# ERROR Compiling OpenMC with DAGMC from source

**URL:** <https://openmc.discourse.group/t/error-compiling-openmc-with-dagmc-from-source/2571>\
**Category:** User Support\
**Created:** [December 16, 2022, 9:12am UTC](https://openmc.discourse.group/t/error-compiling-openmc-with-dagmc-from-source/2571 "2022-12-16T09:12:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![DWT](https://avatars.discourse-cdn.com/v4/letter/d/71e660/32.png) [@DWT](https://openmc.discourse.group/u/DWT)\
**Post date:** [December 16, 2022, 9:12am UTC](https://openmc.discourse.group/t/error-compiling-openmc-with-dagmc-from-source/2571/1 "2022-12-16T09:12:31Z")

</div>

Hello,

I was wondering if someone could help me with the installation process for OpenMC.

I’m having issues compiling OpenMC from source with DAGMC, Libmesh, and MPI (the issue seems to be with DAGMC) - I will attach the terminal output from the make command.

Notes:

- I have modified CMakelists to switch ON the additional packages
- I have used cmake DCMAKE\_PREFIX\_PATH flag as instructed
- DAGMC should be installed corrected per their instruction (not 100% sure though)
- I’m installing on WSL 2 Ubuntu 22.04.5 LTS
- all other pre-requisites should be installed

For some reason, i cannot upload a .txt file (or anything as a new user here) so here is a dump of the terminal output where the error is:

/usr/include/c++/9/bits/stl\_function.h:592:2: note: template argument deduction/substitution failed:  
In file included from /usr/include/c++/9/map:60,  
from /home/dwt/dagmc\_bld/DAGMC/include/DagMC.hpp:7,  
from /home/dwt/openmc/include/openmc/particle\_data.h:12,  
from /home/dwt/openmc/include/openmc/particle.h:13,  
from /home/dwt/openmc/include/openmc/bank.h:6,  
from /home/dwt/openmc/src/bank.cpp:1:  
/usr/include/c++/9/bits/stl\_tree.h:1354:10: note: mismatched types ‘\_Tp\*’ and ‘std::\_\_cxx11::basic\_string’  
1354 | if (!\_M\_impl.\_M\_key\_compare(\_S\_key(\_\_x), \_\_k))  
make[2]: \*\*\* [CMakeFiles/libopenmc.dir/build.make:63: CMakeFiles/libopenmc.dir/src/bank.cpp.o] Error 1  
make[1]: \*\*\* [CMakeFiles/Makefile2:244: CMakeFiles/libopenmc.dir/all] Error 2  
make: \*\*\* [Makefile:130: all] Error 2

---

<div class="post-metadata">

**Author:** ![DWT](https://avatars.discourse-cdn.com/v4/letter/d/71e660/32.png) [@DWT](https://openmc.discourse.group/u/DWT)\
**Post date:** [December 17, 2022, 5:15pm UTC](https://openmc.discourse.group/t/error-compiling-openmc-with-dagmc-from-source/2571/2 "2022-12-17T17:15:04Z")

</div>

I managed to compile with DAGMC and without LibMesh.

Not sure if it’s intended that you can only build with one or the other or if there is still something fundamentally wrong with my LibMesh install and build with OpenMC.

I am happy to move forward with just the DAGMC/MOAB CAD/Mesh features without libmesh but this might be one to note for the install guide or report as a bug if there is one.

---

<div class="post-metadata">

**Author:** ![Shimwell](https://yyz2.discourse-cdn.com/free1/user_avatar/openmc.discourse.group/shimwell/32/3876_2.png) [@Shimwell](https://openmc.discourse.group/u/Shimwell)\
**Post date:** [December 17, 2022, 8:49pm UTC](https://openmc.discourse.group/t/error-compiling-openmc-with-dagmc-from-source/2571/3 "2022-12-17T20:49:05Z")

</div>

Hi DWT

Thanks for posting and welcome to the community.

I just wanted to mention that WSL for Linux with Ubuntu might behave slightly differently to native Ubuntu in some cases. It is often worth updating to the latest WSL as an easy first try for fixing issues.

We do manage to build openmc with both dagmc and libmesh enabled as part of the docker CI regularly and the specific github action file is [here](https://github.com/openmc-dev/openmc/blob/develop/.github/workflows/dockerhub-publish-dagmc-libmesh.yml).  
The dockerfile contents might also provide some ideas about how to compile openmc with these options. However I suspect that using docker instead of WSL might give more success.

The action builds [this](https://github.com/openmc-dev/openmc/blob/develop/Dockerfile) docker file with both libmesh and dagmc enabled. So one option would be to download the prebuild docker image from [here](https://hub.docker.com/layers/openmc/openmc/develop-dagmc-libmesh/images/sha256-ce74ea072c63a0a5016ad9e9fc9e985f9da9b8f877513c83db42cfc374d52408?context=explore) or to build the docker file locally.

Best of luck with the compile.

Jon
