Skip to content

macOS x86_64: using SparseIR fails because libsparseir_jll has no libsparseir product #138

@SamuelBadr

Description

@SamuelBadr

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

false
[:libsparseir_jll]

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions