Release setup and compiling your package

Last update: 20 Nov 2024 [History] [Edit]

Now that your work area is set up and you have checked out the analysis package, let’s set up the Analysis Release and compile it. We will use AnalysisBase for this part of the tutorial.

dir tutorial/AnalysisTutorial

Use the following commands to set up the analysis release:

setupATLAS
cd build/
asetup AnalysisBase,25.2.29
cmake ../source/
make

Since you have compiled a new package for the first time in your shell, you need to source a script within the build directory to modify your environment correctly to pick up local code:

dir tutorial/AnalysisTutorial/build

source x86_64*/setup.sh

tip You will also need to call source x86_64*/setup.sh in your build directory on every login (this does not have to be executed in the build directory, but it does have to be sourced every time).

tip If you are working on a Tier 3 system and need to use an AlmaLinux 9 container, don’t forget to use setupATLAS -c el9

tip If you started from a fresh shell and don’t have it in your .bashrc file, don’t forget to

export ALRB_TutorialData=/cvmfs/atlas.cern.ch/repo/tutorials/asg/cern-nov2024

tip Note that the setup is virtually the same for AnalysisBase and AthAnalysis (i.e. the standalone vs. the Athena based releases), all you have to do is replace AnalysisBase with AthAnalysis. Indeed a lot of this tutorial can be equally applied to either AnalysisBase or AthAnalysis. If you follow the Athena path within the tutorial the above line should be:

asetup AthAnalysis,25.2.29

This tutorial works equally well for both AnalysisBase and AthAnalysis, but to keep things simple you should pick one of them to work through the tutorial. Experience shows that it is very easy to confuse yourself otherwise. You are more than welcome to come back later on and try the tutorial with the other release series, but if you do, do so in a fresh shell (i.e. log in again) and with a new build directory (either remove the old one or create a new one under a different name).

If you are doing this for the first time and as part of the tutorial week you are strongly encouraged to do this tutorial with the AnalysisBase release. Alternative methods will be given for AthAnalysis where the two releases differ.

Recompiling

Note that the above instructions are also what you need to do to recompile.

dir tutorial/AnalysisTutorial/run

We will repeat those instructions a lot:

cd ../build/
make

Or alternatively you can also use the --build option of cmake:

cmake --build ../build/

This will internally go to the build directory and call make there.

warning Sometimes we tell you to run cmake explicitly (typically because we added files or packages). In that case you really have to go to the build directory and call cmake. Calling cmake --build will sometimes not be sufficient.

Warning Whenever you create a new package, you need to have cmake pick it up with:

cd ../build/
cmake ../source/
make

and then call source build/x86_64*/setup.sh. Note that this will only work after the release has been set up.