C/C++
Several C/C++ compilers are available on ewok. These include GNU, Portland Group, Pathscale and Intel. The compilers are accessed by loading the appropriate module file. Each compiler has a corresponding mvapich module. The mvapich modules take care of loading the correct compiler. So, if you wanted to unload the PGI compiler and load the Pathscale compiler, the best way would be to unload mvapich-pgi and load mvapich-pathscale. You may then use a module swap if you want to change between different versions of a compiler.
NOTE: Descriptions of compiler options have been taken from their respective man pages
Available Compilers
Portland Group (PGI) C/C++
Commands
pgcc: C compiler, ANSI (89) and K&R CpgCC: C++ compiler, ANSI C++ with cfront features
pgcc does not currently support the ANSI 99 standard for C. For complex numbers, use pgCC.
Debugging Options
The following options control the amount of debugging information generated by the compiler. They can adversely affect optimization.
| Option | Description |
|---|---|
| -g | Generates symbolic debug information. Turns off optimization. |
| -Mbounds | Adds array bound checking. |
Optimization Options
For most cases, the usual levels of optimization are appropriate (-O0, -O1, -O2 [default], -O3). Here are a few exceptions.
| Option | Description |
|---|---|
| -fast | Chooses generally optimal flags for the target platform. Use pgcc -fast -help to see the equivalent switches.Note 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 extensions (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 |
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. |
PGI Documentation
See man pgcc or man pgCC for a full list of compiler options. PDF and HTML documentation is also available online from PGI at http://www.pgroup.com/resources/docs.htm.
Pathscale C/C++
Commands
pathcc: C compilerpathCC: C++ compiler
Debugging Options
The following options control the amount of debugging information generated by the compiler. They can adversely affect optimization.
| Option | Description |
|---|---|
| -g | Generates symbolic debug information. Turns off optimization. |
Optimization Options
For most cases, the usual levels of optimization are appropriate (-O0, -O1, -O2 [default], -O3). Here are a few exceptions.
| Option | Description |
|---|---|
| -Ofast | Use optimizations to maximize performance. These optimizations are typically safe, but floating-point accuracy may be affected. -Ofast is equivalent to -O3 -ipa -OPT:Ofast -fno-math-errno -ffast-math. |
| -pg -profile | Generate extra code to provide information to the pathprof tool. Both options turn on application-level profiling, but only -profile turns on library-level profiling. See the eko man page for more information. |
| -openmp | Enables the compiler to generate multithreaded code based on the OpenMP directives. |
Pathscale Documentation
See man pathcc, man pathCC, or man eko for a full list of compiler options. Additional documentation is also available online from Pathscale at http://pathscale.com/ws/node/70.
Intel C/C++
Commands
icc: C/C++ compiler.icccompiles .c and .i files as C and only links C++ libraries if the compile line contains C++ source files.icpc: C++ compiler.icpccompiles .c and .i files as C++ and always links C++ libraries.
Debugging Options
The following options control the amount of debugging information generated by the compiler. They can adversely affect optimization.
| Option | Description |
|---|---|
| -g | Generates symbolic debug information. Turns off optimization. |
| -debug |
Enables debugging information and controls output of debug information. See man icc for a list of options for the <keyword> |
Optimization Options
For most cases, the usual levels of optimization are appropriate (-O0, -O1, -O2 [default], -O3). Here are a few exceptions.
| Option | Description |
|---|---|
| -fast | Maximize speed across the program. -fast is equivalent to -O3 -ipo -static. |
| -p -qp | Compile and link for profiling with gprof |
| -openmp | Enables the compiler to generate multithreaded code based on the OpenMP directives. |
Intel Documentation
See man icc for a full list of compiler options. Additional documentation is also available online from Intel at http://www.intel.com/support/performancetools/c/linux/.
GNU C/C++
Commands
gcc: C compilerg++: C++ compiler
Debugging Options
The following options control the amount of debugging information generated by the compiler. They can adversely affect optimization.
| Option | Description |
|---|---|
| -g | Generates symbolic debug information. Turns off optimization. |
Optimization Options
For most cases, the usual levels of optimization are appropriate (-O0, -O1, -O2 [default], -O3). Here are a few exceptions.
| Option | Description |
|---|---|
| -p | Compile and link for profiling with prof. If you use separate compile and link steps, this option must be given both when compiling and when linking. |
| -pg | Compile and link for profiling with gprof. If you use separate compile and link steps, this option must be given both when compiling and when linking. |
GNU Documentation
See man gcc for a full list of compiler options. Additional documentation is also available online from Intel (online and as a downloadable .pdf, .ps, or .tar file) at http://gcc.gnu.org/onlinedocs/.
