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
244 stars 52 forks source link

2.31 does not precompile #519

Closed ViralBShah closed 1 month ago

ViralBShah commented 1 month ago
julia> using LinearSolve
 │ Package LinearSolve not found, but a package named LinearSolve is available
 │ from a registry. 
 │ Install package?
 │   (@v1.10) pkg> add LinearSolve 
 └ (y/n/o) [y]: 
   Resolving package versions...
    Updating `~/.julia/environments/v1.10/Project.toml`
  [7ed4a6bd] + LinearSolve v2.31.0
  No Changes to `~/.julia/environments/v1.10/Manifest.toml`
Precompiling LinearSolve
        Info Given LinearSolve was explicitly requested, output will be shown live 
ERROR: LoadError: This CPU does not provide information on cpuid leaf 0x80000004.
Stacktrace:
 [1] error(s::String)
   @ Base ./error.jl:35
 [2] _throw_unsupported_leaf(leaf::UInt32)
   @ CpuId ~/.julia/packages/CpuId/n7zKC/src/CpuId.jl:38
 [3] cpubrand()
   @ CpuId ~/.julia/packages/CpuId/n7zKC/src/CpuId.jl:337
 [4] top-level scope
   @ ~/.julia/packages/Preferences/enLcN/src/Preferences.jl:54
 [5] include
   @ ./Base.jl:495 [inlined]
 [6] 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:2222
 [7] top-level scope
   @ stdin:3
in expression starting at /Users/viral/.julia/packages/LinearSolve/LWB2D/src/LinearSolve.jl:1
in expression starting at stdin:3
  ✗ LinearSolve
  0 dependencies successfully precompiled in 2 seconds. 109 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 "/Users/viral/.julia/compiled/v1.10/LinearSolve/jl_rnUx7K".
ERROR: LoadError: This CPU does not provide information on cpuid leaf 0x80000004.
Stacktrace:
 [1] error(s::String)
   @ Base ./error.jl:35
 [2] _throw_unsupported_leaf(leaf::UInt32)
   @ CpuId ~/.julia/packages/CpuId/n7zKC/src/CpuId.jl:38
 [3] cpubrand()
   @ CpuId ~/.julia/packages/CpuId/n7zKC/src/CpuId.jl:337
 [4] top-level scope
   @ ~/.julia/packages/Preferences/enLcN/src/Preferences.jl:54
 [5] include
   @ ./Base.jl:495 [inlined]
 [6] 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:2222
 [7] top-level scope
   @ stdin:3
in expression starting at /Users/viral/.julia/packages/LinearSolve/LWB2D/src/LinearSolve.jl:1
in expression starting at stdin:
Stacktrace:
  [1] pkgerror(msg::String)
    @ Pkg.Types ~/.julia/juliaup/julia-1.10.4+0.aarch64.apple.darwin14/share/julia/stdlib/v1.10/Pkg/src/Types.jl:70
  [2] precompile(ctx::Pkg.Types.Context, pkgs::Vector{…}; internal_call::Bool, strict::Bool, warn_loaded::Bool, already_instantiated::Bool, timing::Bool, _from_loading::Bool, kwargs::@Kwargs{…})
    @ Pkg.API ~/.julia/juliaup/julia-1.10.4+0.aarch64.apple.darwin14/share/julia/stdlib/v1.10/Pkg/src/API.jl:1659
  [3] precompile(pkgs::Vector{Pkg.Types.PackageSpec}; io::Base.TTY, kwargs::@Kwargs{_from_loading::Bool})
    @ Pkg.API ~/.julia/juliaup/julia-1.10.4+0.aarch64.apple.darwin14/share/julia/stdlib/v1.10/Pkg/src/API.jl:159
  [4] precompile
    @ ~/.julia/juliaup/julia-1.10.4+0.aarch64.apple.darwin14/share/julia/stdlib/v1.10/Pkg/src/API.jl:147 [inlined]
  [5] #precompile#114
    @ ~/.julia/juliaup/julia-1.10.4+0.aarch64.apple.darwin14/share/julia/stdlib/v1.10/Pkg/src/API.jl:146 [inlined]
  [6] #invokelatest#2
    @ ./essentials.jl:894 [inlined]
  [7] invokelatest
    @ ./essentials.jl:889 [inlined]
  [8] _require(pkg::Base.PkgId, env::String)
    @ Base ./loading.jl:1963
  [9] __require_prelocked(uuidkey::Base.PkgId, env::String)
    @ Base ./loading.jl:1812
 [10] #invoke_in_world#3
    @ ./essentials.jl:926 [inlined]
 [11] invoke_in_world
    @ ./essentials.jl:923 [inlined]
 [12] _require_prelocked(uuidkey::Base.PkgId, env::String)
    @ Base ./loading.jl:1803
 [13] macro expansion
    @ ./loading.jl:1790 [inlined]
 [14] macro expansion
    @ ./lock.jl:267 [inlined]
 [15] __require(into::Module, mod::Symbol)
    @ Base ./loading.jl:1753
 [16] #invoke_in_world#3
    @ ./essentials.jl:926 [inlined]
 [17] invoke_in_world
    @ ./essentials.jl:923 [inlined]
 [18] require(into::Module, mod::Symbol)
    @ Base ./loading.jl:1746
Some type information was truncated. Use `show(err)` to see complete types.
ViralBShah commented 1 month ago
julia> versioninfo()
Julia Version 1.10.4
Commit 48d4fd48430 (2024-06-04 10:41 UTC)
Build Info:
  Official https://julialang.org/ release
Platform Info:
  OS: macOS (arm64-apple-darwin22.4.0)
  CPU: 12 × Apple M2 Max
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-15.0.7 (ORCJIT, apple-m1)
Threads: 1 default, 0 interactive, 1 GC (on 8 virtual cores)
Environment:
  JULIA_IMAGE_THREADS = 8
ChrisRackauckas commented 1 month ago

This was solved in https://github.com/SciML/LinearSolve.jl/pull/521 and the hotfix has already been sent to Pkg.

chriselrod commented 1 month ago

Maybe we should get CI running on apple silicon (or some other ARM CPU)?

# The architecture of the Julia binaries.
#
# Please note that installing aarch64 binaries only makes sense on self-hosted aarch64 runners.
# We currently don't run test builds on that architecture, so we cannot guarantee that the input won't break randomly,
# although there is no reason why it would.

https://github.com/julia-actions/setup-julia What does it take to run on a self-hosted runner?

ChrisRackauckas commented 1 month ago

Maybe. We usually avoid that kind of complication unless the library is actually architecture-specific, since there's no reason to hundreds of extra tests if it's just normal Julia code. LinearSolve is started to get a bit borderline though with its BLAS defaulting.

ViralBShah commented 1 month ago

Apple silicon is in macos-latest on github actions now.