Skip to content

Commit 7508bab

Browse files
Merge pull request #1552 from KrisThielemans/GHA_Ubuntu24.04
Update GitHub Actions to use Ubuntu 24.04 and test g++-14. Need various fixes for this to work.
2 parents d2024fd + d5bbf85 commit 7508bab

File tree

4 files changed

+50
-24
lines changed

4 files changed

+50
-24
lines changed

Diff for: .github/workflows/build-test.yml

+35-19
Original file line numberDiff line numberDiff line change
@@ -38,16 +38,16 @@ jobs:
3838
strategy:
3939
matrix:
4040
include:
41-
- os: ubuntu-latest
41+
- os: ubuntu-24.04
4242
compiler: gcc
43-
compiler_version: 9
43+
# compiler_version: 9
4444
cuda_version: "0"
4545
BUILD_FLAGS: "-DSTIR_OPENMP=ON"
4646
BUILD_TYPE: "Release"
4747
parallelproj: "ON"
4848
ROOT: "ON"
4949
ITK: "OFF"
50-
- os: ubuntu-latest
50+
- os: ubuntu-24.04
5151
compiler: clang
5252
#compiler_version:
5353
cuda_version: "0"
@@ -57,7 +57,7 @@ jobs:
5757
ROOT: "OFF"
5858
# currently using ITK 5.2 which doesn't like clang 14
5959
ITK: "OFF"
60-
- os: ubuntu-latest
60+
- os: ubuntu-24.04
6161
compiler: gcc
6262
compiler_version: 10
6363
cuda_version: "0"
@@ -66,19 +66,20 @@ jobs:
6666
parallelproj: "OFF"
6767
ROOT: "OFF"
6868
ITK: "ON"
69-
- os: ubuntu-latest
69+
- os: ubuntu-24.04
7070
compiler: gcc
71-
compiler_version: 12
71+
compiler_version: 14
7272
cuda_version: "0"
7373
BUILD_FLAGS: "-DSTIR_OPENMP=ON -DCMAKE_CXX_STANDARD=20"
7474
BUILD_TYPE: "RelWithDebInfo"
7575
parallelproj: "ON"
7676
ROOT: "OFF"
7777
ITK: "ON"
78-
- os: ubuntu-latest
78+
- os: ubuntu-24.04
7979
compiler: gcc
80-
compiler_version: 12
81-
cuda_version: "12.1.0"
80+
# currently CUDA doesn't support gcc 14 yet
81+
compiler_version: 13
82+
cuda_version: "12.6.1"
8283
BUILD_FLAGS: "-DSTIR_OPENMP=ON -DCMAKE_CXX_STANDARD=17"
8384
BUILD_TYPE: "Release"
8485
parallelproj: "ON"
@@ -180,7 +181,7 @@ jobs:
180181
echo CXX="$CXX" >> $GITHUB_ENV
181182
182183
- if: matrix.cuda_version != '0'
183-
uses: Jimver/[email protected].11
184+
uses: Jimver/[email protected].19
184185
id: cuda-toolkit
185186
with:
186187
cuda: ${{ matrix.cuda_version }}
@@ -254,13 +255,23 @@ jobs:
254255
rm -rf parallelproj
255256
fi
256257
257-
# Install ROOT (warning: currently only valid on Ubuntu)
258+
# Install ROOT (warning: brittle due to OS versions etc)
258259
if test "${{matrix.ROOT}}XX" == "ONXX"; then
259-
ROOT_file=root_v6.28.12.Linux-ubuntu20-x86_64-gcc9.4.tar.gz
260+
case ${{matrix.os}} in
261+
(ubuntu*)
262+
sudo apt install libtbb-dev libvdt-dev libgif-dev
263+
ROOT_file=root_v6.34.00.Linux-ubuntu24.04-x86_64-gcc13.2.tar.gz
264+
#root_v6.34.00.Linux-ubuntu24.10-x86_64-gcc14.2.tar.gz
265+
;;
266+
(macOS*)
267+
ROOT_file=https://root.cern/download/root_v6.34.00.macos-15.1-arm64-clang160.tar.gz
268+
;;
269+
esac
260270
wget https://root.cern/download/"$ROOT_file"
261271
tar -xzvf "$ROOT_file"
262272
rm "$ROOT_file"
263273
source root/bin/thisroot.sh
274+
echo ROOTSYS="$ROOTSYS" >> $GITHUB_ENV
264275
fi
265276
266277
# we'll install some dependencies with shared libraries, so need to let the OS know
@@ -302,7 +313,11 @@ jobs:
302313
CMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/install
303314
# make available to jobs below
304315
echo CMAKE_INSTALL_PREFIX="$CMAKE_INSTALL_PREFIX" >> $GITHUB_ENV
305-
EXTRA_BUILD_FLAGS="-DBUILD_SWIG_PYTHON=ON -DPYTHON_EXECUTABLE=`which python`"
316+
if [ -n "$ROOTSYS" ]; then
317+
# make sure we find ROOT (and vdt, which is installed in the same place)
318+
EXTRA_BUILD_FLAGS=-DCMAKE_PREFIX_PATH:PATH="$ROOTSYS"
319+
fi
320+
EXTRA_BUILD_FLAGS="${EXTRA_BUILD_FLAGS} -DBUILD_SWIG_PYTHON=ON -DPython_EXECUTABLE=`which python`"
306321
EXTRA_BUILD_FLAGS="${EXTRA_BUILD_FLAGS} -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} -DCMAKE_BUILD_TYPE=${BUILD_TYPE}"
307322
EXTRA_BUILD_FLAGS="${EXTRA_BUILD_FLAGS} -DDOWNLOAD_ZENODO_TEST_DATA=ON"
308323
EXTRA_BUILD_FLAGS="${EXTRA_BUILD_FLAGS} -DDISABLE_STIR_LOCAL=OFF -DSTIR_LOCAL=${GITHUB_WORKSPACE}/examples/C++/using_STIR_LOCAL"
@@ -320,6 +335,13 @@ jobs:
320335
;;
321336
esac
322337
338+
# Enable tmate debugging of manually-triggered workflows if the input option was provided
339+
- name: Setup tmate session if triggered
340+
#if: ${{ failure() }}
341+
uses: mxschmitt/action-tmate@v3
342+
timeout-minutes: 30
343+
if: ${{ github.event_name == 'workflow_dispatch' && inputs.debug_enabled == 'true' }}
344+
323345
- name: build
324346
shell: bash
325347
env:
@@ -329,12 +351,6 @@ jobs:
329351
source ${GITHUB_WORKSPACE}/my-env/bin/activate
330352
cmake --build . -j 2 --config ${BUILD_TYPE}} --target install
331353
332-
# Enable tmate debugging of manually-triggered workflows if the input option was provided
333-
- name: Setup tmate session if triggered
334-
uses: mxschmitt/action-tmate@v3
335-
timeout-minutes: 15
336-
if: ${{ github.event_name == 'workflow_dispatch' && inputs.debug_enabled == 'true' }}
337-
338354
- name: ctest
339355
shell: bash
340356
env:

Diff for: documentation/release_6.3.htm

+10-2
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,11 @@ <h3>Bug fixes</h3>
7979
</ul>
8080

8181
<h3>Build system</h3>
82-
82+
<ul>
83+
<li>Enable more diagnostics in CMake when finding CERN's ROOT (we used to silence them)<br>
84+
<a href=https://github.com/UCL/STIR/pull/1552>PR #1552</a>
85+
</li>
86+
</ul>
8387

8488
<h3>Known problems</h3>
8589
<p>See <a href=https://github.com/UCL/STIR/labels/bug>our issue tracker</a>.</p>
@@ -97,7 +101,11 @@ <h3>Changed functionality</h3>
97101

98102

99103
<h3>Bug fixes</h3>
100-
104+
<ul>
105+
<li>Fixed minor incompatibility with gcc-14 and clang-18 buy adding an extra include file<br>
106+
<a href=https://github.com/UCL/STIR/pull/1552>PR #1552</a>
107+
</li>
108+
</ul>
101109

102110
<h3>Other code changes</h3>
103111

Diff for: src/cmake/FindCERN_ROOT.cmake

+4-3
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@
1414
## FINDING ROOT
1515
#
1616
# Attempts to `find_package(ROOT)`, If that fails, use root-config.
17-
# The primary method for ROOT being found is to use the `find_package(ROOT ${CERN_ROOT_FIND_VERSION} QUIET)` call.
18-
# This process utilizes the `ROOT_DIR` variable to find the relevant CMake files.
17+
# The primary method for ROOT being found is to use the `find_package(ROOT ${CERN_ROOT_FIND_VERSION} CONFIG)` call.
18+
# This process utilizes the `ROOT_DIR` variable to find the relevant ROOTConfig*.cmake files (which are
19+
# part of the ROOT distribution).
1920
# There are two methods by which this variable can be set:
2021
# 1. Set the `ROOT_DIR` CMake argument. Point to `<ROOT_install_dir>/cmake` directory.
2122
# 2. Use the `ROOTSYS` CMake or environment variable. If `ROOT_DIR` is not provided, we will determine set `ROOT_DIR` to `${ROOTSYS}/cmake`.
@@ -53,7 +54,7 @@ if (DEFINED ROOT_DIR)
5354
endif()
5455
endif()
5556

56-
find_package(ROOT ${CERN_ROOT_FIND_VERSION} QUIET)
57+
find_package(ROOT ${CERN_ROOT_FIND_VERSION} CONFIG)
5758
if (ROOT_FOUND)
5859
if (CERN_ROOT_DEBUG)
5960
message(STATUS "Found ROOTConfig.cmake, so translating to old CERN_ROOT variable names")

Diff for: src/include/stir/modelling/PlasmaData.inl

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#include "stir/warning.h"
2222
#include "stir/error.h"
2323
#include <functional>
24+
#include <algorithm>
2425

2526
START_NAMESPACE_STIR
2627

0 commit comments

Comments
 (0)