From 8ebef23219653769ac5a48035056c2300f6b04df Mon Sep 17 00:00:00 2001 From: Kwabena Amponsah Date: Thu, 30 Apr 2026 17:34:56 +0100 Subject: [PATCH 01/16] #98 Add base arg to custom images --- .github/workflows/docker-portability-custom.yml | 6 ++++++ Dockerfile.custom | 6 ++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker-portability-custom.yml b/.github/workflows/docker-portability-custom.yml index 2f21c25..d0c598b 100644 --- a/.github/workflows/docker-portability-custom.yml +++ b/.github/workflows/docker-portability-custom.yml @@ -9,6 +9,12 @@ on: type: string default: "dev" + ubuntu_codename: + description: "Ubuntu codename" + required: true + type: string + default: "jammy" + boost_ver: description: "Boost version" required: true diff --git a/Dockerfile.custom b/Dockerfile.custom index 800d44c..6b02af4 100755 --- a/Dockerfile.custom +++ b/Dockerfile.custom @@ -1,5 +1,5 @@ # Build the image: -# docker build -f Dockerfile.custom --build-arg BOOST=1.74.0 ... -t chaste/runner:custom . +# docker build -f Dockerfile.custom --build-arg BASE=jammy --build-arg BOOST=1.74.0 ... -t chaste/runner:custom . # Run the container in interactive mode: # docker run --init -it -e RUNNER_OFF=1 chaste/runner:custom /bin/bash @@ -7,7 +7,9 @@ # Run the container as a GitHub Actions runner: # docker run --init -it chaste/runner:custom -FROM ubuntu:jammy +ARG BASE=jammy + +FROM ubuntu:${BASE} ARG BOOST ARG HDF5 From 013845310eec2fc29a78f2afc092c1a001c739e8 Mon Sep 17 00:00:00 2001 From: Kwabena Amponsah Date: Tue, 19 May 2026 18:29:02 +0100 Subject: [PATCH 02/16] #98 Add links to patch sources --- scripts/custom/patches/README.md | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 scripts/custom/patches/README.md diff --git a/scripts/custom/patches/README.md b/scripts/custom/patches/README.md new file mode 100644 index 0000000..c7b711a --- /dev/null +++ b/scripts/custom/patches/README.md @@ -0,0 +1,11 @@ +## Patches + +This directory contains patches for fixing issues with various versions of dependencies. + +**Sources** + +- https://github.com/boostorg/python/ +- https://github.com/boostorg/serialization/ +- https://github.com/boostorg/thread/ +- https://github.com/gentoo/gentoo/tree/master/sci-libs/vtk/files/ +- https://sources.debian.org/patches/ From a183513c154608ef899cba117c5c22b73ac1372c Mon Sep 17 00:00:00 2001 From: Kwabena Amponsah Date: Tue, 19 May 2026 18:44:29 +0100 Subject: [PATCH 03/16] #98 Split os setup script by lts --- scripts/custom/setup_custom.sh | 140 ++++------------------------ scripts/custom/setup_ubuntu_2204.sh | 131 ++++++++++++++++++++++++++ scripts/custom/setup_ubuntu_2404.sh | 130 ++++++++++++++++++++++++++ scripts/custom/setup_ubuntu_2604.sh | 130 ++++++++++++++++++++++++++ 4 files changed, 407 insertions(+), 124 deletions(-) create mode 100755 scripts/custom/setup_ubuntu_2204.sh create mode 100755 scripts/custom/setup_ubuntu_2404.sh create mode 100755 scripts/custom/setup_ubuntu_2604.sh diff --git a/scripts/custom/setup_custom.sh b/scripts/custom/setup_custom.sh index 3d745de..5147d36 100755 --- a/scripts/custom/setup_custom.sh +++ b/scripts/custom/setup_custom.sh @@ -1,131 +1,23 @@ #!/bin/sh -# Setup required libraries for building Chaste dependencies on Ubuntu 22.04 Jammy +# Setup required libraries for building Chaste dependencies on Ubuntu LTS +script_dir="$( + cd "$(dirname "$0")" + pwd +)" -export DEBIAN_FRONTEND=noninteractive +codename="$(. /etc/os-release && echo ${VERSION_CODENAME} | sed 's/\.//')" -# Base dependencies -apt-get update -apt-get install -y --no-install-recommends \ - apt-transport-https \ - apt-utils \ - ca-certificates \ - curl \ - environment-modules \ - gnupg \ - jq \ - openssl \ - rsync \ - wget +if [ "${codename}" = 'jammy' ]; then + ${script_dir}/setup_ubuntu_2204.sh -# Build/dev dependencies -apt-get install -y --no-install-recommends \ - build-essential \ - doxygen \ - git \ - lcov \ - python3 \ - python3-dev \ - python3-pip \ - python3-venv \ - valgrind +elif [ "${codename}" = 'noble' ]; then + ${script_dir}/setup_ubuntu_2404.sh -# Install cmake 3.26+ for HDF5 2.0+ (Ubuntu 22.04 has cmake 3.22) -python3 -m pip install --no-cache-dir "cmake>=3.26,<5" +elif [ "${codename}" = 'resolute' ]; then + ${script_dir}/setup_ubuntu_2604.sh -# Chaste dependencies -apt-get install -y --no-install-recommends \ - libfftw3-3 \ - libfftw3-bin \ - libfftw3-dev \ - mpi-default-bin \ - mpi-default-dev - -# VTK dependencies -apt-get install -y --no-install-recommends \ - freeglut3 \ - freeglut3-dev \ - libavcodec-dev \ - libavcodec58 \ - libavformat-dev \ - libavformat58 \ - libavutil-dev \ - libavutil56 \ - libdouble-conversion-dev \ - libdouble-conversion3 \ - libeigen3-dev \ - libfmt-dev \ - libfmt8 \ - libfontconfig1 \ - libfreetype6 \ - libfreetype6-dev \ - libgl1-mesa-dev \ - libgl1-mesa-glx \ - libgl2ps-dev \ - libgl2ps1.4 \ - libglew-dev \ - libglew2.2 \ - libglu1-mesa \ - libglu1-mesa-dev \ - libglx0 \ - libjpeg-dev \ - libjpeg8 \ - libjsoncpp-dev \ - libjsoncpp25 \ - liblz4-1 \ - liblz4-dev \ - liblzma5 \ - libmysqlclient-dev \ - libmysqlclient21 \ - libnetcdf-c++4 \ - libnetcdf-cxx-legacy-dev \ - libnetcdf-dev \ - libnetcdf19 \ - libodbc2 \ - libogg-dev \ - libogg0 \ - libopengl0 \ - libpng-dev \ - libpng16-16 \ - libpq-dev \ - libpq5 \ - libproj-dev \ - libproj22 \ - libsqlite3-0 \ - libsqlite3-dev \ - libswscale-dev \ - libswscale5 \ - libtbb-dev \ - libtbb12 \ - libtcl8.6 \ - libtheora-dev \ - libtheora0 \ - libtiff-dev \ - libtiff5 \ - libtk8.6 \ - libutfcpp-dev \ - libx11-6 \ - libx11-dev \ - libxcursor-dev \ - libxcursor1 \ - libxft-dev \ - libxml2 \ - libxml2-dev \ - libxss-dev \ - libxt-dev \ - libxt6 \ - sqlite3 \ - tcl-dev \ - tk-dev \ - x11proto-core-dev \ - zlib1g \ - zlib1g-dev - -# libexpat1-dev libexpat1: -# To be supplied by custom VTK build due to version conflicts. - -# libgdal-dev libgdal30: -# To be supplied by custom VTK build due to reliance on system boost. - -update-alternatives --install /usr/local/bin/python python /usr/bin/python3 10 -update-alternatives --install /usr/local/bin/pip pip /usr/bin/pip3 10 +else + echo "Unsupported Ubuntu version: ${codename}" + exit 1 +fi diff --git a/scripts/custom/setup_ubuntu_2204.sh b/scripts/custom/setup_ubuntu_2204.sh new file mode 100755 index 0000000..dd3ce3c --- /dev/null +++ b/scripts/custom/setup_ubuntu_2204.sh @@ -0,0 +1,131 @@ +#!/bin/sh + +# Setup required libraries for building Chaste dependencies on Ubuntu 22.04 Jammy LTS + +export DEBIAN_FRONTEND=noninteractive + +# Base dependencies +apt-get update +apt-get install -y --no-install-recommends \ + apt-transport-https \ + apt-utils \ + ca-certificates \ + curl \ + environment-modules \ + gnupg \ + jq \ + openssl \ + rsync \ + wget + +# Build/dev dependencies +apt-get install -y --no-install-recommends \ + build-essential \ + doxygen \ + git \ + lcov \ + python3 \ + python3-dev \ + python3-pip \ + python3-venv \ + valgrind + +# Install cmake 3.26+ for HDF5 2.0+ (Ubuntu 22.04 has cmake 3.22) +python3 -m pip install --no-cache-dir "cmake>=3.26,<5" + +# Chaste dependencies +apt-get install -y --no-install-recommends \ + libfftw3-3 \ + libfftw3-bin \ + libfftw3-dev \ + mpi-default-bin \ + mpi-default-dev + +# VTK dependencies +apt-get install -y --no-install-recommends \ + freeglut3 \ + freeglut3-dev \ + libavcodec-dev \ + libavcodec58 \ + libavformat-dev \ + libavformat58 \ + libavutil-dev \ + libavutil56 \ + libdouble-conversion-dev \ + libdouble-conversion3 \ + libeigen3-dev \ + libfmt-dev \ + libfmt8 \ + libfontconfig1 \ + libfreetype6 \ + libfreetype6-dev \ + libgl1-mesa-dev \ + libgl1-mesa-glx \ + libgl2ps-dev \ + libgl2ps1.4 \ + libglew-dev \ + libglew2.2 \ + libglu1-mesa \ + libglu1-mesa-dev \ + libglx0 \ + libjpeg-dev \ + libjpeg8 \ + libjsoncpp-dev \ + libjsoncpp25 \ + liblz4-1 \ + liblz4-dev \ + liblzma5 \ + libmysqlclient-dev \ + libmysqlclient21 \ + libnetcdf-c++4 \ + libnetcdf-cxx-legacy-dev \ + libnetcdf-dev \ + libnetcdf19 \ + libodbc2 \ + libogg-dev \ + libogg0 \ + libopengl0 \ + libpng-dev \ + libpng16-16 \ + libpq-dev \ + libpq5 \ + libproj-dev \ + libproj22 \ + libsqlite3-0 \ + libsqlite3-dev \ + libswscale-dev \ + libswscale5 \ + libtbb-dev \ + libtbb12 \ + libtcl8.6 \ + libtheora-dev \ + libtheora0 \ + libtiff-dev \ + libtiff5 \ + libtk8.6 \ + libutfcpp-dev \ + libx11-6 \ + libx11-dev \ + libxcursor-dev \ + libxcursor1 \ + libxft-dev \ + libxml2 \ + libxml2-dev \ + libxss-dev \ + libxt-dev \ + libxt6 \ + sqlite3 \ + tcl-dev \ + tk-dev \ + x11proto-core-dev \ + zlib1g \ + zlib1g-dev + +# libexpat1-dev libexpat1: +# To be supplied by custom VTK build due to version conflicts. + +# libgdal-dev libgdal30: +# To be supplied by custom VTK build due to reliance on system boost. + +update-alternatives --install /usr/local/bin/python python /usr/bin/python3 10 +update-alternatives --install /usr/local/bin/pip pip /usr/bin/pip3 10 diff --git a/scripts/custom/setup_ubuntu_2404.sh b/scripts/custom/setup_ubuntu_2404.sh new file mode 100755 index 0000000..8abf94d --- /dev/null +++ b/scripts/custom/setup_ubuntu_2404.sh @@ -0,0 +1,130 @@ +#!/bin/sh + +# Setup required libraries for building Chaste dependencies on Ubuntu 22.04 Noble LTS + +export DEBIAN_FRONTEND=noninteractive + +# Base dependencies +apt-get update +apt-get install -y --no-install-recommends \ + apt-transport-https \ + apt-utils \ + ca-certificates \ + curl \ + environment-modules \ + gnupg \ + jq \ + openssl \ + rsync \ + wget + +# Build/dev dependencies +apt-get install -y --no-install-recommends \ + build-essential \ + cmake \ + cmake-curses-gui \ + doxygen \ + git \ + lcov \ + python3 \ + python3-dev \ + python3-pip \ + python3-venv \ + valgrind + +# Chaste dependencies +apt-get install -y --no-install-recommends \ + libfftw3-3 \ + libfftw3-bin \ + libfftw3-dev \ + mpi-default-bin \ + mpi-default-dev + +# VTK dependencies +apt-get install -y --no-install-recommends \ + freeglut3 \ + freeglut3-dev \ + libavcodec-dev \ + libavcodec58 \ + libavformat-dev \ + libavformat58 \ + libavutil-dev \ + libavutil56 \ + libdouble-conversion-dev \ + libdouble-conversion3 \ + libeigen3-dev \ + libfmt-dev \ + libfmt8 \ + libfontconfig1 \ + libfreetype6 \ + libfreetype6-dev \ + libgl1-mesa-dev \ + libgl1-mesa-glx \ + libgl2ps-dev \ + libgl2ps1.4 \ + libglew-dev \ + libglew2.2 \ + libglu1-mesa \ + libglu1-mesa-dev \ + libglx0 \ + libjpeg-dev \ + libjpeg8 \ + libjsoncpp-dev \ + libjsoncpp25 \ + liblz4-1 \ + liblz4-dev \ + liblzma5 \ + libmysqlclient-dev \ + libmysqlclient21 \ + libnetcdf-c++4 \ + libnetcdf-cxx-legacy-dev \ + libnetcdf-dev \ + libnetcdf19 \ + libodbc2 \ + libogg-dev \ + libogg0 \ + libopengl0 \ + libpng-dev \ + libpng16-16 \ + libpq-dev \ + libpq5 \ + libproj-dev \ + libproj22 \ + libsqlite3-0 \ + libsqlite3-dev \ + libswscale-dev \ + libswscale5 \ + libtbb-dev \ + libtbb12 \ + libtcl8.6 \ + libtheora-dev \ + libtheora0 \ + libtiff-dev \ + libtiff5 \ + libtk8.6 \ + libutfcpp-dev \ + libx11-6 \ + libx11-dev \ + libxcursor-dev \ + libxcursor1 \ + libxft-dev \ + libxml2 \ + libxml2-dev \ + libxss-dev \ + libxt-dev \ + libxt6 \ + sqlite3 \ + tcl-dev \ + tk-dev \ + x11proto-core-dev \ + zlib1g \ + zlib1g-dev + +# libexpat1-dev libexpat1: +# To be supplied by custom VTK build due to version conflicts. + +# libgdal-dev libgdal30: +# To be supplied by custom VTK build due to reliance on system boost. + +update-alternatives --install /usr/local/bin/python python /usr/bin/python3 10 +update-alternatives --install /usr/local/bin/pip pip /usr/bin/pip3 10 diff --git a/scripts/custom/setup_ubuntu_2604.sh b/scripts/custom/setup_ubuntu_2604.sh new file mode 100755 index 0000000..1930348 --- /dev/null +++ b/scripts/custom/setup_ubuntu_2604.sh @@ -0,0 +1,130 @@ +#!/bin/sh + +# Setup required libraries for building Chaste dependencies on Ubuntu 26.04 Resolute LTS + +export DEBIAN_FRONTEND=noninteractive + +# Base dependencies +apt-get update +apt-get install -y --no-install-recommends \ + apt-transport-https \ + apt-utils \ + ca-certificates \ + curl \ + environment-modules \ + gnupg \ + jq \ + openssl \ + rsync \ + wget + +# Build/dev dependencies +apt-get install -y --no-install-recommends \ + build-essential \ + cmake \ + cmake-curses-gui \ + doxygen \ + git \ + lcov \ + python3 \ + python3-dev \ + python3-pip \ + python3-venv \ + valgrind + +# Chaste dependencies +apt-get install -y --no-install-recommends \ + libfftw3-3 \ + libfftw3-bin \ + libfftw3-dev \ + mpi-default-bin \ + mpi-default-dev + +# VTK dependencies +apt-get install -y --no-install-recommends \ + freeglut3 \ + freeglut3-dev \ + libavcodec-dev \ + libavcodec58 \ + libavformat-dev \ + libavformat58 \ + libavutil-dev \ + libavutil56 \ + libdouble-conversion-dev \ + libdouble-conversion3 \ + libeigen3-dev \ + libfmt-dev \ + libfmt8 \ + libfontconfig1 \ + libfreetype6 \ + libfreetype6-dev \ + libgl1-mesa-dev \ + libgl1-mesa-glx \ + libgl2ps-dev \ + libgl2ps1.4 \ + libglew-dev \ + libglew2.2 \ + libglu1-mesa \ + libglu1-mesa-dev \ + libglx0 \ + libjpeg-dev \ + libjpeg8 \ + libjsoncpp-dev \ + libjsoncpp25 \ + liblz4-1 \ + liblz4-dev \ + liblzma5 \ + libmysqlclient-dev \ + libmysqlclient21 \ + libnetcdf-c++4 \ + libnetcdf-cxx-legacy-dev \ + libnetcdf-dev \ + libnetcdf19 \ + libodbc2 \ + libogg-dev \ + libogg0 \ + libopengl0 \ + libpng-dev \ + libpng16-16 \ + libpq-dev \ + libpq5 \ + libproj-dev \ + libproj22 \ + libsqlite3-0 \ + libsqlite3-dev \ + libswscale-dev \ + libswscale5 \ + libtbb-dev \ + libtbb12 \ + libtcl8.6 \ + libtheora-dev \ + libtheora0 \ + libtiff-dev \ + libtiff5 \ + libtk8.6 \ + libutfcpp-dev \ + libx11-6 \ + libx11-dev \ + libxcursor-dev \ + libxcursor1 \ + libxft-dev \ + libxml2 \ + libxml2-dev \ + libxss-dev \ + libxt-dev \ + libxt6 \ + sqlite3 \ + tcl-dev \ + tk-dev \ + x11proto-core-dev \ + zlib1g \ + zlib1g-dev + +# libexpat1-dev libexpat1: +# To be supplied by custom VTK build due to version conflicts. + +# libgdal-dev libgdal30: +# To be supplied by custom VTK build due to reliance on system boost. + +update-alternatives --install /usr/local/bin/python python /usr/bin/python3 10 +update-alternatives --install /usr/local/bin/pip pip /usr/bin/pip3 10 From ee554ea250a62c9edcccff9aa10c3e24053ba042 Mon Sep 17 00:00:00 2001 From: Kwabena Amponsah Date: Tue, 19 May 2026 19:13:42 +0100 Subject: [PATCH 04/16] #98 Simplify patch paths --- scripts/common.sh | 3 + scripts/custom/install_boost.sh | 8 +- scripts/custom/install_vtk.sh | 176 ++++++++++++++++---------------- scripts/custom/setup_custom.sh | 16 ++- scripts/system/setup_system.sh | 11 +- 5 files changed, 109 insertions(+), 105 deletions(-) diff --git a/scripts/common.sh b/scripts/common.sh index 3ab4f1d..6bad333 100644 --- a/scripts/common.sh +++ b/scripts/common.sh @@ -141,3 +141,6 @@ version_ge() { ! version_lt $1 $2 } + +OS_VERSION_ID="$(. /etc/os-release && echo ${VERSION_ID})" +OS_VERSION_CODENAME="$(. /etc/os-release && echo ${VERSION_CODENAME})" diff --git a/scripts/custom/install_boost.sh b/scripts/custom/install_boost.sh index 3accdf7..2c8018f 100755 --- a/scripts/custom/install_boost.sh +++ b/scripts/custom/install_boost.sh @@ -18,6 +18,8 @@ usage() script_dir="$(cd "$(dirname "$0")"; pwd)" . ${script_dir}/common.sh +patch_dir="${script_dir}/patches/boost" + # Parse arguments version= base_dir= @@ -76,21 +78,21 @@ fi # https://github.com/boostorg/python/commit/660487c43fde76f3e64f1cb2e644500da92fe582 if version_le "${version}" '1.66'; then # Boost <= 1.66.x cd ${src_dir}/libs/python - patch -t -p1 < ${script_dir}/patches/boost/1.66/boost_166-python37-unicode-as-string.patch + patch -t -p1 < ${patch_dir}/1.66/boost_166-python37-unicode-as-string.patch fi # Patch for serialization in Boost <= 1.64.x # https://github.com/boostorg/serialization/commit/1d86261581230e2dc5d617a9b16287d326f3e229 if version_le "${version}" '1.64'; then # Boost <= 1.64.x cd ${src_dir} - patch -t -p2 < ${script_dir}/patches/boost/1.64/boost_164-serialization-array-wrapper.patch + patch -t -p2 < ${patch_dir}/1.64/boost_164-serialization-array-wrapper.patch fi # Patch for pthread in 1.69.x <= Boost <= 1.72.x # https://github.com/boostorg/thread/pull/297/commits/74fb0a26099bc51d717f5f154b37231ce7df3e98 if version_ge "${version}" '1.69' && version_le "${version}" '1.72'; then # 1.69.x <= Boost <= 1.72.x cd ${src_dir} - patch -t -p2 < ${script_dir}/patches/boost/1.69/boost_169-pthread.patch + patch -t -p2 < ${patch_dir}/1.69/boost_169-pthread.patch fi # Build and install diff --git a/scripts/custom/install_vtk.sh b/scripts/custom/install_vtk.sh index 4e93f61..c38a402 100755 --- a/scripts/custom/install_vtk.sh +++ b/scripts/custom/install_vtk.sh @@ -18,6 +18,8 @@ usage() script_dir="$(cd "$(dirname "$0")"; pwd)" . ${script_dir}/common.sh +patch_dir="${script_dir}/patches/vtk" + # Parse arguments version= base_dir= @@ -70,102 +72,102 @@ tar -xzf v${version}.tar.gz -C ${src_dir} --strip-components=1 # VTK 6.3.x patches: https://sources.debian.org/patches/vtk6/ if version_eq "${major}.${minor}" '6.3'; then # VTK == 6.3.x cd ${src_dir} - patch -t -p1 < ${script_dir}/patches/vtk/6.3/10_allpatches.patch - patch -t -p1 < ${script_dir}/patches/vtk/6.3/20_soversion-sharedlib.patch - patch -t -p1 < ${script_dir}/patches/vtk/6.3/30_matplotlib.patch - patch -t -p1 < ${script_dir}/patches/vtk/6.3/60_use_system_mpi4py.patch - patch -t -p1 < ${script_dir}/patches/vtk/6.3/70_fix_ftbfs_gcc49.patch - patch -t -p1 < ${script_dir}/patches/vtk/6.3/90_gdal-2.0.patch - patch -t -p1 < ${script_dir}/patches/vtk/6.3/95_ffmpeg_2.9.patch - patch -t -p1 < ${script_dir}/patches/vtk/6.3/97_fix_latex_doxygen.patch - patch -t -p1 < ${script_dir}/patches/vtk/6.3/99-hdf5-1.10-compatibility - patch -t -p1 < ${script_dir}/patches/vtk/6.3/100_javac-heap.patch - patch -t -p1 < ${script_dir}/patches/vtk/6.3/101_java_install_path.patch - patch -t -p1 < ${script_dir}/patches/vtk/6.3/105_unforce_embedded_glew.patch - patch -t -p1 < ${script_dir}/patches/vtk/6.3/106_install_doxygen_scripts_in_nodoc_build.patch - patch -t -p1 < ${script_dir}/patches/vtk/6.3/108_Doxygen-use-mathjax.patch - patch -t -p1 < ${script_dir}/patches/vtk/6.3/109_infovis_boost.patch - patch -t -p1 < ${script_dir}/patches/vtk/6.3/110_remove_nonfree_from_build.patch - patch -t -p1 < ${script_dir}/patches/vtk/6.3/120_fix_ftbfs_qtpainter.patch - patch -t -p1 < ${script_dir}/patches/vtk/6.3/3edc0de2b04ae1e100c229e592d6b9fa94f2915a.patch - patch -t -p1 < ${script_dir}/patches/vtk/6.3/581d9eb874b2b80a3fb21c739a96fa6f955ffb5e.patch - patch -t -p1 < ${script_dir}/patches/vtk/6.3/new-freetype.patch - patch -t -p1 < ${script_dir}/patches/vtk/6.3/vtk6-gcc11-support.patch + patch -t -p1 < ${patch_dir}/6.3/10_allpatches.patch + patch -t -p1 < ${patch_dir}/6.3/20_soversion-sharedlib.patch + patch -t -p1 < ${patch_dir}/6.3/30_matplotlib.patch + patch -t -p1 < ${patch_dir}/6.3/60_use_system_mpi4py.patch + patch -t -p1 < ${patch_dir}/6.3/70_fix_ftbfs_gcc49.patch + patch -t -p1 < ${patch_dir}/6.3/90_gdal-2.0.patch + patch -t -p1 < ${patch_dir}/6.3/95_ffmpeg_2.9.patch + patch -t -p1 < ${patch_dir}/6.3/97_fix_latex_doxygen.patch + patch -t -p1 < ${patch_dir}/6.3/99-hdf5-1.10-compatibility + patch -t -p1 < ${patch_dir}/6.3/100_javac-heap.patch + patch -t -p1 < ${patch_dir}/6.3/101_java_install_path.patch + patch -t -p1 < ${patch_dir}/6.3/105_unforce_embedded_glew.patch + patch -t -p1 < ${patch_dir}/6.3/106_install_doxygen_scripts_in_nodoc_build.patch + patch -t -p1 < ${patch_dir}/6.3/108_Doxygen-use-mathjax.patch + patch -t -p1 < ${patch_dir}/6.3/109_infovis_boost.patch + patch -t -p1 < ${patch_dir}/6.3/110_remove_nonfree_from_build.patch + patch -t -p1 < ${patch_dir}/6.3/120_fix_ftbfs_qtpainter.patch + patch -t -p1 < ${patch_dir}/6.3/3edc0de2b04ae1e100c229e592d6b9fa94f2915a.patch + patch -t -p1 < ${patch_dir}/6.3/581d9eb874b2b80a3fb21c739a96fa6f955ffb5e.patch + patch -t -p1 < ${patch_dir}/6.3/new-freetype.patch + patch -t -p1 < ${patch_dir}/6.3/vtk6-gcc11-support.patch fi # VTK 7.1.x patches: https://sources.debian.org/patches/vtk7/ if version_eq "${major}.${minor}" '7.1'; then # VTK == 7.1.x cd ${src_dir} - patch -t -p1 < ${script_dir}/patches/vtk/7.1/10_allpatches.patch - patch -t -p1 < ${script_dir}/patches/vtk/7.1/20_soversion-sharedlib.patch - patch -t -p1 < ${script_dir}/patches/vtk/7.1/30_matplotlib.patch - patch -t -p1 < ${script_dir}/patches/vtk/7.1/40_use_system_sqlite.patch - patch -t -p1 < ${script_dir}/patches/vtk/7.1/60_use_system_mpi4py.patch - patch -t -p1 < ${script_dir}/patches/vtk/7.1/70_fix_ftbfs_gcc49.patch - patch -t -p1 < ${script_dir}/patches/vtk/7.1/80_fix_arm_compilation.patch - patch -t -p1 < ${script_dir}/patches/vtk/7.1/99-hdf5-1.10-compatibility - patch -t -p1 < ${script_dir}/patches/vtk/7.1/100_javac-heap.patch - patch -t -p1 < ${script_dir}/patches/vtk/7.1/101_java_install_path.patch - patch -t -p1 < ${script_dir}/patches/vtk/7.1/105_unforce_embedded_glew.patch - patch -t -p1 < ${script_dir}/patches/vtk/7.1/106_install_doxygen_scripts_in_nodoc_build.patch - patch -t -p1 < ${script_dir}/patches/vtk/7.1/108_Doxygen-use-mathjax.patch - patch -t -p1 < ${script_dir}/patches/vtk/7.1/109_java-jar-nonjavafiles.patch - patch -t -p1 < ${script_dir}/patches/vtk/7.1/110_python-371.patch - patch -t -p1 < ${script_dir}/patches/vtk/7.1/111_fix_perl.patch - patch -t -p1 < ${script_dir}/patches/vtk/7.1/112_riscv_support.patch - patch -t -p1 < ${script_dir}/patches/vtk/7.1/113_fix_python_equal.patch - patch -t -p1 < ${script_dir}/patches/vtk/7.1/115_support-gcc10.patch - patch -t -p1 < ${script_dir}/patches/vtk/7.1/mysq8_my_bool.patch - patch -t -p1 < ${script_dir}/patches/vtk/7.1/3edc0de2b04ae1e100c229e592d6b9fa94f2915a.patch - patch -t -p1 < ${script_dir}/patches/vtk/7.1/581d9eb874b2b80a3fb21c739a96fa6f955ffb5e.patch - patch -t -p1 < ${script_dir}/patches/vtk/7.1/gcc-11.patch - patch -t -p1 < ${script_dir}/patches/vtk/7.1/ffmpeg-5.patch + patch -t -p1 < ${patch_dir}/7.1/10_allpatches.patch + patch -t -p1 < ${patch_dir}/7.1/20_soversion-sharedlib.patch + patch -t -p1 < ${patch_dir}/7.1/30_matplotlib.patch + patch -t -p1 < ${patch_dir}/7.1/40_use_system_sqlite.patch + patch -t -p1 < ${patch_dir}/7.1/60_use_system_mpi4py.patch + patch -t -p1 < ${patch_dir}/7.1/70_fix_ftbfs_gcc49.patch + patch -t -p1 < ${patch_dir}/7.1/80_fix_arm_compilation.patch + patch -t -p1 < ${patch_dir}/7.1/99-hdf5-1.10-compatibility + patch -t -p1 < ${patch_dir}/7.1/100_javac-heap.patch + patch -t -p1 < ${patch_dir}/7.1/101_java_install_path.patch + patch -t -p1 < ${patch_dir}/7.1/105_unforce_embedded_glew.patch + patch -t -p1 < ${patch_dir}/7.1/106_install_doxygen_scripts_in_nodoc_build.patch + patch -t -p1 < ${patch_dir}/7.1/108_Doxygen-use-mathjax.patch + patch -t -p1 < ${patch_dir}/7.1/109_java-jar-nonjavafiles.patch + patch -t -p1 < ${patch_dir}/7.1/110_python-371.patch + patch -t -p1 < ${patch_dir}/7.1/111_fix_perl.patch + patch -t -p1 < ${patch_dir}/7.1/112_riscv_support.patch + patch -t -p1 < ${patch_dir}/7.1/113_fix_python_equal.patch + patch -t -p1 < ${patch_dir}/7.1/115_support-gcc10.patch + patch -t -p1 < ${patch_dir}/7.1/mysq8_my_bool.patch + patch -t -p1 < ${patch_dir}/7.1/3edc0de2b04ae1e100c229e592d6b9fa94f2915a.patch + patch -t -p1 < ${patch_dir}/7.1/581d9eb874b2b80a3fb21c739a96fa6f955ffb5e.patch + patch -t -p1 < ${patch_dir}/7.1/gcc-11.patch + patch -t -p1 < ${patch_dir}/7.1/ffmpeg-5.patch fi # VTK 8.1.x patches if version_eq "${major}.${minor}" '8.1'; then # VTK == 8.1.x cd ${src_dir} - patch -t -p1 < ${script_dir}/patches/vtk/8.1/20_soversion-sharedlib.patch - patch -t -p1 < ${script_dir}/patches/vtk/8.1/30_matplotlib.patch - patch -t -p1 < ${script_dir}/patches/vtk/8.1/60_use_system_mpi4py.patch - patch -t -p1 < ${script_dir}/patches/vtk/8.1/70_vtk8_fix_ftbfs_gcc49.patch - patch -t -p1 < ${script_dir}/patches/vtk/8.1/100_javac-heap.patch - patch -t -p1 < ${script_dir}/patches/vtk/8.1/101_java_install_path.patch - patch -t -p1 < ${script_dir}/patches/vtk/8.1/106_install_doxygen_scripts_in_nodoc_build.patch - patch -t -p1 < ${script_dir}/patches/vtk/8.1/108_Doxygen-use-mathjax.patch - patch -t -p1 < ${script_dir}/patches/vtk/8.1/109_java-jar-nonjavafiles.patch - patch -t -p1 < ${script_dir}/patches/vtk/8.1/110_python-371.patch - patch -t -p1 < ${script_dir}/patches/vtk/8.1/111_fix_perl.patch - patch -t -p1 < ${script_dir}/patches/vtk/8.1/112_riscv_support.patch - patch -t -p1 < ${script_dir}/patches/vtk/8.1/113_vtk8_fix_python_equal.patch - patch -t -p1 < ${script_dir}/patches/vtk/8.1/115_support-gcc10.patch - patch -t -p1 < ${script_dir}/patches/vtk/8.1/mysq8_my_bool.patch - patch -t -p1 < ${script_dir}/patches/vtk/8.1/3edc0de2b04ae1e100c229e592d6b9fa94f2915a.patch - patch -t -p1 < ${script_dir}/patches/vtk/8.1/581d9eb874b2b80a3fb21c739a96fa6f955ffb5e.patch - patch -t -p1 < ${script_dir}/patches/vtk/8.1/vtk8-gcc-11-exodus.patch + patch -t -p1 < ${patch_dir}/8.1/20_soversion-sharedlib.patch + patch -t -p1 < ${patch_dir}/8.1/30_matplotlib.patch + patch -t -p1 < ${patch_dir}/8.1/60_use_system_mpi4py.patch + patch -t -p1 < ${patch_dir}/8.1/70_vtk8_fix_ftbfs_gcc49.patch + patch -t -p1 < ${patch_dir}/8.1/100_javac-heap.patch + patch -t -p1 < ${patch_dir}/8.1/101_java_install_path.patch + patch -t -p1 < ${patch_dir}/8.1/106_install_doxygen_scripts_in_nodoc_build.patch + patch -t -p1 < ${patch_dir}/8.1/108_Doxygen-use-mathjax.patch + patch -t -p1 < ${patch_dir}/8.1/109_java-jar-nonjavafiles.patch + patch -t -p1 < ${patch_dir}/8.1/110_python-371.patch + patch -t -p1 < ${patch_dir}/8.1/111_fix_perl.patch + patch -t -p1 < ${patch_dir}/8.1/112_riscv_support.patch + patch -t -p1 < ${patch_dir}/8.1/113_vtk8_fix_python_equal.patch + patch -t -p1 < ${patch_dir}/8.1/115_support-gcc10.patch + patch -t -p1 < ${patch_dir}/8.1/mysq8_my_bool.patch + patch -t -p1 < ${patch_dir}/8.1/3edc0de2b04ae1e100c229e592d6b9fa94f2915a.patch + patch -t -p1 < ${patch_dir}/8.1/581d9eb874b2b80a3fb21c739a96fa6f955ffb5e.patch + patch -t -p1 < ${patch_dir}/8.1/vtk8-gcc-11-exodus.patch fi # VTK 8.2.x patches if version_eq "${major}.${minor}" '8.2'; then # VTK == 8.2.x cd ${src_dir} - patch -t -p1 < ${script_dir}/patches/vtk/8.2/20_soversion-sharedlib.patch - patch -t -p1 < ${script_dir}/patches/vtk/8.2/30_matplotlib.patch - patch -t -p1 < ${script_dir}/patches/vtk/8.2/60_vtk8_use_system_mpi4py.patch - patch -t -p1 < ${script_dir}/patches/vtk/8.2/70_vtk8_fix_ftbfs_gcc49.patch - patch -t -p1 < ${script_dir}/patches/vtk/8.2/100_javac-heap.patch - patch -t -p1 < ${script_dir}/patches/vtk/8.2/101_java_install_path.patch - patch -t -p1 < ${script_dir}/patches/vtk/8.2/106_install_doxygen_scripts_in_nodoc_build.patch - patch -t -p1 < ${script_dir}/patches/vtk/8.2/108_Doxygen-use-mathjax.patch - patch -t -p1 < ${script_dir}/patches/vtk/8.2/109_java-jar-nonjavafiles.patch - patch -t -p1 < ${script_dir}/patches/vtk/8.2/110_python-371.patch - patch -t -p1 < ${script_dir}/patches/vtk/8.2/111_fix_perl.patch - patch -t -p1 < ${script_dir}/patches/vtk/8.2/112_riscv_support.patch - patch -t -p1 < ${script_dir}/patches/vtk/8.2/113_vtk8_fix_python_equal.patch - patch -t -p1 < ${script_dir}/patches/vtk/8.2/115_support-gcc10.patch - patch -t -p1 < ${script_dir}/patches/vtk/8.2/mysq8_my_bool.patch - patch -t -p1 < ${script_dir}/patches/vtk/8.2/3edc0de2b04ae1e100c229e592d6b9fa94f2915a.patch - patch -t -p1 < ${script_dir}/patches/vtk/8.2/581d9eb874b2b80a3fb21c739a96fa6f955ffb5e.patch - patch -t -p1 < ${script_dir}/patches/vtk/8.2/vtk8-gcc-11-exodus.patch + patch -t -p1 < ${patch_dir}/8.2/20_soversion-sharedlib.patch + patch -t -p1 < ${patch_dir}/8.2/30_matplotlib.patch + patch -t -p1 < ${patch_dir}/8.2/60_vtk8_use_system_mpi4py.patch + patch -t -p1 < ${patch_dir}/8.2/70_vtk8_fix_ftbfs_gcc49.patch + patch -t -p1 < ${patch_dir}/8.2/100_javac-heap.patch + patch -t -p1 < ${patch_dir}/8.2/101_java_install_path.patch + patch -t -p1 < ${patch_dir}/8.2/106_install_doxygen_scripts_in_nodoc_build.patch + patch -t -p1 < ${patch_dir}/8.2/108_Doxygen-use-mathjax.patch + patch -t -p1 < ${patch_dir}/8.2/109_java-jar-nonjavafiles.patch + patch -t -p1 < ${patch_dir}/8.2/110_python-371.patch + patch -t -p1 < ${patch_dir}/8.2/111_fix_perl.patch + patch -t -p1 < ${patch_dir}/8.2/112_riscv_support.patch + patch -t -p1 < ${patch_dir}/8.2/113_vtk8_fix_python_equal.patch + patch -t -p1 < ${patch_dir}/8.2/115_support-gcc10.patch + patch -t -p1 < ${patch_dir}/8.2/mysq8_my_bool.patch + patch -t -p1 < ${patch_dir}/8.2/3edc0de2b04ae1e100c229e592d6b9fa94f2915a.patch + patch -t -p1 < ${patch_dir}/8.2/581d9eb874b2b80a3fb21c739a96fa6f955ffb5e.patch + patch -t -p1 < ${patch_dir}/8.2/vtk8-gcc-11-exodus.patch fi # VTK 9.0.x patches: @@ -173,22 +175,22 @@ fi # https://github.com/gentoo/gentoo/tree/4893345530421b0d6168b5278d57d69fc08f7fdf/sci-libs/vtk/files if version_eq "${major}.${minor}" '9.0'; then # VTK == 9.0.x cd ${src_dir} - patch -t -p1 < ${script_dir}/patches/vtk/9.0/50_fix_python-modules_path.patch - patch -t -p1 < ${script_dir}/patches/vtk/9.0/70_fix_python_numpy_warning.patch - patch -t -p1 < ${script_dir}/patches/vtk/9.0/fix-limits.patch - patch -t -p1 < ${script_dir}/patches/vtk/9.0/vtk-9.0.3-proj-api-fix-upstream-commit-03256388.patch + patch -t -p1 < ${patch_dir}/9.0/50_fix_python-modules_path.patch + patch -t -p1 < ${patch_dir}/9.0/70_fix_python_numpy_warning.patch + patch -t -p1 < ${patch_dir}/9.0/fix-limits.patch + patch -t -p1 < ${patch_dir}/9.0/vtk-9.0.3-proj-api-fix-upstream-commit-03256388.patch fi # VTK 9.1.x patches: https://sources.debian.org/patches/vtk9/ if version_eq "${major}.${minor}" '9.1'; then # VTK == 9.1.x cd ${src_dir} - patch -t -p1 < ${script_dir}/patches/vtk/9.1/gcc-13.patch + patch -t -p1 < ${patch_dir}/9.1/gcc-13.patch fi # VTK 9.2.x patches if version_eq "${major}.${minor}" '9.2'; then # VTK == 9.2.x cd ${src_dir} - patch -t -p1 < ${script_dir}/patches/vtk/9.2/gcc-13.patch + patch -t -p1 < ${patch_dir}/9.2/gcc-13.patch fi # Build and install diff --git a/scripts/custom/setup_custom.sh b/scripts/custom/setup_custom.sh index 5147d36..ce37369 100755 --- a/scripts/custom/setup_custom.sh +++ b/scripts/custom/setup_custom.sh @@ -1,23 +1,19 @@ #!/bin/sh # Setup required libraries for building Chaste dependencies on Ubuntu LTS -script_dir="$( - cd "$(dirname "$0")" - pwd -)" +script_dir="$(cd "$(dirname "$0")"; pwd)" +. ${script_dir}/common.sh -codename="$(. /etc/os-release && echo ${VERSION_CODENAME} | sed 's/\.//')" - -if [ "${codename}" = 'jammy' ]; then +if [ "${OS_VERSION_CODENAME}" = 'jammy' ]; then ${script_dir}/setup_ubuntu_2204.sh -elif [ "${codename}" = 'noble' ]; then +elif [ "${OS_VERSION_CODENAME}" = 'noble' ]; then ${script_dir}/setup_ubuntu_2404.sh -elif [ "${codename}" = 'resolute' ]; then +elif [ "${OS_VERSION_CODENAME}" = 'resolute' ]; then ${script_dir}/setup_ubuntu_2604.sh else - echo "Unsupported Ubuntu version: ${codename}" + echo "Unsupported Ubuntu version: ${OS_VERSION_CODENAME}" exit 1 fi diff --git a/scripts/system/setup_system.sh b/scripts/system/setup_system.sh index 9601e3c..a6d6385 100755 --- a/scripts/system/setup_system.sh +++ b/scripts/system/setup_system.sh @@ -1,6 +1,8 @@ #!/bin/sh # Setup Chaste system dependency versions on Ubuntu +script_dir="$(cd "$(dirname "$0")"; pwd)" +. ${script_dir}/common.sh export DEBIAN_FRONTEND=noninteractive @@ -33,9 +35,8 @@ apt-get install -y --no-install-recommends \ valgrind # Chaste dependencies -codename="$(. /etc/os-release && echo ${VERSION_CODENAME} | sed 's/\.//')" -if [ "${codename}" = 'plucky' ]; then +if [ "${OS_VERSION_CODENAME}" = 'plucky' ]; then # Install manually: Ubuntu 25.04 Plucky Puffin repository not yet available apt-get install -y --no-install-recommends \ hdf5-tools \ @@ -55,7 +56,7 @@ if [ "${codename}" = 'plucky' ]; then libxerces-c-dev \ petsc-dev \ xsdcxx -elif [ "${codename}" = 'questing' ]; then +elif [ "${OS_VERSION_CODENAME}" = 'questing' ]; then # Install manually: Ubuntu 25.10 Questing Quokka repository not yet available apt-get install -y --no-install-recommends \ hdf5-tools \ @@ -78,14 +79,14 @@ elif [ "${codename}" = 'questing' ]; then else # Install from repository wget -O /usr/share/keyrings/chaste.asc https://chaste.github.io/chaste.asc - repo="deb [signed-by=/usr/share/keyrings/chaste.asc] https://chaste.github.io/ubuntu ${codename}/" + repo="deb [signed-by=/usr/share/keyrings/chaste.asc] https://chaste.github.io/ubuntu ${OS_VERSION_CODENAME}/" echo "${repo}" >/etc/apt/sources.list.d/chaste.list apt-get update && apt-get install -y --no-install-recommends chaste-dependencies fi # Workaround for libexpat1 issue on Ubuntu Jammy # https://bugs.launchpad.net/ubuntu/+source/expat/+bug/2058415 -if [ "${codename}" = 'jammy' ]; then +if [ "${OS_VERSION_CODENAME}" = 'jammy' ]; then apt-get install -y --allow-downgrades libexpat1=2.4.7-1 libexpat1-dev=2.4.7-1 apt-mark hold libexpat1 libexpat1-dev fi From ca3bffea738a095e5723901708bc41ae080b373b Mon Sep 17 00:00:00 2001 From: Kwabena Amponsah Date: Tue, 19 May 2026 19:16:29 +0100 Subject: [PATCH 05/16] #98 Change default base to resolute --- .github/workflows/docker-portability-custom.yml | 2 +- .github/workflows/docker-portability-system.yml | 2 +- Dockerfile.custom | 4 ++-- Dockerfile.system | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/docker-portability-custom.yml b/.github/workflows/docker-portability-custom.yml index 6af5bdb..ea8ed17 100644 --- a/.github/workflows/docker-portability-custom.yml +++ b/.github/workflows/docker-portability-custom.yml @@ -13,7 +13,7 @@ on: description: "Ubuntu codename" required: true type: string - default: "jammy" + default: "resolute" boost_ver: description: "Boost version" diff --git a/.github/workflows/docker-portability-system.yml b/.github/workflows/docker-portability-system.yml index 648614c..bb8bf5a 100644 --- a/.github/workflows/docker-portability-system.yml +++ b/.github/workflows/docker-portability-system.yml @@ -7,7 +7,7 @@ on: description: "Ubuntu codename" required: true type: string - default: "jammy" + default: "resolute" jobs: docker: diff --git a/Dockerfile.custom b/Dockerfile.custom index 6b02af4..ceff65a 100755 --- a/Dockerfile.custom +++ b/Dockerfile.custom @@ -1,5 +1,5 @@ # Build the image: -# docker build -f Dockerfile.custom --build-arg BASE=jammy --build-arg BOOST=1.74.0 ... -t chaste/runner:custom . +# docker build -f Dockerfile.custom --build-arg BASE=resolute --build-arg BOOST=1.74.0 ... -t chaste/runner:custom . # Run the container in interactive mode: # docker run --init -it -e RUNNER_OFF=1 chaste/runner:custom /bin/bash @@ -7,7 +7,7 @@ # Run the container as a GitHub Actions runner: # docker run --init -it chaste/runner:custom -ARG BASE=jammy +ARG BASE=resolute FROM ubuntu:${BASE} diff --git a/Dockerfile.system b/Dockerfile.system index 0f4582d..7beac13 100755 --- a/Dockerfile.system +++ b/Dockerfile.system @@ -1,5 +1,5 @@ # Build the image: -# docker build -f Dockerfile.system --build-arg BASE=jammy -t chaste/runner:system . +# docker build -f Dockerfile.system --build-arg BASE=resolute -t chaste/runner:system . # Run the container in interactive mode: # docker run --init -it -e RUNNER_OFF=1 chaste/runner:system /bin/bash @@ -7,7 +7,7 @@ # Run the container as a GitHub Actions runner: # docker run --init -it chaste/runner:system -ARG BASE=jammy +ARG BASE=resolute FROM ubuntu:${BASE} From 7460532fcc9c2a43d974637d4a79cf0d655f1d15 Mon Sep 17 00:00:00 2001 From: Kwabena Amponsah Date: Tue, 19 May 2026 19:26:51 +0100 Subject: [PATCH 06/16] #98 Add Ubuntu LTS versions to build workflows --- .github/workflows/build-boost.yml | 18 +++++++++++++++++- .github/workflows/build-hdf5.yml | 18 +++++++++++++++++- .github/workflows/build-petsc.yml | 18 +++++++++++++++++- .github/workflows/build-sundials.yml | 18 +++++++++++++++++- .github/workflows/build-vtk.yml | 18 +++++++++++++++++- .github/workflows/build-xercesc.yml | 18 +++++++++++++++++- .github/workflows/build-xsd.yml | 18 +++++++++++++++++- 7 files changed, 119 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build-boost.yml b/.github/workflows/build-boost.yml index 74f270d..db4888e 100644 --- a/.github/workflows/build-boost.yml +++ b/.github/workflows/build-boost.yml @@ -9,6 +9,16 @@ on: type: string default: "1.83.0" + ubuntu_codename: + description: "Ubuntu LTS" + required: true + type: choice + default: "resolute" + options: + - "jammy" + - "noble" + - "resolute" + defaults: run: shell: bash --login -e -o pipefail {0} # login for environment modules @@ -18,7 +28,13 @@ jobs: setup: name: Build Boost ${{ github.event.inputs.boost_ver }} - runs-on: ubuntu-22.04 + runs-on: ubuntu-latest + + container: + image: "ubuntu:${{ github.event.inputs.ubuntu_codename }}" + env: + RUNNER_OFF: 1 + options: --user 0 steps: - name: Checkout diff --git a/.github/workflows/build-hdf5.yml b/.github/workflows/build-hdf5.yml index 542868c..8649bd9 100644 --- a/.github/workflows/build-hdf5.yml +++ b/.github/workflows/build-hdf5.yml @@ -9,6 +9,16 @@ on: type: string default: "1.10.10" + ubuntu_codename: + description: "Ubuntu LTS" + required: true + type: choice + default: "resolute" + options: + - "jammy" + - "noble" + - "resolute" + defaults: run: shell: bash --login -e -o pipefail {0} # login for environment modules @@ -18,7 +28,13 @@ jobs: setup: name: Build HDF5 ${{github.event.inputs.hdf5_ver }} - runs-on: ubuntu-22.04 + runs-on: ubuntu-latest + + container: + image: "ubuntu:${{ github.event.inputs.ubuntu_codename }}" + env: + RUNNER_OFF: 1 + options: --user 0 steps: - name: Checkout diff --git a/.github/workflows/build-petsc.yml b/.github/workflows/build-petsc.yml index 639e6d5..5bff6a2 100644 --- a/.github/workflows/build-petsc.yml +++ b/.github/workflows/build-petsc.yml @@ -18,6 +18,16 @@ on: - "linux-gnu-opt" default: "linux-gnu" + ubuntu_codename: + description: "Ubuntu LTS" + required: true + type: choice + default: "resolute" + options: + - "jammy" + - "noble" + - "resolute" + defaults: run: shell: bash --login -e -o pipefail {0} # login for environment modules @@ -27,7 +37,13 @@ jobs: setup: name: Build PETSc ${{ github.event.inputs.petsc_ver }}/${{github.event.inputs.petsc_arch }} - runs-on: ubuntu-22.04 + runs-on: ubuntu-latest + + container: + image: "ubuntu:${{ github.event.inputs.ubuntu_codename }}" + env: + RUNNER_OFF: 1 + options: --user 0 steps: - name: Checkout diff --git a/.github/workflows/build-sundials.yml b/.github/workflows/build-sundials.yml index 8183a26..e67fd55 100644 --- a/.github/workflows/build-sundials.yml +++ b/.github/workflows/build-sundials.yml @@ -9,6 +9,16 @@ on: type: string default: "6.4.1" + ubuntu_codename: + description: "Ubuntu LTS" + required: true + type: choice + default: "resolute" + options: + - "jammy" + - "noble" + - "resolute" + defaults: run: shell: bash --login -e -o pipefail {0} # login for environment modules @@ -18,7 +28,13 @@ jobs: setup: name: Build SUNDIALS ${{ github.event.inputs.sundials_ver }} - runs-on: ubuntu-22.04 + runs-on: ubuntu-latest + + container: + image: "ubuntu:${{ github.event.inputs.ubuntu_codename }}" + env: + RUNNER_OFF: 1 + options: --user 0 steps: - name: Checkout diff --git a/.github/workflows/build-vtk.yml b/.github/workflows/build-vtk.yml index b71bbab..9b9c0ed 100644 --- a/.github/workflows/build-vtk.yml +++ b/.github/workflows/build-vtk.yml @@ -9,6 +9,16 @@ on: type: string default: "9.1.0" + ubuntu_codename: + description: "Ubuntu LTS" + required: true + type: choice + default: "resolute" + options: + - "jammy" + - "noble" + - "resolute" + defaults: run: shell: bash --login -e -o pipefail {0} # login for environment modules @@ -18,7 +28,13 @@ jobs: setup: name: Build VTK ${{ github.event.inputs.vtk_ver }} - runs-on: ubuntu-22.04 + runs-on: ubuntu-latest + + container: + image: "ubuntu:${{ github.event.inputs.ubuntu_codename }}" + env: + RUNNER_OFF: 1 + options: --user 0 steps: - name: Checkout diff --git a/.github/workflows/build-xercesc.yml b/.github/workflows/build-xercesc.yml index 09d680d..251c4a3 100644 --- a/.github/workflows/build-xercesc.yml +++ b/.github/workflows/build-xercesc.yml @@ -9,6 +9,16 @@ on: type: string default: "3.2.4" + ubuntu_codename: + description: "Ubuntu LTS" + required: true + type: choice + default: "resolute" + options: + - "jammy" + - "noble" + - "resolute" + defaults: run: shell: bash --login -e -o pipefail {0} # login for environment modules @@ -18,7 +28,13 @@ jobs: setup: name: Build Xerces-C ${{ github.event.inputs.xercesc_ver }} - runs-on: ubuntu-22.04 + runs-on: ubuntu-latest + + container: + image: "ubuntu:${{ github.event.inputs.ubuntu_codename }}" + env: + RUNNER_OFF: 1 + options: --user 0 steps: - name: Checkout diff --git a/.github/workflows/build-xsd.yml b/.github/workflows/build-xsd.yml index 57ccde2..81756c1 100644 --- a/.github/workflows/build-xsd.yml +++ b/.github/workflows/build-xsd.yml @@ -9,6 +9,16 @@ on: type: string default: "4.0.0" + ubuntu_codename: + description: "Ubuntu LTS" + required: true + type: choice + default: "resolute" + options: + - "jammy" + - "noble" + - "resolute" + defaults: run: shell: bash --login -e -o pipefail {0} # login for environment modules @@ -18,7 +28,13 @@ jobs: setup: name: Build XSD ${{ github.event.inputs.xsd_ver }} - runs-on: ubuntu-22.04 + runs-on: ubuntu-latest + + container: + image: "ubuntu:${{ github.event.inputs.ubuntu_codename }}" + env: + RUNNER_OFF: 1 + options: --user 0 steps: - name: Checkout From feb87ee6ce0e3c09cf21e2cb8e2b91a7c2364a42 Mon Sep 17 00:00:00 2001 From: Kwabena Amponsah Date: Tue, 19 May 2026 19:33:44 +0100 Subject: [PATCH 07/16] #98 Update build workflows --- .github/workflows/build-all.yml | 2 +- .github/workflows/build-boost.yml | 2 +- .github/workflows/build-hdf5.yml | 2 +- .github/workflows/build-petsc.yml | 2 +- .github/workflows/build-sundials.yml | 4 ++-- .github/workflows/build-vtk.yml | 4 ++-- .github/workflows/build-xercesc.yml | 2 +- .github/workflows/build-xsd.yml | 2 +- 8 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build-all.yml b/.github/workflows/build-all.yml index e260c0b..8b488ad 100644 --- a/.github/workflows/build-all.yml +++ b/.github/workflows/build-all.yml @@ -89,7 +89,7 @@ jobs: - name: Setup OS run: | - sudo ./setup_custom.sh + ./setup_custom.sh - name: List environment modules run: | diff --git a/.github/workflows/build-boost.yml b/.github/workflows/build-boost.yml index db4888e..05031f5 100644 --- a/.github/workflows/build-boost.yml +++ b/.github/workflows/build-boost.yml @@ -47,7 +47,7 @@ jobs: - name: Setup OS run: | - sudo ./setup_custom.sh + ./setup_custom.sh - name: List environment modules run: | diff --git a/.github/workflows/build-hdf5.yml b/.github/workflows/build-hdf5.yml index 8649bd9..dda5e26 100644 --- a/.github/workflows/build-hdf5.yml +++ b/.github/workflows/build-hdf5.yml @@ -47,7 +47,7 @@ jobs: - name: Setup OS run: | - sudo ./setup_custom.sh + ./setup_custom.sh - name: List environment modules run: | diff --git a/.github/workflows/build-petsc.yml b/.github/workflows/build-petsc.yml index 5bff6a2..cfbd6b1 100644 --- a/.github/workflows/build-petsc.yml +++ b/.github/workflows/build-petsc.yml @@ -57,7 +57,7 @@ jobs: - name: Setup OS run: | - sudo ./setup_custom.sh + ./setup_custom.sh - name: List environment modules run: | diff --git a/.github/workflows/build-sundials.yml b/.github/workflows/build-sundials.yml index e67fd55..2101250 100644 --- a/.github/workflows/build-sundials.yml +++ b/.github/workflows/build-sundials.yml @@ -47,8 +47,8 @@ jobs: - name: Setup OS run: | - sudo ./setup_custom.sh && \ - sudo apt-get install -y mpi-default-bin mpi-default-dev + ./setup_custom.sh && \ + apt-get install -y mpi-default-bin mpi-default-dev - name: List environment modules run: | diff --git a/.github/workflows/build-vtk.yml b/.github/workflows/build-vtk.yml index 9b9c0ed..55a1478 100644 --- a/.github/workflows/build-vtk.yml +++ b/.github/workflows/build-vtk.yml @@ -47,8 +47,8 @@ jobs: - name: Setup OS run: | - sudo ./setup_custom.sh && \ - sudo apt-get install -y libboost-dev mpi-default-bin mpi-default-dev + ./setup_custom.sh && \ + apt-get install -y libboost-dev mpi-default-bin mpi-default-dev - name: List environment modules run: | diff --git a/.github/workflows/build-xercesc.yml b/.github/workflows/build-xercesc.yml index 251c4a3..91bd722 100644 --- a/.github/workflows/build-xercesc.yml +++ b/.github/workflows/build-xercesc.yml @@ -47,7 +47,7 @@ jobs: - name: Setup OS run: | - sudo ./setup_custom.sh + ./setup_custom.sh - name: List environment modules run: | diff --git a/.github/workflows/build-xsd.yml b/.github/workflows/build-xsd.yml index 81756c1..c1291bb 100644 --- a/.github/workflows/build-xsd.yml +++ b/.github/workflows/build-xsd.yml @@ -47,7 +47,7 @@ jobs: - name: Setup OS run: | - sudo ./setup_custom.sh + ./setup_custom.sh - name: List environment modules run: | From 425283659978c3d5838f0c64f141c274a363cf1b Mon Sep 17 00:00:00 2001 From: Kwabena Amponsah Date: Tue, 19 May 2026 19:50:46 +0100 Subject: [PATCH 08/16] #98 Use bash everywhere --- scripts/custom/setup_custom.sh | 2 +- scripts/custom/setup_ubuntu_2204.sh | 2 +- scripts/custom/setup_ubuntu_2404.sh | 2 +- scripts/custom/setup_ubuntu_2604.sh | 2 +- scripts/system/setup_system.sh | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/custom/setup_custom.sh b/scripts/custom/setup_custom.sh index ce37369..140afb7 100755 --- a/scripts/custom/setup_custom.sh +++ b/scripts/custom/setup_custom.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # Setup required libraries for building Chaste dependencies on Ubuntu LTS script_dir="$(cd "$(dirname "$0")"; pwd)" diff --git a/scripts/custom/setup_ubuntu_2204.sh b/scripts/custom/setup_ubuntu_2204.sh index dd3ce3c..7c98384 100755 --- a/scripts/custom/setup_ubuntu_2204.sh +++ b/scripts/custom/setup_ubuntu_2204.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # Setup required libraries for building Chaste dependencies on Ubuntu 22.04 Jammy LTS diff --git a/scripts/custom/setup_ubuntu_2404.sh b/scripts/custom/setup_ubuntu_2404.sh index 8abf94d..fe49fbc 100755 --- a/scripts/custom/setup_ubuntu_2404.sh +++ b/scripts/custom/setup_ubuntu_2404.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # Setup required libraries for building Chaste dependencies on Ubuntu 22.04 Noble LTS diff --git a/scripts/custom/setup_ubuntu_2604.sh b/scripts/custom/setup_ubuntu_2604.sh index 1930348..50e2c63 100755 --- a/scripts/custom/setup_ubuntu_2604.sh +++ b/scripts/custom/setup_ubuntu_2604.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # Setup required libraries for building Chaste dependencies on Ubuntu 26.04 Resolute LTS diff --git a/scripts/system/setup_system.sh b/scripts/system/setup_system.sh index a6d6385..8a88465 100755 --- a/scripts/system/setup_system.sh +++ b/scripts/system/setup_system.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # Setup Chaste system dependency versions on Ubuntu script_dir="$(cd "$(dirname "$0")"; pwd)" From 7d137cc06c774e194d68dc93ff05f75e48705f79 Mon Sep 17 00:00:00 2001 From: Kwabena Amponsah Date: Tue, 19 May 2026 20:14:16 +0100 Subject: [PATCH 09/16] #98 Update resolute custom versions --- scripts/custom/setup_ubuntu_2604.sh | 38 ++++++++++++++--------------- 1 file changed, 18 insertions(+), 20 deletions(-) diff --git a/scripts/custom/setup_ubuntu_2604.sh b/scripts/custom/setup_ubuntu_2604.sh index 50e2c63..148a8a3 100755 --- a/scripts/custom/setup_ubuntu_2604.sh +++ b/scripts/custom/setup_ubuntu_2604.sh @@ -34,7 +34,7 @@ apt-get install -y --no-install-recommends \ # Chaste dependencies apt-get install -y --no-install-recommends \ - libfftw3-3 \ + libfftw3-double3 \ libfftw3-bin \ libfftw3-dev \ mpi-default-bin \ @@ -42,24 +42,22 @@ apt-get install -y --no-install-recommends \ # VTK dependencies apt-get install -y --no-install-recommends \ - freeglut3 \ freeglut3-dev \ libavcodec-dev \ - libavcodec58 \ + libavcodec62 \ libavformat-dev \ - libavformat58 \ + libavformat62 \ libavutil-dev \ - libavutil56 \ + libavutil60 \ libdouble-conversion-dev \ libdouble-conversion3 \ libeigen3-dev \ libfmt-dev \ - libfmt8 \ + libfmt10 \ libfontconfig1 \ libfreetype6 \ - libfreetype6-dev \ + libfreetype-dev \ libgl1-mesa-dev \ - libgl1-mesa-glx \ libgl2ps-dev \ libgl2ps1.4 \ libglew-dev \ @@ -70,37 +68,37 @@ apt-get install -y --no-install-recommends \ libjpeg-dev \ libjpeg8 \ libjsoncpp-dev \ - libjsoncpp25 \ + libjsoncpp26 \ liblz4-1 \ liblz4-dev \ liblzma5 \ libmysqlclient-dev \ - libmysqlclient21 \ - libnetcdf-c++4 \ - libnetcdf-cxx-legacy-dev \ + libmysqlclient24 \ + libnetcdf-c++4-1 \ libnetcdf-dev \ - libnetcdf19 \ + libnetcdf-dev \ + libnetcdf22 \ libodbc2 \ libogg-dev \ libogg0 \ libopengl0 \ libpng-dev \ - libpng16-16 \ + libpng16-16t64 \ libpq-dev \ libpq5 \ libproj-dev \ - libproj22 \ + libproj25 \ libsqlite3-0 \ libsqlite3-dev \ libswscale-dev \ - libswscale5 \ + libswscale9 \ libtbb-dev \ libtbb12 \ libtcl8.6 \ libtheora-dev \ - libtheora0 \ + libtheora1 \ libtiff-dev \ - libtiff5 \ + libtiff6 \ libtk8.6 \ libutfcpp-dev \ libx11-6 \ @@ -108,8 +106,8 @@ apt-get install -y --no-install-recommends \ libxcursor-dev \ libxcursor1 \ libxft-dev \ - libxml2 \ - libxml2-dev \ + libxml++2.6-2v5 \ + libxml++2.6-dev \ libxss-dev \ libxt-dev \ libxt6 \ From 6511eb06a4f7fe36d48d101de505b8769778d4dd Mon Sep 17 00:00:00 2001 From: Kwabena Amponsah Date: Wed, 20 May 2026 13:06:39 +0100 Subject: [PATCH 10/16] #98 Simplify common.sh --- scripts/common.sh | 146 +-------------------------- scripts/custom/common.sh | 1 - scripts/custom/install_boost.sh | 4 +- scripts/custom/install_cmake.sh | 4 +- scripts/custom/install_hdf5.sh | 7 +- scripts/custom/install_petsc.sh | 4 +- scripts/custom/install_petsc_hdf5.sh | 4 +- scripts/custom/install_python.sh | 4 +- scripts/custom/install_sundials.sh | 4 +- scripts/custom/install_vtk.sh | 4 +- scripts/custom/install_xercesc.sh | 4 +- scripts/custom/install_xsd.sh | 4 +- scripts/custom/setup_custom.sh | 4 +- scripts/custom/setup_ubuntu_2404.sh | 2 +- scripts/custom/setup_ubuntu_2604.sh | 1 - scripts/env.sh | 13 +++ scripts/functions.sh | 143 ++++++++++++++++++++++++++ scripts/system/common.sh | 1 - scripts/system/setup_system.sh | 4 +- tests/test_common.sh | 2 +- 20 files changed, 186 insertions(+), 174 deletions(-) delete mode 120000 scripts/custom/common.sh create mode 100644 scripts/env.sh create mode 100644 scripts/functions.sh delete mode 120000 scripts/system/common.sh diff --git a/scripts/common.sh b/scripts/common.sh index 6bad333..5f0c785 100644 --- a/scripts/common.sh +++ b/scripts/common.sh @@ -1,146 +1,8 @@ #!/bin/bash -eu -# Split version string, setting minor and patch to 0 if missing. -# -# Usage: split_version -# -# Returns: version major minor patch[ rc] -# -# Examples: -# `split_version 1` -> 1.0.0 1 0 0 -# `split_version 1.2` -> 1.2.0 1 2 0 -# `split_version 1.2.3` -> 1.2.3 1 2 3 -# `split_version 1.2.3-rc1` -> 1.2.3-rc1 1 2 3 rc1 -split_version() -{ - local varr="" parr="" major="" minor="0" patch="0" rc="" - varr=(${1//\./ }) # split version string on '.' - major=${varr[0]} - if [ ${#varr[@]} -ge 2 ]; then - minor=${varr[1]} - if [ ${#varr[@]} -ge 3 ]; then - parr=(${varr[2]//-/ }) # split patch substring on '-' - patch=${parr[0]} - if [ ${#parr[@]} -ge 2 ]; then - rc=${parr[1]} - fi - fi - fi - if [ -z "${rc}" ]; then - echo "${major}.${minor}.${patch}" "${major}" "${minor}" "${patch}" - else - echo "${major}.${minor}.${patch}-${rc}" "${major}" "${minor}" "${patch}" "${rc}" - fi -} +script_dir=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) # https://stackoverflow.com/a/246128 -# Compare two version strings, ignoring release candidate. -# -# Usage: compare_version -# -# Returns: -# -1 if version_x < version_y -# 0 if version_x == version_y -# 1 if version_x > version_y -# -# Examples: -# `compare_version 1.2.3 1.2.3` -> 0 -# `compare_version 1.2.3 1.2.4` -> -1 -# `compare_version 1.2.4 1.2.3` -> 1 -compare_version() -{ - local arr_x maj_x min_x patch_x - local arr_y maj_y min_y patch_y +. ${script_dir}/env.sh +. ${script_dir}/functions.sh - read -r _ maj_x min_x patch_x _ < <(split_version $1) - read -r _ maj_y min_y patch_y _ < <(split_version $2) - - arr_x=("${maj_x}" "${min_x}" "${patch_x}") - arr_y=("${maj_y}" "${min_y}" "${patch_y}") - - for i in $(seq 0 2); do - if ((arr_x[i] > arr_y[i])); then - echo 1 - return - elif ((arr_x[i] < arr_y[i])); then - echo -1 - return - fi - done - - echo 0 -} - -# Check if version_x is equal to version_y. -# -# Usage: version_eq -# -# Returns: true if version_x == version_y, false otherwise -# -# Examples: -# `version_eq 1.2.3 1.2.3` -> true -# `version_eq 1.2.3 1.2.4` -> false -version_eq() -{ - test "$(compare_version $1 $2)" -eq 0 -} - -# Check if version_x is less than version_y. -# -# Usage: version_lt -# -# Returns: true if version_x < version_y, false otherwise -# -# Examples: -# `version_lt 1.2.3 1.2.3` -> false -# `version_lt 1.2.3 1.2.4` -> true -version_lt() -{ - test "$(compare_version $1 $2)" -eq -1 -} - -# Check if version_x is greater than version_y. -# -# Usage: version_gt -# -# Returns: true if version_x > version_y, false otherwise -# -# Examples: -# `version_gt 1.2.3 1.2.3` -> false -# `version_gt 1.2.4 1.2.3` -> true -version_gt() -{ - test "$(compare_version $1 $2)" -eq 1 -} - -# Check if version_x is less than or equal to version_y. -# -# Usage: version_le -# -# Returns: true if version_x <= version_y, false otherwise -# -# Examples: -# `version_le 1.2.3 1.2.3` -> true -# `version_le 1.2.3 1.2.4` -> true -# `version_le 1.2.4 1.2.3` -> false -version_le() -{ - ! version_gt $1 $2 -} - -# Check if version_x is greater than or equal to version_y. -# -# Usage: version_ge -# -# Returns: true if version_x >= version_y, false otherwise -# -# Examples: -# `version_ge 1.2.3 1.2.3` -> true -# `version_ge 1.2.4 1.2.3` -> true -# `version_ge 1.2.3 1.2.4` -> false -version_ge() -{ - ! version_lt $1 $2 -} - -OS_VERSION_ID="$(. /etc/os-release && echo ${VERSION_ID})" -OS_VERSION_CODENAME="$(. /etc/os-release && echo ${VERSION_CODENAME})" +unset script_dir diff --git a/scripts/custom/common.sh b/scripts/custom/common.sh deleted file mode 120000 index f918132..0000000 --- a/scripts/custom/common.sh +++ /dev/null @@ -1 +0,0 @@ -../common.sh \ No newline at end of file diff --git a/scripts/custom/install_boost.sh b/scripts/custom/install_boost.sh index 2c8018f..6ac3015 100755 --- a/scripts/custom/install_boost.sh +++ b/scripts/custom/install_boost.sh @@ -15,8 +15,8 @@ usage() exit 1 } -script_dir="$(cd "$(dirname "$0")"; pwd)" -. ${script_dir}/common.sh +script_dir=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) # https://stackoverflow.com/a/246128 +. ${script_dir}/../common.sh patch_dir="${script_dir}/patches/boost" diff --git a/scripts/custom/install_cmake.sh b/scripts/custom/install_cmake.sh index de74474..c1d0086 100755 --- a/scripts/custom/install_cmake.sh +++ b/scripts/custom/install_cmake.sh @@ -15,8 +15,8 @@ usage() exit 1 } -script_dir="$(cd "$(dirname "$0")"; pwd)" -. ${script_dir}/common.sh +script_dir=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) # https://stackoverflow.com/a/246128 +. ${script_dir}/../common.sh # Parse arguments version= diff --git a/scripts/custom/install_hdf5.sh b/scripts/custom/install_hdf5.sh index 6be6658..3c878c4 100755 --- a/scripts/custom/install_hdf5.sh +++ b/scripts/custom/install_hdf5.sh @@ -15,11 +15,8 @@ usage() exit 1 } -script_dir="$( - cd "$(dirname "$0")" - pwd -)" -. ${script_dir}/common.sh +script_dir=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) # https://stackoverflow.com/a/246128 +. ${script_dir}/../common.sh # Parse arguments version= diff --git a/scripts/custom/install_petsc.sh b/scripts/custom/install_petsc.sh index defb803..0390708 100755 --- a/scripts/custom/install_petsc.sh +++ b/scripts/custom/install_petsc.sh @@ -17,8 +17,8 @@ usage() exit 1 } -script_dir="$(cd "$(dirname "$0")"; pwd)" -. ${script_dir}/common.sh +script_dir=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) # https://stackoverflow.com/a/246128 +. ${script_dir}/../common.sh # Parse arguments version= diff --git a/scripts/custom/install_petsc_hdf5.sh b/scripts/custom/install_petsc_hdf5.sh index 4f07260..d55cc05 100755 --- a/scripts/custom/install_petsc_hdf5.sh +++ b/scripts/custom/install_petsc_hdf5.sh @@ -11,8 +11,8 @@ usage() exit 1 } -script_dir="$(cd "$(dirname "$0")"; pwd)" -. ${script_dir}/common.sh +script_dir=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) # https://stackoverflow.com/a/246128 +. ${script_dir}/../common.sh # Parse arguments petsc_version= diff --git a/scripts/custom/install_python.sh b/scripts/custom/install_python.sh index a0e108e..46ecfe4 100755 --- a/scripts/custom/install_python.sh +++ b/scripts/custom/install_python.sh @@ -6,8 +6,8 @@ usage() exit 1 } -script_dir="$(cd "$(dirname "$0")"; pwd)" -. ${script_dir}/common.sh +script_dir=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) # https://stackoverflow.com/a/246128 +. ${script_dir}/../common.sh # Parse arguments version= diff --git a/scripts/custom/install_sundials.sh b/scripts/custom/install_sundials.sh index 21b9a94..3b4f3f3 100755 --- a/scripts/custom/install_sundials.sh +++ b/scripts/custom/install_sundials.sh @@ -15,8 +15,8 @@ usage() exit 1 } -script_dir="$(cd "$(dirname "$0")"; pwd)" -. ${script_dir}/common.sh +script_dir=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) # https://stackoverflow.com/a/246128 +. ${script_dir}/../common.sh # Parse arguments version= diff --git a/scripts/custom/install_vtk.sh b/scripts/custom/install_vtk.sh index c38a402..88bb521 100755 --- a/scripts/custom/install_vtk.sh +++ b/scripts/custom/install_vtk.sh @@ -15,8 +15,8 @@ usage() exit 1 } -script_dir="$(cd "$(dirname "$0")"; pwd)" -. ${script_dir}/common.sh +script_dir=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) # https://stackoverflow.com/a/246128 +. ${script_dir}/../common.sh patch_dir="${script_dir}/patches/vtk" diff --git a/scripts/custom/install_xercesc.sh b/scripts/custom/install_xercesc.sh index 7049918..b9fa132 100755 --- a/scripts/custom/install_xercesc.sh +++ b/scripts/custom/install_xercesc.sh @@ -15,8 +15,8 @@ usage() exit 1 } -script_dir="$(cd "$(dirname "$0")"; pwd)" -. ${script_dir}/common.sh +script_dir=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) # https://stackoverflow.com/a/246128 +. ${script_dir}/../common.sh # Parse arguments version= diff --git a/scripts/custom/install_xsd.sh b/scripts/custom/install_xsd.sh index dd62ee4..c432a2f 100755 --- a/scripts/custom/install_xsd.sh +++ b/scripts/custom/install_xsd.sh @@ -14,8 +14,8 @@ usage() exit 1 } -script_dir="$(cd "$(dirname "$0")"; pwd)" -. ${script_dir}/common.sh +script_dir=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) # https://stackoverflow.com/a/246128 +. ${script_dir}/../common.sh # Parse arguments version= diff --git a/scripts/custom/setup_custom.sh b/scripts/custom/setup_custom.sh index 140afb7..8b8aa76 100755 --- a/scripts/custom/setup_custom.sh +++ b/scripts/custom/setup_custom.sh @@ -1,8 +1,8 @@ #!/bin/bash # Setup required libraries for building Chaste dependencies on Ubuntu LTS -script_dir="$(cd "$(dirname "$0")"; pwd)" -. ${script_dir}/common.sh +script_dir=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) # https://stackoverflow.com/a/246128 +. ${script_dir}/../common.sh if [ "${OS_VERSION_CODENAME}" = 'jammy' ]; then ${script_dir}/setup_ubuntu_2204.sh diff --git a/scripts/custom/setup_ubuntu_2404.sh b/scripts/custom/setup_ubuntu_2404.sh index fe49fbc..371f5c9 100755 --- a/scripts/custom/setup_ubuntu_2404.sh +++ b/scripts/custom/setup_ubuntu_2404.sh @@ -1,6 +1,6 @@ #!/bin/bash -# Setup required libraries for building Chaste dependencies on Ubuntu 22.04 Noble LTS +# Setup required libraries for building Chaste dependencies on Ubuntu 24.04 Noble LTS export DEBIAN_FRONTEND=noninteractive diff --git a/scripts/custom/setup_ubuntu_2604.sh b/scripts/custom/setup_ubuntu_2604.sh index 148a8a3..0aab6f2 100755 --- a/scripts/custom/setup_ubuntu_2604.sh +++ b/scripts/custom/setup_ubuntu_2604.sh @@ -76,7 +76,6 @@ apt-get install -y --no-install-recommends \ libmysqlclient24 \ libnetcdf-c++4-1 \ libnetcdf-dev \ - libnetcdf-dev \ libnetcdf22 \ libodbc2 \ libogg-dev \ diff --git a/scripts/env.sh b/scripts/env.sh new file mode 100644 index 0000000..5c0dec3 --- /dev/null +++ b/scripts/env.sh @@ -0,0 +1,13 @@ +#!/bin/bash -eu + +OS_VERSION_ID="" +OS_VERSION_CODENAME="" + +if [[ "$OSTYPE" =~ ^linux ]]; then + OS_VERSION_ID="$(. /etc/os-release && echo ${VERSION_ID})" + OS_VERSION_CODENAME="$(. /etc/os-release && echo ${VERSION_CODENAME})" + +elif [[ "$OSTYPE" =~ ^darwin ]]; then + OS_VERSION_ID="$(sw_vers -productVersion)" + OS_VERSION_CODENAME="$(sw_vers -productName)$(echo ${OS_VERSION_ID} | cut -d. -f1)" +fi diff --git a/scripts/functions.sh b/scripts/functions.sh new file mode 100644 index 0000000..3ab4f1d --- /dev/null +++ b/scripts/functions.sh @@ -0,0 +1,143 @@ +#!/bin/bash -eu + +# Split version string, setting minor and patch to 0 if missing. +# +# Usage: split_version +# +# Returns: version major minor patch[ rc] +# +# Examples: +# `split_version 1` -> 1.0.0 1 0 0 +# `split_version 1.2` -> 1.2.0 1 2 0 +# `split_version 1.2.3` -> 1.2.3 1 2 3 +# `split_version 1.2.3-rc1` -> 1.2.3-rc1 1 2 3 rc1 +split_version() +{ + local varr="" parr="" major="" minor="0" patch="0" rc="" + varr=(${1//\./ }) # split version string on '.' + major=${varr[0]} + if [ ${#varr[@]} -ge 2 ]; then + minor=${varr[1]} + if [ ${#varr[@]} -ge 3 ]; then + parr=(${varr[2]//-/ }) # split patch substring on '-' + patch=${parr[0]} + if [ ${#parr[@]} -ge 2 ]; then + rc=${parr[1]} + fi + fi + fi + if [ -z "${rc}" ]; then + echo "${major}.${minor}.${patch}" "${major}" "${minor}" "${patch}" + else + echo "${major}.${minor}.${patch}-${rc}" "${major}" "${minor}" "${patch}" "${rc}" + fi +} + +# Compare two version strings, ignoring release candidate. +# +# Usage: compare_version +# +# Returns: +# -1 if version_x < version_y +# 0 if version_x == version_y +# 1 if version_x > version_y +# +# Examples: +# `compare_version 1.2.3 1.2.3` -> 0 +# `compare_version 1.2.3 1.2.4` -> -1 +# `compare_version 1.2.4 1.2.3` -> 1 +compare_version() +{ + local arr_x maj_x min_x patch_x + local arr_y maj_y min_y patch_y + + read -r _ maj_x min_x patch_x _ < <(split_version $1) + read -r _ maj_y min_y patch_y _ < <(split_version $2) + + arr_x=("${maj_x}" "${min_x}" "${patch_x}") + arr_y=("${maj_y}" "${min_y}" "${patch_y}") + + for i in $(seq 0 2); do + if ((arr_x[i] > arr_y[i])); then + echo 1 + return + elif ((arr_x[i] < arr_y[i])); then + echo -1 + return + fi + done + + echo 0 +} + +# Check if version_x is equal to version_y. +# +# Usage: version_eq +# +# Returns: true if version_x == version_y, false otherwise +# +# Examples: +# `version_eq 1.2.3 1.2.3` -> true +# `version_eq 1.2.3 1.2.4` -> false +version_eq() +{ + test "$(compare_version $1 $2)" -eq 0 +} + +# Check if version_x is less than version_y. +# +# Usage: version_lt +# +# Returns: true if version_x < version_y, false otherwise +# +# Examples: +# `version_lt 1.2.3 1.2.3` -> false +# `version_lt 1.2.3 1.2.4` -> true +version_lt() +{ + test "$(compare_version $1 $2)" -eq -1 +} + +# Check if version_x is greater than version_y. +# +# Usage: version_gt +# +# Returns: true if version_x > version_y, false otherwise +# +# Examples: +# `version_gt 1.2.3 1.2.3` -> false +# `version_gt 1.2.4 1.2.3` -> true +version_gt() +{ + test "$(compare_version $1 $2)" -eq 1 +} + +# Check if version_x is less than or equal to version_y. +# +# Usage: version_le +# +# Returns: true if version_x <= version_y, false otherwise +# +# Examples: +# `version_le 1.2.3 1.2.3` -> true +# `version_le 1.2.3 1.2.4` -> true +# `version_le 1.2.4 1.2.3` -> false +version_le() +{ + ! version_gt $1 $2 +} + +# Check if version_x is greater than or equal to version_y. +# +# Usage: version_ge +# +# Returns: true if version_x >= version_y, false otherwise +# +# Examples: +# `version_ge 1.2.3 1.2.3` -> true +# `version_ge 1.2.4 1.2.3` -> true +# `version_ge 1.2.3 1.2.4` -> false +version_ge() +{ + ! version_lt $1 $2 +} diff --git a/scripts/system/common.sh b/scripts/system/common.sh deleted file mode 120000 index f918132..0000000 --- a/scripts/system/common.sh +++ /dev/null @@ -1 +0,0 @@ -../common.sh \ No newline at end of file diff --git a/scripts/system/setup_system.sh b/scripts/system/setup_system.sh index 8a88465..4a7af36 100755 --- a/scripts/system/setup_system.sh +++ b/scripts/system/setup_system.sh @@ -1,8 +1,8 @@ #!/bin/bash # Setup Chaste system dependency versions on Ubuntu -script_dir="$(cd "$(dirname "$0")"; pwd)" -. ${script_dir}/common.sh +script_dir=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) # https://stackoverflow.com/a/246128 +. ${script_dir}/../common.sh export DEBIAN_FRONTEND=noninteractive diff --git a/tests/test_common.sh b/tests/test_common.sh index b8351e3..3caf306 100644 --- a/tests/test_common.sh +++ b/tests/test_common.sh @@ -1,6 +1,6 @@ #!/bin/bash -eu -script_dir="$(cd "$(dirname "$0")"; pwd)" +script_dir=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) . ${script_dir}/../scripts/common.sh test_split_version() From 16d911cb52eca48b360de34ccf08b36c717794bb Mon Sep 17 00:00:00 2001 From: Kwabena Amponsah Date: Wed, 20 May 2026 13:24:11 +0100 Subject: [PATCH 11/16] #98 Install python-is-python3 --- scripts/common.sh | 8 ++++---- scripts/custom/setup_ubuntu_2204.sh | 4 +--- scripts/custom/setup_ubuntu_2404.sh | 4 +--- scripts/custom/setup_ubuntu_2604.sh | 4 +--- scripts/system/setup_system.sh | 4 +--- 5 files changed, 8 insertions(+), 16 deletions(-) diff --git a/scripts/common.sh b/scripts/common.sh index 5f0c785..e59752f 100644 --- a/scripts/common.sh +++ b/scripts/common.sh @@ -1,8 +1,8 @@ #!/bin/bash -eu -script_dir=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) # https://stackoverflow.com/a/246128 +common_dir=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) # https://stackoverflow.com/a/246128 -. ${script_dir}/env.sh -. ${script_dir}/functions.sh +. ${common_dir}/env.sh +. ${common_dir}/functions.sh -unset script_dir +unset common_dir diff --git a/scripts/custom/setup_ubuntu_2204.sh b/scripts/custom/setup_ubuntu_2204.sh index 7c98384..a34cfe6 100755 --- a/scripts/custom/setup_ubuntu_2204.sh +++ b/scripts/custom/setup_ubuntu_2204.sh @@ -24,6 +24,7 @@ apt-get install -y --no-install-recommends \ doxygen \ git \ lcov \ + python-is-python3 \ python3 \ python3-dev \ python3-pip \ @@ -126,6 +127,3 @@ apt-get install -y --no-install-recommends \ # libgdal-dev libgdal30: # To be supplied by custom VTK build due to reliance on system boost. - -update-alternatives --install /usr/local/bin/python python /usr/bin/python3 10 -update-alternatives --install /usr/local/bin/pip pip /usr/bin/pip3 10 diff --git a/scripts/custom/setup_ubuntu_2404.sh b/scripts/custom/setup_ubuntu_2404.sh index 371f5c9..53a8f1c 100755 --- a/scripts/custom/setup_ubuntu_2404.sh +++ b/scripts/custom/setup_ubuntu_2404.sh @@ -26,6 +26,7 @@ apt-get install -y --no-install-recommends \ doxygen \ git \ lcov \ + python-is-python3 \ python3 \ python3-dev \ python3-pip \ @@ -125,6 +126,3 @@ apt-get install -y --no-install-recommends \ # libgdal-dev libgdal30: # To be supplied by custom VTK build due to reliance on system boost. - -update-alternatives --install /usr/local/bin/python python /usr/bin/python3 10 -update-alternatives --install /usr/local/bin/pip pip /usr/bin/pip3 10 diff --git a/scripts/custom/setup_ubuntu_2604.sh b/scripts/custom/setup_ubuntu_2604.sh index 0aab6f2..e38e9af 100755 --- a/scripts/custom/setup_ubuntu_2604.sh +++ b/scripts/custom/setup_ubuntu_2604.sh @@ -26,6 +26,7 @@ apt-get install -y --no-install-recommends \ doxygen \ git \ lcov \ + python-is-python3 \ python3 \ python3-dev \ python3-pip \ @@ -122,6 +123,3 @@ apt-get install -y --no-install-recommends \ # libgdal-dev libgdal30: # To be supplied by custom VTK build due to reliance on system boost. - -update-alternatives --install /usr/local/bin/python python /usr/bin/python3 10 -update-alternatives --install /usr/local/bin/pip pip /usr/bin/pip3 10 diff --git a/scripts/system/setup_system.sh b/scripts/system/setup_system.sh index 4a7af36..6752384 100755 --- a/scripts/system/setup_system.sh +++ b/scripts/system/setup_system.sh @@ -28,6 +28,7 @@ apt-get install -y --no-install-recommends \ doxygen \ git \ lcov \ + python-is-python3 \ python3 \ python3-dev \ python3-pip \ @@ -90,6 +91,3 @@ if [ "${OS_VERSION_CODENAME}" = 'jammy' ]; then apt-get install -y --allow-downgrades libexpat1=2.4.7-1 libexpat1-dev=2.4.7-1 apt-mark hold libexpat1 libexpat1-dev fi - -update-alternatives --install /usr/local/bin/python python /usr/bin/python3 10 -update-alternatives --install /usr/local/bin/pip pip /usr/bin/pip3 10 From 4bee625f9005edfa580a332ae427d020a3e83c6d Mon Sep 17 00:00:00 2001 From: Kwabena Amponsah Date: Wed, 20 May 2026 15:50:22 +0100 Subject: [PATCH 12/16] #98 Update noble custom versions --- scripts/custom/install_boost.sh | 2 +- scripts/custom/install_cmake.sh | 2 +- scripts/custom/install_hdf5.sh | 2 +- scripts/custom/install_petsc.sh | 2 +- scripts/custom/install_sundials.sh | 2 +- scripts/custom/install_vtk.sh | 2 +- scripts/custom/install_xercesc.sh | 2 +- scripts/custom/install_xsd.sh | 2 +- scripts/custom/setup_ubuntu_2404.sh | 27 ++++++++++++--------------- 9 files changed, 20 insertions(+), 23 deletions(-) diff --git a/scripts/custom/install_boost.sh b/scripts/custom/install_boost.sh index 6ac3015..8a1a3cb 100755 --- a/scripts/custom/install_boost.sh +++ b/scripts/custom/install_boost.sh @@ -2,7 +2,7 @@ # Installs Boost from source and creates a modulefile for it. # Arguments: -# --version=version: The Boost version to install (e.g., 1.74.0). +# --version=version: The Boost version to install (e.g. 1.74.0). # --modules-dir=path: The base directory for the installation and modulefile. # --parallel=value: The number of parallel jobs to use for building (default: number of CPU cores). # Example usage: diff --git a/scripts/custom/install_cmake.sh b/scripts/custom/install_cmake.sh index c1d0086..8d56f08 100755 --- a/scripts/custom/install_cmake.sh +++ b/scripts/custom/install_cmake.sh @@ -2,7 +2,7 @@ # Installs CMake from source and creates a modulefile for it. # Arguments: -# --version=version: The CMake version to install (e.g., 3.21.2). +# --version=version: The CMake version to install (e.g. 3.21.2). # --modules-dir=path: The base directory for the installation and modulefile. # --parallel=value: The number of parallel jobs to use for building (default: number of CPU cores). # Example usage: diff --git a/scripts/custom/install_hdf5.sh b/scripts/custom/install_hdf5.sh index 3c878c4..dd66489 100755 --- a/scripts/custom/install_hdf5.sh +++ b/scripts/custom/install_hdf5.sh @@ -2,7 +2,7 @@ # Installs HDF5 from source and creates a modulefile for it. # Arguments: -# --version=version: The HDF5 version to install (e.g., 1.12.0). +# --version=version: The HDF5 version to install (e.g. 1.12.0). # --modules-dir=path: The base directory for the installation and modulefile. # --parallel=value: The number of parallel jobs to use for building (default: number of CPU cores). # Example usage: diff --git a/scripts/custom/install_petsc.sh b/scripts/custom/install_petsc.sh index 0390708..dd00828 100755 --- a/scripts/custom/install_petsc.sh +++ b/scripts/custom/install_petsc.sh @@ -2,7 +2,7 @@ # Installs PETSc from source and adds a modulefile for it. # Arguments: -# --version=version: The PETSc version to install (e.g., 3.15.0). +# --version=version: The PETSc version to install (e.g. 3.15.0). # --arch=[{linux-gnu|linux-gnu-opt}]: The build type (default: linux-gnu). # --modules-dir=path: The base directory for the installation and modulefile. # --parallel=value: The number of parallel jobs to use for building (default: number of CPU cores). diff --git a/scripts/custom/install_sundials.sh b/scripts/custom/install_sundials.sh index 3b4f3f3..b1fba31 100755 --- a/scripts/custom/install_sundials.sh +++ b/scripts/custom/install_sundials.sh @@ -2,7 +2,7 @@ # Installs Sundials from source and creates a modulefile for it. # Arguments: -# --version=version: The Sundials version to install (e.g., 5.7.0). +# --version=version: The Sundials version to install (e.g. 5.7.0). # --modules-dir=path: The base directory for the installation and modulefile. # --parallel=value: The number of parallel jobs to use for building (default: number of CPU cores). # Example usage: diff --git a/scripts/custom/install_vtk.sh b/scripts/custom/install_vtk.sh index 88bb521..b2317bf 100755 --- a/scripts/custom/install_vtk.sh +++ b/scripts/custom/install_vtk.sh @@ -2,7 +2,7 @@ # Installs VTK from source and creates a modulefile for it. # Arguments: -# --version=version: The VTK version to install (e.g., 9.3.0). +# --version=version: The VTK version to install (e.g. 9.3.0). # --modules-dir=path: The base directory for the installation and modulefile. # --parallel=value: The number of parallel jobs to use for building (default: number of CPU cores). # Example usage: diff --git a/scripts/custom/install_xercesc.sh b/scripts/custom/install_xercesc.sh index b9fa132..158b9a9 100755 --- a/scripts/custom/install_xercesc.sh +++ b/scripts/custom/install_xercesc.sh @@ -2,7 +2,7 @@ # Installs Xerces-C++ from source and creates a modulefile for it. # Arguments: -# --version=version: Version of Xerces-C++ to install (e.g., 3.2.3) +# --version=version: Version of Xerces-C++ to install (e.g. 3.2.3) # --modules-dir=path: The base directory for the installation and modulefile. # --parallel=value: Number of parallel jobs for building (default: number of CPU cores) # Example usage: diff --git a/scripts/custom/install_xsd.sh b/scripts/custom/install_xsd.sh index c432a2f..c221b74 100755 --- a/scripts/custom/install_xsd.sh +++ b/scripts/custom/install_xsd.sh @@ -2,7 +2,7 @@ # Installs XSD from source and creates a modulefile for it. # Arguments: -# --version=version: Version of XSD to install (e.g., 4.0.0) +# --version=version: Version of XSD to install (e.g. 4.0.0) # --modules-dir=path: The base directory for the installation and modulefile. # Example usage: # ./install_xsd.sh --version=4.0.0 --modules-dir=/path/to/modules diff --git a/scripts/custom/setup_ubuntu_2404.sh b/scripts/custom/setup_ubuntu_2404.sh index 53a8f1c..28797ef 100755 --- a/scripts/custom/setup_ubuntu_2404.sh +++ b/scripts/custom/setup_ubuntu_2404.sh @@ -43,24 +43,22 @@ apt-get install -y --no-install-recommends \ # VTK dependencies apt-get install -y --no-install-recommends \ - freeglut3 \ freeglut3-dev \ libavcodec-dev \ - libavcodec58 \ + libavcodec60 \ libavformat-dev \ - libavformat58 \ + libavformat60 \ libavutil-dev \ - libavutil56 \ + libavutil58 \ libdouble-conversion-dev \ libdouble-conversion3 \ libeigen3-dev \ libfmt-dev \ - libfmt8 \ + libfmt9 \ libfontconfig1 \ libfreetype6 \ - libfreetype6-dev \ + libfreetype-dev \ libgl1-mesa-dev \ - libgl1-mesa-glx \ libgl2ps-dev \ libgl2ps1.4 \ libglew-dev \ @@ -77,31 +75,30 @@ apt-get install -y --no-install-recommends \ liblzma5 \ libmysqlclient-dev \ libmysqlclient21 \ - libnetcdf-c++4 \ - libnetcdf-cxx-legacy-dev \ + libnetcdf-c++4-1 \ libnetcdf-dev \ - libnetcdf19 \ + libnetcdf19t64 \ libodbc2 \ libogg-dev \ libogg0 \ libopengl0 \ libpng-dev \ - libpng16-16 \ + libpng16-16t64 \ libpq-dev \ libpq5 \ libproj-dev \ - libproj22 \ + libproj25 \ libsqlite3-0 \ libsqlite3-dev \ libswscale-dev \ - libswscale5 \ + libswscale7 \ libtbb-dev \ libtbb12 \ libtcl8.6 \ libtheora-dev \ libtheora0 \ libtiff-dev \ - libtiff5 \ + libtiff6 \ libtk8.6 \ libutfcpp-dev \ libx11-6 \ @@ -113,7 +110,7 @@ apt-get install -y --no-install-recommends \ libxml2-dev \ libxss-dev \ libxt-dev \ - libxt6 \ + libxt6t64 \ sqlite3 \ tcl-dev \ tk-dev \ From ae1aea29308be8129317b7f1b937bd70949feb67 Mon Sep 17 00:00:00 2001 From: Kwabena Amponsah Date: Wed, 20 May 2026 16:15:37 +0100 Subject: [PATCH 13/16] #98 Restrict custom docker to LTS --- .github/workflows/build-all.yml | 18 +++++++++++++++++- .../workflows/docker-portability-custom.yml | 9 +++++++-- 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-all.yml b/.github/workflows/build-all.yml index 8b488ad..e4e37a2 100644 --- a/.github/workflows/build-all.yml +++ b/.github/workflows/build-all.yml @@ -3,6 +3,16 @@ name: Build all on: workflow_dispatch: inputs: + ubuntu_codename: + description: "Ubuntu LTS" + required: true + type: choice + default: "resolute" + options: + - "jammy" + - "noble" + - "resolute" + boost_ver: description: "Boost version" required: true @@ -63,7 +73,13 @@ jobs: setup: name: Build all dependencies - runs-on: ubuntu-22.04 + runs-on: ubuntu-latest + + container: + image: "ubuntu:${{ github.event.inputs.ubuntu_codename }}" + env: + RUNNER_OFF: 1 + options: --user 0 steps: - name: Checkout diff --git a/.github/workflows/docker-portability-custom.yml b/.github/workflows/docker-portability-custom.yml index ea8ed17..8b05f88 100644 --- a/.github/workflows/docker-portability-custom.yml +++ b/.github/workflows/docker-portability-custom.yml @@ -10,10 +10,14 @@ on: default: "dev" ubuntu_codename: - description: "Ubuntu codename" + description: "Ubuntu LTS" required: true - type: string + type: choice default: "resolute" + options: + - "jammy" + - "noble" + - "resolute" boost_ver: description: "Boost version" @@ -66,6 +70,7 @@ jobs: include: - tags: chaste/runner:portability-${{github.event.inputs.tag_suffix }} build-args: | + BASE=${{ github.event.inputs.ubuntu_codename }} BOOST=${{ github.event.inputs.boost_ver }} HDF5=${{ github.event.inputs.hdf5_ver }} PETSC=${{ github.event.inputs.petsc_ver }} From 84f4811f533263137b3aea66de34110625ca765c Mon Sep 17 00:00:00 2001 From: Kwabena Amponsah Date: Thu, 21 May 2026 17:28:05 +0100 Subject: [PATCH 14/16] #98 Fix relative script directories --- Dockerfile.custom | 14 +++++++++++++- Dockerfile.system | 14 +++++++++++++- scripts/custom/install_boost.sh | 2 +- scripts/custom/install_cmake.sh | 2 +- scripts/custom/install_hdf5.sh | 2 +- scripts/custom/install_petsc.sh | 2 +- scripts/custom/install_petsc_hdf5.sh | 2 +- scripts/custom/install_python.sh | 2 +- scripts/custom/install_sundials.sh | 2 +- scripts/custom/install_vtk.sh | 2 +- scripts/custom/install_xercesc.sh | 2 +- scripts/custom/install_xsd.sh | 2 +- scripts/custom/setup_custom.sh | 4 +++- scripts/system/setup_system.sh | 2 +- 14 files changed, 40 insertions(+), 14 deletions(-) diff --git a/Dockerfile.custom b/Dockerfile.custom index ceff65a..3a7cd8b 100755 --- a/Dockerfile.custom +++ b/Dockerfile.custom @@ -30,7 +30,19 @@ ENV DEFAULT_USER="runner" \ MODULES_DIR="/home/runner/modules" # Copy scripts -COPY scripts/custom/ scripts/*.sh /usr/local/bin/ +COPY scripts/ /usr/local/bin/ +RUN ln -s \ + /usr/local/bin/custom/install_boost.sh \ + /usr/local/bin/custom/install_hdf5.sh \ + /usr/local/bin/custom/install_petsc.sh \ + /usr/local/bin/custom/install_sundials.sh \ + /usr/local/bin/custom/install_vtk.sh \ + /usr/local/bin/custom/install_xercesc.sh \ + /usr/local/bin/custom/install_xsd.sh \ + /usr/local/bin/custom/setup_custom.sh \ + /usr/local/bin/system/install_modulefiles.sh \ + /usr/local/bin/system/setup_system.sh \ + /usr/local/bin/ # Setup base dependencies and install actions runner RUN useradd -r -m -d ${DEFAULT_HOME} -s /bin/bash ${DEFAULT_USER} && \ diff --git a/Dockerfile.system b/Dockerfile.system index 7beac13..b6254d4 100755 --- a/Dockerfile.system +++ b/Dockerfile.system @@ -22,7 +22,19 @@ ENV DEFAULT_USER="runner" \ MODULES_DIR="/home/runner/modules" # Copy scripts -COPY scripts/system/ scripts/*.sh /usr/local/bin/ +COPY scripts/ /usr/local/bin/ +RUN ln -s \ + /usr/local/bin/custom/install_boost.sh \ + /usr/local/bin/custom/install_hdf5.sh \ + /usr/local/bin/custom/install_petsc.sh \ + /usr/local/bin/custom/install_sundials.sh \ + /usr/local/bin/custom/install_vtk.sh \ + /usr/local/bin/custom/install_xercesc.sh \ + /usr/local/bin/custom/install_xsd.sh \ + /usr/local/bin/custom/setup_custom.sh \ + /usr/local/bin/system/install_modulefiles.sh \ + /usr/local/bin/system/setup_system.sh \ + /usr/local/bin/ # Setup Chaste dependencies and install actions runner RUN useradd -r -m -d ${DEFAULT_HOME} -s /bin/bash ${DEFAULT_USER} && \ diff --git a/scripts/custom/install_boost.sh b/scripts/custom/install_boost.sh index 8a1a3cb..4ae2a5d 100755 --- a/scripts/custom/install_boost.sh +++ b/scripts/custom/install_boost.sh @@ -15,7 +15,7 @@ usage() exit 1 } -script_dir=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) # https://stackoverflow.com/a/246128 +script_dir="$( dirname "$( readlink -f "${BASH_SOURCE[0]}" )" )" # https://stackoverflow.com/a/246128 . ${script_dir}/../common.sh patch_dir="${script_dir}/patches/boost" diff --git a/scripts/custom/install_cmake.sh b/scripts/custom/install_cmake.sh index 8d56f08..a0847ab 100755 --- a/scripts/custom/install_cmake.sh +++ b/scripts/custom/install_cmake.sh @@ -15,7 +15,7 @@ usage() exit 1 } -script_dir=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) # https://stackoverflow.com/a/246128 +script_dir="$( dirname "$( readlink -f "${BASH_SOURCE[0]}" )" )" # https://stackoverflow.com/a/246128 . ${script_dir}/../common.sh # Parse arguments diff --git a/scripts/custom/install_hdf5.sh b/scripts/custom/install_hdf5.sh index dd66489..e2b6106 100755 --- a/scripts/custom/install_hdf5.sh +++ b/scripts/custom/install_hdf5.sh @@ -15,7 +15,7 @@ usage() exit 1 } -script_dir=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) # https://stackoverflow.com/a/246128 +script_dir="$( dirname "$( readlink -f "${BASH_SOURCE[0]}" )" )" # https://stackoverflow.com/a/246128 . ${script_dir}/../common.sh # Parse arguments diff --git a/scripts/custom/install_petsc.sh b/scripts/custom/install_petsc.sh index dd00828..d0098b2 100755 --- a/scripts/custom/install_petsc.sh +++ b/scripts/custom/install_petsc.sh @@ -17,7 +17,7 @@ usage() exit 1 } -script_dir=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) # https://stackoverflow.com/a/246128 +script_dir="$( dirname "$( readlink -f "${BASH_SOURCE[0]}" )" )" # https://stackoverflow.com/a/246128 . ${script_dir}/../common.sh # Parse arguments diff --git a/scripts/custom/install_petsc_hdf5.sh b/scripts/custom/install_petsc_hdf5.sh index d55cc05..84c2cd9 100755 --- a/scripts/custom/install_petsc_hdf5.sh +++ b/scripts/custom/install_petsc_hdf5.sh @@ -11,7 +11,7 @@ usage() exit 1 } -script_dir=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) # https://stackoverflow.com/a/246128 +script_dir="$( dirname "$( readlink -f "${BASH_SOURCE[0]}" )" )" # https://stackoverflow.com/a/246128 . ${script_dir}/../common.sh # Parse arguments diff --git a/scripts/custom/install_python.sh b/scripts/custom/install_python.sh index 46ecfe4..78c498b 100755 --- a/scripts/custom/install_python.sh +++ b/scripts/custom/install_python.sh @@ -6,7 +6,7 @@ usage() exit 1 } -script_dir=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) # https://stackoverflow.com/a/246128 +script_dir="$( dirname "$( readlink -f "${BASH_SOURCE[0]}" )" )" # https://stackoverflow.com/a/246128 . ${script_dir}/../common.sh # Parse arguments diff --git a/scripts/custom/install_sundials.sh b/scripts/custom/install_sundials.sh index b1fba31..5163751 100755 --- a/scripts/custom/install_sundials.sh +++ b/scripts/custom/install_sundials.sh @@ -15,7 +15,7 @@ usage() exit 1 } -script_dir=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) # https://stackoverflow.com/a/246128 +script_dir="$( dirname "$( readlink -f "${BASH_SOURCE[0]}" )" )" # https://stackoverflow.com/a/246128 . ${script_dir}/../common.sh # Parse arguments diff --git a/scripts/custom/install_vtk.sh b/scripts/custom/install_vtk.sh index b2317bf..caa736e 100755 --- a/scripts/custom/install_vtk.sh +++ b/scripts/custom/install_vtk.sh @@ -15,7 +15,7 @@ usage() exit 1 } -script_dir=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) # https://stackoverflow.com/a/246128 +script_dir="$( dirname "$( readlink -f "${BASH_SOURCE[0]}" )" )" # https://stackoverflow.com/a/246128 . ${script_dir}/../common.sh patch_dir="${script_dir}/patches/vtk" diff --git a/scripts/custom/install_xercesc.sh b/scripts/custom/install_xercesc.sh index 158b9a9..3172dbb 100755 --- a/scripts/custom/install_xercesc.sh +++ b/scripts/custom/install_xercesc.sh @@ -15,7 +15,7 @@ usage() exit 1 } -script_dir=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) # https://stackoverflow.com/a/246128 +script_dir="$( dirname "$( readlink -f "${BASH_SOURCE[0]}" )" )" # https://stackoverflow.com/a/246128 . ${script_dir}/../common.sh # Parse arguments diff --git a/scripts/custom/install_xsd.sh b/scripts/custom/install_xsd.sh index c221b74..4969cfe 100755 --- a/scripts/custom/install_xsd.sh +++ b/scripts/custom/install_xsd.sh @@ -14,7 +14,7 @@ usage() exit 1 } -script_dir=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) # https://stackoverflow.com/a/246128 +script_dir="$( dirname "$( readlink -f "${BASH_SOURCE[0]}" )" )" # https://stackoverflow.com/a/246128 . ${script_dir}/../common.sh # Parse arguments diff --git a/scripts/custom/setup_custom.sh b/scripts/custom/setup_custom.sh index 8b8aa76..256dfa4 100755 --- a/scripts/custom/setup_custom.sh +++ b/scripts/custom/setup_custom.sh @@ -1,7 +1,9 @@ #!/bin/bash # Setup required libraries for building Chaste dependencies on Ubuntu LTS -script_dir=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) # https://stackoverflow.com/a/246128 + +script_dir="$( dirname "$( readlink -f "${BASH_SOURCE[0]}" )" )" # https://stackoverflow.com/a/246128 + . ${script_dir}/../common.sh if [ "${OS_VERSION_CODENAME}" = 'jammy' ]; then diff --git a/scripts/system/setup_system.sh b/scripts/system/setup_system.sh index 6752384..5afd8b1 100755 --- a/scripts/system/setup_system.sh +++ b/scripts/system/setup_system.sh @@ -1,7 +1,7 @@ #!/bin/bash # Setup Chaste system dependency versions on Ubuntu -script_dir=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) # https://stackoverflow.com/a/246128 +script_dir="$( dirname "$( readlink -f "${BASH_SOURCE[0]}" )" )" # https://stackoverflow.com/a/246128 . ${script_dir}/../common.sh export DEBIAN_FRONTEND=noninteractive From 0ca656e26456fecc6140262756f205949d133d9e Mon Sep 17 00:00:00 2001 From: Kwabena Amponsah Date: Thu, 21 May 2026 17:41:07 +0100 Subject: [PATCH 15/16] #98 Let setup scripts fail with error --- scripts/common.sh | 2 +- scripts/custom/setup_custom.sh | 2 +- scripts/custom/setup_ubuntu_2204.sh | 2 +- scripts/custom/setup_ubuntu_2404.sh | 2 +- scripts/custom/setup_ubuntu_2604.sh | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/common.sh b/scripts/common.sh index e59752f..13d6e9d 100644 --- a/scripts/common.sh +++ b/scripts/common.sh @@ -1,6 +1,6 @@ #!/bin/bash -eu -common_dir=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) # https://stackoverflow.com/a/246128 +common_dir="$( dirname "$( readlink -f "${BASH_SOURCE[0]}" )" )" # https://stackoverflow.com/a/246128 . ${common_dir}/env.sh . ${common_dir}/functions.sh diff --git a/scripts/custom/setup_custom.sh b/scripts/custom/setup_custom.sh index 256dfa4..973bbdb 100755 --- a/scripts/custom/setup_custom.sh +++ b/scripts/custom/setup_custom.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/bash -eu # Setup required libraries for building Chaste dependencies on Ubuntu LTS diff --git a/scripts/custom/setup_ubuntu_2204.sh b/scripts/custom/setup_ubuntu_2204.sh index a34cfe6..d7d2066 100755 --- a/scripts/custom/setup_ubuntu_2204.sh +++ b/scripts/custom/setup_ubuntu_2204.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/bash -eu # Setup required libraries for building Chaste dependencies on Ubuntu 22.04 Jammy LTS diff --git a/scripts/custom/setup_ubuntu_2404.sh b/scripts/custom/setup_ubuntu_2404.sh index 28797ef..35f6559 100755 --- a/scripts/custom/setup_ubuntu_2404.sh +++ b/scripts/custom/setup_ubuntu_2404.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/bash -eu # Setup required libraries for building Chaste dependencies on Ubuntu 24.04 Noble LTS diff --git a/scripts/custom/setup_ubuntu_2604.sh b/scripts/custom/setup_ubuntu_2604.sh index e38e9af..ba0b487 100755 --- a/scripts/custom/setup_ubuntu_2604.sh +++ b/scripts/custom/setup_ubuntu_2604.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/bash -eu # Setup required libraries for building Chaste dependencies on Ubuntu 26.04 Resolute LTS From 931dd6d60562b7334b95e2a7f40c158e86d66c1f Mon Sep 17 00:00:00 2001 From: Kwabena Amponsah Date: Thu, 21 May 2026 18:47:51 +0100 Subject: [PATCH 16/16] #98 Fix Dockerfile script links --- Dockerfile.custom | 1 + Dockerfile.system | 1 + 2 files changed, 2 insertions(+) diff --git a/Dockerfile.custom b/Dockerfile.custom index 3a7cd8b..2402c31 100755 --- a/Dockerfile.custom +++ b/Dockerfile.custom @@ -34,6 +34,7 @@ COPY scripts/ /usr/local/bin/ RUN ln -s \ /usr/local/bin/custom/install_boost.sh \ /usr/local/bin/custom/install_hdf5.sh \ + /usr/local/bin/custom/install_petsc_hdf5.sh \ /usr/local/bin/custom/install_petsc.sh \ /usr/local/bin/custom/install_sundials.sh \ /usr/local/bin/custom/install_vtk.sh \ diff --git a/Dockerfile.system b/Dockerfile.system index b6254d4..b667d43 100755 --- a/Dockerfile.system +++ b/Dockerfile.system @@ -26,6 +26,7 @@ COPY scripts/ /usr/local/bin/ RUN ln -s \ /usr/local/bin/custom/install_boost.sh \ /usr/local/bin/custom/install_hdf5.sh \ + /usr/local/bin/custom/install_petsc_hdf5.sh \ /usr/local/bin/custom/install_petsc.sh \ /usr/local/bin/custom/install_sundials.sh \ /usr/local/bin/custom/install_vtk.sh \