c - Error building NumPy with MKL on OSX with Python 3.3 -
background
using 2012 imac 2nd-gen core i7 processor, i'm trying build numpy 1.7.0 (and scipy) on osx 10.8.3 linked mkl included in evaluation versions of intel's c++ composer xe 2013 , fortran composer xe 2013 osx. following this article on intel's site (loosely adapted, it's not specific in cases) settings, compiler flags, etc.
problem
using either:
$ python3 setup.py config build --compiler=intelem --fcompiler=intelem
or
$ python3 setup.py config --compiler=intelem --fcompiler=intelem build_clib --compiler=intelem --fcompiler=intelem build_ext --compiler=intelem --fcompiler=intelem
i same error:
running build_clib customize intelem64tccompiler customize intelem64tccompiler using build_clib running build_ext customize intelem64tccompiler customize intelem64tccompiler using build_ext building 'numpy.core._dummy' extension compiling c sources c compiler: icc -m64 -march=corei7 -o3 -g -fpic -fp-model strict -fomit-frame-pointer -openmp -xhost -dmkl_ilp64 -i/opt/intel/mkl/include compile options: '-inumpy/core/include -ibuild/src.macosx-10.8-x86_64-3.3/numpy/core/include/numpy -inumpy/core/src/private -inumpy/core/src -inumpy/core -inumpy/core/src/npymath -inumpy/core/src/multiarray -inumpy/core/src/umath -inumpy/core/src/npysort -inumpy/core/include -i/opt/local/library/frameworks/python.framework/versions/3.3/include/python3.3m -ibuild/src.macosx-10.8-x86_64-3.3/numpy/core/src/multiarray -ibuild/src.macosx-10.8-x86_64-3.3/numpy/core/src/umath -c' icc: numpy/core/src/dummymodule.c icc: command line warning #10121: overriding '-marchcorei7' '-xhost' icc -m64 -march=corei7 -o3 -g -fpic -fp-model strict -fomit-frame-pointer -openmp -xhost -dmkl_ilp64 -i/opt/intel/mkl/include -shared build/temp.macosx-10.8-x86_64-3.3/numpy/core/src/dummymodule.o -lbuild/temp.macosx-10.8-x86_64-3.3 -o build/lib.macosx-10.8-x86_64-3.3/numpy/core/_dummy.so icc: command line warning #10121: overriding '-marchcorei7' '-xhost' icc: command line warning #10006: ignoring unknown option '-shared' undefined symbols architecture x86_64: "_pymodule_create2", referenced from: _pyinit__dummy in dummymodule.o "_main", referenced from: start in crt1.10.6.o ld: symbol(s) not found architecture x86_64 icc: command line warning #10121: overriding '-marchcorei7' '-xhost' icc: command line warning #10006: ignoring unknown option '-shared' undefined symbols architecture x86_64: "_pymodule_create2", referenced from: _pyinit__dummy in dummymodule.o "_main", referenced from: start in crt1.10.6.o ld: symbol(s) not found architecture x86_64 error: command "icc -m64 -march=corei7 -o3 -g -fpic -fp-model strict -fomit-frame-pointer -openmp -xhost -dmkl_ilp64 -i/opt/intel/mkl/include -shared build/temp.macosx-10.8-x86_64-3.3/numpy/core/src/dummymodule.o -lbuild/temp.macosx-10.8-x86_64-3.3 -o build/lib.macosx-10.8-x86_64-3.3/numpy/core/_dummy.so" failed exit status 1
my ld_library_path
, dyld_library_path
both:
/opt/intel/lib/intel64:/opt/intel/lib:/opt/intel/mkl/lib:/opt/local/library/frameworks/python.framework/versions/3.3/lib:/opt/local/lib:/usr/local/lib:/usr/lib
my dyld_framework_path
is:
/opt/local/library/frameworks:/library/frameworks:/system/library/frameworks
and site.cfg
is:
[default] library_dirs = /opt/intel/lib/intel64:/opt/intel/lib:/opt/intel/mkl/lib:/opt/local/library/frameworks/python.framework/versions/3.3/lib:/opt/local/lib:/usr/local/lib:/usr/lib include_dirs = /opt/intel/include:/opt/intel/include/intel64:/opt/intel/mkl/include:/opt/local/library/frameworks/python.framework/versions/3.3/include/python3.3m:/opt/local/include:/usr/local/include:/usr/include [mkl] library_dirs = /opt/intel/lib/intel64:/opt/intel/lib:/opt/intel/mkl/lib:/opt/local/library/frameworks/python.framework/versions/3.3/lib:/opt/local/lib:/usr/local/lib:/usr/lib include_dirs = /opt/intel/include:/opt/intel/include/intel64:/opt/intel/mkl/include:/opt/local/library/frameworks/python.framework/versions/3.3/include/python3.3m:/opt/local/include:/usr/local/include:/usr/include mkl_libs = mkl_rt lapack_libs = mkl_lapack
symlinks icc
, ifort
in /usr/bin
, functional. contents of dummymodule.c
available in numpy repository on github. i'm not c programmer, can't see what's wrong. i've gotten error using both macports python 3.3.0 (using above settings) , python.org 3.3.0, settings modified point instead of /opt/local
.
plea
can figure out?
edit
i swapped out -shared
-dynamiclib
, , getting:
building extension "numpy.random.mtrand" sources c compiler: icc -m64 -o3 -g -fpic -fp-model strict -fomit-frame-pointer -openmp -xhost -dmkl_ilp64 compile options: '-inumpy/core/src/private -inumpy/core/src -inumpy/core -inumpy/core/src/npymath -inumpy/core/src/multiarray -inumpy/core/src/umath -inumpy/core/src/npysort -inumpy/core/include -i/opt/local/library/frameworks/python.framework/versions/3.3/include/python3.3m -c' icc: _configtest.c icc -m64 -o3 -g -fpic -fp-model strict -fomit-frame-pointer -openmp -xhost -dmkl_ilp64 _configtest.o -o _configtest _configtest failure. removing: _configtest.c _configtest.o _configtest building data_files sources build_src: building npy-pkg config files running build_py copying numpy/version.py -> build/lib.macosx-10.8-x86_64-3.3/numpy copying build/src.macosx-10.8-x86_64-3.3/numpy/__config__.py -> build/lib.macosx-10.8-x86_64-3.3/numpy copying numpy/distutils/intelccompiler.py -> build/lib.macosx-10.8-x86_64-3.3/numpy/distutils copying build/src.macosx-10.8-x86_64-3.3/numpy/distutils/__config__.py -> build/lib.macosx-10.8-x86_64-3.3/numpy/distutils copying numpy/distutils/fcompiler/intel.py -> build/lib.macosx-10.8-x86_64-3.3/numpy/distutils/fcompiler running build_clib customize intelem64tccompiler customize intelem64tccompiler using build_clib running build_ext customize intelem64tccompiler customize intelem64tccompiler using build_ext building 'numpy.core._dummy' extension compiling c sources c compiler: icc -m64 -o3 -g -fpic -fp-model strict -fomit-frame-pointer -openmp -xhost -dmkl_ilp64 compile options: '-inumpy/core/include -ibuild/src.macosx-10.8-x86_64-3.3/numpy/core/include/numpy -inumpy/core/src/private -inumpy/core/src -inumpy/core -inumpy/core/src/npymath -inumpy/core/src/multiarray -inumpy/core/src/umath -inumpy/core/src/npysort -inumpy/core/include -i/opt/local/library/frameworks/python.framework/versions/3.3/include/python3.3m -c' icc: numpy/core/src/dummymodule.c icc -m64 -o3 -g -fpic -fp-model strict -fomit-frame-pointer -openmp -xhost -dmkl_ilp64 -dynamiclib build/temp.macosx-10.8-x86_64-3.3/numpy/core/src/dummymodule.o -lbuild/temp.macosx-10.8-x86_64-3.3 -o build/lib.macosx-10.8-x86_64-3.3/numpy/core/_dummy.so undefined symbols architecture x86_64: "_pymodule_create2", referenced from: _pyinit__dummy in dummymodule.o ld: symbol(s) not found architecture x86_64 undefined symbols architecture x86_64: "_pymodule_create2", referenced from: _pyinit__dummy in dummymodule.o ld: symbol(s) not found architecture x86_64 error: command "icc -m64 -o3 -g -fpic -fp-model strict -fomit-frame-pointer -openmp -xhost -dmkl_ilp64 -dynamiclib build/temp.macosx-10.8-x86_64-3.3/numpy/core/src/dummymodule.o -lbuild/temp.macosx-10.8-x86_64-3.3 -o build/lib.macosx-10.8-x86_64-3.3/numpy/core/_dummy.so" failed exit status 1
so, line says failure.
after _configtest (not sure that's about) , same error(s) down below. thoughts?
icc: command line warning #10006: ignoring unknown option '-shared'
here's problem. compiler trying build executable, though it's been told build shared library. according icc documentation, -shared
available on linux systems. since yours macosx system, think you'd want use -dynamiclib
instead.
edit: suspect you're missing link pylib, in: icc -m64 -o3 -g -fpic -fp-model strict -fomit-frame-pointer -openmp -xhost -dmkl_ilp64 -dynamiclib build/temp.macosx-10.8-x86_64-3.3/numpy/core/src/dummymodule.o -lbuild/temp.macosx-10.8-x86_64-3.3 -o build/lib.macosx-10.8-x86_64-3.3/numpy/core/_dummy.so
.
the missing link causes this:
undefined symbols architecture x86_64: "_pymodule_create2", referenced from: _pyinit__dummy in dummymodule.o ld: symbol(s) not found architecture x86_64
you need add -lpythonx.y
, x.y represents version of python you're linking against. if file exists, linker can't find it, you'll need tell linker using -llink/search/directory
(eg. -llib/
) directive. if file doesn't exist, need build it.
Comments
Post a Comment