diff options
| author | Jerry Morrison <1fish2@users.noreply.github.com> | 2021-07-09 22:21:11 -0700 |
|---|---|---|
| committer | Jerry Morrison <1fish2@users.noreply.github.com> | 2021-07-09 22:21:11 -0700 |
| commit | 7977994dd6f90eb7b93d9a7dbb3f4ea5523c0442 (patch) | |
| tree | 68fd462f82552c4deb375133830dd928d36ad6c0 /numpy | |
| parent | df9c973f28fb9c0e713db29285b07b57c622652a (diff) | |
| download | numpy-7977994dd6f90eb7b93d9a7dbb3f4ea5523c0442.tar.gz | |
Document BLAS/LAPACK linking rules
... per recent numpy-discussion@python.org discussion.
My aim was to explain the rules clearly including background that developers might need to learn.
I made some guesses to fill in details. For sure let me know whatever's wrong or unclear here.
Should the website installation page https://numpy.org/install/ link to this doc so developers can learn how to install NumPy for their situation?
Diffstat (limited to 'numpy')
| -rw-r--r-- | numpy/distutils/misc_util.py | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/numpy/distutils/misc_util.py b/numpy/distutils/misc_util.py index 60696438f..cf65717b8 100644 --- a/numpy/distutils/misc_util.py +++ b/numpy/distutils/misc_util.py @@ -2362,6 +2362,30 @@ def generate_config_py(target): * ``not found``: dispatched features that are not supported in the system + NumPy BLAS/LAPACK Installation Notes + ------------------------------------ + Installing a numpy wheel (e.g. ``pip install numpy``) includes + an embedded OpenBLAS library on every platform that has a wheel + available. (OpenBLAS implements the BLAS and LAPACK linear + algebra APIs.) In this case, ``show_config()`` reports + ``library_dirs = ['/usr/local/lib']`` per the build time + configuration even if there's no libblas in that directory at + run time. The embedded OpenBLAS is a static link library + compiled with gcc/gfortran. + + Installing numpy from source (e.g. + ``pip install numpy --no-binary numpy)`` looks for BLAS and + LAPACK dynamic link libraries at build time. This search is + influenced by the environment variables + NPY_BLAS_ORDER/NPY_LAPACK_ORDER, if set, and the file + ``~/.numpy-site.cfg``, if present. + On macOS, 'accelerate' (Apple's Accelerate BLAS library) is in + the default search order (but not in numpy 1.20) after + 'openblas'. + Loading a numpy library that's linked to Accelerate on + macOS < 11.3 will detect an Accelerate bug and raise a + RuntimeError. + Examples -------- >>> import numpy as np |
