[ROOT-6862] ROOT is not compiling with Pythia8 support for last version 8201 Created: 31/Oct/14  Updated: 08/Oct/15  Resolved: 27/Aug/15

Status: Closed
Project: ROOT
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Low
Reporter: Oksana Shadura Assignee: Pere Mato Vila
Resolution: Fixed Votes: 0
Labels: None
Environment:

SL6, gcc 4.9.1, ROOT 5-34-xx


Development:

 Description   

ROOT is not compiling with Pythia8 support (version 8201)

Posiible problem:
cint not digesting dlfcn.h

Error details:

[ 94%] Generating G_Pythia8.cxx, G_Pythia8.h
Error: Symbol Dl_info is not defined in current scope /usr/include/dlfcn.h:95:
Error: Syntax error /usr/include/dlfcn.h:99:
Error: Syntax error /usr/include/dlfcn.h:104:
Error: Missing whitespace at or after line 190.
Error: Unexpected end of file (G__fgetspace():2) /usr/include/dlfcn.h:192:
Report: Unrecognized string '__END_DECLS' ignored /usr/include/dlfcn.h:193:
Warning: Error occurred during reading source files
Warning: Error occurred during dictionary source generation
!!!Removing G_Pythia8.cxx G_Pythia8.h !!!
Error: ../../bin/rootcint_tmp: error loading headers...
make[2]: *** [montecarlo/pythia8/G__Pythia8.cxx] Error 1
make[1]: *** [montecarlo/pythia8/CMakeFiles/EGPythia8.dir/all] Error 2
make: *** [all] Error 2



 Comments   
Comment by Andrew Savchenko [ 16/Jul/15 ]

Same error here with pythia-8.2.09, gcc-4.9.3 on Gentoo Linux.

Comment by Pere Mato Vila [ 16/Jul/15 ]

CINT cannot digest system header dlfcn.h used in a Pythia8 header. We will not be able to fix it. You can switch to ROOT 6.

Comment by Oliver Freyermuth [ 17/Jul/15 ]

Hi,

if I may chime in (we are also unable to switch to ROOT 6 already, especially since TFormula saw a large bunch of non-backwards compatible changes and breaks many existing usecases in user code, but luckily we don't use Pythia8 - I already reported issues on everything):

Maybe the best "fix" would be to convince the Pythia8 developers that most parts of the header "PythiaStdlib.h" which they include in all their HEADERS (even in the "interface header" Pythia.h) is a technically incredibly bad idea.

It includes large and heavy headers like <iostream>, <fstream> and <algorithm> some of which produce static initialization overhead. Forcing users of Pythia8 to pull in all these headers in their own projects if they also use Pythia8 without any choice sounds like a bad idea and I see no technical reason for such a thing. They do (luckily) not seem to use any dlopen calls in their headers, though (so including dlfcn may even . be a case of IWYU violation).

dlfcn.h is just a recent addition here. Including such headers in "interface" headers for users is a bad idea (which is why e.g. ROOT doesn't do it, and e.g. LLVM even has explicit rules for forbidden headers IIRC).

It might be worthwhile to ask the Pythia8 developers about this - I myself don't feel too motivated since we don't use Pythia8 right now, but maybe somebody else can step up?

Cheers,
Oliver

Comment by Giulio Eulisse [ 18/Aug/15 ]

For the record, the same problem on Mac appears with:

Error: Too many '}' /usr/include/dlfcn.h:85:

Comment by Pere Mato Vila [ 27/Aug/15 ]

I have committed a 'hack' to avoid the problem in the 5.34 branch

Comment by Axel Naumann [ 27/Aug/15 ]

Hi Oliver,

I'll contact Torbjorn about that.

Axel.

Comment by Ruth Pottgen [ 08/Oct/15 ]

Dear all,

sorry for getting back to this, but I seem to have a very similar problem.
I managed to compile Pythia8.212 with root (5.34.34) on lxplus, but when I want to compile main92 (which is an example for the usage of root trees with pythia), I still get an error about dlfcn (see below).

Is there any combination of Pythia and ROOT versions that is known to work together? (I have tried several versions of Pythia82xx, ROOT5 and ROOT6 already, to no avail.)
Is there anything else I have to setup/configure to make this work?

Any hint is very much appreciated!

Many thanks in advance,
Ruth

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/afs/cern.ch/sw/lcg/app/releases/ROOT/5.34.34/x86_64-slc6-gcc48-opt/root//lib;\
/afs/cern.ch/sw/lcg/app/releases/ROOT/5.34.34/x86_64-slc6-gcc48-opt/root//bin/rootcint -f main92Dct.cc -c -I../include main92.h main92LinkDef.h
Error: Symbol Dl_info is not defined in current scope /usr/include/dlfcn.h:95:
Error: Syntax error /usr/include/dlfcn.h:99:
Error: Syntax error /usr/include/dlfcn.h:104:
Error: Missing whitespace at or after line 190.
Error: Unexpected end of file (G__fgetspace():2) /usr/include/dlfcn.h:192:
Report: Unrecognized string '__END_DECLS' ignored /usr/include/dlfcn.h:193:
Warning: Error occurred during reading source files
Warning: Error occurred during dictionary source generation
!!!Removing main92Dct.cc main92Dct.h !!!
Error: /afs/cern.ch/sw/lcg/app/releases/ROOT/5.34.34/x86_64-slc6-gcc48-opt/root//bin/rootcint: error loading headers...
make: *** [main92] Error 1

Generated at Tue Aug 09 22:05:30 CEST 2022 using Jira 8.22.6#822006-sha1:a60819604027c401cc97bed69f4574413f3aa3b8.