Skip to content

Commit

Permalink
Merge pull request HDFGroup#4659 from HDFGroup/develop
Browse files Browse the repository at this point in the history
Keep up-to-date with develop
  • Loading branch information
vchoi-hdfgroup authored Jul 17, 2024
2 parents 4f7891e + a8dcba2 commit 8928216
Show file tree
Hide file tree
Showing 113 changed files with 7,402 additions and 927 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main-cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ jobs:
# but that seems unnecessary
- name: "MacOS Clang"
os: macos-latest
cpp: OFF
cpp: ON
fortran: ON
java: ON
docs: ON
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/vol_adios2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ jobs:
- name: Checkout HDF5
uses: actions/checkout@v4.1.7
with:
repository: HDFGroup/hdf5
path: hdf5

- name: Configure HDF5
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/vol_async.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ jobs:
- name: Checkout HDF5
uses: actions/checkout@v4.1.7
with:
repository: HDFGroup/hdf5
path: hdf5

- name: Checkout Argobots
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/vol_cache.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ jobs:
- name: Checkout HDF5
uses: actions/checkout@v4.1.7
with:
repository: HDFGroup/hdf5
path: hdf5

- name: Checkout Argobots
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/vol_ext_passthru.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ jobs:
- name: Checkout HDF5
uses: actions/checkout@v4.1.7
with:
repository: HDFGroup/hdf5
path: hdf5

- name: Checkout vol-external-passthrough
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/vol_log.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ jobs:
- name: Checkout HDF5
uses: actions/checkout@v4.1.7
with:
repository: HDFGroup/hdf5
path: hdf5

# Log-based VOL currently doesn't have CMake support
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/vol_rest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ jobs:
- name: Checkout HDF5
uses: actions/checkout@v4.1.7
with:
repository: HDFGroup/hdf5
path: hdf5

- name: Configure HDF5 with REST VOL connector
Expand Down
27 changes: 23 additions & 4 deletions CMakeFilters.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
# help@hdfgroup.org.
#
option (HDF5_USE_ZLIB_NG "Use zlib-ng library as zlib library" OFF)
option (HDF5_USE_LIBAEC_STATIC "Use static AEC library" OFF)
option (HDF5_USE_ZLIB_STATIC "Find static zlib library" OFF)
option (HDF5_USE_LIBAEC_STATIC "Find static AEC library" OFF)
option (ZLIB_USE_EXTERNAL "Use External Library Building for ZLIB" OFF)
option (SZIP_USE_EXTERNAL "Use External Library Building for SZIP" OFF)

Expand Down Expand Up @@ -86,16 +87,29 @@ if (HDF5_ENABLE_Z_LIB_SUPPORT)
set (PACKAGE_NAME ${ZLIB_PACKAGE_NAME}${HDF_PACKAGE_EXT})
endif ()
set(ZLIB_FOUND FALSE)
find_package (ZLIB NAMES ${PACKAGE_NAME} COMPONENTS static shared)
if (HDF5_USE_ZLIB_STATIC)
set(ZLIB_SEACH_TYPE static)
else ()
set(ZLIB_SEACH_TYPE shared)
endif ()
find_package (ZLIB NAMES ${PACKAGE_NAME} COMPONENTS ${ZLIB_SEACH_TYPE})
if (NOT ZLIB_FOUND)
if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.24.0")
set(ZLIB_USE_STATIC_LIBS ${HDF5_USE_ZLIB_STATIC})
endif()
find_package (ZLIB) # Legacy find
endif ()
set(H5_ZLIB_FOUND ${ZLIB_FOUND})
if (H5_ZLIB_FOUND)
set (H5_ZLIB_HEADER "zlib.h")
set (H5_ZLIB_INCLUDE_DIR_GEN ${ZLIB_INCLUDE_DIR})
set (H5_ZLIB_INCLUDE_DIRS ${H5_ZLIB_INCLUDE_DIRS} ${ZLIB_INCLUDE_DIR})
set (LINK_COMP_LIBS ${LINK_COMP_LIBS} ${ZLIB_LIBRARIES})
# The FindZLIB.cmake module does not set an OUTPUT_NAME
# on the target. The target returned is: ZLIB::ZLIB
get_filename_component (libname ${ZLIB_LIBRARIES} NAME_WLE)
string (REGEX REPLACE "^lib" "" libname ${libname})
set_target_properties (ZLIB::ZLIB PROPERTIES OUTPUT_NAME zlib-static)
set (LINK_COMP_LIBS ${LINK_COMP_LIBS} ZLIB::ZLIB)
endif ()
else ()
if (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "GIT" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ")
Expand Down Expand Up @@ -131,9 +145,14 @@ option (HDF5_ENABLE_SZIP_SUPPORT "Use SZip Filter" ON)
if (HDF5_ENABLE_SZIP_SUPPORT)
option (HDF5_ENABLE_SZIP_ENCODING "Use SZip Encoding" ON)
if (NOT SZIP_USE_EXTERNAL)
if (HDF5_USE_LIBAEC_STATIC)
set(LIBAEC_SEACH_TYPE static)
else ()
set(LIBAEC_SEACH_TYPE shared)
endif ()
set(libaec_USE_STATIC_LIBS ${HDF5_USE_LIBAEC_STATIC})
set(SZIP_FOUND FALSE)
find_package (SZIP NAMES ${LIBAEC_PACKAGE_NAME}${HDF_PACKAGE_EXT} COMPONENTS static shared)
find_package (SZIP NAMES ${LIBAEC_PACKAGE_NAME}${HDF_PACKAGE_EXT} COMPONENTS ${LIBAEC_SEACH_TYPE})
if (NOT SZIP_FOUND)
find_package (SZIP) # Legacy find
endif ()
Expand Down
3 changes: 0 additions & 3 deletions CMakeInstallation.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -272,9 +272,6 @@ if (NOT HDF5_EXTERNALLY_CONFIGURED AND NOT HDF5_NO_PACKAGES)
if (WIN32)
set (CPACK_GENERATOR "ZIP")

if (NSIS_EXECUTABLE)
list (APPEND CPACK_GENERATOR "NSIS")
endif ()
# Installers for 32- vs. 64-bit CMake:
# - Root install directory (displayed to end user at installer-run time)
# - "NSIS package/display name" (text used in the installer GUI)
Expand Down
11 changes: 11 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,17 @@ if (CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_CURRENT_BINARY_DIR)
)
endif ()

# Whether the most recently called project() command, in the current scope or above,
# was in the top level CMakeLists.txt file.
if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.21.0")
if(NOT PROJECT_IS_TOP_LEVEL)
set (HDF5_EXTERNALLY_CONFIGURED 1)
endif()
else()
if (NOT CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR)
set (HDF5_EXTERNALLY_CONFIGURED 1)
endif()
endif()
#-----------------------------------------------------------------------------
# Instructions for use : Sub-Project Build
#
Expand Down
4 changes: 3 additions & 1 deletion CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@
"HDF5_PACKAGE_EXTLIBS": "ON",
"HDF5_USE_ZLIB_NG": "OFF",
"ZLIB_USE_LOCALCONTENT": "OFF",
"LIBAEC_USE_LOCALCONTENT": "OFF"
"LIBAEC_USE_LOCALCONTENT": "OFF",
"HDF5_USE_ZLIB_STATIC": "ON",
"HDF5_USE_LIBAEC_STATIC": "ON"
}
},
{
Expand Down
221 changes: 221 additions & 0 deletions HDF5Examples/C/H5D/test-pc.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,221 @@
#! /bin/sh
#
# 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 is for use of h5cc created with the CMake process
# HDF5_HOME is expected to be set

srcdir=..
builddir=.
verbose=yes
nerrors=0

# HDF5 compile commands, assuming they are in your $PATH.
H5CC=$HDF5_HOME/bin/h5cc
LD_LIBRARY_PATH=$HDF5_HOME/lib
export LD_LIBRARY_PATH

if ! test -f $H5CC; then
echo "Set paths for H5CC and LD_LIBRARY_PATH in test.sh"
echo "Set environment variable HDF5_HOME to the hdf5 install dir"
echo "h5cc was not found at $H5CC"
exit $EXIT_FAILURE
fi

H5DUMP=`echo $H5CC | sed -e 's/\/[^/]*$/\/h5dump/'`;
H5_LIBVER=$($H5CC -showconfig | grep -i "HDF5 Version:" | sed 's/^.* //g' | sed 's/[-].*//g')
H5_APIVER=$($H5CC -showconfig | grep -i "Default API mapping:" | sed 's/^.* //g' | sed 's/v//g' | sed 's/1/1_/')

H5_MAJORVER=$(echo $H5_LIBVER | cut -f1 -d'.' | sed -E 's/\./_/g')
H5_MINORVER=$(echo $H5_LIBVER | cut -f2 -d'.' | sed -E 's/\./_/g')
H5_RELEASEVER=$(echo $H5_LIBVER | cut -f3 -d'.' | sed -E 's/\./_/g')
H5_LIBVER_DIR=$H5_MAJORVER$H5_MINORVER

# Shell commands used in Makefiles
RM="rm -rf"
DIFF="diff -c"
CMP="cmp -s"
GREP='grep'
CP="cp -p" # Use -p to preserve mode,ownership,timestamps
DIRNAME='dirname'
LS='ls'
AWK='awk'

# setup plugin path
ENVCMD="env HDF5_PLUGIN_PATH=$LD_LIBRARY_PATH/plugin"

TESTDIR=$builddir


case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
*c*,-n*) ECHO_N= ECHO_C='
' ;;
*c*,* ) ECHO_N=-n ECHO_C= ;;
*) ECHO_N= ECHO_C='\c' ;;
esac
ECHO_N="echo $ECHO_N"


exout() {
$*
}

dumpout() {
$H5DUMP $*
}

# compare current version, required version.
# returns if cur_ver < req_ver is true.
version_compare() {
version_lt=0
if [ ! "$(printf '%s\n' "$1" "$2" | sort -V | head -n1)" = "$2" ]; then
version_lt=1
fi
}


topics="alloc checksum chunk compact extern fillval gzip hyper \
rdwr shuffle szip unlimadd unlimgzip unlimmod"
topics18=""

version_compare "$H5_LIBVER" "1.8.0"
# check if HDF5 version is < 1.8.0
if [ "$version_lt" = 1 ]; then
dir16="/16"
else
dir16=""
topics18="nbit sofloat soint transform"
fi

return_val=0

#Remove external data file from h5ex_d_extern
rm -f h5ex_d_extern.data

for topic in $topics
do
$H5CC $srcdir/h5ex_d_$topic.c -o h5ex_d_$topic
done

for topic in $topics
do
fname=h5ex_d_$topic
$ECHO_N "Testing C/H5D/$fname...$ECHO_C"
exout .$dir16/$fname >tmp.test
status=$?
if test $status -eq 1
then
echo " Unsupported feature"
status=0
else
cmp -s tmp.test $srcdir/tfiles/16/$fname.tst
status=$?
if test $status -ne 0
then
echo " FAILED!"
else
dumpout $fname.h5 >tmp.test
rm -f $fname.h5
cmp -s tmp.test $srcdir/tfiles/16/$fname.ddl
status=$?
if test $status -ne 0
then
echo " FAILED!"
else
echo " Passed"
fi
fi
return_val=`expr $status + $return_val`
fi
done

#######Non-standard tests#######
USE_ALT=""
### Set default tfiles directory for tests
nbitdir="18"
version_compare "$H5_LIBVER" "1.8.23"
# check if HDF5 version is < 1.8.23
if [ "$version_lt" = 1 ]; then
USE_ALT="22"
else
# check if HDF5 version is >= 1.10.0 and < 1.10.8
version_compare "$H5_LIBVER" "1.10.0"
if [ "$version_lt" = 0 ]; then
version_compare "$H5_LIBVER" "1.10.8"
if [ "$version_lt" = 1 ]; then
USE_ALT="07"
nbitdir="110"
fi
fi
fi

for topic in $topics18
do
$H5CC $srcdir/h5ex_d_$topic.c -o h5ex_d_$topic
done

for topic in $topics18
do
fname=h5ex_d_$topic
$ECHO_N "Testing C/H5D/$fname...$ECHO_C"
exout ./$fname >tmp.test
status=$?
if test $status -eq 1
then
echo " Unsupported feature"
status=0
else
if [[ $fname == "h5ex_d_nbit" ]]
then
tdir=$nbitdir
if [[ $USE_ALT == "" ]]
then
### set USE_ALT=07 if not set above
USE_ALT="07"
fi
else
tdir=18
### unset USE_ALT for the other topics
USE_ALT=""
fi
cmp -s tmp.test $srcdir/tfiles/18/$fname.tst
status=$?
if test $status -ne 0
then
echo " FAILED!"
else
if [[ $fname == "h5ex_d_transform" ]]
then
targ="-n"
else
targ=""
fi
dumpout $targ $fname.h5 >tmp.test
rm -f $fname.h5
cmp -s tmp.test $srcdir/tfiles/$tdir/$fname$USE_ALT.ddl
status=$?
if test $status -ne 0
then
echo " FAILED!"
else
echo " Passed"
fi
fi
return_val=`expr $status + $return_val`
fi
done


#Remove external data file from h5ex_d_extern
rm -f h5ex_d_extern.data
rm -f tmp.test
echo "$return_val tests failed in C/H5D/"
exit $return_val
Loading

0 comments on commit 8928216

Please sign in to comment.