Context
Ubuntu 24.04 LTS
gcc 13.3.0
libMesh tag v1.8.4 or branch master (c4ac1945e8) (both fail)
OpenMC branch master (27e38e894)
Problem
If libMesh is configured --with-mpi, OpenMC compilation fails on libopenmc.dir/src/initialize.cpp
Error message:
[ 12%] Building CXX object CMakeFiles/libopenmc.dir/src/initialize.cpp.o
In file included from /usr/include/c++/13/memory:78,
from /u/csh/openmc_bld/src/include/openmc/memory.h:12,
from /u/csh/openmc_bld/src/include/openmc/distribution.h:12,
from /u/csh/openmc_bld/src/include/openmc/chain.h:14,
from /u/csh/openmc_bld/src/src/initialize.cpp:15:
/usr/include/c++/13/bits/unique_ptr.h: In instantiation of ‘std::__detail::__unique_ptr_t<_Tp> std::make_unique(_Args&& ...) [with _Tp = libMesh::LibMeshInit; _Args = {int&, char**&, ompi_communicator_t*&, const int&}; __detail::__unique_ptr_t<_Tp> = __detail::__unique_ptr_t<libMesh::LibMeshInit>]’:
/u/csh/openmc_bld/src/src/initialize.cpp:78:40: required from here
/usr/include/c++/13/bits/unique_ptr.h:1070:30: error: invalid conversion from ‘ompi_communicator_t*’ to ‘int’ [-fpermissive]
1070 | { return unique_ptr<_Tp>(new _Tp(std::forward<_Args>(__args)...)); }
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| |
| ompi_communicator_t*
In file included from /apps/libmesh/include/libmesh/bounding_box.h:24,
from /u/csh/openmc_bld/src/include/openmc/mesh.h:30,
from /u/csh/openmc_bld/src/include/openmc/simulation.h:7,
from /u/csh/openmc_bld/src/src/initialize.cpp:32:
/apps/libmesh/include/libmesh/libmesh.h:111:19: note: initializing argument 3 of ‘libMesh::LibMeshInit::LibMeshInit(int, const char* const*, int, int)’
111 | int COMM_WORLD_IN=0, int n_threads=-1);
| ~~~~^~~~~~~~~~~~~~~
make[2]: *** [CMakeFiles/libopenmc.dir/build.make:412: CMakeFiles/libopenmc.dir/src/initialize.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:252: CMakeFiles/libopenmc.dir/all] Error 2
make: *** [Makefile:146: all] Error 2
Configuration Used
libMesh
$ ../src/configure --with-mpi --with-methods="opt" --prefix=/apps/libmesh
openMC
$ cmake \
-DOPENMC_USE_OPENMP=on \
-DOPENMC_USE_DAGMC=on \
-DOPENMC_USE_MCPL=on \
-DOPENMC_USE_LIBMESH=on \
-DOPENMC_USE_MPI=on \
-DHDF5_PREFER_PARALLEL=on \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX="/apps" \
-DCMAKE_PREFIX_PATH="/apps/libmesh;/apps/dagmc;/apps/mcpl" \
../src
Workaround
If libMesh is compiled without --with-mpi, openMC compiles just fine.
Peripheral Issue
CMake is giving me this warning when I specify -DOPENMC_USE_MCPL=on
CMake Warning:
Manually-specified variables were not used by the project:
OPENMC_USE_MCPL