spack: Unable to build Numpy with Intel 17
I’m trying to build py-numpy with Intel MKL, but although the build succeeds, numpy cannot be imported:
$ python -c 'import numpy'
Traceback (most recent call last):
File "<string>", 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.
Does anyone know how to get numpy + MKL working?
P.S. My import tests from #2869 will detect this type of failed build before the installation is complete. On the current develop, I didn’t notice there was a problem with numpy until I tried building scipy.
About this issue
- Original URL
- State: closed
- Created 10 years ago
- Comments: 19 (19 by maintainers)
Update: Either
rpathisn’t working at all, or we need to add the Intel compilers to therpath. When I load the intel module, things magically work again.This happens because every time an intel compiler is loaded, the environment variable
MKL_ROOTis also set and numpy searches the environment variables before checking the site.cfg. (@wscullin pointed this out.)Now, I have a numpy uses the correct blas/lapack library (I’m using Openblas) and get this error :
This is coming from the same
libifcorelibrary [ref] as discussed in8616. I have included the path to the library incompilers.yamlusingextra_rpaths. What is to be done to resolve this issue ?This post asks for explicit linking. But isn’t the
extra_rpathssupposed to fix this ?One of the many warnings at compile time :
That should come with #1875. I’ll try to implement @tgamblin suggestions asap.