PGI Compilers

Fortran, C and C++ compilers from the Portland Group. PGI compilers are the default, recommended compilers on Glenn.

Availability & Restrictions

The PGI compilers are available to all OSC users without restriction.

The following versions of the PGI compilers are available on OSC systems:

Version Glenn Oakley
7.0 X  
7.1 X  
8.0 X  
9.0 X*  
10.0 X  
10.5 X  
11.6 X  
11.8   X
12.5 X X
12.6 X X
12.9   X
12.10 X X*

* - default version

Usage

Set-up

To configure your environment for use of the PGI compilers, follow the system-specific instructions below:

For the Oakley system, run the following command (you may have to unload your selected compiler - if an error message appears, it will provide instructions):

module load pgi

For the Glenn system, run the following commands:

module load pgi

Using the PGI Compilers

Once the module is loaded, compiling with the PGI compilers requires understanding which binary should be used for which type of code. Specifically, use the pgcc binary for C codes, the pgCC binary for C++ codes, the pgf77 for FORTRAN-77 codes and the pgf90 for FORTRAN-90 codes.

Building With the PGI Compilers

The PGI compilers recognize the following command line options (this list is not exhaustive, for more information run man <compiler binary name>):

Compiler option Purpose
-c Compile into object code only; do not link
-DMACRO[=value] Defines preprocessor macro MACRO with optional value (default value is 1)
-g Enables debugging; disables optimization
-I/directory/name Add /directory/name to the list of directories to be searched for #include files
-L/directory/name Adds /directory/name to the list of directories to be searched for library files
-lname Adds the library libname.a or libname.so to the list of libraries to be linked
-o outfile Names the resulting executable outfile instead of a.out
-UMACRO Removes definition of MACRO from preprocessor
-O0 Disable optimization; default if -g is specified
-O1 Light optimization; default if -g is not specified
-O or -O2 Heavy optimization
-O3 Aggressive optimization; may change numerical results
-Mipa Inline function expansion for calls to procedures defined in separate files; implies -O2
-Munroll Loop unrolling; implies -O2
-Mconcur Automatic parallelization; implies -O2
-mp Enables translation of OpenMP directives
 

Further Reading

See Also

Supercomputer: 
Service: 
Technologies: 
Fields of Science: