G4GDMLParser not found anymore at 11.7?

Hi, I am compiling a previously working Geant4 code and I get the following compilation error.

In file included from /Users/javi/rest/source/packages/restG4/src/DetectorConstruction.cxx:2:
/Users/javi/rest/source/packages/restG4/include/DetectorConstruction.h:8:10: fatal error: 'G4GDMLParser.hh' file not found
#include <G4GDMLParser.hh>
         ^~~~~~~~~~~~~~~~~
In file included from /Users/javi/rest/source/packages/restG4/src/PrimaryGeneratorAction.cxx:2:
In file included from /Users/javi/rest/source/packages/restG4/include/PrimaryGeneratorAction.h:15:
/Users/javi/rest/source/packages/restG4/include/DetectorConstruction.h:8:10: fatal error: 'G4GDMLParser.hh' file not found
#include <G4GDMLParser.hh>
         ^~~~~~~~~~~~~~~~~
1 error generated.

It is probably due to G4GDMLParser getting deprecated. It has been replaced by something else?

Thanks!

Check to see if the Geant4 install that’s being used to compile/link against was built with GDML support (G4GDMLParser.hh isn’t deprecated). The geant4-config program that should have been installed with the headers/libraries can be queried for this with (assuming it is in the PATH)

$ geant4-config --has-feature gdml

This will print “yes” if GDML support is available, or “no” otherwise.

If you’re using CMake to build the application, you can also enforce that Geant4 to be found must support GDML with:

find_package(Geant4 REQUIRED gdml <anyothercomponentsrequired>)
1 Like

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