Quick EGSnrc installation and configuration - nrc-cnrc/EGSnrc GitHub Wiki

Here is the quickest way to download and configure EGSnrc using terminal commands in Linux or macOS. This proves convenient in cases where frequent installation is required, for example in the development, testing or deployment of EGSnrc. Users should still consult the more detailed instructions to understand the software prerequisites before proceeding with a quick installation. Note that the EGSnrc applications and graphical user interfaces are not compiled with this method.

1. Install expect

The expect software is used to answer configuration questions automatically. You can install expect with your operating system package manager, for example:

yum install expect   ### on redhat-based linux
apt install expect   ### on debian-based linux
brew install expect  ### on macOS

2. Clone and configure

Once all prerequisites and the expect software are installed, you can clone and configure EGSnrc using the following commands in the terminal (bash syntax):

git clone https://github.com/nrc-cnrc/EGSnrc.git
cd EGSnrc
HEN_HOUSE/scripts/configure.expect $(git rev-parse --short HEAD) 3

Here $(git rev-parse --short HEAD) names the configuration after the precise EGSnrc version (the current git commit hash), but you can use another name if you want. The number 3 at the end of the command skips the pre-compilation of applications distributed in $EGS_HOME. You can pre-compile all of them by specifying 1 instead (but this takes longer). If you want configuration options that are different from the defaults, you can edit prompt answers in HEN_HOUSE/scripts/configure.expect accordingly.

3. Set environment variables

Configuration ends with some guidance to set environment variables and sourcing shell additions. The message ends with lines similar to (for your installation path):

(...)

export EGS_HOME=/home/username/EGSnrc/egs_home/
export EGS_CONFIG=/home/username/EGSnrc/HEN_HOUSE/specs/a6fc389.conf
source /home/username/EGSnrc/HEN_HOUSE/scripts/egsnrc_bashrc_additions

###############################################################################

You can either add these commands in your shell login file (as suggested), or just enter them in the terminal for a throwaway installation.

Note: If you are installing on a system where EGSnrc is already installed, ensure that the new installation path is listed first in the $PATH environment variable (echo $PATH, or issue the command type mortran3.exe to confirm which EGSnrc the system "sees"). Otherwise fix your $PATH variable sot that the new installation paths appear first in the $PATH variable.

4. Verify

Change to the newly installed $EGS_HOME directory, then inside the egs_app directory; build the application and run the sample input:

cd $EGS_HOME/egs_app
make
egs_app -i slab.egsinp