Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 3 additions & 10 deletions .github/workflows/edm4eic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,18 +41,11 @@ jobs:
run: |
STARTDIR=$(pwd)
echo "::group::Build podio"
cmake -B ${STARTDIR}/podio/build -S ${STARTDIR}/podio \
cmake -S ${STARTDIR}/podio \
--preset ci-build \
-DCMAKE_INSTALL_PREFIX=${STARTDIR}/podio/install \
-DCMAKE_CXX_STANDARD=20 \
-DCMAKE_CXX_FLAGS=" -fdiagnostics-color=always -Werror -Wno-error=deprecated-declarations " \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DUSE_EXTERNAL_CATCH2=ON \
-DENABLE_RNTUPLE=ON \
-DENABLE_DATASOURCE=ON \
-DPODIO_SET_RPATH=ON \
-DBUILD_TESTING=OFF \
-DENABLE_JULIA=OFF \
-G Ninja
-DENABLE_JULIA=OFF
cmake --build ${STARTDIR}/podio/build --target install
cd ${STARTDIR}/podio && source init.sh && source env.sh && cd ${STARTDIR}
echo "::endgroup::"
Expand Down
35 changes: 13 additions & 22 deletions .github/workflows/edm4hep.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,43 +42,34 @@ jobs:
STARTDIR=$(pwd)
echo "::group::Build Catch2"
cd $STARTDIR/catch2
mkdir build && cd build
cmake -DCMAKE_CXX_STANDARD=$([[ ${{ matrix.LCG }} == *-gcc15-* ]] && echo "23" || echo "20") -DCMAKE_INSTALL_PREFIX=../install -G Ninja ..
ninja -k0 install
cmake -B build -S . -DCMAKE_CXX_STANDARD=$([[ ${{ matrix.LCG }} == *-gcc15-* ]] && echo "23" || echo "20") -DCMAKE_INSTALL_PREFIX=$(pwd)/install -G Ninja
cmake --build build --target install
export CMAKE_PREFIX_PATH=$STARTDIR/catch2/install:$CMAKE_PREFIX_PATH
echo "::endgroup::"
echo "::group::Build podio"
cd $STARTDIR/podio
mkdir build && cd build
cmake -DENABLE_SIO=ON \
cmake -S . --preset ci-build \
-DENABLE_JULIA=ON \
-DENABLE_DATASOURCE=ON \
-DENABLE_RNTUPLE=ON \
-DCMAKE_INSTALL_PREFIX=../install \
-DCMAKE_INSTALL_PREFIX=$(pwd)/install \
-DCMAKE_CXX_STANDARD=$([[ ${{ matrix.LCG }} == *-gcc15-* ]] && echo "23" || echo "20") \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_FLAGS=" -fdiagnostics-color=always -Werror -Wno-error=deprecated-declarations " \
-DUSE_EXTERNAL_CATCH2=ON \
-DBUILD_TESTING=ON \
-DPODIO_RUN_STRACE_TEST=ON \
-DPODIO_ENABLE_SCHEMA_EVOLUTION_TESTS=ON \
-G Ninja ..
ninja -k0
-DPODIO_RUN_STRACE_TEST=ON
cmake --build --preset ci-build
echo "::endgroup::"
echo "::group::Test and install podio"
ctest --output-on-failure --schedule-random -j$(nproc) --timeout 600
ninja install
ctest --preset ci-build --parallel
cmake --build --preset ci-build --target install
cd $STARTDIR/podio
source init.sh && source env.sh
echo "::endgroup::"
echo "::group::Build and test EDM4hep"
cd $STARTDIR/edm4hep
mkdir build && cd build
cmake -DCMAKE_CXX_STANDARD=$([[ ${{ matrix.LCG }} == *-gcc15-* ]] && echo "23" || echo "20") \
cmake -B build -S . \
-DCMAKE_CXX_STANDARD=$([[ ${{ matrix.LCG }} == *-gcc15-* ]] && echo "23" || echo "20") \
-DCMAKE_CXX_FLAGS=" -fdiagnostics-color=always " \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DUSE_EXTERNAL_CATCH2=ON \
-G Ninja ..
ninja -k0
ctest --output-on-failure
-G Ninja
cmake --build build -- -k0
ctest --test-dir build --output-on-failure
echo "::endgroup::"
23 changes: 6 additions & 17 deletions .github/workflows/key4hep.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,28 +38,17 @@ jobs:
echo "::group::Run k4_local_repo"
k4_local_repo
echo "::group::Run CMake"
mkdir -p build install
cd build
cmake -DENABLE_SIO=ON \
-DENABLE_JULIA=OFF \
-DCMAKE_INSTALL_PREFIX=../install \
-DCMAKE_CXX_STANDARD=20 \
-DCMAKE_CXX_FLAGS=" -fdiagnostics-color=always -Werror -Wno-error=deprecated-declarations " \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
cmake --preset ci-build \
-DCMAKE_INSTALL_PREFIX=$(pwd)/install \
-DUSE_EXTERNAL_CATCH2=AUTO \
-DENABLE_RNTUPLE=ON \
-DENABLE_DATASOURCE=ON \
-DPODIO_SET_RPATH=ON \
-DPODIO_RUN_STRACE_TEST=ON \
-DPODIO_ENABLE_SCHEMA_EVOLUTION_TESTS=ON \
-G Ninja ..
-DPODIO_RUN_STRACE_TEST=ON
echo "::endgroup::"
echo "::group::Build"
ninja -k0
cmake --build --preset ci-build
echo "::endgroup"
echo "::group::Run tests"
ctest --output-on-failure --schedule-random -j$(nproc) --timeout 600
ctest --preset ci-build --parallel
echo "::endgroup::"
echo "::group::Install"
ninja install
cmake --build --preset ci-build --target install
echo "::endgroup::"
14 changes: 3 additions & 11 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,11 @@ jobs:
git config --global --add safe.directory $(pwd)
echo "::endgroup::"
echo "::group::Run CMake"
mkdir build
cd build
cmake .. -DENABLE_SIO=ON \
cmake -B build -S . \
--preset ci-build \
-DENABLE_JULIA=ON \
-DENABLE_RNTUPLE=ON \
-DENABLE_DATASOURCE=ON \
-DCMAKE_CXX_STANDARD=20 \
-DCMAKE_CXX_FLAGS=" -fdiagnostics-color=always -Werror "\
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
-DPODIO_ENABLE_SCHEMA_EVOLUTION_TESTS=ON \
-DUSE_EXTERNAL_CATCH2=OFF
ln -s $(pwd)/compile_commands.json ../
cd ..
ln -s build/compile_commands.json compile_commands.json
echo "::endgroup::"
echo "::group::Run pre-commit"
pre-commit run --show-diff-on-failure \
Expand Down
7 changes: 3 additions & 4 deletions .github/workflows/publish-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,9 @@ jobs:
python3 -m pip install -r doc/requirements.txt
export PYTHONPATH=$VIRTUAL_ENV/lib/python3.$(python3 -c 'import sys; print(f"{sys.version_info[1]}")')/site-packages:$PYTHONPATH
echo -e "::endgroup::\n::group::Build podio"
cmake -B build . --install-prefix=$(pwd)/install \
-GNinja -DENABLE_SIO=ON -DENABLE_RNTUPLE=ON \
-DENABLE_DATASOURCE=ON -DBUILD_TESTING=OFF \
-DCMAKE_CXX_STANDARD=20
cmake -S . --install-prefix=$(pwd)/install \
--preset full-build \
-DBUILD_TESTING=OFF
cmake --build build --target install
source ./init.sh && source ./env.sh
echo -e "::endgroup::\n::group::build doc"
Expand Down
20 changes: 6 additions & 14 deletions .github/workflows/sanitizers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,23 +41,15 @@ jobs:
ccache-key: ccache-sanitizers-el9-${{ matrix.compiler }}-${{ matrix.sanitizer }}
run: |
echo "::group::Run CMake"
mkdir -p build
cd build
cmake -DCMAKE_BUILD_TYPE=Debug \
cmake -B build -S . \
--preset ci-build \
-DCMAKE_BUILD_TYPE=Debug \
-DUSE_SANITIZER=${{ matrix.sanitizer }} \
-DCMAKE_CXX_STANDARD=$([[ ${{ matrix.compiler }} == gcc15 ]] && echo "23" || echo "20") \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_FLAGS=" -fdiagnostics-color=always " \
-DENABLE_SIO=ON \
-DENABLE_JULIA=OFF \
-DENABLE_RNTUPLE=ON \
-DENABLE_DATASOURCE=ON \
-DPODIO_ENABLE_SCHEMA_EVOLUTION_TESTS=ON \
-G Ninja ..
-DCMAKE_CXX_STANDARD=$([[ ${{ matrix.compiler }} == gcc15 ]] && echo "23" || echo "20")
echo "::endgroup::"
echo "::group::Build"
ninja -k0
cmake --build --preset ci-build
echo "::endgroup::"
echo "::group::Run tests"
ctest --output-on-failure --schedule-random -j$(nproc)
ctest --test-dir build --output-on-failure --schedule-random -j$(nproc)
echo "::endgroup::"
21 changes: 6 additions & 15 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,33 +34,24 @@ jobs:
run: |
echo "::group::Run CMake"
# export JULIA_DEPOT_PATH="$(mktemp -d -p /tmp -t julia_depot_XXXXX):"
mkdir -p build install
cd build
cmake -DENABLE_SIO=ON \
cmake --preset ci-build \
-DENABLE_JULIA=ON \
-DENABLE_RNTUPLE=$([[ ${{ matrix.LCG }} == LCG_104/* ]] && echo "OFF" || echo "ON") \
-DENABLE_DATASOURCE=ON \
-DPODIO_RUN_STRACE_TEST=$([[ ${{ matrix.LCG }} == LCG_104/* ]] && echo "OFF" || echo "ON") \
-DCMAKE_INSTALL_PREFIX=../install \
-DCMAKE_CXX_STANDARD=$([[ ${{ matrix.LCG }} == *-gcc15-* ]] && echo "23" || echo "20") \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_FLAGS=" -fdiagnostics-color=always -Werror -Wno-error=deprecated-declarations " \
-DUSE_EXTERNAL_CATCH2=AUTO \
-DPODIO_USE_CLANG_FORMAT=AUTO \
-DPODIO_ENABLE_SCHEMA_EVOLUTION_TESTS=ON \
-G Ninja ..
-DCMAKE_INSTALL_PREFIX=$(pwd)/install \
-DUSE_EXTERNAL_CATCH2=AUTO
echo "::endgroup::"
echo "::group::Build"
ninja -k0
cmake --build --preset ci-build
echo "::endgroup::"
echo "::group::Julia StaticArrays Package Install"
# # Temporary workaround for https://its.cern.ch/jira/browse/SPI-2838
# JULIA_DEPOT_PATH=$(pwd)/.julia julia -e 'import Pkg'
julia -e 'import Pkg; Pkg.add("StaticArrays")'
echo "::endgroup"
echo "::group::Run tests"
ctest --output-on-failure --schedule-random -j$(nproc) --timeout 600
ctest --preset ci-build --parallel
echo "::endgroup::"
echo "::group::Install"
ninja install
cmake --build --preset ci-build --target install
echo "::endgroup::"
19 changes: 5 additions & 14 deletions .github/workflows/ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,31 +30,22 @@ jobs:
ccache-key: ccache-ubuntu-${{ matrix.LCG }}
run: |
echo "::group::Run CMake"
mkdir -p build install
cd build
cmake -DENABLE_SIO=ON \
cmake -S . --preset ci-build \
-DENABLE_JULIA=ON \
-DENABLE_DATASOURCE=ON \
-DCMAKE_INSTALL_PREFIX=../install \
-DCMAKE_CXX_STANDARD=20 \
-DCMAKE_CXX_FLAGS=" -fdiagnostics-color=always -Werror -Wno-error=deprecated-declarations " \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DUSE_EXTERNAL_CATCH2=OFF \
-DPODIO_SET_RPATH=ON \
-DPODIO_RUN_STRACE_TEST=ON \
-DENABLE_RNTUPLE=ON \
-DPODIO_ENABLE_SCHEMA_EVOLUTION_TESTS=ON \
-G Ninja ..
-DPODIO_RUN_STRACE_TEST=ON
echo "::endgroup::"
echo "::group::Build"
ninja -k0
cmake --build --preset ci-build
echo "::endgroup"
echo "::group::Julia StaticArrays Package Install"
julia -e 'import Pkg; Pkg.add("StaticArrays")'
echo "::endgroup"
echo "::group::Run tests"
ctest --output-on-failure --schedule-random -j$(nproc) --timeout 600
ctest --preset ci-build --parallel
echo "::endgroup::"
echo "::group::Install"
ninja install
cmake --build --preset ci-build --target install
echo "::endgroup::"
74 changes: 74 additions & 0 deletions CMakePresets.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
{
"version": 3,
"configurePresets": [
{
"name": "common",
"hidden": true,
"binaryDir": "${sourceDir}/build",
"cacheVariables": {
"CMAKE_EXPORT_COMPILE_COMMANDS": "ON",
"CMAKE_CXX_STANDARD": "20",
"CMAKE_CXX_FLAGS": " -fdiagnostics-color=always ",
"PODIO_USE_CLANG_FORMAT": "OFF",
"PODIO_SET_RPATH": "ON",
"PODIO_ENABLE_SCHEMA_EVOLUTION_TESTS": "OFF"
}
},
{
"name": "base-build",
"displayName": "Base Build including RNTuple backend and DataSource",
"inherits": "common",
"generator": "Ninja",
"cacheVariables": {
"BUILD_TESTING": "ON",
"ENABLE_RNTUPLE": "ON",
"ENABLE_DATASOURCE": "ON",
"CMAKE_CXX_COMPILER_LAUNCHER": "ccache"
}
},
{
"name": "full-build",
"displayName": "Full build including schema evolution tests and SIO",
"inherits": "base-build",
"cacheVariables": {
"ENABLE_SIO": "ON",
"PODIO_ENABLE_SCHEMA_EVOLUTION_TESTS": "ON"
}
},
{
"name": "ci-build",
"displayName": "Full build with warnings as errors",
"inherits": "full-build",
"cacheVariables": {
"CMAKE_CXX_FLAGS": " -fdiagnostics-color=always -Werror -Wno-error=deprecated-declarations",
"PODIO_USE_CLANG_FORMAT": "AUTO"
}
}
],

"buildPresets": [
{
"name": "ci-build",
"displayName": "Building like on CI",
"configurePreset": "ci-build",
"nativeToolOptions": ["-k0"]
}
],

"testPresets": [
{
"name": "ci-build",
"displayName": "Testing like on CI",
"configurePreset": "ci-build",
"execution": {
"stopOnFailure": false,
"scheduleRandom": true,
"timeout": 600
},
"output": {
"outputOnFailure": true
}

}
]
}
37 changes: 28 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,18 +91,37 @@ and `env.sh`.

## Compiling

If you are using the easy setup from `init.sh` then create separate build
and install areas, and trigger the build:
Podio uses CMake presets to simplify the build process. The following presets are available:

mkdir build
mkdir install
cd build
cmake -DCMAKE_INSTALL_PREFIX=../install ..
make -j 4 install
- `base-build`: Base build with RNTuple backend and DataSource support
- `full-build`: Full build including SIO and schema evolution tests
- `ci-build`: Full build with warnings as errors (used for continuous integration)

To see a list of options, do this in the build-directory:
### Basic build

cmake -LH ..
To build podio with the base configuration:

cmake --preset base-build -DCMAKE_INSTALL_PREFIX=install
cmake --build build -j 4
cmake --install build

### Full build

For a complete build with all features:

cmake --preset full-build -DCMAKE_INSTALL_PREFIX=install
cmake --build build -j 4
cmake --install build

### Custom configuration

To see available CMake options:

cmake --preset base-build -LH

You can override preset options by adding `-D` flags:

cmake --preset base-build -DCMAKE_INSTALL_PREFIX=install -DENABLE_SIO=ON

## Running tests

Expand Down