Select HPC compilers with modules

Linux modules are often used by HPC systems allow using more current versions of software than are in the default system repositories. A typical approach is to create an .sh file for a particular job type. For example, to use gfortran, create gcc.sh and before building do source gcc.sh. Likewise for Intel compilers source intel.sh before the build. To avoid unexpected conflicts or hidden state, load only the modules necessary for a particular project.

These examples assume Bash shell. Determine the shell in use by

echo $0

GCC / Gfortran

To load recent GCC versions, upon login do

. gcc.sh

with gcc.sh containing:

module load cmake

module load gcc
export CC=gcc CXX=g++ FC=gfortran

module load openmpi

Intel

. intel.sh

where intel.sh contains something like:

module load cmake
module load intel

export FC=ifort CXX=icpc CC=icc

export MKLROOT=$SCC_MKL_LIB/../..

. $MKLROOT/bin/mklvars.sh intel64 lp64
. $MKLROOT/../bin/compilervars.sh -arch intel64
. $MKLROOT/../../../compilers_and_libraries/linux/mpi/bin64/mpivars.sh

Julia

The current recommended method in general (for laptop or HPC) to use Julia is to download generic Julia Linux binary.