PGI - Compiling and Linking C/C++ Programs

Pacman

The PGI C compilers are:

pgcc or mpicc

C++ uses the command:

pgCC or mpiCC

Here are sample compiler commands showing common options:

pacman% pgcc -O3 -o prog prog.c

pacman% pgCC -O3 -o prog prog.cpp

Details concerning the examples (see " man pgcc or man pgCC for more information):

Fish

The PGI C compiler for serial and MPI applications is:

cc

The PGI C++ compiler for serial and MPI applications is:

CC

Here are sample compiler commands showing common options:

fish1 % cc -O3 -o prog prog.c fish1 % CC -O3 -o prog prog.cpp

Compiler Options

See "man pgcc" or "man pgCC" for more information.

Option Description
-c Generate intermediate object file but does not attempt to link.
-g Adds information for debugging to the object file and/or executable.
-I<directory> Tells the preprocessor to search in directory for include or module files.
-L<directory> Tells the linker to search in directory for libraries.
-O3 Higher level of optimization than -O2 (the default optimization level).
-fast Higher level optimization (default is -O2). This flag should be used in both compilation andlinking steps.
-Mipa Tells the compiler to perform interprocedural analysis. This option can be very timeconsuming to perform. This flag should be used in both compilation and linking steps.
-Mconcur Enables autoparallelization. Additional options can be used with -Mconcur to provide morefine-grained control of autoparallelization, see man pgcc or man pgCC for details.
-Minfo Instructs the compiler to report optimizations that are made.
-Mneginfo Instructs the compiler to report optimizations that are not made.
-mp Enables parallelization via OpenMP directives.

Please refer to the online PGI documentation for more information. If you have difficulty finding specific information, please communicate with the ARSC Help Desk.

Back to Top