Importing the multiarray numpy extension module failed
I'm trying to install numpy 1.12.0 from source using Intel 17.0.1 MKL and Python 2.7.13, following the instructions at: https://software.intel.com/en-us/articles/numpyscipy-with-intel-mkl
The build succeeds, but when I try to import numpy, I'm seeing:
$ python
Python 2.7.13 (default, Feb 21 2017, 08:45:20)
[GCC Intel(R) C++ gcc 4.4.7 mode] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/blues/gpfs/home/software/spack-0.10.0/opt/spack/linux-centos6-x86_64/intel-17.0.1/py-numpy-1.12.0-r7qapsmckwr6jjvb6llkoufk36g5t36h/lib/python2.7/site-packages/numpy-1.12.0-py2.7-linux-x86_64.egg/numpy/__init__.py", line 142, in <module>
from . import add_newdocs
File "/blues/gpfs/home/software/spack-0.10.0/opt/spack/linux-centos6-x86_64/intel-17.0.1/py-numpy-1.12.0-r7qapsmckwr6jjvb6llkoufk36g5t36h/lib/python2.7/site-packages/numpy-1.12.0-py2.7-linux-x86_64.egg/numpy/add_newdocs.py", line 13, in <module>
from numpy.lib import add_newdoc
File "/blues/gpfs/home/software/spack-0.10.0/opt/spack/linux-centos6-x86_64/intel-17.0.1/py-numpy-1.12.0-r7qapsmckwr6jjvb6llkoufk36g5t36h/lib/python2.7/site-packages/numpy-1.12.0-py2.7-linux-x86_64.egg/numpy/lib/__init__.py", line 8, in <module>
from .type_check import *
File "/blues/gpfs/home/software/spack-0.10.0/opt/spack/linux-centos6-x86_64/intel-17.0.1/py-numpy-1.12.0-r7qapsmckwr6jjvb6llkoufk36g5t36h/lib/python2.7/site-packages/numpy-1.12.0-py2.7-linux-x86_64.egg/numpy/lib/type_check.py", line 11, in <module>
import numpy.core.numeric as _nx
File "/blues/gpfs/home/software/spack-0.10.0/opt/spack/linux-centos6-x86_64/intel-17.0.1/py-numpy-1.12.0-r7qapsmckwr6jjvb6llkoufk36g5t36h/lib/python2.7/site-packages/numpy-1.12.0-py2.7-linux-x86_64.egg/numpy/core/__init__.py", line 24, in <module>
raise ImportError(msg)
ImportError:
Importing the multiarray numpy extension module failed. Most
likely you are trying to import a failed build of numpy.
If you're working with a numpy git repo, try `git clean -xdf` (removes all
files not under version control). Otherwise reinstall numpy.
Any suggestions as to how to debug this problem?
Are you sure that the location you installed to is the one you're importing? If so, can you provide a full build log?
Are you sure that the location you installed to is the one you're importing?
I'm pretty sure. I'm installing a new vanilla Python and Numpy to unique installation directories. In this case, I overwrote PYTHONPATH with the installation directory of Numpy, so it should be the only possible Numpy available. Also, the directory showing up in the error message is the same as my installation directory.
can you provide a full build log?
The following site.cfg:
[mkl]
mkl_libs = mkl_rt
lapack_libs =
include_dirs = /soft/spack-0.10.0/opt/spack/linux-centos6-x86_64/gcc-4.4.7/intel-parallel-studio-professional.2017.1-zaq5tbp664b2ye2gdx3ry35t3wd4rjn4/mkl/include
library_dirs = /soft/spack-0.10.0/opt/spack/linux-centos6-x86_64/gcc-4.4.7/intel-parallel-studio-professional.2017.1-zaq5tbp664b2ye2gdx3ry35t3wd4rjn4/mkl/lib/intel64
rpath = /soft/spack-0.10.0/opt/spack/linux-centos6-x86_64/gcc-4.4.7/intel-parallel-studio-professional.2017.1-zaq5tbp664b2ye2gdx3ry35t3wd4rjn4/mkl/lib/intel64
with no changes to the source code produces the following build log: build-out.txt
If I follow https://software.intel.com/en-us/articles/numpyscipy-with-intel-mkl and use the following patch:
https://github.com/LLNL/spack/pull/3207/files#diff-6d760ab6f2199ca73c93e208ae09ba55, then replace the deprecated -openmp with -qopenmp and explicitly tell it to use --compiler=intelem --fcompiler=intelem, I get the following build log:
build-out.txt
Both techniques produce the same import error message. I'm not sure if it matters, but I'm using the Spack package manager, working off of the branch in https://github.com/LLNL/spack/pull/3207 and using the following CFLAGS and friends: -axCORE-AVX2,AVX.
There's a couple of odd warnings.
icc: build/src.linux-x86_64-2.7/numpy/core/src/multiarray/lowlevel_strided_loops.c
numpy/core/src/multiarray/lowlevel_strided_loops.c.src(125): warning #3175: unrecognized gcc
optimization level
NPY_GCC_UNROLL_LOOPS
NPY_GCC_UNROLL_LOOPS should be defined but not to a gcc optimization level
icc: build/src.linux-x86_64-2.7/numpy/core/src/multiarray/einsum.c
numpy/core/src/multiarray/einsum.c.src(1078): warning #167: argument of type "npy_float={float} *"
is incompatible with parameter of type "const char *"
_mm_prefetch(data0 + 512, _MM_HINT_T0);
not sure, doesn't look familiar
icc: numpy/core/src/private/mem_overlap.c
In file included from /blues/gpfs/home/ajstewart/spack/opt/spack/linux-centos6-x86_64/intel-17.0.1
/python-2.7.13-qqzpcee2wndnmovlk5shpvwqjch2k4kl/include/python2.7/Python.h(8),
from numpy/core/src/private/mem_overlap.c(187):
/blues/gpfs/home/ajstewart/spack/opt/spack/linux-centos6-x86_64/intel-17.0.1/python-2.7.13-
qqzpcee2wndnmovlk5shpvwqjch2k4kl/include/python2.7/pyconfig.h(1190): warning #47:
incompatible redefinition of macro "_POSIX_C_SOURCE" (declared at line 213 of "/usr/include/features.h")
#define _POSIX_C_SOURCE 200112L
This one looks suspicious. The include of Python.h and stdlib headers seems to be the wrong way around in mem_overlap.c. Could you try moving include <Python.h> up to line 184 in that file?
With the following patch:
diff --git a/numpy/core/src/private/mem_overlap.c b/numpy/core/src/private/mem_overlap.c
index b2b80b4..71033dc 100644
--- a/numpy/core/src/private/mem_overlap.c
+++ b/numpy/core/src/private/mem_overlap.c
@@ -181,10 +181,10 @@
All rights reserved.
Licensed under 3-clause BSD license, see LICENSE.txt.
*/
+#include <Python.h>
#include <stdlib.h>
#include <stdio.h>
#include <assert.h>
-#include <Python.h>
#define NPY_NO_DEPRECATED_API NPY_API_VERSION
#include "numpy/ndarraytypes.h"
I get the following build log: build-log.txt
It looks like the same redefinition errors are occuring. Also, I'm still seeing the aforementioned import error.
I always see a ton of redefinition warnings for "_POSIX_C_SOURCE" and "_XOPEN_SOURCE" on my machine.
The features.h file is imported in numpy/core/src/private/npy_config.h in order to get the macros for glibc versions.
And the reason is that the pyconfig* files define _GNU_SOURCE. This is probably an error on the distro or Python side.
I had the bright idea of trying to build numpy with OpenBLAS instead of MKL so that we could diff the build logs and see which error messages were actually important. Unfortunately, I discovered that the exact same problem occurs for OpenBLAS. At this point, I know that the GCC + OpenBLAS build works, but every build I've done with Intel has this import error. Next I'm going to try building with an older version of the Intel compilers to see if that is the problem.
For reference, here is the build log for Intel + OpenBLAS: build-log.txt
Update: My Intel 16.0.3 + OpenBLAS installation also shows the same problem. So far I haven't been able to build numpy with the intel compilers.
I note that there is a new Intel update out today, but suspect it doesn't fix this problem
I just tried building Numpy 1.11.2 with Intel 17.0.1 and it worked! Both Intel MKL and OpenBLAS worked, although my rpath settings didn't work (had to explicitly set LD_LIBRARY_PATH to get the import to work). If you want I can try 1.11.3 and various release candidates for 1.12.0 to narrow down which commit broke Intel support.
Did some more testing and found that I can actually get numpy 1.12.0 working if I set the LD_LIBRARY_PATH for the Intel compilers. Let me see if it's possible to add that to the rpath in our build system...
Question: According to https://github.com/numpy/numpy/blob/master/site.cfg.example, you can put rpath in your site.cfg to add libraries to the RPATH of the executables. Does anyone know if this actually works at all? If so, do I also need the RPATH to the compiler? I only had the RPATH to the BLAS/LAPACK libraries.
Just confirmed that rpath does not work. If I build numpy with the following site.cfg:
[mkl]
mkl_libs = mkl_rt
lapack_libs =
include_dirs = /soft/spack-0.10.0/opt/spack/linux-centos6-x86_64/gcc-4.4.7/intel-parallel-studio-professional.2017.1-zaq5tbp664b2ye2gdx3ry35t3wd4rjn4/mkl/include
library_dirs = /soft/spack-0.10.0/opt/spack/linux-centos6-x86_64/gcc-4.4.7/intel-parallel-studio-professional.2017.1-zaq5tbp664b2ye2gdx3ry35t3wd4rjn4/mkl/lib/intel64
rpath = /soft/spack-0.10.0/opt/spack/linux-centos6-x86_64/gcc-4.4.7/intel-parallel-studio-professional.2017.1-zaq5tbp664b2ye2gdx3ry35t3wd4rjn4/mkl/lib/intel64
run:
unset LD_LIBRARY_PATH
and try to import numpy, I see the aformentioned error message. However, if I set LD_LIBRARY_PATH to the same directory provided in rpath, it works.
For more evidence:
$ unset LD_LIBRARY_PATH
$ ldd -r multiarray.so
linux-vdso.so.1 => (0x00007ffc377fe000)
libmkl_rt.so => not found
libpthread.so.0 => /lib64/libpthread.so.0 (0x00002aee14739000)
libpython2.7.so.1.0 => /blues/gpfs/home/ajstewart/spack/opt/spack/linux-centos6-x86_64/intel-17.0.1/python-2.7.13-qqzpcee2wndnmovlk5shpvwqjch2k4kl/lib/libpython2.7.so.1.0 (0x00002aee14957000)
libimf.so => /blues/gpfs/home/software/spack-0.10.0/opt/spack/linux-centos6-x86_64/gcc-4.4.7/intel-parallel-studio-professional.2017.1-zaq5tbp664b2ye2gdx3ry35t3wd4rjn4/compilers_and_libraries_2017.1.132/linux/compiler/lib/intel64_lin/libimf.so (0x00002aee14e76000)
libsvml.so => /blues/gpfs/home/software/spack-0.10.0/opt/spack/linux-centos6-x86_64/gcc-4.4.7/intel-parallel-studio-professional.2017.1-zaq5tbp664b2ye2gdx3ry35t3wd4rjn4/compilers_and_libraries_2017.1.132/linux/compiler/lib/intel64_lin/libsvml.so (0x00002aee15363000)
libirng.so => /blues/gpfs/home/software/spack-0.10.0/opt/spack/linux-centos6-x86_64/gcc-4.4.7/intel-parallel-studio-professional.2017.1-zaq5tbp664b2ye2gdx3ry35t3wd4rjn4/compilers_and_libraries_2017.1.132/linux/compiler/lib/intel64_lin/libirng.so (0x00002aee1626e000)
libm.so.6 => /lib64/libm.so.6 (0x00002aee165e4000)
libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00002aee16868000)
libintlc.so.5 => /blues/gpfs/home/software/spack-0.10.0/opt/spack/linux-centos6-x86_64/gcc-4.4.7/intel-parallel-studio-professional.2017.1-zaq5tbp664b2ye2gdx3ry35t3wd4rjn4/compilers_and_libraries_2017.1.132/linux/compiler/lib/intel64_lin/libintlc.so.5 (0x00002aee16a7e000)
libc.so.6 => /lib64/libc.so.6 (0x00002aee16ce9000)
/lib64/ld-linux-x86-64.so.2 (0x00002aee13eea000)
libdl.so.2 => /lib64/libdl.so.2 (0x00002aee1707d000)
libutil.so.1 => /lib64/libutil.so.1 (0x00002aee17282000)
undefined symbol: cblas_zdotc_sub (./multiarray.so)
undefined symbol: cblas_cgemv (./multiarray.so)
undefined symbol: cblas_cdotu_sub (./multiarray.so)
undefined symbol: cblas_ddot (./multiarray.so)
undefined symbol: cblas_zgemv (./multiarray.so)
undefined symbol: cblas_daxpy (./multiarray.so)
undefined symbol: cblas_cdotc_sub (./multiarray.so)
undefined symbol: cblas_zgemm (./multiarray.so)
undefined symbol: cblas_csyrk (./multiarray.so)
undefined symbol: cblas_dsyrk (./multiarray.so)
undefined symbol: cblas_sdot (./multiarray.so)
undefined symbol: cblas_zsyrk (./multiarray.so)
undefined symbol: cblas_sgemm (./multiarray.so)
undefined symbol: cblas_dgemm (./multiarray.so)
undefined symbol: cblas_sgemv (./multiarray.so)
undefined symbol: cblas_caxpy (./multiarray.so)
undefined symbol: cblas_ssyrk (./multiarray.so)
undefined symbol: cblas_saxpy (./multiarray.so)
undefined symbol: cblas_dgemv (./multiarray.so)
undefined symbol: cblas_cgemm (./multiarray.so)
undefined symbol: cblas_zdotu_sub (./multiarray.so)
undefined symbol: cblas_zaxpy (./multiarray.so)
$ export LD_LIBRARY_PATH=/soft/spack-0.10.0/opt/spack/linux-centos6-x86_64/gcc-4.4.7/intel-parallel-studio-professional.2017.1-zaq5tbp664b2ye2gdx3ry35t3wd4rjn4/mkl/lib/intel64
$ ldd -r multiarray.so
linux-vdso.so.1 => (0x00007ffcbcaab000)
libmkl_rt.so => /soft/spack-0.10.0/opt/spack/linux-centos6-x86_64/gcc-4.4.7/intel-parallel-studio-professional.2017.1-zaq5tbp664b2ye2gdx3ry35t3wd4rjn4/mkl/lib/intel64/libmkl_rt.so (0x00002aafe0ba3000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x00002aafe11aa000)
libpython2.7.so.1.0 => /blues/gpfs/home/ajstewart/spack/opt/spack/linux-centos6-x86_64/intel-17.0.1/python-2.7.13-qqzpcee2wndnmovlk5shpvwqjch2k4kl/lib/libpython2.7.so.1.0 (0x00002aafe13c8000)
libimf.so => /blues/gpfs/home/software/spack-0.10.0/opt/spack/linux-centos6-x86_64/gcc-4.4.7/intel-parallel-studio-professional.2017.1-zaq5tbp664b2ye2gdx3ry35t3wd4rjn4/compilers_and_libraries_2017.1.132/linux/compiler/lib/intel64_lin/libimf.so (0x00002aafe18e7000)
libsvml.so => /blues/gpfs/home/software/spack-0.10.0/opt/spack/linux-centos6-x86_64/gcc-4.4.7/intel-parallel-studio-professional.2017.1-zaq5tbp664b2ye2gdx3ry35t3wd4rjn4/compilers_and_libraries_2017.1.132/linux/compiler/lib/intel64_lin/libsvml.so (0x00002aafe1dd4000)
libirng.so => /blues/gpfs/home/software/spack-0.10.0/opt/spack/linux-centos6-x86_64/gcc-4.4.7/intel-parallel-studio-professional.2017.1-zaq5tbp664b2ye2gdx3ry35t3wd4rjn4/compilers_and_libraries_2017.1.132/linux/compiler/lib/intel64_lin/libirng.so (0x00002aafe2cdf000)
libm.so.6 => /lib64/libm.so.6 (0x00002aafe3055000)
libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00002aafe32d9000)
libintlc.so.5 => /blues/gpfs/home/software/spack-0.10.0/opt/spack/linux-centos6-x86_64/gcc-4.4.7/intel-parallel-studio-professional.2017.1-zaq5tbp664b2ye2gdx3ry35t3wd4rjn4/compilers_and_libraries_2017.1.132/linux/compiler/lib/intel64_lin/libintlc.so.5 (0x00002aafe34ef000)
libc.so.6 => /lib64/libc.so.6 (0x00002aafe375a000)
/lib64/ld-linux-x86-64.so.2 (0x00002aafe0369000)
libdl.so.2 => /lib64/libdl.so.2 (0x00002aafe3aee000)
libutil.so.1 => /lib64/libutil.so.1 (0x00002aafe3cf3000)
Just confirmed that rpath does not work.
what if you move [rpath] to DEFAULT section? That's how we had it in https://github.com/LLNL/spack/pull/2365
@davydden With a site.cfg like:
[mkl]
mkl_libs = mkl_rt
lapack_libs =
include_dirs = /soft/spack-0.10.0/opt/spack/linux-centos6-x86_64/gcc-4.4.7/intel-parallel-studio-professional.2017.1-zaq5tbp664b2ye2gdx3ry35t3wd4rjn4/mkl/include
library_dirs = /soft/spack-0.10.0/opt/spack/linux-centos6-x86_64/gcc-4.4.7/intel-parallel-studio-professional.2017.1-zaq5tbp664b2ye2gdx3ry35t3wd4rjn4/mkl/lib/intel64
[ALL]
rpath = /soft/spack-0.10.0/opt/spack/linux-centos6-x86_64/gcc-4.4.7/intel-parallel-studio-professional.2017.1-zaq5tbp664b2ye2gdx3ry35t3wd4rjn4/mkl/lib/intel64
I see the exact same error message if the rpath is not in my LD_LIBRARY_PATH. Adding it to my LD_LIBRARY_PATH allows me to import numpy.
I see the exact same error message
oh well....
Interestingly enough, if I use a site.cfg of:
[mkl]
mkl_libs = mkl_rt
lapack_libs =
[ALL]
include_dirs = /soft/spack-0.10.0/opt/spack/linux-centos6-x86_64/gcc-4.4.7/intel-parallel-studio-professional.2017.1-zaq5tbp664b2ye2gdx3ry35t3wd4rjn4/mkl/include
library_dirs = /soft/spack-0.10.0/opt/spack/linux-centos6-x86_64/gcc-4.4.7/intel-parallel-studio-professional.2017.1-zaq5tbp664b2ye2gdx3ry35t3wd4rjn4/mkl/lib/intel64
rpath = /soft/spack-0.10.0/opt/spack/linux-centos6-x86_64/gcc-4.4.7/intel-parallel-studio-professional.2017.1-zaq5tbp664b2ye2gdx3ry35t3wd4rjn4/mkl/lib/intel64
I see completely different behavior. This time it picks up the system BLAS/LAPACK:
$ unset LD_LIBRARY_PATH
$ ldd -r multiarray.so
linux-vdso.so.1 => (0x00007fffa9f40000)
libptf77blas.so.3 => /usr/lib64/atlas/libptf77blas.so.3 (0x00002b447adf9000)
libptcblas.so.3 => /usr/lib64/atlas/libptcblas.so.3 (0x00002b447b018000)
libatlas.so.3 => /usr/lib64/atlas/libatlas.so.3 (0x00002b447b239000)
libpython2.7.so.1.0 => /blues/gpfs/home/ajstewart/spack/opt/spack/linux-centos6-x86_64/intel-17.0.1/python-2.7.13-qqzpcee2wndnmovlk5shpvwqjch2k4kl/lib/libpython2.7.so.1.0 (0x00002b447b895000)
libimf.so => /blues/gpfs/home/software/spack-0.10.0/opt/spack/linux-centos6-x86_64/gcc-4.4.7/intel-parallel-studio-professional.2017.1-zaq5tbp664b2ye2gdx3ry35t3wd4rjn4/compilers_and_libraries_2017.1.132/linux/compiler/lib/intel64_lin/libimf.so (0x00002b447bdb5000)
libsvml.so => /blues/gpfs/home/software/spack-0.10.0/opt/spack/linux-centos6-x86_64/gcc-4.4.7/intel-parallel-studio-professional.2017.1-zaq5tbp664b2ye2gdx3ry35t3wd4rjn4/compilers_and_libraries_2017.1.132/linux/compiler/lib/intel64_lin/libsvml.so (0x00002b447c2a1000)
libirng.so => /blues/gpfs/home/software/spack-0.10.0/opt/spack/linux-centos6-x86_64/gcc-4.4.7/intel-parallel-studio-professional.2017.1-zaq5tbp664b2ye2gdx3ry35t3wd4rjn4/compilers_and_libraries_2017.1.132/linux/compiler/lib/intel64_lin/libirng.so (0x00002b447d1ad000)
libm.so.6 => /lib64/libm.so.6 (0x00002b447d522000)
libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00002b447d7a6000)
libintlc.so.5 => /blues/gpfs/home/software/spack-0.10.0/opt/spack/linux-centos6-x86_64/gcc-4.4.7/intel-parallel-studio-professional.2017.1-zaq5tbp664b2ye2gdx3ry35t3wd4rjn4/compilers_and_libraries_2017.1.132/linux/compiler/lib/intel64_lin/libintlc.so.5 (0x00002b447d9bd000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x00002b447dc27000)
libc.so.6 => /lib64/libc.so.6 (0x00002b447de44000)
/lib64/ld-linux-x86-64.so.2 (0x00002b447a5aa000)
libdl.so.2 => /lib64/libdl.so.2 (0x00002b447e1d9000)
libgfortran.so.3 => /usr/lib64/libgfortran.so.3 (0x00002b447e3dd000)
libutil.so.1 => /lib64/libutil.so.1 (0x00002b447e6d0000)
Are things in [ALL] ignored? Who knows?
To add to the insanity, the results of the build change drastically depending on whether or not I pass --compiler=intelem --fcompiler=intelem to setup.py. Without those flags, it seems to be running the correct compiler, albeit with GCC flags. With those flags, the build crashes when it can't find xiar in my PATH. If I load the Intel parallel studio module, the build completes successfully. But despite the fact that I use a site.cfg of:
[openblas]
libraries = openblas
include_dirs = /blues/gpfs/home/ajstewart/spack/opt/spack/linux-centos6-x86_64/intel-17.0.1/openblas-0.2.19-fqs7uj6mfdrngnutmwqfmmunlyje6x4z/include
library_dirs = /blues/gpfs/home/ajstewart/spack/opt/spack/linux-centos6-x86_64/intel-17.0.1/openblas-0.2.19-fqs7uj6mfdrngnutmwqfmmunlyje6x4z/lib
rpath = /blues/gpfs/home/ajstewart/spack/opt/spack/linux-centos6-x86_64/intel-17.0.1/openblas-0.2.19-fqs7uj6mfdrngnutmwqfmmunlyje6x4z/lib
I end up with the building linking to MKL:
$ ldd -r multiarray.so
linux-vdso.so.1 => (0x00007ffec17ac000)
libmkl_rt.so => /soft/spack-0.10.0/opt/spack/linux-centos6-x86_64/gcc-4.4.7/intel-parallel-studio-professional.2017.1-zaq5tbp664b2ye2gdx3ry35t3wd4rjn4/compilers_and_libraries_2017.1.132/linux/mkl/lib/intel64_lin/libmkl_rt.so (0x00002b14fda4c000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x00002b14fe053000)
libpython2.7.so.1.0 => /blues/gpfs/home/ajstewart/spack/opt/spack/linux-centos6-x86_64/intel-17.0.1/python-2.7.13-qqzpcee2wndnmovlk5shpvwqjch2k4kl/lib/libpython2.7.so.1.0 (0x00002b14fe270000)
libimf.so => /blues/gpfs/home/software/spack-0.10.0/opt/spack/linux-centos6-x86_64/gcc-4.4.7/intel-parallel-studio-professional.2017.1-zaq5tbp664b2ye2gdx3ry35t3wd4rjn4/compilers_and_libraries_2017.1.132/linux/compiler/lib/intel64_lin/libimf.so (0x00002b14fe790000)
libsvml.so => /blues/gpfs/home/software/spack-0.10.0/opt/spack/linux-centos6-x86_64/gcc-4.4.7/intel-parallel-studio-professional.2017.1-zaq5tbp664b2ye2gdx3ry35t3wd4rjn4/compilers_and_libraries_2017.1.132/linux/compiler/lib/intel64_lin/libsvml.so (0x00002b14fec7c000)
libirng.so => /blues/gpfs/home/software/spack-0.10.0/opt/spack/linux-centos6-x86_64/gcc-4.4.7/intel-parallel-studio-professional.2017.1-zaq5tbp664b2ye2gdx3ry35t3wd4rjn4/compilers_and_libraries_2017.1.132/linux/compiler/lib/intel64_lin/libirng.so (0x00002b14ffb88000)
libm.so.6 => /lib64/libm.so.6 (0x00002b14ffefd000)
libiomp5.so => /blues/gpfs/home/software/spack-0.10.0/opt/spack/linux-centos6-x86_64/gcc-4.4.7/intel-parallel-studio-professional.2017.1-zaq5tbp664b2ye2gdx3ry35t3wd4rjn4/compilers_and_libraries_2017.1.132/linux/compiler/lib/intel64_lin/libiomp5.so (0x00002b1500182000)
libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00002b1500525000)
libintlc.so.5 => /blues/gpfs/home/software/spack-0.10.0/opt/spack/linux-centos6-x86_64/gcc-4.4.7/intel-parallel-studio-professional.2017.1-zaq5tbp664b2ye2gdx3ry35t3wd4rjn4/compilers_and_libraries_2017.1.132/linux/compiler/lib/intel64_lin/libintlc.so.5 (0x00002b150073b000)
libc.so.6 => /lib64/libc.so.6 (0x00002b15009a6000)
/lib64/ld-linux-x86-64.so.2 (0x00002b14fd284000)
libdl.so.2 => /lib64/libdl.so.2 (0x00002b1500d3a000)
libutil.so.1 => /lib64/libutil.so.1 (0x00002b1500f3f000)
When I switch my LD_LIBRARY_PATH to point to the OpenBLAS installation I was trying to use, lib_mklrt.so is not found and there are dozens of missing symbols. So not only does the wrong library get picked up, but rpath is completely ignored.
It seems like site.cfg is more of a suggestion. The build picks up whatever it finds, and if it can't find anything, it consults site.cfg. Given this, do you have any suggestions as to how to tell numpy what libraries to use and what RPATH to set??