From 70a7c2bf008b3ab915374aa614d90014f210f592 Mon Sep 17 00:00:00 2001 From: Thomas VINCENT Date: Thu, 4 Jul 2024 10:06:59 +0200 Subject: [PATCH] Squashed 'src/hdf5-blosc/' changes from bd8ee59..949947a 949947a Update release notes for 1.0.1 e2f7493 Merge pull request #17 from zayfod/master aaae50a Merge pull request #33 from lgarrison/fix-cmake-libdir ba20858 cmake: fix build on systems where the libdir is lib64 9683f7d Merge pull request #24 from bhawkins/fix-link c0d81ef Merge pull request #32 from matchy233/fix/warnings cd04690 Merge pull request #31 from mkitti/master 526e3f4 Fix warnings related to const for blosc_filter.c b80cacd Fix branch name of c-blosc repository in CMakeLists ff32d8a Allow for HDF5_ROOT and set blosc tag to main ec0d1ab Fix link to HDF5 docs. 6d60f33 Added freeing of memory, allocated by register_blosc(). git-subtree-dir: src/hdf5-blosc git-subtree-split: 949947a5516bb987570c900c51866a7a50fb2dd7 --- CMakeLists.txt | 7 +++++-- README.rst | 2 +- RELEASE_NOTES.txt | 9 +++++++++ src/blosc_filter.c | 4 ++-- src/example.c | 2 ++ 5 files changed, 19 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f3de7671..9ec0f23e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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 @@ -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) @@ -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} ) @@ -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) diff --git a/README.rst b/README.rst index 671c1e1f..7ca47384 100644 --- a/README.rst +++ b/README.rst @@ -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 `_, you just need to compile the Blosc plugin into a shared library and +As described in the `HDF5 plugin documentation `_, 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 diff --git a/RELEASE_NOTES.txt b/RELEASE_NOTES.txt index d260d37f..fcbab152 100644 --- a/RELEASE_NOTES.txt +++ b/RELEASE_NOTES.txt @@ -6,6 +6,15 @@ :Contact: francesc@blosc.org :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 =========================== diff --git a/src/blosc_filter.c b/src/blosc_filter.c index bfd8c3eb..a099e2d3 100644 --- a/src/blosc_filter.c +++ b/src/blosc_filter.c @@ -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 */ diff --git a/src/example.c b/src/example.c index f06d4119..0e0f184a 100644 --- a/src/example.c +++ b/src/example.c @@ -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;