From 425aa398faf1bf28b21f92c63c94fcb587819aa0 Mon Sep 17 00:00:00 2001 From: theogdoctorg Date: Fri, 15 Dec 2023 16:33:01 -0800 Subject: [PATCH] fixing compilation issue if hdf5 package is not installed/linked properly, where hdf5 variables are undefined. --- src/h5file.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/h5file.cpp b/src/h5file.cpp index dcd048311..82e0d4906 100644 --- a/src/h5file.cpp +++ b/src/h5file.cpp @@ -693,14 +693,18 @@ static void _write_chunk(hid_t data_id, h5file::extending_s *cur, int rank, void h5file::write_chunk(int rank, const size_t *chunk_start, const size_t *chunk_dims, float *data) { + #ifdef HAVE_HDF5 // attempting to fix error with "H5T_NATIVE_FLOAT" not defined _write_chunk(HID(cur_id), get_extending(cur_dataname), rank, chunk_start, chunk_dims, H5T_NATIVE_FLOAT, data); + #endif } void h5file::write_chunk(int rank, const size_t *chunk_start, const size_t *chunk_dims, double *data) { + #ifdef HAVE_HDF5 // attempting to fix error with "H5T_NATIVE_DOUBLE" not defined _write_chunk(HID(cur_id), get_extending(cur_dataname), rank, chunk_start, chunk_dims, H5T_NATIVE_DOUBLE, data); + #endif } void h5file::write_chunk(int rank, const size_t *chunk_start, const size_t *chunk_dims, @@ -835,12 +839,16 @@ static void _read_chunk(hid_t data_id, int rank, const size_t *chunk_start, void h5file::read_chunk(int rank, const size_t *chunk_start, const size_t *chunk_dims, float *data) { + #ifdef HAVE_HDF5 // attempting to fix error with "H5T_NATIVE_FLOAT" not defined _read_chunk(HID(cur_id), rank, chunk_start, chunk_dims, H5T_NATIVE_FLOAT, data); + #endif } void h5file::read_chunk(int rank, const size_t *chunk_start, const size_t *chunk_dims, double *data) { + #ifdef HAVE_HDF5 _read_chunk(HID(cur_id), rank, chunk_start, chunk_dims, H5T_NATIVE_DOUBLE, data); + #endif } void h5file::read_chunk(int rank, const size_t *chunk_start, const size_t *chunk_dims,