On the SCC, there are currently four families of compilers: GNU, LLVM, Nvidia (PGI), and Intel. They are used for compiling C, C++, and Fortran codes. Nvidia purchased The Portland Group company, the original authors of the PGI compilers, in 2013.
The GNU compilers are automatically available after logging onto the SCC. On the AlmaLinux 8 operating system the default GNU compiler version is 8.5.0. To switch to a different compiler, use the module command:
scc1$ module load intel/2024.0 # example - load the Intel compilers
If you are compiling software that uses MPI, the best practice is to load the compiler you want to use followed by the matching OpenMPI module:
scc1$ module load nvidia-hpc/2023-23.5 # example - use the Nvidia compilers with OpenMPI
scc1$ module load openmpi/4.1.5_nvidia-2023-23.5
The compiler commands and module names for the four compilers are listed in the following table. There is a module for older versions of the PGI compilers called pgi
, but it is recommended that the nvidia-hpc
module be used instead for more up-to-date compilers:
Language | Developer | Module Name | Command |
---|---|---|---|
Fortran 77 | GNU | gcc | gfortran |
Fortran 90/95/03 | GNU | gcc | gfortran |
C | GNU | gcc | gcc (cc) |
C++ | GNU | gcc | g++ (c++) |
Fortran 77 | Nvidia/PGI | nvidia-hpc or pgi | pgfortran (pgf77) |
Fortran 90/95/03 | Nvidia/PGI | nvidia-hpc or pgi | pgfortran (pgf90, pgf95) |
C | Nvidia/PGI | nvidia-hpc or pgi | pgcc |
C++ | Nvidia/PGI | nvidia-hpc or pgi | pgc++ |
Fortran 77/90/95/03 | Intel | intel | ifort or ifx 1 |
C | Intel | intel | icc or icx 1 |
C++ | Intel | intel | icpc or icpx 1 |
C | LLVM | llvm | clang |
C++ | LLVM | llvm | clang++ |
1 The Intel compiler modules older than intel/2023.1
provide the icc, icpc, and ifort compilers. The intel/2023.1
module also provides a new family of compilers: icx, icpx, and ifx. Intel compiler modules installed after intel/2023.1
will only provide these new compilers as the “classic” ones (icc, icpc, ifort) have been retired by Intel.
For all of the compilers see Multiprocessor Programming documentation for compiling OpenMP and MPI codes.
GNU and LLVM compilers
Here are some examples of commonly used flags applicable to gcc, g++, and gfortran
compilers. The LLVM clang and clang++ compilers use nearly identical flags to the GNU compilers:
scc1$ module load gcc/12.2.0
scc1$ man gcc # gcc manual (help) page
scc1$ gcc --help # concise options help file
scc1$ gcc -o file-name ... # executable name
scc1$ gcc -On ... # code optimization; n=0,1,2,3
scc1$ gcc -g ... # debug mode
scc1$ gcc -Warray-bounds ... # arrays bound checking
scc1$ gcc -pg ... # profiling
Intel compilers
Here are some examples of commonly used flags applicable to icc, icpc, ifort
compilers:
scc1$ module load intel/2024.0
scc1$ man icx # icxmanual page
scc1$ icx -help # concise options help file
scc1$ icx -o file-name ... # executable name
scc1$ icx -On ... # code optimization; n=0,1,2,3,4,fast; recommends 3
scc1$ icx -fast ... # accelerate the program
scc1$ icx -g ... # debug mode
scc1$ icx -p ... # profiling (-pg is also valid)
Nvidia/PGI compilers
Here are some examples of commonly used flags applicable to pgcc, pgc++, pgfortran
compilers:
scc1$ module load nvidia-hpc/2023-23.5
scc1$ man pgcc # pgfortran manual (help) page
scc1$ pgcc -help # concise options help file
scc1$ pgcc -o file-name ... # executable name
scc1$ pgcc -On ... # code optimization; n=0,1,2,3,4,fast; recommends 3
scc1$ pgcc -g ... # debug mode
scc1$ pgcc -pg ... # profiling