Introduction

Use the following steps to download and install Arm Compiler and Libraries package, which includes:

  • Arm C/C++ Compiler
  • Arm Fortran Compiler
  • Arm Performance Libraries.

Note: Arm Compiler runs on 64-bit Arm hardware, it is not a cross-compiler. For more information, see the Supported Platforms.




Install package

Before you begin

If any of the following tools are not already installed by your Linux distribution, you must install them before installing Arm Compiler for Linux:

  • Python (version 2.7 or later)
  • C Libraries:

    SUSE and RHEL: glibc-devel
    Ubuntu:                 libc6-dev

Procedure

  1. Extract the downloaded package:

    tar -xvf <package_name>.tar.gz

    Replace <package_name> with the full name of the downloaded package.

  2. Change to the extracted package directory:

    cd <package_name>
  3. Install the package:

    • To install the package using the default options (requires superuser permissions), run:
      sudo ./<package_name>.sh
      The packages are installed to /opt/arm/<package_name>.

    • To install the package using a set of options, run:

      sudo ./<package_name>.sh <options>
      Note: sudo permissions are not required if you install the package to a location where you have write permissions using --install-to (see table below).

      Where <options> can be one or more of:

      Option
      Description
      -a, --accept Automatically accept the EULA
      (the EULA still displays).
      -l, --list-packages List the installer packages
      -i, --install-to <location> Install to the given directory.
      Use this option if you do not have sudo rights to install to /opt/arm or another central location.
      -s, --save-packages-to <location> Save packages to given directory.
      -f, --force Force an install attempt to a non empty directory.
      --list-available-microarchitectures List the supported microarchitectures.
      --only-install-microarchitectures=<arg>,<arg> Install the packages for a subset of the supported microarchitectures.
      Supported microarchitectures include:
      • generic: For a generic Armv8-A implementation.
      • generic-sve: For a generic, SVE-enabled Armv8-A implementation.
      • Target-specific: To see the CPU targets supported, see the supported arguments for the -mcpu= compiler option in the Arm Fortran Compiler or Arm C/C++ Compiler reference guide.

      Note: The generic implementation is always installed. native is supported for the -mcpu option, but is not a supported argument for --only-install-microarchitectures. To specify multiple microarchitectures, pass each microarchitecture as a comma-separated argument.
      -h, --help Display this table in the form of a help message in the terminal.

      Note: For the --list-available-microarchitectures and --only-install-microarchitectures=<arg> options, there is a delay between running the script and receiving a response.

      The packages are installed to <install_dir>/<package_name>, where <install_dir> defaults to /opt/arm if not explicitly provided using the --install-to option.

  4. The installer displays the EULA and prompts you to agree to the terms. To agree, type 'yes' at the prompt.

Note: Arm recommends that you rebuild your MPI implementation (Open MPI, MVAPICH, MPICH) after each installation of a new version of Arm Compiler for Linux. This ensures that the Fortran interface incorporates any changes to the armflang module format, and that the correct run-time libraries are used.

Install --autocomplete

From version 20.0, the Arm Compiler for Linux package includes a script that enables auto-completion of arguments in bash.

The auto-completion tool allows you to request a list of the available arguments for a compiler option supported by Arm Compiler for Linux. For example, running:

armclang --autocomplete=-mcpu=

Returns the arguments available to the -mcpu option:

generic
native
neoverse-n1
thunderx2t99

To enable the autocompletion tool, add the <install-dir>/share/utils/bash-autocomplete.sh script to your .bashrc file:

  1. Open your .bashrc file.
  2. Add the line:
    source <install-dir>/share/utils/bash-autocomplete.sh.
  3. Restart your command terminal.

Configure Arm Compiler for Linux

Note: This is an optional step. Arm Compiler for Linux does not require you to configure the tools. However, if you want to specify a set of default options to all invocations of the compiler, this step describes how to configure the tools.

You can configure Arm Compiler for Linux using a configuration file.

A configuration file allows a set of compiler options to be added to all invocations of the compiler. The configuration file can be copied or modified to suit your needs.

A template configuration file example.cfg can be found in <install-directory>/share/config. The template also includes more detailed information about the syntax, order of precedence, language-specific options, linker-specific options, and some example options.

How to use the configuration file

The configuration file can be manually invoked using the --config option. For example:

[armclang|armclang++|armflang] --config /path/to/this/<filename>.cfg <option>

For a more permanent solution, Arm Compiler for Linux supports three environment variables, which can be set to the path of a configuration file. The configuration files provided are used automatically, for each of armclang, armclang++, or armflang. All three variables can be set to the same configuration file. Alternatively, to set language-specific options, create language-specific files:

  • For armclang: ARM_COMPILER_CC_CONFIG
  • For armclang++: ARM_COMPILER_CXX_CONFIG
  • For armflang: ARM_COMPILER_FC_CONFIG

To set these environment variables, open your Arm Compiler for Linux environment modulefile for editing, and add:

  • For armclang:
    setenv    ARM_COMPILER_CC_CONFIG     /path/to/c_options.cfg
  • For armclang++:
    setenv    ARM_COMPILER_CXX_CONFIG    /path/to/c_options.cfg
  • For armflang:
    setenv    ARM_COMPILER_FC_CONFIG     /path/to/fortran_options.cfg

replacing /path/to/ with the path for your system.

For more information, see the header text in the example.cfg template file.


Get started with Arm C/C++ Compiler

See Get started with Arm C/C++ Compiler which shows how to compile and generate executables that can run on any 64-bit Armv8-A architecture.


Get started with Arm Fortran Compiler

See Get started with Arm Fortran Compiler which shows how to install and compile Fortran code using different optimizations levels, and generate an executable.


Get started with Arm Performance Libraries

See Getting started with Arm Performance Libraries which guides you through dynamically modifying your user environment on Linux using environment modules, and then performing an example program compilation and run.


Uninstalling

For convenience, this package includes a script that can be used to easily uninstall Arm Compiler for Linux, uninstall.sh. This script is located in:

<install-dir>/arm-compiler-for-linux-<release>/uninstall.sh

Run this script to uninstall all the packages supplied as part of this suite.

This script attempts to uninstall all the components supplied as part of Arm Compiler for Linux. However, if other packages outside of this product
depend on the GNU GCC component, GNU GCC will not be uninstalled.

Notes:

For versions of Arm Compiler for Linux 19.3 or earlier:

  • Components depended on by other packages must be manually uninstalled.
  • If you use the --install-to option provided by the installer,you will need to uninstall the packages by manually removing their directories.

If you require support when uninstalling any version of Arm Compiler for Linux, contact support-hpc-sw@arm.com.