[petsc-users] HDF5 errors

Satish Balay balay at mcs.anl.gov
Fri Mar 20 13:45:54 CDT 2020


This is due to upgrading hdf5 from 1.10 to 1.12

petsc/master is updated to work with hdf5-1.12

However petsc/maint is set hdf5-1.10. So I'm not sure what to suggest.

Perhaps backport the following change to maint?

diff --git a/include/petsc/private/viewerhdf5impl.h b/include/petsc/private/viewerhdf5impl.h
index 00b845d525..d5be7294cc 100644
--- a/include/petsc/private/viewerhdf5impl.h
+++ b/include/petsc/private/viewerhdf5impl.h
@@ -2,6 +2,11 @@
 #ifndef __VIEWERHDF5IMPL_H
 #define __VIEWERHDF5IMPL_H
 
+#if defined(H5_VERSION)
+#  error "viewerhdf5impl.h must be included *before* any other HDF5 headers"
+#else
+#  define H5_USE_18_API
+#endif
 #include <petscviewerhdf5.h>
 
 #if defined(PETSC_HAVE_HDF5)

Satish

On Fri, 20 Mar 2020, Boyce Griffith wrote:

> Homebrew just updated my hdf5, and now I am getting some errors from the HDF5 viewer in maint:
> 
> /Users/boyceg/sfw/petsc/petsc-maint/src/sys/classes/viewer/impls/hdf5/hdf5v.c:1064:73: error: too few arguments to function call, expected 5, have 4
>     PetscStackCallHDF5(H5Oget_info_by_name,(h5, name, &info, H5P_DEFAULT));
>                        ~~~~~~~~~~~~~~~~~~~                              ^
> /Users/boyceg/sfw/petsc/petsc-maint/include/petsc/private/viewerhdf5impl.h:11:42: note: expanded from macro 'PetscStackCallHDF5'
>     PetscStackPush(#func);_status = func args;PetscStackPop; if (_status) SETERRQ2(PETSC_COMM_SELF,PETSC_ERR_LIB,"Error in HDF5 call %s() Status %d",#func,(int)_status); \
>                                     ~~~~ ^
> /usr/local/include/H5Opublic.h:188:8: note: 'H5Oget_info_by_name3' declared here
> H5_DLL herr_t H5Oget_info_by_name3(hid_t loc_id, const char *name, H5O_info2_t *oinfo,
>        ^
> 1 error generated.
> gmake[2]: *** [gmakefile:156: darwin-dbg/obj/sys/classes/viewer/impls/hdf5/hdf5v.o] Error 1
> 



More information about the petsc-users mailing list