How to sucessfully install the PLANETOCOSMICS on the old version geant4.8.1

I just want to use PLANETOCOSMICS, but it was written for the version Geant4.8.1, which is no longer available from the official Geant4 webpage. Then how can I get it and successfully install it?
Or did somebody modify the PLANETOCOSMICS code for the current version of Geant4? If anybody could give me some help, thanks.

Dear Robert,
I am aware of a project that is currently porting PLANETOCOSMICS to newer geant4 version, but at the moment you are stuck with the old version.

You can download it from the gitlab of cern, or (instead of searching) with the command (for the latest p2 of 8.1)


I don’t remember any more if the installation downloads the required datasets. In case it doesn’t the following commands will do that


Moreover you need to have a working installation of CLHEP. Version of CLHEP is supported (among one or two more) by geant4 version 8.1 and you can download it by


The last time I tried the installation, some years ago, it was with gnu compilers 7.3.1 and both geant4 and clhep should be patched to be compiled. I don’t know what will happen with newer compilers. Anyhow, I attach the patches I had at the time.
geant4.8.1.patch.txt (1.5 KB)
clhep- (3.7 KB)

Good luck!

Dear Robert,
having a closer look at my notes of that time, it seems you will need also an installation of SPICE. At the time the version was N066 and I have also a patch for compiling shared libraries (don’t remember why, probably not needed…).

I don’t know which version of PLANETOCOSMICS you have, but the one that I had seems that could compile also with geant4 version 9.3. It seems that I had to apply also a patch for the compilation of PLANETOCOSMICS.

Dear Pasxioti:
I really thank you. I now have the PLANETOCOSMICS version 2.0. I will try your method to see if it can be installed successfully. If anything goes wrong, I hope you can give me more guidance.
Thank you again for your generous help!

@psaxioti ,I’m very sorry to disturb you again. I’m now stuck on this version 8.1.2 of GEANT4 without cmakelists.txt. I just don’t know how to compile it without using the cmake command. Could you share with me your solution to this problem?

Dear Robert,
yes, version 8.1 comes from the pre cmake era!

As per the instructions of that time you have to issue the following two commands

./Configure -build
./Configure -install

The first one will ask several questions and then compile geant4 and the second one installs it.

Dear Psaxioti:
When I was doing the ./Configure -build operation, which as I list below, leting me to make the choices of the correct path, but they seeem hadn’t be installed, tried skipping the two steps, however, it finally prompted me that the installation had some problem.

  1. You have selected to use XM Motif based user interfaces.But XM Motif was not found in expected place.Please specify the correct path where Xm is installed in your system.You can set ‘-’ (without quotation) to CANCEL the XM flag at all:
  2. You have selected to use OpenInventor driver.But it was not found in expected place.Please specify the correct path where OpenInventor is installed in your system.You can set ‘-’ (without quotation) to CANCEL the OpenInventor flag at all:
    I have tried to installed packages as above, but when the packages was installing, they also occurred errors. So finally these seems have no work to installation of Geant4, I just don’t know how to deal with this thorny problem. It really depresses me, I even don’t know if I should give up this version, and ask you or somone else for the version of PLANETOCOSMICS which works on the geant4 with higher version. I am very grateful for the help you have given me so far.

Dear Robert,
It is a long time since the last time that I did the installation, so I don’t remember any more what the options for building were.
Most probably I didn’t use OpenInventor, but I had installed with Motif.

For sure you will need also the development packages of the libraries that you want to use.
This of course depends on your distribution…
What Linux are you using?

If I know your distribution I will try to have a look, but I don’t promise anything! and for sure I won’t be very fast…

Dear Psaxioti,
I use Ubuntu 20.04.3. Regardless of whether you have finally solved my problem, I really appreciate your patience with me.

Dear Robert,
unfortunately I don’t have an Ubuntu distribution around, so I made some test with docker.
Hopefully what I write holds for a normal ubuntu installation also!
By the commands bellow I managed to compile geant4 version 8.1.2 with all the options enabled apart from OpenInventor. The commands install also clhep since it is needed for the compilation of geant.

# installation of required packages
sudo apt update
sudo apt upgrade
sudo apt install patch wget g++ make libx11-dev libgl-dev libglu1-mesa-dev libxt-dev libxmu-dev libxaw3dxft8-dev libxaw7-dev xaw3dg-dev libmotif-dev libxmhtml-dev libglw1-mesa-dev gfortran

# installation of clhep
tar -zxvf clhep-
wget -O clhep.patch
patch -p1 < ../clhep.patch
./configure --prefix=<base clhep installation folder>
make -j7
make -j7 check
make -j7 install
cd ../../

# installation of geant
tar -zxvf geant4.8.1.2.tar.gz
wget -O geant4.patch
cd geant4-v8.1.2-3193069717bb38ae4049146a49d7f9ef17715e0b/
patch -p1 < ../geant4.patch
sed -i "s|g77|gfortran|" ./config/sys/Linux-g++.gmk
./Configure -build
./Configure -install

At some point you should extract the data files to the folders that you will specify… They are not downloaded automatically.

Hope this helps!