Document Actions
2. Compiler and programming languages
Up to Table of Contents
Fortran compiler
The recommended Fortran compiler is the Intel Fortran Compiler: ifort.
The gfortran compiler is also installed, but we do not recommend it for general usage.
Usage of the Intel ifort compiler
Plain Fortran codes
For plain Fortran codes (all Fortran standards) the general form for usage of the Intel ifort compiler is as follows:
ifort [options] file1 [file2 ...] - Same for ALL Fortran standards
where options represents zero or more compiler options, and fileN
is a Fortran source (.f .for .ftn .f90 .fpp .F .FOR .F90 .i .i90),
assembly (.s .S), object (.o), static library (.a), or an other
linkable file. Commonly used options may be placed in the ifort.cfg
file.
OpenMP based Fortran codes
The form above also applies
for Fortran codes parallelized with OpenMP (www.openmp.org, Wikipedia); you only have to select the
necessary compiler options for OpenMP.
MPI based Fortran codes
For Fortran codes parallelized with MPI the general form is quite similar:
mpif90 [options] file1 [file2 ...]
mpif90 is using the the Intel Ifort compiler, it is just a wrapper that invokes all the necessary MPI stuff automatically for you. Therefore, everything else is the same for compiling MPI codes as for compiling plain Fortran codes. Please check the section about MPI Libraries for more information about using MPI on Stallo.
Intel Fortran Compiler Documentation
In general we will recommend our users to approach the Intel ifort documentation in the following order:
- Intel® Fortran Compiler – Get Help (web page at Intel)
- Intel® Fortran Compiler – Documentation (web page at Intel)
- Intel® Fortran Compiler 10.1 for Linux* – Product Tips and Samples (web page at Intel)
-
see also the section Compiler Options below
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 OpenMPI mpiCC [options] file1 [file2 ...] - For C++ when using OpenMPI
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 compilers (the compiler options are essentially identical for the ifort, icc or icpc 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".
- List of compiler options ('ifort, icc or icpc -help')
- Options for getting started
- Options "nice to know"
- Quick-Reference Guide to Optimization with Intel(R) Compilers.
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).

