diff options
Diffstat (limited to 'tools')
-rw-r--r-- | tools/h5copy/CMakeLists.txt | 13 | ||||
-rw-r--r-- | tools/h5diff/CMakeLists.txt | 22 | ||||
-rw-r--r-- | tools/h5dump/CMakeLists.txt | 13 | ||||
-rw-r--r-- | tools/h5import/CMakeLists.txt | 13 | ||||
-rw-r--r-- | tools/h5jam/CMakeLists.txt | 29 | ||||
-rw-r--r-- | tools/h5ls/CMakeLists.txt | 9 | ||||
-rw-r--r-- | tools/h5ls/h5ls.c | 412 | ||||
-rw-r--r-- | tools/h5repack/CMakeLists.txt | 69 | ||||
-rw-r--r-- | tools/h5repack/CMakeTests.cmake | 8 | ||||
-rw-r--r-- | tools/h5stat/CMakeLists.txt | 13 | ||||
-rw-r--r-- | tools/lib/CMakeLists.txt | 39 | ||||
-rw-r--r-- | tools/lib/h5tools_str.c | 29 | ||||
-rw-r--r-- | tools/misc/CMakeLists.txt | 25 | ||||
-rw-r--r-- | tools/perform/CMakeLists.txt | 36 | ||||
-rw-r--r-- | tools/perform/chunk.c | 4 | ||||
-rw-r--r-- | tools/perform/overhead.c | 3 |
16 files changed, 368 insertions, 369 deletions
diff --git a/tools/h5copy/CMakeLists.txt b/tools/h5copy/CMakeLists.txt index 7291197..63b9b5d 100644 --- a/tools/h5copy/CMakeLists.txt +++ b/tools/h5copy/CMakeLists.txt @@ -10,15 +10,15 @@ INCLUDE_DIRECTORIES (${HDF5_TOOLS_SRC_DIR}/lib) # Add the h5copy and test executables # -------------------------------------------------------------------- add_executable (h5copy ${HDF5_TOOLS_H5COPY_SOURCE_DIR}/h5copy.c) -TARGET_NAMING (h5copy ${LIB_TYPE}) -TARGET_C_PROPERTIES (h5copy ${LIB_TYPE} " " " ") +TARGET_NAMING (h5copy STATIC) +TARGET_C_PROPERTIES (h5copy STATIC " " " ") target_link_libraries (h5copy ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) set_target_properties (h5copy PROPERTIES FOLDER tools) set (H5_DEP_EXECUTABLES h5copy) if (BUILD_TESTING) - if (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) + if (HDF5_BUILD_GENERATORS) add_executable (h5copygentest ${HDF5_TOOLS_H5COPY_SOURCE_DIR}/h5copygentest.c) TARGET_NAMING (h5copygentest STATIC) TARGET_C_PROPERTIES (h5copygentest STATIC " " " ") @@ -26,7 +26,7 @@ if (BUILD_TESTING) set_target_properties (h5copygentest PROPERTIES FOLDER generator/tools) #add_test (NAME h5copygentest COMMAND $<TARGET_FILE:h5copygentest>) - endif (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) + endif (HDF5_BUILD_GENERATORS) include (CMakeTests.cmake) endif (BUILD_TESTING) @@ -46,8 +46,5 @@ endif (BUILD_TESTING) install ( TARGETS h5copy - RUNTIME DESTINATION - ${HDF5_INSTALL_BIN_DIR} - COMPONENT - toolsapplications + RUNTIME DESTINATION ${HDF5_INSTALL_BIN_DIR} COMPONENT toolsapplications ) diff --git a/tools/h5diff/CMakeLists.txt b/tools/h5diff/CMakeLists.txt index 39095a5..59a3241 100644 --- a/tools/h5diff/CMakeLists.txt +++ b/tools/h5diff/CMakeLists.txt @@ -13,8 +13,8 @@ add_executable (h5diff ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/h5diff_common.c ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/h5diff_main.c ) -TARGET_NAMING (h5diff ${LIB_TYPE}) -TARGET_C_PROPERTIES (h5diff ${LIB_TYPE} " " " ") +TARGET_NAMING (h5diff STATIC) +TARGET_C_PROPERTIES (h5diff STATIC " " " ") target_link_libraries (h5diff ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) set_target_properties (h5diff PROPERTIES FOLDER tools) @@ -25,8 +25,8 @@ if (H5_HAVE_PARALLEL) ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/h5diff_common.c ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/ph5diff_main.c ) - TARGET_NAMING (ph5diff ${LIB_TYPE}) - TARGET_C_PROPERTIES (ph5diff ${LIB_TYPE} " " " ") + TARGET_NAMING (ph5diff STATIC) + TARGET_C_PROPERTIES (ph5diff STATIC " " " ") target_link_libraries (ph5diff ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) set_target_properties (ph5diff PROPERTIES FOLDER tools) endif (H5_HAVE_PARALLEL) @@ -35,7 +35,7 @@ if (BUILD_TESTING) # -------------------------------------------------------------------- # Add the h5diff and test executables # -------------------------------------------------------------------- - if (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) + if (HDF5_BUILD_GENERATORS) add_executable (h5diffgentest ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/h5diffgentest.c) TARGET_NAMING (h5diffgentest STATIC) TARGET_C_PROPERTIES (h5diffgentest STATIC " " " ") @@ -43,7 +43,7 @@ if (BUILD_TESTING) set_target_properties (h5diffgentest PROPERTIES FOLDER generator/tools) #add_test (NAME h5diffgentest COMMAND $<TARGET_FILE:h5diffgentest>) - endif (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) + endif (HDF5_BUILD_GENERATORS) include (CMakeTests.cmake) @@ -64,10 +64,7 @@ endif (BUILD_TESTING) install ( TARGETS h5diff - RUNTIME DESTINATION - ${HDF5_INSTALL_BIN_DIR} - COMPONENT - toolsapplications + RUNTIME DESTINATION ${HDF5_INSTALL_BIN_DIR} COMPONENT toolsapplications ) if (H5_HAVE_PARALLEL) @@ -77,9 +74,6 @@ if (H5_HAVE_PARALLEL) install ( TARGETS ph5diff - RUNTIME DESTINATION - ${HDF5_INSTALL_BIN_DIR} - COMPONENT - toolsapplications + RUNTIME DESTINATION ${HDF5_INSTALL_BIN_DIR} COMPONENT toolsapplications ) endif (H5_HAVE_PARALLEL) diff --git a/tools/h5dump/CMakeLists.txt b/tools/h5dump/CMakeLists.txt index 7658c04..47ba7a8 100644 --- a/tools/h5dump/CMakeLists.txt +++ b/tools/h5dump/CMakeLists.txt @@ -14,8 +14,8 @@ add_executable (h5dump ${HDF5_TOOLS_H5DUMP_SOURCE_DIR}/h5dump_ddl.c ${HDF5_TOOLS_H5DUMP_SOURCE_DIR}/h5dump_xml.c ) -TARGET_NAMING (h5dump ${LIB_TYPE}) -TARGET_C_PROPERTIES (h5dump ${LIB_TYPE} " " " ") +TARGET_NAMING (h5dump STATIC) +TARGET_C_PROPERTIES (h5dump STATIC " " " ") target_link_libraries (h5dump ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) set_target_properties (h5dump PROPERTIES FOLDER tools) @@ -25,7 +25,7 @@ if (BUILD_TESTING) # -------------------------------------------------------------------- # Add the h5dump test executable # -------------------------------------------------------------------- - if (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) + if (HDF5_BUILD_GENERATORS) add_executable (h5dumpgentest ${HDF5_TOOLS_H5DUMP_SOURCE_DIR}/h5dumpgentest.c) TARGET_NAMING (h5dumpgentest STATIC) TARGET_C_PROPERTIES (h5dumpgentest STATIC " " " ") @@ -33,7 +33,7 @@ if (BUILD_TESTING) set_target_properties (h5dumpgentest PROPERTIES FOLDER generator/tools) #add_test (NAME h5dumpgentest COMMAND $<TARGET_FILE:h5dumpgentest>) - endif (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) + endif (HDF5_BUILD_GENERATORS) include (CMakeTests.cmake) @@ -57,8 +57,5 @@ endif (BUILD_TESTING) install ( TARGETS h5dump - RUNTIME DESTINATION - ${HDF5_INSTALL_BIN_DIR} - COMPONENT - toolsapplications + RUNTIME DESTINATION ${HDF5_INSTALL_BIN_DIR} COMPONENT toolsapplications ) diff --git a/tools/h5import/CMakeLists.txt b/tools/h5import/CMakeLists.txt index bf1515e..b885a76 100644 --- a/tools/h5import/CMakeLists.txt +++ b/tools/h5import/CMakeLists.txt @@ -10,8 +10,8 @@ INCLUDE_DIRECTORIES (${HDF5_TOOLS_SRC_DIR}/lib) # Add the h5import executables # -------------------------------------------------------------------- add_executable (h5import ${HDF5_TOOLS_H5IMPORT_SOURCE_DIR}/h5import.c) -TARGET_NAMING (h5import ${LIB_TYPE}) -TARGET_C_PROPERTIES (h5import ${LIB_TYPE} " " " ") +TARGET_NAMING (h5import STATIC) +TARGET_C_PROPERTIES (h5import STATIC " " " ") target_link_libraries (h5import ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) #set_target_properties (h5import PROPERTIES COMPILE_DEFINITIONS H5DEBUGIMPORT) set_target_properties (h5import PROPERTIES FOLDER tools) @@ -23,8 +23,8 @@ if (BUILD_TESTING) # Add the h5import executables # -------------------------------------------------------------------- add_executable (h5importtest ${HDF5_TOOLS_H5IMPORT_SOURCE_DIR}/h5importtest.c) - TARGET_NAMING (h5importtest ${LIB_TYPE}) - TARGET_C_PROPERTIES (h5importtest ${LIB_TYPE} " " " ") + TARGET_NAMING (h5importtest STATIC) + TARGET_C_PROPERTIES (h5importtest STATIC " " " ") target_link_libraries (h5importtest ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) set_target_properties (h5importtest PROPERTIES FOLDER tools) @@ -47,8 +47,5 @@ endif (BUILD_TESTING) install ( TARGETS h5import - RUNTIME DESTINATION - ${HDF5_INSTALL_BIN_DIR} - COMPONENT - toolsapplications + RUNTIME DESTINATION ${HDF5_INSTALL_BIN_DIR} COMPONENT toolsapplications ) diff --git a/tools/h5jam/CMakeLists.txt b/tools/h5jam/CMakeLists.txt index 4498132..c01f8f7 100644 --- a/tools/h5jam/CMakeLists.txt +++ b/tools/h5jam/CMakeLists.txt @@ -10,26 +10,26 @@ INCLUDE_DIRECTORIES (${HDF5_TOOLS_SRC_DIR}/lib) # Add the h5jam executables # -------------------------------------------------------------------- add_executable (h5jam ${HDF5_TOOLS_H5JAM_SOURCE_DIR}/h5jam.c) -TARGET_NAMING (h5jam ${LIB_TYPE}) -TARGET_C_PROPERTIES (h5jam ${LIB_TYPE} " " " ") +TARGET_NAMING (h5jam STATIC) +TARGET_C_PROPERTIES (h5jam STATIC " " " ") target_link_libraries (h5jam ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) set_target_properties (h5jam PROPERTIES FOLDER tools) add_executable (getub ${HDF5_TOOLS_H5JAM_SOURCE_DIR}/getub.c) -TARGET_NAMING (getub ${LIB_TYPE}) -TARGET_C_PROPERTIES (getub ${LIB_TYPE} " " " ") +TARGET_NAMING (getub STATIC) +TARGET_C_PROPERTIES (getub STATIC " " " ") target_link_libraries (getub ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) set_target_properties (getub PROPERTIES FOLDER tools) add_executable (tellub ${HDF5_TOOLS_H5JAM_SOURCE_DIR}/tellub.c) -TARGET_NAMING (tellub ${LIB_TYPE}) -TARGET_C_PROPERTIES (tellub ${LIB_TYPE} " " " ") +TARGET_NAMING (tellub STATIC) +TARGET_C_PROPERTIES (tellub STATIC " " " ") target_link_libraries (tellub ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) set_target_properties (tellub PROPERTIES FOLDER tools) add_executable (h5unjam ${HDF5_TOOLS_H5JAM_SOURCE_DIR}/h5unjam.c) -TARGET_NAMING (h5unjam ${LIB_TYPE}) -TARGET_C_PROPERTIES (h5unjam ${LIB_TYPE} " " " ") +TARGET_NAMING (h5unjam STATIC) +TARGET_C_PROPERTIES (h5unjam STATIC " " " ") target_link_libraries (h5unjam ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) set_target_properties (h5unjam PROPERTIES FOLDER tools) @@ -44,15 +44,15 @@ if (BUILD_TESTING) # -------------------------------------------------------------------- # Add the h5jam test executables # -------------------------------------------------------------------- - if (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) + if (HDF5_BUILD_GENERATORS) add_executable (h5jamgentest ${HDF5_TOOLS_H5JAM_SOURCE_DIR}/h5jamgentest.c) - TARGET_NAMING (h5jamgentest ${LIB_TYPE}) - TARGET_C_PROPERTIES (testhdf5 ${LIB_TYPE} " " " ") + TARGET_NAMING (h5jamgentest STATIC) + TARGET_C_PROPERTIES (testhdf5 STATIC " " " ") target_link_libraries (h5jamgentest ${HDF5_LIB_TARGET}) set_target_properties (h5jamgentest PROPERTIES FOLDER generator/tools) #add_test (NAME h5jamgentest COMMAND $<TARGET_FILE:h5jamgentest>) - endif (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) + endif (HDF5_BUILD_GENERATORS) include (CMakeTests.cmake) @@ -73,8 +73,5 @@ endif (BUILD_TESTING) install ( TARGETS h5jam h5unjam - RUNTIME DESTINATION - ${HDF5_INSTALL_BIN_DIR} - COMPONENT - toolsapplications + RUNTIME DESTINATION ${HDF5_INSTALL_BIN_DIR} COMPONENT toolsapplications ) diff --git a/tools/h5ls/CMakeLists.txt b/tools/h5ls/CMakeLists.txt index 984b36b..4e96db2 100644 --- a/tools/h5ls/CMakeLists.txt +++ b/tools/h5ls/CMakeLists.txt @@ -10,8 +10,8 @@ INCLUDE_DIRECTORIES (${HDF5_TOOLS_SRC_DIR}/lib) # Add the h5ls executable #----------------------------------------------------------------------------- add_executable (h5ls ${HDF5_TOOLS_H5LS_SOURCE_DIR}/h5ls.c) -TARGET_NAMING (h5ls ${LIB_TYPE}) -TARGET_C_PROPERTIES (h5ls ${LIB_TYPE} " " " ") +TARGET_NAMING (h5ls STATIC) +TARGET_C_PROPERTIES (h5ls STATIC " " " ") target_link_libraries (h5ls ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) set_target_properties (h5ls PROPERTIES FOLDER tools) @@ -40,8 +40,5 @@ endif (BUILD_TESTING) install ( TARGETS h5ls - RUNTIME DESTINATION - ${HDF5_INSTALL_BIN_DIR} - COMPONENT - toolsapplications + RUNTIME DESTINATION ${HDF5_INSTALL_BIN_DIR} COMPONENT toolsapplications ) diff --git a/tools/h5ls/h5ls.c b/tools/h5ls/h5ls.c index 28f7b8a..fe128fa 100644 --- a/tools/h5ls/h5ls.c +++ b/tools/h5ls/h5ls.c @@ -155,6 +155,8 @@ static struct dispatch_t { } static void print_type(h5tools_str_t *buffer, hid_t type, int ind); +static hbool_t print_int_type(h5tools_str_t *buffer, hid_t type, int ind); +static hbool_t print_float_type(h5tools_str_t *buffer, hid_t type, int ind); static herr_t visit_obj(hid_t file, const char *oname, iter_t *iter); @@ -294,7 +296,7 @@ print_string(h5tools_str_t *buffer, const char *s, hbool_t escape_spaces) if (escape_spaces) { if (buffer) h5tools_str_append(buffer, "\\ "); nprint += 2; - } + } else { if (buffer) h5tools_str_append(buffer, " "); nprint++; @@ -304,7 +306,7 @@ print_string(h5tools_str_t *buffer, const char *s, hbool_t escape_spaces) if (isprint((int)*s)) { if (buffer) h5tools_str_append(buffer, "%c", *s); nprint++; - } + } else { if (buffer) h5tools_str_append(buffer, "\\%03o", *((const unsigned char*)s)); nprint += 4; @@ -385,102 +387,106 @@ print_obj_name(h5tools_str_t *buffer, const iter_t *iter, const char *oname, *------------------------------------------------------------------------- */ static hbool_t -print_native_type(h5tools_str_t *buffer, hid_t type, int H5_ATTR_UNUSED ind) +print_native_type(h5tools_str_t *buffer, hid_t type, int ind) { - if (H5Tequal(type, H5T_NATIVE_SCHAR)==TRUE) { - h5tools_str_append(buffer, "native signed char"); - } else if (H5Tequal(type, H5T_NATIVE_UCHAR)==TRUE) { - h5tools_str_append(buffer, "native unsigned char"); - } else if (H5Tequal(type, H5T_NATIVE_INT)==TRUE) { - h5tools_str_append(buffer, "native int"); - } else if (H5Tequal(type, H5T_NATIVE_UINT)==TRUE) { - h5tools_str_append(buffer, "native unsigned int"); - } else if (H5Tequal(type, H5T_NATIVE_SHORT)==TRUE) { - h5tools_str_append(buffer, "native short"); - } else if (H5Tequal(type, H5T_NATIVE_USHORT)==TRUE) { - h5tools_str_append(buffer, "native unsigned short"); - } else if (H5Tequal(type, H5T_NATIVE_LONG)==TRUE) { - h5tools_str_append(buffer, "native long"); - } else if (H5Tequal(type, H5T_NATIVE_ULONG)==TRUE) { - h5tools_str_append(buffer, "native unsigned long"); - } else if (H5Tequal(type, H5T_NATIVE_LLONG)==TRUE) { - h5tools_str_append(buffer, "native long long"); - } else if (H5Tequal(type, H5T_NATIVE_ULLONG)==TRUE) { - h5tools_str_append(buffer, "native unsigned long long"); - } else if (H5Tequal(type, H5T_NATIVE_FLOAT)==TRUE) { - h5tools_str_append(buffer, "native float"); - } else if (H5Tequal(type, H5T_NATIVE_DOUBLE)==TRUE) { - h5tools_str_append(buffer, "native double"); + if(!simple_output_g) { + if (H5Tequal(type, H5T_NATIVE_SCHAR)==TRUE) { + h5tools_str_append(buffer, "native signed char"); + } else if (H5Tequal(type, H5T_NATIVE_UCHAR)==TRUE) { + h5tools_str_append(buffer, "native unsigned char"); + } else if (H5Tequal(type, H5T_NATIVE_INT)==TRUE) { + h5tools_str_append(buffer, "native int"); + } else if (H5Tequal(type, H5T_NATIVE_UINT)==TRUE) { + h5tools_str_append(buffer, "native unsigned int"); + } else if (H5Tequal(type, H5T_NATIVE_SHORT)==TRUE) { + h5tools_str_append(buffer, "native short"); + } else if (H5Tequal(type, H5T_NATIVE_USHORT)==TRUE) { + h5tools_str_append(buffer, "native unsigned short"); + } else if (H5Tequal(type, H5T_NATIVE_LONG)==TRUE) { + h5tools_str_append(buffer, "native long"); + } else if (H5Tequal(type, H5T_NATIVE_ULONG)==TRUE) { + h5tools_str_append(buffer, "native unsigned long"); + } else if (H5Tequal(type, H5T_NATIVE_LLONG)==TRUE) { + h5tools_str_append(buffer, "native long long"); + } else if (H5Tequal(type, H5T_NATIVE_ULLONG)==TRUE) { + h5tools_str_append(buffer, "native unsigned long long"); + } else if (H5Tequal(type, H5T_NATIVE_FLOAT)==TRUE) { + h5tools_str_append(buffer, "native float"); + } else if (H5Tequal(type, H5T_NATIVE_DOUBLE)==TRUE) { + h5tools_str_append(buffer, "native double"); #if H5_SIZEOF_LONG_DOUBLE !=0 - } else if (H5Tequal(type, H5T_NATIVE_LDOUBLE)==TRUE) { - h5tools_str_append(buffer, "native long double"); + } else if (H5Tequal(type, H5T_NATIVE_LDOUBLE)==TRUE) { + h5tools_str_append(buffer, "native long double"); #endif - } else if (H5Tequal(type, H5T_NATIVE_INT8)==TRUE) { - h5tools_str_append(buffer, "native int8_t"); - } else if (H5Tequal(type, H5T_NATIVE_UINT8)==TRUE) { - h5tools_str_append(buffer, "native uint8_t"); - } else if (H5Tequal(type, H5T_NATIVE_INT16)==TRUE) { - h5tools_str_append(buffer, "native int16_t"); - } else if (H5Tequal(type, H5T_NATIVE_UINT16)==TRUE) { - h5tools_str_append(buffer, "native uint16_t"); - } else if (H5Tequal(type, H5T_NATIVE_INT32)==TRUE) { - h5tools_str_append(buffer, "native int32_t"); - } else if (H5Tequal(type, H5T_NATIVE_UINT32)==TRUE) { - h5tools_str_append(buffer, "native uint32_t"); - } else if (H5Tequal(type, H5T_NATIVE_INT64)==TRUE) { - h5tools_str_append(buffer, "native int64_t"); - } else if (H5Tequal(type, H5T_NATIVE_UINT64)==TRUE) { - h5tools_str_append(buffer, "native uint64_t"); - } else if (H5Tequal(type, H5T_NATIVE_INT_LEAST8)==TRUE) { - h5tools_str_append(buffer, "native int_least8_t"); - } else if (H5Tequal(type, H5T_NATIVE_UINT_LEAST8)==TRUE) { - h5tools_str_append(buffer, "native uint_least8_t"); - } else if (H5Tequal(type, H5T_NATIVE_INT_LEAST16)==TRUE) { - h5tools_str_append(buffer, "native int_least16_t"); - } else if (H5Tequal(type, H5T_NATIVE_UINT_LEAST16)==TRUE) { - h5tools_str_append(buffer, "native uint_least16_t"); - } else if (H5Tequal(type, H5T_NATIVE_INT_LEAST32)==TRUE) { - h5tools_str_append(buffer, "native int_least32_t"); - } else if (H5Tequal(type, H5T_NATIVE_UINT_LEAST32)==TRUE) { - h5tools_str_append(buffer, "native uint_least32_t"); - } else if (H5Tequal(type, H5T_NATIVE_INT_LEAST64)==TRUE) { - h5tools_str_append(buffer, "native int_least64_t"); - } else if (H5Tequal(type, H5T_NATIVE_UINT_LEAST64)==TRUE) { - h5tools_str_append(buffer, "native uint_least64_t"); - } else if (H5Tequal(type, H5T_NATIVE_INT_FAST8)==TRUE) { - h5tools_str_append(buffer, "native int_fast8_t"); - } else if (H5Tequal(type, H5T_NATIVE_UINT_FAST8)==TRUE) { - h5tools_str_append(buffer, "native uint_fast8_t"); - } else if (H5Tequal(type, H5T_NATIVE_INT_FAST16)==TRUE) { - h5tools_str_append(buffer, "native int_fast16_t"); - } else if (H5Tequal(type, H5T_NATIVE_UINT_FAST16)==TRUE) { - h5tools_str_append(buffer, "native uint_fast16_t"); - } else if (H5Tequal(type, H5T_NATIVE_INT_FAST32)==TRUE) { - h5tools_str_append(buffer, "native int_fast32_t"); - } else if (H5Tequal(type, H5T_NATIVE_UINT_FAST32)==TRUE) { - h5tools_str_append(buffer, "native uint_fast32_t"); - } else if (H5Tequal(type, H5T_NATIVE_INT_FAST64)==TRUE) { - h5tools_str_append(buffer, "native int_fast64_t"); - } else if (H5Tequal(type, H5T_NATIVE_UINT_FAST64)==TRUE) { - h5tools_str_append(buffer, "native uint_fast64_t"); - } else if (H5Tequal(type, H5T_NATIVE_B8)==TRUE) { - h5tools_str_append(buffer, "native 8-bit field"); - } else if (H5Tequal(type, H5T_NATIVE_B16)==TRUE) { - h5tools_str_append(buffer, "native 16-bit field"); - } else if (H5Tequal(type, H5T_NATIVE_B32)==TRUE) { - h5tools_str_append(buffer, "native 32-bit field"); - } else if (H5Tequal(type, H5T_NATIVE_B64)==TRUE) { - h5tools_str_append(buffer, "native 64-bit field"); - } else if (H5Tequal(type, H5T_NATIVE_HSIZE)==TRUE) { - h5tools_str_append(buffer, "native hsize_t"); - } else if (H5Tequal(type, H5T_NATIVE_HSSIZE)==TRUE) { - h5tools_str_append(buffer, "native hssize_t"); - } else if (H5Tequal(type, H5T_NATIVE_HERR)==TRUE) { - h5tools_str_append(buffer, "native herr_t"); - } else if (H5Tequal(type, H5T_NATIVE_HBOOL)==TRUE) { - h5tools_str_append(buffer, "native hbool_t"); + } else if (H5Tequal(type, H5T_NATIVE_INT8)==TRUE) { + h5tools_str_append(buffer, "native int8_t"); + } else if (H5Tequal(type, H5T_NATIVE_UINT8)==TRUE) { + h5tools_str_append(buffer, "native uint8_t"); + } else if (H5Tequal(type, H5T_NATIVE_INT16)==TRUE) { + h5tools_str_append(buffer, "native int16_t"); + } else if (H5Tequal(type, H5T_NATIVE_UINT16)==TRUE) { + h5tools_str_append(buffer, "native uint16_t"); + } else if (H5Tequal(type, H5T_NATIVE_INT32)==TRUE) { + h5tools_str_append(buffer, "native int32_t"); + } else if (H5Tequal(type, H5T_NATIVE_UINT32)==TRUE) { + h5tools_str_append(buffer, "native uint32_t"); + } else if (H5Tequal(type, H5T_NATIVE_INT64)==TRUE) { + h5tools_str_append(buffer, "native int64_t"); + } else if (H5Tequal(type, H5T_NATIVE_UINT64)==TRUE) { + h5tools_str_append(buffer, "native uint64_t"); + } else if (H5Tequal(type, H5T_NATIVE_INT_LEAST8)==TRUE) { + h5tools_str_append(buffer, "native int_least8_t"); + } else if (H5Tequal(type, H5T_NATIVE_UINT_LEAST8)==TRUE) { + h5tools_str_append(buffer, "native uint_least8_t"); + } else if (H5Tequal(type, H5T_NATIVE_INT_LEAST16)==TRUE) { + h5tools_str_append(buffer, "native int_least16_t"); + } else if (H5Tequal(type, H5T_NATIVE_UINT_LEAST16)==TRUE) { + h5tools_str_append(buffer, "native uint_least16_t"); + } else if (H5Tequal(type, H5T_NATIVE_INT_LEAST32)==TRUE) { + h5tools_str_append(buffer, "native int_least32_t"); + } else if (H5Tequal(type, H5T_NATIVE_UINT_LEAST32)==TRUE) { + h5tools_str_append(buffer, "native uint_least32_t"); + } else if (H5Tequal(type, H5T_NATIVE_INT_LEAST64)==TRUE) { + h5tools_str_append(buffer, "native int_least64_t"); + } else if (H5Tequal(type, H5T_NATIVE_UINT_LEAST64)==TRUE) { + h5tools_str_append(buffer, "native uint_least64_t"); + } else if (H5Tequal(type, H5T_NATIVE_INT_FAST8)==TRUE) { + h5tools_str_append(buffer, "native int_fast8_t"); + } else if (H5Tequal(type, H5T_NATIVE_UINT_FAST8)==TRUE) { + h5tools_str_append(buffer, "native uint_fast8_t"); + } else if (H5Tequal(type, H5T_NATIVE_INT_FAST16)==TRUE) { + h5tools_str_append(buffer, "native int_fast16_t"); + } else if (H5Tequal(type, H5T_NATIVE_UINT_FAST16)==TRUE) { + h5tools_str_append(buffer, "native uint_fast16_t"); + } else if (H5Tequal(type, H5T_NATIVE_INT_FAST32)==TRUE) { + h5tools_str_append(buffer, "native int_fast32_t"); + } else if (H5Tequal(type, H5T_NATIVE_UINT_FAST32)==TRUE) { + h5tools_str_append(buffer, "native uint_fast32_t"); + } else if (H5Tequal(type, H5T_NATIVE_INT_FAST64)==TRUE) { + h5tools_str_append(buffer, "native int_fast64_t"); + } else if (H5Tequal(type, H5T_NATIVE_UINT_FAST64)==TRUE) { + h5tools_str_append(buffer, "native uint_fast64_t"); + } else if (H5Tequal(type, H5T_NATIVE_B8)==TRUE) { + h5tools_str_append(buffer, "native 8-bit field"); + } else if (H5Tequal(type, H5T_NATIVE_B16)==TRUE) { + h5tools_str_append(buffer, "native 16-bit field"); + } else if (H5Tequal(type, H5T_NATIVE_B32)==TRUE) { + h5tools_str_append(buffer, "native 32-bit field"); + } else if (H5Tequal(type, H5T_NATIVE_B64)==TRUE) { + h5tools_str_append(buffer, "native 64-bit field"); + } else if (H5Tequal(type, H5T_NATIVE_HSIZE)==TRUE) { + h5tools_str_append(buffer, "native hsize_t"); + } else if (H5Tequal(type, H5T_NATIVE_HSSIZE)==TRUE) { + h5tools_str_append(buffer, "native hssize_t"); + } else if (H5Tequal(type, H5T_NATIVE_HERR)==TRUE) { + h5tools_str_append(buffer, "native herr_t"); + } else if (H5Tequal(type, H5T_NATIVE_HBOOL)==TRUE) { + h5tools_str_append(buffer, "native hbool_t"); + } else { + return print_int_type(buffer, type, ind); + } } else { - return FALSE; + return print_int_type(buffer, type, ind); } return TRUE; } @@ -503,22 +509,22 @@ print_native_type(h5tools_str_t *buffer, hid_t type, int H5_ATTR_UNUSED ind) *------------------------------------------------------------------------- */ static hbool_t -print_ieee_type(h5tools_str_t *buffer, hid_t type, int H5_ATTR_UNUSED ind) +print_ieee_type(h5tools_str_t *buffer, hid_t type, int ind) { if (H5Tequal(type, H5T_IEEE_F32BE)==TRUE) { h5tools_str_append(buffer, "IEEE 32-bit big-endian float"); - } + } else if (H5Tequal(type, H5T_IEEE_F32LE)==TRUE) { h5tools_str_append(buffer, "IEEE 32-bit little-endian float"); - } + } else if (H5Tequal(type, H5T_IEEE_F64BE)==TRUE) { h5tools_str_append(buffer, "IEEE 64-bit big-endian float"); - } + } else if (H5Tequal(type, H5T_IEEE_F64LE)==TRUE) { h5tools_str_append(buffer, "IEEE 64-bit little-endian float"); - } + } else { - return FALSE; + return print_float_type(buffer, type, ind); } return TRUE; } @@ -650,17 +656,17 @@ print_int_type(h5tools_str_t *buffer, hid_t type, int ind) order = H5Tget_order(type); if (H5T_ORDER_LE==order) { order_s = " little-endian"; - } + } else if (H5T_ORDER_BE==order) { order_s = " big-endian"; - } + } else if (H5T_ORDER_VAX==order) { order_s = " mixed-endian"; - } + } else { order_s = " unknown-byte-order"; } - } + } else { order_s = ""; } @@ -669,14 +675,14 @@ print_int_type(h5tools_str_t *buffer, hid_t type, int ind) if ((sign=H5Tget_sign(type))>=0) { if (H5T_SGN_NONE==sign) { sign_s = " unsigned"; - } + } else if (H5T_SGN_2==sign) { sign_s = ""; - } + } else { sign_s = " unknown-sign"; } - } + } else { sign_s = " unknown-sign"; } @@ -727,17 +733,17 @@ print_float_type(h5tools_str_t *buffer, hid_t type, int ind) order = H5Tget_order(type); if (H5T_ORDER_LE==order) { order_s = " little-endian"; - } + } else if (H5T_ORDER_BE==order) { order_s = " big-endian"; - } + } else if (H5T_ORDER_VAX==order) { order_s = " mixed-endian"; - } + } else { order_s = " unknown-byte-order"; } - } + } else { order_s = ""; } @@ -949,13 +955,13 @@ print_enum_type(h5tools_str_t *buffer, hid_t type, int ind) h5tools_str_append(buffer, "0x"); for(j = 0; j < dst_size; j++) h5tools_str_append(buffer, "%02x", value[i*dst_size+j]); - } + } else if(H5T_SGN_NONE == H5Tget_sign(native)) { /*On SGI Altix(cobalt), wrong values were printed out with "value+i*dst_size" *strangely, unless use another pointer "copy".*/ copy = value + i * dst_size; h5tools_str_append(buffer, HSIZE_T_FORMAT, *((unsigned long long*)((void*)copy))); - } + } else { /*On SGI Altix(cobalt), wrong values were printed out with "value+i*dst_size" *strangely, unless use another pointer "copy".*/ @@ -1074,7 +1080,7 @@ print_string_type(h5tools_str_t *buffer, hid_t type, int H5_ATTR_UNUSED ind) if (H5Tis_variable_str(type)) { h5tools_str_append(buffer, "variable-length"); - } + } else { h5tools_str_append(buffer, "%lu-byte", (unsigned long)H5Tget_size(type)); } @@ -1108,10 +1114,10 @@ print_reference_type(h5tools_str_t *buffer, hid_t type, int H5_ATTR_UNUSED ind) if (H5Tequal(type, H5T_STD_REF_OBJ)==TRUE) { h5tools_str_append(buffer, "object reference"); - } + } else if (H5Tequal(type, H5T_STD_REF_DSETREG)==TRUE) { h5tools_str_append(buffer, "dataset region reference"); - } + } else { h5tools_str_append(buffer, "%lu-byte unknown reference", (unsigned long)H5Tget_size(type)); @@ -1220,7 +1226,7 @@ print_array_type(h5tools_str_t *buffer, hid_t type, int ind) h5tools_str_append(buffer, "]"); HDfree(dims); - } + } else h5tools_str_append(buffer, " [SCALAR]\n", rawoutstream); @@ -1324,10 +1330,8 @@ print_type(h5tools_str_t *buffer, hid_t type, int ind) } /* end if */ /* Print the type */ - if((!simple_output_g && print_native_type(buffer, type, ind)) || + if(print_native_type(buffer, type, ind) || print_ieee_type(buffer, type, ind) || - print_int_type(buffer, type, ind) || - print_float_type(buffer, type, ind) || print_cmpd_type(buffer, type, ind) || print_enum_type(buffer, type, ind) || print_string_type(buffer, type, ind) || @@ -1371,7 +1375,7 @@ dump_dataset_values(hid_t dset) h5tools_context_t ctx; /* print context */ h5tool_format_t outputformat; h5tool_format_t *info = &ls_dataformat; - + hid_t f_type = H5Dget_type(dset); size_t size = H5Tget_size(f_type); @@ -1402,7 +1406,7 @@ dump_dataset_values(hid_t dset) outputformat.elmt_suf1 = " "; outputformat.str_locale = ESCAPE_HTML; - } + } else { if (no_line_wrap_g) { outputformat.line_per_line = 1; @@ -1422,7 +1426,7 @@ dump_dataset_values(hid_t dset) outputformat.cmpd_pre = NULL; outputformat.cmpd_suf = NULL; outputformat.cmpd_sep = NULL; - + outputformat.vlen_sep = NULL; outputformat.vlen_pre = NULL; outputformat.vlen_suf = NULL; @@ -1439,7 +1443,7 @@ dump_dataset_values(hid_t dset) /* Print all data in hexadecimal format if the `-x' or `--hexdump' * command line switch was given. */ outputformat.raw = TRUE; - } + } else if (string_g && 1==size && H5T_INTEGER==H5Tget_class(f_type)) { /* Print 1-byte integer data as an ASCI character string instead of * integers if the `-s' or `--string' command-line option was given. */ @@ -1469,7 +1473,7 @@ dump_dataset_values(hid_t dset) H5Tclose(f_type); h5tools_str_close(&buffer); - + PRINTVALSTREAM(rawoutstream, "\n"); } @@ -1517,7 +1521,7 @@ list_attr(hid_t obj, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED *ain h5tools_str_reset(&buffer); h5tools_str_append(&buffer, " Attribute: "); - + print_string(&buffer, attr_name, TRUE); if((attr = H5Aopen(obj, attr_name, H5P_DEFAULT))) { @@ -1576,7 +1580,7 @@ list_attr(hid_t obj, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED *ain outputformat.line_cont = " "; outputformat.str_repeat = 8; - } + } else { h5tools_str_reset(&buffer); h5tools_str_append(&buffer, " Data:\n"); @@ -1607,7 +1611,7 @@ list_attr(hid_t obj, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED *ain outputformat.cmpd_pre = NULL; outputformat.cmpd_suf = NULL; outputformat.cmpd_sep = NULL; - + outputformat.vlen_sep = NULL; outputformat.vlen_pre = NULL; outputformat.vlen_suf = NULL; @@ -1651,7 +1655,7 @@ list_attr(hid_t obj, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED *ain H5Sclose(space); H5Tclose(type); H5Aclose(attr); - } + } h5tools_str_close(&buffer); PRINTVALSTREAM(rawoutstream, "\n"); @@ -1708,7 +1712,7 @@ dataset_list1(hid_t dset) h5tools_str_append(&buffer, "%s"HSIZE_T_FORMAT, i?", ":"", cur_size[i]); if (max_size[i]==H5S_UNLIMITED) { h5tools_str_append(&buffer, "/%s", "Inf"); - } + } else if (max_size[i]!=cur_size[i] || verbose_g>0) { h5tools_str_append(&buffer, "/"HSIZE_T_FORMAT, max_size[i]); } @@ -1755,6 +1759,7 @@ dataset_list2(hid_t dset, const char H5_ATTR_UNUSED *name) size_t cd_nelmts; /* filter client number of values */ size_t cd_num; /* filter client data counter */ char f_name[256]; /* filter/file name */ + char dset_name[256]; /* filter/file name */ char s[64]; /* temporary string buffer */ off_t f_offset; /* offset in external file */ hsize_t f_size; /* bytes used in external file */ @@ -1764,6 +1769,7 @@ dataset_list2(hid_t dset, const char H5_ATTR_UNUSED *name) double utilization; /* percent utilization of storage */ H5T_class_t tclass; /* datatype class identifier */ int i; + H5D_layout_t stl; hsize_t curr_pos = 0; /* total data element position */ h5tools_str_t buffer; /* string into which to render */ h5tools_context_t ctx; /* print context */ @@ -1779,20 +1785,71 @@ dataset_list2(hid_t dset, const char H5_ATTR_UNUSED *name) space = H5Dget_space(dset); type = H5Dget_type(dset); - /* Print information about chunked storage */ - if (H5D_CHUNKED==H5Pget_layout(dcpl)) { - hsize_t chsize[64]; /* chunk size in elements */ - - ndims = H5Pget_chunk(dcpl, (int)NELMTS(chsize), chsize/*out*/); - h5tools_str_append(&buffer, " %-10s {", "Chunks:"); - total = H5Tget_size(type); - for (i=0; i<ndims; i++) { - h5tools_str_append(&buffer, "%s"HSIZE_T_FORMAT, i?", ":"", chsize[i]); - total *= chsize[i]; - } - h5tools_str_append(&buffer, "} "HSIZE_T_FORMAT" bytes\n", total); + stl = H5Pget_layout(dcpl); + switch (stl) { + case H5D_CHUNKED: + { + hsize_t chsize[64]; /* chunk size in elements */ + + ndims = H5Pget_chunk(dcpl, (int)NELMTS(chsize), chsize/*out*/); + h5tools_str_append(&buffer, " %-10s {", "Chunks:"); + total = H5Tget_size(type); + for (i=0; i<ndims; i++) { + h5tools_str_append(&buffer, "%s"HSIZE_T_FORMAT, i?", ":"", chsize[i]); + total *= chsize[i]; + } + h5tools_str_append(&buffer, "} "HSIZE_T_FORMAT" bytes\n", total); + } + break; + case H5D_COMPACT: + break; + case H5D_CONTIGUOUS: + /* Print information about external storage */ + if((nf = H5Pget_external_count(dcpl)) > 0) { + for(i = 0, max_len = 0; i < nf; i++) { + if(H5Pget_external(dcpl, (unsigned)i, sizeof(f_name), f_name, NULL, NULL) < 0) + continue; + n = print_string(NULL, f_name, TRUE); + max_len = MAX(max_len, n); + } /* end for */ + h5tools_str_append(&buffer, " %-10s %d external file%s\n", + "Extern:", nf, 1==nf?"":"s"); + h5tools_str_append(&buffer, " %4s %10s %10s %10s %s\n", + "ID", "DSet-Addr", "File-Addr", "Bytes", "File"); + h5tools_str_append(&buffer, " %4s %10s %10s %10s ", + "----", "----------", "----------", "----------"); + for (i=0; i<max_len; i++) h5tools_str_append(&buffer, "-"); + h5tools_str_append(&buffer, "\n"); + for (i=0, total=0; i<nf; i++) { + if (H5Pget_external(dcpl, (unsigned)i, sizeof(f_name), f_name, &f_offset, &f_size)<0) { + h5tools_str_append(&buffer, + " #%03d %10"H5_PRINTF_LL_WIDTH"u %10s %10s ***ERROR*** %s\n", + i, total, "", "", + i+1<nf?"Following addresses are incorrect":""); + } + else if (H5S_UNLIMITED==f_size) { + h5tools_str_append(&buffer, " #%03d %10"H5_PRINTF_LL_WIDTH"u %10"H5_PRINTF_LL_WIDTH"u %10s ", + i, total, (hsize_t)f_offset, "INF"); + print_string(&buffer, f_name, TRUE); + } + else { + h5tools_str_append(&buffer, " #%03d %10"H5_PRINTF_LL_WIDTH"u %10"H5_PRINTF_LL_WIDTH"u %10"H5_PRINTF_LL_WIDTH"u ", + i, total, (hsize_t)f_offset, f_size); + print_string(&buffer, f_name, TRUE); + } + h5tools_str_append(&buffer, "\n"); + total += f_size; + } + h5tools_str_append(&buffer, " %4s %10s %10s %10s ", + "----", "----------", "----------", "----------"); + for (i=0; i<max_len; i++) + h5tools_str_append(&buffer, "-"); + h5tools_str_append(&buffer, "\n"); + } /* end if */ + break; + default: + break; } - /* Print total raw storage size */ total = (hsize_t)H5Sget_simple_extent_npoints(space) * H5Tget_size(type); used = H5Dget_storage_size(dset); @@ -1836,49 +1893,6 @@ dataset_list2(hid_t dset, const char H5_ATTR_UNUSED *name) h5tools_str_append(&buffer, "\n"); - /* Print information about external strorage */ - if((nf = H5Pget_external_count(dcpl)) > 0) { - for(i = 0, max_len = 0; i < nf; i++) { - if(H5Pget_external(dcpl, (unsigned)i, sizeof(f_name), f_name, NULL, NULL) < 0) - continue; - n = print_string(NULL, f_name, TRUE); - max_len = MAX(max_len, n); - } /* end for */ - h5tools_str_append(&buffer, " %-10s %d external file%s\n", - "Extern:", nf, 1==nf?"":"s"); - h5tools_str_append(&buffer, " %4s %10s %10s %10s %s\n", - "ID", "DSet-Addr", "File-Addr", "Bytes", "File"); - h5tools_str_append(&buffer, " %4s %10s %10s %10s ", - "----", "----------", "----------", "----------"); - for (i=0; i<max_len; i++) h5tools_str_append(&buffer, "-"); - h5tools_str_append(&buffer, "\n"); - for (i=0, total=0; i<nf; i++) { - if (H5Pget_external(dcpl, (unsigned)i, sizeof(f_name), f_name, &f_offset, &f_size)<0) { - h5tools_str_append(&buffer, - " #%03d %10"H5_PRINTF_LL_WIDTH"u %10s %10s ***ERROR*** %s\n", - i, total, "", "", - i+1<nf?"Following addresses are incorrect":""); - } - else if (H5S_UNLIMITED==f_size) { - h5tools_str_append(&buffer, " #%03d %10"H5_PRINTF_LL_WIDTH"u %10"H5_PRINTF_LL_WIDTH"u %10s ", - i, total, (hsize_t)f_offset, "INF"); - print_string(&buffer, f_name, TRUE); - } - else { - h5tools_str_append(&buffer, " #%03d %10"H5_PRINTF_LL_WIDTH"u %10"H5_PRINTF_LL_WIDTH"u %10"H5_PRINTF_LL_WIDTH"u ", - i, total, (hsize_t)f_offset, f_size); - print_string(&buffer, f_name, TRUE); - } - h5tools_str_append(&buffer, "\n"); - total += f_size; - } - h5tools_str_append(&buffer, " %4s %10s %10s %10s ", - "----", "----------", "----------", "----------"); - for (i=0; i<max_len; i++) - h5tools_str_append(&buffer, "-"); - h5tools_str_append(&buffer, "\n"); - } /* end if */ - /* Print information about raw data filters */ if((nf = H5Pget_nfilters(dcpl)) > 0) { for(i = 0; i < nf; i++) { @@ -2185,7 +2199,7 @@ list_lnk(const char *name, const H5L_info_t *linfo, void *_iter) h5tools_str_append(&buffer, " "); /* Check if we have already seen this softlink */ - if(symlink_is_visited(iter->symlink_list, linfo->type, NULL, buf)) + if(symlink_is_visited(iter->symlink_list, linfo->type, NULL, buf)) { h5tools_str_append(&buffer, "{Already Visited}\n"); h5tools_render_element(rawoutstream, info, &ctx, &buffer, &curr_pos, (size_t)info->line_ncols, (hsize_t)0, (hsize_t)0); @@ -2194,7 +2208,7 @@ list_lnk(const char *name, const H5L_info_t *linfo, void *_iter) h5tools_render_element(rawoutstream, info, &ctx, &buffer, &curr_pos, (size_t)info->line_ncols, (hsize_t)0, (hsize_t)0); /* Add this link to the list of seen softlinks */ - if(symlink_visit_add(iter->symlink_list, linfo->type, NULL, buf) < 0) + if(symlink_visit_add(iter->symlink_list, linfo->type, NULL, buf) < 0) goto done; /* Adjust user data to specify that we are operating on the @@ -2206,7 +2220,7 @@ list_lnk(const char *name, const H5L_info_t *linfo, void *_iter) if(!recursive_g) grp_literal_g = TRUE; /* Recurse through the soft link */ - if(visit_obj(iter->fid, name, iter) < 0) + if(visit_obj(iter->fid, name, iter) < 0) { grp_literal_g = orig_grp_literal; goto done; @@ -2239,7 +2253,7 @@ list_lnk(const char *name, const H5L_info_t *linfo, void *_iter) else if (no_dangling_link_g && ret == 0) iter->symlink_list->dangle_link = TRUE; - if(H5Lunpack_elink_val(buf, linfo->u.val_size, NULL, &filename, &path) < 0) + if(H5Lunpack_elink_val(buf, linfo->u.val_size, NULL, &filename, &path) < 0) goto done; h5tools_str_append(&buffer, "External Link {"); @@ -2260,7 +2274,7 @@ list_lnk(const char *name, const H5L_info_t *linfo, void *_iter) h5tools_str_append(&buffer, " "); /* Check if we have already seen this elink */ - if(symlink_is_visited(iter->symlink_list, linfo->type, filename, path)) + if(symlink_is_visited(iter->symlink_list, linfo->type, filename, path)) { h5tools_str_append(&buffer, "{Already Visited}\n"); h5tools_render_element(rawoutstream, info, &ctx, &buffer, &curr_pos, (size_t)info->line_ncols, (hsize_t)0, (hsize_t)0); @@ -2269,7 +2283,7 @@ list_lnk(const char *name, const H5L_info_t *linfo, void *_iter) h5tools_render_element(rawoutstream, info, &ctx, &buffer, &curr_pos, (size_t)info->line_ncols, (hsize_t)0, (hsize_t)0); /* Add this link to the list of seen elinks */ - if(symlink_visit_add(iter->symlink_list, linfo->type, filename, path) < 0) + if(symlink_visit_add(iter->symlink_list, linfo->type, filename, path) < 0) { goto done; } @@ -2319,7 +2333,7 @@ done: * * Purpose: Begins iteration on an object * - * Return: + * Return: * Success: 0 * Failure: -1 * @@ -2478,7 +2492,7 @@ get_width(void) * * Purpose: check if command line arguments are valid * - * Return: + * Return: * Success: TRUE (1) * Failure: FALSE (0) * @@ -2486,19 +2500,19 @@ get_width(void) * Jonathan Kim (06/15/2010) * *-------------------------------------------------------------------------*/ -static hbool_t +static hbool_t is_valid_args(void) { hbool_t ret = TRUE; - if(recursive_g && grp_literal_g) + if(recursive_g && grp_literal_g) { HDfprintf(rawerrorstream, "Error: 'recursive' option not compatible with 'group info' option!\n\n"); ret = FALSE; goto out; } - if(no_dangling_link_g && !follow_symlink_g) + if(no_dangling_link_g && !follow_symlink_g) { HDfprintf(rawerrorstream, "Error: --no-dangling-links must be used along with --follow-symlinks option!\n\n"); ret = FALSE; @@ -2876,7 +2890,7 @@ main(int argc, const char *argv[]) if(x) HDfree(oname); - for(u=0; u < symlink_list.nused; u++) + for(u=0; u < symlink_list.nused; u++) { if (symlink_list.objs[u].type == H5L_TYPE_EXTERNAL) HDfree(symlink_list.objs[u].file); @@ -2884,7 +2898,7 @@ main(int argc, const char *argv[]) HDfree(symlink_list.objs[u].path); } HDfree(symlink_list.objs); - + /* if no-dangling-links option specified and dangling link found */ if (no_dangling_link_g && iter.symlink_list->dangle_link) err_exit = 1; diff --git a/tools/h5repack/CMakeLists.txt b/tools/h5repack/CMakeLists.txt index 42d9f3d..7631ae8 100644 --- a/tools/h5repack/CMakeLists.txt +++ b/tools/h5repack/CMakeLists.txt @@ -21,8 +21,8 @@ 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 ${LIB_TYPE} " " " ") +TARGET_NAMING (h5repack STATIC) +TARGET_C_PROPERTIES (h5repack STATIC " " " ") target_link_libraries (h5repack ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) set_target_properties (h5repack PROPERTIES FOLDER tools) @@ -33,51 +33,49 @@ if (BUILD_TESTING) # Add h5Repack test executables # -------------------------------------------------------------------- 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 ${LIB_TYPE} " " " ") + TARGET_NAMING (testh5repack_detect_szip STATIC) + TARGET_C_PROPERTIES (testh5repack_detect_szip STATIC " " " ") 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 ${LIB_TYPE} " " " ") + TARGET_NAMING (h5repacktest STATIC) + TARGET_C_PROPERTIES (h5repacktest STATIC " " " ") target_link_libraries (h5repacktest ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) set_target_properties (h5repacktest PROPERTIES FOLDER tools) #----------------------------------------------------------------------------- # If plugin library tests can be tested #----------------------------------------------------------------------------- - if (BUILD_SHARED_LIBS) - set (HDF5_TOOL_PLUGIN_LIB_CORENAME "dynlibadd") - set (HDF5_TOOL_PLUGIN_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_TOOL_PLUGIN_LIB_CORENAME}") - set (HDF5_TOOL_PLUGIN_LIB_TARGET ${HDF5_TOOL_PLUGIN_LIB_CORENAME}) - add_definitions (${HDF_EXTRA_C_FLAGS}) - INCLUDE_DIRECTORIES (${HDF5_SRC_DIR}) + set (HDF5_TOOL_PLUGIN_LIB_CORENAME "dynlibadd") + set (HDF5_TOOL_PLUGIN_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_TOOL_PLUGIN_LIB_CORENAME}") + set (HDF5_TOOL_PLUGIN_LIB_TARGET ${HDF5_TOOL_PLUGIN_LIB_CORENAME}) + add_definitions (${HDF_EXTRA_C_FLAGS}) + INCLUDE_DIRECTORIES (${HDF5_SRC_DIR}) - 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} - SHARED - HDF5_TOOL_PLUGIN_LIB_NAME_RELEASE - HDF5_TOOL_PLUGIN_LIB_NAME_DEBUG - ) + 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} + SHARED + HDF5_TOOL_PLUGIN_LIB_NAME_RELEASE + HDF5_TOOL_PLUGIN_LIB_NAME_DEBUG + ) - # make plugins dir - file (MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/plugins") - #----------------------------------------------------------------------------- - # Copy plugin library to a plugins folder - #----------------------------------------------------------------------------- - add_custom_command ( - TARGET ${HDF5_TOOL_PLUGIN_LIB_TARGET} - POST_BUILD - COMMAND ${CMAKE_COMMAND} - ARGS -E copy_if_different + # make plugins dir + file (MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/plugins") + #----------------------------------------------------------------------------- + # Copy plugin library to a plugins folder + #----------------------------------------------------------------------------- + add_custom_command ( + TARGET ${HDF5_TOOL_PLUGIN_LIB_TARGET} + POST_BUILD + COMMAND ${CMAKE_COMMAND} + ARGS -E copy_if_different "$<TARGET_FILE:${HDF5_TOOL_PLUGIN_LIB_TARGET}>" "${CMAKE_BINARY_DIR}/plugins/$<TARGET_FILE_NAME:${HDF5_TOOL_PLUGIN_LIB_TARGET}>" - ) - endif (BUILD_SHARED_LIBS) + ) include (CMakeTests.cmake) @@ -98,8 +96,5 @@ endif (BUILD_TESTING) install ( TARGETS h5repack - RUNTIME DESTINATION - ${HDF5_INSTALL_BIN_DIR} - COMPONENT - toolsapplications + RUNTIME DESTINATION ${HDF5_INSTALL_BIN_DIR} COMPONENT toolsapplications ) diff --git a/tools/h5repack/CMakeTests.cmake b/tools/h5repack/CMakeTests.cmake index efaa6e5..dee97ed 100644 --- a/tools/h5repack/CMakeTests.cmake +++ b/tools/h5repack/CMakeTests.cmake @@ -992,16 +992,8 @@ ############################################################################## ### P L U G I N T E S T S ############################################################################## -if (BUILD_SHARED_LIBS) ADD_H5_UD_TEST (plugin_test 0 h5repack_layout.h5 -v -f UD=257,1,9) ADD_H5_UD_TEST (plugin_none 0 h5repack_layout.UD.h5 -v -f NONE) -else (BUILD_SHARED_LIBS) - message (STATUS " **** Plugins libraries must be built as shared libraries **** ") - add_test ( - NAME H5REPACK-plugin - COMMAND ${CMAKE_COMMAND} -E echo "SKIP H5PLUGIN TESTING" - ) -endif (BUILD_SHARED_LIBS) if (HDF5_TEST_VFD) # Run test with different Virtual File Driver diff --git a/tools/h5stat/CMakeLists.txt b/tools/h5stat/CMakeLists.txt index 5230693..71c4741 100644 --- a/tools/h5stat/CMakeLists.txt +++ b/tools/h5stat/CMakeLists.txt @@ -10,8 +10,8 @@ INCLUDE_DIRECTORIES (${HDF5_TOOLS_SRC_DIR}/lib) # Add the h5stat executables # -------------------------------------------------------------------- add_executable (h5stat ${HDF5_TOOLS_H5STAT_SOURCE_DIR}/h5stat.c) -TARGET_NAMING (h5stat ${LIB_TYPE}) -TARGET_C_PROPERTIES (h5stat ${LIB_TYPE} " " " ") +TARGET_NAMING (h5stat STATIC) +TARGET_C_PROPERTIES (h5stat STATIC " " " ") target_link_libraries (h5stat ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) set_target_properties (h5stat PROPERTIES FOLDER tools) @@ -21,7 +21,7 @@ if (BUILD_TESTING) # -------------------------------------------------------------------- # Add the h5stat test executables # -------------------------------------------------------------------- - if (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) + if (HDF5_BUILD_GENERATORS) add_executable (h5stat_gentest ${HDF5_TOOLS_H5STAT_SOURCE_DIR}/h5stat_gentest.c) TARGET_NAMING (h5stat_gentest STATIC) TARGET_C_PROPERTIES (h5stat_gentest STATIC " " " ") @@ -29,7 +29,7 @@ if (BUILD_TESTING) set_target_properties (h5stat_gentest PROPERTIES FOLDER generator/tools) #add_test (NAME h5stat_gentest COMMAND $<TARGET_FILE:h5stat_gentest>) - endif (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) + endif (HDF5_BUILD_GENERATORS) include (CMakeTests.cmake) endif (BUILD_TESTING) @@ -49,8 +49,5 @@ endif (BUILD_TESTING) install ( TARGETS h5stat - RUNTIME DESTINATION - ${HDF5_INSTALL_BIN_DIR} - COMPONENT - toolsapplications + RUNTIME DESTINATION ${HDF5_INSTALL_BIN_DIR} COMPONENT toolsapplications ) diff --git a/tools/lib/CMakeLists.txt b/tools/lib/CMakeLists.txt index dbd72cd..38c84a2 100644 --- a/tools/lib/CMakeLists.txt +++ b/tools/lib/CMakeLists.txt @@ -37,21 +37,43 @@ set (H5_TOOLS_LIB_HDRS ${HDF5_TOOLS_LIB_SOURCE_DIR}/h5diff.h ) -add_library (${HDF5_TOOLS_LIB_TARGET} ${LIB_TYPE} ${H5_TOOLS_LIB_SRCS} ${H5_TOOLS_LIB_HDRS}) -TARGET_C_PROPERTIES (${HDF5_TOOLS_LIB_TARGET} ${LIB_TYPE} " " " ") +add_library (${HDF5_TOOLS_LIB_TARGET} STATIC ${H5_TOOLS_LIB_SRCS} ${H5_TOOLS_LIB_HDRS}) +TARGET_C_PROPERTIES (${HDF5_TOOLS_LIB_TARGET} STATIC " " " ") target_link_libraries (${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_TOOLS_LIB_TARGET}") H5_SET_LIB_OPTIONS ( ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TOOLS_LIB_NAME} - ${LIB_TYPE} + STATIC HDF5_TOOLS_LIB_NAME_RELEASE HDF5_TOOLS_LIB_NAME_DEBUG ) -#set_target_properties (${HDF5_TOOLS_LIB_TARGET} PROPERTIES COMPILE_DEFINITIONS H5DIFF_DEBUG) set_target_properties (${HDF5_TOOLS_LIB_TARGET} PROPERTIES FOLDER libraries/tools INTERFACE_INCLUDE_DIRECTORIES "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include>" ) +#set_property (TARGET ${HDF5_TOOLS_LIB_TARGET} APPEND PROPERTY COMPILE_DEFINITIONS H5DIFF_DEBUG) +set (install_targets ${HDF5_TOOLS_LIB_TARGET}) + +if (BUILD_SHARED_LIBS) + add_library (${HDF5_TOOLS_LIBSH_TARGET} SHARED ${H5_TOOLS_LIB_SRCS} ${H5_TOOLS_LIB_HDRS}) + TARGET_C_PROPERTIES (${HDF5_TOOLS_LIBSH_TARGET} SHARED " " " ") + target_link_libraries (${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) + set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_TOOLS_LIBSH_TARGET}") + H5_SET_LIB_OPTIONS ( + ${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_TOOLS_LIB_NAME} + SHARED + HDF5_TOOLS_LIB_NAME_RELEASE + HDF5_TOOLS_LIB_NAME_DEBUG + ) + set_target_properties (${HDF5_TOOLS_LIBSH_TARGET} PROPERTIES + FOLDER libraries/tools + COMPILE_DEFINITIONS "H5_BUILT_AS_DYNAMIC_LIB" + INTERFACE_INCLUDE_DIRECTORIES "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include>" + INTERFACE_COMPILE_DEFINITIONS H5_BUILT_AS_DYNAMIC_LIB=1 + ) + #set_property (TARGET ${HDF5_TOOLS_LIBSH_TARGET} APPEND PROPERTY COMPILE_DEFINITIONS H5DIFF_DEBUG) + set (install_targets ${install_targets} ${HDF5_TOOLS_LIBSH_TARGET}) +endif (BUILD_SHARED_LIBS) ############################################################################## ############################################################################## @@ -60,7 +82,7 @@ set_target_properties (${HDF5_TOOLS_LIB_TARGET} PROPERTIES ############################################################################## #----------------------------------------------------------------------------- -# Add file(s) to CMake Install +# Add file(s) to CMake Install #----------------------------------------------------------------------------- install ( FILES @@ -76,16 +98,17 @@ install ( #----------------------------------------------------------------------------- if (HDF5_EXPORTED_TARGETS) if (BUILD_SHARED_LIBS) - INSTALL_TARGET_PDB (${HDF5_TOOLS_LIB_TARGET} ${HDF5_INSTALL_BIN_DIR} toolslibraries) + INSTALL_TARGET_PDB (${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_INSTALL_BIN_DIR} toolslibraries) endif (BUILD_SHARED_LIBS) - + install ( TARGETS - ${HDF5_TOOLS_LIB_TARGET} + ${install_targets} EXPORT ${HDF5_EXPORTED_TARGETS} LIBRARY DESTINATION ${HDF5_INSTALL_LIB_DIR} COMPONENT toolslibraries ARCHIVE DESTINATION ${HDF5_INSTALL_LIB_DIR} COMPONENT toolslibraries RUNTIME DESTINATION ${HDF5_INSTALL_BIN_DIR} COMPONENT toolslibraries + FRAMEWORK DESTINATION ${HDF5_INSTALL_FWRK_DIR} COMPONENT toolslibraries ) endif (HDF5_EXPORTED_TARGETS) diff --git a/tools/lib/h5tools_str.c b/tools/lib/h5tools_str.c index 2603984..470620f 100644 --- a/tools/lib/h5tools_str.c +++ b/tools/lib/h5tools_str.c @@ -48,6 +48,7 @@ static char *h5tools_escape(char *s, size_t size); static hbool_t h5tools_str_is_zero(const void *_mem, size_t size); static void h5tools_print_char(h5tools_str_t *str, const h5tool_format_t *info, char ch); +void h5tools_str_indent(h5tools_str_t *str, const h5tool_format_t *info, h5tools_context_t *ctx); /*------------------------------------------------------------------------- * Function: h5tools_str_close @@ -144,16 +145,16 @@ h5tools_str_append(h5tools_str_t *str/*in,out*/, const char *fmt, ...) nchars = HDvsnprintf(str->s + str->len, avail, fmt, ap); HDva_end(ap); - /* Note: HDvsnprintf() behaves differently on Windows as Unix, when - * buffer is smaller than source string. On Unix, this function - * returns length of the source string and copy string upto the - * buffer size with NULL at the end of the buffer. However on - * Windows with the same condition, this function returns -1 and + /* Note: HDvsnprintf() behaves differently on Windows as Unix, when + * buffer is smaller than source string. On Unix, this function + * returns length of the source string and copy string upto the + * buffer size with NULL at the end of the buffer. However on + * Windows with the same condition, this function returns -1 and * doesn't add NULL at the end of the buffer. * Because of this different return results, the strlen of the new string * is used to handle when HDvsnprintf() returns -1 on Windows due * to lack of buffer size, so try one more time after realloc more - * buffer size before return NULL. + * buffer size before return NULL. */ if (nchars < 0) { /* failure, such as bad format */ @@ -277,7 +278,7 @@ h5tools_str_fmt(h5tools_str_t *str/*in,out*/, size_t start, const char *fmt) if (HDstrchr(fmt, '%')) { size_t n = sizeof(_temp); if (str->len - start + 1 > n) { - n = str->len - start + 1; + n = str->len - start + 1; temp = (char*)HDmalloc(n); HDassert(temp); } @@ -665,12 +666,12 @@ h5tools_str_indent(h5tools_str_t *str, const h5tool_format_t *info, * * PVN, 28 March 2006 * added H5T_NATIVE_LDOUBLE case - * + * * Raymond Lu, 2011-09-01 * CLANG compiler complained about the line (about 800): * tempint = (tempint >> packed_data_offset) & packed_data_mask; - * The right shift may cause undefined behavior if PACKED_DATA_OFFSET is - * 32-bit or more. For every kind of native integers, I changed the code + * The right shift may cause undefined behavior if PACKED_DATA_OFFSET is + * 32-bit or more. For every kind of native integers, I changed the code * to make it zero if PACKED_DATA_OFFSET is greater than or equal to the * size of integer. *------------------------------------------------------------------------- @@ -1371,14 +1372,14 @@ h5tools_str_is_zero(const void *_mem, size_t size) * * Purpose: replace all occurrences of substring. * - * Return: char * + * Return: char * * * Programmer: Peter Cao * March 8, 2012 * * Notes: - * Applications need to call free() to free the memoery allocated for - * the return string + * Applications need to call free() to free the memoery allocated for + * the return string * *------------------------------------------------------------------------- */ @@ -1411,6 +1412,6 @@ h5tools_str_replace ( const char *string, const char *substr, const char *replac head = newstr + (tok - oldstr) + HDstrlen( replacement ); HDfree (oldstr); } - + return newstr; } diff --git a/tools/misc/CMakeLists.txt b/tools/misc/CMakeLists.txt index e0f94d0..d53cdc8 100644 --- a/tools/misc/CMakeLists.txt +++ b/tools/misc/CMakeLists.txt @@ -11,20 +11,20 @@ INCLUDE_DIRECTORIES (${HDF5_TOOLS_SRC_DIR}/lib) # -------------------------------------------------------------------- #-- Misc Executables add_executable (h5debug ${HDF5_TOOLS_MISC_SOURCE_DIR}/h5debug.c) -TARGET_NAMING (h5debug ${LIB_TYPE}) -TARGET_C_PROPERTIES (h5debug ${LIB_TYPE} " " " ") +TARGET_NAMING (h5debug STATIC) +TARGET_C_PROPERTIES (h5debug STATIC " " " ") target_link_libraries (h5debug ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) set_target_properties (h5debug PROPERTIES FOLDER tools) add_executable (h5repart ${HDF5_TOOLS_MISC_SOURCE_DIR}/h5repart.c) -TARGET_NAMING (h5repart ${LIB_TYPE}) -TARGET_C_PROPERTIES (h5repart ${LIB_TYPE} " " " ") +TARGET_NAMING (h5repart STATIC) +TARGET_C_PROPERTIES (h5repart STATIC " " " ") target_link_libraries (h5repart ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) set_target_properties (h5repart PROPERTIES FOLDER tools) add_executable (h5mkgrp ${HDF5_TOOLS_MISC_SOURCE_DIR}/h5mkgrp.c) -TARGET_NAMING (h5mkgrp ${LIB_TYPE}) -TARGET_C_PROPERTIES (h5mkgrp ${LIB_TYPE} " " " ") +TARGET_NAMING (h5mkgrp STATIC) +TARGET_C_PROPERTIES (h5mkgrp STATIC " " " ") target_link_libraries (h5mkgrp ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) set_target_properties (h5mkgrp PROPERTIES FOLDER tools) @@ -45,18 +45,18 @@ if (BUILD_TESTING) # -------------------------------------------------------------------- # Add the misc test executables # -------------------------------------------------------------------- - if (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) + if (HDF5_BUILD_GENERATORS) add_executable (h5repart_gentest ${HDF5_TOOLS_MISC_SOURCE_DIR}/h5repart_gentest.c) TARGET_NAMING (h5repart_gentest STATIC) TARGET_C_PROPERTIES (h5repart_gentest STATIC " " " ") target_link_libraries (h5repart_gentest ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) set_target_properties (h5repart_gentest PROPERTIES FOLDER generator/tools) #add_test (NAME h5repart_gentest COMMAND $<TARGET_FILE:h5repart_gentest>) - endif (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) + endif (HDF5_BUILD_GENERATORS) add_executable (h5repart_test ${HDF5_TOOLS_MISC_SOURCE_DIR}/repart_test.c) - TARGET_NAMING (h5repart_test ${LIB_TYPE}) - TARGET_C_PROPERTIES (h5repart_test ${LIB_TYPE} " " " ") + TARGET_NAMING (h5repart_test STATIC) + TARGET_C_PROPERTIES (h5repart_test STATIC " " " ") target_link_libraries (h5repart_test ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) set_target_properties (h5repart_test PROPERTIES FOLDER tools) @@ -80,8 +80,5 @@ endif (BUILD_TESTING) install ( TARGETS h5debug h5repart h5mkgrp - RUNTIME DESTINATION - ${HDF5_INSTALL_BIN_DIR} - COMPONENT - toolsapplications + RUNTIME DESTINATION ${HDF5_INSTALL_BIN_DIR} COMPONENT toolsapplications ) diff --git a/tools/perform/CMakeLists.txt b/tools/perform/CMakeLists.txt index 17b40fa..3a60a84 100644 --- a/tools/perform/CMakeLists.txt +++ b/tools/perform/CMakeLists.txt @@ -21,8 +21,8 @@ set (h5perf_serial_SRCS ${HDF5_PERFORM_SOURCE_DIR}/sio_engine.c ) add_executable (h5perf_serial ${h5perf_serial_SRCS}) -TARGET_NAMING (h5perf_serial ${LIB_TYPE}) -TARGET_C_PROPERTIES (h5perf_serial ${LIB_TYPE} " " " ") +TARGET_NAMING (h5perf_serial STATIC) +TARGET_C_PROPERTIES (h5perf_serial STATIC " " " ") target_link_libraries (h5perf_serial ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) set_target_properties (h5perf_serial PROPERTIES FOLDER perform) @@ -33,8 +33,8 @@ if (HDF5_BUILD_PERFORM_STANDALONE) ${HDF5_PERFORM_SOURCE_DIR}/sio_engine.c ) add_executable (h5perf_serial_alone ${h5perf_serial_alone_SRCS}) - TARGET_NAMING (h5perf_serial_alone ${LIB_TYPE}) - TARGET_C_PROPERTIES (h5perf_serial_alone ${LIB_TYPE} " " " ") + TARGET_NAMING (h5perf_serial_alone STATIC) + TARGET_C_PROPERTIES (h5perf_serial_alone STATIC " " " ") target_link_libraries (h5perf_serial_alone ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) set_target_properties (h5perf_serial_alone PROPERTIES FOLDER perform) set_property (TARGET h5perf_serial_alone @@ -47,8 +47,8 @@ set (chunk_SRCS ${HDF5_PERFORM_SOURCE_DIR}/chunk.c ) ADD_EXECUTABLE(chunk ${chunk_SRCS}) -TARGET_NAMING (chunk ${LIB_TYPE}) -TARGET_C_PROPERTIES (chunk ${LIB_TYPE} " " " ") +TARGET_NAMING (chunk STATIC) +TARGET_C_PROPERTIES (chunk STATIC " " " ") TARGET_LINK_LIBRARIES(chunk ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) set_target_properties (chunk PROPERTIES FOLDER perform) @@ -57,8 +57,8 @@ set (iopipe_SRCS ${HDF5_PERFORM_SOURCE_DIR}/iopipe.c ) add_executable (iopipe ${iopipe_SRCS}) -TARGET_NAMING (iopipe ${LIB_TYPE}) -TARGET_C_PROPERTIES (iopipe ${LIB_TYPE} " " " ") +TARGET_NAMING (iopipe STATIC) +TARGET_C_PROPERTIES (iopipe STATIC " " " ") target_link_libraries (iopipe ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) set_target_properties (iopipe PROPERTIES FOLDER perform) @@ -67,8 +67,8 @@ set (overhead_SRCS ${HDF5_PERFORM_SOURCE_DIR}/overhead.c ) add_executable (overhead ${overhead_SRCS}) -TARGET_NAMING (overhead ${LIB_TYPE}) -TARGET_C_PROPERTIES (overhead ${LIB_TYPE} " " " ") +TARGET_NAMING (overhead STATIC) +TARGET_C_PROPERTIES (overhead STATIC " " " ") target_link_libraries (overhead ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) set_target_properties (overhead PROPERTIES FOLDER perform) @@ -78,8 +78,8 @@ if (BUILD_TESTING) ${HDF5_PERFORM_SOURCE_DIR}/perf_meta.c ) add_executable (perf_meta ${perf_meta_SRCS}) - TARGET_NAMING (perf_meta ${LIB_TYPE}) - TARGET_C_PROPERTIES (perf_meta ${LIB_TYPE} " " " ") + TARGET_NAMING (perf_meta STATIC) + TARGET_C_PROPERTIES (perf_meta STATIC " " " ") target_link_libraries (perf_meta ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) set_target_properties (perf_meta PROPERTIES FOLDER perform) endif (BUILD_TESTING) @@ -89,8 +89,8 @@ set (zip_perf_SRCS ${HDF5_PERFORM_SOURCE_DIR}/zip_perf.c ) add_executable (zip_perf ${zip_perf_SRCS}) -TARGET_NAMING (zip_perf ${LIB_TYPE}) -TARGET_C_PROPERTIES (zip_perf ${LIB_TYPE} " " " ") +TARGET_NAMING (zip_perf STATIC) +TARGET_C_PROPERTIES (zip_perf STATIC " " " ") target_link_libraries (zip_perf ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) set_target_properties (zip_perf PROPERTIES FOLDER perform) @@ -101,8 +101,8 @@ if (H5_HAVE_PARALLEL AND BUILD_TESTING) ${HDF5_PERFORM_SOURCE_DIR}/pio_engine.c ) add_executable (h5perf ${h5perf_SRCS}) - TARGET_NAMING (h5perf ${LIB_TYPE}) - TARGET_C_PROPERTIES (h5perf ${LIB_TYPE} " " " ") + TARGET_NAMING (h5perf STATIC) + TARGET_C_PROPERTIES (h5perf STATIC " " " ") target_link_libraries (h5perf ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) set_target_properties (h5perf PROPERTIES FOLDER perform) @@ -113,8 +113,8 @@ if (H5_HAVE_PARALLEL AND BUILD_TESTING) ${HDF5_PERFORM_SOURCE_DIR}/pio_engine.c ) add_executable (h5perf_alone ${h5perf_alone_SRCS}) - TARGET_NAMING (h5perf_alone ${LIB_TYPE}) - TARGET_C_PROPERTIES (h5perf_alone ${LIB_TYPE} " " " ") + TARGET_NAMING (h5perf_alone STATIC) + TARGET_C_PROPERTIES (h5perf_alone STATIC " " " ") target_link_libraries (h5perf_alone ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) set_target_properties (h5perf_alone PROPERTIES FOLDER perform) set_property (TARGET h5perf_alone diff --git a/tools/perform/chunk.c b/tools/perform/chunk.c index 625809a..74bcc46 100644 --- a/tools/perform/chunk.c +++ b/tools/perform/chunk.c @@ -33,8 +33,8 @@ # include <string.h> #endif - -#if !defined(H5_HAVE_ATTRIBUTE) || defined __cplusplus +/* Solaris Studio defines attribute, but for the attributes we need */ +#if !defined(H5_HAVE_ATTRIBUTE) || defined __cplusplus || defined(__SUNPRO_C) # undef __attribute__ # define __attribute__(X) /*void*/ # define H5_ATTR_UNUSED /*void*/ diff --git a/tools/perform/overhead.c b/tools/perform/overhead.c index 0e9166c..0288ffa 100644 --- a/tools/perform/overhead.c +++ b/tools/perform/overhead.c @@ -46,7 +46,8 @@ # include <io.h> #endif -#ifndef H5_HAVE_ATTRIBUTE +/* Solaris Studio defines attribute, but for the attributes we need */ +#if !defined(H5_HAVE_ATTRIBUTE) || defined __cplusplus || defined(__SUNPRO_C) # undef __attribute__ # define __attribute__(X) /*void*/ # define H5_ATTR_UNUSED /*void*/ |