【发布时间】: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