0% found this document useful (0 votes)
277 views

Building Installing Geant4 Ubuntu 14.04

This document provides instructions for building and installing Geant4, a toolkit for particle transport simulation, on Ubuntu 14.04. It outlines downloading required software like CMake, Qt, and Xerces-C++. It describes downloading the Geant4 source package and unpacking it, then using CMake to configure, build, and install it. Finally, it lists datasets that should be downloaded and unpacked to provide physics data for simulations.

Uploaded by

Atiq
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
277 views

Building Installing Geant4 Ubuntu 14.04

This document provides instructions for building and installing Geant4, a toolkit for particle transport simulation, on Ubuntu 14.04. It outlines downloading required software like CMake, Qt, and Xerces-C++. It describes downloading the Geant4 source package and unpacking it, then using CMake to configure, build, and install it. Finally, it lists datasets that should be downloaded and unpacked to provide physics data for simulations.

Uploaded by

Atiq
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Building and Installing Geant4 on Linux (Ubuntu 14.

04)
By Arnulfo Moiss Maciel Hernndez

Software Required to Build Optional Components of Geant4

Installation of build-essential. In Terminal set:

sudo apt-get install build-essential

Installation of Cmake. In Terminal set:


wget http://www.cmake.org/files/v3.5/cmake-3.5.0-rc2.tar.gz
tar xf cmake-3.5.0-rc2.tar.gz
cd cmake-3.5.0-rc2
./configure
make
sudo make install

X11 Xmu library and/or headers

sudo apt-get install libxaw7-dev libxaw7

Qt User Interface and Visualization. In Terminal set:


wget http://download.qt.io/official_releases/qt/5.0/5.0.2/qt-linux-opensource-5.0.2-x86_64-offline.run
chmod +x qt-linux-opensource-5.0.2-x86_64-offline.run
./qt-linux-opensource-5.0.2-x86_64-offline.run

(if error qmake: could not exec '/usr/lib/x86_64-linux-gnu/qt4/bin/qmake': No such file or directory execute in
Terminal: sudo apt-get install qt5-default )

MesaGL headers and libraries. In Terminal set:

sudo apt-get install mesa-common-dev


sudo apt-get install libglu1-mesa-dev -y

Xerces-C++ headers and libraries. In Terminal set:

wget http://www.eu.apache.org/dist//xerces/c/3/sources/xerces-c-3.1.2.tar.gz
tar xf xerces-c-3.1.2.tar.gz
cd xerces-c-3.1.2
./configure
make
sudo make install

Geant4 Software Download


Download geant4 from:
http://geant4.web.cern.ch/geant4/support/download.shtml
Unpack the Geant4 source package geant4.XX.XX.tar.gz to a location of your choice. For illustration only, this guide will
assume it's been unpacked in a directory named /path/to, so that the Geant4 source package sits in a subdirectory .
(geant4.XX.XX means the latest Release of Geant4)

/path/to/geant4.XX.XX
Building and Installing Geant4 on Linux (Ubuntu 14.04)
By Arnulfo Moiss Maciel Hernndez

Inside geant4.XX.XX folder, make the folders;

geant4-install
geant4-build

In Terminal go thought geant4-build folder


cd geant4-build

Geant4 Build Options


In Terminal set:

cmake -DCMAKE_INSTALL_PREFIX=/path/to/geant4.XX.XX/geant4-install
-DGEANT4_INSTALL_DATA=ON -DGEANT4_USE_GDML=ON -DGEANT4_USE_QT=ON
-DGEANT4_USE_OPENGL_X11=ON -DGEANT4_USE_SYSTEM_EXPAT=OFF /path/to/geant4.XX.XX

(if fails, rm -rf * in g4build before rerunning cmake)

make -j4 (the four is replaced by your number of processor cores)


make install

If all went well, add this to your ~/.bashrc

if [ -f /yourpath/g4install/bin/geant4.sh ]; then
. /yourpatht/g4install/bin/geant4.sh
fi

Setting Datasets
After you have installed Geant4. To do this,
download the following files:
(or the latest versions from http://geant4.web.cern.ch/geant4/support/download.shtml )

http://geant4.cern.ch/support/source/G4NDL.4.5.tar.gz
http://geant4.cern.ch/support/source/G4EMLOW.6.48.tar.gz
http://geant4.cern.ch/support/source/G4PhotonEvaporation.3.2.tar.gz
http://geant4.cern.ch/support/source/G4RadioactiveDecay.4.3.tar.gz
http://geant4.cern.ch/support/source/G4NEUTRONXS.1.4.tar.gz
http://geant4.cern.ch/support/source/G4PII.1.3.tar.gz
http://geant4.cern.ch/support/source/RealSurface.1.0.tar.gz
http://geant4.cern.ch/support/source/G4SAIDDATA.1.1.tar.gz
http://geant4.cern.ch/support/source/G4ABLA.3.0.tar.gz
http://geant4.cern.ch/support/source/G4ENSDFSTATE.1.2.tar.gz

and unpack them under the directory:

/path/to/geant4.XX.XX/geant4-install/share/Geant4-10.2.0/data

You might also like