Problem compiling - Parallel HDF5 detected, but does not support MPI

Hi all,

I am trying to compile openmc with @pshriwise’s branch: Store full unstructured mesh definition and add ability to write to VTK by pshriwise · Pull Request #2103 · openmc-dev/openmc · GitHub

But when I try to run cmake, I get the following error:

HDF5: Using hdf5 compiler wrapper to determine C configuration
-- Found HDF5: /home/kelly/miniconda3/envs/openmc-comp/lib/;/home/kelly/miniconda3/envs/openmc-comp/lib/;/home/kelly/miniconda3/envs/openmc-comp/lib/;/usr/lib/x86_64-linux-gnu/;/usr/lib/x86_64-linux-gnu/;/home/kelly/miniconda3/envs/openmc-comp/lib/;/usr/lib/x86_64-linux-gnu/;/usr/lib/x86_64-linux-gnu/ (found version "1.12.1") found components: C HL 
CMake Error at CMakeLists.txt:116 (message):
  Parallel HDF5 was detected, but the detected compiler, /usr/bin/c++, does
  not support MPI.  An MPI-capable compiler must be used with parallel HDF5.

Does anyone know how to fix this?


Hi @kellythomas,

If you’re updating from the latest release version to this branch, one thing to check is that the OPENMC_USE_MPI CMake variable is set correctly. We used to search for serial/parallel HDF5 installations based on the compiler discovered by CMake, which was usually set using the CXX environment variable. We now rely on this new CMake variable and use the built-in CMake modules to locate an MPI compiler. If you’re building in the same directory and the same settings as before, it’s likely that the HDF5 version being searched for is not going to match up with the compiler in use. Sure fire way to remedy this is to clear out the build directory and do a CMake configuration from scratch using the new CMake variables.

Since I have a feeling you’ll want the unstructured mesh capabilities enabled :smile:, I’ll mention that the dagmc and libmesh CMake variables have also been moved to OPENMC_USE_DAGMC and OPENMC_USE_LIBMESH respectively.

Hope this helps!



One more thing I’ll add – if you do have two installations of HDF5, one serial and one parallel, and CMake is picking up the parallel one when you don’t want it to, you can also pass -DHDF5_PREFER_PARALLEL=OFF on your cmake line.

1 Like

Hi! Thank you, that was helpful. Once I set OPENMC_USE_MPI, OPENMC_USE_DAGMC, and OPENMC_USE_LIBMESH to ON, I got a new error:

-- Checking for module 'libmesh>=1.6.0'
--   No package 'libmesh' found
CMake Error at /usr/share/cmake-3.16/Modules/FindPkgConfig.cmake:463 (message):
  A required package was not found
Call Stack (most recent call first):
  /usr/share/cmake-3.16/Modules/FindPkgConfig.cmake:643 (_pkg_check_modules_internal)
  cmake/Modules/FindLIBMESH.cmake:20 (pkg_check_modules)
  CMakeLists.txt:87 (find_package)

I’m not sure if I actually need the libmesh support turned on though, and if I turn it off, it compiles without errors. Do I need that to make use of the updates in this branch?

Was the variable -DCMAKE_PREFIX_PATH=/location/of/libmesh/install set in your CMake command?