Whizard 3.0.0 doesn't compile with HepMC 3.2.3

Bug #1934598 reported by Kacper Nowak
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
WHIZARD
Fix Released
High
Juergen Reuter

Bug Description

Dear Whizard authors,
after running "make && make install" I got following error (g++ 11.1.0, make 4.3, os Manjaro 21.0.7):
CXX libHepMCWrap_la-HepMC3RootWrap.lo
In file included from /usr/include/TString.h:29,
                 from /usr/include/TNamed.h:26,
                 from /usr/include/TDirectory.h:24,
                 from /usr/include/TDirectoryFile.h:25,
                 from /usr/include/TFile.h:28,
                 from /usr/include/HepMC3/ReaderRootTree.h:27,
                 from ../../../whizard-3.0.0/src/hepmc/HepMC3RootWrap.cpp:14:
/usr/include/ROOT/RStringView.hxx:84:17: error: expected type-specifier
   84 | operator std::string_view() const { return std::string_view(fData,fLength); }
      | ^~~
In file included from /usr/include/TNamed.h:26,
                 from /usr/include/TDirectory.h:24,
                 from /usr/include/TDirectoryFile.h:25,
                 from /usr/include/TFile.h:28,
                 from /usr/include/HepMC3/ReaderRootTree.h:27,
                 from ../../../whizard-3.0.0/src/hepmc/HepMC3RootWrap.cpp:14:
/usr/include/TString.h:115:13: error: expected type-specifier
  115 | operator std::string_view() const { return std::string_view(Data(),fExtent); }
      | ^~~
/usr/include/TString.h:280:32: error: ‘string_view’ in namespace ‘std’ does not name a type
  280 | explicit TString(const std::string_view &sub);
      | ^~~~~~~~~~~
/usr/include/TString.h:280:27: note: ‘std::string_view’ is only available from C++17 onwards
  280 | explicit TString(const std::string_view &sub);
      | ^~~
/usr/include/TString.h:317:37: error: ‘string_view’ in namespace ‘std’ does not name a type
  317 | TString &operator=(const std::string_view &s);
      | ^~~~~~~~~~~
/usr/include/TString.h:317:32: note: ‘std::string_view’ is only available from C++17 onwards
  317 | TString &operator=(const std::string_view &s);
      | ^~~
/usr/include/TString.h:444:9: error: ‘string_view’ in namespace ‘std’ does not name a type
  444 | std::string_view View() const { return std::string_view(GetPointer(),Length()); }
      | ^~~~~~~~~~~
/usr/include/TString.h:444:4: note: ‘std::string_view’ is only available from C++17 onwards
  444 | std::string_view View() const { return std::string_view(GetPointer(),Length()); }
      | ^~~
In file included from /usr/include/TNamed.h:26,
                 from /usr/include/TDirectory.h:24,
                 from /usr/include/TDirectoryFile.h:25,
                 from /usr/include/TFile.h:28,
                 from /usr/include/HepMC3/ReaderRootTree.h:27,
                 from ../../../whizard-3.0.0/src/hepmc/HepMC3RootWrap.cpp:14:
/usr/include/TString.h:839:53: error: ‘string_view’ in namespace ‘std’ does not name a type
  839 | inline Bool_t operator==(const char *s1, const std::string_view &s2)
      | ^~~~~~~~~~~
/usr/include/TString.h:839:48: note: ‘std::string_view’ is only available from C++17 onwards
  839 | inline Bool_t operator==(const char *s1, const std::string_view &s2)
      | ^~~
/usr/include/TString.h:839:15: error: ‘Bool_t operator==(const char*, const int&)’ must have an argument of class or enumerated type
  839 | inline Bool_t operator==(const char *s1, const std::string_view &s2)
      | ^~~~~~~~
/usr/include/TString.h:844:37: error: ‘string_view’ in namespace ‘std’ does not name a type
  844 | inline Bool_t operator==(const std::string_view &s1, const char *s2)
      | ^~~~~~~~~~~
/usr/include/TString.h:844:32: note: ‘std::string_view’ is only available from C++17 onwards
  844 | inline Bool_t operator==(const std::string_view &s1, const char *s2)
      | ^~~
/usr/include/TString.h:844:15: error: ‘Bool_t operator==(const int&, const char*)’ must have an argument of class or enumerated type
  844 | inline Bool_t operator==(const std::string_view &s1, const char *s2)
      | ^~~~~~~~
/usr/include/TString.h:857:37: error: ‘string_view’ in namespace ‘std’ does not name a type
  857 | std::string printValue(const std::string_view* val);
      | ^~~~~~~~~~~
/usr/include/TString.h:857:32: note: ‘std::string_view’ is only available from C++17 onwards
  857 | std::string printValue(const std::string_view* val);
      | ^~~
In file included from /usr/include/HepMC3/ReaderRootTree.h:27,
                 from ../../../whizard-3.0.0/src/hepmc/HepMC3RootWrap.cpp:14:
/usr/include/TFile.h:327:45: error: ‘std::string_view’ has not been declared
  327 | static Bool_t SetCacheFileDir(std::string_view cacheDir, Bool_t operateDisconnected = kTRUE,
      | ^~~~~~~~~~~
/usr/include/TFile.h: In static member function ‘static Bool_t TFile::SetCacheFileDir(ROOT::Internal::TStringView, Bool_t, Bool_t)’:
/usr/include/TFile.h:326:36: error: ‘string_view’ is not a member of ‘std’
  326 | { return SetCacheFileDir(std::string_view(cacheDir), operateDisconnected, forceCacheread); }
      | ^~~~~~~~~~~
/usr/include/TFile.h:326:36: note: ‘std::string_view’ is only available from C++17 onwards
../../../whizard-3.0.0/src/hepmc/HepMC3RootWrap.cpp: In function ‘HepMC3::GenVertex* gen_event_get_signal_process_vertex(HepMC3::GenEvent*)’:
../../../whizard-3.0.0/src/hepmc/HepMC3RootWrap.cpp:181:1: warning: no return statement in function returning non-void [-Wreturn-type]
  181 | }
      | ^
../../../whizard-3.0.0/src/hepmc/HepMC3RootWrap.cpp: In function ‘HepMC3::GenEvent* new_event_particle_const_iterator(HepMC3::GenEvent*)’:
../../../whizard-3.0.0/src/hepmc/HepMC3RootWrap.cpp:201:1: warning: no return statement in function returning non-void [-Wreturn-type]
  201 | }
      | ^
../../../whizard-3.0.0/src/hepmc/HepMC3RootWrap.cpp: In function ‘HepMC3::GenParticlePtr event_particle_const_iterator_get(HepMC3::GenEvent*)’:
../../../whizard-3.0.0/src/hepmc/HepMC3RootWrap.cpp:226:1: warning: no return statement in function returning non-void [-Wreturn-type]
  226 | }
      | ^
../../../whizard-3.0.0/src/hepmc/HepMC3RootWrap.cpp: In function ‘HepMC3::GenVertex* new_vertex_particles_in_const_iterator(HepMC3::GenVertex*)’:
../../../whizard-3.0.0/src/hepmc/HepMC3RootWrap.cpp:287:1: warning: no return statement in function returning non-void [-Wreturn-type]
  287 | }
      | ^
../../../whizard-3.0.0/src/hepmc/HepMC3RootWrap.cpp: In function ‘HepMC3::GenParticlePtr vertex_particles_in_const_iterator_get(HepMC3::GenVertex*)’:
../../../whizard-3.0.0/src/hepmc/HepMC3RootWrap.cpp:312:1: warning: no return statement in function returning non-void [-Wreturn-type]
  312 | }
      | ^
../../../whizard-3.0.0/src/hepmc/HepMC3RootWrap.cpp: In function ‘HepMC3::GenVertex* new_vertex_particles_out_const_iterator(HepMC3::GenVertex*)’:
../../../whizard-3.0.0/src/hepmc/HepMC3RootWrap.cpp:326:1: warning: no return statement in function returning non-void [-Wreturn-type]
  326 | }
      | ^
../../../whizard-3.0.0/src/hepmc/HepMC3RootWrap.cpp: In function ‘HepMC3::GenParticlePtr vertex_particles_out_const_iterator_get(HepMC3::GenVertex*)’:
../../../whizard-3.0.0/src/hepmc/HepMC3RootWrap.cpp:351:1: warning: no return statement in function returning non-void [-Wreturn-type]
  351 | }
      | ^

Regards,
Kacper Nowak

Revision history for this message
Juergen Reuter (j.r.reuter) wrote :

Hi Kacper,
this seems not to be a bug, but an incompatibility between different C++ standards between HepMC3, ROOT, and the WHIZARD interfaces. How did you install ROOT and HepMC3? Did you compile yourself or did you use system packages? string_view is a C++17 feature, so some of your three programs have not been compiled with that compiler or with those flags. Try configuring WHIZARD with the setting
CXXFLAGS="--std=c++17".

Changed in whizard:
status: New → Incomplete
Revision history for this message
Kacper Nowak (anarion19) wrote :

Dear Juergen,
thank you for quick reply. I've installed both HepMC and ROOT 6.24.00 from official
Manjaro repository.
I've tried configuring WHIZARD with c++17 flag but the result is the same.

Revision history for this message
Juergen Reuter (j.r.reuter) wrote :

Dear Kacper,
could you check the following WHIZARD snapshot, please:
https://whizard.hepforge.org/versions/unofficial/whizard-3.0.0+_20210705.tar.gz
Let me know if you encounter the same problem.
Cheers,
   JRR

Revision history for this message
Kacper Nowak (anarion19) wrote :

Thank you very much! It compiles now, but the tests fail. I attach test-suite.log
Cheers,
Kacper

Revision history for this message
Juergen Reuter (j.r.reuter) wrote :

Thanks for reporting. This will be fixed for v3.0.1 to be expected within 2-3 weeks.
Your tests are failing because you need to include the Openloops libraries to your LD_LIBRARY_PATH,
e.g.
export LD_LIBRARY_PATH=<openloops_path>/lib:$LD_LIBRARY_PATH

Changed in whizard:
status: Incomplete → Fix Committed
importance: Undecided → High
assignee: nobody → Juergen Reuter (j.r.reuter)
milestone: none → 3.0.1
Changed in whizard:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.