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.

BOLT is an open-source post-link binary optimization tool developed to speed up large applications. It does this by optimizing the application’s code layout based on performance profile samples collected during execution.

In this guide, you’ll learn how to download and install BOLT. The instructions are for Debian-based Linux distributions, but can be adapted for other Linux distributions.

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

Follow these steps:

  1. Install Git

Install Git for your operating system.

Many Linux distributions include Git so you may not need to install it.

  1. Install CMake
    

        
        
sudo apt install cmake -y

    

Check it 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 CMake install guide.

  1. Install Ninja
    

        
        
sudo apt install ninja-build -y

    

Check it is installed:

    

        
        
ninja --version

    

The output is similar to:

    

        
        1.11.1

        
    
  1. Install Clang
    

        
        
sudo apt install clang -y

    

Check it 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

        
    
  1. Install xz-utils
    

        
        
sudo apt-get install xz-utils -y

    

Install BOLT

You can install BOLT by building the source code or by downloading a binary release from GitHub.

Build and install BOLT from source code

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

  1. Clone the repository
    

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

    
  1. Build BOLT and run it
    

        
        
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"

    
    

        
        
ninja bolt

    
Note

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

  1. Add the path to BOLT in your .bashrc file
    

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

    

You are now ready to verify BOLT is installed .

Install BOLT using a binary release

To install BOLT using a binary release, follow these steps:

Note

The following commands use BOLT version 22.1.3. The same commands work with other versions. Replace the file used in these steps with the file for your version of choice. To find the latest version, see LLVM Project releases .

  1. Download a binary release

For Arm Linux, use the file with ARM64 in the name:

    

        
        
wget https://github.com/llvm/llvm-project/releases/download/llvmorg-22.1.3/LLVM-22.1.3-Linux-ARM64.tar.xz

    
  1. Extract the downloaded file
    

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

    
  1. Add the path to BOLT in your .bashrc file
    

        
        
echo 'export PATH="$PATH:$HOME/LLVM-22.1.3-Linux-ARM64/bin"' >> ~/.bashrc
source ~/.bashrc

    

Verify BOLT is installed

To verify BOLT is installed, follow these steps:

  1. Confirm BOLT applications perf2bolt and llvm-bolt are installed

Check the perf2bolt command:

    

        
        
perf2bolt

    

The output is similar to:

    

        
        perf2bolt: Not enough positional command line arguments specified!
Must specify at least 1 positional argument: See: perf2bolt --help

        
    

Check the llvm-bolt command:

    

        
        
llvm-bolt

    

The output is similar to:

    

        
        llvm-bolt: Not enough positional command line arguments specified!
Must specify at least 1 positional argument: See: llvm-bolt --help

        
    
  1. Print the BOLT version
    

        
        
llvm-bolt --version

    

The output is similar to:

    

        
        LLVM (http://llvm.org/):
  LLVM version 22.1.3
  Optimized build.
BOLT revision e9846648fd6183ee6d8cbdb4502213fcf902a211

  Registered Targets:
    aarch64    - AArch64 (little endian)
    aarch64_32 - AArch64 (little endian ILP32)
    aarch64_be - AArch64 (big endian)
    arm64      - ARM64 (little endian)
    arm64_32   - ARM64 (little endian ILP32)
    riscv32    - 32-bit RISC-V
    riscv32be  - 32-bit big endian RISC-V
    riscv64    - 64-bit RISC-V
    riscv64be  - 64-bit big endian RISC-V
    x86        - 32-bit X86: Pentium-Pro and above
    x86-64     - 64-bit X86: EM64T and AMD64

        
    

You’ll see additional Registered Targets if you downloaded a binary release.

You are now ready to use BOLT on your Linux machine.


Give Feedback

How would you rate this tool quick-install guide?