Software Installation

NOTE 1: IF YOU ARE GOING TO USE BMNROOT ON THE CLUSTERS (NICA/ncx farm, CICC/lxui cluster, SC Govorun), please, take into account that the FairSoft and FairRoot packages are installed on all the clusters, so carefully read the corresponding “How to use” manual (“Computing” section) for the NICA Cluster, CICC Complex, HybriLIT platform or BM@N Online Cluster, and then start with “Installing the BmnRoot framework” on the clusters.

NOTE 2: [EXPERIMENTAL] To simplify the installation of the prerequisite libraries and FairSoft+FairRoot packages, you can run script as follows:

chmod +x
./ [FAIR_OUTPUT_DIR] [-o logfile][-i][-f][-c][-v][-h]

where /opt is FAIR_OUTPUT_DIR by default. After successful completion of the script, then continue with “Installing the BmnRoot framework”.

Before installing BmnRoot make sure that the following packages are installed on your system

  • Install packages needed for RedHat-based OS (eg, CentOS, Scientific Linux, AlmaLinux):
    sudo su
    yum install -y epel-release && yum install -y --skip-broken libuuid-devel wget rsync subversion git make cmake gcc-gfortran gcc-c++ binutils patch redhat-lsb-core libbsd-devel libicu-devel libX11-devel libXmu-devel libXpm-devel libXft-devel libXext-devel mesa-libGLU-devel python3-devel libxml2-devel expat-devel zlib-devel postgresql-devel mysql mysql-devel sqlite-devel openssl-devel curl-devel automake libtool readline-devel xerces-c-devel protobuf-devel gsl-devel fftw3-devel && yum --enablerepo=crb install -y protobuf-devel mysql-devel &> /dev/null
  • Install packages needed for Debian-based OS (eg, Ubuntu):
    sudo su
    apt-get -y install uuid-dev wget rsync subversion git make cmake g++ gcc gfortran binutils patch lsb-release libicu-dev libx11-dev libxmu-dev libxpm-dev libxft-dev libxext-dev dpkg-dev xlibmesa-glu-dev libglew-dev python3-dev python-dev-is-python3 libxml2-dev libexpat1-dev zlib1g-dev libpqxx-dev libmysqlclient-dev libsqlite3-dev libssl-dev libcurl4-openssl-dev automake libtool libreadline-dev libxerces-c-dev libgsl-dev libfftw3-dev

Note that the current FairSoft and FairRoot packages requires GCC 7.2.1+ and CMake 3.16.1+ (check it by gcc -v and cmake –version commands).

If your operating system does not meet the requirements, install the latest version of GCC and CMake or auxiliary devtoolset and cmake3 packages. For instance, for CentOS 7 run: sudo yum install -y centos-release-scl cmake3; sudo yum install -y devtoolset-9. To enable the devtoolset, run scl enable devtoolset-9 — bash (every time to use it). To employ cmake3 package, just use cmake3 command instead of the usual cmake command. To update cmake package for an old Ubuntu/Debian system, you can use kitware repository.

Installing the external packages

  1. Set an installation path for the external packages, e.g. /opt
    NOTE: If you are installing FairSoft/FairRoot to a system directory like /opt, then switch to superuser before (“sudo su” command).

    export INSTALLATION_PATH=/opt
  2. Install the FairSoft package
    The April 2022 release of FairSoft can be downloaded from GitHub:

    git clone fairsoft
    cd fairsoft
    git checkout apr22

    Apply patch (to use builtin XRootD and correct some issues):

    patch -p1 -i fairsoft_apr22.patch

    Installing FairSoft (-j is used to parallel with multicores):

    cmake --build build -j4
  3. Install the FairRoot environment
    The release of FairRoot (18.6.8) can be downloaded from GitHub:

    export SIMPATH=$INSTALLATION_PATH/fairsoft/install
    export PATH=$SIMPATH/bin:$PATH
    git clone fairroot
    cd fairroot
    git checkout v18.6.8

    Apply patch (to add a missing dependency):

    patch -p1 -i fairroot_18_68.patch

    Installing FairRoot (-j is used to parallel with multicores):

    mkdir build
    cd build
    cmake -DCMAKE_INSTALL_PREFIX="$INSTALLATION_PATH/fairroot/install" ..
    make -j4
    make install

Installing the BmnRoot framework

  1. Go to the installation directory

    Go to the directory where you want to install the BmnRoot software, e. g. home directory:

    cd ~

    NOTE: If you are installing BmnRoot to a non-system directory like home directory, then do not use ‘root’ superuser.

  2. Clone GIT repository

    • Clone GIT repository of the last developer BmnRoot version with HTTPS (read-only access, e.g. for unregistered users)
      git clone -b dev --recursive
    • Clone GIT repository of the last developer BmnRoot version with SSH (for developers)
      Register on JINR GitLab with mail. Add SSH key (readme) to your profile to not enter the password every time you access.

      git clone -b dev --recursive
  3. Installation procedure for BmnRoot:

    • Set environment:
      cd bmnroot
      mkdir build

      NOTE: By default, in the file SIMPATH points to /opt/fairsoft/install, and FAIRROOTPATH – /opt/fairroot/install directories. If you installed FairSoft or FairRoot to another directory, please, change SIMPATH and FAIRROOTPATH variables in the file (“export SIMPATH=[your FairSoft install path]” and “export FAIRROOTPATH=[your FairRoot install path]”).

    • Build the framework:
      cd build
      cmake ..
    • Run “.” every time you run terminal to work with BmnRoot (or append this line to the .bashrc file).
  4. Update your local branch from origin branch:

    cd bmnroot
    git pull --recurse-submodules   # if your GIT version < 2.14, run 'git pull && git submodule update --init' instead)

Introduction script deploys the BmnRoot container and adds aliases to easy operate. By default, the script bypasses the installation of the apptainer package (used for the container creation) if it is already present on the machine.

Three options provide configuring the installation:
  –force/-f : installs/reinstalls the apptainer package, even if it is already installed (it removes any version of Apptainer or Singularity and installs the Apptainer package)
  –os=containerOS : ubuntu OR almalinux. Allows one to choose an operating system of the BmnRoot container from the set (AlmaLinux 9 chosen by default)
  –cvmfs : deploys BmnRoot container that employs the central CernVM-FS repository with pre-installed FairSoft and FairRoot frameworks instead of their fully-installed versions in containers.
Without –cvmfs option FairSoft, FairRoot and BmnRoot are used from prepared containers, which are deployed on the local machine. It does not require internet connection while working with the BmnRoot container after the installation.
In case of the –cvmfs option the obtained BmnRoot container is more lightweight, uses officially approved central software repository on CVMFS and includes only BmnRoot sources downloaded inside. But it requires stable internet connection to download libraries requested while working to the local cache. In addition, the first launch of the lightweight container is accompanied by the installation of the BmnRoot (takes some time).

Usage example: source –os=almalinux –cvmfs

Start Guide

1. Download and run (git package is required).

git clone docker-images
cd docker-images/images/bmn/
source     # 'sudo' rights will be requested if some necessary packages are missing

2. Run the BmnRoot container


To test the BmnRoot container

root -b -q /bmnroot/macro/run/run_sim_bmn.C
root -b -q /bmnroot/macro/run/run_reco_bmn.C
root /bmnroot/macro/eventdisplay/eventdisplay.C

Rebuild the BmnRoot container if required (all container data will be removed)