Install AMD AOCC C C++ Fortran compiler

The no-cost AMD AOCC compiler is tuned for AMD CPUs, akin to how Intel oneAPI is tuned for Intel CPUs. For a RHEL-based Linux, install the downloaded “.rpm” file like:

dnf install ./aocc-compiler*.x86_64.rpm

Create a source script “~/aocc.sh” like:

root=/opt/AMD/aocc-compiler-5.0.0/

[[ ! -d ${root} ]] && echo "ERROR: ${root} not found" && exit 1

source ${root}/setenv_AOCC.sh

# setenv_AOCC doesn't set these
export CC=clang CXX=clang++ FC=flang

export CXXFLAGS=
export MPI_ROOT=

flang --version

To use the AOCC compiler:

source ~/aocc.sh

AOCL libraries

The AOCL libraries provide accelerated math functions for AMD CPUs for several popular libraries for use in C, C++, or Fortran. AOCL is compatible with AOCC and other compilers as listed in the AOCL downloads.