--
AndreaDellAcqua - 2023-02-03
This is a short guide about installation procedures of the
AdePT
software stack. I installed Adept both on
lxplus-gpu.cern.ch and on Riccardo's build machine (
pitt-buildnode-01.cern.ch, ask Riccardo for an account if you wish), with different snags being encountered (lxplus-gpu was basically ready to use, pitt-buildnode-01 just being reconfigured on purpose.
Prerequisites
Two packages must be installed on the machine where one builds
AdePT:
Xerces-C
if Xerces-C is pre-installed on the machine one is using, there is nothing to be done. if Xerces-C is
not installed, the source code can be downloaded from
Apache
. Note that if Xerces-C is not installed in a "standard" directory (e.g. /usr/local) CMake will have to be told where to look for it, e.g.:
-DCMAKE_PREFIX_PATH=“/opt/shibboleth”
Geant4
if Geant4 is installed on the machine one is working on, the only thing to be done is to run the G4 initialisation shell which comes with the G4 installation, e.g.
source <path_to_Geant4_initialization>/bin/geant4.sh
On lxplus-gpu this is
source /cvmfs/geant4.cern.ch/geant4/11.1/x86_64-centos8-gcc11-optdeb/bin/geant4.sh
If Geant4 is not installed, the source code can be downloaded from the
Geant4 web site
and a local installation can be built: the G4 initialisation shell will take care of setting all environment variables accordingly. Please note that, in
any case, GDML must be ON for
AdePT examples to work correctly
cmake -DGEANT4_USE_GDML=ON .
AdePT installation
The instructions one find in the
AdePT GitHub repository are quite good and straight to the point but there may be a few differences here and there, depending on the machine configuration etc.
Cuda
Check where Cuda sits on your machine (e.g. /usr/local/cuda), there can be more than one installation, choose wisely! add Cuda to your PATH/LD_LIBRARY_PATH variables:
export PATH=/usr/local/cuda/bin:${PATH}
export LD_LIBRARY_PATH=/usr/local/cuda/lib64:${LD_LIBRARY_PATH}
note that by prepending the Cuda path you override any other (possible) Cuda installation on your system.
Then check the value of the Cuda architecture. if the Cuda demo suite is installed, this can be done using the deviceQuery utility
/usr/local/cuda/extras/demo_suite/deviceQuery
or, if the demo suite is not installed, by running:
nvidia-smi --query-gpu=compute_cap --format=csv
in the following I will be installing
VecCore,
VecGeom and Adept in the same ./install directory, of course installation can be customised.
mkdir install
Note: you can skip the installation of VecCore
if you need it for VecGeom
only. See the VecGeom
section for details.
Clone the
VecCore
repository and install all header files.
git clone https://github.com/root-project/veccore.git
cd veccore
cmake -S. -B./veccore-build -DCMAKE_INSTALL_PREFIX="../install"
cmake --build ./veccore-build --target install
cd ..
Clone the
VecGeom
repository, build and install libraries
git clone https://gitlab.cern.ch/VecGeom/VecGeom.git
cd VecGeom
cmake -S. -B./vecgeom-build -DCMAKE_INSTALL_PREFIX=../install -DVECGEOM_ENABLE_CUDA=ON -DVECGEOM_GDML=ON -DBACKEND=Scalar -DCMAKE_CUDA_ARCHITECTURES=75 -DVECGEOM_USE_NAVINDEX=ON -DCMAKE_BUILD_TYPE=Release
cmake --build ./vecgeom-build --target install -- -j4
cd ..
NOTE:
If you skipped the installation of
VecCore
at the previous step, you can use the
VECGEOM_BUILTIN_VECCORE
option to get a builtin version of it while building
VecGeom
:
git clone https://gitlab.cern.ch/VecGeom/VecGeom.git
cd VecGeom
cmake -S. -B./vecgeom-build -DCMAKE_INSTALL_PREFIX=../install -DVECGEOM_BUILTIN_VECCORE=ON -DVECGEOM_ENABLE_CUDA=ON -DVECGEOM_GDML=ON -DBACKEND=Scalar -DCMAKE_CUDA_ARCHITECTURES=75 -DVECGEOM_USE_NAVINDEX=ON -DCMAKE_BUILD_TYPE=Release
cmake --build ./vecgeom-build --target install -- -j4
cd ..
Clone the
AdePT repository, fetch the
G4HepEM library component and build everything into the examples
git clone https://github.com/apt-sim/AdePT.git
cd AdePT
don't forget to fetch the
G4HepEM stuff
git submodule update --init
configure and make
Note: Please, be sure to have correctly configured Geant4 in the shell you use to compile AdePT; otherwise, AdePT will be compiled anyway, but without the support for Geant4; also, the examples related to Geant4 (like the Example17 we use in our tests as a starting point) will not be compiled. Look for the CMake output, it should throw a warning when it does not find Geant4.
cmake -S. -B./adept-build -DCMAKE_PREFIX_PATH="../install" -DCMAKE_CUDA_ARCHITECTURES=75 -DCMAKE_BUILD_TYPE=Release
cmake --build ./adept-build -- -j4
Assuming everything was fine to here, examples can be found in
adept-build/BuildProducts/bin
Running example5
cd adept-build
CUDA_VISIBLE_DEVICES=0 BuildProducts/bin/example5
We forked the official
AdePT repository into:
https://github.com/adept-atlas/AdePT
We will use this repo for all our ATLAS-related work.
Adding the new remote to an existing clone
If you already cloned a working copy from the official
AdePT repository and started to modify it, you can push your changes to our repository by adding a new
remote URL:
git remote add atlas git@github.com:adept-atlas/AdePT.git
git remote add atlas https://github.com/adept-atlas/AdePT.git
After having set the new remote, you can push your changes to our ATLAS repository by running:
git add .
git commit -m "my changes"
git push atlas master # change 'master' to push to another branch
You can also set the 'atlas' fork as the default repository for your working copy. You can do that by running:
git branch -u atlas/master
After that, you can omit the 'atlas' repository when you want to pull changes from our fork. You only need to run:
git pull