Skip to content

Quick EGSnrc installation and configuration

Frederic Tessier edited this page Jun 14, 2022 · 17 revisions

Here is the quickest way to download and configure EGSnrc using terminal commands in Linux or macOS. This proves convenient for situations 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 installation. Note that the EGSnrc applications and graphical user interfaces are not compiled with this quick installation 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 (commit hash), but you can use another name if you want. The last 3 on the line means that no application will be pre-compiled. You can pre-compile all of them by specifying 1 instead (which takes longer).

You can edit answers in HEN_HOUSE/scripts/configure.expect if you want configuration options that are different from the defaults.

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 for a throwaway installation just enter them in the terminal.

If you are installing on a system where EGSnrc is already installed, take care not to confuse paths between the two installations. Inspect your system PATH variable with echo $PATH to confirm that the intended EGSnrc instance of EGSnrc is visible, or issue the command type mortran3.exe, which should confirm the full path to your newly installed version. Otherwise fix your $PATH variable accordingly sot that the newly installed version paths appear first in the $PATH.

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
Clone this wiki locally