Thursday, October 02, 2008

Fortran compiler notes

I've been working on building heasoft distributions using both gfortran and g95. This under Tiger with Xcode 2.4.1 (which is gcc 4.0.1).

g95 is the current snapshot binary from www.g95.org which is v0.92. It is installed under /usr/local. To build I had to edit the hmakerc files after configure to remove -fno-f2c from the FFLAGS macro.

gfortran is from "fink install gcc42" and is v4.2.2. To build requires editing hmakerc to change -O2 to -O in the FOPT macro and to add at the beginning of the F77LIBS4C the directories -L/usr/lib -L/usr/lib/i686-apple-darwin8/4.0.1 and -L/sw/lib/gcc4.2/lib/gcc/i686-apple-darwin8/4.2.2. Note that it is vital they be in this order and at the beginning of the macro or else the loader will link in gcc v4.2.2 libraries instead of gcc v4.0.1.

No comments: