Compilation on HPC Infrastructure¶
SAS HPC clusters provide a range of compilers and development tools for building scientific and engineering software. These tools are made available through the module system, allowing users to select specific compiler versions and software environments without modifying system configuration.
Using consistent toolchains ensures that applications are built with compatible compiler, MPI, and numerical library versions.
Viewing Available Compilers¶
You can list available compiler modules using:
module avail compiler
If you are looking for a specific compiler family or version, you may also use:
module spider gcc
module spider intel
Available Compilers
The following programming languages are supported through the available compiler toolchains:
* C/C++
* Fortran 77/90/95
* Java
* NVIDIA CUDA
The C/C++ and Fortran compilers are typically provided by the following implementations.
Open source
* GNU GCC
* Clang/LLVM
Commercial licenses
* Intel
Using the Module System for Compilation¶
Compiler environments are configured using the module system. Loading a toolchain automatically sets environment variables such as:
- compiler paths
- library search paths
- include directories
- MPI wrappers
This ensures consistent build environments across nodes. Toolchains can be loaded directly using the module command:
module load compiler
Tip
Always load the desired toolchain before compiling your application to ensure that all required dependencies are set correctly.
Common Toolchains¶
Two primary compiler toolchains are typically available on SAS HPC clusters:
- **Intel Toolchain** – includes Intel compilers and optimized
vendor libraries
- **FOSS Toolchain** – composed of open-source compilers and
scientific libraries
Tip
If your application benefits from vendor-specific optimizations, consider using the Intel toolchain. For fully open-source environments, the FOSS toolchain provides a robust alternative.
Intel Toolchain¶
The Intel toolchain provides optimized compilers and numerical libraries designed for performance-critical HPC workloads.
Typical components include:
- Intel C/C++/Fortran compilers (
icc,icpc,ifort) - Intel MPI library
- Intel Math Kernel Library (MKL) providing BLAS, LAPACK, and FFT
These compilers often provide better performance for applications heavily dependent on vectorization and numerical kernels.
Component Versions in Intel Toolchains¶
| Version | GCC | Binutils | Intel Compilers | Intel MPI | Intel MKL |
|---|---|---|---|---|---|
| 2021a | 10.3.0 | 2.36.1 | 2021.2.0 | 2021.2.0 | 2021.2.0 |
| 2021b | 11.2.0 | 2.37 | 2021.4.0 | 2021.4.0 | 2021.4.0 |
| 2022a | 11.3.0 | 2.38 | 2022.1.0 | 2021.6.0 | 2022.1.0 |
| 2022b | 12.2.0 | 2.39 | 2022.2.1 | 2021.7.1 | 2022.2.1 |
| 2023a | 12.3.0 | 2.40 | 2023.1.0 | 2021.9.0 | 2023.1.0 |
| 2023b | 13.2.0 | 2.40 | 2023.2.1 | 2021.10.0 | 2023.2.0 |
| 2025a | 14.2.0 | 2.42 | 2025.1.1 | 2021.15.0 | 2025.1.0 |
| 2025b | 14.3.0 | 2.44 | 2025.2.0 | 2021.16.1 | 2025.2.0 |
Content will be added.
FOSS Toolchain¶
The FOSS (Free and Open-Source Software) toolchain provides a fully open-source software stack commonly used for HPC applications.
Typical components include:
- GNU GCC compilers
- Open MPI library
- FlexiBLAS (OpenBLAS + LAPACK)
- FFTW and ScaLAPACK libraries
This toolchain is widely used in academic HPC environments and provides excellent portability.
Component Versions in FOSS Toolchains¶
| Version | GCC | OpenMPI | FlexiBLAS | FFTW | ScaLAPACK |
|---|---|---|---|---|---|
| 2021a | 10.3.0 | 4.1.1 | 3.0.4 | 3.3.9 | 2.1.0 |
| 2021b | 11.2.0 | 4.1.1 | 3.0.4 | 3.3.10 | 2.1.0 |
| 2022.05 | 11.3.0 | 4.1.4 | 3.2.0 | 3.3.10 | 2.2.0 |
| 2022a | 11.3.0 | 4.1.4 | 3.2.0 | 3.3.10 | 2.2.0 |
| 2022b | 12.2.0 | 4.1.4 | 3.2.1 | 3.3.10 | 2.2.0 |
| 2023a | 12.3.0 | 4.1.5 | 3.3.1 | 3.3.10 | 2.2.0 |
| 2023b | 13.2.0 | 4.1.6 | 3.3.1 | 3.3.10 | 2.2.0 |
| 2024a | 13.3.0 | 5.0.3 | 3.4.4 | 3.3.10 | 2.2.0 |
Content will be added.
Compiling Applications¶
Once the appropriate compiler toolchain is loaded, applications can be compiled using standard build systems.
To load the Intel 2022a toolchain:
module load intel/2022a
To load the FOSS 2022b toolchain:
module load foss/2022b
Content will be added.
Selecting the appropriate compiler toolchain allows users to optimize their applications and fully utilize the HPC resources available on SAS clusters.
Example: Simple C program¶
gcc program.c -o program
Example: Fortran program¶
gfortran program.f90 -o program
Example: MPI program¶
MPI applications should be compiled using MPI wrapper compilers provided by the loaded MPI implementation.
mpicc program.c -o program
mpif90 program.f90 -o program
These wrapper compilers automatically link the required MPI libraries.
Example: GPU Compilation¶
Applications targeting NVIDIA GPUs can be compiled using the CUDA toolchain.
nvcc program.cu -o program