AMD Optimizing Compilers (AOCC)

The AMD Optimizing Compilers (AOCC) are a customized build of LLVM meant for optimizing code for AMD Zen series processors. The compiler program names are the same as for LLVM since they are just a customized build. The compilers are intentionally quite compatible with the GCC compilers; supporting many of the same extensions beyond the official language standards, having similar compiler options, and often being able mix C++ code compiled by both.

Warning

While the compilers can compile code that might run on the very latest Intel CPUs, the code will likely perform poorly. We strongly recommend that you use a different set of compilers for nodes with Intel CPUs such as GCC or LLVM (Clang).

In all software stacks, the module name is aocc. To load a specific version, run

module load aocc/VERSION

To load the default version, run

module load aocc

Languages

The supported languages and the names of their compiler programs are in the table below.

LanguageCompiler Program
Cclang
C++clang++
Fortranflang

OpenMP

Clang supports the OpenMP (Open Multi-Processing) extension for C, C++, and Fortran. Enable it by adding the -fopenmp option to the compiler. Additionally, the -fopenmp-simd option enables using the OpenMP simd directive.

Targeting CPU Architecture

By default, the Clang compilers will compile code targeting the Zen 1 (znver1). As all AMD processors in the cluster are at least Zen 2, this results in sub-optimal code. The compilers use the following options to control the target architecture:

Compiler OptionDefault ValueMeaning
-march=ARCHznver1Generate instructions targeting ARCH
-mtune=ARCHznver1Tune performance for ARCH but don’t generate instructions not supported by -march=ARCH
-mcpu=ARCHAlias for -march=ARCH -mtune=ARCH

The ARCH values for the different CPU architectures (Spack naming) we provide are

Architecture/Target (Spack naming)ARCH value for the compilers
zen2znver2
zen3znver3
haswellIMPOSSIBLE
broadwellIMPOSSIBLE
skylake_avx512IMPOSSIBLE
cascadelakeIMPOSSIBLE
sapphirerapidsDON’T, but if you must, use znver1 and see warning below
Warning

Even the oldest AMD Zen processors (znver1) have instructions not supported by the sapphirerapids, but code compiled for znver1 might work on these recent Intel processors. But the code, if if runs, will perform poorly. We strongly recommend that you use a different set of compilers for nodes with AMD CPUs such as GCC or LLVM (Clang).