Skip to content

Commit 01f107d

Browse files
authored
Merge pull request #336 from vkucera/install
Update and restructure installation instructions
2 parents 48d1415 + fde0d6e commit 01f107d

File tree

1 file changed

+108
-104
lines changed

1 file changed

+108
-104
lines changed

docs/gettingstarted/installing.md

Lines changed: 108 additions & 104 deletions
Original file line numberDiff line numberDiff line change
@@ -5,48 +5,46 @@ title: Installing O2 and O2Physics
55

66
# Installing O2 and O2Physics
77

8-
ALICE software has several dependencies: aliBuild takes care of downloading them for you. aliBuild
9-
can also automatically download precompiled binaries if possible.
8+
Building software has become an increasingly complicated operation, as our software has many dependencies and we expect it to work both on your laptop and on the Grid.
9+
In addition, we support many Linux distributions and recent macOS versions.
1010

11-
## Installing aliBuild
11+
ALICE uses [aliBuild](https://alisw.github.io/alibuild/) to build software.
1212

13-
Building software has become an increasingly complicated operation, as our software has many dependencies and we expect it to work both on your laptop and on the Grid. In addition, we support many Linux distributions and recent macOS versions.
14-
15-
ALICE uses aliBuild to build software. aliBuild:
13+
aliBuild
1614

1715
* knows how to build software via per-package recipes,
1816
* manages the dependencies consistently,
17+
* can automatically download precompiled binaries if possible,
1918
* rebuilds only what's necessary,
20-
* allows several versions of the same software to be installed at the same time.
21-
22-
### Operating systems we support
19+
* allows several versions of the same software to be installed side by side.
2320

24-
#### Prerequisites
21+
## Install aliBuild
2522

26-
According to your operating system, please follow the prerequisites below. You will find a list of packages to install and configurations to perform.
23+
Please follow the corresponding instructions below, according to your operating system.
2724

28-
##### Primary supported platform
25+
Primary supported platforms:
2926

30-
* [CentOS 7](#prereq-for-centos7)
31-
* [CentOS/AlmaLinux 8](#prereq-for-centos8)
32-
* [AlmaLinux 9](#prereq-for-alma9)
27+
* [CentOS 7](#alibuild-for-centos7)
28+
* [CentOS 8, AlmaLinux 8](#alibuild-for-centos8)
29+
* [AlmaLinux 9](#alibuild-for-alma9)
3330

34-
##### Platforms supported on a best-effort basis
31+
Platforms supported on a best-effort basis:
3532

36-
* [macOS Sonoma and Sequoia (14.0, 15.0)](#prereq-for-macos)
37-
* [Ubuntu (20.04 LTS, 22.04 LTS, 24.04 LTS)](#prereq-for-ubuntu)
38-
* [Fedora](#prereq-for-fedora)
33+
* [macOS](#alibuild-for-macos): Sonoma (14), Sequoia (15)
34+
* [Ubuntu](#alibuild-for-ubuntu): 20.04 LTS, 22.04 LTS, 24.04 LTS
35+
* [Fedora](#alibuild-for-fedora)
3936
* Linux Mint
4037
* Follow the instructions for the Ubuntu version your Linux Mint version is based on.
41-
* Specify the corresponding Ubuntu architecture when running the `aliBuild` command using the `-a` option (e.g. `-a ubuntu2004_x86-64` for Ubuntu 20.04). Use the `-a` option also with the `alienv` command.
38+
* Specify the corresponding Ubuntu architecture when running `aliBuild` commands using the `-a` option (e.g. `-a ubuntu2404_x86-64` for Ubuntu 24.04). Use the `-a` option also with `alienv` commands.
4239

43-
If your operating system is *not* in any list, it does not mean our software won't work on it; it will be just more difficult for you to get support for it.
40+
If your operating system is *not* listed, it does not mean our software won't work on it; it will be just more difficult for you to get support for it.
4441

45-
Only in case you cannot install aliBuild in the way described above, you can install aliBuild manually. This procedure should only be used as a fall-back, in case you cannot follow the instructions for your operating system linked above.
42+
Only in case you cannot install aliBuild in the way described below, you can install aliBuild manually.
43+
This procedure should only be used as a fallback, in case you cannot follow the instructions for your operating system linked above.
4644

47-
<h6 id="prereq-for-centos7"> aliBuild prerequisites for CentOS7 </h6>
45+
### CentOS 7 {#alibuild-for-centos7}
4846

49-
With root permission, i.e. `sudo` or as `root`install the prerequisits using:
47+
With root permissions, i.e. `sudo` or as `root`, install the prerequisites and aliBuild using:
5048

5149
```bash
5250
cat << EOF > /etc/yum.repos.d/alice-system-deps.repo
@@ -62,9 +60,9 @@ yum update -y
6260
yum install -y alibuild
6361
```
6462

65-
<h6 id="prereq-for-centos8"> aliBuild prerequisites for CentOS8 </h6>
63+
### CentOS 8, AlmaLinux 8 {#alibuild-for-centos8}
6664

67-
With root permission, i.e. `sudo` or as `root` install the prerequisits using:
65+
With root permissions, i.e. `sudo` or as `root`, install the prerequisites and aliBuild using:
6866

6967
```bash
7068
yum install -y epel-release
@@ -85,9 +83,9 @@ yum update -y
8583
yum install -y alice-o2-full-deps alibuild
8684
```
8785

88-
<h6 id="prereq-for-alma9"> aliBuild prerequisites for AlmaLinux9 </h6>
86+
### AlmaLinux 9 {#alibuild-for-alma9}
8987

90-
With root permission, i.e. `sudo` or as `root`install the prerequisits using:
88+
With root permissions, i.e. `sudo` or as `root`, install the prerequisites and aliBuild using:
9189

9290
```bash
9391
dnf install -y epel-release dnf-plugins-core
@@ -105,79 +103,64 @@ dnf update -y
105103
dnf install -y alice-o2-full-deps alibuild
106104
```
107105

108-
<h6 id="prereq-for-macos">aliBuild prerequisites for macOS</h6>
106+
### macOS {#alibuild-for-macos}
109107

110-
**Get Xcode**<br>
108+
#### Get Xcode
111109

112110
Xcode bundles the necessary tools to build software in the apple ecosystem including compilers, build systems and version control.
113111

114-
* Download it from the [App Store](https://itunes.apple.com/gh/app/xcode/id497799835?mt=12)
115-
* Open once installed. It will ask to install additional components - approve the action.
116-
* Open a terminal (Applicaions>Utilities>Terminal) and install the command line tools using: <br>
117-
* `sudo xcode-select --install`
118-
* Approve the license conditions by <br>
119-
`sudo xcodebuild -license`
112+
* Download it from the [App Store](https://itunes.apple.com/gh/app/xcode/id497799835?mt=12) and install it.
113+
* Open once installed. It will ask to install additional components. Approve the action.
114+
* Open a terminal (Applications>Utilities>Terminal) and install the command line tools using: `sudo xcode-select --install`
115+
* Approve the license conditions by: `sudo xcodebuild -license`
120116

121-
**Get Homebrew**<br>
117+
#### Get Homebrew
122118

123-
[Homebrew](https://brew.sh/) is a command-line package manager for macOS used to install software packages similar to `yum` on CentOS or `apt` on Ubuntu.
119+
[Homebrew](https://brew.sh/) is a command-line package manager for macOS used to install software packages (similar to `yum` on CentOS or `apt` on Ubuntu).
124120

125121
* Install Homebrew using the [instructions on their webpage](https://brew.sh/).
126-
* Once installed detect any problems regarding Homebrew and your system using: `brew doctor`
122+
* Detect any problems regarding Homebrew and your system using: `brew doctor`.
127123

128-
**Uninstall ROOT**<br>
124+
#### Uninstall ROOT
129125

130-
If you have an existing ROOT installation on your system, this will interfere with the aliBuild installation, and will cause difficult-to-debug compilation errors.
126+
If you have an existing ROOT installation on your system, it will interfere with the aliBuild installation and will cause difficult-to-debug compilation errors.
131127

132128
Please uninstall any existing copy of ROOT on your system. The uninstallation method depends on how you installed it. For example, if you originally installed ROOT using Homebrew, you should uninstall it using `brew uninstall root`.
133129

134130
After uninstalling ROOT, remove any reference to ROOT from your `.zprofile`, `.zshrc` and any other shell configuration files. Then close and re-open your terminal window.
135131

136-
**Install the required packages**<br>
132+
#### Install the required packages
137133

138134
Note that Homebrew does not run as root. Do not prepend sudo to any of the following commands.
139135

140-
* Install the prerequisites and aliBuild via:<br>
141-
```brew install alisw/system-deps/o2-full-deps alisw/system-deps/alibuild```
142-
* Set up Homebrew in your shell by running the following command:<br>
143-
```echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.zprofile```
136+
* Install the prerequisites and aliBuild via: `brew install alisw/system-deps/o2-full-deps alisw/system-deps/alibuild`
137+
* Set up Homebrew in your shell by: `echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.zprofile`
144138
* Close Terminal and reopen it to apply changes.
145139

146-
<h6 id="prereq-for-ubuntu">aliBuild prerequisites for Ubuntu</h6>
147-
148-
ALICE software on Ubuntu is supported on a best effort basis. There is no guarantee that software builds or runs correctly. Support requests might have low priority. We were able to successfully build on:
140+
### Ubuntu {#alibuild-for-ubuntu}
149141

150-
* Ubuntu 20.04 LTS
151-
* Ubuntu 22.04 LTS
152-
* Ubuntu 24.04 LTS
142+
#### Install required system packages
153143

154-
**Install required system packages**<br>
155-
156-
With root permissions, i.e. sudo, update your package sources:
144+
Update your package sources and install the required system packages:
157145

158146
```bash
159147
sudo apt update -y
160-
```
161-
162-
With root permissions, i.e. `sudo`, install the following packages:
163-
164-
```bash
165148
sudo apt install -y curl libcurl4-gnutls-dev build-essential gfortran libmysqlclient-dev xorg-dev libglu1-mesa-dev libfftw3-dev libxml2-dev git unzip autoconf automake autopoint texinfo gettext libtool libtool-bin pkg-config bison flex libperl-dev libbz2-dev swig liblzma-dev libnanomsg-dev rsync lsb-release environment-modules libglfw3-dev libtbb-dev python3-dev python3-venv python3-pip graphviz libncurses-dev software-properties-common gtk-doc-tools
166149
```
167150

168-
**Installing aliBuild**<br>
151+
#### Install aliBuild {#install-alibuild-for-ubuntu}
169152

170-
AliBuild, our build tool, is installed as a standard ubuntu package, provided you enable the alisw PPA repository. This is done with:
153+
Add the [alisw PPA repository](https://launchpad.net/~alisw/+archive/ubuntu/ppa) and install aliBuild as an Ubuntu package:
171154

172155
```bash
173156
sudo add-apt-repository ppa:alisw/ppa
174157
sudo apt update
175158
sudo apt install python3-alibuild
176159
```
177160

178-
<h6 id="prereq-for-fedora">aliBuild prerequisites for Fedora</h6>
161+
### Fedora {#alibuild-for-fedora}
179162

180-
With root permissions, i.e. `sudo` or as `root` install the prerequisites using:
163+
With root permissions, i.e. `sudo` or as `root`, install the prerequisites and aliBuild using:
181164

182165
```bash
183166
yum install -y epel-release
@@ -198,9 +181,9 @@ yum update -y
198181
yum install -y alice-o2-full-deps alibuild
199182
```
200183

201-
### Configure aliBuild
184+
## Configure aliBuild
202185

203-
After you are done installing alibuild you need to configure it by adding the two following lines to your `~/.bashrc`, `~/.bash_profile`, `~/.zshrc` or `~/.zprofile` (depending on your operating system and configuration):
186+
After installing aliBuild, configure it by adding the following lines to your `~/.bashrc`, `~/.bash_profile`, `~/.zshrc` or `~/.zprofile` (depending on your operating system and configuration):
204187

205188
```bash
206189
export ALIBUILD_WORK_DIR="$HOME/alice/sw"
@@ -211,54 +194,100 @@ The first line tells what directory is used as "build cache", the second line in
211194

212195
You need to close and reopen your terminal for the change to be effective. The directory `~/alice/sw` will be created the first time you run aliBuild.
213196

214-
Note that this directory tends to grow in size over time, and it is the one you need to remove in case of cleanups.
197+
Note that this directory tends to grow in size over time and it is the one you need to [clean up](#delete-obsolete-builds) occasionally.
215198

216-
When `aliBuild`is installed on your computer and your prerequisits are statisfied, you can move to the next step.
199+
When `aliBuild` is installed on your computer and your prerequisites are satisfied, you can move to the next step.
217200

218201
See also [shell rc utilities](../tools/README.md#shell-rc-utilities).
219202

220203
## Prepare your source code
221204

222205
We assume your work area is `~/alice`.
223206
Start with a clean shell where you are not in an `alienv` environment.
224-
Create the directory and move to it (all the following commands need to be executed in this folder):
207+
Create the directory and move to it. (All the following commands need to be executed in this directory.):
225208

226209
```bash
227210
mkdir -p ~/alice
228211
cd ~/alice
229212
```
230213

231-
Download O2 and O2Physics:
214+
Download O2Physics (and optionally O2):
232215

233216
```bash
234-
aliBuild init O2@dev
235217
aliBuild init O2Physics@master
218+
aliBuild init O2@dev # optional
236219
```
237220

238-
If you perform `ls` under your work directory, you will see the packages you have downloaded via
239-
`aliBuild init`, plus an `alidist` directory.
221+
If you perform `ls` under your work directory, you will see the development packages you have downloaded via
222+
`aliBuild init`, plus the `alidist` directory.
223+
224+
The `alidist` directory contains software recipes, telling aliBuild how the software is built.
240225

241-
The `alidist` directory contains software recipes, telling aliBuild how the software is built. Your
242-
`alidist` directory and your software source code are Git directories **managed by you**: you need
243-
to keep them up-to-date manually.
226+
```note
227+
You only need the O2 source code if you need to modify it. Otherwise, aliBuild will install the O2 version defined in `alidist` as a dependency of O2Physics.
228+
```
229+
230+
```warning
231+
Your `alidist` directory and your software source code are Git repositories **managed by you**. You need to keep them up to date manually.
232+
```
244233

245234
## Check your prerequisites
246235

247236
```bash
248237
aliDoctor O2Physics
249238
```
250239

251-
aliDoctor will warn you that some packages have to be built as they could not be found from the
252-
system.
240+
aliDoctor will warn you if some packages have to be built as they could not be found on the system.
253241

254242
## Build and rebuild
255243

244+
Build (or rebuild) full O2Physics with:
245+
256246
```bash
257247
aliBuild build O2Physics
258248
```
259249

250+
To set the maximum number of parallel jobs `N`, provide the `-j N` option.
251+
260252
See the [Troubleshooting](../troubleshooting/README.md) section for debugging tips if the build fails.
261253

254+
### Component-based build
255+
256+
To build only parts of O2Physics, provide a space-separated list of requested directories (followed by `/install`) using the `O2PHYSICS_COMPONENTS` variable, e.g.:
257+
258+
```bash
259+
O2PHYSICS_COMPONENTS="Common/install Tools/install Tutorials/install" aliBuild build O2Physics
260+
```
261+
262+
```warning
263+
On Linux, the components providing the required linked shared libraries also need to be included (e.g. `Tools/ML` for `O2Physics::MLCore`).
264+
```
265+
266+
## Use your local software installations
267+
268+
You will not find the packages you have built immediately available on your shell.
269+
We provide a tool called `alienv` that configures your shell according to the packages you want to load.
270+
`alienv` is capable of switching between different versions of the same package without a hassle.
271+
272+
Load the latest O2Physics version you have built.
273+
274+
```bash
275+
alienv enter O2Physics/latest
276+
```
277+
278+
The `alienv enter` command drops you to a new shell with the O2Physics environment.
279+
Unload the packages by simply exiting the environment with the `exit` command.
280+
281+
```warning
282+
Dependencies are loaded automatically. Do not attempt to load O2 or ROOT as well! You will find them automatically in the environment. `alienv enter` is verbose and will inform you about the loaded packages.
283+
```
284+
285+
```tip
286+
If you have built several Git branches of O2Physics, you can enter the environment of a given branch `[branch]` with `alienv enter O2Physics/latest-[branch]-o2`.
287+
288+
You can list all your available packages with `alienv q`.
289+
```
290+
262291
## Delete obsolete builds
263292

264293
With frequent rebuilding of packages, obsolete builds can pile up and occupy a lot of precious
@@ -278,7 +307,7 @@ dependency packages and downloaded `.tar.gz` archives.
278307
In general, it's good practice to run `aliBuild clean` always after `aliBuild build`.
279308

280309
This might not be enough, as aliBuild will not delete any build directory pointed to by a symlink
281-
that has "latest" in its name, even when that build is not needed by any other package anymore.
310+
that has "latest" in its name, even when that build is not needed by any other package any more.
282311
Manual intervention is therefore sometimes needed.
283312

284313
### Deep cleanup
@@ -299,31 +328,6 @@ you can make aliBuild delete the rest with a little trick.
299328
by running `aliBuild build` for each development package.
300329
3. Let aliBuild delete all the other builds by running `aliBuild clean`.
301330

302-
## Use your local software installations
303-
304-
You will not find the packages you have built immediately available on your shell.
305-
We provide a tool called `alienv` that configures your shell according to the packages you want to load.
306-
`alienv` is capable of switching between different versions of the same package without a hassle.
307-
308-
Load the latest O2Physics version you have built.
309-
310-
```bash
311-
alienv enter O2Physics/latest
312-
```
313-
314-
The `alienv enter` command drops you to a new shell with the O2Physics environment. Unload the packages by simply exiting the environment with
315-
the `exit` command.
316-
317-
```warning
318-
Dependencies are loaded automatically. Do not attempt to load O2 or ROOT as well! You will find them automatically in the environment. `alienv enter` is verbose and will inform you about the loaded packages.
319-
```
320-
321-
```tip
322-
If you have built several Git branches of O2Physics, you can enter the environment of a given branch `[branch]` with `alienv enter O2Physics/latest-[branch]-o2`.
323-
324-
You can list all your available packages with `alienv q`.
325-
```
326-
327331
## Building partially for development using ninja
328332

329333
```note

0 commit comments

Comments
 (0)