Problem compiling Geant4

I’m trying to install Geant4 v 11.0.3 in my local directory on a server at my institution. The cmake and gcc versions maintained in /usr/bin are quite old, so I had to locally install the most recent versions of both of those (cmake version 3.25.0 and gcc version 13.0.0). Once I had done that, I was able to configure geant with “cmake -DCMAKE_INSTALL_PREFIX=/path/to/geant4-v11.0.3-install /path/to/geant4-v11.0.3”.

However, when I then try to compile it, I get a string of errors of the form “‘uint32_t’ in namespace ‘std’ does not name a type” and “‘uint62_t’ in namespace ‘std’ does not name a type”.

Doing some searching on stackexchange, it looks like this may be an issue with gcc no longer including <stdint.h> or by default. However, it looks like those ceased to be included many versions ago, and I’m not sure why the latest version of Geant would require a new version of gcc to be configured, but then fail at compilation because an old version is being used.

I tried forcing inclusion of stdint.h by exporting CC=“/mydirectory/bin/gcc -include stdint.h” and CPP=“/mydirectory/bin/g++”, then repeating “cmake -DCMAKE_INSTALL_PREFIX=/path/to/geant4-v11.0.3-install /path/to/geant4-v11.0.3”, but when I run “make”, I still get the same errors.

Any idea what I’ve done wrong here? Thanks.

GCC 13 is still in the development phase AFAIK, and we won’t be testing/supporting it until the release next year. For 11.0.3, I’d recommend GCC 11.2/3 as this was extensively tested for that release. GCC 12 is an option, but we have had to fix a few warnings, so 11 is a safer option.

Thanks. I should have realized that an X.0.0 version might still be in development and not tested yet. I’ll install GCC 11 and try again.

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