On the SCC, there are currently three families of compilers: GNU, 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/2023.1    # load the Intel compiler

The commands for the three compilers are listed in the following table:

Language Developer Command
Fortran 77 GNU gfortran
Fortran 90/95/03 GNU gfortran
C GNU gcc (cc)2
C++ GNU g++ (c++)2
Fortran 77 Nvidia/PGI pgfortran (pgf77)3
Fortran 90/95/03 Nvidia/PGI pgfortran (pgf90, pgf95)3
C Nvidia/PGI pgcc
C++ Nvidia/PGI pgc++
Fortran 77/90/95/03 Intel ifort or ifx 1
C Intel icc or icx 1
C++ Intel icpc or icpx 1
C LLVM clang
C++ 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 and the “classic” ones (icc, icpc, ifort) will be 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% 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% man icc              <-- icc manual page
scc1% icc -help            <-- concise options help file
scc1% icc -o file-name ... <-- executable name
scc1% icc -On ...          <-- code optimization; n=0,1,2,3,4,fast; recommends 3
scc1% icc -fast ...        <-- accelerate the program (recommended)
scc1% icc -g ...           <-- debug mode
scc1% icc -p ...           <-- profiling (-pg is also valid)

PGI compilers

Here are some examples of commonly used flags applicable to pgcc, pgc++, pgfortran compilers:

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