Skip to content

Commit

Permalink
Squashed 'src/H5Z-ZFP/' changes from cd5422c14..092190c38
Browse files Browse the repository at this point in the history
092190c38 Fix spelling errors (silx-kit#128)
b241ca0d0 Fix the CMake multiconfig var and test and tools handling (silx-kit#127)
7b33e4f19 Fix some make output issues (silx-kit#126)
51d221848 Documentation fixes and fixes from testing 1.1.1 (silx-kit#125)
4ae30429c CMake: (fix) HDF5 1.14.0 (silx-kit#121)
e1072ec5b Update Github actions  (silx-kit#118)
b021532ea Fix leak and consistify generic API with ZFP C API (silx-kit#117)
06408bb22 Enable CMake Testing (silx-kit#116)
eb5440043 Fix version info in docs
ad61dfa41 Revert "rework feat-cmake_tests CMake and replace scripts (silx-kit#111)" (silx-kit#115)
03b86413f rework feat-cmake_tests CMake and replace scripts (silx-kit#111)
08116fa9e Update README.md (silx-kit#114)
a10bd7bdb Merge branch 'master' of github.com:LLNL/H5Z-ZFP
1660d94a4 Fix h5repack test (silx-kit#107)
fd01bf1d7 mention generic interface
8d5ec2e74 Update docs (silx-kit#106)
c76f847d9 Added new endianness test (silx-kit#102)
8acf8244b fix reading of byte-swapped input files (silx-kit#95) (silx-kit#101)
62ab4eb6d Minor code clean-up. (silx-kit#103)
60032f640 Bugfix/hdf5 1.14.0 (silx-kit#99)
8fad85d72 CMake: (fix) MPI parallel HDF5 1.14.0 (silx-kit#97)
e81aec114 Don't flag a skipped test as a failed test.  (silx-kit#94)

git-subtree-dir: src/H5Z-ZFP
git-subtree-split: 092190c38d5760b3212ce4d96cced767b90aa189
  • Loading branch information
t20100 committed Sep 4, 2023
1 parent a4e000e commit 4f592ed
Show file tree
Hide file tree
Showing 38 changed files with 2,399 additions and 934 deletions.
57 changes: 38 additions & 19 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,19 @@ name: h5z-zfp

# Controls when the action will run.
#Triggers the workflow on push or pull requests.

# TODO: REMOVE feat-cmake_tests before merging
on:
push:
branches: [ master ]
branches: [ master ]
pull_request:
branches: [ master ]

# Using concurrency to cancel any in-progress job or run
concurrency:
group: ${{ github.workflow }}-${{ github.sha || github.event.pull_request.number }}
cancel-in-progress: true

# A workflow run is made up of one or more jobs that
# can run sequentially or in parallel
jobs:
Expand All @@ -32,17 +39,18 @@ jobs:
- name: Install Dependencies (Linux)
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -qq libhdf5-dev
sudo apt-get install -qq hdf5-tools
echo "HDF5_HOME=/usr/include/hdf5/serial,/usr/lib/x86_64-linux-gnu/hdf5/serial,/usr/bin" >> $GITHUB_ENV
echo "HDF5_HOME=/usr/include/hdf5/serial,/usr/lib/x86_64-linux-gnu/hdf5/serial,/usr/bin" >> $GITHUB_ENV
# Set env vars
echo "CC=gcc" >> $GITHUB_ENV
echo "FC=gfortran" >> $GITHUB_ENV
echo "CXX=g++" >> $GITHUB_ENV
# Checks-out the repository under $GITHUB_WORKSPACE so the job can access it.
- name: Get Sources
uses: actions/checkout@v2
uses: actions/checkout@v3

##################################
# INSTALL ZFP
Expand Down Expand Up @@ -71,11 +79,12 @@ jobs:
make check
shell: bash

- name: build (cmake)
- name: build (cmake) and test
run: |
mkdir build; cd build
cmake -D FORTRAN_INTERFACE=ON -D CMAKE_BUILD_TYPE=Release ..
make
cmake -D FORTRAN_INTERFACE=ON -D CMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON ..
sudo cmake --build . --target install
ctest -C Release .
shell: bash


Expand All @@ -87,7 +96,7 @@ jobs:
runs-on: windows-2019
steps:
- name: checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: install prerequisites
run: |
choco install \
Expand All @@ -98,10 +107,10 @@ jobs:
- name: download HDF5 for Windows
run: |
wget --quiet \
https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-1.12/hdf5-1.12.1/bin/windows/hdf5-1.12.1-Std-win10_64-vs16.zip
unzip hdf5-1.12.1-Std-win10_64-vs16.zip
https://support.hdfgroup.org//ftp/HDF5/releases/hdf5-1.14/hdf5-1.14.1/bin/windows/hdf5-1.14.1-2-Std-win10_64-vs16-clang.zip
unzip hdf5-1.14.1-2-Std-win10_64-vs16-clang.zip
- name: Install HDF5 for Windows
run: msiexec /i "hdf\HDF5-1.12.1-win64.msi" /qn
run: msiexec /i "hdf\HDF5-1.14.1-win64.msi" /qn
shell: cmd
- name: Download and install ZFP
run: |
Expand All @@ -111,23 +120,33 @@ jobs:
mkdir -p build
cd build
cmake .. \
-DCMAKE_BUILD_TYPE=Release \
-G "Visual Studio 16 2019" -A "x64" \
-DCMAKE_CONFIGURATION_TYPES=Release \
-DBUILD_UTILITIES=OFF \
-DBUILD_TESTING=OFF \
-DBUILD_CFP=ON \
-DZFP_BIT_STREAM_WORD_SIZE=8
cmake --build . -j 3
cmake --build . --target install
- name: update PATH
cmake --build . --config Release -j 3
cmake --build . --config Release --target install
- name: Set build and test variables
run: |
echo "C:/Program Files/HDF_Group/HDF5/1.12.1/bin" >> $GITHUB_PATH
- name: configure cmake
echo "C:/Program Files/H5Z_ZFP/plugin" >> $GITHUB_PATH
echo "C:/Program Files/ZFP/bin" >> $GITHUB_PATH
echo "C:/Program Files/ZFP/lib" >> $GITHUB_PATH
echo "C:/Program Files/HDF_Group/HDF5/1.14.1/bin" >> $GITHUB_PATH
echo "HDF5_PLUGIN_PATH=C:/Program Files/H5Z_ZFP/plugin" >> $GITHUB_ENV
echo "HDF5_DIR=C:/Program Files/HDF_Group/HDF5/1.14.1" >> $GITHUB_ENV
echo "HDF5_ROOT=C:/Program Files/HDF_Group/HDF5/1.14.1" >> $GITHUB_ENV
echo "ZFP_DIR=C:/Program Files/ZFP" >> $GITHUB_ENV
- name: Build H5Z-ZFP (CMake) and test
run: |
mkdir build
cd build
cmake .. \
-DCMAKE_BUILD_TYPE=Release \
-G "Visual Studio 16 2019" -A "x64" \
-DCMAKE_CONFIGURATION_TYPES=Release \
-DBUILD_TESTING=ON \
-DFORTRAN_INTERFACE=OFF \
-TClangCL
cmake --build . -j 3
cmake --build . --target install
cmake --build . --config Release --target install
ctest -C Release .
22 changes: 22 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# .readthedocs.yaml
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

# Required
version: 2

# Set the version of Python and other tools you might need
build:
os: ubuntu-22.04
tools:
python: "3.11"

# Build documentation in the docs/ directory with Sphinx
sphinx:
configuration: docs/conf.py

# We recommend specifying your dependencies to enable reproducible builds:
# https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html
# python:
# install:
# - requirements: docs/requirements.txt
54 changes: 49 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,24 @@ if (CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_CURRENT_BINARY_DIR)
"separate from the source directory")
endif ()

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()

get_property(_isMultiConfig GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)

#------------------------------------------------------------------------------#
# Parse version number from H5Zzfp_version.h
#------------------------------------------------------------------------------#
Expand All @@ -20,38 +38,64 @@ set(H5Z_ZFP_VERSION "${H5Z_ZFP_VERSION_MAJOR}.${H5Z_ZFP_VERSION_MINOR}.${H5Z_ZFP

project(H5Z_ZFP VERSION ${H5Z_ZFP_VERSION} LANGUAGES C)

# setup common output folders
include (cmake/HDFMacros.cmake)
SET_HDF_BUILD_TYPE()
DEFAULT_FOLDERS()

#------------------------------------------------------------------------------#
# Compile options.
#------------------------------------------------------------------------------#
option(FORTRAN_INTERFACE "Enable the Fortran interface" ON)
if (FORTRAN_INTERFACE)
enable_language(Fortran)
endif ()

#------------------------------------------------------------------------------#
# Some boilerplate to setup nice output directories
#------------------------------------------------------------------------------#
set(CMAKE_INSTALL_BINDIR bin)
set(CMAKE_INSTALL_LIBDIR lib)
set(CMAKE_INSTALL_INCLUDEDIR include)
set(CMAKE_INSTALL_CMAKEDIR lib/cmake/h5z_zfp)

#------------------------------------------------------------------------------#
# Required packages
#------------------------------------------------------------------------------#
# Find HDF5, relies on HDF5_DIR or HDF5_ROOT being set in environment.
set(COMPONENTS C)
if (FORTRAN_INTERFACE)
list(APPEND COMPONENTS Fortran)
HDF5_SUPPORT ()
if (NOT HDF5_FOUND)
message (FATAL_ERROR "HDF5 is Required for h5z_zfp")
endif ()
find_package(HDF5 REQUIRED COMPONENTS ${COMPONENTS})

# Find MPI depending on if HDF5 needs MPI.
if ((HDF5_IS_PARALLEL OR HDF5_ENABLE_PARALLEL) AND ("${HDF5_VERSION}" VERSION_EQUAL "1.14.0"))
find_package(MPI REQUIRED COMPONENTS C)
endif()

# Find ZFP, relies on ZFP_DIR or ZFP_ROOT being set in environment.
find_package(ZFP REQUIRED CONFIG)
if (NOT ZFP_FOUND)
message (FATAL_ERROR "ZFP is Required for h5z_zfp")
endif ()

#------------------------------------------------------------------------------#
# Add source
#------------------------------------------------------------------------------#
add_subdirectory(${CMAKE_SOURCE_DIR}/src)

#-----------------------------------------------------------------------------
# Dashboard and Testing Settings
#-----------------------------------------------------------------------------
option (BUILD_TESTING "Build h5z-zfp Unit Testing" OFF)
if (BUILD_TESTING)
set (DART_TESTING_TIMEOUT 1200 CACHE STRING
"Timeout in seconds for each test (default 1200=20minutes)")
enable_testing ()
include (CTest)

add_subdirectory(${CMAKE_SOURCE_DIR}/test)
endif ()

#------------------------------------------------------------------------------#
# Packaging
#------------------------------------------------------------------------------#
Expand Down
39 changes: 28 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,38 +1,55 @@
include config.make
# Include config.make only if we're not looking for help
ifeq ($(findstring help, $(strip $(MAKECMDGOALS))),)
ifeq ($(findstring tools, $(strip $(MAKECMDGOALS))),)
ifeq ($(findstring clean, $(strip $(MAKECMDGOALS))),)
ifeq ($(findstring dist, $(strip $(MAKECMDGOALS))),)
include config.make
endif
endif
endif
endif

# Get version string from H5Z-ZFP
H5Z_ZFP_VERSINFO := $(shell grep '^\#define H5Z_FILTER_ZFP_VERSION_[MP]' src/H5Zzfp_version.h | cut -d' ' -f3 | tr '\n' '.' | cut -d'.' -f-3 2>/dev/null)

.PHONY: help all clean dist install

help:
@echo ""
@echo ""
@echo ""
@echo " This is H5Z-ZFP version $(H5Z_ZFP_VERSINFO)."
@echo " This is H5Z-ZFP version $(H5Z_ZFP_VERSINFO)."
@echo "See http://h5z-zfp.readthedocs.io/en/latest/ file for more info."
@echo ""
@echo "Typical make command is..."
@echo ""
@echo " make CC=<C-compiler> HDF5_HOME=<path> ZFP_HOME=<path> PREFIX=<path> all"
@echo ""
@echo "where <path> is a dir whose children are include/lib/bin subdirs."
@echo "HDF5_HOME can also be specified by the HDF5 include directory,"
@echo "library directory and bin directory separated by commas, i.e. HDF5_HOME=INC,LIB,BIN"
@echo "HDF5_HOME can also be set using an INC,LIB,BIN triplet specifying"
@echo "HDF5 include, library and binary dirs separated by commas."
@echo "Standard make variables (e.g. CFLAGS, LD, etc.) can be set as usual."
@echo "Optionally, add FC=<fortran-compiler> to include Fortran support and tests."
@echo ""
@echo "Available make targets are..."
@echo " all - build everything"
@echo " check - all + run tests"
@echo " install - install compiled components"
@echo " clean - clean away all derived targets"
@echo " dist - create distribution tarfile"
@echo " all - build everything needed for H5Z-ZFP plugin/lib"
@echo " check - all + run tests"
@echo " tools - build tools (currently just print_h5repack_farg)"
@echo " install - install plugin/lib"
@echo " clean - clean away all derived targets"
@echo " dist - create distribution tarfile"
@echo " help - this help message"

all:
cd src; $(MAKE) $(MAKEVARS) $@

check: all install
check: all
cd test; $(MAKE) $(MAKEVARS) $@

install:
tools:
cd test; $(MAKE) $(MAKEVARS) print_h5repack_farg

install: all
cd src; $(MAKE) $(MAKEVARS) $@

clean:
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@ compression plugin for the HDF5 library using ZFP compression.
For information about ZFP compression and the BSD-Licensed ZFP
library, see...

- https://computation.llnl.gov/projects/floating-point-compression
- https://computing.llnl.gov/projects/zfp
- https://github.com/LLNL/zfp

For information about HDF5 filter plugins, see...

- https://support.hdfgroup.org/HDF5/doc/Advanced/DynamicallyLoadedFilters

This H5Z-ZFP plugin supports ZFP versions 0.5.0 through 0.5.5.
This H5Z-ZFP plugin supports ZFP versions 0.5.0 and newer.

This plugin uses the [*registered*](https://support.hdfgroup.org/services/filters.html#zfp)
This plugin uses the [*registered*](https://portal.hdfgroup.org/display/support/Filters#Filters-32013)
HDF5 plugin filter id 32013

The HDF5 filter plugin code here is also part of the Silo library.
Expand All @@ -28,7 +28,7 @@ package due to the likely broad appeal and utility of the ZFP
compression library.

This plugin supports all modes of the ZFP compression library, *rate*,
*accuracy*, *precision*, *expert* and *lossless*. It supports 1, 2, 3 and
*accuracy*, *precision*, *expert* and *reversible*. It supports 1, 2, 3 and
4 dimensional datasets (for ZFP version 0.5.5 and newer) of single and double
precision integer and floating point data. It can be applied to HDF5 datasets
of more than 3 dimensions (or 4 dimensions for ZFP versions 0.5.5 and newer)
Expand Down
Loading

0 comments on commit 4f592ed

Please sign in to comment.