diff --git a/.github/workflows/check-releases.yml b/.github/workflows/check-releases.yml new file mode 100644 index 00000000..bb235dc1 --- /dev/null +++ b/.github/workflows/check-releases.yml @@ -0,0 +1,178 @@ +name: hdf5 plugins check compression releases + +# Triggers the workflow on a call from another workflow +on: + workflow_call: + +jobs: + check-compression-releases: + runs-on: ubuntu-latest + steps: + - name: Get bitshuffle release version + id: get-bitshuffle-release + uses: cardinalby/git-get-release-action@v1 + env: + GITHUB_TOKEN: ${{ github.token }} + with: + repo: 'kiyo-masui/bitshuffle' + latest: true + + - name: Report bitshuffle release version + run: | + echo "BSHUF=${{ steps.get-bitshuffle-release.outputs.tag_name }}" >> $GITHUB_OUTPUT + + - name: Get blosc release version + id: get-blosc-release + uses: cardinalby/git-get-release-action@v1 + env: + GITHUB_TOKEN: ${{ github.token }} + with: + repo: 'Blosc/c-blosc' + latest: true + + - name: Report blosc release version + run: | + echo "BLOSC=${{ steps.get-blosc-release.outputs.tag_name }}" >> $GITHUB_OUTPUT + + - name: Get blosc2 release version + id: get-blosc2-release + uses: cardinalby/git-get-release-action@v1 + env: + GITHUB_TOKEN: ${{ github.token }} + with: + repo: 'Blosc/c-blosc2' + latest: true + + - name: Report blosc2 release version + run: | + echo "BLOSC2=${{ steps.get-blosc2-release.outputs.tag_name }}" >> $GITHUB_OUTPUT + +# - name: Get bzip2 release version +# id: get-bzip2-release +# uses: cardinalby/git-get-release-action@v1 +# env: +# GITHUB_TOKEN: ${{ github.token }} +# with: +# repo: 'libarchive/bzip2' +# latest: true +# +# - name: Report bzip2 release version +# run: | +# echo "BZIP2=bzip2: ${{ steps.get-bzip2-release.outputs.tag_name }}" >> $GITHUB_OUTPUT + + - name: Get fpzip release version + id: get-fpzip-release + uses: cardinalby/git-get-release-action@v1 + env: + GITHUB_TOKEN: ${{ github.token }} + with: + repo: 'LLNL/fpzip' + latest: true + + - name: Report fpzip release version + run: | + echo "FPZIP=${{ steps.get-fpzip-release.outputs.tag_name }}" >> $GITHUB_OUTPUT + + - name: Get libjpeg release version + id: get-libjpeg-release + uses: cardinalby/git-get-release-action@v1 + env: + GITHUB_TOKEN: ${{ github.token }} + with: + repo: 'libjpeg-turbo/libjpeg-turbo' + latest: true + + - name: Report libjpeg release version + run: | + echo "JPEG=${{ steps.get-libjpeg-release.outputs.tag_name }}" >> $GITHUB_OUTPUT + + - name: Get lz4 release version + id: get-lz4-release + uses: cardinalby/git-get-release-action@v1 + env: + GITHUB_TOKEN: ${{ github.token }} + with: + repo: 'lz4/lz4' + latest: true + + - name: Report lz4 release version + run: | + echo "LZ4=${{ steps.get-lz4-release.outputs.tag_name }}" >> $GITHUB_OUTPUT + + - name: Get zfp release version + id: get-zfp-release + uses: cardinalby/git-get-release-action@v1 + env: + GITHUB_TOKEN: ${{ github.token }} + with: + repo: 'LLNL/zfp' + latest: true + + - name: Report zfp release version + run: | + echo "ZFP=${{ steps.get-zfp-release.outputs.tag_name }}" >> $GITHUB_OUTPUT + + - name: Get zstd release version + id: get-zstd-release + uses: cardinalby/git-get-release-action@v1 + env: + GITHUB_TOKEN: ${{ github.token }} + with: + repo: 'facebook/zstd' + latest: true + + - name: Report zstd release version + run: | + echo "ZSTD=${{ steps.get-zstd-release.outputs.tag_name }}" >> $GITHUB_OUTPUT + + - name: Get zlib release version + id: get-zlib-release + uses: cardinalby/git-get-release-action@v1 + env: + GITHUB_TOKEN: ${{ github.token }} + with: + repo: 'madler/zlib' + latest: true + + - name: Report zlib release version + run: | + echo "ZLIB=${{ steps.get-zlib-release.outputs.tag_name }}" >> $GITHUB_OUTPUT + + - name: Get zlib-ng release version + id: get-zlib-ng-release + uses: cardinalby/git-get-release-action@v1 + env: + GITHUB_TOKEN: ${{ github.token }} + with: + repo: 'zlib-ng/zlib-ng' + latest: true + + - name: Report zlib-ng release version + run: | + echo "ZLIBNG=${{ steps.get-zlib-ng-release.outputs.tag_name }}" >> $GITHUB_OUTPUT + + - name: create-json + id: create-json + uses: jsdaniell/create-json@v1.2.3 + with: + name: "versions-file.json" + json: '{"bitshuffle":"${{ steps.get-bitshuffle-release.outputs.tag_name }}"", + "blosc":"${{ steps.get-blosc-release.outputs.tag_name }}" + "blosc2":"${{ steps.get-blosc2-release.outputs.tag_name }}" + "fpzip":"${{ steps.get-fpzip-release.outputs.tag_name }}" + "libjpeg":"${{ steps.get-libjpeg-release.outputs.tag_name }}" + "lz4":"${{ steps.get-lz4-release.outputs.tag_name }}" + "zfp":"${{ steps.get-zfp-release.outputs.tag_name }}" + "zstd":"${{ steps.get-zstd-release.outputs.tag_name }}" + "zlib":"${{ steps.get-zlib-release.outputs.tag_name }}" + "zlib-ng":"${{ steps.get-zlib-ng-release.outputs.tag_name }}" + }' + + # Save json report + - name: Save json report + uses: actions/upload-artifact@v4 + with: + name: compression-versions + path: versions-file.json + if-no-files-found: error # 'warn' or 'ignore' are also available, defaults to `warn` + diff --git a/.github/workflows/daily-build.yml b/.github/workflows/daily-build.yml index f02cfdb8..4f7fc822 100644 --- a/.github/workflows/daily-build.yml +++ b/.github/workflows/daily-build.yml @@ -121,3 +121,6 @@ jobs: use_environ: snapshots if: ${{ ((needs.call-workflow-tarball.outputs.has_changes == 'true') || (needs.get-base-names.outputs.run-ignore == 'ignore')) && (needs.get-old-names.outputs.hdf5-name != needs.call-workflow-tarball.outputs.file_base) }} + call-workflow-versions: + uses: ./.github/workflows/check-releases.yml + diff --git a/BLOSC/config/cmake/cacheinit.cmake b/BLOSC/config/cmake/cacheinit.cmake index 331371bc..08730a9f 100644 --- a/BLOSC/config/cmake/cacheinit.cmake +++ b/BLOSC/config/cmake/cacheinit.cmake @@ -27,7 +27,7 @@ set (BLOSC_GIT_URL "https://github.com/Blosc/c-blosc.git" CACHE STRING "Use BLOS set (BLOSC_GIT_BRANCH "master" CACHE STRING "" FORCE) set (BLOSC_TGZ_ORIGPATH "https://github.com/Blosc/c-blosc/archive/refs/tags" CACHE STRING "Use PLUGINS from original location" FORCE) -set (BLOSC_TGZ_NAME "c-blosc-1.21.5.tar.gz" CACHE STRING "Use BLOSC from compressed file" FORCE) +set (BLOSC_TGZ_NAME "c-blosc-1.21.6.tar.gz" CACHE STRING "Use BLOSC from compressed file" FORCE) set (BLOSC_PACKAGE_NAME "blosc" CACHE STRING "Name of BLOSC package" FORCE) set (H5BLOSC_CPACK_ENABLE ON CACHE BOOL "Enable the CPACK include and components" FORCE) diff --git a/BLOSC2/config/cmake/cacheinit.cmake b/BLOSC2/config/cmake/cacheinit.cmake index d44c429e..4196815f 100644 --- a/BLOSC2/config/cmake/cacheinit.cmake +++ b/BLOSC2/config/cmake/cacheinit.cmake @@ -27,7 +27,7 @@ set (BLOSC2_GIT_URL "https://github.com/Blosc/c-blosc2.git" CACHE STRING "Use BL set (BLOSC2_GIT_BRANCH "master" CACHE STRING "" FORCE) set (BLOSC2_TGZ_ORIGPATH "https://github.com/Blosc/c-blosc2/archive/refs/tags" CACHE STRING "Use PLUGINS from original location" FORCE) -set (BLOSC2_TGZ_NAME "c-blosc2-1.21.5.tar.gz" CACHE STRING "Use BLOSC2 from compressed file" FORCE) +set (BLOSC2_TGZ_NAME "c-blosc2-2.15.1.tar.gz" CACHE STRING "Use BLOSC2 from compressed file" FORCE) set (BLOSC2_PACKAGE_NAME "blosc2" CACHE STRING "Name of BLOSC2 package" FORCE) set (H5BLOSC2_CPACK_ENABLE ON CACHE BOOL "Enable the CPACK include and components" FORCE) diff --git a/BSHUF/config/cmake/cacheinit.cmake b/BSHUF/config/cmake/cacheinit.cmake index a36a19f6..b00a652e 100644 --- a/BSHUF/config/cmake/cacheinit.cmake +++ b/BSHUF/config/cmake/cacheinit.cmake @@ -28,8 +28,8 @@ set (BUILD_BSHUF_LZ4_LIBRARY_SOURCE ON CACHE BOOL "build the lz4 library within set (LZ4_GIT_URL "https://github.com/lz4/lz4.git" CACHE STRING "Use LZ4 from GitHub repository" FORCE) set (LZ4_GIT_BRANCH "dev" CACHE STRING "" FORCE) -set (LZ4_TGZ_ORIGPATH "https://github.com/lz4/lz4/releases/download/v1.9.4" CACHE STRING "Use PLUGINS from original location" FORCE) -set (LZ4_TGZ_NAME "lz4-1.9.4.tar.gz" CACHE STRING "Use LZ4 from compressed file" FORCE) +set (LZ4_TGZ_ORIGPATH "https://github.com/lz4/lz4/releases/download/v1.10.0" CACHE STRING "Use PLUGINS from original location" FORCE) +set (LZ4_TGZ_NAME "lz4-1.10.0.tar.gz" CACHE STRING "Use LZ4 from compressed file" FORCE) set (LZ4_PACKAGE_NAME "lz4" CACHE STRING "Name of LZ4 package" FORCE) diff --git a/CMakePresets.json b/CMakePresets.json index 2e53f37b..0ca939f4 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -30,11 +30,11 @@ "BUILD_BSHUF_LZ4_LIBRARY_SOURCE": "ON", "BSHUF_TGZ_NAME": {"type": "STRING", "value": "bitshuffle-0.5.1.tar.gz"}, "BSHUF_PACKAGE_NAME": {"type": "STRING", "value": "bshuf"}, - "BLOSC_TGZ_NAME": {"type": "STRING", "value": "c-blosc-1.21.5.tar.gz"}, + "BLOSC_TGZ_NAME": {"type": "STRING", "value": "c-blosc-1.21.6.tar.gz"}, "BLOSC_PACKAGE_NAME": {"type": "STRING", "value": "blosc"}, "BLOSC_ZLIB_TGZ_NAME": {"type": "STRING", "value": "zlib-1.3.tar.gz"}, "BLOSC_ZLIB_PACKAGE_NAME": {"type": "STRING", "value": "zlib"}, - "BLOSC2_TGZ_NAME": {"type": "STRING", "value": "c-blosc2-2.14.4.tar.gz"}, + "BLOSC2_TGZ_NAME": {"type": "STRING", "value": "c-blosc2-2.15.1.tar.gz"}, "BLOSC2_PACKAGE_NAME": {"type": "STRING", "value": "blosc2"}, "BLOSC2_ZLIB_TGZ_NAME": {"type": "STRING", "value": "zlib-1.3.tar.gz"}, "BLOSC2_ZLIB_PACKAGE_NAME": {"type": "STRING", "value": "zlib"}, @@ -45,7 +45,7 @@ "JPEG_TGZ_NAME": {"type": "STRING", "value": "jpegsrc.v9e.tar.gz"}, "JPEG_PACKAGE_NAME": {"type": "STRING", "value": "jpeg"}, "BUILD_LZ4_LIBRARY_SOURCE": "ON", - "LZ4_TGZ_NAME": {"type": "STRING", "value": "lz4-1.9.4.tar.gz"}, + "LZ4_TGZ_NAME": {"type": "STRING", "value": "lz4-1.10.0.tar.gz"}, "LZ4_PACKAGE_NAME": {"type": "STRING", "value": "lz4"}, "LZF_TGZ_NAME": {"type": "STRING", "value": "liblzf-3.6.tar.gz"}, "LZF_PACKAGE_NAME": {"type": "STRING", "value": "lzf"}, @@ -53,7 +53,7 @@ "SZ_PACKAGE_NAME": {"type": "STRING", "value": "SZ"}, "ZFP_TGZ_NAME": {"type": "STRING", "value": "zfp-1.0.0.tar.gz"}, "ZFP_PACKAGE_NAME": {"type": "STRING", "value": "zfp"}, - "ZSTD_TGZ_NAME": {"type": "STRING", "value": "zstd-1.5.5.tar.gz"}, + "ZSTD_TGZ_NAME": {"type": "STRING", "value": "zstd-1.5.6.tar.gz"}, "ZSTD_PACKAGE_NAME": {"type": "STRING", "value": "zstd"} } }, diff --git a/LZ4/CMakeLists.txt b/LZ4/CMakeLists.txt index b49446ad..9df38d27 100644 --- a/LZ4/CMakeLists.txt +++ b/LZ4/CMakeLists.txt @@ -83,36 +83,33 @@ message (STATUS "H5LZ4 link libs: ${H5PL_LINK_LIBS}") #----------------------------------------------------------------------------- configure_file (${H5LZ4_RESOURCES_DIR}/config.h.in ${H5LZ4_BINARY_DIR}/lz4_config.h @ONLY) -INCLUDE_DIRECTORIES (${HDF5_INCLUDE_DIR}) - -option (BUILD_LZ4_LIBRARY_SOURCE "build the lz4 library within the plugin" ON) -if (NOT BUILD_LZ4_LIBRARY_SOURCE) - include (ExternalProject) - set (H5PL_ALLOW_EXTERNAL_SUPPORT "NO" CACHE STRING "Allow External Library Building (NO GIT TGZ)") - set_property (CACHE H5PL_ALLOW_EXTERNAL_SUPPORT PROPERTY STRINGS NO GIT TGZ) - if (H5PL_ALLOW_EXTERNAL_SUPPORT MATCHES "GIT" OR H5PL_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") - option (LZ4_USE_EXTERNAL "Use External Library Building for LZ4" 1) - if (H5PL_ALLOW_EXTERNAL_SUPPORT MATCHES "GIT") - set (LZ4_URL ${LZ4_GIT_URL} CACHE STRING "Path to lz4 git repository") - set (LZ4_BRANCH ${LZ4_GIT_BRANCH}) - elseif (H5PL_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") - if (NOT H5PL_COMP_TGZPATH) - set (H5PL_COMP_TGZPATH ${H5LZ4_SOURCE_DIR}) - endif () - set (LZ4_URL ${H5PL_COMP_TGZPATH}/${LZ4_TGZ_NAME}) - else () - set (LZ4_USE_EXTERNAL 0) +include (ExternalProject) +set (H5PL_ALLOW_EXTERNAL_SUPPORT "NO" CACHE STRING "Allow External Library Building (NO GIT TGZ)") +set_property (CACHE H5PL_ALLOW_EXTERNAL_SUPPORT PROPERTY STRINGS NO GIT TGZ) +if (H5PL_ALLOW_EXTERNAL_SUPPORT MATCHES "GIT" OR H5PL_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") + option (LZ4_USE_EXTERNAL "Use External Library Building for LZ4" 1) + if (H5PL_ALLOW_EXTERNAL_SUPPORT MATCHES "GIT") + set (LZ4_URL ${LZ4_GIT_URL} CACHE STRING "Path to lz4 git repository") + set (LZ4_BRANCH ${LZ4_GIT_BRANCH}) + elseif (H5PL_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") + if (NOT H5PL_COMP_TGZPATH) + set (H5PL_COMP_TGZPATH ${H5LZ4_SOURCE_DIR}) endif () + set (LZ4_URL ${H5PL_COMP_TGZPATH}/${LZ4_TGZ_NAME}) + else () + set (LZ4_USE_EXTERNAL 0) endif () - #----------------------------------------------------------------------------- - # lz4 Library Settings - #----------------------------------------------------------------------------- +endif () +#----------------------------------------------------------------------------- +# lz4 Library Settings +#----------------------------------------------------------------------------- +if (NOT H5_LZ4_HEADER) if (NOT LZ4_USE_EXTERNAL) find_package (LZ4 NAMES ${LZ4_PACKAGE_NAME}) if (NOT LZ4_FOUND) find_package (LZ4) # Legacy find - if (NOT LZ4_FOUND) - message (FATAL_ERROR " lz4 is Required for ${H5LZ4_PACKAGE_NAME} library") + if (LZ4_FOUND) + set (H5PL_LINK_LIBS ${H5PL_LINK_LIBS} ${LZ4_LIBRARIES}) endif () endif () endif () @@ -132,13 +129,12 @@ if (NOT BUILD_LZ4_LIBRARY_SOURCE) message (FATAL_ERROR " LZ4 is Required for ${H5LZ4_PACKAGE_NAME} library") endif () endif () - message (STATUS "lz4 found: INC=${LZ4_INCLUDE_DIR} TOOLS=${LZ4_LIBRARIES}") - set (H5PL_LINK_LIBS ${H5PL_LINK_LIBS} ${LZ4_LIBRARIES}) - - if (LZ4_FOUND) - PACKAGE_LZ4_LIBRARY (${H5PL_ALLOW_EXTERNAL_SUPPORT}) - endif () +else () + # This project is being called from within another and LZ4 is already configured + set (H5_HAVE_LZ4_H 1) endif () +message (STATUS "lz4 found: INC=${LZ4_INCLUDE_DIR} TOOLS=${LZ4_LIBRARIES}") +set (H5PL_LINK_LIBS ${H5PL_LINK_LIBS} ${LZ4_LIBRARIES}) #----------------------------------------------------------------------------- #----------------------------------------------------------------------------- diff --git a/LZ4/config/CMakeLists.txt b/LZ4/config/CMakeLists.txt new file mode 100644 index 00000000..c372733a --- /dev/null +++ b/LZ4/config/CMakeLists.txt @@ -0,0 +1,268 @@ +# CMake support for LZ4 +# +# To the extent possible under law, the author(s) have dedicated all +# copyright and related and neighboring rights to this software to +# the public domain worldwide. This software is distributed without +# any warranty. +# +# For details, see . + + +cmake_minimum_required(VERSION 3.5) + +set(LZ4_TOP_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../..") + +# Parse version information +function(parse_lz4_version VERSION_TYPE) + file(STRINGS "${LZ4_TOP_SOURCE_DIR}/lib/lz4.h" version_line REGEX "^#define LZ4_VERSION_${VERSION_TYPE} +([0-9]+).*$") + string(REGEX REPLACE "^#define LZ4_VERSION_${VERSION_TYPE} +([0-9]+).*$" "\\1" version_number "${version_line}") + set(LZ4_VERSION_${VERSION_TYPE} ${version_number} PARENT_SCOPE) +endfunction() + +foreach(version_type IN ITEMS MAJOR MINOR RELEASE) + parse_lz4_version(${version_type}) +endforeach() + +set(LZ4_VERSION_STRING "${LZ4_VERSION_MAJOR}.${LZ4_VERSION_MINOR}.${LZ4_VERSION_RELEASE}") +mark_as_advanced(LZ4_VERSION_STRING LZ4_VERSION_MAJOR LZ4_VERSION_MINOR LZ4_VERSION_RELEASE) + +message(STATUS "Creating build script for LZ4 version: ${LZ4_VERSION_STRING}") + +project(LZ4 VERSION ${LZ4_VERSION_STRING} LANGUAGES C) + + +option(LZ4_BUILD_CLI "Build lz4 program" ON) + + +# Determine if LZ4 is being built as part of another project. +# If LZ4 is bundled in another project, we don't want to install anything. +# Default behavior can be overridden by setting the LZ4_BUNDLED_MODE variable. +if(NOT DEFINED LZ4_BUNDLED_MODE) + get_directory_property(LZ4_IS_SUBPROJECT PARENT_DIRECTORY) + if(LZ4_IS_SUBPROJECT) + set(LZ4_BUNDLED_MODE ON) + else() + set(LZ4_BUNDLED_MODE OFF) + endif() +endif() +mark_as_advanced(LZ4_BUNDLED_MODE) + +# CPack +if(NOT LZ4_BUNDLED_MODE AND NOT CPack_CMake_INCLUDED) + set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "LZ4 compression library") + set(CPACK_PACKAGE_DESCRIPTION_FILE "${LZ4_TOP_SOURCE_DIR}/README.md") + set(CPACK_RESOURCE_FILE_LICENSE "${LZ4_TOP_SOURCE_DIR}/LICENSE") + set(CPACK_PACKAGE_VERSION_MAJOR ${LZ4_VERSION_MAJOR}) + set(CPACK_PACKAGE_VERSION_MINOR ${LZ4_VERSION_MINOR}) + set(CPACK_PACKAGE_VERSION_PATCH ${LZ4_VERSION_RELEASE}) + include(CPack) +endif(NOT LZ4_BUNDLED_MODE AND NOT CPack_CMake_INCLUDED) + +# Allow people to choose whether to build shared or static libraries +# via the BUILD_SHARED_LIBS option unless we are in bundled mode, in +# which case we always use static libraries. +include(CMakeDependentOption) +CMAKE_DEPENDENT_OPTION(BUILD_SHARED_LIBS "Build shared libraries" ON "NOT LZ4_BUNDLED_MODE" OFF) +CMAKE_DEPENDENT_OPTION(BUILD_STATIC_LIBS "Build static libraries" OFF "BUILD_SHARED_LIBS" ON) + +if(NOT BUILD_SHARED_LIBS AND NOT BUILD_STATIC_LIBS) + message(FATAL_ERROR "Both BUILD_SHARED_LIBS and BUILD_STATIC_LIBS have been disabled") +endif() + +set(LZ4_LIB_SOURCE_DIR "${LZ4_TOP_SOURCE_DIR}/lib") +set(LZ4_PROG_SOURCE_DIR "${LZ4_TOP_SOURCE_DIR}/programs") + +include_directories("${LZ4_LIB_SOURCE_DIR}") + +# CLI sources +file(GLOB LZ4_SOURCES + "${LZ4_LIB_SOURCE_DIR}/*.c") +file(GLOB LZ4_CLI_SOURCES + "${LZ4_PROG_SOURCE_DIR}/*.c") +list(APPEND LZ4_CLI_SOURCES ${LZ4_SOURCES}) # LZ4_CLI always use liblz4 sources directly. + +# Whether to use position independent code for the static library. If +# we're building a shared library this is ignored and PIC is always +# used. +option(LZ4_POSITION_INDEPENDENT_LIB "Use position independent code for static library (if applicable)" ON) + +# liblz4 +include(GNUInstallDirs) +set(LZ4_LIBRARIES_BUILT) +if(BUILD_SHARED_LIBS) + add_library(lz4_shared SHARED ${LZ4_SOURCES}) + target_include_directories(lz4_shared + PUBLIC $ + INTERFACE $) + set_target_properties(lz4_shared PROPERTIES + OUTPUT_NAME lz4 + SOVERSION "${LZ4_VERSION_MAJOR}" + VERSION "${LZ4_VERSION_STRING}") + if(MSVC) + target_compile_definitions(lz4_shared PRIVATE + LZ4_DLL_EXPORT=1) + endif() + list(APPEND LZ4_LIBRARIES_BUILT lz4_shared) +endif() +if(BUILD_STATIC_LIBS) + set(STATIC_LIB_NAME lz4) + if (MSVC AND BUILD_SHARED_LIBS) + set(STATIC_LIB_NAME lz4_static) + endif() + add_library(lz4_static STATIC ${LZ4_SOURCES}) + target_include_directories(lz4_static + PUBLIC $ + INTERFACE $) + set_target_properties(lz4_static PROPERTIES + OUTPUT_NAME ${STATIC_LIB_NAME} + POSITION_INDEPENDENT_CODE ${LZ4_POSITION_INDEPENDENT_LIB}) + list(APPEND LZ4_LIBRARIES_BUILT lz4_static) +endif() +# Add unified target. +add_library(lz4 INTERFACE) +list(APPEND LZ4_LIBRARIES_BUILT lz4) +if(BUILD_SHARED_LIBS) + target_link_libraries(lz4 INTERFACE lz4_shared) +else() + target_link_libraries(lz4 INTERFACE lz4_static) +endif() + +# xxhash namespace +if(BUILD_SHARED_LIBS) + target_compile_definitions(lz4_shared PRIVATE + XXH_NAMESPACE=LZ4_) +endif() +if(BUILD_STATIC_LIBS) + target_compile_definitions(lz4_static PRIVATE + XXH_NAMESPACE=LZ4_) +endif() + +# lz4 +if (LZ4_BUILD_CLI) + set(LZ4_PROGRAMS_BUILT lz4cli) + add_executable(lz4cli ${LZ4_CLI_SOURCES}) + set_target_properties(lz4cli PROPERTIES OUTPUT_NAME lz4) +endif() + +# Extra warning flags +if(MSVC) + set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /W4") +else() + include (CheckCCompilerFlag) + foreach (flag + # GCC-style + -pedantic-errors + -Wall + -Wextra + -Wundef + -Wcast-qual + -Wcast-align + -Wshadow + -Wswitch-enum + -Wdeclaration-after-statement + -Wstrict-prototypes + -Wpointer-arith) + + # Because https://gcc.gnu.org/wiki/FAQ#wnowarning + string(REGEX REPLACE "\\-Wno\\-(.+)" "-W\\1" flag_to_test "${flag}") + string(REGEX REPLACE "[^a-zA-Z0-9]+" "_" test_name "CFLAG_${flag_to_test}") + + check_c_compiler_flag("${ADD_COMPILER_FLAGS_PREPEND} ${flag_to_test}" ${test_name}) + + if(${test_name}) + set(CMAKE_C_FLAGS_DEBUG "${flag} ${CMAKE_C_FLAGS_DEBUG}") + endif() + + unset(test_name) + unset(flag_to_test) + endforeach (flag) +endif() + + +if(NOT LZ4_BUNDLED_MODE) + install(TARGETS ${LZ4_PROGRAMS_BUILT} + BUNDLE DESTINATION "${CMAKE_INSTALL_BINDIR}" + RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}") + install(TARGETS ${LZ4_LIBRARIES_BUILT} + EXPORT lz4Targets + LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" + ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" + RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}") + install(FILES + "${LZ4_LIB_SOURCE_DIR}/lz4.h" + "${LZ4_LIB_SOURCE_DIR}/lz4hc.h" + "${LZ4_LIB_SOURCE_DIR}/lz4frame.h" + "${LZ4_LIB_SOURCE_DIR}/lz4file.h" + DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}") + install(FILES "${LZ4_PROG_SOURCE_DIR}/lz4.1" + DESTINATION "${CMAKE_INSTALL_MANDIR}/man1") + install(FILES "${CMAKE_CURRENT_BINARY_DIR}/liblz4.pc" + DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig") + + include(CMakePackageConfigHelpers) + write_basic_package_version_file( + "${CMAKE_CURRENT_BINARY_DIR}/lz4ConfigVersion.cmake" + VERSION ${LZ4_VERSION_STRING} + COMPATIBILITY SameMajorVersion) + + set(LZ4_PKG_INSTALLDIR "${CMAKE_INSTALL_LIBDIR}/cmake/lz4") + configure_package_config_file( + "${CMAKE_CURRENT_LIST_DIR}/lz4Config.cmake.in" + "${CMAKE_CURRENT_BINARY_DIR}/lz4Config.cmake" + INSTALL_DESTINATION ${LZ4_PKG_INSTALLDIR}) + export(EXPORT lz4Targets + FILE ${CMAKE_CURRENT_BINARY_DIR}/lz4Targets.cmake + NAMESPACE LZ4::) + + install(EXPORT lz4Targets + FILE lz4Targets.cmake + NAMESPACE LZ4:: + DESTINATION ${LZ4_PKG_INSTALLDIR}) + install(FILES + ${CMAKE_CURRENT_BINARY_DIR}/lz4Config.cmake + ${CMAKE_CURRENT_BINARY_DIR}/lz4ConfigVersion.cmake + DESTINATION ${LZ4_PKG_INSTALLDIR}) + + # Install lz4cat and unlz4 symlinks on Unix systems + if(UNIX AND LZ4_BUILD_CLI) + foreach(cli_tool IN ITEMS lz4cat unlz4) + # Create a custom target for the symlink creation + add_custom_target("create_${cli_tool}_symlink" ALL + COMMAND ${CMAKE_COMMAND} -E create_symlink + $ ${cli_tool} + COMMENT "Creating symlink for ${cli_tool}" + VERBATIM) + + # Install the symlink into the binary installation directory + install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${cli_tool}" + DESTINATION ${CMAKE_INSTALL_BINDIR} + RENAME ${cli_tool}) + endforeach() + + # create manpage aliases + foreach(f lz4cat unlz4) + file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/${f}.1" ".so man1/lz4.1\n") + install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${f}.1" + DESTINATION "${CMAKE_INSTALL_MANDIR}/man1") + endforeach() + endif(UNIX AND LZ4_BUILD_CLI) +endif(NOT LZ4_BUNDLED_MODE) + +# pkg-config +set(PREFIX "${CMAKE_INSTALL_PREFIX}") + +if("${CMAKE_INSTALL_FULL_LIBDIR}" STREQUAL "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}") + set(LIBDIR "\${prefix}/${CMAKE_INSTALL_LIBDIR}") +else() + set(LIBDIR "${CMAKE_INSTALL_FULL_LIBDIR}") +endif() + +if("${CMAKE_INSTALL_FULL_INCLUDEDIR}" STREQUAL "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR}") + set(INCLUDEDIR "\${prefix}/${CMAKE_INSTALL_INCLUDEDIR}") +else() + set(INCLUDEDIR "${CMAKE_INSTALL_FULL_INCLUDEDIR}") +endif() + +# for liblz4.pc substitution +set(VERSION ${LZ4_VERSION_STRING}) +configure_file(${LZ4_LIB_SOURCE_DIR}/liblz4.pc.in liblz4.pc @ONLY) diff --git a/LZ4/config/cmake/H5LZ4Macros.cmake b/LZ4/config/cmake/H5LZ4Macros.cmake index 6c3b079c..7426dfee 100644 --- a/LZ4/config/cmake/H5LZ4Macros.cmake +++ b/LZ4/config/cmake/H5LZ4Macros.cmake @@ -17,11 +17,13 @@ macro (EXTERNAL_LZ4_LIBRARY compress_type) FetchContent_Declare (LZ4 GIT_REPOSITORY ${LZ4_URL} GIT_TAG ${LZ4_BRANCH} + SOURCE_SUBDIR build/cmake ) elseif (${compress_type} MATCHES "TGZ") FetchContent_Declare (LZ4 URL ${LZ4_URL} URL_HASH "" + SOURCE_SUBDIR build/cmake ) endif () @@ -34,7 +36,7 @@ macro (EXTERNAL_LZ4_LIBRARY compress_type) # Make subproject to use 'BUILD_TESTING=OFF' setting. set (BUILD_TESTING OFF CACHE INTERNAL "Build Unit Testing" FORCE) - FetchContent_MakeAvailable(LZ4) + FetchContent_MakeAvailable (LZ4) # Restore the old value of the parameter set (BUILD_TESTING ${BUILD_TESTING_OLD} CACHE BOOL "Build Unit Testing" FORCE) @@ -42,11 +44,11 @@ macro (EXTERNAL_LZ4_LIBRARY compress_type) set (BUILD_SHARED_LIBS ${BUILD_SHARED_LIBS_OLD} CACHE BOOL "Type of libraries to build" FORCE) # include (${BINARY_DIR}/LZ4-targets.cmake) - set (LZ4_LIBRARY "lz4-static") + set (LZ4_LIBRARY "lz4_static") set (LZ4_INCLUDE_DIR_GEN "${lz4_BINARY_DIR}") - set (LZ4_INCLUDE_DIR "${lz4_SOURCE_DIR}/src") + set (LZ4_INCLUDE_DIR "${lz4_SOURCE_DIR}/lib") set (LZ4_FOUND 1) - set (LZ4_LIBRARIES ${JPEG_LIBRARY}) + set (LZ4_LIBRARIES ${LZ4_LIBRARY}) set (LZ4_INCLUDE_DIRS ${LZ4_INCLUDE_DIR_GEN} ${LZ4_INCLUDE_DIR}) endmacro () diff --git a/LZ4/config/cmake/cacheinit.cmake b/LZ4/config/cmake/cacheinit.cmake index a3320e61..58986745 100644 --- a/LZ4/config/cmake/cacheinit.cmake +++ b/LZ4/config/cmake/cacheinit.cmake @@ -23,13 +23,11 @@ set (HDF5_PACKAGE_NAME "hdf5" CACHE STRING "Name of HDF5 package" FORCE) set (HDF5_NAMESPACE "hdf5::" CACHE STRING "Name space of HDF5 library" FORCE) -set (BUILD_LZ4_LIBRARY_SOURCE ON CACHE BOOL "build the lz4 library within the plugin" FORCE) - set (LZ4_GIT_URL "https://github.com/lz4/lz4.git" CACHE STRING "Use LZ4 from GitHub repository" FORCE) set (LZ4_GIT_BRANCH "dev" CACHE STRING "" FORCE) -set (LZ4_TGZ_ORIGPATH "https://github.com/lz4/lz4/releases/download/v1.9.4" CACHE STRING "Use PLUGINS from original location" FORCE) -set (LZ4_TGZ_NAME "lz4-1.9.4.tar.gz" CACHE STRING "Use LZ4 from compressed file" FORCE) +set (LZ4_TGZ_ORIGPATH "https://github.com/lz4/lz4/releases/download/v1.10.0" CACHE STRING "Use PLUGINS from original location" FORCE) +set (LZ4_TGZ_NAME "lz4-1.10.0.tar.gz" CACHE STRING "Use LZ4 from compressed file" FORCE) set (LZ4_PACKAGE_NAME "lz4" CACHE STRING "Name of LZ4 package" FORCE) set (H5LZ4_CPACK_ENABLE ON CACHE BOOL "Enable the CPACK include and components" FORCE) diff --git a/LZ4/config/lz4Config.cmake.in b/LZ4/config/lz4Config.cmake.in new file mode 100644 index 00000000..e9c94733 --- /dev/null +++ b/LZ4/config/lz4Config.cmake.in @@ -0,0 +1,2 @@ +@PACKAGE_INIT@ +include( "${CMAKE_CURRENT_LIST_DIR}/lz4Targets.cmake" ) \ No newline at end of file diff --git a/LZ4/src/CMakeLists.txt b/LZ4/src/CMakeLists.txt index d6a6eb0e..b77a62e6 100644 --- a/LZ4/src/CMakeLists.txt +++ b/LZ4/src/CMakeLists.txt @@ -21,8 +21,8 @@ add_definitions (${HDF5_EXTRA_C_FLAGS}) # Setup include Directories #----------------------------------------------------------------------------- set (H5LZ4_INCLUDE_DIRS ${H5LZ4_INCLUDE_DIRS} - ${H5PL_HDF5_INCLUDE_DIRS} ${H5LZ4_BINARY_DIR} ${LZ4_BINARY_DIR} - ${H5LZ4_SRC_SOURCE_DIR}/lib + ${H5PL_HDF5_INCLUDE_DIRS} ${H5LZ4_BINARY_DIR} + ${H5LZ4_SRC_SOURCE_DIR} ${LZ4_INCLUDE_DIRS} ) @@ -32,19 +32,6 @@ set (H5LZ4_INCLUDE_DIRS ${H5LZ4_INCLUDE_DIRS} set (H5LZ4_SRCS ${H5LZ4_SRC_SOURCE_DIR}/H5Zlz4.c ) -if (BUILD_LZ4_LIBRARY_SOURCE) - set (H5LZ4_SRCS ${H5LZ4_SRCS} - ${H5LZ4_SRC_SOURCE_DIR}/lib/lz4.c - ${H5LZ4_SRC_SOURCE_DIR}/lib/lz4.h - ${H5LZ4_SRC_SOURCE_DIR}/lib/lz4hc.c - ${H5LZ4_SRC_SOURCE_DIR}/lib/lz4hc.h - ${H5LZ4_SRC_SOURCE_DIR}/lib/lz4frame.c - ${H5LZ4_SRC_SOURCE_DIR}/lib/lz4frame.h - ${H5LZ4_SRC_SOURCE_DIR}/lib/lz4frame_static.h - ${H5LZ4_SRC_SOURCE_DIR}/lib/xxhash.c - ${H5LZ4_SRC_SOURCE_DIR}/lib/xxhash.h - ) -endif () add_library (${H5LZ4_LIB_TARGET} MODULE ${H5LZ4_SRCS}) if (DISABLE_H5LZ4_ENCODER) diff --git a/LZ4/src/H5Zlz4.c b/LZ4/src/H5Zlz4.c index b28f5dd7..7e250236 100644 --- a/LZ4/src/H5Zlz4.c +++ b/LZ4/src/H5Zlz4.c @@ -142,10 +142,14 @@ static size_t H5Z_filter_lz4(unsigned int flags, size_t cd_nelmts, } else /* do the decompression */ { -#if LZ4_VERSION_NUMBER > 10300 +#if LZ4_VERSION_NUMBER > 10900 + int compressedBytes = LZ4_decompress_safe(rpos, roBuf, blockSize, origSize); +#else +#if LZ4_VERSION_NUMBER > 10800 int compressedBytes = LZ4_decompress_fast(rpos, roBuf, blockSize); #else int compressedBytes = LZ4_uncompress(rpos, roBuf, blockSize); +#endif #endif if(compressedBytes != compressedBlockSize) { diff --git a/ZSTD/config/CMakeLists.txt b/ZSTD/config/CMakeLists.txt index 05483762..fff69b18 100644 --- a/ZSTD/config/CMakeLists.txt +++ b/ZSTD/config/CMakeLists.txt @@ -13,9 +13,7 @@ cmake_minimum_required(VERSION 3.14 FATAL_ERROR) # Set and use the newest cmake policies that are validated to work set(ZSTD_MAX_VALIDATED_CMAKE_MAJOR_VERSION "3") set(ZSTD_MAX_VALIDATED_CMAKE_MINOR_VERSION "13") #Policies never changed at PATCH level -if("${CMAKE_MAJOR_VERSION}" LESS 3) - set(ZSTD_CMAKE_POLICY_VERSION "${CMAKE_VERSION}") -elseif( "${ZSTD_MAX_VALIDATED_CMAKE_MAJOR_VERSION}" EQUAL "${CMAKE_MAJOR_VERSION}" AND +if( "${ZSTD_MAX_VALIDATED_CMAKE_MAJOR_VERSION}" EQUAL "${CMAKE_MAJOR_VERSION}" AND "${ZSTD_MAX_VALIDATED_CMAKE_MINOR_VERSION}" GREATER "${CMAKE_MINOR_VERSION}") set(ZSTD_CMAKE_POLICY_VERSION "${CMAKE_VERSION}") else() @@ -32,12 +30,12 @@ set(LIBRARY_DIR ${ZSTD_SOURCE_DIR}/lib) include(GetZstdLibraryVersion) GetZstdLibraryVersion(${LIBRARY_DIR}/zstd.h zstd_VERSION_MAJOR zstd_VERSION_MINOR zstd_VERSION_PATCH) - project(zstd - VERSION "${zstd_VERSION_MAJOR}.${zstd_VERSION_MINOR}.${zstd_VERSION_PATCH}" - LANGUAGES C # Main library is in C - ASM # And ASM - CXX # Testing contributed code also utilizes CXX - ) +project(zstd + VERSION "${zstd_VERSION_MAJOR}.${zstd_VERSION_MINOR}.${zstd_VERSION_PATCH}" + LANGUAGES C # Main library is in C + ASM # And ASM + CXX # Testing contributed code also utilizes CXX + ) message(STATUS "ZSTD VERSION: ${zstd_VERSION}") set(zstd_HOMEPAGE_URL "https://facebook.github.io/zstd") set(zstd_DESCRIPTION "Zstandard is a real-time compression algorithm, providing high compression ratios.") @@ -110,9 +108,25 @@ endif () #----------------------------------------------------------------------------- # External dependencies #----------------------------------------------------------------------------- +# Define a function to handle special thread settings for HP-UX +# See https://github.com/facebook/zstd/pull/3862 for details. +function(setup_hpux_threads) + find_package(Threads) + if (NOT Threads_FOUND) + set(CMAKE_USE_PTHREADS_INIT 1 PARENT_SCOPE) + set(CMAKE_THREAD_LIBS_INIT -lpthread PARENT_SCOPE) + set(CMAKE_HAVE_THREADS_LIBRARY 1 PARENT_SCOPE) + set(Threads_FOUND TRUE PARENT_SCOPE) + endif() +endfunction() + if (ZSTD_MULTITHREAD_SUPPORT AND UNIX) - set(THREADS_PREFER_PTHREAD_FLAG ON) - find_package(Threads REQUIRED) + if (CMAKE_SYSTEM_NAME MATCHES "HP-UX") + setup_hpux_threads() + else() + set(THREADS_PREFER_PTHREAD_FLAG ON) + find_package(Threads REQUIRED) + endif() if(CMAKE_USE_PTHREADS_INIT) set(THREADS_LIBS "${CMAKE_THREAD_LIBS_INIT}") else() diff --git a/ZSTD/config/cmake/H5ZSTDMacros.cmake b/ZSTD/config/cmake/H5ZSTDMacros.cmake index 856e17fd..2bc580fd 100644 --- a/ZSTD/config/cmake/H5ZSTDMacros.cmake +++ b/ZSTD/config/cmake/H5ZSTDMacros.cmake @@ -17,7 +17,8 @@ macro (EXTERNAL_ZSTD_LIBRARY compress_type) FetchContent_Declare (ZSTD GIT_REPOSITORY ${ZSTD_URL} GIT_TAG ${ZSTD_BRANCH} - SOURCE_SUBDIR this-directory-does-not-exist + SOURCE_SUBDIR build/cmake + #SOURCE_SUBDIR this-directory-does-not-exist PATCH_COMMAND ${CMAKE_COMMAND} -E copy ${H5ZSTD_SOURCE_DIR}/config/CMakeLists.txt /build/cmake/CMakeLists.txt diff --git a/ZSTD/config/cmake/cacheinit.cmake b/ZSTD/config/cmake/cacheinit.cmake index 73f94d47..6a3e01c2 100644 --- a/ZSTD/config/cmake/cacheinit.cmake +++ b/ZSTD/config/cmake/cacheinit.cmake @@ -26,8 +26,8 @@ set (HDF5_NAMESPACE "hdf5::" CACHE STRING "Name space of HDF5 library" FORCE) set (ZSTD_GIT_URL "https://github.com/facebook/zstd.git" CACHE STRING "Use ZSTD from GitHub repository" FORCE) set (ZSTD_GIT_BRANCH "dev" CACHE STRING "" FORCE) -set (ZSTD_TGZ_ORIGPATH "https://github.com/facebook/zstd/releases/download/v1.5.5" CACHE STRING "Use PLUGINS from original location" FORCE) -set (ZSTD_TGZ_NAME "zstd-1.5.5.tar.gz" CACHE STRING "Use ZSTD from compressed file" FORCE) +set (ZSTD_TGZ_ORIGPATH "https://github.com/facebook/zstd/releases/download/v1.5.6" CACHE STRING "Use PLUGINS from original location" FORCE) +set (ZSTD_TGZ_NAME "zstd-1.5.6.tar.gz" CACHE STRING "Use ZSTD from compressed file" FORCE) set (ZSTD_PACKAGE_NAME "zstd" CACHE STRING "Name of ZSTD package" FORCE) set (H5ZSTD_CPACK_ENABLE ON CACHE BOOL "Enable the CPACK include and components" FORCE) diff --git a/ZSTD/config/libCMakeLists.txt b/ZSTD/config/libCMakeLists.txt index d0a8ebaa..426a0d2d 100644 --- a/ZSTD/config/libCMakeLists.txt +++ b/ZSTD/config/libCMakeLists.txt @@ -11,41 +11,66 @@ project(libzstd C ASM) set(CMAKE_INCLUDE_CURRENT_DIR TRUE) option(ZSTD_BUILD_STATIC "BUILD STATIC LIBRARIES" ON) - -# Define library directory, where sources and header files are located -include_directories(${LIBRARY_DIR} ${LIBRARY_DIR}/common) +option(ZSTD_BUILD_SHARED "BUILD SHARED LIBRARIES" ON) +option(ZSTD_BUILD_COMPRESSION "BUILD COMPRESSION MODULE" ON) +option(ZSTD_BUILD_DECOMPRESSION "BUILD DECOMPRESSION MODULE" ON) +option(ZSTD_BUILD_DICTBUILDER "BUILD DICTBUILDER MODULE" ON) +option(ZSTD_BUILD_DEPRECATED "BUILD DEPRECATED MODULE" OFF) + +set(ZSTDLIB_VISIBLE "" CACHE STRING "Visibility for ZSTDLIB API") +set(ZSTDERRORLIB_VISIBLE "" CACHE STRING "Visibility for ZSTDERRORLIB_VISIBLE API") +set(ZDICTLIB_VISIBLE "" CACHE STRING "Visibility for ZDICTLIB_VISIBLE API") +set(ZSTDLIB_STATIC_API "" CACHE STRING "Visibility for ZSTDLIB_STATIC_API API") +set(ZDICTLIB_STATIC_API "" CACHE STRING "Visibility for ZDICTLIB_STATIC_API API") + +set_property(CACHE ZSTDLIB_VISIBLE PROPERTY STRINGS "" "hidden" "default" "protected" "internal") +set_property(CACHE ZSTDERRORLIB_VISIBLE PROPERTY STRINGS "" "hidden" "default" "protected" "internal") +set_property(CACHE ZDICTLIB_VISIBLE PROPERTY STRINGS "" "hidden" "default" "protected" "internal") +set_property(CACHE ZSTDLIB_STATIC_API PROPERTY STRINGS "" "hidden" "default" "protected" "internal") +set_property(CACHE ZDICTLIB_STATIC_API PROPERTY STRINGS "" "hidden" "default" "protected" "internal") file(GLOB CommonSources ${LIBRARY_DIR}/common/*.c) file(GLOB CompressSources ${LIBRARY_DIR}/compress/*.c) +file(GLOB DecompressSources ${LIBRARY_DIR}/decompress/*.c) if (MSVC) - file(GLOB DecompressSources ${LIBRARY_DIR}/decompress/*.c) add_compile_options(-DZSTD_DISABLE_ASM) else () - file(GLOB DecompressSources ${LIBRARY_DIR}/decompress/*.c ${LIBRARY_DIR}/decompress/*.S) + if(CMAKE_SYSTEM_PROCESSOR MATCHES "amd64.*|AMD64.*|x86_64.*|X86_64.*") + set(DecompressSources ${DecompressSources} ${LIBRARY_DIR}/decompress/huf_decompress_amd64.S) + else() + add_compile_options(-DZSTD_DISABLE_ASM) + endif() endif () file(GLOB DictBuilderSources ${LIBRARY_DIR}/dictBuilder/*.c) - -set(Sources - ${CommonSources} - ${CompressSources} - ${DecompressSources} - ${DictBuilderSources}) - +file(GLOB DeprecatedSources ${LIBRARY_DIR}/deprecated/*.c) +file(GLOB PublicHeaders ${LIBRARY_DIR}/*.h) file(GLOB CommonHeaders ${LIBRARY_DIR}/common/*.h) file(GLOB CompressHeaders ${LIBRARY_DIR}/compress/*.h) file(GLOB DecompressHeaders ${LIBRARY_DIR}/decompress/*.h) file(GLOB DictBuilderHeaders ${LIBRARY_DIR}/dictBuilder/*.h) - -set(Headers - ${LIBRARY_DIR}/zstd.h - ${CommonHeaders} - ${CompressHeaders} - ${DecompressHeaders} - ${DictBuilderHeaders}) +file(GLOB DeprecatedHeaders ${LIBRARY_DIR}/deprecated/*.h) + +set(Sources ${CommonSources}) +set(Headers ${PublicHeaders} ${CommonHeaders}) +if (ZSTD_BUILD_COMPRESSION) + set(Sources ${Sources} ${CompressSources}) + set(Headers ${Headers} ${CompressHeaders}) +endif() +if (ZSTD_BUILD_DECOMPRESSION) + set(Sources ${Sources} ${DecompressSources}) + set(Headers ${Headers} ${DecompressHeaders}) +endif() +if (ZSTD_BUILD_DICTBUILDER) + set(Sources ${Sources} ${DictBuilderSources}) + set(Headers ${Headers} ${DictBuilderHeaders}) +endif() +if (ZSTD_BUILD_DEPRECATED) + set(Sources ${Sources} ${DeprecatedSources}) + set(Headers ${Headers} ${DeprecatedHeaders}) +endif() if (ZSTD_LEGACY_SUPPORT) set(LIBRARY_LEGACY_DIR ${LIBRARY_DIR}/legacy) - include_directories(${LIBRARY_LEGACY_DIR}) set(Sources ${Sources} ${LIBRARY_LEGACY_DIR}/zstd_v01.c @@ -76,12 +101,24 @@ endif () # Our assembly expects to be compiled by a C compiler, and is only enabled for # __GNUC__ compatible compilers. Otherwise all the ASM code is disabled by # macros. -set_source_files_properties(${Sources} PROPERTIES LANGUAGE C) +if(NOT CMAKE_ASM_COMPILER STREQUAL CMAKE_C_COMPILER) + set_source_files_properties(${Sources} PROPERTIES LANGUAGE C) +endif() + +macro (add_definition target var) + if (NOT ("${${var}}" STREQUAL "")) + set_property(TARGET ${target} APPEND PROPERTY COMPILE_DEFINITIONS "${var}=__attribute__((visibility(\"${${var}}\")))") + endif () +endmacro () + +# Define directories containing the library's public headers +set(PUBLIC_INCLUDE_DIRS ${LIBRARY_DIR}) # Split project to static and shared libraries build set(library_targets) if (ZSTD_BUILD_STATIC) add_library(libzstd_static STATIC ${Sources} ${Headers}) + target_include_directories(libzstd_static INTERFACE $) list(APPEND library_targets libzstd_static) if (ZSTD_MULTITHREAD_SUPPORT) set_property(TARGET libzstd_static APPEND PROPERTY COMPILE_DEFINITIONS "ZSTD_MULTITHREAD") @@ -89,7 +126,15 @@ if (ZSTD_BUILD_STATIC) target_link_libraries(libzstd_static ${THREADS_LIBS}) endif () endif () + add_definition(libzstd_static ZSTDLIB_VISIBLE) + add_definition(libzstd_static ZSTDERRORLIB_VISIBLE) + add_definition(libzstd_static ZDICTLIB_VISIBLE) + add_definition(libzstd_static ZSTDLIB_STATIC_API) + add_definition(libzstd_static ZDICTLIB_STATIC_API) endif () +add_library(libzstd INTERFACE) +target_link_libraries(libzstd INTERFACE libzstd_static) +list(APPEND library_targets libzstd) # Add specific compile definitions for MSVC project if (MSVC) diff --git a/ZSTD/src/H5Zzstd.c b/ZSTD/src/H5Zzstd.c index fd57cb66..b8c13072 100644 --- a/ZSTD/src/H5Zzstd.c +++ b/ZSTD/src/H5Zzstd.c @@ -56,7 +56,7 @@ static size_t H5Z_filter_zstd(unsigned int flags, size_t cd_nelmts, if (flags & H5Z_FLAG_REVERSE) { /* We're decompressing */ - size_t decompSize = ZSTD_getDecompressedSize(*buf, origSize); + size_t decompSize = ZSTD_getFrameContentSize(*buf, origSize); if (NULL == (outbuf = malloc(decompSize))) goto error; diff --git a/config/cmake/cacheinit.cmake b/config/cmake/cacheinit.cmake index 7dfee4d4..756e61be 100644 --- a/config/cmake/cacheinit.cmake +++ b/config/cmake/cacheinit.cmake @@ -58,7 +58,7 @@ set (BLOSC_GIT_URL "https://github.com/Blosc/c-blosc.git" CACHE STRING "Use BLOS set (BLOSC_GIT_BRANCH "main" CACHE STRING "" FORCE) set (BLOSC_TGZ_ORIGPATH "https://github.com/Blosc/c-blosc/archive/refs/tags" CACHE STRING "Use PLUGINS from original location" FORCE) -set (BLOSC_TGZ_NAME "c-blosc-1.21.5.tar.gz" CACHE STRING "Use BLOSC from compressed file" FORCE) +set (BLOSC_TGZ_NAME "c-blosc-1.21.6.tar.gz" CACHE STRING "Use BLOSC from compressed file" FORCE) set (BLOSC_PACKAGE_NAME "blosc" CACHE STRING "Name of BLOSC package" FORCE) @@ -76,7 +76,7 @@ set (BLOSC2_GIT_URL "https://github.com/Blosc/c-blosc2.git" CACHE STRING "Use BL set (BLOSC2_GIT_BRANCH "main" CACHE STRING "" FORCE) set (BLOSC2_TGZ_ORIGPATH "https://github.com/Blosc/c-blosc2/archive/refs/tags" CACHE STRING "Use PLUGINS from original location" FORCE) -set (BLOSC2_TGZ_NAME "c-blosc2-2.14.4.tar.gz" CACHE STRING "Use BLOSC2 from compressed file" FORCE) +set (BLOSC2_TGZ_NAME "c-blosc2-2.15.1.tar.gz" CACHE STRING "Use BLOSC2 from compressed file" FORCE) set (BLOSC2_PACKAGE_NAME "blosc2" CACHE STRING "Name of BLOSC2 package" FORCE) @@ -125,8 +125,8 @@ set (BUILD_LZ4_LIBRARY_SOURCE ON CACHE BOOL "build the lz4 library within the pl set (LZ4_GIT_URL "https://github.com/lz4/lz4.git" CACHE STRING "Use LZ4 from GitHub repository" FORCE) set (LZ4_GIT_BRANCH "dev" CACHE STRING "" FORCE) -set (LZ4_TGZ_ORIGPATH "https://github.com/lz4/lz4/releases/download/v1.9.4" CACHE STRING "Use PLUGINS from original location" FORCE) -set (LZ4_TGZ_NAME "lz4-1.9.4.tar.gz" CACHE STRING "Use LZ4 from compressed file" FORCE) +set (LZ4_TGZ_ORIGPATH "https://github.com/lz4/lz4/releases/download/v1.10.0" CACHE STRING "Use PLUGINS from original location" FORCE) +set (LZ4_TGZ_NAME "lz4-1.10.0.tar.gz" CACHE STRING "Use LZ4 from compressed file" FORCE) set (LZ4_PACKAGE_NAME "lz4" CACHE STRING "Name of LZ4 package" FORCE) @@ -154,7 +154,7 @@ set (ZFP_PACKAGE_NAME "zfp" CACHE STRING "Name of ZFP package" FORCE) set (ZSTD_GIT_URL "https://github.com/facebook/zstd.git" CACHE STRING "Use ZSTD from GitHub repository" FORCE) set (ZSTD_GIT_BRANCH "dev" CACHE STRING "" FORCE) -set (ZSTD_TGZ_ORIGPATH "https://github.com/facebook/zstd/releases/download/v1.5.5" CACHE STRING "Use PLUGINS from original location" FORCE) -set (ZSTD_TGZ_NAME "zstd-1.5.5.tar.gz" CACHE STRING "Use ZSTD from compressed file" FORCE) +set (ZSTD_TGZ_ORIGPATH "https://github.com/facebook/zstd/releases/download/v1.5.6" CACHE STRING "Use PLUGINS from original location" FORCE) +set (ZSTD_TGZ_NAME "zstd-1.5.6.tar.gz" CACHE STRING "Use ZSTD from compressed file" FORCE) set (ZSTD_PACKAGE_NAME "zstd" CACHE STRING "Name of ZSTD package" FORCE) diff --git a/docs/INSTALL_With_CMake.txt b/docs/INSTALL_With_CMake.txt index 8a36ea6f..23043aa2 100644 --- a/docs/INSTALL_With_CMake.txt +++ b/docs/INSTALL_With_CMake.txt @@ -432,7 +432,7 @@ These five steps are described in detail below. set (BLOSC_GIT_URL "https://github.com/Blosc/c-blosc.git" CACHE STRING "Use BLOSC from Github repository" FORCE) set (BLOSC_GIT_BRANCH "main" CACHE STRING "" FORCE) set (BLOSC_TGZ_ORIGPATH "https://github.com/Blosc/c-blosc/archive/refs/tags" CACHE STRING "Use PLUGINS from original location" FORCE) - set (BLOSC_TGZ_NAME "c-blosc-1.21.5.tar.gz" CACHE STRING "Use BLOSC from compressed file" FORCE) + set (BLOSC_TGZ_NAME "c-blosc-1.21.6.tar.gz" CACHE STRING "Use BLOSC from compressed file" FORCE) set (BLOSC_PACKAGE_NAME "blosc" CACHE STRING "Name of BLOSC package" FORCE) set (BLOSC_ZLIB_GIT_URL "https://github.com/madler/zlib.git" CACHE STRING "Use ZLIB from GitHub repository" FORCE) set (BLOSC_ZLIB_GIT_BRANCH "develop" CACHE STRING "" FORCE) @@ -443,7 +443,7 @@ These five steps are described in detail below. set (BLOSC2_GIT_URL "https://github.com/Blosc/c-blosc2.git" CACHE STRING "Use BLOSC2 from Github repository" FORCE) set (BLOSC2_GIT_BRANCH "main" CACHE STRING "" FORCE) set (BLOSC2_TGZ_ORIGPATH "https://github.com/Blosc/c-blosc2/archive/refs/tags" CACHE STRING "Use PLUGINS from original location" FORCE) - set (BLOSC2_TGZ_NAME "c-blosc2-2.14.4.tar.gz" CACHE STRING "Use BLOSC2 from compressed file" FORCE) + set (BLOSC2_TGZ_NAME "c-blosc2-2.15.1.tar.gz" CACHE STRING "Use BLOSC2 from compressed file" FORCE) set (BLOSC2_PACKAGE_NAME "blosc2" CACHE STRING "Name of BLOSC2 package" FORCE) set (BLOSC2_ZLIB_GIT_URL "https://github.com/madler/zlib.git" CACHE STRING "Use ZLIB from GitHub repository" FORCE) set (BLOSC2_ZLIB_GIT_BRANCH "develop" CACHE STRING "" FORCE) @@ -472,8 +472,8 @@ These five steps are described in detail below. set (BUILD_LZ4_LIBRARY_SOURCE ON CACHE BOOL "build the lz4 library within the plugin" FORCE) set (LZ4_GIT_URL "https://github.com/lz4/lz4.git" CACHE STRING "Use LZ4 from GitHub repository" FORCE) set (LZ4_GIT_BRANCH "dev" CACHE STRING "" FORCE) - set (LZ4_TGZ_ORIGPATH "https://github.com/lz4/lz4/releases/download/v1.9.4" CACHE STRING "Use PLUGINS from original location" FORCE) - set (LZ4_TGZ_NAME "lz4-1.9.4.tar.gz" CACHE STRING "Use LZ4 from compressed file" FORCE) + set (LZ4_TGZ_ORIGPATH "https://github.com/lz4/lz4/releases/download/v1.10.0" CACHE STRING "Use PLUGINS from original location" FORCE) + set (LZ4_TGZ_NAME "lz4-1.10.0.tar.gz" CACHE STRING "Use LZ4 from compressed file" FORCE) set (LZ4_PACKAGE_NAME "lz4" CACHE STRING "Name of LZ4 package" FORCE) ############################# lzf ################################################ set (LZF_URL "http://software.schmorp.de/pkg/liblzf.html" CACHE STRING "LZF home" FORCE) @@ -500,8 +500,8 @@ These five steps are described in detail below. ############################# zstd ################################################ set (ZSTD_GIT_URL "https://github.com/facebook/zstd.git" CACHE STRING "Use ZSTD from GitHub repository" FORCE) set (ZSTD_GIT_BRANCH "dev" CACHE STRING "" FORCE) - set (ZSTD_TGZ_ORIGPATH "https://github.com/facebook/zstd/releases/download/v1.5.5" CACHE STRING "Use PLUGINS from original location" FORCE) - set (ZSTD_TGZ_NAME "zstd-1.5.5.tar.gz" CACHE STRING "Use ZSTD from compressed file" FORCE) + set (ZSTD_TGZ_ORIGPATH "https://github.com/facebook/zstd/releases/download/v1.5.6" CACHE STRING "Use PLUGINS from original location" FORCE) + set (ZSTD_TGZ_NAME "zstd-1.5.6.tar.gz" CACHE STRING "Use ZSTD from compressed file" FORCE) set (ZSTD_PACKAGE_NAME "zstd" CACHE STRING "Name of ZSTD package" FORCE) diff --git a/libs/c-blosc-1.21.5.tar.gz b/libs/c-blosc-1.21.5.tar.gz deleted file mode 100644 index c50b64ac..00000000 Binary files a/libs/c-blosc-1.21.5.tar.gz and /dev/null differ diff --git a/libs/c-blosc-1.21.6.tar.gz b/libs/c-blosc-1.21.6.tar.gz new file mode 100644 index 00000000..f9e0ccfb Binary files /dev/null and b/libs/c-blosc-1.21.6.tar.gz differ diff --git a/libs/c-blosc2-2.14.4.tar.gz b/libs/c-blosc2-2.14.4.tar.gz deleted file mode 100644 index d162d497..00000000 Binary files a/libs/c-blosc2-2.14.4.tar.gz and /dev/null differ diff --git a/libs/c-blosc2-2.15.1.tar.gz b/libs/c-blosc2-2.15.1.tar.gz new file mode 100644 index 00000000..15ec0874 Binary files /dev/null and b/libs/c-blosc2-2.15.1.tar.gz differ diff --git a/libs/lz4-1.10.0.tar.gz b/libs/lz4-1.10.0.tar.gz new file mode 100644 index 00000000..a19d3603 Binary files /dev/null and b/libs/lz4-1.10.0.tar.gz differ diff --git a/libs/lz4-1.9.4.tar.gz b/libs/lz4-1.9.4.tar.gz deleted file mode 100644 index b3e2eb94..00000000 Binary files a/libs/lz4-1.9.4.tar.gz and /dev/null differ diff --git a/libs/zstd-1.5.5.tar.gz b/libs/zstd-1.5.5.tar.gz deleted file mode 100644 index 57e55792..00000000 Binary files a/libs/zstd-1.5.5.tar.gz and /dev/null differ diff --git a/libs/zstd-1.5.6.tar.gz b/libs/zstd-1.5.6.tar.gz new file mode 100644 index 00000000..7e63317f Binary files /dev/null and b/libs/zstd-1.5.6.tar.gz differ