Software Installation

1st experiment of the NICA project

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 fair_install.sh script (root-rights are required) as follows:

wget https://bmn.jinr.ru/plug/fair_install.sh
chmod +x fair_install.sh
./fair_install.sh [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 ncurses-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 protobuf-compiler-grpc

Note that the current software packages requires GCC 7.2.1+, CMake 3.16.1+ and PostgreSQL client 10+ (you can check it by gcc -v, cmake --version and psql --version commands).

If your operating system does not meet the requirements, install the latest version of GCC, CMake, PostgreSQL client 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 install new PostgreSQL client versions. you can run (e.g. for version 14) sudo yum install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm; sudo yum install -y postgresql14-devel. 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
    cd $INSTALLATION_PATH
    
  2. Install the FairSoft package
    The January 2024 p3 release of FairSoft (with ROOT 6.30/08) can be downloaded from GitHub:

    git clone https://github.com/FairRootGroup/FairSoft.git fairsoft
    cd fairsoft
    git checkout jan24p3
    

    Apply patch to correct some issues:

    wget https://bmn.jinr.ru/plug/fairsoft_jan24p3.patch
    patch -p1 -i fairsoft_jan24p3.patch
    

    Installing FairSoft (-j option is used to parallel with multi-cores):

    cmake -B build -DCMAKE_INSTALL_PREFIX=install -DCMAKE_BUILD_TYPE=RelWithDebInfo -DGEANT4MT=OFF
    cmake --build build -j4
    
  3. Install the FairRoot environment
    The release of FairRoot (18.8.1) can be downloaded from GitHub:

    cd $INSTALLATION_PATH
    export SIMPATH=$INSTALLATION_PATH/fairsoft/install
    export PATH=$SIMPATH/bin:$PATH
    git clone https://github.com/FairRootGroup/FairRoot.git fairroot
    cd fairroot
    git checkout v18.8.1
    

    Apply patch to correct some issues:

    wget https://bmn.jinr.ru/plug/fairroot_18_81.patch
    patch -p1 -i fairroot_18_81.patch
    

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

    mkdir build
    cd build
    cmake -DCMAKE_INSTALL_PREFIX="$INSTALLATION_PATH/fairroot/install" -DBUILD_EXAMPLES=OFF ..
    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 https://git.jinr.ru/nica/bmnroot.git
      
    • Clone GIT repository of the last developer BmnRoot version with SSH (for developers)
      Register on JINR GitLab with @jinr.ru mail. Add SSH key (readme) to your profile to not enter the password every time you access.

      git clone -b dev --recursive git@git.jinr.ru:nica/bmnroot.git
      
  3. Installation procedure for BmnRoot:

    • Set environment:
      cd bmnroot
      mkdir build
      . SetEnv.sh
      

      NOTE: By default, in the SetEnv.sh 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 ..
      make -j4
      . config.sh
      
    • Run ". config.sh" 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

install_bmn_container.sh 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 install_bmn_container.sh --os=almalinux --cvmfs

Start Guide

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

git clone https://git.jinr.ru/nica/bmndist.git bmn-docker
cd bmn-docker/images/bmn/
source install_bmn_container.sh     # 'sudo' rights will be requested if some necessary packages are missing

2. Run the BmnRoot container

bmn_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)

rebuild_bmn_container

Leave a Reply