Personal tools
You are here: Home UiT Stallo Documentation Stallo User Guide (old) C and C++ compilers
Document Actions

C and C++ compilers

Up to Table of Contents

Information about the C and C++ compilers.

The recommended C and C++ compilers are the Intel Compilers; icc (C) and icpc (C++).
The gcc compiler is also installed, but we do not recommend it for general usage due to performance issues.

 

Usage of the Intel C/C++ compilers

Plain C/C++ codes
For plain C/C++ codes the general form for usage of the Intel icc/icpc compilers are as follows:

icc  [options] file1 [file2 ...]          (C)

icpc [options] file1 [file2 ...]          (C++)

where options represents zero or more compiler options, fileN is a C/C++ source (.C .c .cc .cpp .cxx .c++ .i .ii), assembly (.s .S), object (.o), static library (.a), or other linkable file. Commonly used options may be placed in the icc.cfg file (C) or the icpc.cfg (C++).

OpenMP based C/C++ codes
The form above also applies for C/C++ codes parallelized with OpenMP (www.openmp.org, Wikipedia); you only have to select the necessary compiler options for OpenMP.

MPI based C/C++ codes
For C/C++ codes parallelized with MPI the general form is quite similar:

mpicc [options] file1 [file2 ...]          - for C when using MPICH
mpiCC [options] file1 [file2 ...]          - For C++ when using MPICH

Both mpicc mpiCC are using the the Intel compilers, they are just wrappers that invokes all the necessary MPI stuff automatically for you. Therefore, everything else is the same for compiling MPI codes as for compiling plain C/C++ codes. Please check the section abut MPI Libraries for more information about using MPI.

 

Compiler Options

Below you will find a complete list of compiler options for the Intel icc and icpc compilers (the compiler options are identical for the two compilers), but we have also made a list with selected compiler options which we recommend for getting started, plus a list with some options we consider as "nice to know".


Intel C/C++ Compiler Documentation

In general we will recommend our users to approach the Intel C/C++ documentation in the following order:

1. Start out with the 'icc/icpc -help' information, where you will find all(?) the compiler options for the compilers in a compact and structured way (this information is identical for icc and icpc). Do not pay too much attention to the subjects that the options are sorted under, because it may well happen that you will find the option you are looking for under a different subject than you first expected.

2. If further / more detailed information is needed (or something is missing in 'icc/icpc -help'), check out the manual page for the icc/icpc compiler, 'man icc/icpc', where all options are described in detail (The manual pages are identical for icc and icpc).

3. If even further information is needed you should consult the rather huge reference manuals for the icc/icpc compilers. NB! Please notice that these manuals also contain information for all other supported OS's. For the most recent updated versions of the manuals, please check the following Intel page (Then go to: Compilers --> Linux --> Intel C/C++ Compiler for Linux --> Support Resources).

by Maria Wulff Hauglann last modified Aug 23, 2010 12:56 PM Notur