-
Notifications
You must be signed in to change notification settings - Fork 146
Install EGSnrc on OS X Yosemite
Installing EGSnrc on OS X involves 3 steps:
Before installing EGSnrc on OS X, ensure the software listed below is available on your system. By default, Fortran, C and C++ Compilers are not installed on OS X. The following instructions are valid for a pristine copy of OS X. If you already have development tools installed, such as Xcode for example, you should adjust the installation procedure to prevent interfering with your existing software build chain. To use EGSnrc you need:
- 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: the Qt4 development tools (to compile the Qt graphical user interfaces)
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. EGSnrc also 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.
Open the Terminal application in OS X and issue the following command to install gcc
, g++
, and the GNU make
utlity:
xcode-select --install
The GNU Fortran compiler gfortran
is not available within OS X, hence you need to download gfortran-5.1-bin.tar.gz
from http://hpc.sourceforge.net/. Open the Terminal application, go to the directory where you downloaded the file and extrac the pre-compiled binary files with the -C /.
flag to install under /usr/local/
:
cd /path/to/download/directory/
sudo tar -xzvf gfortran-5.1-bin.tar.gz -C /.
To check that you have working Fortran, C, C++ compilers and the GNU make
tool, issue the following commands (or equivalent ones if you are using other compilers) in the Terminal application:
gfortran --version # should report your Fortran compiler version
gcc --version # should report your C compiler version
g++ --version # should report your C++ compiler version
make --version # should report "GNU Make" on first line
Note that by default, some parts of EGSnrc require a compiler that supports standard C++11 (g++ option -std=c++11
), and will soon require C++14 (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.
While Tcl/Tk is not essential to run EGSnrc simulations, it proves useful if you want to use EGSnrc graphical user interfaces. Conveniently, Tcl/Tk is included in macOS, which you can confirm with the following command in the Terminal application:
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. The easiest way to get the Grace plotting tool on macOS is to install QtGrace, which is a port of the original Grace software to the Qt toolkit and which can run under Linux, macOS and Windows. You can download QtGrace from http://sourceforge.net/projects/qtgrace/.
If you prefer to use the native X11 implementation of Grace (the same that is available on Linux), you can use a third-party package manager such as Homebrew or MacPorts to install the necessary components. For example, to install grace with Homebrew, enter the following commands in the Terminal application (supplying your password when required):
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew install Caskroom/cask/xquartz
brew install homebrew/x11/grace
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.
- Open the Terminal application
- Check that git is available on your system:
git --version
- Change directory to the desired install location:
cd path/to/your/install/location
- Clone the EGSnrc repository:
git clone https://github.com/nrc-cnrc/EGSnrc.git
- 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 operating system and software environment, using a configuration shell script that prompts you for configuration options on the command-line.
- Open the Terminal application
- For 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
~/.profile
file, insert commands to define$EGS_HOME
,$EGS_CONFIG
and source EGSnrc additions, as prescribed at the end of the user configuration script - Download
EGSnrc-guis-macos.zip
, which provides pre-compiled EGSnrc graphical user interfaces, from the latest release
- Overview
- Install on VirtualBox
- Install on Linux
- Install on macOS
- Install on Windows
- Quick installation
- Upgrading