C/C++

Portland Group C/C++

The C/C++ compiler on Hawk is PGI C/C++. Because Hawk will most likely have several versions of the PGI compilers installed at any given time, the PGI compilers are managed through modules. A module avail will show what is available. A module list will show what is loaded.

The PGI C/C++ commands are described below.

Command Module Description
pgcc pgi C compiler
pgCC pgi C++ compiler
mpicc mpich/pgi Similar to pgcc with automatic links to the MPI libraries
mpiCC mpich/pgi Similar to pgCC with automatic links to the MPI libraries

Also note that PGI also provides a graphical debugger pgdbg and the profiler pgprof.

Upon login, your environment does not have the PGI compilers loaded. You will need to do a module load <compiler>. After that, you can use the compiler and read its man page.

Options

The options below control the amount of debugging information generated by the compiler. They can adversely affect optimization.

Option Description
-g Generates symbolic debugging information. Turns off optimization.
-Mbounds Adds array bound checking.
For most cases, the usual levels of optimization are appropriate (-O0,
-O1, -O2 [default], -O3). Here are a few exceptions.
-fast Chooses generally optimal flags for the target platform. Use pgcc -fast -help to see the equivalent switches. Note that this sets the optimization level to a minimum of 2; see -O.
-fastsse Chooses generally optimal flags for a processor that supports the streaming SIMD extension (SSE) (Pentium 3/4, AthlonXP/MP, Opteron) and SSE2 (Pentium 4, Opteron) instructions. Use pgcc -fastsse -help to see the equivalent switches.
-tp k8-64 Targets optimization to the 64-bit Opteron processor.
-Mflushz Sets SSE to flush-to-zero mode.
-pg
-ql
-Mprof
Is the instrument program for profiling. These flags imply different types of profiling. Please check the pgcc or pgCC man page for more information.
-Minfo Generates an optimization report to standard error. This has several suboptions, so check the man page.
-mp Enables the compiler to generate multithreaded code based on the OpenMP directives.

Documentation

See each compiler’s man page for a full list of compiler options. PDF and HTML documentation is also available online from PGI at the following URL: http://www.pgroup.com/resources/docs.htm