HOWTO – Install Geant4 (no compiling needed)

Are you a physics student and you need to install this marvellous, poorly documented, complex program? You are crashing your head against a fucking wall because whenever you compile it from source it gives you that dreadful segmentation error?
Look no further! You can install it in 4 simple steps, if you are lucky enough to run a debian-ish distro!

  • Step one:
    Install the required Geant4 dependencies:

    sudo apt-get install libboost-all-dev libmpfr4 libmpfr-dev liblzma-dev libsqlite3-dev 
  • Step two:
    Add the Geant4 repositories (yes, they exist!) to your sources:

    echo "deb debian stable hep" >> /etc/apt/sources.list.d/geant4.list
    echo "deb-src debian stable hep" >> /etc/apt/sources.list.d/geant4.list 
  • Step three:
    Update the system and install Geant4:

    sudo apt-get update && sudo apt-get install cern-archive-keyring
    sudo apt-get update && sudo apt-get install geant4
  • Step four:
    Setup the environment:

    echo "export G4ENV_VERBOSITY=silent" >> .bashrc
    echo "source /usr/share/geant4/" >> .bashrc
    echo "export LD_LIBRARY_PATH=/usr/lib:/usr/lib64:\$LD_LIBRARY_PATH:/usr/local/lib" >> .bashrc
    echo "export PATH=/usr/local/bin:\$PATH" >> .bashrc
    source .bashrc 

And yup, it’s all done. Thanks for reading. Ask for questions if you need to!



Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s