KaliVeda
Toolkit for HIC analysis
Appendix: KaliVeda build system

The build system uses CMake. The CMakeLists.txt file in the top level source directory handles the building and/or installation of:

  • each subproject source directory in src/ (e.g. core/, indra/, ...) and the associated libraries;
  • any required third-party libraries in external/ or extras/;
  • the stand-alone executables in the execs/ directory;
  • the configuration files for the different libraries (top-level config/etc/ directory and etc/ directory in each subproject
  • any datasets which have been downloaded in the datasets/ directory;

Only out-of-source builds are supported. Specific CMake modules used to build KaliVeda, find other packages, etc. etc., are in the cmake/ directory. Various tools for developers are in the extras/tools/ directory.

Top-level cmake options

The list of options which can be used to configure the build are given here, with their default values in brackets. Example of use:

$ cmake [..] -D[option1]=[YES|NO] -D[option2]=[ON|OFF] [...]
Option Default Meaning
Option Default Meaning
-----— ------— ------—
WITH_INDRA_DATASETS OFF download & install datasets for INDRA experiments
WITH_FAZIA_DATASETS OFF download & install datasets for FAZIA experiments
WITH_INDRA_FAZIA_DATASETS OFF download & install datasets for INDRA-FAZIA experiments
WITH_ALL_DATASETS OFF download & install all datasets listed above
USE_GEMINI OFF build KVGemini interface to built-in Gemini++ statistical decay code
USE_MFM OFF use library for reading GANIL acquisition data in MFM format
USE_PROTOBUF OFF use Google protocol buffers e.g. for reading raw FAZIA data
USE_MESYTEC OFF enable support for reading (INDRA) data from Mesytec DAQ electronics
USE_FITLTG OFF build Tassan-Got package for fitting identification grids (see KVTGID)
USE_MICROSTAT OFF build libraries for generation of events with different statistical weights
see MicroStat Package
USE_BUILTIN_GRU OFF build own library for reading legacy GANIL acquisition data (not MFM format)
ENABLE_ALL_OPTIONS OFF enable all USE_* options listed above
USE_SQLITE ON enable SQLite database interface KVSQLite, if SQLite3 available
CCIN2P3_BUILD OFF configure build for IN2P3 Computing Centre environment
ONLINE_TOOLS OFF build & install tools used during experiment data taking
Warning
Contrary to previous versions (<1.14) of KaliVeda, the files required to handle different datasets from INDRA, FAZIA or INDRA-FAZIA experiments (which includes just being able to build the multidetector array(s) used in each case) are not installed by default. Only experiments for which the corresponding WITH_*_DATASETS=ON build option (see above) is given will be installed.

All options are handled by the cmake/HandleBuildOptions.cmake module, which sets the value of variables

set(WITH_[option] yes)

which are visible in all subprojects, and can be used to control what gets built. These variables are used to set preprocessor directives in the KVConfig.h header file (see Useful C++ Pre-processor Symbols), such as

#define WITH_[option]

which can be used in any C/C++ source with #include "KVConfig.h".

Building subprojects

The subprojects (src/core, src/indra, etc.) are each in a subdirectory of the main project. The build system for each is the same. In the top-level CMakeLists.txt file for each subproject is a call to the function

#---BUILD_KALIVEDA_SUBPROJECT(
# [LIB_COMPONENT_NAME comp]
# [INSTALL_EXTRAS [yes|no]]
# [MODULE_LIST dir1 dir2 ...]
# [IGNORE_DIRS dir1 dir2 ...]
# [DEPENDENCIES lib1 lib2 ...]
# )
#
#---Called by top-level CMakeLists.txt in a KaliVeda subproject i.e. src/core, src/indra, ...
#---
#---LIB_COMPONENT_NAME [optional]:
#--- shared library generated for subproject will be libkaliveda-[LIB_COMPONENT_NAME].so
#--- associated (exported) target will be kaliveda::[LIB_COMPONENT_NAME]
#--- * if not given, generate library libkaliveda.so
#--- * associated target will be kaliveda::kaliveda
#---
#---MODULE_LIST [optional]:
#--- if given, list of subdirectories to include in library
#--- if not, all subdirectories with a CMakeLists.txt file will be included, except for IGNORE_DIRS
#---
#---INSTALL_EXTRAS [optional]:
# if given and 'yes|true|on', install special directories:
# etc/ : any *.rootrc files in etc/ are installed with all other configuration files
# in ${CMAKE_INSTALL_SYSCONFROOTDIR}
# data/ : everything in data/ is installed in ${CMAKE_INSTALL_DATADIR}
# examples/ : example classes & other code in examples/ is installed in
# ${CMAKE_INSTALL_TUTDIR}/${KVSUBPROJECT}
# factory/ : template files for plugin classes in factory/ are installed in ${CMAKE_INSTALL_TMPLDIR}
#
#---IGNORE_DIRS [optional]: subdirectories to ignore
#
#---DEPENDENCIES [optional}: libraries on which all modules depend

which is defined in cmake/KaliVedaMacros.cmake.

Subproject modules

Each module subdirectory contains:

  • class source code (.h and .cpp files);
  • LinkDef.h file for dictionary generation
  • CMakeLists.txt file for the module

The CMakeLists.txt file contains a call to the function

#---BUILD_KALIVEDA_MODULE(kvmod [KVMOD_DEPENDS kvmod1 kvmod2...] [EXTRA_LIBS lib1 lib2...]
# [DICT_EXCLUDE toto.h titi.h ...] [LIB_EXCLUDE Class1 Class2...])
# [TARGET_COMPILE_DEFINITIONS toto titi=1 ...])
#
#---Build the current module, 'kvmod', i.e. a subdirectory in src/core/, src/indra/, etc.
# KVMOD_DEPENDS = list of modules belonging to the same library/lib_component that this module depends on
# i.e. they must & will be built first
# EXTRA_LIBS = extra libraries/targets this module depends on
# - Further dependencies may have been set (by BUILD_KALIVEDA_SUBPROJECT(...DEPENDENCIES...))
# - in the variable ${kvmod}_dependencies
#
# INCLUDE_DIRECTORY:
# Give this argument if the header files for the module are in a subdirectory
# These headers will be installed in ${CMAKE_INSTALL_PKGINCDIR}/INCLUDE_DIRECTORY
#
# TARGET_COMPILE_DEFINITIONS:
# - define the corresponding C/C++ symbols, to use in code as '#ifdef toto ... #endif'
#
# To exclude some headers from dictionary generation: DICT_EXCLUDE toto.h titi.h ...
# To exclude some classes from shared library: LIB_EXCLUDE Class1 Class2 ...
#

which is defined in cmake/KaliVedaMacros.cmake

Library targets

Subproject Target Exported target Library
src/core kaliveda kaliveda::kaliveda libkaliveda.so
src/indra kaliveda-indra kaliveda::kaliveda-indra libkaliveda-indra.so
src/fazia kaliveda-fazia kaliveda::kaliveda-fazia libkaliveda-fazia.so
src/indrafazia kaliveda-indrafazia kaliveda::kaliveda-indrafazia libkaliveda-indrafazia.so

Installation layout

Installation directories are defined in the cmake/KaliVedaInstallDirs.cmake module. The default layout for the installation is

bin/
include/
  kaliveda/
lib/
  kaliveda/
  cmake/
share/
  doc/
    kaliveda/
  examples/
    core/
    ...
  kaliveda/
    data/
    etc/
    templates/
    [dataset1]/
    [dataset2]/
...
  man/
    man1/

This allows to install KaliVeda inside system directories, e.g. /usr/local, as any files generated during use of KaliVeda are written in a user-specific "working directory" which by default is created in $HOME/.kaliveda.