SciML / LinearSolve.jl

LinearSolve.jl: High-Performance Unified Interface for Linear Solvers in Julia. Easily switch between factorization and Krylov methods, add preconditioners, and all in one interface.
https://docs.sciml.ai/LinearSolve/stable/
Other
241 stars 52 forks source link

ERROR: Failed to precompile LinearSolve #433

Closed cwittens closed 9 months ago

cwittens commented 9 months ago

When I'm trying to use LinearSolve I get the following error message:


julia> versioninfo()
Julia Version 1.9.3
Commit bed2cd540a (2023-08-24 14:43 UTC)
Build Info:
  Official https://julialang.org/ release
Platform Info:
  OS: Windows (x86_64-w64-mingw32)
  CPU: 8 × 11th Gen Intel(R) Core(TM) i7-1185G7 @ 3.00GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-14.0.6 (ORCJIT, tigerlake)
  Threads: 1 on 8 virtual cores
Environment:
  JULIA_EDITOR = code
  JULIA_NUM_THREADS =

julia> Pkg.activate(temp = true)
  Activating new project at `C:\Users\colli\AppData\Local\Temp\jl_IfJGCK`

julia> Pkg.add("LinearSolve")
   Resolving package versions...
    Updating `C:\Users\colli\AppData\Local\Temp\jl_IfJGCK\Project.toml`
  [7ed4a6bd] + LinearSolve v2.20.0
    Updating `C:\Users\colli\AppData\Local\Temp\jl_IfJGCK\Manifest.toml`
  [47edcb42] + ADTypes v0.2.4
  [7d9f7c33] + Accessors v0.1.33
  [79e6a3ab] + Adapt v3.7.1
  [4fba245c] + ArrayInterface v7.5.1
  [62783981] + BitTwiddlingConvenienceFunctions v0.1.5
  [2a0fbf3d] + CPUSummary v0.2.4
  [49dc2e85] + Calculus v0.5.1
  [fb6a15b2] + CloseOpenIntervals v0.1.12
  [38540f10] + CommonSolve v0.2.4
  [34da2185] + Compat v4.10.0
  [a33af91c] + CompositionsBase v0.1.2
  [2569d6c7] + ConcreteStructs v0.2.3
  [187b0558] + ConstructionBase v1.5.4
  [adafc99b] + CpuId v0.3.1
  [9a962f9c] + DataAPI v1.15.0
  [864edb3b] + DataStructures v0.18.15
  [e2d170a0] + DataValueInterfaces v1.0.0
  [8bb1440f] + DelimitedFiles v1.9.1
  [31c24e10] + Distributions v0.25.103
  [ffbed154] + DocStringExtensions v0.9.3
  [fa6b7ba4] + DualNumbers v0.6.8
  [4e289a0a] + EnumX v1.0.4
  [f151be2c] + EnzymeCore v0.6.3
  [e2ba6199] + ExprTools v0.1.10
  [29a986be] + FastLapackInterface v2.0.0
  [1a297f60] + FillArrays v1.7.0
  [069b7b12] + FunctionWrappers v1.1.3
  [77dc65aa] + FunctionWrappersWrappers v0.1.3
  [46192b85] + GPUArraysCore v0.1.5
  [3e5b6fbb] + HostCPUFeatures v0.1.16
  [34004b35] + HypergeometricFunctions v0.3.23
  [615f187c] + IfElse v0.1.1
  [18e54dd8] + IntegerMathUtils v0.1.2
  [3587e190] + InverseFunctions v0.1.12
  [92d709cd] + IrrationalConstants v0.2.2
  [82899510] + IteratorInterfaceExtensions v1.0.0
  [692b3bcd] + JLLWrappers v1.5.0
  [ef3ab10e] + KLU v0.4.1
  [ba0b0d4f] + Krylov v0.9.4
  [73f95e8e] + LatticeRules v0.0.1
  [10f19ff3] + LayoutPointers v0.1.15
  [50d2b5c4] + Lazy v0.15.1
  [7ed4a6bd] + LinearSolve v2.20.0
  [2ab3a3ac] + LogExpFunctions v0.3.26
  [bdcacae8] + LoopVectorization v0.12.166
  [1914dd2f] + MacroTools v0.5.11
  [d125e4d3] + ManualMemory v0.1.8
  [e1d29d7a] + Missings v1.1.0
  [77ba4419] + NaNMath v1.0.2
  [6fe1bfb0] + OffsetArrays v1.12.10
  [bac558e1] + OrderedCollections v1.6.2
  [90014a1f] + PDMats v0.11.29
  [f517fe37] + Polyester v0.7.9
  [1d0040c9] + PolyesterWeave v0.2.1
  [aea7be01] + PrecompileTools v1.2.0
  [21216c6a] + Preferences v1.4.1
  [27ebfcd6] + Primes v0.5.5
  [1fd47b50] + QuadGK v2.9.1
  [8a4e6c94] + QuasiMonteCarlo v0.3.2
  [3cdcf5f2] + RecipesBase v1.3.4
  [731186ca] + RecursiveArrayTools v2.38.10
  [f2c3362d] + RecursiveFactorization v0.2.21
  [189a3867] + Reexport v1.2.2
  [ae029012] + Requires v1.3.0
  [79098fc4] + Rmath v0.7.1
  [7e49a35a] + RuntimeGeneratedFunctions v0.5.12
  [94e857df] + SIMDTypes v0.1.0
  [476501e8] + SLEEFPirates v0.6.42
  [0bca4576] + SciMLBase v2.8.0
  [c0aeaf25] + SciMLOperators v0.3.7
  [efcf1570] + Setfield v1.1.1
  [ed01d8cd] + Sobol v1.5.0
  [a2af1166] + SortingAlgorithms v1.2.0
  [e56a9233] + Sparspak v0.3.9
  [276daf66] + SpecialFunctions v2.3.1
  [aedffcd0] + Static v0.8.8
  [0d7ed370] + StaticArrayInterface v1.4.1
  [1e83bf80] + StaticArraysCore v1.4.2
  [82ae8749] + StatsAPI v1.7.0
  [2913bbd2] + StatsBase v0.34.2
  [4c63d2b9] + StatsFuns v1.3.0
  [7792a7ef] + StrideArraysCore v0.5.1
  [2efcf032] + SymbolicIndexingInterface v0.2.2
  [3783bdb8] + TableTraits v1.0.1
  [bd369af6] + Tables v1.11.1
  [8290d209] + ThreadingUtilities v0.5.2
  [d5829a12] + TriangularSolve v0.1.20
  [410a4b4d] + Tricks v0.1.8
  [781d530d] + TruncatedStacktraces v1.4.0
  [3a884ed6] + UnPack v1.0.2
  [3d5dd08c] + VectorizationBase v0.21.64
  [1d5cc7b8] + IntelOpenMP_jll v2023.2.0+0
  [856f044c] + MKL_jll v2023.2.0+0
  [efe28fd5] + OpenSpecFun_jll v0.5.5+0
  [f50d1b31] + Rmath_jll v0.4.0+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
  [4af54fe1] + LazyArtifacts
  [b27032c2] + LibCURL v0.6.3
  [76f85450] + LibGit2
  [8f399da3] + Libdl
  [37e2e46d] + LinearAlgebra
  [56ddb016] + Logging
  [d6f4376e] + Markdown
  [a63ad114] + Mmap
  [ca575930] + NetworkOptions v1.2.0
  [44cfe95a] + Pkg v1.9.2
  [de0858da] + Printf
  [3fa0cd96] + REPL
  [9a3f8284] + Random
  [ea8e919c] + SHA v0.7.0
  [9e88b42a] + Serialization
  [6462fe0b] + Sockets
  [2f01184e] + SparseArrays
  [10745b16] + Statistics v1.9.0
  [4607b0f0] + SuiteSparse
  [fa267f1f] + TOML v1.0.3
  [a4e569a6] + Tar v1.10.0
  [8dfed614] + Test
  [cf7118a7] + UUIDs
  [4ec0a83e] + Unicode
  [e66e0078] + CompilerSupportLibraries_jll v1.0.5+0
  [deac9b47] + LibCURL_jll v7.84.0+0
  [29816b5a] + LibSSH2_jll v1.10.2+0
  [c8ffd9c3] + MbedTLS_jll v2.28.2+0
  [14a3606d] + MozillaCACerts_jll v2022.10.11
  [4536629a] + OpenBLAS_jll v0.3.21+4
  [05823500] + OpenLibm_jll v0.8.1+0
  [bea87d4a] + SuiteSparse_jll v5.10.1+6
  [83775a58] + Zlib_jll v1.2.13+0
  [8e850b90] + libblastrampoline_jll v5.8.0+0
  [8e850ede] + nghttp2_jll v1.48.0+0
  [3f19e933] + p7zip_jll v17.4.0+0
Precompiling project...
  ✗ LinearSolve
  ✗ LinearSolve → LinearSolveRecursiveArrayToolsExt
  0 dependencies successfully precompiled in 18 seconds. 113 already precompiled.
  2 dependencies errored. To see a full report either run `import Pkg; Pkg.precompile()` or load the packages

julia> using LinearSolve
[ Info: Precompiling LinearSolve [7ed4a6bd-45f5-4d41-b270-4a48e9bafcae]
ERROR: LoadError: InitError: could not load library "C:\Users\colli\.julia\artifacts\6288063f1c2040dd23c7710d999838037ec279a5\bin\mkl_core.2.dll"
The specified module could not be found.
Stacktrace:
  [1] dlopen(s::String, flags::UInt32; throw_error::Bool)
    @ Base.Libc.Libdl .\libdl.jl:117
  [2] dlopen(s::String, flags::UInt32)
    @ Base.Libc.Libdl .\libdl.jl:116
  [3] macro expansion
    @ C:\Users\colli\.julia\packages\JLLWrappers\pG9bm\src\products\library_generators.jl:63 [inlined]
  [4] __init__()
    @ MKL_jll C:\Users\colli\.julia\packages\MKL_jll\8Hu7G\src\wrappers\x86_64-w64-mingw32.jl:10
  [5] register_restored_modules(sv::Core.SimpleVector, pkg::Base.PkgId, path::String)
    @ Base .\loading.jl:1115
  [6] _include_from_serialized(pkg::Base.PkgId, path::String, ocachepath::String, depmods::Vector{Any})
    @ Base .\loading.jl:1061
  [7] _require_search_from_serialized(pkg::Base.PkgId, sourcepath::String, build_id::UInt128)
    @ Base .\loading.jl:1506
  [8] _require(pkg::Base.PkgId, env::String)
    @ Base .\loading.jl:1783
  [9] _require_prelocked(uuidkey::Base.PkgId, env::String)
    @ Base .\loading.jl:1660
 [10] macro expansion
    @ .\loading.jl:1648 [inlined]
 [11] macro expansion
    @ .\lock.jl:267 [inlined]
 [12] require(into::Module, mod::Symbol)
    @ Base .\loading.jl:1611
 [13] top-level scope
    @ C:\Users\colli\.julia\packages\Preferences\TTEAN\src\Preferences.jl:45
 [14] include
    @ .\Base.jl:457 [inlined]
 [15] 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, UInt128}}, source::Nothing)
    @ Base .\loading.jl:2049
 [16] top-level scope
    @ stdin:3
during initialization of module MKL_jll
in expression starting at C:\Users\colli\.julia\packages\LinearSolve\binjx\src\LinearSolve.jl:1
in expression starting at stdin:3
ERROR: Failed to precompile LinearSolve [7ed4a6bd-45f5-4d41-b270-4a48e9bafcae] to "C:\\Users\\colli\\.julia\\compiled\\v1.9\\LinearSolve\\jl_5C4D.tmp".
Stacktrace:
  [1] error(s::String)
    @ Base .\error.jl:35
  [2] compilecache(pkg::Base.PkgId, path::String, internal_stderr::IO, internal_stdout::IO, keep_loaded_modules::Bool)
    @ Base .\loading.jl:2300
  [3] compilecache
    @ .\loading.jl:2167 [inlined]
  [4] _require(pkg::Base.PkgId, env::String)
    @ Base .\loading.jl:1805
  [5] _require_prelocked(uuidkey::Base.PkgId, env::String)
    @ Base .\loading.jl:1660
  [6] macro expansion
    @ .\loading.jl:1648 [inlined]
  [7] macro expansion
    @ .\lock.jl:267 [inlined]
  [8] require(into::Module, mod::Symbol)
    @ Base .\loading.jl:1611
  [9] eval
    @ .\boot.jl:370 [inlined]
 [10] eval
    @ .\Base.jl:68 [inlined]
 [11] repleval(m::Module, code::Expr, #unused#::String)
    @ VSCodeServer c:\Users\colli\.vscode\extensions\julialang.language-julia-1.57.2\scripts\packages\VSCodeServer\src\repl.jl:229
 [12] (::VSCodeServer.var"#110#112"{Module, Expr, REPL.LineEditREPL, REPL.LineEdit.Prompt})()
    @ VSCodeServer c:\Users\colli\.vscode\extensions\julialang.language-julia-1.57.2\scripts\packages\VSCodeServer\src\repl.jl:192
 [13] with_logstate(f::Function, logstate::Any)
    @ Base.CoreLogging .\logging.jl:514
 [14] with_logger
    @ .\logging.jl:626 [inlined]
 [15] (::VSCodeServer.var"#109#111"{Module, Expr, REPL.LineEditREPL, REPL.LineEdit.Prompt})()
    @ VSCodeServer c:\Users\colli\.vscode\extensions\julialang.language-julia-1.57.2\scripts\packages\VSCodeServer\src\repl.jl:193
 [16] #invokelatest#2
    @ .\essentials.jl:819 [inlined]
 [17] invokelatest(::Any)
    @ Base .\essentials.jl:816
 [18] macro expansion
    @ c:\Users\colli\.vscode\extensions\julialang.language-julia-1.57.2\scripts\packages\VSCodeServer\src\eval.jl:34 [inlined]
 [19] (::VSCodeServer.var"#62#63")()
    @ VSCodeServer .\task.jl:514

julia> Pkg.precompile()
Precompiling project...
  ✗ LinearSolve
  ✗ LinearSolve → LinearSolveRecursiveArrayToolsExt
  0 dependencies successfully precompiled in 20 seconds. 113 already precompiled.

ERROR: The following 1 direct dependency failed to precompile:

LinearSolve [7ed4a6bd-45f5-4d41-b270-4a48e9bafcae]

Failed to precompile LinearSolve [7ed4a6bd-45f5-4d41-b270-4a48e9bafcae] to "C:\\Users\\colli\\.julia\\compiled\\v1.9\\LinearSolve\\jl_C1F0.tmp".
ERROR: LoadError: InitError: could not load library "C:\Users\colli\.julia\artifacts\6288063f1c2040dd23c7710d999838037ec279a5\bin\mkl_core.2.dll"
The specified module could not be found.
Stacktrace:
  [1] dlopen(s::String, flags::UInt32; throw_error::Bool)
    @ Base.Libc.Libdl .\libdl.jl:117
  [2] dlopen(s::String, flags::UInt32)
    @ Base.Libc.Libdl .\libdl.jl:116
  [3] macro expansion
    @ C:\Users\colli\.julia\packages\JLLWrappers\pG9bm\src\products\library_generators.jl:63 [inlined]
  [4] __init__()
    @ MKL_jll C:\Users\colli\.julia\packages\MKL_jll\8Hu7G\src\wrappers\x86_64-w64-mingw32.jl:10
  [5] register_restored_modules(sv::Core.SimpleVector, pkg::Base.PkgId, path::String)
    @ Base .\loading.jl:1115
  [6] _include_from_serialized(pkg::Base.PkgId, path::String, ocachepath::String, depmods::Vector{Any})
    @ Base .\loading.jl:1061
  [7] _require_search_from_serialized(pkg::Base.PkgId, sourcepath::String, build_id::UInt128)
    @ Base .\loading.jl:1506
  [8] _require(pkg::Base.PkgId, env::String)
    @ Base .\loading.jl:1783
  [9] _require_prelocked(uuidkey::Base.PkgId, env::String)
    @ Base .\loading.jl:1660
 [10] macro expansion
    @ .\loading.jl:1648 [inlined]
 [11] macro expansion
    @ .\lock.jl:267 [inlined]
 [12] require(into::Module, mod::Symbol)
    @ Base .\loading.jl:1611
 [13] top-level scope
    @ C:\Users\colli\.julia\packages\Preferences\TTEAN\src\Preferences.jl:45
 [14] include
    @ .\Base.jl:457 [inlined]
 [15] 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, UInt128}}, source::Nothing)
    @ Base .\loading.jl:2049
 [16] top-level scope
    @ stdin:3
during initialization of module MKL_jll
in expression starting at C:\Users\colli\.julia\packages\LinearSolve\binjx\src\LinearSolve.jl:1
in expression starting at stdin:3
Stacktrace:
 [1] pkgerror(msg::String)
   @ Pkg.Types C:\Users\colli\.julia\juliaup\julia-1.9.3+0.x64.w64.mingw32\share\julia\stdlib\v1.9\Pkg\src\Types.jl:69
 [2] precompile(ctx::Pkg.Types.Context, pkgs::Vector{Pkg.Types.PackageSpec}; internal_call::Bool, strict::Bool, warn_loaded::Bool, already_instantiated::Bool, timing::Bool, kwargs::Base.Pairs{Symbol, Base.TTY, Tuple{Symbol}, NamedTuple{(:io,), Tuple{Base.TTY}}})
   @ Pkg.API C:\Users\colli\.julia\juliaup\julia-1.9.3+0.x64.w64.mingw32\share\julia\stdlib\v1.9\Pkg\src\API.jl:1581
 [3] precompile(pkgs::Vector{Pkg.Types.PackageSpec}; io::Base.TTY, kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
   @ Pkg.API C:\Users\colli\.julia\juliaup\julia-1.9.3+0.x64.w64.mingw32\share\julia\stdlib\v1.9\Pkg\src\API.jl:156
 [4] precompile(pkgs::Vector{Pkg.Types.PackageSpec})
   @ Pkg.API C:\Users\colli\.julia\juliaup\julia-1.9.3+0.x64.w64.mingw32\share\julia\stdlib\v1.9\Pkg\src\API.jl:145
 [5] precompile(; name::Nothing, uuid::Nothing, version::Nothing, url::Nothing, rev::Nothing, path::Nothing, mode::Pkg.Types.PackageMode, subdir::Nothing, kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
   @ Pkg.API C:\Users\colli\.julia\juliaup\julia-1.9.3+0.x64.w64.mingw32\share\julia\stdlib\v1.9\Pkg\src\API.jl:171
 [6] precompile()
   @ Pkg.API C:\Users\colli\.julia\juliaup\julia-1.9.3+0.x64.w64.mingw32\share\julia\stdlib\v1.9\Pkg\src\API.jl:162
 [7] top-level scope
   @ REPL[7]:1
ChrisRackauckas commented 9 months ago

It looks like something happened with the MKL artifact. Did you try rebuilding? Is this a standard binary from https://julialang.org/downloads/ ?

cwittens commented 9 months ago

Yes it is the standard binary.


Options:
  -h, --help     Print help
  -V, --version  Print version

C:\Users\colli>juliaup status
 Default  Channel  Version                  Update
---------------------------------------------------
       *  release  1.9.3+0.x64.w64.mingw32
giordano commented 9 months ago

@cwittens can you please confirm whether you have the file C:\Users\colli\.julia\artifacts\6288063f1c2040dd23c7710d999838037ec279a5\bin\mkl_core.2.dll on disk? If so, can you try to debug it following the example at https://github.com/JuliaPackaging/Yggdrasil/issues/7508#issuecomment-1769742338? At least that should point out to what library is missing. I'm not familiar with Windows at all, so don't ask me much more than what I linked already :slightly_smiling_face:

cwittens commented 9 months ago

The folder C:\Users\colli\.julia\artifacts\6288063f1c2040dd23c7710d999838037ec279a5\ did exist but it was empty. What I did is I deleted the folder and tried to use LinearSolve and I took some time, but now it is working just fine. Thank you!

julia> using Pkg

julia> Pkg.add("LinearSolve")
   Resolving package versions...
  No Changes to `C:\Users\colli\.julia\environments\v1.9\Project.toml`
  No Changes to `C:\Users\colli\.julia\environments\v1.9\Manifest.toml`

julia> using LinearSolve
[ Info: Precompiling LinearSolve [7ed4a6bd-45f5-4d41-b270-4a48e9bafcae]
  Downloaded artifact: MKL
[ Info: Precompiling LinearSolveRecursiveArrayToolsExt [04950c4b-5bc4-5740-952d-02d2c1eb583a]

julia> using LinearSolve