After emerging sci-libs/mkl-10.0.5.025 and sci-libs/numpy-1.4.1, python -c "import numpy" gives: Traceback (most recent call last): File "<string>", line 1, in <module> File "/usr/lib64/python2.6/site-packages/numpy/__init__.py", line 132, in <module> import add_newdocs File "/usr/lib64/python2.6/site-packages/numpy/add_newdocs.py", line 9, in <module> from lib import add_newdoc File "/usr/lib64/python2.6/site-packages/numpy/lib/__init__.py", line 13, in <module> from polynomial import * File "/usr/lib64/python2.6/site-packages/numpy/lib/polynomial.py", line 17, in <module> from numpy.linalg import eigvals, lstsq File "/usr/lib64/python2.6/site-packages/numpy/linalg/__init__.py", line 47, in <module> from linalg import * File "/usr/lib64/python2.6/site-packages/numpy/linalg/linalg.py", line 22, in <module> from numpy.linalg import lapack_lite ImportError: /usr/lib64/libblas.so.0: invalid ELF header Reproducible: Always Steps to Reproduce: 1. ACCEPT_KEYWORDS='~amd64' emerge -u mkl && eselect cblas set mkl-gfortran-threads && eselect blas set mkl-gfortran-threads 2. USE="test blas lapack" ACCEPT_KEYWORDS='~amd64' emerge setuptools nose =numpy-1.4.1 3. python -c "import numpy"
Unfortunately mkl in Gentoo is fairly broken, we have not found the time or people to take good care of this package.
*** This bug has been marked as a duplicate of bug 273206 ***
I had similar problem with octave and mkl (ld returns "invalid ELF header") I see that the problematic file (/opt/intel/mkl/10.0.5.025/lib/em64t/libmkl.so) is actually a text file with a single line: GROUP (libmkl_intel_lp64.so libmkl_intel_thread.so libmkl_core.so) As far as I understood from `man ld`, it may be used for scripting during linkage but not for dynamic linking. So what I did was: ld -o libmkl_my.so --shared -L /opt/intel/mkl/10.0.5.025/lib/em64t/ -lmkl This creates a valid so from that script. Then I created a symlink from libblas.so to libmkl_my.so This seemed to work, at least octave starts. I now have some problems with using it from octave (like eig(Mat) giving "invalid parameter"), but I suppose it is unrelated (seems like incompatible ABI :-( )