Skip to content

Commit 45debae

Browse files
authored
Try to drop obsolete information from the instructions (#171)
1 parent 973e575 commit 45debae

1 file changed

Lines changed: 43 additions & 225 deletions

File tree

building/build.md

Lines changed: 43 additions & 225 deletions
Original file line numberDiff line numberDiff line change
@@ -21,29 +21,33 @@ mkdir -p ~/alice
2121
cd ~/alice
2222
```
2323

24-
If you want to develop analysis code, download AliPhysics:
24+
If you need to develop for Run 3, download O2Physics:
2525

2626
```bash
27-
aliBuild init AliPhysics@master
27+
aliBuild init O2Physics@master
2828
```
2929

30-
Only if you need to develop the Run 2 core software (unlikely), download AliRoot:
30+
Only if you need to develop the Run 3 core software (unlikely), download O2:
3131

3232
```bash
33-
aliBuild init AliRoot@master
33+
aliBuild init O2@dev
3434
```
3535

36-
If you need to develop for Run 3, download O2Physics:
36+
{% callout "Obsolete / Deprecated stack" %}
37+
If you absolutely need to develop analysis using the old, deprecated
38+
Run 1 / Run 2 stack, you can still use AliPhysics :
3739

3840
```bash
39-
aliBuild init O2Physics@master
41+
aliBuild init AliPhysics@master
4042
```
4143

42-
Only if you need to develop the Run 3 core software (unlikely), download O2:
44+
Only if you need to develop the Run 2 core software (unlikely), download AliRoot:
4345

4446
```bash
45-
aliBuild init O2@dev
47+
aliBuild init AliRoot@master
4648
```
49+
{% endcallout %}
50+
4751

4852
### Source code and recipes
4953

@@ -85,7 +89,7 @@ Instead of resetting to the current upstream version, you may want to download s
8589
the software:
8690

8791
```bash
88-
cd ~/alice/AliPhysics
92+
cd ~/alice/O2
8993
git fetch --all --tags
9094
git checkout v5-09-42-01
9195
```
@@ -105,20 +109,6 @@ were installed correctly. In general, aliBuild is capable of building all requir
105109
dependencies, but it has also the ability to take them "from the system" if possible, resulting in
106110
less time spent for building for you.
107111

108-
Run the `aliDoctor` command to check dependencies for Run 2 software:
109-
110-
```bash
111-
cd ~/alice
112-
aliDoctor AliPhysics
113-
```
114-
115-
For Run 2 software based on ROOT 6 (note: this is the only option on macOS):
116-
117-
```bash
118-
cd ~/alice
119-
aliDoctor AliPhysics
120-
```
121-
122112
For Run 3 software:
123113

124114
```bash
@@ -148,17 +138,20 @@ contains those packages, or less packages, then you are fine and you may continu
148138
> installed it, it might just be that its version it's incompatible (this frequently happens with
149139
> `CMake`) or you are missing the "development" package for that component.
150140
141+
{% callout "Obsolete / Deprecated stack" %}
142+
For Run 2 software based on ROOT 6 (note: this is the only option on macOS):
151143

152-
## Build and rebuild
153-
154-
You can build the whole Run 2 software stack based on ROOT 6 with:
155-
156-
```
144+
```bash
157145
cd ~/alice
158-
aliBuild build AliPhysics
146+
aliDoctor AliPhysics
159147
```
160148

161-
Similarly, for O2Physics:
149+
{% endcallout %}
150+
151+
152+
## Build and rebuild
153+
154+
You can build the whole Run 3 software stack with :
162155

163156
```
164157
cd ~/alice
@@ -186,25 +179,13 @@ will only be able to submit Grid analysis jobs using ROOT 6-based builds (whose
186179
just [use it from CVMFS](precomp.md) by logging in to `lxplus.cern.ch`.
187180
{% endcallout %}
188181

189-
190-
### Other build options
191-
192-
The options above are suitable for a CentOS 7 installation, since precompiled binaries
193-
will be downloaded. You also have other installation options according to your needs: it is not
194-
guaranteed that cached binaries are available for the following options, but they may be faster to
195-
build.
196-
197-
**Build AliPhysics based on ROOT 5 (legacy):**
198-
199-
```bash
200-
aliBuild build AliPhysics --defaults user # without GEANT 3, GEANT 4, DPMJET
201-
aliBuild build AliPhysics --defaults release # full ROOT 5 stack
182+
{% callout "Obsolete / Deprecated stack" %}
202183
```
184+
cd ~/alice
185+
aliBuild build AliPhysics
186+
```
187+
{% endcallout %}
203188

204-
_⚠️ ROOT 5 does not work on macOS. Use a ROOT 6 version compatible with ROOT 5 if you really need it
205-
(see below)._
206-
207-
---
208189

209190
### Rebuild existing installations
210191

@@ -252,20 +233,20 @@ alienv q
252233
**Load the latest version you have built of a package (AliPhysics for instance):**
253234

254235
```bash
255-
alienv enter AliPhysics/latest
236+
alienv enter O2/latest
256237
```
257238

258-
_⚠️ Dependencies are loaded automatically. Do not attempt to load AliRoot and ROOT as well, you will
239+
_⚠️ Dependencies are loaded automatically. Do not attempt to load O2 and ROOT as well, you will
259240
find them automatically in the environment! `alienv enter` is verbose and will inform you about the
260241
loaded packages if you have doubts._
261242

262243
The `alienv enter` command drops you to a new shell. Unload the packages by simply exiting it with
263244
the `exit` command.
264245

265-
{% callout "I have several AliPhysics versions. Which one is AliPhysics/latest?" %}
246+
{% callout "I have several O2 versions. Which one is O2/latest?" %}
266247
aliBuild will tell you exactly what you need to type in order to load the software you have just
267-
built. Just use aliBuild's suggestion in place of `AliPhysics/latest` wherever appropriate: for
268-
instance, if you have several AliPhysics versions, `AliPhysics/latest` will point to the version you
248+
built. Just use aliBuild's suggestion in place of `O2/latest` wherever appropriate: for
249+
instance, if you have several O2 versions, `O2/latest` will point to the version you
269250
have built more recently, not the latest.
270251
{% endcallout %}
271252

@@ -276,202 +257,39 @@ If you know what you are doing, you can also load the environment in your _curre
276257
subsequently unload it (this is not recommended):
277258

278259
```bash
279-
alienv load AliPhysics/latest
280-
alienv unload AliPhysics/latest
260+
alienv load O2/latest
261+
alienv unload O2/latest
281262
```
282263

283264
If you want to load the environment inside a script you are developing, just add this line (works
284265
with Bash scripts):
285266

286267
```bash
287-
source $(alienv printenv AliPhysics/latest)
268+
source $(alienv printenv O2/latest)
288269
```
289270

290271

291272
### Run a single command in the environment
292273

293-
You can also run a single command (for instance, `aliroot`) in the given environment without loading
274+
You can also run a single command (for instance, `root`) in the given environment without loading
294275
it in the current shell:
295276

296277
```bash
297-
alienv setenv AliPhysics/latest -c aliroot myMacro.C+
278+
alienv setenv O2/latest -c root
298279
```
299280

300281
{% callout "🚫Do not load alienv automatically in your shell" %}
301282
Even if this is technically possible, it is strongly not recommended to load the environment with
302283
`alienv` in your `~/.bashrc`! **You must keep your environment pristine for safely running
303284
aliBuild.** By not loading the environment automatically, you will avoid a huge source of errors.
304-
305-
Do you still find annoying to type `alienv enter AliPhysics/latest` every time you want to use it?
306-
You can add the following line in your `~/.bashrc` to make it more convenient:
307-
308-
```bash
309-
alias ali='alienv enter AliPhysics/latest'
310-
```
311-
312-
You are creating an alias called `ali`, that will load the environment by just typing it at the
313-
prompt. Of course you can name it any way you want.
314285
{% endcallout %}
315286

316287

317288
## Special build needs
318289

319-
Read below if you have some advanced requirements for your local installation.
320-
321-
322-
### Build by using less resources
323-
324-
Building takes by default all the available CPU and most of the memory of your computer,
325-
considerably slowing down your work. In some cases you may want to reduce the number of cores
326-
available to aliBuild by using the `-j <num-cores>` option:
327-
328-
```bash
329-
aliBuild build AliPhysics -j 1
330-
```
331-
332-
333-
### Do not use the cache on CentOS 7
290+
Please refer to the aliBuild documentation for special build options like:
334291

335-
aliBuild will attempt to fetch the precompiled binaries automatically
336-
on CentOS 7: no need to specify extra options.
337-
338-
If you want _not_ to use them for some reason, it is important you follow the [CentOS 7
339-
prerequisites](prereq-centos7.md) first: this will allow aliBuild to take as many packages as
340-
possible from the system. You will then need to add the `--always-prefer-system` option to the
341-
`aliBuild build` command. For instance:
342-
343-
```bash
344-
aliBuild build AliPhysics --always-prefer-system
345-
```
346-
347-
348-
### Build the same source multiple times with different options
349-
350-
aliBuild and alienv give you the ability to build the same development source with different
351-
defaults without duplicating the source, and without conflicts.
352-
353-
Imagine we are under `~/alice` and we have cloned AliRoot and AliPhysics with the `aliBuild init`
354-
command above. We build AliPhysics _twice_, once with ROOT 5 and a second time against ROOT 6.
355-
356-
**Let's first build AliPhysics with ROOT 5:**
357-
358-
```bash
359-
aliBuild build AliPhysics --defaults user -z aliroot5
360-
```
361-
362-
_⚠️ Note the `-z aliroot5` command; it is assigning a nickname to the build for distinguishing it
363-
more easily when using it._
364-
365-
The command ends with a message saying what to do to use the package:
366-
367-
```bash
368-
alienv enter AliPhysics/latest-aliroot5-user
369-
```
370-
371-
---
372-
373-
**Let's now build the same AliPhysics with ROOT 6:**
374-
375-
```bash
376-
aliBuild build AliPhysics -z aliroot6
377-
```
378-
379-
Now, the message tells us to type:
380-
381-
```bash
382-
alienv enter AliPhysics/latest-aliroot6-o2
383-
```
384-
385-
Keep in mind that:
386-
387-
* aliBuild always tells you what is the package name to load at the end of the build
388-
* you can load the two environments separately, in two different shells, with no chance of a mixup
389-
* you have used the same set of sources for generating two distinct builds
390-
* `alienv enter AliPhysics/latest` will load the _latest you have built_, which can either be the
391-
ROOT 5 or ROOT 6-based version: given its ambiguity, do use explicit names instead
392-
393-
It is also possible to directly run `aliroot` (or any command you want) without "entering" the
394-
environment:
395-
396-
```bash
397-
alienv setenv AliPhysics/latest-aliroot5-user -c aliroot
398-
alienv setenv AliPhysics/latest-aliroot6-o2 -c aliroot
399-
```
400-
401-
The `aliroot` command will be run with the correct environment in both cases.
402-
403-
{% callout "Migrating from ROOT 5 to ROOT 6" %}
404-
While you are at it, if you want to migrate your existing code to ROOT 6 (and make sure it works
405-
there) check out our [migration guide](../analysis/ROOT5-to-6.md).
406-
{% endcallout %}
407-
408-
409-
### Build specific releases (tags) of the software
410-
411-
It might come useful to build a certain tag of AliRoot and AliPhysics instead of simply pulling the
412-
master.
413-
414-
> Note that **we only guarantee that the current AliPhysics master works against the latest AliRoot
415-
> tag!** It is therefore possible (though a rare occurrence) that the current AliRoot master breaks
416-
> the current AliPhysics master.
417-
418-
If you have your source code in "development mode" (_i.e._ downloaded locally by means of `aliBuild
419-
init`), since your AliRoot/AliPhysics/O2 directories [are mere Git
420-
repositories](#software-and-recipes-must-be-updated-manually), you simply need to `cd` into them and
421-
checkout the Git version you want.
422-
423-
For instance, if you want to build AliPhysics against AliRoot v5-09-33, you would need to first
424-
move to the AliRoot directory and check the version out:
425-
426-
```bash
427-
cd ~/alice/AliRoot
428-
git fetch upstream --tags
429-
git checkout v5-09-33
430-
```
431-
432-
Then update your AliPhysics master:
433-
434-
```bash
435-
cd ~/alice/AliPhysics
436-
git checkout master
437-
git pull --rebase upstream master
438-
```
439-
440-
and then build normally using the `aliBuild` command. You might want to build using different `-z`
441-
options [as explained here](#build-the-same-source-multiple-times-with-different-options) in order
442-
to have different builds usable in parallel without duplicating your source code.
443-
444-
## 🧹 Delete obsolete builds
445-
446-
With frequent rebuilding of packages, obsolete builds can pile up and occupy a lot of precious
447-
disk space.
448-
449-
### Basic cleanup
450-
451-
The simplest way to get rid of obsolete builds is to let aliBuild do its best by running:
452-
```bash
453-
aliBuild clean
454-
```
455-
which can take the optional argument `--aggressive-cleanup` that deletes also source code of built
456-
dependency packages and downloaded `.tar.gz` archives.
457-
458-
In general, it's good practice to run `aliBuild clean` always after `aliBuild build`.
459-
460-
This might not be enough, as aliBuild will not delete any build directory pointed to by a symlink
461-
that has "latest" in its name, even when that build is not needed by any other package anymore.
462-
Manual intervention is therefore sometimes needed.
463-
464-
### Deep cleanup
465-
466-
If you want to keep only the latest builds of your development packages (and their dependencies),
467-
you can make aliBuild delete the rest with a little trick.
468-
469-
1. Delete symlinks to all builds:
470-
```bash
471-
find $ALIBUILD_WORK_DIR/$(aliBuild architecture)/ -mindepth 2 -maxdepth 2 -type l -delete
472-
find $ALIBUILD_WORK_DIR/BUILD/ -mindepth 1 -maxdepth 1 -type l -delete
473-
```
474-
In case you specified the architecture manually (using the `-a` option with `aliBuild build`), you should replace `$(aliBuild architecture)` with your manually specified architecture.
475-
1. Recreate symlinks to the latest builds of development packages (and their dependencies)
476-
by running `aliBuild build` for each development package.
477-
1. Let aliBuild delete all the other builds by running `aliBuild clean`.
292+
- Building multiple branches in the same area
293+
- Remove obsolete / unneeded packages
294+
- Limit resource usage
295+
- Cross platforms builds using docker / Apple Container

0 commit comments

Comments
 (0)