diff --git a/.github/workflows/build-images.yml b/.github/workflows/build-images.yml index 8ab1449..fabcee9 100644 --- a/.github/workflows/build-images.yml +++ b/.github/workflows/build-images.yml @@ -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 diff --git a/ubuntu2204/0001-CMake-allow-finding-newer-versions-of-podio.patch b/ubuntu2204/0001-CMake-allow-finding-newer-versions-of-podio.patch new file mode 100644 index 0000000..2c90a28 --- /dev/null +++ b/ubuntu2204/0001-CMake-allow-finding-newer-versions-of-podio.patch @@ -0,0 +1,31 @@ +From 76bbcc713a5ef93502b23ed59a68f96dd87318b6 Mon Sep 17 00:00:00 2001 +From: Andre Sailer +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 + diff --git a/ubuntu2204/Dockerfile b/ubuntu2204/Dockerfile index 0f1f000..1d337a3 100644 --- a/ubuntu2204/Dockerfile +++ b/ubuntu2204/Dockerfile @@ -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 @@ -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 @@ -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} \ @@ -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 \ @@ -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 diff --git a/ubuntu2204_clang/0001-CMake-allow-finding-newer-versions-of-podio.patch b/ubuntu2204_clang/0001-CMake-allow-finding-newer-versions-of-podio.patch new file mode 100644 index 0000000..2c90a28 --- /dev/null +++ b/ubuntu2204_clang/0001-CMake-allow-finding-newer-versions-of-podio.patch @@ -0,0 +1,31 @@ +From 76bbcc713a5ef93502b23ed59a68f96dd87318b6 Mon Sep 17 00:00:00 2001 +From: Andre Sailer +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 + diff --git a/ubuntu2204_clang/Dockerfile b/ubuntu2204_clang/Dockerfile index 70103cc..c2ef088 100644 --- a/ubuntu2204_clang/Dockerfile +++ b/ubuntu2204_clang/Dockerfile @@ -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 \ @@ -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 \ @@ -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"\ @@ -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 \ @@ -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 @@ -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 \ @@ -150,12 +156,11 @@ 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 \ @@ -163,9 +168,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/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 \ @@ -173,11 +180,8 @@ RUN mkdir src \ -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 diff --git a/ubuntu2204/podio_cpp20.patch b/ubuntu2204_clang/podio_cpp20.patch similarity index 100% rename from ubuntu2204/podio_cpp20.patch rename to ubuntu2204_clang/podio_cpp20.patch diff --git a/ubuntu2204_clang/pythia8307_cpp20.patch b/ubuntu2204_clang/pythia8307_cpp20.patch new file mode 100644 index 0000000..c6a1890 --- /dev/null +++ b/ubuntu2204_clang/pythia8307_cpp20.patch @@ -0,0 +1,129 @@ +From 09ef584f1ca797d84c1c0af18ec06b33d6c0d2d0 Mon Sep 17 00:00:00 2001 +From: Paul Gessinger +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() : 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 class LHmatrixBlock { + public: + //Constructor. Set uninitialized and explicitly zero. +- LHmatrixBlock() : 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 class LHtensor3Block { + public: + //Constructor. Set uninitialized and explicitly zero. +- LHtensor3Block() : 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 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(pythiaPtr); + pythiaObjects[iPythia]->settings.flag("Print:quiet", true); +-- +2.31.1 + diff --git a/ubuntu2204_exatrkx/Dockerfile b/ubuntu2204_exatrkx/Dockerfile index a09f5ab..599ebe0 100644 --- a/ubuntu2204_exatrkx/Dockerfile +++ b/ubuntu2204_exatrkx/Dockerfile @@ -16,6 +16,7 @@ RUN apt-get update -y \ && apt-get install -y \ build-essential \ curl \ + cmake \ git \ freeglut3-dev \ libboost-dev \ @@ -55,18 +56,21 @@ ENV UNPACK_TO_SRC tar -xz --strip-components=1 --directory src ENV PREFIX /usr/local ENV CUDA_ARCH 86 -# CMake 3.16.3 version in APT is too old -# requires rsync; installation uses `rsync` instead of `install` -RUN mkdir src \ - && ${GET} https://github.com/Kitware/CMake/releases/download/v3.21.2/cmake-3.21.2-Linux-x86_64.tar.gz \ - | ${UNPACK_TO_SRC} \ - && rsync -ruv src/ ${PREFIX} \ - && cd .. \ - && rm -rf src +ENV XXHASH_VERSION=0.7.3 +ENV JSON_VERSION=3.11.2 +ENV ROOT_VERSION=6.28.06 +ENV TORCH_SCATTER_VERSION=2.0.9 +ENV CUGRAPH_VERSION=22.02.00 +ENV ONNXRUNTIME_VERSION=1.13.1 + +# libtorch (unzip cannot be used in a pipe...) +ENV LIBTORCH_URL_GPU https://download.pytorch.org/libtorch/cu118/libtorch-cxx11-abi-shared-with-deps-2.0.1%2Bcu118.zip +ENV LIBTORCH_URL_CPU https://download.pytorch.org/libtorch/cpu/libtorch-cxx11-abi-shared-with-deps-2.0.1%2Bcpu.zip + # xxHash RUN mkdir -p src \ - && ${GET} https://github.com/Cyan4973/xxHash/archive/v0.7.3.tar.gz \ + && ${GET} https://github.com/Cyan4973/xxHash/archive/v${XXHASH_VERSION}.tar.gz \ | ${UNPACK_TO_SRC} \ && cmake -B build -S src/cmake_unofficial -GNinja\ -DCMAKE_BUILD_TYPE=MinSizeRel \ @@ -77,7 +81,7 @@ RUN mkdir -p src \ # nlohmann's JSON RUN mkdir src \ - && ${GET} https://github.com/nlohmann/json/archive/refs/tags/v3.10.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 \ -DCMAKE_BUILD_TYPE=MinSizeRel \ @@ -86,10 +90,6 @@ RUN mkdir src \ && cmake --build build -- install \ && rm -rf build src -# libtorch (unzip cannot be used in a pipe...) -ENV LIBTORCH_URL_GPU https://download.pytorch.org/libtorch/cu118/libtorch-cxx11-abi-shared-with-deps-2.0.1%2Bcu118.zip -ENV LIBTORCH_URL_CPU https://download.pytorch.org/libtorch/cpu/libtorch-cxx11-abi-shared-with-deps-2.0.1%2Bcpu.zip - RUN ${GET} --output libtorch.zip ${LIBTORCH_URL_GPU} \ && unzip libtorch.zip \ && rsync -ruv libtorch/ ${PREFIX} \ @@ -98,7 +98,7 @@ RUN ${GET} --output libtorch.zip ${LIBTORCH_URL_GPU} \ # torch-scatter # I have absolutely no clue why I need this __CUDA_NO_HALF_CONVERSIONS__, but it fails to compile if not set... RUN mkdir src \ - && ${GET} https://github.com/rusty1s/pytorch_scatter/archive/refs/tags/2.0.9.tar.gz \ + && ${GET} https://github.com/rusty1s/pytorch_scatter/archive/refs/tags/${TORCH_SCATTER_VERSION}.tar.gz \ | ${UNPACK_TO_SRC} \ && cmake -B build -S src -GNinja \ -DCMAKE_BUILD_TYPE=MinSizeRel \ @@ -112,10 +112,10 @@ RUN mkdir src \ # ROOT RUN mkdir src \ - && ${GET} https://root.cern/download/root_v6.24.06.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=MinSizeRel \ + -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_CXX_STANDARD=20 \ -DCMAKE_INSTALL_PREFIX=${PREFIX} \ -Dfail-on-missing=ON \ @@ -123,12 +123,14 @@ RUN mkdir src \ -Dgdml=ON \ -Dopengl=ON \ -Dpyroot=ON \ + -Ddataframe=ON \ + -Droot7=ON \ && cmake --build build -- install \ && rm -rf build src # cugraph RUN mkdir src \ - && ${GET} https://github.com/rapidsai/cugraph/archive/refs/tags/v22.02.00.tar.gz \ + && ${GET} https://github.com/rapidsai/cugraph/archive/refs/tags/v${CUGRAPH_VERSION}.tar.gz \ | ${UNPACK_TO_SRC} \ && cmake -B build -S src/cpp -GNinja \ -DCMAKE_BUILD_TYPE=MinSizeRel \ @@ -142,7 +144,7 @@ RUN mkdir src \ # Onnx (download of tar.gz does not work out of the box, since the build.sh script requires a git repository) RUN git clone https://github.com/microsoft/onnxruntime src \ - && (cd src && git checkout v1.13.1) \ + && (cd src && git checkout v${ONNXRUNTIME_VERSION}) \ && ./src/build.sh \ --config MinSizeRel \ --build_shared_lib \ @@ -150,9 +152,8 @@ RUN git clone https://github.com/microsoft/onnxruntime src \ --use_cuda \ --cuda_home /usr/local/cuda \ --cudnn_home /usr/local/cuda \ -# --minimal_build \ # does not work somehow -# --parallel 1 \ --skip_tests \ + --parallel 0 \ --cmake_extra_defines \ CMAKE_INSTALL_PREFIX=${PREFIX} \ CMAKE_CUDA_ARCHITECTURES=${CUDA_ARCH} \ diff --git a/ubuntu2404/0001-CMake-allow-finding-newer-versions-of-podio.patch b/ubuntu2404/0001-CMake-allow-finding-newer-versions-of-podio.patch new file mode 100644 index 0000000..2c90a28 --- /dev/null +++ b/ubuntu2404/0001-CMake-allow-finding-newer-versions-of-podio.patch @@ -0,0 +1,31 @@ +From 76bbcc713a5ef93502b23ed59a68f96dd87318b6 Mon Sep 17 00:00:00 2001 +From: Andre Sailer +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 + diff --git a/ubuntu2404/Dockerfile b/ubuntu2404/Dockerfile index 2ea49d8..2ca8741 100644 --- a/ubuntu2404/Dockerfile +++ b/ubuntu2404/Dockerfile @@ -58,12 +58,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.06 -ENV PODIO_VERSION=00-17-02 +ENV PODIO_VERSION=01-00-01 ENV EDM4HEP_VERSION=00-10-01 -ENV DD4HEP_VERSION=01-28 +ENV DD4HEP_VERSION=01-29 ENV ONNXRUNTIME_VERSION=1.16.3 ENV VIRTUAL_ENV=/opt/venv @@ -160,6 +160,7 @@ RUN mkdir src \ && rm -rf build src # EDM4hep +ENV EDM4HEP_VERSION=00-10-05 RUN pip3 install jinja2 pyyaml \ && mkdir src \ && ${GET} https://github.com/key4hep/EDM4hep/archive/refs/tags/v${EDM4HEP_VERSION}.tar.gz \ @@ -175,9 +176,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_INSTALL_PREFIX=${PREFIX} \ @@ -203,7 +206,7 @@ RUN git clone https://github.com/microsoft/onnxruntime src \ --build_dir build \ --skip_tests \ --allow_running_as_root \ + --parallel 0 \ && cmake --build build/MinSizeRel -- install \ && rm -rf build src -COPY download_geant4_data.sh /usr/local/bin diff --git a/ubuntu2404/podio_cpp20.patch b/ubuntu2404/podio_cpp20.patch new file mode 100644 index 0000000..4491547 --- /dev/null +++ b/ubuntu2404/podio_cpp20.patch @@ -0,0 +1,15 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index e8a943b..c4f3a96 100755 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -77,8 +77,8 @@ find_package(ROOT REQUIRED COMPONENTS RIO Tree) + + # Check that root is compiled with a modern enough c++ standard + get_target_property(ROOT_COMPILE_FEATURES ROOT::Core INTERFACE_COMPILE_FEATURES) +-if (NOT "cxx_std_17" IN_LIST ROOT_COMPILE_FEATURES) +- message(FATAL_ERROR "You are trying to build podio against a version of ROOT that has not been built with a sufficient c++ standard. podio requires c++17") ++if (NOT "cxx_std_17" IN_LIST ROOT_COMPILE_FEATURES AND NOT "cxx_std_20" IN_LIST ROOT_COMPILE_FEATURES) ++ message(FATAL_ERROR "You are trying to build podio against a version of ROOT that has not been built with a sufficient c++ standard. podio requires c++17 or higher") + endif() + #Check if Python version detected matches the version used to build ROOT + SET(Python_FIND_FRAMEWORK LAST) diff --git a/ubuntu2404/pythia8307_cpp20.patch b/ubuntu2404/pythia8307_cpp20.patch new file mode 100644 index 0000000..c6a1890 --- /dev/null +++ b/ubuntu2404/pythia8307_cpp20.patch @@ -0,0 +1,129 @@ +From 09ef584f1ca797d84c1c0af18ec06b33d6c0d2d0 Mon Sep 17 00:00:00 2001 +From: Paul Gessinger +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() : 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 class LHmatrixBlock { + public: + //Constructor. Set uninitialized and explicitly zero. +- LHmatrixBlock() : 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 class LHtensor3Block { + public: + //Constructor. Set uninitialized and explicitly zero. +- LHtensor3Block() : 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 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(pythiaPtr); + pythiaObjects[iPythia]->settings.flag("Print:quiet", true); +-- +2.31.1 +