-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Squashed 'src/H5Z-ZFP/' changes from 5d9a995..cd5422c
cd5422c Compatibility with Visual Studio 2019 (#93) bcff4d2 CMake: (fix) Missing header file. (#90) 59b7f38 updating for 1.0.0 (#85) 3802c0f Tests: (fix) Makefile - CFLAGS and clean target (#84) 111e5a1 Fix Silo doc section and warnings (#83) 9dd4546 Use ZFP's version string (#80) 557a4f6 Pin zfp version in windows ci (#82) f51ac59 added parameter to fortran const (#76) 35a08e0 [github] add windows build config (#72) 1844b5b Fixed detection of CFP availability (#74) c8544d3 [windows] enable compilation in windows with ClangCL (#71) 7b34cac Update installation.rst (#66) e153bf9 Feature direct write zfp array (#43) 20b0f1f Added missing HDF5 include (CMake) (#63) 20b893a Test and fix working with HDF5-1.12 (#62) 497e942 CMake: (fix) Autotools build HDF5 (#59) 8f63f7d Add missing headers for string functions and fix printfs for cd_nelmts (#60) 8de12f7 Added generic interface fortran wrappers with tests (#58) 983a187 find zfp and hdf5 in lib64 instead of lib (#56) e6c9c14 Fix typos f7670c4 Fix second typo in h5repack docs (#55) 57a849d handle optional/mandatory flag (#54) 48126d3 CMake: (feature) Added CMake build configuration (#52) bee7434 fix link to travis badge (#51) 00146c1 update to download from github (#49) 259feb8 Remove include for HDF5 header file (#48) 3d0b176 adding missing call to h5z_zfp_finaliz() (#45) b642fe8 minor fixes to docs and h5repack utility (#42) git-subtree-dir: src/H5Z-ZFP git-subtree-split: cd5422c146836e17c7a0380bfb05cf52d0c4467c
- Loading branch information
Showing
33 changed files
with
1,634 additions
and
306 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,133 @@ | ||
name: h5z-zfp | ||
|
||
# Controls when the action will run. | ||
#Triggers the workflow on push or pull requests. | ||
on: | ||
push: | ||
branches: [ master ] | ||
pull_request: | ||
branches: [ master ] | ||
|
||
# A workflow run is made up of one or more jobs that | ||
# can run sequentially or in parallel | ||
jobs: | ||
# This workflow contains a single job called "build" | ||
linux-build: | ||
strategy: | ||
matrix: | ||
name: ["Ubuntu Latest GCC"] | ||
include: | ||
- name: "Ubuntu Latest GCC" | ||
artifact: "Linux.tar.xz" | ||
os: ubuntu-latest | ||
|
||
name: ${{ matrix.name }} | ||
# The type of runner that the job will run on. | ||
runs-on: ${{ matrix.os }} | ||
if: "!contains(github.event.head_commit.message, 'skip-ci')" | ||
|
||
# Steps represent a sequence of tasks that will be executed | ||
# as part of the job. | ||
steps: | ||
- name: Install Dependencies (Linux) | ||
if: matrix.os == 'ubuntu-latest' | ||
run: | | ||
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 | ||
# 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 | ||
|
||
################################## | ||
# INSTALL ZFP | ||
################################## | ||
|
||
- name: install ZFP | ||
run: | | ||
git clone https://github.com/LLNL/zfp.git | ||
export HOME_DIR=$(echo ~) | ||
cd zfp | ||
git checkout 1.0.0 | ||
mkdir build;cd build | ||
cmake -D ZFP_BIT_STREAM_WORD_SIZE=8 -D BUILD_CFP=ON -D CMAKE_INSTALL_PREFIX=$PWD/zfp -D BUILD_TESTING=OFF -D BUILD_UTILITIES=OFF .. | ||
make install | ||
echo "ZFP_HOME=$PWD/zfp" >> $GITHUB_ENV | ||
echo "ZFP_DIR=$PWD/zfp" >> $GITHUB_ENV | ||
shell: bash | ||
|
||
################################## | ||
# BUILD AND TEST H5Z-ZFP | ||
################################## | ||
|
||
- name: build (autotools) and check | ||
run: | | ||
make all | ||
make check | ||
shell: bash | ||
|
||
- name: build (cmake) | ||
run: | | ||
mkdir build; cd build | ||
cmake -D FORTRAN_INTERFACE=ON -D CMAKE_BUILD_TYPE=Release .. | ||
make | ||
shell: bash | ||
|
||
|
||
windows-build: | ||
name: 'Windows MSVC/Clang' | ||
defaults: | ||
run: | ||
shell: bash | ||
runs-on: windows-2019 | ||
steps: | ||
- name: checkout repository | ||
uses: actions/checkout@v2 | ||
- name: install prerequisites | ||
run: | | ||
choco install \ | ||
unzip \ | ||
wget | ||
- name: setup MSVC Tools | ||
uses: ilammy/msvc-dev-cmd@v1 | ||
- 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 | ||
- name: Install HDF5 for Windows | ||
run: msiexec /i "hdf\HDF5-1.12.1-win64.msi" /qn | ||
shell: cmd | ||
- name: Download and install ZFP | ||
run: | | ||
git clone https://github.com/LLNL/zfp.git | ||
cd zfp | ||
git checkout 1.0.0 | ||
mkdir -p build | ||
cd build | ||
cmake .. \ | ||
-DCMAKE_BUILD_TYPE=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 | ||
run: | | ||
echo "C:/Program Files/HDF_Group/HDF5/1.12.1/bin" >> $GITHUB_PATH | ||
- name: configure cmake | ||
run: | | ||
mkdir build | ||
cd build | ||
cmake .. \ | ||
-DCMAKE_BUILD_TYPE=Release \ | ||
-DFORTRAN_INTERFACE=OFF \ | ||
-TClangCL | ||
cmake --build . -j 3 | ||
cmake --build . --target install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
cmake_minimum_required(VERSION 3.9) | ||
|
||
# Fail immediately if not using an out-of-source build | ||
if (CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_CURRENT_BINARY_DIR) | ||
message(FATAL_ERROR | ||
"In-source builds are not supported. Please create a build directory " | ||
"separate from the source directory") | ||
endif () | ||
|
||
#------------------------------------------------------------------------------# | ||
# Parse version number from H5Zzfp_version.h | ||
#------------------------------------------------------------------------------# | ||
file(STRINGS "${CMAKE_CURRENT_SOURCE_DIR}/src/H5Zzfp_version.h" H5Z_ZFP_H REGEX "^\#define H5Z_FILTER_ZFP_VERSION_MAJOR") | ||
string(REGEX REPLACE "^.*MAJOR " "" H5Z_ZFP_VERSION_MAJOR "${H5Z_ZFP_H}") | ||
file(STRINGS "${CMAKE_CURRENT_SOURCE_DIR}/src/H5Zzfp_version.h" H5Z_ZFP_H REGEX "^\#define H5Z_FILTER_ZFP_VERSION_MINOR") | ||
string(REGEX REPLACE "^.*MINOR " "" H5Z_ZFP_VERSION_MINOR "${H5Z_ZFP_H}") | ||
file(STRINGS "${CMAKE_CURRENT_SOURCE_DIR}/src/H5Zzfp_version.h" H5Z_ZFP_H REGEX "^\#define H5Z_FILTER_ZFP_VERSION_PATCH") | ||
string(REGEX REPLACE "^.*PATCH " "" H5Z_ZFP_VERSION_PATCH "${H5Z_ZFP_H}") | ||
set(H5Z_ZFP_VERSION "${H5Z_ZFP_VERSION_MAJOR}.${H5Z_ZFP_VERSION_MINOR}.${H5Z_ZFP_VERSION_PATCH}") | ||
|
||
project(H5Z_ZFP VERSION ${H5Z_ZFP_VERSION} LANGUAGES C) | ||
|
||
#------------------------------------------------------------------------------# | ||
# 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_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) | ||
endif () | ||
find_package(HDF5 REQUIRED COMPONENTS ${COMPONENTS}) | ||
|
||
# Find ZFP, relies on ZFP_DIR or ZFP_ROOT being set in environment. | ||
find_package(ZFP REQUIRED CONFIG) | ||
|
||
#------------------------------------------------------------------------------# | ||
# Add source | ||
#------------------------------------------------------------------------------# | ||
add_subdirectory(${CMAKE_SOURCE_DIR}/src) | ||
|
||
#------------------------------------------------------------------------------# | ||
# Packaging | ||
#------------------------------------------------------------------------------# | ||
# Install h5z_zfp-config.cmake and h5z_zfp-config-version.cmake | ||
set(H5Z_ZFP_CONFIG_IN ${CMAKE_CURRENT_SOURCE_DIR}/cmake/h5z_zfp-config.cmake.in) | ||
set(H5Z_ZFP_CONFIG_OUT ${CMAKE_CURRENT_BINARY_DIR}/cmake/h5z_zfp-config.cmake) | ||
configure_file(${H5Z_ZFP_CONFIG_IN} ${H5Z_ZFP_CONFIG_OUT} @ONLY) | ||
set(H5Z_ZFP_CONFIG_VERSION_IN ${CMAKE_CURRENT_SOURCE_DIR}/cmake/h5z_zfp-config-version.cmake.in) | ||
set(H5Z_ZFP_CONFIG_VERSION_OUT ${CMAKE_CURRENT_BINARY_DIR}/cmake/h5z_zfp-config-version.cmake) | ||
configure_file(${H5Z_ZFP_CONFIG_VERSION_IN} ${H5Z_ZFP_CONFIG_VERSION_OUT} @ONLY) | ||
install(FILES ${H5Z_ZFP_CONFIG_OUT} | ||
DESTINATION ${CMAKE_INSTALL_CMAKEDIR}) | ||
install(FILES ${H5Z_ZFP_CONFIG_VERSION_OUT} | ||
DESTINATION ${CMAKE_INSTALL_CMAKEDIR}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
set(PACKAGE_VERSION_MAJOR @PROJECT_VERSION_MAJOR@) | ||
set(PACKAGE_VERSION_MINOR @PROJECT_VERSION_MINOR@) | ||
set(PACKAGE_VERSION_PATCH @PROJECT_VERSION_PATCH@) | ||
set(PACKAGE_VERSION @PROJECT_VERSION@) | ||
|
||
# Check whether the requested PACKAGE_FIND_VERSION is compatible | ||
if(PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION OR | ||
PACKAGE_VERSION_MAJOR GREATER PACKAGE_FIND_VERSION_MAJOR) | ||
set(PACKAGE_VERSION_COMPATIBLE FALSE) | ||
else() | ||
set(PACKAGE_VERSION_COMPATIBLE TRUE) | ||
if(PACKAGE_VERSION VERSION_EQUAL PACKAGE_FIND_VERSION) | ||
set(PACKAGE_VERSION_EXACT TRUE) | ||
endif() | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
# h5z_zfp-config.cmake | ||
# -------------------- | ||
# | ||
# Finds the H5Z_ZFP library, specify the starting search path in H5Z_ZFP_ROOT | ||
# | ||
# Static vs. shared | ||
# ----------------- | ||
# To make use of the static library instead of the shared one, one needs | ||
# to set the variable H5Z_ZFP_USE_STATIC_LIBS to ON before calling find_package. | ||
# Example: | ||
# set(H5Z_ZFP_USE_STATIC_LIBS ON) | ||
# find_package(H5Z_ZFP REQUIRED CONFIG) | ||
# | ||
# This will define the following variables: | ||
# | ||
# H5Z_ZFP_FOUND - True if the system has the H5Z_ZFP library. | ||
# H5Z_ZFP_WITH_OPENMP - True if the zfp library has been built with OpenMP support. | ||
# | ||
# and the following imported targets: | ||
# | ||
# h5z_zfp::h5z_zfp - The H5Z_ZFP library. | ||
|
||
find_path(H5Z_ZFP_INCLUDE_DIR NAMES H5Zzfp.h DOC "H5Z_ZFP include directory") | ||
if(H5Z_ZFP_USE_STATIC_LIBS) | ||
find_library(H5Z_ZFP_LIBRARY NAMES libh5zzfp.a DOC "H5Z_ZFP library") | ||
else() | ||
find_library(H5Z_ZFP_LIBRARY NAMES libh5zzfp.so HINTS $ENV{H5Z_ZFP_ROOT}/plugin DOC "H5Z_ZFP library") | ||
endif() | ||
|
||
include(FindPackageHandleStandardArgs) | ||
set(${CMAKE_FIND_PACKAGE_NAME}_CONFIG "${CMAKE_CURRENT_LIST_FILE}") | ||
find_package_handle_standard_args(H5Z_ZFP | ||
FOUND_VAR H5Z_ZFP_FOUND | ||
REQUIRED_VARS H5Z_ZFP_LIBRARY H5Z_ZFP_INCLUDE_DIR | ||
CONFIG_MODE | ||
) | ||
|
||
if(H5Z_ZFP_FOUND) | ||
set(HDF5_USE_STATIC_LIBRARIES ${H5Z_ZFP_USE_STATIC_LIBS}) | ||
find_package(HDF5 MODULE REQUIRED COMPONENTS C) | ||
find_package(ZFP REQUIRED CONFIG) | ||
if(H5Z_ZFP_USE_STATIC_LIBS) | ||
add_library(h5z_zfp::h5z_zfp STATIC IMPORTED) | ||
else() | ||
add_library(h5z_zfp::h5z_zfp SHARED IMPORTED) | ||
endif() | ||
set_target_properties(h5z_zfp::h5z_zfp PROPERTIES | ||
IMPORTED_LOCATION "${H5Z_ZFP_LIBRARY}" | ||
INTERFACE_INCLUDE_DIRECTORIES "${H5Z_ZFP_INCLUDE_DIR}" | ||
INTERFACE_LINK_LIBRARIES "zfp::zfp;${HDF5_LIBRARIES}" | ||
LINK_LIBRARIES "zfp::zfp;${HDF5_LIBRARIES}" | ||
) | ||
set(H5Z_ZFP_WITH_OPENMP ${ZFP_WITH_OPENMP}) | ||
endif() | ||
|
||
mark_as_advanced( | ||
H5Z_ZFP_INCLUDE_DIR | ||
H5Z_ZFP_LIBRARY | ||
) |
Oops, something went wrong.