Installing for use with OpenMC

Note: DagMC can simultaneously be built with support for other physics codes while being installed as a dependency for OpenMC.

This document explains how to install DAGMC for use with OpenMC, assuming you have already installed the required dependencies.

DAGMC is an optional dependency of OpenMC. Therefore, the install process for this code only generates and installs the DAGMC libraries necessary for linkage with OpenMC.

Get DAGMC

As before, this guide assumes that you are building DAGMC in the subdirectory dagmc_bld of your home directory.

The first step is to clone the DAGMC repository.

$ cd $HOME/dagmc_bld
$ mkdir DAGMC
$ cd DAGMC
$ git clone https://github.com/svalinn/DAGMC
$ cd DAGMC
$ git checkout develop
$ git submodule update --init

Configure DAGMC

First, create and enter the build directory.

$ cd $HOME/dagmc_bld/DAGMC
$ ln -s DAGMC src
$ mkdir bld
$ cd bld

Then, choose where you want to install DAGMC. This is where the binaries, libraries, header files, etc. will be placed. This guide uses $INSTALL_PATH to represent this location.

$ INSTALL_PATH=$HOME/dagmc_bld/DAGMC

CMake variables are used to configure DAGMC with your desired build options. A few examples will be shown here, but you can see a list of all possible options here.

Installing DAGMC as a dependency of OpenMC

From the build directory, run:

$ cmake ../src -DMOAB_DIR=$HOME/dagmc_bld/MOAB \
               -DBUILD_TALLY=ON \
               -DCMAKE_INSTALL_PREFIX=$INSTALL_PATH

If the CMake configuration proceeded successfully, you are now ready to install DAGMC.

Use Make to install the DAGMC libraries.

$ make
$ make install

If the build was successful, the binaries, libraries, header files, and tests will be installed to the bin, lib, include, and tests subdirectories of $INSTALL_PATH respectively.

Finally, ensure that the DagMC library is in your $LD_LIBRARY_PATH

$ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$HOME/dagmc_bld/dagmc/lib

Installing OpenMC with DagMC geometry enabled

To install OpenMC with support for DagMC please refer to OpenMC’s installation from source instructions here.

Test DAGMC

We regularly run the DAGMC test suite on CircleCI as part of our continuous integration system. You may however wish to run the tests yourself in order to verify you have installed DAGMC correctly.

If the tests have completed successfully, you are now ready to run your first DAGMC problem. See the DAGMC user’s guide for more information.