ROOT and Pythia8 Info symbol found twice


ROOT Version: v6-18
Platform: CC7
Compiler: GCC-6.2
Pythia8: 8230


Hi all,

I am getting this error from ROOT inside python.

[INFO] Monte Carlo Engine Initialisation with: TGeant4
In file included from libVMC dictionary payload:17:
In file included from /root/ship/sw/slc7_x86-64/ROOT/v6-18-00-3/include/TMCManager.h:26:
/root/ship/sw/slc7_x86-64/ROOT/v6-18-00-3/include/TMCParticleStatus.h:51:7: error: reference to 'Info' is ambiguous
      Info("Print", "Status of track");
      ^
/root/ship/sw/slc7_x86-64/ROOT/v6-18-00-3/include/TError.h:58:13: note: candidate found by name lookup is 'Info'
extern void Info(const char *location, const char *msgfmt, ...)
            ^
/root/ship/sw/slc7_x86-64/pythia/v8230-ship-1/include/Pythia8/Info.h:30:7: note: candidate found by name lookup is 'Pythia8::Info'
class Info {
      ^
Error in <TInterpreter::AutoParse>: Error parsing payload code for class TVirtualMC with content:

#line 1 "libVMC dictionary payload"


#define _BACKWARD_BACKWARD_WARNING_H
// Inline headers
#include "TGeoMCGeometry.h"
#include "TMCAutoLock.h"
#include "TMCOptical.h"
#include "TMCParticleType.h"
#include "TMCProcess.h"
#include "TMCtls.h"
#include "TMCVerbose.h"
#include "TVirtualMCApplication.h"
#include "TVirtualMCGeometry.h"
#include "TVirtualMC.h"
#include "TVirtualMCSensitiveDetector.h"
#include "TVirtualMCStack.h"
#include "TMCManager.h"
#include "TMCManagerStack.h"
#include "TGeoMCBranchArrayContainer.h"
#include "TMCParticleStatus.h"

#undef  _BACKWARD_BACKWARD_WARNING_H

I have close to zero idea of what is happening, but my guess is that ROOT is looking for the Info symbol, and it find it twice. One from ROOT itself and another from Pythia.

If it were my code, I guess I could using namespaces to specify exactly what I want, but it is ROOT code and I am not quite sure what I should do.

Maybe import pythia in a different way? How?

This error happens at runtime and we are using the python interface.

Hi,
What is exactly the Python code that triggers this error?

Hi!

It happens in this line here: https://github.com/ShipSoft/FairShip/blob/master/macro/run_simScript.py#L526

gMC = ROOT.TVirtualMC.GetMC()

I have no experience with Pythia, so I am not sure of why this symbol conflict appears. Is Pythia compiled against ROOT? You are using some installation of both ROOT and Pythia on CVMFS?

Perhaps @amadio knows more?

The problem seems to be two incompatible definitions of Info, as a function in ROOT, and as a class in Pythia. It doesn’t seem to be something specific to Pythia, but just a name clash of incompatible types with the same name, and TInterpreter::AutoParse not knowing what to do about it.

Exactly, the problem appear after upgrading from v6-14.

Indeed ROOT introduce this file: https://github.com/root-project/root/blame/master/montecarlo/vmc/inc/TMCParticleStatus.h#L51 5 months ago.

What should we do in this case?

I think this is the problematic function, it’s just imported into the file you linked above.

Yes, I see that the problem is there, but how do we go to fix this kind of issue?

Can we maybe have this call to Info being a bit more specific?

After all it is ROOT that is breaking old working code… And just having a call to Info() like that will always break the code.

Cad we make that call into ROOT::Info() ?

I don’t think there is an easy way to fix this. The Info() function in ROOT is quite old and used in several places. It’s also added in the global space, so there’s no way to better qualify it. You may be able to make things work by compiling your code rather than relying on the interpreter, though.

I see, but basically any generator will have its own Info function. With the introduction of VMC in ROOT this is going to be quite a problem. Isn’t?

Hi @amadio , @siscia,
The call to Info() happens in the function TMCParticleStatus::Print(); could you try out to move the implementation of the function below the class definition? This would prevent from its processing with the Root interpreter.
The changes to be tried out:

   /// Print all info at once
   void Print() const;
   ClassDef(TMCParticleStatus, 1)
};

// inline functions
inline void TMCParticleStatus::Print() const {
...
}

Or, we can also try to add the implementation code in .cxx file.

1 Like

Very well!

What is the process?

Should I try it in my local environment and then make a PR against ROOT? Then when I should expect the code to be available in a tag?

ping!
up!

Was this forgotten?

Sorry, you can make a PR against ROOT on GitHub. As for the review of your changes, it’s better to wait until next week, when @axel will be back to review. Best regards,

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