背景
使用带有第二代 Core i7 处理器的 2012 iMac,我正在尝试在 OSX 10.8.3 上构建NumPy 1.7.0 (最终是 SciPY),该 OSX 10.8.3 链接到英特尔C++ Composer XE 2013和Fortran评估版本中包含的MKL适用于 OSX 的Composer XE 2013。我正在关注英特尔网站上的这篇文章(松散地改编,因为在某些情况下它不是很具体),用于设置、编译器标志等。
问题
使用任一:
$ python3 setup.py config build --compiler=intelem --fcompiler=intelem
或者
$ python3 setup.py config --compiler=intelem --fcompiler=intelem build_clib --compiler=intelem --fcompiler=intelem build_ext --compiler=intelem --fcompiler=intelem
我犯了同样的错误:
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' with '-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' with '-xhost'
icc: command line warning #10006: ignoring unknown option '-shared'
Undefined symbols for 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 for architecture x86_64
icc: command line warning #10121: overriding '-marchcorei7' with '-xhost'
icc: command line warning #10006: ignoring unknown option '-shared'
Undefined symbols for 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 for 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 with exit status 1
我的LD_LIBRARY_PATH
和DYLD_LIBRARY_PATH
都是:
/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
我DYLD_FRAMEWORK_PATH
的是:
/opt/local/Library/Frameworks:/Library/Frameworks:/System/Library/Frameworks
我site.cfg
的是:
[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
指向icc
和ifort
在其中的符号链接是/usr/bin
有功能的。的内容dummymodule.c
可在GitHub 上的 numpy 存储库中找到。我不是 C 程序员,所以我不能立即看出问题所在。我使用 MacPorts python 3.3.0(使用上述设置)和 python.org 3.3.0 都遇到了这个错误,设置修改为指向它而不是/opt/local
.
恳求
任何人都可以帮助解决这个问题吗?
编辑
我换成了-shared
,-dynamiclib
现在得到:
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 for architecture x86_64:
"_PyModule_Create2", referenced from:
_PyInit__dummy in dummymodule.o
ld: symbol(s) not found for architecture x86_64
Undefined symbols for architecture x86_64:
"_PyModule_Create2", referenced from:
_PyInit__dummy in dummymodule.o
ld: symbol(s) not found for 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 with exit status 1
所以,我failure.
在 _configtest (不确定那是什么)和下面的相同错误之后得到一条线。想法?