-
Notifications
You must be signed in to change notification settings - Fork 17
Installation
We maintain a docker image that packages all of ATTPCROOT's dependencies. It can be found here.
Assuming you have Docker installed (and an working X11 server running) you can quickly compile and run the code:
- Allow the docker container to access your X11 server
xhost +local:docker
- Launch a docker container based on the image.
docker run -it \
-e DISPLAY=$DISPLAY \
-v /tmp/.X11-unix:/tmp/.X11-unix \
--platform linux/amd64 --rm \
--name attpcroot anthoak13/attpcroot-deps
- The
-e
flag sets yourDISPLAY
environment variable for X11 forwarding. - The
-v
flag mounts the X11 socket. -
--name
gives your container a human-readable name (attpcroot
in this case) -
anthoak13/attpcroot-deps
is the name of the image (which will be automatically downloaded if you have not pulled it already).
- From within the image, clone and build ATTPCROOT
git clone https://github.com/ATTPC/ATTPCROOTv2.git
cd ATTPCROOTv2
mkdir build && cd build
cmake ..
make -j8
source config.sh
- Run test scripts (from the main repository directory)
cd macros/tests
./generateGeometry.sh
cd AT-TPC
root -l -q run_unpack_attpc.C
root -l run_eve.C
The ATTPCROOT code depends on the following external packages, with tested version numbers:
- Required dependencies
- Compiler with support for C++14 standard (gcc 9+, <8 is not supported)
- CMake 3.15 or higher
- Xerces (3.2.3)
- FairSoft (nov 22 patches)
- FairRoot (18.8)
- HDF5 (1.10.4)
- For developers
- clang-format for code "cleaning"
- Optional dependencies
- GenFit
- HiRAEVT
- For developers
- IWYU for static analysis
- clang-tidy for code "linking"
ROOT and FairROOT are already installed on the system. As of 1/14/2021 the IT department has decided they no longer want to maintain the installation, the the process has changed. The perquisites for installation can now bew found in the directory /mnt/simulation/attpcroot/fair_install_18.6/
. It is recommended to use the env_fishtank.sh
script to set the required modules and environment variables that used to be handled just through the fishtank module system.
If you are going to be developing with the code read Preparing the environment and setup your repository like it describes. Otherwise you can clone the main repository.
After cloning the repo:
cd ATTPCROOTv2
source env_fishtank.sh
mkdir build
cd build
cmake -DCMAKE_PREFIX_PATH=/mnt/simulations/attpcroot/fair_install_18.6/ ../
make install -j 4
source config.sh
You can change the install path in the normal CMake way by running:
cmake -DCMAKE_PREFIX_PATH=/mnt/simulations/attpcroot/fair_install_18.6/ -DCMAKE_INSTALL_PATH=pathToInstall ../
make install -j 4
Here are the instructions for a minimally working build on Ubuntu 22.04 LTS. WIP
Create a directory where all of the dependencies will be installed. We will use ~/fair_install
. Install cmake.
mkdir ~/fair_install
sudo apt install cmake
Clone the FairSoft repository and run the setup Ubuntu script.
cd ~/fair_install
git clone -b nov22_patches https://github.com/FairRootGroup/FairSoft
cd FairSoft
sudo ./legacy/setup-ubuntu.sh
mkdir build
If desired modify the install directory. In this case we will modify the install directory as followed in the FairSoftConfig.cmake:
set(CMAKE_INSTALL_PREFIX "~/fair_install/FairSoftInstall" CACHE PATH "Install prefix" FORCE)
You can also change the installation directory on the command line when configuring cmake by setting the DCMAKE_INSTALL_PREFIX
variable.
Then configure CMake, build, and export the required environment variable SIMPATH
.
cmake -S ./ -B ./build/ -C ./FairSoftConfig.cmake
cmake --build ./build/ -j 8
export SIMPATH=~/fair_install/FairSoftInstall
cd ~/fair_install
git clone -b dev https://github.com/FairRootGroup/FairRoot.git
cd FairRoot
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX=~/fair_install/FairRootInstall -DBUILD_EXAMPLES=OFF ..
make -j 8
make install
cd ~/fair_install
wget https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-1.10/hdf5-1.10.4/src/hdf5-1.10.4.tar.gz
tar -xvf hdf5-1.10.4.tar.gz
mkdir hdf5-1.10.4/build
cd hdf5-1.10.4/build
cmake -DCMAKE_INSTALL_PREFIX=~/fair_install/hdf5 ..
make -j8 && make install
To then let cmake find the right version of HDF5, in the ATTPCROOT build folder run
cmake -DCMAKE_PREFIX_PATH=~/fair_install ..
where the file path should be the parent folder containing the hdf5 install folder.
Copied below are the instructions for building and installing the perquisites on FRIB fishtank. Hopefully they will be of use installing the software on other systems:
We will be following a modified version of the FairSoft installation directions here.
Step 1 is to install the dependencies. FairSoft provides macros for those with sudo privileges. On fishtank without root access you must do:
module purge
module load gnu/gcc/9.3
module load xerces/3.2.3
export XercesC_ROOT=/mnt/misc/sw/x86_64/Debian/10/xerces/3.2.3/
Follow the directions in step 2 to clone FairSoft for the release apr21_patches. Something like:
git clone -b apr21_patches https://github.com/FairRootGroup/FairSoft
Before configuring the installation in step 3 you will probably have to bootstrap cmake to get the correct version. You will also want to set the installation path by editing the file FairSoftConfig.cmake.
After configuring FairSoft but before building we are going to make some tweaks to the root configuration. We are going to enable fftw3. In the file <buildDir>/Stamp/root/root-configure-RelWithDebInfo.cmake
edit the line that sets the command, adding the following option -Dbuiltin_fftw3=ON;
. You may also want to disable XRootD by changing the parameter -Dxrootd=ON
to -Dxrootd=OFF
.
Now we can execute the build step (step 4 in the FairSoft documentation).
If it fails when it gets to installing root, because it can't build XROOTD or some other component, you can enable/disbale components by editing both the CMakeCache.txt
for root and the root-configure-RelWithDebInfo.cmake
. For example to disable xrootd and enable fftw3 if it wasn't done before, we would modify cmake cache file for root, found at Build/root/CMakeCache.txt by changing the lines:
-
xrootd:BOOL=ON
toxrootd:BOOL=OFF
-
builtin_xrootd:BOOL=ON
tobuiltin_xrootd:BOOL=OFF
-
builtin_fftw3:BOOL=OFF
tobuiltin_fftw3:BOOL=ON
-
fftw3:BOOL=OFF
tofftw3:BOOL=ON
As well as make the changes to the configure script specified above in-between steps 3 and 4.
Modified directions from https://github.com/FairRootGroup/FairRoot
export SIMPATH=FairSoftInstallDirectory
- Clone the FairRoot repository
git clone -b v18.6_patches https://github.com/FairRootGroup/FairRoot.git
- Create the build directory
mkdir /mnt/analysis/e12014/fair_install/FairRoot/
- Run cmake in the build directory
cmake -DCMAKE_INSTALL_PREFIX=/mnt/simulations/attpcroot/fair_install_18.6/FairRoot /mnt/simulations/attpcroot/fair_install_18.6/src/FairRoot/
- Build and install the code in the build directory
make
make install
- Grab source code
wget https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-1.10/hdf5-1.10.4/src/hdf5-1.10.4.tar.gz
- Untar source
tar -xvf hdf5-1.10.4.tar.gz
- Make build directory
mkdir /mnt/analysis/e12014/fair_install/hdf5
- Run cmake
cmake -DCMAKE_INSTALL_PREFIX=/mnt/simulations/attpcroot/fair_install_18.6/hdf5 /mnt/simulations/attpcroot/fair_install_18.6/src/hdf5-1.10.4
- Make and install
make && make install
- Get the source
git clone https://github.com/Yassid/GenFit.git
- Make build directory
mkdir /mnt/analysis/e12014/fair_install/genfit
- Run cmake from build directory, making sure it can find our version of root
cmake -DCMAKE_INSTALL_PREFIX=/mnt/simulations/attpcroot/fair_install_18.6/GenFit -DCMAKE_PREFIX_PATH=/mnt/simulations/attpcroot/fair_install_18.6/FairSoft/ -DBUILD_TESTING=OFF /mnt/simulations/attpcroot/fair_install_18.6/src/GenFit/
- Build and install
make
andmake install
- Get the source
git clone https://github.com/nscl-hira/HiRAEVT.git
- Create build directory
mkdir /mnt/analysis/e12014/fair_install/HiRAEVT
- Run cmake in build directory, disabling unpacking modules
cmake -DCMAKE_INSTALL_PREFIX=/mnt/simulations/attpcroot/fair_install_18.6/HiRAEVT -DCMAKE_PREFIX_PATH=/mnt/simulations/attpcroot/fair_install_18.6/FairSoft/ -DBUILD_UNPACKERS=OFF /mnt/simulations/attpcroot/fair_install_18.6/src/HiRAEVT/
- Build and install
make
andmake install
- Grab the source
wget https://github.com/flann-lib/flann/archive/refs/tags/1.9.1.tar.gz
- Unpack the source
tar -xzf 1.9.1.tar.gz
- Create a build directory
mkdir /mnt/analysis/e12014/fair_install/flann/
- Modify flann per issue #369 to build with newer versions of cmake:
touch src/cpp/empty.cpp
sed -e '/add_library(flann_cpp SHARED/ s/""/empty.cpp/' \
-e '/add_library(flann SHARED/ s/""/empty.cpp/' \
-i src/cpp/CMakeLists.txt
- In the build directory, run cmake
cmake -DCMAKE_INSTALL_PREFIX=/mnt/simulations/attpcroot/fair_install_18.6/flann /mnt/simulations/attpcroot/fair_install_18.6/src/flann
-
make && make install
(might yell about pyFlann but idc)
- Grab the source
wget https://gitlab.com/libeigen/eigen/-/archive/3.3.9/eigen-3.3.9.tar.gz
- Untar file
tar -xzf eigen-3.3.9.tar.gz
- Make build directory
mkdir /mnt/analysis/e12014/fair_install/eigen3
cmake -DCMAKE_INSTALL_PREFIX=/mnt/simulations/attpcroot/fair_install_18.6/eigen /mnt/simulations/attpcroot/fair_install_18.6/src/eigen-3.3.9/
- Install
make install
- Make sure FLANN, and Eigen are all installed
- Grab the source code
https://github.com/PointCloudLibrary/pcl/archive/refs/tags/pcl-1.10.1.tar.gz
- Untar source
tar -xvf pcl-1.10.1.tar.gz
- Create build directory
mkdir /mnt/analysis/e12014/fair_install/pcl
- In build directory, run cmake set to use the boost libraries from fairsoft
cmake -DCMAKE_INSTALL_PREFIX=/mnt/simulations/attpcroot/fair_install_18.6/pcl -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=/mnt/simulations/attpcroot/fair_install_18.6/flann -DBOOST_INCLUDEDIR=/mnt/simulations/attpcroot/fair_install_18.6/FairSoft/include -DBOOST_LIBRARYDIR=/mnt/simulations/attpcroot/fair_install_18.6/FairSoft/lib/ -DBoost_NO_SYSTEM_PATHS=ON /mnt/simulations/attpcroot/fair_install_18.6/src/pcl-pcl-1.10.1/
- Build and install the code
make
andmake install