Python中文
首页
教程
问答
标签
搜索
登录
注册
使用python3.3在OSX上用MKL构建NumPy时出错
回答此问题可获得
20
贡献值,回答如果被采纳可获得
50
分。
<h2><strong><em>背景</em></strong></h2> <p>使用带有第二代酷睿i7处理器的2012年iMac,我试图在OSX 10.8.3上构建<a href="http://www.numpy.org" rel="nofollow">NumPy</a>1.7.0(最终是<a href="http://www.scipy.org" rel="nofollow">SciPY</a>),该版本链接到英特尔的<a href="https://registrationcenter.intel.com/RegCenter/Evalform.aspx?productid=1771" rel="nofollow">C++ Composer XE 2013</a>和<a href="https://registrationcenter.intel.com/RegCenter/Evalform.aspx?productid=1795" rel="nofollow">Fortran Composer XE 2013</a>的评估版中。我在英特尔的站点上关注<a href="http://software.intel.com/en-us/articles/numpyscipy-with-intel-mkl" rel="nofollow">this article</a>的设置、编译器标志等</p> <h2><strong><em>问题</em></strong></h2> <p>使用以下任一选项:</p> <pre><code>$ python3 setup.py config build --compiler=intelem --fcompiler=intelem </code></pre> <p>或者</p> ^{pr2}$ <p>我也有同样的错误:</p> <pre><code>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 </code></pre> <p>我的<code>LD_LIBRARY_PATH</code>和{<cd2>}都是:</p> <pre><code>/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 </code></pre> <p>我的<code>DYLD_FRAMEWORK_PATH</code>是:</p> <pre><code>/opt/local/Library/Frameworks:/Library/Frameworks:/System/Library/Frameworks </code></pre> <p>我的<code>site.cfg</code>是:</p> <pre><code>[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 </code></pre> <p>指向<code>icc</code>和<code>ifort</code>的符号链接位于<code>/usr/bin</code>中,并且是功能性的。<code>dummymodule.c</code>的内容可在<a href="https://github.com/numpy/numpy/blob/master/numpy/core/src/dummymodule.c" rel="nofollow">GitHub</a>上的numpy存储库中找到。我不是一个C程序员,所以我不能马上看出问题所在。我在使用MacPortsPython3.3.0(使用上述设置)和python.org网站3.3.0,修改了指向它而不是<code>/opt/local</code>的设置。在</p> <h2>抗辩</h2> <p>有人能帮忙弄清楚吗?在</p> <h2><strong>编辑</strong></h2> <p>我把<code>-shared</code>换成了<code>-dynamiclib</code>,现在得到了:</p> <pre><code>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 </code></pre> <p>因此,我在configtest(不确定这是关于什么的)之后得到一行内容是<code>failure.</code>,下面是相同的错误。思想?在</p>
0 条评论
分类:
Python问答
请先
登录
后评论
默认排序
时间排序
1 个回答
匿名
1天前
擅长:python、mysql、java
<p>我建议您更改文件numpy-1.7.0/numpy/distutils/intelccompiler.py第37行至</p> <p>icc-m64-fPIC-O3-g-fPIC-fp model strict-fomit帧指针-openmp-xhost-undefined dynamic_查找-bundle-DMKL'ILP64</p> <p>我以前有过这个编译错误</p>
请先
登录
后评论
针对此问题:
更多的回答
关注
89
关注
收藏
1
收藏,
216
浏览
网友 提问于 2天前
相关Python问题
如何合并多个PDF文件?
8 回答
如何合并多个xarray数据变量及其坐标?
6 回答
如何合并多个列中具有重复值的行
2 回答
如何合并多个唯一id
1 回答
如何合并多个图纸并使用图纸名称的名称重命名列名?
2 回答
如何合并多个字典并添加同一个键的值?(Python)
4 回答
如何合并多个搜索结果文件(pkl)以将它们全部打印在一起?
3 回答
如何合并多个数据帧
7 回答
如何合并多个数据帧并使用Pandas为假人添加列?
4 回答
如何合并多个数据帧并按时间戳排序
8 回答
如何合并多个数据帧的列表并用另一个lis标记每列
10 回答
如何合并多个数据框中的列
8 回答
如何合并多个文件?
5 回答
如何合并多个查询集?
6 回答
如何合并多个绘图?
10 回答
如何合并多个词典
7 回答
如何合并多个输入数据集(数据帧)?
1 回答
如何合并多条记录中拆分的文本行
10 回答
如何合并多索引列datafram
1 回答
如何合并多级(即多索引)数据帧?
2 回答