Advanced: Toolchains

Short version

Do not mix up toolchain versions (2021b vs 2022a) or toolchain names (foss vs intel). It will load incompatible versions of compilers/libraries, and will most likely break applications.

This is very easy to do if you rely on default modules since these change depending on what the newest installed version is. Software is sometimes not updated synchronously, so you may run into an issue where loading defaults for module load Python and module load TensorFlow will result in a broken environment. Please specify version numbers when loading software.

Longer version

A toolchain consists of a set of compilers, libraries, linkers and more. The collection of software that is in the toolchain makes sure that all other software is built (or compiled) with consistent versions. This makes it possible to combine modules, as long as you stick to the same toolchain.

In order to find out what a toolchain consists of, you can simply load it and do a module list. For instance, for foss (free and open source software) 2022a you will get the following:

$ module load foss/2022a
$ module list
Currently Loaded Modules:
  1) 2023.01                       (S)  10) libpciaccess/0.16-GCCcore-11.3.0  19) OpenBLAS/0.3.20-GCC-11.3.0
  2) StdEnv                        (S)  11) hwloc/2.7.1-GCCcore-11.3.0        20) FlexiBLAS/3.2.0-GCC-11.3.0
  3) GCCcore/11.3.0                     12) OpenSSL/1.1                       21) FFTW/3.3.10-GCC-11.3.0
  4) zlib/1.2.12-GCCcore-11.3.0         13) libevent/2.1.12-GCCcore-11.3.0    22) gompi/2022a
  5) binutils/2.38-GCCcore-11.3.0       14) UCX/1.12.1-GCCcore-11.3.0         23) FFTW.MPI/3.3.10-gompi-2022a
  6) GCC/11.3.0                         15) libfabric/1.15.1-GCCcore-11.3.0   24) ScaLAPACK/2.2.0-gompi-2022a-fb
  7) numactl/2.0.14-GCCcore-11.3.0      16) PMIx/4.1.2-GCCcore-11.3.0         25) foss/2022a
  8) XZ/5.2.5-GCCcore-11.3.0            17) UCC/1.0.0-GCCcore-11.3.0
  9) libxml2/2.9.13-GCCcore-11.3.0      18) OpenMPI/4.1.4-GCC-11.3.0

From here you can see that the main component of this toolchain is the GCC(core) 11.3.0 compiler, which is also used for other components of the toolchain (e.g. OpenMPI, OpenBLAS, etc). This also means that you can safely load modules built with foss 2022a and GCC(core) 11.3.0 at the same time, as the latter is basically a subtoolchain/component of the former.

However, if you would now load something that was built with another toolchain or GCC, the module system will try to switch from one version to another (since loading two versions of the compiler simultaneously is not possible). In such cases, the module command will output something like:

The following have been reloaded with a version change:
  1) FFTW.MPI/3.3.10-gompi-2022a => FFTW.MPI/3.3.10-gompi-2022b          12) XZ/5.2.5-GCCcore-11.3.0 => XZ/5.2.7-GCCcore-12.2.0
  2) FFTW/3.3.10-GCC-11.3.0 => FFTW/3.3.10-GCC-12.2.0                    13) binutils/2.38-GCCcore-11.3.0 => binutils/2.39-GCCcore-12.2.0
  3) FlexiBLAS/3.2.0-GCC-11.3.0 => FlexiBLAS/3.2.1-GCC-12.2.0            14) foss/2022a => foss/2022b
...

This will probably break all the loaded modules that depend on the GCC version that you initially loaded. So, when you see this, make sure to do a module purge to unload everything, and try again by loading compatible versions of these modules.