Skip to content

Commit

Permalink
updates workflows and builds
Browse files Browse the repository at this point in the history
  • Loading branch information
paulgessinger committed Jul 9, 2024
1 parent d906524 commit fd43ec8
Show file tree
Hide file tree
Showing 12 changed files with 428 additions and 55 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ jobs:
- ubuntu2004_rocm
- ubuntu2004_rocm_oneapi
- ubuntu2004_oneapi
- ubuntu2004_exatrkx
- ubuntu2204_exatrkx
- ubuntu2204
- ubuntu2204_cuda
- ubuntu2204_clang
- ubuntu2204_cpp20
- ubuntu2204_cpp17
- ubuntu2204_rocm_clang
- ubuntu2404
- ubuntu2404_cuda
Expand Down
31 changes: 31 additions & 0 deletions ubuntu2204/0001-CMake-allow-finding-newer-versions-of-podio.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
From 76bbcc713a5ef93502b23ed59a68f96dd87318b6 Mon Sep 17 00:00:00 2001
From: Andre Sailer <[email protected]>
Date: Mon, 24 Jun 2024 15:51:35 +0200
Subject: [PATCH] CMake: allow finding newer versions of podio

---
CMakeLists.txt | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index e80779bb..50d167c2 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -155,7 +155,13 @@ endif()

if(DD4HEP_USE_EDM4HEP)
find_package(EDM4HEP REQUIRED)
- find_package(podio 0.16.3 REQUIRED)
+ # we need podio with Frame support (>=0.16.3)
+ # podio is "SameMajorVersion" compatible
+ find_package(podio 0.16.3) # this will not find 1.0 and newer
+ if(NOT podio_FOUND)
+ # we try to find a newer version now
+ find_package(podio 1.0 REQUIRED)
+ endif()
# DD4HEP_SETUP_EDM4HEP_TARGETS()
endif()

--
2.39.3

19 changes: 9 additions & 10 deletions ubuntu2204/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,12 @@ ENV PREFIX /usr/local

ENV GEANT4_VERSION=11.1.1
ENV HEPMC3_VERSION=3.2.5
ENV PYTHIA8_VERSION=309
ENV PYTHIA8_VERSION=312
ENV JSON_VERSION=3.11.2
ENV ROOT_VERSION=6.28.02
ENV PODIO_VERSION=00-16-03
ENV EDM4HEP_VERSION=00-07-02
ENV DD4HEP_VERSION=01-27
ENV ROOT_VERSION=6.28.06
ENV PODIO_VERSION=01-00-01
ENV EDM4HEP_VERSION=00-10-01
ENV DD4HEP_VERSION=01-29
ENV ONNXRUNTIME_VERSION=1.13.1

# Geant4
Expand Down Expand Up @@ -97,13 +97,11 @@ RUN mkdir src \

# Pythia8
# requires rsync; installation uses `rsync` instead of `install`
ADD pythia8307_cpp20.patch .
RUN mkdir src \
&& ${GET} https://pythia.org/download/pythia83/pythia8${PYTHIA8_VERSION}.tgz\
| ${UNPACK_TO_SRC} \
&& cd src \
&& git apply ../pythia8*_cpp20.patch \
&& ./configure --enable-shared --prefix=${PREFIX} \
&& ./configure --enable-shared --prefix=${PREFIX} --cxx-common="-O2 -std=c++20 -pedantic -W -Wall -Wshadow -fPIC -pthread"\
&& make -j$(nproc) install \
&& cd .. \
&& rm -rf src
Expand Down Expand Up @@ -138,12 +136,10 @@ RUN mkdir src \
ENV LD_LIBRARY_PATH /usr/local/lib
ENV PYTHON_PATH /usr/local/lib

ADD podio_cpp20.patch .
# podio
RUN mkdir src \
&& ${GET} https://github.com/AIDASoft/podio/archive/refs/tags/v${PODIO_VERSION}.tar.gz \
| ${UNPACK_TO_SRC} \
&& cd src && git apply ../podio_cpp20.patch && cd .. \
&& cmake -B build -S src -GNinja \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=${PREFIX} \
Expand All @@ -167,9 +163,11 @@ RUN pip3 install jinja2 pyyaml \

# DD4hep
# requires Geant4 and ROOT and must come last
ADD 0001-CMake-allow-finding-newer-versions-of-podio.patch .
RUN mkdir src \
&& ${GET} https://github.com/AIDASoft/DD4hep/archive/v${DD4HEP_VERSION}.tar.gz \
| ${UNPACK_TO_SRC} \
&& patch -p1 -d src < 0001-CMake-allow-finding-newer-versions-of-podio.patch \
&& cmake -B build -S src -GNinja \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_CXX_STANDARD=20 \
Expand All @@ -192,5 +190,6 @@ RUN git clone https://github.com/microsoft/onnxruntime src \
--build_dir build \
--parallel $(nproc) \
--skip_tests \
--parallel 0 \
&& cmake --build build/MinSizeRel -- install \
&& rm -rf build src
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
From 76bbcc713a5ef93502b23ed59a68f96dd87318b6 Mon Sep 17 00:00:00 2001
From: Andre Sailer <[email protected]>
Date: Mon, 24 Jun 2024 15:51:35 +0200
Subject: [PATCH] CMake: allow finding newer versions of podio

---
CMakeLists.txt | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index e80779bb..50d167c2 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -155,7 +155,13 @@ endif()

if(DD4HEP_USE_EDM4HEP)
find_package(EDM4HEP REQUIRED)
- find_package(podio 0.16.3 REQUIRED)
+ # we need podio with Frame support (>=0.16.3)
+ # podio is "SameMajorVersion" compatible
+ find_package(podio 0.16.3) # this will not find 1.0 and newer
+ if(NOT podio_FOUND)
+ # we try to find a newer version now
+ find_package(podio 1.0 REQUIRED)
+ endif()
# DD4HEP_SETUP_EDM4HEP_TARGETS()
endif()

--
2.39.3

40 changes: 22 additions & 18 deletions ubuntu2204_clang/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,18 @@ ENV PREFIX /usr/local
ENV CC clang
ENV CXX clang++

ENV GEANT4_VERSION=11.1.1
ENV HEPMC3_VERSION=3.2.5
ENV PYTHIA8_VERSION=312
ENV JSON_VERSION=3.11.2
ENV ROOT_VERSION=6.28.06
ENV PODIO_VERSION=01-00-01
ENV EDM4HEP_VERSION=00-10-01
ENV DD4HEP_VERSION=01-29

# Geant4
RUN mkdir src \
&& ${GET} https://gitlab.cern.ch/geant4/geant4/-/archive/v11.1.1/geant4-v11.1.1.tar.gz \
&& ${GET} https://gitlab.cern.ch/geant4/geant4/-/archive/v${GEANT4_VERSION}/geant4-v${GEANT4_VERSION}.tar.gz \
| ${UNPACK_TO_SRC} \
&& cmake -B build -S src -GNinja \
-DCMAKE_BUILD_TYPE=Release \
Expand All @@ -79,12 +88,11 @@ RUN mkdir src \

# HepMC3
RUN mkdir src \
&& ${GET} https://gitlab.cern.ch/hepmc/HepMC3/-/archive/3.2.5/HepMC3-3.2.5.tar.gz \
&& ${GET} https://gitlab.cern.ch/hepmc/HepMC3/-/archive/${HEPMC3_VERSION}/HepMC3-${HEPMC3_VERSION}.tar.gz \
| ${UNPACK_TO_SRC} \
&& cmake -B build -S src -GNinja \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=${PREFIX} \
-DCMAKE_CXX_STANDARD=20 \
-DHEPMC3_BUILD_STATIC_LIBS=OFF \
-DHEPMC3_ENABLE_PYTHON=OFF \
-DHEPMC3_ENABLE_ROOTIO=OFF \
Expand All @@ -95,7 +103,7 @@ RUN mkdir src \
# Pythia8
# requires rsync; installation uses `rsync` instead of `install`
RUN mkdir src \
&& ${GET} https://pythia.org/download/pythia83/pythia8309.tgz\
&& ${GET} https://pythia.org/download/pythia83/pythia8${PYTHIA8_VERSION}.tgz\
| ${UNPACK_TO_SRC} \
&& cd src \
&& ./configure --enable-shared --prefix=${PREFIX} --cxx-common="-O2 -std=c++20 -pedantic -W -Wall -Wshadow -fPIC -pthread"\
Expand All @@ -105,18 +113,15 @@ RUN mkdir src \

# nlohmann's JSON
RUN mkdir src \
&& ${GET} https://github.com/nlohmann/json/archive/refs/tags/v3.11.2.tar.gz \
&& ${GET} https://github.com/nlohmann/json/archive/refs/tags/v${JSON_VERSION}.tar.gz \
| ${UNPACK_TO_SRC} \
&& cmake -B build -S src -GNinja \
-DJSON_BuildTests=OFF \
-DCMAKE_CXX_STANDARD=20 \
-DCMAKE_INSTALL_PREFIX=${PREFIX} \
&& cmake -B build -S src -GNinja -DJSON_BuildTests=OFF \
&& cmake --build build -- install \
&& rm -rf build src

# ROOT
RUN mkdir src \
&& ${GET} https://root.cern/download/root_v6.28.02.source.tar.gz \
&& ${GET} https://root.cern/download/root_v${ROOT_VERSION}.source.tar.gz \
| ${UNPACK_TO_SRC} \
&& cmake -B build -S src -GNinja \
-DCMAKE_BUILD_TYPE=Release \
Expand All @@ -127,6 +132,8 @@ RUN mkdir src \
-Dgdml=ON \
-Dopengl=ON \
-Dpyroot=ON \
-Ddataframe=ON \
-Droot7=ON \
&& cmake --build build -- install \
&& rm -rf build src

Expand All @@ -136,12 +143,11 @@ ENV PYTHON_PATH /usr/local/lib

# podio
RUN mkdir src \
&& ${GET} https://github.com/AIDASoft/podio/archive/refs/tags/v00-16-03.tar.gz \
&& ${GET} https://github.com/AIDASoft/podio/archive/refs/tags/v${PODIO_VERSION}.tar.gz \
| ${UNPACK_TO_SRC} \
&& cmake -B build -S src -GNinja \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=${PREFIX} \
-DCMAKE_CXX_STANDARD=20 \
-DBUILD_TESTING=OFF \
-USE_EXTERNAL_CATCH2=OFF \
&& cmake --build build -- install \
Expand All @@ -150,34 +156,32 @@ RUN mkdir src \
# EDM4hep
RUN pip3 install jinja2 pyyaml \
&& mkdir src \
&& ${GET} https://github.com/key4hep/EDM4hep/archive/refs/tags/v00-07-02.tar.gz \
&& ${GET} https://github.com/key4hep/EDM4hep/archive/refs/tags/v${EDM4HEP_VERSION}.tar.gz \
| ${UNPACK_TO_SRC} \
&& cmake -B build -S src -GNinja \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=${PREFIX} \
-DCMAKE_CXX_STANDARD=20 \
-DBUILD_TESTING=OFF \
-DUSE_EXTERNAL_CATCH2=OFF \
&& cmake --build build -- install \
&& rm -rf build src

# DD4hep
# requires Geant4 and ROOT and must come last
ADD 0001-CMake-allow-finding-newer-versions-of-podio.patch .
RUN mkdir src \
&& ${GET} https://github.com/AIDASoft/DD4hep/archive/v01-25-01.tar.gz \
&& ${GET} https://github.com/AIDASoft/DD4hep/archive/v${DD4HEP_VERSION}.tar.gz \
| ${UNPACK_TO_SRC} \
&& patch -p1 -d src < 0001-CMake-allow-finding-newer-versions-of-podio.patch \
&& cmake -B build -S src -GNinja \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_CXX_STANDARD=20 \
-DCMAKE_INSTALL_PREFIX=${PREFIX} \
-DCMAKE_PREFIX_PATH=${PREFIX} \
-DBUILD_TESTING=OFF \
-DDD4HEP_BUILD_PACKAGES="DDG4 DDDetectors DDRec UtilityApps" \
-DDD4HEP_IGNORE_GEANT4_TLS=ON \
-DDD4HEP_USE_GEANT4=ON \
-DDD4HEP_USE_XERCESC=ON \
-DDD4HEP_USE_EDM4HEP=ON \
&& cmake --build build -- install \
&& rm -rf build src

COPY download_geant4_data.sh /usr/local/bin
File renamed without changes.
129 changes: 129 additions & 0 deletions ubuntu2204_clang/pythia8307_cpp20.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
From 09ef584f1ca797d84c1c0af18ec06b33d6c0d2d0 Mon Sep 17 00:00:00 2001
From: Paul Gessinger <[email protected]>
Date: Thu, 24 Mar 2022 16:08:26 +0100
Subject: [PATCH] fixes for C++20 build

---
include/Pythia8/SusyLesHouches.h | 6 +++---
src/HadronWidths.cc | 8 ++++----
src/NucleonExcitations.cc | 8 ++++----
src/PythiaParallel.cc | 2 +-
4 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/include/Pythia8/SusyLesHouches.h b/include/Pythia8/SusyLesHouches.h
index 2f1d9fd..5090c00 100644
--- a/include/Pythia8/SusyLesHouches.h
+++ b/include/Pythia8/SusyLesHouches.h
@@ -28,7 +28,7 @@ namespace Pythia8 {
public:

//Constructor.
- LHblock<T>() : idnow(0), qDRbar(), i(), val() {} ;
+ LHblock() : idnow(0), qDRbar(), i(), val() {} ;

//Does block exist?
bool exists() { return int(entry.size()) == 0 ? false : true ; };
@@ -129,7 +129,7 @@ namespace Pythia8 {
template <int size> class LHmatrixBlock {
public:
//Constructor. Set uninitialized and explicitly zero.
- LHmatrixBlock<size>() : entry(), qDRbar(), val() {
+ LHmatrixBlock() : entry(), qDRbar(), val() {
initialized=false;
for (i=1;i<=size;i++) {
for (j=1;j<=size;j++) {
@@ -208,7 +208,7 @@ namespace Pythia8 {
template <int size> class LHtensor3Block {
public:
//Constructor. Set uninitialized and explicitly zero.
- LHtensor3Block<size>() : entry(), qDRbar(), val() {
+ LHtensor3Block() : entry(), qDRbar(), val() {
initialized=false;
for (i=1;i<=size;i++) {
for (j=1;j<=size;j++) {
diff --git a/src/HadronWidths.cc b/src/HadronWidths.cc
index ccc5c72..95a5cb1 100644
--- a/src/HadronWidths.cc
+++ b/src/HadronWidths.cc
@@ -867,7 +867,7 @@ double HadronWidths::psSize(double eCM, ParticleDataEntryPtr prodA,
return 0.;

// Integrate mass of A.
- auto f = [=](double mA) {
+ auto f = [=,this](double mA) {
return pow(pCMS(eCM, mA, m0B), lType) * mDistr(idA, mA); };
if (!integrateGauss(result, f, mMinA, min(mMaxA, eCM - m0B)))
success = false;
@@ -879,7 +879,7 @@ double HadronWidths::psSize(double eCM, ParticleDataEntryPtr prodA,
return 0.;

// Integrate mass of B.
- auto f = [=](double mB) {
+ auto f = [=,this](double mB) {
return pow(pCMS(eCM, m0A, mB), lType) * mDistr(idB, mB); };
if (!integrateGauss(result, f, mMinB, min(mMaxB, eCM - m0A)))
success = false;
@@ -891,10 +891,10 @@ double HadronWidths::psSize(double eCM, ParticleDataEntryPtr prodA,
return 0.;

// Define integrand of outer integral.
- auto I = [=, &success](double mA) {
+ auto I = [=, &success, this](double mA) {

// Define integrand of inner integral.
- auto f = [=](double mB) {
+ auto f = [=,this](double mB) {
return pow(pCMS(eCM, mA, mB), lType)
* mDistr(idA, mA) * mDistr(idB, mB); };
double res;
diff --git a/src/NucleonExcitations.cc b/src/NucleonExcitations.cc
index b5eef8f..a82383a 100644
--- a/src/NucleonExcitations.cc
+++ b/src/NucleonExcitations.cc
@@ -502,7 +502,7 @@ double NucleonExcitations::psSize(double eCM, ParticleDataEntry& prodA,
return 0.;

// Integrate mass of A.
- auto f = [=](double mA) {
+ auto f = [=, this](double mA) {
return pCMS(eCM, mA, m0B) * hadronWidthsPtr->mDistr(idA, mA); };
if (!integrateGauss(result, f, mMinA, min(mMaxA, eCM - m0B)))
success = false;
@@ -514,7 +514,7 @@ double NucleonExcitations::psSize(double eCM, ParticleDataEntry& prodA,
return 0.;

// Integrate mass of B.
- auto f = [=](double mB) {
+ auto f = [=,this](double mB) {
return pCMS(eCM, m0A, mB) * hadronWidthsPtr->mDistr(idB, mB); };
if (!integrateGauss(result, f, mMinB, min(mMaxB, eCM - m0A)))
success = false;
@@ -526,10 +526,10 @@ double NucleonExcitations::psSize(double eCM, ParticleDataEntry& prodA,
return 0.;

// Define integrand of outer integral.
- auto I = [=, &success](double mA) {
+ auto I = [=, &success, this](double mA) {

// Define integrand of inner integral.
- auto f = [=](double mB) {
+ auto f = [=,this](double mB) {
return pCMS(eCM, mA, mB)
* hadronWidthsPtr->mDistr(idA, mA)
* hadronWidthsPtr->mDistr(idB, mB); };
diff --git a/src/PythiaParallel.cc b/src/PythiaParallel.cc
index 81450e2..7ec3a92 100644
--- a/src/PythiaParallel.cc
+++ b/src/PythiaParallel.cc
@@ -106,7 +106,7 @@ bool PythiaParallel::init(function<bool(Pythia&)> customInit) {
bool initSuccess = true;

for (int iPythia = 0; iPythia < numThreads; iPythia += 1) {
- initThreads.emplace_back([=, &seeds, &initSuccess]() {
+ initThreads.emplace_back([=, &seeds, &initSuccess, this]() {
Pythia* pythiaPtr = new Pythia(settings, particleData, false);
pythiaObjects[iPythia] = unique_ptr<Pythia>(pythiaPtr);
pythiaObjects[iPythia]->settings.flag("Print:quiet", true);
--
2.31.1

Loading

0 comments on commit fd43ec8

Please sign in to comment.