Skip to content

Fresh Linux install fails to load without system OpenBLAS (undefined symbol: dgemm_) #128

@terasakisatoshi

Description

@terasakisatoshi

Summary

A fresh Linux install/load fails in __init__ with undefined symbol: dgemm_ unless a BLAS library is already present in the global loader namespace.

Reproducer

I reproduced this from the current checkout with a clean temp environment:

using Pkg

temp_env = mktempdir()
Pkg.activate(temp_env)
Pkg.add(path="/path/to/SparseIR.jl")
using SparseIR

I also reproduced the same failure with a local development checkout via:

using Pkg
Pkg.activate(mktempdir())
Pkg.develop(path="/path/to/SparseIR.jl")
Pkg.build("SparseIR")
using SparseIR

Observed output

ERROR: InitError: could not load library ".../deps/libsparse_ir_capi.so"
.../deps/libsparse_ir_capi.so: undefined symbol: dgemm_

Environment

  • Ubuntu runner
  • Julia 1.12.5
  • no system OpenBLAS/BLAS libraries visible from ldconfig -p

Additional observations

  • using LinearAlgebra; using SparseIR still fails with the same dgemm_ error.
  • This workaround makes the package load successfully:
using LinearAlgebra, Libdl
Libdl.dlopen(LinearAlgebra.BLAS.libblastrampoline, Libdl.RTLD_GLOBAL | Libdl.RTLD_LAZY)
using SparseIR
  • The built libsparse_ir_capi.so contains unresolved dgemm_ / zgemm_ symbols.
  • The repo's PkgAdd.yml workflow installs libopenblas-dev before its smoke test, but the README currently says the needed dependencies are installed automatically.

Expected behavior

A fresh install should load with using SparseIR on Linux without requiring an undocumented system OpenBLAS package or a manual Libdl.dlopen(..., RTLD_GLOBAL) workaround.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions