Why Would You Use a Portland Group Compiler

The Portland Group compilers are production quality, high performance optimizing compilers. They provide extensive documentation and tools. They are not recommended for new programs on Princeton clusters.

A reason for chosing an Portland Group compiler would be that the application under consideration was developed with an Portland Group compiler.


Princeton has a current license. The compilers are installed on an as-requested basis onto cluster head nodes.


The Portland Group compilers accept the standard ISO / ANSI languages with some extensions.

Simple Usage

To compile a C source program named test.c into an executable program named test, use

pgcc -o test test.c

To compile a C source program named gravity.c into an object file to be linked later, use

pgcc -c gravity.c

To combine the C object files, main.o, tensor.o, matrix.o and vector.o into an executable program called algebra, use

pgcc -o algebra main.o tensor.o matrix.o vector.o

Similarly, for a C++ program, use

pgCC -o test test.cxx

pgCC -c gravity.cxx

pgCC -o algebra main.o tensor.o matrix.o vector.o

For a Fortran program, one might use

pgfortran -o test test.f

pgfortran -c gravity.f

pgfortran -o algebra main.o tensor.o matrix.o vector.o

Programs written in Fortran 90 should be named ending with ".f90", rather than ".f"


The main tool used to debug Portland Group compiler suite programs is the Gnu debugger, gdb. Allinea's commercial debugger, DDT, is available on many of the clusters. Usage instructions for DDT can be foundhere.