Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fcc-edm master not compatible with podio master (operator<< conflict) #52

Open
cbernet opened this issue Dec 20, 2017 · 4 comments
Open

Comments

@cbernet
Copy link
Contributor

cbernet commented Dec 20, 2017

Hello, I've been trying to compile the master version of podio (664b301775979) with the latest version of fcc-edm (22b5abc) on ubuntu 16.04 with gcc version 5.4.0.

Podio compiles and works fine, but the fcc-edm compilation fails with the error messages shown below (*).

The problem is that the ostream operators that are now added by podio to the components are conflicting with the ones in https://github.com/HEP-FCC/fcc-edm/blob/master/utilities/ParticleUtils.h.
And indeed, if I remove the operators from ParticleUtils, fcc-edm compiles and works.

That sounds like a valid complaint from the compiler, and I don't understand how it could work at all at some point. Would anybody have a suggestion to make it work? I'd like to avoid removing the operators in ParticleUtils.

Cheers!

Colin

(*)

/home/cbernet/FCC/fcc-edm/utilities/ParticleUtils.cc: In function ‘std::ostream& operator<<(std::ostream&, const fcc::Particle&)’:
/home/cbernet/FCC/fcc-edm/utilities/ParticleUtils.cc:105:29: error: call of overloaded ‘operator<<(std::ostream&, const fcc::BareParticle&)’ is ambiguous
   operator<<(out, ptc.core());
                             ^
/home/cbernet/FCC/fcc-edm/utilities/ParticleUtils.cc:91:15: note: candidate: std::ostream& operator<<(std::ostream&, const fcc::BareParticle&)
 std::ostream& operator<<(std::ostream& out, const fcc::BareParticle& ptc) {
               ^
/home/cbernet/FCC/fcc-edm/utilities/ParticleUtils.cc:103:15: note: candidate: std::ostream& operator<<(std::ostream&, const fcc::Particle&)
 std::ostream& operator<<(std::ostream& out, const fcc::Particle& ptc) {
               ^
In file included from /home/cbernet/FCC/fcc-edm/utilities/ParticleUtils.cc:2:0:
/home/cbernet/FCC/fcc-edm/utilities/ParticleUtils.h:50:15: note: candidate: std::ostream& operator<<(std::ostream&, const fcc::MCParticle&)
 std::ostream& operator<<(std::ostream& out, const fcc::MCParticle& ptc);
               ^
In file included from /home/cbernet/FCC/fcc-edm/utilities/ParticleUtils.cc:10:0:
/home/cbernet/FCC/fcc-edm/datamodel/datamodel/MCParticle.h:136:15: note: candidate: std::ostream& fcc::operator<<(std::ostream&, const fcc::ConstMCParticle&)
 std::ostream& operator<<( std::ostream& o,const ConstMCParticle& value );
               ^
In file included from /home/cbernet/FCC/fcc-edm/utilities/ParticleUtils.cc:9:0:
/home/cbernet/FCC/fcc-edm/datamodel/datamodel/Particle.h:137:15: note: candidate: std::ostream& fcc::operator<<(std::ostream&, const fcc::ConstParticle&)
 std::ostream& operator<<( std::ostream& o,const ConstParticle& value );
               ^
In file included from /home/cbernet/FCC/fcc-edm/datamodel/datamodel/Particle.h:3:0,
                 from /home/cbernet/FCC/fcc-edm/utilities/ParticleUtils.cc:9:
/home/cbernet/FCC/fcc-edm/datamodel/datamodel/BareParticle.h:22:22: note: candidate: std::ostream& fcc::operator<<(std::ostream&, const fcc::BareParticle&)
 inline std::ostream& operator<<( std::ostream& o,const fcc::BareParticle& value ){ 
                      ^
/home/cbernet/FCC/fcc-edm/utilities/ParticleUtils.cc: In function ‘std::ostream& operator<<(std::ostream&, const fcc::MCParticle&)’:
/home/cbernet/FCC/fcc-edm/utilities/ParticleUtils.cc:112:29: error: call of overloaded ‘operator<<(std::ostream&, const fcc::BareParticle&)’ is ambiguous
   operator<<(out, ptc.core());
                             ^
/home/cbernet/FCC/fcc-edm/utilities/ParticleUtils.cc:91:15: note: candidate: std::ostream& operator<<(std::ostream&, const fcc::BareParticle&)
 std::ostream& operator<<(std::ostream& out, const fcc::BareParticle& ptc) {
               ^
/home/cbernet/FCC/fcc-edm/utilities/ParticleUtils.cc:103:15: note: candidate: std::ostream& operator<<(std::ostream&, const fcc::Particle&)
 std::ostream& operator<<(std::ostream& out, const fcc::Particle& ptc) {
               ^
/home/cbernet/FCC/fcc-edm/utilities/ParticleUtils.cc:109:15: note: candidate: std::ostream& operator<<(std::ostream&, const fcc::MCParticle&)
 std::ostream& operator<<(std::ostream& out, const fcc::MCParticle& ptc) {
               ^
In file included from /home/cbernet/FCC/fcc-edm/utilities/ParticleUtils.cc:10:0:
/home/cbernet/FCC/fcc-edm/datamodel/datamodel/MCParticle.h:136:15: note: candidate: std::ostream& fcc::operator<<(std::ostream&, const fcc::ConstMCParticle&)
 std::ostream& operator<<( std::ostream& o,const ConstMCParticle& value );
               ^
In file included from /home/cbernet/FCC/fcc-edm/utilities/ParticleUtils.cc:9:0:
/home/cbernet/FCC/fcc-edm/datamodel/datamodel/Particle.h:137:15: note: candidate: std::ostream& fcc::operator<<(std::ostream&, const fcc::ConstParticle&)
 std::ostream& operator<<( std::ostream& o,const ConstParticle& value );
               ^
In file included from /home/cbernet/FCC/fcc-edm/datamodel/datamodel/Particle.h:3:0,
                 from /home/cbernet/FCC/fcc-edm/utilities/ParticleUtils.cc:9:
/home/cbernet/FCC/fcc-edm/datamodel/datamodel/BareParticle.h:22:22: note: candidate: std::ostream& fcc::operator<<(std::ostream&, const fcc::BareParticle&)
 inline std::ostream& operator<<( std::ostream& o,const fcc::BareParticle& value ){ 
                      ^
utilities/CMakeFiles/utilities.dir/build.make:134: recipe for target 'utilities/CMakeFiles/utilities.dir/ParticleUtils.cc.o' failed
make[2]: *** [utilities/CMakeFiles/utilities.dir/ParticleUtils.cc.o] Error 1
make[2]: *** Waiting for unfinished jobs....
CMakeFiles/Makefile2:1115: recipe for target 'utilities/CMakeFiles/utilities.dir/all' failed
make[1]: *** [utilities/CMakeFiles/utilities.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 86%] Built target datamodel-dictgen
@vvolkl
Copy link
Member

vvolkl commented Jan 10, 2018

Hello Colin!

the operators in podio already seem to give decent output to me. Maybe we can improve them so the ones in ParticleUtils can be removed after all?
Cheers,
Valentin

@cbernet
Copy link
Contributor Author

cbernet commented Jan 10, 2018 via email

@vvolkl
Copy link
Member

vvolkl commented Jan 10, 2018

Hi Colin,

I see what you mean! and probably you need the operator << to have convenient debugging in python using print? But strictly speaking, we have the same problem with the code that is currently in ParticleUtils, no? It should be usuable by ee/hh/eh and there is no way to make it specific on the collider. The simplest solution I can think of is to have a print function in a ee / hh namespace ( without the convenience of <<, of course :/)

@cbernet
Copy link
Contributor Author

cbernet commented Jan 10, 2018 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants