Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rivet 4.0.0 and YODA 2.0.0 #9111

Merged
merged 5 commits into from
Jul 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 0 additions & 12 deletions rivet-analysis.patch

This file was deleted.

37 changes: 37 additions & 0 deletions rivet-duplicate-libs.patch
Original file line number Diff line number Diff line change
@@ -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<string> _pluginpaths;
+ static vector<string> _pluginnames;

typedef map<string, const AnalysisBuilderBase*> 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<string> AnalysisLoader::_pluginpaths;
+ vector<string> 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;

14 changes: 7 additions & 7 deletions rivet.spec
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
### 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
Source99: scram-tools.file/tools/eigen/env
Patch0: rivet-analysis
Patch0: rivet-duplicate-libs

Requires: hepmc fastjet fastjet-contrib yoda
Requires: hepmc3 fastjet fastjet-contrib yoda hdf5 highfive onnxruntime
BuildRequires: python3 py3-cython autotools

%prep
Expand Down Expand Up @@ -46,13 +46,14 @@ CXXFLAGS="-std=c++%{cms_cxx_standard} $CMS_EIGEN_CXX_FLAGS"
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
make %{makeprocesses} all

%install
Expand All @@ -61,5 +62,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
1 change: 1 addition & 0 deletions scram-tools.file/tools/hepmc3/hepmc3.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@
<environment name="INCLUDE" default="$HEPMC3_BASE/include"/>
</client>
<runtime name="CMSSW_FWLITE_INCLUDE_PATH" value="$HEPMC3_BASE/include" type="path"/>
<runtime name="ROOT_INCLUDE_PATH" value="$INCLUDE" type="path"/>
</tool>
4 changes: 3 additions & 1 deletion scram-tools.file/tools/rivet/rivet.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@
<runtime name="RIVET_DATA_PATH" value="$RIVET_BASE/share/Rivet" type="path"/>
<runtime name="PDFPATH" default="$RIVET_BASE/share" type="path"/>
<runtime name="ROOT_INCLUDE_PATH" value="$INCLUDE" type="path"/>
<runtime name="TEXMFHOME" value="$RIVET_BASE/share/Rivet/texmf" type="path"/>
<use name="hepmc"/>
<use name="fastjet"/>
<use name="fastjet-contrib"/>
<use name="gsl"/>
<use name="yoda"/>
<use name="hdf5"/>
<use name="highfive"/>
<use name="onnxruntime"/>
</tool>
2 changes: 1 addition & 1 deletion yoda.spec
Original file line number Diff line number Diff line change
@@ -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
Expand Down