How to install f77 on Mac OS X 10.6
Asked Answered
P

2

8

Can anyone tell me how to install f77 on Mac OS X 10.6? I am quite new to f77.

Thank you very much

Pharisaic answered 29/3, 2011 at 10:5 Comment(2)
This is probably a question better suited for Super User or Apple...Annunciata
@Jonathan Dursi - No, it is perfectly fine here. Compiles usually go under "software tools commonly used by programmers" or "matters that are unique to the programming profession".Iso
A
11

So the compiler you're looking for is gfortran, part of the gcc suite. Gfortran will compile old f77 code, but it will also compile more modern (Fortran90, 95, 2003, and some 2008 support) versions of the same language; if you're going to start working on someone's old f77 code I strongly suggest you learn about what more modern versions of fortran look like. Things have improved greatly. You may see options to install g77, which was the previous generation of gnu fortran compilers -- don't do it. It's 5 years old and hasn't been supported for 4 years.

As to installing gfortran, you have several options:

  • MacPorts is one great source for linux software on your mac; it builds things for your machine, so installing can take some time. Once you've installed the macports binaries, you can type "sudo port install gcc46 +gfortran" to install the newest gcc and gfortran compilers.

  • Binaries are available at the HPC for Mac OS X website. I think these are modestly older binaries for 4.5. I haven't tried the gfortran binaries there, but that website is usually reliable.

  • The gcc wiki points still elsewhere for 4.5 binaries for Mac OS X.

Annunciata answered 29/3, 2011 at 11:19 Comment(4)
MacPorts "gcc46 +gfortran" didn't install gfortran for me, just gcc, so you might need to fall back to the gcc45 package, which includes gfortran by default. I recommend against the gcc binary at HPC ... it installs (or did several years ago) in /usr/local, which can cause very nasty library conflicts with the OS.Wiersma
Err... why should installing something in /usr/local cause any library conflicts with the OS?Louvar
I had to use gfortran-mp-4.6 as compiler, instead of f77 or gfortran.Oldtimer
gfortran will certainly compile f77 code, but it spits out tons of errors - obviously legacy code doesn't do well with new compilers.Thermoluminescent
D
4

Intel also provides their compiler to OS X and linux users for free under a very specific non-commercial license. If you are going to be using Fortran in a way that is compliant with their licensing terms you can install it from them. They have a pretty good support forum for their OS X/Linux compiler including install directions.

Desensitize answered 31/3, 2011 at 13:49 Comment(1)
The non-commercial license has been removed for Mac OS X and is going away for Linux too. 9/2014Desensitize

© 2022 - 2024 — McMap. All rights reserved.