JuliaMolSim / Molly.jl

Molecular simulation in Julia
Other
371 stars 51 forks source link

Precompilation error due to zygote.jl #117

Closed Geophyte closed 1 year ago

Geophyte commented 1 year ago

The error might be on my side because I am new to Julia, but the following line has worked for me thus far and in the case of Molly it produces an error:

julia> import Pkg; Pkg.add("Molly");
ERROR: LoadError: UndefVarError: dualize not defined
Stacktrace:       
 [1] include(mod::Module, _path::String)
   @ Base .\Base.jl:419
 [2] include(x::String)
   @ Molly C:\Users\idab\.julia\packages\Molly\6TwMF\src\Molly.jl:1
 [3] top-level scope
   @ C:\Users\idab\.julia\packages\Molly\6TwMF\src\Molly.jl:62     
 [4] include
   @ .\Base.jl:419 [inlined]
 [5] 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, UInt64}}, source::String)
   @ Base .\loading.jl:1554
 [6] top-level scope
   @ stdin:1
in expression starting at C:\Users\idab\.julia\packages\Molly\6TwMF\src\zygote.jl:5
in expression starting at C:\Users\idab\.julia\packages\Molly\6TwMF\src\Molly.jl:1
in expression starting at stdin:1
ERROR: Failed to precompile Molly [aa0f7f06-fcc0-5ec4-a7f3-a573f33f9c4c] to C:\Users\idab\.julia\compiled\v1.8\Molly\jl_985.tmp.
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:1707
  [3] compilecache
    @ .\loading.jl:1651 [inlined]
  [4] _require(pkg::Base.PkgId)
    @ Base .\loading.jl:1337
  [5] _require_prelocked(uuidkey::Base.PkgId)
    @ Base .\loading.jl:1200
  [6] macro expansion
    @ .\loading.jl:1180 [inlined]
  [7] macro expansion
    @ .\lock.jl:223 [inlined]
  [8] require(into::Module, mod::Symbol)
    @ Base .\loading.jl:1144
  [9] eval
    @ .\boot.jl:368 [inlined]
 [10] include_string(mapexpr::typeof(REPL.softscope), mod::Module, code::String, filename::String)
    @ Base .\loading.jl:1428
 [11] invokelatest(::Any, ::Any, ::Vararg{Any}; kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
    @ Base .\essentials.jl:729
 [12] invokelatest(::Any, ::Any, ::Vararg{Any})
    @ Base .\essentials.jl:726
 [13] inlineeval(m::Module, code::String, code_line::Int64, code_column::Int64, file::String; softscope::Bool)
    @ VSCodeServer c:\Users\idab\.vscode\extensions\julialang.language-julia-1.38.2\scripts\packages\VSCodeServer\src\eval.jl:233
 [14] (::VSCodeServer.var"#66#70"{Bool, Bool, Bool, Module, String, Int64, Int64, String, VSCodeServer.ReplRunCodeRequestParams})()
    @ VSCodeServer c:\Users\idab\.vscode\extensions\julialang.language-julia-1.38.2\scripts\packages\VSCodeServer\src\eval.jl:157
 [15] withpath(f::VSCodeServer.var"#66#70"{Bool, Bool, Bool, Module, String, Int64, Int64, String, VSCodeServer.ReplRunCodeRequestParams}, path::String)
    @ VSCodeServer c:\Users\idab\.vscode\extensions\julialang.language-julia-1.38.2\scripts\packages\VSCodeServer\src\repl.jl:249
 [16] (::VSCodeServer.var"#65#69"{Bool, Bool, Bool, Module, String, Int64, Int64, String, VSCodeServer.ReplRunCodeRequestParams})()
    @ VSCodeServer c:\Users\idab\.vscode\extensions\julialang.language-julia-1.38.2\scripts\packages\VSCodeServer\src\eval.jl:155
 [17] hideprompt(f::VSCodeServer.var"#65#69"{Bool, Bool, Bool, Module, String, Int64, Int64, String, VSCodeServer.ReplRunCodeRequestParams})
    @ VSCodeServer c:\Users\idab\.vscode\extensions\julialang.language-julia-1.38.2\scripts\packages\VSCodeServer\src\repl.jl:38
 [18] (::VSCodeServer.var"#64#68"{Bool, Bool, Bool, Module, String, Int64, Int64, String, VSCodeServer.ReplRunCodeRequestParams})()
    @ VSCodeServer c:\Users\idab\.vscode\extensions\julialang.language-julia-1.38.2\scripts\packages\VSCodeServer\src\eval.jl:126
 [19] with_logstate(f::Function, logstate::Any)
    @ Base.CoreLogging .\logging.jl:511
 [20] with_logger
    @ .\logging.jl:623 [inlined]
 [21] (::VSCodeServer.var"#63#67"{VSCodeServer.ReplRunCodeRequestParams})()
    @ VSCodeServer c:\Users\idab\.vscode\extensions\julialang.language-julia-1.38.2\scripts\packages\VSCodeServer\src\eval.jl:225
 [22] #invokelatest#2
    @ .\essentials.jl:729 [inlined]
 [23] invokelatest(::Any)
    @ Base .\essentials.jl:726
 [24] macro expansion
    @ c:\Users\idab\.vscode\extensions\julialang.language-julia-1.38.2\scripts\packages\VSCodeServer\src\eval.jl:34 [inlined]
 [25] (::VSCodeServer.var"#61#62")()
    @ VSCodeServer .\task.jl:484

Some additional info:

julia> versioninfo()
Julia Version 1.8.5
Commit 17cfb8e65e (2023-01-08 06:45 UTC)
Platform Info:
  OS: Windows (x86_64-w64-mingw32)
  CPU: 12 × Intel(R) Core(TM) i7-10750H CPU @ 2.60GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-13.0.1 (ORCJIT, skylake)
  Threads: 1 on 12 virtual cores
Environment:
  JULIA_EDITOR = code
jgreener64 commented 1 year ago

Interesting, what package versions do you have (Pkg.status())?

Geophyte commented 1 year ago

It's a fresh Julia install because I broke it while trying to troubleshoot

julia> import Pkg; Pkg.status();
Status `C:\Users\idab\.julia\environments\v1.8\Project.toml`
  [46823bd8] Chemfiles v0.10.3   
  [f6369f11] ForwardDiff v0.10.35
  [aa0f7f06] Molly v0.14.2
jgreener64 commented 1 year ago

Thanks for raising, this is an issue with ForwardDiff v0.10.35 released yesterday. I am working on a fix, in the short term you can add ForwardDiff v0.10.34 to get round this.

jgreener64 commented 1 year ago

Fixed in Molly v0.14.3.