About this Install Guide

This guide shows you how to install and use the tool with the most common configuration. For advanced options and complete reference information, see the official documentation. Some install guides also include optional next steps to help you explore related workflows or integrations.

The LLVM toolchain includes Clang, LLD, BOLT, and other utilities for compiling, linking, profiling, and optimizing applications on Arm Linux.

You’ll learn how to install LLVM from a prebuilt release or from source, install BOLT from Linux distribution packages, and verify the installed tools.

Note

BOLT is provided as a built-in, ready-to-use component of the Arm Toolchain for Linux suite. For more information, see How to use BOLT with our toolchain .

Before you begin

Confirm you are using an Arm machine:

    

        
        
uname -m

    

The output is similar to:

    

        
        aarch64

        
    

If you see a different result, you’re not using an Arm computer running 64-bit Linux.

There are three ways to install LLVM tools:

Install from LLVM releases

You can install LLVM by downloading a prebuilt binary release from GitHub.

Install the tools needed to download and extract the archive. For Debian-based Linux distributions, including Ubuntu, install wget and xz-utils:

    

        
        
sudo apt update
sudo apt install wget xz-utils -y

    
Note

The following commands for installing from a release use LLVM version 22.1.8. To install a different version, replace the filename in the commands. For the latest releases, see LLVM Project releases .

The commands extract LLVM to $HOME/toolchain. To install LLVM in a different location, adjust the extraction path and update the PATH environment variable accordingly.

  1. Download a binary release. For Arm Linux, use the archive with Linux-ARM64 in its filename:
    

        
        
mkdir -p $HOME/toolchain
cd $HOME/toolchain
wget https://github.com/llvm/llvm-project/releases/download/llvmorg-22.1.8/LLVM-22.1.8-Linux-ARM64.tar.xz

    
  1. Extract the downloaded file:
    

        
        
tar -xvf LLVM-22.1.8-Linux-ARM64.tar.xz

    
  1. Add the LLVM bin directory to your PATH to run LLVM tools, such as clang and lld, from any directory:
    

        
        
export PATH="$HOME/toolchain/LLVM-22.1.8-Linux-ARM64/bin:$PATH"

    
Note

The command updates PATH for your current terminal session. To make the change persistent, add the same command to your shell profile, such as ~/.bashrc.

Install from source

To install LLVM from source, follow these steps:

Install source build dependencies

Start by installing the required build tools.

  1. Install Git for your operating system. Many Linux distributions include Git, so you might not need to install it.

  2. Install CMake:

    

        
        
sudo apt install cmake -y

    

Check that CMake is installed:

    

        
        
cmake --version

    

The output is similar to:

    

        
        cmake version 3.28.3

CMake suite maintained and supported by Kitware (kitware.com/cmake).

        
    

For more information, see the CMake install guide .

  1. Install Ninja:
    

        
        
sudo apt install ninja-build -y

    

Check that Ninja is installed:

    

        
        
ninja --version

    

The output is similar to:

    

        
        1.11.1

        
    
  1. Install Clang:
    

        
        
sudo apt install clang -y

    

Check that Clang is installed:

    

        
        
clang --version

    

The output is similar to:

    

        
        Ubuntu clang version 18.1.3 (1ubuntu1)
Target: aarch64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/bin

        
    

Build from source

To build and install from source code, follow these steps:

  1. Clone the repository:
    

        
        
git clone https://github.com/llvm/llvm-project.git

    
  1. Configure a build:
    

        
        
cd llvm-project
mkdir build
cd build
cmake -G Ninja ../llvm -DLLVM_TARGETS_TO_BUILD="X86;AArch64" -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_ASSERTIONS=ON -DLLVM_ENABLE_PROJECTS="bolt;clang;lld"

    

Build a tool. For example, BOLT:

    

        
        
ninja bolt

    
Note

The build time depends on your machine configuration and might take several minutes to complete.

  1. Add the path to the build directory in your .bashrc file:
    

        
        
echo 'export PATH="$PATH:$HOME/llvm-project/build/bin"' >> ~/.bashrc
source ~/.bashrc

    

After the build completes, verify that the tools work as expected. To verify BOLT, continue to verify the BOLT tools .

Install BOLT using a package manager

Use a package manager if you prefer only a system-managed installation of BOLT. Package versions depend on your Linux distribution.

    

        
        

sudo apt update
sudo apt install llvm-bolt


    
    

        
        

sudo dnf install llvm-bolt


    
    

        
        

sudo zypper install llvm-bolt


    

BOLT is available on Ubuntu 25.04 and later, Debian 13 and later, Fedora 42 and later, and on openSUSE Tumbleweed.

Next, verify the BOLT tools .

Verify Clang compiler and LLD linker tools

Run the following commands:

    

        
        
clang --version
clang++ --version
ld.lld --version

    

The output is similar to:

    

        
        clang version 22.1.8 (https://github.com/llvm/llvm-project ca7933e47d3a3451d81e72ac174dcb5aa28b59d1)
Target: aarch64-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/ubuntu/toolchain/LLVM-22.1.8-Linux-ARM64/bin

clang version 22.1.8 (https://github.com/llvm/llvm-project ca7933e47d3a3451d81e72ac174dcb5aa28b59d1)
Target: aarch64-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/ubuntu/toolchain/LLVM-22.1.8-Linux-ARM64/bin

LLD 22.1.8 (https://github.com/llvm/llvm-project ca7933e47d3a3451d81e72ac174dcb5aa28b59d1) (compatible with GNU linkers)

        
    

Each command should print LLVM version information.

Compile and run a C++ example

Use a text editor to copy and paste the following code into a file named hello.cpp:

    

        
        
#include <iostream>

int main()
{
    std::cout << "Hello, LLVM on Arm\n";
    return 0;
}

    

Compile the example with clang++ and link it with LLD:

    

        
        
clang++ -fuse-ld=lld hello.cpp -o hello

    

Run the example:

    

        
        
./hello

    

The output is similar to:

    

        
        Hello, LLVM on Arm

        
    

Verify the PGO profiling tools

Run the following commands:

    

        
        
llvm-profdata --version
llvm-profgen --version

    

Each command should print LLVM version information.

Verify BOLT tools

Run the following commands:

    

        
        
perf2bolt --version
llvm-bolt --version

    

The output is similar to:

    

        
        LLVM (http://llvm.org/):
  LLVM version 22.1.8
  Optimized build.

        
    

Each command should print LLVM version information.

Next steps

You’re now ready to use LLVM on your Arm Linux system.

To learn how to use the LLVM toolchain, see the LLVM Learning Paths .


Give Feedback

How would you rate this tool quick-install guide?