Skip to content

Check the FMA requirement of libsparseir at load (#164) - #170

Merged
shinaoka merged 1 commit into
mainfrom
feat/fma-check
Oct 29, 2026
Merged

shinaoka merged 1 commit into
mainfrom
feat/fma-check

Conversation

@shinaoka

Copy link
Copy Markdown
Member

Part of #164, following SpM-lab/sparse-ir-rs#350 (which adds spir_build_uses_fma / spir_cpu_has_fma).

  • __init__ calls the two functions through Libdl.dlsym_e before the BLAS backend is set up. If the library uses FMA and the CPU lacks it, it throws a SparseIRError naming the requirement and the local -fma build, instead of the process dying with SIGILL.
  • A library without the symbols (every libsparseir_jll released so far) is not checked, so this is safe to merge before the JLL that has them.
  • README: the CPU requirement and the workaround RUSTFLAGS="-C target-feature=-fma" julia -e 'using Pkg; Pkg.build("SparseIR")'.
  • test/spir/cpu_tests.jl: the decision for all four combinations, and the check on the loaded library.

Local: Pkg.test() 56/56 items, 17734 passes (Julia 1.12.5, current JLL).

#164 stays open until the JLL with the check is released and the compat is bumped (its documentation and JLL-flavour items belong to that release).

🤖 Generated with Claude Code

…cks it

__init__ calls spir_build_uses_fma and spir_cpu_has_fma (sparse-ir-rs#332)
before anything in the library runs, and throws a SparseIRError naming the
requirement and the -fma local build instead of dying with SIGILL. A
library without the two symbols (every JLL up to now) is not checked. The
README states the requirement and the workaround.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@shinaoka
shinaoka merged commit d721bfc into main Oct 29, 2026
17 checks passed
@shinaoka
shinaoka deleted the feat/fma-check branch October 29, 2026 06:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant