1
0
mirror of https://github.com/TREX-CoE/trexio.git synced 2024-11-03 20:54:07 +01:00

Removed dependency on hdf5_hl

This commit is contained in:
Anthony Scemama 2023-01-16 14:54:17 +01:00
parent 5dff6491aa
commit 8da5c2215b
2 changed files with 10 additions and 11 deletions

View File

@ -131,18 +131,15 @@ AS_IF([test "x$with_hdf5" == "xno"], [
AC_DEFINE([HAVE_HDF5], 0, [Define to 1 if HDF5 is available]) ],
[test "x$with_hdf5" != "xyes"], [
HDF5_PATH="$with_hdf5"
HDF5_LIBS="-L$HDF5_PATH/lib -lhdf5 -lhdf5_hl"
HDF5_LIBS="-L$HDF5_PATH/lib -lhdf5"
HDF5_CFLAGS="-I$HDF5_PATH/include"
AC_DEFINE([HAVE_HDF5], 1, [Define to 1 if HDF5 is available]) ],
[
PKG_CHECK_MODULES([HDF5], [hdf5 >= 1.8])
AS_IF([ test "${HDF5_LIBS}" == "" ], [
AC_CHECK_LIB([hdf5], [H5Fcreate], [ HDF5_LIBS="-lhdf5" ])
AC_CHECK_HEADER([hdf5.h], [HDF5_CFLAGS=""], [AC_MSG_ERROR([HDF5 header not found]) ])
AC_CHECK_HEADER([hdf5_hl.h], [HDF5_CFLAGS=""], [AC_MSG_ERROR([HDF5 header not found]) ])
])
AC_CHECK_HEADER([hdf5.h], [HDF5_CFLAGS=""], [AC_MSG_ERROR([HDF5 header not found]) ]) ])
AC_DEFINE([HAVE_HDF5], 1, [Define to 1 if HDF5 is available])
HDF5_LIBS="$HDF5_LIBS -lhdf5_hl"
])
AM_CONDITIONAL([HAVE_HDF5],[test "x$with_hdf5" != "xno"])

View File

@ -39,7 +39,6 @@
#include <sys/stat.h>
#include "hdf5.h"
#include "hdf5_hl.h"
#+end_src
@ -380,18 +379,21 @@ trexio_hdf5_read_$group_dset$ (trexio_t* const file, $group_dset_dtype$* const $
}
FREE(ddims);
/* Read dataset */
herr_t status = H5Dread(dset_id,
H5T_$GROUP_DSET_H5_DTYPE$,
H5S_ALL, H5S_ALL, H5P_DEFAULT,
$group_dset$);
H5Sclose(dspace_id);
H5Dclose(dset_id);
/* High-level H5LT API. No need to deal with dataspaces and datatypes */
herr_t status = H5LTread_dataset(f->$group$_group,
$GROUP_DSET$_NAME,
H5T_$GROUP_DSET_H5_DTYPE$,
$group_dset$);
if (status < 0) return TREXIO_FAILURE;
return TREXIO_SUCCESS;
}
#+end_src
#+begin_src c :tangle write_dset_data_hdf5.c