Skip to content

Commit

Permalink
making PULL_INSTALL_MOAB a boolean with value, so it can be ON and OF…
Browse files Browse the repository at this point in the history
…F and have a value. adding docs for the new option
  • Loading branch information
bam241 committed Jan 24, 2025
1 parent af0e850 commit 5667457
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 2 deletions.
6 changes: 5 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,14 @@ endif()

# Dealing with MOAB
if (PULL_INSTALL_MOAB)
set(MOAB_VERSION ${PULL_INSTALL_MOAB})

# Ensure MOAB_VERSION
if(NOT DEFINED MOAB_VERSION)
if(${MOAB_VERSION})
MESSAGE("NO MOAB_VERSION specified. Defaulting to 5.5.1")
set(MOAB_VERSION "5.5.1")
endif()
MESSAGE("MOAB_VERSION to be installed: ${MOAB_VERSION}")
include(MOAB_PullAndMake)
moab_pull_make(${MOAB_VERSION})
else()
Expand Down
2 changes: 1 addition & 1 deletion cmake/DAGMC_macros.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ macro (dagmc_setup_options)

option(DOUBLE_DOWN "Enable ray tracing with Embree via double down" OFF)

option(PULL_INSTALL_MOAB "Enable automatic downloading of MOAB dependency" OFF)
option(PULL_INSTALL_MOAB "Enable automatic downloading of MOAB dependency, provide a MOAB TAG version" OFF)

if (BUILD_ALL)
set(BUILD_MCNP5 ON)
Expand Down
5 changes: 5 additions & 0 deletions doc/install/cmake_options.rst
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,8 @@ Note that unless set, all boolean options default to ``OFF``.
* ``-DBUILD_PIC=ON`` Build with position-independent code. (Default: OFF)

* ``-DBUILD_RPATH=ON`` Build with RPATH functionality. (Default: ON)

* ``-DPULL_INSTALL_MOAB=MOAB_version`` Enables automatic downloading of MOAB
dependency, provide a MOAB TAG version, (default: OFF). When using this
option, it is required to provide the path to HDF5 location, using
``-DHDF5_ROOT``.
11 changes: 11 additions & 0 deletions doc/install/dependencies.rst
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,17 @@ To build moab using the default packages:
$ make check
$ make install

If you whish to avoid building MOAB from source, it is possible to build it at
the same time as DAGMC by setting the ``PULL_INSTALL_MOAB`` option to the
desired MOAB version. This will automatically download and build MOAB as a
dependency of DAGMC. When using this option it is assumed that HDF5 is properly
installed on your computer and you will need to provide its location for the
MOAB installation. For example, to build MOAB version 5.5.1, you would add the
following flag to the cmake command when building DAGMC:
::

$ cmake ../dagmc -DPULL_INSTALL_MOAB=5.5.1 -DHDF5_ROOT=PATH_TO_HDF5

Making sure the dependencies were installed correctly
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Expand Down

0 comments on commit 5667457

Please sign in to comment.