Installing multiple releases of Geant4

Hi everyone,

Is it possible to have multiple releases of Geant4 installed in same machine and just use the specified version by sourcing it accordingly?

Thanks a lot.
PS: Sorry in advance if this has been discussed somewhere before

Yes. Obviously each release will have it’s own installation directory. On my Mac, I have /Applications/Geant4/, and different G4 versions under that. You source the geant4make.sh or geant4.sh or whatever, that is the version directory you want to use.

I would recommend maintaining a separate Geant4 data directory, and configuration each installation to point to that directory (see the Installation Guide). Otherwise, you’ll end up with duplicate copies of the same datasets.

1 Like

Thanks for your reply @mkelsey.

I already have a Geant4 release installed with its data directory as a result I did not create a separate Geant4 data directory at that time. So, is it possible to use the same data directory in a newer release?

Yes, when configuring the build of the newer release, you can use the GEANT4_INSTALL_DATADIR cmake option (see the Install Guide) to point to the directory with the existing datasets. The configuration will then reuse any it can, and (if you have set GEANT4_INSTALL_DATA to ON) install any new ones needed in that same location.

The scripts that @mkelsey mentions will set up the needed environment variables correctly for the different versions. See also the postinstall guide on datasets as the setup was simplified from version 11.1 and newer. The scripts will work across all versions though.

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