To build Fortran code for the Linux service nodes, you can call the PGI compilers directly. It is a good idea however, to use the compiler wrappers provided by Cray. In addition to taking care of cross-compiling, the Cray wrappers look at programming environment and take care of some of the work of linking in libraries, etc. The compiler wrapper for Fortran is ftn.
NICS supports Fortran compilers from Portland Group (PGI), GNU, and PathScale. Only one compiler is available at a time to avoid ambiguity. The module command may be used to determine which compiler is being used. Modules which define the programming environment (including which compiler is being used) begin with PrgEnv-:
module avail PrgEnv
In addition, there are modules for the compilers themselves. These can be used to change which version of a compiler you are using. If you are changing to a different compiler entirely, you should not need to change these, PrgEnv- should do that automatically.
Most of the flags for the GNU compilers will also work for Pathscale, PGI is a little different. For example, to compile OpenMP code with PGI, you need to use the flag -mp, whereas with GNU and Pathscale, you would use -fopenmp. For details on the flags accepted by each compiler, see the man pages for each executable name:
| PGI | GNU | Pathscale | |
|---|---|---|---|
| Fortran | pgf90 or pgf77 | gfortran | pathf90 |
Fortran Documentation
See man ftn for use of the ftn command. See man pgf77 or man pgf90 for a full list of compiler options. PDF and HTML documentation is also available online from PGI at http://www.pgroup.com/resources/docs.htm. Documentation is also available from http://docs.cray.com.

