0% found this document useful (0 votes)
98 views7 pages

The Ultimate Guideto Installing EGSnrcand Geant 4

This document provides instructions for installing the Geant4 and EGSnrc Monte Carlo simulation toolkits along with the BEAMnrc code. It outlines downloading and compiling Geant4 and EGSnrc from source, setting environment variables, and verifying a successful installation. Key steps include using CMake to configure and build Geant4, setting Geant4 and EGSnrc environment variables in .bashrc, and running sample codes to test the installations.

Uploaded by

deathangel123
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
98 views7 pages

The Ultimate Guideto Installing EGSnrcand Geant 4

This document provides instructions for installing the Geant4 and EGSnrc Monte Carlo simulation toolkits along with the BEAMnrc code. It outlines downloading and compiling Geant4 and EGSnrc from source, setting environment variables, and verifying a successful installation. Key steps include using CMake to configure and build Geant4, setting Geant4 and EGSnrc environment variables in .bashrc, and running sample codes to test the installations.

Uploaded by

deathangel123
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

See discussions, stats, and author profiles for this publication at: https://www.researchgate.

net/publication/284178853

The Ultimate Guide to Installing EGSnrc and Geant4

Research · November 2015


DOI: 10.13140/RG.2.1.4619.7208

CITATIONS READS
0 1,161

1 author:

E. Ulises Moya-Sanchez
Government of Jalisco
62 PUBLICATIONS   99 CITATIONS   

SEE PROFILE

Some of the authors of this publication are also working on these related projects:

Local Phase Image Computation View project

Artificial Intelligence for good View project

All content following this page was uploaded by E. Ulises Moya-Sanchez on 19 November 2015.

The user has requested enhancement of the downloaded file.


The Ultimate Guide to Installing
EGSnrc and Geant4
Moisés Arnulfo Maciel H*, Benjamín Hernández**, Daniel Cebreros*, Ulises Moya*
*Posgrado en Ciencias Computacionales UAG, **Centro Estatal de Cancerología de Nayarit.
Material de apoyo del curso: Monte Carlo simulation in radiation therapy: Geant4 and EGSnrc,
impartido por Bruce Faddegon y José Ramos University of California, San Francisco
BUAP, 3 al noviembre 2015,
http://www.fcfm.buap.mx/fismed/mctp-Nov15/cursoMC-Nov15.html

1.- Before EGSnrc and Geant4 Installation

We have used the Ubuntu 14.04 or Ubuntu 15.10. Open the terminal and put this

sudo -s

apt-get install cmake

apt-get -y install gcc

apt-get -y install g++

apt-get install glibc*

apt-get install libx11-dev

apt-get install libxmu-dev

apt-get install libgl-dev

libgl1-mesa-dev-lts-vivid

libgl1-mesa-dev-lts-utopic

libgl1-mesa-dev

apt-get install libglu-dev

apt-get install python python-tk idle python-pmw python-imagingaa

apt-get isntall gfortran


apt-get isntall grace

apt-get isntall git

apt-get isntall expat

2.-Download Geant4

Download from http://geant4.cern.ch/support/download.shtml


(Info from the Geant4 guide ). Unpack the Geant4 source package geant4.10.01.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

/path/to/geant4.10.01

We refer to this directory as the source directory. The next step is to create a directory in which to
configure and run the build and store the build products. This directory should not be the same as, or
inside, the source directory. In this guide, we create this build directory alongside our source directory:

$ cd /path/to

$ mkdir geant4.10.1-build

$ ls

geant4.10.01 geant4.10.1-build

To configure the build, change into the build directory and run Cmake(Cuidado con la versión que
bajes y recomendamos bajar los DATA Files necesarios para la simulación, los pones en la carpeta
GEANT4_Datasets en la dirección /home/ulisesmoya/geant4.10.1-build
http://geant4.cern.ch/support/download.shtml ):

$ cd /path/to/geant4.10.1-build
$ cmake ../geant4.10.01.p02 -DCMAKE_INSTALL_PREFIX=../geant4-install
-DGEANT4_USE_OPENGL_X11=ON -DGEANT4_USE_RAYTRACER_X11=ON
-DGEANT4_INSTALL_DATA=OFF -DEXPAT_LIBRARY=/usr/lib/x86_64-linux-gnu/libexpat.so
-DGEANT4_BUILD_MULTITHREADED=ON

Here, the CMake Variable CMAKE_INSTALL_PREFIX is used to set the install directory, the
directory under which the Geant4 libraries, headers and support files will be installed. It must be
supplied as an absolute path. The second argument to CMake is the path to the source directory. In this
example, we have used the absolute path to the source directory, but you can also use the relative path
from your build directory to your source directory.

Additional arguments may be passed to CMake to activate optional components of Geant4, such as
visualization drivers, or tune the build and install parameters. See Section 2.3 for details of these
options. If you run CMake and decide afterwards you want to activate additional options, simply rerun
CMake in the build directory, passing it the extra options plus the build directory. For example, after
running CMake as above, you may wish to activate the installation of Geant4's datasets, so you would
run

cat /proc/cpuinfo | grep proc (optional to know howmany processor ypu could
set)

where N is the number of parallel jobs you require (e.g. if your machine has a dual core processor, you
could set N to 2)

$time make -j N

$make install

Add the following environment sttings, look your specific direction!!! for instance in this case
/home/moyel/ for other user change !
export Geant4_DIR=/home/ulisesmoya/geant4.10.01.p02-install

$ gedit ~/.bashrc

In gedit look like this


#######################################
#G4 environment settings#
########################################
export Geant4_DIR=/home/moyel/geant4.10.01.p02-install
export G4DATA=/home/moyel/geant4.10.01.p02-build/data
export G4LEDATA=$G4DATA/G4EMLOW6.41
export G4NEUTRONHPDATA=$G4DATA/G4NDL4.5
export G4SAIDXSDATA=$G4DATA/G4SAIDDATA1.1
export G4NEUTRONXSDATA=$G4DATA/G4NEUTRONXS1.4
export G4LEVELGAMMADATA=$G4DATA/PhotonEvaporation3.1
export G4RADIOACTIVEDATA=$G4DATA/RadioactiveDecay4.2
export ROOTSYS=$HOME/root
export PATH=$ROOTSYS/bin:$PATH
export LD_LIBRARY_PATH=$Geant4_DIR/lib:$ROOTSYS/lib:$LD_LIBRARY_PATH

2.1 Anggie
Anggie is a very nice program to generate code using a graphic gui

git clone https://github.com/JoseRamosMendez/Anggie.git

copiar MOMO de /home/ulisesmoya/geant4.10.01.p02/environments


y pegarla en la carpeta de Anggie
Abrir Anggie

python Anggie.py

EGS instalation

Download EGSnrc from: http://www.nrc-


cnrc.gc.ca/eng/solutions/advisory/egsnrc/download_egsnrc.html
You have to go to the download folder

$ chmod +x egs_install_Linux_self.exe

$ ./egs_install_Linux_self.exe
Follow instalation guiade and make sure that your enviroment settings will be update (look the bashrc
command in the Geant4 section)

$ gedit ~/.bashrc

In gedit look like this


###############################
# EGSnrc environment settings #
###############################
export EGS_CONFIG=/home/ulisesmoya/HEN_HOUSE/specs/x86_64-unknown-linux-gnu.conf
export EGS_HOME=/home/ulisesmoya/egsnrc_mp/
export LD_LIBRARY_PATH=/home/ulisesmoya/HEN_HOUSE/egs+
+/dso/linux64:$LD_LIBRARY_PATH
. /home/ulisesmoya/HEN_HOUSE/scripts/egsnrc_bashrc_additions
__________________________________________________________________________________

Isntalar BEAM

download http://www.nrc-cnrc.gc.ca/eng/solutions/advisory/beam/download_beam.html

$ chmod +x beam_install_Linux_self.exe

$ ./beam_install_Linux_self.exe

Look again your environments settings

$ gedit ~/.bashrc

In gedit look like this


#######################
# BEAMnrc environment settings
##########################
. /home/ulisesmoya/HEN_HOUSE/scripts/beamnrc_bashrc_additions

******************************************************************

Congratulations! You successfully installed BEAMnrc for

the EGSnrcMP Monte Carlo simulation system for Unix.

******************************************************************
This command will be useful to update your environment settings (optional)

. /home/ulisesmoya/HEN_HOUSE/scripts/beamnrc_bashrc_additions

View publication stats

You might also like