You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Precompilation failure on modern DiffEqBase versions: UndefVarError: DefaultInit not defined #108
When using ODEInterfaceDiffEq (e.g., version v3.17.0) alongside modern versions of the SciML/DiffEqBase ecosystem (such as DiffEqBase v6.174+), precompilation fails with the following error:
WARNING: Imported binding DiffEqBase.DefaultInit was undeclared at import time during import to ODEInterfaceDiffEq.
ERROR: LoadError: UndefVarError: DefaultInit not defined in ODEInterfaceDiffEq
Stacktrace:
[1] top-level scope
@ ~/.julia/packages/ODEInterfaceDiffEq/HJWJN/src/initialize.jl:14
Cause
In src/initialize.jl, the package tries to import DefaultInit from DiffEqBase:
julia
import DiffEqBase: DefaultInit
However, in modern versions of the SciML ecosystem, DefaultInit is defined in OrdinaryDiffEqCore (or OrdinaryDiffEq) rather than in DiffEqBase or SciMLBase. Since ODEInterfaceDiffEq does not depend on OrdinaryDiffEq, it cannot resolve the type.
Suggested Fix
Similar to how Sundials.jl defines its own IDADefaultInit, ODEInterfaceDiffEq can define its own DAE default initialization type locally to preserve the interface without requiring a dependency on OrdinaryDiffEq:
In src/initialize.jl, remove import DiffEqBase: DefaultInit and instead define it locally:
julia
struct DefaultInit <: DiffEqBase.DAEInitializationAlgorithm end
In src/solve.jl, update the default parameter in the solver signature from DiffEqBase.DefaultInit() to the locally defined DefaultInit():
diff
On the older version, likely the issue is that you need a higher DiffEqBase
However, in modern versions of the SciML ecosystem, DefaultInit is defined in OrdinaryDiffEqCore (or OrdinaryDiffEq) rather than in DiffEqBase or SciMLBase. Since ODEInterfaceDiffEq does not depend on OrdinaryDiffEq, it cannot resolve the type.
Sorry should have provided more context. I am dealing with a legacy project which makes heavy use of SparseDiffTools v2.x. As such this restricts SciMLOperators to < 0.5.0. Migrating to SparseDiffTools v3.x would be a major headache. Would adding a few lines of checking if DefaultInit is it exported by the loaded version of DiffEqBase be a major pain point on your end?
not sure I understand the question. Did you mean the version of ODEInterfaceDiffEq.jl? Also I was able to to update the code to the SparseDiffTools v3.x interface, so the problem is moot
Activity
ChrisRackauckas commentedon Jun 17, 2026
Please upgrade to v5, which has downgrade tests to ensure this version mismatch isn't possible.
ChrisRackauckas commentedon Jun 17, 2026
On the older version, likely the issue is that you need a higher DiffEqBase
That is not true. https://github.com/SciML/OrdinaryDiffEq.jl/blob/0bda3109a1b9581450776b0e5f9607c2dd5e5281/lib/DiffEqBase/src/dae_initialization.jl#L11
uliw commentedon Jun 17, 2026
Sorry should have provided more context. I am dealing with a legacy project which makes heavy use of
SparseDiffTools v2.x. As such this restricts SciMLOperators to < 0.5.0. Migrating toSparseDiffTools v3.xwould be a major headache. Would adding a few lines of checking ifDefaultInitis it exported by the loaded version of DiffEqBase be a major pain point on your end?ChrisRackauckas commentedon Jun 17, 2026
Backported to what version?
uliw commentedon Jun 19, 2026
not sure I understand the question. Did you mean the version of ODEInterfaceDiffEq.jl? Also I was able to to update the code to the SparseDiffTools v3.x interface, so the problem is moot