Skip to content

Precompilation error during installation #2339

@Sophia755

Description

@Sophia755

Hi everybody, I got the following error when installing Enzyme with Pkg.add("Enzyme")

PkgPrecompileError: The following 1 direct dependency failed to precompile:

Enzyme 

Failed to precompile Enzyme [7da242da-08ed-463a-9acd-ee780be4f1d9] to "/home/sophia/.julia/compiled/v1.11/Enzyme/jl_SWud7w".
ERROR: LoadError: Cannot compile MethodInstance for Enzyme.var"##234".f(::Float64) for world 40732; method is only valid in worlds 41031 to 18446744073709551615
Stacktrace:
  [1] error(s::String)
    @ Base ./error.jl:35
  [2] compile_method_instance(job::GPUCompiler.CompilerJob)
    @ GPUCompiler ~/.julia/packages/GPUCompiler/2EcSf/src/jlgen.jl:591
  [3] irgen(job::GPUCompiler.CompilerJob)
    @ GPUCompiler ~/.julia/packages/GPUCompiler/2EcSf/src/irgen.jl:4
  [4] macro expansion
    @ ~/.julia/packages/GPUCompiler/2EcSf/src/driver.jl:171 [inlined]
  [5] emit_llvm(job::GPUCompiler.CompilerJob; kwargs::@Kwargs{libraries::Bool, toplevel::Bool, optimize::Bool, cleanup::Bool, only_entry::Bool, validate::Bool})
    @ GPUCompiler ~/.julia/packages/GPUCompiler/2EcSf/src/utils.jl:110
  [6] emit_llvm
    @ ~/.julia/packages/GPUCompiler/2EcSf/src/utils.jl:108 [inlined]
  [7] codegen(output::Symbol, job::GPUCompiler.CompilerJob{Enzyme.Compiler.EnzymeTarget, Enzyme.Compiler.EnzymeCompilerParams}; libraries::Bool, deferred_codegen::Bool, optimize::Bool, toplevel::Bool, strip::Bool, validate::Bool, only_entry::Bool, parent_job::Nothing)
    @ Enzyme.Compiler ~/.julia/packages/Enzyme/owyQj/src/compiler.jl:3498
  [8] codegen
    @ ~/.julia/packages/Enzyme/owyQj/src/compiler.jl:3441 [inlined]
  [9] _thunk(job::GPUCompiler.CompilerJob{Enzyme.Compiler.EnzymeTarget, Enzyme.Compiler.EnzymeCompilerParams}, postopt::Bool)
    @ Enzyme.Compiler ~/.julia/packages/Enzyme/owyQj/src/compiler.jl:5498
 [10] _thunk
    @ ~/.julia/packages/Enzyme/owyQj/src/compiler.jl:5498 [inlined]
 [11] cached_compilation
    @ ~/.julia/packages/Enzyme/owyQj/src/compiler.jl:5550 [inlined]
 [12] thunkbase(mi::Core.MethodInstance, World::UInt64, FA::Type{<:EnzymeCore.Annotation}, A::Type{<:EnzymeCore.Annotation}, TT::Type, Mode::Enzyme.API.CDerivativeMode, width::Int64, ModifiedBetween::NTuple{N, Bool} where N, ReturnPrimal::Bool, ShadowInit::Bool, ABI::Type, ErrIfFuncWritten::Bool, RuntimeActivity::Bool, edges::Vector{Any})
    @ Enzyme.Compiler ~/.julia/packages/Enzyme/owyQj/src/compiler.jl:5661
 [13] thunk_generator(world::UInt64, source::LineNumberNode, FA::Type, A::Type, TT::Type, Mode::Enzyme.API.CDerivativeMode, Width::Int64, ModifiedBetween::NTuple{N, Bool} where N, ReturnPrimal::Bool, ShadowInit::Bool, ABI::Type, ErrIfFuncWritten::Bool, RuntimeActivity::Bool, self::Any, fakeworld::Any, fa::Type, a::Type, tt::Type, mode::Type, width::Type, modifiedbetween::Type, returnprimal::Type, shadowinit::Type, abi::Type, erriffuncwritten::Type, runtimeactivity::Type)
    @ Enzyme.Compiler ~/.julia/packages/Enzyme/owyQj/src/compiler.jl:5846
 [14] autodiff
    @ ~/.julia/packages/Enzyme/owyQj/src/Enzyme.jl:485 [inlined]
 [15] autodiff
    @ ~/.julia/packages/Enzyme/owyQj/src/Enzyme.jl:544 [inlined]
 [16] autodiff(mode::EnzymeCore.ReverseMode{false, false, EnzymeCore.FFIABI, false, false}, f::typeof(Enzyme.var"##234".f), args::EnzymeCore.Active{Float64})
    @ Enzyme ~/.julia/packages/Enzyme/owyQj/src/Enzyme.jl:516
 [17] macro expansion
    @ ~/.julia/packages/Enzyme/owyQj/src/precompile.jl:11 [inlined]
 [18] macro expansion
    @ ~/.julia/packages/PrecompileTools/L8A3n/src/workloads.jl:78 [inlined]
 [19] macro expansion
    @ ~/.julia/packages/Enzyme/owyQj/src/precompile.jl:10 [inlined]
 [20] macro expansion
    @ ~/.julia/packages/PrecompileTools/L8A3n/src/workloads.jl:140 [inlined]
 [21] top-level scope
    @ ~/.julia/packages/Enzyme/owyQj/src/precompile.jl:139
 [22] include(mod::Module, _path::String)
    @ Base ./Base.jl:557
 [23] include(x::String)
    @ Enzyme ~/.julia/packages/Enzyme/owyQj/src/Enzyme.jl:1
 [24] top-level scope
    @ ~/.julia/packages/Enzyme/owyQj/src/Enzyme.jl:1521
 [25] include
    @ ./Base.jl:557 [inlined]
 [26] include_package_for_output(pkg::Base.PkgId, input::String, depot_path::Vector{String}, dl_load_path::Vector{String}, load_path::Vector{String}, concrete_deps::Vector{Pair{Base.PkgId, UInt128}}, source::Nothing)
    @ Base ./loading.jl:2881
 [27] top-level scope
    @ stdin:6
in expression starting at /home/sophia/.julia/packages/Enzyme/owyQj/src/precompile.jl:3
in expression starting at /home/sophia/.julia/packages/Enzyme/owyQj/src/Enzyme.jl:1
in expression starting at stdin:

I created a fresh environment and deleted the .julia folder. So there shouldn't be any conflicting packages.
Version Infos:

Julia Version 1.11.4
Commit 8561cc3d68d (2025-03-10 11:36 UTC)
Build Info:
  Official https://julialang.org/ release
Platform Info:
  OS: Linux (x86_64-linux-gnu)
  CPU: 8 × Intel(R) Core(TM) i7-8550U CPU @ 1.80GHz
  WORD_SIZE: 64
  LLVM: libLLVM-16.0.6 (ORCJIT, skylake)
Threads: 1 default, 0 interactive, 1 GC (on 8 virtual cores)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions