Skip to content

Commit

Permalink
Merge commit '616c34e6a05d6ab1ca20cfeb8cf9a00a89c5af60' into update-p…
Browse files Browse the repository at this point in the history
…lugins
  • Loading branch information
t20100 committed Sep 4, 2023
2 parents 4df0f23 + 616c34e commit eb0bc64
Show file tree
Hide file tree
Showing 123 changed files with 2,311 additions and 1,041 deletions.
9 changes: 4 additions & 5 deletions src/c-blosc2/ANNOUNCE.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
# Announcing C-Blosc2 2.9.2
# Announcing C-Blosc2 2.10.2
A fast, compressed and persistent binary data store library for C.

## What is new?

This a maintenance release with improved support for dynamic plugins and
fixes for some corner cases when handling incompressible data. Also,
many other small fixes and improvements have been included. An upgrade to
this release is recommended.
This is a maintenance release with also several improvements for helping
integration of C-Blosc2 in other projects (thanks to Alex Huebl). Also,
some fixes for MinGW platform are in (thanks to Biswapriyo Nath).

For more info, please see the release notes in:

Expand Down
84 changes: 84 additions & 0 deletions src/c-blosc2/Blosc2Config.cmake.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
# only add PUBLIC dependencies as well
# https://cmake.org/cmake/help/latest/manual/cmake-packages.7.html#creating-a-package-configuration-file
include(CMakeFindDependencyMacro)

# Search in <PackageName>_ROOT:
# https://cmake.org/cmake/help/v3.12/policy/CMP0074.html
if(POLICY CMP0074)
cmake_policy(SET CMP0074 NEW)
endif()

# locate the installed FindABC.cmake modules
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/Modules")

# this section stores which configuration options were set
set(HAVE_THREADS @Threads_FOUND@)
set(HAVE_IPP @HAVE_IPP@)
set(HAVE_ZLIB_NG @HAVE_ZLIB_NG@)
set(DEACTIVATE_IPP @DEACTIVATE_IPP@)
set(DEACTIVATE_ZLIB @DEACTIVATE_ZLIB@)
set(DEACTIVATE_ZSTD @DEACTIVATE_ZSTD@)
set(PREFER_EXTERNAL_LZ4 @PREFER_EXTERNAL_LZ4@)
set(PREFER_EXTERNAL_ZLIB @PREFER_EXTERNAL_ZLIB@)
set(PREFER_EXTERNAL_ZSTD @PREFER_EXTERNAL_ZSTD@)

# find dependencies and their targets, which are used in our Blosc2Targets.cmake
# additionally, the Blosc2_..._FOUND variables are used to support
# find_package(Blosc2 ... COMPONENTS ... ...)
# this enables downstream projects to express the need for specific features.
if(WIN32)
if(HAVE_THREADS)
find_dependency(Threads)
set(Blosc2_THREADS_FOUND TRUE)
else()
set(Blosc2_THREADS_FOUND FALSE)
endif()
else()
find_dependency(Threads)
set(Blosc2_THREADS_FOUND TRUE)
endif()

if(NOT DEACTIVATE_IPP AND HAVE_IPP)
find_dependency(IPP)
set(Blosc2_IPP_FOUND FALSE)
else()
set(Blosc2_IPP_FOUND TRUE)
endif()

if(PREFER_EXTERNAL_LZ4)
find_dependency(LZ4)
endif()
set(Blosc2_LZ4_FOUND TRUE)

if(DEACTIVATE_ZLIB)
set(Blosc2_ZLIB_FOUND FALSE)
elseif(NOT DEACTIVATE_ZLIB AND PREFER_EXTERNAL_ZLIB)
if(HAVE_ZLIB_NG)
find_dependency(ZLIB_NG)
else()
find_dependency(ZLIB)
endif()
set(Blosc2_ZLIB_FOUND TRUE)
endif()

if(DEACTIVATE_ZSTD)
set(Blosc2_ZSTD_FOUND FALSE)
elseif(NOT PREFER_EXTERNAL_ZSTD AND PREFER_EXTERNAL_ZSTD)
find_dependency(ZSTD)
set(Blosc2_ZSTD_FOUND TRUE)
endif()

# define central Blosc2::blosc2_shared/static targets
include("${CMAKE_CURRENT_LIST_DIR}/Blosc2Targets.cmake")

# check if components are fulfilled and set Blosc2_<COMPONENT>_FOUND vars
# Blosc2_FIND_COMPONENTS is a list set by find_package(... COMPONENTS ... ...)
# likewise Blosc2_FIND_REQUIRED_... per component specified
foreach(comp ${Blosc2_FIND_COMPONENTS})
if(NOT Blosc2_${comp}_FOUND)
if(Blosc2_FIND_REQUIRED_${comp})
set(Blosc2_FOUND FALSE)
endif()
endif()
endforeach()

139 changes: 121 additions & 18 deletions src/c-blosc2/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ endif()

# Propagate CMAKE_OSX_ARCHITECTURES env variable into CMAKE_SYSTEM_PROCESSOR
if(DEFINED ENV{CMAKE_OSX_ARCHITECTURES})
if($ENV{CMAKE_OSX_ARCHITECTURES} STREQUAL "arm64")
if("$ENV{CMAKE_OSX_ARCHITECTURES}" STREQUAL "arm64")
set(CMAKE_SYSTEM_PROCESSOR arm64)
endif()
endif()
Expand Down Expand Up @@ -385,23 +385,6 @@ if(NOT DEFINED BLOSC_INSTALL)
endif()
endif()

# uninstall target
if(BLOSC_INSTALL)
include(GNUInstallDirs)
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/blosc2.pc.in"
"${CMAKE_CURRENT_BINARY_DIR}/blosc2.pc"
@ONLY)
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/blosc2.pc"
DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig" COMPONENT DEV)
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
@ONLY)
add_custom_target(uninstall
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake)
endif()

# include directories
include_directories(include)
if(BUILD_PLUGINS)
Expand Down Expand Up @@ -440,6 +423,126 @@ if(BUILD_EXAMPLES)
add_subdirectory(examples)
endif()

# collecting SOURCES is now complete
if(BUILD_SHARED)
target_sources(blosc2_shared PRIVATE ${SOURCES})
endif()
if(BUILD_STATIC)
target_sources(blosc2_static PRIVATE ${SOURCES})
endif()
if(BUILD_TESTS)
target_sources(blosc_testing PRIVATE ${SOURCES})
endif()

# install targets
if(BLOSC_INSTALL)
include(GNUInstallDirs)

# C++ files
install(FILES ${PROJECT_SOURCE_DIR}/include/blosc2.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} COMPONENT DEV)
install(FILES ${PROJECT_SOURCE_DIR}/include/b2nd.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} COMPONENT DEV)
install(FILES
${PROJECT_SOURCE_DIR}/include/blosc2/blosc2-export.h
${PROJECT_SOURCE_DIR}/include/blosc2/blosc2-common.h
${PROJECT_SOURCE_DIR}/include/blosc2/blosc2-stdio.h
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/blosc2 COMPONENT DEV)
if(BUILD_PLUGINS)
install(FILES
${PROJECT_SOURCE_DIR}/include/blosc2/filters-registry.h
${PROJECT_SOURCE_DIR}/include/blosc2/codecs-registry.h
${PROJECT_SOURCE_DIR}/include/blosc2/tuners-registry.h
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/blosc2 COMPONENT DEV)
endif()

if(BUILD_SHARED)
install(TARGETS blosc2_shared
LIBRARY COMPONENT LIB
ARCHIVE COMPONENT DEV
RUNTIME COMPONENT LIB)
endif()
if(BUILD_STATIC)
install(TARGETS blosc2_static COMPONENT DEV)
endif()

# config files
include(CMakePackageConfigHelpers)

# we need a general location for Unix and Windows to install our
# Blosc2Config.cmake files to. This is defined in CMake:
# https://cmake.org/cmake/help/latest/command/find_package.html#config-mode-search-procedure
if(NOT Blosc2_INSTALL_CMAKEDIR)
if(CMAKE_INSTALL_CMAKEDIR)
set(Blosc2_INSTALL_CMAKEDIR "${CMAKE_INSTALL_CMAKEDIR}/Blosc2")
else()
if(WIN32 AND NOT MINGW)
set(Blosc2_INSTALL_CMAKEDIR "cmake")
else()
set(Blosc2_INSTALL_CMAKEDIR "${CMAKE_INSTALL_LIBDIR}/cmake/Blosc2")
endif()
endif()
endif()

# CMake config file
# This stores our targets and find and populates the targets we depend on,
# including third party interface libraries that we added.
set(Blosc2_INSTALL_TARGET_NAMES)
if(BUILD_SHARED)
list(APPEND Blosc2_INSTALL_TARGET_NAMES blosc2_shared)
endif()
if(BUILD_STATIC)
list(APPEND Blosc2_INSTALL_TARGET_NAMES blosc2_static)
endif()
configure_file(
${PROJECT_SOURCE_DIR}/Blosc2Config.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/Blosc2Config.cmake
@ONLY
)
install(TARGETS ${Blosc2_INSTALL_TARGET_NAMES}
EXPORT Blosc2Targets
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
)
install(EXPORT Blosc2Targets
FILE Blosc2Targets.cmake
NAMESPACE Blosc2::
DESTINATION ${Blosc2_INSTALL_CMAKEDIR}
)
write_basic_package_version_file("Blosc2ConfigVersion.cmake"
VERSION ${BLOSC2_VERSION_STRING}
COMPATIBILITY SameMajorVersion
)
install(
FILES
${CMAKE_CURRENT_BINARY_DIR}/Blosc2Config.cmake
${CMAKE_CURRENT_BINARY_DIR}/Blosc2ConfigVersion.cmake
DESTINATION ${Blosc2_INSTALL_CMAKEDIR}
)

# CMake Find*.cmake files used in Blosc2Config.cmake
install(
DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/cmake/
DESTINATION ${Blosc2_INSTALL_CMAKEDIR}/Modules
)

# pkg-config .pc file
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/blosc2.pc.in"
"${CMAKE_CURRENT_BINARY_DIR}/blosc2.pc"
@ONLY)
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/blosc2.pc"
DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig" COMPONENT DEV)

# uninstaller
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
@ONLY)
add_custom_target(uninstall
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake)
endif()


# packaging
if(NOT BLOSC_IS_SUBPROJECT)
Expand Down
17 changes: 16 additions & 1 deletion src/c-blosc2/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ New features in C-Blosc2

* **More filters:** besides `shuffle` and `bitshuffle` already present in C-Blosc1, C-Blosc2 already implements:

- `bytedelta`: calculates the difference between bytes in a block that has been shuffle already. We have `blogged about bytedelta <https://www.blosc.org/posts/bytedelta-enhance-compression-toolset/>`_.
- `bytedelta`: calculates the difference between bytes in a block that has been shuffled already. We have `blogged about bytedelta <https://www.blosc.org/posts/bytedelta-enhance-compression-toolset/>`_.

- `delta`: the stored blocks inside a chunk are diff'ed with respect to first block in the chunk. The idea is that, in some situations, the diff will have more zeros than the original data, leading to better compression.

Expand Down Expand Up @@ -227,6 +227,21 @@ Tweeter feed
Follow `@Blosc2 <https://twitter.com/Blosc2>`_ so as to get informed about the latest developments.


Citing Blosc
============

You can cite our work on the different libraries under the Blosc umbrella as:

.. code-block:: console
@ONLINE{blosc,
author = {{Blosc Development Team}},
title = "{A fast, compressed and persistent data store library}",
year = {2009-2023},
note = {https://blosc.org}
}
Acknowledgments
===============

Expand Down
6 changes: 3 additions & 3 deletions src/c-blosc2/README_CHUNK_FORMAT.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ A regular chunk is composed of a header and a blocks section::

Also, there are the so-called lazy chunks that do not have the actual compressed data,
but only metainformation about how to read it. Lazy chunks typically appear when reading
data from persistent media. A lazy chunk has the header and bstarts sections in place
and in addition, they have an additional trailer for allowing to read the data blocks::
data from persistent media. A lazy chunk has header and bstarts sections in place and
in addition, an additional trailer for allowing to read the data blocks::

+---------+---------+---------+
| header | bstarts | trailer |
Expand Down Expand Up @@ -184,7 +184,7 @@ compression, and finally a list of compressed data streams::
| bstarts | dict | streams |
+=========+======+=========+

Each block is equal-sized as specified by the `blocksize` header field. The size of the last block that can be shorter
Each block is equal-sized as specified by the `blocksize` header field. The size of the last block can be shorter
or equal to the rest.

**Block starts**
Expand Down
57 changes: 57 additions & 0 deletions src/c-blosc2/RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,63 @@
Release notes for C-Blosc2
==========================

Changes from 2.10.1 to 2.10.2
=============================

* Several fixes for the CMake system. Thanks to Axel Huebl. See PR #541 and #542.

* Several fixes for mingw plaform. Thanks to Biswapriyo Nath. See PR #540 and #543.


Changes from 2.10.0 to 2.10.1
=============================

* `blosc2_remove_urlpath(const char *urlpath)` does not return an error
when path does not exist.

* Changes in CMake installer to conserve targets and properties
on install, so CMake users do not need to write `FindBlosc2.cmake`
files anymore. This also helps to preserve transitive dependencies on
CMake targets, especially useful for fully static builds, e.g., for
Python wheels. Thanks to @ax3l (Axel Huebl). See PR #537.

* Fix new typos. Thanks to @DimitriPapadopoulos. See PR #538.


Changes from 2.9.3 to 2.10.0
============================

* bytedelta filter has been fixed. For backward compatibility, the old
bytedelta filter is still available as `BLOSC_FILTER_BYTEDELTA_BUGGY`
symbol, with the same ID (34) than before. The new, fixed bytedelta
filter has received a new ID (35) and it can be used via the usual
`BLOSC_FILTER_BYTEDELTA` symbol. That means that old data written with
the buggy bytedelta filter should be decompressed without issues.
Thanks to @foody (Tom Birch) for the fix. See #531, #532 for more info.

* Filter buffers are correctly cycled now. Now it is possible to use e.g.
shuffle and bitshuffle filters in the pipeline. Thanks to @foody (Tom Birch)
for the fix. See #528 and PR #530.

* Assorted fixes for allowing better inclusion in external projects.
Thanks to @ax3l (Axel Huebel). See #525, #527 and #529.

* Minor fixes in the documentation. Thanks to @ivilata (Ivan Vilata).
See #523.


Changes from 2.9.2 to 2.9.3
===========================

* Thanks to Dimitri Papadopoulos for an extensive set of improvements in
documentation and code.

* `load_lib` is now a private function. Before was public, but
never meant to be.

* Several fixes for bugs discovered by the fuzzer.


Changes from 2.9.1 to 2.9.2
===========================

Expand Down
3 changes: 1 addition & 2 deletions src/c-blosc2/RELEASING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,7 @@ Post-release actions
version to the next minor one (i.e. X.Y.Z --> X.Y.(Z+1).dev).

- Create new headers for adding new features in ``RELEASE_NOTES.md``
and empty the release-specific information in ``ANNOUNCE.md`` and
add this place-holder instead:
and add this place-holder instead:

#XXX version-specific blurb XXX#

Expand Down
4 changes: 3 additions & 1 deletion src/c-blosc2/THANKS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,6 @@ Thanks

* Nathan Moinvaziri for his outstanding work on the security side of the things via `fuzzer testing <https://google.github.io/oss-fuzz/>`_.

* Marta Iborra for her implementation of sparse storage for persistent super-chunks.
* Marta Iborra for her implementation of sparse storage for persistent super-chunks and her attention to detail in many other aspects of the library.

* Dimitri Papadopoulos for an extensive set of improvements in documentation and code.
Loading

0 comments on commit eb0bc64

Please sign in to comment.