-
-
Notifications
You must be signed in to change notification settings - Fork 11.1k
DOC: BLAS/LAPACK linking rules #19447
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 3 commits
7977994
83f2b22
05d6e61
4452927
8a67d77
e883802
599a72f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -2362,6 +2362,30 @@ def show(): | |||||||||||||||||||||||||||
* ``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. | ||||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This looks good except I'm not finding
Searching site-packages/numpy in one of the virtualenvs that contains numpy with embedded OpenBLAS,
Is the embedded OpenBLAS one of the two shared objects in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this a numpy installed by
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The file listing below is for numpy 1.19.5 installed from a wheel via
(The files for numpy 1.21.0 installed from a wheel look very similar, with one more
This is on MacOS 10.14.6. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The wheels can be examined from the pypi downloads, after all they are renamed zip files. So for macOS the directory is [0] aside: the linux directory is probably meant to be There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. :-) I found it after forcing Judging by the console messages and speed, |
||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
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 | ||||||||||||||||||||||||||||
rgommers marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||||||||||||||||
influenced by the environment variables | ||||||||||||||||||||||||||||
rgommers marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||||||||||||||||
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'. | ||||||||||||||||||||||||||||
rgommers marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||||||||||||||||
Loading a numpy library that's linked to Accelerate on | ||||||||||||||||||||||||||||
macOS < 11.3 will detect an Accelerate bug and raise a | ||||||||||||||||||||||||||||
RuntimeError. | ||||||||||||||||||||||||||||
rgommers marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
Examples | ||||||||||||||||||||||||||||
-------- | ||||||||||||||||||||||||||||
>>> import numpy as np | ||||||||||||||||||||||||||||
|
Uh oh!
There was an error while loading. Please reload this page.