Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 568826 - dev-python/numpy-1.10.2-r1 with sci-libs/mkl: from numpy.linalg import lapack_lite, _umath_linalg ImportError: /opt/intel/composerxe-2013.2.144/mkl/lib/intel64/libmkl_gnu_thread.so: undefined symbol: mkl_blas_dgemm_blk_info_hi_thr_bdz
Summary: dev-python/numpy-1.10.2-r1 with sci-libs/mkl: from numpy.linalg import lapack...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Development (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Science Related Packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-12-19 20:14 UTC by Andrew Savchenko
Modified: 2015-12-27 16:20 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
emerge --info (emerge.info,5.84 KB, text/plain)
2015-12-19 20:14 UTC, Andrew Savchenko
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Savchenko gentoo-dev 2015-12-19 20:14:56 UTC
Created attachment 419850 [details]
emerge --info

Hello,

when MKL blas implementation (mkl64-gfortran-openmp in my case) is being used by numpy-1.10.2-r1 it is not linked properly. Numpy itself builds fine, but fails to load at runtime:

$ python
Python 3.3.5 (default, Mar 28 2014, 19:31:48)
[GCC 4.7.3] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib64/python3.3/site-packages/numpy/__init__.py", line 180, in <module>
    from . import add_newdocs
  File "/usr/lib64/python3.3/site-packages/numpy/add_newdocs.py", line 13, in <module>
    from numpy.lib import add_newdoc
  File "/usr/lib64/python3.3/site-packages/numpy/lib/__init__.py", line 18, in <module>
    from .polynomial import *
  File "/usr/lib64/python3.3/site-packages/numpy/lib/polynomial.py", line 20, in <module>
    from numpy.linalg import eigvals, lstsq, inv
  File "/usr/lib64/python3.3/site-packages/numpy/linalg/__init__.py", line 51, in <module>
    from .linalg import *
  File "/usr/lib64/python3.3/site-packages/numpy/linalg/linalg.py", line 29, in <module>
    from numpy.linalg import lapack_lite, _umath_linalg
ImportError: /opt/intel/composerxe-2013.2.144/mkl/lib/intel64/libmkl_gnu_thread.so: undefined symbol: mkl_blas_dgemm_blk_info_hi_thr_bdz

Diagnostics shows:

$ symlookup -p /opt mkl_blas_dgemm_blk_info_hi_thr_bdz
symlookup: warning: directory '/opt/intel/composerxe-2013.1.106/licenses' cannot be read: Permission denied
/opt/intel/composerxe-2013.2.144/mkl/lib/ia32/libmkl_core.so:   mkl_blas_dgemm_blk_info_hi_thr_bdz
/opt/intel/composerxe-2013.2.144/mkl/lib/intel64/libmkl_core.so:        mkl_blas_dgemm_blk_info_hi_thr_bdz

MKL pkg-config file contains proper information:

$ pkg-config --libs mkl64-gfortran-openmp
-L/opt/intel/composerxe-2013.2.144/mkl/lib/intel64 -L/opt/intel/composerxe-2013.2.144/compiler/lib/intel64 -Wl,--start-group -lmkl_gf_lp64 -lmkl_gnu_thread -lmkl_core -Wl,--end-group -fopenmp -lpthread

Please notice -lmkl_core — this library contains required symbol.

My version of MKL is rather old (11.1.2.144), but I can't use newer one due to license restrictions. As one can see from above, MKL pkg-config setup is correct itself, so the problem is somewhere in the numpy: it should link with mkl_core as well, but:

# ldd /usr/lib64/python3.3/site-packages/numpy/linalg/lapack_lite.cpython-33.so
        linux-vdso.so.1 (0x00007fff6edff000)
        /opt/intel/composerxe-2013.2.144/compiler/lib/intel64/libimf.so (0x00007fc43df4f000)
        libmkl_gf_lp64.so => /opt/intel/composerxe-2013.2.144/mkl/lib/intel64/libmkl_gf_lp64.so (0x00007fc43d7ef000)
        libmkl_gnu_thread.so => /opt/intel/composerxe-2013.2.144/mkl/lib/intel64/libmkl_gnu_thread.so (0x00007fc43cd0a000)
        libpython3.3.so.1.0 => /usr/lib64/libpython3.3.so.1.0 (0x00007fc43c894000)
        libgomp.so.1 => /usr/lib/gcc/x86_64-pc-linux-gnu/4.8.2/libgomp.so.1 (0x00007fc43c684000)
        libpthread.so.0 => /lib64/libpthread.so.0 (0x00007fc43c467000)
        libc.so.6 => /lib64/libc.so.6 (0x00007fc43c0c4000)
        libintlc.so.5 => /opt/intel/composerxe-2013.2.144/compiler/lib/intel64/libintlc.so.5 (0x00007fc43be6d000)
        libdl.so.2 => /lib64/libdl.so.2 (0x00007fc43bc69000)
        libutil.so.1 => /lib64/libutil.so.1 (0x00007fc43ba66000)
        libm.so.6 => /lib64/libm.so.6 (0x00007fc43b76b000)
        /lib64/ld-linux-x86-64.so.2 (0x00007fc43e617000)

$ ldd /usr/lib64/python3.3/site-packages/numpy/linalg/_umath_linalg.cpython-33.so
        linux-vdso.so.1 (0x00007fff47f75000)
        /opt/intel/composerxe-2013.2.144/compiler/lib/intel64/libimf.so (0x00007f460fff6000)
        libmkl_gf_lp64.so => /opt/intel/composerxe-2013.2.144/mkl/lib/intel64/libmkl_gf_lp64.so (0x00007f460f896000)
        libmkl_gnu_thread.so => /opt/intel/composerxe-2013.2.144/mkl/lib/intel64/libmkl_gnu_thread.so (0x00007f460edb1000)
        libpython3.3.so.1.0 => /usr/lib64/libpython3.3.so.1.0 (0x00007f460e93b000)
        libgomp.so.1 => /usr/lib/gcc/x86_64-pc-linux-gnu/4.8.2/libgomp.so.1 (0x00007f460e72b000)
        libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f460e50e000)
        libc.so.6 => /lib64/libc.so.6 (0x00007f460e16b000)
        libintlc.so.5 => /opt/intel/composerxe-2013.2.144/compiler/lib/intel64/libintlc.so.5 (0x00007f460df14000)
        libdl.so.2 => /lib64/libdl.so.2 (0x00007f460dd10000)
        libutil.so.1 => /lib64/libutil.so.1 (0x00007f460db0d000)
        libm.so.6 => /lib64/libm.so.6 (0x00007f460d812000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f46106e0000)

Please note, that libmkl_core is absent in the listings.

(The whole setup is quite old, but in production and can't be @world updated till the next maintenance window.)
Comment 1 Andrew Savchenko gentoo-dev 2015-12-19 20:15:48 UTC
Oops, should be "when MKL *lapack* implementation"
Comment 2 Justin Lecher (RETIRED) gentoo-dev 2015-12-27 16:20:21 UTC
commit 1a7d2ff6d7c7473e44b2d76e954a4b279b083a09
Author: Justin Lecher <jlec@gentoo.org>
Date:   Sun Dec 27 17:15:52 2015 +0100

    sci-libs/mkl: Update link flags according to intel's suggestions

    Gentoo-Bug: https://bugs.gentoo.org/show_bug.cgi?id=568826

    Package-Manager: portage-2.2.26
    Signed-off-by: Justin Lecher <jlec@gentoo.org>