This is an old revision of the document!
A technique is what you call any trick you use more than once.
The three dominant compiled languages used in HPC are C, Fortran and C++.
Many people write the first and last as C/C++. That's misleading. C and C++ are separate languages. Confusing them is responsible for many problems.
The compilers found at the CHPC fall into three families: GCC, Intel and Sun Studio.
'GCC' stands for GNU Compiler Collection; 'gcc' stands for GNU C Compiler; try not to confuse them
There's a fourth family, IBM XL, but we won't worry about it since the P690s are gone and BG/P is DOA.
| Language | GCC | Intel |
|---|---|---|
| C | gcc | icc |
| Fortran | gfortran | ifort |
| C++ | g++ | icpc |
So to actually compile a C program with the GNU C compiler you would type at the shell command line:
you@login01:~$ gcc -o hello hello.c
And for a Fortran 90 program using Intel's compiler:
you@login01:~$ ifort -o hello hello.f90
By convention, there are variables that define the actual command invoked (see above) and which can be used in the shell, with make files and configure.
| Variable | Compiler | Example |
|---|---|---|
CC | C | CC=gcc |
FC | Fortran | FC=ifort |
CXX | C++ | CXX=/opt/gridware/intel/comp12/composerxe-2011.0.084/bin/intel64/icpc |
The last example shows that you can include the full path to a particular compiler — usually the current PATH will be searched.
Fortran comes in two main flavours, Fortran 77 and Fortran 90 (also called 9x since it includes Fortran 95). By default FC refers to the Fortran 9x compiler and when it is necessary to also point to a Fortran 77 compiler:
F77 | Fortran 77 | F77=g77 |
|---|
When building an MPI library — for example, OpenMPI — one should specify all four since MPI provides MPI compilers for:
mpicc | MPI C compiler |
mpicxx | MPI C++ compiler |
mpif77 | MPI Fortran 77 compiler |
mpif90 | MPI Fortran 90 compiler |
When building OpenMPOI then, before the usual make; make install command, tell configure which compilers to use:
./configure --prefix=$HOME/mpi/intel/ \ CC=icc CXX=icpc F77=ifort FC=ifort \ --with-openib \ --with-openib-libdir=/usr/lib64/
The above example uses Intel compilers and also builds in InfiniBand support.