Precompile error in DifferentialEquations.jl

Hi all!

I’m completely new to Julia and I was trying to set up the example in SciML (Build and run your first simulation with Julia's SciML · Overview of Julia's SciML). However, when I try to do

   Pkg.add("DifferentialEquations")

I get a precompile error. This is the output of Pkg.precompile():

**Precompiling** project...

✗ LinearSolve

✗ NonlinearSolve

✗ OrdinaryDiffEq

✗ StochasticDiffEq

✗ DelayDiffEq

✗ DifferentialEquations

0 dependencies successfully precompiled in 58 seconds. 141 already precompiled.

**ERROR:** The following 4 direct dependencies failed to precompile:

NonlinearSolve [8913a72c-1f9b-4ce2-8d82-65094dcecaec]

Failed to precompile NonlinearSolve [8913a72c-1f9b-4ce2-8d82-65094dcecaec] to /Users/jaimeredondoyuste/.julia/compiled/v1.8/NonlinearSolve/jl_hKy20Z.

**ERROR:** LoadError: MethodError: convert(::Type{Union{}}, ::SparseArrays.SparseMatrixCSC{Float64, Int64}) is ambiguous. Candidates:

convert(T::Type{<:SparseArrays.AbstractSparseMatrixCSC}, m::AbstractMatrix) in SparseArrays at /opt/homebrew/Cellar/julia/1.8.5/share/julia/stdlib/v1.8/SparseArrays/src/sparsematrix.jl:745

convert(T::Type{<:LinearAlgebra.UpperTriangular}, m::SparseArrays.AbstractSparseMatrixCSC) in SparseArrays at /opt/homebrew/Cellar/julia/1.8.5/share/julia/stdlib/v1.8/SparseArrays/src/sparsematrix.jl:755

... [similar error, referred to different methods]...

Possible fix, define

convert(::Type{Union{}}, ::SparseArrays.AbstractSparseMatrixCSC)

Stacktrace:

[1] **Sparspak.SpkSparseSolver.SparseSolver{Int64, Float64}(**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**)** (repeats 2 times)

@ Sparspak.SpkSparseSolver ~/.julia/packages/Sparspak/ZSfSg/src/SparseMethod/SpkSparseSolver.jl:18

[2] **Sparspak.SpkSparseSolver.SparseSolver(**m::SparseArrays.SparseMatrixCSC{Float64, Int64}**)**

@ Sparspak.SparseCSCInterface ~/.julia/packages/Sparspak/ZSfSg/src/SparseCSCInterface/SparseCSCInterface.jl:189


...[similar stuff, output is too large otherwise]


**ERROR:** LoadError: Failed to precompile LinearSolve [7ed4a6bd-45f5-4d41-b270-4a48e9bafcae] to /Users/jaimeredondoyuste/.julia/compiled/v1.8/LinearSolve/jl_DHUd6j.

@ REPL[15]:1

I have shortened the output, since it is somewhat repetitive and otherwise the post becomes too large.

In case it helps, this is my Julia installation version:

julia> versioninfo()
Julia Version 1.8.5
Commit 17cfb8e65e* (2023-01-08 06:45 UTC)
Platform Info:
  OS: macOS (arm64-apple-darwin21.6.0)
  CPU: 8 × Apple M1 Pro
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-13.0.1 (ORCJIT, apple-m1)
  Threads: 1 on 6 virtual cores

I would appreciate if you have any idea how to debug or fix this. Thank you very much :slight_smile:

1 Like

@j-fu do you know why this keeps showing up for some people? If it’s a version bound thing then Sparsepak may need looser bounds.

No real idea so far without the possibility to repeat this in an MWE (I understand that this is not easy to get).

What I felt with 1.8.5 is (and this may be the case here) that a method signature like mymethod(SparseMatrixCSC) is kind of not fully recognized during specialization and the situation is fixed by declaring mymethod(SparseMatrixCSC{TV,Ti}) where {Tv,Ti} . There are few places in Sparspak where this change could be made which could be related to the problem of OP. Very hand-wavy I know…

Will prepare a PR on sparspak tonight (de).

Ok, Sparspak 0.3.8 has the updates now. Not sure if this will help though.
Maybe @jredondo you could try to update: Just try a
pkg> update and see if Sparspak v0.3.8 is drawn in (via LinearSolve). And then see if it precompiles.

Issue discussion in LinearSolve fails to precompile on julia 1.8.5 · Issue #266 · SciML/LinearSolve.jl · GitHub as this may be related.

Thanks!

Sparspak v0.3.8 was installed when updating, however it still does not precompile. The error log looks like:

ERROR: The following 2 direct dependencies failed to precompile:

OrdinaryDiffEq [1dea7af3-3e70-54e6-95c3-0bf5283fa5ed]

Failed to precompile OrdinaryDiffEq [1dea7af3-3e70-54e6-95c3-0bf5283fa5ed] to /Users/jaimeredondoyuste/.julia/compiled/v1.8/OrdinaryDiffEq/jl_MaF86C.
ERROR: LoadError: MethodError: convert(::Type{Union{}}, ::SparseArrays.SparseMatrixCSC{Float64, Int64}) is ambiguous. Candidates:
  convert(T::Type{<:SparseArrays.AbstractSparseMatrixCSC}, m::AbstractMatrix) in SparseArrays at /opt/homebrew/Cellar/julia/1.8.5/share/julia/stdlib/v1.8/SparseArrays/src/sparsematrix.jl:745
  convert(T::Type{<:LinearAlgebra.UpperTriangular}, m::SparseArrays.AbstractSparseMatrixCSC) in SparseArrays at /opt/homebrew/Cellar/julia/1.8.5/share/julia/stdlib/v1.8/SparseArrays/src/sparsematrix.jl:755
  convert(T::Type{<:LinearAlgebra.SymTridiagonal}, m::SparseArrays.AbstractSparseMatrixCSC) in SparseArrays at /opt/homebrew/Cellar/julia/1.8.5/share/julia/stdlib/v1.8/SparseArrays/src/sparsematrix.jl:749
  convert(T::Type{<:LinearAlgebra.Diagonal}, m::SparseArrays.AbstractSparseMatrixCSC) in SparseArrays at /opt/homebrew/Cellar/julia/1.8.5/share/julia/stdlib/v1.8/SparseArrays/src/sparsematrix.jl:747
  convert(T::Type{<:LinearAlgebra.LowerTriangular}, m::SparseArrays.AbstractSparseMatrixCSC) in SparseArrays at /opt/homebrew/Cellar/julia/1.8.5/share/julia/stdlib/v1.8/SparseArrays/src/sparsematrix.jl:753
  convert(T::Type{<:LinearAlgebra.Bidiagonal}, m::AbstractMatrix) in LinearAlgebra at /opt/homebrew/Cellar/julia/1.8.5/share/julia/stdlib/v1.8/LinearAlgebra/src/bidiag.jl:203
  convert(T::Type{<:LinearAlgebra.Tridiagonal}, m::SparseArrays.AbstractSparseMatrixCSC) in SparseArrays at /opt/homebrew/Cellar/julia/1.8.5/share/julia/stdlib/v1.8/SparseArrays/src/sparsematrix.jl:751
  convert(T::Type{<:SparseArrays.SparseVector}, m::SparseArrays.AbstractSparseMatrixCSC) in SparseArrays at /opt/homebrew/Cellar/julia/1.8.5/share/julia/stdlib/v1.8/SparseArrays/src/sparsevector.jl:466
  convert(::Type{Union{}}, a::AbstractArray) in Base at array.jl:618
  convert(::Type{SA}, a::AbstractArray) where SA<:StaticArraysCore.StaticArray in StaticArrays at /Users/jaimeredondoyuste/.julia/packages/StaticArrays/jA1zK/src/convert.jl:194
  convert(::Type{T}, a::AbstractArray) where T<:Array in Base at array.jl:617
  convert(T::Type{<:BitArray}, a::AbstractArray) in Base at bitarray.jl:580
  convert(::Type{T}, M::AbstractArray) where T<:OffsetArrays.OffsetArray in OffsetArrays at /Users/jaimeredondoyuste/.julia/packages/OffsetArrays/TcCEq/src/OffsetArrays.jl:256
  convert(::Type{Union{}}, x) in Base at essentials.jl:213
  convert(::Type{T}, arg) where T<:VecElement in Base at baseext.jl:19
  convert(::Type{T}, obj) where T<:FunctionWrappers.FunctionWrapper in FunctionWrappers at /Users/jaimeredondoyuste/.julia/packages/FunctionWrappers/Q5cBx/src/FunctionWrappers.jl:113
Possible fix, define
  convert(::Type{Union{}}, ::SparseArrays.AbstractSparseMatrixCSC)
Stacktrace:
  [1] Sparspak.SpkSparseSolver.SparseSolver{Int64, Float64}(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) (repeats 2 times)
    @ Sparspak.SpkSparseSolver ~/.julia/packages/Sparspak/5cKXy/src/SparseMethod/SpkSparseSolver.jl:18
  [2] Sparspak.SpkSparseSolver.SparseSolver(m::SparseArrays.SparseMatrixCSC{Float64, Int64})
    @ Sparspak.SparseCSCInterface ~/.julia/packages/Sparspak/5cKXy/src/SparseCSCInterface/SparseCSCInterface.jl:189
  [3] sparspaklu(m::SparseArrays.SparseMatrixCSC{Float64, Int64}; factorize::Bool)
    @ Sparspak.SparseCSCInterface ~/.julia/packages/Sparspak/5cKXy/src/SparseCSCInterface/SparseCSCInterface.jl:219
  [4] init_cacheval(#unused#::LinearSolve.SparspakFactorization, A::SparseArrays.SparseMatrixCSC{Float64, Int64}, b::Vector{Float64}, u::Vector{Float64}, Pl::SciMLOperators.IdentityOperator{4}, Pr::SciMLOperators.IdentityOperator{4}, maxiters::Int64, abstol::Float64, reltol::Float64, verbose::Bool, assumptions::LinearSolve.OperatorAssumptions{true})
    @ LinearSolve ~/.julia/packages/LinearSolve/fBayl/src/factorization.jl:514
  [5] init(::SciMLBase.LinearProblem{Nothing, true, SparseArrays.SparseMatrixCSC{Float64, Int64}, Vector{Float64}, SciMLBase.NullParameters, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}}, ::LinearSolve.SparspakFactorization; alias_A::Bool, alias_b::Bool, abstol::Float64, reltol::Float64, maxiters::Int64, verbose::Bool, Pl::SciMLOperators.IdentityOperator{4}, Pr::SciMLOperators.IdentityOperator{4}, assumptions::LinearSolve.OperatorAssumptions{true}, kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
    @ LinearSolve ~/.julia/packages/LinearSolve/fBayl/src/common.jl:117
  [6] init(::SciMLBase.LinearProblem{Nothing, true, SparseArrays.SparseMatrixCSC{Float64, Int64}, Vector{Float64}, SciMLBase.NullParameters, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}}, ::LinearSolve.SparspakFactorization)
    @ LinearSolve ~/.julia/packages/LinearSolve/fBayl/src/common.jl:88
  [7] solve(::SciMLBase.LinearProblem{Nothing, true, SparseArrays.SparseMatrixCSC{Float64, Int64}, Vector{Float64}, SciMLBase.NullParameters, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}}, ::LinearSolve.SparspakFactorization; kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
    @ LinearSolve ~/.julia/packages/LinearSolve/fBayl/src/common.jl:157
  [8] solve(::SciMLBase.LinearProblem{Nothing, true, SparseArrays.SparseMatrixCSC{Float64, Int64}, Vector{Float64}, SciMLBase.NullParameters, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}}, ::LinearSolve.SparspakFactorization)
    @ LinearSolve ~/.julia/packages/LinearSolve/fBayl/src/common.jl:154
  [9] macro expansion
    @ ~/.julia/packages/LinearSolve/fBayl/src/LinearSolve.jl:102 [inlined]
 [10] top-level scope
    @ ~/.julia/packages/SnoopPrecompile/1XXT1/src/SnoopPrecompile.jl:62
 [11] include
    @ ./Base.jl:419 [inlined]
 [12] 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, UInt64}}, source::String)
    @ Base ./loading.jl:1554
 [13] top-level scope
    @ stdin:1
in expression starting at /Users/jaimeredondoyuste/.julia/packages/LinearSolve/fBayl/src/LinearSolve.jl:1
in expression starting at stdin:1

With an error also to load LinearSolve which depends on the failure to precompile of OrdinaryDiffEq and then a similar error to the one copied for DifferentialEquations.

Is there any simple fix for this? Would just installing a previous version of Julia and the packages would work? As far as I know, I do not think I have anything weird in my local environment that could be causing trouble, but I also don’t know the best way to check this.

In any case, thanks for the help :slight_smile:

Ok - I am puzzled.

Does the error occur also when you just add Sparspak.jl ?

I will find a colleague who has an arm64 mac and see if the bug occurs there.

Got this from my colleague:

   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.8.5 (2023-01-08)
 _/ |\__'_|_|_|\__'_|  |  Official https://julialang.org/ release
|__/                   |

(@v1.8) pkg> add LinearSolve
    Updating registry at `~/.julia/registries/General.toml`
   Resolving package versions...
   Installed SIMDTypes ──────────────────────── v0.1.0
   Installed GPUArraysCore ──────────────────── v0.1.3
   Installed ArrayInterfaceStaticArrays ─────── v0.1.5
   Installed Adapt ──────────────────────────── v3.5.0
   Installed DiffRules ──────────────────────── v1.12.2
   Installed BitTwiddlingConvenienceFunctions ─ v0.1.5
   Installed FunctionWrappersWrappers ───────── v0.1.1
   Installed OffsetArrays ───────────────────── v1.12.9
   Installed StrideArraysCore ───────────────── v0.4.6
   Installed VectorizationBase ──────────────── v0.21.58
   Installed CpuId ──────────────────────────── v0.3.1
   Installed DiffResults ────────────────────── v1.1.0
   Installed LayoutPointers ─────────────────── v0.1.13
   Installed RuntimeGeneratedFunctions ──────── v0.5.5
   Installed LinearSolve ────────────────────── v1.35.0
   Installed SciMLBase ──────────────────────── v1.82.0
   Installed CPUSummary ─────────────────────── v0.2.2
   Installed Tables ─────────────────────────── v1.10.0
   Installed SciMLOperators ─────────────────── v0.1.19
   Installed Setfield ───────────────────────── v1.1.1
   Installed DataAPI ────────────────────────── v1.14.0
   Installed StaticArrays ───────────────────── v1.5.12
   Installed RecipesBase ────────────────────── v1.3.3
   Installed LoopVectorization ──────────────── v0.12.150
   Installed Polyester ──────────────────────── v0.7.2
   Installed ArrayInterfaceStaticArraysCore ─── v0.1.3
   Installed StaticArraysCore ───────────────── v1.4.0
   Installed NaNMath ────────────────────────── v1.0.1
   Installed ConstructionBase ───────────────── v1.4.1
   Installed ArrayInterfaceCore ─────────────── v0.1.29
   Installed EnumX ──────────────────────────── v1.0.4
   Installed HostCPUFeatures ────────────────── v0.1.14
   Installed ThreadingUtilities ─────────────── v0.5.1
   Installed ChainRulesCore ─────────────────── v1.15.7
   Installed FunctionWrappers ───────────────── v1.1.3
   Installed ManualMemory ───────────────────── v0.1.8
   Installed PolyesterWeave ─────────────────── v0.2.1
   Installed SymbolicIndexingInterface ──────── v0.2.1
   Installed SnoopPrecompile ────────────────── v1.0.3
   Installed RecursiveArrayTools ────────────── v2.36.0
   Installed ArrayInterface ─────────────────── v6.0.25
   Installed ForwardDiff ────────────────────── v0.10.34
   Installed FillArrays ─────────────────────── v0.13.7
   Installed TriangularSolve ────────────────── v0.1.19
   Installed FastLapackInterface ────────────── v1.2.8
   Installed KLU ────────────────────────────── v0.4.0
   Installed LogExpFunctions ────────────────── v0.3.21
   Installed ArrayInterfaceOffsetArrays ─────── v0.1.7
   Installed Lazy ───────────────────────────── v0.15.1
   Installed CloseOpenIntervals ─────────────── v0.1.11
   Installed Compat ─────────────────────────── v4.6.0
   Installed SLEEFPirates ───────────────────── v0.6.38
   Installed MacroTools ─────────────────────── v0.5.10
   Installed Static ─────────────────────────── v0.8.3
   Installed Krylov ─────────────────────────── v0.9.0
   Installed InverseFunctions ───────────────── v0.1.8
   Installed RecursiveFactorization ─────────── v0.2.17
   Installed CommonSolve ────────────────────── v0.2.3
   Installed DocStringExtensions ────────────── v0.9.3
   Installed KrylovKit ──────────────────────── v0.6.0
   Installed ChangesOfVariables ─────────────── v0.1.5
   Installed Sparspak ───────────────────────── v0.3.8
    Updating `~/.julia/environments/v1.8/Project.toml`
  [7ed4a6bd] + LinearSolve v1.35.0
    Updating `~/.julia/environments/v1.8/Manifest.toml`
  [79e6a3ab] + Adapt v3.5.0
  [4fba245c] + ArrayInterface v6.0.25
  [30b0a656] + ArrayInterfaceCore v0.1.29
  [015c0d05] + ArrayInterfaceOffsetArrays v0.1.7
  [b0d46f97] + ArrayInterfaceStaticArrays v0.1.5
  [dd5226c6] + ArrayInterfaceStaticArraysCore v0.1.3
  [62783981] + BitTwiddlingConvenienceFunctions v0.1.5
  [2a0fbf3d] + CPUSummary v0.2.2
  [d360d2e6] + ChainRulesCore v1.15.7
  [9e997f8a] + ChangesOfVariables v0.1.5
  [fb6a15b2] + CloseOpenIntervals v0.1.11
  [38540f10] + CommonSolve v0.2.3
  [bbf7d656] + CommonSubexpressions v0.3.0
  [34da2185] + Compat v4.6.0
  [187b0558] + ConstructionBase v1.4.1
  [adafc99b] + CpuId v0.3.1
  [9a962f9c] + DataAPI v1.14.0
  [e2d170a0] + DataValueInterfaces v1.0.0
  [163ba53b] + DiffResults v1.1.0
  [b552c78f] + DiffRules v1.12.2
  [ffbed154] + DocStringExtensions v0.9.3
  [4e289a0a] + EnumX v1.0.4
  [e2ba6199] + ExprTools v0.1.8
  [29a986be] + FastLapackInterface v1.2.8
  [1a297f60] + FillArrays v0.13.7
  [f6369f11] + ForwardDiff v0.10.34
  [069b7b12] + FunctionWrappers v1.1.3
  [77dc65aa] + FunctionWrappersWrappers v0.1.1
  [46192b85] + GPUArraysCore v0.1.3
  [3e5b6fbb] + HostCPUFeatures v0.1.14
  [615f187c] + IfElse v0.1.1
  [3587e190] + InverseFunctions v0.1.8
  [92d709cd] + IrrationalConstants v0.1.1
  [42fd0dbc] + IterativeSolvers v0.9.2
  [82899510] + IteratorInterfaceExtensions v1.0.0
  [692b3bcd] + JLLWrappers v1.4.1
  [ef3ab10e] + KLU v0.4.0
  [ba0b0d4f] + Krylov v0.9.0
  [0b1a1467] + KrylovKit v0.6.0
  [10f19ff3] + LayoutPointers v0.1.13
  [50d2b5c4] + Lazy v0.15.1
  [7ed4a6bd] + LinearSolve v1.35.0
  [2ab3a3ac] + LogExpFunctions v0.3.21
  [bdcacae8] + LoopVectorization v0.12.150
  [1914dd2f] + MacroTools v0.5.10
  [d125e4d3] + ManualMemory v0.1.8
  [77ba4419] + NaNMath v1.0.1
  [6fe1bfb0] + OffsetArrays v1.12.9
  [bac558e1] + OrderedCollections v1.4.1
  [f517fe37] + Polyester v0.7.2
  [1d0040c9] + PolyesterWeave v0.2.1
  [21216c6a] + Preferences v1.3.0
  [3cdcf5f2] + RecipesBase v1.3.3
  [731186ca] + RecursiveArrayTools v2.36.0
  [f2c3362d] + RecursiveFactorization v0.2.17
  [189a3867] + Reexport v1.2.2
  [ae029012] + Requires v1.3.0
  [7e49a35a] + RuntimeGeneratedFunctions v0.5.5
  [94e857df] + SIMDTypes v0.1.0
  [476501e8] + SLEEFPirates v0.6.38
  [0bca4576] + SciMLBase v1.82.0
  [c0aeaf25] + SciMLOperators v0.1.19
  [efcf1570] + Setfield v1.1.1
  [66db9d55] + SnoopPrecompile v1.0.3
  [e56a9233] + Sparspak v0.3.8
  [276daf66] + SpecialFunctions v2.1.7
  [aedffcd0] + Static v0.8.3
  [90137ffa] + StaticArrays v1.5.12
  [1e83bf80] + StaticArraysCore v1.4.0
  [7792a7ef] + StrideArraysCore v0.4.6
  [2efcf032] + SymbolicIndexingInterface v0.2.1
  [3783bdb8] + TableTraits v1.0.1
  [bd369af6] + Tables v1.10.0
  [8290d209] + ThreadingUtilities v0.5.1
  [d5829a12] + TriangularSolve v0.1.19
  [410a4b4d] + Tricks v0.1.6
  [3a884ed6] + UnPack v1.0.2
  [3d5dd08c] + VectorizationBase v0.21.58
  [700de1a5] + ZygoteRules v0.2.2
  [efe28fd5] + OpenSpecFun_jll v0.5.5+0
  [0dad84c5] + ArgTools v1.1.1
  [56f22d72] + Artifacts
  [2a0f44e3] + Base64
  [ade2ca70] + Dates
  [8ba89e20] + Distributed
  [f43a241f] + Downloads v1.6.0
  [7b1f6079] + FileWatching
  [9fa8497b] + Future
  [b77e0a4c] + InteractiveUtils
  [b27032c2] + LibCURL v0.6.3
  [76f85450] + LibGit2
  [8f399da3] + Libdl
  [37e2e46d] + LinearAlgebra
  [56ddb016] + Logging
  [d6f4376e] + Markdown
  [ca575930] + NetworkOptions v1.2.0
  [44cfe95a] + Pkg v1.8.0
  [de0858da] + Printf
  [3fa0cd96] + REPL
  [9a3f8284] + Random
  [ea8e919c] + SHA v0.7.0
  [9e88b42a] + Serialization
  [6462fe0b] + Sockets
  [2f01184e] + SparseArrays
  [10745b16] + Statistics
  [4607b0f0] + SuiteSparse
  [fa267f1f] + TOML v1.0.0
  [a4e569a6] + Tar v1.10.1
  [8dfed614] + Test
  [cf7118a7] + UUIDs
  [4ec0a83e] + Unicode
  [e66e0078] + CompilerSupportLibraries_jll v1.0.1+0
  [deac9b47] + LibCURL_jll v7.84.0+0
  [29816b5a] + LibSSH2_jll v1.10.2+0
  [c8ffd9c3] + MbedTLS_jll v2.28.0+0
  [14a3606d] + MozillaCACerts_jll v2022.2.1
  [4536629a] + OpenBLAS_jll v0.3.20+0
  [05823500] + OpenLibm_jll v0.8.1+0
  [bea87d4a] + SuiteSparse_jll v5.10.1+0
  [83775a58] + Zlib_jll v1.2.12+3
  [8e850b90] + libblastrampoline_jll v5.1.1+0
  [8e850ede] + nghttp2_jll v1.48.0+0
  [3f19e933] + p7zip_jll v17.4.0+0
Precompiling project...
  88 dependencies successfully precompiled in 42 seconds

(@v1.8) pkg>

Can you list what is in your global environment (with Pkg.status()? )

Here’s the environment:

(@v1.8) pkg> status
Status `~/.julia/environments/v1.8/Project.toml`
  [28f2ccd6] ApproxFun v0.13.14
  [bcd4f6db] DelayDiffEq v5.40.6
  [0c46a032] DifferentialEquations v7.6.0
⌅ [5b8099bc] DomainSets v0.5.15
  [61744808] DynamicalSystems v2.3.2
  [86223c79] Graphs v1.7.4
  [23fbe1c1] Latexify v0.15.18
  [7ed4a6bd] LinearSolve v1.35.0
  [94925ecb] MethodOfLines v0.8.2
  [961ee093] ModelingToolkit v8.46.0
  [8913a72c] NonlinearSolve v1.3.0
  [1dea7af3] OrdinaryDiffEq v6.41.0
  [91a5bcdd] Plots v1.38.4
  [e56a9233] Sparspak v0.3.8
  [789caeaf] StochasticDiffEq v6.57.4
Info Packages marked with ⌅ have new versions available but compatibility constraints restrict them from upgrading. To see why use `status --outdated`

When I just add sparspak:

(@v1.8) pkg> add Sparspak
   Resolving package versions...
  No Changes to `~/.julia/environments/v1.8/Project.toml`
  No Changes to `~/.julia/environments/v1.8/Manifest.toml`

When I try to precompile, however I get the above error. Is there any package that I am missing?

No I dont’t think you miss anything. Devs try to dig down…
How did you install Julia ? What is your version of homebrew?

Can you join the discussion on Package not Precompiling · Issue #271 · SciML/LinearSolve.jl · GitHub ?

In the moment it seems that this is a bug in the homebrew Julia build, and that the problem goes away when switching to a Julia version dowloaded from the Julia homepage.