Use CentOS modules for new compilers on HPC

1 minute read

CentOS modules allow using current versions of software on old CentOS installs, such as CentOS 6 that is still common on some HPCs. My approach is to create .sh files that I source for a particular job type. For example, if I want to use gfortran, i have a gcc.sh that I source before building. Likewise for Intel compilers, I have an intel.sh I source beforehand.

Examples

I generally have a file loadall.sh that upon source, loads the software I use for interactive-like sessions. In many use cases, you wouldn’t want to load everything, so I break it out by program in the sections below. Note that the scripts assume the Bash shell. Typically you can determine which shell you’re using by

echo $0

Interactive HPC session

To work interactively on HPC, upon login I do

. loadall.sh

where loadall.sh contains something like:

#!/bin/bash

module load matlab
module load idl
module load python/3.6_intel-2018.2.037

module load cmake
module load gcc

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

module load openmpi

GCC / Gfortran session

To load recent GCC versions, upon login do

. gcc.sh

where gcc.sh contains something like:

#!/bin/bash

module load cmake

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

module load openmpi

Intel

To load recent GCC versions, upon login do

. intel.sh

where intel.sh contains something like:

#!/bin/bash

module load cmake
module load intel/2018
module load openmpi/3.0.0_intel-2018

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.

Notes

The BU SCC keeps up to date with latest versions of programming langauges. Access to BU SCC is for BU faculty and research staff, with graduate students also generally permitted to access.

Leave a Comment