Skip to content

Commit 05d6603

Browse files
authored
Merge pull request #3205 from paschalis-mpeis/bolt-install-page
bolt-demo: add installation instructions
2 parents 3a27b2c + ce8c124 commit 05d6603

9 files changed

Lines changed: 77 additions & 10 deletions

File tree

content/learning-paths/servers-and-cloud-computing/bolt-demo/_index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ who_is_this_for: This is an introductory topic for developers who have compiled
99

1010
learning_objectives:
1111
- Identify whether a program is a good candidate for code layout optimization
12+
- Install LLVM BOLT on Linux
1213
- Use LLVM BOLT to perform profile-guided post-link optimization of an AArch64 binary with poor spatial locality
1314
- Collect profile data using multiple techniques, including BRBE, instrumentation, SPE, and PMU event sampling
1415
- Evaluate the impact of BOLT optimizations using performance metrics and profiling data
@@ -19,7 +20,6 @@ prerequisites:
1920
- Linux kernel version 6.17 or later to enable Branch Record Buffer Extension ([BRBE profiling](/learning-paths/servers-and-cloud-computing/bolt-demo/brbe/))
2021
- Linux kernel version 6.14 or later for Arm Statistical Profiling Extension ([SPE profiling](/learning-paths/servers-and-cloud-computing/bolt-demo/spe/))
2122
- GCC version 13.3 or later to compile the example program ([GCC](/install-guides/gcc/) )
22-
- LLVM BOLT version [21.1.8](https://github.com/llvm/llvm-project/releases/tag/llvmorg-21.1.8) or later (download [zip](https://github.com/llvm/llvm-project/releases/download/llvmorg-21.1.8/LLVM-21.1.8-Linux-ARM64.tar.xz))
2323
- A system with with sufficient hardware performance counters to use the [TopDown](/install-guides/topdown-tool) methodology. This typically requires running on bare metal rather than a virtualized environment.
2424

2525

content/learning-paths/servers-and-cloud-computing/bolt-demo/brbe.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: Optimize with BRBE profiling
3-
weight: 5
3+
weight: 6
44

55
### FIXED, DO NOT MODIFY
66
layout: learningpathall

content/learning-paths/servers-and-cloud-computing/bolt-demo/good-candidates.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: Identify programs for BOLT optimization
3-
weight: 4
3+
weight: 5
44

55
### FIXED, DO NOT MODIFY
66
layout: learningpathall
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
---
2+
title: Install BOLT on Linux
3+
weight: 3
4+
5+
### FIXED, DO NOT MODIFY
6+
layout: learningpathall
7+
---
8+
9+
## Install BOLT on Linux
10+
11+
This guide requires LLVM BOLT 22.1.0 or later for SPE profiling and required options.
12+
Package manager versions might be older, so verify the installed version before continuing.
13+
14+
15+
## Install BOLT from LLVM releases
16+
17+
Install BOLT from a prebuilt [LLVM release](https://github.com/llvm/llvm-project/releases).
18+
This method provides a consistent version across systems. It also lets you use newer releases when available.
19+
The following example uses LLVM 22.1.0.
20+
21+
Download and extract LLVM:
22+
23+
```bash
24+
wget https://github.com/llvm/llvm-project/releases/download/llvmorg-22.1.0/LLVM-22.1.0-Linux-ARM64.tar.xz
25+
tar xf LLVM-22.1.0-Linux-ARM64.tar.xz
26+
```
27+
28+
Add LLVM tools to your PATH:
29+
30+
```bash
31+
export PATH="$(pwd)/LLVM-22.1.0-Linux-ARM64/bin:$PATH"
32+
```
33+
34+
35+
## Install BOLT using a package manager
36+
37+
Use a package manager if you prefer a system-managed installation. Package versions depend on your Linux distribution.
38+
39+
40+
41+
{{< tabpane code=true >}}
42+
43+
{{< tab header="Ubuntu/Debian" language="bash">}}
44+
sudo apt update
45+
sudo apt install llvm-bolt
46+
{{< /tab >}}
47+
48+
{{< tab header="Fedora" language="bash">}}
49+
sudo dnf install llvm-bolt
50+
{{< /tab >}}
51+
52+
{{< tab header="openSUSE" language="bash">}}
53+
sudo zypper install llvm-bolt
54+
{{< /tab >}}
55+
56+
{{< /tabpane >}}
57+
58+
59+
BOLT is available on Ubuntu 25.04 and later, Debian 13 and later, Fedora 42 and later, and on openSUSE Tumbleweed.
60+
61+
## Verify the installation
62+
63+
```bash
64+
llvm-bolt --version
65+
```
66+
67+
The command prints the BOLT version. If the command fails, check your PATH.

content/learning-paths/servers-and-cloud-computing/bolt-demo/instrumentation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: Optimize with instrumentation profiling
3-
weight: 6
3+
weight: 7
44

55
### FIXED, DO NOT MODIFY
66
layout: learningpathall

content/learning-paths/servers-and-cloud-computing/bolt-demo/pmu.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: Optimize with PMU profiling
3-
weight: 8
3+
weight: 9
44

55
### FIXED, DO NOT MODIFY
66

@@ -48,4 +48,4 @@ Finally, `llvm-bolt` uses the generated profile to reorganize functions and basi
4848

4949
You've collected a PMU profile and generated an optimized binary using basic sampling. While PMU provides less detailed control-flow information than BRBE or SPE, it's available on all Arm systems.
5050

51-
Now you're ready to verify how effective the BOLT optimization was by measuring performance improvements.
51+
Now you're ready to verify how effective the BOLT optimization was by measuring performance improvements.

content/learning-paths/servers-and-cloud-computing/bolt-demo/setup.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
2-
title: Prepare your environment for BOLT
3-
weight: 3
2+
title: Prepare your environment
3+
weight: 4
44

55
### FIXED, DO NOT MODIFY
66
layout: learningpathall

content/learning-paths/servers-and-cloud-computing/bolt-demo/spe.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: Optimize with SPE profiling
3-
weight: 7
3+
weight: 8
44

55
### FIXED, DO NOT MODIFY
66

content/learning-paths/servers-and-cloud-computing/bolt-demo/verify-optimization.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: Verify BOLT optimization results
3-
weight: 9
3+
weight: 10
44

55
### FIXED, DO NOT MODIFY
66
layout: learningpathall

0 commit comments

Comments
 (0)