Compiling applications

Compiling your application is almost always done on an end-user login or gateway node. However on several clusters the headnode is acting as frontend machine. In this article we will describe the steps available based on the availability of a login node.

Typically, there are several compilers available on the login node. A few examples: GNU compiler collection, Intel compilers, Pathscale compilers and Portland Group compilers. The following table summarizes the possible available compiler commands available on a typical cluster installation.

Compilers
Language GNU CCPortlandIntelPathscaleOpen64
Cgccpgcciccpathccopencc
C++c++pgCCiccpathCCopenCC
Fortran77gfortranpgf77ifort-openf90
Fortran90gfortranpgf90ifortpathf90openf90
Fortran95gfortranpgf95ifortpathf95openf95

Although most commercial compilers are available through the distribution update commands (i.e. yum on RedHat based installations), you need a valid and installed license in order to make it usable. Please note that GNU compilers are the de facto standard on Linux and are installed by default and do not require a license.

Please select the compiler(s) and libraries you wish to use by loading the appropriate environment modules. Please note that if you intend to use the default GNU-C (GCC) compilers, you generally do not require to load a module although a different version of the compiler may have been made available through the module environment.

The commands referred to in the table above are specific for batch type (single processor) applications. For parallel applications it is preferable to use MPI based compilers. The necessary compilers are automatically available after choosing the parallel environment (Mpich/MVAPICH/OpenMPI/Intel-MPI/Qlogic-MPI etcetera). The following compiler commands are available:


CodeCFortran77F90C++
Compiler commandmpiccmpif77mpif90mpiCC

Please check the documentation of the compiler and the makefile to view which optimization flags are available. Usually there is a README or INSTALL file available with your software.

ClusterVision supplied software environments often contain multiple (Open)MPI packages for different compilers. Sometimes it is desired to mix compilers, for example to combine GCC with pathf90. In such case it is possible to override the compiler by setting an environment variable, for example:

export OMPI_MPICC=gcc
export OMPI_MPIF90=pathf90

… and so on. Common variables you can set are:

  • OMPI_MPICC
  • OMPI_MPIFC
  • OMPI_MPIF77
  • OMPI_MPIF90
  • OMPI_MPICXX
Copyright 2002-2014 ClusterVision BV