Installation

Unfortunately, at this moment you can't get BARS as a binary package. The only way to get it is to build it from the source.

Suppported environments

BARS only supports amd64 architectures running GNU/Linux. There are no plans to support other architectures or operating systems.

Prerequisites

Libraries

BARS installation requires the following to be installed:

Install these as following, before installing CERN ROOT:

CentOS

  yum install bzip2-devel bzip2-libs zlib zlib-devel gsl gsl-devel libgomp

Debian, Ubuntu, Void etc

  apt install libbz2-dev libbz2 zlib1g-dev libgsl123 libgsl-dev libgomp1

ALT Linux

  apt-get install libbz2 zlib zlib-devel libgsl libgsl-devel libgomp libgomp$(gcc --version | grep -o '(GCC) [0-9]' | grep -o [0-9])-devel 

CERN ROOT 6

BARS requires CERN ROOT v6.10.08 or higher. Please follow the basic instructions for Building ROOT to install ROOT in your system. The following cmake line is preferred for a global ROOT installation and includes all the necessary options:

$ cmake .. -DCMAKE_INSTALL_PREFIX=/usr/local/cern-root \
  -Dminimal=ON -Dmathmore=ON -Dcxx11=ON -Dgnuinstall=ON \
  -Dbuiltin_freetype=ON -Dxft=ON -Dtmva=ON -Dx11=ON \
  -Dasimage=ON -Dastiff=ON

Important notes:

Building ROOT on ALT Linux 5

There is a known issue with installing ROOT on ALT Linux 5. Although ALT Linux 5 is not supported, it is still occasionally used, so here's a workaround for a specific configuration

If you follow the installation procedure described above, ROOT compilation will fail due to conflicts between declarations of functions strlcat and strlcpy in /usr/include/string.h ( from gcc) and in strlcpy.h (from ROOT).

The possible solutions are:

  1. In /usr/include/string.h comment out declarations:
    extern size_t strlcat (char *__dst, __const char *__src, size_t __n)
    __THROW __nonnull ((1, 2));
    extern size_t strlcpy (char *__dst, __const char *__src, size_t __n)
    __THROW __nonnull ((1, 2));
  1. Do not include strlcpy.h in Rtypes.h at all:
//#include "strlcpy.h"    // part of string.h on systems that have it

Furthermore:

Getting BARS

Now that all the prerequisites are installed, we can start BARS installation.

BARS source code is stored in the Baikal-GVD GitLab repository. You can get it by cloning via HTTPS:

git clone https://git.jinr.ru/Baikal/bars.git --recursive

or, if you have SSH key:

git clone git@git.jinr.ru:Baikal/bars.git --recursive

As of now, there are no fixed releases or tags. The master branch is expected to work, however.

Building BARS

Once you've cloned BARS, go to its root directory.

cd path/to/bars

Create build directory and go there

mkdir build && cd build

Build makefiles with cmake (on CentOS 7 you might need to use cmake3 instead)

cmake .. -DCMAKE_BUILD_TYPE=Release

If you'd like to use a debugger with BARS, do the following instead:

cmake .. -DCMAKE_BUILD_TYPE=Debug

You can read more about cmake build options here.

Now that your build chain is complete, start compilation.

make -j$(nproc)

Once the compilation is completed, install BARS libraries, dictionaries and headers to their directories:

make install

Setting up environment

BARS requires several environmet variables to be set.

For newer BARS apps to function properly, additional variables are required:

It is recommended to declare these variables in ~/.profile:

export BARSSYS='/path/to/bars/build'
export BARS_DATA_PROCESSED='/mnt/cephfs/'
export BARS_DATA_JOINT='/mnt/cephfs/'
export BARS_DATA_RAW='/mnt/data3/raw_full/'
export BARS_DATA_GEOMETRY='/mnt/cephfs/geometry'
export LD_LIBRARY_PATH=$BARSSYS/lib:$LD_LIBRARY_PATH
export PATH=$BARSSYS/programs/bin:$PATH

You also need to modify .rootrc script in your home directory:

Unix.*.Root.MacroPath: .:$(ROOTSYS)/macros:$(BARSSYS)/macros:

This ensures that BARS logon script will run when ROOT starts up.


CONGRATULATIONS, YOU HAVE COMPLETED THE INSTALLATION