summaryrefslogtreecommitdiffstats
path: root/tools/h5repack
diff options
context:
space:
mode:
authorDana Robinson <derobins@hdfgroup.org>2015-05-07 21:05:14 (GMT)
committerDana Robinson <derobins@hdfgroup.org>2015-05-07 21:05:14 (GMT)
commit984ecb72c2fa62d233383b24047e04061754ae34 (patch)
treea0a1ce905153a08466dae1354e14d426c86b3849 /tools/h5repack
parented599421c5ef01347368d50b1b7dbed3b323c43f (diff)
parent8f82c9b8be875cd28e18402e920f8e162d8f8d38 (diff)
downloadhdf5-984ecb72c2fa62d233383b24047e04061754ae34.zip
hdf5-984ecb72c2fa62d233383b24047e04061754ae34.tar.gz
hdf5-984ecb72c2fa62d233383b24047e04061754ae34.tar.bz2
[svn-r27038] Merge of r26393-27031 from the trunk.
Tested on 64-bit linux VM w/ C++ and Fortran 2003
Diffstat (limited to 'tools/h5repack')
-rw-r--r--tools/h5repack/CMakeLists.txt12
-rw-r--r--tools/h5repack/CMakeTests.cmake134
-rw-r--r--tools/h5repack/h5repack.sh.in8
-rw-r--r--tools/h5repack/testfiles/README5
-rw-r--r--tools/h5repack/testfiles/h5repack_nested_8bit_enum.h5bin0 -> 273992 bytes
-rw-r--r--tools/h5repack/testfiles/h5repack_nested_8bit_enum_deflated.h5bin0 -> 120630 bytes
6 files changed, 50 insertions, 109 deletions
diff --git a/tools/h5repack/CMakeLists.txt b/tools/h5repack/CMakeLists.txt
index f6c3050..42d9f3d 100644
--- a/tools/h5repack/CMakeLists.txt
+++ b/tools/h5repack/CMakeLists.txt
@@ -22,7 +22,7 @@ set (REPACK_COMMON_SRCS
add_executable (h5repack ${REPACK_COMMON_SRCS} ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/h5repack_main.c)
TARGET_NAMING (h5repack ${LIB_TYPE})
-TARGET_C_PROPERTIES (h5repack " " " ")
+TARGET_C_PROPERTIES (h5repack ${LIB_TYPE} " " " ")
target_link_libraries (h5repack ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET})
set_target_properties (h5repack PROPERTIES FOLDER tools)
@@ -34,13 +34,13 @@ if (BUILD_TESTING)
# --------------------------------------------------------------------
add_executable (testh5repack_detect_szip ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testh5repack_detect_szip.c)
TARGET_NAMING (testh5repack_detect_szip ${LIB_TYPE})
- TARGET_C_PROPERTIES (testh5repack_detect_szip " " " ")
+ TARGET_C_PROPERTIES (testh5repack_detect_szip ${LIB_TYPE} " " " ")
target_link_libraries (testh5repack_detect_szip ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET})
set_target_properties (testh5repack_detect_szip PROPERTIES FOLDER tools)
add_executable (h5repacktest ${REPACK_COMMON_SRCS} ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/h5repacktst.c)
TARGET_NAMING (h5repacktest ${LIB_TYPE})
- TARGET_C_PROPERTIES (h5repacktest " " " ")
+ TARGET_C_PROPERTIES (h5repacktest ${LIB_TYPE} " " " ")
target_link_libraries (h5repacktest ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET})
set_target_properties (h5repacktest PROPERTIES FOLDER tools)
@@ -54,12 +54,12 @@ if (BUILD_TESTING)
add_definitions (${HDF_EXTRA_C_FLAGS})
INCLUDE_DIRECTORIES (${HDF5_SRC_DIR})
- add_library (${HDF5_TOOL_PLUGIN_LIB_TARGET} ${LIB_TYPE} dynlib_rpk.c)
- TARGET_C_PROPERTIES (${HDF5_TOOL_PLUGIN_LIB_TARGET} " " " ")
+ add_library (${HDF5_TOOL_PLUGIN_LIB_TARGET} SHARED dynlib_rpk.c)
+ TARGET_C_PROPERTIES (${HDF5_TOOL_PLUGIN_LIB_TARGET} SHARED " " " ")
target_link_libraries (${HDF5_TOOL_PLUGIN_LIB_TARGET} ${HDF5_TEST_LIB_TARGET})
H5_SET_LIB_OPTIONS (
${HDF5_TOOL_PLUGIN_LIB_TARGET} ${HDF5_TOOL_PLUGIN_LIB_NAME}
- ${LIB_TYPE}
+ SHARED
HDF5_TOOL_PLUGIN_LIB_NAME_RELEASE
HDF5_TOOL_PLUGIN_LIB_NAME_DEBUG
)
diff --git a/tools/h5repack/CMakeTests.cmake b/tools/h5repack/CMakeTests.cmake
index 220c871..efaa6e5 100644
--- a/tools/h5repack/CMakeTests.cmake
+++ b/tools/h5repack/CMakeTests.cmake
@@ -341,7 +341,7 @@
ENDMACRO (ADD_H5_TEST_META)
MACRO (ADD_H5_UD_TEST testname resultcode resultfile)
- if (HDF5_BUILD_TOOLS AND NOT HDF5_ENABLE_USING_MEMCHECKER)
+ if (NOT HDF5_ENABLE_USING_MEMCHECKER)
# Remove any output file left over from previous test run
add_test (
NAME H5REPACK_UD-${testname}-clearall-objects
@@ -382,7 +382,7 @@
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
set_tests_properties (H5REPACK_UD-h5dump-${testname} PROPERTIES DEPENDS "H5REPACK_UD-${testname}")
- endif (HDF5_BUILD_TOOLS AND NOT HDF5_ENABLE_USING_MEMCHECKER)
+ endif (NOT HDF5_ENABLE_USING_MEMCHECKER)
ENDMACRO (ADD_H5_UD_TEST)
##############################################################################
@@ -649,22 +649,6 @@
set (USE_FILTER_SZIP "true")
endif (H5_HAVE_FILTER_SZIP)
- if (H5_HAVE_FILTER_SHUFFLE)
- set (USE_FILTER_SHUFFLE "true")
- endif (H5_HAVE_FILTER_SHUFFLE)
-
- if (H5_HAVE_FILTER_FLETCHER32)
- set (USE_FILTER_FLETCHER32 "true")
- endif (H5_HAVE_FILTER_FLETCHER32)
-
- if (H5_HAVE_FILTER_NBIT)
- set (USE_FILTER_NBIT "true")
- endif (H5_HAVE_FILTER_NBIT)
-
- if (H5_HAVE_FILTER_SCALEOFFSET)
- set (USE_FILTER_SCALEOFFSET "true")
- endif (H5_HAVE_FILTER_SCALEOFFSET)
-
# copy files (these files have no filters)
ADD_H5_TEST (fill "TEST" ${FILE0})
ADD_H5_TEST (objs "TEST" ${FILE1})
@@ -709,42 +693,26 @@
# shuffle with individual object
set (arg ${FILE4} -f dset2:SHUF -l dset2:CHUNK=20x10)
- set (TESTTYPE "TEST")
- if (NOT USE_FILTER_SHUFFLE)
- set (TESTTYPE "SKIP")
- endif (NOT USE_FILTER_SHUFFLE)
- ADD_H5_TEST (shuffle_individual ${TESTTYPE} ${arg})
+ ADD_H5_TEST (shuffle_individual "TEST" ${arg})
# shuffle for all
set (arg ${FILE4} -f SHUF)
- set (TESTTYPE "TEST")
- if (NOT USE_FILTER_SHUFFLE)
- set (TESTTYPE "SKIP")
- endif (NOT USE_FILTER_SHUFFLE)
- ADD_H5_TEST (shuffle_all ${TESTTYPE} ${arg})
+ ADD_H5_TEST (shuffle_all "TEST" ${arg})
# fletcher32 with individual object
set (arg ${FILE4} -f dset2:FLET -l dset2:CHUNK=20x10)
- set (TESTTYPE "TEST")
- if (NOT USE_FILTER_FLETCHER32)
- set (TESTTYPE "SKIP")
- endif (NOT USE_FILTER_FLETCHER32)
- ADD_H5_TEST (fletcher_individual ${TESTTYPE} ${arg})
+ ADD_H5_TEST (fletcher_individual "TEST" ${arg})
# fletcher32 for all
set (arg ${FILE4} -f FLET)
- set (TESTTYPE "TEST")
- if (NOT USE_FILTER_FLETCHER32)
- set (TESTTYPE "SKIP")
- endif (NOT USE_FILTER_FLETCHER32)
- ADD_H5_TEST (fletcher_all ${TESTTYPE} ${arg})
+ ADD_H5_TEST (fletcher_all "TEST" ${arg})
# all filters
set (arg ${FILE4} -f dset2:SHUF -f dset2:FLET -f dset2:SZIP=8,NN -f dset2:GZIP=1 -l dset2:CHUNK=20x10)
set (TESTTYPE "TEST")
- if (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP OR NOT USE_FILTER_SHUFFLE OR NOT USE_FILTER_FLETCHER32 OR NOT USE_FILTER_DEFLATE)
+ if (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP OR NOT USE_FILTER_DEFLATE)
set (TESTTYPE "SKIP")
- endif (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP OR NOT USE_FILTER_SHUFFLE OR NOT USE_FILTER_FLETCHER32 OR NOT USE_FILTER_DEFLATE)
+ endif (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP OR NOT USE_FILTER_DEFLATE)
ADD_H5_TEST (all_filters ${TESTTYPE} ${arg})
# verbose gzip with individual object
@@ -793,90 +761,50 @@
# shuffle copy
set (arg ${FILE9})
- set (TESTTYPE "TEST")
- if (NOT USE_FILTER_SHUFFLE)
- set (TESTTYPE "SKIP")
- endif (NOT USE_FILTER_SHUFFLE)
- ADD_H5_TEST (shuffle_copy ${TESTTYPE} ${arg})
+ ADD_H5_TEST (shuffle_copy "TEST" ${arg})
# shuffle remove
set (arg ${FILE9} -f dset_shuffle:NONE)
- set (TESTTYPE "TEST")
- if (NOT USE_FILTER_SHUFFLE)
- set (TESTTYPE "SKIP")
- endif (NOT USE_FILTER_SHUFFLE)
- ADD_H5_TEST (shuffle_remove ${TESTTYPE} ${arg})
+ ADD_H5_TEST (shuffle_remove "TEST" ${arg})
# fletcher32 copy
set (arg ${FILE10})
- set (TESTTYPE "TEST")
- if (NOT USE_FILTER_FLETCHER32)
- set (TESTTYPE "SKIP")
- endif (NOT USE_FILTER_FLETCHER32)
- ADD_H5_TEST (fletcher_copy ${TESTTYPE} ${arg})
+ ADD_H5_TEST (fletcher_copy "TEST" ${arg})
# fletcher32 remove
set (arg ${FILE10} -f dset_fletcher32:NONE)
- set (TESTTYPE "TEST")
- if (NOT USE_FILTER_FLETCHER32)
- set (TESTTYPE "SKIP")
- endif (NOT USE_FILTER_FLETCHER32)
- ADD_H5_TEST (fletcher_remove ${TESTTYPE} ${arg})
+ ADD_H5_TEST (fletcher_remove "TEST" ${arg})
# nbit copy
set (arg ${FILE12})
- set (TESTTYPE "TEST")
- if (NOT USE_FILTER_NBIT)
- set (TESTTYPE "SKIP")
- endif (NOT USE_FILTER_NBIT)
- ADD_H5_TEST (nbit_copy ${TESTTYPE} ${arg})
+ ADD_H5_TEST (nbit_copy "TEST" ${arg})
# nbit remove
set (arg ${FILE12} -f dset_nbit:NONE)
- set (TESTTYPE "TEST")
- if (NOT USE_FILTER_NBIT)
- set (TESTTYPE "SKIP")
- endif (NOT USE_FILTER_NBIT)
- ADD_H5_TEST (nbit_remove ${TESTTYPE} ${arg})
+ ADD_H5_TEST (nbit_remove "TEST" ${arg})
# nbit add
set (arg ${FILE12} -f dset_int31:NBIT)
- set (TESTTYPE "TEST")
- if (NOT USE_FILTER_NBIT)
- set (TESTTYPE "SKIP")
- endif (NOT USE_FILTER_NBIT)
- ADD_H5_TEST (nbit_add ${TESTTYPE} ${arg})
+ ADD_H5_TEST (nbit_add "TEST" ${arg})
# scaleoffset copy
set (arg ${FILE13})
- set (TESTTYPE "TEST")
- if (NOT USE_FILTER_SCALEOFFSET)
- set (TESTTYPE "SKIP")
- endif (NOT USE_FILTER_SCALEOFFSET)
- ADD_H5_TEST (scale_copy ${TESTTYPE} ${arg})
+ ADD_H5_TEST (scale_copy "TEST" ${arg})
# scaleoffset add
set (arg ${FILE13} -f dset_none:SOFF=31,IN)
- set (TESTTYPE "TEST")
- if (NOT USE_FILTER_SCALEOFFSET)
- set (TESTTYPE "SKIP")
- endif (NOT USE_FILTER_SCALEOFFSET)
- ADD_H5_TEST (scale_add ${TESTTYPE} ${arg})
+ ADD_H5_TEST (scale_add "TEST" ${arg})
# scaleoffset remove
set (arg ${FILE13} -f dset_scaleoffset:NONE)
- set (TESTTYPE "TEST")
- if (NOT USE_FILTER_SCALEOFFSET)
- set (TESTTYPE "SKIP")
- endif (NOT USE_FILTER_SCALEOFFSET)
- ADD_H5_TEST (scale_remove ${TESTTYPE} ${arg})
+ ADD_H5_TEST (scale_remove "TEST" ${arg})
# remove all filters
set (arg ${FILE11} -f NONE)
set (TESTTYPE "TEST")
- if (NOT USE_FILTER_FLETCHER32 OR NOT USE_FILTER_DEFLATE OR NOT USE_FILTER_SZIP OR NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SHUFFLE OR NOT USE_FILTER_NBIT OR NOT USE_FILTER_SCALEOFFSET)
+ if (NOT USE_FILTER_DEFLATE OR NOT USE_FILTER_SZIP OR NOT USE_FILTER_SZIP_ENCODER)
set (TESTTYPE "SKIP")
- endif (NOT USE_FILTER_FLETCHER32 OR NOT USE_FILTER_DEFLATE OR NOT USE_FILTER_SZIP OR NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SHUFFLE OR NOT USE_FILTER_NBIT OR NOT USE_FILTER_SCALEOFFSET)
+ endif (NOT USE_FILTER_DEFLATE OR NOT USE_FILTER_SZIP OR NOT USE_FILTER_SZIP_ENCODER)
ADD_H5_TEST (remove_all ${TESTTYPE} ${arg})
#filter conversions
@@ -943,14 +871,14 @@
# Use first dset to test.
#---------------------------------------------------------------------------
# chunk to chunk - specify chunk dim bigger than any current dim
-ADD_H5_VERIFY_TEST (chunk2chunk "TEST" 0 h5repack_layout3.h5 chunk_unlimit1 CHUNK -l chunk_unlimit1:CHUNK=100x300)
+ ADD_H5_VERIFY_TEST (chunk2chunk "TEST" 0 h5repack_layout3.h5 chunk_unlimit1 CHUNK -l chunk_unlimit1:CHUNK=100x300)
# chunk to contiguous
-ADD_H5_VERIFY_TEST (chunk2conti "TEST" 0 h5repack_layout3.h5 chunk_unlimit1 CONTI -l chunk_unlimit1:CONTI)
+ ADD_H5_VERIFY_TEST (chunk2conti "TEST" 0 h5repack_layout3.h5 chunk_unlimit1 CONTI -l chunk_unlimit1:CONTI)
# chunk to compact - convert big dataset (should be > 64k) for this purpose,
# should remain as original layout (chunk)
-ADD_H5_VERIFY_TEST (chunk2compa "TEST" 0 h5repack_layout3.h5 chunk_unlimit1 CHUNK -l chunk_unlimit1:COMPA)
+ ADD_H5_VERIFY_TEST (chunk2compa "TEST" 0 h5repack_layout3.h5 chunk_unlimit1 CHUNK -l chunk_unlimit1:COMPA)
#--------------------------------------------------------------------------
# Test -f for some specific cases. Chunked dataset with unlimited max dims.
@@ -960,16 +888,16 @@ ADD_H5_VERIFY_TEST (chunk2compa "TEST" 0 h5repack_layout3.h5 chunk_unlimit1 CHUN
# - should not change max dims from unlimit
# chunk dim is bigger than dataset dim. ( dset size < 64k )
-ADD_H5_VERIFY_TEST (error1 "TEST" 0 h5repack_layout3.h5 chunk_unlimit1 H5S_UNLIMITED -f chunk_unlimit1:NONE)
+ ADD_H5_VERIFY_TEST (error1 "TEST" 0 h5repack_layout3.h5 chunk_unlimit1 H5S_UNLIMITED -f chunk_unlimit1:NONE)
# chunk dim is bigger than dataset dim. ( dset size > 64k )
-ADD_H5_VERIFY_TEST (error2 "TEST" 0 h5repack_layout3.h5 chunk_unlimit2 H5S_UNLIMITED -f chunk_unlimit2:NONE)
+ ADD_H5_VERIFY_TEST (error2 "TEST" 0 h5repack_layout3.h5 chunk_unlimit2 H5S_UNLIMITED -f chunk_unlimit2:NONE)
# chunk dims are smaller than dataset dims. ( dset size < 64k )
-ADD_H5_VERIFY_TEST (error3 "TEST" 0 h5repack_layout3.h5 chunk_unlimit3 H5S_UNLIMITED -f chunk_unlimit3:NONE)
+ ADD_H5_VERIFY_TEST (error3 "TEST" 0 h5repack_layout3.h5 chunk_unlimit3 H5S_UNLIMITED -f chunk_unlimit3:NONE)
# file input - should not fail
-ADD_H5_TEST (error4 "TEST" h5repack_layout3.h5 -f NONE)
+ ADD_H5_TEST (error4 "TEST" h5repack_layout3.h5 -f NONE)
#--------------------------------------------------------------------------
# Test base: Convert CHUNK to CONTI for a chunked dataset with small dataset
@@ -977,9 +905,9 @@ ADD_H5_TEST (error4 "TEST" h5repack_layout3.h5 -f NONE)
# (HDFFV-8214)
#--------------------------------------------------------------------------
# chunk dim is bigger than dataset dim. should succeed.
-ADD_H5_VERIFY_TEST (ckdim_biger "TEST" 0 h5repack_layout3.h5 chunk_unlimit2 CONTI -l chunk_unlimit2:CONTI)
+ ADD_H5_VERIFY_TEST (ckdim_biger "TEST" 0 h5repack_layout3.h5 chunk_unlimit2 CONTI -l chunk_unlimit2:CONTI)
# chunk dim is smaller than dataset dim. should succeed.
-ADD_H5_VERIFY_TEST (ckdim_smaller "TEST" 0 h5repack_layout3.h5 chunk_unlimit3 CONTI -l chunk_unlimit3:CONTI)
+ ADD_H5_VERIFY_TEST (ckdim_smaller "TEST" 0 h5repack_layout3.h5 chunk_unlimit3 CONTI -l chunk_unlimit3:CONTI)
@@ -1008,9 +936,9 @@ ADD_H5_VERIFY_TEST (ckdim_smaller "TEST" 0 h5repack_layout3.h5 chunk_unlimit3 CO
# several global filters
set (arg ${FILE4} --filter GZIP=1 --filter SHUF)
set (TESTTYPE "TEST")
- if (NOT USE_FILTER_DEFLATE OR NOT USE_FILTER_SHUFFLE)
+ if (NOT USE_FILTER_DEFLATE)
set (TESTTYPE "SKIP")
- endif (NOT USE_FILTER_DEFLATE OR NOT USE_FILTER_SHUFFLE)
+ endif (NOT USE_FILTER_DEFLATE)
ADD_H5_TEST (global_filters ${TESTTYPE} ${arg})
# syntax of -i infile -o outfile
diff --git a/tools/h5repack/h5repack.sh.in b/tools/h5repack/h5repack.sh.in
index e3bb939..4a32491 100644
--- a/tools/h5repack/h5repack.sh.in
+++ b/tools/h5repack/h5repack.sh.in
@@ -93,6 +93,8 @@ $SRC_H5REPACK_TESTFILES/h5repack_layouto.h5
$SRC_H5REPACK_TESTFILES/h5repack_layout2.h5
$SRC_H5REPACK_TESTFILES/h5repack_layout3.h5
$SRC_H5REPACK_TESTFILES/h5repack_named_dtypes.h5
+$SRC_H5REPACK_TESTFILES/h5repack_nested_8bit_enum.h5
+$SRC_H5REPACK_TESTFILES/h5repack_nested_8bit_enum_deflated.h5
$SRC_H5REPACK_TESTFILES/h5repack_nbit.h5
$SRC_H5REPACK_TESTFILES/h5repack_objs.h5
$SRC_H5REPACK_TESTFILES/h5repack_refs.h5
@@ -701,6 +703,12 @@ TOOLTEST hlink h5repack_hlink.h5
TOOLTEST layout h5repack_layout.h5
TOOLTEST early h5repack_early.h5
+# nested 8bit enum in both deflated and non-deflated datafiles
+if [ $USE_FILTER_DEFLATE != "yes" ]; then
+TOOLTEST nested_8bit_enum h5repack_nested_8bit_enum.h5
+else
+TOOLTEST nested_8bit_enum h5repack_nested_8bit_enum_deflated.h5
+fi
# use h5repack_layout.h5 to write some filters (this file has no filters)
diff --git a/tools/h5repack/testfiles/README b/tools/h5repack/testfiles/README
new file mode 100644
index 0000000..4096dee
--- /dev/null
+++ b/tools/h5repack/testfiles/README
@@ -0,0 +1,5 @@
+h5repack_nested_8bit_enum_deflated.h5:
+h5repack_nested_8bit_enum.h5:
+ enuberated 8bit type nested in compount type. Original file provided
+ by a user (HDFFV-8667) as a test file. Used h5copy to extract only the
+ Compound type dataset. The non-deflated version is produced by h5repack.
diff --git a/tools/h5repack/testfiles/h5repack_nested_8bit_enum.h5 b/tools/h5repack/testfiles/h5repack_nested_8bit_enum.h5
new file mode 100644
index 0000000..f1bd8e9
--- /dev/null
+++ b/tools/h5repack/testfiles/h5repack_nested_8bit_enum.h5
Binary files differ
diff --git a/tools/h5repack/testfiles/h5repack_nested_8bit_enum_deflated.h5 b/tools/h5repack/testfiles/h5repack_nested_8bit_enum_deflated.h5
new file mode 100644
index 0000000..2e66da2
--- /dev/null
+++ b/tools/h5repack/testfiles/h5repack_nested_8bit_enum_deflated.h5
Binary files differ