Macs in Chemistry

Insanely Great Science

gfortran on Snow Leopard

I know there a few Fortran programmers out there so this tip from MacResearch may be useful.

To get gfortran working under Snow Leopard.

- install Xcode
- install fink (I'm using the 32-bit version)
- install gcc44 with fink
That's it. It works by virtue of fortran being among the --enable-languages options set by fink during the gcc44 build (note that of this writing there are no fink binaries for Snow Leopard, so it builds everything from source).
Even though my fink is 32-bit, this gcc44 install results in a 64-bit gfortran compiler. Thus, to build open source packages such as netcdf and openmpi (which I do manually from the source, that is, not using fink), I needed to specify FFLAGS=-m64 FCFLAGS=-m64 for the configure step. To build those packages for all users, I used sudo rather than logging in as root, as something about my root environment (which I very rarely use) messed up those builds when I tried the latter.
Note that for this setup, one needs to use the -m64 flag during compilation and linking of all fortran programs
blog comments powered by Disqus