Skip to content

WIP: CMake modernization

Thomas Cluzel requested to merge tcluzel/Gaudi:cmake-modernisation into master

CMake modernization

See on JIRA.

Goal

Modernize the CMake of Gaudi to speed up the configuration of the project.

What needs to be done before merging?

  • Ask someone from ATLAS if share/PartPropSvc.py and share/PDGTABLE* still need to be installed
  • LHCb needs to be able to use the new configuration of Gaudi

How to compile? The new way with modern CMake

Set up the build environment (platform)

hpx_source /cvmfs/lhcb.cern.ch/lib/etc/cern_profile.sh
source /cvmfs/sft.cern.ch/lcg/views/LCG_96/x86_64-centos7-gcc8-opt/setup.sh
export CMAKE_PREFIX_PATH="$CMAKE_PREFIX_PATH:/cvmfs/sft.cern.ch/lcg/releases/LCG_95/vectorclass/1.30/x86_64-centos7-gcc8-opt/"
export CMAKE_PREFIX_PATH="$CMAKE_PREFIX_PATH:/cvmfs/projects.cern.ch/intelsw/psxe/linux/x86_64/2019/vtune_amplifier" # optional
lb-set-platform x86_64-centos7-gcc8-opt

You need at least cmake 3.15 to be able to configure Gaudi. If needed do the following:

export PATH="/cvmfs/lhcb.cern.ch/lib/contrib/CMake/3.15.2/Linux-x86_64/bin:$PATH"
cmake --version

If you do not feel like sourcing a view, you may use a toolchain but be aware that toolchains inside Gaudi are not meant to stay here, they are examples. ln -s cmake/toolchains/x86_64-centos7-gcc8-opt.cmake toolchain.cmake

Compilation

git clone ...
cd ...
# Configure
cmake -S . -B build.$BINARY_TAG [-D CMAKE_TOOLCHAIN_FILE=toolchain.cmake]
# Build
cmake --build build.$BINARY_TAG -j `nproc`
# Run the tests
cmake --build build.$BINARY_TAG -t test
# Package Gaudi
cmake --build build.$BINARY_TAG -t package

# Or

git clone ... ; cd ...
make
make test
make package

Every optional dependency of Gaudi (namely AIDA XercesC CLHEP HepPDT CppUnit unwind gperftools Doxygen IntelAmplifier jemalloc) can be disabled at configure time by passing -DGAUDI_USE_<DEPENDENCY>=OFF to cmake.

More information

Developer's guide

Maintainer's guide


Thomas Cluzel thomas.cluzel@cern.ch

Edited by Marco Clemencic

Merge request reports

Loading