Skip to content

RivetHepMC: add include ReaderFactory to fix linking issue for deduce_reader

Andre Sailer requested to merge andresailer/rivet:fixHepMCReader into release-3-1-x

Following this change in HepMC3 https://gitlab.cern.ch/hepmc/HepMC3/-/merge_requests/260 Rivet fails to build against the HEAD of HepMC3 if this include is not present. (see e.g. https://lcgapp-services.cern.ch/cdash/viewFiles.php?buildid=263055 )

libtool: link: /cvmfs/sft.cern.ch/lcg/releases/gcc/11.3.0-de683/x86_64-el9/bin/g++ -pedantic -Wall -Wno-long-long -Wno-format -Werror=uninitialized -Werror=delete-non-virtual-dtor -fopenmp -O2 -o .libs/rivet-nopy rivet_nopy-rivet-nopy.o  -L/build/jenkins/workspace/lcg_nightly_pipeline/install/dev3cuda/hepmc3/HEAD/x86_64-el9-gcc11-opt/lib64 -L/usr/lib -L/build/jenkins/workspace/lcg_nightly_pipeline/install/dev3cuda/MCGenerators/yoda/1.9.8/x86_64-el9-gcc11-opt/lib -L/build/jenkins/workspace/lcg_nightly_pipeline/install/dev3cuda/fastjet/3.4.1/x86_64-el9-gcc11-opt/lib -L/build/jenkins/workspace/lcg_nightly_pipeline/install/dev3cuda/fjcontrib/1.052/x86_64-el9-gcc11-opt/lib -L/cvmfs/sft-nightlies.cern.ch/lcg/latest/fastjet/3.4.1-5af57/x86_64-el9-gcc11-opt/lib -L/cvmfs/sft.cern.ch/lcg/releases/gcc/11.3.0-de683/x86_64-el9/bin/../lib/gcc/x86_64-pc-linux-gnu/11.3.0 -L/cvmfs/sft.cern.ch/lcg/releases/gcc/11.3.0-de683/x86_64-el9/bin/../lib/gcc -L/cvmfs/sft.cern.ch/lcg/releases/gcc/11.3.0-de683/x86_64-el9/bin/../lib/gcc/x86_64-pc-linux-gnu/11.3.0/../../../../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -L/cvmfs/sft.cern.ch/lcg/releases/gcc/11.3.0-de683/x86_64-el9/bin/../lib/gcc/x86_64-pc-linux-gnu/11.3.0/../../.. ../src/.libs/libRivet.so /cvmfs/sft-nightlies.cern.ch/lcg/latest/MCGenerators/yoda/1.9.8-006da/x86_64-el9-gcc11-opt/lib/libYODA.so -ldl /cvmfs/sft-nightlies.cern.ch/lcg/latest/fastjet/3.4.1-5af57/x86_64-el9-gcc11-opt/lib/libfastjetplugins.so /cvmfs/sft-nightlies.cern.ch/lcg/latest/fastjet/3.4.1-5af57/x86_64-el9-gcc11-opt/lib/libsiscone_spherical.so /cvmfs/sft-nightlies.cern.ch/lcg/latest/fastjet/3.4.1-5af57/x86_64-el9-gcc11-opt/lib/libsiscone.so /cvmfs/sft.cern.ch/lcg/releases/gcc/11.3.0-de683/x86_64-el9/lib/../lib64/libgfortran.so /cvmfs/sft.cern.ch/lcg/releases/gcc/11.3.0-de683/x86_64-el9/lib/../lib64/libquadmath.so -lfastjetcontribfragile /cvmfs/sft-nightlies.cern.ch/lcg/latest/fastjet/3.4.1-5af57/x86_64-el9-gcc11-opt/lib/libfastjettools.so /cvmfs/sft-nightlies.cern.ch/lcg/latest/fastjet/3.4.1-5af57/x86_64-el9-gcc11-opt/lib/libfastjet.so /cvmfs/sft.cern.ch/lcg/releases/gcc/11.3.0-de683/x86_64-el9/lib/../lib64/libstdc++.so -lm -lHepMC3 -lHepMC3search -lz -fopenmp -Wl,-rpath -Wl,/build/jenkins/workspace/lcg_nightly_pipeline/install/dev3cuda/MCGenerators/rivet/3.1.8/x86_64-el9-gcc11-opt/lib -Wl,-rpath -Wl,/cvmfs/sft.cern.ch/lcg/releases/gcc/11.3.0-de683/x86_64-el9/lib/../lib64 -Wl,-rpath -Wl,/cvmfs/sft-nightlies.cern.ch/lcg/latest/MCGenerators/yoda/1.9.8-006da/x86_64-el9-gcc11-opt/lib -Wl,-rpath -Wl,/cvmfs/sft-nightlies.cern.ch/lcg/latest/fastjet/3.4.1-5af57/x86_64-el9-gcc11-opt/lib
/cvmfs/sft.cern.ch/lcg/releases/binutils/2.40-acaab/x86_64-el9/bin/ld: rivet_nopy-rivet-nopy.o: in function `main':
rivet-nopy.cc:(.text.startup+0x158): undefined reference to `HepMC3::deduce_reader(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
collect2: error: ld returned 1 exit status

I think, because deduce_reader(std::string const&) now has an inline it is no longer being linked from the library.

  • This does not yet work with the latest HepMC3 released version
Edited by Andre Sailer

Merge request reports