无法通过Homebrew安装gfortran

27
我尝试安装gfortran时收到了这条消息。
~$ brew install gfortran
Error: No available formula for gfortran
GNU Fortran is now provided as part of GCC, and can be installed with:
  brew install gcc
我的问题是如何使用Homebrew或Port安装gfortran?
或者
如果现在GNU Fortran是GCC的一部分,我该如何使用gcc编译Fortran代码?
我不确定,也许我误解了什么。我记得上次我仍然可以使用gfortran编译我的代码,但现在它无法工作。
进一步信息:
当我使用命令brew list时,我仍然看到gfortran存在,但无法使用。
更多信息(最新):
好了,现在我可以使用gfortran命令,但出现了另一��问题。
~$ gfortran-4.9 hello.f
dyld: Library not loaded: /usr/local/lib/libcloog-isl.4.dylib
  Referenced from: /usr/local/Cellar/gcc/4.9.2/libexec/gcc/x86_64-apple-darwin14.0.0/4.9.2/f951
  Reason: image not found
gfortran-4.9: internal compiler error: Trace/BPT trap: 5 (program f951)
Abort trap: 6
1个回答

34

根据说明,只需执行brew install gcc即可。gcc包含了gcc、g++、gfortran等工具。


非常感谢您的回答,现在我可以使用“gfortran”命令了,但又遇到了另一个问题。 - fronthem
似乎cloog未安装或未正确链接到Homebrew的前缀。请将brew doctor的输出发布到Gist或pastebin,并提供链接。 - Tim Smith

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接