Skip to content

key4hep/k4-project-template

Repository files navigation

k4-project-template

This repository can be a starting point and template for projects using the Key4hep software stack, in particular those writing Gaudi algorithms.

Dependencies

  • ROOT

  • PODIO

  • Gaudi

  • k4FWCore

Installation

Run, from the k4-project-template directory:

source /cvmfs/sw.hsf.org/key4hep/setup.sh
k4_local_repo
mkdir build
cd build
cmake .. -DCMAKE_INSTALL_PREFIX=../install -G Ninja
ninja install

Alternatively you can source the nightlies instead of the releases:

source /cvmfs/sw-nightlies.hsf.org/key4hep/setup.sh

Note that if you source the releases and use the current version of this repository this is not guaranteed to work as there could be changes since this repository was built for the release. What you can do in this case is to checkout a previous tag, for example:

git checkout v0.3.0

This is because the releases are only built with tagged versions of the packages. With the nightlies this repository should always work; if it doesn't please open an issue.

Execute Examples

Make sure that ../install/lib and ../install/python are in LD_LIBRARY_PATH and PYTHONPATH respectively (k4_local_repo should take care of this). If they are not, they can be added by running:

export LD_LIBRARY_PATH=$PWD/../install/lib:$LD_LIBRARY_PATH
export PYTHONPATH=$PWD/../install/python:$PYTHONPATH

and then run the examples like this:

k4run ../k4ProjectTemplate/options/createHelloWorld.py
k4run ../k4ProjectTemplate/options/createExampleEventData.py

References:

These could perhaps be usefule for newcomers.

  1. lhcb-98-064 COMP
  2. Hello World in the Gaudi Framework