PGI Compiler

Overview

The Portland Compiler Suite (now owned by Nvidia) contains Fortran 95, Fortran 90, Fortran 77, C, C++, HPF and CUDA Accelerator compilers for machines running 64bit Linux.

Version 18.10 is installed on CSF4.

Note: the PGI CUDA Accelerator supports OpenACC compiler directives.

Restrictions on use

There are only two network licenses available site wide for each of Fortran and C/C++. If you get a license related error, it is almost certainly because all of our licenses are in use and you should try again at a later time. For further licensing information see the following webpage:

Set up procedure

To gain access to these compilers, run one of the following command after logging into the login node.

module load pgi/18.10          # Will use some GCC 6.4.0 functionality

Basic compilation commands

Basic compilation commands are as follows:

# C
pgcc hello.c -o hello

# C++ (note: use pgc++ if link compatibility with the GNU C++ compiler is required)
pgCC hello.cpp -o hello
pgcpp hello.cpp -o hello

# Fortran
pgf90 hello.f90 -o hello
pgf95 hello.f90 -o hello
pgfortran hello.f90 -o hello

# High performance fortran
pghpf hello.hpf -o hello

Target Architectures

To compile specifically for architectures such as Intel Skylake use the -tp=architecture flag. For example:

pgcc -tp=skylake hello.c -o hello_skylake

Note that the installed version of the PGI compiler does not support Intel Cascade Lake found in CSF4. This is newer than Skylake. You may still compiler specifically for Skylake and your code will be optimized for the features found in that CPU. This will give you some optimization but not the maximum that the Cascade Lake could actually do.

Sample code

Sample code can be found in the subfolders of the $PGIEXAMPLES directory

AutoPar  CUDA-Fortran  CUDA-Libraries  CUDA-x86-SDK  F2003  MPI  OpenACC  OpenMP

Each subfolder contains makefiles to compile the sample code. If you copy these folders and see an errors like /usr/bin/ld: cannot open output file c1.exe: Permission denied when compiling ensure you have the necessary permissions to write files to your folders.

Further information

Once you have loaded the PGI module (see set up procedure), basic documentation is available as a manpage:

man pgcc
man pgf90
man pgc++

Further Info

Last modified on September 2, 2021 at 3:35 pm by George Leaver