默认编译器Macports

时间:2014-02-18 23:46:23

标签: macports

不确定这是否是此类问题的正确位置。如果没有,请指出我正确的方向。

我在带有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包时遇到了这个问题(或者可能就是这个,我不记得了),所以我强迫macports通过更改makefile来使用更新的编译器,它暂时工作。直到我开始升级过时的端口。显然现在macports遇到了链接错误,只是重新安装了所有这些包(这就是我现在所处的位置)。那么为什么macports不仅仅使用更新的编译器呢?或者我怎么能让他这样做? (也许我不应该?)

感谢任何帮助。感谢。

1 个答案:

答案 0 :(得分:1)

在10.5.8上使用Xcode 3.1.4 MacPorts使用以下编译器(按顺序,除非被端口列入黑名单,因为已知会中断):

  1. 来自/usr/bin
  2. 的GCC 4.2
  3. 相同编译器的MacPorts构建(带有一些小错误修正)
  4. 来自/usr/bin
  5. 的GCC 4.0
  6. 来自MacPorts的Clang 3.3
  7. 似乎这个端口应该将GCC 4.2列入黑名单(也可能是2.和3.)。您可以将其归档为错误,但说实话,只有尽最大努力才能提供对10.5的支持,因为大多数维护人员都无法在此平台上进行测试,因此可能无法让您随时随地除非您提供报告补丁。

    您可以像以前一样从命令行覆盖编译器。要从立即开始重建停止rev-upgrade,可以在macports.conf中设置revupgrade_mode report。我必须看到port -dy rev-upgrade的输出,当它遇到破碎的端口时才知道它为什么会产生破坏的二进制文件。

    已经提到选择机制不会影响MacPorts为其端口选择的编译器(因为取决于用户选择的内容会添加另一个可能使构建不可再生的变量,这是我们试图避免的事情)。 MacPorts的'默认编译器可以更改,但这样做是完全不受支持的,故意没有记录。话虽这么说,如果您仍想尝试这一点,https://apple.stackexchange.com/questions/118550/define-local-keyword-globally-in-a-macports-config/122997#122997有一些关于如何做到这一点的信息。