Compiling MCatNLO for PYTHIA8: undefined reference to `dl**' and 'HepMC'

Asked by Haitao Li

Dear MG5 experts

I use the MG5_aMC 2.33 and Pythia 8.212. I have added the path of Pythia8 to mg5_configuration.txt and modified shower_card.dat by adding "dl" to extralibs and path of hepmc to extrapaths. When I use MG5+Pythia8, I still get a Compiling error. The massage is

/home/hail/Documents/hepcode/pythia8212/lib/libpythia8.a(PartonDistributions.o): In function `Pythia8::LHAPDF::symbol(std::string)':
PartonDistributions.cc:(.text+0xe690): undefined reference to `dlerror'
PartonDistributions.cc:(.text+0xe69c): undefined reference to `dlsym'
PartonDistributions.cc:(.text+0xe6a4): undefined refPythia8 compilation did not succeed, exiting
text+0xe752): undefined reference to `dlerror'
PartonDistributions.cc:(.text+0xe77d): undefined reference to `dlopen'
PartonDistributions.cc:(.text+0xe785): undefined reference to `dlerror'
/home/hail/Documents/hepcode/pythia8212/lib/libpythia8.a(PartonDistributions.o): In function `Pythia8::LHAPDF::~LHAPDF()':
PartonDistributions.cc:(.text+0xfaba): undefined reference to `dlclose'
PartonDistributions.cc:(.text+0xfac1): undefined reference to `dlerror'
/tmp/ccLaODHX.o: In function `main':
Pythia82.cc:(.text+0x13e1): undefined reference to `HepMC::IO_GenEvent::IO_GenEvent(std::string const&, std::_Ios_Openmode)'
Pythia82.cc:(.text+0x1589): undefined reference to `HepMC::WeightContainer::WeightContainer(std::vector<double, std::allocator<double> > const&)'
Pythia82.cc:(.text+0x15ab): undefined reference to `HepMC::Units::default_momentum_unit()'
Pythia82.cc:(.text+0x15b3): undefined reference to `HepMC::Units::default_length_unit()'
Pythia82.cc:(.text+0x15e9): undefined reference to `HepMC::GenEvent::GenEvent(int, int, HepMC::GenVertex*, HepMC::WeightContainer const&, std::vector<long, std::allocator<long> > const&, HepMC::Units::MomentumUnit, HepMC::Units::LengthUnit)'
Pythia82.cc:(.text+0x16fb): undefined reference to `HepMC::WeightContainer::push_back(double const&)'
Pythia82.cc:(.text+0x18d9): undefined reference to `HepMC::IO_GenEvent::~IO_GenEvent()'
Pythia82.cc:(.text+0x1b43): undefined reference to `HepMC::IO_GenEvent::~IO_GenEvent()'
Pythia82.cc:(.text+0x1bcb): undefined reference to `HepMC::IO_GenEvent::~IO_GenEvent()'
/tmp/ccLaODHX.o: In function `HepMC::Flow::set_icode(int, int)':
Pythia82.cc:(.text._ZN5HepMC4Flow9set_icodeEii[_ZN5HepMC4Flow9set_icodeEii]+0x41): undefined reference to `HepMC::Flow::Flow(HepMC::Flow const&)'
/tmp/ccLaODHX.o: In function `HepMC::Flow::set_unique_icode(int)':
Pythia82.cc:(.text._ZN5HepMC4Flow16set_unique_icodeEi[_ZN5HepMC4Flow16set_unique_icodeEi]+0x3f): undefined reference to `HepMC::Flow::Flow(HepMC::Flow const&)'
/tmp/ccLaODHX.o: In function `HepMC::GenParticle::set_flow(int, int)':
Pythia82.cc:(.text._ZN5HepMC11GenParticle8set_flowEii[_ZN5HepMC11GenParticle8set_flowEii]+0x3a): undefined reference to `HepMC::Flow::~Flow()'
Pythia82.cc:(.text._ZN5HepMC11GenParticle8set_flowEii[_ZN5HepMC11GenParticle8set_flowEii]+0x62): undefined reference to `HepMC::Flow::~Flow()'
/tmp/ccLaODHX.o: In function `HepMC::GenEvent::set_cross_section(HepMC::GenCrossSection const&)':
Pythia82.cc:(.text._ZN5HepMC8GenEvent17set_cross_sectionERKNS_15GenCrossSectionE[_ZN5HepMC8GenEvent17set_cross_sectionERKNS_15GenCrossSectionE]+0x4b): undefined reference to `HepMC::GenCrossSection::GenCrossSection(HepMC::GenCrossSection const&)'
/tmp/ccLaODHX.o: In function `HepMC::IO_BaseClass::read_next_event()':
Pythia82.cc:(.text._ZN5HepMC12IO_BaseClass15read_next_eventEv[_ZN5HepMC12IO_BaseClass15read_next_eventEv]+0x3c): undefined reference to `HepMC::WeightContainer::WeightContainer(std::vector<double, std::allocator<double> > const&)'
Pythia82.cc:(.text._ZN5HepMC12IO_BaseClass15read_next_eventEv[_ZN5HepMC12IO_BaseClass15read_next_eventEv]+0x5b): undefined reference to `HepMC::Units::default_momentum_unit()'
Pythia82.cc:(.text._ZN5HepMC12IO_BaseClass15read_next_eventEv[_ZN5HepMC12IO_BaseClass15read_next_eventEv]+0x63): undefined reference to `HepMC::Units::default_length_unit()'
Pythia82.cc:(.text._ZN5HepMC12IO_BaseClass15read_next_eventEv[_ZN5HepMC12IO_BaseClass15read_next_eventEv]+0x99): undefined reference to `HepMC::GenEvent::GenEvent(int, int, HepMC::GenVertex*, HepMC::WeightContainer const&, std::vector<long, std::allocator<long> > const&, HepMC::Units::MomentumUnit, HepMC::Units::LengthUnit)'
/tmp/ccLaODHX.o: In function `HepMC::Pythia8ToHepMC::fill_next_event(Pythia8::Event&, HepMC::GenEvent*, int, Pythia8::Info*, Pythia8::Settings*, bool, HepMC::GenParticle*, int)':
Pythia82.cc:(.text._ZN5HepMC14Pythia8ToHepMC15fill_next_eventERN7Pythia85EventEPNS_8GenEventEiPNS1_4InfoEPNS1_8SettingsEbPNS_11GenParticleEi[_ZN5HepMC14Pythia8ToHepMC15fill_next_eventERN7Pythia85EventEPNS_8GenEventEiPNS1_4InfoEPNS1_8SettingsEbPNS_11GenParticleEi]+0xff): undefined reference to `HepMC::Units::conversion_factor(HepMC::Units::MomentumUnit, HepMC::Units::MomentumUnit)'
Pythia82.cc:(.text._ZN5HepMC14Pythia8ToHepMC15fill_next_eventERN7Pythia85EventEPNS_8GenEventEiPNS1_4InfoEPNS1_8SettingsEbPNS_11GenParticleEi[_ZN5HepMC14Pythia8ToHepMC15fill_next_eventERN7Pythia85EventEPNS_8GenEventEiPNS1_4InfoEPNS1_8SettingsEbPNS_11GenParticleEi]+0x130): undefined reference to `HepMC::Units::conversion_factor(HepMC::Units::LengthUnit, HepMC::Units::LengthUnit)'
Pythia82.cc:(.text._ZN5HepMC14Pythia8ToHepMC15fill_next_eventERN7Pythia85EventEPNS_8GenEventEiPNS1_4InfoEPNS1_8SettingsEbPNS_11GenParticleEi[_ZN5HepMC14Pythia8ToHepMC15fill_next_eventERN7Pythia85EventEPNS_8GenEventEiPNS1_4InfoEPNS1_8SettingsEbPNS_11GenParticleEi]+0x216): undefined reference to `HepMC::WeightContainer::WeightContainer(std::vector<double, std::allocator<double> > const&)'
Pythia82.cc:(.text._ZN5HepMC14Pythia8ToHepMC15fill_next_eventERN7Pythia85EventEPNS_8GenEventEiPNS1_4InfoEPNS1_8SettingsEbPNS_11GenParticleEi[_ZN5HepMC14Pythia8ToHepMC15fill_next_eventERN7Pythia85EventEPNS_8GenEventEiPNS1_4InfoEPNS1_8SettingsEbPNS_11GenParticleEi]+0x23a): undefined reference to `HepMC::GenVertex::GenVertex(HepMC::FourVector const&, int, HepMC::WeightContainer const&)'
Pythia82.cc:(.text._ZN5HepMC14Pythia8ToHepMC15fill_next_eventERN7Pythia85EventEPNS_8GenEventEiPNS1_4InfoEPNS1_8SettingsEbPNS_11GenParticleEi[_ZN5HepMC14Pythia8ToHepMC15fill_next_eventERN7Pythia85EventEPNS_8GenEventEiPNS1_4InfoEPNS1_8SettingsEbPNS_11GenParticleEi]+0x272): undefined reference to `HepMC::GenVertex::add_particle_in(HepMC::GenParticle*)'
Pythia82.cc:(.text._ZN5HepMC14Pythia8ToHepMC15fill_next_eventERN7Pythia85EventEPNS_8GenEventEiPNS1_4InfoEPNS1_8SettingsEbPNS_11GenParticleEi[_ZN5HepMC14Pythia8ToHepMC15fill_next_eventERN7Pythia85EventEPNS_8GenEventEiPNS1_4InfoEPNS1_8SettingsEbPNS_11GenParticleEi]+0x28b): undefined reference to `HepMC::GenEvent::add_vertex(HepMC::GenVertex*)'
Pythia82.cc:(.text._ZN5HepMC14Pythia8ToHepMC15fill_next_eventERN7Pythia85EventEPNS_8GenEventEiPNS1_4InfoEPNS1_8SettingsEbPNS_11GenParticleEi[_ZN5HepMC14Pythia8ToHepMC15fill_next_eventERN7Pythia85EventEPNS_8GenEventEiPNS1_4InfoEPNS1_8SettingsEbPNS_11GenParticleEi]+0x42a): undefined reference to `HepMC::Flow::Flow(HepMC::GenParticle*)'
Pythia82.cc:(.text._ZN5HepMC14Pythia8ToHepMC15fill_next_eventERN7Pythia85EventEPNS_8GenEventEiPNS1_4InfoEPNS1_8SettingsEbPNS_11GenParticleEi[_ZN5HepMC14Pythia8ToHepMC15fill_next_eventERN7Pythia85EventEPNS_8GenEventEiPNS1_4InfoEPNS1_8SettingsEbPNS_11GenParticleEi]+0x448): undefined reference to `HepMC::Polarization::Polarization(double, double)'
Pythia82.cc:(.text._ZN5HepMC14Pythia8ToHepMC15fill_next_eventERN7Pythia85EventEPNS_8GenEventEiPNS1_4InfoEPNS1_8SettingsEbPNS_11GenParticleEi[_ZN5HepMC14Pythia8ToHepMC15fill_next_eventERN7Pythia85EventEPNS_8GenEventEiPNS1_4InfoEPNS1_8SettingsEbPNS_11GenParticleEi]+0x47e): undefined reference to `HepMC::GenParticle::GenParticle(HepMC::FourVector const&, int, int, HepMC::Flow const&, HepMC::Polarization const&)'
Pythia82.cc:(.text._ZN5HepMC14Pythia8ToHepMC15fill_next_eventERN7Pythia85EventEPNS_8GenEventEiPNS1_4InfoEPNS1_8SettingsEbPNS_11GenParticleEi[_ZN5HepMC14Pythia8ToHepMC15fill_next_eventERN7Pythia85EventEPNS_8GenEventEiPNS1_4InfoEPNS1_8SettingsEbPNS_11GenParticleEi]+0x4ba): undefined reference to `HepMC::Flow::~Flow()'
Pythia82.cc:(.text._ZN5HepMC14Pythia8ToHepMC15fill_next_eventERN7Pythia85EventEPNS_8GenEventEiPNS1_4InfoEPNS1_8SettingsEbPNS_11GenParticleEi[_ZN5HepMC14Pythia8ToHepMC15fill_next_eventERN7Pythia85EventEPNS_8GenEventEiPNS1_4InfoEPNS1_8SettingsEbPNS_11GenParticleEi]+0x506): undefined reference to `HepMC::GenParticle::suggest_barcode(int)'
Pythia82.cc:(.text._ZN5HepMC14Pythia8ToHepMC15fill_next_eventERN7Pythia85EventEPNS_8GenEventEiPNS1_4InfoEPNS1_8SettingsEbPNS_11GenParticleEi[_ZN5HepMC14Pythia8ToHepMC15fill_next_eventERN7Pythia85EventEPNS_8GenEventEiPNS1_4InfoEPNS1_8SettingsEbPNS_11GenParticleEi]+0x55f): undefined reference to `HepMC::GenParticle::set_generated_mass(double const&)'
Pythia82.cc:(.text._ZN5HepMC14Pythia8ToHepMC15fill_next_eventERN7Pythia85EventEPNS_8GenEventEiPNS1_4InfoEPNS1_8SettingsEbPNS_11GenParticleEi[_ZN5HepMC14Pythia8ToHepMC15fill_next_eventERN7Pythia85EventEPNS_8GenEventEiPNS1_4InfoEPNS1_8SettingsEbPNS_11GenParticleEi]+0x6bc): undefined reference to `HepMC::GenEvent::set_beam_particles(HepMC::GenParticle*, HepMC::GenParticle*)'
Pythia82.cc:(.text._ZN5HepMC14Pythia8ToHepMC15fill_next_eventERN7Pythia85EventEPNS_8GenEventEiPNS1_4InfoEPNS1_8SettingsEbPNS_11GenParticleEi[_ZN5HepMC14Pythia8ToHepMC15fill_next_eventERN7Pythia85EventEPNS_8GenEventEiPNS1_4InfoEPNS1_8SettingsEbPNS_11GenParticleEi]+0x7f3): undefined reference to `HepMC::GenVertex::add_particle_out(HepMC::GenParticle*)'
Pythia82.cc:(.text._ZN5HepMC14Pythia8ToHepMC15fill_next_eventERN7Pythia85EventEPNS_8GenEventEiPNS1_4InfoEPNS1_8SettingsEbPNS_11GenParticleEi[_ZN5HepMC14Pythia8ToHepMC15fill_next_eventERN7Pythia85EventEPNS_8GenEventEiPNS1_4InfoEPNS1_8SettingsEbPNS_11GenParticleEi]+0x9e7): undefined reference to `HepMC::WeightContainer::WeightContainer(std::vector<double, std::allocator<double> > const&)'
Pythia82.cc:(.text._ZN5HepMC14Pythia8ToHepMC15fill_next_eventERN7Pythia85EventEPNS_8GenEventEiPNS1_4InfoEPNS1_8SettingsEbPNS_11GenParticleEi[_ZN5HepMC14Pythia8ToHepMC15fill_next_eventERN7Pythia85EventEPNS_8GenEventEiPNS1_4InfoEPNS1_8SettingsEbPNS_11GenParticleEi]+0xa0e): undefined reference to `HepMC::GenVertex::GenVertex(HepMC::FourVector const&, int, HepMC::WeightContainer const&)'
Pythia82.cc:(.text._ZN5HepMC14Pythia8ToHepMC15fill_next_eventERN7Pythia85EventEPNS_8GenEventEiPNS1_4InfoEPNS1_8SettingsEbPNS_11GenParticleEi[_ZN5HepMC14Pythia8ToHepMC15fill_next_eventERN7Pythia85EventEPNS_8GenEventEiPNS1_4InfoEPNS1_8SettingsEbPNS_11GenParticleEi]+0xa4c): undefined reference to `HepMC::GenVertex::add_particle_out(HepMC::GenParticle*)'
Pythia82.cc:(.text._ZN5HepMC14Pythia8ToHepMC15fill_next_eventERN7Pythia85EventEPNS_8GenEventEiPNS1_4InfoEPNS1_8SettingsEbPNS_11GenParticleEi[_ZN5HepMC14Pythia8ToHepMC15fill_next_eventERN7Pythia85EventEPNS_8GenEventEiPNS1_4InfoEPNS1_8SettingsEbPNS_11GenParticleEi]+0xa65): undefined reference to `HepMC::GenEvent::add_vertex(HepMC::GenVertex*)'
Pythia82.cc:(.text._ZN5HepMC14Pythia8ToHepMC15fill_next_eventERN7Pythia85EventEPNS_8GenEventEiPNS1_4InfoEPNS1_8SettingsEbPNS_11GenParticleEi[_ZN5HepMC14Pythia8ToHepMC15fill_next_eventERN7Pythia85EventEPNS_8GenEventEiPNS1_4InfoEPNS1_8SettingsEbPNS_11GenParticleEi]+0xb9b): undefined reference to `HepMC::GenVertex::add_particle_in(HepMC::GenParticle*)'
Pythia82.cc:(.text._ZN5HepMC14Pythia8ToHepMC15fill_next_eventERN7Pythia85EventEPNS_8GenEventEiPNS1_4InfoEPNS1_8SettingsEbPNS_11GenParticleEi[_ZN5HepMC14Pythia8ToHepMC15fill_next_eventERN7Pythia85EventEPNS_8GenEventEiPNS1_4InfoEPNS1_8SettingsEbPNS_11GenParticleEi]+0xf2d): undefined reference to `HepMC::WeightContainer::WeightContainer(std::vector<double, std::allocator<double> > const&)'
Pythia82.cc:(.text._ZN5HepMC14Pythia8ToHepMC15fill_next_eventERN7Pythia85EventEPNS_8GenEventEiPNS1_4InfoEPNS1_8SettingsEbPNS_11GenParticleEi[_ZN5HepMC14Pythia8ToHepMC15fill_next_eventERN7Pythia85EventEPNS_8GenEventEiPNS1_4InfoEPNS1_8SettingsEbPNS_11GenParticleEi]+0xf51): undefined reference to `HepMC::GenVertex::GenVertex(HepMC::FourVector const&, int, HepMC::WeightContainer const&)'
Pythia82.cc:(.text._ZN5HepMC14Pythia8ToHepMC15fill_next_eventERN7Pythia85EventEPNS_8GenEventEiPNS1_4InfoEPNS1_8SettingsEbPNS_11GenParticleEi[_ZN5HepMC14Pythia8ToHepMC15fill_next_eventERN7Pythia85EventEPNS_8GenEventEiPNS1_4InfoEPNS1_8SettingsEbPNS_11GenParticleEi]+0xfa3): undefined reference to `HepMC::GenVertex::add_particle_out(HepMC::GenParticle*)'
Pythia82.cc:(.text._ZN5HepMC14Pythia8ToHepMC15fill_next_eventERN7Pythia85EventEPNS_8GenEventEiPNS1_4InfoEPNS1_8SettingsEbPNS_11GenParticleEi[_ZN5HepMC14Pythia8ToHepMC15fill_next_eventERN7Pythia85EventEPNS_8GenEventEiPNS1_4InfoEPNS1_8SettingsEbPNS_11GenParticleEi]+0xfbc): undefined reference to `HepMC::GenEvent::add_vertex(HepMC::GenVertex*)'
Pythia82.cc:(.text._ZN5HepMC14Pythia8ToHepMC15fill_next_eventERN7Pythia85EventEPNS_8GenEventEiPNS1_4InfoEPNS1_8SettingsEbPNS_11GenParticleEi[_ZN5HepMC14Pythia8ToHepMC15fill_next_eventERN7Pythia85EventEPNS_8GenEventEiPNS1_4InfoEPNS1_8SettingsEbPNS_11GenParticleEi]+0x1578): undefined reference to `HepMC::WeightContainer::push_back(double const&)'
Pythia82.cc:(.text._ZN5HepMC14Pythia8ToHepMC15fill_next_eventERN7Pythia85EventEPNS_8GenEventEiPNS1_4InfoEPNS1_8SettingsEbPNS_11GenParticleEi[_ZN5HepMC14Pythia8ToHepMC15fill_next_eventERN7Pythia85EventEPNS_8GenEventEiPNS1_4InfoEPNS1_8SettingsEbPNS_11GenParticleEi]+0x1630): undefined reference to `HepMC::Flow::~Flow()'
collect2: error: ld returned 1 exit status
make: *** [Pythia82] Error 1

I have saw the answers to other similar questions which didn't work for me.

Best,
Haitao

Question information

Language:
English Edit question
Status:
Answered
For:
MadGraph5_aMC@NLO Edit question
Assignee:
Paolo Torrielli Edit question
Last query:
Last reply:
Revision history for this message
Paolo Torrielli (paolo-torrielli) said :
#1

Dear Haitao,
this error is due to the code not finding library 'dl'.

I see you added it to the EXTRALIBS of your shower card,
but if you don't have the library on your system, or if the
code does not find it, it will still issue that error.

I would thus suggest you to check if that library (libdl) is
present on your system.
If it is not there, then after standard installation of the
library, the code should work. If it is there (maybe in some
non-standard location) you could try and add its path to
the variable EXTRAPATHS of the shower card, in order to
instruct the code about where to look for it.

If this does not work, you could also try and add its path
to the LD_LIBRARY_PATH of your .bash_profile or .bashrc
file.

Cheers,
Paolo

Revision history for this message
Haitao Li (lihaitao-phy) said :
#2

Dear Paolo,

Thank you very much for quick response.

I think that dl library is present on my system, otherwise I cannot install pythia8 successfully.
Below is the message when I type "whereis libdl" in terminal

"libdl: /lib/libdl.a /lib/libdl.so /usr/lib/libdl.a /usr/lib/libdl.so".

And I have tried to add /usr/lib to the LD_LIBRARY_PATH of .bashrc and EXTRAPATHS of shower_card. The same compiling error comes out again. Do you know what causes this error?

Cheers.
Haitao

Revision history for this message
Paolo Torrielli (paolo-torrielli) said :
#3

Dear Haitao,
this is a bit weird.

You could first go in MCatNLO, and type ./MCatNLO_MadFKS.inputs,
which is the command that compiles the interface.
This should output an error message, and probably from that message
you can get some more information about the issue.

The next thing you could try is to edit the two makefiles of the
MG5_aMC-Pythia8 interface, namely MCatNLO/srcPythia8/Makefile
and MCatNLO/srcPythia8/Makefile_hep, adding explicitly library dl
there.

Moreover, recently there has been some activity regarding Pythia8
and this dl library, so I would recommend, if you're not already doing
that, to use the latest version of MG5_aMC, and see if this one works.

Let me know.
Cheers.
Paolo

Can you help with this problem?

Provide an answer of your own, or ask Haitao Li for more information if necessary.

To post a message you must log in.