Getting errors when adding `DataDrivenDiffEq` package

Hey guys. I’m having problems when trying to add DataDrivenDiffEq package. As per what the documentation and github readme of package says, I tried import Pkg; Pkg.add("DataDrivenDiffEq") and also pkg> add DataDrivenDiffEq, but in both cases, I’m getting a long error which as per my research on the internet, nobody has encountered. I did try julia environments too, but had no progress. I have no clue why I’m getting this error and it’d be great if anyone can point out how to fix this problem

Now, I’m trying this on a MacBook air (m1) (I’ll provide more if it’s needed):

julia> Sys.MACHINE
"arm64-apple-darwin23.4.0"

julia> VERSION
v"1.10.4"

and the errors are these:

Precompiling DataDrivenDiffEq
        Info Given DataDrivenDiffEq was explicitly requested, output will be shown live
ERROR: LoadError: TypeError: in new, expected Union{}, got a value of type SparseArrays.SparseMatrixCSC{Float64, Int64}rSolveKernelAbstractionsExt
Stacktrace:
 [1] Sparspak.SpkSparseSolver.SparseSolver(p::SparseArrays.SparseMatrixCSC{Float64, Int64}, slvr::Sparspak.SpkSparseBase._SparseBase{Int64, Float64}, n::Int64, ma::Int64, na::Int64, mc::Int64, nc::Int64, _inmatrixdone::Bool, _orderdone::Bool, _symbolicdone::Bool, _factordone::Bool, _trisolvedone::Bool, _refinedone::Bool, _condestdone::Bool)
   @ Sparspak.SpkSparseSolver ~/.julia/packages/Sparspak/oqBYl/src/SparseMethod/SpkSparseSolver.jl:18
 [2] Sparspak.SpkSparseSolver.SparseSolver(m::SparseArrays.SparseMatrixCSC{Float64, Int64})
   @ Sparspak.SparseCSCInterface ~/.julia/packages/Sparspak/oqBYl/src/SparseCSCInterface/SparseCSCInterface.jl:189
 [3] sparspaklu(m::SparseArrays.SparseMatrixCSC{Float64, Int64}; factorize::Bool)
   @ Sparspak.SparseCSCInterface ~/.julia/packages/Sparspak/oqBYl/src/SparseCSCInterface/SparseCSCInterface.jl:219
 [4] top-level scope
   @ ~/.julia/packages/LinearSolve/WmS9C/src/factorization.jl:1336
 [5] include(x::String)
   @ LinearSolve ~/.julia/packages/LinearSolve/WmS9C/src/LinearSolve.jl:1
 [6] top-level scope
   @ ~/.julia/packages/LinearSolve/WmS9C/src/LinearSolve.jl:127
 [7] top-level scope
   @ stdin:3
in expression starting at /Users/user/.julia/packages/LinearSolve/WmS9C/src/factorization.jl:1336
in expression starting at /Users/user/.julia/packages/LinearSolve/WmS9C/src/LinearSolve.jl:1
in expression starting at stdin:3
ERROR: LoadError: Failed to precompile LinearSolve [7ed4a6bd-45f5-4d41-b270-4a48e9bafcae] to "/Users/user/.julia/compiled/v1.10/LinearSolve/jl_duIDiT".
Stacktrace:
 [1] mkpidlock(f::Base.var"#968#969"{Base.PkgId}, at::String, pid::Int32; kwopts::@Kwargs{stale_age::Int64, wait::Bool})
   @ FileWatching.Pidfile /opt/homebrew/Cellar/julia/1.10.4/share/julia/stdlib/v1.10/FileWatching/src/pidfile.jl:93
 [2] #mkpidlock#6
   @ /opt/homebrew/Cellar/julia/1.10.4/share/julia/stdlib/v1.10/FileWatching/src/pidfile.jl:88 [inlined]
 [3] trymkpidlock(::Function, ::Vararg{Any}; kwargs::@Kwargs{stale_age::Int64})
   @ FileWatching.Pidfile /opt/homebrew/Cellar/julia/1.10.4/share/julia/stdlib/v1.10/FileWatching/src/pidfile.jl:111
 [4] top-level scope
   @ stdin:3
in expression starting at /Users/user/.julia/packages/NonlinearSolve/sETeN/src/NonlinearSolve.jl:1
in expression starting at stdin:3
ERROR: LoadError: Failed to precompile NonlinearSolve [8913a72c-1f9b-4ce2-8d82-65094dcecaec] to "/Users/user/.julia/compiled/v1.10/NonlinearSolve/jl_kr39hM".
Stacktrace:
 [1] mkpidlock(f::Base.var"#968#969"{Base.PkgId}, at::String, pid::Int32; kwopts::@Kwargs{stale_age::Int64, wait::Bool})
   @ FileWatching.Pidfile /opt/homebrew/Cellar/julia/1.10.4/share/julia/stdlib/v1.10/FileWatching/src/pidfile.jl:93
 [2] #mkpidlock#6
   @ /opt/homebrew/Cellar/julia/1.10.4/share/julia/stdlib/v1.10/FileWatching/src/pidfile.jl:88 [inlined]
 [3] trymkpidlock(::Function, ::Vararg{Any}; kwargs::@Kwargs{stale_age::Int64})
   @ FileWatching.Pidfile /opt/homebrew/Cellar/julia/1.10.4/share/julia/stdlib/v1.10/FileWatching/src/pidfile.jl:111
 [4] top-level scope
   @ stdin:3
in expression starting at /Users/user/.julia/packages/DiffEqCallbacks/kbsPG/src/DiffEqCallbacks.jl:1
in expression starting at stdin:3
ERROR: LoadError: Failed to precompile DiffEqCallbacks [459566f4-90b8-5000-8ac3-15dfb0a30def] to "/Users/user/.julia/compiled/v1.10/DiffEqCallbacks/jl_4FLHK8".
Stacktrace:
 [1] compilecache(pkg::Base.PkgId, path::String, internal_stderr::IO, internal_stdout::IO, keep_loaded_modules::Bool)
   @ Base ./loading.jl:2468
 [2] compilecache
   @ ./loading.jl:2340 [inlined]
 [3] (::Base.var"#968#969"{Base.PkgId})()
   @ Base ./loading.jl:1974
 [4] mkpidlock(f::Base.var"#968#969"{Base.PkgId}, at::String, pid::Int32; kwopts::@Kwargs{stale_age::Int64, wait::Bool})
   @ FileWatching.Pidfile /opt/homebrew/Cellar/julia/1.10.4/share/julia/stdlib/v1.10/FileWatching/src/pidfile.jl:93
 [5] #mkpidlock#6
   @ /opt/homebrew/Cellar/julia/1.10.4/share/julia/stdlib/v1.10/FileWatching/src/pidfile.jl:88 [inlined]
 [6] trymkpidlock(::Function, ::Vararg{Any}; kwargs::@Kwargs{stale_age::Int64})
   @ FileWatching.Pidfile /opt/homebrew/Cellar/julia/1.10.4/share/julia/stdlib/v1.10/FileWatching/src/pidfile.jl:111
 [7] top-level scope
   @ stdin:3
in expression starting at /Users/user/.julia/packages/ModelingToolkit/GJiqn/src/ModelingToolkit.jl:1
in expression starting at stdin:3
ERROR: LoadError: Failed to precompile ModelingToolkit [961ee093-0014-501f-94e3-6117800e7a78] to "/Users/user/.julia/compiled/v1.10/ModelingToolkit/jl_1MaJYl".
Stacktrace:
 [1] mkpidlock(f::Base.var"#968#969"{Base.PkgId}, at::String, pid::Int32; kwopts::@Kwargs{stale_age::Int64, wait::Bool})
   @ FileWatching.Pidfile /opt/homebrew/Cellar/julia/1.10.4/share/julia/stdlib/v1.10/FileWatching/src/pidfile.jl:93
 [2] #mkpidlock#6
   @ /opt/homebrew/Cellar/julia/1.10.4/share/julia/stdlib/v1.10/FileWatching/src/pidfile.jl:88 [inlined]
 [3] trymkpidlock(::Function, ::Vararg{Any}; kwargs::@Kwargs{stale_age::Int64})
   @ FileWatching.Pidfile /opt/homebrew/Cellar/julia/1.10.4/share/julia/stdlib/v1.10/FileWatching/src/pidfile.jl:111
 [4] top-level scope
   @ stdin:3
in expression starting at /Users/user/.julia/packages/DataDrivenDiffEq/gpXhb/src/DataDrivenDiffEq.jl:1
in expression starting at stdin:3
  ✗ LinearSolve
  ✗ LinearSolve → LinearSolveKernelAbstractionsExt
  ✗ LinearSolve → LinearSolveRecursiveArrayToolsExt
  ✗ NonlinearSolve
  ✗ NonlinearSolve → NonlinearSolveSymbolicsExt
  ✗ DiffEqCallbacks
  ✗ ModelingToolkit
  ✗ DataDrivenDiffEq
  0 dependencies successfully precompiled in 41 seconds. 276 already precompiled.

ERROR: The following 1 direct dependency failed to precompile:

DataDrivenDiffEq [2445eb08-9709-466a-b3fc-47e12bd697a2]

Failed to precompile DataDrivenDiffEq [2445eb08-9709-466a-b3fc-47e12bd697a2] to "/Users/user/.julia/compiled/v1.10/DataDrivenDiffEq/jl_Ro9wuV".
ERROR: LoadError: TypeError: in new, expected Union{}, got a value of type SparseArrays.SparseMatrixCSC{Float64, Int64}
Stacktrace:
 [1] Sparspak.SpkSparseSolver.SparseSolver(p::SparseArrays.SparseMatrixCSC{Float64, Int64}, slvr::Sparspak.SpkSparseBase._SparseBase{Int64, Float64}, n::Int64, ma::Int64, na::Int64, mc::Int64, nc::Int64, _inmatrixdone::Bool, _orderdone::Bool, _symbolicdone::Bool, _factordone::Bool, _trisolvedone::Bool, _refinedone::Bool, _condestdone::Bool)
   @ Sparspak.SpkSparseSolver ~/.julia/packages/Sparspak/oqBYl/src/SparseMethod/SpkSparseSolver.jl:18
 [2] Sparspak.SpkSparseSolver.SparseSolver(m::SparseArrays.SparseMatrixCSC{Float64, Int64})
   @ Sparspak.SparseCSCInterface ~/.julia/packages/Sparspak/oqBYl/src/SparseCSCInterface/SparseCSCInterface.jl:189
 [3] sparspaklu(m::SparseArrays.SparseMatrixCSC{Float64, Int64}; factorize::Bool)
   @ Sparspak.SparseCSCInterface ~/.julia/packages/Sparspak/oqBYl/src/SparseCSCInterface/SparseCSCInterface.jl:219
 [4] top-level scope
   @ ~/.julia/packages/LinearSolve/WmS9C/src/factorization.jl:1336
 [5] include(x::String)
   @ LinearSolve ~/.julia/packages/LinearSolve/WmS9C/src/LinearSolve.jl:1
 [6] top-level scope
   @ ~/.julia/packages/LinearSolve/WmS9C/src/LinearSolve.jl:127
 [7] top-level scope
   @ stdin:3
in expression starting at /Users/user/.julia/packages/LinearSolve/WmS9C/src/factorization.jl:1336
in expression starting at /Users/user/.julia/packages/LinearSolve/WmS9C/src/LinearSolve.jl:1
in expression starting at stdin:3
ERROR: LoadError: Failed to precompile LinearSolve [7ed4a6bd-45f5-4d41-b270-4a48e9bafcae] to "/Users/user/.julia/compiled/v1.10/LinearSolve/jl_duIDiT".
Stacktrace:
 [1] mkpidlock(f::Base.var"#968#969"{Base.PkgId}, at::String, pid::Int32; kwopts::@Kwargs{stale_age::Int64, wait::Bool})
   @ FileWatching.Pidfile /opt/homebrew/Cellar/julia/1.10.4/share/julia/stdlib/v1.10/FileWatching/src/pidfile.jl:93
 [2] #mkpidlock#6
   @ /opt/homebrew/Cellar/julia/1.10.4/share/julia/stdlib/v1.10/FileWatching/src/pidfile.jl:88 [inlined]
 [3] trymkpidlock(::Function, ::Vararg{Any}; kwargs::@Kwargs{stale_age::Int64})
   @ FileWatching.Pidfile /opt/homebrew/Cellar/julia/1.10.4/share/julia/stdlib/v1.10/FileWatching/src/pidfile.jl:111
 [4] top-level scope
   @ stdin:3
in expression starting at /Users/user/.julia/packages/NonlinearSolve/sETeN/src/NonlinearSolve.jl:1
in expression starting at stdin:3
ERROR: LoadError: Failed to precompile NonlinearSolve [8913a72c-1f9b-4ce2-8d82-65094dcecaec] to "/Users/user/.julia/compiled/v1.10/NonlinearSolve/jl_kr39hM".
Stacktrace:
 [1] mkpidlock(f::Base.var"#968#969"{Base.PkgId}, at::String, pid::Int32; kwopts::@Kwargs{stale_age::Int64, wait::Bool})
   @ FileWatching.Pidfile /opt/homebrew/Cellar/julia/1.10.4/share/julia/stdlib/v1.10/FileWatching/src/pidfile.jl:93
 [2] #mkpidlock#6
   @ /opt/homebrew/Cellar/julia/1.10.4/share/julia/stdlib/v1.10/FileWatching/src/pidfile.jl:88 [inlined]
 [3] trymkpidlock(::Function, ::Vararg{Any}; kwargs::@Kwargs{stale_age::Int64})
   @ FileWatching.Pidfile /opt/homebrew/Cellar/julia/1.10.4/share/julia/stdlib/v1.10/FileWatching/src/pidfile.jl:111
 [4] top-level scope
   @ stdin:3
in expression starting at /Users/user/.julia/packages/DiffEqCallbacks/kbsPG/src/DiffEqCallbacks.jl:1
in expression starting at stdin:3
ERROR: LoadError: Failed to precompile DiffEqCallbacks [459566f4-90b8-5000-8ac3-15dfb0a30def] to "/Users/user/.julia/compiled/v1.10/DiffEqCallbacks/jl_4FLHK8".
Stacktrace:
 [1] compilecache(pkg::Base.PkgId, path::String, internal_stderr::IO, internal_stdout::IO, keep_loaded_modules::Bool)
   @ Base ./loading.jl:2468
 [2] compilecache
   @ ./loading.jl:2340 [inlined]
 [3] (::Base.var"#968#969"{Base.PkgId})()
   @ Base ./loading.jl:1974
 [4] mkpidlock(f::Base.var"#968#969"{Base.PkgId}, at::String, pid::Int32; kwopts::@Kwargs{stale_age::Int64, wait::Bool})
   @ FileWatching.Pidfile /opt/homebrew/Cellar/julia/1.10.4/share/julia/stdlib/v1.10/FileWatching/src/pidfile.jl:93
 [5] #mkpidlock#6
   @ /opt/homebrew/Cellar/julia/1.10.4/share/julia/stdlib/v1.10/FileWatching/src/pidfile.jl:88 [inlined]
 [6] trymkpidlock(::Function, ::Vararg{Any}; kwargs::@Kwargs{stale_age::Int64})
   @ FileWatching.Pidfile /opt/homebrew/Cellar/julia/1.10.4/share/julia/stdlib/v1.10/FileWatching/src/pidfile.jl:111
 [7] top-level scope
   @ stdin:3
in expression starting at /Users/user/.julia/packages/ModelingToolkit/GJiqn/src/ModelingToolkit.jl:1
in expression starting at stdin:3
ERROR: LoadError: Failed to precompile ModelingToolkit [961ee093-0014-501f-94e3-6117800e7a78] to "/Users/user/.julia/compiled/v1.10/ModelingToolkit/jl_1MaJYl".
Stacktrace:
 [1] mkpidlock(f::Base.var"#968#969"{Base.PkgId}, at::String, pid::Int32; kwopts::@Kwargs{stale_age::Int64, wait::Bool})
   @ FileWatching.Pidfile /opt/homebrew/Cellar/julia/1.10.4/share/julia/stdlib/v1.10/FileWatching/src/pidfile.jl:93
 [2] #mkpidlock#6
   @ /opt/homebrew/Cellar/julia/1.10.4/share/julia/stdlib/v1.10/FileWatching/src/pidfile.jl:88 [inlined]
 [3] trymkpidlock(::Function, ::Vararg{Any}; kwargs::@Kwargs{stale_age::Int64})
   @ FileWatching.Pidfile /opt/homebrew/Cellar/julia/1.10.4/share/julia/stdlib/v1.10/FileWatching/src/pidfile.jl:111
 [4] top-level scope
   @ stdin:3
in expression starting at /Users/user/.julia/packages/DataDrivenDiffEq/gpXhb/src/DataDrivenDiffEq.jl:1
in expression starting at stdin:
Stacktrace:
 [1] precompile(pkgs::Vector{Pkg.Types.PackageSpec}; io::Base.TTY, kwargs::@Kwargs{_from_loading::Bool})
   @ Pkg.API /opt/homebrew/Cellar/julia/1.10.4/share/julia/stdlib/v1.10/Pkg/src/API.jl:159
 [2] precompile
   @ /opt/homebrew/Cellar/julia/1.10.4/share/julia/stdlib/v1.10/Pkg/src/API.jl:147 [inlined]
 [3] #precompile#114
   @ /opt/homebrew/Cellar/julia/1.10.4/share/julia/stdlib/v1.10/Pkg/src/API.jl:146 [inlined]

I just tried a normal Julia installation with latest Julia and latest package versions on Mac M2 and it was fine.

Is your installation using a non-standard Julia build like Homebrew? The fact that it’s failing in the linear algebra package is a sign that your build is simply incorrect, like using an incorrect LLVM version, which I know Homebrew does. Homebrew is a completely broken build and Julia tries to report it but the Homebrew maintainers (non-Julia people) decided it was a good idea to patch the source code to remove the warning that it’s an unsupported build, even though it’s very clear it’s not using the correct LLVM version. Let me know if my guess is correct.