I am running Mac OS X 10.7.3 (Lion)

I have a problem in using the fortran compiler g77: any program I try to compile, it gives me this message: "g77: installation problem, cannot exec `as"

I've downloaded and installed the latest release of Xcode, but nothing changed...

Thanks in advance for any help,


  • Where did you get g77 from as it is not prt of Xcode 4 – mmmmmm Apr 12 '12 at 11:50
  • From hpc.sourceforge.net – mcastel Apr 13 '12 at 13:25
  • 1
    Have you downloaded the Xcode command line tools? – mmmmmm Apr 13 '12 at 14:28

g77 is not part of Xcode. You may have a look here http://hpc.sourceforge.net/ which provides a version compatible with Lion and XCode 4.x.

On LION, with XCode 4.3 you will need to download the command-line tools as an additional step. You will find the option to download the command-line tools in XCode 4.3's Preferences


I think finding g77 will be a challenge, you are more likely to find gfortran (the HPC link you have been given provides gfrotran).

Aside from HPC, you can get gfortran for Lion from the GCC wiki, which provides a binary for OSX at:


or from the R project:


(I use the R project one, and you need to create the symlink

lrwxr-xr-x  1 root  wheel  21 12 Apr 14:50 /usr/bin/gfortran@ -> /usr/bin/gfortran-4.2

and it works fine, at least to compile Julia).

More on the matter is here:


  • 1
    gfortran is the replacement of g77. – nohillside Jun 24 '12 at 14:58

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .