Skip to content

Commit

Permalink
Merge pull request #90 from 2xB/main
Browse files Browse the repository at this point in the history
CI: Add tests for documented dependency installation
  • Loading branch information
richeldichel authored Dec 1, 2023
2 parents 8608bc2 + 5353b82 commit 3dbad7d
Show file tree
Hide file tree
Showing 6 changed files with 114 additions and 22 deletions.
90 changes: 90 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
name: Test Kassiopeia

# as described on https://katrin-experiment.github.io/Kassiopeia/compiling.html

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

# 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.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
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: [false] # FIXME add "true" after solving https://github.com/KATRIN-Experiment/Kassiopeia/issues/87
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
26 changes: 18 additions & 8 deletions Documentation/gh-pages/source/compiling.rst
Original file line number Diff line number Diff line change
Expand Up @@ -102,26 +102,36 @@ 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:

.. code-block:: bash
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
---------------------
Expand Down Expand Up @@ -554,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
8 changes: 0 additions & 8 deletions KEMField/Source/IO/StructuredASCII/src/KSAInputCollector.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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: "<<count<<std::endl;

file_status = fReader->GetLine(fLine);


fNodeStack.top()->AddLine(fLine);

fTempNode = nullptr;
Expand All @@ -56,8 +50,6 @@ void KSAInputCollector::ForwardInput(KSAInputNode* root)
}

//std::cout<<"line = "<<fLine<<std::endl;

count++;
};
}

Expand Down
4 changes: 2 additions & 2 deletions Kommon/Core/Initialization/KXMLInitializer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ void KXMLInitializer::ParseCommandLine(int argc, char** argv)
}

// parse command line arguments - but only up to the -r flag
commandLineArgs = move(KArgumentList(lastArg, argv));
commandLineArgs = std::move(KArgumentList(lastArg, argv));
KDEBUG("Commandline: " << commandLineArgs.CommandLine());

// parse `key=value` pairs after the -r flag
Expand Down Expand Up @@ -162,7 +162,7 @@ void KXMLInitializer::ParseCommandLine(int argc, char** argv)
commandLineArgs.SetOption("KEMFIELD_CACHE", path);
}

fArguments = move(commandLineArgs);
fArguments = std::move(commandLineArgs);
}

pair<string, KTextFile> KXMLInitializer::GetConfigFile()
Expand Down
4 changes: 2 additions & 2 deletions Kommon/Math/Geometry/include/KTwoMatrix.hh
Original file line number Diff line number Diff line change
Expand Up @@ -93,15 +93,15 @@ 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];

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];
Expand Down
4 changes: 2 additions & 2 deletions setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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:-""}
Expand Down

0 comments on commit 3dbad7d

Please sign in to comment.