Skip navigation.

Installing EGSnrc on a 64-bit AMD Opteron Cluster running CentOS 5 Linux

EGSnrc comes with a very silly homepage (now changed, alas - I had grown to like the rocket-powered egg). Despite the comic logo, the function is quite dry - Monte Carlo simulations of coupled electron-photon transport with an energy range of 1keV - 10 GeV. When installed with BEAM it cn be used for for modelling radiotherapy sources. Preconditions for installing and running EGSnrc include a Fortran compiler, a C++ compiler, QT and QT-dev versions 3.1 and greater, and TCL/TK version 8.0 or higher. Although it hasn't been updated for some years, there is excellent documentation which explains the physics, implementation details and installation on a Linux/UNIX system.

Download the installation script and the tarball of the source code. Unpack the source in sensible place (/usr/local/EGSnrc/v4).

Unlike many similar programs these need to be moved in a special egsnrc home directory (e.g., /home/egsnrc).

Load the necessary modules (module load gcc, module load tcl). Make the script executable (chmod u+x install_egs) and run it (./install_egs).

When the installer as Input directory where you stored the EGSnrc distribution files, enter /usr/local/EGSnrc/v4. When the installer asks Input directory where you want to install EGSnrc:, enter /home/egsnrc. Keep in mind if you're doing a reinstall there will be user-created files in some directories (e.g., /usr/local/EGSnrc/v4/scripts/beamnrc_bashrc_additions) and you may wish to consider a safer location for testing purposes.

Follow the install directives regarding fortran and gcc compilers etc. Most will find the defaults acceptable.

EGnrc consists of two main directories. One, the HEN_HOUSE (I know, I know), holds all the standard EGSnrc files. This directory must be kept on the system where all local EGSnrc users can read (this is why in a multiuser system, creating a user called egsnrc is useful). The second directory is user_code directory area. It is a requirement that there must be a sub-directory with the same name as the user code.

Every user who wants to use the system must now run the script from their home directory.


This however will fail horribly because installing it as root does not give the correct permissions for users. It's just plain awful, but you'll have to give universal read permissions for the directory.

chmod a+x /home/egsnrc/scripts/finalize_egs_foruser
chmod a+r /home/egsnrc/ -R

(You could go through and find out exactly what files are required, but that's someone else's battle... Hello National Research Council, Canada?)

The question will ask for an absolute path which must be writable for the user e.g., /home/lev/egsnrc.

When configuration is complete add the following statements to the .bashrc file (assuming that you're using bash as your shell, of course; there's equivalent values for Korn or C/tsch in .profile or .cshrc as appropriate).

export EGS_HOME=/home/egsnrc/egsnrc/
export EGS_CONFIG=/home/egsnrc//specs/x86_64-unknown-linux-gnu-f95.conf
. /home/egsnrc/scripts/egsnrc_bashrc_additions