From b89d7393c2c50f47524b168f2f5534f83cd3f0f7 Mon Sep 17 00:00:00 2001 From: Markus Seidel Date: Fri, 29 Mar 2024 12:38:00 +0100 Subject: [PATCH 1/4] Rivet 4.0.0 and YODA 2.0.0 --- rivet-analysis.patch | 12 ------------ rivet.spec | 13 ++++++------- scram-tools.file/tools/rivet/rivet.xml | 4 +++- yoda.spec | 2 +- 4 files changed, 10 insertions(+), 21 deletions(-) delete mode 100644 rivet-analysis.patch diff --git a/rivet-analysis.patch b/rivet-analysis.patch deleted file mode 100644 index b1302b1cf0d..00000000000 --- a/rivet-analysis.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff --git a/analyses/pluginATLAS/ATLAS_2023_I2663725.cc b/analyses/pluginATLAS/ATLAS_2023_I2663725.cc -index 41d39daad7645a563654a55f423ebe4a71a23ef1..e0c1e538ce9d4ddd793ed202db53d7294d3b8144 100644 ---- a/analyses/pluginATLAS/ATLAS_2023_I2663725.cc -+++ b/analyses/pluginATLAS/ATLAS_2023_I2663725.cc -@@ -5,6 +5,7 @@ - #include "Rivet/Projections/DressedLeptons.hh" - #include "Rivet/Projections/PromptFinalState.hh" - #include "Rivet/Projections/InvisibleFinalState.hh" -+#include "Rivet/Projections/VetoedFinalState.hh" - - namespace Rivet { - diff --git a/rivet.spec b/rivet.spec index 7a18cbdf81c..6a856d0119f 100644 --- a/rivet.spec +++ b/rivet.spec @@ -1,17 +1,15 @@ -### RPM external rivet 3.1.10 +### RPM external rivet 4.0.0 ## INCLUDE cpp-standard ## INITENV +PATH PYTHON3PATH %{i}/${PYTHON3_LIB_SITE_PACKAGES} ## OLD GENSER Source: http://cern.ch/service-spi/external/MCGenerators/distribution/rivet/rivet-%{realversion}-src.tgz Source: git+https://gitlab.com/hepcedar/rivet.git?obj=master/%{n}-%{realversion}&export=%{n}-%{realversion}&output=/%{n}-%{realversion}.tgz -Patch0: rivet-analysis -Requires: hepmc fastjet fastjet-contrib yoda +Requires: hepmc3 fastjet fastjet-contrib yoda hdf5 highfive onnxruntime BuildRequires: python3 py3-cython autotools %prep ## OLD GENSER: %setup -n rivet/%{realversion} %setup -n %{n}-%{realversion} -%patch0 -p1 # Update config.{guess,sub} to detect aarch64 and ppc64le rm -f %{_tmppath}/config.{sub,guess} @@ -43,13 +41,14 @@ CXXFLAGS="-std=c++%{cms_cxx_standard}" sed -i "/_pow10 only defined for positive powers/d" include/Rivet/Tools/ParticleIdUtils.hh PYTHON=$(which python3) \ -./configure --disable-silent-rules --prefix=%{i} --with-hepmc=${HEPMC_ROOT} \ +./configure --disable-silent-rules --prefix=%{i} --with-hepmc=${HEPMC3_ROOT} \ --with-fastjet=${FASTJET_ROOT} --with-fjcontrib=${FASTJET_CONTRIB_ROOT} --with-yoda=${YODA_ROOT} \ --disable-doxygen --disable-pdfmanual --with-pic \ - CXX="$(which g++)" CPPFLAGS="-I${BOOST_ROOT}/include" CXXFLAGS="${CXXFLAGS}" + --with-hdf5=${HDF5_ROOT}/bin/h5pcc --with-highfive=${HIGHFIVE_ROOT} --enable-onnxrt=${ONNXRUNTIME_ROOT} \ + CXX="mpicxx" CPPFLAGS="-I${BOOST_ROOT}/include" CXXFLAGS="${CXXFLAGS}" # The following hack insures that the bins with the library linked explicitly # rather than indirectly, as required by the gold linker -perl -p -i -e "s|LIBS = $|LIBS = -lHepMC|g" bin/Makefile +perl -p -i -e "s|LIBS = $|LIBS = -lHepMC3|g" bin/Makefile %build make %{makeprocesses} all %install diff --git a/scram-tools.file/tools/rivet/rivet.xml b/scram-tools.file/tools/rivet/rivet.xml index b1723d487f8..af6c9f08766 100644 --- a/scram-tools.file/tools/rivet/rivet.xml +++ b/scram-tools.file/tools/rivet/rivet.xml @@ -10,10 +10,12 @@ - + + + diff --git a/yoda.spec b/yoda.spec index b9835ef0d1c..4e6ef526631 100644 --- a/yoda.spec +++ b/yoda.spec @@ -1,4 +1,4 @@ -### RPM external yoda 1.9.10 +### RPM external yoda 2.0.0 ## INITENV +PATH PYTHON3PATH %i/${PYTHON3_LIB_SITE_PACKAGES} Source: git+https://gitlab.com/hepcedar/yoda.git?obj=main/%{n}-%{realversion}&export=%{n}-%{realversion}&output=/%{n}-%{realversion}.tgz From 323cf9d33fafa8547454088f119b3210d74974e3 Mon Sep 17 00:00:00 2001 From: Markus Seidel Date: Thu, 4 Apr 2024 09:56:24 +0200 Subject: [PATCH 2/4] Remove rivet-buildplugin --- rivet.spec | 1 - 1 file changed, 1 deletion(-) diff --git a/rivet.spec b/rivet.spec index 6a856d0119f..eaddf4bd980 100644 --- a/rivet.spec +++ b/rivet.spec @@ -57,5 +57,4 @@ sed -i -e 's|^#!.*python.*|#!/usr/bin/env python3|' %{i}/bin/* %post %{relocateConfig}bin/rivet-config -%{relocateConfig}bin/rivet-buildplugin %{relocateConfig}bin/rivet-build From d4ac5c8e255629b4c96732d964af6e8e04377f79 Mon Sep 17 00:00:00 2001 From: Markus Seidel Date: Thu, 4 Apr 2024 11:49:03 +0200 Subject: [PATCH 3/4] HepMC3 ROOT_INCLUDE_PATH --- scram-tools.file/tools/hepmc3/hepmc3.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/scram-tools.file/tools/hepmc3/hepmc3.xml b/scram-tools.file/tools/hepmc3/hepmc3.xml index 1bec426f62c..399d9173829 100644 --- a/scram-tools.file/tools/hepmc3/hepmc3.xml +++ b/scram-tools.file/tools/hepmc3/hepmc3.xml @@ -7,4 +7,5 @@ + From 256c88cd69ac85ee9d15104e756dfe2a7414beb6 Mon Sep 17 00:00:00 2001 From: Markus Seidel Date: Mon, 8 Apr 2024 10:57:53 +0200 Subject: [PATCH 4/4] Rivet ignore duplicate libs --- rivet-duplicate-libs.patch | 37 +++++++++++++++++++++++++++++++++++++ rivet.spec | 2 ++ 2 files changed, 39 insertions(+) create mode 100644 rivet-duplicate-libs.patch diff --git a/rivet-duplicate-libs.patch b/rivet-duplicate-libs.patch new file mode 100644 index 00000000000..6121fa1cd68 --- /dev/null +++ b/rivet-duplicate-libs.patch @@ -0,0 +1,37 @@ +diff --git a/include/Rivet/AnalysisLoader.hh b/include/Rivet/AnalysisLoader.hh +index d95c5d3a5..7ed7db87d 100644 +--- a/include/Rivet/AnalysisLoader.hh ++++ b/include/Rivet/AnalysisLoader.hh +@@ -98,6 +98,7 @@ namespace Rivet { + + /// List of Rivet*.so plugin library paths to load from + static vector _pluginpaths; ++ static vector _pluginnames; + + typedef map AnalysisBuilderMap; + /// Canonical analysis builder functors +diff --git a/src/Core/AnalysisLoader.cc b/src/Core/AnalysisLoader.cc +index 137383b12..e2a1cc91a 100644 +--- a/src/Core/AnalysisLoader.cc ++++ b/src/Core/AnalysisLoader.cc +@@ -14,6 +14,7 @@ namespace Rivet { + + // Initialise static-function ptrs + vector AnalysisLoader::_pluginpaths; ++ vector AnalysisLoader::_pluginnames; + AnalysisLoader::AnalysisBuilderMap AnalysisLoader::_ptrs; + AnalysisLoader::AnalysisBuilderMap AnalysisLoader::_aliasptrs; + +@@ -159,6 +160,11 @@ namespace Rivet { + if (filename.find("Rivet") != 0) continue; + size_t posn = filename.find(libsuffix); + if (posn == string::npos || posn != filename.length()-libsuffix.length()) continue; ++ // Ensure not duplicate libs ++ if (find(_pluginnames.begin(), _pluginnames.end(), filename) != _pluginnames.end()) { ++ continue; ++ } ++ _pluginnames += filename; + /// @todo Make sure this is an abs path + /// @todo Sys-dependent path separator instead of "/" + const string path = d + "/" + filename; + diff --git a/rivet.spec b/rivet.spec index eaddf4bd980..cba709f6b8c 100644 --- a/rivet.spec +++ b/rivet.spec @@ -3,6 +3,7 @@ ## INITENV +PATH PYTHON3PATH %{i}/${PYTHON3_LIB_SITE_PACKAGES} ## OLD GENSER Source: http://cern.ch/service-spi/external/MCGenerators/distribution/rivet/rivet-%{realversion}-src.tgz Source: git+https://gitlab.com/hepcedar/rivet.git?obj=master/%{n}-%{realversion}&export=%{n}-%{realversion}&output=/%{n}-%{realversion}.tgz +Patch0: rivet-duplicate-libs Requires: hepmc3 fastjet fastjet-contrib yoda hdf5 highfive onnxruntime BuildRequires: python3 py3-cython autotools @@ -10,6 +11,7 @@ BuildRequires: python3 py3-cython autotools %prep ## OLD GENSER: %setup -n rivet/%{realversion} %setup -n %{n}-%{realversion} +%patch0 -p1 # Update config.{guess,sub} to detect aarch64 and ppc64le rm -f %{_tmppath}/config.{sub,guess}