JuliaLang / julia

The Julia Programming Language
https://julialang.org/
MIT License
45.81k stars 5.49k forks source link

Cannot use DifferentialEquations on Mac M2 - ARM chip #50382

Closed tpresser570 closed 1 year ago

tpresser570 commented 1 year ago

Cannot precompile DifferentialEquations.jl on mac m2. Have never seen this error before when loading and looks like its a problem with array handling wthin Sundials. Maybe CpuID? since that does not compile either for ARM chips? Attached a screenshot of output below and versioninfo().

Calling:

julia> using DifferentialEquations

Returns:

[ Info: Precompiling DifferentialEquations [0c46a032-eb83-5123-abaf-570d42b7fbaa]
WARNING: Method definition adapt_storage(Type{var"#s1"} where var"#s1"<:(StaticArraysCore.SArray{S, T, N, L} where L where N where T), Array{T, N} where N where T) where {S} in module AdaptStaticArraysExt at /Users/.julia/packages/Adapt/xviDc/ext/AdaptStaticArraysExt.jl:6 overwritten in module ArrayInterfaceStaticArraysCore at /Users/.julia/packages/ArrayInterfaceStaticArraysCore/4vyfn/src/ArrayInterfaceStaticArraysCore.jl:31.
  ** incremental compilation may be fatally broken for this module **

WARNING: Method definition adapt_storage(Type{var"#s1"} where var"#s1"<:(StaticArraysCore.SArray{S, T, N, L} where L where N where T), Array{T, N} where N where T) where {S} in module AdaptStaticArraysExt at /Users/.julia/packages/Adapt/xviDc/ext/AdaptStaticArraysExt.jl:6 overwritten in module ArrayInterfaceStaticArraysCore at /Users/.julia/packages/ArrayInterfaceStaticArraysCore/4vyfn/src/ArrayInterfaceStaticArraysCore.jl:31.
  ** incremental compilation may be fatally broken for this module **

ERROR: LoadError: UndefVarError: `libsundials_cvode` not defined
Stacktrace:
 [1] top-level scope
   @ ~/.julia/packages/Sundials/4gP3E/src/Sundials.jl:50
 [2] include
   @ ./Base.jl:457 [inlined]
 [3] 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::String)
   @ Base ./loading.jl:2045
 [4] top-level scope
   @ stdin:3
in expression starting at /Users/tylerpresser/.julia/packages/Sundials/4gP3E/src/Sundials.jl:3
in expression starting at stdin:3
ERROR: LoadError: Failed to precompile Sundials [c3572dad-4567-51f8-b174-8c6c989267f4] to "/Users/tylerpresser/.julia/compiled/v1.9/Sundials/jl_S2Owcx".
Stacktrace:
  [1] error(s::String)
    @ Base ./error.jl:35
  [2] compilecache(pkg::Base.PkgId, path::String, internal_stderr::IO, internal_stdout::IO, keep_loaded_modules::Bool)
    @ Base ./loading.jl:2296
  [3] compilecache
    @ ./loading.jl:2163 [inlined]
  [4] _require(pkg::Base.PkgId, env::String)
    @ Base ./loading.jl:1805
  [5] _require_prelocked(uuidkey::Base.PkgId, env::String)
    @ Base ./loading.jl:1660
  [6] macro expansion
    @ ./loading.jl:1648 [inlined]
  [7] macro expansion
    @ ./lock.jl:267 [inlined]
  [8] require(into::Module, mod::Symbol)
    @ Base ./loading.jl:1611
  [9] include
    @ ./Base.jl:457 [inlined]
 [10] 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:2045
 [11] top-level scope
    @ stdin:3
in expression starting at /Users/tylerpresser/.julia/packages/DifferentialEquations/yS3VA/src/DifferentialEquations.jl:1
in expression starting at stdin:3
ERROR: Failed to precompile DifferentialEquations [0c46a032-eb83-5123-abaf-570d42b7fbaa] to "/Users/.julia/compiled/v1.9/DifferentialEquations/jl_sPD2Yv".
Stacktrace:
  [1] error(s::String)
    @ Base ./error.jl:35
  [2] compilecache(pkg::Base.PkgId, path::String, internal_stderr::IO, internal_stdout::IO, keep_loaded_modules::Bool)
    @ Base ./loading.jl:2296
  [3] compilecache
    @ ./loading.jl:2163 [inlined]
  [4] _require(pkg::Base.PkgId, env::String)
    @ Base ./loading.jl:1805
  [5] _require_prelocked(uuidkey::Base.PkgId, env::String)
    @ Base ./loading.jl:1660
  [6] macro expansion
    @ ./loading.jl:1648 [inlined]
  [7] macro expansion
    @ ./lock.jl:267 [inlined]
  [8] require(into::Module, mod::Symbol)
    @ Base ./loading.jl:1611
  [9] eval
    @ ./boot.jl:370 [inlined]
 [10] eval
    @ ./Base.jl:68 [inlined]
 [11] repleval(m::Module, code::Expr, #unused#::String)
    @ VSCodeServer ~/.vscode/extensions/julialang.language-julia-1.47.2/scripts/packages/VSCodeServer/src/repl.jl:222
 [12] (::VSCodeServer.var"#107#109"{Module, Expr, REPL.LineEditREPL, REPL.LineEdit.Prompt})()
    @ VSCodeServer ~/.vscode/extensions/julialang.language-julia-1.47.2/scripts/packages/VSCodeServer/src/repl.jl:186
 [13] with_logstate(f::Function, logstate::Any)
    @ Base.CoreLogging ./logging.jl:514
 [14] with_logger
    @ ./logging.jl:626 [inlined]
 [15] (::VSCodeServer.var"#106#108"{Module, Expr, REPL.LineEditREPL, REPL.LineEdit.Prompt})()
    @ VSCodeServer ~/.vscode/extensions/julialang.language-julia-1.47.2/scripts/packages/VSCodeServer/src/repl.jl:187
 [16] #invokelatest#2
    @ ./essentials.jl:816 [inlined]
 [17] invokelatest(::Any)
    @ Base ./essentials.jl:813
 [18] macro expansion
    @ ~/.vscode/extensions/julialang.language-julia-1.47.2/scripts/packages/VSCodeServer/src/eval.jl:34 [inlined]
 [19] (::VSCodeServer.var"#61#62")()
    @ VSCodeServer ./task.jl:514

calling versioninfo():

Julia> versioninfo()
Julia Version 1.9.1
Commit 147bdf428cd (2023-06-07 08:27 UTC)
Platform Info:
  OS: macOS (arm64-apple-darwin22.4.0)
  CPU: 10 × Apple M2 Pro
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-14.0.6 (ORCJIT, apple-m1)
  Threads: 1 on 6 virtual cores
Environment:
  JULIA_EDITOR = code
  JULIA_NUM_THREADS = 
oscardssmith commented 1 year ago

the screenshot seems but to be attached

tpresser570 commented 1 year ago

@oscardssmith screenshot attached now

oscardssmith commented 1 year ago

can you paste the full stacktrace of the error you get on using? the screenshot appears to be cutting off what the actual error is

tpresser570 commented 1 year ago

can you paste the full stacktrace of the error you get on using? the screenshot appears to be cutting off what the actual error is

Sorry about that, @oscardssmith, full stacktrace included now

oscardssmith commented 1 year ago

Thanks!

giordano commented 1 year ago

As a general remark it's much better to copy-and-paste error messages (and format them as code with triple backticks):

tpresser570 commented 1 year ago

As a general remark it's much better to copy-and-paste error messages (and format them as code with triple backticks):

  • it's more readable than a screenshot anyway
  • screenshots aren't searchable, people having your same problem won't be able to find this page by googling the same error message.

fixed

giordano commented 1 year ago

That's much better, thanks.

This isn't a problem in Julia itself, but in third-party packages. Anyway, what's the output of

]st -m DifferentialEquations Sundials Sundials_jll

in your environment?

tpresser570 commented 1 year ago

calling: ]st -m DifferentialEquations Sundials Sundials_jll

returns:

Status `~/Documents/GitHub/LambAIrt/Manifest.toml`
⌃ [0c46a032] DifferentialEquations v7.6.0
⌃ [c3572dad] Sundials v4.15.1
⌃ [fb77eaff] Sundials_jll v5.2.0+1
Info Packages marked with ⌃ have new versions available and may be upgradable.
giordano commented 1 year ago

You're using an old version of Sundials_jll. Update it to v5.2.1.