I ran into a macOS/x86_64 precompilation failure while testing another package against SparseIR 2.x, and I was able to reduce it to using SparseIR in a fresh environment.
Reproducer
mkdir /tmp/sparseir-x64-repro
julia +1~x64 --startup-file=no --project=/tmp/sparseir-x64-repro -e 'using Pkg; Pkg.add(name="SparseIR", version="2.1.2")'
julia +1~x64 --startup-file=no --project=/tmp/sparseir-x64-repro -e 'using SparseIR'
Observed error
ERROR: LoadError: UndefVarError: `libsparseir` not defined in `libsparseir_jll`
Suggestion: check for spelling errors or missing imports.
Stacktrace:
[1] getproperty
@ ./Base_compiler.jl:47 [inlined]
[2] get_libsparseir()
@ SparseIR.C_API ~/.julia/packages/SparseIR/.../src/C_API.jl:15
[3] top-level scope
@ ~/.julia/packages/SparseIR/.../src/C_API.jl:19
Further reduction
This seems to come from the JLL rather than from OvercompleteIR or any downstream package.
In a fresh x86_64 Julia environment:
mkdir /tmp/libsparseir-jll-x64-repro
julia +1~x64 --startup-file=no --project=/tmp/libsparseir-jll-x64-repro -e 'using Pkg; Pkg.add(name="libsparseir_jll", version="0.8.4")'
julia +1~x64 --startup-file=no --project=/tmp/libsparseir-jll-x64-repro -e 'using libsparseir_jll; println(isdefined(libsparseir_jll, :libsparseir)); println(filter(x -> occursin("sparse", String(x)), names(libsparseir_jll; all=true, imported=true)))'
prints
whereas on arm64 macOS the analogous check gives
true
[:get_libsparseir_path, :libsparseir, :libsparseir_handle, :libsparseir_jll, :libsparseir_path, Symbol("#get_libsparseir_path")]
I also checked the installed libsparseir_jll package contents locally. Its src/wrappers/ directory contains
aarch64-apple-darwin.jl
aarch64-linux-gnu.jl
powerpc64le-linux-gnu.jl
x86_64-linux-gnu.jl
x86_64-unknown-freebsd.jl
x86_64-w64-mingw32.jl
but there is no x86_64-apple-darwin.jl, and Artifacts.toml likewise has no x86_64 macOS entry.
So I think the immediate problem is that the current libsparseir_jll release is missing the macOS x86_64 wrapper/artifact, and SparseIR then fails when it expects libsparseir_jll.libsparseir to exist.
Environment
- macOS 26.4
- Julia 1.12.5 x86_64 (
julia +1~x64 via juliaup)
- SparseIR 2.1.2
- libsparseir_jll 0.8.4+0
On the same machine, the arm64 Julia build does not have this problem.
I ran into a macOS/x86_64 precompilation failure while testing another package against SparseIR 2.x, and I was able to reduce it to
using SparseIRin a fresh environment.Reproducer
Observed error
Further reduction
This seems to come from the JLL rather than from OvercompleteIR or any downstream package.
In a fresh x86_64 Julia environment:
prints
whereas on arm64 macOS the analogous check gives
I also checked the installed
libsparseir_jllpackage contents locally. Itssrc/wrappers/directory containsaarch64-apple-darwin.jlaarch64-linux-gnu.jlpowerpc64le-linux-gnu.jlx86_64-linux-gnu.jlx86_64-unknown-freebsd.jlx86_64-w64-mingw32.jlbut there is no
x86_64-apple-darwin.jl, andArtifacts.tomllikewise has nox86_64macOS entry.So I think the immediate problem is that the current
libsparseir_jllrelease is missing the macOS x86_64 wrapper/artifact, and SparseIR then fails when it expectslibsparseir_jll.libsparseirto exist.Environment
julia +1~x64via juliaup)On the same machine, the arm64 Julia build does not have this problem.