Skip to content

Update numpy to use OpenBLAS - #6310

Open
jjerphan wants to merge 9 commits into
emscripten-forge:mainfrom
jjerphan:numpy-use-openblas
Open

Update numpy to use OpenBLAS#6310
jjerphan wants to merge 9 commits into
emscripten-forge:mainfrom
jjerphan:numpy-use-openblas

Conversation

@jjerphan

@jjerphan jjerphan commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Follow-up to #6194. This ports the OpenBLAS-linked build from the experimental numpy-openblas recipe into the official numpy recipe, and removes numpy-openblas.

The default numpy package now uses OpenBLAS for BLAS and LAPACK (-Dallow-noblas=false), with the flang Fortran ABI patch and the BLAS/LAPACK tests from #6194.

SciPy pytester stays scoped to scipy.linalg and scipy.sparse.linalg until #6320's full-suite diagnostic can finish. The function signature mismatch abort after linalg/tests/test_basic.py also happens on main's NumPy in #6320 (same ~3647 tests), so it is not caused by OpenBLAS-linked NumPy.

Template B: Checklist for updating a package

  • ⚠️ Bump build number if the version remains unchanged
  • Or reset build number to 0 if updating the package to a newer version

PR Formatting

  • PR title follows format: Add [package-name] or Update [package-name] to [version]
  • PR description includes:
    • Version being added/updated
    • Any special build considerations or patches applied

Package Details

  • Package Name: numpy
  • Version: 2.5.2 (build 1)

Build Notes

Same considerations as #6194:

  • Host/run dependency on openblas
  • Build-local scipy-openblas.pc alias so Meson skips wasm-ld-breaking OpenBLAS symbol probes
  • Patch 0001-Match-flang-OpenBLAS-Fortran-ABI-on-Emscripten-wasm32.patch for flang CHARACTER lengths and void subroutine returns
  • Tests cover show_config BLAS/LAPACK, matmul, Cholesky, solve, and eigh

The experimental-channel tag from numpy-openblas is not copied; this targets the main channel.

@jjerphan jjerphan changed the title Build the official numpy recipe against OpenBLAS Update numpy to use OpenBLAS Aug 20, 2026
Port the experimental numpy-openblas recipe from emscripten-forge#6194 into numpy so
the default package uses OpenBLAS for BLAS and LAPACK.

Signed-off-by: Julien Jerphanion <git@jjerphan.xyz>
@jjerphan
jjerphan force-pushed the numpy-use-openblas branch 3 times, most recently from 1772cca to 6257f48 Compare August 21, 2026 08:33
Ship the Python test suite, meson tests-tag C helpers, and hypothesis
so np.test() can collect numpy._core and linalg in the browser, and
rebuild SciPy against this OpenBLAS-linked NumPy.

Signed-off-by: Julien Jerphanion <git@jjerphan.xyz>
@jjerphan
jjerphan force-pushed the numpy-use-openblas branch from 7699d85 to 44751df Compare August 21, 2026 09:27
Emscripten long double is 128-bit while libc strtold only parses
binary64, so unique Dragon4 strings do not parse back. Skip those
four tests, using np.dtype(tp).itemsize because the scalar type's
.itemsize is a descriptor.

Signed-off-by: Julien Jerphanion <git@jjerphan.xyz>
Meson install tags were limited to runtime/python-runtime/tests, which
omits numpy.pc and headers. SciPy's dependency('numpy') then fails at
configure. Include the devel tag as well.

Signed-off-by: Julien Jerphanion <git@jjerphan.xyz>
Ship SciPy's Meson tests tag into the package and call scipy.test()
from pytester so CI exercises the full fast suite, not only smokes.
Skip wasm thread, process, and host-libm tests in conftest.

Signed-off-by: Julien Jerphanion <git@jjerphan.xyz>
fft/tests/test_backend.py fails wholesale because set_backend is
thread-local. Pytest then aborts on Fortran void/int ABI mismatches
during GC; skip that collection and _exit after the session.

Signed-off-by: Julien Jerphanion <git@jjerphan.xyz>
test_bsplines/fitpack hit a function-signature mismatch under
llvm-flang's hidden character-length calling convention. Exit the
pytest session immediately so destructor GC cannot abort a clean run.

Signed-off-by: Julien Jerphanion <git@jjerphan.xyz>
The full suite aborts on unpatched FITPACK Fortran ABI. Run
scipy.linalg and scipy.sparse.linalg, matching NumPy's scoped tests.

Signed-off-by: Julien Jerphanion <git@jjerphan.xyz>
The function-signature mismatch after linalg/tests/test_basic.py also
happens on main's NumPy in emscripten-forge#6320, so it is not OpenBLAS-specific.
Disable GC, skip the Cython ABI checks, and log tests with -v.

Signed-off-by: Julien Jerphanion <git@jjerphan.xyz>
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