Running UNIX fortran compilers

24 Jan 1994

The fortran compilers on different UNIX platforms have different options for controlling debugging and otptimization. It order to simplify the compiling of code on different computers, a shell script can be used to issue the appropriate commands.

Such a script was written for GEM and then adapted by the SLAC B factory group. This script knows how to call compilers on AIX, HP-UX, IRIX, SunOS, Solaris, ULTRIX, and OSF1. For example it knows that the fortran compiler under AIX is called xlf not f77.

It also calls the C preprocessor to handle the includes. Unlike when the compiler calls the C preprocessor itself, the expanded code is kept. This expanded code from name.F is kept in name.f, and name.f is then compiled. This technique makes debugging easier, since the source code line number are correct in the debugger.

We keep our script in a /usr/products/IRIX/off781/devel/bin/f77_781. Alternatively, if you have setup off781 you can use $OFF781_BIN/f77_781.


Mike Procario (procario@fnal.gov)