Failed to precompile DifferentialEquations

I am trying to run the sample code given here. The code here on Differential Equations

using DifferentialEquations, Flux, Optim, DiffEqFlux, Plots

u0 = [1.0,1.0]
tstart=0.0
tend=10.0
sampling=0.1

model_params= [1.5,1.0,3.0,1.0]

function model(du,u,p,t)
x, y = u
a, b, c, d = p
du[1] = dx = ax - bxy
du[2] = dy = -c
y + dxy
end

generates the following error

┌ Info: Precompiling DifferentialEquations [0c46a032-eb83-5123-abaf-570d42b7fbaa]
└ @ Base loading.jl:1192
WARNING: Method definition vec(Number) in module FiniteDiff at /home/biplav/.julia/packages/FiniteDiff/EBys0/src/jacobians.jl:128 overwritten in module DiffEqDiffTools at /home/biplav/.julia/packages/DiffEqDiffTools/uD0fb/src/jacobians.jl:114.
ERROR: LoadError: LoadError: syntax: incomplete: premature end of input
Stacktrace:
[1] include at ./boot.jl:317 [inlined]
[2] include_relative(::Module, ::String) at ./loading.jl:1044
[3] include at ./sysimg.jl:29 [inlined]
[4] include(::String) at /home/biplav/.julia/packages/OrdinaryDiffEq/8Pn99/src/OrdinaryDiffEq.jl:1
[5] top-level scope at none:0
[6] include at ./boot.jl:317 [inlined]
[7] include_relative(::Module, ::String) at ./loading.jl:1044
[8] include(::Module, ::String) at ./sysimg.jl:29
[9] top-level scope at none:2
[10] eval at ./boot.jl:319 [inlined]
[11] eval(::Expr) at ./client.jl:393
[12] top-level scope at ./none:3
in expression starting at /home/biplav/.julia/packages/OrdinaryDiffEq/8Pn99/src/tableaus/rkc_tableaus.jl:12393
in expression starting at /home/biplav/.julia/packages/OrdinaryDiffEq/8Pn99/src/OrdinaryDiffEq.jl:106
ERROR: LoadError: Failed to precompile OrdinaryDiffEq [1dea7af3-3e70-54e6-95c3-0bf5283fa5ed] to /home/biplav/.julia/compiled/v1.0/OrdinaryDiffEq/DlSvy.ji.
Stacktrace:
[1] error(::String) at ./error.jl:33
[2] compilecache(::Base.PkgId, ::String) at ./loading.jl:1203
[3] _require(::Base.PkgId) at ./loading.jl:960
[4] require(::Base.PkgId) at ./loading.jl:858
[5] require(::Module, ::Symbol) at ./loading.jl:853
[6] include at ./boot.jl:317 [inlined]
[7] include_relative(::Module, ::String) at ./loading.jl:1044
[8] include(::Module, ::String) at ./sysimg.jl:29
[9] top-level scope at none:2
[10] eval at ./boot.jl:319 [inlined]
[11] eval(::Expr) at ./client.jl:393
[12] top-level scope at ./none:3
in expression starting at /home/biplav/.julia/packages/DiffEqCallbacks/b4ahb/src/DiffEqCallbacks.jl:10
ERROR: LoadError: Failed to precompile DiffEqCallbacks [459566f4-90b8-5000-8ac3-15dfb0a30def] to /home/biplav/.julia/compiled/v1.0/DiffEqCallbacks/TKs5l.ji.
Stacktrace:
[1] error(::String) at ./error.jl:33
[2] compilecache(::Base.PkgId, ::String) at ./loading.jl:1203
[3] _require(::Base.PkgId) at ./loading.jl:960
[4] require(::Base.PkgId) at ./loading.jl:858
[5] require(::Module, ::Symbol) at ./loading.jl:853
[6] include at ./boot.jl:317 [inlined]
[7] include_relative(::Module, ::String) at ./loading.jl:1044
[8] include(::Module, ::String) at ./sysimg.jl:29
[9] top-level scope at none:2
[10] eval at ./boot.jl:319 [inlined]
[11] eval(::Expr) at ./client.jl:393
[12] top-level scope at ./none:3
in expression starting at /home/biplav/.julia/packages/SteadyStateDiffEq/qQ3Lb/src/SteadyStateDiffEq.jl:6
ERROR: LoadError: Failed to precompile SteadyStateDiffEq [9672c7b4-1e72-59bd-8a11-6ac3964bc41f] to /home/biplav/.julia/compiled/v1.0/SteadyStateDiffEq/lsCSw.ji.
Stacktrace:
[1] error(::String) at ./error.jl:33
[2] compilecache(::Base.PkgId, ::String) at ./loading.jl:1203
[3] _require(::Base.PkgId) at ./loading.jl:960
[4] require(::Base.PkgId) at ./loading.jl:858
[5] require(::Module, ::Symbol) at ./loading.jl:853
[6] include at ./boot.jl:317 [inlined]
[7] include_relative(::Module, ::String) at ./loading.jl:1044
[8] include(::Module, ::String) at ./sysimg.jl:29
[9] top-level scope at none:2
[10] eval at ./boot.jl:319 [inlined]
[11] eval(::Expr) at ./client.jl:393
[12] top-level scope at ./none:3
in expression starting at /home/biplav/.julia/packages/DifferentialEquations/9ez1L/src/DifferentialEquations.jl:9
Failed to precompile DifferentialEquations [0c46a032-eb83-5123-abaf-570d42b7fbaa] to /home/biplav/.julia/compiled/v1.0/DifferentialEquations/UQdwS.ji.

Stacktrace:
[1] error(::String) at ./error.jl:33
[2] compilecache(::Base.PkgId, ::String) at ./loading.jl:1203
[3] _require(::Base.PkgId) at ./loading.jl:960
[4] require(::Base.PkgId) at ./loading.jl:858
[5] require(::Module, ::Symbol) at ./loading.jl:853
[6] top-level scope at In[5]:1

Is this problem a memory error as solved in this question, and how can I solve this?

You are getting an error from precompilation that seems inside the package and not in the code you are executing. However, I just update everything here, recompile DiffEqDiffTools without a problem. I would suggest you to clean your Julia environment and start again.

EDIT: Another option would be trying to update everything.

1 Like

could you explain on what is needed to be done to update everything and clean environment?

1 Like

For a clean environment, just remove / move ~/.julia and install all the packages again. To update, type ]update in REPL.

1 Like

The issue is Julia v1.0 does not work with DifferentialEquations. That said, v1.6 will very soon be the new LTS and it works well DifferentialEquations.jl

2 Likes