# HDF5 2.0 has breaking changes - cmake doesn't set the \`HDF5\_IS\_PARALLEL\` variable anymore

**URL:** https://discourse.cmake.org/t/hdf5-2-0-has-breaking-changes-cmake-doesnt-set-the-hdf5-is-parallel-variable-anymore/15444
**Category:** Usage
**Tags:** os:linux
**Created:** [January 7, 2026, 4:18pm UTC](https://discourse.cmake.org/t/hdf5-2-0-has-breaking-changes-cmake-doesnt-set-the-hdf5-is-parallel-variable-anymore/15444 "2026-01-07T16:18:54Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![cphyc](https://discourse.cmake.org/user_avatar/discourse.cmake.org/cphyc/32/5968_2.png) [@cphyc](https://discourse.cmake.org/u/cphyc)
#### Post date: [January 7, 2026, 4:18pm UTC](https://discourse.cmake.org/t/hdf5-2-0-has-breaking-changes-cmake-doesnt-set-the-hdf5-is-parallel-variable-anymore/15444/1 "2026-01-07T16:18:54Z")

</div>

Detection of MPI support in HDF5 worked with HDF5\<2.0.0. With the recent release of HDF5 2.0.0 ( [​Release of HDF5 2.0.0 (Newsletter #207) - The HDF Group - ensuring long-term access and usability of HDF data and supporting users of HDF technologies](https://www.hdfgroup.org/2025/11/10/release-of-hdf5-2-0-0-newsletter-207/) ), CMake appears to be unable to detect MPI support in HDF5 properly.

You can find the source and cmake configuration file below, and here is the command I’ve tried:  
`$ mkdir build && cd build && cmake .. && make && mpirun -np 2 test_hdf5_mpi`

The configuration works, the code compiles and runs with openmpi 5.0.7, hdf5 1.14.6 with MPI support, Cmake 3.26.5 and GCC 15.2.0.

```auto
$ mkdir build && cd build && cmake .. && make && mpirun -np 2 test_hdf5_mpi
-- The C compiler identification is GNU 8.5.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Found MPI_C: /softs/openmpi/5.0.7-gnu-slurm/lib/libmpi.so (found version "3.1") 
-- Found MPI: TRUE (found version "3.1")  
-- Found HDF5: /softs/hdf5/1.14.6-mpi-gnu/lib/libhdf5.so;/usr/lib64/libz.so;/usr/lib64/libdl.so;/usr/lib64/libm.so (found version "1.14.6") found components: C 
-- Configuring done (0.8s)
-- Generating done (0.0s)
-- Build files have been written to: /home/cadiou/tmp/build
[50%] Building C object CMakeFiles/test_hdf5_mpi.dir/test.c.o
[100%] Linking C executable test_hdf5_mpi
[100%] Built target test_hdf5_mpi
[1] Parallel HDF5 appears to be working.
[0] Parallel HDF5 appears to be working.

```

The configuration fails with openmpi 5.0.9, hdf5 2.0.0 with MPI support, Cmake 4.2.1 and GCC 15.2.1:

```auto
$ mkdir build && cd build && cmake .. && make && mpirun -np 2 test_hdf5_mpi
-- The C compiler identification is GNU 15.2.1
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Found MPI_C: /usr/lib/libmpi.so (found version "3.1")
-- Found MPI: TRUE (found version "3.1")
-- Found ZLIB: /usr/lib/libz.so (found version "1.3.1")
-- Found HDF5: hdf5-shared (found version "2.0.0") found components: C
CMake Error at CMakeLists.txt:13 (message):
  Found HDF5, but it is NOT built with MPI support

-- Configuring incomplete, errors occurred!

```

* * *

```auto
# file: test.c

#include <mpi.h>
#include <hdf5.h>
#include <stdio.h>

int main(int argc, char **argv)
{
    MPI_Init(&argc, &argv);

    int rank;
    MPI_Comm_rank(MPI_COMM_WORLD, &rank);

    hid_t fapl = H5Pcreate(H5P_FILE_ACCESS);
    if (fapl < 0) {
        if (rank == 0) fprintf(stderr, "H5Pcreate failed\n");
        MPI_Abort(MPI_COMM_WORLD, 1);
    }

    herr_t status = H5Pset_fapl_mpio(fapl, MPI_COMM_WORLD, MPI_INFO_NULL);
    if (status < 0) {
        if (rank == 0) fprintf(stderr, "H5Pset_fapl_mpio failed (no parallel HDF5?)\n");
        MPI_Abort(MPI_COMM_WORLD, 2);
    }

    printf("[%d] Parallel HDF5 appears to be working.\n", rank);

    H5Pclose(fapl);
    MPI_Finalize();
    return 0;
}

```

```auto
# file: CMakeLists.txt

cmake_minimum_required(VERSION 3.18)
project(test_hdf5_mpi C)

# MPI is required
find_package(MPI REQUIRED)

set( HDF5_PREFER_PARALLEL ON )

# HDF5 with explicit parallel requirement
find_package(HDF5 REQUIRED COMPONENTS C)

if (NOT HDF5_IS_PARALLEL)
    message(FATAL_ERROR "Found HDF5, but it is NOT built with MPI support")
endif()

add_executable(test_hdf5_mpi test.c)

target_link_libraries(test_hdf5_mpi
    MPI::MPI_C
    HDF5::HDF5
)

target_include_directories(test_hdf5_mpi PRIVATE ${HDF5_INCLUDE_DIRS})

```

---

<div class="post-metadata">

### Author: ![cphyc](https://discourse.cmake.org/user_avatar/discourse.cmake.org/cphyc/32/5968_2.png) [@cphyc](https://discourse.cmake.org/u/cphyc)
#### Post date: [January 7, 2026, 4:27pm UTC](https://discourse.cmake.org/t/hdf5-2-0-has-breaking-changes-cmake-doesnt-set-the-hdf5-is-parallel-variable-anymore/15444/2 "2026-01-07T16:27:18Z")

</div>

Note that, one of the breaking changes in HDF5 2.0.0 is a renaming of `HDF5_ENABLE_PARALLEL` to `HDF5_PROVIDES_PARALLEL` (see PR #[5716](https://github.com/HDFGroup/hdf5/pull/5716)). It seems like the following diff fixes `FindHDF5.cmake`:

```auto
686c686
< set(HDF5_IS_PARALLEL ${HDF5_ENABLE_PARALLEL})
---
> set(HDF5_IS_PARALLEL ${HDF5_PROVIDES_PARALLEL})

```

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.cmake.org/u/ben.boeckel)
#### Post date: [February 9, 2026, 2:05am UTC](https://discourse.cmake.org/t/hdf5-2-0-has-breaking-changes-cmake-doesnt-set-the-hdf5-is-parallel-variable-anymore/15444/3 "2026-02-09T02:05:50Z")

</div>

Can you please submit an MR for this? Or, failing that, file an issue? Feel free to Cc me; I have a couple other reasons to visit FindHDF5 and this can get swept up in that.

---

<div class="post-metadata">

### Author: ![cphyc](https://discourse.cmake.org/user_avatar/discourse.cmake.org/cphyc/32/5968_2.png) [@cphyc](https://discourse.cmake.org/u/cphyc)
#### Post date: [February 9, 2026, 10:10am UTC](https://discourse.cmake.org/t/hdf5-2-0-has-breaking-changes-cmake-doesnt-set-the-hdf5-is-parallel-variable-anymore/15444/4 "2026-02-09T10:10:34Z")

</div>

I have opened a MR fixing the issue that was already merged (for 4.3.0) [https://gitlab.kitware.com/cmake/cmake/-/merge\_requests/11573](https://gitlab.kitware.com/cmake/cmake/-/merge_requests/11573).
