Skip to content
Adam Anthony edited this page Jun 21, 2024 · 17 revisions

Installation instructions

Quickstart (with Docker)

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:

  1. Allow the docker container to access your X11 server
xhost +local:docker 
  1. 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 your DISPLAY 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).
  1. 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
  1. 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

Dependencies

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
  • Optional dependencies

Installation on FRIB cluster

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

Installation on other systems

Here are the instructions for a minimally working build on Ubuntu 22.04 LTS. WIP

Prerequisites

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

FairSoft

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

FairRoot

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

HDF5

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.

Installation on other systems (deprecated)

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:

FairSoft

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:

  1. xrootd:BOOL=ON to xrootd:BOOL=OFF
  2. builtin_xrootd:BOOL=ON to builtin_xrootd:BOOL=OFF
  3. builtin_fftw3:BOOL=OFF to builtin_fftw3:BOOL=ON
  4. fftw3:BOOL=OFF to fftw3:BOOL=ON

As well as make the changes to the configure script specified above in-between steps 3 and 4.

FairRoot 18.6.5

Modified directions from https://github.com/FairRootGroup/FairRoot

  1. export SIMPATH=FairSoftInstallDirectory
  2. Clone the FairRoot repository git clone -b v18.6_patches https://github.com/FairRootGroup/FairRoot.git
  3. Create the build directory mkdir /mnt/analysis/e12014/fair_install/FairRoot/
  4. 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/
  5. Build and install the code in the build directory make make install

HDF5 1.10.4

  1. 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
  2. Untar source tar -xvf hdf5-1.10.4.tar.gz
  3. Make build directory mkdir /mnt/analysis/e12014/fair_install/hdf5
  4. 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
  5. Make and install make && make install

GenFit (Optional dependency)

  1. Get the source git clone https://github.com/Yassid/GenFit.git
  2. Make build directory mkdir /mnt/analysis/e12014/fair_install/genfit
  3. 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/
  1. Build and install make and make install

HiRAEVT (Optional dependency)

  1. Get the source git clone https://github.com/nscl-hira/HiRAEVT.git
  2. Create build directory mkdir /mnt/analysis/e12014/fair_install/HiRAEVT
  3. 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/
  1. Build and install make and make install

FLANN 1.9.1 (Required for PCL)

  1. Grab the source wget https://github.com/flann-lib/flann/archive/refs/tags/1.9.1.tar.gz
  2. Unpack the source tar -xzf 1.9.1.tar.gz
  3. Create a build directory mkdir /mnt/analysis/e12014/fair_install/flann/
  4. 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
  1. 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
  2. make && make install (might yell about pyFlann but idc)

Eigen3 (Required for PCL)

  1. Grab the source wget https://gitlab.com/libeigen/eigen/-/archive/3.3.9/eigen-3.3.9.tar.gz
  2. Untar file tar -xzf eigen-3.3.9.tar.gz
  3. Make build directory mkdir /mnt/analysis/e12014/fair_install/eigen3
  4. cmake -DCMAKE_INSTALL_PREFIX=/mnt/simulations/attpcroot/fair_install_18.6/eigen /mnt/simulations/attpcroot/fair_install_18.6/src/eigen-3.3.9/
  5. Install make install

PCL 1.10.1 (Optional dependency)

  1. Make sure FLANN, and Eigen are all installed
  2. Grab the source code https://github.com/PointCloudLibrary/pcl/archive/refs/tags/pcl-1.10.1.tar.gz
  3. Untar source tar -xvf pcl-1.10.1.tar.gz
  4. Create build directory mkdir /mnt/analysis/e12014/fair_install/pcl
  5. 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/
  1. Build and install the code make and make install