Compilers and Build Tools

CARC has compilers and related build tools for installing software available.

Compilers

The following table describes the C/C++/Fortran/MPI/CUDA compilers available on CARC HPC clusters and how to load them:

Compiler familyCompilersModules
GCCgcc, g++, gfortranmodule load gcc
LLVMclang, clang++, flangmodule load llvm
AOCCclang, clang++, flangmodule load aocc
Inteldpcpp, icx, icpx, ifx, icc, icpc, ifort, mpiicc, mpiicpc, mpiifortmodule load intel-oneapi
OpenMPImpicc, mpicxx, mpifortmodule load gcc/11.3.0 openmpi/4.1.4
MPICHmpicc, mpicxx, mpifortmodule load gcc/11.3.0 mpich/4.0.2
MVAPICH2mpicc, mpicxx, mpifortmodule load gcc/11.3.0 mvapich2/2.3.7
NVIDIAnvc, nvc++, nvfortran, nvccmodule load nvhpc
NVIDIA/CUDAnvccmodule load gcc/11.3.0 cuda/11.6.2

The latest version of a compiler family installed is loaded by default, but typically more than one version of a compiler family is available. Use the module spider command to see all available versions (e.g., module spider gcc).

All of these compilers provide optimization options that can be used to optimize programs, such as targeting specific CPU microarchitectures or GPU architectures. Consult the compiler documentation listed under Additional Resources at the bottom for more information.

Build tools

CARC offers a few popular tools that help build and test software: Make, Autotools, CMake, and Meson.

Make

To use GNU Make, load modules like the following:

module load gcc/11.3.0 gmake

Autotools

To use GNU Autotools, load modules like the following:

module load gcc/11.3.0 automake autoconf libtool m4 gmake

CMake

To use CMake, load modules like the following:

module load gcc/11.3.0 cmake gmake

If using Ninja instead of Make, replace gmake with ninja:

module load gcc/11.3.0 cmake ninja

For more deatiled information, see the CMake user guide.

Meson

To use Meson, typically with Ninja, load modules like the following:

module load gcc/11.3.0 meson ninja

Other tools

There are other tools available that are useful for building software and that you may wish to load, including git, pkgconf, and binutils.

Package managers

If you want to build and manage an entire software stack from source code, there are two popular package managers: EasyBuild and Spack. Both are open-source, community supported package managers. To use them, install them in one of your directories and configure tham as needed.

EasyBuild is designed to make scientific software installation easier and can be used without much prior knowledge of compilers and program optimization.

Spack offers more flexibility and optimization options, but may have a steeper learning curve compared to EasyBuild. CARC uses Spack to build most of the software that is provided via software modules on our HPC clusters. CARC provides some template YAML files for creating Spack environments here.

Note: package build recipes may not exist for your software of interest, so you may need to create and contribute them yourself. Please see the official EasyBuild or Spack tutorials linked below for instructions on how to do this.

Additional resources

If you have questions about or need help with compilers or build tools, please submit a help ticket and we will assist you.

EasyBuild tutorials Spack tutorials OpenMP user guide MPI user guide GPU user guide Rust user guide

Back to top