-- CamiloSevilla - 2018-04-20

geant4.10.04 Installation Handbook v04

Autor: Andrés Camilo Sevilla12, José Mauricio Sevilla3


1Grupo Física de Bajas Temperaturas y Detectores CRYOMAG - UNAL
2Grupo Física Médica - UNAL
3Grupo de Caos y Complejidad - UNAL

April 2018 - Bogotá, Colombia

1. Prerequisites

OS recommended: Ubuntu 16.04, Ubuntu 18.04

To use the most common and useful Geant4 components (in Medical and Detectors Physics), you need install some package on your ubuntu system via terminal using $sudo apt-get install --package-- or synaptic package manager.

- GDML Support
requires: libxerces-c-dev

- User Interface and Visualization
requires: qt4-dev-tools, freeglut3-dev, libmotif-dev, tk-dev

- other requirements: cmake, libxpm-dev, libxmu-dev, libxi-dev

$ sudo apt-get install libxerces-c-dev qt4-dev-tools freeglut3-dev libmotif-dev tk-dev cmake libxpm-dev libxmu-dev libxi-dev

2. Building from source files

Create a folder "geant4" in your system:

$ cd /opt/
$ sudo mkdir applications
$ cd applications
$ sudo mkdir geant4

Download and copy geant4.10.04 source files to geant4 folder, then unpack it:

$ sudo mv ~/Downloads/geant4.10.04.p01.tar.gz /opt/applications/geant4/.
$ cd /opt/applications/geant4/
$ sudo tar -zxvf geant4.10.04.p01.tar.gz

Create a directory to configure and build Geant4.

$ mkdir geant4.10.04.p01-build

To configure the build, enter to build directory and run CMake

$ cd geant4.10.04.p01-build
$ sudo cmake -DCMAKE_INSTALL_PREFIX=/opt/applications/geant4/geant4.10.04.p01-install -DGEANT4_USE_GDML=ON -DCMAKE_BUILD_TYPE=Debug -DGEANT4_INSTALL_DATA=ON -DGEANT4_USE_OPENGL_X11=ON -DGEANT4_USE_XM=ON -DGEANT4_USE_QT=ON -DGEANT4_BUILD_MULTITHREADED=ON /opt/applications/geant4/geant4.10.04.p01

After the configuration, CMake will have generated Unix Makefiles for building Geant4. To build, simply execute make in the build directory:

$ make -jN
$ make install -jN

Note: N is the number of cores available in your PC.

To finish the installation open the .bashrc file:

$ gedit ~/.bashrc

At the end include the lines:

# geant4
source /opt/applications/geant4/geant4.10.04.p01-install/bin/geant4.sh

3. Running an example

Create a G4WORK folder:

$ mkdir ~/workspace
$ mkdir ~/workspace/G4WORK

Copy there a G4 example:

$ cp -R ~/geant4/geant4.10.04.p01/examples/basic/B1/ ~/workspace/G4WORK/.

Configure and compile B1 example

$ cd ~/workspace/G4WORK/
$ mkdir B1-build
$ cd B1-build
$ cmake ../B1
$ make -jN

Note: N is the number of cores available in your PC.

Finally run the example

$ ./exampleB1

4. References

[1] Geant4 installation guide, Geant4 Collaboration, http://geant4.web.cern.ch/geant4/UserDocumentation/UsersGuides/InstallationGuide/html/index.html
[2] Twiki Allpix , John Idarraga, https://twiki.cern.ch/twiki/bin/view/Main/AllPix

Topic attachments
I Attachment History Action Size Date Who Comment
Unknown file formatgz geant4.10.04.p01.tar.gz r1 manage 170520.0 K 2018-04-20 - 05:47 CamiloSevilla  
Edit | Attach | Watch | Print version | History: r8 < r7 < r6 < r5 < r4 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r8 - 2018-04-20 - CamiloSevilla
 
    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    Main All webs login

This site is powered by the TWiki collaboration platform Powered by PerlCopyright &© 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
or Ideas, requests, problems regarding TWiki? use Discourse or Send feedback