4

I am writing a C extension and would like to take advantage of the linear algebra routines that the numpy libraries are linked to. Is there a cross platform method of getting the path for these? I've looked through most of numpy.distutils.* and haven't found anything like this. I've also tried numpy.show_config() which prints out the correct name of the libraries being linked to but the wrong directory.

My goal is to be able to have access to the low level routines that numpy calls under the hood. I.e. in my C code I'd like to be able to do

dgetrf(&m, &n, a, &lda, ipiv, &info);
// or
LAPACK_dgetrf(&m, &n, a, &lda, ipiv, &info);

Any help or links to documentation is appretiated.

vlovero
  • 190
  • 1
  • 11

1 Answers1

0

Numpy do not implement linear algebra routines and it generally uses OpenBLAS by default on most platforms (possibly the Intel MKL if available assuming Numpy is correctly configured). The information about the linked BLAS are visible with np.show_config(). If you are on Linux, you can list the shared library linked using ldd or objdump or even lsof. On Windows, you can use Process Explorer to see the linked DLL at runtime. There is no cross-platform to get the path to the BLAS library. In fact, the path of np.show_config() is wrong on my Windows (it reference a storage device that does not even exists).

Jérôme Richard
  • 41,678
  • 6
  • 29
  • 59