GSI Forum
GSI Helmholtzzentrum für Schwerionenforschung

Home » PANDA » PandaRoot » Bugs, Fixes, Releases » [FIXED] FairEvtFilter problem with c++11
icon9.gif  [FIXED] FairEvtFilter problem with c++11 [message #17510] Wed, 12 November 2014 18:16 Go to previous message
StefanoSpataro is currently offline  StefanoSpataro
Messages: 2736
Registered: June 2005
Location: Torino
first-grade participant

From: *to.infn.it
Trying to install pandaroot with the new external packages and git, in an Ubuntu 14.10 (gcc 4.9.1) I have seen that the code has problems with the C++11 options.
In particular:

In file included from /home/lavezzi/git/pandaroot/pgenerators/eventFilter/FairFilteredPrimaryGenerator.h:27:0,
                 from /home/lavezzi/git/pandaroot/pgenerators/eventFilter/FairFilteredPrimaryGenerator.cxx:1:
/home/lavezzi/git/pandaroot/pgenerators/eventFilter/FairEvtFilter.h:129:46: error: 'constexpr' needed for in-class initialization of static data member 'const Double_t FairEvtFilter::kNoChargeSpecified' of non-integral type [-fpermissive]
  static const Double_t kNoChargeSpecified = -999.9;
                                              ^
pgenerators/CMakeFiles/PGen.dir/build.make:497: recipe for target 'pgenerators/CMakeFiles/PGen.dir/eventFilter/FairFilteredPrimaryGenerator.cxx.o' failed


In c++11 static const of a non-integer number is not allowed, one should use constexpr. But if I use constexpr:

[  9%] Generating G__PGenDict.cxx
Error: Invalid type 'constexpr' in declaration of 'Double_t kNoChargeSpecified' /home/lavezzi/git/pandaroot/pgenerators/eventFilter/FairEvtFilter.h:129:
Warning: Error occurred during reading source files
Warning: Error occurred during dictionary source generation
!!!Removing /home/lavezzi/git/pandaroot/cbuild/pgenerators/G__PGenDict.cxx /home/lavezzi/git/pandaroot/cbuild/pgenerators/G__PGenDict.h !!!
Error: /home/lavezzi/git/fairsoft_jul14p3/externals/bin/rootcint: error loading headers...
pgenerators/CMakeFiles/PGen.dir/build.make:77: recipe for target 'pgenerators/G__PGenDict.cxx' failed
make[2]: *** [pgenerators/G__PGenDict.cxx] Error 1


Martin, can you fix this problem? This is present in several classes, including also FTS.
From some comments i read in the forum, what you are doing is a bit nasty and should be disegned in a different and safer way.

Thanks in advance.

[Updated on: Mon, 12 January 2015 12:10]

Report message to a moderator

 
Read Message icon9.gif
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: TRandom() - seed
Next Topic: Reading parameter file, ROOT::delete_TFile(void*) ()
Goto Forum:
  


Current Time: Thu Mar 28 21:38:46 CET 2024

Total time taken to generate the page: 0.01196 seconds