Search code examples
xcode4homebrewgfortran

homebrew install for gfortran fails for xcode 4.2


I have xcode4.2 installed and because of that, I am unable to get gfortran installed via homebrew.

Here's the error:

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

How can I get this working (using xcode 4.2, downgrading my xcode 4.2 isn't really a good option) ?


Solution

  • Homebrew in my experience is the worst option to obtain gfortran on OS X.

    Did you try binaries from this page?

    Another option is MacPorts. And you can also compile gfortran from sources by yourself. It's not that difficult with XCode 3. However the story might be different with XCode 4, because of the default LLVM-compiler.

    Is there any specific reason to use the latest version of XCode for you? Try binaries first. I didn't test them with XCode 4 but... Let us know if you try.