PGI Compilers and Tools

Article ID: 365
Last updated: 04 Dec, 2025

As an alternative to using Intel compilers for Fortran, C, and C++ programs, you can use the compilers and program development tools from PGI Compilers and Tools. By default, the PGI compilers generate code that is optimized for the compilation host.

Note: The PGI compilers have been rebranded by NVIDIA. This article will be removed in the near future.

PGI Compiling

Several versions of PGI compilers and tools are installed as modules under the /nasa system directory. To view available versions, run:

pfe21% module use -a /nasa/modulefiles/testing
pfe21% module avail comp-pgi

-------- /nasa/modulefiles/testing ---------
comp-pgi/17.10 comp-pgi/18.10 comp-pgi/18.4  comp-pgi/19.10 comp-pgi/19.5  comp-pgi/20.4

The following command line will load version 18.10:

pfe21% module load comp-pgi/18.10

Note: Starting with the PGI compiler 2018, two different code generators (PGI-proprietary vs LLVM-based) are included in each package. The default code generator for 2018 versions is the PGI-proprietary code generator and for 2019 and later versions is the LLVM-based generator. The PGI 2019 compilers using LLVM are not link-compatible with PGI 2018 and prior releases.

Using the PGI Compilers

PGI provides multiple commands for different languages or functions. In 18.10 and earlier versions, the following are available.

Command Language or Function
pgfortran PGI Fortran
pgf77 Fortran 77
pgf90 or pgf95 Fortran 90/95/F2003
pgcc ANSI C99 and K&R (Kernighan and Ritchie) C
pgc++ GNU-compatible C++
pgdbg Source code debugger (supports OpenMP and MPI)
pgprof Performance profiler (supports OpenMP and MPI)

Note: By default, the PGI compilers generate code that is optimized for the type of processor on which compilation is performed (the compilation host). Be aware that the processors are forward-compatible, but not backward-compatible. Thus a code compiled and optimized on a newer-generation processor will not necessarily execute correctly on previous-generation processors.

If you want to build an executable that targets a specific processor type, use the -tp flag:

-tp= skylake-64 Intel Skylake Xeon processor, 64-bit mode
(includes Skylake and Cascade Lake)
-tp= haswell-64 Intel Haswell architecture Core processor, 64-bit mode
(includes Haswell and Broadwell)
-tp= sandybridge-64 Intel SandyBridge architecture Core processor, 64-bit mode
(includes Sandy Bridge and Ivy Bridge)
TIP: Using the -tp=sandybridge-64,haswell-64,skylake-64 option will generate a single executable in which the code is optimized for the Intel Sandy Bridge, Haswell, and Skylake architectures. The choice of which optimized copy to execute is made at run time and depends on the machine executing the code. You must load comp-pgi/18.4 or later versions in order to use -tp= skylake-64.

PGI recommends that for best performance on processors which support SSE instructions (including all NAS processor types), use pgfortran, even for FORTRAN 77 code, use the -fastsse option.

For more information about the PGI compilers, see man pgfortran, man pgcc, and man pgc++ or use the pgfortran -help, pgcc -help, or pgc++ -help commands. Information about the PGI debugger and performance analysis tool can be found using the commands pgdbg -help and pgprof -help.

Contact Us

General User Assistance

Security

  • Report security issues 24x7x365
  • Toll-free: 1-877-NASA-SEC (1-877-627-2732)
  • E-mail: soc@nasa.gov

User Documentation

High-End Computing Capability (HECC) Portfolio Office

NASA High-End Computing Program

Tell Us About It

Our goal is furnish all the information you need to efficiently and effectively use the HECC resources needed for your NASA computational projects.

We welcome your input on features and topics that you would like to see included on this website.

Please send us email with your wish list and other feedback.