Skip to content

How to force build system to use a particular BLAS/LAPACK? #14146

@adamjstewart

Description

@adamjstewart

Hi, I'm a Spack developer and I've been playing around with our numpy package for awhile now. One issue that we've continually faced is the inability to tell numpy which BLAS/LAPACK library we want to build with. We will create a site.cfg like:

[openblas]
libraries=openblas
library_dirs=/Users/Adam/spack/opt/spack/darwin-mojave-x86_64/clang-10.0.1-apple/openblas-0.3.6-3yts3o25cqf437oxaa4qzfhiw3swc7j2/lib
rpath=/Users/Adam/spack/opt/spack/darwin-mojave-x86_64/clang-10.0.1-apple/openblas-0.3.6-3yts3o25cqf437oxaa4qzfhiw3swc7j2/lib

which works great... unless MKL is installed on the system, in which case numpy decides to use that instead. Inevitably, the rpath isn't set (because we were never trying to build with MKL), and this leads to many problems at runtime. Some examples:

Recently, we discovered a hack, where we can use a site.cfg like:

[openblas]
libraries=openblas
library_dirs=/Users/Adam/spack/opt/spack/darwin-mojave-x86_64/clang-10.0.1-apple/openblas-0.3.6-3yts3o25cqf437oxaa4qzfhiw3swc7j2/lib
rpath=/Users/Adam/spack/opt/spack/darwin-mojave-x86_64/clang-10.0.1-apple/openblas-0.3.6-3yts3o25cqf437oxaa4qzfhiw3swc7j2/lib
[mkl]
libraries=
library_dirs=
rpath=
[atlas]
libraries=
library_dirs=
rpath=

to prevent numpy from looking for MKL or ATLAS elsewhere. This worked fine, until the release of numpy 1.17.0, when we noticed build failures for numexpr: pydata/numexpr#340

It seems like this isn't the right way to do things. So is there a better way to tell numpy which BLAS/LAPACK implementation to use?

@scheibelp @huqy @robbmcleod @scottwittenburg @s-sajid-ali

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions