=====Portland Group C/C++=====
The C/C++ compiler on Tiger is Portland Group C/C++. Tiger will most likely have several versions of the PGI compilers installed at any given time. A "''module avail''" will show what is available. A "''module default''" will show what is loaded (if anything.)
The PGI 6.0 and 5.2-4 C compilers have two commands:
* ''pgcc'': C compiler, ANSI (89) and K&R C
* ''pgCC'': C++ compiler, ANSI C++ with "''cfront''" features
Portland Group provides a graphical debugger, ''pgdbg''. Note that
''pgcc'' does not currently support the ANSI 99 standard for C. For
complex numbers, use ''pgCC''.
===== Important Notes =====
Upon login, your environment does not have any compilers loaded. You will need to do a "''module load <compiler>''". After that, you can use the compiler and read its man page.
When you load a compiler module, a related mpich module will be loaded as well. This module contains header files and libraries for MPI. In addition, it contains the mpicc and mpicxx commands. To compile an MPI program, you will need to use mpicc or mpicxx instead of the pgcc or pgCC. Using mpicc/mpicxx will call the appropriate compiler, and it will set up the appropriate header and library paths for MPI. It will also automatically link in any necessary libraries for MPI. Thus, there is no need to add "''-lmpi''" to your command line.
=====Options=====
The following options control the amount of debugging information generated by the compiler. They can adversely affect optimization.
''-g''
''-Mbounds''
----
The following option controls the memory model used by the resulting executable. It can be critical for applications that use more than 2 GB of memory per process.
'-mcmodel=medium''
----
For most cases, the usual levels of optimization are appropriate (-O0, -O1, -O2 (default), -O3). Here are a few exceptions.
''-fast''
''-fastsse''
'-tp k8-64''
''-Mflushz''
''-pg''
''-ql''
''-Mprof''
''-Minfo''**
''-mp''**
=====Documentation=====
See ''man pgcc'' or ''man pgCC'' for a full list of compiler options. PDF and HTML documentation is also available online from Portland Group at the following URL.
http://www.pgroup.com/doc/pgiug.pdf
http://www.pgroup.com/resources/tips.htm