From b81a326b510c7ffb896415bfae94c65e05d0bde4 Mon Sep 17 00:00:00 2001 From: 2xB <31772910+2xB@users.noreply.github.com> Date: Mon, 20 Nov 2023 08:36:30 +0100 Subject: [PATCH 1/5] CI: Add tests mirroring documentation --- .github/workflows/test.yml | 93 +++++++++++++++++++ Documentation/gh-pages/source/compiling.rst | 24 +++-- .../StructuredASCII/src/KSAInputCollector.cc | 8 -- Kommon/Core/Initialization/KXMLInitializer.cc | 4 +- Kommon/Math/Geometry/include/KTwoMatrix.hh | 4 +- setup.sh | 4 +- 6 files changed, 116 insertions(+), 21 deletions(-) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 000000000..82b68127c --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,93 @@ +name: Test Kassiopeia + +# as described on https://katrin-experiment.github.io/Kassiopeia/compiling.html + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +env: + REGISTRY: ghcr.io + +# Keep the following in sync with Documentation/gh-pages/source/compiling.rst ! +jobs: + ubuntu_20_04: + strategy: + matrix: + use_clang: [true, false] + runs-on: ubuntu-latest + container: ubuntu:20.04 + steps: + - uses: actions/checkout@v3 + - name: Install dependencies + run: | + # Set up variables to avoid interactive timezone selection + # Source: https://serverfault.com/a/992421 + export DEBIAN_FRONTEND=noninteractive + export TZ=Etc/UTC + + apt-get update -y && apt-get install -y \ + build-essential cmake cmake-curses-gui \ + libboost-all-dev libfftw3-dev libgsl-dev libhdf5-dev liblog4cxx-dev libomp-dev libopenmpi-dev \ + libsqlite3-dev libssl-dev libvtk7-dev libxml2-dev ocl-icd-opencl-dev zlib1g-dev + - name: Install root + run: | + apt install -y wget + wget https://root.cern/download/root_v6.28.06.Linux-centos8-x86_64-gcc8.5.tar.gz + tar -xf root_v6.28.06.Linux-centos8-x86_64-gcc8.5.tar.gz + - name: Build code + run: | + source root/bin/thisroot.sh + if ${{ matrix.use_clang }}; then + echo "Using Clang." + apt install -y clang + export CC=/usr/bin/clang + export CXX=/usr/bin/clang++ + fi + ./setup.sh + shell: bash + + - name: Launch environment and run tests + run: | + source root/bin/thisroot.sh && source install/bin/kasperenv.sh && UnitTestKasper + shell: bash + + fedora_37: + strategy: + matrix: + use_clang: [true, false] + runs-on: ubuntu-latest + container: fedora:37 + steps: + - uses: actions/checkout@v3 + - name: Run workaround for log4cxx bug (no longer needed with Fedora 39) + run: | + dnf update -y + dnf install -y --setopt=install_weak_deps=False dnf-plugins-core + dnf clean all + dnf copr enable thofmann/log4xx-1.x -y + - name: Install dependencies + run: | + dnf install -y \ + @development-tools cmake cmake-gui \ + root-core root-io-xmlparser root-minuit2 root-spectrum root-genvector \ + vtk vtk-qt \ + boost-devel fftw-devel gsl-devel hdf5-devel libomp-devel liburing-devel libxml2-devel log4cxx-devel \ + ocl-icd-devel openmpi-devel openssl-devel sqlite-devel vtk-devel zlib-devel + - name: Build code + run: | + if ${{ matrix.use_clang }}; then + echo "Using Clang." + dnf install -y clang + export CC=/usr/bin/clang + export CXX=/usr/bin/clang++ + fi + ./setup.sh + shell: bash + + - name: Launch environment and run tests + run: | + source install/bin/kasperenv.sh && UnitTestKasper + shell: bash diff --git a/Documentation/gh-pages/source/compiling.rst b/Documentation/gh-pages/source/compiling.rst index 7d990a12c..573066851 100644 --- a/Documentation/gh-pages/source/compiling.rst +++ b/Documentation/gh-pages/source/compiling.rst @@ -102,15 +102,23 @@ possible to compile *Kassiopeia* without a recent version of Boost_! The minimum Minimum requirements -------------------- -On a Debian/Ubuntu Linux system the minimum software packages required by the Kassiopiea + +.. Keep the following in sync with .github/workflows/test.yml ! +**Debian/Ubuntu** + +On a Debian/Ubuntu Linux system the minimum software packages required by the Kassiopeia build system can be installed through the use of the package manager through the following command: .. code-block:: bash apt-get update -y && apt-get install -y \ build-essential cmake cmake-curses-gui \ - libboost-all-dev libfftw3-dev libgsl0-dev libhdf5-dev liblog4cxx-dev libomp-dev libopenmpi-dev \ - libpcl-dev libsqlite3-dev libssl-dev libvtk6-dev libxml2-dev ocl-icd-opencl-dev zlib1g-dev + libboost-all-dev libfftw3-dev libgsl-dev libhdf5-dev liblog4cxx-dev libomp-dev libopenmpi-dev \ + libsqlite3-dev libssl-dev libvtk7-dev libxml2-dev ocl-icd-opencl-dev zlib1g-dev + +Tested on Ubuntu Linux 20.04 LTS & 22.04 LTS. + +**RedHat/Fedora** On a RedHat/Fedora Linux system, the packages can be installed through the command: @@ -118,10 +126,12 @@ On a RedHat/Fedora Linux system, the packages can be installed through the comma dnf install -y \ @development-tools cmake cmake-gui \ - root-core root-io-xmlparser root-minuit2 root-spectrum \ - vtk vtk-qt vtk-java \ - boost-devel fftw-devel gsl-devel hdf5-devel libomp-devel libxml2-devel log4cxx-devel \ - ocl-icd-devel openmpi-devel openssl-devel pcl-devel sqlite-devel vtk-devel zlib-devel + root-core root-io-xmlparser root-minuit2 root-spectrum root-genvector \ + vtk vtk-qt \ + boost-devel fftw-devel gsl-devel hdf5-devel libomp-devel liburing-devel libxml2-devel log4cxx-devel \ + ocl-icd-devel openmpi-devel openssl-devel sqlite-devel vtk-devel zlib-devel + +Tested on Fedora Linux 37. Required dependencies --------------------- diff --git a/KEMField/Source/IO/StructuredASCII/src/KSAInputCollector.cc b/KEMField/Source/IO/StructuredASCII/src/KSAInputCollector.cc index 81ba89622..49b798307 100644 --- a/KEMField/Source/IO/StructuredASCII/src/KSAInputCollector.cc +++ b/KEMField/Source/IO/StructuredASCII/src/KSAInputCollector.cc @@ -23,15 +23,9 @@ void KSAInputCollector::ForwardInput(KSAInputNode* root) file_status = true; }; - - int count = 0; while (!fNodeStack.empty() && file_status) { - - //std::cout<<"calling the reader at line count: "<GetLine(fLine); - fNodeStack.top()->AddLine(fLine); fTempNode = nullptr; @@ -56,8 +50,6 @@ void KSAInputCollector::ForwardInput(KSAInputNode* root) } //std::cout<<"line = "< KXMLInitializer::GetConfigFile() diff --git a/Kommon/Math/Geometry/include/KTwoMatrix.hh b/Kommon/Math/Geometry/include/KTwoMatrix.hh index cbd1957c0..4e6d8348b 100644 --- a/Kommon/Math/Geometry/include/KTwoMatrix.hh +++ b/Kommon/Math/Geometry/include/KTwoMatrix.hh @@ -93,7 +93,7 @@ inline KTwoMatrix& KTwoMatrix::operator=(const KTwoMatrix& aMatrix) return *this; } -inline KTwoMatrix::KTwoMatrix(const double anArray[9]) +inline KTwoMatrix::KTwoMatrix(const double anArray[4]) { fData[0] = anArray[0]; fData[1] = anArray[1]; @@ -101,7 +101,7 @@ inline KTwoMatrix::KTwoMatrix(const double anArray[9]) fData[2] = anArray[2]; fData[3] = anArray[3]; } -inline KTwoMatrix& KTwoMatrix::operator=(const double anArray[9]) +inline KTwoMatrix& KTwoMatrix::operator=(const double anArray[4]) { fData[0] = anArray[0]; fData[1] = anArray[1]; diff --git a/setup.sh b/setup.sh index 7bc3fac8a..294bc7703 100755 --- a/setup.sh +++ b/setup.sh @@ -37,8 +37,8 @@ if [ $# -ne 0 ] ; then fi KASSIOPEIA_BUILD_TYPE=${KASSIOPEIA_BUILD_TYPE:-"RelWithDebInfo"} -KASSIOPEIA_INSTALL_PREFIX=${KASSIOPEIA_INSTALL_PREFIX:-"install"} -KASSIOPEIA_BUILD_PREFIX=${KASSIOPEIA_BUILD_PREFIX:-"build"} +KASSIOPEIA_INSTALL_PREFIX=$(realpath -s ${KASSIOPEIA_INSTALL_PREFIX:-"install"}) +KASSIOPEIA_BUILD_PREFIX=$(realpath -s ${KASSIOPEIA_BUILD_PREFIX:-"build"}) KASSIOPEIA_MAKECMD=${KASSIOPEIA_MAKECMD:-"make"} KASSIOPEIA_CUSTOM_CMAKE_ARGS=${KASSIOPEIA_CUSTOM_CMAKE_ARGS:-""} From 3975b2bd2014239c1bc864d9ee4fd971495407b4 Mon Sep 17 00:00:00 2001 From: 2xB <31772910+2xB@users.noreply.github.com> Date: Mon, 27 Nov 2023 18:28:43 +0100 Subject: [PATCH 2/5] CI: Deactivate Fedora clang test Broken due to https://github.com/KATRIN-Experiment/Kassiopeia/issues/87 --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 82b68127c..5f1e6ee6e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -57,7 +57,7 @@ jobs: fedora_37: strategy: matrix: - use_clang: [true, false] + use_clang: [false] # FIXME add "true" after solving https://github.com/KATRIN-Experiment/Kassiopeia/issues/87 runs-on: ubuntu-latest container: fedora:37 steps: From 30b611d6916a537129f97696934c9f87f43d326e Mon Sep 17 00:00:00 2001 From: 2xB <31772910+2xB@users.noreply.github.com> Date: Tue, 28 Nov 2023 15:48:31 +0100 Subject: [PATCH 3/5] CI: Use older ROOT version We state Kassiopeia would be compatible starting with ROOT version 6.16, so we should also test against an older version of ROOT. This is the newest patch of the oldest version of ROOT that is available for Ubuntu 20.04. --- .github/workflows/test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 5f1e6ee6e..0e13f4bd6 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -35,8 +35,8 @@ jobs: - name: Install root run: | apt install -y wget - wget https://root.cern/download/root_v6.28.06.Linux-centos8-x86_64-gcc8.5.tar.gz - tar -xf root_v6.28.06.Linux-centos8-x86_64-gcc8.5.tar.gz + wget https://root.cern/download/root_v6.20.08.Linux-ubuntu20-x86_64-gcc9.3.tar.gz + tar -xf root_v6.20.08.Linux-ubuntu20-x86_64-gcc9.3.tar.gz - name: Build code run: | source root/bin/thisroot.sh From 3cf6a0398281d771818aa3dd37250e984e15203c Mon Sep 17 00:00:00 2001 From: 2xB <31772910+2xB@users.noreply.github.com> Date: Tue, 28 Nov 2023 15:49:35 +0100 Subject: [PATCH 4/5] CI: Remove unneeded environment variable --- .github/workflows/test.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 0e13f4bd6..7f0cdd415 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -8,9 +8,6 @@ on: pull_request: branches: [ "main" ] -env: - REGISTRY: ghcr.io - # Keep the following in sync with Documentation/gh-pages/source/compiling.rst ! jobs: ubuntu_20_04: From 5353b827df4adbd839f629f8c20da05c9403adf0 Mon Sep 17 00:00:00 2001 From: 2xB <31772910+2xB@users.noreply.github.com> Date: Tue, 28 Nov 2023 18:43:00 +0100 Subject: [PATCH 5/5] Requirements: Update ROOT to v6.24 Due to the use of `TGraph::AddPoint` in `KSROOTZonalHarmonicsPainter`, it is no longer possible to use ROOT versions older than 6.23.2. Since the last published 6.23 version with binaries is 6.23.1, ROOT is just supported beginning with version 6.24. --- .github/workflows/test.yml | 4 ++-- Documentation/gh-pages/source/compiling.rst | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 7f0cdd415..5c1d7183b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -32,8 +32,8 @@ jobs: - name: Install root run: | apt install -y wget - wget https://root.cern/download/root_v6.20.08.Linux-ubuntu20-x86_64-gcc9.3.tar.gz - tar -xf root_v6.20.08.Linux-ubuntu20-x86_64-gcc9.3.tar.gz + wget https://root.cern/download/root_v6.24.08.Linux-ubuntu20-x86_64-gcc9.4.tar.gz + tar -xf root_v6.24.08.Linux-ubuntu20-x86_64-gcc9.4.tar.gz - name: Build code run: | source root/bin/thisroot.sh diff --git a/Documentation/gh-pages/source/compiling.rst b/Documentation/gh-pages/source/compiling.rst index 573066851..68a56f2e9 100644 --- a/Documentation/gh-pages/source/compiling.rst +++ b/Documentation/gh-pages/source/compiling.rst @@ -564,6 +564,6 @@ architectures where compiled code is shared between different machines. Be aware .. |clangVersion| replace:: 3.4 .. |CMakeVersion| replace:: 3.14 .. |BoostVersion| replace:: 1.65 -.. |ROOTVersion| replace:: 6.16 +.. |ROOTVersion| replace:: 6.24 .. |FFTWVersion| replace:: 3.3.4 .. |VTKVersion| replace:: 7.0