AMD Optimized Compiler Collection (AOCC)
Supported versions
To check which AMD AOCC versions are currently supported on Discoverer, execute on the login node:
module avail amd/aocc/
Loading
To obtain access to the latest AMD AOCC load the environment module aocc/latest:
module load amd/aocc/latest
otherwise replace latest with the version you need.
LLVM compilers
Warning
AOCC provides LLVM compilers only!
clang
clang++
flang
Compiler optimization flags for AMD Zen2 CPU
Note
The compute nodes of Discoverer HPC are equipped with AMD EPYC 7H12 64-Core processors, which implies AMD Zen2 CPU architecture.
The following compiler flags can be useful during the compile-time optimization of your binary code on AMD Zen2:
-march=znver2 -mtune=native
For example:
clang -march=znver2 -mtune=native ...
clang++ -march=znver2 -mtune=native ...
flang -march=znver2 -mtune=native ...
More on the supported compiler flags: AMD EPYC™ 7xx2-series Processors Compiler Options Quick Reference Guide
Interaction with CMake
It is recommended to specify the compiler executables when invoking cmake tool:
-DCMAKE_C_COMPILER=clang
-DCMAKE_CXX_COMPILER=clang++
-DCMAKE_Fortran_COMPILER=flang
The corresponding optimization compiler flags can be passed to cmake as well:
-DCMAKE_C_FLAGS="-march=znver2 -mtune=native"
-DCMAKE_CXX_FLAGS="-march=znver2 -mtune=native"
-DCMAKE_Fortran_FLAGS="-march=znver2 -mtune=native"
Getting help
See Getting help