-
Notifications
You must be signed in to change notification settings - Fork 146
Install EGSnrc on Linux
Installing EGSnrc on Linux involves 3 steps:
Before installing EGSnrc on Linux, ensure the software packages listed below are installed. These are very common and widely available, often installed by default on many Linux distributions (otherwise you can find them through your package manager, or else ask your system administrator to install them). The optional components are highly recommended, even though the core EGSnrc simulation toolkit will work without them.
- a Fortran compiler (preferably
gfortran
) - a C compiler (preferably
gcc
) - a C++ compiler (preferably
g++
) - the GNU
make
utility - optional: the Tcl/Tk interpreter and widget toolkit, version 8.0 or later
-
optional: the Grace plotting tool (providing the
xmgrace
command), version 5.0 or later -
optional: Open Motif development package, to compile dosxyz_show (e.g.
libmotif-dev
) -
optional: the Qt4 or Qt5 development tools (e.g.
qt5-default
andqt5-qmake
), to re-compile the Qt GUIs -
optional: a job scheduler of your choice (e.g. the package
at
), for parallel processing
You may use any working Fortran, C and C++ compilers on your system. We develop and use EGSnrc with the GNU compilers gfortran
, gcc
and g++
, so these are recommended. If you use other compilers, you might have to adjust compilation options in the configuration stage in order for EGSnrc to work as expected. To check that you have working Fortran, C and C++ compilers, open a terminal shell and issue the following commands (or equivalent ones if you are using other compilers):
gfortran --version # should report your Fortran compiler version
gcc --version # should report your C compiler version
g++ --version # should report your C++ compiler version
Note that EGSnrc require a compiler that supports the C++14 standard (g++ option -std=c++14
). If you have an older compiler that does not recognize this option, please adjust or remove it from the list of proposed flags during the EGSnrc configuration.
EGSnrc relies on a make
tool, which controls and automates the software building process: most EGSnrc applications are built by issuing the make
command in the appropriate directory. There are various implementations of make
, but EGSnrc relies on features of the GNU implementation (also called gmake
on some systems). To check that make
invokes GNU make on your system, open a terminal shell and issue the following command:
make --version # should report "GNU Make" on first line
While Tcl/Tk is not essential to run EGSnrc simulations, it proves useful if you want to use EGSnrc graphical user interfaces. Note that Tcl/Tk is normally installed by default in most Linux distributions. If you want to check that Tcl/Tk is available on your system, open a terminal shell and issue the following command:
echo 'puts [info patchlevel]; exit 0' | wish # should report version 8.0 or newer
Grace proves useful if you want to display data plots generated by EGSnrc applications. It is packaged for major Linux distributions. To check if Grace is installed on your system, open a terminal shell and issue either of these commands:
grace -version # should report Grace-5.0 or newer
xmgrace # should launch the Grace graphical user interface
On some Red Hat systems, it may be necessary to add the epel.repo (https://fedoraproject.org/wiki/EPEL), then install the grace
package.
You don't need Open Motif to run EGSnrc simulations. However, to compile the dosxyz_show
application (for visualizing voxelized phantoms and dose distributions), you need the Open Motif library development files. The corresponding package is generally available in major Linux distributions, under different names: libmotif-dev, libmotif-devel, libopenmotif-devel, openmotif-devel, motif-devel.
Compiling the Qt GUIs is not normally required - precompiled versions are provided through the installation tool, and on the release page. However, for developers see the instructions here.
You don't need a job scheduler to run EGSnrc simulations. A job scheduler simplifies the queuing, managing and monitoring of parallel calculations on a many-core system. Examples of popular schedulers are: OpenPBS, Torque, Slurm, Grid Engine, Moab. EGSnrc is compatible with any scheduling software. We provide the script $HEN_HOUSE/scripts/bin/egs-parallel
to facilitate job submission out-of-the-box on OpenPBS and Torque schedulers, as well as on multi-core machines.
To use the EGSnrc toolkit you must copy the entire EGSnrc directory tree to your computer. All the project files are grouped in a single top-level EGSnrc
directory which you can put just about anywhere on your system (preferably under your home directory for a single-user installation) as long as the path contains no blank space or '@' character. We recommend that you use git
to clone the EGSnrc repository, but alternatively you may download a compressed image of the EGSnrc directory.
Make sure to install EGSnrc in a short path (e.g. /home/you/EGSnrc), because there is a limit of 80 characters on path lengths in the Mortran codes.
- Open a terminal shell
- Check that git is available on your system:
git --version
- Change directory to the desired install location:
cd path/to/your/install/location
(note that cloning the repository with create a new directoryEGSnrc
in your current directory) - Clone the EGSnrc repository:
git clone https://github.com/nrc-cnrc/EGSnrc.git
(this will create a directoryEGSnrc
in the current directory)
Consider the Upgrading instructions which propose a few additional steps in the installation procedure to manage upgrades more easily with the git
version control software, and to facilitate citing your local code modifications unequivocally.
- Download the compressed image EGSnrc-master.zip
- Move the
EGSnrc-master.zip
file to the desired install location - Uncompress the archive using the
unzip
command-line tool, or your favorite utility - If you want, you can rename the inflated
EGSnrc-master
directory toEGSnrc
Once you have the EGSnrc source code on your computer, you must configure EGSnrc for your particular software environment, using either a configuration GUI or a configuration shell script that prompts you for configuration options on the command-line.
- Download the
EGSnrc-configure-linux
executable from the latest release on the release page - Turn on the execute permission for this file:
chmod +x EGSnrc-configure-linux
- Clear EGSnrc environment variables:
export HEN_HOUSE="" EGS_HOME="" EGS_CONFIG=""
- Launch the installer:
./EGSnrc-configure-linux
- Read the first page and click
Next
- Choose a name for your configuration
- Pick a
HEN_HOUSE
directory, normally inside theEGSnrc
top-level directory - Choose your personal EGSnrc user directory; we recommend you call it
egs_home
, inside yourEGSnrc
top-level directory - Click
Next
, review the Licence notice, and clickNext
- Select whether you want the program to set your environment variables and create desktop icons at the end of the configuration, and click
Install
to proceed
- Open a terminal bash shell
- If you have installed EGSnrc before and would like a fresh install, clear existing EGSnrc environment variables with the command:
export HEN_HOUSE="" EGS_HOME="" EGS_CONFIG=""
- Go to your EGSnrc directory:
cd path/to/EGSnrc/directory
- Launch the configuration script:
./HEN_HOUSE/scripts/configure
- Answer prompts and follow instructions rigorously
- In your shell resource file (e.g. ~/.bashrc), insert commands to define
$EGS_HOME
,$EGS_CONFIG
and source EGSnrc additions, as prescribed at the end of the user configuration script
- Start a new terminal (or log out and back in again) to ensure the shell resource file is read
- From the latest release, download
EGSnrc-guis-linux.tar.gz
, which provides pre-compiled EGSnrc graphical user interfaces. Or better yet, consider compiling them yourself.
- Overview
- Install on VirtualBox
- Install on Linux
- Install on macOS
- Install on Windows
- Quick installation
- Upgrading