diff --git a/CMakeLists.txt b/CMakeLists.txt index c7a3c2285f..12eed0fbd6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -24,7 +24,7 @@ if(WIN32) set(ARMADILLO_LIBRARY_DIRS "C:/linalg/bin") elseif(UNIX) - set(HDF5_ROOT /usr/local/ /usr) # there maybe more upto date library in these places + #set(HDF5_ROOT /usr/local/ /usr) # there maybe more upto date library in these places include(GNUInstallDirs) find_package(PkgConfig REQUIRED QUIET) endif() @@ -36,8 +36,9 @@ if(ANDROID) endif() include(FindHDF5) +#find_package(HDF5 REQUIRED) if(HDF5_VERSION VERSION_LESS ${H5CPP_VERSION}) - message(FATAL_ERROR "-- !!! H5CPP examples require of HDF5 v${H5CPP_VERSION} or greater!!!") + message(FATAL_ERROR "-- !!! H5CPP examples require of HDF5 v${H5CPP_VERSION} or greater!!! Found version ${HDF5_VERSION}") else() message("-- H5CPP ${PROJECT_VERSION} matches with minimum required HDF5 v${HDF5_VERSION}") endif() diff --git a/h5cpp/H5Zpipeline_basic.hpp b/h5cpp/H5Zpipeline_basic.hpp index 8bce47cce5..91b648619d 100644 --- a/h5cpp/H5Zpipeline_basic.hpp +++ b/h5cpp/H5Zpipeline_basic.hpp @@ -38,22 +38,35 @@ inline void h5::impl::basic_pipeline_t::read_chunk_impl( const hsize_t* offset, size_t length = nbytes; // filter may changed this, think of compression void *in = chunk0, *out=chunk1, *tmp = chunk1; // invariant: out must point to data block written uint32_t filter_mask; + [[ maybe-unused ]] size_t chunk_length = block_size; // for(int i=0; i<9; i++) // std::cout << ((short*) in)[i] << " "; // std::cout<<"\n"; switch( tail ){ // tail = index pointing to queue holding filters - case 0: // no filters, ( if blocking ) -> data == chunk0 otherwise directly from container - H5Dread_chunk(ds, dxpl, offset, &filter_mask, chunk0); + case 0: // no filters, ( if blocking ) -> data == chunk0 otherwise directly from container + #ifdef H5Dread_chunk + H5Dread_chunk(ds, dxpl, offset, &filter_mask, chunk0, &chunk_length); + #else + H5Dread_chunk(ds, dxpl, offset, &filter_mask, chunk0); + #enfdif break; case 1: // single filter - H5Dread_chunk(ds, dxpl, offset, &filter_mask, chunk1); + #ifdef H5Dread_chunk + H5Dread_chunk(ds, dxpl, offset, &filter_mask, chunk1, &chunk_length); + #else + H5Dread_chunk(ds, dxpl, offset, &filter_mask, chunk1); + #endif length = filter[0](chunk0, chunk1, nbytes, flags[0], cd_size[0], cd_values[0] ); break; default: // more than one filter throw std::runtime_error("filters not implemented yet..."); if( tail % 2 ){ - H5Dread_chunk(ds, dxpl, offset, &filter_mask, chunk0); + #ifdef H5Dread_chunk + H5Dread_chunk(ds, dxpl, offset, &filter_mask, chunk0, &chunk_length); + #else + H5Dread_chunk(ds, dxpl, offset, &filter_mask, chunk0); + #endif for(int j=tail; j>0; j--){ // invariant: out == buffer holding final result tmp = in, in = out, out = tmp; length = filter[j](out,in,length, flags[j], cd_size[j], cd_values[j]);