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.
|Language|| GNU CC||Portland||Intel||Pathscale||Open64 |
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:
|Compiler command||mpicc||mpif77||mpif90||mpiCC |
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:
… and so on. Common variables you can set are: