【问题标题】:How to change the default gcc compiler for python如何更改python的默认gcc编译器
【发布时间】:2018-08-07 16:24:58
【问题描述】:

我已经在我的电脑上安装了 gcc 4.9.2(mac osx 10.10, 64 bit),而 Python 环境中显示的是 gcc 4.2 版本。我不知道为什么会这样。

我在调用 numpy.f2py 函数时遇到了一些问题,我认为这可能与不兼容的 gcc 编译器有关。

1.Python 外壳

▶ python
Python 3.5.5 | packaged by conda-forge | (default, Jul 23 2018, 23:45:11) 
[GCC 4.2.1 Compatible Apple LLVM 6.1.0 (clang-602.0.53)] on darwin
Type "help", "copyright", "credits" or "license" for more information.

2.在终端

▶ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/local/libexec/gcc/x86_64-apple-darwin14.0.0/4.9.2/lto-wrapper
Target: x86_64-apple-darwin14.0.0
Configured with: ../gcc-4.9-20141029/configure --enable-languages=c++,fortran
Thread model: posix
gcc version 4.9.2 20141029 (prerelease) (GCC)   

我认为这个问题可能是因为 gcc 编译器是在 python 之后安装的。如何解决这个问题,希望得到您的建议。

【问题讨论】:

    标签: python python-2.7 gcc fortran gfortran


    【解决方案1】:

    我相信你在启动python交互式shell时得到的[GCC 4.2.1 Compatible Apple LLVM 6.1.0 (clang-602.0.53)]是用来编译python解释器的编译器,它与f2py使用的编译器无关。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-12-11
      • 2017-08-28
      • 2013-01-24
      • 2023-04-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-01-12
      相关资源
      最近更新 更多