【问题标题】:Questions about upgrading scipy via homebrew and how to go about getting a fortran compiler关于通过自制软件升级 scipy 以及如何获取 fortran 编译器的问题
【发布时间】:2015-04-01 20:32:58
【问题描述】:

我试着跑

 pip install --upgrade scipy

但是我得到了一堆错误:

   running build_clib

customize UnixCCompiler

customize UnixCCompiler using build_clib

customize Gnu95FCompiler

Could not locate executable gfortran

Could not locate executable f95

customize NAGFCompiler

customize AbsoftFCompiler

Could not locate executable f90

Could not locate executable f77

customize IBMFCompiler

Could not locate executable xlf90

Could not locate executable xlf

customize IntelFCompiler

Could not locate executable ifort

Could not locate executable ifc

customize GnuFCompiler

Could not locate executable g77

customize G95FCompiler

Could not locate executable g95

customize PGroupFCompiler

Could not locate executable pgfortran

don't know how to compile Fortran code on platform 'posix'

building 'dfftpack' library

error: library dfftpack has Fortran sources but no Fortran compiler found

看来我需要安装一个fortran编译器(不知道这是否能解决我所有的问题)。那我试试

brew install gcc

然后我收到一条警告:

  gcc-4.9.2_1 already installed, it's just not linked

然后我尝试链接它。

  brew link gcc

然后我明白了

  Error: Could not symlink bin/c++-4.9

 Target /usr/local/bin/c++-4.9
  is a symlink belonging to gcc49. You can unlink it:
  brew unlink gcc49

我应该这样做吗?我想要 gcc49,因为我在 mac 上,并且我使用 gcc49 来获得 openmp 支持(如果我没记错的话,它会在我做任何 NVIDIA 的事情时使用)。取消链接gcc49和链接gcc会有什么后果?

【问题讨论】:

    标签: python-2.7 gcc scipy homebrew gfortran


    【解决方案1】:

    如果您真的永远需要 4.9 版,您应该只需要 gcc49

    要同时获得与 OpenMP 兼容的 gcc 和 fortran 编译器,您可以:

    • brew reinstall gcc49 --with-fortran --without-multilib,或
    • brew unlink gcc49 && brew install gcc --without-multilib

    无论哪种方式,您都必须重建整个 gcc 集合;对不起!

    【讨论】:

    • “--without-multilib”有什么作用?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2012-12-29
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-01-18
    • 2021-05-20
    • 2019-03-08
    相关资源
    最近更新 更多