On 8/7/21 2:23 am, Jerry Morrison wrote:
> Got it!
>
> *Summary:*
> * Installing a numpy wheel (e.g. `pip install numpy==1.21.0`) uses its
> embedded OpenBLAS on every platform that has a wheel.
> That OpenBLAS is always compiled with gcc/gfortran.
> In this case, `np.show_config()` reports `library_dirs =
> ['/usr/local/lib']` even though there's no libblas in that directory.
>
> * Installing numpy from source (e.g. `pip install numpy==1.21.0
> --no-binary numpy)` looks for BLAS & LAPACK libraries at build time as
> influenced by the environment vars NPY_BLAS_ORDER/NPY_LAPACK_ORDER or
> by the file ~/.numpy-site.cfg.
> On macOS, 'accelerate' is in the default search order after 'openblas'.
> On macOS < 11.3, importing numpy that's linked to Accelerate will
> detect an Accelerate bug and raise a RuntimeError.
That seems correct, although admittedly show_config could do a better
job. The problem is that not every BLAS implementation provides a
convenient method to self-report.
For implementations that don't self-report, could show_config detect that it's using embedded OpenBLAS or a system Accelerate library?
It might be nice to document all this somewhere more permanent, the
docstring for show_config might be a good place to start.
Do you want a PR? (How to get the translations?)