PGI Compilers

Fortran, C, and C++ compilers from the Portland Group

Availability and Restrictions

PGI compiler is available on Oakley, Ruby, and Owens Clusters. The versions currently available at OSC are:

Version Oakley ruby Owens notes
12.10 X     Default version on Oakley prior to 09/15/2015
13.5.0   X    
14.9.0   X   Default version on Ruby prior to 09/15/2015
15.4.0 X* X*    
16.5.0     X*  
* : Current Default Version

You can use module avail pgi  to view available modules for a given machine. Feel free to contact OSC Help if you need other versions for your work.

Access

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

Usage on Oakley

Set-up

To configure your environment for the default version of the PGI Compilers, use  module load pgi . To configure your environment for a particular PGI compiler version, use  module load pgi/version . For example, use  module load pgi/12.10  to load PGI compiler version 12.10.

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.

See our compilation guide for a more detailed breakdown of the compilers.

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
 

Usage on Ruby

Set-up

To configure your environment for the default version of the PGI Compilers, use  module load pgi . To configure your environment for a particular PGI compiler version, use  module load pgi/version . For example, use  module load pgi/14.9.0  to load PGI compiler version 14.9.

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.

See our compilation guide for a more detailed breakdown of the compilers.

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
 

Usage on Owens

Set-up

To configure your environment for the default version of the PGI Compilers, use  module load pgi . To configure your environment for a particular PGI compiler version, use  module load pgi/version . For example, use module load pgi/16.5.0  to load PGI compiler version 16.5.0.

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 pgc++ binary for C++ codes, the pgf77 for FORTRAN-77 codes and the pgf90 for FORTRAN-90 codes.

See our compilation guide for a more detailed breakdown of the compilers.

Building with the PGI Compilers

The PGI compilers recognize the following command line options (this list is not exhaustive, for more information runman <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: