Skip to content

Commit

Permalink
Merge pull request #114 from 2xB/fedora40fixes
Browse files Browse the repository at this point in the history
Fix build pipeline & update Docker image
  • Loading branch information
richeldichel authored Jul 8, 2024
2 parents 805765f + 350dbb5 commit 890b097
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 32 deletions.
12 changes: 3 additions & 9 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
pull_request:
branches: [ "main" ]

# Keep the following in sync with Documentation/gh-pages/source/compiling.rst !
# Keep the following in sync with Documentation/gh-pages/source/setup_manual.rst !
jobs:
ubuntu_20_04:
strategy:
Expand Down Expand Up @@ -51,20 +51,14 @@ jobs:
source root/bin/thisroot.sh && source install/bin/kasperenv.sh && UnitTestKasper
shell: bash

fedora_37:
fedora_40:
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
container: fedora:40
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 \
Expand Down
2 changes: 2 additions & 0 deletions Docker/packages.full
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ vim
zsh
zsh-syntax-highlighting
htop
diffutils
paraview

root
root-notebook
Expand Down
11 changes: 2 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,14 @@ ARG KASSIOPEIA_GIT_COMMIT=""
ARG KASSIOPEIA_CPUS=""

# --- runtime-base ---
# NOTE: For Fedora 39, remove marked lines below
FROM fedora:38 as runtime-base
FROM fedora:40 as runtime-base
ARG KASSIOPEIA_UID
ARG KASSIOPEIA_USER
ARG KASSIOPEIA_GID
ARG KASSIOPEIA_GROUP

LABEL description="Runtime base container"

# TODO REMOVE FOR FEDORA 39
RUN dnf update -y \
&& dnf install -y --setopt=install_weak_deps=False dnf-plugins-core \
&& dnf clean all
RUN dnf copr enable thofmann/log4xx-1.x -y
# END TODO

COPY Docker/packages.runtime packages
RUN dnf update -y \
&& dnf install -y --setopt=install_weak_deps=False $(cat packages) \
Expand Down Expand Up @@ -144,6 +136,7 @@ RUN pip3 install --no-cache-dir jupyterlab \
&& pip3 install --no-cache-dir jupyter-server-proxy \
&& pip3 install --no-cache-dir jupyterhub \
&& pip3 install --no-cache-dir ipympl \
&& pip3 install --no-cache-dir uproot \
&& pip3 install --no-cache-dir iminuit

# Ensure if LDAP is used on a JupyterHub, user names are correctly resolved
Expand Down
2 changes: 1 addition & 1 deletion Documentation/gh-pages/source/setup_manual.rst
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ On a RedHat/Fedora Linux system, the packages can be installed through the comma
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.
Tested on Fedora Linux 40.

Required dependencies
----------------------
Expand Down
9 changes: 3 additions & 6 deletions Kassiopeia/Objects/Include/KSObject.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

#include "KSObjectsMessage.h"
#include "KTagged.h"
#include <memory>

namespace Kassiopeia
{
Expand Down Expand Up @@ -53,7 +54,7 @@ class KSObject : public katrin::KTagged
XType* fObject;
};

mutable KSHolder* fHolder;
mutable std::unique_ptr<KSHolder> fHolder;
};

inline KSObject::KSHolder::KSHolder() = default;
Expand Down Expand Up @@ -141,12 +142,8 @@ template<> inline const KSObject* KSObject::As<KSObject>() const

template<class XType> inline void KSObject::Set(XType* anObject)
{
if (fHolder != nullptr) {
delete fHolder;
fHolder = nullptr;
}
auto* tHolder = new KSHolderTemplate<XType>(anObject);
fHolder = tHolder;
fHolder = std::unique_ptr<KSHolder>(tHolder);
return;
}

Expand Down
4 changes: 2 additions & 2 deletions Kassiopeia/Objects/Source/KSObject.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
namespace Kassiopeia
{

KSObject::KSObject() : KTagged(), fHolder(nullptr) {}
KSObject::KSObject(const KSObject& aCopy) : KTagged(aCopy), fHolder(nullptr) {}
KSObject::KSObject() : KTagged() {};
KSObject::KSObject(const KSObject& aCopy) : KTagged(aCopy) {}
KSObject::~KSObject() = default;

} // namespace Kassiopeia
26 changes: 21 additions & 5 deletions kasperenv.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ if [ -n "${KASPERSYS}" ]
OLD_PKGCFGPATH=${OLD_KASPERSYS}/lib/pkgconfig:
OLD_PYTHONPATH=${OLD_KASPERSYS}/lib/python:
OLD_CMAKE_PREF=${OLD_KASPERSYS}:
OLD_ROOT_INCLUDE_PATH=${OLD_KASPERSYS}/include:
fi

if [ -n "${KASPER_INSTALL}" ]
Expand All @@ -24,6 +25,7 @@ if [ -n "${KASPER_INSTALL}" ]
OLD_PKGCFGPATH=${OLD_KASPER_INSTALL}/lib/pkgconfig:
OLD_PYTHONPATH=${OLD_KASPER_INSTALL}/lib/python:
OLD_CMAKE_PREF=${OLD_KASPER_INSTALL}:
OLD_ROOT_INCLUDE_PATH=${OLD_KASPER_INSTALL}/include:
fi

if [ -n "${KASPER_SOURCE}" ]
Expand All @@ -36,6 +38,7 @@ export KASPER_INSTALL=@KASPER_INSTALL_DIR@
KASPER_INSTALL_BIN=@BIN_INSTALL_DIR@
KASPER_INSTALL_LIB=@LIB_INSTALL_DIR@
KASPER_INSTALL_CACHE=@CACHE_INSTALL_DIR@
KASPER_INSTALL_INCLUDE=@INCLUDE_INSTALL_DIR@

printf "\033[32;1m** KASPER source directory set to ${KASPER_SOURCE}\033[0m\n"
printf "\033[32;1m** KASPER install directory set to ${KASPER_INSTALL}\033[0m\n"
Expand Down Expand Up @@ -67,10 +70,23 @@ fi
export KEMFIELD_CACHE
mkdir -p ${KEMFIELD_CACHE}

export PATH=${KASPER_INSTALL_BIN}:$(echo $PATH | sed 's/${OLD_PATH}//g')
export LD_LIBRARY_PATH=${KASPER_INSTALL_LIB}:$(echo $LD_LIBRARY_PATH | sed 's/${OLD_LDLIBPATH}//g')
export PKG_CONFIG_PATH=${KASPER_INSTALL_LIB}/pkgconfig:$(echo $PKG_CONFIG_PATH | sed 's/${OLD_PKGCFGPATH}//g')
export PYTHONPATH=${KASPER_INSTALL_LIB}/python:$(echo $PYTHONPATH | sed 's/${OLD_PYTHONPATH}//g')
export CMAKE_PREFIX_PATH=${KASPER_INSTALL}:$(echo $CMAKE_PREFIX_PATH | sed 's/${OLD_CMAKE_PREF}//g')

[[ -n $OLD_PATH ]] && export PATH=$(echo $PATH | sed "s;${OLD_PATH};;g")
export PATH=${KASPER_INSTALL_BIN}:$PATH

[[ -n $OLD_LDLIBPATH ]] && export LD_LIBRARY_PATH=$(echo $LD_LIBRARY_PATH | sed "s;${OLD_LDLIBPATH};;g")
export LD_LIBRARY_PATH=${KASPER_INSTALL_LIB}:$LD_LIBRARY_PATH

[[ -n $OLD_PKGCFGPATH ]] && export PKG_CONFIG_PATH=$(echo $PKG_CONFIG_PATH | sed "s;${OLD_PKGCFGPATH};;g")
export PKG_CONFIG_PATH=${KASPER_INSTALL_LIB}/pkgconfig:$PKG_CONFIG_PATH

[[ -n $OLD_PYTHONPATH ]] && export PYTHONPATH=$(echo $PYTHONPATH | sed "s;${OLD_PYTHONPATH};;g")
export PYTHONPATH=${KASPER_INSTALL_LIB}/python:$PYTHONPATH

[[ -n $OLD_CMAKE_PREF ]] && export CMAKE_PREFIX_PATH=$(echo $CMAKE_PREFIX_PATH | sed "s;${OLD_CMAKE_PREF};;g")
export CMAKE_PREFIX_PATH=${KASPER_INSTALL}:$CMAKE_PREFIX_PATH

[[ -n $OLD_ROOT_INCLUDE_PATH ]] && export ROOT_INCLUDE_PATH=$(echo $ROOT_INCLUDE_PATH | sed "s;${OLD_ROOT_INCLUDE_PATH};;g")
export ROOT_INCLUDE_PATH=${KASPER_INSTALL_INCLUDE}:$ROOT_INCLUDE_PATH

return 0

0 comments on commit 890b097

Please sign in to comment.