spack: Unable to build Numpy with Intel 17

@davydden @glennpj @alalazo

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)

Most upvoted comments

Update: Either rpath isn’t working at all, or we need to add the Intel compilers to the rpath. When I load the intel module, things magically work again.

Confirmed that specifying an rpath in site.cfg doesn’t actually do anything.

This happens because every time an intel compiler is loaded, the environment variable MKL_ROOT is 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 :

ImportError: /home/sajid/packages/spack/opt/spack/linux-centos7-x86_64/intel-18.0.3/openblas-0.3.0-vhf45ztydok656i4lsuqhmlv2hehrbiz/lib/libopenblas.so.0: undefined symbol: for_cpystr

This is coming from the same libifcore library [ref] as discussed in 8616 . I have included the path to the library in compilers.yaml using extra_rpaths. What is to be done to resolve this issue ?

This post asks for explicit linking. But isn’t the extra_rpaths supposed to fix this ?

One of the many warnings at compile time :

ifort:f77: scipy/linalg/src/id_dist/src/dfft_subr_6.f
ifort: command line warning #10157: ignoring option '-W'; argument is of wrong type
ifort: command line warning #10006: ignoring unknown option '-ffixed-form'
ifort: command line warning #10006: ignoring unknown option '-fno-second-underscore'

I’m seeing a lot of nice support for automatically finding lib directories, but what about include directories?

That should come with #1875. I’ll try to implement @tgamblin suggestions asap.