【发布时间】:2014-02-18 23:46:23
【问题描述】:
不确定这是否是此类问题的正确位置。如果没有,请指出正确的方向。
我在带有 Xcode 3.1.4 的白色 13" macbook 上使用 OSX 10.5.8。通过 macports 安装 py27-bottleneck 时,出现以下错误
---> Building py27-bottleneck
running build
running build_py
package init file 'bottleneck/tests/__init__.py' not found (or not a regular file)
package init file 'bottleneck/src/func/__init__.py' not found (or not a regular file)
package init file 'bottleneck/src/move/__init__.py' not found (or not a regular file)
package init file 'bottleneck/tests/__init__.py' not found (or not a regular file)
package init file 'bottleneck/src/func/__init__.py' not found (or not a regular file)
package init file 'bottleneck/src/move/__init__.py' not found (or not a regular file)
running build_ext
building 'func' extension
/usr/bin/gcc-4.2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -arch i386 -I/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/include -I/opt/local/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c bottleneck/src/func/func.c -o build/temp.macosx-10.5-i386-2.7/bottleneck/src/func/func.o
In file included from /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1760,
from /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:17,
from /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/include/numpy/arrayobject.h:4,
from bottleneck/src/func/func.c:314:
/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:15:2: warning: #warning "Using deprecated NumPy API, disable it by " "#defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION"
/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/include/numpy/__ufunc_api.h:242: warning: ?_import_umath? defined but not used
cc1(53864) malloc: *** mmap(size=298745856) failed (error code=12)
*** error: can't allocate region
*** set a breakpoint in malloc_error_break to debug
cc1: out of memory allocating 298742336 bytes after a total of 0 bytes
error: command '/usr/bin/gcc-4.2' failed with exit status 1
Command failed: cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_python_py-bottleneck/py27-bottleneck/work/Bottleneck-0.8.0" && /opt/local/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7 setup.py --no-user-cfg build
Exit code: 1
Error: org.macports.build for port py27-bottleneck returned: command execution failed
Warning: targets not executed for py27-bottleneck: org.macports.activate org.macports.build org.macports.destroot org.macports.install
Please see the log file for port py27-bottleneck for details:
/opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_ports_python_py-bottleneck/py27-bottleneck/main.log
Error: Problem while installing py27-bottleneck
我真的不知道问题出在哪里以及为什么会这样,但我注意到 macports 仍在使用旧的编译器。
那么有人知道我该如何解决这个问题吗?
另外,为什么 macports 仍然使用 gcc-4.2,而我的所有符号链接都指向 /opt/local/bin/gcc-mp-4.8。我记得之前在安装其他一些 python 包时遇到了这个问题(或者可能是这个,我不记得了),所以我通过更改 makefile 强制 macports 使用较新的编译器,它暂时工作。直到我开始升级我过时的端口。显然,现在 macports 遇到了链接错误,只是重新安装了所有这些包(这就是我现在所在的位置)。那么为什么 macports 不只是使用较新的编译器呢?或者我怎样才能让他这样做? (也许我不应该?)
感谢任何帮助。谢谢。
【问题讨论】:
-
macports 未设置为使用不同的编译器 gcc 选择是在您使用 gcc 编写代码时选择气体,基本上因为他们无法使用每个编译器测试每个端口
-
@Mark 我知道我可以用不同的编译器编译这个 python 模块而不会出现任何问题。我应该使用不同的编译器在 macports 之外编译它还是会带来更多麻烦?
-
如果涉及 c++,那么问题会更多 - 但是在这种情况下,它是编译器错误或者您没有足够的内存 - macbook 中有多少内存? macports 也可能不再在 10.5 上进行测试
-
@Mark 我当时有大约 2.5GB 的可用内存,就像我提到的,当我手动更改自述文件以使用另一个编译器时,它编译正确。我也可以正确使用使用该模块的模块。但是当更新可用并且我尝试升级过时的端口时,它当然会再次使用原始编译器。这就是我现在的位置。
标签: macports