Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/main-fetchcontent-mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ jobs:
-DENABLE_ZSTD=OFF \
-DENABLE_BITGROOM=ON \
-DENABLE_GRANULAR_BITROUND=ON \
-DENABLE_BITROUND=ON \
-DENABLE_BSHUF=ON \
..
cmake --build . --parallel 3 --config ${{ inputs.build_mode }}
Expand Down Expand Up @@ -166,6 +167,7 @@ jobs:
-DENABLE_ZSTD=ON \
-DENABLE_BITGROOM=ON \
-DENABLE_GRANULAR_BITROUND=ON \
-DENABLE_BITROUND=ON \
-DENABLE_BSHUF=ON \
$GITHUB_WORKSPACE
cmake --build . --parallel 3 --config ${{ inputs.build_mode }}
Expand Down Expand Up @@ -241,6 +243,7 @@ jobs:
-DENABLE_ZSTD=ON \
-DENABLE_BITGROOM=ON \
-DENABLE_GRANULAR_BITROUND=ON \
-DENABLE_BITROUND=ON \
-DENABLE_BSHUF=ON \
$GITHUB_WORKSPACE
cmake --build . --parallel 3 --config ${{ inputs.build_mode }}
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/main-fetchcontent-ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ jobs:
-DENABLE_ZSTD=OFF \
-DENABLE_BITGROOM=ON \
-DENABLE_GRANULAR_BITROUND=ON \
-DENABLE_BITROUND=ON \
-DENABLE_BSHUF=ON \
..
# NOTE: Currently a serial build has to be forced, as Blosc and Blosc2
Expand Down Expand Up @@ -158,6 +159,7 @@ jobs:
-DENABLE_ZSTD=ON \
-DENABLE_BITGROOM=ON \
-DENABLE_GRANULAR_BITROUND=ON \
-DENABLE_BITROUND=ON \
-DENABLE_BSHUF=ON \
$GITHUB_WORKSPACE
# NOTE: Currently, a serial build has to be forced as Blosc and Blosc2
Expand Down Expand Up @@ -235,6 +237,7 @@ jobs:
-DENABLE_ZSTD=ON \
-DENABLE_BITGROOM=ON \
-DENABLE_GRANULAR_BITROUND=ON \
-DENABLE_BITROUND=ON \
-DENABLE_BSHUF=ON \
$GITHUB_WORKSPACE
# NOTE: Currently, a serial build has to be forced as Blosc and Blosc2
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/main-fetchcontent-win.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ jobs:
-DENABLE_ZSTD=OFF \
-DENABLE_BITGROOM=ON \
-DENABLE_GRANULAR_BITROUND=ON \
-DENABLE_BITROUND=ON \
-DENABLE_BSHUF=ON \
..
cmake --build . --parallel 4 --config ${{ inputs.build_mode }}
Expand Down Expand Up @@ -175,6 +176,7 @@ jobs:
-DENABLE_ZSTD=ON \
-DENABLE_BITGROOM=ON \
-DENABLE_GRANULAR_BITROUND=ON \
-DENABLE_BITROUND=ON \
-DENABLE_BSHUF=ON \
$GITHUB_WORKSPACE
cmake --build . --parallel 4 --config ${{ inputs.build_mode }}
Expand Down Expand Up @@ -261,6 +263,7 @@ jobs:
-DENABLE_ZSTD=ON \
-DENABLE_BITGROOM=ON \
-DENABLE_GRANULAR_BITROUND=ON \
-DENABLE_BITROUND=ON \
-DENABLE_BSHUF=ON \
$GITHUB_WORKSPACE
cmake --build . --parallel 4 --config ${{ inputs.build_mode }}
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/main-package-managers-mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ jobs:
-DENABLE_ZSTD=ON \
-DENABLE_BITGROOM=OFF \
-DENABLE_GRANULAR_BITROUND=OFF \
-DENABLE_BITROUND=OFF \
-DENABLE_BSHUF=OFF \
$GITHUB_WORKSPACE
cmake --build . --parallel 3 --config ${{ inputs.build_mode }}
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/main-package-managers-ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ jobs:
-DENABLE_ZFP=OFF \
-DENABLE_BITGROOM=OFF \
-DENABLE_GRANULAR_BITROUND=OFF \
-DENABLE_BITROUND=OFF \
-DENABLE_BLOSC=OFF \
-DENABLE_BSHUF=OFF \
-DENABLE_BZIP2=OFF \
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/main-package-managers-win.yml
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ jobs:
-DENABLE_ZSTD=ON \
-DENABLE_BITGROOM=OFF \
-DENABLE_GRANULAR_BITROUND=OFF \
-DENABLE_BITROUND=OFF \
-DENABLE_BSHUF=OFF \
$GITHUB_WORKSPACE
cmake --build . --parallel 4 --config ${{ inputs.build_mode }}
Expand Down
51 changes: 51 additions & 0 deletions BITROUND/Additional_Legal/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
HDF5 BitRound filter plugin -- provenance and license
======================================================

This plugin adapts two BSD-style sources, both authored by Charlie Zender:

* the BitRound quantization core, from netcdf-c (libsrc4/nc4var.c,
NC_QUANTIZE_BITROUND; PR #2232). The netcdf-c repository is copyright
UCAR (University Corporation for Atmospheric Research).

* the HDF5 filter-plugin scaffolding (cd_values layout, set_local /
can_apply pattern), from the BitGroom plugin in the ccr project,
copyright (c) Charlie Zender / ccr.

Algorithm reference:
Kloewer M, Razinger M, Dominguez JJ, Dueben PD, Palmer TN. "Compressing
atmospheric data into its real information content." Nat. Comput. Sci.
1(11), 713-724 (2021). doi:10.1038/s43588-021-00156-2

Both upstream sources are distributed under the BSD 3-Clause License, which
also governs this plugin:

BSD 3-Clause License

Copyright (c) 2019, ccr
Copyright (c) UCAR (netcdf-c)
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

3. Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
165 changes: 165 additions & 0 deletions BITROUND/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,165 @@
#
# Copyright by The HDF Group.
# All rights reserved.
#
# This file is part of HDF5. The full HDF5 copyright notice, including
# terms governing use, modification, and redistribution, is contained in
# the COPYING file, which can be found at the root of the source code
# distribution tree, or in https://www.hdfgroup.org/licenses.
# If you do not have access to either file, you may request a copy from
# help@hdfgroup.org.
#
cmake_minimum_required (VERSION 3.18)
project (H5BITROUND C)

if (POLICY CMP0074)
# find_package() uses <PackageName>_ROOT variables.
cmake_policy (SET CMP0074 NEW)
endif ()

if (POLICY CMP0083)
# To control generation of Position Independent Executable (PIE) or not,
# some flags are required at link time.
cmake_policy (SET CMP0083 NEW)
endif ()

# Avoid warning about DOWNLOAD_EXTRACT_TIMESTAMP in CMake 3.24:
if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.24.0")
cmake_policy(SET CMP0135 NEW)
endif()

#-----------------------------------------------------------------------------
# Basic H5BITROUND stuff here
#-----------------------------------------------------------------------------
if (NOT H5PL_RESOURCES_DIR)
include (${H5BITROUND_SOURCE_DIR}/config/cmake/HDFMacros.cmake)
include (${H5BITROUND_SOURCE_DIR}/config/cmake/HDFPluginMacros.cmake)
include (${H5BITROUND_SOURCE_DIR}/config/CacheURLs.cmake)

SET_HDF_BUILD_TYPE()
endif ()
BASIC_SETTINGS (H5${BITROUND_PACKAGE_NAME})

set (H5BITROUND_VERS_MAJOR 1)
set (H5BITROUND_VERS_MINOR 0)
set (H5BITROUND_VERS_RELEASE 0)

set (H5BITROUND_SOVERS_MAJOR 1)
set (H5BITROUND_SOVERS_MINOR 0)
set (H5BITROUND_SOVERS_INTERFACE 1)
set (H5BITROUND_SOVERS_RELEASE 0)
math (EXPR H5BITROUND_SOVERS_MAJOR ${H5BITROUND_SOVERS_INTERFACE}-${H5BITROUND_SOVERS_RELEASE})

#-----------------------------------------------------------------------------
set (H5BITROUND_PACKAGE_VERSION "${H5BITROUND_VERS_MAJOR}.${H5BITROUND_VERS_MINOR}")
set (H5BITROUND_PACKAGE_VERSION_STRING "${H5BITROUND_PACKAGE_VERSION}")
set (H5BITROUND_PACKAGE_VERSION_MAJOR "${H5BITROUND_VERS_MAJOR}")
set (H5BITROUND_PACKAGE_VERSION_MINOR "${H5BITROUND_VERS_MINOR}")
set (H5BITROUND_PACKAGE_STRING "${H5BITROUND_PACKAGE_NAME} ${H5BITROUND_PACKAGE_VERSION}")
set (H5BITROUND_PACKAGE_TARNAME "${H5BITROUND_PACKAGE_NAME}{HDF_PACKAGE_EXT}")
set (H5BITROUND_PACKAGE_URL "http://www.hdfgroup.org")
set (H5BITROUND_PACKAGE_BUGREPORT "help@hdfgroup.org")
set (H5BITROUND_PACKAGE_SOVERSION "${H5BITROUND_SOVERS_MAJOR}.${H5BITROUND_SOVERS_RELEASE}.${H5BITROUND_SOVERS_MINOR}")
set (H5BITROUND_PACKAGE_SOVERSION_MAJOR "${H5BITROUND_SOVERS_MAJOR}")
message(STATUS "Configuring for bitround HDF5 Plugin version: " ${H5BITROUND_PACKAGE_STRING})

#-----------------------------------------------------------------------------
# Include some macros for reusable code
#-----------------------------------------------------------------------------
include (${H5BITROUND_RESOURCES_DIR}/H5BITROUNDMacros.cmake)

#-----------------------------------------------------------------------------
# Run all the CMake configuration tests for our build environment
#-----------------------------------------------------------------------------
include (${H5BITROUND_RESOURCES_DIR}/ConfigureChecks.cmake)

#-----------------------------------------------------------------------------
# HDF5 support
#-----------------------------------------------------------------------------
HDF5_SUPPORT (TRUE)
message (STATUS "H5BITROUND link libs: ${H5PL_LINK_LIBS}")

#-----------------------------------------------------------------------------
# Generate the bitround_config.h file containing user settings needed by compilation
#-----------------------------------------------------------------------------
configure_file (${H5BITROUND_RESOURCES_DIR}/config.h.in ${H5BITROUND_BINARY_DIR}/bitround_config.h @ONLY)

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)
#-----------------------------------------------------------------------------
option (BUILD_BITROUND_LIBRARY_SOURCE "build the bitround library within the plugin" ON)
if (NOT BUILD_BITROUND_LIBRARY_SOURCE)
if (H5PL_ALLOW_EXTERNAL_SUPPORT MATCHES "GIT" OR H5PL_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ")
option (BITROUND_USE_EXTERNAL "Use External Library Building for BITROUND" 1)
if (H5PL_ALLOW_EXTERNAL_SUPPORT MATCHES "GIT")
message (FATAL_ERROR " BITROUND has no compression only library repository")
elseif (H5PL_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ")
if (NOT H5PL_COMP_TGZPATH)
set (H5PL_COMP_TGZPATH ${H5BITROUND_SOURCE_DIR})
endif ()
set (BITROUND_URL ${H5PL_COMP_TGZPATH}/${BITROUND_TGZ_NAME})
else ()
set (BITROUND_USE_EXTERNAL 0)
endif ()
endif ()
#-----------------------------------------------------------------------------
# bitround Library Settings
#-----------------------------------------------------------------------------
if (NOT H5_BITROUND_HEADER)
if (NOT BITROUND_USE_EXTERNAL)
find_package (BITROUND NAMES ${BITROUND_PACKAGE_NAME}${HDF_PACKAGE_EXT} COMPONENTS static)
if (NOT BITROUND_FOUND)
find_package (BITROUND) # Legacy find
if (BITROUND_FOUND)
set (H5PL_LINK_LIBS ${H5PL_LINK_LIBS} ${BITROUND_LIBRARIES})
endif ()
endif ()
endif ()
if (BITROUND_FOUND)
set (H5_HAVE_BITROUND 1)
set (BITROUND_INCLUDE_DIR_GEN ${BITROUND_INCLUDE_DIR})
set (BITROUND_INCLUDE_DIRS ${BITROUND_INCLUDE_DIRS} ${BITROUND_INCLUDE_DIR})
else ()
if (H5PL_ALLOW_EXTERNAL_SUPPORT MATCHES "GIT" OR H5PL_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ")
EXTERNAL_BITROUND_LIBRARY (${H5PL_ALLOW_EXTERNAL_SUPPORT})
set (H5_HAVE_BITROUND 1)
message (STATUS "Filter BITROUND is built")
else ()
message (FATAL_ERROR " BITROUND is Required for ${H5BITROUND_PACKAGE_NAME} library")
endif ()
endif ()
endif ()
message (STATUS "bitround found: INC=${BITROUND_INCLUDE_DIR} TOOLS=${BITROUND_LIBRARIES}")
set (H5PL_LINK_LIBS ${H5PL_LINK_LIBS} ${BITROUND_LIBRARIES})

if (BITROUND_FOUND)
PACKAGE_BITROUND_LIBRARY (${H5PL_ALLOW_EXTERNAL_SUPPORT})
endif ()
endif ()
#-----------------------------------------------------------------------------

#-----------------------------------------------------------------------------
# Dashboard and Testing Settings
#-----------------------------------------------------------------------------
option (H5PL_BUILD_TESTING "Build h5bitround Unit Testing" OFF)
if (H5PL_BUILD_TESTING)
set (DART_TESTING_TIMEOUT 1200 CACHE STRING
"Timeout in seconds for each test (default 1200=20minutes)")
enable_testing ()
include (CTest)
include (${PROJECT_SOURCE_DIR}/CTestConfig.cmake)
configure_file (${${PLUGIN_PACKAGE_NAME}_RESOURCES_DIR}/CTestCustom.cmake ${PROJECT_BINARY_DIR}/CTestCustom.ctest @ONLY)
endif ()

add_subdirectory (src)

option (H5PL_BUILD_EXAMPLES "Build h5bitround Examples" OFF)
if (H5PL_BUILD_EXAMPLES)
add_subdirectory (example)
endif ()

#-----------------------------------------------------------------------------
# Add file(s) to CMake Install
#-----------------------------------------------------------------------------
INSTALL_SUPPORT (H5BITROUND)
36 changes: 36 additions & 0 deletions BITROUND/CTestConfig.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#
# Copyright by The HDF Group.
# All rights reserved.
#
# This file is part of HDF5. The full HDF5 copyright notice, including
# terms governing use, modification, and redistribution, is contained in
# the COPYING file, which can be found at the root of the source code
# distribution tree, or in https://www.hdfgroup.org/licenses.
# If you do not have access to either file, you may request a copy from
# help@hdfgroup.org.
#
## This file should be placed in the root directory of your project.
## Then modify the CMakeLists.txt file in the root directory of your
## project to incorporate the testing dashboard.
## # The following are required to uses Dart and the Cdash dashboard
## ENABLE_TESTING()
## INCLUDE(CTest)
set (CTEST_PROJECT_NAME "HDF5PLUGINS")
set (CTEST_NIGHTLY_START_TIME "18:00:00 CST")

set (CTEST_DROP_METHOD "https")
set (CTEST_DROP_SITE "cdash.hdfgroup.org")
set (CTEST_DROP_LOCATION "/submit.php?project=HDF5PLUGINS")
set (CTEST_DROP_SITE_CDASH TRUE)

set (UPDATE_TYPE git)
set (VALGRIND_COMMAND "/usr/bin/valgrind")
set (VALGRIND_COMMAND_OPTIONS "-v --tool=memcheck --leak-check=full --track-fds=yes --num-callers=50 --show-reachable=yes --track-origins=yes --malloc-fill=0xff --free-fill=0xfe")

set (CTEST_TEST_TIMEOUT 3600 CACHE STRING
"Maximum time allowed before CTest will kill the test.")
set (DART_TESTING_TIMEOUT 3600 CACHE STRING
"Maximum time allowed before CTest will kill the test." FORCE)

set (CTEST_SUBMIT_RETRY_DELAY 20 CACHE STRING
"How long to wait between timed-out CTest submissions.")
13 changes: 13 additions & 0 deletions BITROUND/Makefile.am
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Copyright by The HDF Group. All rights reserved.

# This builds the main BITROUND directory. This is the bitround
# filter. It's similar to the built in HDF5 shuffle filter, but works
# on a bit level instead of bytes.

# Allen Byrne, Ed Hartnett 1/15/19

# This directory stores libtool macros, put there by aclocal.
ACLOCAL_AMFLAGS = -I m4

# Build these subdirectories.
SUBDIRS = src #example
Loading
Loading