3

我安装了 xcode4.2,因此,我无法通过自制软件安装 gfortran。

这是错误:

calvin$ brew -v install gfortran
Homebrew 0.8
==> Downloading http://r.research.att.com/gfortran-lion-5666-3.pkg
/usr/bin/curl -f#LA Homebrew 0.8 (Ruby 1.8.7-249; Mac OS X 10.7.2) http://r.research.att.com    /gfortran-lion-5666-3.pkg -o /Users/calvin/Library/Caches/Homebrew/gfortran-4.2.4-5666.3.pkg
######################################################################## 100.0%^[[B
/usr/bin/xar -xf /Users/calvin/Library/Caches/Homebrew/gfortran-4.2.4-5666.3.pkg 
mv *.pkg/Payload Payload.gz 
ls | grep -v Payload | xargs rm -r 
/usr/bin/gcc
Error: Currently the gfortran compiler provided by this brew is only supported
for:

  - XCode 3.1.4 on OS X 10.5.x
  - XCode 3.2.2/3.2.3 -- 4.0 on OS X 10.6.x
  - XCode 4.1 on OS X 10.7.x

The AppStore and Software Update can help upgrade your copy of XCode.
The latest version of XCode is also available from:

http://developer.apple.com/technologies/xcode.html
rmdir: /usr/local/Cellar/gfortran/4.2.4-5666.3 (empty)
Error: Nothing was installed to /usr/local/Cellar/gfortran/4.2.4-5666.3

我怎样才能让它工作(使用 xcode 4.2,降级我的 xcode 4.2 并不是一个好的选择)?

4

1 回答 1

2

以我的经验,Homebrew 是在 OS X 上获取 gfortran 的最糟糕的选择。

您是否尝试过此页面的二进制文件?

另一种选择是MacPorts。您也可以自己从源代码编译 gfortran。使用 XCode 3 并没有那么困难。但是,由于默认的 LLVM 编译器,XCode 4 的情况可能会有所不同。

是否有任何特定理由为您使用最新版本的 XCode?首先尝试二进制文件。我没有用 XCode 4 测试它们,但是......如果你尝试,请告诉我们。

于 2011-10-16T22:04:16.733 回答