OpenMC was not configuredwith DAGMC

I just installed OpenMC on a new machine and got the following error trying to use dagmc:

OpenMC was not configuredwith DAGMC

My installation is from source, and I included the dagmc flag (see below), so I’m not sure what the issue is here

#source install
cd /opt
sudo git clone --recurse-submodules --single-branch --branch develop --depth 1 https://github.com/openmc-dev/openmc.git
cd openmc
sudo mkdir build
cd build
sudo cmake -Doptimize=on \
           -Ddagmc=ON \
           -DDAGMC_ROOT=$HOME/openmc/DAGMC \
           -DHDF5_PREFER_PARALLEL=off ..
sudo make install
cd /opt/openmc/
sudo python setup.py install

Runs as the following version

 Version | 0.13.1-dev

Any ideas? Let me know if I can provide more detail.

Thanks,
Luke

EDIT:

Here is the python script:

#Geometry
h5m_filepath = 'h5m_files/zpre.h5m'
dag_univ = openmc.DAGMCUniverse(filename=h5m_filepath)
geom = openmc.Geometry(root=dag_univ)
geom.export_to_xml()

I think I found the issue. Looks like the cmake option for dagmc in the latest version (2. Installation and Configuration — OpenMC Documentation) is OPENMC_USE_DAGMC instead of just dagmc. Will try recompiling and confirm.

@LukeLabrie That’s correct – the CMake option is indeed OPENMC_USE_DAGMC now due to a recent change.

Hi there, I have also had this issue when attempting to use dagmc. When installing from source

sudo cmake 
-Doptimize=on            
-DOPENMC_USE_DAGMC=ON            
-DDAGMC_ROOT=/home/williamjsmith15/dagmc_bld/DAGMC/DAGMC            -DHDF5_PREFER_PARALLEL=off

I get the error:

CMake Warning:
  No source or binary directory provided.  Both will be assumed to be the
  same as the current working directory, but note that this warning will
  become a fatal error in future CMake releases.


-- Configuring DAGMC 3.2.2
CMake Error at /home/williamjsmith15/dagmc_bld/DAGMC/DAGMC/CMakeFiles/Export/lib/cmake/dagmc/DAGMCTargets.cmake:111 (message):
  The imported target "dagmc-shared" references the file

     "/home/williamjsmith15/dagmc_bld/DAGMC/DAGMC/CMakeFiles/Export/lib/libdagmc.so"

  but this file does not exist.  Possible reasons include:

  * The file was deleted, renamed, or moved to another location.

  * An install or uninstall procedure did not complete successfully.

  * The installation package was faulty and contained

     "/home/williamjsmith15/dagmc_bld/DAGMC/DAGMC/CMakeFiles/Export/lib/cmake/dagmc/DAGMCTargets.cmake"

  but not all the files it references.

Call Stack (most recent call first):
  /home/williamjsmith15/dagmc_bld/DAGMC/DAGMC/DAGMCConfig.cmake:31 (include)
  CMakeLists.txt:70 (find_package)

Any ideas at a solution? The libdagmc.so file is not in that location but I have followed the installation steps as per the DAGMC website.

Thanks,
Will

Hi @willia.smith-14 and welcome to the community! Sorry to hear you’re having trouble building with DAGMC. Maybe @pshriwise (our local DAGMC expert) can chime in. In the meantime, if you don’t see the libdagmc.so file, what do you see in the /home/williamjsmith15/dagmc_bld/DAGMC/DAGMC/CMakeFiles/Export/lib/ directory?

Hi Will!

Thanks for posting here. Hopefully we can get you up and running with a few tweaks to your CMake line. What would be helpful for me to see is the CMake command you used when building DAGMC if you wouldn’t mind sharing it.

-Patrick

Hi Patrick,

Thanks for getting back so quick! I used the one in the DAGMC Guide (Installing for use with OpenMC, Installing for use with OpenMC — DAGMC):

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

Thanks

Paul,

Thanks for getting back to me so quick!
The path just has a cmake file in it

Thanks

Thanks Will!
I would try the following CMake command when configuring OpenMC:

sudo cmake ../src
-Doptimize=on            
-DOPENMC_USE_DAGMC=ON            
-DCMAKE_PREFIX_PATH=$INSTALL_PATH
-DHDF5_PREFER_PARALLEL=off

The CMAKE_PREFIX_PATH variable is an updated way of providing the DAGMC installation location.

Thanks Patrick,

Is this run in the build folder of the OpenMC install location? When running it there it just spits out:

Usage

  cmake [options] <path-to-source>
  cmake [options] <path-to-existing-build>
  cmake [options] -S <path-to-source> -B <path-to-build>

Specify a source directory to (re-)generate a build system for it in the
current working directory.  Specify an existing build directory to
re-generate its build system.

Run 'cmake --help' for more information.

-Doptimize=on: command not found
-DOPENMC_USE_DAGMC=ON: command not found
-DCMAKE_PREFIX_PATH=: command not found
-DHDF5_PREFER_PARALLEL=off: command not found

I’ve tried running it on a fresh install of OpenMC and running it after the cmake .. , make and make install as shown in the installing from source guide.

Thanks
Will

Ah, yeah the CMake command I provided above was missing the path to the source directory. I’ve updated it to include that based on the path used above.