This C++ version of BAT is still being maintained, but addition of new features is unlikely. Check out our new incarnation, BAT.jl, the Bayesian analysis toolkit in Julia. In addition to Metropolis-Hastings sampling, BAT.jl supports Hamiltonian Monte Carlo (HMC) with automatic differentiation, automatic prior-based parameter space transformations, and much more. See the BAT.jl documentation.
Installation instructions for BAT 0.2.1
You can find here a short description of what to do to be able to compile and use BAT on your computer. In the future a detailed description of the installation procedure should become a part of the manual.
Platforms
BAT has been developed on Linux machines running different distributions and different versions of the kernel and gcc. As far as we know there is nothing distribution dependent inside of BAT. However, we have not yet started to systematically check for compatibility and portability. This is planned for future releases of BAT. For the moment the only statement we can do here is that if you don't have a too old or too specific installation of Linux you should be able to compile and use BAT without problems.
The installation and functionality of BAT has also been tested on MACs.
Windows is not supported for the moment.
Dependencies
ROOT:
ROOT is an object oriented data analysis framework. You can obtain it from http://root.cern.ch/. To compile and run BAT you will need a ROOT version 5.16 or later. Please, check your linux distribution for the availability of precompiled packages on your system. Mostly used distributions nowdays have the ROOT packages available.
Note: To be able to use the interface to RooFit/RooStats the ROOT version 5.22 or later is necessary.
Recommended software
CUBA:
CUBA is a library containing general purpose multidimensional integration algorithms. It can be obtained from http://www.feynarts.de/cuba/. In this version BAT no longer depends on CUBA and you can compile and run without it. However, the use of CUBA is recommended as it provides integration routines tuned for performance, which are very usefull for integration in problems with large number of dimensions.
Note: Since version 1.5 the compilation of Cuba no longer crashes if you don't have Mathematica installed. To compile and install CUBA libraries use commands make lib ; make install.
Installation Procedure
This version of BAT uses autoconf/automake system for building and installation.
Unpack the tarball containing the BAT source usually named like BAT-x.x.tar.gz (here x.x is the version number) using command
tar -xzf BAT-x.x.tar.gz
A directory called BAT-x.x will be created containing the source code. Enter the directory and run the configuration using commands
cd BAT-x.x ./configure
This will check your system for all components needed to compile BAT and set up the paths for installation. You can add option --prefix=/path/to/install/bat to ./configure to specify the the prefix to the BAT installation path. The BAT library files will be installed to $prefix/lib and the include files to $prefix/include . Default installation prefix is /usr/local.
The configure script checks for ROOT availability in the system and fails if ROOT is not installed or not in the path. You can specify the ROOTSYS directory using --with-rootsys=/path/to/rootsys.
The configure will also search for libcuba.a and cuba.h in the system. The libcuba.a has to be available in the standard system library search path. You can specify the cuba.h location using --with-cuba-path=/path/to/cuba/header.
After successful configuration run
make make install
to compile and install BAT.
Note that depending on the setting of installation prefix you might need root priviledges to be able to install BATand run 'sudo make install' instead of plain 'make install'. If you are installing BAT e.g. in your $HOMEDIR, you need to add the path to the library and to the include files to the search path in your system. Depending on your shell you can do that via commands
export BATINSTALLDIR=/bat/install/prefix export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$BATINSTALLDIR/lib export CPATH=$CPATH:$BATINSTALLDIR/include
or
setenv BATINSTALLDIR /bat/install/prefix setenv LD_LIBRARY_PATH $LD_LIBRARY_PATH:$BATINSTALLDIR/lib setenv CPATH $CPATH:$BATINSTALLDIR/include
for bash and csh compatible shells, respectively.
An option for use in compiled programs would also be to add -I/bat/install/include/path to CFLAGS and -L/bat/install/lib/path to LDFLAGS in your Makefile. However, the interactive ROOT macros will not work if libBAT.so and libBAT.rootmap both aren't in the system library search path.