[Numpy-discussion] compiling and linking MKL with numpy/scipy

Xavier Barthelemy xabart at gmail.com
Tue Nov 22 18:42:11 EST 2011


dear everyone,

I am hard trying to compile numpy / and scipy with mkl.

unfortunately it does not work. i have tried a lot of solution, and the
closest for me to work is:



*I have *

Linux manning 2.6.32-27-server #49-Ubuntu SMP Thu Dec 2 02:05:21 UTC 2010
x86_64 GNU/Linux

python -c 'import os,sys;print os.name,sys.platform' -> posix linux

python 2.6

numpy 1.6.1

scipy 0.10

Intel® Fortran Compiler XE Version 12.1 Update 1, Intel® Debugger Version
12.1 Update 1, Intel® Math Kernel Library (Intel® MKL) Version 10.3 Update 7



*I used this to help me*:
http://software.intel.com/en-us/articles/intel-mkl-link-line-advisor/

*the relevant part of site.cfg* in numpy:

[mkl]
library_dirs = /opt/intel/composer_xe_2011_sp1.7.256/mkl/lib/intel64/
include_dirs = /opt/intel/composer_xe_2011_sp1.7.256/mkl/include/
lapack_libs =
mmkl_libs = mkl_intel_ilp64 ,mkl_core ,mkl_intel_thread,mkl_mc

*i**n distutils/intecompiler.py*

cc_exe = 'icc -m64 -O2 -fomit-frame-pointer -openmp -lpthread -fPIC -xHost
-fp-model strict -DMKL_ILP64 '
ccxx_exe = 'icpc -m64 -O2 -fomit-frame-pointer -openmp -lpthread -fPIC
-xHost -fp-model strict -DMKL_ILP64 '



* in distutils/fcompiler/intel.py*

def get_flags_opt(self):
return ['-O3 -openmp -i8 -fpe0 -L$(MKLROOT)/lib/intel64 -lpthread,']



*I run in .bashrc*

source /opt/intel/composer_xe_2011_sp1.7.256/bin/compilervars.sh intel64
source /opt/intel/composer_xe_2011_sp1.7.256/mkl/bin/mklvars.sh intel64
ilp64

*and my complation script is:*

export
LD_LIBRARY_PATH=/opt/intel/composer_xe_2011_sp1.7.256/mkl/lib/intel64/:/opt/intel/composer_xe_2011_sp1.7.256/compiler/lib/intel64/:$LD_LIBRARY_PATH

python setup.py config --compiler=intelem build_clib --compiler=intelem
build_ext --compiler=intelem install


*I had to use* "-fp-model strict" to pass the simple test of numpy
numpy.test()


*but when I run numpy.test('full')*

test_assumed_shape.TestAssumedShapeSumExample.test_all ... Segmentation
fault

*and then with the same config for scipy *

scipy.test('full')

test_definition (test_basic.TestDoubleFFT) ... Segmentation fault
*which obviously come from numpy*


So what do I miss to make it work?



Thanks
Xavier
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20111123/2222256b/attachment.html>


More information about the NumPy-Discussion mailing list