Hi everyone,
I’m having trouble with ModelingToolkit precompilation on Julia 1.12 on Windows, and I can’t figure out what’s triggering it.
In my project I’m just adding some libraries (including ModelingToolkit) :
using ModelingToolkit
using OrdinaryDiffEq
using Plots
using Waveforms
using Sundials
using DASSL
and I consistently get:
PkgPrecompileError: The following 1 direct dependency failed to precompile:
ModelingToolkit
Failed to precompile ModelingToolkit [961ee093-0014-501f-94e3-6117800e7a78] to "C:\\Users\\...\\.julia\\compiled\\v1.12\\ModelingToolkit\\jl_XXXX.tmp".
ERROR: LoadError: UndefVarError: `ODESystem` not defined in `ModelingToolkit`
Suggestion: define the const at top-level before running function that uses it (stricter Julia v1.12+ rule).
I tried to add a local environment and compile via:
using Pkg
Pkg.activate(@__DIR__)
Pkg.instantiate()
Pkg.precompile()
but I still get the same error.
Some extras :
Using ModelingToolkit in the REPL works, so it seems the package itself is installed, but the precompilation step keeps failing with this ODESystem error.
Has anyone seen this on Julia 1.12, or knows what can cause this issue during precompile? Any tips on how to debug which file / expression is being evaluated at that point would be very welcome.
Thanks!