OpenBLAS 32-bit Integer (LP64) Provider for SciPy/NumPy
scipy-openblas32 provides OpenBLAS, a highly optimized BLAS library, packaged as Python wheels. Its primary purpose is to serve as a build and runtime dependency in CI and local development for NumPy and SciPy, and to be vendored into their official wheels. It bundles all necessary gfortran support libraries, making the wheels self-contained. The current version is 0.3.31.188.0, and it maintains an active release cadence driven by the needs of SciPy and NumPy.
Warnings
- breaking Do NOT add a direct runtime dependency on `scipy-openblas32` if your project is not NumPy or SciPy. This is explicitly unsupported and highly likely to lead to breakage or symbol conflicts due to internal changes in this repository or due to NumPy/SciPy starting to depend on a different version. This package is solely for use by SciPy and NumPy.
- gotcha The `scipy-openblas32` package provides the LP64 ABI (32-bit integer size for array indexing in BLAS functions). This is distinct from `scipy-openblas64`, which provides the ILP64 ABI (64-bit integer size). Both packages can be installed on 64-bit systems; the '32' or '64' refers to the integer size used by the BLAS library internally, not the system architecture. SciPy currently *always requires LP64* but can optionally be built with ILP64 support as well.
- gotcha There is no strong guarantee of backwards compatibility for the symbol names or the small Python API (`get_include_dir`, etc.). Projects using `scipy-openblas32` as a build dependency should pin exact versions (e.g., `==`) in their CI/lock files to prevent unexpected breakage.
- gotcha On Windows, dynamic linking of OpenBLAS DLLs can be problematic due to the lack of RPATH support. If not vendored directly into a wheel (as SciPy does), you may need to manually manage the DLL search path using `os.add_dll_directory` or tools like `delvewheel` during custom builds.
- gotcha Mixing OpenBLAS builds (e.g., vendored `pthreads`-based OpenBLAS in wheels with system-installed `OpenMP`-based OpenBLAS) can lead to 'oversubscription' issues, where multiple parallelization mechanisms conflict, potentially degrading performance or causing crashes.
- deprecated The SciPy documentation indicates that the requirement for SciPy to *always* require the LP64 ABI (32-bit integer) is "very likely changing for the 1.18.0 release." This could imply a shift in default ABI preference for SciPy's internal builds, potentially affecting how `scipy-openblas32` is prioritized or used in the future if ILP64 becomes more central.
Install
-
pip install scipy-openblas32
Imports
- get_include_dir
import scipy_openblas32 as so32; so32.get_include_dir()
- get_lib_dir
import scipy_openblas32 as so32; so32.get_lib_dir()
- get_library
import scipy_openblas32 as so32; so32.get_library()
- get_pkg_config
import scipy_openblas32 as so32; so32.get_pkg_config()
Quickstart
import scipy_openblas32 as so32
# This library is typically used by build systems of other packages
# to locate the bundled OpenBLAS libraries for compilation.
# For example, to generate a pkg-config file for a build system:
# (This code snippet demonstrates the *intended interaction* for other libraries)
# In a real build process, the output would be redirected to a file, e.g., scipy-openblas32.pc
print("OpenBLAS include directory:", so32.get_include_dir())
print("OpenBLAS library directory:", so32.get_lib_dir())
print("OpenBLAS pkg-config info:\n", so32.get_pkg_config())