Error while installing ROOT 6.10.00 (related with pythia8)

I am installing ROOT in a cluster, where I don’t have authority to install everything with default setting, instead I need to classify the install path and export the path of external libraries (eg. pythia8) explicitly.

I install pythia8 by inside madgraph5, namely, call “install pythia8” inside mg5. Thus, pythia8 is install in a directory as “path-to-MG5/MG5_aMC_v2_5_5/HEPTools/pythia8”. Moreover, since I apply lhapdf package, the .so file in /pythia8/lib/ is libpythia8lhapdf6.so.

When I build the root, I clarify the prefix as well as pythia8 path as the following:

cmake3 -DCMAKE_INSTALL_PREFIX=/phenod/x3/hluo/PhenoPKG/Install-root -DPYTHIA8_LIBRARY=/phenod/x3/hluo/PhenoPKG/MG5_aMC_v2_5_5/HEPTools/pythia8/lib -DPYTHIA8_DIR=/phenod/x3/hluo/PhenoPKG/MG5_aMC_v2_5_5/HEPTools/pythia8 -DPYTHIA8_INCLUDE_DIR=/phenod/x3/hluo/PhenoPKG/MG5_aMC_v2_5_5/HEPTools/pythia8/include -Dpythia8=ON ../root-6.10.00

After that, I do “cmake3 --build . – -j8”

Then the following error appears.


[ 97%] Building CXX object montecarlo/vmc/CMakeFiles/VMC.dir/src/TVirtualMCGeometry.cxx.o
[ 97%] Building CXX object montecarlo/vmc/CMakeFiles/VMC.dir/src/TVirtualMCStack.cxx.o
[ 97%] Linking CXX shared library ../../lib/libVMC.so
[ 97%] Built target VMC
Scanning dependencies of target EGPythia8
[ 97%] Building CXX object montecarlo/pythia8/CMakeFiles/EGPythia8.dir/G__Pythia8.cxx.o
[ 97%] Building CXX object montecarlo/pythia8/CMakeFiles/EGPythia8.dir/src/TPythia8.cxx.o
[ 97%] Building CXX object montecarlo/pythia8/CMakeFiles/EGPythia8.dir/src/TPythia8Decayer.cxx.o
[ 97%] Linking CXX shared library ../../lib/libEGPythia8.so
CMakeFiles/EGPythia8.dir/src/TPythia8.cxx.o: In function `TPythia8::~TPythia8()':
/phenod/x3/hluo/PhenoPKG/root-6.10.00/montecarlo/pythia8/src/TPythia8.cxx:132: undefined reference to `Pythia8::Pythia::~Pythia()'
CMakeFiles/EGPythia8.dir/src/TPythia8.cxx.o: In function `TPythia8::GenerateEvent()':
/phenod/x3/hluo/PhenoPKG/root-6.10.00/montecarlo/pythia8/src/TPythia8.cxx:186: undefined reference to `Pythia8::Pythia::next()'
CMakeFiles/EGPythia8.dir/src/TPythia8.cxx.o: In function `TPythia8::TPythia8()':
/phenod/x3/hluo/PhenoPKG/root-6.10.00/montecarlo/pythia8/src/TPythia8.cxx:102: undefined reference to `Pythia8::Pythia::Pythia(std::string, bool)'
CMakeFiles/EGPythia8.dir/src/TPythia8.cxx.o: In function `TPythia8::TPythia8(char const*)':
/phenod/x3/hluo/PhenoPKG/root-6.10.00/montecarlo/pythia8/src/TPythia8.cxx:119: undefined reference to `Pythia8::Pythia::Pythia(std::string, bool)'
CMakeFiles/EGPythia8.dir/src/TPythia8.cxx.o: In function `TPythia8::ReadString(char const*) const':
/phenod/x3/hluo/PhenoPKG/root-6.10.00/montecarlo/pythia8/src/TPythia8.cxx:301: undefined reference to `Pythia8::Pythia::readString(std::string, bool)'
CMakeFiles/EGPythia8.dir/src/TPythia8.cxx.o: In function `TPythia8::ReadConfigFile(char const*) const':
/phenod/x3/hluo/PhenoPKG/root-6.10.00/montecarlo/pythia8/src/TPythia8.cxx:309: undefined reference to `Pythia8::Pythia::SUBRUNDEFAULT'
/phenod/x3/hluo/PhenoPKG/root-6.10.00/montecarlo/pythia8/src/TPythia8.cxx:309: undefined reference to `Pythia8::Pythia::readFile(std::string, bool, int)'
CMakeFiles/EGPythia8.dir/src/TPythia8.cxx.o: In function `Pythia8::Settings::listAll()':
/phenod/x3/hluo/PhenoPKG/MG5_aMC_v2_5_5/HEPTools/pythia8/include/Pythia8/Settings.h:225: undefined reference to `Pythia8::Settings::list(bool, bool, std::string)'
CMakeFiles/EGPythia8.dir/src/TPythia8.cxx.o: In function `Pythia8::Settings::listChanged()':
/phenod/x3/hluo/PhenoPKG/MG5_aMC_v2_5_5/HEPTools/pythia8/include/Pythia8/Settings.h:226: undefined reference to `Pythia8::Settings::list(bool, bool, std::string)'
CMakeFiles/EGPythia8.dir/src/TPythia8.cxx.o: In function `TPythia8::Initialize(int, int, double)':
/phenod/x3/hluo/PhenoPKG/root-6.10.00/montecarlo/pythia8/src/TPythia8.cxx:151: undefined reference to `Pythia8::Settings::mode(std::string, int, bool)'
/phenod/x3/hluo/PhenoPKG/root-6.10.00/montecarlo/pythia8/src/TPythia8.cxx:152: undefined reference to `Pythia8::Settings::mode(std::string, int, bool)'
/phenod/x3/hluo/PhenoPKG/root-6.10.00/montecarlo/pythia8/src/TPythia8.cxx:153: undefined reference to `Pythia8::Settings::mode(std::string, int, bool)'
/phenod/x3/hluo/PhenoPKG/root-6.10.00/montecarlo/pythia8/src/TPythia8.cxx:154: undefined reference to `Pythia8::Settings::parm(std::string, double, bool)'
/phenod/x3/hluo/PhenoPKG/root-6.10.00/montecarlo/pythia8/src/TPythia8.cxx:156: undefined reference to `Pythia8::Pythia::init()'
CMakeFiles/EGPythia8.dir/src/TPythia8.cxx.o: In function `TPythia8::Initialize(int, int, double, double)':
/phenod/x3/hluo/PhenoPKG/root-6.10.00/montecarlo/pythia8/src/TPythia8.cxx:169: undefined reference to `Pythia8::Settings::mode(std::string, int, bool)'
/phenod/x3/hluo/PhenoPKG/root-6.10.00/montecarlo/pythia8/src/TPythia8.cxx:170: undefined reference to `Pythia8::Settings::mode(std::string, int, bool)'
/phenod/x3/hluo/PhenoPKG/root-6.10.00/montecarlo/pythia8/src/TPythia8.cxx:171: undefined reference to `Pythia8::Settings::mode(std::string, int, bool)'
/phenod/x3/hluo/PhenoPKG/root-6.10.00/montecarlo/pythia8/src/TPythia8.cxx:172: undefined reference to `Pythia8::Settings::parm(std::string, double, bool)'
/phenod/x3/hluo/PhenoPKG/root-6.10.00/montecarlo/pythia8/src/TPythia8.cxx:173: undefined reference to `Pythia8::Settings::parm(std::string, double, bool)'
/phenod/x3/hluo/PhenoPKG/root-6.10.00/montecarlo/pythia8/src/TPythia8.cxx:176: undefined reference to `Pythia8::Pythia::init()'
CMakeFiles/EGPythia8.dir/src/TPythia8.cxx.o: In function `Pythia8::ParticleData::list(int)':
/phenod/x3/hluo/PhenoPKG/MG5_aMC_v2_5_5/HEPTools/pythia8/include/Pythia8/ParticleData.h:434: undefined reference to `Pythia8::ParticleData::list(std::vector<int, std::allocator<int> >)'
CMakeFiles/EGPythia8.dir/src/TPythia8.cxx.o: In function `Pythia8::ParticleData::listAll()':
/phenod/x3/hluo/PhenoPKG/MG5_aMC_v2_5_5/HEPTools/pythia8/include/Pythia8/ParticleData.h:428: undefined reference to `Pythia8::ParticleData::list(bool, bool)'
CMakeFiles/EGPythia8.dir/src/TPythia8.cxx.o: In function `Pythia8::ParticleData::listChanged(bool)':
/phenod/x3/hluo/PhenoPKG/MG5_aMC_v2_5_5/HEPTools/pythia8/include/Pythia8/ParticleData.h:429: undefined reference to `Pythia8::ParticleData::list(bool, bool)'
CMakeFiles/EGPythia8.dir/src/TPythia8.cxx.o: In function `TPythia8::PrintStatistics() const':
/phenod/x3/hluo/PhenoPKG/root-6.10.00/montecarlo/pythia8/src/TPythia8.cxx:357: undefined reference to `Pythia8::Pythia::stat()'
CMakeFiles/EGPythia8.dir/src/TPythia8.cxx.o: In function `TPythia8::EventListing() const':
/phenod/x3/hluo/PhenoPKG/root-6.10.00/montecarlo/pythia8/src/TPythia8.cxx:365: undefined reference to `Pythia8::Event::list(bool, bool, int) const'
CMakeFiles/EGPythia8.dir/src/TPythia8Decayer.cxx.o: In function `TPythia8Decayer::TPythia8Decayer()':
/phenod/x3/hluo/PhenoPKG/root-6.10.00/montecarlo/pythia8/src/TPythia8Decayer.cxx:40: undefined reference to `Pythia8::Pythia::readString(std::string, bool)'
/phenod/x3/hluo/PhenoPKG/root-6.10.00/montecarlo/pythia8/src/TPythia8Decayer.cxx:41: undefined reference to `Pythia8::Pythia::init()'
CMakeFiles/EGPythia8.dir/src/TPythia8Decayer.cxx.o: In function `TPythia8Decayer::AppendParticle(int, TLorentzVector*)':
/phenod/x3/hluo/PhenoPKG/MG5_aMC_v2_5_5/HEPTools/pythia8/include/Pythia8/Event.h:52: undefined reference to `vtable for Pythia8::Particle'
CMakeFiles/EGPythia8.dir/src/TPythia8Decayer.cxx.o: In function `Pythia8::Particle::setEvtPtr(Pythia8::Event*)':
/phenod/x3/hluo/PhenoPKG/MG5_aMC_v2_5_5/HEPTools/pythia8/include/Pythia8/Event.h:81: undefined reference to `Pythia8::Particle::setPDEPtr(Pythia8::ParticleDataEntry*)'
CMakeFiles/EGPythia8.dir/src/TPythia8Decayer.cxx.o: In function `Pythia8::Pythia::moreDecays()':
/phenod/x3/hluo/PhenoPKG/MG5_aMC_v2_5_5/HEPTools/pythia8/include/Pythia8/Pythia.h:172: undefined reference to `Pythia8::HadronLevel::moreDecays(Pythia8::Event&)'
CMakeFiles/EGPythia8.dir/src/TPythia8Decayer.cxx.o: In function `std::vector<Pythia8::Particle, std::allocator<Pythia8::Particle> >::_M_default_append(unsigned long)':
/phenod/x3/hluo/PhenoPKG/MG5_aMC_v2_5_5/HEPTools/pythia8/include/Pythia8/Event.h:41: undefined reference to `vtable for Pythia8::Particle'
/phenod/x3/hluo/PhenoPKG/MG5_aMC_v2_5_5/HEPTools/pythia8/include/Pythia8/Event.h:69: undefined reference to `vtable for Pythia8::Particle'
/phenod/x3/hluo/PhenoPKG/MG5_aMC_v2_5_5/HEPTools/pythia8/include/Pythia8/Event.h:41: undefined reference to `vtable for Pythia8::Particle'
CMakeFiles/EGPythia8.dir/src/TPythia8Decayer.cxx.o: In function `void std::vector<Pythia8::Particle, std::allocator<Pythia8::Particle> >::_M_emplace_back_aux<Pythia8::Particle>(Pythia8::Particle&&)':
/phenod/x3/hluo/PhenoPKG/MG5_aMC_v2_5_5/HEPTools/pythia8/include/Pythia8/Event.h:69: undefined reference to `vtable for Pythia8::Particle'
/phenod/x3/hluo/PhenoPKG/MG5_aMC_v2_5_5/HEPTools/pythia8/include/Pythia8/Event.h:69: undefined reference to `vtable for Pythia8::Particle'
CMakeFiles/EGPythia8.dir/src/TPythia8Decayer.cxx.o: In function `std::_Rb_tree_iterator<std::pair<int const, Pythia8::ParticleDataEntry> > std::_Rb_tree<int, std::pair<int const, Pythia8::ParticleDataEntry>, std::_Select1st<std::pair<int const, Pythia8::ParticleDataEntry> >, std::less<int>, std::allocator<std::pair<int const, Pythia8::ParticleDataEntry> > >::_M_emplace_hint_unique<std::piecewise_construct_t const&, std::tuple<int&&>, std::tuple<> >(std::_Rb_tree_const_iterator<std::pair<int const, Pythia8::ParticleDataEntry> >, std::piecewise_construct_t const&, std::tuple<int&&>&&, std::tuple<>&&)':
/phenod/x3/hluo/PhenoPKG/MG5_aMC_v2_5_5/HEPTools/pythia8/include/Pythia8/ParticleData.h:129: undefined reference to `Pythia8::ParticleDataEntry::setDefaults()'
CMakeFiles/EGPythia8.dir/src/TPythia8Decayer.cxx.o: In function `std::_Rb_tree_iterator<std::pair<int const, Pythia8::ParticleDataEntry> > std::_Rb_tree<int, std::pair<int const, Pythia8::ParticleDataEntry>, std::_Select1st<std::pair<int const, Pythia8::ParticleDataEntry> >, std::less<int>, std::allocator<std::pair<int const, Pythia8::ParticleDataEntry> > >::_M_emplace_hint_unique<std::piecewise_construct_t const&, std::tuple<int&&>, std::tuple<> >(std::_Rb_tree_const_iterator<std::pair<int const, Pythia8::ParticleDataEntry> >, std::piecewise_construct_t const&, std::tuple<int&&>&&, std::tuple<>&&)':
/usr/include/c++/4.8.2/bits/stl_pair.h:96: undefined reference to `Pythia8::ParticleDataEntry::~ParticleDataEntry()'
collect2: error: ld returned 1 exit status
gmake[2]: *** [lib/libEGPythia8.so] Error 1
gmake[1]: *** [montecarlo/pythia8/CMakeFiles/EGPythia8.dir/all] Error 2
gmake: *** [all] Error 2

Could someone tell me how to solve this error?

PYTHIA8_LIBRARY should be the actual Pyhia8 library and not only the directory where the library is.
Alternatively and perhaps better is to configure with only:

cmake3 -DCMAKE_INSTALL_PREFIX=/phenod/x3/hluo/PhenoPKG/Install-root \
       -DPYTHIA8_DIR=/phenod/x3/hluo/PhenoPKG/MG5_aMC_v2_5_5/HEPTools/pythia8 \
       -Dpythia8=ON \
       ../root-6.10.00

The libraries and headers can be found simply using PYTHIA8_DIR. If you want to try remember to remove the CMakeCache.txt file.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.