Following up (thanks Tobias), this compilation error is resolved by installing HDF5-MPI.
In other words, if you configure OGS with PETSC=On and don’t have HDF5-MPI installed in your system, OGS will not compile. Shouldn’t this be checked by cmake during configuration?
If you build a regular serial config (OGS_USE_PETSC=OFF) you have to make sure that you have the brew formula hdf5 installed and currently linked.
If you build a config with Petsc (OGS_USE_PETSC=ON) you have to install and link hdf5-mpi.
If you do not want to care about this stuff: Uninstall all hdf5 formulas and then OGS will take care of automatically building the right hdf5 configuration in the build-directory.