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.
- Supported OS: Debian 10
- CentOS 7 and later
- Ubuntu 16.04 and later
- ALT Linux 8.2 and later
Prerequisites
Libraries
BARS installation requires the following to be installed:
- libBz2 and zlib for raw data access.
- GNU scientific library for data processing.
- OpenMP for parallel data processing (optional, but highly recommended)
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:
- Do not install CERN ROOT with a package manager. A prepackaged ROOT distribution is almost guaranteed to be inadequate.
- If you build ROOT with support for C++14 or later, you'll need to alter BARS CMakeFile to support it. If you don't know how to do it, stick to C++11 as in example above.
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
- Linux: 4.4.16-std-def-alt0.M80P.1
- ROOT 6.10/04
- gcc version 5.3.1 20151207 (ALT Linux 5.3.1-alt3) (GCC)
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:
- 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));
- Do not include
strlcpy.h
inRtypes.h
at all:
//#include "strlcpy.h" // part of string.h on systems that have it
Furthermore:
- libpng-devel must be installed. Otherwise, ROOT interpreter crashes after executing
new TBrowser
- old libgsl-devel must be deleted, because of repository gsl version is very old 1.16 (2013). I installed gsl2.4 from source (./configure, make, make install (by superuser) doesnt cause problems). Looking ahead $LD_LIBRARY_PATH must have /usr/local/lib where libgsl installed.
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.
$BARSSYS
should contain path to BARS build directory (e.g./home/user/bars/build
)$LD_LIBRARY_PATH
should include$BARSSYS/lib
$PATH
should include$BARSSYS/programs/bin
and$HOME/.local/bin
For newer BARS apps to function properly, additional variables are required:
$BARS_DATA_PROCESSED
- mountpoint ofcephfs
.$BARS_DATA_JOINT
- mountpoint ofcephfs
.$BARS_DATA_GEOMETRY
- path to thegeometry
directory on cephfs.$BARS_DATA_RAW
- mountpoint of raw telescope output.
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