Skip to content

Commit

Permalink
Merge pull request #1386 from KrisThielemans/ROOT_changes
Browse files Browse the repository at this point in the history
update ROOT to v6.28.12 and fix FindCERN_ROOT when root-config is used
KrisThielemans authored Feb 15, 2024
2 parents 37f799f + d27a6f1 commit bc56456
Showing 2 changed files with 54 additions and 42 deletions.
88 changes: 48 additions & 40 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
@@ -259,8 +259,10 @@ jobs:
# Install ROOT (warning: currently only valid on Ubuntu)
if test "${{matrix.ROOT}}XX" == "ONXX"; then
wget https://root.cern/download/root_v6.24.02.Linux-ubuntu20-x86_64-gcc9.3.tar.gz
tar -xzvf root_v6.24.02.Linux-ubuntu20-x86_64-gcc9.3.tar.gz
ROOT_file=root_v6.28.12.Linux-ubuntu20-x86_64-gcc9.4.tar.gz
wget https://root.cern/download/"$ROOT_file"
tar -xzvf "$ROOT_file"
rm "$ROOT_file"
source root/bin/thisroot.sh
fi
@@ -330,6 +332,12 @@ jobs:
source ${GITHUB_WORKSPACE}/my-env/bin/activate
cmake --build . -j 2 --config ${BUILD_TYPE}} --target install
# Enable tmate debugging of manually-triggered workflows if the input option was provided
- name: Setup tmate session if triggered
uses: mxschmitt/action-tmate@v3
timeout-minutes: 15
if: ${{ github.event_name == 'workflow_dispatch' && inputs.debug_enabled == 'true' }}

- name: ctest
shell: bash
env:
@@ -354,6 +362,43 @@ jobs:
# execute tests
ctest --output-on-failure -C ${BUILD_TYPE} ${EXCLUDE}
- name: examples
shell: bash
run: |
set -ex;
PATH=${CMAKE_INSTALL_PREFIX}/bin:$PATH
# Run examples to see if they work
cd ${GITHUB_WORKSPACE}/examples/PET_simulation
./run_simulation.sh 1> /dev/null
# Run the Demo executables
EXE_LOC=${GITHUB_WORKSPACE}/build/src/examples/C++/using_STIR_LOCAL
cd ${GITHUB_WORKSPACE}/examples/C++/using_STIR_LOCAL
generate_image generate_image.par
forward_project sino.hs image.hv small.hs
# Cannot test demo1 or demo2 as they require interactivity. Piping does not work.
${EXE_LOC}/demo3 demo.par --display_off
${EXE_LOC}/demo3 demoPM.par --display_off
${EXE_LOC}/demo4_obj_fun demo4_obj_fun.par
${EXE_LOC}/demo5_line_search demo5_line_search.par
# build and run C++/using_installed_STIR
cd ${GITHUB_WORKSPACE}/examples/C++/using_installed_STIR
cmake -S . -B build/ -DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_INSTALL_PREFIX}
cmake --build build/ --config Release --target install
# run demo
demo_create_image
# just check if its output makes sense
list_image_info test.hv
- name: remove build
shell: bash
# remove to create some disk space
run:
rm -rf cd ${GITHUB_WORKSPACE}/build

- name: recon_test_pack
shell: bash
env:
@@ -378,7 +423,7 @@ jobs:
./run_SPECT_tests.sh
fi
- name: Upload log files for debugging
- name: Upload recon_test_pack log files for debugging
uses: actions/upload-artifact@v3
if: failure()
with:
@@ -388,43 +433,6 @@ jobs:
${{ github.workspace }}/recon_test_pack/**/my_*s
retention-days: 7

# Enable tmate debugging of manually-triggered workflows if the input option was provided
- name: Setup tmate session if triggered
uses: mxschmitt/action-tmate@v3
timeout-minutes: 15
if: ${{ github.event_name == 'workflow_dispatch' && inputs.debug_enabled == 'true' }}

- name: examples
shell: bash
run: |
set -ex;
PATH=${CMAKE_INSTALL_PREFIX}/bin:$PATH
# Run examples to see if they work
cd ${GITHUB_WORKSPACE}/examples/PET_simulation
./run_simulation.sh 1> /dev/null
# Run the Demo executables
EXE_LOC=${GITHUB_WORKSPACE}/build/src/examples/C++/using_STIR_LOCAL
cd ${GITHUB_WORKSPACE}/examples/C++/using_STIR_LOCAL
generate_image generate_image.par
forward_project sino.hs image.hv small.hs
# Cannot test demo1 or demo2 as they require interactivity. Piping does not work.
${EXE_LOC}/demo3 demo.par --display_off
${EXE_LOC}/demo3 demoPM.par --display_off
${EXE_LOC}/demo4_obj_fun demo4_obj_fun.par
${EXE_LOC}/demo5_line_search demo5_line_search.par
# build and run C++/using_installed_STIR
cd ${GITHUB_WORKSPACE}/examples/C++/using_installed_STIR
cmake -S . -B build/ -DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_INSTALL_PREFIX}
cmake --build build/ --config Release --target install
# run demo
demo_create_image
# just check if its output makes sense
list_image_info test.hv
- name: Python
shell: bash
run: |
8 changes: 6 additions & 2 deletions src/cmake/FindCERN_ROOT.cmake
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@
# @Author Nikos Efthimiou (nikos.efthimiou AT gmail.com)
# @Author Kris Thielemans
# @Author the ROOT team
# @Atuhor Rebert Twyman (improved documentation)
# @Author Robert Twyman (improved documentation)

## CMAKE ARGS
#
@@ -37,7 +37,7 @@

# This file contains lines from FindROOT.cmake distributed in ROOT 6.08.
# Therefore, this file is presumably licensed under the LGPL 2.1.
# New parts Copyright 2016, 2020, 2023 University College London
# New parts Copyright 2016, 2020, 2023, 2024 University College London

if (NOT DEFINED ROOTSYS)
set(ROOTSYS "$ENV{ROOTSYS}")
@@ -153,7 +153,11 @@ else()

endif()

# root-config reports version as 6.26/10. This might also happen in other cases. Convert it to 6.26.10
string(REPLACE "/" "." CERN_ROOT_VERSION "${CERN_ROOT_VERSION}")

if (CERN_ROOT_DEBUG)
message(STATUS "CERN_ROOT_VERSION: ${CERN_ROOT_VERSION}")
message(STATUS "CERN_ROOT_INCLUDE_DIRS: ${CERN_ROOT_INCLUDE_DIRS}")
message(STATUS "AVAILABLE ROOT LIBRARIES: ${CERN_ROOT_LIBRARIES}")
if (TARGET ROOT::Tree)

0 comments on commit bc56456

Please sign in to comment.