Install DAG-MCNP5/6

This document explains how to install DAG-MCNP5/6, assuming you have already installed the required dependencies.

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

Apply the MCNP source code patch

DAGMC can be built with MCNP5 or MCNP6 or both, from Los Alamos National Laboratory. It is export-controlled software so you will need to request it from RSICC.

If you are building DAG-MCNP5/6, you will need to copy the MCNP source code from the DVD into the DAGMC repository and apply a patch so it can be used with DAGMC. The patch you use must correspond to your version of MCNP. Currently supported versions of MCNP5 are 5.1.40, 5.1.51, and 5.1.60.

$ cd src/mcnp/mcnp5
$ cp -r <path_to_dvd>/MCNP5/Source .
$ chmod -R u+rw Source
$ patch -p0 < patch/mcnp516.patch

Currently supported versions of MCNP6 are 6_beta2, 6.1, 6.1.1beta, and 6.2.

$ cd src/mcnp/mcnp6
$ cp -r <path_to_dvd>/MCNP6/Source .
$ chmod -R u+rw Source
$ patch -p0 < patch/mcnp620.patch

Assuming the patch or patches were succesfully applied, i.e. there were no warnings or errors, you are now ready to configure DAGMC to produce the desired build.

Configure DAG-MCNP5/6

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.

Note that all of these examples examples assume that the $DATAPATH environment variable is set. If it is not set, then the -DMCNP5_DATAPATH and/or -DMCNP6_DATAPATH cmake options must be included instead.

Example 1: Build the DAGMC interfaces and DAG-MCNP5.

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

Example 2: Build an MPI version of DAG-MCNP5.

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

Example 3: Build the DAGMC interfaces and DAG-MCNP6.

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

Example 4: Build an MPI version of DAG-MCNP6.

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

Example 5: Build both DAG-MCNP5 and DAG-MCNP6.

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

Example 6: Build MPI versions of both DAG-MCNP5 and DAG-MCNP6.

$ cmake ../src -DMOAB_DIR=$HOME/dagmc_bld/MOAB \
               -DBUILD_MCNP5=ON \
               -DBUILD_MCNP6=ON \
               -DBUILD_MCNP_MPI=ON \
               -DCMAKE_INSTALL_PREFIX=$INSTALL_PATH

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

Build DAG-MCNP5/6

Use Make to install DAG-MCNP5/6.

$ 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.

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.