0% found this document useful (0 votes)
1K views4 pages

AOCC Install Guide: Installing AOCC On Linux

The document provides instructions for installing the AMD Optimizing C/C++ Compiler (AOCC) on Linux. It can be installed using tar, rpm, or deb packages by downloading the package, running installation commands as root if needed, and sourcing environment scripts. Basic usage involves setting the environment and then using the Clang or Flang compilers along with optional optimized libraries. Prerequisites and known limitations are also outlined.

Uploaded by

Felipe Garrido
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
1K views4 pages

AOCC Install Guide: Installing AOCC On Linux

The document provides instructions for installing the AMD Optimizing C/C++ Compiler (AOCC) on Linux. It can be installed using tar, rpm, or deb packages by downloading the package, running installation commands as root if needed, and sourcing environment scripts. Basic usage involves setting the environment and then using the Clang or Flang compilers along with optional optimized libraries. Prerequisites and known limitations are also outlined.

Uploaded by

Felipe Garrido
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

AOCC Install Guide

Contents

• AOCC Install Guide


o Installing AOCC on Linux
o Supported Operating systems
o Known issues and limitations

“AMD Optimizing C/C++ Compiler” - abbreviated as AOCC is a highly optimized C, C++


and Fortran compiler for x86 targets especially for Zen based AMD processors. This
AOCC 2.0 release is based on LLVM 8.0 release (llvm.org, 20th Mar 2019) and supports
Flang as the default Fortran compiler. This manual does not cover the internals of LLVM
or AOCC compiler

Installing AOCC on Linux


C, C++ and Fortran Compiler
• AOCC package is available in tar, rpm and deb types
• Download the appropriate package to a directory of your choice say <compdir> and
follow the below installation steps

• TAR - Installation does not require root or sudo permission


• cd <compdir>
• tar -xvf aocc-compiler-2.0.0.tar*
• cd aocc-compiler-2.0.0
• bash install.sh
o This will install the compiler and display AOCC setup instruction
• source <compdir>/setenv_AOCC.sh
o This will set up shell environment for using AOCC C, C++ and Fortran
compiler in the shell environment where above command was executed
• RPM: Installation needs root or sudo permission
• cd <compdir>
• sudo rmp -ivh aocc-compiler-2.0.0-1.x86_64.rpm
o This will install the compiler under /opt/AMD/aocc-compiler-2.0.0
• source /opt/AMD/aocc-compiler-2.0.0/setenv_AOCC.sh
o This will set up shell environment for using AOCC C, C++ and Fortran
compiler in the shell environment where above command was executed

• DEB: Installation needs root or sudo permission


• cd <compdir>
• dpkg -i aocc-compiler-2.0.0_1_amd64.deb
o This will install the compiler under /opt/AMD/aocc-compiler-2.0.0
• source /opt/AMD/aocc-compiler-2.0.0/setenv_AOCC.sh
o This will set up shell environment for using AOCC C, C++ and Fortran
compiler in the shell environment where above command was executed
• clang -v
o This will show AOCC version

• You can run bash <compdir>/AOCC-2.0-Compiler/AOCC-2.0-prerequisites-


check.sh to check if you have all the prerequisites and that your shell environment is
set up correctly

• If there are failing checks then correct them (repeat any of the above steps that
you may have missed) and run prerequisites_check.sh again
• Repeat until prerequisites_check.sh displays ‘Check:PASSED’
• Note: If you have only warnings in failing checks then you can proceed if
packages mentioned in the warnings are not required for your run

• The compiler is installed, and your environment set to point to the current release of
AOCC. At any point in time you can source <compdir>/setenv_AOCC.sh to set the
environment variables for the installed compiler
Using AOCC

• source <compdir>/setenv_AOCC.sh
• To build and run a C/C++ program
o $ clang [command line options] xyz.c -o xyz
o $ ./xyz
o Optimization flags: Please read the options listed in Clang - the C, C++ Compiler guide
• To build and run Fortran programs using flang:
o $ flang [command line options] hello.f90 -o hello
o $ ./hello
o Optimization flags: Please read the options listed in Flang - the Fortran Compiler guide

Some applications may benefit from optimized libraries. AOCC is known to work seamlessly with
these libraries. It is recommended that you evaluate these libraries while building your application
with AOCC as they may help boost the performance of your application over and above the compiler
optimizations that come with AOCC.

In most cases these libraries only need to be linked Example

• export LD_LIBRARY_PATH=<compdir>/aocc-compiler-2.0.0/lib:$LD_LIBRARY_PATH
• clang [command line flags] xyz.c -L<compdir>/aocc-compiler-2.0.0/lib -lamdlibm -o xyz
• ./xyz

AOCC compiler prerequisites

AOCC requires few prerequisite software installs for working as expected. To quickly check if you
already have the required prerequisites you can run this script as follows
• bash <compdir>/AOCC-2.0-Compiler/AOCC-2.0-prerequisites-check.sh
Upgrading AMD LibM (Required only when upgrading AMD LibM from here )

• Extract the newer AMD LibM version package


• Overwrite AOCC-<ver>-Compiler/lib/libamdlibm.so and AOCC-<ver>-
Compiler/lib/libamdlibm.a with the newer versions of libamdlibm.so and libamdlibm.a
• Similarly, overwrite AOCC-<ver>-Compiler/include/amdlibm.h with the newer versions of
amdlibm.h

Supported Operating systems


This release has been tested on the following OS

• RHEL 7.4
• SLES 12 SP3
• Ubuntu 18.04 LTS

Known issues and limitations


• AOCC compiler binaries are suitable to run on Linux systems having glibC version
2.17 and above only.
• Currently, Flang supports only 64 bit targets

You might also like