【问题标题】:Default Python compilers on MacOS XMacOS X 上的默认 Python 编译器
【发布时间】:2010-09-04 23:35:43
【问题描述】:

我正在尝试在 MacOS X 上为 Python 安装 matplotlib。如果我使用系统 Python 2.6.1,matplotlib 使用的默认编译器命令(可能通过 distutils)是::

gcc-4.2 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes
g++-4.2 -Wl,-F. -bundle -undefined dynamic_lookup

但是,如果我只是将 python.org 2.6.6 Python 添加到 PATH 以使用它,默认编译器会突然更改为

gcc-4.0 -DNDEBUG -g -O3
c++ -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk \
    -g -bundle -undefined dynamic_lookup

这会导致问题,所以我想知道在运行python setup.py install 时,是什么决定了使用哪些 C 编译器?为什么使用 python.org Python 意味着使用不同的默认编译器命令?

【问题讨论】:

    标签: python compiler-construction


    【解决方案1】:

    python.org 版本旨在与 MacOsX 10.5 和 10.6 一样工作,因此它当然必须坚持两者都通用的gcc 版本。当然,Apple 的系统 Python 没有这样的限制——它只支持一个非常特定的 MacOsX 版本,因此可以使用可用于该特定版本的“最新和最好的”gcc……当然它确实如此; -)。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-04-12
      • 2023-03-29
      • 1970-01-01
      • 1970-01-01
      • 2010-11-13
      • 2014-10-24
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多