[SciPy-Dev] Many Problems Building w/ MKL 11, ifort, icc; scipy.test() Fails w/ Undefined Symbols

Will Buckner wbuckner@beatsmusic....
Thu Aug 22 16:40:11 CDT 2013


Hadn't found them until you told me, but I've now carefully reviewed and
followed instructions from that doc. It's still not linking mkl_core
properly before intel_thread. Using mkl_rt doesn't help at all--and, I'm
unclear why that
's not just the default directions if mkl_rt works properly. When using
mkl_rt, I still must
use LD_PRELOAD=/opt/intel/mkl/lib/intel64/libmkl_core.so:/opt/intel/lib/intel64/libiomp5.so
or I get undefined symbol errors when running python. It's as if these two
libraries just aren't linked, and LD_PRELOAD is a bandaid. Is there a way
to manually edit the link line anywhere? Or where's it being built? If I
control+f my terminal output from a verbose build, I see no "-lanything"
being passed anywhere.

Thanks,
Will


On Wed, Aug 14, 2013 at 2:19 PM, Ralf Gommers <ralf.gommers@gmail.com>wrote:

>
>
>
> On Wed, Aug 14, 2013 at 9:52 PM, Will Buckner <wbuckner@beatsmusic.com>wrote:
>
>> I've tried this about 6 different ways now, and all successful builds
>> result in the same error during scipy.test() (note that NumPy builds fine
>> with same site.cfg):
>>
>> ======================================================================
>> ERROR: Failure: ImportError
>> (/opt/intel/composer_xe_2013.5.192/mkl/lib/intel64/libmkl_intel_thread.so:
>> undefined symbol: mkl_blas_dgemm_blk_info_bdz)
>> ----------------------------------------------------------------------
>> Traceback (most recent call last):
>>   File "/usr/local/lib/python2.7/dist-packages/nose/loader.py", line 413,
>> in loadTestsFromName
>>     addr.filename, addr.module)
>>   File "/usr/local/lib/python2.7/dist-packages/nose/importer.py", line
>> 47, in importFromPath
>>     return self.importFromDir(dir_path, fqname)
>>   File "/usr/local/lib/python2.7/dist-packages/nose/importer.py", line
>> 94, in importFromDir
>>     mod = load_module(part_fqname, fh, filename, desc)
>>   File "/usr/local/lib/python2.7/dist-packages/scipy/stats/__init__.py",
>> line 320, in <module>
>>     from .stats import *
>>   File "/usr/local/lib/python2.7/dist-packages/scipy/stats/stats.py",
>> line 242, in <module>
>>     import scipy.linalg as linalg
>>   File "/usr/local/lib/python2.7/dist-packages/scipy/linalg/__init__.py",
>> line 147, in <module>
>>     from .misc import *
>>   File "/usr/local/lib/python2.7/dist-packages/scipy/linalg/misc.py",
>> line 5, in <module>
>>     from . import blas
>>   File "/usr/local/lib/python2.7/dist-packages/scipy/linalg/blas.py",
>> line 113, in <module>
>>     from scipy.linalg import _fblas
>> ImportError:
>> /opt/intel/composer_xe_2013.5.192/mkl/lib/intel64/libmkl_intel_thread.so:
>> undefined symbol: mkl_blas_dgemm_blk_info_bdz
>>
>>
>> Here's some info on my environment:
>>
>> Intel Composer XE 2013.5.192, ifort+icc
>> icc flags: -fPIC -DMKL_ILP64 -m64 -fp-model', 'strict',
>> '-fomit-frame-pointer', '-openmp', '-xhost', '-parallel'
>> ifort flags: -fPIC -i8 -xhost -openmp -fp-model strict
>> OS: Ubuntu 12.04
>> 24 Cores Intel(R) Xeon(R) CPU E5-2650 0 @ 2.00GHz
>> Intel LibMKL 11.0.5
>>
>> site.cfg:
>>
>> [mkl]
>> library_dirs = /opt/intel/mkl/lib/intel64:/opt/intel/lib/intel64
>> include_dirs = /opt/intel/mkl/include:/opt/intel/include
>> lapack_libs = mkl_lapack95_lp64
>> mkl_libs = mkl_def, mkl_intel_lp64, mkl_intel_thread, mkl_core, mkl_mc
>>
>> [fftw]
>> library_dirs = /opt/intel/mkl/lib/intel64
>> include_dirs = /opt/intel/mkl/include
>> libraries = fftw3
>>
>> [amd]
>> amd_libs = amd
>> library_dirs = /usr/lib
>> include_dirs = /usr/include/suitesparse/
>>
>> [umfpack]
>> umfpack_libs = umfpack
>> library_dirs = /usr/lib
>> include_dirs = /usr/include/suitesparse/
>>
>> Built with:
>> python setup.py clean
>> python setup.py  -v config --compiler=intelem --fcompiler=intelem
>> build_clib --compiler=intelem --fcompiler=intelem build_ext
>>  --compiler=intelem --fcompiler=intelem install
>>
>>   FOUND:
>>     libraries = ['mkl_def', 'mkl_intel_lp64', 'mkl_intel_thread',
>> 'mkl_core', 'mkl_mc', 'pthread']
>>     library_dirs = ['/opt/intel/mkl/lib/intel64']
>>     define_macros = [('SCIPY_MKL_H', None)]
>>     include_dirs = ['/opt/intel/mkl/include', '/opt/intel/include']
>>
>>   FOUND:
>>     libraries = ['mkl_def', 'mkl_intel_lp64', 'mkl_intel_thread',
>> 'mkl_core', 'mkl_mc', 'pthread']
>>     library_dirs = ['/opt/intel/mkl/lib/intel64']
>>     define_macros = [('SCIPY_MKL_H', None)]
>>     include_dirs = ['/opt/intel/mkl/include', '/opt/intel/include']
>>
>>   FOUND:
>>     libraries = ['mkl_lapack95_lp64', 'mkl_def', 'mkl_intel_lp64',
>> 'mkl_intel_thread', 'mkl_core', 'mkl_mc', 'pthread']
>>     library_dirs = ['/opt/intel/mkl/lib/intel64']
>>     define_macros = [('SCIPY_MKL_H', None)]
>>     include_dirs = ['/opt/intel/mkl/include', '/opt/intel/include']
>>
>> ( library_dirs = /usr/local/lib:/usr/lib:/usr/lib/x86_64-linux-gnu )
>>   FOUND:
>>     libraries = ['mkl_lapack95_lp64', 'mkl_def', 'mkl_intel_lp64',
>> 'mkl_intel_thread', 'mkl_core', 'mkl_mc', 'pthread']
>>     library_dirs = ['/opt/intel/mkl/lib/intel64']
>>     define_macros = [('SCIPY_MKL_H', None)]
>>     include_dirs = ['/opt/intel/mkl/include', '/opt/intel/include']
>>
>>
>> **The problem is here:**
>>
>> ======================================================================
>> ERROR: Failure: ImportError
>> (/opt/intel/composer_xe_2013.5.192/mkl/lib/intel64/libmkl_intel_thread.so:
>> undefined symbol: mkl_blas_dgemm_blk_info_bdz)
>> ----------------------------------------------------------------------
>> Traceback (most recent call last):
>>   File "/usr/local/lib/python2.7/dist-packages/nose/loader.py", line 413,
>> in loadTestsFromName
>>     addr.filename, addr.module)
>>   File "/usr/local/lib/python2.7/dist-packages/nose/importer.py", line
>> 47, in importFromPath
>>     return self.importFromDir(dir_path, fqname)
>>   File "/usr/local/lib/python2.7/dist-packages/nose/importer.py", line
>> 94, in importFromDir
>>     mod = load_module(part_fqname, fh, filename, desc)
>>   File "/usr/local/lib/python2.7/dist-packages/scipy/stats/__init__.py",
>> line 320, in <module>
>>     from .stats import *
>>   File "/usr/local/lib/python2.7/dist-packages/scipy/stats/stats.py",
>> line 242, in <module>
>>     import scipy.linalg as linalg
>>   File "/usr/local/lib/python2.7/dist-packages/scipy/linalg/__init__.py",
>> line 147, in <module>
>>     from .misc import *
>>   File "/usr/local/lib/python2.7/dist-packages/scipy/linalg/misc.py",
>> line 5, in <module>
>>     from . import blas
>>   File "/usr/local/lib/python2.7/dist-packages/scipy/linalg/blas.py",
>> line 113, in <module>
>>     from scipy.linalg import _fblas
>> ImportError:
>> /opt/intel/composer_xe_2013.5.192/mkl/lib/intel64/libmkl_intel_thread.so:
>> undefined symbol: mkl_blas_dgemm_blk_info_bdz
>>
>>
>> Now, where is mkl_blas_dgemm_blk_info_bdz defined?
>>
>> daisy@speedballcompute01:/opt/intel/mkl/lib/intel64$ nm libmkl_core.so |
>> grep mkl_blas_dgemm_blk_info_bdz
>> 00000000000c59f0 T mkl_blas_dgemm_blk_info_bdz
>> daisy@speedballcompute01:/opt/intel/mkl/lib/intel64$
>>
>> Right there ^.
>>
>> I included mkl_core in site.cfg and it seems to be linking it, so I'm not
>> sure why this symbol is still undefined. Note that it *is* undefined in
>> libmkl_intel_thread.so:
>>
>> daisy@speedballcompute01:/opt/intel/mkl/lib/intel64$ nm
>> libmkl_intel_thread.so | grep mkl_blas_dgemm_blk_info_bdz
>>                  U mkl_blas_dgemm_blk_info_bdz
>> daisy@speedballcompute01:/opt/intel/mkl/lib/intel64$
>>
>>
>> I also tried the instructions provided by intel at
>> http://software.intel.com/en-us/articles/numpyscipy-with-intel-mkl,
>> using just mkl_rt. This had the same result, and seems incorrect, as it's
>> not providing any lapack libraries (I'm assuming it would just fall back to
>> "no lapack" and it seems to). This is highly confusing, as all of the MKL
>> numpy/scipy instructions seem to be for older MKLs, before mkl_rt.
>>
>
> These are fairly recent and mention mkl_rt:
> http://scipy.org/scipylib/building/linux.html#any-distribution-with-intel-c-compiler-and-mkl.
> Did you find those?
>
> Ralf
>
>
>
>>
>> Could anyone help me debug this? I'm hopelessly frustrated with it at
>> this point and willing to do whatever to help you guys debug.
>>
>> Thanks! What additional info is needed?
>>
>> _______________________________________________
>> SciPy-Dev mailing list
>> SciPy-Dev@scipy.org
>> http://mail.scipy.org/mailman/listinfo/scipy-dev
>>
>>
>
> _______________________________________________
> SciPy-Dev mailing list
> SciPy-Dev@scipy.org
> http://mail.scipy.org/mailman/listinfo/scipy-dev
>
>


-- 


*Will Buckner*
Machine Learning & Data Architect
(408) 637-8466 (m)
wbuckner@beatsmusic.com
*
*
*Beats Music*
*
*

The information contained in or attached to this transmission may contain
privileged and confidential information.  It is intended only for the use
of the person(s) named above. If you are not the intended recipient, you
are hereby notified that any review, dissemination, distribution or
duplication of this communication is strictly prohibited. If you are not
the intended recipient, please contact the sender by reply email and delete
all copies of the original message.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/scipy-dev/attachments/20130822/6537591a/attachment.html 


More information about the SciPy-Dev mailing list