Encountering Precompilation Error Messages When Adding NeuralPDE Package in Julia

I’m currently working on a Julia project where I need to use the NeuralPDE package. However, when I try to add and precompile this package, I’m encountering several error messages related to dependencies. Here’s a summary of what happens during the precompilation process:

Precompiling project…
✗ NonlinearSolve
✗ OrdinaryDiffEq
✗ StochasticDiffEq
✗ ModelingToolkit
✗ AdvancedHMC → AdvancedHMCOrdinaryDiffEqExt
✗ Optimization → OptimizationMTKExt
✗ NeuralPDE
0 dependencies successfully precompiled in 56 seconds. 333 already precompiled.
7 dependencies errored.
For a report of the errors see julia> err. To retry use pkg> precompile

julia> err:

err
PkgPrecompileError: The following 1 direct dependency failed to precompile:

NeuralPDE [315f7962-48a3-4962-8226-d0f33b1235f0]

Failed to precompile NeuralPDE [315f7962-48a3-4962-8226-d0f33b1235f0] to “/home/edward/.julia/compiled/v1.10/NeuralPDE/jl_afTPE5”.
ERROR: LoadError: Invalid Tag object:
Expected ForwardDiff.Tag{NonlinearSolve.JacobianWrapper{true, SciMLBase.NonlinearFunction{true, SciMLBase.FullSpecialize, NonlinearSolve.var"#53#55", LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED_NO_TIME), Nothing, Nothing, Nothing}, Vector{Float32}}, Float32},
Observed ForwardDiff.Tag{Bool, Float32}.
Stacktrace:
[1] checktag(::Type{ForwardDiff.Tag{Bool, Float32}}, f::NonlinearSolve.JacobianWrapper{true, SciMLBase.NonlinearFunction{true, SciMLBase.FullSpecialize, NonlinearSolve.var"#53#55", LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED_NO_TIME), Nothing, Nothing, Nothing}, Vector{Float32}}, x::Vector{Float32})
@ ForwardDiff ~/.julia/packages/ForwardDiff/PcZ48/src/config.jl:34
[2] jacobian!(result::Matrix{Float32}, f!::Function, y::Vector{Float32}, x::Vector{Float32}, cfg::ForwardDiff.JacobianConfig{ForwardDiff.Tag{Bool, Float32}, Float32, 1, Tuple{Vector{ForwardDiff.Dual{ForwardDiff.Tag{Bool, Float32}, Float32, 1}}, Vector{ForwardDiff.Dual{ForwardDiff.Tag{Bool, Float32}, Float32, 1}}}}, ::Val{true})
@ ForwardDiff ~/.julia/packages/ForwardDiff/PcZ48/src/jacobian.jl:76
[3] jacobian!(result::Matrix{Float32}, f!::Function, y::Vector{Float32}, x::Vector{Float32}, cfg::ForwardDiff.JacobianConfig{ForwardDiff.Tag{Bool, Float32}, Float32, 1, Tuple{Vector{ForwardDiff.Dual{ForwardDiff.Tag{Bool, Float32}, Float32, 1}}, Vector{ForwardDiff.Dual{ForwardDiff.Tag{Bool, Float32}, Float32, 1}}}})
@ ForwardDiff ~/.julia/packages/ForwardDiff/PcZ48/src/jacobian.jl:76
[4] sparse_jacobian!(J::Matrix{Float32}, ::ADTypes.AutoForwardDiff{0, Bool}, cache::SparseDiffTools.ForwardDiffJacobianCache{SparseDiffTools.NoMatrixColoring, ForwardDiff.JacobianConfig{ForwardDiff.Tag{Bool, Float32}, Float32, 1, Tuple{Vector{ForwardDiff.Dual{ForwardDiff.Tag{Bool, Float32}, Float32, 1}}, Vector{ForwardDiff.Dual{ForwardDiff.Tag{Bool, Float32}, Float32, 1}}}}, Nothing, Vector{Float32}, Vector{Float32}}, f!::NonlinearSolve.JacobianWrapper{true, SciMLBase.NonlinearFunction{true, SciMLBase.FullSpecialize, NonlinearSolve.var"#53#55", LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED_NO_TIME), Nothing, Nothing, Nothing}, Vector{Float32}}, fx::Vector{Float32}, x::Vector{Float32})
@ SparseDiffTools ~/.julia/packages/SparseDiffTools/CsonI/src/highlevel/forward_mode.jl:70
[5] jacobian!!(J::Matrix{Float32}, cache::NonlinearSolve.NewtonRaphsonCache{true, SciMLBase.NonlinearFunction{true, SciMLBase.FullSpecialize, NonlinearSolve.var"#53#55", LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED_NO_TIME), Nothing, Nothing, Nothing}, NonlinearSolve.NewtonRaphson{nothing, ADTypes.AutoForwardDiff{0, Bool}, Nothing, typeof(NonlinearSolve.DEFAULT_PRECS), NonlinearSolve.LineSearch{LineSearches.Static, ADTypes.AutoFiniteDiff{Val{:forward}, Val{:forward}, Val{:hcentral}}, Bool}}, Vector{Float32}, Vector{Float32}, Vector{Float32}, Vector{Float32}, Vector{Float32}, NonlinearSolve.JacobianWrapper{true, SciMLBase.NonlinearFunction{true, SciMLBase.FullSpecialize, NonlinearSolve.var"#53#55", LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED_NO_TIME), Nothing, Nothing, Nothing}, Vector{Float32}}, LinearSolve.LinearCache{Matrix{Float32}, Vector{Float32}, Vector{Float32}, SciMLBase.NullParameters, LinearSolve.DefaultLinearSolver, LinearSolve.DefaultLinearSolverInit{LinearAlgebra.LU{Float32, Matrix{Float32}, Vector{Int64}}, LinearAlgebra.QRCompactWY{Float32, Matrix{Float32}, Matrix{Float32}}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, LinearAlgebra.LU{Float32, Matrix{Float32}, Vector{Int64}}, Tuple{LinearAlgebra.LU{Float32, Matrix{Float32}, Vector{Int64}}, Vector{Int64}}, Nothing, Nothing, Nothing, LinearAlgebra.SVD{Float32, Float32, Matrix{Float32}, Vector{Float32}}, LinearAlgebra.Cholesky{Float32, Matrix{Float32}}, LinearAlgebra.Cholesky{Float32, Matrix{Float32}}, Tuple{LinearAlgebra.LU{Float64, Matrix{Float64}, Vector{Int32}}, Base.RefValue{Int32}}, Tuple{LinearAlgebra.LU{Float64, Matrix{Float64}, Vector{Int64}}, Base.RefValue{Int64}}, LinearAlgebra.QRPivoted{Float32, Matrix{Float32}, Vector{Float32}, Vector{Int64}}}, LinearSolve.InvPreconditioner{LinearAlgebra.Diagonal{Float32, Vector{Float32}}}, LinearAlgebra.Diagonal{Float32, Vector{Float32}}, Float32, Bool}, Matrix{Float32}, SparseDiffTools.ForwardDiffJacobianCache{SparseDiffTools.NoMatrixColoring, ForwardDiff.JacobianConfig{ForwardDiff.Tag{Bool, Float32}, Float32, 1, Tuple{Vector{ForwardDiff.Dual{ForwardDiff.Tag{Bool, Float32}, Float32, 1}}, Vector{ForwardDiff.Dual{ForwardDiff.Tag{Bool, Float32}, Float32, 1}}}}, Nothing, Vector{Float32}, Vector{Float32}}, Bool, typeof(NonlinearSolve.DEFAULT_NORM), Float32, SciMLBase.NonlinearProblem{Vector{Float32}, true, Vector{Float32}, SciMLBase.NonlinearFunction{true, SciMLBase.FullSpecialize, NonlinearSolve.var"#53#55", LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED_NO_TIME), Nothing, Nothing, Nothing}, @Kwargs{}, SciMLBase.StandardNonlinearProblem}, NonlinearSolve.LineSearchCache{NonlinearSolve.var"#eval_f#18"{Vector{Float32}, SciMLBase.NonlinearFunction{true, SciMLBase.FullSpecialize, NonlinearSolve.var"#53#55", LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED_NO_TIME), Nothing, Nothing, Nothing}, Vector{Float32}, Val{true}, Vector{Float32}}, Nothing, Nothing, Nothing, Float32, NonlinearSolve.LineSearch{LineSearches.Static, ADTypes.AutoFiniteDiff{Val{:forward}, Val{:forward}, Val{:hcentral}}, Bool}}})
@ NonlinearSolve ~/.julia/packages/NonlinearSolve/6NIAV/src/jacobian.jl:40
[6] perform_step!(cache::NonlinearSolve.NewtonRaphsonCache{true, SciMLBase.NonlinearFunction{true, SciMLBase.FullSpecialize, NonlinearSolve.var"#53#55", LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED_NO_TIME), Nothing, Nothing, Nothing}, NonlinearSolve.NewtonRaphson{nothing, ADTypes.AutoForwardDiff{0, Bool}, Nothing, typeof(NonlinearSolve.DEFAULT_PRECS), NonlinearSolve.LineSearch{LineSearches.Static, ADTypes.AutoFiniteDiff{Val{:forward}, Val{:forward}, Val{:hcentral}}, Bool}}, Vector{Float32}, Vector{Float32}, Vector{Float32}, Vector{Float32}, Vector{Float32}, NonlinearSolve.JacobianWrapper{true, SciMLBase.NonlinearFunction{true, SciMLBase.FullSpecialize, NonlinearSolve.var"#53#55", LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED_NO_TIME), Nothing, Nothing, Nothing}, Vector{Float32}}, LinearSolve.LinearCache{Matrix{Float32}, Vector{Float32}, Vector{Float32}, SciMLBase.NullParameters, LinearSolve.DefaultLinearSolver, LinearSolve.DefaultLinearSolverInit{LinearAlgebra.LU{Float32, Matrix{Float32}, Vector{Int64}}, LinearAlgebra.QRCompactWY{Float32, Matrix{Float32}, Matrix{Float32}}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, LinearAlgebra.LU{Float32, Matrix{Float32}, Vector{Int64}}, Tuple{LinearAlgebra.LU{Float32, Matrix{Float32}, Vector{Int64}}, Vector{Int64}}, Nothing, Nothing, Nothing, LinearAlgebra.SVD{Float32, Float32, Matrix{Float32}, Vector{Float32}}, LinearAlgebra.Cholesky{Float32, Matrix{Float32}}, LinearAlgebra.Cholesky{Float32, Matrix{Float32}}, Tuple{LinearAlgebra.LU{Float64, Matrix{Float64}, Vector{Int32}}, Base.RefValue{Int32}}, Tuple{LinearAlgebra.LU{Float64, Matrix{Float64}, Vector{Int64}}, Base.RefValue{Int64}}, LinearAlgebra.QRPivoted{Float32, Matrix{Float32}, Vector{Float32}, Vector{Int64}}}, LinearSolve.InvPreconditioner{LinearAlgebra.Diagonal{Float32, Vector{Float32}}}, LinearAlgebra.Diagonal{Float32, Vector{Float32}}, Float32, Bool}, Matrix{Float32}, SparseDiffTools.ForwardDiffJacobianCache{SparseDiffTools.NoMatrixColoring, ForwardDiff.JacobianConfig{ForwardDiff.Tag{Bool, Float32}, Float32, 1, Tuple{Vector{ForwardDiff.Dual{ForwardDiff.Tag{Bool, Float32}, Float32, 1}}, Vector{ForwardDiff.Dual{ForwardDiff.Tag{Bool, Float32}, Float32, 1}}}}, Nothing, Vector{Float32}, Vector{Float32}}, Bool, typeof(NonlinearSolve.DEFAULT_NORM), Float32, SciMLBase.NonlinearProblem{Vector{Float32}, true, Vector{Float32}, SciMLBase.NonlinearFunction{true, SciMLBase.FullSpecialize, NonlinearSolve.var"#53#55", LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED_NO_TIME), Nothing, Nothing, Nothing}, @Kwargs{}, SciMLBase.StandardNonlinearProblem}, NonlinearSolve.LineSearchCache{NonlinearSolve.var"#eval_f#18"{Vector{Float32}, SciMLBase.NonlinearFunction{true, SciMLBase.FullSpecialize, NonlinearSolve.var"#53#55", LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED_NO_TIME), Nothing, Nothing, Nothing}, Vector{Float32}, Val{true}, Vector{Float32}}, Nothing, Nothing, Nothing, Float32, NonlinearSolve.LineSearch{LineSearches.Static, ADTypes.AutoFiniteDiff{Val{:forward}, Val{:forward}, Val{:hcentral}}, Bool}}})
@ NonlinearSolve ~/.julia/packages/NonlinearSolve/6NIAV/src/raphson.jl:88
[7] solve!
@ NonlinearSolve ~/.julia/packages/NonlinearSolve/6NIAV/src/raphson.jl:136 [inlined]
[8] #__solve#1
@ NonlinearSolve ~/.julia/packages/NonlinearSolve/6NIAV/src/NonlinearSolve.jl:34 [inlined]
[9] __solve
@ NonlinearSolve ~/.julia/packages/NonlinearSolve/6NIAV/src/NonlinearSolve.jl:31 [inlined]
[10] #solve_call#34
@ DiffEqBase ~/.julia/packages/DiffEqBase/s433k/src/solve.jl:559 [inlined]
[11] solve_call
@ DiffEqBase ~/.julia/packages/DiffEqBase/s433k/src/solve.jl:529 [inlined]
[12] #solve_up#42
@ DiffEqBase ~/.julia/packages/DiffEqBase/s433k/src/solve.jl:1028 [inlined]
[13] solve_up
@ DiffEqBase ~/.julia/packages/DiffEqBase/s433k/src/solve.jl:993 [inlined]
[14] #solve#41
@ DiffEqBase ~/.julia/packages/DiffEqBase/s433k/src/solve.jl:987 [inlined]
[15] macro expansion
@ ~/.julia/packages/NonlinearSolve/6NIAV/src/NonlinearSolve.jl:61 [inlined]
[16] macro expansion
@ ~/.julia/packages/PrecompileTools/kmH5L/src/workloads.jl:78 [inlined]
[17] top-level scope
@ ~/.julia/packages/NonlinearSolve/6NIAV/src/NonlinearSolve.jl:48
[18] include
@ Base ./Base.jl:495 [inlined]
[19] 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:2216
[20] top-level scope
@ stdin:3
in expression starting at /home/edward/.julia/packages/NonlinearSolve/6NIAV/src/NonlinearSolve.jl:1
in expression starting at stdin:3
ERROR: LoadError: Failed to precompile NonlinearSolve [8913a72c-1f9b-4ce2-8d82-65094dcecaec] to “/home/edward/.julia/compiled/v1.10/NonlinearSolve/jl_doA7Aj”.
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:2462
[3] compilecache
@ Base ./loading.jl:2334 [inlined]
[4] (::Base.var"#968#969"{Base.PkgId})()
@ Base ./loading.jl:1968
[5] mkpidlock(f::Base.var"#968#969"{Base.PkgId}, at::String, pid::Int32; kwopts::@Kwargs{stale_age::Int64, wait::Bool})
@ FileWatching.Pidfile ~/.julia/juliaup/julia-1.10.0+0.x64.linux.gnu/share/julia/stdlib/v1.10/FileWatching/src/pidfile.jl:93
[6] #mkpidlock#6
@ FileWatching.Pidfile ~/.julia/juliaup/julia-1.10.0+0.x64.linux.gnu/share/julia/stdlib/v1.10/FileWatching/src/pidfile.jl:88 [inlined]
[7] trymkpidlock(::Function, ::Vararg{Any}; kwargs::@Kwargs{stale_age::Int64})
@ FileWatching.Pidfile ~/.julia/juliaup/julia-1.10.0+0.x64.linux.gnu/share/julia/stdlib/v1.10/FileWatching/src/pidfile.jl:111
[8] #invokelatest#2
@ Base ./essentials.jl:889 [inlined]
[9] invokelatest
@ Base ./essentials.jl:884 [inlined]
[10] maybe_cachefile_lock(f::Base.var"#968#969"{Base.PkgId}, pkg::Base.PkgId, srcpath::String; stale_age::Int64)
@ Base ./loading.jl:2977
[11] maybe_cachefile_lock
@ Base ./loading.jl:2974 [inlined]
[12] _require(pkg::Base.PkgId, env::String)
@ Base ./loading.jl:1964
[13] __require_prelocked(uuidkey::Base.PkgId, env::String)
@ Base ./loading.jl:1806
[14] #invoke_in_world#3
@ Base ./essentials.jl:921 [inlined]
[15] invoke_in_world
@ Base ./essentials.jl:918 [inlined]
[16] _require_prelocked(uuidkey::Base.PkgId, env::String)
@ Base ./loading.jl:1797
[17] macro expansion
@ Base ./loading.jl:1784 [inlined]
[18] macro expansion
@ Base ./lock.jl:267 [inlined]
[19] __require(into::Module, mod::Symbol)
@ Base ./loading.jl:1747
[20] #invoke_in_world#3
@ Base ./essentials.jl:921 [inlined]
[21] invoke_in_world
@ Base ./essentials.jl:918 [inlined]
[22] require(into::Module, mod::Symbol)
@ Base ./loading.jl:1740
[23] include
@ Base ./Base.jl:495 [inlined]
[24] 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:2216
[25] top-level scope
@ stdin:3
in expression starting at /home/edward/.julia/packages/OrdinaryDiffEq/FFFcA/src/OrdinaryDiffEq.jl:1
in expression starting at stdin:3
ERROR: LoadError: Failed to precompile OrdinaryDiffEq [1dea7af3-3e70-54e6-95c3-0bf5283fa5ed] to “/home/edward/.julia/compiled/v1.10/OrdinaryDiffEq/jl_vYV6yK”.
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:2462
[3] compilecache
@ Base ./loading.jl:2334 [inlined]
[4] (::Base.var"#968#969"{Base.PkgId})()
@ Base ./loading.jl:1968
[5] mkpidlock(f::Base.var"#968#969"{Base.PkgId}, at::String, pid::Int32; kwopts::@Kwargs{stale_age::Int64, wait::Bool})
@ FileWatching.Pidfile ~/.julia/juliaup/julia-1.10.0+0.x64.linux.gnu/share/julia/stdlib/v1.10/FileWatching/src/pidfile.jl:93
[6] #mkpidlock#6
@ FileWatching.Pidfile ~/.julia/juliaup/julia-1.10.0+0.x64.linux.gnu/share/julia/stdlib/v1.10/FileWatching/src/pidfile.jl:88 [inlined]
[7] trymkpidlock(::Function, ::Vararg{Any}; kwargs::@Kwargs{stale_age::Int64})
@ FileWatching.Pidfile ~/.julia/juliaup/julia-1.10.0+0.x64.linux.gnu/share/julia/stdlib/v1.10/FileWatching/src/pidfile.jl:111
[8] #invokelatest#2
@ Base ./essentials.jl:889 [inlined]
[9] invokelatest
@ Base ./essentials.jl:884 [inlined]
[10] maybe_cachefile_lock(f::Base.var"#968#969"{Base.PkgId}, pkg::Base.PkgId, srcpath::String; stale_age::Int64)
@ Base ./loading.jl:2977
[11] maybe_cachefile_lock
@ Base ./loading.jl:2974 [inlined]
[12] _require(pkg::Base.PkgId, env::String)
@ Base ./loading.jl:1964
[13] __require_prelocked(uuidkey::Base.PkgId, env::String)
@ Base ./loading.jl:1806
[14] #invoke_in_world#3
@ Base ./essentials.jl:921 [inlined]
[15] invoke_in_world
@ Base ./essentials.jl:918 [inlined]
[16] _require_prelocked(uuidkey::Base.PkgId, env::String)
@ Base ./loading.jl:1797
[17] macro expansion
@ Base ./loading.jl:1784 [inlined]
[18] macro expansion
@ Base ./lock.jl:267 [inlined]
[19] __require(into::Module, mod::Symbol)
@ Base ./loading.jl:1747
[20] #invoke_in_world#3
@ Base ./essentials.jl:921 [inlined]
[21] invoke_in_world
@ Base ./essentials.jl:918 [inlined]
[22] require(into::Module, mod::Symbol)
@ Base ./loading.jl:1740
[23] include(mod::Module, _path::String)
@ Base ./Base.jl:495
[24] include(x::String)
@ ModelingToolkit ~/.julia/packages/ModelingToolkit/BsHty/src/ModelingToolkit.jl:4
[25] top-level scope
@ ~/.julia/packages/ModelingToolkit/BsHty/src/ModelingToolkit.jl:128
[26] include
@ Base ./Base.jl:495 [inlined]
[27] 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:2216
[28] top-level scope
@ stdin:3
in expression starting at /home/edward/.julia/packages/ModelingToolkit/BsHty/src/systems/abstractsystem.jl:1
in expression starting at /home/edward/.julia/packages/ModelingToolkit/BsHty/src/ModelingToolkit.jl:1
in expression starting at stdin:3
ERROR: LoadError: Failed to precompile ModelingToolkit [961ee093-0014-501f-94e3-6117800e7a78] to “/home/edward/.julia/compiled/v1.10/ModelingToolkit/jl_2Uzo9H”.
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:2462
[3] compilecache
@ Base ./loading.jl:2334 [inlined]
[4] (::Base.var"#968#969"{Base.PkgId})()
@ Base ./loading.jl:1968
[5] mkpidlock(f::Base.var"#968#969"{Base.PkgId}, at::String, pid::Int32; kwopts::@Kwargs{stale_age::Int64, wait::Bool})
@ FileWatching.Pidfile ~/.julia/juliaup/julia-1.10.0+0.x64.linux.gnu/share/julia/stdlib/v1.10/FileWatching/src/pidfile.jl:93
[6] #mkpidlock#6
@ FileWatching.Pidfile ~/.julia/juliaup/julia-1.10.0+0.x64.linux.gnu/share/julia/stdlib/v1.10/FileWatching/src/pidfile.jl:88 [inlined]
[7] trymkpidlock(::Function, ::Vararg{Any}; kwargs::@Kwargs{stale_age::Int64})
@ FileWatching.Pidfile ~/.julia/juliaup/julia-1.10.0+0.x64.linux.gnu/share/julia/stdlib/v1.10/FileWatching/src/pidfile.jl:111
[8] #invokelatest#2
@ Base ./essentials.jl:889 [inlined]
[9] invokelatest
@ Base ./essentials.jl:884 [inlined]
[10] maybe_cachefile_lock(f::Base.var"#968#969"{Base.PkgId}, pkg::Base.PkgId, srcpath::String; stale_age::Int64)
@ Base ./loading.jl:2977
[11] maybe_cachefile_lock
@ Base ./loading.jl:2974 [inlined]
[12] _require(pkg::Base.PkgId, env::String)
@ Base ./loading.jl:1964
[13] __require_prelocked(uuidkey::Base.PkgId, env::String)
@ Base ./loading.jl:1806
[14] #invoke_in_world#3
@ Base ./essentials.jl:921 [inlined]
[15] invoke_in_world
@ Base ./essentials.jl:918 [inlined]
[16] _require_prelocked(uuidkey::Base.PkgId, env::String)
@ Base ./loading.jl:1797
[17] macro expansion
@ Base ./loading.jl:1784 [inlined]
[18] macro expansion
@ Base ./lock.jl:267 [inlined]
[19] __require(into::Module, mod::Symbol)
@ Base ./loading.jl:1747
[20] #invoke_in_world#3
@ Base ./essentials.jl:921 [inlined]
[21] invoke_in_world
@ Base ./essentials.jl:918 [inlined]
[22] require(into::Module, mod::Symbol)
@ Base ./loading.jl:1740
[23] include
@ Base ./Base.jl:495 [inlined]
[24] 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:2216
[25] top-level scope
@ stdin:3
in expression starting at /home/ed

I would appreciate any guidance or suggestions on how to resolve these precompilation errors. Has anyone else experienced similar issues with NeuralPDE or its dependencies? Any help in troubleshooting this would be greatly appreciated.

Thank you in advance!

Solution: Older versions might be more compatible with certain packages or legacy code.

You have very many packages installed in a single environment. This increases the likelihood of conflicting packages with distinct compatibilities.

If possible try to separate individual tasks into separate projects. For this task, try creating a new shared project

using Pkg
pkg"activate @neuralpde"
pkg"add NeuralPDE"

Next time you want to use NeuralPDE, do

using Pkg
pkg"activate @neuralpde"

There are on-going updates to get this package working with latest dependency versions and Julia v1.10. You can track this in build: compat bumps to latest versions by sathvikbhagavan · Pull Request #783 · SciML/NeuralPDE.jl · GitHub