Root Installation, need '-ldl'?

Hello,

I am a newbie who is installing ROOT for a week already and
still not so successful.
I was just following the instruction of the website and “README/INSTALL”.
But ‘make’ always failed at build [95%] level with such error messages:
[ 95%] Linking CXX shared library …/…/lib/libEGPythia8.so
/lib/…/lib/libpythia8.a(PartonDistributions.o): In function Pythia8::LHAPDF::symbol(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)': PartonDistributions.cc:(.text+0xdb68): undefined reference todlsym’
PartonDistributions.cc:(.text+0xdb70): undefined reference to dlerror' PartonDistributions.cc:(.text+0xdbf3): undefined reference todlerror’
/lib/…/lib/libpythia8.a(PartonDistributions.o): In function Pythia8::LHAPDF::~LHAPDF()': PartonDistributions.cc:(.text+0x13b7b): undefined reference todlclose’
PartonDistributions.cc:(.text+0x13b80): undefined reference to dlerror' /lib/../lib/libpythia8.a(PartonDistributions.o): In functionPythia8::LHAPDF::LHAPDF(int, std::__cxx11::basic_string<char, std::char_traits, std::allocator >, Pythia8::Info*)’:
PartonDistributions.cc:(.text+0x13f4b): undefined reference to dlerror' PartonDistributions.cc:(.text+0x141f1): undefined reference todlopen’
PartonDistributions.cc:(.text+0x141fd): undefined reference to `dlerror’
collect2: error: ld returned 1 exit status
montecarlo/pythia8/CMakeFiles/EGPythia8.dir/build.make:174: recipe for target ‘lib/libEGPythia8.so’ failed
make[2]: *** [lib/libEGPythia8.so] Error 1
CMakeFiles/Makefile2:18833: recipe for target ‘montecarlo/pythia8/CMakeFiles/EGPythia8.dir/all’ failed
make[1]: *** [montecarlo/pythia8/CMakeFiles/EGPythia8.dir/all] Error 2
Makefile:149: recipe for target ‘all’ failed
make: *** [all] Error 2

I googled this and found some suggestions to add “-ldl” to LDFLAGS. And I added “-ldl” to etc/MakeFile/arch.
But the problem is not solved.

Do you have any suggestion to do for solving this?

Thanks!

‘-ldl’ fixed the problem. I changed LDFLAGS not CLDFLAGS and compiled cmake.

Thank you for your answer :smiley:

When using static libraries (like you use for Pythia), the dependencies (e.g. libdl) of the static library have to be propagated to the library linking against it (in this case libEGPythia8 in ROOT) since they are not linked to the static library itself. I think the best option in your case would be to just use shared libraries for Pythia8.