ERROR Compiling OpenMC with DAGMC from source

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

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.

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.
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 docker file with both libmesh and dagmc enabled. So one option would be to download the prebuild docker image from here or to build the docker file locally.

Best of luck with the compile.

Jon

1 Like