Skip to content

Commit

Permalink
Merge pull request #310 from t20100/update-dependencies
Browse files Browse the repository at this point in the history
Updated embedded filters: LZ4 (commit 49e3b65), hdf5-blosc (v1.0.1), SZ (commit f466775); Updated library: Snappy (v1.2.1)
  • Loading branch information
kif authored Jul 5, 2024
2 parents 19663d7 + 68534d0 commit 8e9e3cb
Show file tree
Hide file tree
Showing 26 changed files with 708 additions and 91 deletions.
10 changes: 5 additions & 5 deletions doc/information.rst
Original file line number Diff line number Diff line change
Expand Up @@ -68,22 +68,22 @@ HDF5 filters and compression libraries
HDF5 compression filters and compression libraries sources were obtained from:

* `LZ4 plugin <https://github.com/nexusformat/HDF5-External-Filter-Plugins>`_
(commit `d48f960 <https://github.com/nexusformat/HDF5-External-Filter-Plugins/tree/d48f96064cb6e229ede4bf5e5c0e1935cf691036>`_)
(commit `49e3b65 <https://github.com/nexusformat/HDF5-External-Filter-Plugins/tree/49e3b65eca772bca77af13ba047d8b577673afba>`_)
using LZ4.
* `bitshuffle plugin <https://github.com/kiyo-masui/bitshuffle>`_ (v0.5.1) using LZ4 and ZStd.
* bzip2 plugin (from `PyTables <https://github.com/PyTables/PyTables/>`_ v3.9.2)
using `BZip2 <https://sourceware.org/git/bzip2.git>`_ (v1.0.8).
* `hdf5-blosc plugin <https://github.com/Blosc/hdf5-blosc>`_ (v1.0.0)
* `hdf5-blosc plugin <https://github.com/Blosc/hdf5-blosc>`_ (v1.0.1)
using `c-blosc <https://github.com/Blosc/c-blosc>`_ (v1.21.5), LZ4, Snappy, ZLib and ZStd.
* hdf5-blosc2 plugin (from `PyTables <https://github.com/PyTables/PyTables/>`_ v3.9.2)
using `c-blosc2 <https://github.com/Blosc/c-blosc2>`_ (v2.13.2), LZ4, ZLib and ZStd.
* `FCIDECOMP plugin <ftp://ftp.eumetsat.int/pub/OPS/out/test-data/Test-data-for-External-Users/MTG_FCI_Test-Data/FCI_Decompression_Software_V1.0.2>`_ (v1.0.2)
using `CharLS <https://github.com/team-charls/charls>`_
(1.x branch, commit `25160a4 <https://github.com/team-charls/charls/tree/25160a42fb62e71e4b0ce081f5cb3f8bb73938b5>`_).
* `SZ plugin <https://github.com/szcompressor/SZ>`_
(commit `c25805c12b3 <https://github.com/szcompressor/SZ/commit/c25805c12b339d2cb2f406f95293b9a7313c4fb1>`_)
* `H5Z-SPERR plugin <https://github.com/NCAR/H5Z-SPERR>`_ (v0.1.3) using `SPERR <https://github.com/NCAR/SPERR>`_ (v0.8.1).
(commit `f466775 <https://github.com/szcompressor/SZ/tree/f4667759ead6a902110e80ff838ccdfddbc8dcd7>`_)
using `SZ <https://github.com/szcompressor/SZ>`_, ZLib and ZStd.
* `H5Z-SPERR plugin <https://github.com/NCAR/H5Z-SPERR>`_ (v0.1.3) using `SPERR <https://github.com/NCAR/SPERR>`_ (v0.8.1).
* `SZ3 plugin <https://github.com/szcompressor/SZ3>`_
(commit `4bbe9df7e4bcb <https://github.com/szcompressor/SZ3/commit/4bbe9df7e4bcb6ae6339fcb3033100da07fe7434>`_)
using `SZ3 <https://github.com/szcompressor/SZ3>`_ and ZStd.
Expand All @@ -95,7 +95,7 @@ HDF5 compression filters and compression libraries sources were obtained from:
Sources of compression libraries shared accross multiple filters were obtained from:

* `LZ4 v1.9.4 <https://github.com/Blosc/c-blosc2/tree/v2.13.2/internal-complibs/lz4-1.9.4>`_
* `Snappy v1.1.10 <https://github.com/google/snappy>`_
* `Snappy v1.2.1 <https://github.com/google/snappy>`_
* `ZStd v1.5.5 <https://github.com/Blosc/c-blosc2/tree/v2.13.2/internal-complibs/zstd-1.5.5>`_
* `ZLib v1.2.13 <https://github.com/Blosc/c-blosc/tree/v1.21.5/internal-complibs/zlib-1.2.13>`_

Expand Down
3 changes: 2 additions & 1 deletion src/LZ4/COPYING
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

Copyright Notice and License Terms for
HDF5 LZ4 compression filter plugin
-----------------------------------------------------------------------------
Expand Down Expand Up @@ -56,4 +57,4 @@ Source code of the HDF5 LZ4 filter is based on h5py implementation found in
Additional_Legal/h5py_Copyrights_and_Licenses.txt
Original source:
http://docs.h5py.org/en/latest/licenses.html
License type: BSD-style license
License type: BSD-style license
2 changes: 1 addition & 1 deletion src/LZ4/lz4_h5filter.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@


#ifndef LZ4_H5FILTER_H
#define LZ5_H5FILTER_H
#define LZ4_H5FILTER_H

#define H5Z_class_t_vers 2
#include "hdf5.h"
Expand Down
20 changes: 16 additions & 4 deletions src/SZ/sz/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,23 @@ set_target_properties (SZ PROPERTIES
OUTPUT_NAME_RELWITHDEBINFO ${LIB_RELEASE_NAME}
)

target_link_libraries (SZ PUBLIC ${ZLIB_dep} ${ZSTD_dep} m)
if (WIN32 AND NOT MINGW)
target_link_libraries (SZ PUBLIC ${ZLIB_dep} ${ZSTD_dep})
else ()
target_link_libraries (SZ PUBLIC ${ZLIB_dep} ${ZSTD_dep} m)
endif ()

target_compile_options(SZ
PRIVATE $<$<CONFIG:Debug>:-Wall -Wextra -Wpedantic -Wno-unused-parameter>
)
if (WIN32 AND NOT MINGW)
message(STATUS "Native windows compiler detected, adding compile flags")
target_compile_options(SZ
PRIVATE $<$<CONFIG:Debug>:-Wall>
)
else ()
message(STATUS "GCC detected, adding compile flags")
target_compile_options(SZ
PRIVATE $<$<CONFIG:Debug>:-Wall -Wextra -Wpedantic -Wno-unused-parameter>
)
endif()

if(BUILD_OPENMP)
target_link_libraries(SZ PRIVATE OpenMP::OpenMP_C)
Expand Down
11 changes: 10 additions & 1 deletion src/SZ/sz/src/sz.c
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,16 @@ unsigned char *SZ_compress_rev(int dataType, void *data, void *reservedValue, si

void *SZ_decompress(int dataType, unsigned char *bytes, size_t byteLength, size_t r5, size_t r4, size_t r3, size_t r2, size_t r1)
{
if(confparams_dec==NULL)
//correct dimension if needed
size_t _r[5];
filterDimension(r5, r4, r3, r2, r1, _r);
r5 = _r[4];
r4 = _r[3];
r3 = _r[2];
r2 = _r[1];
r1 = _r[0];

if(confparams_dec==NULL)
confparams_dec = (sz_params*)malloc(sizeof(sz_params));
memset(confparams_dec, 0, sizeof(sz_params));
if(exe_params==NULL)
Expand Down
4 changes: 4 additions & 0 deletions src/SZ/zlib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ else ()
set (BUILD_EXT_LIBS_TYPE "STATIC")
endif ()

if (WIN32 AND NOT MINGW)
set (BUILD_EXT_LIBS_TYPE "STATIC")
endif ()

add_library(ZLIB ${BUILD_EXT_LIBS_TYPE}
./gzclose.c
./uncompr.c
Expand Down
4 changes: 4 additions & 0 deletions src/SZ/zstd/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ else ()
set (BUILD_EXT_LIBS_TYPE "STATIC")
endif ()

if (WIN32 AND NOT MINGW)
set (BUILD_EXT_LIBS_TYPE "STATIC")
endif ()

add_library(zstd ${BUILD_EXT_LIBS_TYPE}
./common/entropy_common.c
./common/pool.c
Expand Down
7 changes: 5 additions & 2 deletions src/hdf5-blosc/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
cmake_minimum_required(VERSION 2.8.10)
cmake_policy(SET CMP0074 NEW)
project(blosc_hdf5)
include(ExternalProject)
include(GNUInstallDirs)

# options
option(BUILD_TESTS
Expand All @@ -9,7 +11,7 @@ option(BUILD_TESTS
option(BUILD_PLUGIN
"Build dynamically loadable plugin for HDF5 version > 1.8.11" ON)
if(BUILD_PLUGIN)
set(PLUGIN_INSTALL_PATH "/usr/local/hdf5/lib/plugin" CACHE PATH
set(PLUGIN_INSTALL_PATH "/usr/local/hdf5/lib/plugin" CACHE PATH
"Where to install the dynamic HDF5-plugin")
endif(BUILD_PLUGIN)

Expand All @@ -25,6 +27,7 @@ message("GIT_EXECUTABLE='${GIT_EXECUTABLE}'")
ExternalProject_Add(project_blosc
PREFIX ${BLOSC_PREFIX}
GIT_REPOSITORY https://github.com/Blosc/c-blosc.git
GIT_TAG main
INSTALL_DIR ${BLOSC_INSTALL_DIR}
CMAKE_ARGS ${BLOSC_CMAKE_ARGS}
)
Expand Down Expand Up @@ -52,7 +55,7 @@ include_directories(${HDF5_INCLUDE_DIRS})

# add blosc libraries
add_library(blosc_shared SHARED IMPORTED)
set_property(TARGET blosc_shared PROPERTY IMPORTED_LOCATION ${BLOSC_INSTALL_DIR}/lib/${CMAKE_SHARED_LIBRARY_PREFIX}blosc${CMAKE_SHARED_LIBRARY_SUFFIX})
set_property(TARGET blosc_shared PROPERTY IMPORTED_LOCATION ${BLOSC_INSTALL_DIR}/${CMAKE_INSTALL_LIBDIR}/${CMAKE_SHARED_LIBRARY_PREFIX}blosc${CMAKE_SHARED_LIBRARY_SUFFIX})
add_dependencies(blosc_shared project_blosc)
include_directories(${BLOSC_INSTALL_DIR}/include)

Expand Down
2 changes: 1 addition & 1 deletion src/hdf5-blosc/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Instead of just linking this Blosc filter into your HDF5 application, it is poss
it as a system-wide HDF5 plugin (with HDF5 1.8.11 or later). This is useful because it allows
*every* HDF5-using program on your system to transparently read Blosc-compressed HDF5 files.

As described in the `HDF5 plugin documentation <https://www.hdfgroup.org/HDF5/doc/Advanced/DynamicallyLoadedFilters/HDF5DynamicallyLoadedFilters.pdf>`_, you just need to compile the Blosc plugin into a shared library and
As described in the `HDF5 plugin documentation <https://portal.hdfgroup.org/display/HDF5/HDF5+Dynamically+Loaded+Filters>`_, you just need to compile the Blosc plugin into a shared library and
copy it to the plugin directory (which defaults to ``/usr/local/hdf5/lib/plugin`` on non-Windows systems).

Following the ``cmake`` instructions below produces a ``libH5Zblosc.so`` shared library
Expand Down
9 changes: 9 additions & 0 deletions src/hdf5-blosc/RELEASE_NOTES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,15 @@
:Contact: [email protected]
:URL: http://www.blosc.org

Changes from 1.0.0 to 1.0.1
===========================

- Fix warnings related to const for blosc_filter.c. Thanks to
@matchy233. Closes #34.

- Fix build on systems where the libdir is lib64 instead of lib. Thanks to
Lehman Garrison.


Changes from 0.0.1 to 1.0.0
===========================
Expand Down
4 changes: 2 additions & 2 deletions src/hdf5-blosc/src/blosc_filter.c
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,8 @@ size_t blosc_filter(unsigned flags, size_t cd_nelmts,
int doshuffle = 1; /* Shuffle default */
int compcode; /* Blosc compressor */
int code;
char* compname = "blosclz"; /* The compressor by default */
char* complist;
const char* compname = "blosclz"; /* The compressor by default */
const char* complist;
char errmsg[256];

/* Filter params that are always set */
Expand Down
2 changes: 2 additions & 0 deletions src/hdf5-blosc/src/example.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ int main(){
/* Register the filter with the library */
r = register_blosc(&version, &date);
printf("Blosc version info: %s (%s)\n", version, date);
free(version);
free(date);

if(r<0) goto failed;

Expand Down
2 changes: 2 additions & 0 deletions src/snappy/.bazelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# googletest requires C++14 or above
build --cxxopt='-std=c++17'
1 change: 1 addition & 0 deletions src/snappy/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@

# Build directory.
build/
/bazel-*
out/
Loading

0 comments on commit 8e9e3cb

Please sign in to comment.