Compiling Code
List of compilers
Three sets of compilers are available on Hazel: GNU, Intel, and Nvidia (formerly Portland Group). Each set includes Fortran, C, and C++ compilers.
GNU compilers
The GNU compilers are provided as part of the Linux distribution used on the Hazel cluster.
To use the GNU implementation of Open MPI, load the module>
module load openmpi-gcc.
To compile with GNU:
Serial compilation
- C -
gcc - C++ -
g++ - Fortran -
gfortran
Parallel compilation using MPI
- C -
mpicc - C++ -
mpicxx, alsompiCCandmpic++ - Fortran -
mpifort, alsompif77andmpif90
Parallel compilation using OpenMP
- When compiling, use the flag
-fopenmp.
Intel compilers
To use the Intel compilers, load the module module load PrgEnv-intel.
To compile with Intel:
Serial compilation
- C -
icc - C++ -
icpc - Fortran -
ifort
Parallel compilation using MPI
- C -
mpiicc, alsompicc - C++ -
mpiicpc, alsompicxx - Fortran -
mpiifort, alsompif77andmpif90
Parallel compilation using OpenMP
- When compiling, use the flag
-qopenmp.
Nvidia (Portland Group compilers)
To use the PGI compilers,
load the module module load PrgEnv-pgi.
To compile with PGI:
Serial compilation
- C -
pgcc - C++ -
pgc++ - Fortran -
pgfortranalsopgf77andpgf90
Parallel compilation using OpenMP
- When compiling, use the flag
-mp.
Parallel compilation using OpenACC
- When compiling, use the flag
-accorta=[target].
Compiler tips and recommendations
Warnings
module load intel was used to compile the code, use module load intel to set the environment in a submit script before launching the executable.bsub -Is, see LSF for Interactive jobs). Choosing a compiler
module avail and then load the full pathname of the module, e.g., module load PrgEnv-intel/2016.0.109.