next-exp / nexus

Geant4 simulation framework of the NEXT Collaboration
5 stars 55 forks source link

Compilation error with gcc 12.2.0 #188

Closed soleti closed 11 months ago

soleti commented 1 year ago

I recently updated my gcc compiler on Ubuntu to the 12.2.0 version. Now, the compilation fails with these errors:

In file included from source/base/DetectorConstruction.cc:9:
source/base/DetectorConstruction.h:33:22: error: 'std::unique_ptr' has not been declared
...
source/base/DetectorConstruction.h:13:1: note: 'std::unique_ptr' is defined in header '<memory>'; did you forget to '#include <memory>'?
   12 | #include <G4VUserDetectorConstruction.hh>
  +++ |+#include <memory>
   13 | 

and

In file included from source/base/PrimaryGeneration.cc:10:
source/base/PrimaryGeneration.h:32:23: error: 'std::unique_ptr' has not been declared
...
source/base/PrimaryGeneration.h:15:1: note: 'std::unique_ptr' is defined in header '<memory>'; did you forget to '#include <memory>'?
   14 | #include <globals.hh>
  +++ |+#include <memory>

Adding the #include <memory> fixes indeed the issue. Before opening a PR it would be good to have someone verify this independently.

paolafer commented 11 months ago

I've found the same problem in some clusters. PR #223 fixes the issue.