# Precompile error in DifferentialEquations.jl

**URL:** <https://discourse.julialang.org/t/precompile-error-in-differentialequations-jl/94086>\
**Category:** New to Julia\
**Tags:** question, package, diffeq\
**Created:** [February 5, 2023, 10:07am UTC](https://discourse.julialang.org/t/precompile-error-in-differentialequations-jl/94086 "2023-02-05T10:07:35Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![jredondo](https://avatars.discourse-cdn.com/v4/letter/j/ac8455/32.png) [@jredondo](https://discourse.julialang.org/u/jredondo)\
**Post date:** [February 5, 2023, 10:07am UTC](https://discourse.julialang.org/t/precompile-error-in-differentialequations-jl/94086/1 "2023-02-05T10:07:35Z")

</div>

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](https://docs.sciml.ai/Overview/stable/getting_started/first_simulation/)). However, when I try to do

```plaintext
   Pkg.add("DifferentialEquations")

```

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

```julia
**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
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 🙂

---

_[View the full topic](https://discourse.julialang.org/t/precompile-error-in-differentialequations-jl/94086)._
