Skip to content

Incompatibility with llvmlite 0.45.0: AttributeError: module 'llvmlite.binding' has no attribute 'PassManagerBuilder' #95

@hanlaur

Description

@hanlaur

Hello and thanks for this magnificent module!

There appears to be a breaking change in llvmlite 0.45.0 that impacts lleaves:

Example error:

    def compile_to_module(
        file_path,
        fblocksize=34,
        finline=True,
        raw_score=False,
        froot_func_name="forest_root",
        use_fp64=True,
    ):
        forest = parse_to_ast(file_path)
        forest.raw_score = raw_score
    
        ir = llvmlite.ir.Module(name="forest")
        gen_forest(forest, ir, fblocksize, froot_func_name, use_fp64)
    
        ir.triple = llvm.get_process_triple()
        module = llvm.parse_assembly(str(ir))
        module.name = str(file_path)
        module.verify()
    
        if os.environ.get("LLEAVES_PRINT_UNOPTIMIZED_IR") == "1":
            print(module)
    
        # Create optimizer
>       pmb = llvm.PassManagerBuilder()
              ^^^^^^^^^^^^^^^^^^^^^^^
E       AttributeError: module 'llvmlite.binding' has no attribute 'PassManagerBuilder'

This can at the moment be solved by pinning llvmlite to 0.44.0, but probably good to handle this in lleaves in future.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions