Fortran code for the Linux service nodes, should be built using the ftn command provided by Cray. Advanced users may call the PGI compilers directly, but this is not the suggested method. The ftn command takes care of cross-compiling, looks at the programming environment and takes care of some of the work of linking in libraries, etc.
NICS supports Fortran compilers including 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 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 more information on the 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.

