From 55822485c64197a6c2c4a623824fcdcd10a57d31 Mon Sep 17 00:00:00 2001 From: Raymond Lu Date: Wed, 13 Mar 2013 14:35:26 -0500 Subject: [svn-r23346] First commit for DESY project. It has the basic functionality of loading dynamically filter libraries and a simple test for it. Tested on koala. --- MANIFEST | 10 + Makefile.in | 11 +- configure | 59 +++- configure.ac | 5 +- src/H5.c | 1 + src/H5Edefin.h | 3 + src/H5Einit.h | 7 + src/H5Epubgen.h | 4 + src/H5Eterm.h | 3 + src/H5PL.c | 401 ++++++++++++++++++++++ src/H5PLpkg.h | 59 ++++ src/H5PLprivate.h | 59 ++++ src/H5PLpublic.h | 45 +++ src/H5Pocpl.c | 91 ++++- src/H5Pprivate.h | 2 + src/H5Z.c | 62 +++- src/H5Zprivate.h | 1 + src/H5Zpublic.h | 6 + src/H5config.h.in | 3 + src/H5err.txt | 2 + src/H5private.h | 1 + src/Makefile.am | 4 +- src/Makefile.in | 7 +- src/hdf5.h | 1 + test/Makefile.am | 10 +- test/Makefile.in | 46 ++- test/plugin.c | 810 ++++++++++++++++++++++++++++++++++++++++++++ test/plugin_lib/Makefile.in | 26 ++ test/plugin_lib/dynlib1.c | 73 ++++ test/plugin_lib/dynlib1.h | 9 + test/test_plugin.sh.in | 57 ++++ 31 files changed, 1834 insertions(+), 44 deletions(-) create mode 100644 src/H5PL.c create mode 100644 src/H5PLpkg.h create mode 100644 src/H5PLprivate.h create mode 100644 src/H5PLpublic.h create mode 100644 test/plugin.c create mode 100644 test/plugin_lib/Makefile.in create mode 100644 test/plugin_lib/dynlib1.c create mode 100644 test/plugin_lib/dynlib1.h create mode 100644 test/test_plugin.sh.in diff --git a/MANIFEST b/MANIFEST index e0ffe8f..86a3238 100644 --- a/MANIFEST +++ b/MANIFEST @@ -846,6 +846,10 @@ ./src/H5Ppublic.h ./src/H5Pstrcpl.c ./src/H5Ptest.c +./src/H5PL.c +./src/H5PLpkg.c +./src/H5PLprivate.c +./src/H5PLpublic.c ./src/H5R.c ./src/H5Rdeprec.c ./src/H5Rpkg.h @@ -1027,6 +1031,7 @@ ./test/ntypes.c ./test/ohdr.c ./test/objcopy.c +./test/plugin.c ./test/reserved.c ./test/pool.c ./test/set_extent.c @@ -1049,6 +1054,7 @@ ./test/testhdf5.c ./test/testhdf5.h ./test/testlibinfo.sh.in +./test/test_plugin.sh.in ./test/testmeta.c ./test/tfile.c ./test/tgenprop.c @@ -1087,6 +1093,10 @@ ./test/gen_filters.c ./test/chunk_info.c +./test/plugin_lib/dynlib1.c +./test/plugin_lib/dynlib1.h +./test/plugin_lib/Makefile.in + ./test/testfiles/err_compat_1 ./test/testfiles/err_compat_2 ./test/testfiles/error_test_1 diff --git a/Makefile.in b/Makefile.in index 1472be5..7144e95 100644 --- a/Makefile.in +++ b/Makefile.in @@ -88,9 +88,10 @@ DIST_COMMON = $(am__configure_deps) $(srcdir)/Makefile.am \ $(top_srcdir)/bin/ltmain.sh $(top_srcdir)/bin/missing \ $(top_srcdir)/bin/mkinstalldirs \ $(top_srcdir)/config/commence.am $(top_srcdir)/configure \ - COPYING bin/COPYING bin/README bin/compile bin/config.guess \ - bin/config.sub bin/depcomp bin/install-sh bin/ltmain.sh \ - bin/missing bin/mkinstalldirs + $(top_srcdir)/test/plugin_lib/Makefile.in COPYING bin/COPYING \ + bin/README bin/compile bin/config.guess bin/config.sub \ + bin/depcomp bin/install-sh bin/ltmain.sh bin/missing \ + bin/mkinstalldirs subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac @@ -100,7 +101,7 @@ am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(SHELL) $(top_srcdir)/bin/mkinstalldirs CONFIG_HEADER = $(top_builddir)/src/H5config.h -CONFIG_CLEAN_FILES = +CONFIG_CLEAN_FILES = test/plugin_lib/Makefile CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) @@ -519,6 +520,8 @@ $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) $(am__aclocal_m4_deps): +test/plugin_lib/Makefile: $(top_builddir)/config.status $(top_srcdir)/test/plugin_lib/Makefile.in + cd $(top_builddir) && $(SHELL) ./config.status $@ mostlyclean-libtool: -rm -f *.lo diff --git a/configure b/configure index 0fce423..157dcc1 100755 --- a/configure +++ b/configure @@ -22247,7 +22247,7 @@ $as_echo "user-defined" >&6; } esac ## ---------------------------------------------------------------------- -## Check for system libraries. +## Check for system libraries. "dl" stands for dynamically loaded library ## { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ceil in -lm" >&5 $as_echo_n "checking for ceil in -lm... " >&6; } @@ -22302,6 +22302,59 @@ _ACEOF fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 +$as_echo_n "checking for dlopen in -ldl... " >&6; } +if ${ac_cv_lib_dl_dlopen+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +#ifdef FC_DUMMY_MAIN +#ifndef FC_DUMMY_MAIN_EQ_F77 +# ifdef __cplusplus + extern "C" +# endif + int FC_DUMMY_MAIN() { return 1; } +#endif +#endif +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dl_dlopen=yes +else + ac_cv_lib_dl_dlopen=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 +$as_echo "$ac_cv_lib_dl_dlopen" >&6; } +if test "x$ac_cv_lib_dl_dlopen" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBDL 1 +_ACEOF + + LIBS="-ldl $LIBS" + +fi + if test "`uname`" = "SunOS" -o "`uname -sr`" = "HP-UX B.11.00"; then ## ...for Solaris @@ -31133,7 +31186,7 @@ if test -n "$TESTPARALLEL"; then fi fi -ac_config_files="$ac_config_files src/libhdf5.settings Makefile src/Makefile test/Makefile test/testcheck_version.sh test/testerror.sh test/H5srcdir_str.h test/testlibinfo.sh test/testlinks_env.sh testpar/Makefile testpar/testph5.sh perform/Makefile tools/Makefile tools/h5dump/Makefile tools/h5dump/testh5dump.sh tools/h5dump/testh5dumppbits.sh tools/h5dump/testh5dumpxml.sh tools/h5ls/testh5ls.sh tools/h5import/Makefile tools/h5import/h5importtestutil.sh tools/h5diff/Makefile tools/h5diff/testh5diff.sh tools/h5diff/testph5diff.sh tools/h5jam/Makefile tools/h5jam/testh5jam.sh tools/h5repack/Makefile tools/h5repack/h5repack.sh tools/h5ls/Makefile tools/h5copy/Makefile tools/h5copy/testh5copy.sh tools/lib/Makefile tools/misc/Makefile tools/misc/h5cc tools/misc/testh5mkgrp.sh tools/misc/testh5repart.sh tools/h5stat/testh5stat.sh tools/h5stat/Makefile examples/Makefile examples/run-c-ex.sh examples/testh5cc.sh c++/Makefile c++/src/Makefile c++/src/h5c++ c++/test/Makefile c++/test/H5srcdir_str.h c++/examples/Makefile c++/examples/run-c++-ex.sh c++/examples/testh5c++.sh fortran/Makefile fortran/src/h5fc fortran/src/Makefile fortran/test/Makefile fortran/testpar/Makefile fortran/examples/Makefile fortran/examples/run-fortran-ex.sh fortran/examples/testh5fc.sh hl/Makefile hl/src/Makefile hl/test/Makefile hl/test/H5srcdir_str.h hl/tools/Makefile hl/tools/gif2h5/Makefile hl/tools/gif2h5/h52giftest.sh hl/examples/Makefile hl/examples/run-hlc-ex.sh hl/c++/Makefile hl/c++/src/Makefile hl/c++/test/Makefile hl/c++/examples/Makefile hl/c++/examples/run-hlc++-ex.sh hl/fortran/Makefile hl/fortran/src/Makefile hl/fortran/test/Makefile hl/fortran/examples/Makefile hl/fortran/examples/run-hlfortran-ex.sh" +ac_config_files="$ac_config_files src/libhdf5.settings Makefile src/Makefile test/Makefile test/testcheck_version.sh test/testerror.sh test/H5srcdir_str.h test/testlibinfo.sh test/testlinks_env.sh test/test_plugin.sh test/plugin_lib/Makefile testpar/Makefile testpar/testph5.sh perform/Makefile tools/Makefile tools/h5dump/Makefile tools/h5dump/testh5dump.sh tools/h5dump/testh5dumppbits.sh tools/h5dump/testh5dumpxml.sh tools/h5ls/testh5ls.sh tools/h5import/Makefile tools/h5import/h5importtestutil.sh tools/h5diff/Makefile tools/h5diff/testh5diff.sh tools/h5diff/testph5diff.sh tools/h5jam/Makefile tools/h5jam/testh5jam.sh tools/h5repack/Makefile tools/h5repack/h5repack.sh tools/h5ls/Makefile tools/h5copy/Makefile tools/h5copy/testh5copy.sh tools/lib/Makefile tools/misc/Makefile tools/misc/h5cc tools/misc/testh5mkgrp.sh tools/misc/testh5repart.sh tools/h5stat/testh5stat.sh tools/h5stat/Makefile examples/Makefile examples/run-c-ex.sh examples/testh5cc.sh c++/Makefile c++/src/Makefile c++/src/h5c++ c++/test/Makefile c++/test/H5srcdir_str.h c++/examples/Makefile c++/examples/run-c++-ex.sh c++/examples/testh5c++.sh fortran/Makefile fortran/src/h5fc fortran/src/Makefile fortran/test/Makefile fortran/testpar/Makefile fortran/examples/Makefile fortran/examples/run-fortran-ex.sh fortran/examples/testh5fc.sh hl/Makefile hl/src/Makefile hl/test/Makefile hl/test/H5srcdir_str.h hl/tools/Makefile hl/tools/gif2h5/Makefile hl/tools/gif2h5/h52giftest.sh hl/examples/Makefile hl/examples/run-hlc-ex.sh hl/c++/Makefile hl/c++/src/Makefile hl/c++/test/Makefile hl/c++/examples/Makefile hl/c++/examples/run-hlc++-ex.sh hl/fortran/Makefile hl/fortran/src/Makefile hl/fortran/test/Makefile hl/fortran/examples/Makefile hl/fortran/examples/run-hlfortran-ex.sh" cat >confcache <<\_ACEOF @@ -32394,6 +32447,8 @@ do "test/H5srcdir_str.h") CONFIG_FILES="$CONFIG_FILES test/H5srcdir_str.h" ;; "test/testlibinfo.sh") CONFIG_FILES="$CONFIG_FILES test/testlibinfo.sh" ;; "test/testlinks_env.sh") CONFIG_FILES="$CONFIG_FILES test/testlinks_env.sh" ;; + "test/test_plugin.sh") CONFIG_FILES="$CONFIG_FILES test/test_plugin.sh" ;; + "test/plugin_lib/Makefile") CONFIG_FILES="$CONFIG_FILES test/plugin_lib/Makefile" ;; "testpar/Makefile") CONFIG_FILES="$CONFIG_FILES testpar/Makefile" ;; "testpar/testph5.sh") CONFIG_FILES="$CONFIG_FILES testpar/testph5.sh" ;; "perform/Makefile") CONFIG_FILES="$CONFIG_FILES perform/Makefile" ;; diff --git a/configure.ac b/configure.ac index c6959f9..6b6d3a3 100644 --- a/configure.ac +++ b/configure.ac @@ -1242,9 +1242,10 @@ case "X-$enable_production" in esac ## ---------------------------------------------------------------------- -## Check for system libraries. +## Check for system libraries. "dl" stands for dynamically loaded library ## AC_CHECK_LIB([m], [ceil]) +AC_CHECK_LIB([dl], [dlopen]) if test "`uname`" = "SunOS" -o "`uname -sr`" = "HP-UX B.11.00"; then ## ...for Solaris @@ -4425,6 +4426,8 @@ AC_CONFIG_FILES([src/libhdf5.settings test/H5srcdir_str.h test/testlibinfo.sh test/testlinks_env.sh + test/test_plugin.sh + test/plugin_lib/Makefile testpar/Makefile testpar/testph5.sh perform/Makefile diff --git a/src/H5.c b/src/H5.c index 14ec7ca..25525a4 100644 --- a/src/H5.c +++ b/src/H5.c @@ -271,6 +271,7 @@ H5_term_library(void) pending += DOWN(Z); pending += DOWN(FD); pending += DOWN(P); + pending += DOWN(PL); /* Don't shut down the error code until other APIs which use it are shut down */ if(pending == 0) pending += DOWN(E); diff --git a/src/H5Edefin.h b/src/H5Edefin.h index 2ae79e5..8557f13 100644 --- a/src/H5Edefin.h +++ b/src/H5Edefin.h @@ -25,6 +25,7 @@ hid_t H5E_FUNC_g = FAIL; /* Function entry/exit */ hid_t H5E_FILE_g = FAIL; /* File accessibilty */ hid_t H5E_SOHM_g = FAIL; /* Shared Object Header Messages */ hid_t H5E_SYM_g = FAIL; /* Symbol table */ +hid_t H5E_PLUGIN_g = FAIL; /* Plugin for dynamically loaded library */ hid_t H5E_VFL_g = FAIL; /* Virtual File Layer */ hid_t H5E_INTERNAL_g = FAIL; /* Internal error (too specific to document in detail) */ hid_t H5E_BTREE_g = FAIL; /* B-Tree node */ @@ -131,6 +132,8 @@ hid_t H5E_PATH_g = FAIL; /* Problem with path to object */ /* No error */ hid_t H5E_NONE_MINOR_g = FAIL; /* No error */ +/* Plugin errors */ + /* File accessibilty errors */ hid_t H5E_FILEEXISTS_g = FAIL; /* File already exists */ hid_t H5E_FILEOPEN_g = FAIL; /* File already open */ diff --git a/src/H5Einit.h b/src/H5Einit.h index a2eb02f..edd9bf5 100644 --- a/src/H5Einit.h +++ b/src/H5Einit.h @@ -44,6 +44,11 @@ if((msg = H5E_create_msg(cls, H5E_MAJOR, "Symbol table"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") if((H5E_SYM_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") +assert(H5E_PLUGIN_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MAJOR, "Plugin for dynamically loaded library"))==NULL) + HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") +if((H5E_PLUGIN_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) + HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") assert(H5E_VFL_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MAJOR, "Virtual File Layer"))==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") @@ -477,6 +482,8 @@ if((msg = H5E_create_msg(cls, H5E_MINOR, "No error"))==NULL) if((H5E_NONE_MINOR_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") +/* Plugin errors */ + /* File accessibilty errors */ assert(H5E_FILEEXISTS_g==(-1)); if((msg = H5E_create_msg(cls, H5E_MINOR, "File already exists"))==NULL) diff --git a/src/H5Epubgen.h b/src/H5Epubgen.h index ddfb1d3..3df7d7e 100644 --- a/src/H5Epubgen.h +++ b/src/H5Epubgen.h @@ -28,6 +28,7 @@ #define H5E_FILE (H5OPEN H5E_FILE_g) #define H5E_SOHM (H5OPEN H5E_SOHM_g) #define H5E_SYM (H5OPEN H5E_SYM_g) +#define H5E_PLUGIN (H5OPEN H5E_PLUGIN_g) #define H5E_VFL (H5OPEN H5E_VFL_g) #define H5E_INTERNAL (H5OPEN H5E_INTERNAL_g) #define H5E_BTREE (H5OPEN H5E_BTREE_g) @@ -60,6 +61,7 @@ H5_DLLVAR hid_t H5E_FUNC_g; /* Function entry/exit */ H5_DLLVAR hid_t H5E_FILE_g; /* File accessibilty */ H5_DLLVAR hid_t H5E_SOHM_g; /* Shared Object Header Messages */ H5_DLLVAR hid_t H5E_SYM_g; /* Symbol table */ +H5_DLLVAR hid_t H5E_PLUGIN_g; /* Plugin for dynamically loaded library */ H5_DLLVAR hid_t H5E_VFL_g; /* Virtual File Layer */ H5_DLLVAR hid_t H5E_INTERNAL_g; /* Internal error (too specific to document in detail) */ H5_DLLVAR hid_t H5E_BTREE_g; /* B-Tree node */ @@ -221,6 +223,8 @@ H5_DLLVAR hid_t H5E_PATH_g; /* Problem with path to object */ #define H5E_NONE_MINOR (H5OPEN H5E_NONE_MINOR_g) H5_DLLVAR hid_t H5E_NONE_MINOR_g; /* No error */ +/* Plugin errors */ + /* File accessibilty errors */ #define H5E_FILEEXISTS (H5OPEN H5E_FILEEXISTS_g) #define H5E_FILEOPEN (H5OPEN H5E_FILEOPEN_g) diff --git a/src/H5Eterm.h b/src/H5Eterm.h index 6c621bc..f782db5 100644 --- a/src/H5Eterm.h +++ b/src/H5Eterm.h @@ -26,6 +26,7 @@ H5E_FUNC_g= H5E_FILE_g= H5E_SOHM_g= H5E_SYM_g= +H5E_PLUGIN_g= H5E_VFL_g= H5E_INTERNAL_g= H5E_BTREE_g= @@ -133,6 +134,8 @@ H5E_PATH_g= /* No error */ H5E_NONE_MINOR_g= +/* Plugin errors */ + /* File accessibilty errors */ H5E_FILEEXISTS_g= H5E_FILEOPEN_g= diff --git a/src/H5PL.c b/src/H5PL.c new file mode 100644 index 0000000..4bf059c --- /dev/null +++ b/src/H5PL.c @@ -0,0 +1,401 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by The HDF Group. * + * Copyright by the Board of Trustees of the University of Illinois. * + * 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 files COPYING and Copyright.html. COPYING can be found at the root * + * of the source code distribution tree; Copyright.html can be found at the * + * root level of an installed copy of the electronic HDF5 document set and * + * is linked from the top-level documents page. It can also be found at * + * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * + * access to either file, you may request a copy from help@hdfgroup.org. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#define H5PL_PACKAGE /*suppress error about including H5PLpkg */ + +/* Interface initialization */ +#define H5_INTERFACE_INIT_FUNC H5PL_init_interface + +#include "H5private.h" /* Generic Functions */ +#include "H5Dprivate.h" /* Dataset functions */ +#include "H5Eprivate.h" /* Error handling */ +#include "H5Iprivate.h" /* IDs */ +#include "H5MMprivate.h" /* Memory management */ +#include "H5Oprivate.h" /* Object headers */ +#include "H5Pprivate.h" /* Property lists */ +#include "H5Sprivate.h" /* Dataspace functions */ +#include "H5Zprivate.h" /* Filter pipeline */ +#include "H5PLpkg.h" /* Plugin */ + +#define H5PL_DEFAULT_PATH "/usr:/usr/lib:/usr/local" +#define H5PL_PATH_SEPERATOR ":" + + +/*-------------------------------------------------------------------------- +NAME + H5PL_init_interface -- Initialize interface-specific information +USAGE + herr_t H5PL_init_interface() + +RETURNS + Non-negative on success/Negative on failure +DESCRIPTION + Initializes any interface-specific data or routines. + +--------------------------------------------------------------------------*/ +static herr_t +H5PL_init_interface(void) +{ + FUNC_ENTER_NOAPI_NOINIT_NOERR + + FUNC_LEAVE_NOAPI(SUCCEED) +} /* end H5PL_init_interface() */ + + +/*------------------------------------------------------------------------- + * Function: H5PL_term_interface + * + * Purpose: Terminate the H5I interface: release all memory, reset all + * global variables to initial values. This only happens if all + * types have been destroyed from other interfaces. + * + * Return: Success: Positive if any action was taken that might + * affect some other interface; zero otherwise. + * + * Failure: Negative. + * + * Programmer: Raymond Lu + * 20 February 2013 + * + *------------------------------------------------------------------------- + */ +int +H5PL_term_interface(void) +{ + void *handle = NULL; + size_t i = 0; + + FUNC_ENTER_NOAPI_NOINIT_NOERR + + if(H5_interface_initialize_g) { + /* Free the table of dynamic libraries */ + for(i=0; id_name, "lib", 3) && HDstrstr(dp->d_name, ".so")) { + pathname = (char *)H5MM_malloc(strlen(dir) + strlen(dp->d_name) + 2); + HDstrncpy(pathname, dir, strlen(dir)+1); + HDstrcat(pathname, "/"); + HDstrcat(pathname, dp->d_name); + + /*fprintf(stderr, "dp->d_name=%s, pathname=%s. ", dp->d_name, pathname); + fprintf(stderr, "\n");*/ + + if(HDstat(pathname, &my_stat) == -1) + HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "can't stat file: %s", strerror(errno)) + + if(!S_ISDIR(my_stat.st_mode)) { /* if directory, skip it */ + if(NULL == (handle = dlopen(pathname, RTLD_NOW|RTLD_LAZY))) { + /*fprintf(stderr, "not open dl library: %s", dlerror());*/ + if(!HDstrcmp(dp->d_name, "libbogus2.so")) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCOPY, FAIL, "can't open dl library: %s", dlerror()) + else + continue; + } + + dlerror(); /*clear error*/ + if(NULL == (H5PL_get_plugin_info = dlsym(handle, "H5PL_get_plugin_info"))) { + if(H5PL_close(handle) < 0) + HGOTO_ERROR(H5E_PLUGIN, H5E_CLOSEERROR, FAIL, "can't close dynamic library") + } + + if(H5PL_get_plugin_info) { + if(NULL == (plugin_info = (*H5PL_get_plugin_info)())) { + if(H5PL_close(handle) < 0) + HGOTO_ERROR(H5E_PLUGIN, H5E_CLOSEERROR, FAIL, "can't close dynamic library") + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTGET, FAIL, "can't get plugin info") + } + + if(plugin_info->id == type_id) { + (H5PL_table_g[H5PL_table_used_g]).handle = handle; + (H5PL_table_g[H5PL_table_used_g]).pl_type = plugin_type; + (H5PL_table_g[H5PL_table_used_g]).pl_id = plugin_info->id; +/*fprintf(stderr, "%s: H5PL_table_used_g=%d, id=%d, id 2=%d\n", FUNC, H5PL_table_used_g, (H5PL_table_g[H5PL_table_used_g]).pl_id, plugin_info->id);*/ + H5PL_table_used_g++; + + *info = (void *)plugin_info; + ret_value = TRUE; + + HGOTO_DONE(ret_value) + } else if(H5PL_close(handle) < 0) + HGOTO_ERROR(H5E_PLUGIN, H5E_CLOSEERROR, FAIL, "can't close dynamic library") + } + } + + if(pathname) + pathname = (char *)H5MM_xfree(pathname); + } + } + + if(HDclosedir(dirp) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CLOSEERROR, FAIL, "can't close directory: %s", strerror(errno)) + dirp = NULL; + } + + +done: + if(pathname) + pathname = (char *)H5MM_xfree(pathname); + if(dirp) + HDclosedir(dirp); + + FUNC_LEAVE_NOAPI(ret_value) +} + + +/*------------------------------------------------------------------------- + * Function: H5PL_search_table + * + * Purpose: + * + * Return: TRUE on success, + * FALSE on not found, + * negative on failure + * + * Programmer: Raymond Lu + * 13 February 2013 + * + * Modifications: + * + *------------------------------------------------------------------------- + */ +htri_t +H5PL_search_table(H5PL_type_t plugin_type, int type_id, void **info) +{ + htri_t found = FALSE; + H5Z_class2_t* (*H5PL_get_plugin_info)(void) = NULL; + H5Z_class2_t *plugin_info = NULL; + int i; + htri_t ret_value = FALSE; + + FUNC_ENTER_NOAPI(FAIL) + +/*if(0 < H5PL_table_used_g) +fprintf(stderr, "%s: H5PL_table_used_g=%d, id=%d\n", FUNC, H5PL_table_used_g, (H5PL_table_g[H5PL_table_used_g-1]).pl_id);*/ + + /* Search in the table of already opened dynamic libraries */ + if(0 < H5PL_table_used_g) { + for(i=0; iid);*/ + + *info = (void *)plugin_info; + ret_value = TRUE; + } + } + } + + /* Expand the table if it is small */ + if(H5PL_table_used_g >= H5PL_table_alloc_g) { + size_t n = MAX(H5Z_MAX_NFILTERS, 2*H5PL_table_alloc_g); + H5PL_table_t *table = (H5PL_table_t *)H5MM_realloc(H5PL_table_g, n * sizeof(H5PL_table_t)); + + if(!table) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "unable to extend dynamic library table") + + H5PL_table_g = table; + H5PL_table_alloc_g = n; + } /* end if */ + +done: + FUNC_LEAVE_NOAPI(ret_value) +} + + +/*------------------------------------------------------------------------- + * Function: H5PL_close + * + * Purpose: + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Raymond Lu + * 13 February 2013 + * + * Modifications: + * + *------------------------------------------------------------------------- + */ +herr_t +H5PL_close(void *handle) +{ + herr_t ret_value = SUCCEED; + + FUNC_ENTER_NOAPI(FAIL) +/*fprintf(stderr, "%s: closing. handle=%p\n", FUNC, handle);*/ + dlclose(handle); + +done: + FUNC_LEAVE_NOAPI(ret_value) +} + diff --git a/src/H5PLpkg.h b/src/H5PLpkg.h new file mode 100644 index 0000000..adbe38a --- /dev/null +++ b/src/H5PLpkg.h @@ -0,0 +1,59 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by The HDF Group. * + * Copyright by the Board of Trustees of the University of Illinois. * + * 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 files COPYING and Copyright.html. COPYING can be found at the root * + * of the source code distribution tree; Copyright.html can be found at the * + * root level of an installed copy of the electronic HDF5 document set and * + * is linked from the top-level documents page. It can also be found at * + * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * + * access to either file, you may request a copy from help@hdfgroup.org. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#ifndef H5PL_PACKAGE +#error "Do not include this file outside the H5PL package!" +#endif + +#ifndef _H5PLpkg_H +#define _H5PLpkg_H + +/* Include private header file */ +#include "H5PLprivate.h" + +#define MAX_PATH_NUM 16 + +/****************************/ +/* Local typedefs */ +/****************************/ + +typedef struct H5PL_table_t { + H5PL_type_t pl_type; /* plugin type */ + int pl_id; /* ID for the plugin */ + void *handle; /* plugin handle */ +} H5PL_table_t; + +/****************************/ +/* Local variables */ +/****************************/ + +static size_t H5PL_table_alloc_g = 0; +static size_t H5PL_table_used_g = 0; +static H5PL_table_t *H5PL_table_g = NULL; + +static char *path_table[MAX_PATH_NUM]; +static size_t num_paths = 0; +static htri_t path_found = FALSE; + +/******************************/ +/* Package Private Prototypes */ +/******************************/ + +/* Function prototypes for H5PL package scope */ +htri_t H5PL_find(H5PL_type_t plugin_type, int type_id, char *dir, void **info); +htri_t H5PL_search_table(H5PL_type_t plugin_type, int type_id, void **info); + +#endif /* _H5PLpkg_H */ + diff --git a/src/H5PLprivate.h b/src/H5PLprivate.h new file mode 100644 index 0000000..0a79249 --- /dev/null +++ b/src/H5PLprivate.h @@ -0,0 +1,59 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by The HDF Group. * + * Copyright by the Board of Trustees of the University of Illinois. * + * 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 files COPYING and Copyright.html. COPYING can be found at the root * + * of the source code distribution tree; Copyright.html can be found at the * + * root level of an installed copy of the electronic HDF5 document set and * + * is linked from the top-level documents page. It can also be found at * + * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * + * access to either file, you may request a copy from help@hdfgroup.org. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* Programmer: Raymond Lu + * 13 February 2013 + */ + +#ifndef _H5PLprivate_H +#define _H5PLprivate_H + +/* Include package's public header */ +#include "H5PLpublic.h" + +/* Private headers needed by this file */ +#include "H5private.h" /* Generic Functions */ + +#ifdef H5_HAVE_DLFCN_H + #include +#endif + +#include +/*#include */ + +/**************************/ +/* Library Private Macros */ +/**************************/ + + +/****************************/ +/* Library Private Typedefs */ +/****************************/ + + +/*****************************/ +/* Library-private Variables */ +/*****************************/ + + +/***************************************/ +/* Library-private Function Prototypes */ +/***************************************/ + +/* Internal API routines */ +H5_DLL void* H5PL_load(H5PL_type_t plugin_type, int type_id); +H5_DLL herr_t H5PL_close(void *handle); + +#endif diff --git a/src/H5PLpublic.h b/src/H5PLpublic.h new file mode 100644 index 0000000..1f21f88 --- /dev/null +++ b/src/H5PLpublic.h @@ -0,0 +1,45 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by The HDF Group. * + * Copyright by the Board of Trustees of the University of Illinois. * + * 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 files COPYING and Copyright.html. COPYING can be found at the root * + * of the source code distribution tree; Copyright.html can be found at the * + * root level of an installed copy of the electronic HDF5 document set and * + * is linked from the top-level documents page. It can also be found at * + * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * + * access to either file, you may request a copy from help@hdfgroup.org. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* + * Programmer: Raymond Lu + * 13 February 2013 + */ +#ifndef _H5PLpublic_H +#define _H5PLpublic_H + +/* Public headers needed by this file */ +#include "H5public.h" + +/****************************/ +/* Library Public Typedefs */ +/****************************/ + +typedef enum H5PL_type_t { + H5PL_TYPE_ERROR = -1, /*error */ + H5PL_TYPE_FILTER = 0, /*filter */ + H5PL_TYPE_VFD = 1, /*virtual file driver */ + H5PL_TYPE_NONE = 2 /*this must be last! */ +} H5PL_type_t; + + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef __cplusplus +} +#endif +#endif diff --git a/src/H5Pocpl.c b/src/H5Pocpl.c index d8ddfee..032162a 100644 --- a/src/H5Pocpl.c +++ b/src/H5Pocpl.c @@ -38,6 +38,8 @@ #include "H5Eprivate.h" /* Error handling */ #include "H5Iprivate.h" /* IDs */ #include "H5MMprivate.h" /* Memory management */ +#include "H5PLprivate.h" /* Dynamic plugin */ +#include "H5Zprivate.h" /* Filter pipeline */ #include "H5Opkg.h" /* Object headers */ #include "H5Ppkg.h" /* Property lists */ @@ -746,9 +748,9 @@ herr_t H5Pset_filter(hid_t plist_id, H5Z_filter_t filter, unsigned int flags, size_t cd_nelmts, const unsigned int cd_values[/*cd_nelmts*/]) { - H5P_genplist_t *plist; /* Property list */ - H5O_pline_t pline; /* Filter pipeline */ - herr_t ret_value=SUCCEED; /* return value */ + H5P_genplist_t *plist; /* Property list */ + H5O_pline_t pline; /* Filter pipeline */ + herr_t ret_value=SUCCEED; /* return value */ FUNC_ENTER_API(FAIL) H5TRACE5("e", "iZfIuz*[a3]Iu", plist_id, filter, flags, cd_nelmts, cd_values); @@ -765,6 +767,84 @@ H5Pset_filter(hid_t plist_id, H5Z_filter_t filter, unsigned int flags, if(NULL == (plist = H5P_object_verify(plist_id, H5P_OBJECT_CREATE))) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID") + /* Call the private function */ + if(H5P_set_filter(plist, filter, flags, cd_nelmts, cd_values) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "failed to call private function") + +done: + FUNC_LEAVE_API(ret_value) +} /* end H5Pset_filter() */ + + +/*------------------------------------------------------------------------- + * Function: H5P_set_filter + * + * Purpose: Adds the specified FILTER and corresponding properties to the + * end of the data or link output filter pipeline + * depending on whether PLIST is a dataset creation or group + * creation property list. The FLAGS argument specifies certain + * general properties of the filter and is documented below. + * The CD_VALUES is an array of CD_NELMTS integers which are + * auxiliary data for the filter. The integer vlues will be + * stored in the dataset object header as part of the filter + * information. + * + * The FLAGS argument is a bit vector of the following fields: + * + * H5Z_FLAG_OPTIONAL(0x0001) + * If this bit is set then the filter is optional. If the + * filter fails during an H5Dwrite() operation then the filter + * is just excluded from the pipeline for the chunk for which it + * failed; the filter will not participate in the pipeline + * during an H5Dread() of the chunk. If this bit is clear and + * the filter fails then the entire I/O operation fails. + * If this bit is set but encoding is disabled for a filter, + * attempting to write will generate an error. + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Robb Matzke + * Wednesday, April 15, 1998 + * + * Modifications: + * + * Raymond Lu + * Tuesday, October 2, 2001 + * Changed the way to check parameter and set property for + * generic property list. + * + * Neil Fortner + * Wednesday, May 20, 2009 + * Overloaded to accept gcpl's as well as dcpl's and moved to + * H5Pocpl.c + * + *------------------------------------------------------------------------- + */ +herr_t +H5P_set_filter(H5P_genplist_t *plist, H5Z_filter_t filter, unsigned int flags, + size_t cd_nelmts, const unsigned int cd_values[/*cd_nelmts*/]) +{ + H5O_pline_t pline; /* Filter pipeline */ + H5Z_class2_t *filter_info = NULL; + htri_t filter_avail = FALSE; /* Filter availability */ + herr_t ret_value=SUCCEED; /* return value */ + + FUNC_ENTER_NOAPI(FAIL) + + if((filter_avail = H5Z_filter_avail(filter)) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't check filter availability") + + if(!filter_avail) { + if((filter_info = (H5Z_class2_t *)H5PL_load(H5PL_TYPE_FILTER, (int)filter)) == NULL) + HGOTO_ERROR(H5E_PLUGIN, H5E_CANTLOAD, FAIL, "failed to load dynamically loaded plugin") +/*if(filter_info) +fprintf(stderr, "%s: filter_info=%p, filter_info->id=%d\n", FUNC, filter_info, filter_info->id);*/ + if (H5Z_register (filter_info)<0) + HGOTO_ERROR (H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register filter") + + } + +#ifndef TMP /* Get the pipeline property to append to */ if(H5P_get(plist, H5O_CRT_PIPELINE_NAME, &pline) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get pipeline") @@ -776,10 +856,11 @@ H5Pset_filter(hid_t plist_id, H5Z_filter_t filter, unsigned int flags, /* Put the I/O pipeline information back into the property list */ if(H5P_set(plist, H5O_CRT_PIPELINE_NAME, &pline) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set pipeline") +#endif done: - FUNC_LEAVE_API(ret_value) -} /* end H5Pset_filter() */ + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5P_set_filter() */ /*------------------------------------------------------------------------- diff --git a/src/H5Pprivate.h b/src/H5Pprivate.h index 6560064..2006ced 100644 --- a/src/H5Pprivate.h +++ b/src/H5Pprivate.h @@ -108,6 +108,8 @@ H5_DLL herr_t H5P_modify_filter(H5P_genplist_t *plist, H5Z_filter_t filter, H5_DLL herr_t H5P_get_filter_by_id(H5P_genplist_t *plist, H5Z_filter_t id, unsigned int *flags, size_t *cd_nelmts, unsigned cd_values[], size_t namelen, char name[], unsigned *filter_config); +H5_DLL herr_t H5P_set_filter(H5P_genplist_t *plist, H5Z_filter_t filter, + unsigned int flags, size_t cd_nelmts, const unsigned int cd_values[/*cd_nelmts*/]); /* *SPECIAL* Don't make more of these! -QAK */ H5_DLL htri_t H5P_isa_class(hid_t plist_id, hid_t pclass_id); diff --git a/src/H5Z.c b/src/H5Z.c index 3bb3a44..8e8d80c 100644 --- a/src/H5Z.c +++ b/src/H5Z.c @@ -26,6 +26,7 @@ #include "H5MMprivate.h" /* Memory management */ #include "H5Oprivate.h" /* Object headers */ #include "H5Pprivate.h" /* Property lists */ +#include "H5PLprivate.h" /* Plugins */ #include "H5Sprivate.h" /* Dataspace functions */ #include "H5Zpkg.h" /* Data filters */ @@ -303,6 +304,8 @@ H5Z_register (const H5Z_class2_t *cls) herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) +/*if(cls) +fprintf(stderr, "cls=%p, cls->id=%d\n", cls, cls->id);*/ HDassert(cls); HDassert(cls->id >= 0 && cls->id <= H5Z_FILTER_MAX); @@ -450,7 +453,6 @@ done: htri_t H5Zfilter_avail(H5Z_filter_t id) { - size_t i; /* Local index variable */ htri_t ret_value=FALSE; /* Return value */ FUNC_ENTER_API(FAIL) @@ -459,6 +461,36 @@ H5Zfilter_avail(H5Z_filter_t id) /* Check args */ if(id<0 || id>H5Z_FILTER_MAX) HGOTO_ERROR (H5E_ARGS, H5E_BADVALUE, FAIL, "invalid filter identification number") + + if((ret_value = H5Z_filter_avail(id)) < 0) + HGOTO_ERROR (H5E_PLINE, H5E_NOTFOUND, FAIL, "unable to check the availability of the filter") + +done: + FUNC_LEAVE_API(ret_value) +} /* end H5Zfilter_avail() */ + + +/*------------------------------------------------------------------------- + * Function: H5Z_filter_avail + * + * Purpose: Private function to check if a filter is available + * + * Return: Non-negative (TRUE/FALSE) on success/Negative on failure + * + * Programmer: Raymond Lu + * 13 February 2013 + * + * Modifications: + * + *------------------------------------------------------------------------- + */ +htri_t +H5Z_filter_avail(H5Z_filter_t id) +{ + size_t i; /* Local index variable */ + htri_t ret_value=FALSE; /* Return value */ + + FUNC_ENTER_NOAPI(FAIL) /* Is the filter already registered? */ for(i=0; ifilter[idx].id))<0) { + H5Z_class2_t *filter_info = NULL; + + if((filter_info = (H5Z_class2_t *)H5PL_load(H5PL_TYPE_FILTER, (int)(pline->filter[idx].id))) != NULL) { + if (H5Z_register(filter_info)<0) + HGOTO_ERROR (H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register filter") + } else { + /* Print out the filter name to give more info. But the name is optional for + * the filter */ + if(pline->filter[idx].name) + HGOTO_ERROR(H5E_PLINE, H5E_READERROR, FAIL, "required filter '%s' is not registered", + pline->filter[idx].name) + else + HGOTO_ERROR(H5E_PLINE, H5E_READERROR, FAIL, "required filter (name unavailable) is not registered") + } + } + + /* Search in the table of registered filters again to find the dynamic filter just loaded and registered */ if ((fclass_idx=H5Z_find_idx(pline->filter[idx].id))<0) { /* Print out the filter name to give more info. But the name is optional for * the filter */ if(pline->filter[idx].name) HGOTO_ERROR(H5E_PLINE, H5E_READERROR, FAIL, "required filter '%s' is not registered", - pline->filter[idx].name) + pline->filter[idx].name) else HGOTO_ERROR(H5E_PLINE, H5E_READERROR, FAIL, "required filter (name unavailable) is not registered") - } + fclass=&H5Z_table_g[fclass_idx]; #ifdef H5Z_DEBUG fstats=&H5Z_stat_table_g[fclass_idx]; diff --git a/src/H5Zprivate.h b/src/H5Zprivate.h index c1528b3..f53b50c 100644 --- a/src/H5Zprivate.h +++ b/src/H5Zprivate.h @@ -92,6 +92,7 @@ H5_DLL herr_t H5Z_set_local_direct(const struct H5O_pline_t *pline); H5_DLL H5Z_filter_info_t *H5Z_filter_info(const struct H5O_pline_t *pline, H5Z_filter_t filter); H5_DLL htri_t H5Z_all_filters_avail(const struct H5O_pline_t *pline); +H5_DLL htri_t H5Z_filter_avail(H5Z_filter_t id); H5_DLL herr_t H5Z_delete(struct H5O_pline_t *pline, H5Z_filter_t filter); /* Data Transform Functions */ diff --git a/src/H5Zpublic.h b/src/H5Zpublic.h index 5d9b5ed..b5ac475 100644 --- a/src/H5Zpublic.h +++ b/src/H5Zpublic.h @@ -42,6 +42,12 @@ typedef int H5Z_filter_t; #define H5Z_FILTER_NBIT 5 /*nbit compression */ #define H5Z_FILTER_SCALEOFFSET 6 /*scale+offset compression */ #define H5Z_FILTER_RESERVED 256 /*filter ids below this value are reserved for library use */ + +#define H5Z_FILTER_DYNLIB1 257 +#define H5Z_FILTER_DYNLIB2 258 + +#define H5Z_FILTER_BZIP2 300 + #define H5Z_FILTER_MAX 65535 /*maximum filter id */ /* General macros */ diff --git a/src/H5config.h.in b/src/H5config.h.in index 0308b38..c1cee13 100644 --- a/src/H5config.h.in +++ b/src/H5config.h.in @@ -187,6 +187,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_IO_H +/* Define to 1 if you have the `dl' library (-ldl). */ +#undef HAVE_LIBDL + /* Define to 1 if you have the `dmalloc' library (-ldmalloc). */ #undef HAVE_LIBDMALLOC diff --git a/src/H5err.txt b/src/H5err.txt index ab3277f..282afd8 100644 --- a/src/H5err.txt +++ b/src/H5err.txt @@ -76,6 +76,7 @@ MAJOR, H5E_FSPACE, Free Space Manager MAJOR, H5E_SOHM, Shared Object Header Messages MAJOR, H5E_EARRAY, Extensible Array MAJOR, H5E_FARRAY, Fixed Array +MAJOR, H5E_PLUGIN, Plugin for dynamically loaded library MAJOR, H5E_NONE_MAJOR, No error # Sections (for grouping minor errors) @@ -98,6 +99,7 @@ SECTION, HEAP, Heap errors SECTION, FSPACE, Free space errors SECTION, PIPELINE, I/O pipeline errors SECTION, SYSTEM, System level errors +SECTION, PLUGIN, Plugin errors SECTION, NONE, No error # Minor errors diff --git a/src/H5private.h b/src/H5private.h index bff4e59..3bc8722 100644 --- a/src/H5private.h +++ b/src/H5private.h @@ -2350,6 +2350,7 @@ H5_DLL int H5G_term_interface(void); H5_DLL int H5I_term_interface(void); H5_DLL int H5L_term_interface(void); H5_DLL int H5P_term_interface(void); +H5_DLL int H5PL_term_interface(void); H5_DLL int H5R_term_interface(void); H5_DLL int H5S_term_interface(void); H5_DLL int H5T_term_interface(void); diff --git a/src/Makefile.am b/src/Makefile.am index 2669bdd..262bdc7 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -88,7 +88,7 @@ libhdf5_la_SOURCES= H5.c H5checksum.c H5dbg.c H5system.c H5timer.c H5trace.c \ H5P.c H5Pacpl.c H5Pdapl.c H5Pdcpl.c \ H5Pdeprec.c H5Pdxpl.c H5Pencdec.c \ H5Pfapl.c H5Pfcpl.c H5Pfmpl.c \ - H5Pgcpl.c H5Pint.c \ + H5Pgcpl.c H5Pint.c H5PL.c \ H5Plapl.c H5Plcpl.c H5Pocpl.c H5Pocpypl.c H5Pstrcpl.c H5Ptest.c \ H5R.c H5Rdeprec.c \ H5RC.c \ @@ -117,7 +117,7 @@ include_HEADERS = hdf5.h H5api_adpt.h H5overflow.h H5pubconf.h H5public.h H5vers H5FDfamily.h H5FDlog.h H5FDmpi.h H5FDmpio.h H5FDmpiposix.h \ H5FDmulti.h H5FDsec2.h H5FDstdio.h \ H5Gpublic.h H5Ipublic.h H5Lpublic.h \ - H5MMpublic.h H5Opublic.h H5Ppublic.h H5Rpublic.h H5Spublic.h \ + H5MMpublic.h H5Opublic.h H5PLpublic.h H5Ppublic.h H5Rpublic.h H5Spublic.h \ H5Tpublic.h H5Zpublic.h # install libhdf5.settings in lib directory diff --git a/src/Makefile.in b/src/Makefile.in index d9dca2d..f7fe1d8 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -158,7 +158,7 @@ am_libhdf5_la_OBJECTS = H5.lo H5checksum.lo H5dbg.lo H5system.lo \ H5Orefcount.lo H5Osdspace.lo H5Oshared.lo H5Ostab.lo \ H5Oshmesg.lo H5Otest.lo H5Ounknown.lo H5P.lo H5Pacpl.lo \ H5Pdapl.lo H5Pdcpl.lo H5Pdeprec.lo H5Pdxpl.lo H5Pencdec.lo \ - H5Pfapl.lo H5Pfcpl.lo H5Pfmpl.lo H5Pgcpl.lo H5Pint.lo \ + H5Pfapl.lo H5Pfcpl.lo H5Pfmpl.lo H5Pgcpl.lo H5Pint.lo H5PL.lo \ H5Plapl.lo H5Plcpl.lo H5Pocpl.lo H5Pocpypl.lo H5Pstrcpl.lo \ H5Ptest.lo H5R.lo H5Rdeprec.lo H5RC.lo H5RS.lo H5S.lo \ H5Sall.lo H5Sdbg.lo H5Shyper.lo H5Smpio.lo H5Snone.lo \ @@ -585,7 +585,7 @@ libhdf5_la_SOURCES = H5.c H5checksum.c H5dbg.c H5system.c H5timer.c H5trace.c \ H5P.c H5Pacpl.c H5Pdapl.c H5Pdcpl.c \ H5Pdeprec.c H5Pdxpl.c H5Pencdec.c \ H5Pfapl.c H5Pfcpl.c H5Pfmpl.c \ - H5Pgcpl.c H5Pint.c \ + H5Pgcpl.c H5Pint.c H5PL.c \ H5Plapl.c H5Plcpl.c H5Pocpl.c H5Pocpypl.c H5Pstrcpl.c H5Ptest.c \ H5R.c H5Rdeprec.c \ H5RC.c \ @@ -614,7 +614,7 @@ include_HEADERS = hdf5.h H5api_adpt.h H5overflow.h H5pubconf.h H5public.h H5vers H5FDfamily.h H5FDlog.h H5FDmpi.h H5FDmpio.h H5FDmpiposix.h \ H5FDmulti.h H5FDsec2.h H5FDstdio.h \ H5Gpublic.h H5Ipublic.h H5Lpublic.h \ - H5MMpublic.h H5Opublic.h H5Ppublic.h H5Rpublic.h H5Spublic.h \ + H5MMpublic.h H5Opublic.h H5PLpublic.h H5Ppublic.h H5Rpublic.h H5Spublic.h \ H5Tpublic.h H5Zpublic.h @@ -935,6 +935,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5Otest.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5Ounknown.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5P.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5PL.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5Pacpl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5Pdapl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5Pdcpl.Plo@am__quote@ diff --git a/src/hdf5.h b/src/hdf5.h index a37329d..c2e4866 100644 --- a/src/hdf5.h +++ b/src/hdf5.h @@ -34,6 +34,7 @@ #include "H5MMpublic.h" /* Memory management */ #include "H5Opublic.h" /* Object headers */ #include "H5Ppublic.h" /* Property lists */ +#include "H5PLpublic.h" /* Plugin */ #include "H5Rpublic.h" /* References */ #include "H5Spublic.h" /* Dataspaces */ #include "H5Tpublic.h" /* Datatypes */ diff --git a/test/Makefile.am b/test/Makefile.am index fd40ad6..37975f2 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -24,9 +24,9 @@ include $(top_srcdir)/config/commence.am INCLUDES=-I$(top_srcdir)/src -I$(top_builddir)/src # Test script for error_test and err_compat -TEST_SCRIPT = testerror.sh testlibinfo.sh testcheck_version.sh testlinks_env.sh +TEST_SCRIPT = testerror.sh testlibinfo.sh testcheck_version.sh testlinks_env.sh test_plugin.sh check_SCRIPTS = $(TEST_SCRIPT) -SCRIPT_DEPEND = error_test$(EXEEXT) err_compat$(EXEEXT) links_env$(EXEEXT) +SCRIPT_DEPEND = error_test$(EXEEXT) err_compat$(EXEEXT) links_env$(EXEEXT) plugin$(EXEEXT) # These are our main targets. They should be listed in the order to be @@ -50,7 +50,7 @@ TEST_PROG= testhdf5 lheap ohdr stab gheap cache cache_api cache_tagging \ # 'make check' doesn't run them directly, so they are not included in TEST_PROG. # Also build testmeta, which is used for timings test. It builds quickly, # and this lets automake keep all its test programs in one place. -check_PROGRAMS=$(TEST_PROG) error_test err_compat tcheck_version testmeta links_env +check_PROGRAMS=$(TEST_PROG) error_test err_compat tcheck_version testmeta links_env plugin # These programs generate test files for the tests. They don't need to be @@ -128,7 +128,7 @@ CHECK_CLEANFILES+=accum.h5 cmpd_dset.h5 compact_dataset.h5 dataset.h5 dset_offse earray.h5 efc[0-5].h5 log_vfd_out.log \ new_multi_file_v16-r.h5 new_multi_file_v16-s.h5 \ split_get_file_image_test-m.h5 split_get_file_image_test-r.h5 \ - file_image_core_test.h5.copy + file_image_core_test.h5.copy plugin.h5 # Sources for testhdf5 executable testhdf5_SOURCES=testhdf5.c tarray.c tattr.c tchecksum.c tconfig.c tfile.c \ @@ -137,6 +137,6 @@ testhdf5_SOURCES=testhdf5.c tarray.c tattr.c tchecksum.c tconfig.c tfile.c \ tvlstr.c tvltypes.c # Temporary files. -DISTCLEANFILES=testerror.sh testlibinfo.sh testcheck_version.sh testlinks_env.sh +DISTCLEANFILES=testerror.sh testlibinfo.sh testcheck_version.sh testlinks_env.sh test_plugin.sh include $(top_srcdir)/config/conclude.am diff --git a/test/Makefile.in b/test/Makefile.in index 6f39794..458ede6 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -69,15 +69,15 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ DIST_COMMON = $(srcdir)/H5srcdir_str.h.in $(srcdir)/Makefile.am \ - $(srcdir)/Makefile.in $(srcdir)/testcheck_version.sh.in \ - $(srcdir)/testerror.sh.in $(srcdir)/testlibinfo.sh.in \ - $(srcdir)/testlinks_env.sh.in $(top_srcdir)/bin/depcomp \ - $(top_srcdir)/bin/mkinstalldirs \ + $(srcdir)/Makefile.in $(srcdir)/test_plugin.sh.in \ + $(srcdir)/testcheck_version.sh.in $(srcdir)/testerror.sh.in \ + $(srcdir)/testlibinfo.sh.in $(srcdir)/testlinks_env.sh.in \ + $(top_srcdir)/bin/depcomp $(top_srcdir)/bin/mkinstalldirs \ $(top_srcdir)/config/commence.am \ $(top_srcdir)/config/conclude.am COPYING check_PROGRAMS = $(am__EXEEXT_1) error_test$(EXEEXT) \ err_compat$(EXEEXT) tcheck_version$(EXEEXT) testmeta$(EXEEXT) \ - links_env$(EXEEXT) + links_env$(EXEEXT) plugin$(EXEEXT) @BUILD_ALL_CONDITIONAL_TRUE@noinst_PROGRAMS = $(am__EXEEXT_2) TESTS = $(am__EXEEXT_1) $(TEST_SCRIPT) subdir = test @@ -88,7 +88,7 @@ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ mkinstalldirs = $(SHELL) $(top_srcdir)/bin/mkinstalldirs CONFIG_HEADER = $(top_builddir)/src/H5config.h CONFIG_CLEAN_FILES = testcheck_version.sh testerror.sh H5srcdir_str.h \ - testlibinfo.sh testlinks_env.sh + testlibinfo.sh testlinks_env.sh test_plugin.sh CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libh5test_la_LIBADD = @@ -377,6 +377,10 @@ ohdr_SOURCES = ohdr.c ohdr_OBJECTS = ohdr.$(OBJEXT) ohdr_LDADD = $(LDADD) ohdr_DEPENDENCIES = libh5test.la $(LIBHDF5) +plugin_SOURCES = plugin.c +plugin_OBJECTS = plugin.$(OBJEXT) +plugin_LDADD = $(LDADD) +plugin_DEPENDENCIES = libh5test.la $(LIBHDF5) pool_SOURCES = pool.c pool_OBJECTS = pool.$(OBJEXT) pool_LDADD = $(LDADD) @@ -477,10 +481,10 @@ SOURCES = $(libh5test_la_SOURCES) accum.c app_ref.c big.c bittests.c \ gen_new_super.c gen_noencoder.c gen_nullspace.c gen_plist.c \ gen_sizes_lheap.c gen_specmetaread.c gen_udlinks.c getname.c \ gheap.c hyperslab.c istore.c lheap.c links.c links_env.c mf.c \ - mount.c mtime.c ntypes.c objcopy.c ohdr.c pool.c reserved.c \ - set_extent.c space_overflow.c stab.c tcheck_version.c \ - $(testhdf5_SOURCES) testmeta.c $(ttsafe_SOURCES) unlink.c \ - vfd.c + mount.c mtime.c ntypes.c objcopy.c ohdr.c plugin.c pool.c \ + reserved.c set_extent.c space_overflow.c stab.c \ + tcheck_version.c $(testhdf5_SOURCES) testmeta.c \ + $(ttsafe_SOURCES) unlink.c vfd.c DIST_SOURCES = $(libh5test_la_SOURCES) accum.c app_ref.c big.c \ bittests.c btree2.c cache.c cache_api.c cache_tagging.c \ cmpd_dset.c cross_read.c dangle.c dsets.c dt_arith.c \ @@ -494,9 +498,10 @@ DIST_SOURCES = $(libh5test_la_SOURCES) accum.c app_ref.c big.c \ gen_noencoder.c gen_nullspace.c gen_plist.c gen_sizes_lheap.c \ gen_specmetaread.c gen_udlinks.c getname.c gheap.c hyperslab.c \ istore.c lheap.c links.c links_env.c mf.c mount.c mtime.c \ - ntypes.c objcopy.c ohdr.c pool.c reserved.c set_extent.c \ - space_overflow.c stab.c tcheck_version.c $(testhdf5_SOURCES) \ - testmeta.c $(ttsafe_SOURCES) unlink.c vfd.c + ntypes.c objcopy.c ohdr.c plugin.c pool.c reserved.c \ + set_extent.c space_overflow.c stab.c tcheck_version.c \ + $(testhdf5_SOURCES) testmeta.c $(ttsafe_SOURCES) unlink.c \ + vfd.c am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ @@ -817,13 +822,14 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog accum.h5 cmpd_dset.h5 \ objcopy_ext.dat trefer1.h5 trefer2.h5 app_ref.h5 farray.h5 \ earray.h5 efc[0-5].h5 log_vfd_out.log new_multi_file_v16-r.h5 \ new_multi_file_v16-s.h5 split_get_file_image_test-m.h5 \ - split_get_file_image_test-r.h5 file_image_core_test.h5.copy + split_get_file_image_test-r.h5 file_image_core_test.h5.copy \ + plugin.h5 INCLUDES = -I$(top_srcdir)/src -I$(top_builddir)/src # Test script for error_test and err_compat -TEST_SCRIPT = testerror.sh testlibinfo.sh testcheck_version.sh testlinks_env.sh +TEST_SCRIPT = testerror.sh testlibinfo.sh testcheck_version.sh testlinks_env.sh test_plugin.sh check_SCRIPTS = $(TEST_SCRIPT) -SCRIPT_DEPEND = error_test$(EXEEXT) err_compat$(EXEEXT) links_env$(EXEEXT) +SCRIPT_DEPEND = error_test$(EXEEXT) err_compat$(EXEEXT) links_env$(EXEEXT) plugin$(EXEEXT) # These are our main targets. They should be listed in the order to be # executed, generally most specific tests to least specific tests. @@ -876,7 +882,7 @@ testhdf5_SOURCES = testhdf5.c tarray.c tattr.c tchecksum.c tconfig.c tfile.c \ # Temporary files. -DISTCLEANFILES = testerror.sh testlibinfo.sh testcheck_version.sh testlinks_env.sh +DISTCLEANFILES = testerror.sh testlibinfo.sh testcheck_version.sh testlinks_env.sh test_plugin.sh # Automake needs to be taught how to build lib, progs, and tests targets. # These will be filled in automatically for the most part (e.g., @@ -942,6 +948,8 @@ testlibinfo.sh: $(top_builddir)/config.status $(srcdir)/testlibinfo.sh.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ testlinks_env.sh: $(top_builddir)/config.status $(srcdir)/testlinks_env.sh.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ +test_plugin.sh: $(top_builddir)/config.status $(srcdir)/test_plugin.sh.in + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @@ -1162,6 +1170,9 @@ objcopy$(EXEEXT): $(objcopy_OBJECTS) $(objcopy_DEPENDENCIES) $(EXTRA_objcopy_DEP ohdr$(EXEEXT): $(ohdr_OBJECTS) $(ohdr_DEPENDENCIES) $(EXTRA_ohdr_DEPENDENCIES) @rm -f ohdr$(EXEEXT) $(AM_V_CCLD)$(LINK) $(ohdr_OBJECTS) $(ohdr_LDADD) $(LIBS) +plugin$(EXEEXT): $(plugin_OBJECTS) $(plugin_DEPENDENCIES) $(EXTRA_plugin_DEPENDENCIES) + @rm -f plugin$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(plugin_OBJECTS) $(plugin_LDADD) $(LIBS) pool$(EXEEXT): $(pool_OBJECTS) $(pool_DEPENDENCIES) $(EXTRA_pool_DEPENDENCIES) @rm -f pool$(EXEEXT) $(AM_V_CCLD)$(LINK) $(pool_OBJECTS) $(pool_LDADD) $(LIBS) @@ -1267,6 +1278,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntypes.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/objcopy.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ohdr.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/plugin.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pool.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/reserved.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/set_extent.Po@am__quote@ diff --git a/test/plugin.c b/test/plugin.c new file mode 100644 index 0000000..4385916 --- /dev/null +++ b/test/plugin.c @@ -0,0 +1,810 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by The HDF Group. * + * Copyright by the Board of Trustees of the University of Illinois. * + * 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 files COPYING and Copyright.html. COPYING can be found at the root * + * of the source code distribution tree; Copyright.html can be found at the * + * root level of an installed copy of the electronic HDF5 document set and * + * is linked from the top-level documents page. It can also be found at * + * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * + * access to either file, you may request a copy from help@hdfgroup.org. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* + * Programmer: Raymond Lu + * 13 February 2013 + * + * Purpose: Tests the plugin module (H5PL) + */ +#include +#include + +#include "h5test.h" +#include "H5srcdir.h" + +/* + * This file needs to access private datatypes from the H5Z package. + */ +#define H5Z_PACKAGE +#include "H5Zpkg.h" + +const char *FILENAME[] = { + "plugin", + NULL +}; +#define FILENAME_BUF_SIZE 1024 +#define KB 1024 + +#define FILE_DEFLATE_NAME "deflate.h5" + +/* Dataset names for testing filters */ +#define DSET_DEFAULT_NAME "default" +#define DSET_CHUNKED_NAME "chunked" +#define DSET_COMPACT_NAME "compact" +#define DSET_SIMPLE_IO_NAME "simple_io" +#define DSET_USERBLOCK_IO_NAME "userblock_io" +#define DSET_COMPACT_IO_NAME "compact_io" +#define DSET_COMPACT_MAX_NAME "max_compact" +#define DSET_COMPACT_MAX2_NAME "max_compact_2" +#define DSET_CONV_BUF_NAME "conv_buf" +#define DSET_TCONV_NAME "tconv" +#define DSET_DEFLATE_NAME "deflate" +#define DSET_BZIP2_NAME "bzip2" +#define DSET_DYNLIB1_NAME "dynlib1" +#define DSET_DYNLIB2_NAME "dynlib2" +#ifdef H5_HAVE_FILTER_SZIP +#define DSET_SZIP_NAME "szip" +#endif /* H5_HAVE_FILTER_SZIP */ +#define DSET_SHUFFLE_NAME "shuffle" +#define DSET_FLETCHER32_NAME "fletcher32" +#define DSET_FLETCHER32_NAME_2 "fletcher32_2" +#define DSET_FLETCHER32_NAME_3 "fletcher32_3" +#define DSET_SHUF_DEF_FLET_NAME "shuffle+deflate+fletcher32" +#define DSET_SHUF_DEF_FLET_NAME_2 "shuffle+deflate+fletcher32_2" +#if defined H5_HAVE_FILTER_SZIP && defined H5_HAVE_FILTER_SHUFFLE && defined H5_HAVE_FILTER_FLETCHER32 +#define DSET_SHUF_SZIP_FLET_NAME "shuffle+szip+fletcher32" +#define DSET_SHUF_SZIP_FLET_NAME_2 "shuffle+szip+fletcher32_2" +#endif /* defined H5_HAVE_FILTER_SZIP && defined H5_HAVE_FILTER_SHUFFLE && defined H5_HAVE_FILTER_FLETCHER32 */ + +#define DSET_MISSING_NAME "missing" +#define DSET_CAN_APPLY_NAME "can_apply" +#define DSET_CAN_APPLY_NAME2 "can_apply2" +#ifdef H5_HAVE_FILTER_SZIP +#define DSET_CAN_APPLY_SZIP_NAME "can_apply_szip" +#endif /* H5_HAVE_FILTER_SZIP */ +#define DSET_SET_LOCAL_NAME "set_local" +#define DSET_SET_LOCAL_NAME_2 "set_local_2" +#define DSET_ONEBYTE_SHUF_NAME "onebyte_shuffle" +#define DSET_NBIT_INT_NAME "nbit_int" +#define DSET_NBIT_FLOAT_NAME "nbit_float" +#define DSET_NBIT_DOUBLE_NAME "nbit_double" +#define DSET_NBIT_ARRAY_NAME "nbit_array" +#define DSET_NBIT_COMPOUND_NAME "nbit_compound" +#define DSET_NBIT_COMPOUND_NAME_2 "nbit_compound_2" +#define DSET_NBIT_COMPOUND_NAME_3 "nbit_compound_3" +#define DSET_NBIT_INT_SIZE_NAME "nbit_int_size" +#define DSET_NBIT_FLT_SIZE_NAME "nbit_flt_size" +#define DSET_SCALEOFFSET_INT_NAME "scaleoffset_int" +#define DSET_SCALEOFFSET_INT_NAME_2 "scaleoffset_int_2" +#define DSET_SCALEOFFSET_FLOAT_NAME "scaleoffset_float" +#define DSET_SCALEOFFSET_FLOAT_NAME_2 "scaleoffset_float_2" +#define DSET_SCALEOFFSET_DOUBLE_NAME "scaleoffset_double" +#define DSET_SCALEOFFSET_DOUBLE_NAME_2 "scaleoffset_double_2" +#define DSET_COMPARE_DCPL_NAME "compare_dcpl" +#define DSET_COMPARE_DCPL_NAME_2 "compare_dcpl_2" +#define DSET_COPY_DCPL_NAME_1 "copy_dcpl_1" +#define DSET_COPY_DCPL_NAME_2 "copy_dcpl_2" +#define COPY_DCPL_EXTFILE_NAME "ext_file" +#define DSET_DEPREC_NAME "deprecated" +#define DSET_DEPREC_NAME_CHUNKED "deprecated_chunked" +#define DSET_DEPREC_NAME_COMPACT "deprecated_compact" +#define DSET_DEPREC_NAME_FILTER "deprecated_filter" + +#define USER_BLOCK 1024 +#define SIXTY_FOUR_KB 65536 + +/* Temporary filter IDs used for testing */ + +/* Flags for testing filters */ +#define DISABLE_FLETCHER32 0 +#define ENABLE_FLETCHER32 1 +#define DATA_CORRUPTED 1 +#define DATA_NOT_CORRUPTED 0 + +/* Parameters for the "set local" test */ +#define BOGUS2_PERM_NPARMS 2 /* Number of "permanent" parameters */ +#define BOGUS2_PARAM_1 13 /* (No particular meaning, just for checking value) */ +#define BOGUS2_PARAM_2 35 /* (No particular meaning, just for checking value) */ +#define BOGUS2_ALL_NPARMS 4 /* Total number of parameter = permanent + "local" parameters */ + +/* Dimensionality for conversion buffer test */ +#define DIM1 100 /* Dim. Size of data member # 1 */ +#define DIM2 5000 /* Dim. Size of data member # 2 */ +#define DIM3 10 /* Dim. Size of data member # 3 */ + +/* Parameters for internal filter test */ +#define FILTER_CHUNK_DIM1 2 +#define FILTER_CHUNK_DIM2 25 +#define FILTER_HS_OFFSET1 7 +#define FILTER_HS_OFFSET2 30 +#define FILTER_HS_SIZE1 4 +#define FILTER_HS_SIZE2 50 + +/* Names for noencoder test */ +#ifdef H5_HAVE_FILTER_SZIP +#define NOENCODER_FILENAME "noencoder.h5" +#define NOENCODER_COPY_FILENAME "noencoder.h5.copy" +#define NOENCODER_TEST_DATASET "noencoder_tdset.h5" +#define NOENCODER_SZIP_DATASET "noencoder_szip_dset.h5" +#define NOENCODER_SZIP_SHUFF_FLETCH_DATASET "noencoder_szip_shuffle_fletcher_dset.h5" +#endif /* H5_HAVE_FILTER_SZIP */ + +/* Names for zero-dim test */ +#define ZERODIM_DATASET "zerodim" + +/* Parameters for zero-dim test */ +#define MISSING_CHUNK_DATASET "missing_chunk" +#define MISSING_CHUNK_DIM 100 + +/* Names for random chunks test */ +#define NPOINTS 50 + +/* Parameters for huge chunks test */ +#define HUGE_DATASET "Dataset" +#define HUGE_DIM ((hsize_t)16 * 1024 * 1024 * 1024) +#define HUGE_CHUNK_DIM ((hsize_t)2 * 1024 * 1024 * 1024) +#define TOO_HUGE_CHUNK_DIM ((hsize_t)4 * 1024 * 1024 * 1024) +#define HUGE_DATASET2 "Dataset2" +#define HUGE_DIM2_0 ((hsize_t)16 * 1024) +#define HUGE_DIM2_1 ((hsize_t)16 * 1024) +#define HUGE_DIM2_2 ((hsize_t)16 * 1024) +#define HUGE_CHUNK_DIM2_0 ((hsize_t)2 * 1024) +#define HUGE_CHUNK_DIM2_1 ((hsize_t)1024) +#define HUGE_CHUNK_DIM2_2 ((hsize_t)1024) +#define TOO_HUGE_CHUNK_DIM2_0 ((hsize_t)4 * 1024) +#define TOO_HUGE_CHUNK_DIM2_1 ((hsize_t)1024) +#define TOO_HUGE_CHUNK_DIM2_2 ((hsize_t)1024) + +/* Parameters for testing bypassing chunk cache */ +#define BYPASS_DATASET1 "Dset1" +#define BYPASS_DATASET2 "Dset2" +#define BYPASS_DIM 1000 +#define BYPASS_CHUNK_DIM 500 +#define BYPASS_FILL_VALUE 7 + +/* Shared global arrays */ +#define DSET_DIM1 100 +#define DSET_DIM2 200 + +int points_deflate[DSET_DIM1][DSET_DIM2], + points_dynlib1[DSET_DIM1][DSET_DIM2], + points_dynlib2[DSET_DIM1][DSET_DIM2], + points_bzip2[DSET_DIM1][DSET_DIM2]; + + +/*------------------------------------------------------------------------- + * Function: test_filter_internal + * + * Purpose: Tests + * + * Return: Success: 0 + * Failure: -1 + * + * Programmer: Raymond Lu + * 27 February 2013 + * + *------------------------------------------------------------------------- + */ +static herr_t +test_filter_internal(hid_t fid, const char *name, hid_t dcpl, hsize_t *dset_size) +{ + hid_t dataset; /* Dataset ID */ + hid_t dxpl; /* Dataset xfer property list ID */ + hid_t write_dxpl; /* Dataset xfer property list ID for writing */ + hid_t sid; /* Dataspace ID */ + const hsize_t size[2] = {DSET_DIM1, DSET_DIM2}; /* Dataspace dimensions */ + const hsize_t hs_offset[2] = {FILTER_HS_OFFSET1, FILTER_HS_OFFSET2}; /* Hyperslab offset */ + const hsize_t hs_size[2] = {FILTER_HS_SIZE1, FILTER_HS_SIZE2}; /* Hyperslab size */ + void *tconv_buf = NULL; /* Temporary conversion buffer */ + int points[DSET_DIM1][DSET_DIM2], check[DSET_DIM1][DSET_DIM2]; + size_t i, j; /* Local index variables */ + int n = 0; + herr_t status; /* Error status */ + + /* Create the data space */ + if((sid = H5Screate_simple(2, size, NULL)) < 0) goto error; + + /* + * Create a small conversion buffer to test strip mining. We + * might as well test all we can! + */ + if((dxpl = H5Pcreate(H5P_DATASET_XFER)) < 0) goto error; + tconv_buf = HDmalloc((size_t)1000); + if(H5Pset_buffer(dxpl, (size_t)1000, tconv_buf, NULL) < 0) goto error; + if((write_dxpl = H5Pcopy(dxpl)) < 0) TEST_ERROR; + + TESTING(" filters (setup)"); + + /* Check if all the filters are available */ + if(H5Pall_filters_avail(dcpl)!=TRUE) { + H5_FAILED(); + printf(" Line %d: Incorrect filter availability\n",__LINE__); + goto error; + } /* end if */ + + /* Create the dataset */ + if((dataset = H5Dcreate2(fid, name, H5T_NATIVE_INT, sid, H5P_DEFAULT, + dcpl, H5P_DEFAULT)) < 0) goto error; + + PASSED(); + + /*---------------------------------------------------------------------- + * STEP 1: Read uninitialized data. It should be zero. + *---------------------------------------------------------------------- + */ + TESTING(" filters (uninitialized read)"); + + if(H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl, check) < 0) + TEST_ERROR; + + for(i=0; i<(size_t)size[0]; i++) { + for(j=0; j<(size_t)size[1]; j++) { + if(0!=check[i][j]) { + H5_FAILED(); + printf(" Read a non-zero value.\n"); + printf(" At index %lu,%lu\n", + (unsigned long)i, (unsigned long)j); + goto error; + } + } + } + PASSED(); + + /*---------------------------------------------------------------------- + * STEP 2: Test filters by setting up a chunked dataset and writing + * to it. + *---------------------------------------------------------------------- + */ + TESTING(" filters (write)"); + + for(i=n=0; i9) + return(0); + + add_on = cd_values[0]; + +/*fprintf(stderr, "add_on=%d\n", add_on);*/ + + if(flags & H5Z_FLAG_REVERSE) { /*read*/ + /* Substract the "add on" value to all the data values */ + while(buf_left>0) { + *int_ptr++ -= add_on; + buf_left -= sizeof(int); + } /* end while */ + } /* end if */ + else { /*write*/ + /* Add the "add on" value to all the data values */ + while(buf_left>0) { + *int_ptr++ += add_on; + buf_left -= sizeof(int); + } /* end while */ + } /* end else */ + +/*fprintf(stderr, "nbytes=%d\n", nbytes);*/ + + return nbytes; +} diff --git a/test/plugin_lib/dynlib1.h b/test/plugin_lib/dynlib1.h new file mode 100644 index 0000000..f255ee4 --- /dev/null +++ b/test/plugin_lib/dynlib1.h @@ -0,0 +1,9 @@ +#include +#include +#include + +#define FILTER_DYNLIB1_VERS 1 + +/* Local prototypes for filter functions */ +static size_t H5Z_filter_dynlib1(unsigned int flags, size_t cd_nelmts, + const unsigned int *cd_values, size_t nbytes, size_t *buf_size, void **buf); diff --git a/test/test_plugin.sh.in b/test/test_plugin.sh.in new file mode 100644 index 0000000..a1287a5 --- /dev/null +++ b/test/test_plugin.sh.in @@ -0,0 +1,57 @@ +#! /bin/sh +# +# Copyright by The HDF Group. +# Copyright by the Board of Trustees of the University of Illinois. +# 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 files COPYING and Copyright.html. COPYING can be found at the root +# of the source code distribution tree; Copyright.html can be found at the +# root level of an installed copy of the electronic HDF5 document set and +# is linked from the top-level documents page. It can also be found at +# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have +# access to either file, you may request a copy from help@hdfgroup.org. +# +# Tests for test_error and err_compat + +srcdir=@srcdir@ +TOP_BUILDDIR=@top_builddir@ + +echo $srcdir +echo $TOP_BUILDDIR + +# Determine backward compatibility options eneabled +DEPRECATED_SYMBOLS="@DEPRECATED_SYMBOLS@" + +nerrors=0 +verbose=yes + +#test -d ./plugin_lib +MAKE_CMD=make +CD=cd +TEST_NAME=plugin +TEST_BIN=`pwd`/$TEST_NAME +ENVCMD="env HDF5_PLUGIN_PATH=`pwd`/plugin_lib" + +# Run the test +$CD ./plugin_lib +echo "$MAKE_CMD" +$MAKE_CMD +$CD ../ +$ENVCMD $TEST_BIN +echo "$HDF5_PLUGIN_PATH" + +# Print a line-line message left justified in a field of 70 characters +# beginning with the word "Testing". +# +TESTING() { + SPACES=" " + echo "Testing $* $SPACES" | cut -c1-70 | tr -d '\012' +} + +if test $nerrors -eq 0 ; then + echo "All Error API tests passed." +fi + +exit $nerrors -- cgit v0.12 From 08359be858ae9e4595dab1f4a7718017d9af7663 Mon Sep 17 00:00:00 2001 From: Raymond Lu Date: Wed, 13 Mar 2013 17:34:23 -0500 Subject: [svn-r23347] ported revision 23248:23346 from the trunk --- CMakeLists.txt | 6 +- COPYING | 2 +- CTestConfig.cmake | 2 + MANIFEST | 21 +- Makefile.in | 2 +- README.txt | 2 +- bin/checkposix | 2 +- bin/cmakehdf5 | 9 +- c++/Makefile.in | 2 +- c++/examples/Makefile.in | 2 +- c++/src/Makefile.in | 4 +- c++/test/Makefile.in | 2 +- config/cmake/CTestCustom.cmake | 67 +- config/cmake/grepTest.cmake | 2 +- config/cmake/mccacheinit.cmake | 7 +- config/cmake/userblockTest.cmake | 10 +- config/lt_vers.am | 2 +- configure | 203 ++++--- configure.ac | 185 +++--- examples/Makefile.in | 2 +- fortran/Makefile.in | 2 +- fortran/examples/Makefile.in | 2 +- fortran/src/CMakeLists.txt | 1 + fortran/src/H5Aff.f90 | 2 +- fortran/src/H5Aff_F03.f90 | 2 +- fortran/src/H5Aff_F90.f90 | 2 +- fortran/src/H5Dff.f90 | 2 +- fortran/src/H5Dff_F03.f90 | 2 +- fortran/src/H5Dff_F90.f90 | 2 +- fortran/src/H5Eff.f90 | 2 +- fortran/src/H5Eff_F03.f90 | 2 +- fortran/src/H5Eff_F90.f90 | 2 +- fortran/src/H5FDmpioff.f90 | 2 +- fortran/src/H5Ff.c | 34 ++ fortran/src/H5Fff.f90 | 2 +- fortran/src/H5Fff_F03.f90 | 104 ++++ fortran/src/H5Fff_F90.f90 | 43 ++ fortran/src/H5Gff.f90 | 2 +- fortran/src/H5Iff.f90 | 2 +- fortran/src/H5Lf.c | 2 +- fortran/src/H5Lff.f90 | 2 +- fortran/src/H5Lff_F03.f90 | 2 +- fortran/src/H5Lff_F90.f90 | 2 +- fortran/src/H5Off.f90 | 2 +- fortran/src/H5Off_F03.f90 | 2 +- fortran/src/H5Off_F90.f90 | 2 +- fortran/src/H5Pf.c | 38 +- fortran/src/H5Pff.f90 | 23 +- fortran/src/H5Pff_F03.f90 | 2 +- fortran/src/H5Pff_F90.f90 | 2 +- fortran/src/H5Rff.f90 | 2 +- fortran/src/H5Rff_F03.f90 | 2 +- fortran/src/H5Rff_F90.f90 | 2 +- fortran/src/H5Sff.f90 | 2 +- fortran/src/H5Tff.f90 | 2 +- fortran/src/H5Tff_F03.f90 | 2 +- fortran/src/H5Tff_F90.f90 | 2 +- fortran/src/H5Zff.f90 | 2 +- fortran/src/H5_ff.f90 | 2 +- fortran/src/H5_ff_F03.f90 | 2 +- fortran/src/H5f90proto.h | 6 +- fortran/src/H5match_types.c | 13 + fortran/src/HDF5.f90 | 1 + fortran/src/Makefile.am | 9 +- fortran/src/Makefile.in | 26 +- fortran/src/hdf5_fortrandll.def.in | 1 + fortran/test/CMakeLists.txt | 1 + fortran/test/Makefile.am | 2 +- fortran/test/Makefile.in | 9 +- fortran/test/fortranlib_test_F03.f90 | 10 +- fortran/test/tH5F_F03.f90 | 175 ++++++ fortran/test/tH5P.f90 | 842 +++++++++++++------------- fortran/test/tH5P_F03.f90 | 141 +++++ fortran/test/tH5T_F03.f90 | 34 +- fortran/testpar/Makefile.in | 2 +- hl/Makefile.in | 2 +- hl/c++/Makefile.in | 2 +- hl/c++/examples/Makefile.in | 2 +- hl/c++/src/Makefile.in | 4 +- hl/c++/test/Makefile.in | 2 +- hl/examples/Makefile.in | 2 +- hl/fortran/Makefile.in | 2 +- hl/fortran/examples/Makefile.in | 2 +- hl/fortran/src/Makefile.in | 4 +- hl/fortran/test/Makefile.in | 2 +- hl/src/Makefile.in | 4 +- hl/test/Makefile.in | 2 +- hl/tools/Makefile.in | 2 +- hl/tools/gif2h5/Makefile.in | 2 +- perform/Makefile.in | 2 +- release_docs/CMake.txt | 435 ++++++++++++- release_docs/INSTALL_Windows.txt | 3 - release_docs/INSTALL_parallel | 28 +- release_docs/RELEASE.txt | 22 +- release_docs/USING_CMake.txt | 84 ++- release_docs/USING_Windows.txt | 643 +------------------- src/H5FDstdio.c | 23 +- src/H5HFdbg.c | 18 +- src/H5Lexternal.c | 47 +- src/H5Ocopy.c | 2 +- src/H5Oname.c | 12 +- src/H5T.c | 4 +- src/H5private.h | 55 +- src/H5public.h | 4 +- src/H5system.c | 12 +- src/Makefile.in | 4 +- test/CMakeLists.txt | 20 +- test/Makefile.in | 2 +- test/testframe.c | 4 +- test/testhdf5.h | 2 +- test/testlibinfo.sh.in | 5 +- test/tfile.c | 11 +- test/th5o.c | 4 + test/th5s.c | 11 +- test/tsohm.c | 14 + testpar/Makefile.in | 2 +- tools/Makefile.in | 2 +- tools/h5copy/CMakeLists.txt | 409 +++++++------ tools/h5copy/Makefile.in | 2 +- tools/h5copy/testfiles/h5copy_misc1.out | 2 +- tools/h5copy/testh5copy.sh.in | 367 ++++++----- tools/h5diff/CMakeLists.txt | 30 +- tools/h5diff/Makefile.in | 2 +- tools/h5diff/testfiles/h5diff_706.txt | 2 +- tools/h5diff/testfiles/h5diff_708.txt | 2 +- tools/h5dump/CMakeLists.txt | 308 +++++----- tools/h5dump/Makefile.in | 2 +- tools/h5import/CMakeLists.txt | 264 ++++++-- tools/h5import/Makefile.in | 2 +- tools/h5jam/CMakeLists.txt | 532 ++++++++-------- tools/h5jam/Makefile.in | 2 +- tools/h5jam/testh5jam.sh.in | 31 +- tools/h5ls/CMakeLists.txt | 5 +- tools/h5ls/Makefile.in | 2 +- tools/h5repack/CMakeLists.txt | 397 ++++++------ tools/h5repack/Makefile.in | 2 +- tools/h5repack/h5repack.sh.in | 357 ++++++----- tools/h5stat/CMakeLists.txt | 5 +- tools/h5stat/Makefile.in | 2 +- tools/lib/Makefile.in | 2 +- tools/lib/h5diff_attr.c | 7 + tools/lib/h5tools_dump.c | 2 +- tools/lib/h5tools_str.c | 379 ++++++------ tools/misc/CMakeLists.txt | 281 +++++---- tools/misc/Makefile.in | 2 +- tools/misc/testh5mkgrp.sh.in | 126 +++- tools/testfiles/h5mkgrp_help.ls | 4 - tools/testfiles/h5mkgrp_nested.ls | 13 - tools/testfiles/h5mkgrp_nested_latest.ls | 16 - tools/testfiles/h5mkgrp_nested_lp.ls | 13 + tools/testfiles/h5mkgrp_nested_mult.ls | 19 - tools/testfiles/h5mkgrp_nested_mult_latest.ls | 24 - tools/testfiles/h5mkgrp_nested_mult_lp.ls | 21 + tools/testfiles/h5mkgrp_nested_mult_p.ls | 16 + tools/testfiles/h5mkgrp_nested_p.ls | 10 + tools/testfiles/h5mkgrp_several.ls | 5 +- tools/testfiles/h5mkgrp_several_l.ls | 13 + tools/testfiles/h5mkgrp_several_latest.ls | 16 - tools/testfiles/h5mkgrp_several_p.ls | 10 + tools/testfiles/h5mkgrp_several_v.ls | 10 + tools/testfiles/h5mkgrp_single.ls | 5 +- tools/testfiles/h5mkgrp_single_l.ls | 9 + tools/testfiles/h5mkgrp_single_latest.ls | 12 - tools/testfiles/h5mkgrp_single_p.ls | 7 + tools/testfiles/h5mkgrp_single_v.ls | 7 + tools/testfiles/h5mkgrp_version.ls | 4 - vms/src/h5pubconf.h | 6 +- 167 files changed, 4092 insertions(+), 3300 deletions(-) create mode 100644 fortran/src/H5Fff_F03.f90 create mode 100644 fortran/src/H5Fff_F90.f90 create mode 100644 fortran/test/tH5F_F03.f90 delete mode 100644 tools/testfiles/h5mkgrp_help.ls delete mode 100644 tools/testfiles/h5mkgrp_nested.ls delete mode 100644 tools/testfiles/h5mkgrp_nested_latest.ls create mode 100644 tools/testfiles/h5mkgrp_nested_lp.ls delete mode 100644 tools/testfiles/h5mkgrp_nested_mult.ls delete mode 100644 tools/testfiles/h5mkgrp_nested_mult_latest.ls create mode 100644 tools/testfiles/h5mkgrp_nested_mult_lp.ls create mode 100644 tools/testfiles/h5mkgrp_nested_mult_p.ls create mode 100644 tools/testfiles/h5mkgrp_nested_p.ls create mode 100644 tools/testfiles/h5mkgrp_several_l.ls delete mode 100644 tools/testfiles/h5mkgrp_several_latest.ls create mode 100644 tools/testfiles/h5mkgrp_several_p.ls create mode 100644 tools/testfiles/h5mkgrp_several_v.ls create mode 100644 tools/testfiles/h5mkgrp_single_l.ls delete mode 100644 tools/testfiles/h5mkgrp_single_latest.ls create mode 100644 tools/testfiles/h5mkgrp_single_p.ls create mode 100644 tools/testfiles/h5mkgrp_single_v.ls delete mode 100644 tools/testfiles/h5mkgrp_version.ls diff --git a/CMakeLists.txt b/CMakeLists.txt index ef4e1c7..60655ae 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -563,9 +563,9 @@ IF (HDF5_ENABLE_Z_LIB_SUPPORT) IF (NOT H5_ZLIB_HEADER) IF (NOT ZLIB_USE_EXTERNAL) FIND_PACKAGE (ZLIB NAMES ${ZLIB_PACKAGE_NAME}${HDF_PACKAGE_EXT}) - IF (NOT ZLIB_FOUND) - FIND_PACKAGE (ZLIB) # Legacy find - ENDIF (NOT ZLIB_FOUND) + IF (NOT ZLIB_FOUND) + FIND_PACKAGE (ZLIB) # Legacy find + ENDIF (NOT ZLIB_FOUND) ENDIF (NOT ZLIB_USE_EXTERNAL) IF (ZLIB_FOUND) SET (H5_HAVE_FILTER_DEFLATE 1) diff --git a/COPYING b/COPYING index 9e816c8..25e79e7 100644 --- a/COPYING +++ b/COPYING @@ -4,7 +4,7 @@ HDF5 (Hierarchical Data Format 5) Software Library and Utilities ----------------------------------------------------------------------------- HDF5 (Hierarchical Data Format 5) Software Library and Utilities -Copyright 2006-2012 by The HDF Group. +Copyright 2006-2013 by The HDF Group. NCSA HDF5 (Hierarchical Data Format 5) Software Library and Utilities Copyright 1998-2006 by the Board of Trustees of the University of Illinois. diff --git a/CTestConfig.cmake b/CTestConfig.cmake index 8d00095..5d8f25c 100644 --- a/CTestConfig.cmake +++ b/CTestConfig.cmake @@ -20,6 +20,8 @@ SET (CTEST_DROP_SITE_CDASH TRUE) SET (UPDATE_TYPE svn) SET (VALGRIND_COMMAND "/usr/bin/valgrind") SET (VALGRIND_COMMAND_OPTIONS "-v --tool=memcheck --leak-check=full --track-fds=yes --num-callers=50 --show-reachable=yes --track-origins=yes --malloc-fill=0xff --free-fill=0xfe") +SET (CTEST_MEMORYCHECK_COMMAND "/usr/bin/valgrind") +SET (CTEST_MEMORYCHECK_COMMAND_OPTIONS "-v --tool=memcheck --leak-check=full --track-fds=yes --num-callers=50 --show-reachable=yes --track-origins=yes --malloc-fill=0xff --free-fill=0xfe") SET (CTEST_TEST_TIMEOUT 3600 CACHE STRING "Maximum time allowed before CTest will kill the test.") diff --git a/MANIFEST b/MANIFEST index 86a3238..f15fa29 100644 --- a/MANIFEST +++ b/MANIFEST @@ -293,6 +293,8 @@ ./fortran/src/H5FDmpioff.f90 ./fortran/src/H5Ff.c ./fortran/src/H5Fff.f90 +./fortran/src/H5Fff_F90.f90 +./fortran/src/H5Fff_F03.f90 ./fortran/src/H5Gf.c ./fortran/src/H5Gff.f90 ./fortran/src/H5If.c @@ -354,6 +356,7 @@ ./fortran/test/tH5E_F03.f90 ./fortran/test/tH5E.f90 ./fortran/test/tH5F.f90 +./fortran/test/tH5F_F03.f90 ./fortran/test/tH5G.f90 ./fortran/test/tH5G_1_8.f90 ./fortran/test/tH5I.f90 @@ -2138,16 +2141,18 @@ ./tools/h5copy/testfiles/h5copy_misc1.out # test files for h5mkgrp -./tools/testfiles/h5mkgrp_help.ls -./tools/testfiles/h5mkgrp_nested.ls -./tools/testfiles/h5mkgrp_nested_latest.ls -./tools/testfiles/h5mkgrp_nested_mult.ls -./tools/testfiles/h5mkgrp_nested_mult_latest.ls +./tools/testfiles/h5mkgrp_nested_p.ls +./tools/testfiles/h5mkgrp_nested_lp.ls +./tools/testfiles/h5mkgrp_nested_mult_p.ls +./tools/testfiles/h5mkgrp_nested_mult_lp.ls ./tools/testfiles/h5mkgrp_several.ls -./tools/testfiles/h5mkgrp_several_latest.ls +./tools/testfiles/h5mkgrp_several_v.ls +./tools/testfiles/h5mkgrp_several_p.ls +./tools/testfiles/h5mkgrp_several_l.ls ./tools/testfiles/h5mkgrp_single.ls -./tools/testfiles/h5mkgrp_single_latest.ls -./tools/testfiles/h5mkgrp_version.ls +./tools/testfiles/h5mkgrp_single_v.ls +./tools/testfiles/h5mkgrp_single_p.ls +./tools/testfiles/h5mkgrp_single_l.ls # high level libraries diff --git a/Makefile.in b/Makefile.in index 7144e95..2ecc508 100644 --- a/Makefile.in +++ b/Makefile.in @@ -263,6 +263,7 @@ H5_VERSION = @H5_VERSION@ HADDR_T = @HADDR_T@ HAVE_DMALLOC = @HAVE_DMALLOC@ HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@ +HAVE_PTHREAD = @HAVE_PTHREAD@ HDF5_HL = @HDF5_HL@ HDF5_INTERFACES = @HDF5_INTERFACES@ HDF_CXX = @HDF_CXX@ @@ -314,7 +315,6 @@ PACKAGE_VERSION = @PACKAGE_VERSION@ PARALLEL = @PARALLEL@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ -PTHREAD = @PTHREAD@ RANLIB = @RANLIB@ ROOT = @ROOT@ RUNPARALLEL = @RUNPARALLEL@ diff --git a/README.txt b/README.txt index 224be1b..b3a5451 100644 --- a/README.txt +++ b/README.txt @@ -1,4 +1,4 @@ -HDF5 version 1.9.144 currently under development +HDF5 version 1.9.148 currently under development Please refer to the release_docs/INSTALL file for installation instructions. ------------------------------------------------------------------------------ diff --git a/bin/checkposix b/bin/checkposix index 3912e9f..b295d7d 100755 --- a/bin/checkposix +++ b/bin/checkposix @@ -1,4 +1,4 @@ -#!/usr/local/bin/perl -w +#!/usr/bin/perl -w require 5.003; # diff --git a/bin/cmakehdf5 b/bin/cmakehdf5 index cdd75c0..c024ad1 100755 --- a/bin/cmakehdf5 +++ b/bin/cmakehdf5 @@ -58,7 +58,7 @@ EOF #========== #========== cat > $cfgfile <<'EOF' -cmake_minimum_required(VERSION 2.8.6 FATAL_ERROR) +cmake_minimum_required(VERSION 2.8.10 FATAL_ERROR) ######################################################## # This dashboard is maintained by The HDF Group # For any comments please contact cdashhelp@hdfgroup.org @@ -84,7 +84,12 @@ set (REPOSITORY_URL "http://svn.hdfgroup.uiuc.edu/hdf5/branches/hdf5_1_8") set (ADD_BUILD_OPTIONS "-DCMAKE_INSTALL_PREFIX:PATH=/usr/local/hdf5.1.8 -DHDF5_ALLOW_EXTERNAL_SUPPORT:STRING=\"SVN\" -DHDF5_PACKAGE_EXTLIBS:BOOL=ON") # Use multiple CPU cores to build -SET (CTEST_BUILD_FLAGS "-j4") +include(ProcessorCount) +ProcessorCount(N) +if(NOT N EQUAL 0) + set(CTEST_BUILD_FLAGS -j${N}) + set(ctest_test_args ${ctest_test_args} PARALLEL_LEVEL ${N}) +endif() # ----------------------------------------------------------- # -- Get environment diff --git a/c++/Makefile.in b/c++/Makefile.in index 8c82ca9..232299d 100644 --- a/c++/Makefile.in +++ b/c++/Makefile.in @@ -227,6 +227,7 @@ H5_VERSION = @H5_VERSION@ HADDR_T = @HADDR_T@ HAVE_DMALLOC = @HAVE_DMALLOC@ HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@ +HAVE_PTHREAD = @HAVE_PTHREAD@ HDF5_HL = @HDF5_HL@ HDF5_INTERFACES = @HDF5_INTERFACES@ HDF_CXX = @HDF_CXX@ @@ -278,7 +279,6 @@ PACKAGE_VERSION = @PACKAGE_VERSION@ PARALLEL = @PARALLEL@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ -PTHREAD = @PTHREAD@ RANLIB = @RANLIB@ ROOT = @ROOT@ RUNPARALLEL = @RUNPARALLEL@ diff --git a/c++/examples/Makefile.in b/c++/examples/Makefile.in index e9bbf47..e8aa093 100644 --- a/c++/examples/Makefile.in +++ b/c++/examples/Makefile.in @@ -194,6 +194,7 @@ H5_VERSION = @H5_VERSION@ HADDR_T = @HADDR_T@ HAVE_DMALLOC = @HAVE_DMALLOC@ HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@ +HAVE_PTHREAD = @HAVE_PTHREAD@ HDF5_HL = @HDF5_HL@ HDF5_INTERFACES = @HDF5_INTERFACES@ HDF_CXX = @HDF_CXX@ @@ -245,7 +246,6 @@ PACKAGE_VERSION = @PACKAGE_VERSION@ PARALLEL = @PARALLEL@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ -PTHREAD = @PTHREAD@ RANLIB = @RANLIB@ ROOT = @ROOT@ RUNPARALLEL = @RUNPARALLEL@ diff --git a/c++/src/Makefile.in b/c++/src/Makefile.in index 76b7717..b025f0b 100644 --- a/c++/src/Makefile.in +++ b/c++/src/Makefile.in @@ -269,6 +269,7 @@ H5_VERSION = @H5_VERSION@ HADDR_T = @HADDR_T@ HAVE_DMALLOC = @HAVE_DMALLOC@ HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@ +HAVE_PTHREAD = @HAVE_PTHREAD@ HDF5_HL = @HDF5_HL@ HDF5_INTERFACES = @HDF5_INTERFACES@ HDF_CXX = @HDF_CXX@ @@ -320,7 +321,6 @@ PACKAGE_VERSION = @PACKAGE_VERSION@ PARALLEL = @PARALLEL@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ -PTHREAD = @PTHREAD@ RANLIB = @RANLIB@ ROOT = @ROOT@ RUNPARALLEL = @RUNPARALLEL@ @@ -467,7 +467,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 134 +LT_VERS_REVISION = 138 LT_VERS_AGE = 0 # Include src directory diff --git a/c++/test/Makefile.in b/c++/test/Makefile.in index 00a8056..ef1455c 100644 --- a/c++/test/Makefile.in +++ b/c++/test/Makefile.in @@ -230,6 +230,7 @@ H5_VERSION = @H5_VERSION@ HADDR_T = @HADDR_T@ HAVE_DMALLOC = @HAVE_DMALLOC@ HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@ +HAVE_PTHREAD = @HAVE_PTHREAD@ HDF5_HL = @HDF5_HL@ HDF5_INTERFACES = @HDF5_INTERFACES@ HDF_CXX = @HDF_CXX@ @@ -281,7 +282,6 @@ PACKAGE_VERSION = @PACKAGE_VERSION@ PARALLEL = @PARALLEL@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ -PTHREAD = @PTHREAD@ RANLIB = @RANLIB@ ROOT = @ROOT@ RUNPARALLEL = @RUNPARALLEL@ diff --git a/config/cmake/CTestCustom.cmake b/config/cmake/CTestCustom.cmake index c33201f..ec7b10e 100755 --- a/config/cmake/CTestCustom.cmake +++ b/config/cmake/CTestCustom.cmake @@ -38,35 +38,15 @@ SET (CTEST_CUSTOM_MEMCHECK_IGNORE hl_test-clear-objects hl_fortran_test-clear-objects ######### tools/h5copy ######### - H5COPY-clear-refs - H5COPY-clear-ext-links - H5COPY-clear-misc + H5COPY-clearall-objects ######### tools/h5diff ######### H5DIFF-clearall-objects ######### tools/h5dump ######### H5DUMP-clearall-objects - H5DUMP-clear-out1 - H5DUMP-clear-out3 - H5DUMP-clear-objects H5DUMP_PACKED_BITS-clearall-objects H5DUMP-XML-clearall-objects ######### tools/h5import ######### - H5IMPORT-ASCII_I32-clear-objects - H5IMPORT-ASCII_I16-clear-objects - H5IMPORT-ASCII_I8-clear-objects - H5IMPORT-ASCII_UI16-clear-objects - H5IMPORT-ASCII_UI32-clear-objects - H5IMPORT-ASCII_F32-clear-objects - H5IMPORT-ASCII_F64-clear-objects - H5IMPORT-BINARY_F64-clear-objects - H5IMPORT-BINARY_I8-clear-objects - H5IMPORT-BINARY_I16-clear-objects - H5IMPORT-BINARY_I32-clear-objects - H5IMPORT-BINARY_UI16-clear-objects - H5IMPORT-BINARY_UI32-clear-objects - H5IMPORT-STR-clear-objects - H5IMPORT-BINARY_I8_EOF-clear-objects - H5IMPORT-ASCII_F64_R1-clear-objects + H5IMPORT-clear-objects ######### tools/h5jam ######### H5JAM-SETUP-N_twithub_u10_c-clear-objects H5JAM-SETUP-N_twithub_u10_c @@ -225,47 +205,8 @@ SET (CTEST_CUSTOM_MEMCHECK_IGNORE ######### tools/h5stat ######### H5STAT-clearall-objects ######### tools/misc ######### - h5repart_20K-clear-objects - h5repart_5K-clear-objects - h5repart_sec2-clear-objects - H5MKGRP_CMP-clear-h5mkgrp_help - H5MKGRP_CMP-clear-h5mkgrp_version - H5MKGRP-clear-h5mkgrp_single - H5MKGRP-h5mkgrp_single #uses runTest.cmake - H5MKGRP-h5ls-h5mkgrp_single #uses runTest.cmake - H5MKGRP-clear-h5mkgrp_single-v - H5MKGRP-h5mkgrp_single-v #uses runTest.cmake - H5MKGRP-h5ls-h5mkgrp_single-v #uses runTest.cmake - H5MKGRP-clear-h5mkgrp_single-p - H5MKGRP-h5mkgrp_single-p #uses runTest.cmake - H5MKGRP-h5ls-h5mkgrp_single-p #uses runTest.cmake - H5MKGRP-clear-h5mkgrp_single_latest-l - H5MKGRP-h5mkgrp_single_latest-l #uses runTest.cmake - H5MKGRP-h5ls-h5mkgrp_single_latest-l #uses runTest.cmake - H5MKGRP-clear-h5mkgrp_several - H5MKGRP-h5mkgrp_several #uses runTest.cmake - H5MKGRP-h5ls-h5mkgrp_several #uses runTest.cmake - H5MKGRP-clear-h5mkgrp_several-v - H5MKGRP-h5mkgrp_several-v #uses runTest.cmake - H5MKGRP-h5ls-h5mkgrp_several-v #uses runTest.cmake - H5MKGRP-clear-h5mkgrp_several-p - H5MKGRP-h5mkgrp_several-p #uses runTest.cmake - H5MKGRP-h5ls-h5mkgrp_several-p #uses runTest.cmake - H5MKGRP-clear-h5mkgrp_several_latest-l - H5MKGRP-h5mkgrp_several_latest-l #uses runTest.cmake - H5MKGRP-h5ls-h5mkgrp_several_latest-l #uses runTest.cmake - H5MKGRP-clear-h5mkgrp_nested-p - H5MKGRP-h5mkgrp_nested-p #uses runTest.cmake - H5MKGRP-h5ls-h5mkgrp_nested-p #uses runTest.cmake - H5MKGRP-clear-h5mkgrp_nested_latest-lp - H5MKGRP-h5mkgrp_nested_latest-lp #uses runTest.cmake - H5MKGRP-h5ls-h5mkgrp_nested_latest-lp #uses runTest.cmake - H5MKGRP-clear-h5mkgrp_nested_mult-p - H5MKGRP-h5mkgrp_nested_mult-p #uses runTest.cmake - H5MKGRP-h5ls-h5mkgrp_nested_mult-p #uses runTest.cmake - H5MKGRP-clear-h5mkgrp_nested_mult_latest-lp - H5MKGRP-h5mkgrp_nested_mult_latest-lp #uses runTest.cmake - H5MKGRP-h5ls-h5mkgrp_nested_mult_latest-lp #uses runTest.cmake + H5REPART-clearall-objects + H5MKGRP-clearall-objects ######### examples ######### EXAMPLES-clear-objects cpp_ex-clear-objects diff --git a/config/cmake/grepTest.cmake b/config/cmake/grepTest.cmake index 365d9c3..74ac912 100644 --- a/config/cmake/grepTest.cmake +++ b/config/cmake/grepTest.cmake @@ -57,7 +57,7 @@ IF (${TEST_EXPECT} STREQUAL "1") IF (NOT ${TEST_RESULT} STREQUAL "0") MESSAGE (FATAL_ERROR "Failed: The output of ${TEST_PROGRAM} did contain ${TEST_FILTER}") ENDIF (NOT ${TEST_RESULT} STREQUAL "0") -ENDIF (${TEST_EXPECT} STREQUAL "0") +ENDIF (${TEST_EXPECT} STREQUAL "1") # everything went fine... MESSAGE ("Passed: The output of ${TEST_PROGRAM} matched") diff --git a/config/cmake/mccacheinit.cmake b/config/cmake/mccacheinit.cmake index b472acf..8ca3879 100755 --- a/config/cmake/mccacheinit.cmake +++ b/config/cmake/mccacheinit.cmake @@ -8,6 +8,8 @@ SET (BUILD_SHARED_LIBS OFF CACHE BOOL "Build Shared Libraries" FORCE) SET (BUILD_TESTING ON CACHE BOOL "Build HDF5 Unit Testing" FORCE) +SET (HDF_PACKAGE_EXT "" CACHE STRING "Name of HDF package extension" FORCE) + SET (HDF5_BUILD_CPP_LIB ON CACHE BOOL "Build HDF5 C++ Library" FORCE) SET (HDF5_BUILD_EXAMPLES ON CACHE BOOL "Build HDF5 Library Examples" FORCE) @@ -58,7 +60,7 @@ SET (HDF5_ENABLE_THREADSAFE OFF CACHE BOOL "(WINDOWS)Enable Threadsafety" FORCE) SET (HDF5_PACKAGE_EXTLIBS OFF CACHE BOOL "(WINDOWS)CPACK - include external libraries" FORCE) -SET (HDF5_NO_PACKAGES OFF CACHE BOOL "CPACK - Disable packaging" FORCE) +SET (HDF5_NO_PACKAGES ON CACHE BOOL "CPACK - Disable packaging" FORCE) SET (HDF5_ALLOW_EXTERNAL_SUPPORT "NO" CACHE STRING "Allow External Library Building" FORCE) @@ -74,3 +76,6 @@ SET (CMAKE_BUILD_TYPE "Debug" CACHE STRING "Build Debug" FORCE) SET (CTEST_BUILD_CONFIGURATION "Debug" CACHE STRING "Build Debug" FORCE) +SET (ZLIB_PACKAGE_NAME "zlib" CACHE STRING "Name of ZLIB package" FORCE) + +SET (SZIP_PACKAGE_NAME "szip" CACHE STRING "Name of SZIP package" FORCE) diff --git a/config/cmake/userblockTest.cmake b/config/cmake/userblockTest.cmake index 5e8a808..8910bb2 100644 --- a/config/cmake/userblockTest.cmake +++ b/config/cmake/userblockTest.cmake @@ -65,17 +65,17 @@ IF (TEST_CHECKUB STREQUAL "YES") COMMAND ${TEST_GET_PROGRAM} -c ${TEST_O_STRING_LEN} ${TEST_OFILE} WORKING_DIRECTORY ${TEST_FOLDER} RESULT_VARIABLE TEST_RESULT - OUTPUT_FILE ${TEST_UFILE}.cmp + OUTPUT_FILE ${TEST_HFILE}-ub.cmp OUTPUT_VARIABLE TEST_ERROR ERROR_VARIABLE TEST_ERROR OUTPUT_STRIP_TRAILING_WHITESPACE ) #cat $ufile >> $cmpfile FILE (STRINGS ${TEST_UFILE} TEST_STREAM NEWLINE_CONSUME) - FILE (APPEND ${TEST_UFILE}.cmp "${TEST_STREAM}") + FILE (APPEND ${TEST_HFILE}-ub.cmp "${TEST_STREAM}") ELSE (NOT TEST_O_STRING_LEN STREQUAL "0") FILE (STRINGS ${TEST_UFILE} TEST_STREAM NEWLINE_CONSUME) - FILE (WRITE ${TEST_UFILE}.cmp ${TEST_STREAM}) + FILE (WRITE ${TEST_HFILE}-ub.cmp ${TEST_STREAM}) ENDIF (NOT TEST_O_STRING_LEN STREQUAL "0") #$JAM_BIN/getub -c $size $hfile > $tfile @@ -91,14 +91,14 @@ IF (TEST_CHECKUB STREQUAL "YES") # now compare the outputs EXECUTE_PROCESS ( - COMMAND ${CMAKE_COMMAND} -E compare_files ${TEST_UFILE}.cmp ${TEST_HFILE}.cmp + COMMAND ${CMAKE_COMMAND} -E compare_files ${TEST_HFILE}-ub.cmp ${TEST_HFILE}.cmp RESULT_VARIABLE TEST_RESULT ) MESSAGE (STATUS "COMPARE Result: ${TEST_RESULT}: ${TEST_STRING_SIZE}=${TEST_U_STRING_LEN}+${TEST_O_STRING_LEN}") # if the return value is !=${TEST_EXPECT} bail out IF (NOT ${TEST_RESULT} STREQUAL ${TEST_EXPECT}) - MESSAGE (FATAL_ERROR "Failed: The output of ${TEST_UFILE} did not match ${TEST_HFILE}.\n${TEST_ERROR}") + MESSAGE (FATAL_ERROR "Failed: The output of ${TEST_HFILE}-ub did not match ${TEST_HFILE}.\n${TEST_ERROR}") ENDIF (NOT ${TEST_RESULT} STREQUAL ${TEST_EXPECT}) ELSE (TEST_CHECKUB STREQUAL "YES") # call 'ubsize' to get the size of the user block diff --git a/config/lt_vers.am b/config/lt_vers.am index d94d73c..37b5b68 100644 --- a/config/lt_vers.am +++ b/config/lt_vers.am @@ -17,7 +17,7 @@ # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 134 +LT_VERS_REVISION = 138 LT_VERS_AGE = 0 ## If the API changes *at all*, increment LT_VERS_INTERFACE and diff --git a/configure b/configure index 157dcc1..3af799b 100755 --- a/configure +++ b/configure @@ -1,7 +1,7 @@ #! /bin/sh # From configure.ac Id: configure.ac 22697 2012-08-19 14:35:47Z hdftest . # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for HDF5 1.9.144. +# Generated by GNU Autoconf 2.69 for HDF5 1.9.148. # # Report bugs to . # @@ -591,8 +591,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='HDF5' PACKAGE_TARNAME='hdf5' -PACKAGE_VERSION='1.9.144' -PACKAGE_STRING='HDF5 1.9.144' +PACKAGE_VERSION='1.9.148' +PACKAGE_STRING='HDF5 1.9.148' PACKAGE_BUGREPORT='help@hdfgroup.org' PACKAGE_URL='' @@ -681,7 +681,7 @@ INSTRUMENT_LIBRARY TRACE_API DEBUG_PKG H5_LONE_COLON -PTHREAD +HAVE_PTHREAD BUILD_SHARED_SZIP_CONDITIONAL_FALSE BUILD_SHARED_SZIP_CONDITIONAL_TRUE LL_PATH @@ -1484,7 +1484,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures HDF5 1.9.144 to adapt to many kinds of systems. +\`configure' configures HDF5 1.9.148 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1554,7 +1554,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of HDF5 1.9.144:";; + short | recursive ) echo "Configuration of HDF5 1.9.148:";; esac cat <<\_ACEOF @@ -1750,7 +1750,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -HDF5 configure 1.9.144 +HDF5 configure 1.9.148 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2844,7 +2844,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by HDF5 $as_me 1.9.144, which was +It was created by HDF5 $as_me 1.9.148, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -3676,7 +3676,7 @@ fi # Define the identity of the package. PACKAGE='hdf5' - VERSION='1.9.144' + VERSION='1.9.148' cat >>confdefs.h <<_ACEOF @@ -25326,11 +25326,14 @@ if test "x$ac_cv_header_dmalloc_h" = xyes; then : #define HAVE_DMALLOC_H 1 _ACEOF +else + unset HAVE_DMALLOC fi done - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dmalloc_shutdown in -ldmalloc" >&5 + if test "x$HAVE_DMALLOC" = "xyes"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dmalloc_shutdown in -ldmalloc" >&5 $as_echo_n "checking for dmalloc_shutdown in -ldmalloc... " >&6; } if ${ac_cv_lib_dmalloc_dmalloc_shutdown+:} false; then : $as_echo_n "(cached) " >&6 @@ -25385,7 +25388,7 @@ else unset HAVE_DMALLOC fi - + fi if test -z "$HAVE_DMALLOC" -a -n "$HDF5_CONFIG_ABORT"; then as_fn_error $? "couldn't find dmalloc library" "$LINENO" 5 fi @@ -25440,18 +25443,19 @@ if test "x$ac_cv_header_dmalloc_h" = xyes; then : _ACEOF else - CPPFLAGS="$saved_CPPFLAGS"; AM_CPPFLAGS="$saved_AM_CPPFLAGS" + CPPFLAGS="$saved_CPPFLAGS"; AM_CPPFLAGS="$saved_AM_CPPFLAGS" unset HAVE_DMALLOC fi done - if test -n "$dmalloc_lib"; then - LDFLAGS="$LDFLAGS -L$dmalloc_lib" - AM_LDFLAGS="$AM_LDFLAGS -L$dmalloc_lib" - fi + if test "x$HAVE_DMALLOC" = "xyes"; then + if test -n "$dmalloc_lib"; then + LDFLAGS="$LDFLAGS -L$dmalloc_lib" + AM_LDFLAGS="$AM_LDFLAGS -L$dmalloc_lib" + fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dmalloc_shutdown in -ldmalloc" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dmalloc_shutdown in -ldmalloc" >&5 $as_echo_n "checking for dmalloc_shutdown in -ldmalloc... " >&6; } if ${ac_cv_lib_dmalloc_dmalloc_shutdown+:} false; then : $as_echo_n "(cached) " >&6 @@ -25506,6 +25510,7 @@ else LDFLAGS="$saved_LDFLAGS"; AM_LDFLAGS="$saved_AM_LDFLAGS"; unset HAVE_DMALLOC fi + fi if test -z "$HAVE_DMALLOC" -a -n "$HDF5_CONFIG_ABORT"; then as_fn_error $? "couldn't find dmalloc library" "$LINENO" 5 @@ -25540,11 +25545,14 @@ if test "x$ac_cv_header_zlib_h" = xyes; then : #define HAVE_ZLIB_H 1 _ACEOF HAVE_ZLIB_H="yes" +else + unset HAVE_ZLIB fi done - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for compress2 in -lz" >&5 + if test "x$HAVE_ZLIB" = "xyes" -a "x$HAVE_ZLIB_H" = "xyes"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for compress2 in -lz" >&5 $as_echo_n "checking for compress2 in -lz... " >&6; } if ${ac_cv_lib_z_compress2+:} false; then : $as_echo_n "(cached) " >&6 @@ -25599,14 +25607,17 @@ else unset HAVE_ZLIB fi - ac_fn_c_check_func "$LINENO" "compress2" "ac_cv_func_compress2" + fi + if test -z "$HAVE_ZLIB"; then + if test -n "$HDF5_CONFIG_ABORT"; then + as_fn_error $? "couldn't find zlib library" "$LINENO" 5 + fi + else + ac_fn_c_check_func "$LINENO" "compress2" "ac_cv_func_compress2" if test "x$ac_cv_func_compress2" = xyes; then : HAVE_COMPRESS2="yes" fi - - if test -z "$HAVE_ZLIB" -a -n "$HDF5_CONFIG_ABORT"; then - as_fn_error $? "couldn't find zlib library" "$LINENO" 5 fi ;; no) @@ -25620,8 +25631,8 @@ $as_echo "suppressed" >&6; } HAVE_ZLIB="yes" case "$withval" in *,*) - zlib_inc="`echo $withval |cut -f1 -d,`" - zlib_lib="`echo $withval |cut -f2 -d, -s`" + zlib_inc="`echo $withval | cut -f1 -d,`" + zlib_lib="`echo $withval | cut -f2 -d, -s`" ;; *) if test -n "$withval"; then @@ -25659,7 +25670,7 @@ if test "x$ac_cv_header_zlib_h" = xyes; then : _ACEOF HAVE_ZLIB_H="yes" else - CPPFLAGS="$saved_CPPFLAGS"; AM_CPPFLAGS="$saved_AM_CPPFLAGS" + CPPFLAGS="$saved_CPPFLAGS"; AM_CPPFLAGS="$saved_AM_CPPFLAGS" unset HAVE_ZLIB fi done @@ -25670,7 +25681,8 @@ done AM_LDFLAGS="$AM_LDFLAGS -L$zlib_lib" fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for compress2 in -lz" >&5 + if test "x$HAVE_ZLIB" = "xyes" -a "x$HAVE_ZLIB_H" = "xyes"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for compress2 in -lz" >&5 $as_echo_n "checking for compress2 in -lz... " >&6; } if ${ac_cv_lib_z_compress2+:} false; then : $as_echo_n "(cached) " >&6 @@ -25725,14 +25737,18 @@ else LDFLAGS="$saved_LDFLAGS"; AM_LDFLAGS="$saved_AM_LDFLAGS"; unset HAVE_ZLIB fi - ac_fn_c_check_func "$LINENO" "compress2" "ac_cv_func_compress2" + fi + + if test -z "$HAVE_ZLIB"; then + if test -n "$HDF5_CONFIG_ABORT"; then + as_fn_error $? "couldn't find zlib library" "$LINENO" 5 + fi + else + ac_fn_c_check_func "$LINENO" "compress2" "ac_cv_func_compress2" if test "x$ac_cv_func_compress2" = xyes; then : HAVE_COMPRESS2="yes" fi - - if test -z "$HAVE_ZLIB" -a -n "$HDF5_CONFIG_ABORT"; then - as_fn_error $? "couldn't find zlib library" "$LINENO" 5 fi ;; esac @@ -25741,13 +25757,13 @@ if test "x$HAVE_ZLIB" = "xyes" -a "x$HAVE_ZLIB_H" = "xyes" -a "x$HAVE_COMPRESS2" $as_echo "#define HAVE_FILTER_DEFLATE 1" >>confdefs.h - USE_FILTER_DEFLATE="yes" + USE_FILTER_DEFLATE="yes" - ## Add "deflate" to external filter list - if test "X$EXTERNAL_FILTERS" != "X"; then - EXTERNAL_FILTERS="${EXTERNAL_FILTERS}," - fi - EXTERNAL_FILTERS="${EXTERNAL_FILTERS}deflate(zlib)" + ## Add "deflate" to external filter list + if test "X$EXTERNAL_FILTERS" != "X"; then + EXTERNAL_FILTERS="${EXTERNAL_FILTERS}," + fi + EXTERNAL_FILTERS="${EXTERNAL_FILTERS}deflate(zlib)" fi @@ -25778,11 +25794,14 @@ if test "x$ac_cv_header_szlib_h" = xyes; then : #define HAVE_SZLIB_H 1 _ACEOF HAVE_SZLIB_H="yes" +else + unset HAVE_SZLIB fi done - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SZ_BufftoBuffCompress in -lsz" >&5 + if test "x$HAVE_SZLIB" = "xyes" -a "x$HAVE_SZLIB_H" = "xyes"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SZ_BufftoBuffCompress in -lsz" >&5 $as_echo_n "checking for SZ_BufftoBuffCompress in -lsz... " >&6; } if ${ac_cv_lib_sz_SZ_BufftoBuffCompress+:} false; then : $as_echo_n "(cached) " >&6 @@ -25837,7 +25856,7 @@ else unset HAVE_SZLIB fi - + fi if test -z "$HAVE_SZLIB" -a -n "$HDF5_CONFIG_ABORT"; then as_fn_error $? "couldn't find szlib library" "$LINENO" 5 fi @@ -25892,7 +25911,7 @@ if test "x$ac_cv_header_szlib_h" = xyes; then : _ACEOF HAVE_SZLIB_H="yes" else - CPPFLAGS="$saved_CPPFLAGS"; AM_CPPFLAGS="$saved_AM_CPPFLAGS" + CPPFLAGS="$saved_CPPFLAGS"; AM_CPPFLAGS="$saved_AM_CPPFLAGS" unset HAVE_SZIP fi done @@ -25903,7 +25922,8 @@ done AM_LDFLAGS="$AM_LDFLAGS -L$szlib_lib" fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SZ_BufftoBuffCompress in -lsz" >&5 + if test "x$HAVE_SZLIB" = "xyes" -a "x$HAVE_SZLIB_H" = "xyes"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SZ_BufftoBuffCompress in -lsz" >&5 $as_echo_n "checking for SZ_BufftoBuffCompress in -lsz... " >&6; } if ${ac_cv_lib_sz_SZ_BufftoBuffCompress+:} false; then : $as_echo_n "(cached) " >&6 @@ -25958,6 +25978,7 @@ else LDFLAGS="$saved_LDFLAGS"; AM_LDFLAGS="$saved_AM_LDFLAGS"; unset HAVE_SZLIB fi + fi if test -z "$HAVE_SZLIB" -a -n "$HDF5_CONFIG_ABORT"; then as_fn_error $? "couldn't find szlib library" "$LINENO" 5 @@ -25966,22 +25987,22 @@ fi esac if test "x$HAVE_SZLIB" = "xyes" -a "x$HAVE_SZLIB_H" = "xyes"; then - ## SZLIB library is available. Check if it can encode - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for szlib encoder" >&5 + ## SZLIB library is available. Check if it can encode + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for szlib encoder" >&5 $as_echo_n "checking for szlib encoder... " >&6; } - ## Set LD_LIBRARY_PATH so encoder test can find the library and run. - ## Also add LL_PATH substitution to Makefiles so they can use the - ## path as well, for testing examples. - if test -z "$LD_LIBRARY_PATH"; then + ## Set LD_LIBRARY_PATH so encoder test can find the library and run. + ## Also add LL_PATH substitution to Makefiles so they can use the + ## path as well, for testing examples. + if test -z "$LD_LIBRARY_PATH"; then export LD_LIBRARY_PATH="$szlib_lib" - else + else export LD_LIBRARY_PATH="$szlib_lib:$LD_LIBRARY_PATH" - fi + fi - LL_PATH="$LD_LIBRARY_PATH" + LL_PATH="$LD_LIBRARY_PATH" - if ${hdf5_cv_szlib_can_encode+:} false; then : + if ${hdf5_cv_szlib_can_encode+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : @@ -26020,31 +26041,30 @@ fi $as_echo "#define HAVE_FILTER_SZIP 1" >>confdefs.h - USE_FILTER_SZIP="yes" + USE_FILTER_SZIP="yes" - if test ${hdf5_cv_szlib_can_encode} = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 + if test ${hdf5_cv_szlib_can_encode} = "yes"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } - fi - if test ${hdf5_cv_szlib_can_encode} = "no"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 + fi + if test ${hdf5_cv_szlib_can_encode} = "no"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } - fi + fi - ## Add "szip" to external filter list - if test ${hdf5_cv_szlib_can_encode} = "yes"; then - if test "X$EXTERNAL_FILTERS" != "X"; then - EXTERNAL_FILTERS="${EXTERNAL_FILTERS}," - fi - EXTERNAL_FILTERS="${EXTERNAL_FILTERS}szip(encoder)" + ## Add "szip" to external filter list + if test ${hdf5_cv_szlib_can_encode} = "yes"; then + if test "X$EXTERNAL_FILTERS" != "X"; then + EXTERNAL_FILTERS="${EXTERNAL_FILTERS}," fi - if test ${hdf5_cv_szlib_can_encode} = "no"; then - if test "X$EXTERNAL_FILTERS" != "X"; then - EXTERNAL_FILTERS="${EXTERNAL_FILTERS}," - fi - EXTERNAL_FILTERS="${EXTERNAL_FILTERS}szip(no encoder)" + EXTERNAL_FILTERS="${EXTERNAL_FILTERS}szip(encoder)" + fi + if test ${hdf5_cv_szlib_can_encode} = "no"; then + if test "X$EXTERNAL_FILTERS" != "X"; then + EXTERNAL_FILTERS="${EXTERNAL_FILTERS}," fi - + EXTERNAL_FILTERS="${EXTERNAL_FILTERS}szip(no encoder)" + fi fi if test "X$USE_FILTER_SZIP" = "Xyes" && test "X$LL_PATH" != "X"; then @@ -26150,7 +26170,7 @@ rm -f confcache ## and/or a library path. If the library path is specified then it must ## be preceded by a comma. ## - PTHREAD=yes + HAVE_PTHREAD=yes # Check whether --with-pthread was given. if test "${with_pthread+set}" = set; then : @@ -26170,11 +26190,14 @@ if test "x$ac_cv_header_pthread_h" = xyes; then : #define HAVE_PTHREAD_H 1 _ACEOF +else + unset HAVE_PTHREAD fi done - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_self in -lpthread" >&5 + if test "x$HAVE_DMALLOC" = "xyes"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_self in -lpthread" >&5 $as_echo_n "checking for pthread_self in -lpthread... " >&6; } if ${ac_cv_lib_pthread_pthread_self+:} false; then : $as_echo_n "(cached) " >&6 @@ -26226,16 +26249,17 @@ _ACEOF LIBS="-lpthread $LIBS" else - unset PTHREAD + unset HAVE_PTHREAD fi + fi ;; no) { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread" >&5 $as_echo_n "checking for pthread... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: suppressed" >&5 $as_echo "suppressed" >&6; } - unset PTHREAD + unset HAVE_PTHREAD ;; *) case "$withval" in @@ -26274,7 +26298,7 @@ if test "x$ac_cv_header_pthread_h" = xyes; then : _ACEOF else - CPPFLAGS="$saved_CPPFLAGS"; AM_CPPFLAGS="$saved_AM_CPPFLAGS"; unset PTHREAD + CPPFLAGS="$saved_CPPFLAGS"; AM_CPPFLAGS="$saved_AM_CPPFLAGS"; unset HAVE_PTHREAD fi done @@ -26289,19 +26313,20 @@ if test "x$ac_cv_header_pthread_h" = xyes; then : _ACEOF else - unset PTHREAD + unset HAVE_PTHREAD fi done fi - if test -n "$pthread_lib"; then - saved_LDFLAGS="$LDFLAGS" - saved_AM_LDFLAGS="$AM_LDFLAGS" - LDFLAGS="$LDFLAGS -L$pthread_lib" - AM_LDFLAGS="$AM_LDFLAGS -L$pthread_lib" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_self in -lpthread" >&5 + if test "x$HAVE_DMALLOC" = "xyes"; then + if test -n "$pthread_lib"; then + saved_LDFLAGS="$LDFLAGS" + saved_AM_LDFLAGS="$AM_LDFLAGS" + LDFLAGS="$LDFLAGS -L$pthread_lib" + AM_LDFLAGS="$AM_LDFLAGS -L$pthread_lib" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_self in -lpthread" >&5 $as_echo_n "checking for pthread_self in -lpthread... " >&6; } if ${ac_cv_lib_pthread_pthread_self+:} false; then : $as_echo_n "(cached) " >&6 @@ -26353,12 +26378,11 @@ _ACEOF LIBS="-lpthread $LIBS" else - LDFLAGS="$saved_LDFLAGS"; AM_LDFLAGS="$saved_AM_LDFLAGS"; unset PTHREAD + LDFLAGS="$saved_LDFLAGS"; AM_LDFLAGS="$saved_AM_LDFLAGS"; unset HAVE_PTHREAD fi - - else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_self in -lpthread" >&5 + else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_self in -lpthread" >&5 $as_echo_n "checking for pthread_self in -lpthread... " >&6; } if ${ac_cv_lib_pthread_pthread_self+:} false; then : $as_echo_n "(cached) " >&6 @@ -26410,9 +26434,10 @@ _ACEOF LIBS="-lpthread $LIBS" else - unset PTHREAD + unset HAVE_PTHREAD fi + fi fi ;; esac @@ -31776,7 +31801,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by HDF5 $as_me 1.9.144, which was +This file was extended by HDF5 $as_me 1.9.148, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -31842,7 +31867,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -HDF5 config.status 1.9.144 +HDF5 config.status 1.9.148 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" @@ -34617,7 +34642,7 @@ Usage: $0 [OPTIONS] Report bugs to ." lt_cl_version="\ -HDF5 config.lt 1.9.144 +HDF5 config.lt 1.9.148 configured by $0, generated by GNU Autoconf 2.69. Copyright (C) 2011 Free Software Foundation, Inc. diff --git a/configure.ac b/configure.ac index 6b6d3a3..e8ede42 100644 --- a/configure.ac +++ b/configure.ac @@ -26,7 +26,7 @@ AC_PREREQ([2.69]) ## NOTE: Do not forget to change the version number here when we do a ## release!!! ## -AC_INIT([HDF5], [1.9.144], [help@hdfgroup.org]) +AC_INIT([HDF5], [1.9.148], [help@hdfgroup.org]) AC_CONFIG_SRCDIR([src/H5.c]) AC_CONFIG_HEADER([src/H5config.h]) @@ -1616,9 +1616,10 @@ AC_ARG_WITH([dmalloc], case $withval in yes) HAVE_DMALLOC="yes" - AC_CHECK_HEADERS([dmalloc.h]) - AC_CHECK_LIB([dmalloc], [dmalloc_shutdown],, [unset HAVE_DMALLOC]) - + AC_CHECK_HEADERS([dmalloc.h],, [unset HAVE_DMALLOC]) + if test "x$HAVE_DMALLOC" = "xyes"; then + AC_CHECK_LIB([dmalloc], [dmalloc_shutdown],, [unset HAVE_DMALLOC]) + fi if test -z "$HAVE_DMALLOC" -a -n "$HDF5_CONFIG_ABORT"; then AC_MSG_ERROR([couldn't find dmalloc library]) fi @@ -1662,14 +1663,16 @@ case $withval in AM_CPPFLAGS="$AM_CPPFLAGS -I$dmalloc_inc" fi - AC_CHECK_HEADERS([dmalloc.h],,[CPPFLAGS="$saved_CPPFLAGS"; AM_CPPFLAGS="$saved_AM_CPPFLAGS"]) + AC_CHECK_HEADERS([dmalloc.h],,[CPPFLAGS="$saved_CPPFLAGS"; AM_CPPFLAGS="$saved_AM_CPPFLAGS"] [unset HAVE_DMALLOC]) - if test -n "$dmalloc_lib"; then - LDFLAGS="$LDFLAGS -L$dmalloc_lib" - AM_LDFLAGS="$AM_LDFLAGS -L$dmalloc_lib" - fi + if test "x$HAVE_DMALLOC" = "xyes"; then + if test -n "$dmalloc_lib"; then + LDFLAGS="$LDFLAGS -L$dmalloc_lib" + AM_LDFLAGS="$AM_LDFLAGS -L$dmalloc_lib" + fi - AC_CHECK_LIB([dmalloc], [dmalloc_shutdown],, [LDFLAGS="$saved_LDFLAGS"; AM_LDFLAGS="$saved_AM_LDFLAGS"; unset HAVE_DMALLOC]) + AC_CHECK_LIB([dmalloc], [dmalloc_shutdown],, [LDFLAGS="$saved_LDFLAGS"; AM_LDFLAGS="$saved_AM_LDFLAGS"; unset HAVE_DMALLOC]) + fi if test -z "$HAVE_DMALLOC" -a -n "$HDF5_CONFIG_ABORT"; then AC_MSG_ERROR([couldn't find dmalloc library]) @@ -1693,12 +1696,16 @@ AC_ARG_WITH([zlib], case $withval in yes) HAVE_ZLIB="yes" - AC_CHECK_HEADERS([zlib.h], [HAVE_ZLIB_H="yes"]) - AC_CHECK_LIB([z], [compress2],, [unset HAVE_ZLIB]) - AC_CHECK_FUNC([compress2], [HAVE_COMPRESS2="yes"]) - - if test -z "$HAVE_ZLIB" -a -n "$HDF5_CONFIG_ABORT"; then - AC_MSG_ERROR([couldn't find zlib library]) + AC_CHECK_HEADERS([zlib.h], [HAVE_ZLIB_H="yes"], [unset HAVE_ZLIB]) + if test "x$HAVE_ZLIB" = "xyes" -a "x$HAVE_ZLIB_H" = "xyes"; then + AC_CHECK_LIB([z], [compress2],, [unset HAVE_ZLIB]) + fi + if test -z "$HAVE_ZLIB"; then + if test -n "$HDF5_CONFIG_ABORT"; then + AC_MSG_ERROR([couldn't find zlib library]) + fi + else + AC_CHECK_FUNC([compress2], [HAVE_COMPRESS2="yes"]) fi ;; no) @@ -1710,8 +1717,8 @@ case $withval in HAVE_ZLIB="yes" case "$withval" in *,*) - zlib_inc="`echo $withval |cut -f1 -d,`" - zlib_lib="`echo $withval |cut -f2 -d, -s`" + zlib_inc="`echo $withval | cut -f1 -d,`" + zlib_lib="`echo $withval | cut -f2 -d, -s`" ;; *) if test -n "$withval"; then @@ -1742,32 +1749,37 @@ case $withval in AC_CHECK_HEADERS([zlib.h], [HAVE_ZLIB_H="yes"], - [CPPFLAGS="$saved_CPPFLAGS"; AM_CPPFLAGS="$saved_AM_CPPFLAGS"]) + [CPPFLAGS="$saved_CPPFLAGS"; AM_CPPFLAGS="$saved_AM_CPPFLAGS"] [unset HAVE_ZLIB]) if test -n "$zlib_lib"; then LDFLAGS="$LDFLAGS -L$zlib_lib" AM_LDFLAGS="$AM_LDFLAGS -L$zlib_lib" fi - AC_CHECK_LIB([z], [compress2],, - [LDFLAGS="$saved_LDFLAGS"; AM_LDFLAGS="$saved_AM_LDFLAGS"; unset HAVE_ZLIB]) - AC_CHECK_FUNC([compress2], [HAVE_COMPRESS2="yes"]) + if test "x$HAVE_ZLIB" = "xyes" -a "x$HAVE_ZLIB_H" = "xyes"; then + AC_CHECK_LIB([z], [compress2],, + [LDFLAGS="$saved_LDFLAGS"; AM_LDFLAGS="$saved_AM_LDFLAGS"; unset HAVE_ZLIB]) + fi - if test -z "$HAVE_ZLIB" -a -n "$HDF5_CONFIG_ABORT"; then - AC_MSG_ERROR([couldn't find zlib library]) + if test -z "$HAVE_ZLIB"; then + if test -n "$HDF5_CONFIG_ABORT"; then + AC_MSG_ERROR([couldn't find zlib library]) + fi + else + AC_CHECK_FUNC([compress2], [HAVE_COMPRESS2="yes"]) fi ;; esac if test "x$HAVE_ZLIB" = "xyes" -a "x$HAVE_ZLIB_H" = "xyes" -a "x$HAVE_COMPRESS2" = "xyes"; then - AC_DEFINE([HAVE_FILTER_DEFLATE], [1], [Define if support for deflate (zlib) filter is enabled]) - USE_FILTER_DEFLATE="yes" + AC_DEFINE([HAVE_FILTER_DEFLATE], [1], [Define if support for deflate (zlib) filter is enabled]) + USE_FILTER_DEFLATE="yes" - ## Add "deflate" to external filter list - if test "X$EXTERNAL_FILTERS" != "X"; then - EXTERNAL_FILTERS="${EXTERNAL_FILTERS}," - fi - EXTERNAL_FILTERS="${EXTERNAL_FILTERS}deflate(zlib)" + ## Add "deflate" to external filter list + if test "X$EXTERNAL_FILTERS" != "X"; then + EXTERNAL_FILTERS="${EXTERNAL_FILTERS}," + fi + EXTERNAL_FILTERS="${EXTERNAL_FILTERS}deflate(zlib)" fi @@ -1787,9 +1799,10 @@ AC_ARG_WITH([szlib], case $withval in yes) HAVE_SZLIB="yes" - AC_CHECK_HEADERS([szlib.h], [HAVE_SZLIB_H="yes"]) - AC_CHECK_LIB([sz], [SZ_BufftoBuffCompress],, [unset HAVE_SZLIB]) - + AC_CHECK_HEADERS([szlib.h], [HAVE_SZLIB_H="yes"], [unset HAVE_SZLIB]) + if test "x$HAVE_SZLIB" = "xyes" -a "x$HAVE_SZLIB_H" = "xyes"; then + AC_CHECK_LIB([sz], [SZ_BufftoBuffCompress],, [unset HAVE_SZLIB]) + fi if test -z "$HAVE_SZLIB" -a -n "$HDF5_CONFIG_ABORT"; then AC_MSG_ERROR([couldn't find szlib library]) fi @@ -1835,15 +1848,17 @@ case $withval in AC_CHECK_HEADERS([szlib.h], [HAVE_SZLIB_H="yes"], - [CPPFLAGS="$saved_CPPFLAGS"; AM_CPPFLAGS="$saved_AM_CPPFLAGS"]) + [CPPFLAGS="$saved_CPPFLAGS"; AM_CPPFLAGS="$saved_AM_CPPFLAGS"] [unset HAVE_SZIP]) if test -n "$szlib_lib"; then LDFLAGS="$LDFLAGS -L$szlib_lib" AM_LDFLAGS="$AM_LDFLAGS -L$szlib_lib" fi - AC_CHECK_LIB([sz], [SZ_BufftoBuffCompress],, - [LDFLAGS="$saved_LDFLAGS"; AM_LDFLAGS="$saved_AM_LDFLAGS"; unset HAVE_SZLIB]) + if test "x$HAVE_SZLIB" = "xyes" -a "x$HAVE_SZLIB_H" = "xyes"; then + AC_CHECK_LIB([sz], [SZ_BufftoBuffCompress],, + [LDFLAGS="$saved_LDFLAGS"; AM_LDFLAGS="$saved_AM_LDFLAGS"; unset HAVE_SZLIB]) + fi if test -z "$HAVE_SZLIB" -a -n "$HDF5_CONFIG_ABORT"; then AC_MSG_ERROR([couldn't find szlib library]) @@ -1852,21 +1867,21 @@ case $withval in esac if test "x$HAVE_SZLIB" = "xyes" -a "x$HAVE_SZLIB_H" = "xyes"; then - ## SZLIB library is available. Check if it can encode - AC_MSG_CHECKING([for szlib encoder]) + ## SZLIB library is available. Check if it can encode + AC_MSG_CHECKING([for szlib encoder]) - ## Set LD_LIBRARY_PATH so encoder test can find the library and run. - ## Also add LL_PATH substitution to Makefiles so they can use the - ## path as well, for testing examples. - if test -z "$LD_LIBRARY_PATH"; then + ## Set LD_LIBRARY_PATH so encoder test can find the library and run. + ## Also add LL_PATH substitution to Makefiles so they can use the + ## path as well, for testing examples. + if test -z "$LD_LIBRARY_PATH"; then export LD_LIBRARY_PATH="$szlib_lib" - else + else export LD_LIBRARY_PATH="$szlib_lib:$LD_LIBRARY_PATH" - fi + fi - AC_SUBST([LL_PATH]) LL_PATH="$LD_LIBRARY_PATH" + AC_SUBST([LL_PATH]) LL_PATH="$LD_LIBRARY_PATH" - AC_CACHE_VAL([hdf5_cv_szlib_can_encode], + AC_CACHE_VAL([hdf5_cv_szlib_can_encode], [AC_TRY_RUN([ #include @@ -1880,31 +1895,30 @@ if test "x$HAVE_SZLIB" = "xyes" -a "x$HAVE_SZLIB_H" = "xyes"; then } ], [hdf5_cv_szlib_can_encode=yes], [hdf5_cv_szlib_can_encode=no],)]) - AC_DEFINE([HAVE_FILTER_SZIP], [1], + AC_DEFINE([HAVE_FILTER_SZIP], [1], [Define if support for szip filter is enabled]) - USE_FILTER_SZIP="yes" + USE_FILTER_SZIP="yes" - if test ${hdf5_cv_szlib_can_encode} = "yes"; then - AC_MSG_RESULT([yes]) - fi - if test ${hdf5_cv_szlib_can_encode} = "no"; then - AC_MSG_RESULT([no]) - fi + if test ${hdf5_cv_szlib_can_encode} = "yes"; then + AC_MSG_RESULT([yes]) + fi + if test ${hdf5_cv_szlib_can_encode} = "no"; then + AC_MSG_RESULT([no]) + fi - ## Add "szip" to external filter list - if test ${hdf5_cv_szlib_can_encode} = "yes"; then - if test "X$EXTERNAL_FILTERS" != "X"; then - EXTERNAL_FILTERS="${EXTERNAL_FILTERS}," - fi - EXTERNAL_FILTERS="${EXTERNAL_FILTERS}szip(encoder)" - fi - if test ${hdf5_cv_szlib_can_encode} = "no"; then - if test "X$EXTERNAL_FILTERS" != "X"; then - EXTERNAL_FILTERS="${EXTERNAL_FILTERS}," - fi - EXTERNAL_FILTERS="${EXTERNAL_FILTERS}szip(no encoder)" + ## Add "szip" to external filter list + if test ${hdf5_cv_szlib_can_encode} = "yes"; then + if test "X$EXTERNAL_FILTERS" != "X"; then + EXTERNAL_FILTERS="${EXTERNAL_FILTERS}," fi - + EXTERNAL_FILTERS="${EXTERNAL_FILTERS}szip(encoder)" + fi + if test ${hdf5_cv_szlib_can_encode} = "no"; then + if test "X$EXTERNAL_FILTERS" != "X"; then + EXTERNAL_FILTERS="${EXTERNAL_FILTERS}," + fi + EXTERNAL_FILTERS="${EXTERNAL_FILTERS}szip(no encoder)" + fi fi AM_CONDITIONAL([BUILD_SHARED_SZIP_CONDITIONAL], [test "X$USE_FILTER_SZIP" = "Xyes" && test "X$LL_PATH" != "X"]) @@ -1919,7 +1933,7 @@ AC_CACHE_SAVE ## and/or a library path. If the library path is specified then it must ## be preceded by a comma. ## -AC_SUBST([PTHREAD]) PTHREAD=yes +AC_SUBST([HAVE_PTHREAD]) HAVE_PTHREAD=yes AC_ARG_WITH([pthread], [AS_HELP_STRING([--with-pthread=DIR], [Use the Pthreads library [default=no]])],, @@ -1927,13 +1941,15 @@ AC_ARG_WITH([pthread], case "$withval" in yes) - AC_CHECK_HEADERS([pthread.h]) - AC_CHECK_LIB([pthread], [pthread_self],, [unset PTHREAD]) + AC_CHECK_HEADERS([pthread.h],, [unset HAVE_PTHREAD]) + if test "x$HAVE_DMALLOC" = "xyes"; then + AC_CHECK_LIB([pthread], [pthread_self],, [unset HAVE_PTHREAD]) + fi ;; no) AC_MSG_CHECKING([for pthread]) AC_MSG_RESULT([suppressed]) - unset PTHREAD + unset HAVE_PTHREAD ;; *) case "$withval" in @@ -1963,21 +1979,22 @@ case "$withval" in saved_AM_CPPFLAGS="$AM_CPPFLAGS" CPPFLAGS="$CPPFLAGS -I$pthread_inc" AM_CPPFLAGS="$AM_CPPFLAGS -I$pthread_inc" - AC_CHECK_HEADERS([pthread.h],, [CPPFLAGS="$saved_CPPFLAGS"; AM_CPPFLAGS="$saved_AM_CPPFLAGS"; unset PTHREAD]) + AC_CHECK_HEADERS([pthread.h],, [CPPFLAGS="$saved_CPPFLAGS"; AM_CPPFLAGS="$saved_AM_CPPFLAGS"; unset HAVE_PTHREAD]) else - AC_CHECK_HEADERS([pthread.h],, [unset PTHREAD]) + AC_CHECK_HEADERS([pthread.h],, [unset HAVE_PTHREAD]) fi - if test -n "$pthread_lib"; then - saved_LDFLAGS="$LDFLAGS" - saved_AM_LDFLAGS="$AM_LDFLAGS" - LDFLAGS="$LDFLAGS -L$pthread_lib" - AM_LDFLAGS="$AM_LDFLAGS -L$pthread_lib" - AC_CHECK_LIB([pthread], [pthread_self],, - [LDFLAGS="$saved_LDFLAGS"; AM_LDFLAGS="$saved_AM_LDFLAGS"; unset PTHREAD]) - - else - AC_CHECK_LIB([pthread], [pthread_self],, [unset PTHREAD]) + if test "x$HAVE_DMALLOC" = "xyes"; then + if test -n "$pthread_lib"; then + saved_LDFLAGS="$LDFLAGS" + saved_AM_LDFLAGS="$AM_LDFLAGS" + LDFLAGS="$LDFLAGS -L$pthread_lib" + AM_LDFLAGS="$AM_LDFLAGS -L$pthread_lib" + AC_CHECK_LIB([pthread], [pthread_self],, + [LDFLAGS="$saved_LDFLAGS"; AM_LDFLAGS="$saved_AM_LDFLAGS"; unset HAVE_PTHREAD]) + else + AC_CHECK_LIB([pthread], [pthread_self],, [unset HAVE_PTHREAD]) + fi fi ;; esac diff --git a/examples/Makefile.in b/examples/Makefile.in index b6dfab5..064cb84 100644 --- a/examples/Makefile.in +++ b/examples/Makefile.in @@ -194,6 +194,7 @@ H5_VERSION = @H5_VERSION@ HADDR_T = @HADDR_T@ HAVE_DMALLOC = @HAVE_DMALLOC@ HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@ +HAVE_PTHREAD = @HAVE_PTHREAD@ HDF5_HL = @HDF5_HL@ HDF5_INTERFACES = @HDF5_INTERFACES@ HDF_CXX = @HDF_CXX@ @@ -245,7 +246,6 @@ PACKAGE_VERSION = @PACKAGE_VERSION@ PARALLEL = @PARALLEL@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ -PTHREAD = @PTHREAD@ RANLIB = @RANLIB@ ROOT = @ROOT@ RUNPARALLEL = @RUNPARALLEL@ diff --git a/fortran/Makefile.in b/fortran/Makefile.in index 806eb30..acab031 100644 --- a/fortran/Makefile.in +++ b/fortran/Makefile.in @@ -231,6 +231,7 @@ H5_VERSION = @H5_VERSION@ HADDR_T = @HADDR_T@ HAVE_DMALLOC = @HAVE_DMALLOC@ HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@ +HAVE_PTHREAD = @HAVE_PTHREAD@ HDF5_HL = @HDF5_HL@ HDF5_INTERFACES = @HDF5_INTERFACES@ HDF_CXX = @HDF_CXX@ @@ -282,7 +283,6 @@ PACKAGE_VERSION = @PACKAGE_VERSION@ PARALLEL = @PARALLEL@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ -PTHREAD = @PTHREAD@ RANLIB = @RANLIB@ ROOT = @ROOT@ RUNPARALLEL = @RUNPARALLEL@ diff --git a/fortran/examples/Makefile.in b/fortran/examples/Makefile.in index 5f6124c..93a2af1 100644 --- a/fortran/examples/Makefile.in +++ b/fortran/examples/Makefile.in @@ -202,6 +202,7 @@ H5_VERSION = @H5_VERSION@ HADDR_T = @HADDR_T@ HAVE_DMALLOC = @HAVE_DMALLOC@ HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@ +HAVE_PTHREAD = @HAVE_PTHREAD@ HDF5_HL = @HDF5_HL@ HDF5_INTERFACES = @HDF5_INTERFACES@ HDF_CXX = @HDF_CXX@ @@ -253,7 +254,6 @@ PACKAGE_VERSION = @PACKAGE_VERSION@ PARALLEL = @PARALLEL@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ -PTHREAD = @PTHREAD@ RANLIB = @RANLIB@ ROOT = @ROOT@ RUNPARALLEL = @RUNPARALLEL@ diff --git a/fortran/src/CMakeLists.txt b/fortran/src/CMakeLists.txt index 765bb65..c41916a 100644 --- a/fortran/src/CMakeLists.txt +++ b/fortran/src/CMakeLists.txt @@ -188,6 +188,7 @@ SET (f90_F_SRCS ${HDF5_F90_SRC_SOURCE_DIR}/H5Aff${F_STATUS}.f90 ${HDF5_F90_SRC_SOURCE_DIR}/H5Dff${F_STATUS}.f90 ${HDF5_F90_SRC_SOURCE_DIR}/H5Eff${F_STATUS}.f90 + ${HDF5_F90_SRC_SOURCE_DIR}/H5Fff${F_STATUS}.f90 ${HDF5_F90_SRC_SOURCE_DIR}/H5Lff${F_STATUS}.f90 ${HDF5_F90_SRC_SOURCE_DIR}/H5Off${F_STATUS}.f90 ${HDF5_F90_SRC_SOURCE_DIR}/H5Pff${F_STATUS}.f90 diff --git a/fortran/src/H5Aff.f90 b/fortran/src/H5Aff.f90 index 1926dd1..25f7fa7 100644 --- a/fortran/src/H5Aff.f90 +++ b/fortran/src/H5Aff.f90 @@ -28,7 +28,7 @@ ! NOTES ! *** IMPORTANT *** ! If you add a new H5A function you must add the function name to the -! Windows dll file 'hdf5_fortrandll.def' in the fortran/src directory. +! Windows dll file 'hdf5_fortrandll.def.in' in the fortran/src directory. ! This is needed for Windows based operating systems. ! !***** diff --git a/fortran/src/H5Aff_F03.f90 b/fortran/src/H5Aff_F03.f90 index b9e6c92..26c911a 100644 --- a/fortran/src/H5Aff_F03.f90 +++ b/fortran/src/H5Aff_F03.f90 @@ -61,7 +61,7 @@ ! (B) ! *** IMPORTANT *** ! If you add a new H5A function you must add the function name to the -! Windows dll file 'hdf5_fortrandll.def' in the fortran/src directory. +! Windows dll file 'hdf5_fortrandll.def.in' in the fortran/src directory. ! This is needed for Windows based operating systems. ! !***** diff --git a/fortran/src/H5Aff_F90.f90 b/fortran/src/H5Aff_F90.f90 index 7e14f7a..974b023 100644 --- a/fortran/src/H5Aff_F90.f90 +++ b/fortran/src/H5Aff_F90.f90 @@ -33,7 +33,7 @@ ! NOTES ! *** IMPORTANT *** ! If you add a new H5A function you must add the function name to the -! Windows dll file 'hdf5_fortrandll.def' in the fortran/src directory. +! Windows dll file 'hdf5_fortrandll.def.in' in the fortran/src directory. ! This is needed for Windows based operating systems. ! !***** diff --git a/fortran/src/H5Dff.f90 b/fortran/src/H5Dff.f90 index b1e1df1..3ad868c 100644 --- a/fortran/src/H5Dff.f90 +++ b/fortran/src/H5Dff.f90 @@ -30,7 +30,7 @@ ! NOTES ! *** IMPORTANT *** ! If you add a new H5D function you must add the function name to the -! Windows dll file 'hdf5_fortrandll.def' in the fortran/src directory. +! Windows dll file 'hdf5_fortrandll.def.in' in the fortran/src directory. ! This is needed for Windows based operating systems. ! !***** diff --git a/fortran/src/H5Dff_F03.f90 b/fortran/src/H5Dff_F03.f90 index 61d5dfc..be4bd69 100644 --- a/fortran/src/H5Dff_F03.f90 +++ b/fortran/src/H5Dff_F03.f90 @@ -74,7 +74,7 @@ ! ! *** IMPORTANT *** ! If you add a new H5D function you must add the function name to the -! Windows dll file 'hdf5_fortrandll.def' in the fortran/src directory. +! Windows dll file 'hdf5_fortrandll.def.in' in the fortran/src directory. ! This is needed for Windows based operating systems. ! !***** diff --git a/fortran/src/H5Dff_F90.f90 b/fortran/src/H5Dff_F90.f90 index 3bb0fc0..46ea3ad 100644 --- a/fortran/src/H5Dff_F90.f90 +++ b/fortran/src/H5Dff_F90.f90 @@ -42,7 +42,7 @@ ! (3) ! *** IMPORTANT *** ! If you add a new H5D function you must add the function name to the -! Windows dll file 'hdf5_fortrandll.def' in the fortran/src directory. +! Windows dll file 'hdf5_fortrandll.def.in' in the fortran/src directory. ! This is needed for Windows based operating systems. !***** diff --git a/fortran/src/H5Eff.f90 b/fortran/src/H5Eff.f90 index 2e137df..7b56376 100644 --- a/fortran/src/H5Eff.f90 +++ b/fortran/src/H5Eff.f90 @@ -28,7 +28,7 @@ ! NOTES ! *** IMPORTANT *** ! If you add a new H5E function to the module you must add the function name -! to the Windows dll file 'hdf5_fortrandll.def' in the fortran/src directory. +! to the Windows dll file 'hdf5_fortrandll.def.in' in the fortran/src directory. ! This is needed for Windows based operating systems. ! !***** diff --git a/fortran/src/H5Eff_F03.f90 b/fortran/src/H5Eff_F03.f90 index 164f203..3ba3ce96 100644 --- a/fortran/src/H5Eff_F03.f90 +++ b/fortran/src/H5Eff_F03.f90 @@ -33,7 +33,7 @@ ! NOTES ! *** IMPORTANT *** ! If you add a new H5E function to the module you must add the function name -! to the Windows dll file 'hdf5_fortrandll.def' in the fortran/src directory. +! to the Windows dll file 'hdf5_fortrandll.def.in' in the fortran/src directory. ! This is needed for Windows based operating systems. ! !***** diff --git a/fortran/src/H5Eff_F90.f90 b/fortran/src/H5Eff_F90.f90 index e698a84..158ec12 100644 --- a/fortran/src/H5Eff_F90.f90 +++ b/fortran/src/H5Eff_F90.f90 @@ -28,7 +28,7 @@ ! ! *** IMPORTANT *** ! If you add a new H5D function you must add the function name to the -! Windows dll file 'hdf5_fortrandll.def' in the fortran/src directory. +! Windows dll file 'hdf5_fortrandll.def.in' in the fortran/src directory. ! This is needed for Windows based operating systems. !***** diff --git a/fortran/src/H5FDmpioff.f90 b/fortran/src/H5FDmpioff.f90 index d9faef3..5c81bc8 100644 --- a/fortran/src/H5FDmpioff.f90 +++ b/fortran/src/H5FDmpioff.f90 @@ -26,7 +26,7 @@ ! NOTES ! *** IMPORTANT *** ! If you add a new H5P function you must add the function name to the -! Windows dll file 'hdf5_fortrandll.def' in the fortran/src directory. +! Windows dll file 'hdf5_fortrandll.def.in' in the fortran/src directory. ! This is needed for Windows based operating systems. ! !***** diff --git a/fortran/src/H5Ff.c b/fortran/src/H5Ff.c index 1259d4d..4910aca 100644 --- a/fortran/src/H5Ff.c +++ b/fortran/src/H5Ff.c @@ -679,3 +679,37 @@ nh5fget_filesize_c(hid_t_f *file_id, hsize_t_f *size) done: return ret_value; } + +/****if* H5Ff/h5fget_file_image_c + * NAME + * h5fget_file_image_c + * PURPOSE + * Calls h5fget_file_image + * INPUTS + * file_id - Target file identifier. + * buf_ptr - Pointer to the buffer into which the image of the HDF5 file is to be copied. + * buf_len - Size of the supplied buffer. + * OUTPUTS + * buf_req - The size in bytes of the buffer required to store the file image. + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * M. Scot Breitenfeld + * November 26, 2012 + * SOURCE +*/ +int_f +nh5fget_file_image_c(hid_t_f *file_id, void *buf_ptr, size_t_f *buf_len, size_t_f *buf_req) +/******/ +{ + herr_t ret_value=0; /* Return value */ + + /* + * Call h5fget_file_image function + */ + if ((*buf_req = (size_t_f)H5Fget_file_image((hid_t)*file_id, buf_ptr, (size_t)*buf_len)) < 0) + HGOTO_DONE(FAIL); + +done: + return ret_value; +} diff --git a/fortran/src/H5Fff.f90 b/fortran/src/H5Fff.f90 index 0c70ad4..faa1967 100644 --- a/fortran/src/H5Fff.f90 +++ b/fortran/src/H5Fff.f90 @@ -28,7 +28,7 @@ ! NOTES ! *** IMPORTANT *** ! If you add a new H5F function you must add the function name to the -! Windows dll file 'hdf5_fortrandll.def' in the fortran/src directory. +! Windows dll file 'hdf5_fortrandll.def.in' in the fortran/src directory. ! This is needed for Windows based operating systems. ! !***** diff --git a/fortran/src/H5Fff_F03.f90 b/fortran/src/H5Fff_F03.f90 new file mode 100644 index 0000000..1ccd39a --- /dev/null +++ b/fortran/src/H5Fff_F03.f90 @@ -0,0 +1,104 @@ +!****h* ROBODoc/H5F (F03) +! +! NAME +! H5F_PROVISIONAL +! +! PURPOSE +! This file contains Fortran 2003 interfaces for H5F functions. +! +! COPYRIGHT +! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +! Copyright by The HDF Group. * +! Copyright by the Board of Trustees of the University of Illinois. * +! 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 files COPYING and Copyright.html. COPYING can be found at the root * +! of the source code distribution tree; Copyright.html can be found at the * +! root level of an installed copy of the electronic HDF5 document set and * +! is linked from the top-level documents page. It can also be found at * +! http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * +! access to either file, you may request a copy from help@hdfgroup.org. * +! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +! +! NOTES +! *** IMPORTANT *** +! If you add a new H5T function you must add the function name to the +! Windows dll file 'hdf5_fortrandll.def.in' in the fortran/src directory. +! This is needed for Windows based operating systems. +! +!***** + + +MODULE H5F_PROVISIONAL + + USE H5GLOBAL + USE, INTRINSIC :: ISO_C_BINDING + + +CONTAINS +!****s* H5F (F03)/h5fget_file_image_f_F03 +! +! NAME +! h5fget_file_image_f +! +! PURPOSE +! Retrieves a copy of the image of an existing, open file. +! +! Inputs: +! file_id - Target file identifier. +! buf_ptr - Pointer to the buffer into which the image of the HDF5 file is to be copied. +! buf_len - Size of the supplied buffer. +! +! Outputs: +! hdferr - error code: +! 0 on success and -1 on failure +! Optional: +! buf_size - The size in bytes of the buffer required to store the file image. +! +! AUTHOR +! M. Scot Breitenfeld +! November 26, 2012 +! +! Fortran2003 Interface: + SUBROUTINE h5fget_file_image_f(file_id, buf_ptr, buf_len, hdferr, buf_size) + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T) , INTENT(IN) :: file_id + TYPE(C_PTR) , INTENT(INOUT) :: buf_ptr + INTEGER(SIZE_T) , INTENT(IN) :: buf_len + INTEGER(SIZE_T) , INTENT(OUT), OPTIONAL :: buf_size + INTEGER , INTENT(OUT) :: hdferr +!***** + + INTEGER(SIZE_T) :: buf_size_default + + INTERFACE + INTEGER FUNCTION h5fget_file_image_c(file_id, buf_ptr, buf_len, buf_size) + USE, INTRINSIC :: ISO_C_BINDING + USE H5GLOBAL + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5FGET_FILE_IMAGE_C'::h5fget_file_image_c + !DEC$ENDIF + INTEGER(HID_T) , INTENT(IN) :: file_id + TYPE(C_PTR) , VALUE :: buf_ptr + INTEGER(SIZE_T) , INTENT(IN) :: buf_len + INTEGER(SIZE_T), INTENT(IN) :: buf_size + END FUNCTION h5fget_file_image_c + END INTERFACE + + + IF(PRESENT(buf_size))THEN + buf_ptr = C_NULL_PTR + ENDIF + + hdferr = h5fget_file_image_c(file_id, buf_ptr, buf_len, buf_size_default) + + IF(PRESENT(buf_size))THEN + buf_size = buf_size_default + ENDIF + + END SUBROUTINE h5fget_file_image_f + +END MODULE H5F_PROVISIONAL diff --git a/fortran/src/H5Fff_F90.f90 b/fortran/src/H5Fff_F90.f90 new file mode 100644 index 0000000..b6e659b --- /dev/null +++ b/fortran/src/H5Fff_F90.f90 @@ -0,0 +1,43 @@ +!****h* ROBODoc/H5F (F90) +! +! NAME +! H5F_PROVISIONAL +! +! PURPOSE +! This file contains Fortran 90 interfaces for H5F functions. It +! containsthe same functions as H5Fff_F03.f90, when applicable, +! but excludes the Fortran 2003 functions and the interface listings. +! This file will be compiled instead of H5Fff_F03.f90 if Fortran 2003 +! functions are not enabled. +! +! COPYRIGHT +! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +! Copyright by The HDF Group. * +! Copyright by the Board of Trustees of the University of Illinois. * +! 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 files COPYING and Copyright.html. COPYING can be found at the root * +! of the source code distribution tree; Copyright.html can be found at the * +! root level of an installed copy of the electronic HDF5 document set and * +! is linked from the top-level documents page. It can also be found at * +! http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * +! access to either file, you may request a copy from help@hdfgroup.org. * +! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +! +! NOTES +! *** IMPORTANT *** +! If you add a new H5F function you must add the function name to the +! Windows dll file 'hdf5_fortrandll.def.in' in the fortran/src directory. +! This is needed for Windows based operating systems. +! +!***** + + +MODULE H5F_PROVISIONAL + + USE H5GLOBAL + IMPLICIT NONE + +END MODULE H5F_PROVISIONAL diff --git a/fortran/src/H5Gff.f90 b/fortran/src/H5Gff.f90 index 155185a..d4d7496 100644 --- a/fortran/src/H5Gff.f90 +++ b/fortran/src/H5Gff.f90 @@ -28,7 +28,7 @@ ! NOTES ! *** IMPORTANT *** ! If you add a new H5G function you must add the function name to the -! Windows dll file 'hdf5_fortrandll.def' in the fortran/src directory. +! Windows dll file 'hdf5_fortrandll.def.in' in the fortran/src directory. ! This is needed for Windows based operating systems. ! !***** diff --git a/fortran/src/H5Iff.f90 b/fortran/src/H5Iff.f90 index 86e88b9..7c9a843 100644 --- a/fortran/src/H5Iff.f90 +++ b/fortran/src/H5Iff.f90 @@ -28,7 +28,7 @@ ! NOTES ! *** IMPORTANT *** ! If you add a new H5I function you must add the function name to the -! Windows dll file 'hdf5_fortrandll.def' in the fortran/src directory. +! Windows dll file 'hdf5_fortrandll.def.in' in the fortran/src directory. ! This is needed for Windows based operating systems. ! !***** diff --git a/fortran/src/H5Lf.c b/fortran/src/H5Lf.c index e5b01ed..c5138b6 100644 --- a/fortran/src/H5Lf.c +++ b/fortran/src/H5Lf.c @@ -725,7 +725,7 @@ nh5lget_name_by_idx_c(hid_t_f *loc_id, _fcd group_name, size_t_f *group_namelen, if(NULL == (c_name = (char *)HDmalloc(c_size))) HGOTO_DONE(FAIL) - if((*size = (size_t)H5Lget_name_by_idx((hid_t)*loc_id, c_group_name, (H5_index_t)*index_field, + if((*size = (size_t_f)H5Lget_name_by_idx((hid_t)*loc_id, c_group_name, (H5_index_t)*index_field, (H5_iter_order_t)*order, (hsize_t)*n,c_name, c_size, (hid_t)*lapl_id)) < 0) HGOTO_DONE(FAIL) diff --git a/fortran/src/H5Lff.f90 b/fortran/src/H5Lff.f90 index 8043d74..4660e52 100644 --- a/fortran/src/H5Lff.f90 +++ b/fortran/src/H5Lff.f90 @@ -27,7 +27,7 @@ ! NOTES ! *** IMPORTANT *** ! If you add a new H5L function you must add the function name to the -! Windows dll file 'hdf5_fortrandll.def' in the fortran/src directory. +! Windows dll file 'hdf5_fortrandll.def.in' in the fortran/src directory. ! This is needed for Windows based operating systems. ! !***** diff --git a/fortran/src/H5Lff_F03.f90 b/fortran/src/H5Lff_F03.f90 index e2c54a7..83f80ac 100644 --- a/fortran/src/H5Lff_F03.f90 +++ b/fortran/src/H5Lff_F03.f90 @@ -32,7 +32,7 @@ ! NOTES ! *** IMPORTANT *** ! If you add a new H5A function you must add the function name to the -! Windows dll file 'hdf5_fortrandll.def' in the fortran/src directory. +! Windows dll file 'hdf5_fortrandll.def.in' in the fortran/src directory. ! This is needed for Windows based operating systems. ! !***** diff --git a/fortran/src/H5Lff_F90.f90 b/fortran/src/H5Lff_F90.f90 index c802af7..dd62b7b 100644 --- a/fortran/src/H5Lff_F90.f90 +++ b/fortran/src/H5Lff_F90.f90 @@ -30,7 +30,7 @@ ! ! *** IMPORTANT *** ! If you add a new H5D function you must add the function name to the -! Windows dll file 'hdf5_fortrandll.def' in the fortran/src directory. +! Windows dll file 'hdf5_fortrandll.def.in' in the fortran/src directory. ! This is needed for Windows based operating systems. !***** diff --git a/fortran/src/H5Off.f90 b/fortran/src/H5Off.f90 index ce8c55c..1437e9f 100644 --- a/fortran/src/H5Off.f90 +++ b/fortran/src/H5Off.f90 @@ -31,7 +31,7 @@ ! NOTES ! *** IMPORTANT *** ! If you add a new H5O function you must add the function name to the -! Windows dll file 'hdf5_fortrandll.def' in the fortran/src directory. +! Windows dll file 'hdf5_fortrandll.def.in' in the fortran/src directory. ! This is needed for Windows based operating systems. ! !***** diff --git a/fortran/src/H5Off_F03.f90 b/fortran/src/H5Off_F03.f90 index f4ddd3e..0cf4d46 100644 --- a/fortran/src/H5Off_F03.f90 +++ b/fortran/src/H5Off_F03.f90 @@ -28,7 +28,7 @@ ! NOTES ! *** IMPORTANT *** ! If you add a new H5P function you must add the function name to the -! Windows dll file 'hdf5_fortrandll.def' in the fortran/src directory. +! Windows dll file 'hdf5_fortrandll.def.in' in the fortran/src directory. ! This is needed for Windows based operating systems. ! !***** diff --git a/fortran/src/H5Off_F90.f90 b/fortran/src/H5Off_F90.f90 index 53553d6..5688c5d 100644 --- a/fortran/src/H5Off_F90.f90 +++ b/fortran/src/H5Off_F90.f90 @@ -30,7 +30,7 @@ ! ! *** IMPORTANT *** ! If you add a new H5D function you must add the function name to the -! Windows dll file 'hdf5_fortrandll.def' in the fortran/src directory. +! Windows dll file 'hdf5_fortrandll.def.in' in the fortran/src directory. ! This is needed for Windows based operating systems. !***** diff --git a/fortran/src/H5Pf.c b/fortran/src/H5Pf.c index 6fc8487..dba2aa4 100644 --- a/fortran/src/H5Pf.c +++ b/fortran/src/H5Pf.c @@ -1937,28 +1937,29 @@ DONE: /****if* H5Pf/h5pset_external_c * NAME - * h5pset_external_c + * h5pset_external_c * PURPOSE - * Call H5Pset_external to add an external file to the - * list of external files. + * Call H5Pset_external to add an external file to the + * list of external files. * INPUTS - * prp_id - property list identifier - * name - Name of an external file - * namelen - length of name - * offset - Offset, in bytes, from the beginning of the file - * to the location in the file where the data starts. - * bytes - Number of bytes reserved in the file for the data. + * prp_id - property list identifier + * name - Name of an external file + * namelen - length of name + * offset - Offset, in bytes, from the beginning of the file + * to the location in the file where the data starts. + * bytes - Number of bytes reserved in the file for the data. * RETURNS - * 0 on success, -1 on failure + * 0 on success, -1 on failure * AUTHOR * Xiangyang Su - * Wednesday, February 23, 2000 + * Wednesday, February 23, 2000 * HISTORY - * + * Changed type of 'offset' from int_f to off_t_f -- MSB January 9, 2012 + * * SOURCE */ int_f -nh5pset_external_c (hid_t_f *prp_id, _fcd name, int_f* namelen, int_f* offset, hsize_t_f*bytes) +nh5pset_external_c (hid_t_f *prp_id, _fcd name, int_f* namelen, off_t_f* offset, hsize_t_f*bytes) /******/ { int ret_value = -1; @@ -2029,14 +2030,14 @@ nh5pget_external_count_c (hid_t_f *prp_id, int_f* count) /****if* H5Pf/h5pget_external_c * NAME - * h5pget_external_c + * h5pget_external_c * PURPOSE - * Call H5Pget_external to get nformation about an external file. + * Call H5Pget_external to get nformation about an external file. * INPUTS * prp_id - property list identifier * name_size - length of name * idx - External file index. - *OUTPUT + * OUTPUT * name - Name of an external file * offset - Offset, in bytes, from the beginning of the file * to the location in the file where the data starts. @@ -2047,11 +2048,12 @@ nh5pget_external_count_c (hid_t_f *prp_id, int_f* count) * Xiangyang Su * Wednesday, February 23, 2000 * HISTORY + * Changed type of 'offset' from integer to off_t -- MSB January 9, 2012 * * SOURCE */ int_f -nh5pget_external_c(hid_t_f *prp_id, int_f *idx, size_t_f* name_size, _fcd name, int_f* offset, hsize_t_f*bytes) +nh5pget_external_c(hid_t_f *prp_id, int_f *idx, size_t_f* name_size, _fcd name, off_t_f* offset, hsize_t_f*bytes) /******/ { int ret_value = -1; @@ -2079,7 +2081,7 @@ nh5pget_external_c(hid_t_f *prp_id, int_f *idx, size_t_f* name_size, _fcd name, if (status < 0) goto DONE; - *offset = (int_f)c_offset; + *offset = (off_t_f)c_offset; *bytes = (hsize_t_f)size; /* Note: if the size of the fortran buffer is larger then the returned string * from the function then we need to give HD5packFstring the fortran buffer size so diff --git a/fortran/src/H5Pff.f90 b/fortran/src/H5Pff.f90 index 4254b7f..a3c9a60 100644 --- a/fortran/src/H5Pff.f90 +++ b/fortran/src/H5Pff.f90 @@ -27,7 +27,7 @@ ! NOTES ! *** IMPORTANT *** ! If you add a new H5P function you must add the function name to the -! Windows dll file 'hdf5_fortrandll.def' in the fortran/src directory. +! Windows dll file 'hdf5_fortrandll.def.in' in the fortran/src directory. ! This is needed for Windows based operating systems. !***** @@ -2329,14 +2329,16 @@ CONTAINS ! HISTORY ! Explicit Fortran interfaces were added for ! called C functions (it is needed for Windows -! port). March 14, 2001 +! port). March 14, 2001 +! +! Changed type of 'offset' from integer to off_t -- MSB January 9, 2012 ! ! Fortran90 Interface: - SUBROUTINE h5pset_external_f(prp_id, name, offset,bytes, hdferr) + SUBROUTINE h5pset_external_f(prp_id, name, offset, bytes, hdferr) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier CHARACTER(LEN=*), INTENT(IN) :: name ! Name of an external file - INTEGER, INTENT(IN) :: offset ! Offset, in bytes, from the beginning + INTEGER(OFF_T), INTENT(IN) :: offset ! Offset, in bytes, from the beginning ! of the file to the location in the file ! where the data starts. INTEGER(HSIZE_T), INTENT(IN) :: bytes ! Number of bytes reserved in the @@ -2347,9 +2349,6 @@ CONTAINS INTEGER :: namelen -! INTEGER, EXTERNAL :: h5pset_external_c -! MS FORTRAN needs explicit interface for C functions called here. -! INTERFACE INTEGER FUNCTION h5pset_external_c(prp_id, name,namelen, offset, bytes) USE H5GLOBAL @@ -2360,7 +2359,7 @@ CONTAINS INTEGER(HID_T), INTENT(IN) :: prp_id CHARACTER(LEN=*), INTENT(IN) :: name INTEGER :: namelen - INTEGER, INTENT(IN) :: offset + INTEGER(OFF_T), INTENT(IN) :: offset INTEGER(HSIZE_T), INTENT(IN) :: bytes END FUNCTION h5pset_external_c END INTERFACE @@ -2453,7 +2452,9 @@ CONTAINS ! HISTORY ! Explicit Fortran interfaces were added for ! called C functions (it is needed for Windows -! port). March 14, 2001 +! port). March 14, 2001 +! +! Changed type of 'offset' from integer to off_t -- MSB January 9, 2012 ! ! Fortran90 Interface: SUBROUTINE h5pget_external_f(prp_id, idx, name_size, name, offset,bytes, hdferr) @@ -2462,7 +2463,7 @@ CONTAINS INTEGER, INTENT(IN) :: idx ! External file index. INTEGER(SIZE_T), INTENT(IN) :: name_size ! Maximum length of name array CHARACTER(LEN=*), INTENT(OUT) :: name ! Name of an external file - INTEGER, INTENT(OUT) :: offset ! Offset, in bytes, from the beginning + INTEGER(OFF_T), INTENT(OUT) :: offset ! Offset, in bytes, from the beginning ! of the file to the location in the file ! where the data starts. INTEGER(HSIZE_T), INTENT(OUT) :: bytes ! Number of bytes reserved in the @@ -2485,7 +2486,7 @@ CONTAINS INTEGER, INTENT(IN) :: idx INTEGER(SIZE_T), INTENT(IN) :: name_size CHARACTER(LEN=*), INTENT(OUT) :: name - INTEGER, INTENT(OUT) :: offset + INTEGER(OFF_T), INTENT(OUT) :: offset INTEGER(HSIZE_T), INTENT(OUT) :: bytes END FUNCTION h5pget_external_c END INTERFACE diff --git a/fortran/src/H5Pff_F03.f90 b/fortran/src/H5Pff_F03.f90 index b601e69..7fb6ff9 100644 --- a/fortran/src/H5Pff_F03.f90 +++ b/fortran/src/H5Pff_F03.f90 @@ -28,7 +28,7 @@ ! NOTES ! *** IMPORTANT *** ! If you add a new H5P function you must add the function name to the -! Windows dll file 'hdf5_fortrandll.def' in the fortran/src directory. +! Windows dll file 'hdf5_fortrandll.def.in' in the fortran/src directory. ! This is needed for Windows based operating systems. ! !***** diff --git a/fortran/src/H5Pff_F90.f90 b/fortran/src/H5Pff_F90.f90 index ebdd185..5b75643 100644 --- a/fortran/src/H5Pff_F90.f90 +++ b/fortran/src/H5Pff_F90.f90 @@ -29,7 +29,7 @@ ! NOTES ! *** IMPORTANT *** ! If you add a new H5P function you must add the function name to the -! Windows dll file '*hdf5_fortrandll.def' in the fortran/src directory. +! Windows dll file 'hdf5_fortrandll.def.in' in the fortran/src directory. ! This is needed for Windows based operating systems. !***** diff --git a/fortran/src/H5Rff.f90 b/fortran/src/H5Rff.f90 index 89ffc10..64f1365 100644 --- a/fortran/src/H5Rff.f90 +++ b/fortran/src/H5Rff.f90 @@ -31,7 +31,7 @@ ! NOTES ! *** IMPORTANT *** ! If you add a new H5R function you must add the function name to the -! Windows dll file 'hdf5_fortrandll.def' in the fortran/src directory. +! Windows dll file 'hdf5_fortrandll.def.in' in the fortran/src directory. ! This is needed for Windows based operating systems. ! !***** diff --git a/fortran/src/H5Rff_F03.f90 b/fortran/src/H5Rff_F03.f90 index 88ec8cf..dd36699 100644 --- a/fortran/src/H5Rff_F03.f90 +++ b/fortran/src/H5Rff_F03.f90 @@ -31,7 +31,7 @@ ! NOTES ! *** IMPORTANT *** ! If you add a new H5R function you must add the function name to the -! Windows dll file 'hdf5_fortrandll.def' in the fortran/src directory. +! Windows dll file 'hdf5_fortrandll.def.in' in the fortran/src directory. ! This is needed for Windows based operating systems. ! !***** diff --git a/fortran/src/H5Rff_F90.f90 b/fortran/src/H5Rff_F90.f90 index 0190e57..ab074b9 100644 --- a/fortran/src/H5Rff_F90.f90 +++ b/fortran/src/H5Rff_F90.f90 @@ -31,7 +31,7 @@ ! NOTES ! *** IMPORTANT *** ! If you add a new H5R function you must add the function name to the -! Windows dll file 'hdf5_fortrandll.def' in the fortran/src directory. +! Windows dll file 'hdf5_fortrandll.def.in' in the fortran/src directory. ! This is needed for Windows based operating systems. !***** diff --git a/fortran/src/H5Sff.f90 b/fortran/src/H5Sff.f90 index 9ef8ca8..1bae584 100644 --- a/fortran/src/H5Sff.f90 +++ b/fortran/src/H5Sff.f90 @@ -31,7 +31,7 @@ ! NOTES ! *** IMPORTANT *** ! If you add a new H5S function you must add the function name to the -! Windows dll file 'hdf5_fortrandll.def' in the fortran/src directory. +! Windows dll file 'hdf5_fortrandll.def.in' in the fortran/src directory. ! This is needed for Windows based operating systems. ! !***** diff --git a/fortran/src/H5Tff.f90 b/fortran/src/H5Tff.f90 index fd857a8..89bd972 100644 --- a/fortran/src/H5Tff.f90 +++ b/fortran/src/H5Tff.f90 @@ -28,7 +28,7 @@ ! NOTES ! *** IMPORTANT *** ! If you add a new H5T function you must add the function name to the -! Windows dll file 'hdf5_fortrandll.def' in the fortran/src directory. +! Windows dll file 'hdf5_fortrandll.def.in' in the fortran/src directory. ! This is needed for Windows based operating systems. ! !***** diff --git a/fortran/src/H5Tff_F03.f90 b/fortran/src/H5Tff_F03.f90 index 902e2ac..d16553a 100644 --- a/fortran/src/H5Tff_F03.f90 +++ b/fortran/src/H5Tff_F03.f90 @@ -28,7 +28,7 @@ ! NOTES ! *** IMPORTANT *** ! If you add a new H5T function you must add the function name to the -! Windows dll file 'hdf5_fortrandll.def' in the fortran/src directory. +! Windows dll file 'hdf5_fortrandll.def.in' in the fortran/src directory. ! This is needed for Windows based operating systems. ! !***** diff --git a/fortran/src/H5Tff_F90.f90 b/fortran/src/H5Tff_F90.f90 index 021773d..a95b31f 100644 --- a/fortran/src/H5Tff_F90.f90 +++ b/fortran/src/H5Tff_F90.f90 @@ -30,7 +30,7 @@ ! ! *** IMPORTANT *** ! If you add a new H5D function you must add the function name to the -! Windows dll file 'hdf5_fortrandll.def' in the fortran/src directory. +! Windows dll file 'hdf5_fortrandll.def.in' in the fortran/src directory. ! This is needed for Windows based operating systems. !***** diff --git a/fortran/src/H5Zff.f90 b/fortran/src/H5Zff.f90 index ec68286..7b67b5b 100644 --- a/fortran/src/H5Zff.f90 +++ b/fortran/src/H5Zff.f90 @@ -28,7 +28,7 @@ ! NOTES ! *** IMPORTANT *** ! If you add a new H5Z function you must add the function name to the -! Windows dll file 'hdf5_fortrandll.def' in the fortran/src directory. +! Windows dll file 'hdf5_fortrandll.def.in' in the fortran/src directory. ! This is needed for Windows based operating systems. ! !***** diff --git a/fortran/src/H5_ff.f90 b/fortran/src/H5_ff.f90 index c51b039..f9c20ac 100644 --- a/fortran/src/H5_ff.f90 +++ b/fortran/src/H5_ff.f90 @@ -30,7 +30,7 @@ ! NOTES ! *** IMPORTANT *** ! If you add a new function you must add the function name to the -! Windows dll file 'hdf5_fortrandll.def' in the fortran/src directory. +! Windows dll file 'hdf5_fortrandll.def.in' in the fortran/src directory. ! This is needed for Windows based operating systems. ! !***** diff --git a/fortran/src/H5_ff_F03.f90 b/fortran/src/H5_ff_F03.f90 index f3e7098..d418ed5 100644 --- a/fortran/src/H5_ff_F03.f90 +++ b/fortran/src/H5_ff_F03.f90 @@ -27,7 +27,7 @@ ! NOTES ! *** IMPORTANT *** ! If you add a new function you must add the function name to the -! Windows dll file 'hdf5_fortrandll.def' in the fortran/src directory. +! Windows dll file 'hdf5_fortrandll.def.in' in the fortran/src directory. ! This is needed for Windows based operating systems. !***** diff --git a/fortran/src/H5f90proto.h b/fortran/src/H5f90proto.h index 9340c2a..4b02b6c 100644 --- a/fortran/src/H5f90proto.h +++ b/fortran/src/H5f90proto.h @@ -93,6 +93,7 @@ typedef struct H5O_info_t_f { #define nh5fget_obj_count_c H5_FC_FUNC_(h5fget_obj_count_c, H5FGET_OBJ_COUNT_C) #define nh5fget_obj_ids_c H5_FC_FUNC_(h5fget_obj_ids_c, H5FGET_OBJ_IDS_C) #define nh5fget_freespace_c H5_FC_FUNC_(h5fget_freespace_c, H5FGET_FREESPACE_C) +#define nh5fget_file_image_c H5_FC_FUNC_(h5fget_file_image_c, H5FGET_FILE_IMAGE_C) #define nh5fget_name_c H5_FC_FUNC_(h5fget_name_c, H5FGET_NAME_C) #define nh5fget_filesize_c H5_FC_FUNC_(h5fget_filesize_c, H5FGET_FILESIZE_C) @@ -108,6 +109,7 @@ H5_FCDLL int_f nh5fget_access_plist_c (hid_t_f *file_id, hid_t_f *access_id); H5_FCDLL int_f nh5fget_obj_count_c (hid_t_f *file_id, int_f *obj_type, size_t_f *obj_count); H5_FCDLL int_f nh5fget_obj_ids_c (hid_t_f *file_id, int_f *obj_type, size_t_f *max_objs, hid_t_f *obj_ids, size_t_f *num_objs); H5_FCDLL int_f nh5fget_freespace_c (hid_t_f *file_id, hssize_t_f *free_space); +H5_FCDLL int_f nh5fget_file_image_c(hid_t_f *file_id, void *buf_ptr, size_t_f *buf_len, size_t_f *buf_req); H5_FCDLL int_f nh5fflush_c (hid_t_f *obj_id, int_f *scope); H5_FCDLL int_f nh5fget_name_c(hid_t_f *obj_id, size_t_f *size, _fcd buf, size_t_f *buflen); H5_FCDLL int_f nh5fget_filesize_c(hid_t_f *file_id, hsize_t_f *size); @@ -1063,9 +1065,9 @@ H5_FCDLL int_f nh5pmodify_filter_c (hid_t_f *prp_id, int_f* filter, int_f* flags H5_FCDLL int_f nh5pget_nfilters_c (hid_t_f *prp_id, int_f* nfilters); H5_FCDLL int_f nh5pget_filter_c(hid_t_f *prp_id, int_f* filter_number, int_f* flags, size_t_f* cd_nelmts, int_f* cd_values, size_t_f *namelen, _fcd name, int_f* filter_id); H5_FCDLL int_f nh5pget_filter_by_id_c(hid_t_f *prp_id, int_f* filter_id, int_f* flags, size_t_f* cd_nelmts, int_f* cd_values, size_t_f *namelen, _fcd name); -H5_FCDLL int_f nh5pset_external_c (hid_t_f *prp_id, _fcd name, int_f* namelen, int_f* offset, hsize_t_f*bytes); +H5_FCDLL int_f nh5pset_external_c (hid_t_f *prp_id, _fcd name, int_f* namelen, off_t_f* offset, hsize_t_f*bytes); H5_FCDLL int_f nh5pget_external_count_c (hid_t_f *prp_id, int_f* count); -H5_FCDLL int_f nh5pget_external_c(hid_t_f *prp_id, int_f *idx, size_t_f* name_size, _fcd name, int_f* offset, hsize_t_f*bytes); +H5_FCDLL int_f nh5pget_external_c(hid_t_f *prp_id, int_f *idx, size_t_f* name_size, _fcd name, off_t_f* offset, hsize_t_f*bytes); H5_FCDLL int_f nh5pget_btree_ratios_c(hid_t_f *prp_id, real_f* left, real_f* middle, real_f* right); H5_FCDLL int_f nh5pset_btree_ratios_c(hid_t_f *prp_id, real_f* left, real_f* middle, real_f* right); H5_FCDLL int_f nh5pget_fapl_mpio_c(hid_t_f *prp_id, int_f* comm, int_f* info); diff --git a/fortran/src/H5match_types.c b/fortran/src/H5match_types.c index 4c83d21..eb30775 100644 --- a/fortran/src/H5match_types.c +++ b/fortran/src/H5match_types.c @@ -321,6 +321,19 @@ int main(void) return -1; #endif + /* off_t */ +#if defined H5_FORTRAN_HAS_INTEGER_8_KIND && H5_SIZEOF_OFF_T >= 8 + writeToFiles("OFF_T", "off_t_f", 8, H5_FORTRAN_HAS_INTEGER_8_KIND); +#elif defined H5_FORTRAN_HAS_INTEGER_4_KIND && H5_SIZEOF_OFF_T >= 4 + writeToFiles("OFF_T", "off_t_f", 4, H5_FORTRAN_HAS_INTEGER_4_KIND); +#elif defined H5_FORTRAN_HAS_INTEGER_2_KIND && H5_SIZEOF_OFF_T >= 2 + writeToFiles("OFF_T", "off_t_f", 2, H5_FORTRAN_HAS_INTEGER_2_KIND); +#elif defined H5_FORTRAN_HAS_INTEGER_1_KIND && H5_SIZEOF_OFF_T >= 1 + writeToFiles("OFF_T", "off_t_f", 1, H5_FORTRAN_HAS_INTEGER_1_KIND); +#else + /* Error: couldn't find a size for off_t */ + return -1; +#endif /* size_t */ #if defined H5_FORTRAN_HAS_INTEGER_8_KIND && H5_SIZEOF_SIZE_T >= 8 diff --git a/fortran/src/HDF5.f90 b/fortran/src/HDF5.f90 index cb3d8bf..75af333 100644 --- a/fortran/src/HDF5.f90 +++ b/fortran/src/HDF5.f90 @@ -30,6 +30,7 @@ MODULE HDF5 USE H5GLOBAL USE H5F + USE H5F_PROVISIONAL USE H5G USE H5E USE H5E_PROVISIONAL diff --git a/fortran/src/Makefile.am b/fortran/src/Makefile.am index e6ef610..12c38e2 100644 --- a/fortran/src/Makefile.am +++ b/fortran/src/Makefile.am @@ -76,7 +76,7 @@ libhdf5_fortran_la_SOURCES=H5f90global.f90 \ H5_DBLE_Interface$(F_DBLE).f90 \ H5f90kit.c H5_f.c H5Af.c H5Df.c H5Ef.c H5Ff.c H5Gf.c \ H5If.c H5Lf.c H5Of.c H5Pf.c H5Rf.c H5Sf.c H5Tf.c H5Zf.c \ - H5Aff$(F_STATUS).f90 H5Dff$(F_STATUS).f90 H5Eff$(F_STATUS).f90 H5Lff$(F_STATUS).f90 \ + H5Aff$(F_STATUS).f90 H5Dff$(F_STATUS).f90 H5Eff$(F_STATUS).f90 H5Fff$(F_STATUS).f90 H5Lff$(F_STATUS).f90 \ H5Off$(F_STATUS).f90 H5Pff$(F_STATUS).f90 H5Rff$(F_STATUS).f90 H5Tff$(F_STATUS).f90 $(PARALLEL_COND_SRC) # HDF5 Fortran library depends on HDF5 Library. @@ -201,6 +201,7 @@ H5Dff.lo: $(srcdir)/H5Dff.f90 H5f90global.lo H5Aff$(F_STATUS).lo: $(srcdir)/H5Aff$(F_STATUS).f90 H5f90global.lo H5Dff$(F_STATUS).lo: $(srcdir)/H5Dff$(F_STATUS).f90 H5f90global.lo H5Eff$(F_STATUS).lo: $(srcdir)/H5Eff$(F_STATUS).f90 H5f90global.lo +H5Fff$(F_STATUS).lo: $(srcdir)/H5Fff$(F_STATUS).f90 H5f90global.lo H5Lff$(F_STATUS).lo: $(srcdir)/H5Lff$(F_STATUS).f90 H5f90global.lo H5Off$(F_STATUS).lo: $(srcdir)/H5Off$(F_STATUS).f90 H5f90global.lo H5Pff$(F_STATUS).lo: $(srcdir)/H5Pff$(F_STATUS).f90 H5f90global.lo @@ -217,11 +218,11 @@ H5Rff.lo: $(srcdir)/H5Rff.f90 H5f90global.lo H5Sff.lo: $(srcdir)/H5Sff.f90 H5f90global.lo H5Tff.lo: $(srcdir)/H5Tff.f90 H5f90global.lo H5Zff.lo: $(srcdir)/H5Zff.f90 H5f90global.lo -H5_DBLE_Interface$(F_DBLE).lo: $(srcdir)/H5_DBLE_Interface$(F_DBLE).f90 H5Aff$(F_STATUS).lo H5Dff$(F_STATUS).lo H5Eff$(F_STATUS).lo H5Pff$(F_STATUS).lo +H5_DBLE_Interface$(F_DBLE).lo: $(srcdir)/H5_DBLE_Interface$(F_DBLE).f90 H5Aff$(F_STATUS).lo H5Dff$(F_STATUS).lo H5Fff$(F_STATUS).lo H5Eff$(F_STATUS).lo H5Pff$(F_STATUS).lo HDF5.lo: $(srcdir)/HDF5.f90 H5f90global.lo H5_ff$(F_STATUS).lo H5_ff.lo H5Aff.lo H5Aff$(F_STATUS).lo \ H5Dff.lo H5Dff$(F_STATUS).lo \ H5Eff.lo H5Eff$(F_STATUS).lo \ - H5Fff.lo H5Gff.lo H5Iff.lo H5Lff.lo H5Lff$(F_STATUS).lo \ + H5Fff.lo H5Fff$(F_STATUS).lo H5Gff.lo H5Iff.lo H5Lff.lo H5Lff$(F_STATUS).lo \ H5Off.lo H5Off$(F_STATUS).lo H5Pff.lo H5Pff$(F_STATUS).lo H5Rff$(F_STATUS).lo H5Rff.lo \ H5Sff.lo H5Tff.lo H5Tff$(F_STATUS).lo H5Zff.lo \ H5_DBLE_Interface$(F_DBLE).lo @@ -230,7 +231,7 @@ HDF5mpio.lo: $(srcdir)/H5FDmpioff.f90 H5f90global.lo H5_ff$(F_STATUS).lo H5Aff.lo H5Aff$(F_STATUS).lo \ H5Dff.lo H5Dff$(F_STATUS).lo \ H5Eff.lo H5Eff$(F_STATUS).lo \ - H5Fff.lo H5Gff.lo H5Iff.lo H5Lff.lo H5Lff$(F_STATUS).lo \ + H5Fff.lo H5Fff$(F_STATUS).lo H5Gff.lo H5Iff.lo H5Lff.lo H5Lff$(F_STATUS).lo \ H5Off.lo H5Off$(F_STATUS).lo H5Pff.lo H5Pff$(F_STATUS).lo H5Rff$(F_STATUS).lo H5Rff.lo \ H5Sff.lo H5Tff.lo H5Tff$(F_STATUS).lo H5Zff.lo \ H5_DBLE_Interface$(F_DBLE).lo H5FDmpioff.lo diff --git a/fortran/src/Makefile.in b/fortran/src/Makefile.in index 6a816b0..c41653f 100644 --- a/fortran/src/Makefile.in +++ b/fortran/src/Makefile.in @@ -128,9 +128,10 @@ am__libhdf5_fortran_la_SOURCES_DIST = H5f90global.f90 \ H5_DBLE_Interface$(F_DBLE).f90 H5f90kit.c H5_f.c H5Af.c H5Df.c \ H5Ef.c H5Ff.c H5Gf.c H5If.c H5Lf.c H5Of.c H5Pf.c H5Rf.c H5Sf.c \ H5Tf.c H5Zf.c H5Aff$(F_STATUS).f90 H5Dff$(F_STATUS).f90 \ - H5Eff$(F_STATUS).f90 H5Lff$(F_STATUS).f90 H5Off$(F_STATUS).f90 \ - H5Pff$(F_STATUS).f90 H5Rff$(F_STATUS).f90 H5Tff$(F_STATUS).f90 \ - HDF5.f90 H5FDmpiof.c HDF5mpio.f90 H5FDmpioff.f90 + H5Eff$(F_STATUS).f90 H5Fff$(F_STATUS).f90 H5Lff$(F_STATUS).f90 \ + H5Off$(F_STATUS).f90 H5Pff$(F_STATUS).f90 H5Rff$(F_STATUS).f90 \ + H5Tff$(F_STATUS).f90 HDF5.f90 H5FDmpiof.c HDF5mpio.f90 \ + H5FDmpioff.f90 @BUILD_PARALLEL_CONDITIONAL_FALSE@am__objects_1 = HDF5.lo @BUILD_PARALLEL_CONDITIONAL_TRUE@am__objects_1 = H5FDmpiof.lo \ @BUILD_PARALLEL_CONDITIONAL_TRUE@ HDF5mpio.lo H5FDmpioff.lo @@ -141,9 +142,9 @@ am_libhdf5_fortran_la_OBJECTS = H5f90global.lo H5fortran_types.lo \ H5f90kit.lo H5_f.lo H5Af.lo H5Df.lo H5Ef.lo H5Ff.lo H5Gf.lo \ H5If.lo H5Lf.lo H5Of.lo H5Pf.lo H5Rf.lo H5Sf.lo H5Tf.lo \ H5Zf.lo H5Aff$(F_STATUS).lo H5Dff$(F_STATUS).lo \ - H5Eff$(F_STATUS).lo H5Lff$(F_STATUS).lo H5Off$(F_STATUS).lo \ - H5Pff$(F_STATUS).lo H5Rff$(F_STATUS).lo H5Tff$(F_STATUS).lo \ - $(am__objects_1) + H5Eff$(F_STATUS).lo H5Fff$(F_STATUS).lo H5Lff$(F_STATUS).lo \ + H5Off$(F_STATUS).lo H5Pff$(F_STATUS).lo H5Rff$(F_STATUS).lo \ + H5Tff$(F_STATUS).lo $(am__objects_1) libhdf5_fortran_la_OBJECTS = $(am_libhdf5_fortran_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) @@ -319,6 +320,7 @@ H5_VERSION = @H5_VERSION@ HADDR_T = @HADDR_T@ HAVE_DMALLOC = @HAVE_DMALLOC@ HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@ +HAVE_PTHREAD = @HAVE_PTHREAD@ HDF5_HL = @HDF5_HL@ HDF5_INTERFACES = @HDF5_INTERFACES@ HDF_CXX = @HDF_CXX@ @@ -370,7 +372,6 @@ PACKAGE_VERSION = @PACKAGE_VERSION@ PARALLEL = @PARALLEL@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ -PTHREAD = @PTHREAD@ RANLIB = @RANLIB@ ROOT = @ROOT@ RUNPARALLEL = @RUNPARALLEL@ @@ -517,7 +518,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 134 +LT_VERS_REVISION = 138 LT_VERS_AGE = 0 # Include src directory in both Fortran and C flags (C compiler is used @@ -556,7 +557,7 @@ libhdf5_fortran_la_SOURCES = H5f90global.f90 \ H5_DBLE_Interface$(F_DBLE).f90 \ H5f90kit.c H5_f.c H5Af.c H5Df.c H5Ef.c H5Ff.c H5Gf.c \ H5If.c H5Lf.c H5Of.c H5Pf.c H5Rf.c H5Sf.c H5Tf.c H5Zf.c \ - H5Aff$(F_STATUS).f90 H5Dff$(F_STATUS).f90 H5Eff$(F_STATUS).f90 H5Lff$(F_STATUS).f90 \ + H5Aff$(F_STATUS).f90 H5Dff$(F_STATUS).f90 H5Eff$(F_STATUS).f90 H5Fff$(F_STATUS).f90 H5Lff$(F_STATUS).f90 \ H5Off$(F_STATUS).f90 H5Pff$(F_STATUS).f90 H5Rff$(F_STATUS).f90 H5Tff$(F_STATUS).f90 $(PARALLEL_COND_SRC) @@ -1101,6 +1102,7 @@ H5Dff.lo: $(srcdir)/H5Dff.f90 H5f90global.lo H5Aff$(F_STATUS).lo: $(srcdir)/H5Aff$(F_STATUS).f90 H5f90global.lo H5Dff$(F_STATUS).lo: $(srcdir)/H5Dff$(F_STATUS).f90 H5f90global.lo H5Eff$(F_STATUS).lo: $(srcdir)/H5Eff$(F_STATUS).f90 H5f90global.lo +H5Fff$(F_STATUS).lo: $(srcdir)/H5Fff$(F_STATUS).f90 H5f90global.lo H5Lff$(F_STATUS).lo: $(srcdir)/H5Lff$(F_STATUS).f90 H5f90global.lo H5Off$(F_STATUS).lo: $(srcdir)/H5Off$(F_STATUS).f90 H5f90global.lo H5Pff$(F_STATUS).lo: $(srcdir)/H5Pff$(F_STATUS).f90 H5f90global.lo @@ -1117,11 +1119,11 @@ H5Rff.lo: $(srcdir)/H5Rff.f90 H5f90global.lo H5Sff.lo: $(srcdir)/H5Sff.f90 H5f90global.lo H5Tff.lo: $(srcdir)/H5Tff.f90 H5f90global.lo H5Zff.lo: $(srcdir)/H5Zff.f90 H5f90global.lo -H5_DBLE_Interface$(F_DBLE).lo: $(srcdir)/H5_DBLE_Interface$(F_DBLE).f90 H5Aff$(F_STATUS).lo H5Dff$(F_STATUS).lo H5Eff$(F_STATUS).lo H5Pff$(F_STATUS).lo +H5_DBLE_Interface$(F_DBLE).lo: $(srcdir)/H5_DBLE_Interface$(F_DBLE).f90 H5Aff$(F_STATUS).lo H5Dff$(F_STATUS).lo H5Fff$(F_STATUS).lo H5Eff$(F_STATUS).lo H5Pff$(F_STATUS).lo HDF5.lo: $(srcdir)/HDF5.f90 H5f90global.lo H5_ff$(F_STATUS).lo H5_ff.lo H5Aff.lo H5Aff$(F_STATUS).lo \ H5Dff.lo H5Dff$(F_STATUS).lo \ H5Eff.lo H5Eff$(F_STATUS).lo \ - H5Fff.lo H5Gff.lo H5Iff.lo H5Lff.lo H5Lff$(F_STATUS).lo \ + H5Fff.lo H5Fff$(F_STATUS).lo H5Gff.lo H5Iff.lo H5Lff.lo H5Lff$(F_STATUS).lo \ H5Off.lo H5Off$(F_STATUS).lo H5Pff.lo H5Pff$(F_STATUS).lo H5Rff$(F_STATUS).lo H5Rff.lo \ H5Sff.lo H5Tff.lo H5Tff$(F_STATUS).lo H5Zff.lo \ H5_DBLE_Interface$(F_DBLE).lo @@ -1130,7 +1132,7 @@ HDF5mpio.lo: $(srcdir)/H5FDmpioff.f90 H5f90global.lo H5_ff$(F_STATUS).lo H5Aff.lo H5Aff$(F_STATUS).lo \ H5Dff.lo H5Dff$(F_STATUS).lo \ H5Eff.lo H5Eff$(F_STATUS).lo \ - H5Fff.lo H5Gff.lo H5Iff.lo H5Lff.lo H5Lff$(F_STATUS).lo \ + H5Fff.lo H5Fff$(F_STATUS).lo H5Gff.lo H5Iff.lo H5Lff.lo H5Lff$(F_STATUS).lo \ H5Off.lo H5Off$(F_STATUS).lo H5Pff.lo H5Pff$(F_STATUS).lo H5Rff$(F_STATUS).lo H5Rff.lo \ H5Sff.lo H5Tff.lo H5Tff$(F_STATUS).lo H5Zff.lo \ H5_DBLE_Interface$(F_DBLE).lo H5FDmpioff.lo diff --git a/fortran/src/hdf5_fortrandll.def.in b/fortran/src/hdf5_fortrandll.def.in index bf7596d..4ce185b 100644 --- a/fortran/src/hdf5_fortrandll.def.in +++ b/fortran/src/hdf5_fortrandll.def.in @@ -228,6 +228,7 @@ H5F_mp_H5FGET_ACCESS_PLIST_F H5F_mp_H5FIS_HDF5_F H5F_mp_H5FGET_NAME_F H5F_mp_H5FGET_FILESIZE_F +@H5_NOF03EXP@H5F_PROVISIONAL_mp_H5FGET_FILE_IMAGE_F ; H5G H5G_mp_H5GOPEN_F H5G_mp_H5GCREATE_F diff --git a/fortran/test/CMakeLists.txt b/fortran/test/CMakeLists.txt index 5b41a32..5b9ca11 100644 --- a/fortran/test/CMakeLists.txt +++ b/fortran/test/CMakeLists.txt @@ -105,6 +105,7 @@ IF (HDF5_ENABLE_F2003) fortranlib_test_F03.f90 tH5F.f90 tH5E_F03.f90 + tH5F_F03.f90 tH5L_F03.f90 tH5O_F03.f90 tH5P_F03.f90 diff --git a/fortran/test/Makefile.am b/fortran/test/Makefile.am index 42dd127..84f55e5 100644 --- a/fortran/test/Makefile.am +++ b/fortran/test/Makefile.am @@ -68,7 +68,7 @@ fortranlib_test_1_8_SOURCES = fortranlib_test_1_8.f90 \ if FORTRAN_2003_CONDITIONAL_F fortranlib_test_F03_SOURCES = fortranlib_test_F03.f90 \ - tH5F.f90 tH5E_F03.f90 tH5L_F03.f90 tH5O_F03.f90 tH5P_F03.f90 tH5T_F03.f90 + tH5F.f90 tH5E_F03.f90 tH5F_F03.f90 tH5L_F03.f90 tH5O_F03.f90 tH5P_F03.f90 tH5T_F03.f90 endif diff --git a/fortran/test/Makefile.in b/fortran/test/Makefile.in index b9f05e3..6c226bc 100644 --- a/fortran/test/Makefile.in +++ b/fortran/test/Makefile.in @@ -136,11 +136,12 @@ fortranlib_test_1_8_LDADD = $(LDADD) fortranlib_test_1_8_DEPENDENCIES = libh5test_fortran.la $(LIBH5TEST) \ $(LIBH5F) $(LIBHDF5) am__fortranlib_test_F03_SOURCES_DIST = fortranlib_test_F03.f90 \ - tH5F.f90 tH5E_F03.f90 tH5L_F03.f90 tH5O_F03.f90 tH5P_F03.f90 \ - tH5T_F03.f90 + tH5F.f90 tH5E_F03.f90 tH5F_F03.f90 tH5L_F03.f90 tH5O_F03.f90 \ + tH5P_F03.f90 tH5T_F03.f90 @FORTRAN_2003_CONDITIONAL_F_TRUE@am_fortranlib_test_F03_OBJECTS = fortranlib_test_F03.$(OBJEXT) \ @FORTRAN_2003_CONDITIONAL_F_TRUE@ tH5F.$(OBJEXT) \ @FORTRAN_2003_CONDITIONAL_F_TRUE@ tH5E_F03.$(OBJEXT) \ +@FORTRAN_2003_CONDITIONAL_F_TRUE@ tH5F_F03.$(OBJEXT) \ @FORTRAN_2003_CONDITIONAL_F_TRUE@ tH5L_F03.$(OBJEXT) \ @FORTRAN_2003_CONDITIONAL_F_TRUE@ tH5O_F03.$(OBJEXT) \ @FORTRAN_2003_CONDITIONAL_F_TRUE@ tH5P_F03.$(OBJEXT) \ @@ -304,6 +305,7 @@ H5_VERSION = @H5_VERSION@ HADDR_T = @HADDR_T@ HAVE_DMALLOC = @HAVE_DMALLOC@ HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@ +HAVE_PTHREAD = @HAVE_PTHREAD@ HDF5_HL = @HDF5_HL@ HDF5_INTERFACES = @HDF5_INTERFACES@ HDF_CXX = @HDF_CXX@ @@ -355,7 +357,6 @@ PACKAGE_VERSION = @PACKAGE_VERSION@ PARALLEL = @PARALLEL@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ -PTHREAD = @PTHREAD@ RANLIB = @RANLIB@ ROOT = @ROOT@ RUNPARALLEL = @RUNPARALLEL@ @@ -527,7 +528,7 @@ fortranlib_test_1_8_SOURCES = fortranlib_test_1_8.f90 \ tH5F.f90 tH5O.f90 tH5A_1_8.f90 tH5G_1_8.f90 @FORTRAN_2003_CONDITIONAL_F_TRUE@fortranlib_test_F03_SOURCES = fortranlib_test_F03.f90 \ -@FORTRAN_2003_CONDITIONAL_F_TRUE@ tH5F.f90 tH5E_F03.f90 tH5L_F03.f90 tH5O_F03.f90 tH5P_F03.f90 tH5T_F03.f90 +@FORTRAN_2003_CONDITIONAL_F_TRUE@ tH5F.f90 tH5E_F03.f90 tH5F_F03.f90 tH5L_F03.f90 tH5O_F03.f90 tH5P_F03.f90 tH5T_F03.f90 fflush1_SOURCES = fflush1.f90 fflush2_SOURCES = fflush2.f90 diff --git a/fortran/test/fortranlib_test_F03.f90 b/fortran/test/fortranlib_test_F03.f90 index 606b050..1d9615f 100644 --- a/fortran/test/fortranlib_test_F03.f90 +++ b/fortran/test/fortranlib_test_F03.f90 @@ -145,7 +145,10 @@ PROGRAM fortranlibtest_F03 CALL test_nbit(ret_total_error) CALL write_test_status(ret_total_error, ' Testing nbit filter', total_error) - + ret_total_error = 0 + CALL external_test_offset(cleanup, ret_total_error) + CALL write_test_status(ret_total_error, ' Testing external dataset with offset', total_error) + ! write(*,*) ! write(*,*) '=========================================' ! write(*,*) 'Testing GROUP interface ' @@ -163,6 +166,11 @@ PROGRAM fortranlibtest_F03 CALL obj_info(ret_total_error) CALL write_test_status(ret_total_error, ' Testing object info functions ', total_error) + ret_total_error = 0 + CALL test_get_file_image(ret_total_error) + CALL write_test_status(ret_total_error, ' Testing get file image ', total_error) + + WRITE(*,*) WRITE(*,*) ' ============================================ ' diff --git a/fortran/test/tH5F_F03.f90 b/fortran/test/tH5F_F03.f90 new file mode 100644 index 0000000..dea9a5d --- /dev/null +++ b/fortran/test/tH5F_F03.f90 @@ -0,0 +1,175 @@ +!****h* root/fortran/test/tH5F_F03.f90 +! +! NAME +! tH5F_F03.f90 +! +! FUNCTION +! Test FORTRAN HDF5 H5F APIs which are dependent on FORTRAN 2003 +! features. +! +! COPYRIGHT +! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +! Copyright by The HDF Group. * +! Copyright by the Board of Trustees of the University of Illinois. * +! 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 files COPYING and Copyright.html. COPYING can be found at the root * +! of the source code distribution tree; Copyright.html can be found at the * +! root level of an installed copy of the electronic HDF5 document set and * +! is linked from the top-level documents page. It can also be found at * +! http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * +! access to either file, you may request a copy from help@hdfgroup.org. * +! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +! +! NOTES +! Tests the H5F APIs functionalities of: +! h5fget_file_image_f +! +! CONTAINS SUBROUTINES +! test_get_file_image +! +!***** + +! ***************************************** +! *** H 5 F T E S T S +! ***************************************** + +SUBROUTINE test_get_file_image(total_error) + ! + ! Tests the wrapper for h5fget_file_image + ! + USE HDF5 + USE ISO_C_BINDING + + IMPLICIT NONE + + INTEGER, INTENT(INOUT) :: total_error ! returns error + + CHARACTER(kind=c_char), ALLOCATABLE, DIMENSION(:), TARGET :: file_image_ptr ! Image from file + CHARACTER(kind=c_char), ALLOCATABLE, DIMENSION(:), TARGET :: image_ptr ! Image from h5fget_file_image_f + + INTEGER, DIMENSION(1:100), TARGET :: data ! Write data + INTEGER :: i, file_sz + INTEGER(hid_t) :: file_id = -1 ! File identifier + INTEGER(hid_t) :: dset_id = -1 ! Dataset identifier + INTEGER(hid_t) :: space_id = -1 ! Dataspace identifier + INTEGER(hsize_t), DIMENSION(1:2) :: dims ! Dataset dimensions + INTEGER(size_t) :: itmp_a, itmp_b ! General purpose integers + INTEGER(size_t) :: image_size ! Size of image + TYPE(C_PTR) :: f_ptr ! Pointer + INTEGER(hid_t) :: fapl ! File access property + INTEGER :: error ! Error flag + + + RETURN ! DEBUG, PGI COMPILERS seem to have a bug in the INQUIRE functions, + ! waiting for an answer from PGI how to resolve the problem. + + ! Create new properties for file access + CALL h5pcreate_f(H5P_FILE_ACCESS_F, fapl, error) + CALL check("h5pcreate_f", error, total_error) + + ! Set standard I/O driver + CALL h5pset_fapl_stdio_f(fapl, error) + CALL check("h5pset_fapl_stdio_f", error, total_error) + + ! Create the file + CALL h5fcreate_f("tget_file_image.h5", H5F_ACC_TRUNC_F, file_id, error, H5P_DEFAULT_F, fapl) + CALL check("h5fcreate_f", error, total_error) + + ! Set up data space for new data set + dims(1:2) = (/10,10/) + + CALL h5screate_simple_f(2, dims, space_id, error) + CALL check("h5screate_simple_f", error, total_error) + + ! Create a dataset + CALL h5dcreate_f(file_id, "dset 0", H5T_NATIVE_INTEGER, space_id, dset_id, error) + CALL check("h5dcreate_f", error, total_error) + + ! Write some data to the data set + DO i = 1, 100 + data(i) = i + ENDDO + + f_ptr = C_LOC(data(1)) + CALL h5dwrite_f(dset_id, H5T_NATIVE_INTEGER, f_ptr, error) + CALL check("h5dwrite_f",error, total_error) + + ! Flush the file + CALL h5fflush_f(file_id, H5F_SCOPE_GLOBAL_F, error) + CALL check("h5fflush_f",error, total_error) + + ! Open the test file using standard I/O calls + OPEN(UNIT=10,FILE='tget_file_image.h5', ACCESS='STREAM') + ! Get the size of the test file + ! + ! Since we use the eoa to calculate the image size, the file size + ! may be larger. This is OK, as long as (in this specialized instance) + ! the remainder of the file is all '\0's. + ! + ! With latest mods to truncate call in core file drive, + ! file size should match image size; get the file size + INQUIRE(UNIT=10, SIZE=file_sz) + CLOSE(UNIT=10) + + ! I. Get buffer size needed to hold the buffer + + ! A. Preferred way to get the size + f_ptr = C_NULL_PTR + CALL h5fget_file_image_f(file_id, f_ptr, INT(0, size_t), error, image_size) + CALL check("h5fget_file_image_f",error, total_error) + CALL verify("h5fget_file_image_f", file_sz, INT(image_size), total_error) + + ! B. f_ptr set to point to an incorrect buffer, should pass anyway + f_ptr = C_LOC(data(1)) + itmp_a = 1 + CALL h5fget_file_image_f(file_id, f_ptr, itmp_a, error, image_size) + CALL check("h5fget_file_image_f",error, total_error) + CALL VERIFY("h5fget_file_image_f", INT(itmp_a), 1, total_error) ! Routine should not change the value + CALL VERIFY("h5fget_file_image_f", file_sz, INT(image_size), total_error) + + ! Allocate a buffer of the appropriate size + ALLOCATE(image_ptr(1:image_size)) + + ! Load the image of the file into the buffer + f_ptr = C_LOC(image_ptr(1)(1:1)) + CALL h5fget_file_image_f(file_id, f_ptr, image_size, error) + CALL check("h5fget_file_image_f",error, total_error) + + ! Close dset and space + CALL h5dclose_f(dset_id, error) + CALL check("h5dclose_f", error, total_error) + CALL h5sclose_f(space_id, error) + CALL check("h5sclose_f", error, total_error) + ! Close the test file + CALL h5fclose_f(file_id, error) + CALL check("h5fclose_f",error, total_error) + + ! Allocate a buffer for the test file image + ALLOCATE(file_image_ptr(1:image_size)) + + ! Open the test file using standard I/O calls + OPEN(UNIT=10,FILE='tget_file_image.h5', ACCESS='STREAM') + + ! Read the test file from disk into the buffer + DO i = 1, image_size + READ(10) file_image_ptr(i) + ENDDO + + CLOSE(10) + + ! verify the file and the image contain the same data + DO i = 1, image_size + ! convert one byte to an unsigned integer + IF( ICHAR(file_image_ptr(i)) .NE. ICHAR(image_ptr(i)))THEN + total_error = total_error + 1 + EXIT + ENDIF + ENDDO + + ! release resources + DEALLOCATE(file_image_ptr,image_ptr) + +END SUBROUTINE test_get_file_image diff --git a/fortran/test/tH5P.f90 b/fortran/test/tH5P.f90 index 3faaac2..4c78334 100644 --- a/fortran/test/tH5P.f90 +++ b/fortran/test/tH5P.f90 @@ -27,385 +27,376 @@ ! !***** - SUBROUTINE external_test(cleanup, total_error) +SUBROUTINE external_test(cleanup, total_error) ! This subroutine tests following functionalities: ! h5pset_external_f, h5pget_external_count_f, ! h5pget_external_f - USE HDF5 ! This module contains all necessary modules - - IMPLICIT NONE - LOGICAL, INTENT(IN) :: cleanup - INTEGER, INTENT(OUT) :: total_error - - CHARACTER(LEN=8), PARAMETER :: filename = "external" - CHARACTER(LEN=80) :: fix_filename - INTEGER(HID_T) :: file_id - INTEGER(HID_T) :: plist_id - INTEGER(HID_T) :: space_id - INTEGER(HID_T) :: dataset_id - INTEGER(HSIZE_T), DIMENSION(1) :: cur_size !data space current size - INTEGER(HSIZE_T), DIMENSION(1) :: max_size !data space maximum size - CHARACTER(LEN=256) :: name !external file name - INTEGER :: file_offset !external file offset - INTEGER(HSIZE_T) :: file_size !sizeof external file segment - INTEGER :: error !error code - INTEGER(SIZE_T) :: int_size !size of integer - INTEGER(HSIZE_T) :: file_bytes !Number of bytes reserved - !in the file for the data - INTEGER :: RANK = 1 !dataset rank - INTEGER :: count !number of external files for the - !specified dataset - INTEGER(SIZE_T) :: namesize - INTEGER(HSIZE_T) :: size, buf_size - INTEGER :: idx - - buf_size = 4*1024*1024 - - ! - !Create file "external.h5" using default properties. - ! - CALL h5_fixname_f(filename, fix_filename, H5P_DEFAULT_F, error) - if (error .ne. 0) then - write(*,*) "Cannot modify filename" - stop - endif - CALL h5fcreate_f(fix_filename, H5F_ACC_TRUNC_F, file_id, error) - CALL check("h5fcreate_f",error,total_error) - - - CALL h5pcreate_f(H5P_DATASET_XFER_F, plist_id, error) - CALL check("h5pcreate_f", error, total_error) - CALL h5pset_buffer_f(plist_id, buf_size, error) - CALL check("h5pset_buffer_f", error, total_error) - CALL h5pget_buffer_f(plist_id, size, error) - CALL check("h5pget_buffer_f", error, total_error) - if (size .ne.buf_size) then - total_error = total_error + 1 - write(*,*) "h5pget_buffer_f returned wrong size, error" - endif - CALL h5pclose_f(plist_id, error) - CALL check("h5pclose_f", error, total_error) - - CALL h5pcreate_f(H5P_DATASET_CREATE_F, plist_id, error) - CALL check("h5pcreate_f",error,total_error) - cur_size(1) =100 - max_size(1) = 100; - call h5tget_size_f(H5T_NATIVE_INTEGER, int_size, error) - CALL check("h5tget_size_f",error,total_error) - file_size = int_size * max_size(1); - CALL h5pset_external_f(plist_id, "ext1.data", 0, file_size, error) - CALL check("h5pset_external_f",error,total_error) - CALL h5screate_simple_f(RANK, cur_size, space_id, error, max_size) - CALL check("h5screate_simple_f", error, total_error) - CALL h5dcreate_f(file_id, "dset1", H5T_NATIVE_INTEGER, space_id, & - dataset_id, error, plist_id) - CALL check("h5dcreate_f", error, total_error) - - CALL h5dclose_f(dataset_id, error) - CALL check("h5dclose_f", error, total_error) - CALL h5pclose_f(plist_id, error) - CALL check("h5pclose_f", error, total_error) - CALL h5sclose_f(space_id, error) - CALL check("h5sclose_f", error, total_error) - CALL h5fclose_f(file_id, error) - - CALL h5fopen_f(fix_filename, H5F_ACC_RDWR_F, file_id, error) - CALL h5dopen_f(file_id, "dset1", dataset_id, error) - CALL check("h5dopen_f",error,total_error) - - ! Read dataset creation information - CALL h5dget_create_plist_f(dataset_id, plist_id, error) - CALL check("h5dget_create_plist_f",error,total_error) - CALL h5pget_external_count_f(plist_id, count, error) - CALL check("h5pget_external_count_f",error,total_error) - if(count .ne. 1 ) then - write (*,*) "got external_count is not correct" - total_error = total_error + 1 - end if - namesize = 10 - idx = 0 - CALL h5pget_external_f(plist_id, idx, namesize, name, file_offset, & - file_bytes, error) - CALL check("h5pget_external_f",error,total_error) - if(file_offset .ne. 0 ) then - write (*,*) "got external file offset is not correct" - total_error = total_error + 1 - end if - if(file_bytes .ne. file_size ) then - write (*,*) "got external file size is not correct" - total_error = total_error + 1 - end if - - CALL h5dclose_f(dataset_id, error) - CALL check("h5dclose_f", error, total_error) - CALL h5pclose_f(plist_id, error) - CALL check("h5pclose_f", error, total_error) - CALL h5fclose_f(file_id, error) - CALL check("h5fclose_f", error, total_error) - - - if(cleanup) CALL h5_cleanup_f(filename, H5P_DEFAULT_F, error) - CALL check("h5_cleanup_f", error, total_error) + USE HDF5 ! This module contains all necessary modules + + IMPLICIT NONE + LOGICAL, INTENT(IN) :: cleanup + INTEGER, INTENT(OUT) :: total_error + + CHARACTER(LEN=8), PARAMETER :: filename = "external" + CHARACTER(LEN=80) :: fix_filename + INTEGER(HID_T) :: file_id + INTEGER(HID_T) :: plist_id + INTEGER(HID_T) :: space_id + INTEGER(HID_T) :: dataset_id + INTEGER(HSIZE_T), DIMENSION(1) :: cur_size !data space current size + INTEGER(HSIZE_T), DIMENSION(1) :: max_size !data space maximum size + CHARACTER(LEN=256) :: name !external file name + INTEGER(OFF_T) :: file_offset !external file offset + INTEGER(HSIZE_T) :: file_size !sizeof external file segment + INTEGER :: error !error code + INTEGER(SIZE_T) :: int_size !size of integer + INTEGER(HSIZE_T) :: file_bytes !Number of bytes reserved + !in the file for the data + INTEGER :: RANK = 1 !dataset rank + INTEGER :: count !number of external files for the + !specified dataset + INTEGER(SIZE_T) :: namesize + INTEGER(HSIZE_T) :: size, buf_size + INTEGER :: idx + + buf_size = 4*1024*1024 + + ! + !Create file "external.h5" using default properties. + ! + CALL h5_fixname_f(filename, fix_filename, H5P_DEFAULT_F, error) + IF (error .NE. 0) THEN + STOP "Cannot modify filename" + ENDIF + CALL h5fcreate_f(fix_filename, H5F_ACC_TRUNC_F, file_id, error) + CALL check("h5fcreate_f",error,total_error) + + CALL h5pcreate_f(H5P_DATASET_XFER_F, plist_id, error) + CALL check("h5pcreate_f", error, total_error) + CALL h5pset_buffer_f(plist_id, buf_size, error) + CALL check("h5pset_buffer_f", error, total_error) + CALL h5pget_buffer_f(plist_id, size, error) + CALL check("h5pget_buffer_f", error, total_error) + IF (size .NE.buf_size) THEN + total_error = total_error + 1 + WRITE(*,*) "h5pget_buffer_f returned wrong size, error" + ENDIF + CALL h5pclose_f(plist_id, error) + CALL check("h5pclose_f", error, total_error) + + CALL h5pcreate_f(H5P_DATASET_CREATE_F, plist_id, error) + CALL check("h5pcreate_f",error,total_error) + cur_size(1) =100 + max_size(1) = 100 + CALL h5tget_size_f(H5T_NATIVE_INTEGER, int_size, error) + CALL check("h5tget_size_f",error,total_error) + file_size = int_size * max_size(1) + CALL h5pset_external_f(plist_id, "ext1.data", INT(0,off_t), file_size, error) + CALL check("h5pset_external_f",error,total_error) + CALL h5screate_simple_f(RANK, cur_size, space_id, error, max_size) + CALL check("h5screate_simple_f", error, total_error) + CALL h5dcreate_f(file_id, "dset1", H5T_NATIVE_INTEGER, space_id, & + dataset_id, error, plist_id) + CALL check("h5dcreate_f", error, total_error) + + CALL h5dclose_f(dataset_id, error) + CALL check("h5dclose_f", error, total_error) + CALL h5pclose_f(plist_id, error) + CALL check("h5pclose_f", error, total_error) + CALL h5sclose_f(space_id, error) + CALL check("h5sclose_f", error, total_error) + CALL h5fclose_f(file_id, error) + + CALL h5fopen_f(fix_filename, H5F_ACC_RDWR_F, file_id, error) + CALL h5dopen_f(file_id, "dset1", dataset_id, error) + CALL check("h5dopen_f",error,total_error) + + ! Read dataset creation information + CALL h5dget_create_plist_f(dataset_id, plist_id, error) + CALL check("h5dget_create_plist_f",error,total_error) + CALL h5pget_external_count_f(plist_id, count, error) + CALL check("h5pget_external_count_f",error,total_error) + IF(count .NE. 1 ) THEN + WRITE (*,*) "got external_count is not correct" + total_error = total_error + 1 + END IF + namesize = 10 + idx = 0 + CALL h5pget_external_f(plist_id, idx, namesize, name, file_offset, & + file_bytes, error) + CALL check("h5pget_external_f",error,total_error) + IF(file_offset .NE. 0 ) THEN + WRITE (*,*) "got external file offset is not correct" + total_error = total_error + 1 + END IF + IF(file_bytes .NE. file_size ) THEN + WRITE (*,*) "got external file size is not correct" + total_error = total_error + 1 + END IF + + CALL h5dclose_f(dataset_id, error) + CALL check("h5dclose_f", error, total_error) + CALL h5pclose_f(plist_id, error) + CALL check("h5pclose_f", error, total_error) + CALL h5fclose_f(file_id, error) + CALL check("h5fclose_f", error, total_error) + + IF(cleanup) CALL h5_cleanup_f(filename, H5P_DEFAULT_F, error) + CALL check("h5_cleanup_f", error, total_error) + RETURN +END SUBROUTINE external_test + +SUBROUTINE multi_file_test(cleanup, total_error) + USE HDF5 ! This module contains all necessary modules + + IMPLICIT NONE + LOGICAL, INTENT(IN) :: cleanup + INTEGER, INTENT(OUT) :: total_error + + CHARACTER(LEN=9), PARAMETER :: filename = "multidset" ! File name + CHARACTER(LEN=80) :: fix_filename + CHARACTER(LEN=4), PARAMETER :: dsetname = "dset" ! Dataset name + + INTEGER(HID_T) :: file_id ! File identifier + INTEGER(HID_T) :: dset_id ! Dataset identifier + INTEGER(HID_T) :: dspace_id ! Dataspace identifier + INTEGER(HID_T) :: dtype_id ! Datatype identifier + INTEGER(HID_T) :: fapl, fapl_1 ! File access property list identifier + INTEGER, DIMENSION(0:H5FD_MEM_NTYPES_F-1) :: memb_map, memb_map_out + INTEGER(HID_T), DIMENSION(0:H5FD_MEM_NTYPES_F-1) :: memb_fapl, memb_fapl_out + CHARACTER(LEN=20), DIMENSION(0:H5FD_MEM_NTYPES_F-1) :: memb_name, memb_name_out + REAL, DIMENSION(0:H5FD_MEM_NTYPES_F-1) :: memb_addr, memb_addr_out + !INTEGER(HADDR_T), DIMENSION(0:H5FD_MEM_NTYPES_F) :: memb_addr + LOGICAL :: relax = .TRUE. + LOGICAL :: relax_out = .TRUE. + + INTEGER(HSIZE_T), DIMENSION(2) :: dims = (/4,6/) ! Dataset dimensions + INTEGER :: rank = 2 ! Dataset rank + + INTEGER, DIMENSION(4,6) :: dset_data, data_out ! Data buffers + INTEGER :: error ! Error flag + INTEGER(HID_T) :: driver + INTEGER :: i, j !general purpose integers + INTEGER(HSIZE_T), DIMENSION(2) :: data_dims + INTEGER :: mdc_nelmts + INTEGER(SIZE_T) :: rdcc_nelmts + INTEGER(SIZE_T) :: rdcc_nbytes + REAL :: rdcc_w0 + memb_fapl = H5P_DEFAULT_F + memb_map = H5FD_MEM_SUPER_F + memb_addr = 0. + memb_map(H5FD_MEM_SUPER_F) = H5FD_MEM_SUPER_F + memb_addr(H5FD_MEM_SUPER_F) = 0. + memb_map(H5FD_MEM_BTREE_F) = H5FD_MEM_BTREE_F + memb_addr(H5FD_MEM_BTREE_F) = 0.1 + memb_map(H5FD_MEM_DRAW_F) = H5FD_MEM_DRAW_F + memb_addr(H5FD_MEM_DRAW_F) = 0.5 + memb_map(H5FD_MEM_GHEAP_F) = H5FD_MEM_GHEAP_F + memb_addr(H5FD_MEM_GHEAP_F) = 0.2 + memb_map(H5FD_MEM_LHEAP_F) = H5FD_MEM_LHEAP_F + memb_addr(H5FD_MEM_LHEAP_F) = 0.3 + memb_map(H5FD_MEM_OHDR_F) = H5FD_MEM_OHDR_F + memb_addr(H5FD_MEM_OHDR_F) = 0.4 + + memb_name = ' ' + memb_name(H5FD_MEM_SUPER_F) = '%s-s.h5' + memb_name(H5FD_MEM_BTREE_F) = '%s-b.h5' + memb_name(H5FD_MEM_DRAW_F) = '%s-r.h5' + memb_name(H5FD_MEM_GHEAP_F) = '%s-g.h5' + memb_name(H5FD_MEM_LHEAP_F) = '%s-l.h5' + memb_name(H5FD_MEM_OHDR_F) = '%s-o.h5' + + ! + ! Initialize the dset_data array. + ! + DO i = 1, 4 + DO j = 1, 6 + dset_data(i,j) = (i-1)*6 + j + END DO + END DO + + ! + ! Create a new file using default properties. + ! + CALL h5_fixname_f(filename, fix_filename, H5P_DEFAULT_F, error) + IF (error .NE. 0) THEN + WRITE(*,*) "Cannot modify filename" + STOP + ENDIF + CALL h5pcreate_f(H5P_FILE_ACCESS_F, fapl, error) + CALL check("h5pcreate_f", error, total_error) + CALL h5pset_fapl_multi_f(fapl, memb_map, memb_fapl, memb_name, memb_addr, relax, error) + CALL check("h5pset_fapl_multi_f", error, total_error) + CALL h5pget_fapl_multi_f(fapl, memb_map_out, memb_fapl_out, memb_name_out, & + memb_addr_out, relax_out, error) + CALL check("h5pget_fapl_multi_f", error, total_error) + CALL h5pget_driver_f(fapl, driver, error) + CALL check("h5pget_driver_f",error, total_error) + IF(driver .NE. H5FD_MULTI_F) THEN + WRITE(*,*) "Wrong value for driver" + ENDIF + ! + ! Let's check h5pget(set)cache_f APIs here for now + ! + CALL h5pget_cache_f(fapl, mdc_nelmts, rdcc_nelmts, rdcc_nbytes, & + rdcc_w0, error) + CALL check("h5pget_cache_f", error, total_error) + + ! + ! Set cache to some number + ! + rdcc_nbytes = 1024*1024 + CALL h5pset_cache_f(fapl, mdc_nelmts, rdcc_nelmts, rdcc_nbytes, & + rdcc_w0, error) + CALL check("h5pset_cache_f", error, total_error) + CALL h5fcreate_f(fix_filename, H5F_ACC_TRUNC_F, file_id, error, access_prp = fapl) + CALL check("h5fcreate_f", error, total_error) + IF(error .NE. 0) THEN + WRITE(*,*) "Cannot create file using multi-file driver... Exiting...." + total_error = 1 + CALL h5pclose_f(fapl, error) RETURN - END SUBROUTINE external_test - - SUBROUTINE multi_file_test(cleanup, total_error) - USE HDF5 ! This module contains all necessary modules - - IMPLICIT NONE - LOGICAL, INTENT(IN) :: cleanup - INTEGER, INTENT(OUT) :: total_error - - CHARACTER(LEN=9), PARAMETER :: filename = "multidset" ! File name - CHARACTER(LEN=80) :: fix_filename - CHARACTER(LEN=4), PARAMETER :: dsetname = "dset" ! Dataset name - - INTEGER(HID_T) :: file_id ! File identifier - INTEGER(HID_T) :: dset_id ! Dataset identifier - INTEGER(HID_T) :: dspace_id ! Dataspace identifier - INTEGER(HID_T) :: dtype_id ! Datatype identifier - INTEGER(HID_T) :: fapl, fapl_1 ! File access property list identifier - INTEGER, DIMENSION(0:H5FD_MEM_NTYPES_F-1) :: memb_map, memb_map_out - INTEGER(HID_T), DIMENSION(0:H5FD_MEM_NTYPES_F-1) :: memb_fapl, memb_fapl_out - CHARACTER(LEN=20), DIMENSION(0:H5FD_MEM_NTYPES_F-1) :: memb_name, memb_name_out - REAL, DIMENSION(0:H5FD_MEM_NTYPES_F-1) :: memb_addr, memb_addr_out - !INTEGER(HADDR_T), DIMENSION(0:H5FD_MEM_NTYPES_F) :: memb_addr - LOGICAL :: relax = .TRUE. - LOGICAL :: relax_out = .TRUE. - - INTEGER(HSIZE_T), DIMENSION(2) :: dims = (/4,6/) ! Dataset dimensions - INTEGER :: rank = 2 ! Dataset rank - - INTEGER, DIMENSION(4,6) :: dset_data, data_out ! Data buffers - INTEGER :: error ! Error flag - INTEGER(HID_T) :: driver - INTEGER :: i, j !general purpose integers - INTEGER(HSIZE_T), DIMENSION(2) :: data_dims - INTEGER :: mdc_nelmts - INTEGER(SIZE_T) :: rdcc_nelmts - INTEGER(SIZE_T) :: rdcc_nbytes - REAL :: rdcc_w0 - memb_fapl = H5P_DEFAULT_F - memb_map = H5FD_MEM_SUPER_F - memb_addr = 0. - memb_map(H5FD_MEM_SUPER_F) = H5FD_MEM_SUPER_F - memb_addr(H5FD_MEM_SUPER_F) = 0. - memb_map(H5FD_MEM_BTREE_F) = H5FD_MEM_BTREE_F - memb_addr(H5FD_MEM_BTREE_F) = 0.1 - memb_map(H5FD_MEM_DRAW_F) = H5FD_MEM_DRAW_F - memb_addr(H5FD_MEM_DRAW_F) = 0.5 - memb_map(H5FD_MEM_GHEAP_F) = H5FD_MEM_GHEAP_F - memb_addr(H5FD_MEM_GHEAP_F) = 0.2 - memb_map(H5FD_MEM_LHEAP_F) = H5FD_MEM_LHEAP_F - memb_addr(H5FD_MEM_LHEAP_F) = 0.3 - memb_map(H5FD_MEM_OHDR_F) = H5FD_MEM_OHDR_F - memb_addr(H5FD_MEM_OHDR_F) = 0.4 - - memb_name = ' ' - memb_name(H5FD_MEM_SUPER_F) = '%s-s.h5' - memb_name(H5FD_MEM_BTREE_F) = '%s-b.h5' - memb_name(H5FD_MEM_DRAW_F) = '%s-r.h5' - memb_name(H5FD_MEM_GHEAP_F) = '%s-g.h5' - memb_name(H5FD_MEM_LHEAP_F) = '%s-l.h5' - memb_name(H5FD_MEM_OHDR_F) = '%s-o.h5' - - ! - ! Initialize the dset_data array. - ! - do i = 1, 4 - do j = 1, 6 - dset_data(i,j) = (i-1)*6 + j; - end do - end do - - ! - ! Create a new file using default properties. - ! - CALL h5_fixname_f(filename, fix_filename, H5P_DEFAULT_F, error) - if (error .ne. 0) then - write(*,*) "Cannot modify filename" - stop - endif - CALL h5pcreate_f(H5P_FILE_ACCESS_F, fapl, error) - CALL check("h5pcreate_f", error, total_error) - CALL h5pset_fapl_multi_f(fapl, memb_map, memb_fapl, memb_name, memb_addr, relax, error) - CALL check("h5pset_fapl_multi_f", error, total_error) - CALL h5pget_fapl_multi_f(fapl, memb_map_out, memb_fapl_out, memb_name_out, & - memb_addr_out, relax_out, error) - CALL check("h5pget_fapl_multi_f", error, total_error) - CALL h5pget_driver_f(fapl, driver, error) - CALL check("h5pget_driver_f",error, total_error) - if(driver .ne. H5FD_MULTI_F) then - write(*,*) "Wrong value for driver" - endif - ! - ! Let's check h5pget(set)cache_f APIs here for now - ! - CALL h5pget_cache_f(fapl, mdc_nelmts, rdcc_nelmts, rdcc_nbytes, & - rdcc_w0, error) - CALL check("h5pget_cache_f", error, total_error) - - - ! Set cache to some number - ! - rdcc_nbytes = 1024*1024 - CALL h5pset_cache_f(fapl, mdc_nelmts, rdcc_nelmts, rdcc_nbytes, & - rdcc_w0, error) - CALL check("h5pset_cache_f", error, total_error) - CALL h5fcreate_f(fix_filename, H5F_ACC_TRUNC_F, file_id, error, access_prp = fapl) - CALL check("h5fcreate_f", error, total_error) - if(error .ne. 0) then - write(*,*) "Cannot create file using multi-file driver... Exiting...." - total_error = 1 - call h5pclose_f(fapl, error) - return - endif - - ! - ! Create the dataspace. - ! - CALL h5screate_simple_f(rank, dims, dspace_id, error) - CALL check("h5screate_simple_f", error, total_error) - - - ! - ! Create the dataset with default properties. - ! - CALL h5dcreate_f(file_id, dsetname, H5T_NATIVE_INTEGER, dspace_id, & - dset_id, error) - CALL check("h5dcreate_f", error, total_error) - - ! - ! Write the dataset. - ! - data_dims(1) = 4 - data_dims(2) = 6 - CALL h5dwrite_f(dset_id, H5T_NATIVE_INTEGER, dset_data, data_dims, error) - CALL check("h5dwrite_f", error, total_error) - - - ! - ! End access to the dataset and release resources used by it. - ! - CALL h5dclose_f(dset_id, error) - CALL check("h5dclose_f", error, total_error) - - ! - ! Terminate access to the data space. - ! - CALL h5sclose_f(dspace_id, error) - CALL check("h5sclose_f", error, total_error) - - ! - ! Close the file. - ! - CALL h5fclose_f(file_id, error) - CALL check("h5fclose_f", error, total_error) - CALL h5pclose_f(fapl, error) - CALL check("h5pclose_f", error, total_error) - ! - ! Open the existing file. - ! - CALL h5pcreate_f(H5P_FILE_ACCESS_F, fapl, error) - CALL check("h5pcreate_f", error, total_error) - CALL h5pset_fapl_multi_f(fapl, relax, error) - CALL check("h5pset_fapl_multi_f", error, total_error) - CALL h5fopen_f (fix_filename, H5F_ACC_RDWR_F, file_id, error, access_prp = fapl) - CALL check("h5fopen_f", error, total_error) - ! - CALL h5fget_access_plist_f(file_id, fapl_1, error) - CALL check("h5fget_access_plist_f", error, total_error) - !It doesn't work on Windows. - !CALL h5pget_fapl_multi_f(fapl_1, memb_map_out, memb_fapl_out, memb_name_out, & - ! memb_addr_out, relax_out, error) - ! write(*,*) memb_map_out - ! write(*,*) memb_fapl_out - ! write(*,*) memb_name_out - ! write(*,*) memb_addr_out - ! CALL check("h5pget_fapl_multi_f", error, total_error) - - ! - ! Open the existing dataset. - ! - CALL h5dopen_f(file_id, dsetname, dset_id, error) - CALL check("h5dopen_f", error, total_error) - - ! - ! Get the dataset type. - ! - CALL h5dget_type_f(dset_id, dtype_id, error) - CALL check("h5dget_type_f", error, total_error) - - ! - ! Get the data space. - ! - CALL h5dget_space_f(dset_id, dspace_id, error) - CALL check("h5dget_space_f", error, total_error) - - ! - ! Read the dataset. - ! - CALL h5dread_f(dset_id, H5T_NATIVE_INTEGER, data_out, data_dims, error) - CALL check("h5dread_f", error, total_error) - - ! - !Compare the data. - ! - do i = 1, 4 - do j = 1, 6 - IF (data_out(i,j) .NE. dset_data(i, j)) THEN - write(*, *) "dataset test error occured" - write(*,*) "data read is not the same as the data writen" - END IF - end do - end do - - ! - ! End access to the dataset and release resources used by it. - ! - CALL h5dclose_f(dset_id, error) - CALL check("h5dclose_f", error, total_error) - - ! - ! Terminate access to the data space. - ! - CALL h5sclose_f(dspace_id, error) - CALL check("h5sclose_f", error, total_error) - - ! - ! Terminate access to the data type. - ! - CALL h5tclose_f(dtype_id, error) - CALL check("h5tclose_f", error, total_error) - ! - ! Close the file. - ! - CALL h5fclose_f(file_id, error) - CALL check("h5fclose_f", error, total_error) - CALL h5pclose_f(fapl, error) - CALL check("h5pclose_f", error, total_error) - CALL h5pclose_f(fapl_1, error) - CALL check("h5pclose_f", error, total_error) - IF(cleanup) CALL h5_cleanup_f(filename, H5P_DEFAULT_F, error) - CALL check("h5_cleanup_f", error, total_error) - - IF(cleanup) CALL h5_cleanup_f(filename//'.h5-b', H5P_DEFAULT_F, error) - CALL check("h5_cleanup_f", error, total_error) - IF(cleanup) CALL h5_cleanup_f(filename//'.h5-g', H5P_DEFAULT_F, error) - CALL check("h5_cleanup_f", error, total_error) - IF(cleanup) CALL h5_cleanup_f(filename//'.h5-l', H5P_DEFAULT_F, error) - CALL check("h5_cleanup_f", error, total_error) - IF(cleanup) CALL h5_cleanup_f(filename//'.h5-o', H5P_DEFAULT_F, error) - CALL check("h5_cleanup_f", error, total_error) - IF(cleanup) CALL h5_cleanup_f(filename//'.h5-r', H5P_DEFAULT_F, error) - CALL check("h5_cleanup_f", error, total_error) - IF(cleanup) CALL h5_cleanup_f(filename//'.h5-s', H5P_DEFAULT_F, error) - CALL check("h5_cleanup_f", error, total_error) - - RETURN - END SUBROUTINE multi_file_test + ENDIF + ! + ! Create the dataspace. + ! + CALL h5screate_simple_f(rank, dims, dspace_id, error) + CALL check("h5screate_simple_f", error, total_error) + ! + ! Create the dataset with default properties. + ! + CALL h5dcreate_f(file_id, dsetname, H5T_NATIVE_INTEGER, dspace_id, & + dset_id, error) + CALL check("h5dcreate_f", error, total_error) + ! + ! Write the dataset. + ! + data_dims(1) = 4 + data_dims(2) = 6 + CALL h5dwrite_f(dset_id, H5T_NATIVE_INTEGER, dset_data, data_dims, error) + CALL check("h5dwrite_f", error, total_error) + ! + ! End access to the dataset and release resources used by it. + ! + CALL h5dclose_f(dset_id, error) + CALL check("h5dclose_f", error, total_error) + + ! + ! Terminate access to the data space. + ! + CALL h5sclose_f(dspace_id, error) + CALL check("h5sclose_f", error, total_error) + + ! + ! Close the file. + ! + CALL h5fclose_f(file_id, error) + CALL check("h5fclose_f", error, total_error) + CALL h5pclose_f(fapl, error) + CALL check("h5pclose_f", error, total_error) + ! + ! Open the existing file. + ! + CALL h5pcreate_f(H5P_FILE_ACCESS_F, fapl, error) + CALL check("h5pcreate_f", error, total_error) + CALL h5pset_fapl_multi_f(fapl, relax, error) + CALL check("h5pset_fapl_multi_f", error, total_error) + CALL h5fopen_f (fix_filename, H5F_ACC_RDWR_F, file_id, error, access_prp = fapl) + CALL check("h5fopen_f", error, total_error) + ! + CALL h5fget_access_plist_f(file_id, fapl_1, error) + CALL check("h5fget_access_plist_f", error, total_error) + !It doesn't work on Windows. + !CALL h5pget_fapl_multi_f(fapl_1, memb_map_out, memb_fapl_out, memb_name_out, & + ! memb_addr_out, relax_out, error) + ! write(*,*) memb_map_out + ! write(*,*) memb_fapl_out + ! write(*,*) memb_name_out + ! write(*,*) memb_addr_out + ! CALL check("h5pget_fapl_multi_f", error, total_error) + + ! + ! Open the existing dataset. + ! + CALL h5dopen_f(file_id, dsetname, dset_id, error) + CALL check("h5dopen_f", error, total_error) + + ! + ! Get the dataset type. + ! + CALL h5dget_type_f(dset_id, dtype_id, error) + CALL check("h5dget_type_f", error, total_error) + + ! + ! Get the data space. + ! + CALL h5dget_space_f(dset_id, dspace_id, error) + CALL check("h5dget_space_f", error, total_error) + + ! + ! Read the dataset. + ! + CALL h5dread_f(dset_id, H5T_NATIVE_INTEGER, data_out, data_dims, error) + CALL check("h5dread_f", error, total_error) + + ! + !Compare the data. + ! + DO i = 1, 4 + DO j = 1, 6 + IF (data_out(i,j) .NE. dset_data(i, j)) THEN + WRITE(*, *) "dataset test error occured" + WRITE(*,*) "data read is not the same as the data writen" + END IF + END DO + END DO + + ! + ! End access to the dataset and release resources used by it. + ! + CALL h5dclose_f(dset_id, error) + CALL check("h5dclose_f", error, total_error) + + ! + ! Terminate access to the data space. + ! + CALL h5sclose_f(dspace_id, error) + CALL check("h5sclose_f", error, total_error) + + ! + ! Terminate access to the data type. + ! + CALL h5tclose_f(dtype_id, error) + CALL check("h5tclose_f", error, total_error) + ! + ! Close the file. + ! + CALL h5fclose_f(file_id, error) + CALL check("h5fclose_f", error, total_error) + CALL h5pclose_f(fapl, error) + CALL check("h5pclose_f", error, total_error) + CALL h5pclose_f(fapl_1, error) + CALL check("h5pclose_f", error, total_error) + IF(cleanup) CALL h5_cleanup_f(filename, H5P_DEFAULT_F, error) + CALL check("h5_cleanup_f", error, total_error) + + IF(cleanup) CALL h5_cleanup_f(filename//'.h5-b', H5P_DEFAULT_F, error) + CALL check("h5_cleanup_f", error, total_error) + IF(cleanup) CALL h5_cleanup_f(filename//'.h5-g', H5P_DEFAULT_F, error) + CALL check("h5_cleanup_f", error, total_error) + IF(cleanup) CALL h5_cleanup_f(filename//'.h5-l', H5P_DEFAULT_F, error) + CALL check("h5_cleanup_f", error, total_error) + IF(cleanup) CALL h5_cleanup_f(filename//'.h5-o', H5P_DEFAULT_F, error) + CALL check("h5_cleanup_f", error, total_error) + IF(cleanup) CALL h5_cleanup_f(filename//'.h5-r', H5P_DEFAULT_F, error) + CALL check("h5_cleanup_f", error, total_error) + IF(cleanup) CALL h5_cleanup_f(filename//'.h5-s', H5P_DEFAULT_F, error) + CALL check("h5_cleanup_f", error, total_error) + + RETURN +END SUBROUTINE multi_file_test !------------------------------------------------------------------------- ! Function: test_chunk_cache @@ -432,24 +423,24 @@ SUBROUTINE test_chunk_cache(cleanup, total_error) IMPLICIT NONE LOGICAL, INTENT(IN) :: cleanup INTEGER, INTENT(OUT) :: total_error - + CHARACTER(LEN=14), PARAMETER :: filename="chunk_cache" CHARACTER(LEN=80) :: fix_filename - INTEGER(hid_t) :: fid = -1 ! /* File ID */ + INTEGER(hid_t) :: fid = -1 ! File ID INTEGER(hid_t) :: file - INTEGER(hid_t) :: fapl_local = -1 ! /* Local fapl */ - INTEGER(hid_t) :: fapl_def = -1 ! /* Default fapl */ - INTEGER(hid_t) :: dcpl = -1 !/* Dataset creation property list ID */ - INTEGER(hid_t) :: dapl1 = -1 !/* Dataset access property list ID */ - INTEGER(hid_t) :: dapl2 = -1 !/* Dataset access property list ID */ - INTEGER(hid_t) :: sid = -1 !/* Dataspace ID */ - INTEGER(hid_t) :: dsid = -1 !/* Dataset ID */ - INTEGER(hsize_t), DIMENSION(1:1) :: chunk_dim, NDIM = (/100/) !/* Dataset and chunk dimensions */ - INTEGER(size_t) :: nslots_1, nslots_2, nslots_3, nslots_4 !/* rdcc number of elements */ - INTEGER(size_t) :: nbytes_1, nbytes_2, nbytes_3, nbytes_4 !/* rdcc number of bytes */ + INTEGER(hid_t) :: fapl_local = -1 ! Local fapl + INTEGER(hid_t) :: fapl_def = -1 ! Default fapl + INTEGER(hid_t) :: dcpl = -1 ! Dataset creation property list ID + INTEGER(hid_t) :: dapl1 = -1 ! Dataset access property list ID + INTEGER(hid_t) :: dapl2 = -1 ! Dataset access property list ID + INTEGER(hid_t) :: sid = -1 ! Dataspace ID + INTEGER(hid_t) :: dsid = -1 ! Dataset ID + INTEGER(hsize_t), DIMENSION(1:1) :: chunk_dim, NDIM = (/100/) ! Dataset and chunk dimensions + INTEGER(size_t) :: nslots_1, nslots_2, nslots_3, nslots_4 ! rdcc number of elements + INTEGER(size_t) :: nbytes_1, nbytes_2, nbytes_3, nbytes_4 ! rdcc number of bytes INTEGER :: mdc_nelmts - INTEGER(size_t) ::nlinks !/* Number of link traversals */ - REAL :: w0_1, w0_2, w0_3, w0_4; !/* rdcc preemption policy */ + INTEGER(size_t) ::nlinks ! Number of link traversals + REAL :: w0_1, w0_2, w0_3, w0_4 ! rdcc preemption policy INTEGER :: error INTEGER(size_t) rdcc_nelmts INTEGER(size_t) rdcc_nbytes @@ -462,7 +453,7 @@ SUBROUTINE test_chunk_cache(cleanup, total_error) STOP ENDIF - !/* Create a default fapl and dapl */ + ! Create a default fapl and dapl CALL H5Pcreate_f(H5P_FILE_ACCESS_F, fapl_def, error) CALL check("H5Pcreate_f", error, total_error) CALL H5Pcreate_f(H5P_DATASET_ACCESS_F, dapl1, error) @@ -481,7 +472,7 @@ SUBROUTINE test_chunk_cache(cleanup, total_error) CALL VERIFYlogical("H5Pget_chunk_cache_f", .TRUE., .FALSE., total_error) ENDIF - ! /* Set a lapl property on dapl1 (to verify inheritance) */ + ! Set a lapl property on dapl1 (to verify inheritance) CALL H5Pset_nlinks_f(dapl1, 134_size_t , error) CALL check("H5Pset_nlinks_f", error, total_error) CALL H5Pget_nlinks_f(dapl1, nlinks, error) @@ -494,7 +485,7 @@ SUBROUTINE test_chunk_cache(cleanup, total_error) ! Turn off the chunk cache, so all the chunks are immediately written to disk CALL H5Pget_cache_f(fapl_local, mdc_nelmts, rdcc_nelmts, rdcc_nbytes, rdcc_w0, error) CALL check("H5Pget_cache_f", error, total_error) - rdcc_nbytes = 0; + rdcc_nbytes = 0 CALL H5Pset_cache_f(fapl_local, mdc_nelmts, rdcc_nelmts, rdcc_nbytes, rdcc_w0, error) CALL check("H5Pset_cache_f", error, total_error) @@ -506,29 +497,29 @@ SUBROUTINE test_chunk_cache(cleanup, total_error) CALL H5Pset_cache_f(fapl_local, 0, nslots_2, nbytes_2, w0_2, error) CALL check("H5Pset_cache_f", error, total_error) - !/* Create file */ + ! Create file CALL H5Fcreate_f(fix_filename, H5F_ACC_TRUNC_F, fid, error, H5P_DEFAULT_F, fapl_local) CALL check("H5Fcreate_f", error, total_error) - !/* Create dataset creation property list */ + ! Create dataset creation property list CALL H5Pcreate_f(H5P_DATASET_CREATE_F, dcpl, error) CALL check("H5Pcreate_f", error, total_error) - !/* Set chunking */ - chunk_dim(1) = 10; + ! Set chunking + chunk_dim(1) = 10 CALL H5Pset_chunk_f(dcpl, 1, chunk_dim, error) CALL check("H5Pset_chunk_f", error, total_error) - !/* Create 1-D dataspace */ + ! Create 1-D dataspace ndim(1) = 100 CALL H5Screate_simple_f(1, ndim, sid, error) CALL check("H5Pcreate_f", error, total_error) - ! /* Create dataset with default dapl */ + ! Create dataset with default dapl CALL H5Dcreate_f(fid, "dset", H5T_NATIVE_INTEGER, sid, dsid, error, dcpl, H5P_DEFAULT_F, dapl1) CALL check("H5Pcreate_f", error, total_error) - ! /* Retrieve dapl from dataset, verify cache values are the same as on fapl_local */ + ! Retrieve dapl from dataset, verify cache values are the same as on fapl_local CALL H5Dget_access_plist_f(dsid, dapl2, error) CALL check("H5Dget_access_plist_f", error, total_error) CALL H5Pget_chunk_cache_f(dapl2, nslots_4, nbytes_4, w0_4, error) @@ -538,7 +529,8 @@ SUBROUTINE test_chunk_cache(cleanup, total_error) IF(w0_2.NE.w0_4)THEN CALL VERIFYlogical("H5Pget_chunk_cache_f", .TRUE., .FALSE., total_error) ENDIF - CALL H5Pclose_f(dapl2,error); CALL check("H5Pclose_f", error, total_error) + CALL H5Pclose_f(dapl2,error) + CALL check("H5Pclose_f", error, total_error) ! Set new values on dapl1. nbytes will be set to default, so the file ! property will override this setting @@ -550,7 +542,7 @@ SUBROUTINE test_chunk_cache(cleanup, total_error) CALL H5Pset_chunk_cache_f(dapl1, nslots_3, nbytes_3, w0_3, error) CALL check("H5Pset_chunk_cache_f", error, total_error) - ! Close dataset, reopen with dapl1. Note the use of a dapl with H5Oopen */ + ! Close dataset, reopen with dapl1. Note the use of a dapl with H5Oopen CALL H5Dclose_f(dsid, error) CALL H5Oopen_f(fid, "dset", dsid, error, dapl1) @@ -569,10 +561,12 @@ SUBROUTINE test_chunk_cache(cleanup, total_error) IF(w0_3.NE.w0_4)THEN CALL VERIFYlogical("H5Pget_chunk_cache_f4", .TRUE., .FALSE., total_error) ENDIF - CALL H5Pclose_f(dapl2,error); CALL check("H5Pclose_f", error, total_error) + CALL H5Pclose_f(dapl2,error) + CALL check("H5Pclose_f", error, total_error) ! Close dataset, reopen with H5P_DEFAULT as dapl - CALL H5Dclose_f(dsid, error); CALL check("H5Dclose_f", error, total_error) + CALL H5Dclose_f(dsid, error) + CALL check("H5Dclose_f", error, total_error) CALL H5Oopen_f(fid, "dset", dsid, error) CALL check("H5Oopen_f", error, total_error) @@ -587,10 +581,12 @@ SUBROUTINE test_chunk_cache(cleanup, total_error) IF(w0_2.NE.w0_4)THEN CALL VERIFYlogical("H5Pget_chunk_cache_f", .TRUE., .FALSE., total_error) ENDIF - CALL H5Pclose_f(dapl2,error); CALL check("H5Pclose_f", error, total_error) + CALL H5Pclose_f(dapl2,error) + CALL check("H5Pclose_f", error, total_error) ! Similary, test use of H5Dcreate2 with H5P_DEFAULT - CALL H5Dclose_f(dsid, error); CALL check("H5Dclose_f", error, total_error) + CALL H5Dclose_f(dsid, error) + CALL check("H5Dclose_f", error, total_error) CALL H5Dcreate_f(fid, "dset2", H5T_NATIVE_INTEGER, sid, dsid, error, dcpl, H5P_DEFAULT_F, H5P_DEFAULT_F) CALL check("H5Pcreate_f", error, total_error) @@ -615,8 +611,10 @@ SUBROUTINE test_chunk_cache(cleanup, total_error) ! Close and reopen file with new fapl_local - CALL H5Dclose_f(dsid, error); CALL check("H5Dclose_f", error, total_error) - CALL H5Fclose_f(fid,error); CALL check("h5fclose_f", error, total_error) + CALL H5Dclose_f(dsid, error) + CALL check("H5Dclose_f", error, total_error) + CALL H5Fclose_f(fid,error) + CALL check("h5fclose_f", error, total_error) CALL H5Fopen_f (fix_filename, H5F_ACC_RDWR_F, fid, error, fapl_local) CALL check("h5fopen_f", error, total_error) @@ -628,7 +626,8 @@ SUBROUTINE test_chunk_cache(cleanup, total_error) CALL h5dopen_f (fid, "dset", dsid, error, dapl2) CALL check("h5dopen_f", error, total_error) - CALL H5Pclose_f(dapl2,error); CALL check("H5Pclose_f", error, total_error) ! Close dapl2, to avoid id leak + CALL H5Pclose_f(dapl2,error) + CALL check("H5Pclose_f", error, total_error) ! Close dapl2, to avoid id leak CALL H5Dget_access_plist_f(dsid, dapl2, error) CALL check("H5Dget_access_plist_f", error, total_error) @@ -647,11 +646,13 @@ SUBROUTINE test_chunk_cache(cleanup, total_error) CALL H5Pset_chunk_cache_f(dapl2, nslots_2, nbytes_2, w0_2, error) CALL check("H5Pset_chunk_cache_f", error, total_error) - CALL H5Dclose_f(dsid, error); CALL check("H5Dclose_f", error, total_error) + CALL H5Dclose_f(dsid, error) + CALL check("H5Dclose_f", error, total_error) CALL h5dopen_f (fid, "dset", dsid, error, dapl2) CALL check("h5dopen_f", error, total_error) - CALL H5Pclose_f(dapl2,error); CALL check("H5Pclose_f", error, total_error) + CALL H5Pclose_f(dapl2,error) + CALL check("H5Pclose_f", error, total_error) CALL H5Dget_access_plist_f(dsid, dapl2, error) CALL check("H5Dget_access_plist_f", error, total_error) @@ -665,17 +666,24 @@ SUBROUTINE test_chunk_cache(cleanup, total_error) ! Close - CALL H5Dclose_f(dsid, error); CALL check("H5Dclose_f", error, total_error) - CALL H5Sclose_f(sid,error); CALL check("H5Sclose_f", error, total_error) - CALL H5Pclose_f(fapl_local,error); CALL check("H5Pclose_f", error, total_error) - CALL H5Pclose_f(fapl_def,error); CALL check("H5Pclose_f", error, total_error) - CALL H5Pclose_f(dapl1,error); CALL check("H5Pclose_f", error, total_error) - CALL H5Pclose_f(dapl2,error); CALL check("H5Pclose_f", error, total_error) - CALL H5Pclose_f(dcpl,error); CALL check("H5Pclose_f", error, total_error) - CALL H5Fclose_f(fid,error); CALL check("H5Fclose_f", error, total_error) + CALL H5Dclose_f(dsid, error) + CALL check("H5Dclose_f", error, total_error) + CALL H5Sclose_f(sid,error) + CALL check("H5Sclose_f", error, total_error) + CALL H5Pclose_f(fapl_local,error) + CALL check("H5Pclose_f", error, total_error) + CALL H5Pclose_f(fapl_def,error) + CALL check("H5Pclose_f", error, total_error) + CALL H5Pclose_f(dapl1,error) + CALL check("H5Pclose_f", error, total_error) + CALL H5Pclose_f(dapl2,error) + CALL check("H5Pclose_f", error, total_error) + CALL H5Pclose_f(dcpl,error) + CALL check("H5Pclose_f", error, total_error) + CALL H5Fclose_f(fid,error) + CALL check("H5Fclose_f", error, total_error) IF(cleanup) CALL h5_cleanup_f(filename, H5P_DEFAULT_F, error) CALL check("h5_cleanup_f", error, total_error) END SUBROUTINE test_chunk_cache - diff --git a/fortran/test/tH5P_F03.f90 b/fortran/test/tH5P_F03.f90 index aec8a26..02ca9dc 100644 --- a/fortran/test/tH5P_F03.f90 +++ b/fortran/test/tH5P_F03.f90 @@ -362,3 +362,144 @@ SUBROUTINE test_genprop_class_callback(total_error) CALL check("h5pclose_class_f", error, total_error) END SUBROUTINE test_genprop_class_callback + +!------------------------------------------------------------------------- +! Function: external_test_offset +! +! Purpose: Tests APIs: +! h5pset_external_f (with offsets not equal to zero), h5pget_external_f +! +! Return: Success: 0 +! Failure: -1 +! +! FORTRAN Programmer: M. Scot Breitenfeld +! January 10, 2012 +!------------------------------------------------------------------------- +! +SUBROUTINE external_test_offset(cleanup,total_error) + + USE ISO_C_BINDING + USE HDF5 ! This module contains all necessary modules + + IMPLICIT NONE + INTEGER, INTENT(OUT) :: total_error + LOGICAL, INTENT(IN) :: cleanup + + INTEGER(hid_t) :: fapl=-1 ! file access property list + INTEGER(hid_t) :: file=-1 ! file to write to + INTEGER(hid_t) :: dcpl=-1 ! dataset creation properties + INTEGER(hid_t) :: space=-1 ! data space + INTEGER(hid_t) :: dset=-1 ! dataset + INTEGER(hid_t) :: grp=-1 ! group to emit diagnostics + INTEGER(size_t) :: i, j ! miscellaneous counters + CHARACTER(LEN=180) :: filename ! file names + INTEGER, DIMENSION(1:25) :: part ! raw data buffers + INTEGER, DIMENSION(1:100), TARGET :: whole ! raw data buffers + INTEGER(hsize_t), DIMENSION(1:1) :: cur_size ! current data space size + INTEGER(hid_t) :: hs_space ! hyperslab data space + INTEGER(hsize_t), DIMENSION(1:1) :: hs_start = (/30/) ! hyperslab starting offset + INTEGER(hsize_t), DIMENSION(1:1) :: hs_count = (/25/) ! hyperslab size + CHARACTER(LEN=1) :: ichr1 ! character conversion holder + INTEGER :: error ! error status + TYPE(C_PTR) :: f_ptr ! fortran pointer + + CHARACTER(LEN=1,KIND=C_CHAR), DIMENSION(1:30) :: temparray + + temparray(1:30)(1:1) = '0' ! 1 byte character + + ! Write the data to external files directly + DO i = 1, 4 + DO j = 1, 25 + part(j) = (i-1)*25+(j-1) + ENDDO + WRITE(ichr1,'(I1.1)') i + filename = "extern_"//ichr1//"a.raw" + OPEN(10, FILE=filename, ACCESS='STREAM', form='UNFORMATTED') + + WRITE(10) temparray(1:(i-1)*10) + WRITE(10) part + CLOSE(10) + ENDDO + ! + ! Create the file and an initial group. + CALL h5pcreate_f(H5P_FILE_ACCESS_F, fapl, error) + CALL h5fcreate_f('extren_raw.h5', H5F_ACC_TRUNC_F, file, error, access_prp=fapl) + CALL check("h5fcreate_f",error,total_error) + + CALL h5gcreate_f(file, "emit-diagnostics", grp, error) + CALL check("h5gcreate_f",error, total_error) + + ! Create the dataset + CALL h5pcreate_f(H5P_DATASET_CREATE_F, dcpl, error) + CALL check("h5pcreate_f", error, total_error) + CALL h5pset_external_f(dcpl, "extern_1a.raw", INT(0,off_t), INT(SIZEOF(part), hsize_t), error) + CALL check("h5pset_external_f",error,total_error) + CALL h5pset_external_f(dcpl, "extern_2a.raw", INT(10,off_t), INT(SIZEOF(part), hsize_t), error) + CALL check("h5pset_external_f",error,total_error) + CALL h5pset_external_f(dcpl, "extern_3a.raw", INT(20,off_t), INT(SIZEOF(part), hsize_t), error) + CALL check("h5pset_external_f",error,total_error) + CALL h5pset_external_f(dcpl, "extern_4a.raw", INT(30,off_t), INT(SIZEOF(part), hsize_t), error) + CALL check("h5pset_external_f",error,total_error) + + cur_size(1) = 100 + CALL h5screate_simple_f(1, cur_size, space, error) + CALL check("h5screate_simple_f", error, total_error) + CALL h5dcreate_f(file, "dset1", H5T_NATIVE_INTEGER, space, dset,error,dcpl_id=dcpl) + CALL check("h5dcreate_f", error, total_error) + + ! + ! Read the entire dataset and compare with the original + whole(:) = 0 + f_ptr = C_LOC(whole(1)) + CALL h5dread_f(dset, H5T_NATIVE_INTEGER, f_ptr, error, mem_space_id=space, file_space_id=space) + CALL check("h5dread_f", error, total_error) + + DO i = 1, 100 + IF(whole(i) .NE. i-1)THEN + WRITE(*,*) "Incorrect value(s) read." + total_error = total_error + 1 + EXIT + ENDIF + ENDDO + ! + ! Read the middle of the dataset + CALL h5scopy_f(space, hs_space, error) + CALL check("h5scopy_f", error, total_error) + CALL h5sselect_hyperslab_f(hs_space, H5S_SELECT_SET_F, hs_start, hs_count, error) + CALL check("h5sselect_hyperslab_f", error, total_error) + + whole(:) = 0 + f_ptr = C_LOC(whole(1)) + CALL h5dread_f(dset, H5T_NATIVE_INTEGER, f_ptr, error, mem_space_id=hs_space, file_space_id=hs_space) + CALL check("h5dread_f", error, total_error) + + CALL h5sclose_f(hs_space, error) + CALL check("h5sclose_f", error, total_error) + DO i = hs_start(1)+1, hs_start(1)+hs_count(1) + IF(whole(i) .NE. i-1)THEN + WRITE(*,*) "Incorrect value(s) read." + total_error = total_error + 1 + EXIT + ENDIF + ENDDO + + CALL h5dclose_f(dset, error) + CALL check("h5dclose_f", error, total_error) + CALL h5pclose_f(dcpl, error) + CALL check("h5pclose_f", error, total_error) + CALL h5sclose_f(space, error) + CALL check("h5sclose_f", error, total_error) + CALL h5fclose_f(file, error) + CALL check("h5fclose_f", error, total_error) + + ! cleanup + DO i = 1, 4 + WRITE(ichr1,'(I1.1)') i + filename = "extern_"//ichr1//"a.raw" + CALL h5_cleanup_f(filename, H5P_DEFAULT_F, error) + CALL check("h5_cleanup_f", error, total_error) + ENDDO + IF(cleanup) CALL h5_cleanup_f("extren_raw.h5", H5P_DEFAULT_F, error) + CALL check("h5_cleanup_f", error, total_error) + +END SUBROUTINE external_test_offset diff --git a/fortran/test/tH5T_F03.f90 b/fortran/test/tH5T_F03.f90 index 7336cf7..f7efcc4 100644 --- a/fortran/test/tH5T_F03.f90 +++ b/fortran/test/tH5T_F03.f90 @@ -405,7 +405,7 @@ END SUBROUTINE test_array_compound_atomic CALL check("h5tarray_create_f", error, total_error) ! Insert character array field - CALL h5tinsert_f(tid2, "c", H5OFFSETOF(C_LOC(wdata(1,1)),C_LOC(wdata(1,1)%c(1))), tid4, error) + CALL h5tinsert_f(tid2, "c", H5OFFSETOF(C_LOC(wdata(1,1)),C_LOC(wdata(1,1)%c(1)(1:1))), tid4, error) CALL check("h5tinsert2_f", error, total_error) ! Close array of floats field datatype @@ -551,7 +551,7 @@ END SUBROUTINE test_array_compound_atomic CALL H5Tget_member_offset_f(tid2, 2, off, error) CALL check("H5Tget_member_offset_f", error, total_error) CALL VERIFY("H5Tget_member_offset_f",INT(off),& - INT(H5OFFSETOF(C_LOC(wdata(1,1)),C_LOC(wdata(1,1)%c(1)))), total_error) + INT(H5OFFSETOF(C_LOC(wdata(1,1)),C_LOC(wdata(1,1)%c(1)(1:1)))), total_error) ! Check the 3rd field's datatype CALL H5Tget_member_type_f(tid2, 2, mtid2, error) @@ -1710,7 +1710,7 @@ SUBROUTINE t_opaque(total_error) ! CALL h5dcreate_f(file, dataset, dtype, space, dset, error) CALL check("h5dcreate_f",error, total_error) - f_ptr = C_LOC(wdata(1)) + f_ptr = C_LOC(wdata(1)(1:1)) CALL h5dwrite_f(dset, dtype, f_ptr, error) CALL check("h5dwrite_f",error, total_error) ! @@ -1774,7 +1774,7 @@ SUBROUTINE t_opaque(total_error) ! ! Read the data. ! - f_ptr = C_LOC(rdata(1)) + f_ptr = C_LOC(rdata(1)(1:1)) CALL h5dread_f(dset, dtype, f_ptr, error) CALL check("H5Dread_f",error, total_error) ! @@ -2123,7 +2123,7 @@ SUBROUTINE t_regref(total_error) CALL h5screate_simple_f(1, dims3, memspace, error) CALL check("h5screate_simple_f",error, total_error) - f_ptr = C_LOC(rdata2(1)) + f_ptr = C_LOC(rdata2(1)(1:1)) CALL h5dread_f( dset2, H5T_NATIVE_INTEGER_1, f_ptr, error, memspace, space) CALL check("H5Dread_f",error, total_error) CALL verifystring("h5dread_f",rdata2(1)(1:npoints),TRIM(chrref_correct(i)), total_error) @@ -2473,24 +2473,24 @@ SUBROUTINE t_vlstring_readwrite(total_error) ! Initialize array of C pointers - wdata(1) = C_LOC(A(1)) - wdata(2) = C_LOC(B(1)) - wdata(3) = C_LOC(C(1)) - wdata(4) = C_LOC(D(1)) + wdata(1) = C_LOC(A(1)(1:1)) + wdata(2) = C_LOC(B(1)(1:1)) + wdata(3) = C_LOC(C(1)(1:1)) + wdata(4) = C_LOC(D(1)(1:1)) data_w(1) = A(1) data_w(2) = B(1) data_w(3) = C(1) data_w(4) = D(1) - wdata2D(1,1) = C_LOC(A11(1)) - wdata2D(1,2) = C_LOC(A12(1)) - wdata2D(1,3) = C_LOC(A13(1)) - wdata2D(1,4) = C_LOC(A14(1)) - wdata2D(2,1) = C_LOC(A21(1)) - wdata2D(2,2) = C_LOC(A22(1)) - wdata2D(2,3) = C_LOC(A23(1)) - wdata2D(2,4) = C_LOC(A24(1)) + wdata2D(1,1) = C_LOC(A11(1)(1:1)) + wdata2D(1,2) = C_LOC(A12(1)(1:1)) + wdata2D(1,3) = C_LOC(A13(1)(1:1)) + wdata2D(1,4) = C_LOC(A14(1)(1:1)) + wdata2D(2,1) = C_LOC(A21(1)(1:1)) + wdata2D(2,2) = C_LOC(A22(1)(1:1)) + wdata2D(2,3) = C_LOC(A23(1)(1:1)) + wdata2D(2,4) = C_LOC(A24(1)(1:1)) data2D_w(1,1) = A11(1) data2D_w(1,2) = A12(1) diff --git a/fortran/testpar/Makefile.in b/fortran/testpar/Makefile.in index 1cbc87e..9a93367 100644 --- a/fortran/testpar/Makefile.in +++ b/fortran/testpar/Makefile.in @@ -229,6 +229,7 @@ H5_VERSION = @H5_VERSION@ HADDR_T = @HADDR_T@ HAVE_DMALLOC = @HAVE_DMALLOC@ HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@ +HAVE_PTHREAD = @HAVE_PTHREAD@ HDF5_HL = @HDF5_HL@ HDF5_INTERFACES = @HDF5_INTERFACES@ HDF_CXX = @HDF_CXX@ @@ -280,7 +281,6 @@ PACKAGE_VERSION = @PACKAGE_VERSION@ PARALLEL = @PARALLEL@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ -PTHREAD = @PTHREAD@ RANLIB = @RANLIB@ ROOT = @ROOT@ RUNPARALLEL = @RUNPARALLEL@ diff --git a/hl/Makefile.in b/hl/Makefile.in index dddd693..786bfba 100644 --- a/hl/Makefile.in +++ b/hl/Makefile.in @@ -231,6 +231,7 @@ H5_VERSION = @H5_VERSION@ HADDR_T = @HADDR_T@ HAVE_DMALLOC = @HAVE_DMALLOC@ HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@ +HAVE_PTHREAD = @HAVE_PTHREAD@ HDF5_HL = @HDF5_HL@ HDF5_INTERFACES = @HDF5_INTERFACES@ HDF_CXX = @HDF_CXX@ @@ -282,7 +283,6 @@ PACKAGE_VERSION = @PACKAGE_VERSION@ PARALLEL = @PARALLEL@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ -PTHREAD = @PTHREAD@ RANLIB = @RANLIB@ ROOT = @ROOT@ RUNPARALLEL = @RUNPARALLEL@ diff --git a/hl/c++/Makefile.in b/hl/c++/Makefile.in index 4a33b33..60baefe 100644 --- a/hl/c++/Makefile.in +++ b/hl/c++/Makefile.in @@ -227,6 +227,7 @@ H5_VERSION = @H5_VERSION@ HADDR_T = @HADDR_T@ HAVE_DMALLOC = @HAVE_DMALLOC@ HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@ +HAVE_PTHREAD = @HAVE_PTHREAD@ HDF5_HL = @HDF5_HL@ HDF5_INTERFACES = @HDF5_INTERFACES@ HDF_CXX = @HDF_CXX@ @@ -278,7 +279,6 @@ PACKAGE_VERSION = @PACKAGE_VERSION@ PARALLEL = @PARALLEL@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ -PTHREAD = @PTHREAD@ RANLIB = @RANLIB@ ROOT = @ROOT@ RUNPARALLEL = @RUNPARALLEL@ diff --git a/hl/c++/examples/Makefile.in b/hl/c++/examples/Makefile.in index f617fec..8297d0a 100644 --- a/hl/c++/examples/Makefile.in +++ b/hl/c++/examples/Makefile.in @@ -193,6 +193,7 @@ H5_VERSION = @H5_VERSION@ HADDR_T = @HADDR_T@ HAVE_DMALLOC = @HAVE_DMALLOC@ HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@ +HAVE_PTHREAD = @HAVE_PTHREAD@ HDF5_HL = @HDF5_HL@ HDF5_INTERFACES = @HDF5_INTERFACES@ HDF_CXX = @HDF_CXX@ @@ -244,7 +245,6 @@ PACKAGE_VERSION = @PACKAGE_VERSION@ PARALLEL = @PARALLEL@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ -PTHREAD = @PTHREAD@ RANLIB = @RANLIB@ ROOT = @ROOT@ RUNPARALLEL = @RUNPARALLEL@ diff --git a/hl/c++/src/Makefile.in b/hl/c++/src/Makefile.in index 149fd6d..89aee46 100644 --- a/hl/c++/src/Makefile.in +++ b/hl/c++/src/Makefile.in @@ -260,6 +260,7 @@ H5_VERSION = @H5_VERSION@ HADDR_T = @HADDR_T@ HAVE_DMALLOC = @HAVE_DMALLOC@ HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@ +HAVE_PTHREAD = @HAVE_PTHREAD@ HDF5_HL = @HDF5_HL@ HDF5_INTERFACES = @HDF5_INTERFACES@ HDF_CXX = @HDF_CXX@ @@ -311,7 +312,6 @@ PACKAGE_VERSION = @PACKAGE_VERSION@ PARALLEL = @PARALLEL@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ -PTHREAD = @PTHREAD@ RANLIB = @RANLIB@ ROOT = @ROOT@ RUNPARALLEL = @RUNPARALLEL@ @@ -458,7 +458,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 134 +LT_VERS_REVISION = 138 LT_VERS_AGE = 0 # Include src directory diff --git a/hl/c++/test/Makefile.in b/hl/c++/test/Makefile.in index 0213f38..f8ad89b 100644 --- a/hl/c++/test/Makefile.in +++ b/hl/c++/test/Makefile.in @@ -226,6 +226,7 @@ H5_VERSION = @H5_VERSION@ HADDR_T = @HADDR_T@ HAVE_DMALLOC = @HAVE_DMALLOC@ HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@ +HAVE_PTHREAD = @HAVE_PTHREAD@ HDF5_HL = @HDF5_HL@ HDF5_INTERFACES = @HDF5_INTERFACES@ HDF_CXX = @HDF_CXX@ @@ -277,7 +278,6 @@ PACKAGE_VERSION = @PACKAGE_VERSION@ PARALLEL = @PARALLEL@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ -PTHREAD = @PTHREAD@ RANLIB = @RANLIB@ ROOT = @ROOT@ RUNPARALLEL = @RUNPARALLEL@ diff --git a/hl/examples/Makefile.in b/hl/examples/Makefile.in index f6126d4..2713377 100644 --- a/hl/examples/Makefile.in +++ b/hl/examples/Makefile.in @@ -193,6 +193,7 @@ H5_VERSION = @H5_VERSION@ HADDR_T = @HADDR_T@ HAVE_DMALLOC = @HAVE_DMALLOC@ HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@ +HAVE_PTHREAD = @HAVE_PTHREAD@ HDF5_HL = @HDF5_HL@ HDF5_INTERFACES = @HDF5_INTERFACES@ HDF_CXX = @HDF_CXX@ @@ -244,7 +245,6 @@ PACKAGE_VERSION = @PACKAGE_VERSION@ PARALLEL = @PARALLEL@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ -PTHREAD = @PTHREAD@ RANLIB = @RANLIB@ ROOT = @ROOT@ RUNPARALLEL = @RUNPARALLEL@ diff --git a/hl/fortran/Makefile.in b/hl/fortran/Makefile.in index 6fe288c..8b7f728 100644 --- a/hl/fortran/Makefile.in +++ b/hl/fortran/Makefile.in @@ -231,6 +231,7 @@ H5_VERSION = @H5_VERSION@ HADDR_T = @HADDR_T@ HAVE_DMALLOC = @HAVE_DMALLOC@ HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@ +HAVE_PTHREAD = @HAVE_PTHREAD@ HDF5_HL = @HDF5_HL@ HDF5_INTERFACES = @HDF5_INTERFACES@ HDF_CXX = @HDF_CXX@ @@ -282,7 +283,6 @@ PACKAGE_VERSION = @PACKAGE_VERSION@ PARALLEL = @PARALLEL@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ -PTHREAD = @PTHREAD@ RANLIB = @RANLIB@ ROOT = @ROOT@ RUNPARALLEL = @RUNPARALLEL@ diff --git a/hl/fortran/examples/Makefile.in b/hl/fortran/examples/Makefile.in index 7dd855b..9f08f21 100644 --- a/hl/fortran/examples/Makefile.in +++ b/hl/fortran/examples/Makefile.in @@ -194,6 +194,7 @@ H5_VERSION = @H5_VERSION@ HADDR_T = @HADDR_T@ HAVE_DMALLOC = @HAVE_DMALLOC@ HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@ +HAVE_PTHREAD = @HAVE_PTHREAD@ HDF5_HL = @HDF5_HL@ HDF5_INTERFACES = @HDF5_INTERFACES@ HDF_CXX = @HDF_CXX@ @@ -245,7 +246,6 @@ PACKAGE_VERSION = @PACKAGE_VERSION@ PARALLEL = @PARALLEL@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ -PTHREAD = @PTHREAD@ RANLIB = @RANLIB@ ROOT = @ROOT@ RUNPARALLEL = @RUNPARALLEL@ diff --git a/hl/fortran/src/Makefile.in b/hl/fortran/src/Makefile.in index d1b1977..fc734df 100644 --- a/hl/fortran/src/Makefile.in +++ b/hl/fortran/src/Makefile.in @@ -276,6 +276,7 @@ H5_VERSION = @H5_VERSION@ HADDR_T = @HADDR_T@ HAVE_DMALLOC = @HAVE_DMALLOC@ HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@ +HAVE_PTHREAD = @HAVE_PTHREAD@ HDF5_HL = @HDF5_HL@ HDF5_INTERFACES = @HDF5_INTERFACES@ HDF_CXX = @HDF_CXX@ @@ -327,7 +328,6 @@ PACKAGE_VERSION = @PACKAGE_VERSION@ PARALLEL = @PARALLEL@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ -PTHREAD = @PTHREAD@ RANLIB = @RANLIB@ ROOT = @ROOT@ RUNPARALLEL = @RUNPARALLEL@ @@ -474,7 +474,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 134 +LT_VERS_REVISION = 138 LT_VERS_AGE = 0 INCLUDES = -I$(top_srcdir)/src -I$(top_srcdir)/hl/src -I$(top_builddir)/hl/src \ -I$(top_srcdir)/fortran/src -I$(top_builddir)/fortran/src diff --git a/hl/fortran/test/Makefile.in b/hl/fortran/test/Makefile.in index 7e69b79..2acee8c 100644 --- a/hl/fortran/test/Makefile.in +++ b/hl/fortran/test/Makefile.in @@ -240,6 +240,7 @@ H5_VERSION = @H5_VERSION@ HADDR_T = @HADDR_T@ HAVE_DMALLOC = @HAVE_DMALLOC@ HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@ +HAVE_PTHREAD = @HAVE_PTHREAD@ HDF5_HL = @HDF5_HL@ HDF5_INTERFACES = @HDF5_INTERFACES@ HDF_CXX = @HDF_CXX@ @@ -291,7 +292,6 @@ PACKAGE_VERSION = @PACKAGE_VERSION@ PARALLEL = @PARALLEL@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ -PTHREAD = @PTHREAD@ RANLIB = @RANLIB@ ROOT = @ROOT@ RUNPARALLEL = @RUNPARALLEL@ diff --git a/hl/src/Makefile.in b/hl/src/Makefile.in index afef6f7..bd46a70 100644 --- a/hl/src/Makefile.in +++ b/hl/src/Makefile.in @@ -259,6 +259,7 @@ H5_VERSION = @H5_VERSION@ HADDR_T = @HADDR_T@ HAVE_DMALLOC = @HAVE_DMALLOC@ HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@ +HAVE_PTHREAD = @HAVE_PTHREAD@ HDF5_HL = @HDF5_HL@ HDF5_INTERFACES = @HDF5_INTERFACES@ HDF_CXX = @HDF_CXX@ @@ -310,7 +311,6 @@ PACKAGE_VERSION = @PACKAGE_VERSION@ PARALLEL = @PARALLEL@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ -PTHREAD = @PTHREAD@ RANLIB = @RANLIB@ ROOT = @ROOT@ RUNPARALLEL = @RUNPARALLEL@ @@ -457,7 +457,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 134 +LT_VERS_REVISION = 138 LT_VERS_AGE = 0 # This library is our main target. diff --git a/hl/test/Makefile.in b/hl/test/Makefile.in index ad3f370..30b329e 100644 --- a/hl/test/Makefile.in +++ b/hl/test/Makefile.in @@ -267,6 +267,7 @@ H5_VERSION = @H5_VERSION@ HADDR_T = @HADDR_T@ HAVE_DMALLOC = @HAVE_DMALLOC@ HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@ +HAVE_PTHREAD = @HAVE_PTHREAD@ HDF5_HL = @HDF5_HL@ HDF5_INTERFACES = @HDF5_INTERFACES@ HDF_CXX = @HDF_CXX@ @@ -318,7 +319,6 @@ PACKAGE_VERSION = @PACKAGE_VERSION@ PARALLEL = @PARALLEL@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ -PTHREAD = @PTHREAD@ RANLIB = @RANLIB@ ROOT = @ROOT@ RUNPARALLEL = @RUNPARALLEL@ diff --git a/hl/tools/Makefile.in b/hl/tools/Makefile.in index 23baa17..eca7b8f 100644 --- a/hl/tools/Makefile.in +++ b/hl/tools/Makefile.in @@ -228,6 +228,7 @@ H5_VERSION = @H5_VERSION@ HADDR_T = @HADDR_T@ HAVE_DMALLOC = @HAVE_DMALLOC@ HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@ +HAVE_PTHREAD = @HAVE_PTHREAD@ HDF5_HL = @HDF5_HL@ HDF5_INTERFACES = @HDF5_INTERFACES@ HDF_CXX = @HDF_CXX@ @@ -279,7 +280,6 @@ PACKAGE_VERSION = @PACKAGE_VERSION@ PARALLEL = @PARALLEL@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ -PTHREAD = @PTHREAD@ RANLIB = @RANLIB@ ROOT = @ROOT@ RUNPARALLEL = @RUNPARALLEL@ diff --git a/hl/tools/gif2h5/Makefile.in b/hl/tools/gif2h5/Makefile.in index 8b98276..3d7e7fe 100644 --- a/hl/tools/gif2h5/Makefile.in +++ b/hl/tools/gif2h5/Makefile.in @@ -242,6 +242,7 @@ H5_VERSION = @H5_VERSION@ HADDR_T = @HADDR_T@ HAVE_DMALLOC = @HAVE_DMALLOC@ HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@ +HAVE_PTHREAD = @HAVE_PTHREAD@ HDF5_HL = @HDF5_HL@ HDF5_INTERFACES = @HDF5_INTERFACES@ HDF_CXX = @HDF_CXX@ @@ -293,7 +294,6 @@ PACKAGE_VERSION = @PACKAGE_VERSION@ PARALLEL = @PARALLEL@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ -PTHREAD = @PTHREAD@ RANLIB = @RANLIB@ ROOT = @ROOT@ RUNPARALLEL = @RUNPARALLEL@ diff --git a/perform/Makefile.in b/perform/Makefile.in index 230469c..4cc5b2b 100644 --- a/perform/Makefile.in +++ b/perform/Makefile.in @@ -268,6 +268,7 @@ H5_VERSION = @H5_VERSION@ HADDR_T = @HADDR_T@ HAVE_DMALLOC = @HAVE_DMALLOC@ HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@ +HAVE_PTHREAD = @HAVE_PTHREAD@ HDF5_HL = @HDF5_HL@ HDF5_INTERFACES = @HDF5_INTERFACES@ HDF_CXX = @HDF_CXX@ @@ -319,7 +320,6 @@ PACKAGE_VERSION = @PACKAGE_VERSION@ PARALLEL = @PARALLEL@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ -PTHREAD = @PTHREAD@ RANLIB = @RANLIB@ ROOT = @ROOT@ RUNPARALLEL = @RUNPARALLEL@ diff --git a/release_docs/CMake.txt b/release_docs/CMake.txt index 029d16d..81dfb61 100644 --- a/release_docs/CMake.txt +++ b/release_docs/CMake.txt @@ -10,7 +10,7 @@ Notes: This short instruction is written for users who want to quickly build www.cmake.org. CMake uses the command line, however the visual CMake tool is - recommended for the configuration step. The steps are similiar for + recommended for the configuration step. The steps are similar for all the operating systems supported by CMake. NOTES: @@ -25,14 +25,14 @@ Notes: This short instruction is written for users who want to quickly build Please send us any comments on how CMake support can be improved on any system. Visit the KitWare site for more information about CMake. - 3. If you are building HDF5 on Windows, do NOT use or execute any - files from the windows folder. - - 4. Build and test results can be submitted to our CDash server at: + 3. Build and test results can be submitted to our CDash server at: cdash.hdfgroup.uiuc.edu. Please read the HDF and CDash document at: www.hdfgroup.org/CDash/HowToSubmit. + 4. See the appendix at the bottom of this file for examples of using + a ctest script for building and testing. + ======================================================================== Preconditions @@ -44,8 +44,7 @@ Notes: This short instruction is written for users who want to quickly build 2. If you plan to use Zlib or Szip; A. Download the packages and install them in a central location. For example on Windows, create a folder extlibs - and install the packages there. Windows users should also read Section V - in INSTALL_Windows.txt. + and install the packages there. B. Use source packages from a SVN server by adding the following CMake options: HDF5_ALLOW_EXTERNAL_SUPPORT:STRING="SVN" @@ -81,8 +80,9 @@ Notes: This short instruction is written for users who want to quickly build available in your Start menu. For Linux, UNIX, and Mac users the executable is named "cmake-gui" and can be found where CMake was installed. - Specify the source and build directories. It is recommemded that you - choose a build directory different then the source directory + Specify the source and build directories. + ***** It is recommemded that you choose a build directory ****** + ***** different then the source directory ****** (for example on Windows, if the source is at c:\MyHDFstuff\hdf5, then use c:\MyHDFstuff\hdf5\build or c:\MyHDFstuff\build\hdf5). @@ -119,24 +119,46 @@ Notes: This short instruction is written for users who want to quickly build * :BOOL=[ON | OFF] is: - # This is the CMakeCache file. - ######################## - # EXTERNAL cache entries - ######################## - SET (BUILD_SHARED_LIBS ON CACHE BOOL "Build Shared Libraries" FORCE) - SET (BUILD_TESTING ON CACHE BOOL "Build HDF5 Unit Testing" FORCE) - SET (HDF5_BUILD_CPP_LIB ON CACHE BOOL "Build HDF5 C++ Library" FORCE) - SET (HDF5_BUILD_EXAMPLES ON CACHE BOOL "Build HDF5 Library Examples" FORCE) - SET (HDF5_BUILD_FORTRAN ON CACHE BOOL "Build FORTRAN support" FORCE) - SET (HDF5_BUILD_HL_LIB ON CACHE BOOL "Build HIGH Level HDF5 Library" FORCE) - SET (HDF5_BUILD_TOOLS ON CACHE BOOL "Build HDF5 Tools" FORCE) - SET (HDF5_DISABLE_COMPILER_WARNINGS OFF CACHE BOOL "Disable compiler warnings" FORCE) - SET (HDF5_ENABLE_HSIZET ON CACHE BOOL "Enable datasets larger than memory" FORCE) - SET (HDF5_ENABLE_PARALLEL OFF CACHE BOOL "Enable parallel build (requires MPI)" FORCE) - SET (HDF5_ENABLE_SZIP_ENCODING ON CACHE BOOL "Use SZip Encoding" FORCE) - SET (HDF5_ENABLE_SZIP_SUPPORT ON CACHE BOOL "Use SZip Filter" FORCE) - SET (HDF5_ENABLE_Z_LIB_SUPPORT ON CACHE BOOL "Enable Zlib Filters" FORCE) - SET (HDF5_ENABLE_COVERAGE OFF CACHE BOOL "Enable code coverage for Libraries and Programs" FORCE) + # This is the CMakeCache file. + ######################## + # EXTERNAL cache entries + ######################## + SET (BUILD_SHARED_LIBS ON CACHE BOOL "Build Shared Libraries" FORCE) + SET (BUILD_TESTING ON CACHE BOOL "Build HDF5 Unit Testing" FORCE) + SET (HDF_PACKAGE_EXT "" CACHE STRING "Name of HDF package extension" FORCE) + SET (HDF5_BUILD_CPP_LIB ON CACHE BOOL "Build HDF5 C++ Library" FORCE) + SET (HDF5_BUILD_EXAMPLES ON CACHE BOOL "Build HDF5 Library Examples" FORCE) + SET (HDF5_BUILD_FORTRAN ON CACHE BOOL "Build FORTRAN support" FORCE) + SET (HDF5_ENABLE_F2003 OFF CACHE BOOL "Enable FORTRAN 2003 Standard" FORCE) + SET (HDF5_BUILD_HL_LIB ON CACHE BOOL "Build HIGH Level HDF5 Library" FORCE) + SET (HDF5_BUILD_TOOLS ON CACHE BOOL "Build HDF5 Tools" FORCE) + SET (HDF5_BUILD_GENERATORS OFF CACHE BOOL "Build Test Generators" FORCE) + SET (HDF5_ENABLE_Z_LIB_SUPPORT ON CACHE BOOL "Enable Zlib Filters" FORCE) + SET (HDF5_ENABLE_SZIP_SUPPORT ON CACHE BOOL "Use SZip Filter" FORCE) + SET (HDF5_ENABLE_SZIP_ENCODING ON CACHE BOOL "Use SZip Encoding" FORCE) + SET (HDF5_ENABLE_HSIZET ON CACHE BOOL "Enable datasets larger than memory" FORCE) + SET (HDF5_ENABLE_UNSUPPORTED OFF CACHE BOOL "Enable unsupported combinations of configuration options" FORCE) + SET (HDF5_ENABLE_DEPRECATED_SYMBOLS ON CACHE BOOL "Enable deprecated public API symbols" FORCE) + SET (HDF5_ENABLE_DIRECT_VFD OFF CACHE BOOL "Build the Direct I/O Virtual File Driver" FORCE) + SET (HDF5_ENABLE_PARALLEL OFF CACHE BOOL "Enable parallel build (requires MPI)" FORCE) + SET (MPIEXEC_MAX_NUMPROCS "3" CACHE STRING "Minimum number of processes for HDF parallel tests" FORCE) + SET (HDF5_BUILD_PARALLEL_ALL OFF CACHE BOOL "Build Parallel Programs" FORCE) + SET (HDF5_ENABLE_COVERAGE OFF CACHE BOOL "Enable code coverage for Libraries and Programs" FORCE) + SET (HDF5_ENABLE_USING_MEMCHECKER OFF CACHE BOOL "Indicate that a memory checker is used" FORCE) + SET (HDF5_DISABLE_COMPILER_WARNINGS OFF CACHE BOOL "Disable compiler warnings" FORCE) + SET (HDF5_USE_FOLDERS ON CACHE BOOL "Enable folder grouping of projects in IDEs." FORCE) + SET (HDF5_USE_16_API_DEFAULT OFF CACHE BOOL "Use the HDF5 1.6.x API by default" FORCE) + SET (HDF5_USE_18_API_DEFAULT OFF CACHE BOOL "Use the HDF5 1.8.x API by default" FORCE) + SET (HDF5_ENABLE_THREADSAFE OFF CACHE BOOL "(WINDOWS)Enable Threadsafety" FORCE) + SET (HDF5_PACKAGE_EXTLIBS OFF CACHE BOOL "(WINDOWS)CPACK - include external libraries" FORCE) + SET (HDF5_NO_PACKAGES OFF CACHE BOOL "CPACK - Disable packaging" FORCE) + SET (HDF5_ALLOW_EXTERNAL_SUPPORT "NO" CACHE STRING "Allow External Library Building" FORCE) + SET (ZLIB_SVN_URL "http://svn.hdfgroup.uiuc.edu/zlib/trunk" CACHE STRING "Use ZLib from HDF repository" FORCE) + SET (SZIP_SVN_URL "http://svn.hdfgroup.uiuc.edu/szip/trunk" CACHE STRING "Use SZip from HDF repository" FORCE) + SET (ZLIB_TGZ_NAME "ZLib.tar.gz" CACHE STRING "Use ZLib from compressed file" FORCE) + SET (SZIP_TGZ_NAME "SZip.tar.gz" CACHE STRING "Use SZip from compressed file" FORCE) + SET (ZLIB_PACKAGE_NAME "zlib" CACHE STRING "Name of ZLIB package" FORCE) + SET (SZIP_PACKAGE_NAME "szip" CACHE STRING "Name of SZIP package" FORCE) 2. Configure the cache settings @@ -323,6 +345,365 @@ IF (HDF5_ENABLE_SZIP_SUPPORT) ************************************************************************ + APPENDIX + +Below are examples of the ctest scripts used by The HDF Group. +See the script, cmakehdf5, in the bin folder for a smaller and limited +function shell script version of the following general scripts. +The example is for a linux machine, but the same scripts can be used on +a windows machine by adjusting the CTEST_CMAKE_GENERATOR option in the +product specific script. + +************************************************************************ + +CTestScript.cmake: common ctest script used to build, test and package +======================================================================== + +cmake_minimum_required(VERSION 2.8.6 FATAL_ERROR) +######################################################## +# This dashboard is maintained by The HDF Group +# For any comments please contact cdashhelp@hdfgroup.org +# +######################################################## +# ----------------------------------------------------------- +# -- Get environment +# ----------------------------------------------------------- +if(NOT SITE_OS_NAME) + ## machine name not provided - attempt to discover with uname + ## -- set hostname + ## -------------------------- + find_program(HOSTNAME_CMD NAMES hostname) + exec_program(${HOSTNAME_CMD} ARGS OUTPUT_VARIABLE HOSTNAME) + set(CTEST_SITE "${HOSTNAME}${CTEST_SITE_EXT}") + find_program(UNAME NAMES uname) + macro(getuname name flag) + exec_program("${UNAME}" ARGS "${flag}" OUTPUT_VARIABLE "${name}") + endmacro(getuname) + + getuname(osname -s) + getuname(osrel -r) + getuname(cpu -m) + message("Dashboard script uname output: ${osname}-${osrel}-${cpu}\n") + + set(CTEST_BUILD_NAME "${osname}-${osrel}-${cpu}") + if(USE_AUTOTOOLS) + set(CTEST_BUILD_NAME "AT-${CTEST_BUILD_NAME}") + endif(USE_AUTOTOOLS) + if(SITE_BUILDNAME_SUFFIX) + set(CTEST_BUILD_NAME "${CTEST_BUILD_NAME}-${SITE_BUILDNAME_SUFFIX}") + endif(SITE_BUILDNAME_SUFFIX) + set(BUILD_OPTIONS "${ADD_BUILD_OPTIONS}") +else(NOT SITE_OS_NAME) + ## machine name provided + ## -------------------------- + if(CMAKE_HOST_UNIX) + set(CTEST_BUILD_NAME "${SITE_OS_NAME}-${SITE_OS_VERSION}-${SITE_OS_BITS}-${SITE_COMPILER_NAME}-${SITE_COMPILER_VERSION}") + else(CMAKE_HOST_UNIX) + set(CTEST_BUILD_NAME "${SITE_OS_NAME}-${SITE_OS_VERSION}-${SITE_COMPILER_NAME}") + endif(CMAKE_HOST_UNIX) + if(SITE_BUILDNAME_SUFFIX) + set(CTEST_BUILD_NAME ${CTEST_BUILD_NAME}-${SITE_BUILDNAME_SUFFIX}) + endif() + set(BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DSITE:STRING=${CTEST_SITE} -DBUILDNAME:STRING=${CTEST_BUILD_NAME}") +endif(NOT SITE_OS_NAME) + +#----------------------------------------------------------------------------- +# MAC machines need special option +#----------------------------------------------------------------------------- +if(APPLE) + # Compiler choice + execute_process(COMMAND xcrun --find cc OUTPUT_VARIABLE XCODE_CC OUTPUT_STRIP_TRAILING_WHITESPACE) + execute_process(COMMAND xcrun --find c++ OUTPUT_VARIABLE XCODE_CXX OUTPUT_STRIP_TRAILING_WHITESPACE) + SET(ENV{CC} "${XCODE_CC}") + SET(ENV{CXX} "${XCODE_CXX}") + # Shared fortran is not supported, build static + set (BUILD_OPTIONS "${BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=OFF -DCMAKE_ANSI_CFLAGS:STRING=-fPIC") + set(BUILD_OPTIONS "${BUILD_OPTIONS} -DCTEST_USE_LAUNCHERS:BOOL=ON -DCMAKE_BUILD_WITH_INSTALL_RPATH:BOOL=OFF") +endif(APPLE) + +#----------------------------------------------------------------------------- +## cygwin does not handle the find_package() call +## -------------------------- +if(NOT SITE_CYGWIN}) + find_package (Subversion) + set(CTEST_UPDATE_COMMAND "${Subversion_SVN_EXECUTABLE}") +else(NOT SITE_CYGWIN}) + set(CTEST_UPDATE_COMMAND "/usr/bin/svn") +endif(NOT SITE_CYGWIN}) + +#----------------------------------------------------------------------------- +set(NEED_REPOSITORY_CHECKOUT 0) +set(CTEST_CMAKE_COMMAND "\"${CMAKE_COMMAND}\"") +if (CTEST_USE_TAR_SOURCE) + ## Uncompress source if tar file provided + ## -------------------------- + if(WIN32) + set(CTEST_7Z_COMMAND "C:/Program Files/7-Zip/7z.exe") + message("extracting... [${CTEST_7Z_COMMAND} x ${CTEST_USE_TAR_SOURCE}.zip]") + execute_process(COMMAND ${CTEST_7Z_COMMAND} x ${CTEST_USE_TAR_SOURCE}.zip RESULT_VARIABLE rv) + else(WIN32) + message("extracting... [${CTEST_CMAKE_COMMAND} -E tar -xvf ${CTEST_USE_TAR_SOURCE}.tar]") + execute_process(COMMAND tar -xvf ${CTEST_USE_TAR_SOURCE}.tar RESULT_VARIABLE rv) + endif(WIN32) + + if(NOT rv EQUAL 0) + message("extracting... [error-(${rv}) clean up]") + file(REMOVE_RECURSE "${CTEST_SOURCE_DIRECTORY}") + message(FATAL_ERROR "error: extract of ${CTEST_USE_TAR_SOURCE} failed") + endif(NOT rv EQUAL 0) + + file(RENAME ${CTEST_USE_TAR_SOURCE} ${CTEST_SOURCE_DIRECTORY}) + set(LOCAL_SKIP_UPDATE "TRUE") +else (CTEST_USE_TAR_SOURCE) + ## use subversion to get source + ## -------------------------- + if (NOT EXISTS "${CTEST_SOURCE_DIRECTORY}") + set (NEED_REPOSITORY_CHECKOUT 1) + endif (NOT EXISTS "${CTEST_SOURCE_DIRECTORY}") + + if (${NEED_REPOSITORY_CHECKOUT}) + set (CTEST_CHECKOUT_COMMAND + "${CTEST_UPDATE_COMMAND} co ${REPOSITORY_URL} \"${CTEST_SOURCE_DIRECTORY}\" -r HEAD") + else (${NEED_REPOSITORY_CHECKOUT}) + set (CTEST_CHECKOUT_COMMAND "${CTEST_UPDATE_COMMAND} update") + endif (${NEED_REPOSITORY_CHECKOUT}) +endif (CTEST_USE_TAR_SOURCE) + +#----------------------------------------------------------------------------- +## Clear the build directory +## -------------------------- +set(CTEST_START_WITH_EMPTY_BINARY_DIRECTORY TRUE) +file(MAKE_DIRECTORY "${CTEST_BINARY_DIRECTORY}") +#include(${CTEST_SOURCE_DIRECTORY}/CTestConfig.cmake) +ctest_empty_binary_directory(${CTEST_BINARY_DIRECTORY}) + +# Use multiple CPU cores to build +include(ProcessorCount) +ProcessorCount(N) +if(NOT N EQUAL 0) + if(NOT WIN32) + set(CTEST_BUILD_FLAGS -j${N}) + endif(NOT WIN32) + set(ctest_test_args ${ctest_test_args} PARALLEL_LEVEL ${N}) +endif() + +#----------------------------------------------------------------------------- +# Send the main script as a note. +if(USE_AUTOTOOLS) + ## autotools builds need to use make and does not use the cacheinit.cmake file + ## -- make command + ## ----------------- + find_program(MAKE NAMES make) + + list(APPEND CTEST_NOTES_FILES + "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}" + "${CMAKE_CURRENT_LIST_FILE}" + ) +else(USE_AUTOTOOLS) + list(APPEND CTEST_NOTES_FILES + "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}" + "${CMAKE_CURRENT_LIST_FILE}" + "${CTEST_SOURCE_DIRECTORY}/config/cmake/cacheinit.cmake" + ) +endif(USE_AUTOTOOLS) + +#----------------------------------------------------------------------------- +# Check for required variables. +# -------------------------- +foreach(req + CTEST_CMAKE_GENERATOR + CTEST_SITE + CTEST_BUILD_NAME + ) + if(NOT DEFINED ${req}) + message(FATAL_ERROR "The containing script must set ${req}") + endif(NOT DEFINED ${req}) +endforeach(req) + +#----------------------------------------------------------------------------- +# Initialize the CTEST commands +#------------------------------ +if(USE_AUTOTOOLS) + set(CTEST_CONFIGURE_COMMAND "${CTEST_SOURCE_DIRECTORY}/configure ${ADD_BUILD_OPTIONS}") + set(CTEST_BUILD_COMMAND "${MAKE} ${CTEST_BUILD_FLAGS}") + ## -- CTest Config + #configure_file($ENV{HOME}/CTestConfiguration/CTestConfig.cmake ${CTEST_SOURCE_DIRECTORY}/CTestConfig.cmake) + configure_file(${CTEST_SOURCE_DIRECTORY}/config/cmake/CTestCustom.cmake ${CTEST_BINARY_DIRECTORY}/CTestCustom.cmake) + ## -- CTest Testfile +# configure_file(${CTEST_SCRIPT_DIRECTORY}/CTestTestfile.cmake ${CTEST_BINARY_DIRECTORY}/CTestTestfile.cmake) + file(WRITE ${CTEST_BINARY_DIRECTORY}/CTestTestfile.cmake "ADD_TEST(makecheck \"${MAKE}\" \"${CTEST_BUILD_FLAGS}\" \"-i\" \"check\")") +else(USE_AUTOTOOLS) + if(LOCAL_MEMCHECK_TEST) + find_program(CTEST_MEMORYCHECK_COMMAND NAMES valgrind) + set (CTEST_CONFIGURE_COMMAND + "${CTEST_CMAKE_COMMAND} -C \"${CTEST_SOURCE_DIRECTORY}/config/cmake/mccacheinit.cmake\" -DCMAKE_BUILD_TYPE:STRING=${CTEST_BUILD_CONFIGURATION} ${BUILD_OPTIONS} \"-G${CTEST_CMAKE_GENERATOR}\" \"${CTEST_SOURCE_DIRECTORY}\"" + ) + else(LOCAL_MEMCHECK_TEST) + find_program(CTEST_COVERAGE_COMMAND NAMES gcov) + set (CTEST_CONFIGURE_COMMAND + "${CTEST_CMAKE_COMMAND} -C \"${CTEST_SOURCE_DIRECTORY}/config/cmake/cacheinit.cmake\" -DCMAKE_BUILD_TYPE:STRING=${CTEST_BUILD_CONFIGURATION} ${BUILD_OPTIONS} \"-G${CTEST_CMAKE_GENERATOR}\" \"${CTEST_SOURCE_DIRECTORY}\"" + ) + endif(LOCAL_MEMCHECK_TEST) +endif(USE_AUTOTOOLS) + +#----------------------------------------------------------------------------- +## -- set output to english +set($ENV{LC_MESSAGES} "en_EN") + +# Print summary information. +foreach(v + CTEST_SITE + CTEST_BUILD_NAME + CTEST_SOURCE_DIRECTORY + CTEST_BINARY_DIRECTORY + CTEST_CMAKE_GENERATOR + CTEST_BUILD_CONFIGURATION + CTEST_GIT_COMMAND + CTEST_CHECKOUT_COMMAND + CTEST_CONFIGURE_COMMAND + CTEST_SCRIPT_DIRECTORY + CTEST_USE_LAUNCHERS + ) + set(vars "${vars} ${v}=[${${v}}]\n") +endforeach(v) +message("Dashboard script configuration:\n${vars}\n") + +#----------------------------------------------------------------------------- +if(${MODEL} STREQUAL "Continuous") + ## Continuous mode is used for commit test processing + ## -------------------------- + while (${CTEST_ELAPSED_TIME} LESS 36000) + set(START_TIME ${CTEST_ELAPSED_TIME}) + CTEST_START (Continuous) + CTEST_UPDATE (SOURCE "${CTEST_SOURCE_DIRECTORY}" RETURN_VALUE res) + set (CTEST_CHECKOUT_COMMAND) # checkout on first iteration only + message("Dashboard updated files: ${res}\n") + if(res GREATER 0) + CTEST_CONFIGURE (BUILD "${CTEST_BINARY_DIRECTORY}") + CTEST_READ_CUSTOM_FILES ("${CTEST_BINARY_DIRECTORY}") + CTEST_SUBMIT (PARTS Update Configure Notes) + CTEST_BUILD (BUILD "${CTEST_BINARY_DIRECTORY}" APPEND) + CTEST_SUBMIT (PARTS Build) + CTEST_TEST (BUILD "${CTEST_BINARY_DIRECTORY}" APPEND ${ctest_test_args}) + CTEST_SUBMIT (PARTS Test) + + execute_process (COMMAND cpack -C ${CTEST_BUILD_CONFIGURATION} + WORKING_DIRECTORY ${CTEST_BINARY_DIRECTORY} + RESULT_VARIABLE cpackResult + OUTPUT_VARIABLE cpackLog + ERROR_VARIABLE cpackLog.err + ) + file (WRITE ${CTEST_BINARY_DIRECTORY}/cpack.log "${cpackLog.err}" "${cpackLog}") + endif(${res} GREATER 0) + + CTEST_SLEEP(${START_TIME} 300 ${CTEST_ELAPSED_TIME}) + endwhile (${CTEST_ELAPSED_TIME} LESS 36000) +#----------------------------------------------------------------------------- +else(${MODEL} STREQUAL "Continuous") +#----------------------------------------------------------------------------- + ## NORMAL process + ## -- LOCAL_SKIP_UPDATE skips updating the source folder from svn + ## -- LOCAL_NO_SUBMIT skips reporting to CDash server + ## -- LOCAL_SKIP_TEST skips the test process (only builds) + ## -- LOCAL_MEMCHECK_TEST executes the Valgrind testing + ## -- LOCAL_COVERAGE_TEST executes code coverage process + ## -------------------------- + CTEST_START (${MODEL} TRACK ${MODEL}) + if(NOT LOCAL_SKIP_UPDATE) + CTEST_UPDATE (SOURCE "${CTEST_SOURCE_DIRECTORY}") + endif(NOT LOCAL_SKIP_UPDATE) + CTEST_CONFIGURE (BUILD "${CTEST_BINARY_DIRECTORY}") + CTEST_READ_CUSTOM_FILES ("${CTEST_BINARY_DIRECTORY}") + if(NOT LOCAL_NO_SUBMIT) + CTEST_SUBMIT (PARTS Update Configure Notes) + endif(NOT LOCAL_NO_SUBMIT) + CTEST_BUILD (BUILD "${CTEST_BINARY_DIRECTORY}" APPEND) + if(NOT LOCAL_NO_SUBMIT) + CTEST_SUBMIT (PARTS Build) + endif(NOT LOCAL_NO_SUBMIT) + if(NOT LOCAL_SKIP_TEST) + if(NOT LOCAL_MEMCHECK_TEST) + CTEST_TEST (BUILD "${CTEST_BINARY_DIRECTORY}" APPEND ${ctest_test_args}) + if(NOT LOCAL_NO_SUBMIT) + CTEST_SUBMIT (PARTS Test) + endif(NOT LOCAL_NO_SUBMIT) + else(NOT LOCAL_MEMCHECK_TEST) + CTEST_MEMCHECK (BUILD "${CTEST_BINARY_DIRECTORY}" APPEND ${ctest_test_args}) + if(NOT LOCAL_NO_SUBMIT) + CTEST_SUBMIT (PARTS MemCheck) + endif(NOT LOCAL_NO_SUBMIT) + endif(NOT LOCAL_MEMCHECK_TEST) + if(LOCAL_COVERAGE_TEST) + CTEST_COVERAGE (BUILD "${CTEST_BINARY_DIRECTORY}" APPEND) + if(NOT LOCAL_NO_SUBMIT) + CTEST_SUBMIT (PARTS Coverage) + endif(NOT LOCAL_NO_SUBMIT) + endif(LOCAL_COVERAGE_TEST) + endif(NOT LOCAL_SKIP_TEST) + if(NOT LOCAL_MEMCHECK_TEST) + ##----------------------------------------------- + ## Package the product + ##----------------------------------------------- + execute_process(COMMAND cpack -C ${CTEST_BUILD_CONFIGURATION} -V + WORKING_DIRECTORY ${CTEST_BINARY_DIRECTORY} + RESULT_VARIABLE cpackResult + OUTPUT_VARIABLE cpackLog + ERROR_VARIABLE cpackLog.err + ) + file(WRITE ${CTEST_BINARY_DIRECTORY}/cpack.log "${cpackLog.err}" "${cpackLog}") + endif(NOT LOCAL_MEMCHECK_TEST) +endif(${MODEL} STREQUAL "Continuous") +#----------------------------------------------------------------------------- + +message("DONE:CTestScript") +************************************************************************ + +************************************************************************ +Product specific script, HDF518Static.cmake, that uses the +CTestScript.cmake file (see above). Usage: +"ctest -S HDF518Static.cmake,hdf518 -C Release -O hdf518static.log" +where hdf518 is the source folder relative to the location of these scripts +======================================================================== + +cmake_minimum_required(VERSION 2.8.6 FATAL_ERROR) + +# CTEST_SCRIPT_ARG is the source folder passed on the command line +set(CTEST_SOURCE_NAME ${CTEST_SCRIPT_ARG}) +set(CTEST_BINARY_NAME ${CTEST_SOURCE_NAME}/buildstatic) +set(CTEST_DASHBOARD_ROOT ${CTEST_SCRIPT_DIRECTORY}) +set(CTEST_SOURCE_DIRECTORY "${CTEST_DASHBOARD_ROOT}/${CTEST_SOURCE_NAME}") +set(CTEST_BINARY_DIRECTORY "${CTEST_DASHBOARD_ROOT}/${CTEST_BINARY_NAME}") +set(CTEST_BUILD_CONFIGURATION "Release") +set(MODEL "Experimental") + +# build generator name, see cmake generator list +set(CTEST_CMAKE_GENERATOR "Unix Makefiles") + +# machine description, can be removed on linux +set(CTEST_SITE "machine.domain") +set(SITE_OS_NAME "os name") +set(SITE_OS_VERSION "os version") +set(SITE_OS_BITS "os size") +set(SITE_COMPILER_NAME "compiler name") +set(SITE_COMPILER_VERSION "compiler version") + +# extra CDash build name description +set(SITE_BUILDNAME_SUFFIX "STATIC") + +# needed for source updates, change as required +set(REPOSITORY_URL "http://svn.hdfgroup.uiuc.edu/hdf5/branches/hdf5_1_8") + +# options to add/change from the cacheinit.cmake in the config/cmake folder +set(ADD_BUILD_OPTIONS "-DBUILD_SHARED_LIBS:BOOL=OFF -DCMAKE_INSTALL_PREFIX:PATH=/usr/local/hdf5.1.8_static") +set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DCMAKE_ANSI_CFLAGS:STRING=-fPIC -DHDF5_PACKAGE_EXTLIBS:BOOL=ON") +set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ALLOW_EXTERNAL_SUPPORT:STRING=\"SVN\"") + +# include common script file +include(${CTEST_SCRIPT_DIRECTORY}/CTestScript.cmake) + +message("DONE") + +************************************************************************ Need further assistance, send email to help@hdfgroup.org diff --git a/release_docs/INSTALL_Windows.txt b/release_docs/INSTALL_Windows.txt index 967675f..4344ea4 100644 --- a/release_docs/INSTALL_Windows.txt +++ b/release_docs/INSTALL_Windows.txt @@ -9,8 +9,5 @@ We now recommend that users build, test and install HDF5 using CMake. Instructions for building and testing HDF5 using CMake can be found in the CMake.txt file found in this folder. -The old solutions and projects found in the windows\ folder will be -maintained for legacy users until HDF5 1.10. - The old INSTALL_Windows documentation can be found in the obsolete_windows_docs\ folder located with this document. diff --git a/release_docs/INSTALL_parallel b/release_docs/INSTALL_parallel index b2e1eec..eacaf68 100644 --- a/release_docs/INSTALL_parallel +++ b/release_docs/INSTALL_parallel @@ -17,12 +17,14 @@ of running the parallel test suites. 1.1. Requirements ----------------- -PHDF5 requires an MPI compiler with MPI-IO support and a parallel file system. -If you don't know yet, you should first consult with your system support staff -of information how to compile an MPI program, how to run an MPI application, -and how to access the parallel file system. There are sample MPI-IO C and -Fortran programs in the appendix section of "Sample programs". You can use -them to run simple tests of your MPI compilers and the parallel file system. +PHDF5 requires an MPI compiler with MPI-IO support and a POSIX compliant +(Ref. 1) parallel file system. If you don't know yet, you should first consult +with your system support staff of information how to compile an MPI program, +how to run an MPI application, and how to access the parallel file system. +There are sample MPI-IO C and Fortran programs in the appendix section of +"Sample programs". You can use them to run simple tests of your MPI compilers +and the parallel file system. Also, the t_posix_compliant test in testpar +verifies if the file system is POSIX compliant. 1.2. Further Help @@ -274,6 +276,20 @@ if the tests should use directory /PFS/user/me, do shell initial files like .profile, .cshrc, etc.) +Reference +--------- +1. POSIX Compliant. A good explanation is by Donald Lewin, + After a write() to a regular file has successfully returned, any + successful read() from each byte position on the file that was modified + by that write() will return the date that was written by the write(). A + subsequent write() to the same byte will overwrite the file data. If a + read() of a file data can be proven by any means [e.g., MPI_Barrier()] + to occur after a write() of that data, it must reflect that write(), + even if the calls are made by a different process. + Lewin, D. (1994). "POSIX Programmer's Guide (pg. 513-4)". O'Reilly + & Associates. + + Appendix A. Sample programs --------------------------- Here are sample MPI-IO C and Fortran programs. You may use them to run simple diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index fa0e6ec..1f4016c 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -1,4 +1,4 @@ -HDF5 version 1.9.144 currently under development +HDF5 version 1.9.148 currently under development ================================================================================ @@ -751,9 +751,12 @@ Bug Fixes since HDF5-1.8.0 release Tools ----- + - h5diff: Fixed to return correct exit code 1 when detect unique extra + attribute. Prior to this fix, h5diff returned exit code 0 indicating + two files are identical. HDFFV-7643 (JKM 2013/02/15) - h5diff: Improved speed when comparing HDF5 files with lots of - attributes. Much slower performance was identified with release version - from 1.8.7 to 1.8.10 compared to 1.8.6. (JKM 2012/10/19) + attributes. Much slower performance was identified with release + version from 1.8.7 to 1.8.10 compared to 1.8.6. (JKM 2012/10/19) - h5repack: "h5repack -f NONE file1.h5 out.h5" command failed if source file contains chunked dataset and a chunk dim is bigger than the dataset dim. Another issue is that the command changed max dims @@ -1068,6 +1071,19 @@ Bug Fixes since HDF5-1.8.0 release in "New Features" section. (BMR - 2008/08/10) + Testing + ------- + - In some Mac system, testlibinfo.sh failed with this error: + Check file ../src/.libs/libhdf5.7.dylib + strings: object: ../src/.libs/libhdf5.7.dylib malformed object \ + (unknown load command 15) + The strings command of Mac inspects library files and older + versions of strings may not know newer library format, resulting + in errors. Fixed by sending the library file as stdin to the strings + coommand to avoid this problem. (AKC - 2013/03/08 HDFFV-8305) + + - Fixed a typo in the ERROR macro in test/testhdf5.h. It segmentation + faulted when used before. (AKC - 2013/02/12 HDFFV-8267) Supported Platforms diff --git a/release_docs/USING_CMake.txt b/release_docs/USING_CMake.txt index 4397750..0e980ea 100644 --- a/release_docs/USING_CMake.txt +++ b/release_docs/USING_CMake.txt @@ -4,14 +4,14 @@ Notes: This short instruction is written for users who want to quickly build HDF5 Applications from the HDF5 Examples package using the CMake tools. - Users can adapt these instructions for their own applicaltions, see the + Users can adapt these instructions for their own applications, see the "Minimum Project Files" section. More information about using CMake can be found at the KitWare site, www.cmake.org. CMake uses the command line, however the visual CMake tool is - available for the configuration step. The steps are similiar for + available for the configuration step. The steps are similar for all the operating systems supported by CMake. NOTES: @@ -31,6 +31,10 @@ Notes: This short instruction is written for users who want to quickly build Please read the HDF and CDash document at: www.hdfgroup.org/CDash/HowToSubmit. + 4. See the appendix at the bottom of this file for an example of using + a ctest script for building and testing. See CMake.txt for more + information. + ======================================================================== Preconditions @@ -62,7 +66,7 @@ Notes: This short instruction is written for users who want to quickly build available in your Start menu. For Linux, UNIX, and Mac users the executable is named "cmake-gui" and can be found where CMake was installed. - Specify the source and build directories. It is recommemded that you + Specify the source and build directories. It is recommended that you choose a build directory different then the source directory (for example on Windows, if the source is at c:\MyHDFstuff\hdf5, then use c:\MyHDFstuff\hdf5\build or c:\MyHDFstuff\build\hdf5). @@ -156,7 +160,7 @@ Notes: This short instruction is written for users who want to quickly build ======================================================================== - Using HDF5 Libraries with Visual Studio 2008 + Using Visual Studio 2008 with HDF5 Libraries built with Visual Studio 2008 ======================================================================== 8. Set up path for external libraries and headers @@ -168,11 +172,11 @@ Notes: This short instruction is written for users who want to quickly build and select "x64". 8.2 Find the box "Show directories for", choose "Include files", add the - header path (i.e. c:\Program Files\HDF Group\HDF5\hdf5-1.8.7\include) + header path (i.e. c:\Program Files\HDF Group\HDF5\hdf5-1.8.x\include) to the included directories. 8.3 Find the box "Show directories for", choose "Library files", add the - library path (i.e. c:\Program Files\HDF Group\HDF5\hdf5-1.8.7\lib) + library path (i.e. c:\Program Files\HDF Group\HDF5\hdf5-1.8.x\lib) to the library directories. 8.4 If using Fortran libraries, you will also need to setup the path @@ -180,10 +184,28 @@ Notes: This short instruction is written for users who want to quickly build ======================================================================== + Using Visual Studio 2010 with HDF5 Libraries built with Visual Studio 2010 +======================================================================== + + 9. Set up path for external libraries and headers + + The path settings will need to be in project property sheets per project. + Go to "Project" and select "Properties", find "Configuration Properties", + and then "VC++ Directories". + + 9.1 If you are building on 64-bit Windows, find the "Platform" dropdown + and select "x64". + + 9.2 Add the header path to the "Include Directories" setting. + + 9.3 Add the library path to the "Library Directories" setting. + + +======================================================================== Minimum C Project Files for CMake ======================================================================== - 9. Create a CMakeLists.txt file at the source root. + 10. Create a CMakeLists.txt file at the source root. .......................................................................... cmake_minimum_required (VERSION 2.8.10) PROJECT (HDF5MyApp C CXX) @@ -196,7 +218,55 @@ ADD_EXECUTABLE (hdf_example ${PROJECT_SOURCE_DIR}/hdf_example.c) TARGET_LINK_LIBRARIES (hdf_example ${LINK_LIBS}) .......................................................................... + +************************************************************************ + APPENDIX + +Below ia an example of the ctest script used by The HDF Group. See the +Appendix in the CMake.txt file for the CTestScript.cmake file used by this +script. + ************************************************************************ +Product specific script, HDF518Example.cmake, that uses the +CTestScript.cmake file (see Appendix in the CMake.txt). Usage: +"ctest -S HDF518Example.cmake,hdf518Examples -C Release -O hdf518EX.log" +where hdf518Examples is the source folder relative to the location of these scripts +======================================================================== + +cmake_minimum_required(VERSION 2.8.6 FATAL_ERROR) + +set(CTEST_SOURCE_NAME ${CTEST_SCRIPT_ARG}) +set(CTEST_BINARY_NAME ${CTEST_SOURCE_NAME}/build) +set(CTEST_DASHBOARD_ROOT ${CTEST_SCRIPT_DIRECTORY}) +set(CTEST_SOURCE_DIRECTORY "${CTEST_DASHBOARD_ROOT}/${CTEST_SOURCE_NAME}") +set(CTEST_BINARY_DIRECTORY "${CTEST_DASHBOARD_ROOT}/${CTEST_BINARY_NAME}") +set(CTEST_BUILD_CONFIGURATION "Release") +set(MODEL "Experimental") + +# build generator name, see cmake generator list +set(CTEST_CMAKE_GENERATOR "Unix Makefiles") + +# machine description, can be removed on linux +set(CTEST_SITE "machine.domain") +set(SITE_OS_NAME "os name") +set(SITE_OS_VERSION "os version") +set(SITE_OS_BITS "os size") +set(SITE_COMPILER_NAME "compiler name") +set(SITE_COMPILER_VERSION "compiler version") + + +# needed for source updates, change as required +set(REPOSITORY_URL "http://svn.hdfgroup.uiuc.edu/hdf5-examples/trunk/1_8") + +set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DCMAKE_INSTALL_PREFIX:PATH=/usr/local/hdf5Examples-1.8") + +# location of the installed hdf5 (cmake configuration folder) +set(ENV{HDF5_DIR} "/usr/share/cmake/hdf5") + +include(${CTEST_SCRIPT_DIRECTORY}/CTestScript.cmake) + +message("DONE") + Need further assistance, send email to help@hdfgroup.org diff --git a/release_docs/USING_Windows.txt b/release_docs/USING_Windows.txt index 9afbeb1..97ac4ad 100644 --- a/release_docs/USING_Windows.txt +++ b/release_docs/USING_Windows.txt @@ -4,626 +4,10 @@ * (Full Version) * *********************************************************************** -The following instructions assume that the HDF5 binary code package from -HDF website (http://hdfgroup.org) is used. +We now recommend that users build, test and install HDF5 using CMake. -Warnings: -Please read CAREFULLY about the following preconditions and notes first. - -Contents: - - Section : Preconditions and Notes - Section I : What do we provide? - Section II : How to build examples (optional) - Section III : How to build an application using the HDF5 library or DLL - Section IV : How to build HDF5 for 64-bit Windows - Section V : How to build HDF5 applications using Visual Studio 2010 - Section VI : Misc. - - -======================================================================== - Preconditions and Notes -======================================================================== - -Preconditions: - - 1. Installed Microsoft Visual Studio. This document is written for Visual - Studio 2008. Express Editions may work with the project files - but not from the command line. We do not support the Express Editions. - - 2. (Optional) Installed Intel Compiler 10.1 or 11.1 if you want to use HDF5 - Fortran libraries. - - 3. Install Winzip or 7-zip for extracting source tarball. - - Note: 1. 7zip is an open-source alternative to WinZip. Some of the - advanced functionality is disabled in WinZip unless you buy the - software. With 7zip, most of this functionality is included for - free. - - 5. Set up a directory structure to unpack the library. For example: - - c:\ (any drive) - MyHDFstuff\ (any folder name) - - 6. Download the hdf5-1.8.x binary code package and use 7zip or WinZip to - extract the HDF5 package into c:\MyHDFstuff. This creates a directory - called 'hdf5-1.8.x' under MyHDFstuff which contains several files and - directories. Rename "hdf5-1.8.x" to "hdf5". - - 7. HDF5 provide options to do in-memory compression within HDF5 library. - Currently, two external compression libraries Zlib and Szip can be used - with HDF5. - - 7.1 HDF5 uses Zlib version 1.2.5 for compression and Zlib is - distributed with HDF5 library in 1.8.x release. - - 7.2 HDF5 uses Szip version 2.1 for compression and Szip compression - software is provided with HDF5 products in 1.8.x release. - - Please note that Szip is not a totally open-source free software. - For licensing issue of Szip, please check "Licensing terms" at - http://hdfgroup.org/doc_resource/SZIP/index.html. - - Szip compression feature inside HDF5 is enabled by default. - - 8. Define the following environment variables: - - HDF5_EXT_ZLIB - HDF5_EXT_SZIP - - In this section, Zlib and Szip compression packages are assumed to be - used. Please read Section V as well as this section if you do not want - to use compression feature inside HDF5. - - To define these environment variables: - - Click "Start", click "Control Panel", and then double-click "System". - On the "Advanced" tab, click "Environment Variables". - - If you are logged on as administrator to the local computer AND want to - let all other users use these two environment variables, click "New" - under "System Variables" box; otherwise, click "New" under "User - Variables" box. - - In the New Variable window, set "Variable name" as HDF5_EXT_ZLIB and - "Variable value" as zlib.lib, then click OK. - - Similarly, you can set: - - HDF5_EXT_SZIP environment variable as szip.lib - - Notes: - - a. You will have to close and reopen running programs for the new - environment variable settings to take effect. - - b. c:\zlib\zlib.dll and c:\szip\dll\szip.dll should be copied - into a location that the application can find. - - 9. Set up path for libraries and headers - - Invoke Microsoft Visual Studio and go to "Tools" and select "Options", - find "Projects", and then "VC++ Directories". - - 9.1 If you are building on 64-bit Windows, find the "Platform" dropdown - and select "x64". - - 9.2 Find the box "Show directories for", choose "Include files", if you - can not find your HDF5 header path (for example, - c:\MyHDFstuff\include) from the directory list, add the - header path (c:\MyHDFstuff\include) to the included - directories. - - 9.3 Find the box "Show directories for", choose "Library files". If you - cannot find your HDF5 library path (for example, - c:\MyHDFstuff\dll for dynamic-shared and c:\MyHDFstuff\lib for static) - from the directory list, add the library - path (c:\MyHDFstuff\dll or c:\MyHDFstuff\lib) to the library directories. - - 9.4 If building Fortran applications, you will also need to setup the path - for the Intel Fortran compiler. Please see Section VI. - - NOTE: - If you are using VS2010, the path settings will need to be in project - property sheets per project. Go to "Project" and select "Properties", find - "Configuration Properties", and then "VC++ Directories". - - 9.1 If you are building on 64-bit Windows, find the "Platform" dropdown - and select "x64". - 9.2 Add the header path to the "Include Directories" setting. - 9.3 Add the library path to the "Library Directories" setting. - -Notes: - - 1. HDF4-related tools are not built and released with HDF5 library packages - any more. To obtain HDF4 related tools, please check - http://hdfgroup.org/h4toh5/ and ftp://ftp.hdfgroup.org/HDF5/h4toh5 - - 2. For Fortran users, Intel Fortran Compiler 10.1 is currently supported - -- please see Section VI. Intel Compiler 11.1 can be used but the project files - must be upgraded within the Visual Studio IDE. - - 3. The szip and zlib dlls must be in the PATH for using the tools (including static). - - -======================================================================== - Section I: What do we provide? -======================================================================== - - 1. Provide - - HDF5 static library: - release version - - HDF5 Dynamic Link Library(DLL): - release version as well as export libraries for DLL - - HDF5 High-Level Library (Optional): - HDF5 C++ Library - HDF5 HL-Fortran Library - - HDF5 tools: - HDF5 tools - - HDF5 tool library: - release version - - HDF5 tool export library for DLL: - release version - - 2. Examples (Included in the binary distribution as a zip file) - - Unpack the examples, hdf5-examples.zip, into your "hdf5" folder - (c:\MyHDFstuff\hdf5). - The resulting structure under this folder should be: - c++ - c++/examples - examples - fortran - fortran/examples - hl - hl/c++ - hl/c++/examples - hl/examples - hl/fortran - hl/fortran/examples - windows - windows/c++ - windows/c++/examples - windows/examples - windows/fortran - windows/fortran/examples - windows/hl - windows/hl/examples - windows/hl/fortran - windows/hl/fortran/examples - hdf5build_examples.bat - InstallExamples.bat - - HDF5 examples: - Simple HDF5 C/C++/Fortran and High level C/Fortran examples - -======================================================================== - Section II: How To Build Examples (Optional) -======================================================================== - -Simple examples have been provided for users to test HDF5 C/C++/Fortran and -High level C/Fortran library and tools. - -Note: - 1) To build HDF5 C++ examples, HDF5 C++ library must have been installed in - Step I. - - 2) To build HDF5 Fortran or HL Fortran examples, please see Section VI, - Step 3. - - 3) To build HDF5 High Level C examples, HDF5 High level library must have - been installed in step I. - - 4) By default, the HDF5 binary distribution only includes the release - versions of HDF5 C/C++ libraries and DLLs. - -To build and test HDF5 C examples: ----------------------------------- - 1. Invoke Microsoft Visual Studio, go to "File" and select the "Open - Solution" option. - - Then open the solution - c:\MyHDFstuff\hdf5examples\windows\examples\allexamples\allexamples.sln. - - 2. Select "Build", and "Configuration Manager". - - To build release versions of C examples. - - In "Active Solution Configuration", select "Release". Select "Close". - Select "Build" -> "Build Solution" or "Rebuild Solution" to build - release version of project "allexamples". - - When the release build is done, there should be the following - subdirectories in c:\MyHDFstuff\hdf5examples\examples\ - - attributetest - attributetestdll - chunkread - chunkreaddll - compoundtest - compoundtestdll - extendwritetest - extendwritetestdll - grouptest - grouptestdll - readtest - readtestdll - selectest - selectestdll - writetest - writetestdll - - 3. Invoke a command prompt window and run the batch file InstallExamples.bat - which resides in the top level directory (c:\MyHDFstuff\hdf5examples). This file - creates new directories, examplesREL, examplesRELDLL in the - c:\MyHDFstuff\hdf5examples\examples directory and places - all the executables in it. - - 4. We provide a batch file named testExamples.bat and an expected examples - tests output file named testExamples_exp_output.txt in - c:\MyHDFstuff\hdf5\examples directory for you to test HDF5 C examples. - - testExamples.bat batch file has options: - - testExamples release -- for release version - - testExamples release dll -- for release DLL version - - Invoke a command prompt and run testExamples.bat with appropriate options. - You should get "All HDF5 C examples tests passed." when the C examples are - built successfully. Otherwise, the difference between the expected - outputs and actual outputs will be given. - -To build and test HDF5 C++ examples: ------------------------------------- - - 1. Invoke Microsoft Visual Studio, go to "File" and select the "Open - Solution" option. - - Then open the solution - c:\MyHDFstuff\hdf5examples\windows\examples\allexamples\allcppexamples.sln. - - 2. Select "Build", and "Configuration Manager". - - To build release versions of C examples. - - In "Active Solution Configuration", select "Release". Select "Close". - Select "Build" -> "Build Solution" or "Rebuild Solution" to build - release version of project "allcppexamples". - - When the release build is done, there should be the following - subdirectories in c:\MyHDFstuff\hdf5examples\c++\examples\ - - chunks - chunksdll - compound - compounddll - create - createdll - extend_ds - extend_dsll - h5group - h5groupdll - readdata - readdatadll - writedata - writedatadll - - 3. Invoke a command prompt window and run the batch file - InstallcppExamples.bat which resides in the top level directory - (c:\MyHDFstuff\hdf5examples). This file creates new directories, - cppexamplesREL, cppexamplesRELDLL in the - c:\MyHDFstuff\hdf5examples\c++\examples directory and places all - the executables in it. - - 4. We provide a batch file named testcppExamples.bat in - c:\MyHDFstuff\hdf5examples\c++\examples directory for you to test HDF5 C++ - examples. - - testcppExamples.bat batch file has options: - - testcppExamples release -- for release version - - testcppExamples release dll -- for release DLL version - - Invoke a command prompt and run testcppExamples.bat with appropriate - options. You should get "All HDF5 C++ examples tests passed." when the - C++ examples are built successfully. Otherwise, the difference between - the expected outputs and actual outputs will be given. - - -To build and test HDF5 High Level C examples: ---------------------------------------------- - - 1. Invoke Microsoft Visual Studio, go to "File" and select the "Open - Solution" option. - - Then open the solution - c:\MyHDFstuff\hdf5examples\windows\hl\examples\allhlcexamples\allhlcexamples.sln - - 2. Select "Build", and "Configuration Manager". - - To build release versions of C examples. - - In "Active Solution Configuration", select "Release". Select "Close". - Select "Build" -> "Build Solution" or "Rebuild Solution" to build - release version of project "allhlcexamples". - - When the release build is done, binaries will be built in the - following subdirectories of c:\MyHDFstuff\hdf5\examples\ - - ex_image[1-2](dll) - ex_lite1(dll) - ex_table[01-12](dll) - ex_ds1(dll) - ptExample[FL+VL](dll) - - 3. Invoke a command prompt and run the batch file Install_hlcexamples.bat - which resides in the top level directory (c:\MyHDFstuff\hdf5examples). This file - creates new directories, HLCexamplesRELEASE, HLCexamplesRELEASEDLL in the - c:\MyHDFstuff\hdf5examples\hl\examples directory and places all the executables in - it. - - 4. We provide a batch file named test_hl_cexamples.bat in - c:\MyHDFstuff\hdf5examples\hl\examples directory for you to test HDF5 high level C - examples. - - test_hl_cexamples.bat batch file has options: - - Options purpose - - test_hl_cexamples release -- for release version - - test_hl_cexamples release dll -- for release DLL version - - Invoke a command prompt window and run test_hl_cexamples with - appropriate options. - - Invoke a command prompt and run testExamples.bat with appropriate options. - You should get "All of the HL C Examples Passed!" when the HL C examples - are built successfully. Otherwise, the difference between the expected - outputs and actual outputs will be given. - - -======================================================================== - Section III: Building an application using the HDF5 library or DLL -======================================================================== - -Waring: The instructions below will only describe how to build an application - using the release version of the HDF5 library or DLL. To use the debug - version of the HDF5 library or DLL, you need to substitute the release - version of the HDF5 library or DLL with the debug version. - - -To build an application that uses the HDF5 static library the following -locations will need to be specified for locating header files and linking with -the HDF static library, for example: - -c:\MyHDFstuff\hdf5\hdf5lib\release\include -c:\MyHDFstuff\hdf5\hdf5lib\release\lib - -We assume that you will use Zlib and Szip compression with HDF5 library. - -1. Specifying Include Directories - -To specify the include directories in the settings for your Visual Studio -project, you may choose one of the following two methods. - - Method One: Project-wide Settings - - 1. Open your project in Microsoft Visual Studio and make sure it is the - active project. - - 2. Go to the Project menu and chose the "Properties" option. - - 3. Choose the build configuration you would like to modify in the drop - down menu labeled "Configuration:" - - 4. Choose the "C/C++" tab, and select "General". - - 5. In a text-area labeled with "Additional Include Directories:", add - HDF5, Zlib, and Szip header files directories. For example: - - c:\MyHDFstuff\hdf5\hdf5lib\release\include - c:\zlib\include - c:\szip\include - - Then click OK. - - 6. (Optional) To use HDF5 Fortran static library, the location of - Fortran module files should be specified by following Project-> - Settings->Fortran->Preprocessor, and in the text-area labeled - "Additional Include Directories", add HDF5 Fortran module files - directories. For example: - - c:\MyHDFstuff\hdf5\hdf5lib\release\include - - Method Two: Visual Studio Settings - - 1. In Visual STudio, go to Tools->Options->Projects-> - VC++ Directories. Under "Show Directories For", select "Include files" - - 2. Insert the correct HDF5, Zlib, Szip paths for headers(include). For - example, - - c:\MyHDFstuff\hdf5\hdf5lib\release\include - c:\zlib\include - c:\szip\include - - -2. Specifying Library Directories - -To specify the library directories in the settings for your Visual Studio -project, you may choose one of the following two methods. - - Method One: Project-wide Settings - - 1. Open your project in Microsoft Visual Studio and make sure it is the - active project. - - 2. Go to the Project menu and chose the "Properties" option. - - 3. Choose the build configuration you would like to modify in the drop - down menu labeled "Configuration:" - - 4. Choose the "Linker" tab, and select "General". - - 5. In a text-area labeled with "Additional Library Directories:", add - HDF5, Zlib, and Szip library files directories. For example: - - c:\MyHDFstuff\hdf5\hdf5lib\release\lib - c:\zlib\dll - c:\szip\dll - - Note: To link with HDF5 DLLs rathern that static libraries, simply - specify the "dll" directory rather than "lib", and link with the - corresponding DLL link library below. - - Then click OK. - - - Method Two: Visual Studio Settings - - 1. In Visual STudio, go to Tools->Options->Projects-> - VC++ Directories. Under "Show Directories For", select "Library files" - - 2. Insert the correct HDF5, Zlib, Szip paths for link libraries. For - example, - - c:\MyHDFstuff\hdf5\hdf5lib\release\lib - c:\zlib\dll - c:\szip\dll - - Note: To link with HDF5 DLLs rathern that static libraries, simply - specify the "dll" directory rather than "lib", and link with the - corresponding DLL link library below. - - -3. Specifying Libraries to Link - - To link the HDF5 static library with your application: - - 1. In Visual Studio, go to the Project menu and choose "Properties". - - 2. Find the "Link" option and "Input" category. In the "Additional - Dependencies" field, insert "zlib.lib, libszip.lib, hdf5.lib". - - 3. (Optional) Also insert "hdf5_cpp.lib" if you want to use HDF5 C++ - static library. - - 4. (Optional) Also insert "hdf5_fortran.lib" if you want to use HDF5 - Fortran static library. - - 5. (Optional) Also insert "hdf5_hl.lib" if you want to use HDF5 high - level static library. - - 6. (Optional) Also insert "hdf5_hl_cpp.lib" if you want to use HDF5 High - Level C++ static library. - - 7. (Optional) Also insert "hdf5_hl_fortran.lib" if you want to use HDF5 - High Level Fortran static library. - - - To link the HDF5 DLL library with your application: - - 1. Follow the steps for linking the HDF5 static library as shown above, - except now link the export library that is created with the DLL. - - The export library is called hdf5dll.lib for HDF5 C libray, - hdf5_cppdll.lib for HDF5 C++ library, and hdf5_fortrandll.lib - for HDF5 Fortran library. - - 2. In the Project Properties dialog, go to the C/C++ > Preprocessor - subsection. In the "Preprocessor Definitions" box, add "_HDF5USEDLL_" - to the list. - - 3. (Optional) Also add HDF5CPP_USEDLL to use HDF5 C++ DLL. - - 4. (Optional) Also add _HDF5USEHLDLL_ to use HDF5 high level DLL. - - 5. (Optional) Also add HDF5USE_HLCPPDLL use HDF5 high level C++ DLL. - - 6. (Optional) Follow Project->Settings->Fortran->Category->General-> - Predefined Preprocess or Symbols, and add "HDF5F90_WINDOWS" to use HDF5 - Fortran DLL. - - 7. Place the DLLs in a location that Windows will be able to locate. The - searched path and order for DLL's is - - a) The directory where the executable module for the current - process is located. - b) The current directory. - c} The Windows system directory. The GetSystemDirectory function - retrieves the path of this directory. - d) The Windows directory. The GetWindowsDirectory function - retrieves the path of this directory. - e) The directories listed in the PATH environment variable. - - -======================================================================== - Section IV: How to build HDF5 for 64-bit Windows -======================================================================== - -HDF5 is available for 64-bit Windows in Visual Studio 2008. - -Prerequisites: - - 1. A 64-bit Windows machine. - - 2. Microsoft Visual Studio 2008 installed with x64 Extensions. - - -Building: - - Building 64-bit Windows binaries is very similar to the process for 32-bit. - Therefore, you may follow the instructions in Section II with the following - modifications. - - 1. The x64 platform must be selected in the build configuration for - debug and release versions. Before building, go to "Build", - "Configuration Manager". In the "Active solution platform" box, - select "x64", and press "Close". - - 2. 64-bit HDF5 applications must be built with 64-bit external libraries. - You must add the include and - library paths for x64 configurations as you have in the - "Prerequisites" section. This is also true for Intel Fortran if - Fortran libraries are to be built. - -======================================================================== - Section V: How to build HDF5 applications using Visual Studio 2010 -======================================================================== -Building with Visual Studio 2010 is very similar to building with Visual Studio -2008, with some minor changes. Therefore, follow the build instructions above, -with the following considerations: - - 1. Visual Studio 2010 uses a new format for project files, but Visual Studio - 2008 project files can be converted. The HDF5 project files - will need to be converted on first use. To do so: - - 1.1. Open the HDF5 Visual Studio 2008 solution file as in Section II - (all.sln) - - NOTE. Intel Fortran 11.1 currently does not integrate with Visual Studio 2010. - - 1.2. You will be prompted with an automatic conversion wizard. Click - through, accepting the default values. You may choose to create - backups of the project files, although it isn't necessary. - - 1.3. When it is finished, it should state that all projects were - converted successfully with no errors. Warnings can be ignored. - - 2. Once the project files have been converted you will need to create project - property sheets for the library and include paths. Then build and test normally. - Note that the converted project files aren't backwards compatible with - previous versions of Visual Studio. +Instructions for building and testing HDF5 applications using CMake can be found in +the USING_CMake.txt file found in this folder. ======================================================================== @@ -635,26 +19,7 @@ with the following considerations: Here are some helpful notes if you are not familiar with using the Visual C++ Development Environment. - 1.1 Project name and location issues: - - It is recommended that you use the given directory structure for building - HDF5 Examples. However, it is possible to create your own structure. If you must - install all.sln and all.vcproj in another directory, relative to hdf5 - directory, you will be asked to locate the sub-project files, when you open - the project all.sln. - - If you want to rename "all" (the entire project), you will need to modify - two files all.sln and all.vcproj as text (contrary to the explicit warnings - in the files). - - - 1.2 Settings... details: - - If you create your own project, the necessary settings can be read - from the all.vcproj file (as text), or from the Project Settings in the - Visual Studio project settings dialog. - - 1.3 FAQ + 1.1 FAQ Many other common questions and hints are located online and being updated in the HDF5 FAQ. For Windows-specific questions, please see: diff --git a/src/H5FDstdio.c b/src/H5FDstdio.c index 4e484c2..8f4f7f0 100644 --- a/src/H5FDstdio.c +++ b/src/H5FDstdio.c @@ -415,23 +415,36 @@ H5FD_stdio_open( const char *name, unsigned flags, hid_t fapl_id, /* Get the file descriptor (needed for truncate and some Windows information) */ file->fd = fileno(file->fp); - if(file->fd < 0) + if(file->fd < 0) { + free(file); + fclose(f); H5Epush_ret(func, H5E_ERR_CLS, H5E_FILE, H5E_CANTOPENFILE, "unable to get file descriptor", NULL); + } /* end if */ #ifdef H5_HAVE_WIN32_API file->hFile = (HANDLE)_get_osfhandle(file->fd); - if(INVALID_HANDLE_VALUE == file->hFile) + if(INVALID_HANDLE_VALUE == file->hFile) { + free(file); + fclose(f); H5Epush_ret(func, H5E_ERR_CLS, H5E_FILE, H5E_CANTOPENFILE, "unable to get Windows file handle", NULL); + } /* end if */ - if(!GetFileInformationByHandle((HANDLE)file->hFile, &fileinfo)) - H5Epush_ret(func, H5E_ERR_CLS, H5E_FILE, H5E_CANTOPENFILE, "unable to get Windows file desinformationcriptor", NULL); + if(!GetFileInformationByHandle((HANDLE)file->hFile, &fileinfo)) { + free(file); + fclose(f); + H5Epush_ret(func, H5E_ERR_CLS, H5E_FILE, H5E_CANTOPENFILE, "unable to get Windows file descriptor information", NULL); + } /* end if */ file->nFileIndexHigh = fileinfo.nFileIndexHigh; file->nFileIndexLow = fileinfo.nFileIndexLow; file->dwVolumeSerialNumber = fileinfo.dwVolumeSerialNumber; #else /* H5_HAVE_WIN32_API */ - fstat(file->fd, &sb); + if(fstat(file->fd, &sb) < 0) { + free(file); + fclose(f); + H5Epush_ret(func, H5E_ERR_CLS, H5E_FILE, H5E_BADFILE, "unable to fstat file", NULL) + } /* end if */ file->device = sb.st_dev; #ifdef H5_VMS file->inode[0] = sb.st_ino[0]; diff --git a/src/H5HFdbg.c b/src/H5HFdbg.c index 76c7b96..5d68fd1 100644 --- a/src/H5HFdbg.c +++ b/src/H5HFdbg.c @@ -187,7 +187,7 @@ H5HF_dtable_debug(const H5HF_dtable_t *dtable, FILE *stream, int indent, int fwi void H5HF_hdr_print(const H5HF_hdr_t *hdr, hid_t dxpl_id, hbool_t dump_internal, FILE *stream, int indent, int fwidth) { - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_NOAPI_NOINIT_NOERR /* * Check arguments. @@ -381,7 +381,7 @@ H5HF_dblock_debug_cb(H5FS_section_info_t *_sect, void *_udata) size_t start, end; /* Start & end of the overlapping area */ size_t len; /* Length of the overlapping area */ size_t overlap; /* Track any overlaps */ - unsigned u; /* Local index variable */ + size_t u; /* Local index variable */ /* Calculate the starting & ending */ if(sect_start < dblock_start) @@ -396,7 +396,7 @@ H5HF_dblock_debug_cb(H5FS_section_info_t *_sect, void *_udata) /* Calculate the length */ len = end - start; - sprintf(temp_str, "Section #%u:", (unsigned)udata->sect_count); + HDsnprintf(temp_str, sizeof(temp_str), "Section #%u:", (unsigned)udata->sect_count); HDfprintf(udata->stream, "%*s%-*s %8Zu, %8Zu\n", udata->indent + 3, "", MAX(0, udata->fwidth - 9), temp_str, start, len); @@ -530,7 +530,7 @@ H5HF_dblock_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, HDfprintf(stream, "%*s%-*s %.2f%%\n", indent, "", fwidth, "Percent of available space for data used:", - (100.0 * (double)((dblock->size - blk_prefix_size) - amount_free) / (double)(dblock->size - blk_prefix_size))); + ((double)100.0f * (double)((dblock->size - blk_prefix_size) - amount_free) / (double)(dblock->size - blk_prefix_size))); /* * Print the data in a VMS-style octal dump. @@ -569,7 +569,7 @@ H5HF_iblock_print(const H5HF_indirect_t *iblock, char temp_str[64]; /* Temporary string, for formatting */ size_t u, v; /* Local index variable */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_NOAPI_NOINIT_NOERR /* * Check arguments. @@ -614,13 +614,13 @@ H5HF_iblock_print(const H5HF_indirect_t *iblock, else HDfprintf(stream, "%*sDirect Block Entries: (address)\n", indent, ""); for(u = 0; u < hdr->man_dtable.max_direct_rows && u < iblock->nrows; u++) { - sprintf(temp_str, "Row #%u: (block size: %lu)", (unsigned)u, (unsigned long)hdr->man_dtable.row_block_size[u]); + HDsnprintf(temp_str, sizeof(temp_str), "Row #%u: (block size: %lu)", (unsigned)u, (unsigned long)hdr->man_dtable.row_block_size[u]); HDfprintf(stream, "%*s%-*s\n", indent + 3, "", MAX(0, fwidth - 3), temp_str); for(v = 0; v < hdr->man_dtable.cparam.width; v++) { size_t off = (u * hdr->man_dtable.cparam.width) + v; - sprintf(temp_str, "Col #%u:", (unsigned)v); + HDsnprintf(temp_str, sizeof(temp_str), "Col #%u:", (unsigned)v); if(hdr->filter_len > 0) HDfprintf(stream, "%*s%-*s %9a/%6Zu/%x\n", indent + 6, "", MAX(0, fwidth - 6), temp_str, @@ -642,13 +642,13 @@ H5HF_iblock_print(const H5HF_indirect_t *iblock, H5V_log2_of2(hdr->man_dtable.cparam.width); for(u = hdr->man_dtable.max_direct_rows; u < iblock->nrows; u++) { num_indirect_rows = (H5V_log2_gen(hdr->man_dtable.row_block_size[u]) - first_row_bits) + 1; - sprintf(temp_str, "Row #%u: (# of rows: %u)", (unsigned)u, num_indirect_rows); + HDsnprintf(temp_str, sizeof(temp_str), "Row #%u: (# of rows: %u)", (unsigned)u, num_indirect_rows); HDfprintf(stream, "%*s%-*s\n", indent + 3, "", MAX(0, fwidth - 3), temp_str); for(v = 0; v < hdr->man_dtable.cparam.width; v++) { size_t off = (u * hdr->man_dtable.cparam.width) + v; - sprintf(temp_str, "Col #%u:", (unsigned)v); + HDsnprintf(temp_str, sizeof(temp_str), "Col #%u:", (unsigned)v); HDfprintf(stream, "%*s%-*s %9a\n", indent + 6, "", MAX(0, fwidth - 6), temp_str, iblock->ents[off].addr); diff --git a/src/H5Lexternal.c b/src/H5Lexternal.c index 62e7a5e..a1245ba 100644 --- a/src/H5Lexternal.c +++ b/src/H5Lexternal.c @@ -102,7 +102,7 @@ H5L_getenv_prefix_name(char **env_prefix/*in,out*/) FUNC_ENTER_NOAPI_NOINIT_NOERR - strret = HDstrchr(*env_prefix, COLON_SEPC); + strret = HDstrchr(*env_prefix, H5_COLON_SEPC); if (strret == NULL) { retptr = *env_prefix; *env_prefix = strret; @@ -144,14 +144,9 @@ H5L_build_name(char *prefix, char *file_name, char **full_name/*out*/) if(NULL == (*full_name = (char *)H5MM_malloc(prefix_len + fname_len + 2))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "unable to allocate filename buffer") - /* Copy the prefix into the buffer */ - HDstrcpy(*full_name, prefix); - - if (!CHECK_DELIMITER(prefix[prefix_len-1])) - HDstrcat(*full_name, DIR_SEPS); - - /* Add the external link's filename to the prefix supplied */ - HDstrcat(*full_name, file_name); + /* Compose the full file name */ + HDsnprintf(*full_name, (prefix_len + fname_len + 2), "%s%s%s", prefix, + (H5_CHECK_DELIMITER(prefix[prefix_len - 1]) ? "" : H5_DIR_SEPS), file_name); done: FUNC_LEAVE_NOAPI(ret_value) @@ -319,24 +314,32 @@ H5L_extern_traverse(const char UNUSED *link_name, hid_t cur_group, HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed") /* target file_name is an absolute pathname: see RM for detailed description */ - if(CHECK_ABSOLUTE(file_name) || CHECK_ABS_PATH(file_name)) { + if(H5_CHECK_ABSOLUTE(file_name) || H5_CHECK_ABS_PATH(file_name)) { /* Try opening file */ if(NULL == (ext_file = H5F_efc_open(loc.oloc->file, file_name, intent, H5P_FILE_CREATE_DEFAULT, fapl_id, H5AC_dxpl_id))) { - char *ptr = NULL; + char *ptr; H5E_clear_stack(NULL); /* get last component of file_name */ - GET_LAST_DELIMITER(file_name, ptr) + H5_GET_LAST_DELIMITER(file_name, ptr) HDassert(ptr); - HDstrcpy(temp_file_name, ++ptr); + + /* Increment past delimiter */ + ptr++; + + /* Copy into the temp. file name */ + HDstrncpy(temp_file_name, ptr, HDstrlen(ptr) + 1); } /* end if */ } /* end if */ - else if(CHECK_ABS_DRIVE(file_name)) { + else if(H5_CHECK_ABS_DRIVE(file_name)) { + /* Try opening file */ if(NULL == (ext_file = H5F_efc_open(loc.oloc->file, file_name, intent, H5P_FILE_CREATE_DEFAULT, fapl_id, H5AC_dxpl_id))) { + H5E_clear_stack(NULL); + /* strip ":" */ - HDstrcpy(temp_file_name, &file_name[2]); + HDstrncpy(temp_file_name, &file_name[2], (HDstrlen(file_name) - 2) + 1); } /* end if */ } /* end if */ @@ -414,7 +417,7 @@ H5L_extern_traverse(const char UNUSED *link_name, hid_t cur_group, HGOTO_ERROR(H5E_LINK, H5E_CANTALLOC, FAIL, "can't duplicate resolved file name string") /* get last component of file_name */ - GET_LAST_DELIMITER(actual_file_name, ptr) + H5_GET_LAST_DELIMITER(actual_file_name, ptr) if(!ptr) HGOTO_ERROR(H5E_LINK, H5E_CANTOPENFILE, FAIL, "unable to open external file, external link file name = '%s', temp_file_name = '%s'", file_name, temp_file_name) @@ -543,6 +546,8 @@ H5Lcreate_external(const char *file_name, const char *obj_name, char *norm_obj_name = NULL; /* Pointer to normalized current name */ void *ext_link_buf = NULL; /* Buffer to contain external link */ size_t buf_size; /* Size of buffer to hold external link */ + size_t file_name_len; /* Length of file name string */ + size_t norm_obj_name_len; /* Length of normalized object name string */ uint8_t *p; /* Pointer into external link buffer */ herr_t ret_value = SUCCEED; /* Return value */ @@ -565,16 +570,18 @@ H5Lcreate_external(const char *file_name, const char *obj_name, HGOTO_ERROR(H5E_SYM, H5E_BADVALUE, FAIL, "can't normalize object name") /* Combine the filename and link name into a single buffer to give to the UD link */ - buf_size = 1 + (HDstrlen(file_name) + 1) + (HDstrlen(norm_obj_name) + 1); + file_name_len = HDstrlen(file_name) + 1; + norm_obj_name_len = HDstrlen(norm_obj_name) + 1; + buf_size = 1 + file_name_len + norm_obj_name_len; if(NULL == (ext_link_buf = H5MM_malloc(buf_size))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "unable to allocate udata buffer") /* Encode the external link information */ p = (uint8_t *)ext_link_buf; *p++ = (H5L_EXT_VERSION << 4) | H5L_EXT_FLAGS_ALL; /* External link version & flags */ - HDstrcpy((char *)p, file_name); /* Name of file containing external link's object */ - p += HDstrlen(file_name) + 1; - HDstrcpy((char *)p, norm_obj_name); /* External link's object */ + HDstrncpy((char *)p, file_name, file_name_len); /* Name of file containing external link's object */ + p += file_name_len; + HDstrncpy((char *)p, norm_obj_name, norm_obj_name_len); /* External link's object */ /* Create an external link */ if(H5L_create_ud(&link_loc, link_name, ext_link_buf, buf_size, H5L_TYPE_EXTERNAL, lcpl_id, lapl_id, H5AC_dxpl_id) < 0) diff --git a/src/H5Ocopy.c b/src/H5Ocopy.c index f643842..dc79e47 100644 --- a/src/H5Ocopy.c +++ b/src/H5Ocopy.c @@ -1245,7 +1245,7 @@ H5O_copy_obj_by_ref(H5O_loc_t *src_oloc, hid_t dxpl_id, H5O_loc_t *dst_oloc, new_oloc.addr = dst_oloc->addr; /* Pick a default name for the new object */ - sprintf(tmp_obj_name, "~obj_pointed_by_%llu", (unsigned long long)dst_oloc->addr); + HDsnprintf(tmp_obj_name, sizeof(tmp_obj_name), "~obj_pointed_by_%llu", (unsigned long long)dst_oloc->addr); /* Create a link to the newly copied object */ /* Note: since H5O_copy_header_map actually copied the target object, it diff --git a/src/H5Oname.c b/src/H5Oname.c index fb44000..c1cb8c8 100644 --- a/src/H5Oname.c +++ b/src/H5Oname.c @@ -97,10 +97,10 @@ H5O_name_decode(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, H5O_t UNUSED *open_oh, HDassert(p); /* decode */ - if(NULL == (mesg = (H5O_name_t *)H5MM_calloc(sizeof(H5O_name_t))) || - NULL == (mesg->s = (char *)H5MM_malloc(HDstrlen((const char *)p) + 1))) + if(NULL == (mesg = (H5O_name_t *)H5MM_calloc(sizeof(H5O_name_t)))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") + if(NULL == (mesg->s = (char *)H5MM_strdup((const char *)p))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") - HDstrcpy(mesg->s, (const char *)p); /* Set return value */ ret_value = mesg; @@ -138,9 +138,9 @@ H5O_name_encode(H5F_t UNUSED *f, hbool_t UNUSED disable_shared, uint8_t *p, cons FUNC_ENTER_NOAPI_NOINIT_NOERR /* check args */ - assert(f); - assert(p); - assert(mesg && mesg->s); + HDassert(f); + HDassert(p); + HDassert(mesg && mesg->s); /* encode */ HDstrcpy((char*)p, mesg->s); diff --git a/src/H5T.c b/src/H5T.c index 5801c3f..65460ed 100644 --- a/src/H5T.c +++ b/src/H5T.c @@ -4389,7 +4389,7 @@ H5T_path_find(const H5T_t *src, const H5T_t *dst, const char *name, H5T_g.apaths = 128; if(NULL == (H5T_g.path[0] = H5FL_CALLOC(H5T_path_t))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed for no-op conversion path") - HDstrcpy(H5T_g.path[0]->name, "no-op"); + HDsnprintf(H5T_g.path[0]->name, sizeof(H5T_g.path[0]->name), "no-op"); H5T_g.path[0]->func = H5T__conv_noop; H5T_g.path[0]->cdata.command = H5T_CONV_INIT; if(H5T__conv_noop(FAIL, FAIL, &(H5T_g.path[0]->cdata), (size_t)0, (size_t)0, (size_t)0, NULL, NULL, dxpl_id) < 0) { @@ -4457,7 +4457,7 @@ H5T_path_find(const H5T_t *src, const H5T_t *dst, const char *name, path->name[H5T_NAMELEN - 1] = '\0'; } /* end if */ else - HDstrcpy(path->name, "NONAME"); + HDsnprintf(path->name, sizeof(path->name), "NONAME"); if(NULL == (path->src = H5T_copy(src, H5T_COPY_ALL))) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, NULL, "unable to copy datatype for conversion path") if(NULL == (path->dst = H5T_copy(dst, H5T_COPY_ALL))) diff --git a/src/H5private.h b/src/H5private.h index 3bc8722..f1f5dbb 100644 --- a/src/H5private.h +++ b/src/H5private.h @@ -1473,19 +1473,20 @@ extern char *strdup(const char *s); #if defined(H5_HAVE_WINDOW_PATH) /* directory delimiter for Windows: slash and backslash are acceptable on Windows */ -#define DIR_SLASH_SEPC '/' -#define DIR_SEPC '\\' -#define DIR_SEPS "\\" -#define CHECK_DELIMITER(SS) ((SS == DIR_SEPC)||(SS == DIR_SLASH_SEPC)) -#define CHECK_ABSOLUTE(NAME) ((isalpha(NAME[0])) && (NAME[1] == ':') && (CHECK_DELIMITER(NAME[2]))) -#define CHECK_ABS_DRIVE(NAME) ((isalpha(NAME[0])) && (NAME[1] == ':')) -#define CHECK_ABS_PATH(NAME) (CHECK_DELIMITER(NAME[0])) - -#define GET_LAST_DELIMITER(NAME, ptr) { \ +#define H5_DIR_SLASH_SEPC '/' +#define H5_DIR_SEPC '\\' +#define H5_DIR_SEPS "\\" +#define H5_CHECK_DELIMITER(SS) ((SS == H5_DIR_SEPC) || (SS == H5_DIR_SLASH_SEPC)) +#define H5_CHECK_ABSOLUTE(NAME) ((HDisalpha(NAME[0])) && (NAME[1] == ':') && (H5_CHECK_DELIMITER(NAME[2]))) +#define H5_CHECK_ABS_DRIVE(NAME) ((HDisalpha(NAME[0])) && (NAME[1] == ':')) +#define H5_CHECK_ABS_PATH(NAME) (H5_CHECK_DELIMITER(NAME[0])) + +#define H5_GET_LAST_DELIMITER(NAME, ptr) { \ char *slash, *backslash; \ - slash = strrchr(NAME, DIR_SLASH_SEPC); \ - backslash = strrchr(NAME, DIR_SEPC); \ - if (backslash > slash) \ + \ + slash = HDstrrchr(NAME, H5_DIR_SLASH_SEPC); \ + backslash = HDstrrchr(NAME, H5_DIR_SEPC); \ + if(backslash > slash) \ (ptr = backslash); \ else \ (ptr = slash); \ @@ -1495,27 +1496,27 @@ extern char *strdup(const char *s); /* OpenVMS pathname: $:[path] * i.g. SYS$SYSUSERS:[LU.HDF5.SRC]H5system.c */ -#define DIR_SEPC ']' -#define DIR_SEPS "]" -#define CHECK_DELIMITER(SS) (SS == DIR_SEPC) -#define CHECK_ABSOLUTE(NAME) (strrchr(NAME, ':') && strrchr(NAME, '[')) -#define CHECK_ABS_DRIVE(NAME) (0) -#define CHECK_ABS_PATH(NAME) (0) -#define GET_LAST_DELIMITER(NAME, ptr) ptr = strrchr(NAME, DIR_SEPC); +#define H5_DIR_SEPC ']' +#define H5_DIR_SEPS "]" +#define H5_CHECK_DELIMITER(SS) (SS == H5_DIR_SEPC) +#define H5_CHECK_ABSOLUTE(NAME) (HDstrrchr(NAME, ':') && HDstrrchr(NAME, '[')) +#define H5_CHECK_ABS_DRIVE(NAME) (0) +#define H5_CHECK_ABS_PATH(NAME) (0) +#define H5_GET_LAST_DELIMITER(NAME, ptr) ptr = HDstrrchr(NAME, H5_DIR_SEPC); #else -#define DIR_SEPC '/' -#define DIR_SEPS "/" -#define CHECK_DELIMITER(SS) (SS == DIR_SEPC) -#define CHECK_ABSOLUTE(NAME) (CHECK_DELIMITER(*NAME)) -#define CHECK_ABS_DRIVE(NAME) (0) -#define CHECK_ABS_PATH(NAME) (0) -#define GET_LAST_DELIMITER(NAME, ptr) ptr = strrchr(NAME, DIR_SEPC); +#define H5_DIR_SEPC '/' +#define H5_DIR_SEPS "/" +#define H5_CHECK_DELIMITER(SS) (SS == H5_DIR_SEPC) +#define H5_CHECK_ABSOLUTE(NAME) (H5_CHECK_DELIMITER(*NAME)) +#define H5_CHECK_ABS_DRIVE(NAME) (0) +#define H5_CHECK_ABS_PATH(NAME) (0) +#define H5_GET_LAST_DELIMITER(NAME, ptr) ptr = HDstrrchr(NAME, H5_DIR_SEPC); #endif -#define COLON_SEPC ':' +#define H5_COLON_SEPC ':' /* Use FUNC to safely handle variations of C99 __func__ keyword handling */ diff --git a/src/H5public.h b/src/H5public.h index 63439c4..f66508d 100644 --- a/src/H5public.h +++ b/src/H5public.h @@ -75,10 +75,10 @@ extern "C" { /* Version numbers */ #define H5_VERS_MAJOR 1 /* For major interface/format changes */ #define H5_VERS_MINOR 9 /* For minor interface/format changes */ -#define H5_VERS_RELEASE 144 /* For tweaks, bug-fixes, or development */ +#define H5_VERS_RELEASE 148 /* For tweaks, bug-fixes, or development */ #define H5_VERS_SUBRELEASE "" /* For pre-releases like snap0 */ /* Empty string for real releases. */ -#define H5_VERS_INFO "HDF5 library version: 1.9.144" /* Full version string */ +#define H5_VERS_INFO "HDF5 library version: 1.9.148" /* Full version string */ #define H5check() H5check_version(H5_VERS_MAJOR,H5_VERS_MINOR, \ H5_VERS_RELEASE) diff --git a/src/H5system.c b/src/H5system.c index 83cecba..3ffe411 100644 --- a/src/H5system.c +++ b/src/H5system.c @@ -707,7 +707,7 @@ H5_build_extpath(const char *name, char **extpath/*out*/) * OpenVMS: $:[path] * i.g. SYS$SYSUSERS:[LU.HDF5.SRC]H5system.c */ - if(CHECK_ABSOLUTE(name)) { + if(H5_CHECK_ABSOLUTE(name)) { if(NULL == (full_path = (char *)H5MM_strdup(name))) HGOTO_ERROR(H5E_INTERNAL, H5E_NOSPACE, FAIL, "memory allocation failed") } /* end if */ @@ -726,7 +726,7 @@ H5_build_extpath(const char *name, char **extpath/*out*/) * Unix: does not apply * OpenVMS: does not apply */ - if(CHECK_ABS_DRIVE(name)) { + if(H5_CHECK_ABS_DRIVE(name)) { drive = name[0] - 'A' + 1; retcwd = HDgetdcwd(drive, cwdpath, MAX_PATH_LEN); HDstrcpy(new_name, &name[2]); @@ -737,7 +737,7 @@ H5_build_extpath(const char *name, char **extpath/*out*/) * Unix: does not apply * OpenVMS: does not apply */ - else if(CHECK_ABS_PATH(name) && (0 != (drive = HDgetdrive()))) { + else if(H5_CHECK_ABS_PATH(name) && (0 != (drive = HDgetdrive()))) { sprintf(cwdpath, "%c:%c", (drive+'A'-1), name[0]); retcwd = cwdpath; HDstrcpy(new_name, &name[1]); @@ -773,8 +773,8 @@ H5_build_extpath(const char *name, char **extpath/*out*/) else HDstrncat(full_path, new_name, HDstrlen(new_name)); #else - if(!CHECK_DELIMITER(cwdpath[cwdlen - 1])) - HDstrncat(full_path, DIR_SEPS, HDstrlen(DIR_SEPS)); + if(!H5_CHECK_DELIMITER(cwdpath[cwdlen - 1])) + HDstrncat(full_path, H5_DIR_SEPS, HDstrlen(H5_DIR_SEPS)); HDstrncat(full_path, new_name, HDstrlen(new_name)); #endif } /* end if */ @@ -784,7 +784,7 @@ H5_build_extpath(const char *name, char **extpath/*out*/) if(full_path) { char *ptr = NULL; - GET_LAST_DELIMITER(full_path, ptr) + H5_GET_LAST_DELIMITER(full_path, ptr) HDassert(ptr); *++ptr = '\0'; *extpath = full_path; diff --git a/src/Makefile.in b/src/Makefile.in index f7fe1d8..3c9098f 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -324,6 +324,7 @@ H5_VERSION = @H5_VERSION@ HADDR_T = @HADDR_T@ HAVE_DMALLOC = @HAVE_DMALLOC@ HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@ +HAVE_PTHREAD = @HAVE_PTHREAD@ HDF5_HL = @HDF5_HL@ HDF5_INTERFACES = @HDF5_INTERFACES@ HDF_CXX = @HDF_CXX@ @@ -375,7 +376,6 @@ PACKAGE_VERSION = @PACKAGE_VERSION@ PARALLEL = @PARALLEL@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ -PTHREAD = @PTHREAD@ RANLIB = @RANLIB@ ROOT = @ROOT@ RUNPARALLEL = @RUNPARALLEL@ @@ -522,7 +522,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 134 +LT_VERS_REVISION = 138 LT_VERS_AGE = 0 H5detect_CFLAGS = -g $(AM_CFLAGS) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index aa92371..6af1e94 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -223,8 +223,24 @@ ADD_TEST ( tsohm_dst.h5 tsohm_src.h5 ) -ADD_TEST (NAME testhdf5 COMMAND $) -SET_TESTS_PROPERTIES(testhdf5 PROPERTIES DEPENDS h5test-clear-testhdf5-objects) + +IF (HDF5_ENABLE_USING_MEMCHECKER) + ADD_TEST (NAME testhdf5-base COMMAND $ -x heap -x file -x select) + SET_TESTS_PROPERTIES(testhdf5-base PROPERTIES DEPENDS h5test-clear-testhdf5-objects) + SET_TESTS_PROPERTIES(testhdf5-base PROPERTIES ENVIRONMENT HDF5_ALARM_SECONDS=3600) + ADD_TEST (NAME testhdf5-heap COMMAND $ -o heap) + SET_TESTS_PROPERTIES(testhdf5-heap PROPERTIES DEPENDS h5test-clear-testhdf5-objects) + SET_TESTS_PROPERTIES(testhdf5-heap PROPERTIES ENVIRONMENT HDF5_ALARM_SECONDS=3600) + ADD_TEST (NAME testhdf5-file COMMAND $ -o file) + SET_TESTS_PROPERTIES(testhdf5-file PROPERTIES DEPENDS h5test-clear-testhdf5-objects) + SET_TESTS_PROPERTIES(testhdf5-file PROPERTIES ENVIRONMENT HDF5_ALARM_SECONDS=3600) + ADD_TEST (NAME testhdf5-select COMMAND $ -o select) + SET_TESTS_PROPERTIES(testhdf5-select PROPERTIES DEPENDS h5test-clear-testhdf5-objects) + SET_TESTS_PROPERTIES(testhdf5-select PROPERTIES ENVIRONMENT HDF5_ALARM_SECONDS=3600) +ELSE (HDF5_ENABLE_USING_MEMCHECKER) + ADD_TEST (NAME testhdf5 COMMAND $) + SET_TESTS_PROPERTIES(testhdf5 PROPERTIES DEPENDS h5test-clear-testhdf5-objects) +ENDIF (HDF5_ENABLE_USING_MEMCHECKER) ############################################################################## ############################################################################## diff --git a/test/Makefile.in b/test/Makefile.in index 458ede6..81681ef 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -598,6 +598,7 @@ H5_VERSION = @H5_VERSION@ HADDR_T = @HADDR_T@ HAVE_DMALLOC = @HAVE_DMALLOC@ HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@ +HAVE_PTHREAD = @HAVE_PTHREAD@ HDF5_HL = @HDF5_HL@ HDF5_INTERFACES = @HDF5_INTERFACES@ HDF_CXX = @HDF_CXX@ @@ -649,7 +650,6 @@ PACKAGE_VERSION = @PACKAGE_VERSION@ PARALLEL = @PARALLEL@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ -PTHREAD = @PTHREAD@ RANLIB = @RANLIB@ ROOT = @ROOT@ RUNPARALLEL = @RUNPARALLEL@ diff --git a/test/testframe.c b/test/testframe.c index 5835b73..8ab7a5b 100644 --- a/test/testframe.c +++ b/test/testframe.c @@ -155,8 +155,8 @@ void TestUsage(void) print_func("Usage: %s [-v[erbose] (l[ow]|m[edium]|h[igh]|0-9)] %s\n", TestProgName, (TestPrivateUsage ? "" : "")); - print_func(" [-[e]x[clude] name+] \n"); - print_func(" [-o[nly] name+] \n"); + print_func(" [-[e]x[clude] name]+ \n"); + print_func(" [-o[nly] name]+ \n"); print_func(" [-b[egin] name] \n"); print_func(" [-s[ummary]] \n"); print_func(" [-c[leanoff]] \n"); diff --git a/test/testhdf5.h b/test/testhdf5.h index c92c0f0..907fce9 100644 --- a/test/testhdf5.h +++ b/test/testhdf5.h @@ -142,7 +142,7 @@ if(VERBOSE_HI) \ print_func(" Call to routine: %15s at line %4d in %s returned " \ "invalid result\n", where, (int)__LINE__, __FILE__); \ - TestErrPrintf("*** UNEXPECTED RESULT from %s at line %4d in %s\n" \ + TestErrPrintf("*** UNEXPECTED RESULT from %s at line %4d in %s\n", \ where, (int)__LINE__, __FILE__); \ } while(0) diff --git a/test/testlibinfo.sh.in b/test/testlibinfo.sh.in index fba1794..b7aa6c4 100644 --- a/test/testlibinfo.sh.in +++ b/test/testlibinfo.sh.in @@ -53,7 +53,10 @@ SKIP() { # Function definitions CHECK_LIBINFO(){ LINEMSG $1 - if strings $1 | grep "SUMMARY OF THE HDF5 CONFIGURATION" > /dev/null; then + # Some systems, like Mac, the strings command inspects library files. Older + # versions of strings may not know newer library format, resulting in + # command errors. Make it read the file as stdin to avoid the problem. + if strings < $1 | grep "SUMMARY OF THE HDF5 CONFIGURATION" > /dev/null; then echo " PASSED" else echo " FAILED" diff --git a/test/tfile.c b/test/tfile.c index 8ee0b64..e669bd0 100644 --- a/test/tfile.c +++ b/test/tfile.c @@ -526,6 +526,9 @@ test_file_open(void) /* Close dataset from first open */ ret = H5Dclose(did); CHECK(ret, FAIL, "H5Dclose"); + + ret = H5Pclose(fapl_id); + CHECK(ret, FAIL, "H5Pclose"); } /* test_file_open() */ /**************************************************************** @@ -1060,6 +1063,9 @@ test_get_file_id(void) VERIFY(fid2, FAIL, "H5Iget_file_id"); /* Close objects */ + ret = H5Pclose(plist); + CHECK(ret, FAIL, "H5Pclose"); + ret = H5Tclose(datatype_id); CHECK(ret, FAIL, "H5Tclose"); @@ -2855,7 +2861,7 @@ test_filespace_sects(void) test_free_sections(fapl_stdio, filename); /* close fapl and remove the file */ - h5_cleanup(FILENAME, fapl_split); + h5_cleanup(FILENAME, fapl_stdio); /* CORE */ MESSAGE(5, ("Testing File free space information for a core file\n")); @@ -3223,6 +3229,9 @@ test_libver_bounds_real(H5F_libver_t libver_create, unsigned oh_vers_create, ret = H5Fclose(file); CHECK(ret, FAIL, "H5Fclose"); + + ret = H5Pclose(fapl); + CHECK(ret, FAIL, "H5Pclose"); } /* end test_libver_bounds_real() */ /**************************************************************** diff --git a/test/th5o.c b/test/th5o.c index c46751e..a470f4c 100644 --- a/test/th5o.c +++ b/test/th5o.c @@ -111,6 +111,8 @@ test_h5o_open(void) CHECK(dspace, FAIL, "H5Dget_space"); /* Close the IDs */ + ret = H5Sclose(dspace); + CHECK(ret, FAIL, "H5Sclose"); ret = H5Gclose(grp); CHECK(ret, FAIL, "H5Gclose"); ret = H5Tclose(dtype); @@ -324,6 +326,8 @@ test_h5o_open_by_addr(void) CHECK(dspace, FAIL, "H5Dget_space"); /* Close the IDs */ + ret = H5Sclose(dspace); + CHECK(ret, FAIL, "H5Sclose"); ret = H5Gclose(grp); CHECK(ret, FAIL, "H5Gclose"); ret = H5Tclose(dtype); diff --git a/test/th5s.c b/test/th5s.c index a026545..ebbaa37 100644 --- a/test/th5s.c +++ b/test/th5s.c @@ -182,14 +182,13 @@ test_h5s_basic(void) fid1 = H5Fopen(testfile, H5F_ACC_RDONLY, H5P_DEFAULT); CHECK_I(fid1, "H5Fopen"); if (fid1 >= 0){ - dset1 = H5Dopen2(fid1, "dset", H5P_DEFAULT); - VERIFY(dset1, FAIL, "H5Dopen2"); - ret = H5Fclose(fid1); - CHECK_I(ret, "H5Fclose"); + dset1 = H5Dopen2(fid1, "dset", H5P_DEFAULT); + VERIFY(dset1, FAIL, "H5Dopen2"); + ret = H5Fclose(fid1); + CHECK_I(ret, "H5Fclose"); } else - printf("***cannot open the pre-created H5S_MAX_RANK test file (%s)\n", - testfile); + printf("***cannot open the pre-created H5S_MAX_RANK test file (%s)\n", testfile); } /* Verify that incorrect dimensions don't work */ diff --git a/test/tsohm.c b/test/tsohm.c index fddb552..eb5f7c5 100644 --- a/test/tsohm.c +++ b/test/tsohm.c @@ -1280,6 +1280,9 @@ static void size2_verify_plist1(hid_t plist) ret = memcmp(&fill1, &fill1_correct, sizeof(fill1_correct)); VERIFY(ret, 0, memcmp); + + ret = H5Tclose(dtype1_id); + CHECK_I(ret, "H5Tclose"); } /*------------------------------------------------------------------------- @@ -1348,6 +1351,9 @@ static void size2_verify_plist2(hid_t plist) ret = HDmemcmp(&fill2, &fill2_correct, (size_t)DTYPE2_SIZE); VERIFY(ret, 0, memcmp); + + ret = H5Tclose(dtype2_id); + CHECK_I(ret, "H5Tclose"); } #ifdef NOT_NOW @@ -3138,6 +3144,8 @@ static void test_sohm_extlink_helper(hid_t src_fcpl_id, hid_t dst_fcpl_id) /* Close the dataset and both files to make sure everything gets flushed * out of memory */ + ret = H5Sclose(space_id); + CHECK_I(ret, "H5Sclose"); ret = H5Dclose(dset_id); CHECK_I(ret, "H5Dclose"); ret = H5Fclose(src_file_id); @@ -3195,6 +3203,9 @@ test_sohm_extlink(void) test_sohm_extlink_helper(fcpl_id, H5P_DEFAULT); test_sohm_extlink_helper(H5P_DEFAULT, fcpl_id); test_sohm_extlink_helper(fcpl_id, fcpl_id); + + ret = H5Pclose(fcpl_id); + CHECK_I(ret, "H5Pclose"); } @@ -3782,6 +3793,9 @@ test_sohm_extend_dset(void) CHECK_I(ret, "test_sohm_extend_dset_helper"); ret = test_sohm_extend_dset_helper(fcpl_id, TRUE); CHECK_I(ret, "test_sohm_extend_dset_helper"); + + ret = H5Pclose(fcpl_id); + CHECK_I(ret, "H5Pclose"); } diff --git a/testpar/Makefile.in b/testpar/Makefile.in index 394b3b1..2fbf5fc 100644 --- a/testpar/Makefile.in +++ b/testpar/Makefile.in @@ -255,6 +255,7 @@ H5_VERSION = @H5_VERSION@ HADDR_T = @HADDR_T@ HAVE_DMALLOC = @HAVE_DMALLOC@ HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@ +HAVE_PTHREAD = @HAVE_PTHREAD@ HDF5_HL = @HDF5_HL@ HDF5_INTERFACES = @HDF5_INTERFACES@ HDF_CXX = @HDF_CXX@ @@ -306,7 +307,6 @@ PACKAGE_VERSION = @PACKAGE_VERSION@ PARALLEL = @PARALLEL@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ -PTHREAD = @PTHREAD@ RANLIB = @RANLIB@ ROOT = @ROOT@ RUNPARALLEL = @RUNPARALLEL@ diff --git a/tools/Makefile.in b/tools/Makefile.in index 70e11ae..46c7d53 100644 --- a/tools/Makefile.in +++ b/tools/Makefile.in @@ -228,6 +228,7 @@ H5_VERSION = @H5_VERSION@ HADDR_T = @HADDR_T@ HAVE_DMALLOC = @HAVE_DMALLOC@ HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@ +HAVE_PTHREAD = @HAVE_PTHREAD@ HDF5_HL = @HDF5_HL@ HDF5_INTERFACES = @HDF5_INTERFACES@ HDF_CXX = @HDF_CXX@ @@ -279,7 +280,6 @@ PACKAGE_VERSION = @PACKAGE_VERSION@ PARALLEL = @PARALLEL@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ -PTHREAD = @PTHREAD@ RANLIB = @RANLIB@ ROOT = @ROOT@ RUNPARALLEL = @RUNPARALLEL@ diff --git a/tools/h5copy/CMakeLists.txt b/tools/h5copy/CMakeLists.txt index 970cc12..7f68e76 100644 --- a/tools/h5copy/CMakeLists.txt +++ b/tools/h5copy/CMakeLists.txt @@ -44,9 +44,6 @@ IF (BUILD_TESTING) SET (LIST_OTHER_TEST_FILES ${HDF5_TOOLS_H5COPY_SOURCE_DIR}/testfiles/h5copy_misc1.out - ${HDF5_TOOLS_H5COPY_SOURCE_DIR}/testfiles/h5copy_extlinks_src.out.ls - ${HDF5_TOOLS_H5COPY_SOURCE_DIR}/testfiles/h5copy_ref.out.ls - ${HDF5_TOOLS_H5COPY_SOURCE_DIR}/testfiles/h5copytst.out.ls ) FILE (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") @@ -62,20 +59,6 @@ IF (BUILD_TESTING) ARGS -E copy_if_different ${listfiles} ${dest} ) ENDFOREACH (listfiles ${LIST_HDF5_TEST_FILES} ${LIST_OTHER_TEST_FILES}) - - # - # This section can be removed, but leave here for a reference later. - # Purpose: '-l3' ignores top 3 lines when copy text file. - # - #FOREACH (listfiles ${LIST_OTHER_TEST_FILES}) - # SET (lsdest "${PROJECT_BINARY_DIR}/testfiles/${listfiles}") - # ADD_CUSTOM_COMMAND ( - # TARGET h5copy - # POST_BUILD - # COMMAND ${XLATE_UTILITY} - # ARGS ${HDF5_TOOLS_H5COPY_SOURCE_DIR}/testfiles/${listfiles} ${lsdest} -l3 - # ) - #ENDFOREACH (listfiles ${LIST_OTHER_TEST_FILES}) ############################################################################## ############################################################################## @@ -86,89 +69,189 @@ IF (BUILD_TESTING) # # Perform h5copy according to passing parmeters # - MACRO (ADD_H5_F_TEST testname resultcode infile outfile fparam vparam sparam srcname dparam dstname) + MACRO (ADD_H5_F_TEST testname resultcode infile fparam vparam sparam srcname dparam dstname) + IF (NOT HDF5_ENABLE_USING_MEMCHECKER) + # Remove any output file left over from previous test run + ADD_TEST ( + NAME H5COPY_F-${testname}-clear-objects + COMMAND ${CMAKE_COMMAND} + -E remove + ./testfiles/${testname}.out.h5 + ) + ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) + ADD_TEST ( NAME H5COPY_F-${testname} - COMMAND $ -f ${fparam} -i ./testfiles/${infile} -o ./testfiles/${outfile} ${vparam} ${sparam} ${srcname} ${dparam} ${dstname} ${ARGN} + COMMAND $ -f ${fparam} -i ./testfiles/${infile} -o ./testfiles/${testname}.out.h5 ${vparam} ${sparam} ${srcname} ${dparam} ${dstname} ${ARGN} ) - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5COPY_F-${testname} PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "H5COPY_F-${testname}") - ADD_H5_DIFF_TEST (${testname} ${resultcode} ${last_test} ${infile} ${outfile} ${srcname} ${dstname}) + IF (HDF5_ENABLE_USING_MEMCHECKER) + IF (NOT "${last_test}" STREQUAL "") + SET_TESTS_PROPERTIES (H5COPY_F-${testname} PROPERTIES DEPENDS ${last_test}) + ENDIF (NOT "${last_test}" STREQUAL "") + ELSE (HDF5_ENABLE_USING_MEMCHECKER) + SET_TESTS_PROPERTIES (H5COPY_F-${testname} PROPERTIES DEPENDS H5COPY_F-${testname}-clear-objects) + ENDIF (HDF5_ENABLE_USING_MEMCHECKER) + + # resultcode=2 will cause the test to skip the diff test + IF (NOT ${resultcode} STREQUAL "2") + ADD_TEST ( + NAME H5COPY_F-${testname}-DIFF + COMMAND $ -q ./testfiles/${infile} ./testfiles/${testname}.out.h5 ${srcname} ${dstname} + ) + SET_TESTS_PROPERTIES(H5COPY_F-${testname}-DIFF PROPERTIES DEPENDS H5COPY_F-${testname}) + IF (${resultcode} STREQUAL "1") + SET_TESTS_PROPERTIES (H5COPY_F-${testname}-DIFF PROPERTIES WILL_FAIL "true") + ENDIF (${resultcode} STREQUAL "1") + ENDIF (NOT ${resultcode} STREQUAL "2") ENDMACRO (ADD_H5_F_TEST) - MACRO (ADD_H5_TEST testname resultcode infile outfile vparam sparam srcname dparam dstname) + MACRO (ADD_H5_TEST testname resultcode infile vparam sparam srcname dparam dstname) + IF (NOT HDF5_ENABLE_USING_MEMCHECKER) + # Remove any output file left over from previous test run + ADD_TEST ( + NAME H5COPY-${testname}-clear-objects + COMMAND ${CMAKE_COMMAND} + -E remove + ./testfiles/${testname}.out.h5 + ) + ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) + ADD_TEST ( NAME H5COPY-${testname} - COMMAND $ -i ./testfiles/${infile} -o ./testfiles/${outfile} ${vparam} ${sparam} ${srcname} ${dparam} ${dstname} ${ARGN} + COMMAND $ -i ./testfiles/${infile} -o ./testfiles/${testname}.out.h5 ${vparam} ${sparam} ${srcname} ${dparam} ${dstname} ${ARGN} ) - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5COPY-${testname} PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "H5COPY-${testname}") - ADD_H5_DIFF_TEST (${testname} ${resultcode} ${last_test} ${infile} ${outfile} ${srcname} ${dstname}) + IF (HDF5_ENABLE_USING_MEMCHECKER) + IF (NOT "${last_test}" STREQUAL "") + SET_TESTS_PROPERTIES (H5COPY-${testname} PROPERTIES DEPENDS ${last_test}) + ENDIF (NOT "${last_test}" STREQUAL "") + ELSE (HDF5_ENABLE_USING_MEMCHECKER) + SET_TESTS_PROPERTIES (H5COPY-${testname} PROPERTIES DEPENDS H5COPY-${testname}-clear-objects) + ENDIF (HDF5_ENABLE_USING_MEMCHECKER) + + # resultcode=2 will cause the test to skip the diff test + IF (NOT ${resultcode} STREQUAL "2") + ADD_TEST ( + NAME H5COPY-${testname}-DIFF + COMMAND $ -q ./testfiles/${infile} ./testfiles/${testname}.out.h5 ${srcname} ${dstname} + ) + SET_TESTS_PROPERTIES(H5COPY-${testname}-DIFF PROPERTIES DEPENDS H5COPY-${testname}) + IF (${resultcode} STREQUAL "1") + SET_TESTS_PROPERTIES (H5COPY-${testname}-DIFF PROPERTIES WILL_FAIL "true") + ENDIF (${resultcode} STREQUAL "1") + ENDIF (NOT ${resultcode} STREQUAL "2") ENDMACRO (ADD_H5_TEST) - MACRO (ADD_H5_DIFF_TEST testname resultcode testdepends infile outfile srcname dstname) + MACRO (ADD_H5_TEST2 testname resultcode infile psparam pdparam vparam sparam srcname dparam dstname) + IF (NOT HDF5_ENABLE_USING_MEMCHECKER) + # Remove any output file left over from previous test run + ADD_TEST ( + NAME H5COPY-${testname}-clear-objects + COMMAND ${CMAKE_COMMAND} + -E remove + ./testfiles/${testname}.out.h5 + ) + ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) + + ADD_TEST ( + NAME H5COPY-${testname}-prefill + COMMAND $ -i ./testfiles/${infile} -o ./testfiles/${testname}.out.h5 -v -s ${psparam} -d ${pdparam} + ) + IF (HDF5_ENABLE_USING_MEMCHECKER) + IF (NOT "${last_test}" STREQUAL "") + SET_TESTS_PROPERTIES (H5COPY-${testname}-prefill PROPERTIES DEPENDS ${last_test}) + ENDIF (NOT "${last_test}" STREQUAL "") + ELSE (HDF5_ENABLE_USING_MEMCHECKER) + SET_TESTS_PROPERTIES (H5COPY-${testname}-prefill PROPERTIES DEPENDS H5COPY-${testname}-clear-objects) + ENDIF (HDF5_ENABLE_USING_MEMCHECKER) + + ADD_TEST ( + NAME H5COPY-${testname} + COMMAND $ -i ./testfiles/${infile} -o ./testfiles/${testname}.out.h5 ${vparam} ${sparam} ${srcname} ${dparam} ${dstname} ${ARGN} + ) + SET_TESTS_PROPERTIES (H5COPY-${testname} PROPERTIES DEPENDS H5COPY-${testname}-prefill) # resultcode=2 will cause the test to skip the diff test IF (NOT ${resultcode} STREQUAL "2") ADD_TEST ( - NAME H5COPY-DIFF_${testname} - COMMAND $ -q ./testfiles/${infile} ./testfiles/${outfile} ${srcname} ${dstname} + NAME H5COPY-${testname}-DIFF + COMMAND $ -q ./testfiles/${infile} ./testfiles/${testname}.out.h5 ${srcname} ${dstname} ) - SET_TESTS_PROPERTIES(H5COPY-DIFF_${testname} PROPERTIES DEPENDS ${testdepends}) - SET (last_test "H5COPY-DIFF_${testname}") + SET_TESTS_PROPERTIES(H5COPY-${testname}-DIFF PROPERTIES DEPENDS H5COPY-${testname}) IF (${resultcode} STREQUAL "1") - SET_TESTS_PROPERTIES (H5COPY-DIFF_${testname} PROPERTIES WILL_FAIL "true") + SET_TESTS_PROPERTIES (H5COPY-${testname}-DIFF PROPERTIES WILL_FAIL "true") ENDIF (${resultcode} STREQUAL "1") ENDIF (NOT ${resultcode} STREQUAL "2") - ENDMACRO (ADD_H5_DIFF_TEST) + ENDMACRO (ADD_H5_TEST2) + + MACRO (ADD_H5_TEST_SAME testname resultcode pfile psparam pdparam vparam sparam srcname dparam dstname) + IF (NOT HDF5_ENABLE_USING_MEMCHECKER) + # Remove any output file left over from previous test run + ADD_TEST ( + NAME H5COPY_SAME-${testname}-clear-objects + COMMAND ${CMAKE_COMMAND} + -E remove + ./testfiles/${testname}.out.h5 + ) + ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) - # - # Test result with h5ls - # - MACRO (ADD_H5LS_TEST file filetest) - # If using memchecker add tests without using scripts + ADD_TEST ( + NAME H5COPY_SAME-${testname}-prefill + COMMAND $ -i ./testfiles/${pfile} -o ./testfiles/${testname}.out.h5 -v -s ${psparam} -d ${pdparam} + ) IF (HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST (NAME H5COPY-h5ls_${file}-${filetest} COMMAND $ -Svr ./testfiles/${file}.out.h5) + IF (NOT "${last_test}" STREQUAL "") + SET_TESTS_PROPERTIES (H5COPY_SAME-${testname}-prefill PROPERTIES DEPENDS ${last_test}) + ENDIF (NOT "${last_test}" STREQUAL "") ELSE (HDF5_ENABLE_USING_MEMCHECKER) + SET_TESTS_PROPERTIES (H5COPY_SAME-${testname}-prefill PROPERTIES DEPENDS H5COPY_SAME-${testname}-clear-objects) + ENDIF (HDF5_ENABLE_USING_MEMCHECKER) + + ADD_TEST ( + NAME H5COPY_SAME-${testname} + COMMAND $ -i ./testfiles/${testname}.out.h5 -o ./testfiles/${testname}.out.h5 ${vparam} ${sparam} ${srcname} ${dparam} ${dstname} ${ARGN} + ) + SET_TESTS_PROPERTIES (H5COPY_SAME-${testname} PROPERTIES DEPENDS H5COPY_SAME-${testname}-prefill) + # resultcode=2 will cause the test to skip the diff test + IF (NOT ${resultcode} STREQUAL "2") ADD_TEST ( - NAME H5COPY-h5ls_${file}-${filetest} - COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$" - -D "TEST_ARGS=-Svr;./testfiles/${file}.out.h5" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" - -D "TEST_OUTPUT=./testfiles/${file}.out.out" - -D "TEST_EXPECT=0" - -D "TEST_REFERENCE=./testfiles/${file}.out.ls" - -D "TEST_MASK=true" - -P "${HDF5_RESOURCES_DIR}/runTest.cmake" + NAME H5COPY_SAME-${testname}-DIFF + COMMAND $ -q ./testfiles/${testname}.out.h5 ./testfiles/${testname}.out.h5 ${srcname} ${dstname} ) - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5COPY-h5ls_${file}-${filetest} PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "H5COPY-h5ls_${file}-${filetest}") - ENDMACRO (ADD_H5LS_TEST) + SET_TESTS_PROPERTIES(H5COPY_SAME-${testname}-DIFF PROPERTIES DEPENDS H5COPY_SAME-${testname}) + IF (${resultcode} STREQUAL "1") + SET_TESTS_PROPERTIES (H5COPY_SAME-${testname}-DIFF PROPERTIES WILL_FAIL "true") + ENDIF (${resultcode} STREQUAL "1") + ENDIF (NOT ${resultcode} STREQUAL "2") + ENDMACRO (ADD_H5_TEST_SAME) # # Similiar to ADD_H5_TEST macro. Compare to outputs from source & target # files instead of checking with h5ls. # - MACRO (ADD_H5_CMP_TEST testname resultcode infile outfile vparam sparam srcname dparam dstname) + MACRO (ADD_H5_CMP_TEST testname resultcode infile vparam sparam srcname dparam dstname) # If using memchecker add tests without using scripts IF (HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST (NAME H5COPY-CMP-${testname} COMMAND $ -i ./testfiles/${infile} -o ./testfiles/${outfile} ${vparam} ${sparam} ${srcname} ${dparam} ${dstname} ${ARGN}) + ADD_TEST (NAME H5COPY-CMP-${testname} COMMAND $ -i ./testfiles/${infile} -o ./testfiles/${testname}.out.h5 ${vparam} ${sparam} ${srcname} ${dparam} ${dstname} ${ARGN}) IF (${resultcode} STREQUAL "1") SET_TESTS_PROPERTIES (H5COPY-CMP-${testname} PROPERTIES WILL_FAIL "true") ENDIF (${resultcode} STREQUAL "1") + IF (NOT "${last_test}" STREQUAL "") + SET_TESTS_PROPERTIES (H5COPY-CMP-${testname} PROPERTIES DEPENDS ${last_test}) + ENDIF (NOT "${last_test}" STREQUAL "") ELSE (HDF5_ENABLE_USING_MEMCHECKER) + # Remove any output file left over from previous test run + ADD_TEST ( + NAME H5COPY-CMP-${testname}-clear-objects + COMMAND ${CMAKE_COMMAND} + -E remove + ./testfiles/${testname}.out.h5 + ./testfiles/${testname}.out.out + ./testfiles/${testname}.out.out.err + ) ADD_TEST ( NAME H5COPY-CMP-${testname} COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$" - -D "TEST_ARGS=-i;./testfiles/${infile};-o;./testfiles/${outfile};${vparam};${sparam};${srcname};${dparam};${dstname}" + -D "TEST_ARGS=-i;./testfiles/${infile};-o;./testfiles/${testname}.out.h5;${vparam};${sparam};${srcname};${dparam};${dstname}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" -D "TEST_OUTPUT=./testfiles/${testname}.out.out" -D "TEST_EXPECT=${resultcode}" @@ -176,11 +259,8 @@ IF (BUILD_TESTING) -D "TEST_MASK=true" -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) + SET_TESTS_PROPERTIES (H5COPY-CMP-${testname} PROPERTIES DEPENDS H5COPY-CMP-${testname}-clear-objects) ENDIF (HDF5_ENABLE_USING_MEMCHECKER) - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5COPY-CMP-${testname} PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "H5COPY-CMP-${testname}") ENDMACRO (ADD_H5_CMP_TEST) ############################################################################## @@ -197,172 +277,135 @@ IF (BUILD_TESTING) SET (HDF_EXT_SRC_FILE h5copy_extlinks_src) SET (HDF_EXT_TRG_FILE h5copy_extlinks_trg) - # Remove any output file left over from previous test run - ADD_TEST ( - NAME H5COPY-clearall-objects - COMMAND ${CMAKE_COMMAND} - -E remove - ./testfiles/${HDF_FILE1}.out.h5 - ./testfiles/${HDF_FILE1}.out.out - ./testfiles/${HDF_FILE1}.out.out.err - ./testfiles/${HDF_FILE2}.out.h5 - ./testfiles/${HDF_FILE2}.out.out - ./testfiles/${HDF_FILE2}.out.out.err - ./testfiles/${HDF_EXT_SRC_FILE}.out.h5 - ./testfiles/${HDF_EXT_SRC_FILE}.out.out - ./testfiles/${HDF_EXT_SRC_FILE}.out.out.err - ) - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5COPY-clearall-objects PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "H5COPY-clearall-objects") + IF (HDF5_ENABLE_USING_MEMCHECKER) + # Remove any output file left over from previous test run + ADD_TEST ( + NAME H5COPY-clearall-objects + COMMAND ${CMAKE_COMMAND} + -E remove + simple.out.h5 + chunk.out.h5 + compact.out.h5 + compound.out.h5 + compressed.out.h5 + named_vl.out.h5 + nested_vl.out.h5 + simple_top.out.h5 + dsrename.out.h5 + grp_empty.out.h5 + grp_dsets.out.h5 + grp_nested.out.h5 + simple_group.out.h5 + grp_rename.out.h5 + grp_dsets_rename.out.h5 + A_B1_simple.out.h5 + A_B2_simple2.out.h5 + C_D_simple.out.h5 + E_F_grp_dsets.out.h5 + G_H_grp_nested.out.h5 + region_ref.out.h5 + ext_link.out.h5 + ext_link_f.out.h5 + ext_dangle_noobj.out.h5 + ext_dangle_noobj_f.out.h5 + ext_dangle_nofile.out.h5 + ext_dangle_nofile_f.out.h5 + ext_link_group.out.h5 + ext_link_group_f.out.h5 + samefile1.out.h5 + samefile2.out.h5 + h5copy_misc1.out.h5 + h5copy_misc1.out.out + h5copy_misc1.out.out.err + ) + SET_TESTS_PROPERTIES (H5COPY-clearall-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") + IF (NOT "${last_test}" STREQUAL "") + SET_TESTS_PROPERTIES (H5COPY-clearall-objects PROPERTIES DEPENDS ${last_test}) + ENDIF (NOT "${last_test}" STREQUAL "") + SET (last_test "H5COPY-clearall-objects") + ENDIF (HDF5_ENABLE_USING_MEMCHECKER) # "Test copying various forms of datasets" - ADD_H5_TEST (simple 0 ${HDF_FILE1}.h5 ${HDF_FILE1}.out.h5 -v -s simple -d simple) - ADD_H5_TEST (chunk 0 ${HDF_FILE1}.h5 ${HDF_FILE1}.out.h5 -v -s chunk -d chunk) - ADD_H5_TEST (compact 0 ${HDF_FILE1}.h5 ${HDF_FILE1}.out.h5 -v -s compact -d compact) - ADD_H5_TEST (compound 0 ${HDF_FILE1}.h5 ${HDF_FILE1}.out.h5 -v -s compound -d compound) - ADD_H5_TEST (compressed 0 ${HDF_FILE1}.h5 ${HDF_FILE1}.out.h5 -v -s compressed -d compressed) - ADD_H5_TEST (named_vl 0 ${HDF_FILE1}.h5 ${HDF_FILE1}.out.h5 -v -s named_vl -d named_vl) - ADD_H5_TEST (nested_vl 0 ${HDF_FILE1}.h5 ${HDF_FILE1}.out.h5 -v -s nested_vl -d nested_vl) + ADD_H5_TEST (simple 0 ${HDF_FILE1}.h5 -v -s simple -d simple) + ADD_H5_TEST (chunk 0 ${HDF_FILE1}.h5 -v -s chunk -d chunk) + ADD_H5_TEST (compact 0 ${HDF_FILE1}.h5 -v -s compact -d compact) + ADD_H5_TEST (compound 0 ${HDF_FILE1}.h5 -v -s compound -d compound) + ADD_H5_TEST (compressed 0 ${HDF_FILE1}.h5 -v -s compressed -d compressed) + ADD_H5_TEST (named_vl 0 ${HDF_FILE1}.h5 -v -s named_vl -d named_vl) + ADD_H5_TEST (nested_vl 0 ${HDF_FILE1}.h5 -v -s nested_vl -d nested_vl) # "Test copying dataset within group in source file to root of destination" - ADD_H5_TEST (simple_top 0 ${HDF_FILE1}.h5 ${HDF_FILE1}.out.h5 -v -s grp_dsets/simple -d simple_top) + ADD_H5_TEST (simple_top 0 ${HDF_FILE1}.h5 -v -s grp_dsets/simple -d simple_top) # "Test copying & renaming dataset" - ADD_H5_TEST (rename 0 ${HDF_FILE1}.h5 ${HDF_FILE1}.out.h5 -v -s compound -d rename) + ADD_H5_TEST (dsrename 0 ${HDF_FILE1}.h5 -v -s compound -d rename) # "Test copying empty, 'full' & 'nested' groups" - ADD_H5_TEST (grp_empty 0 ${HDF_FILE1}.h5 ${HDF_FILE1}.out.h5 -v -s grp_empty -d grp_empty) - ADD_H5_TEST (grp_dsets 0 ${HDF_FILE1}.h5 ${HDF_FILE1}.out.h5 -v -s grp_dsets -d grp_dsets) - ADD_H5_TEST (grp_nested 0 ${HDF_FILE1}.h5 ${HDF_FILE1}.out.h5 -v -s grp_nested -d grp_nested) + ADD_H5_TEST (grp_empty 0 ${HDF_FILE1}.h5 -v -s grp_empty -d grp_empty) + ADD_H5_TEST (grp_dsets 0 ${HDF_FILE1}.h5 -v -s grp_dsets -d grp_dsets) + ADD_H5_TEST (grp_nested 0 ${HDF_FILE1}.h5 -v -s grp_nested -d grp_nested) # "Test copying dataset within group in source file to group in destination" - ADD_H5_TEST (simple_group 0 ${HDF_FILE1}.h5 ${HDF_FILE1}.out.h5 -v -s /grp_dsets/simple -d /grp_dsets/simple_group) + ADD_H5_TEST2 (simple_group 0 ${HDF_FILE1}.h5 grp_dsets grp_dsets -v -s /grp_dsets/simple -d /grp_dsets/simple_group) # "Test copying & renaming group" - ADD_H5_TEST (grp_rename 0 ${HDF_FILE1}.h5 ${HDF_FILE1}.out.h5 -v -s grp_dsets -d grp_rename) + ADD_H5_TEST (grp_rename 0 ${HDF_FILE1}.h5 -v -s grp_dsets -d grp_rename) # "Test copying 'full' group hierarchy into group in destination file" - ADD_H5_TEST (grp_dsets_rename 0 ${HDF_FILE1}.h5 ${HDF_FILE1}.out.h5 -v -s grp_dsets -d /grp_rename/grp_dsets) + ADD_H5_TEST2 (grp_dsets_rename 0 ${HDF_FILE1}.h5 grp_dsets grp_rename -v -s grp_dsets -d /grp_rename/grp_dsets) # "Test copying objects into group hier. that doesn't exist yet in destination file" - ADD_H5_TEST (A_B1_simple 0 ${HDF_FILE1}.h5 ${HDF_FILE1}.out.h5 -vp -s simple -d /A/B1/simple) - ADD_H5_TEST (A_B2_simple2 0 ${HDF_FILE1}.h5 ${HDF_FILE1}.out.h5 -vp -s simple -d /A/B2/simple2) - ADD_H5_TEST (C_D_simple 0 ${HDF_FILE1}.h5 ${HDF_FILE1}.out.h5 -vp -s /grp_dsets/simple -d /C/D/simple) - ADD_H5_TEST (E_F_grp_dsets 0 ${HDF_FILE1}.h5 ${HDF_FILE1}.out.h5 -vp -s /grp_dsets -d /E/F/grp_dsets) - ADD_H5_TEST (G_H_grp_nested 0 ${HDF_FILE1}.h5 ${HDF_FILE1}.out.h5 -vp -s /grp_nested -d /G/H/grp_nested) - - # Verify that the file created above is correct - ADD_H5LS_TEST (${HDF_FILE1} basic) + ADD_H5_TEST (A_B1_simple 0 ${HDF_FILE1}.h5 -vp -s simple -d /A/B1/simple) + ADD_H5_TEST (A_B2_simple2 0 ${HDF_FILE1}.h5 -vp -s simple -d /A/B2/simple2) + ADD_H5_TEST (C_D_simple 0 ${HDF_FILE1}.h5 -vp -s /grp_dsets/simple -d /C/D/simple) + ADD_H5_TEST (E_F_grp_dsets 0 ${HDF_FILE1}.h5 -vp -s /grp_dsets -d /E/F/grp_dsets) + ADD_H5_TEST (G_H_grp_nested 0 ${HDF_FILE1}.h5 -vp -s /grp_nested -d /G/H/grp_nested) ############# COPY REFERENCES ############## - # Remove any output file left over from previous test run - ADD_TEST ( - NAME H5COPY-clear-refs - COMMAND ${CMAKE_COMMAND} - -E remove - ./testfiles/${HDF_FILE2}.out.h5 - ./testfiles/${HDF_FILE2}.out.out - ./testfiles/${HDF_FILE2}.out.out.err - ) - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5COPY-clear-refs PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "H5COPY-clear-refs") - # "Test copying object and region references" - ADD_H5_F_TEST (region_ref 2 ${HDF_FILE2}.h5 ${HDF_FILE2}.out.h5 ref -v -s / -d /COPY) - - # Verify that the file created above is correct - ADD_H5LS_TEST (${HDF_FILE2} refs) + ADD_H5_F_TEST (region_ref 2 ${HDF_FILE2}.h5 ref -v -s / -d /COPY) ############# COPY EXT LINKS ############## - # Remove any output file left over from previous test run - ADD_TEST ( - NAME H5COPY-clear-ext-links - COMMAND ${CMAKE_COMMAND} - -E remove - ./testfiles/${HDF_EXT_SRC_FILE}.out.h5 - ./testfiles/${HDF_EXT_SRC_FILE}.out.out - ./testfiles/${HDF_EXT_SRC_FILE}.out.out.err - ) - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5COPY-clear-ext-links PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "H5COPY-clear-ext-links") - # "Test copying external link directly without -f ext" - ADD_H5_TEST (ext_link 2 ${HDF_EXT_SRC_FILE}.h5 ${HDF_EXT_SRC_FILE}.out.h5 -v -s /group_ext/extlink_dset -d /copy1_dset) + ADD_H5_TEST (ext_link 2 ${HDF_EXT_SRC_FILE}.h5 -v -s /group_ext/extlink_dset -d /copy1_dset) # "Test copying external link directly with -f ext" - ADD_H5_F_TEST (ext_link_f 2 ${HDF_EXT_SRC_FILE}.h5 ${HDF_EXT_SRC_FILE}.out.h5 ext -v -s /group_ext/extlink_dset -d /copy2_dset) + ADD_H5_F_TEST (ext_link_f 2 ${HDF_EXT_SRC_FILE}.h5 ext -v -s /group_ext/extlink_dset -d /copy2_dset) # "Test copying dangling external link (no obj) directly without -f ext" - ADD_H5_TEST (ext_dangle_noobj 2 ${HDF_EXT_SRC_FILE}.h5 ${HDF_EXT_SRC_FILE}.out.h5 -v -s /group_ext/extlink_notyet1 -d /copy_dangle1_1) + ADD_H5_TEST (ext_dangle_noobj 2 ${HDF_EXT_SRC_FILE}.h5 -v -s /group_ext/extlink_notyet1 -d /copy_dangle1_1) # "Test copying dangling external link (no obj) directly with -f ext" - ADD_H5_F_TEST (ext_dangle_noobj_f 2 ${HDF_EXT_SRC_FILE}.h5 ${HDF_EXT_SRC_FILE}.out.h5 ext -v -s /group_ext/extlink_notyet1 -d /copy_dangle1_2) + ADD_H5_F_TEST (ext_dangle_noobj_f 2 ${HDF_EXT_SRC_FILE}.h5 ext -v -s /group_ext/extlink_notyet1 -d /copy_dangle1_2) # "Test copying dangling external link (no file) directly without -f ext" - ADD_H5_TEST (ext_dangle_nofile 2 ${HDF_EXT_SRC_FILE}.h5 ${HDF_EXT_SRC_FILE}.out.h5 -v -s /group_ext/extlink_notyet2 -d /copy_dangle2_1) + ADD_H5_TEST (ext_dangle_nofile 2 ${HDF_EXT_SRC_FILE}.h5 -v -s /group_ext/extlink_notyet2 -d /copy_dangle2_1) # "Test copying dangling external link (no file) directly with -f ext" - ADD_H5_F_TEST (ext_dangle_nofile_f 2 ${HDF_EXT_SRC_FILE}.h5 ${HDF_EXT_SRC_FILE}.out.h5 ext -v -s /group_ext/extlink_notyet2 -d /copy_dangle2_2) + ADD_H5_F_TEST (ext_dangle_nofile_f 2 ${HDF_EXT_SRC_FILE}.h5 ext -v -s /group_ext/extlink_notyet2 -d /copy_dangle2_2) # "Test copying a group contains external links without -f ext" - ADD_H5_TEST (ext_link_group 2 ${HDF_EXT_SRC_FILE}.h5 ${HDF_EXT_SRC_FILE}.out.h5 -v -s /group_ext -d /copy1_group) + ADD_H5_TEST (ext_link_group 2 ${HDF_EXT_SRC_FILE}.h5 -v -s /group_ext -d /copy1_group) # "Test copying a group contains external links with -f ext" - ADD_H5_F_TEST (ext_link_group_f 2 ${HDF_EXT_SRC_FILE}.h5 ${HDF_EXT_SRC_FILE}.out.h5 ext -v -s /group_ext -d /copy2_group) - - # Verify that the file created above is correct - ADD_H5LS_TEST (${HDF_EXT_SRC_FILE} links) + ADD_H5_F_TEST (ext_link_group_f 2 ${HDF_EXT_SRC_FILE}.h5 ext -v -s /group_ext -d /copy2_group) ############# Test misc. ############## - # Remove any output file left over from previous test run - ADD_TEST ( - NAME H5COPY-clear-misc - COMMAND ${CMAKE_COMMAND} - -E remove - ./testfiles/h5copy_misc1.out.out - ./testfiles/h5copy_misc1.out.out.err - ./testfiles/${HDF_FILE1}.out.h5 - ) - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5COPY-clear-misc PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "H5COPY-clear-misc") #----------------------------------------------------------------- # "Test copying object into group which doesn't exist, without -p" # - ADD_H5_CMP_TEST (h5copy_misc1 1 ${HDF_FILE1}.h5 ${HDF_FILE1}.out.h5 -v -s /simple -d /g1/g2/simple) - # Remove any output file left over from previous test run - ADD_TEST ( - NAME H5COPY-clear-samefile - COMMAND ${CMAKE_COMMAND} - -E remove - ./testfiles/${HDF_FILE1}.out.h5 - ) - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5COPY-clear-samefile PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "H5COPY-clear-samefile") + ADD_H5_CMP_TEST (h5copy_misc1 1 ${HDF_FILE1}.h5 -v -s /simple -d /g1/g2/simple) #------------------------------------------- # "Test copying objects to the same file " # - # create temporary test file with some objects - ADD_H5_TEST (samefile1_pre 0 ${HDF_FILE1}.h5 ${HDF_FILE1}.out.h5 -v -s /simple -d /simple) - ADD_H5_TEST (samefile2_pre 0 ${HDF_FILE1}.h5 ${HDF_FILE1}.out.h5 -v -s /grp_dsets -d /grp_dsets) - # actual test cases # - dataset - ADD_H5_TEST (samefile1 0 ${HDF_FILE1}.out.h5 ${HDF_FILE1}.out.h5 -v -s /simple -d /simple_cp) + ADD_H5_TEST_SAME (samefile1 0 ${HDF_FILE1}.h5 /simple /simple -v -s /simple -d /simple_cp) # - group with some datasets - ADD_H5_TEST (samefile2 0 ${HDF_FILE1}.out.h5 ${HDF_FILE1}.out.h5 -v -s /grp_dsets -d /grp_dsets_cp) + ADD_H5_TEST_SAME (samefile2 0 ${HDF_FILE1}.h5 /grp_dsets /grp_dsets -v -s /grp_dsets -d /grp_dsets_cp) ENDIF (BUILD_TESTING) ############################################################################## diff --git a/tools/h5copy/Makefile.in b/tools/h5copy/Makefile.in index da9d0b7..3278f80 100644 --- a/tools/h5copy/Makefile.in +++ b/tools/h5copy/Makefile.in @@ -234,6 +234,7 @@ H5_VERSION = @H5_VERSION@ HADDR_T = @HADDR_T@ HAVE_DMALLOC = @HAVE_DMALLOC@ HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@ +HAVE_PTHREAD = @HAVE_PTHREAD@ HDF5_HL = @HDF5_HL@ HDF5_INTERFACES = @HDF5_INTERFACES@ HDF_CXX = @HDF_CXX@ @@ -285,7 +286,6 @@ PACKAGE_VERSION = @PACKAGE_VERSION@ PARALLEL = @PARALLEL@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ -PTHREAD = @PTHREAD@ RANLIB = @RANLIB@ ROOT = @ROOT@ RUNPARALLEL = @RUNPARALLEL@ diff --git a/tools/h5copy/testfiles/h5copy_misc1.out b/tools/h5copy/testfiles/h5copy_misc1.out index 10dd1a6..1624f2b 100644 --- a/tools/h5copy/testfiles/h5copy_misc1.out +++ b/tools/h5copy/testfiles/h5copy_misc1.out @@ -1,3 +1,3 @@ -Copying file <./testfiles/h5copytst.h5> and object to file <./testfiles/h5copytst.out.h5> and object +Copying file <./testfiles/h5copytst.h5> and object to file <./testfiles/h5copy_misc1.out.h5> and object Error in copy...Exiting h5copy error: group doesn't exist. Use -p to create parent groups. diff --git a/tools/h5copy/testh5copy.sh.in b/tools/h5copy/testh5copy.sh.in index c7acd9a..d30d8d8 100644 --- a/tools/h5copy/testh5copy.sh.in +++ b/tools/h5copy/testh5copy.sh.in @@ -57,9 +57,6 @@ $SRC_H5COPY_TESTFILES/h5copy_extlinks_trg.h5 # List of expect files that will be copied over to local test dir LIST_OTHER_TEST_FILES=" -$SRC_H5COPY_TESTFILES/h5copy_extlinks_src.out.ls -$SRC_H5COPY_TESTFILES/h5copy_ref.out.ls -$SRC_H5COPY_TESTFILES/h5copytst.out.ls $SRC_H5COPY_TESTFILES/h5copy_misc1.out " @@ -151,15 +148,6 @@ VERIFY() # Print a line-line message left justified in a field of 70 characters # beginning with the word "Verifying". # -VERIFY_H5LS() -{ - SPACES=" " - echo "Verifying h5ls file structure $* $SPACES" | cut -c1-70 | tr -d '\012' -} - -# Print a line-line message left justified in a field of 70 characters -# beginning with the word "Verifying". -# VERIFY_OUTPUT() { SPACES=" " @@ -183,24 +171,34 @@ TOOLTEST() { actualout="$TESTDIR/tooltest.actualout" actualerr="$TESTDIR/tooltest.actualerr" - runh5diff=yes - if [ "$1" = -i ]; then - inputfile=$2 - else - runh5diff=no - fi - if [ "$3" = -o ]; then - outputfile=$4 - else - runh5diff=no - fi + runh5diff=yes + if [ "$1" = -i ]; then + inputfile=$2 + else + if [ "$1" = -f ]; then + inputfile=$4 + else + inputfile=$3 + fi + runh5diff=no + fi + if [ "$3" = -o ]; then + outputfile=$4 + else + if [ "$1" = -f ]; then + outputfile=$6 + else + outputfile=$5 + fi + runh5diff=no + fi TESTING $H5COPY $@ ( - echo "#############################" - echo " output for '$H5COPY $@'" - echo "#############################" - $RUNSERIAL $H5COPY_BIN $@ + echo "#############################" + echo " output for '$H5COPY $@'" + echo "#############################" + $RUNSERIAL $H5COPY_BIN $@ ) > $actualout 2> $actualerr RET=$? if [ $RET != 0 ]; then @@ -210,15 +208,141 @@ TOOLTEST() nerrors="`expr $nerrors + 1`" else echo " PASSED" + + if [ $runh5diff != no ]; then + H5DIFFTEST $inputfile $outputfile $7 $9 + fi # Clean up output file if test -z "$HDF5_NOCLEANUP"; then - rm -f $actualout $actualerr + rm -f $actualout $actualerr $outputfile + fi + fi +} + +# TOOLTEST back-to-back +TOOLTEST_PREFILL() +{ + actualout="$TESTDIR/tooltest.actualout" + actualerr="$TESTDIR/tooltest.actualerr" + runh5diff=yes + if [ "$1" = -i ]; then + inputfile=$2 + else + runh5diff=no + fi + if [ "$3" = -o ]; then + outputfile=$4 + else + runh5diff=no + fi + + grp_name=$5 + grp_name2=$6 + obj_name=$7 + obj_name2=$8 + + TESTING $H5COPY $@ + ( + echo "#############################" + echo " output for '$H5COPY $@'" + echo "#############################" + $RUNSERIAL $H5COPY_BIN -i $inputfile -o $outputfile -v -s $grp_name -d $grp_name2 + ) > $actualout 2> $actualerr + RET=$? + if [ $RET != 0 ]; then + echo "*FAILED*" + echo "failed result is:" + cat $actualout + nerrors="`expr $nerrors + 1`" + else + TESTING $H5COPY $@ + ( + echo "#############################" + echo " output for '$H5COPY $@'" + echo "#############################" + $RUNSERIAL $H5COPY_BIN -i $inputfile -o $outputfile -v -s $obj_name -d $obj_name2 + ) > $actualout 2> $actualerr + RET=$? + if [ $RET != 0 ]; then + echo "*FAILED*" + echo "failed result is:" + cat $actualout + nerrors="`expr $nerrors + 1`" + else + echo " PASSED" + + if [ $runh5diff != no ]; then + H5DIFFTEST $inputfile $outputfile $obj_name $obj_name2 + fi + + # Clean up output file + if test -z "$HDF5_NOCLEANUP"; then + rm -f $actualout $actualerr $outputfile + fi fi fi +} + +# TOOLTEST back-to-back +TOOLTEST_SAME() +{ + actualout="$TESTDIR/tooltest.actualout" + actualerr="$TESTDIR/tooltest.actualerr" + runh5diff=yes + if [ "$1" = -i ]; then + inputfile=$2 + else + runh5diff=no + fi + if [ "$3" = -o ]; then + outputfile=$4 + else + runh5diff=no + fi - if [ $runh5diff != no ]; then - H5DIFFTEST $inputfile $outputfile $7 $9 + grp_name=$5 + grp_name2=$6 + + TESTING $H5COPY $@ + ( + echo "#############################" + echo " output for '$H5COPY $@'" + echo "#############################" + $RUNSERIAL $H5COPY_BIN -i $inputfile -o $outputfile -v -s $grp_name -d $grp_name + ) > $actualout 2> $actualerr + RET=$? + if [ $RET != 0 ]; then + echo "*FAILED*" + echo "failed result is:" + cat $actualout + nerrors="`expr $nerrors + 1`" + else + TESTING $H5COPY $@ + ( + echo "#############################" + echo " output for '$H5COPY $@'" + echo "#############################" + $RUNSERIAL $H5COPY_BIN -i $outputfile -o $outputfile -v -s $grp_name -d $grp_name2 + ) > $actualout 2> $actualerr + RET=$? + if [ $RET != 0 ]; then + echo "*FAILED*" + echo "failed result is:" + cat $actualout + nerrors="`expr $nerrors + 1`" + else + echo " PASSED" + + if [ $runh5diff != no ]; then + H5DIFFTEST $outputfile $outputfile $grp_name $grp_name2 + fi + + # Clean up output file + if test -z "$HDF5_NOCLEANUP"; then + rm -f $actualout $actualerr $outputfile + fi + fi fi } @@ -259,18 +383,18 @@ TOOLTEST_FAIL() actualerr_sav=${actualerr}-sav shift if [ "$1" = -i ]; then - inputfile=$2 + inputfile=$2 fi if [ "$3" = -o ]; then - outputfile=$4 + outputfile=$4 fi TESTING $H5COPY $@ ( - #echo "#############################" - #echo " output for '$H5COPY $@'" - #echo "#############################" - $RUNSERIAL $H5COPY_BIN $@ + #echo "#############################" + #echo " output for '$H5COPY $@'" + #echo "#############################" + $RUNSERIAL $H5COPY_BIN $@ ) > $actualout 2> $actualerr RET=$? @@ -298,7 +422,7 @@ TOOLTEST_FAIL() # Clean up output file if test -z "$HDF5_NOCLEANUP"; then - rm -f $actualout $actualerr $actualout_sav $actualerr_sav + rm -f $actualout $actualerr $actualout_sav $actualerr_sav $outputfile fi } @@ -311,10 +435,10 @@ H5DIFFTEST() $RUNSERIAL $H5DIFF_BIN -q "$@" RET=$? if [ $RET != 0 ] ; then - echo "*FAILED*" - nerrors="`expr $nerrors + 1`" + echo "*FAILED*" + nerrors="`expr $nerrors + 1`" else - echo " PASSED" + echo " PASSED" fi } @@ -327,50 +451,13 @@ H5DIFFTEST_FAIL() RET=$? if [ $h5haveexitcode = 'yes' -a $RET != 1 ] ; then - echo "*FAILED*" - nerrors="`expr $nerrors + 1`" + echo "*FAILED*" + nerrors="`expr $nerrors + 1`" else - echo " PASSED" + echo " PASSED" fi } -# Call the h5ls tool to verify the correct output data in the destination file -# -H5LSTEST() -{ - expect="$TESTDIR/`basename $1 .h5`.ls" - actual="$TESTDIR/`basename $1 .h5`.ls.actualout" - - # Stderr is included in stdout so that the diff can detect - # any unexpected output from that stream too. - # - # Note: The modification time and storage utilization are masked off - # so that the output is more portable - VERIFY_H5LS $@ - ( - $RUNSERIAL $H5LS_BIN $H5LS_ARGS $@ - ) 2>&1 |sed 's/Modified:.*/Modified: XXXX-XX-XX XX:XX:XX XXX/' |sed 's/Storage:.*/Storage:
/' >$actual - - - if [ ! -f $expect ]; then - # Create the expect file if it doesn't yet exist. - echo " CREATED" - cp $actual $expect - elif $CMP $expect $actual; then - echo " PASSED" - else - echo "*FAILED*" - echo " Expected result (*.ls) differs from actual result (*.out)" - nerrors="`expr $nerrors + 1`" - test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' - fi - - # Clean up output file - if test -z "$HDF5_NOCLEANUP"; then - rm -f $actual $actual_err - fi -} - # Copy single datasets of various forms from one group to another, # adding object copied to the destination file each time # @@ -379,82 +466,54 @@ H5LSTEST() COPY_OBJECTS() { TESTFILE="$TESTDIR/h5copytst.h5" - FILEOUT="$TESTDIR/`basename h5copytst.h5 .h5`.out.h5" - - # Remove any output file left over from previous test run - rm -f $FILEOUT - echo "Testing from `basename $TESTFILE` to `basename $FILEOUT` for the following tests:" echo "Test copying various forms of datasets" - TOOLTEST -i $TESTFILE -o $FILEOUT -v -s simple -d simple - TOOLTEST -i $TESTFILE -o $FILEOUT -v -s chunk -d chunk - TOOLTEST -i $TESTFILE -o $FILEOUT -v -s compact -d compact - TOOLTEST -i $TESTFILE -o $FILEOUT -v -s compound -d compound - TOOLTEST -i $TESTFILE -o $FILEOUT -v -s compressed -d compressed - TOOLTEST -i $TESTFILE -o $FILEOUT -v -s named_vl -d named_vl - TOOLTEST -i $TESTFILE -o $FILEOUT -v -s nested_vl -d nested_vl + TOOLTEST -i $TESTFILE -o $TESTDIR/simple.out.h5 -v -s simple -d simple + TOOLTEST -i $TESTFILE -o $TESTDIR/chunk.out.h5 -v -s chunk -d chunk + TOOLTEST -i $TESTFILE -o $TESTDIR/compact.out.h5 -v -s compact -d compact + TOOLTEST -i $TESTFILE -o $TESTDIR/compound.out.h5 -v -s compound -d compound + TOOLTEST -i $TESTFILE -o $TESTDIR/compressed.out.h5 -v -s compressed -d compressed + TOOLTEST -i $TESTFILE -o $TESTDIR/named_vl.out.h5 -v -s named_vl -d named_vl + TOOLTEST -i $TESTFILE -o $TESTDIR/nested_vl.out.h5 -v -s nested_vl -d nested_vl echo "Test copying dataset within group in source file to root of destination" - TOOLTEST -i $TESTFILE -o $FILEOUT -v -s grp_dsets/simple -d simple_top + TOOLTEST -i $TESTFILE -o $TESTDIR/simple_top.out.h5 -v -s grp_dsets/simple -d simple_top echo "Test copying & renaming dataset" - TOOLTEST -i $TESTFILE -o $FILEOUT -v -s compound -d rename + TOOLTEST -i $TESTFILE -o $TESTDIR/dsrename.out.h5 -v -s compound -d rename echo "Test copying empty, 'full' & 'nested' groups" - TOOLTEST -i $TESTFILE -o $FILEOUT -v -s grp_empty -d grp_empty - TOOLTEST -i $TESTFILE -o $FILEOUT -v -s grp_dsets -d grp_dsets - TOOLTEST -i $TESTFILE -o $FILEOUT -v -s grp_nested -d grp_nested + TOOLTEST -i $TESTFILE -o $TESTDIR/grp_empty.out.h5 -v -s grp_empty -d grp_empty + TOOLTEST -i $TESTFILE -o $TESTDIR/grp_dsets.out.h5 -v -s grp_dsets -d grp_dsets + TOOLTEST -i $TESTFILE -o $TESTDIR/grp_nested.out.h5 -v -s grp_nested -d grp_nested echo "Test copying dataset within group in source file to group in destination" - TOOLTEST -i $TESTFILE -o $FILEOUT -v -s /grp_dsets/simple -d /grp_dsets/simple_group + TOOLTEST_PREFILL -i $TESTFILE -o $TESTDIR/simple_group.out.h5 grp_dsets grp_dsets /grp_dsets/simple /grp_dsets/simple_group echo "Test copying & renaming group" - TOOLTEST -i $TESTFILE -o $FILEOUT -v -s grp_dsets -d grp_rename + TOOLTEST -i $TESTFILE -o $TESTDIR/grp_rename.out.h5 -v -s grp_dsets -d grp_rename echo "Test copying 'full' group hierarchy into group in destination file" - TOOLTEST -i $TESTFILE -o $FILEOUT -v -s grp_dsets -d /grp_rename/grp_dsets + TOOLTEST_PREFILL -i $TESTFILE -o $TESTDIR/grp_dsets_rename.out.h5 grp_dsets grp_rename grp_dsets /grp_rename/grp_dsets echo "Test copying objects into group hier. that doesn't exist yet in destination file" - TOOLTEST -i $TESTFILE -o $FILEOUT -vp -s simple -d /A/B1/simple - TOOLTEST -i $TESTFILE -o $FILEOUT -vp -s simple -d /A/B2/simple2 - TOOLTEST -i $TESTFILE -o $FILEOUT -vp -s /grp_dsets/simple -d /C/D/simple - TOOLTEST -i $TESTFILE -o $FILEOUT -vp -s /grp_dsets -d /E/F/grp_dsets - TOOLTEST -i $TESTFILE -o $FILEOUT -vp -s /grp_nested -d /G/H/grp_nested - - # Verify that the file created above is correct - H5LSTEST $FILEOUT - - # Remove output file created, if the "no cleanup" environment variable is - # not defined - if test -z "$HDF5_NOCLEANUP"; then - rm -f $FILEOUT - fi + TOOLTEST -i $TESTFILE -o $TESTDIR/A_B1_simple.out.h5 -vp -s simple -d /A/B1/simple + TOOLTEST -i $TESTFILE -o $TESTDIR/A_B2_simple2.out.h5 -vp -s simple -d /A/B2/simple2 + TOOLTEST -i $TESTFILE -o $TESTDIR/C_D_simple.out.h5 -vp -s /grp_dsets/simple -d /C/D/simple + TOOLTEST -i $TESTFILE -o $TESTDIR/E_F_grp_dsets.out.h5 -vp -s /grp_dsets -d /E/F/grp_dsets + TOOLTEST -i $TESTFILE -o $TESTDIR/G_H_grp_nested.out.h5 -vp -s /grp_nested -d /G/H/grp_nested } # Copy references in various way. -# adding to the destination file each time compare the result # # Assumed arguments: # COPY_REFERENCES() { TESTFILE="$TESTDIR/h5copy_ref.h5" - FILEOUT="$TESTDIR/`basename h5copy_ref.h5 .h5`.out.h5" - - # Remove any output file left over from previous test run - rm -f $FILEOUT echo "Test copying object and region references" - TOOLTEST -f ref -i $TESTFILE -o $FILEOUT -v -s / -d /COPY - - # Verify that the file created above is correct - H5LSTEST $FILEOUT - - # Remove output file created, if the "no cleanup" environment variable is - # not defined - if test -z "$HDF5_NOCLEANUP"; then - rm -f $FILEOUT - fi + TOOLTEST_F -f ref -i $TESTFILE -o $TESTDIR/region_ref.out.h5 -v -s / -d /COPY } # Copy external links. @@ -465,43 +524,30 @@ COPY_REFERENCES() COPY_EXT_LINKS() { TESTFILE="$TESTDIR/h5copy_extlinks_src.h5" - FILEOUT="$TESTDIR/`basename h5copy_extlinks_src.h5 .h5`.out.h5" - - # Remove any output file left over from previous test run - rm -f $FILEOUT echo "Test copying external link directly without -f ext" - TOOLTEST -v -i $TESTFILE -o $FILEOUT -s /group_ext/extlink_dset -d /copy1_dset + TOOLTEST -v -i $TESTFILE -o $TESTDIR/ext_link.out.h5 -s /group_ext/extlink_dset -d /copy1_dset echo "Test copying external link directly with -f ext" - TOOLTEST -f ext -i $TESTFILE -o $FILEOUT -v -s /group_ext/extlink_dset -d /copy2_dset + TOOLTEST_F -f ext -i $TESTFILE -o $TESTDIR/ext_link_f.out.h5 -v -s /group_ext/extlink_dset -d /copy2_dset echo "Test copying dangling external link (no obj) directly without -f ext" - TOOLTEST -v -i $TESTFILE -o $FILEOUT -s /group_ext/extlink_notyet1 -d /copy_dangle1_1 + TOOLTEST -v -i $TESTFILE -o $TESTDIR/ext_dangle_noobj.out.h5 -s /group_ext/extlink_notyet1 -d /copy_dangle1_1 echo "Test copying dangling external link (no obj) directly with -f ext" - TOOLTEST -f ext -i $TESTFILE -o $FILEOUT -v -s /group_ext/extlink_notyet1 -d /copy_dangle1_2 + TOOLTEST_F -f ext -i $TESTFILE -o $TESTDIR/ext_dangle_noobj_f.out.h5 -v -s /group_ext/extlink_notyet1 -d /copy_dangle1_2 echo "Test copying dangling external link (no file) directly without -f ext" - TOOLTEST -v -i $TESTFILE -o $FILEOUT -s /group_ext/extlink_notyet2 -d /copy_dangle2_1 + TOOLTEST -v -i $TESTFILE -o $TESTDIR/ext_dangle_nofile.out.h5 -s /group_ext/extlink_notyet2 -d /copy_dangle2_1 echo "Test copying dangling external link (no file) directly with -f ext" - TOOLTEST -f ext -i $TESTFILE -o $FILEOUT -v -s /group_ext/extlink_notyet2 -d /copy_dangle2_2 + TOOLTEST_F -f ext -i $TESTFILE -o $TESTDIR/ext_dangle_nofile_f.out.h5 -v -s /group_ext/extlink_notyet2 -d /copy_dangle2_2 echo "Test copying a group contains external links without -f ext" - TOOLTEST -v -i $TESTFILE -o $FILEOUT -s /group_ext -d /copy1_group + TOOLTEST -v -i $TESTFILE -o $TESTDIR/ext_link_group.out.h5 -s /group_ext -d /copy1_group echo "Test copying a group contains external links with -f ext" - TOOLTEST -f ext -v -i $TESTFILE -o $FILEOUT -s /group_ext -d /copy2_group - - # Verify that the file created above is correct - H5LSTEST $FILEOUT - - # Remove output file created, if the "no cleanup" environment variable is - # not defined - if test -z "$HDF5_NOCLEANUP"; then - rm -f $FILEOUT - fi + TOOLTEST_F -f ext -i $TESTFILE -o $TESTDIR/ext_link_group_f.out.h5 -v -s /group_ext -d /copy2_group } # Test misc. @@ -511,28 +557,13 @@ COPY_EXT_LINKS() TEST_MISC() { TESTFILE="$TESTDIR/h5copytst.h5" - FILEOUT="$TESTDIR/`basename h5copytst.h5 .h5`.out.h5" - - # Remove any output file left over from previous test run - rm -f $FILEOUT echo "Test copying object into group which doesn't exist, without -p" - TOOLTEST_FAIL h5copy_misc1.out -v -i $TESTFILE -o $FILEOUT -s /simple -d /g1/g2/simple + TOOLTEST_FAIL h5copy_misc1.out -i $TESTFILE -o $TESTDIR/h5copy_misc1.out.h5 -v -s /simple -d /g1/g2/simple echo "Test copying objects to the same file " - rm -f $FILEOUT - # create temporary test file ($FILEOUT) with some objects - TOOLTEST -i $TESTFILE -o $FILEOUT -v -s /simple -d /simple - TOOLTEST -i $TESTFILE -o $FILEOUT -v -s /grp_dsets -d /grp_dsets - # actual test cases - TOOLTEST -i $FILEOUT -o $FILEOUT -v -s /simple -d /simple_cp - TOOLTEST -i $FILEOUT -o $FILEOUT -v -s /grp_dsets -d /grp_dsets_cp - - # Remove output file created, if the "no cleanup" environment variable is - # not defined - if test -z "$HDF5_NOCLEANUP"; then - rm -f $FILEOUT - fi + TOOLTEST_SAME -i $TESTFILE -o $TESTDIR/samefile1.out.h5 /simple /simple_cp + TOOLTEST_SAME -i $TESTFILE -o $TESTDIR/samefile2.out.h5 /grp_dsets /grp_dsets_cp } ############################################################################## diff --git a/tools/h5diff/CMakeLists.txt b/tools/h5diff/CMakeLists.txt index 87eca15..8eb5ad1 100644 --- a/tools/h5diff/CMakeLists.txt +++ b/tools/h5diff/CMakeLists.txt @@ -344,10 +344,9 @@ IF (BUILD_TESTING) IF (NOT "${last_test}" STREQUAL "") SET_TESTS_PROPERTIES (H5DIFF-${resultfile} PROPERTIES DEPENDS ${last_test}) ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "H5DIFF-${resultfile}") ELSE (HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( - NAME H5DIFF-clear-${resultfile}-objects + NAME H5DIFF-${resultfile}-clear-objects COMMAND ${CMAKE_COMMAND} -E remove ./testfiles/${resultfile}.out ./testfiles/${resultfile}.out.err ) @@ -363,7 +362,7 @@ IF (BUILD_TESTING) -D "TEST_APPEND=EXIT CODE:" -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) - SET_TESTS_PROPERTIES (H5DIFF-${resultfile} PROPERTIES DEPENDS "H5DIFF-clear-${resultfile}-objects") + SET_TESTS_PROPERTIES (H5DIFF-${resultfile} PROPERTIES DEPENDS "H5DIFF-${resultfile}-clear-objects") ENDIF (HDF5_ENABLE_USING_MEMCHECKER) IF (H5_HAVE_PARALLEL) ADD_PH5_TEST (${resultfile} ${resultcode} ${ARGN}) @@ -381,10 +380,9 @@ IF (BUILD_TESTING) IF (NOT "${last_test}" STREQUAL "") SET_TESTS_PROPERTIES (PH5DIFF-${resultfile} PROPERTIES DEPENDS ${last_test}) ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "PH5DIFF-${resultfile}") ELSE (HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( - NAME PH5DIFF-clear-${resultfile}-objects + NAME PH5DIFF-${resultfile}-clear-objects COMMAND ${CMAKE_COMMAND} -E remove ./testfiles/${resultfile}_p.out ./testfiles/${resultfile}_p.out.err ) @@ -402,7 +400,7 @@ IF (BUILD_TESTING) -D "TEST_SKIP_COMPARE=TRUE" -P "${HDF5_RESOURCES_DIR}/prunTest.cmake" ) - SET_TESTS_PROPERTIES (PH5DIFF-${resultfile} PROPERTIES DEPENDS "PH5DIFF-clear-${resultfile}-objects") + SET_TESTS_PROPERTIES (PH5DIFF-${resultfile} PROPERTIES DEPENDS "PH5DIFF-${resultfile}-clear-objects") ENDIF (HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (ADD_PH5_TEST file) @@ -413,15 +411,14 @@ IF (BUILD_TESTING) # If using memchecker add tests without using scripts IF (NOT HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( - NAME H5DIFF-clear-${testname}-objects + NAME H5DIFF-${testname}-clear-objects COMMAND ${CMAKE_COMMAND} -E remove ./testfiles/${testname}.out ./testfiles/${testname}.out.err ) # if there was a previous test IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5DIFF-clear-${testname}-objects PROPERTIES DEPENDS ${last_test}) + SET_TESTS_PROPERTIES (H5DIFF-${testname}-clear-objects PROPERTIES DEPENDS ${last_test}) ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "H5DIFF-clear-${testname}-objects") ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST (NAME H5DIFF-${testname} COMMAND $ ${ARGN}) @@ -429,10 +426,13 @@ IF (BUILD_TESTING) SET_TESTS_PROPERTIES (H5DIFF-${testname} PROPERTIES WILL_FAIL "true") ENDIF (NOT ${resultcode} STREQUAL "0") - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5DIFF-${testname} PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "H5DIFF-${testname}") + IF (HDF5_ENABLE_USING_MEMCHECKER) + IF (NOT "${last_test}" STREQUAL "") + SET_TESTS_PROPERTIES (H5DIFF-${testname} PROPERTIES DEPENDS ${last_test}) + ENDIF (NOT "${last_test}" STREQUAL "") + ELSE (HDF5_ENABLE_USING_MEMCHECKER) + SET_TESTS_PROPERTIES (H5DIFF-${testname} PROPERTIES DEPENDS H5DIFF-${testname}-clear-objects) + ENDIF (HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (ADD_H5_NO_OUTPUT_TEST) ############################################################################## @@ -1092,13 +1092,13 @@ ADD_H5_TEST (h5diff_704 1 -v2 ${ATTR_VERBOSE_LEVEL_FILE1} ${ATTR_VERBOSE_LEVEL_F ADD_H5_TEST (h5diff_705 1 -v2 ${ATTR_VERBOSE_LEVEL_FILE1} ${ATTR_VERBOSE_LEVEL_FILE2} /dset) # same attr number , all different attr name -ADD_H5_TEST (h5diff_706 0 -v2 ${ATTR_VERBOSE_LEVEL_FILE1} ${ATTR_VERBOSE_LEVEL_FILE2} /ntype) +ADD_H5_TEST (h5diff_706 1 -v2 ${ATTR_VERBOSE_LEVEL_FILE1} ${ATTR_VERBOSE_LEVEL_FILE2} /ntype) # different attr number , same attr name (intersected) ADD_H5_TEST (h5diff_707 1 -v2 ${ATTR_VERBOSE_LEVEL_FILE1} ${ATTR_VERBOSE_LEVEL_FILE2} /g2) # different attr number , all different attr name -ADD_H5_TEST (h5diff_708 0 -v2 ${ATTR_VERBOSE_LEVEL_FILE1} ${ATTR_VERBOSE_LEVEL_FILE2} /g3) +ADD_H5_TEST (h5diff_708 1 -v2 ${ATTR_VERBOSE_LEVEL_FILE1} ${ATTR_VERBOSE_LEVEL_FILE2} /g3) # when no attributes exist in both objects ADD_H5_TEST (h5diff_709 0 -v2 ${ATTR_VERBOSE_LEVEL_FILE1} ${ATTR_VERBOSE_LEVEL_FILE2} /g4) diff --git a/tools/h5diff/Makefile.in b/tools/h5diff/Makefile.in index 4676341..5567ceb 100644 --- a/tools/h5diff/Makefile.in +++ b/tools/h5diff/Makefile.in @@ -241,6 +241,7 @@ H5_VERSION = @H5_VERSION@ HADDR_T = @HADDR_T@ HAVE_DMALLOC = @HAVE_DMALLOC@ HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@ +HAVE_PTHREAD = @HAVE_PTHREAD@ HDF5_HL = @HDF5_HL@ HDF5_INTERFACES = @HDF5_INTERFACES@ HDF_CXX = @HDF_CXX@ @@ -292,7 +293,6 @@ PACKAGE_VERSION = @PACKAGE_VERSION@ PARALLEL = @PARALLEL@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ -PTHREAD = @PTHREAD@ RANLIB = @RANLIB@ ROOT = @ROOT@ RUNPARALLEL = @RUNPARALLEL@ diff --git a/tools/h5diff/testfiles/h5diff_706.txt b/tools/h5diff/testfiles/h5diff_706.txt index 38eeac5..5825150 100644 --- a/tools/h5diff/testfiles/h5diff_706.txt +++ b/tools/h5diff/testfiles/h5diff_706.txt @@ -10,4 +10,4 @@ datatype: and x integer1 x integer4 Attributes status: 0 common, 3 only in obj1, 3 only in obj2 -EXIT CODE: 0 +EXIT CODE: 1 diff --git a/tools/h5diff/testfiles/h5diff_708.txt b/tools/h5diff/testfiles/h5diff_708.txt index add386b..a10a8b7 100644 --- a/tools/h5diff/testfiles/h5diff_708.txt +++ b/tools/h5diff/testfiles/h5diff_708.txt @@ -14,4 +14,4 @@ group : and x integer10 x integer3 Attributes status: 0 common, 3 only in obj1, 2 only in obj2 -EXIT CODE: 0 +EXIT CODE: 1 diff --git a/tools/h5dump/CMakeLists.txt b/tools/h5dump/CMakeLists.txt index 56f49ac..3f39ae3 100644 --- a/tools/h5dump/CMakeLists.txt +++ b/tools/h5dump/CMakeLists.txt @@ -680,11 +680,11 @@ IF (BUILD_TESTING) SET (last_test "H5DUMP-${testname}") ELSE (HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( - NAME H5DUMP-clear-h5dump-${testname}-objects + NAME H5DUMP-h5dump-${testname}-clear-objects COMMAND ${CMAKE_COMMAND} -E remove h5dump-${testname}.out h5dump-${testname}.out.err ) - SET_TESTS_PROPERTIES (H5DUMP-clear-h5dump-${testname}-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") + SET_TESTS_PROPERTIES (H5DUMP-h5dump-${testname}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") ADD_TEST ( NAME H5DUMP-h5dump-${testname} COMMAND "${CMAKE_COMMAND}" @@ -696,7 +696,7 @@ IF (BUILD_TESTING) -D "TEST_REFERENCE=h5dump-${testname}.txt" -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) - SET_TESTS_PROPERTIES (H5DUMP-h5dump-${testname} PROPERTIES DEPENDS "H5DUMP-clear-h5dump-${testname}-objects") + SET_TESTS_PROPERTIES (H5DUMP-h5dump-${testname} PROPERTIES DEPENDS "H5DUMP-h5dump-${testname}-clear-objects") ENDIF (HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (ADD_HELP_TEST) @@ -724,14 +724,13 @@ IF (BUILD_TESTING) IF (NOT "${last_test}" STREQUAL "") SET_TESTS_PROPERTIES (H5DUMP-${resultfile} PROPERTIES DEPENDS ${last_test}) ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "H5DUMP-${resultfile}") ELSE (HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( - NAME H5DUMP-clear-${resultfile}-objects + NAME H5DUMP-${resultfile}-clear-objects COMMAND ${CMAKE_COMMAND} - -E remove ${resultfile}.out ${resultfile}.out.err + -E remove ${resultfile}.bin ${resultfile}.out ${resultfile}.out.err ) - SET_TESTS_PROPERTIES (H5DUMP-clear-${resultfile}-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") + SET_TESTS_PROPERTIES (H5DUMP-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") ADD_TEST ( NAME H5DUMP-${resultfile} COMMAND "${CMAKE_COMMAND}" @@ -743,7 +742,7 @@ IF (BUILD_TESTING) -D "TEST_REFERENCE=${resultfile}.ddl" -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) - SET_TESTS_PROPERTIES (H5DUMP-${resultfile} PROPERTIES DEPENDS "H5DUMP-clear-${resultfile}-objects") + SET_TESTS_PROPERTIES (H5DUMP-${resultfile} PROPERTIES DEPENDS "H5DUMP-${resultfile}-clear-objects") ENDIF (HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (ADD_H5_TEST file) @@ -758,14 +757,13 @@ IF (BUILD_TESTING) IF (NOT "${last_test}" STREQUAL "") SET_TESTS_PROPERTIES (H5DUMP-${resultfile} PROPERTIES DEPENDS ${last_test}) ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "H5DUMP-${resultfile}") ELSE (HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( - NAME H5DUMP-clear-${resultfile}-objects + NAME H5DUMP-${resultfile}-clear-objects COMMAND ${CMAKE_COMMAND} -E remove ${resultfile}.txt ${resultfile}.out ${resultfile}.out.err ) - SET_TESTS_PROPERTIES (H5DUMP-clear-${resultfile}-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") + SET_TESTS_PROPERTIES (H5DUMP-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") ADD_TEST ( NAME H5DUMP-${resultfile} COMMAND "${CMAKE_COMMAND}" @@ -777,49 +775,96 @@ IF (BUILD_TESTING) -D "TEST_REFERENCE=${resultfile}.ddl" -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) - SET_TESTS_PROPERTIES (H5DUMP-${resultfile} PROPERTIES DEPENDS "H5DUMP-clear-${resultfile}-objects") + SET_TESTS_PROPERTIES (H5DUMP-${resultfile} PROPERTIES DEPENDS "H5DUMP-${resultfile}-clear-objects") ADD_TEST ( - NAME H5DUMP-output-cmp-${resultfile} + NAME H5DUMP-${resultfile}-output-cmp COMMAND ${CMAKE_COMMAND} -E compare_files ${resultfile}.txt ${resultfile}.exp ) - SET_TESTS_PROPERTIES (H5DUMP-output-cmp-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") - SET_TESTS_PROPERTIES (H5DUMP-output-cmp-${resultfile} PROPERTIES DEPENDS H5DUMP-${resultfile}) + SET_TESTS_PROPERTIES (H5DUMP-${resultfile}-output-cmp PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") + SET_TESTS_PROPERTIES (H5DUMP-${resultfile}-output-cmp PROPERTIES DEPENDS H5DUMP-${resultfile}) ENDIF (HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (ADD_H5_TEST_EXPORT file) + MACRO (ADD_H5_TEST_EXPORT_DDL resultfile targetfile resultcode ddlfile) + # If using memchecker add tests without using scripts + IF (HDF5_ENABLE_USING_MEMCHECKER) + ADD_TEST (NAME H5DUMP-${resultfile} COMMAND $ --ddl=${ddlfile}.txt ${ARGN} ${resultfile}.txt ${targetfile}) + SET_TESTS_PROPERTIES (H5DUMP-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") + IF (NOT ${resultcode} STREQUAL "0") + SET_TESTS_PROPERTIES (H5DUMP-${resultfile} PROPERTIES WILL_FAIL "true") + ENDIF (NOT ${resultcode} STREQUAL "0") + IF (NOT "${last_test}" STREQUAL "") + SET_TESTS_PROPERTIES (H5DUMP-${resultfile} PROPERTIES DEPENDS ${last_test}) + ENDIF (NOT "${last_test}" STREQUAL "") + ELSE (HDF5_ENABLE_USING_MEMCHECKER) + ADD_TEST ( + NAME H5DUMP-${resultfile}-clear-objects + COMMAND ${CMAKE_COMMAND} + -E remove ${ddlfile}.txt ${resultfile}.txt ${resultfile}.out ${resultfile}.out.err + ) + SET_TESTS_PROPERTIES (H5DUMP-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") + ADD_TEST ( + NAME H5DUMP-${resultfile} + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=--ddl=${ddlfile}.txt;${ARGN};${resultfile}.txt;${targetfile}" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles/std" + -D "TEST_OUTPUT=${resultfile}.out" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_REFERENCE=${resultfile}.ddl" + -P "${HDF5_RESOURCES_DIR}/runTest.cmake" + ) + SET_TESTS_PROPERTIES (H5DUMP-${resultfile} PROPERTIES DEPENDS "H5DUMP-${resultfile}-clear-objects") + ADD_TEST ( + NAME H5DUMP-${resultfile}-output-cmp + COMMAND ${CMAKE_COMMAND} + -E compare_files ${resultfile}.txt ${resultfile}.exp + ) + SET_TESTS_PROPERTIES (H5DUMP-${resultfile}-output-cmp PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") + SET_TESTS_PROPERTIES (H5DUMP-${resultfile}-output-cmp PROPERTIES DEPENDS H5DUMP-${resultfile}) + ADD_TEST ( + NAME H5DUMP-${resultfile}-output-cmp-ddl + COMMAND ${CMAKE_COMMAND} + -E compare_files ${ddlfile}.txt ${ddlfile}.exp + ) + SET_TESTS_PROPERTIES (H5DUMP-${resultfile}-output-cmp-ddl PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") + SET_TESTS_PROPERTIES (H5DUMP-${resultfile}-output-cmp-ddl PROPERTIES DEPENDS H5DUMP-${resultfile}-output-cmp) + ENDIF (HDF5_ENABLE_USING_MEMCHECKER) + ENDMACRO (ADD_H5_TEST_EXPORT_DDL file) + MACRO (ADD_H5_EXPORT_TEST resultfile targetfile resultcode) - ADD_TEST ( - NAME H5DUMP-output-${resultfile} - COMMAND $ ${ARGN} ${resultfile}.txt ${targetfile} - ) - SET_TESTS_PROPERTIES (H5DUMP-output-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5DUMP-output-${resultfile} PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "H5DUMP-output-${resultfile}") IF (NOT HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( + NAME H5DUMP-output-${resultfile}-clear-objects + COMMAND ${CMAKE_COMMAND} + -E remove ${resultfile}.txt + ) + SET_TESTS_PROPERTIES (H5DUMP-output-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") + ADD_TEST ( + NAME H5DUMP-output-${resultfile} + COMMAND $ ${ARGN} ${resultfile}.txt ${targetfile} + ) + SET_TESTS_PROPERTIES (H5DUMP-output-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") + SET_TESTS_PROPERTIES (H5DUMP-output-${resultfile} PROPERTIES DEPENDS H5DUMP-output-${resultfile}-clear-objects) + ADD_TEST ( NAME H5DUMP-output-cmp-${resultfile} COMMAND ${CMAKE_COMMAND} -E compare_files ${resultfile}.txt ${resultfile}.exp ) SET_TESTS_PROPERTIES (H5DUMP-output-cmp-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5DUMP-output-cmp-${resultfile} PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "H5DUMP-output-cmp-${resultfile}") + SET_TESTS_PROPERTIES (H5DUMP-output-cmp-${resultfile} PROPERTIES DEPENDS H5DUMP-output-${resultfile}) ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (ADD_H5_EXPORT_TEST file) MACRO (ADD_H5_MASK_TEST resultfile resultcode) IF (NOT HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( - NAME H5DUMP-clear-${resultfile}-objects + NAME H5DUMP-${resultfile}-clear-objects COMMAND ${CMAKE_COMMAND} -E remove ${resultfile}.out ${resultfile}.out.err ) - SET_TESTS_PROPERTIES (H5DUMP-clear-${resultfile}-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") + SET_TESTS_PROPERTIES (H5DUMP-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") ADD_TEST ( NAME H5DUMP-${resultfile} COMMAND "${CMAKE_COMMAND}" @@ -832,18 +877,18 @@ IF (BUILD_TESTING) -D "TEST_MASK_ERROR=true" -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) - SET_TESTS_PROPERTIES (H5DUMP-${resultfile} PROPERTIES DEPENDS "H5DUMP-clear-${resultfile}-objects") + SET_TESTS_PROPERTIES (H5DUMP-${resultfile} PROPERTIES DEPENDS "H5DUMP-${resultfile}-clear-objects") ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (ADD_H5_MASK_TEST file) MACRO (ADD_H5ERR_MASK_TEST resultfile resultcode) IF (NOT HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( - NAME H5DUMP-clear-${resultfile}-objects + NAME H5DUMP-${resultfile}-clear-objects COMMAND ${CMAKE_COMMAND} -E remove ${resultfile}.out ${resultfile}.out.err ) - SET_TESTS_PROPERTIES (H5DUMP-clear-${resultfile}-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") + SET_TESTS_PROPERTIES (H5DUMP-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") ADD_TEST ( NAME H5DUMP-${resultfile} COMMAND "${CMAKE_COMMAND}" @@ -857,10 +902,40 @@ IF (BUILD_TESTING) -D "TEST_MASK_ERROR=true" -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) - SET_TESTS_PROPERTIES (H5DUMP-${resultfile} PROPERTIES DEPENDS "H5DUMP-clear-${resultfile}-objects") + SET_TESTS_PROPERTIES (H5DUMP-${resultfile} PROPERTIES DEPENDS "H5DUMP-${resultfile}-clear-objects") ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (ADD_H5ERR_MASK_TEST file) + MACRO (ADD_H5_TEST_IMPORT conffile resultfile testfile resultcode) + # If using memchecker add tests without using scripts + IF (NOT HDF5_ENABLE_USING_MEMCHECKER) + ADD_TEST ( + NAME H5DUMP-IMPORT-${resultfile}-clear-objects + COMMAND ${CMAKE_COMMAND} + -E remove ${conffile}.out ${conffile}.out.err ${resultfile}.bin ${resultfile}.h5 + ) + SET_TESTS_PROPERTIES (H5DUMP-IMPORT-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") + ADD_TEST ( + NAME H5DUMP-IMPORT-${resultfile} + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=${ARGN};-o;${resultfile}.bin;${testfile}" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles/std" + -D "TEST_OUTPUT=${conffile}.out" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_REFERENCE=${conffile}.ddl" + -P "${HDF5_RESOURCES_DIR}/runTest.cmake" + ) + SET_TESTS_PROPERTIES (H5DUMP-IMPORT-${resultfile} PROPERTIES DEPENDS "H5DUMP-IMPORT-${resultfile}-clear-objects") + ADD_TEST (NAME H5DUMP-IMPORT-h5import-${resultfile} COMMAND h5import ${resultfile}.bin -c ${conffile}.out -o ${resultfile}.h5) + SET_TESTS_PROPERTIES (H5DUMP-IMPORT-h5import-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") + SET_TESTS_PROPERTIES (H5DUMP-IMPORT-h5import-${resultfile} PROPERTIES DEPENDS H5DUMP-IMPORT-${resultfile}) + ADD_TEST (NAME H5DUMP-IMPORT-h5diff-${resultfile} COMMAND h5diff ${testfile} ${resultfile}.h5 /integer /integer) + SET_TESTS_PROPERTIES (H5DUMP-IMPORT-h5diff-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") + SET_TESTS_PROPERTIES (H5DUMP-IMPORT-h5diff-${resultfile} PROPERTIES DEPENDS H5DUMP-IMPORT-h5import-${resultfile}) + ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) + ENDMACRO (ADD_H5_TEST_IMPORT file) + MACRO (ADD_H5_PBITS_TEST resultfile resultcode) # If using memchecker add tests without using scripts IF (HDF5_ENABLE_USING_MEMCHECKER) @@ -869,17 +944,16 @@ IF (BUILD_TESTING) IF (NOT ${resultcode} STREQUAL "0") SET_TESTS_PROPERTIES (H5DUMP-${resultfile} PROPERTIES WILL_FAIL "true") ENDIF (NOT ${resultcode} STREQUAL "0") - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5DUMP-${resultfile} PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "H5DUMP-${resultfile}") + IF (NOT "${last_pbits_test}" STREQUAL "") + SET_TESTS_PROPERTIES (H5DUMP-${resultfile} PROPERTIES DEPENDS ${last_pbits_test}) + ENDIF (NOT "${last_pbits_test}" STREQUAL "") ELSE (HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( - NAME H5DUMP-clear-${resultfile}-objects + NAME H5DUMP-${resultfile}-clear-objects COMMAND ${CMAKE_COMMAND} -E remove ${resultfile}.out ${resultfile}.out.err ) - SET_TESTS_PROPERTIES (H5DUMP-clear-${resultfile}-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/pbits") + SET_TESTS_PROPERTIES (H5DUMP-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/pbits") ADD_TEST ( NAME H5DUMP-${resultfile} COMMAND "${CMAKE_COMMAND}" @@ -891,7 +965,7 @@ IF (BUILD_TESTING) -D "TEST_REFERENCE=${resultfile}.ddl" -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) - SET_TESTS_PROPERTIES (H5DUMP-${resultfile} PROPERTIES DEPENDS "H5DUMP-clear-${resultfile}-objects") + SET_TESTS_PROPERTIES (H5DUMP-${resultfile} PROPERTIES DEPENDS "H5DUMP-${resultfile}-clear-objects") ENDIF (HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (ADD_H5_PBITS_TEST file) @@ -915,17 +989,16 @@ IF (BUILD_TESTING) IF (NOT ${resultcode} STREQUAL "0") SET_TESTS_PROPERTIES (H5DUMP-XML-${resultfile} PROPERTIES WILL_FAIL "true") ENDIF (NOT ${resultcode} STREQUAL "0") - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5DUMP-XML-${resultfile} PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "H5DUMP-XML-${resultfile}") + IF (NOT "${last_xml_test}" STREQUAL "") + SET_TESTS_PROPERTIES (H5DUMP-XML-${resultfile} PROPERTIES DEPENDS ${last_xml_test}) + ENDIF (NOT "${last_xml_test}" STREQUAL "") ELSE (HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( - NAME H5DUMP-XML-clear-${resultfile}-objects + NAME H5DUMP-XML-${resultfile}-clear-objects COMMAND ${CMAKE_COMMAND} -E remove ${resultfile}.out ${resultfile}.out.err ) - SET_TESTS_PROPERTIES (H5DUMP-XML-clear-${resultfile}-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/xml") + SET_TESTS_PROPERTIES (H5DUMP-XML-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/xml") ADD_TEST ( NAME H5DUMP-XML-${resultfile} COMMAND "${CMAKE_COMMAND}" @@ -937,7 +1010,7 @@ IF (BUILD_TESTING) -D "TEST_REFERENCE=${resultfile}.xml" -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) - SET_TESTS_PROPERTIES (H5DUMP-XML-${resultfile} PROPERTIES DEPENDS "H5DUMP-XML-clear-${resultfile}-objects") + SET_TESTS_PROPERTIES (H5DUMP-XML-${resultfile} PROPERTIES DEPENDS "H5DUMP-XML-${resultfile}-clear-objects") ENDIF (HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (ADD_XML_H5_TEST file) @@ -1017,6 +1090,8 @@ IF (BUILD_TESTING) tattrreg.out.err tattrregR.out tattrregR.out.err + tbin1LE.bin + tbinregR.txt tbinregR.out tbinregR.out.err tbigdims.out @@ -1151,7 +1226,7 @@ IF (BUILD_TESTING) tnoddlfile.out.err trawdatafile.out trawdatafile.out.err - twithddlfile.txt + trawdatafile.txt tno-subset.out tno-subset.out.err tnullspace.out @@ -1268,22 +1343,7 @@ IF (BUILD_TESTING) ADD_H5_TEST_EXPORT (trawdatafile packedbits.h5 0 --enable-error-stack -y -o) ADD_H5_TEST_EXPORT (tnoddlfile packedbits.h5 0 --enable-error-stack -O -y -o) - IF (NOT HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( - NAME H5DUMP-clear-twithddlfile-export - COMMAND ${CMAKE_COMMAND} - -E remove twithddl.txt - ) - SET_TESTS_PROPERTIES (H5DUMP-clear-twithddlfile-export PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") - ADD_H5_TEST_EXPORT (twithddlfile packedbits.h5 0 --enable-error-stack --ddl=twithddl.txt -y -o) - ADD_TEST ( - NAME H5DUMP-output-cmp-meta-twithddlfile - COMMAND ${CMAKE_COMMAND} - -E compare_files twithddl.txt twithddl.exp - ) - SET_TESTS_PROPERTIES (H5DUMP-output-cmp-meta-twithddlfile PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") - SET_TESTS_PROPERTIES (H5DUMP-output-cmp-meta-twithddlfile PROPERTIES DEPENDS "H5DUMP-clear-twithddlfile-export") - ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) + ADD_H5_TEST_EXPORT_DDL (twithddlfile packedbits.h5 0 twithddl --enable-error-stack --ddl=twithddl.txt -y -o) # test for maximum display datasets ADD_H5_TEST (twidedisplay 0 --enable-error-stack -w0 packedbits.h5) @@ -1534,110 +1594,32 @@ IF (BUILD_TESTING) ADD_H5_TEST (tvms 0 --enable-error-stack tvms.h5) # test for binary output - ADD_H5_TEST (tbin1LE 0 --enable-error-stack -d integer -o out1LE.bin -b LE tbinary.h5) + ADD_H5_TEST (tbin1LE 0 --enable-error-stack -d integer -o tbin1LE.bin -b LE tbinary.h5) # test for string binary output ADD_H5_EXPORT_TEST (tstr2bin2 tstr2.h5 0 --enable-error-stack -d /g2/dset2 -b -o) ADD_H5_EXPORT_TEST (tstr2bin6 tstr2.h5 0 --enable-error-stack -d /g6/dset6 -b -o) # NATIVE default. the NATIVE test can be validated with h5import/h5diff - ADD_TEST (NAME H5DUMP-clear-objects-tbin1 COMMAND ${CMAKE_COMMAND} -E remove out1.bin) - SET_TESTS_PROPERTIES (H5DUMP-clear-objects-tbin1 PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") - IF (HDF5_ENABLE_USING_MEMCHECKER) - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5DUMP-clear-objects-tbin1 PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) - ADD_H5_TEST (tbin1 0 --enable-error-stack -d integer -o out1.bin -b tbinary.h5) - IF (HDF5_ENABLE_USING_MEMCHECKER) - SET_TESTS_PROPERTIES (H5DUMP-tbin1 PROPERTIES DEPENDS H5DUMP-clear-objects-tbin1) - SET (last_test "H5DUMP-tbin1") - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) - - IF (NOT HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST (NAME H5DUMP-clear-out1D COMMAND ${CMAKE_COMMAND} -E remove ./testfiles/std/out1D.h5) - SET_TESTS_PROPERTIES (H5DUMP-clear-out1D PROPERTIES DEPENDS H5DUMP-tbin1) - ADD_TEST (NAME H5DUMP-h5import-out1D COMMAND h5import out1.bin -c tbin1.out -o out1D.h5) - SET_TESTS_PROPERTIES (H5DUMP-h5import-out1D PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") - SET_TESTS_PROPERTIES (H5DUMP-h5import-out1D PROPERTIES DEPENDS H5DUMP-clear-out1D) - ADD_TEST (NAME H5DUMP-h5diff-out1D COMMAND h5diff tbinary.h5 out1D.h5 /integer /integer) - SET_TESTS_PROPERTIES (H5DUMP-h5diff-out1D PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") - SET_TESTS_PROPERTIES (H5DUMP-h5diff-out1D PROPERTIES DEPENDS H5DUMP-h5import-out1D) - ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) - + ADD_H5_TEST_IMPORT (tbin1 out1D tbinary.h5 0 --enable-error-stack -d integer -b) + IF (NOT HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST (NAME H5DUMP-clear-out1 COMMAND ${CMAKE_COMMAND} -E remove ./testfiles/std/out1.h5) - SET_TESTS_PROPERTIES (H5DUMP-clear-out1 PROPERTIES DEPENDS H5DUMP-tbin1) - ADD_TEST (NAME H5DUMP-h5import-out1 COMMAND h5import out1.bin -c out3.h5import -o out1.h5) - SET_TESTS_PROPERTIES (H5DUMP-h5import-out1 PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") - SET_TESTS_PROPERTIES (H5DUMP-h5import-out1 PROPERTIES DEPENDS H5DUMP-clear-out1) - ADD_TEST (NAME H5DUMP-h5diff-out1 COMMAND h5diff tbinary.h5 out1.h5 /integer /integer) - SET_TESTS_PROPERTIES (H5DUMP-h5diff-out1 PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") - SET_TESTS_PROPERTIES (H5DUMP-h5diff-out1 PROPERTIES DEPENDS H5DUMP-h5import-out1) + ADD_TEST (NAME H5DUMP-tbin2-bin-clear-objects COMMAND ${CMAKE_COMMAND} -E remove out2.bin) + SET_TESTS_PROPERTIES (H5DUMP-tbin2-bin-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") + ADD_H5_TEST (tbin2 0 --enable-error-stack -b BE -d float -o out2.bin tbinary.h5) + SET_TESTS_PROPERTIES (H5DUMP-tbin2 PROPERTIES DEPENDS H5DUMP-tbin2-bin-clear-objects) ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST (NAME H5DUMP-clear-objects-tbin2 COMMAND ${CMAKE_COMMAND} -E remove out2.bin) - SET_TESTS_PROPERTIES (H5DUMP-clear-objects-tbin2 PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") - IF (HDF5_ENABLE_USING_MEMCHECKER) - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5DUMP-clear-objects-tbin2 PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) - ADD_H5_TEST (tbin2 0 --enable-error-stack -b BE -d float -o out2.bin tbinary.h5) - IF (HDF5_ENABLE_USING_MEMCHECKER) - SET_TESTS_PROPERTIES (H5DUMP-tbin2 PROPERTIES DEPENDS H5DUMP-clear-objects-tbin2) - SET (last_test "H5DUMP-tbin2") - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) - # the NATIVE test can be validated with h5import/h5diff - ADD_TEST (NAME H5DUMP-clear-objects-tbin3 COMMAND ${CMAKE_COMMAND} -E remove out3.bin) - SET_TESTS_PROPERTIES (H5DUMP-clear-objects-tbin3 PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") - IF (HDF5_ENABLE_USING_MEMCHECKER) - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5DUMP-clear-objects-tbin3 PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) - ADD_H5_TEST (tbin3 0 --enable-error-stack -d integer -o out3.bin -b NATIVE tbinary.h5) - IF (HDF5_ENABLE_USING_MEMCHECKER) - SET_TESTS_PROPERTIES (H5DUMP-tbin3 PROPERTIES DEPENDS H5DUMP-clear-objects-tbin3) - SET (last_test "H5DUMP-tbin3") - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) - - IF (NOT HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST (NAME H5DUMP-clear-out3D COMMAND ${CMAKE_COMMAND} -E remove ./testfiles/std/out3D.h5) - SET_TESTS_PROPERTIES (H5DUMP-clear-out3D PROPERTIES DEPENDS H5DUMP-tbin3) - ADD_TEST (NAME H5DUMP-h5import-out3D COMMAND h5import out3.bin -c tbin3.out -o out3D.h5) - SET_TESTS_PROPERTIES (H5DUMP-h5import-out3D PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") - SET_TESTS_PROPERTIES (H5DUMP-h5import-out3D PROPERTIES DEPENDS H5DUMP-clear-out3D) - ADD_TEST (NAME H5DUMP-h5diff-out3D COMMAND h5diff tbinary.h5 out3D.h5 /integer /integer -q) - SET_TESTS_PROPERTIES (H5DUMP-h5diff-out3D PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") - SET_TESTS_PROPERTIES (H5DUMP-h5diff-out3D PROPERTIES DEPENDS H5DUMP-h5import-out3D) - ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) - + ADD_H5_TEST_IMPORT (tbin3 out3D tbinary.h5 0 --enable-error-stack -d integer -b NATIVE) + IF (NOT HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST (NAME H5DUMP-clear-out3 COMMAND ${CMAKE_COMMAND} -E remove ./testfiles/std/out3.h5) - SET_TESTS_PROPERTIES (H5DUMP-h5import-out3 PROPERTIES DEPENDS H5DUMP-tbin3) - ADD_TEST (NAME H5DUMP-h5import-out3 COMMAND h5import out3.bin -c out3.h5import -o out3.h5) - SET_TESTS_PROPERTIES (H5DUMP-h5import-out3 PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") - SET_TESTS_PROPERTIES (H5DUMP-h5import-out3 PROPERTIES DEPENDS H5DUMP-clear-out3) - ADD_TEST (NAME H5DUMP-h5diff-out3 COMMAND h5diff tbinary.h5 out3.h5 /integer /integer -q) - SET_TESTS_PROPERTIES (H5DUMP-h5diff-out3 PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") - SET_TESTS_PROPERTIES (H5DUMP-h5diff-out3 PROPERTIES DEPENDS H5DUMP-h5import-out3) + ADD_TEST (NAME H5DUMP-tbin4-bin-clear-objects COMMAND ${CMAKE_COMMAND} -E remove out4.bin) + SET_TESTS_PROPERTIES (H5DUMP-tbin4-bin-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") + ADD_H5_TEST (tbin4 0 --enable-error-stack -d double -b FILE -o out4.bin tbinary.h5) + SET_TESTS_PROPERTIES (H5DUMP-tbin4 PROPERTIES DEPENDS H5DUMP-tbin4-bin-clear-objects) ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST (NAME H5DUMP-clear-objects-tbin4 COMMAND ${CMAKE_COMMAND} -E remove out4.bin) - SET_TESTS_PROPERTIES (H5DUMP-clear-objects-tbin4 PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") - IF (HDF5_ENABLE_USING_MEMCHECKER) - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5DUMP-clear-objects-tbin4 PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) - ADD_H5_TEST (tbin4 0 --enable-error-stack -d double -b FILE -o out4.bin tbinary.h5) - IF (HDF5_ENABLE_USING_MEMCHECKER) - SET_TESTS_PROPERTIES (H5DUMP-tbin4 PROPERTIES DEPENDS H5DUMP-clear-objects-tbin4) - SET (last_test "H5DUMP-tbin4") - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) - # test for dataset region references ADD_H5_TEST (tdatareg 0 --enable-error-stack tdatareg.h5) ADD_H5ERR_MASK_TEST (tdataregR 0 --enable-error-stack -R tdatareg.h5) @@ -1793,10 +1775,10 @@ IF (BUILD_TESTING) tpbitsUnsignedLongLong16.out.err ) SET_TESTS_PROPERTIES (H5DUMP_PACKED_BITS-clearall-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/pbits") - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5DUMP_PACKED_BITS-clearall-objects PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "H5DUMP_PACKED_BITS-clearall-objects") + IF (NOT "${last_pbits_test}" STREQUAL "") + SET_TESTS_PROPERTIES (H5DUMP_PACKED_BITS-clearall-objects PROPERTIES DEPENDS ${last_pbits_test}) + ENDIF (NOT "${last_pbits_test}" STREQUAL "") + SET (last_pbits_test "H5DUMP_PACKED_BITS-clearall-objects") ENDIF (HDF5_ENABLE_USING_MEMCHECKER) # test failure handling @@ -2014,9 +1996,9 @@ IF (BUILD_TESTING) tvlstr.h5.out.err ) SET_TESTS_PROPERTIES (H5DUMP-XML-clearall-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/xml") - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5DUMP-XML-clearall-objects PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") + IF (NOT "${last_xml_test}" STREQUAL "") + SET_TESTS_PROPERTIES (H5DUMP-XML-clearall-objects PROPERTIES DEPENDS ${last_xml_test}) + ENDIF (NOT "${last_xml_test}" STREQUAL "") SET (last_test "H5DUMP-XML-clearall-objects") ENDIF (HDF5_ENABLE_USING_MEMCHECKER) diff --git a/tools/h5dump/Makefile.in b/tools/h5dump/Makefile.in index 6b4a6e6..4741683 100644 --- a/tools/h5dump/Makefile.in +++ b/tools/h5dump/Makefile.in @@ -240,6 +240,7 @@ H5_VERSION = @H5_VERSION@ HADDR_T = @HADDR_T@ HAVE_DMALLOC = @HAVE_DMALLOC@ HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@ +HAVE_PTHREAD = @HAVE_PTHREAD@ HDF5_HL = @HDF5_HL@ HDF5_INTERFACES = @HDF5_INTERFACES@ HDF_CXX = @HDF_CXX@ @@ -291,7 +292,6 @@ PACKAGE_VERSION = @PACKAGE_VERSION@ PARALLEL = @PARALLEL@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ -PTHREAD = @PTHREAD@ RANLIB = @RANLIB@ ROOT = @ROOT@ RUNPARALLEL = @RUNPARALLEL@ diff --git a/tools/h5import/CMakeLists.txt b/tools/h5import/CMakeLists.txt index 235cb9f..97f7be9 100644 --- a/tools/h5import/CMakeLists.txt +++ b/tools/h5import/CMakeLists.txt @@ -128,31 +128,29 @@ IF (BUILD_TESTING) ############################################################################## ############################################################################## MACRO (ADD_H5_TEST testname importfile conffile testfile) - ADD_TEST ( - NAME H5IMPORT-${testname}-clear-objects - COMMAND ${CMAKE_COMMAND} - -E remove - ${testfile} - ${testfile}.new - ${testfile}.new.err - ${testfile}.out - ${testfile}.out.err - ) - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5IMPORT-${testname}-clear-objects PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "H5IMPORT-${testname}-clear-objects") - - ADD_TEST (NAME H5IMPORT-${testname} COMMAND $ ${importfile} -c ${conffile} -o ${testfile}) - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5IMPORT-${testname} PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "H5IMPORT-${testname}") - - # If using memchecker add tests without using scripts - IF (NOT HDF5_ENABLE_USING_MEMCHECKER) + # If using memchecker skip macro based tests + IF (HDF5_ENABLE_USING_MEMCHECKER) + ADD_TEST (NAME H5IMPORT-${testname} COMMAND $ ${importfile} -c ${conffile} -o ${testfile}) + IF (NOT "${last_test}" STREQUAL "") + SET_TESTS_PROPERTIES (H5IMPORT-${testname} PROPERTIES DEPENDS ${last_test}) + ENDIF (NOT "${last_test}" STREQUAL "") + ELSE (HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( - NAME H5IMPORT-H5DMP-${testname} + NAME H5IMPORT-${testname}-clear-objects + COMMAND ${CMAKE_COMMAND} + -E remove + ${testfile} + ${testfile}.new + ${testfile}.new.err + ${testfile}.out + ${testfile}.out.err + ) + + ADD_TEST (NAME H5IMPORT-${testname} COMMAND $ ${importfile} -c ${conffile} -o ${testfile}) + SET_TESTS_PROPERTIES (H5IMPORT-${testname} PROPERTIES DEPENDS H5IMPORT-${testname}-clear-objects) + + ADD_TEST ( + NAME H5IMPORT-${testname}-H5DMP COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$" -D "TEST_ARGS:STRING=${testfile}" @@ -163,9 +161,9 @@ IF (BUILD_TESTING) -D "TEST_SKIP_COMPARE=TRUE" -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) - SET_TESTS_PROPERTIES (H5IMPORT-H5DMP-${testname} PROPERTIES DEPENDS H5IMPORT-${testname}) + SET_TESTS_PROPERTIES (H5IMPORT-${testname}-H5DMP PROPERTIES DEPENDS H5IMPORT-${testname}) ADD_TEST ( - NAME H5IMPORT-H5DMP_CMP-${testname} + NAME H5IMPORT-${testname}-H5DMP_CMP COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$" -D "TEST_ARGS:STRING=testfiles/${testfile}" @@ -176,13 +174,12 @@ IF (BUILD_TESTING) -D "TEST_REFERENCE=${testfile}.new" -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) - SET_TESTS_PROPERTIES (H5IMPORT-H5DMP_CMP-${testname} PROPERTIES DEPENDS H5IMPORT-H5DMP-${testname}) - SET (last_test "H5IMPORT-H5DMP_CMP-${testname}") - ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) + SET_TESTS_PROPERTIES (H5IMPORT-${testname}-H5DMP_CMP PROPERTIES DEPENDS H5IMPORT-${testname}-H5DMP) + ENDIF (HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (ADD_H5_TEST testname importfile conffile testfile) MACRO (ADD_H5_DUMPTEST testname datasetname testfile) - # If using memchecker add tests without using scripts + # If using memchecker skip tests IF (NOT HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( NAME H5IMPORT-DUMP-${testname}-clear-objects @@ -197,13 +194,10 @@ IF (BUILD_TESTING) d${testfile}.dff d${testfile}.dff.err ) - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5IMPORT-DUMP-${testname}-clear-objects PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") IF ("${ARGN}" STREQUAL "BINARY") ADD_TEST ( - NAME H5IMPORT-DUMP-${testname}-H5DUMP + NAME H5IMPORT-DUMP-${testname}-H5DMP COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$" -D "TEST_ARGS:STRING=-p;-d;${datasetname};-o;d${testfile}.bin;-b;testfiles/${testfile}" @@ -215,7 +209,7 @@ IF (BUILD_TESTING) ) ELSE ("${ARGN}" STREQUAL "BINARY") ADD_TEST ( - NAME H5IMPORT-DUMP-${testname}-H5DUMP + NAME H5IMPORT-DUMP-${testname}-H5DMP COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$" -D "TEST_ARGS:STRING=-p;-d;${datasetname};-o;d${testfile}.bin;-y;--width=1;testfiles/${testfile}" @@ -226,7 +220,7 @@ IF (BUILD_TESTING) -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) ENDIF ("${ARGN}" STREQUAL "BINARY") - SET_TESTS_PROPERTIES (H5IMPORT-DUMP-${testname}-H5DUMP PROPERTIES DEPENDS "H5IMPORT-DUMP-${testname}-clear-objects") + SET_TESTS_PROPERTIES (H5IMPORT-DUMP-${testname}-H5DMP PROPERTIES DEPENDS "H5IMPORT-DUMP-${testname}-clear-objects") ADD_TEST ( NAME H5IMPORT-DUMP-${testname} @@ -239,10 +233,10 @@ IF (BUILD_TESTING) -D "TEST_SKIP_COMPARE=TRUE" -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) - SET_TESTS_PROPERTIES (H5IMPORT-DUMP-${testname} PROPERTIES DEPENDS "H5IMPORT-DUMP-${testname}-H5DUMP") + SET_TESTS_PROPERTIES (H5IMPORT-DUMP-${testname} PROPERTIES DEPENDS "H5IMPORT-DUMP-${testname}-H5DMP") ADD_TEST ( - NAME H5IMPORT-DUMP-${testname}-H5DIFF + NAME H5IMPORT-DUMP-${testname}-H5DFF COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$" -D "TEST_ARGS:STRING=-v;d${testfile};testfiles/${testfile};${datasetname};${datasetname}" @@ -253,21 +247,17 @@ IF (BUILD_TESTING) -D "TEST_REFERENCE=testfiles/d${testfile}.txt" -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) - SET_TESTS_PROPERTIES (H5IMPORT-DUMP-${testname}-H5DIFF PROPERTIES DEPENDS "H5IMPORT-DUMP-${testname}") - SET (last_test "H5IMPORT-DUMP-${testname}-H5DIFF") - ELSE (NOT HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( - NAME H5IMPORT-DUMP-${testname}-SKIPPED - COMMAND ${CMAKE_COMMAND} -E echo "SKIP ${testname} ${datasetname} ${testfile}" - ) + SET_TESTS_PROPERTIES (H5IMPORT-DUMP-${testname}-H5DFF PROPERTIES DEPENDS "H5IMPORT-DUMP-${testname}") ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (ADD_H5_DUMPTEST testname datasetname testfile) MACRO (ADD_H5_SKIP_DUMPTEST testname datasetname testfile) - ADD_TEST ( - NAME H5IMPORT-DUMP-${testname}-SKIPPED - COMMAND ${CMAKE_COMMAND} -E echo "SKIP ${testname} ${datasetname} ${testfile} --- DEFLATE filter not available" - ) + IF (NOT HDF5_ENABLE_USING_MEMCHECKER) + ADD_TEST ( + NAME H5IMPORT-DUMP-${testname}-SKIPPED + COMMAND ${CMAKE_COMMAND} -E echo "SKIP ${testname} ${datasetname} ${testfile} --- DEFLATE filter not available" + ) + ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (ADD_H5_SKIP_DUMPTEST testname datasetname testfile) # -------------------------------------------------------------------- @@ -283,27 +273,171 @@ IF (BUILD_TESTING) ############################################################################## ############################################################################## - # Remove any output file left over from previous test run - ADD_TEST ( - NAME H5IMPORT-clear-objects - COMMAND ${CMAKE_COMMAND} - -E remove - binfp64.bin - binin8.bin - binin8w.bin - binin16.bin - binin32.bin - binuin16.bin - binuin32.bin - ${HDF5_REFERENCE_TEST_FILES} - ) - SET (last_test "H5IMPORT-clear-objects") + IF (HDF5_ENABLE_USING_MEMCHECKER) + # Remove any output file left over from previous test run + ADD_TEST ( + NAME H5IMPORT-clear-objects + COMMAND ${CMAKE_COMMAND} + -E remove + binfp64.bin + binin8.bin + binin8w.bin + binin16.bin + binin32.bin + binuin16.bin + binuin32.bin + txtin32.h5 + txtin32.h5.new + txtin32.h5.new.err + txtin32.h5.out + txtin32.h5.out.err + txtin16.h5 + txtin16.h5.new + txtin16.h5.new.err + txtin16.h5.out + txtin16.h5.out.err + txtin8.h5 + txtin8.h5.new + txtin8.h5.new.err + txtin8.h5.out + txtin8.h5.out.err + txtuin16.h5 + txtuin16.h5.new + txtuin16.h5.new.err + txtuin16.h5.out + txtuin16.h5.out.err + txtuin32.h5 + txtuin32.h5.new + txtuin32.h5.new.err + txtuin32.h5.out + txtuin32.h5.out.err + txtfp32.h5 + txtfp32.h5.new + txtfp32.h5.new.err + txtfp32.h5.out + txtfp32.h5.out.err + txtfp64.h5 + txtfp64.h5.new + txtfp64.h5.new.err + txtfp64.h5.out + txtfp64.h5.out.err + binfp64.h5 + binfp64.h5.new + binfp64.h5.new.err + binfp64.h5.out + binfp64.h5.out.err + binin8.h5 + binin8.h5.new + binin8.h5.new.err + binin8.h5.out + binin8.h5.out.err + binin8w.h5 + binin8w.h5.new + binin8w.h5.new.err + binin8w.h5.out + binin8w.h5.out.err + binin16.h5 + binin16.h5.new + binin16.h5.new.err + binin16.h5.out + binin16.h5.out.err + binin32.h5 + binin32.h5.new + binin32.h5.new.err + binin32.h5.out + binin32.h5.out.err + binuin16.h5 + binuin16.h5.new + binuin16.h5.new.err + binuin16.h5.out + binuin16.h5.out.err + binuin32.h5 + binuin32.h5.new + binuin32.h5.new.err + binuin32.h5.out + binuin32.h5.out.err + txtstr.h5 + txtstr.h5.new + txtstr.h5.new.err + txtstr.h5.out + txtstr.h5.out.err + textpfe.h5 + textpfe.h5.new + textpfe.h5.new.err + textpfe.h5.out + textpfe.h5.out.err + dbinfp64.h5 + dbinfp64.h5.bin + dbinfp64.h5.imp + dbinfp64.h5.imp.err + dbinfp64.h5.dmp + dbinfp64.h5.dmp.err + dbinfp64.h5.dff + dbinfp64.h5.dff.err + dbinin8.h5 + dbinin8.h5.bin + dbinin8.h5.imp + dbinin8.h5.imp.err + dbinin8.h5.dmp + dbinin8.h5.dmp.err + dbinin8.h5.dff + dbinin8.h5.dff.err + dbinin8w.h5 + dbinin8w.h5.bin + dbinin8w.h5.imp + dbinin8w.h5.imp.err + dbinin8w.h5.dmp + dbinin8w.h5.dmp.err + dbinin8w.h5.dff + dbinin8w.h5.dff.err + dbinin16.h5 + dbinin16.h5.bin + dbinin16.h5.imp + dbinin16.h5.imp.err + dbinin16.h5.dmp + dbinin16.h5.dmp.err + dbinin16.h5.dff + dbinin16.h5.dff.err + dbinin32.h5 + dbinin32.h5.bin + dbinin32.h5.imp + dbinin32.h5.imp.err + dbinin32.h5.dmp + dbinin32.h5.dmp.err + dbinin32.h5.dff + dbinin32.h5.dff.err + dbinuin16.h5 + dbinuin16.h5.bin + dbinuin16.h5.imp + dbinuin16.h5.imp.err + dbinuin16.h5.dmp + dbinuin16.h5.dmp.err + dbinuin16.h5.dff + dbinuin16.h5.dff.err + dbinuin32.h5 + dbinuin32.h5.bin + dbinuin32.h5.imp + dbinuin32.h5.imp.err + dbinuin32.h5.dmp + dbinuin32.h5.dmp.err + dbinuin32.h5.dff + dbinuin32.h5.dff.err + dtxtstr.h5 + dtxtstr.h5.bin + dtxtstr.h5.imp + dtxtstr.h5.imp.err + dtxtstr.h5.dmp + dtxtstr.h5.dmp.err + dtxtstr.h5.dff + dtxtstr.h5.dff.err + ) + SET (last_test "H5IMPORT-clear-objects") + ENDIF (HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST (NAME H5IMPORT-h5importtest COMMAND $) IF (NOT "${last_test}" STREQUAL "") SET_TESTS_PROPERTIES (H5IMPORT-h5importtest PROPERTIES DEPENDS ${last_test}) ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "H5IMPORT-h5importtest") # ----- TESTING "ASCII I32 rank 3 - Output BE " ; ADD_H5_TEST (ASCII_I32 testfiles/txtin32.txt testfiles/txtin32.conf txtin32.h5) diff --git a/tools/h5import/Makefile.in b/tools/h5import/Makefile.in index 16e8901..9ad2341 100644 --- a/tools/h5import/Makefile.in +++ b/tools/h5import/Makefile.in @@ -234,6 +234,7 @@ H5_VERSION = @H5_VERSION@ HADDR_T = @HADDR_T@ HAVE_DMALLOC = @HAVE_DMALLOC@ HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@ +HAVE_PTHREAD = @HAVE_PTHREAD@ HDF5_HL = @HDF5_HL@ HDF5_INTERFACES = @HDF5_INTERFACES@ HDF_CXX = @HDF_CXX@ @@ -285,7 +286,6 @@ PACKAGE_VERSION = @PACKAGE_VERSION@ PARALLEL = @PARALLEL@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ -PTHREAD = @PTHREAD@ RANLIB = @RANLIB@ ROOT = @ROOT@ RUNPARALLEL = @RUNPARALLEL@ diff --git a/tools/h5jam/CMakeLists.txt b/tools/h5jam/CMakeLists.txt index 437fed3..95777b3 100644 --- a/tools/h5jam/CMakeLists.txt +++ b/tools/h5jam/CMakeLists.txt @@ -112,6 +112,13 @@ IF (BUILD_TESTING) ENDIF (NOT "${resultcode}" STREQUAL "0") ELSE (HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( + NAME H5JAM-${expectfile}-clear-objects + COMMAND ${CMAKE_COMMAND} + -E remove + ${expectfile}.out + ${expectfile}.out.err + ) + ADD_TEST ( NAME H5JAM-${expectfile} COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$" @@ -122,6 +129,7 @@ IF (BUILD_TESTING) -D "TEST_REFERENCE=testfiles/${expectfile}.txt" -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) + SET_TESTS_PROPERTIES (H5JAM-${expectfile} PROPERTIES DEPENDS H5JAM-${expectfile}-clear-objects) ENDIF (HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (TEST_H5JAM_OUTPUT) @@ -138,6 +146,13 @@ IF (BUILD_TESTING) ENDIF (NOT "${resultcode}" STREQUAL "0") ELSE (HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( + NAME H5JAM-UNJAM-${expectfile}-clear-objects + COMMAND ${CMAKE_COMMAND} + -E remove + ${expectfile}.out + ${expectfile}.out.err + ) + ADD_TEST ( NAME H5JAM-UNJAM-${expectfile} COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$" @@ -148,50 +163,38 @@ IF (BUILD_TESTING) -D "TEST_REFERENCE=testfiles/${expectfile}.txt" -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) + SET_TESTS_PROPERTIES (H5JAM-UNJAM-${expectfile} PROPERTIES DEPENDS H5JAM-UNJAM-${expectfile}-clear-objects) ENDIF (HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (TEST_H5UNJAM_OUTPUT) - MACRO (CLEANUP testname) - ADD_TEST ( - NAME H5JAM-CLEANUP-${testname}-clear-objects - COMMAND ${CMAKE_COMMAND} -E remove ${ARGN} - ) - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5JAM-CLEANUP-${testname}-clear-objects PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "H5JAM-CLEANUP-${testname}-clear-objects") - ENDMACRO(CLEANUP testname testfile) - - MACRO (CHECKFILE testname expected actual) + MACRO (CHECKFILE testname testdepends expected actual) # If using memchecker add tests without using scripts IF (NOT HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( - NAME H5JAM-CHECKFILE-${testname}-clear-objects + NAME H5JAM-${testname}-CHECKFILE-clear-objects COMMAND ${CMAKE_COMMAND} -E remove - ${expected}.new - ${expected}.new.err + ${actual}.new + ${actual}.new.err ${actual}.out ${actual}.out.err ) - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5JAM-CHECKFILE-${testname}-clear-objects PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") + SET_TESTS_PROPERTIES (H5JAM-${testname}-CHECKFILE-clear-objects PROPERTIES DEPENDS ${testdepends}) ADD_TEST ( - NAME H5JAM-CHECKFILE-H5DMP-${testname} + NAME H5JAM-${testname}-CHECKFILE-H5DMP COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$" -D "TEST_ARGS:STRING=testfiles/${expected}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" - -D "TEST_OUTPUT=${expected}.new" + -D "TEST_OUTPUT=${actual}.new" -D "TEST_EXPECT=0" -D "TEST_FILTER=(^(HDF5)[^\n]*)" -D "TEST_SKIP_COMPARE=TRUE" -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) - SET_TESTS_PROPERTIES (H5JAM-CHECKFILE-H5DMP-${testname} PROPERTIES DEPENDS H5JAM-CHECKFILE-${testname}-clear-objects) + SET_TESTS_PROPERTIES (H5JAM-${testname}-CHECKFILE-H5DMP PROPERTIES DEPENDS H5JAM-${testname}-CHECKFILE-clear-objects) ADD_TEST ( - NAME H5JAM-CHECKFILE-H5DMP_CMP-${testname} + NAME H5JAM-${testname}-CHECKFILE-H5DMP_CMP COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$" -D "TEST_ARGS:STRING=${actual}" @@ -199,168 +202,210 @@ IF (BUILD_TESTING) -D "TEST_OUTPUT=${actual}.out" -D "TEST_EXPECT=0" -D "TEST_FILTER=(^(HDF5)[^\n]*)" - -D "TEST_REFERENCE=${expected}.new" + -D "TEST_REFERENCE=${actual}.new" -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) - SET_TESTS_PROPERTIES (H5JAM-CHECKFILE-H5DMP_CMP-${testname} PROPERTIES DEPENDS H5JAM-CHECKFILE-H5DMP-${testname}) - SET (last_test "H5JAM-CHECKFILE-H5DMP_CMP-${testname}") + SET_TESTS_PROPERTIES (H5JAM-${testname}-CHECKFILE-H5DMP_CMP PROPERTIES DEPENDS H5JAM-${testname}-CHECKFILE-H5DMP) ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) - ENDMACRO(CHECKFILE testname expected actual) - - MACRO (SETUP testname infile outfile) - ADD_TEST ( - NAME H5JAM-SETUP-${testname}-clear-objects - COMMAND ${CMAKE_COMMAND} -E remove ${outfile} - ) - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5JAM-SETUP-${testname}-clear-objects PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - ADD_TEST ( - NAME H5JAM-SETUP-${testname} - COMMAND ${CMAKE_COMMAND} -E copy_if_different ${HDF5_TOOLS_H5JAM_SOURCE_DIR}/testfiles/${infile} ${PROJECT_BINARY_DIR}/${outfile} - ) - SET_TESTS_PROPERTIES (H5JAM-SETUP-${testname} PROPERTIES DEPENDS H5JAM-SETUP-${testname}-clear-objects) - SET (last_test "H5JAM-SETUP-${testname}") - ENDMACRO(SETUP testname infile outfile) + ENDMACRO(CHECKFILE testname testdepends expected actual) - MACRO (CHECK_UB_1 testname testfile ufile) + MACRO (UNJAMTEST testname setfile infile ufile chkfile outfile) IF (NOT HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( - NAME H5JAM-CHECK_UB_1-${testname}-clear-objects - COMMAND ${CMAKE_COMMAND} - -E remove - ${testfile}.len.txt - ${testfile}.cmp - ${ufile}.cmp + NAME H5JAM-${testname}-UNJAM-SETUP-clear-objects + COMMAND ${CMAKE_COMMAND} -E remove ${infile} + ) + ADD_TEST ( + NAME H5JAM-${testname}-UNJAM-SETUP + COMMAND ${CMAKE_COMMAND} -E copy_if_different ${HDF5_TOOLS_H5JAM_SOURCE_DIR}/testfiles/${setfile} ${PROJECT_BINARY_DIR}/${infile} + ) + SET_TESTS_PROPERTIES (H5JAM-${testname}-UNJAM-SETUP PROPERTIES DEPENDS H5JAM-${testname}-UNJAM-SETUP-clear-objects) + ADD_TEST ( + NAME H5JAM-${testname}-UNJAM-clear-objects + COMMAND ${CMAKE_COMMAND} -E remove ${outfile} ) - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5JAM-CHECK_UB_1-${testname}-clear-objects PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") + SET_TESTS_PROPERTIES (H5JAM-${testname}-UNJAM-clear-objects PROPERTIES DEPENDS H5JAM-${testname}-UNJAM-SETUP) + IF (NOT "${ufile}" STREQUAL "NONE") + ADD_TEST ( + NAME H5JAM-${testname}-UNJAM_D-clear-objects + COMMAND ${CMAKE_COMMAND} -E remove ${ufile} + ) + SET_TESTS_PROPERTIES (H5JAM-${testname}-UNJAM_D-clear-objects PROPERTIES DEPENDS H5JAM-${testname}-UNJAM-clear-objects) + ADD_TEST (NAME H5JAM-${testname}-UNJAM COMMAND $ -i ${infile} -u ${ufile} -o ${outfile}) + SET_TESTS_PROPERTIES (H5JAM-${testname}-UNJAM PROPERTIES DEPENDS H5JAM-${testname}-UNJAM_D-clear-objects) + SET (compare_test ${ufile}) + ELSE (NOT "${ufile}" STREQUAL "NONE") + IF (NOT "${ARGN}" STREQUAL "--delete") + ADD_TEST ( + NAME H5JAM-${testname}-UNJAM_D-clear-objects + COMMAND ${CMAKE_COMMAND} -E remove ${outfile}.ufile.txt ${outfile}.ufile.txt.err + ) + SET_TESTS_PROPERTIES (H5JAM-${testname}-UNJAM_D-clear-objects PROPERTIES DEPENDS H5JAM-${testname}-UNJAM-clear-objects) + ADD_TEST ( + NAME H5JAM-${testname}-UNJAM + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=-i;${infile};-o;${outfile}" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -D "TEST_OUTPUT=${outfile}.ufile.txt" + -D "TEST_EXPECT=0" + -D "TEST_SKIP_COMPARE=TRUE" + -P "${HDF5_RESOURCES_DIR}/runTest.cmake" + ) + SET_TESTS_PROPERTIES (H5JAM-${testname}-UNJAM PROPERTIES DEPENDS H5JAM-${testname}-UNJAM_D-clear-objects) + SET (compare_test "${outfile}.ufile.txt") + ELSE (NOT "${ARGN}" STREQUAL "--delete") + ADD_TEST (NAME H5JAM-${testname}-UNJAM COMMAND $ -i ${infile} -o ${outfile}) + SET_TESTS_PROPERTIES (H5JAM-${testname}-UNJAM PROPERTIES DEPENDS H5JAM-${testname}-UNJAM-clear-objects) + SET (compare_test "") + ENDIF (NOT "${ARGN}" STREQUAL "--delete") + ENDIF (NOT "${ufile}" STREQUAL "NONE") + IF (NOT "${compare_test}" STREQUAL "") + ADD_TEST ( + NAME H5JAM-${testname}-UNJAM-CHECK_UB_1-clear-objects + COMMAND ${CMAKE_COMMAND} + -E remove + ${infile}.len.txt + ${infile}.cmp + ${infile}-ub.cmp + ) + SET_TESTS_PROPERTIES (H5JAM-${testname}-UNJAM-CHECK_UB_1-clear-objects PROPERTIES DEPENDS "H5JAM-${testname}-UNJAM") + ADD_TEST ( + NAME H5JAM-${testname}-UNJAM-CHECK_UB_1 + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_GET_PROGRAM=$" + -D "TEST_CHECKUB=YES" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -D "TEST_HFILE=${infile}" + -D "TEST_UFILE=${compare_test}" + -D "TEST_EXPECT=0" + -D "TEST_OFILE=" + -P "${HDF5_RESOURCES_DIR}/userblockTest.cmake" + ) + SET_TESTS_PROPERTIES (H5JAM-${testname}-UNJAM-CHECK_UB_1 PROPERTIES DEPENDS H5JAM-${testname}-UNJAM-CHECK_UB_1-clear-objects) + ENDIF (NOT "${compare_test}" STREQUAL "") + ADD_TEST ( - NAME H5JAM-CHECK_UB_1-${testname} + NAME H5JAM-${testname}-UNJAM-CHECK_NOUB COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$" -D "TEST_GET_PROGRAM=$" - -D "TEST_CHECKUB=YES" + -D "TEST_CHECKUB=NO" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" - -D "TEST_HFILE=${testfile}" - -D "TEST_UFILE=${ufile}" + -D "TEST_HFILE=${outfile}" -D "TEST_EXPECT=0" - -D "TEST_OFILE=${ARGN}" + -D "TEST_UFILE=NULL" + -D "TEST_OFILE=NULL" -P "${HDF5_RESOURCES_DIR}/userblockTest.cmake" ) - SET_TESTS_PROPERTIES (H5JAM-CHECK_UB_1-${testname} PROPERTIES DEPENDS H5JAM-CHECK_UB_1-${testname}-clear-objects) - SET (last_test "H5JAM-CHECK_UB_1-${testname}") + IF (NOT "${compare_test}" STREQUAL "") + SET_TESTS_PROPERTIES (H5JAM-${testname}-UNJAM-CHECK_NOUB PROPERTIES DEPENDS H5JAM-${testname}-UNJAM-CHECK_UB_1) + ELSE (NOT "${compare_test}" STREQUAL "") + SET_TESTS_PROPERTIES (H5JAM-${testname}-UNJAM-CHECK_NOUB PROPERTIES DEPENDS H5JAM-${testname}-UNJAM) + ENDIF (NOT "${compare_test}" STREQUAL "") + + CHECKFILE (${testname} "H5JAM-${testname}-UNJAM-CHECK_NOUB" ${chkfile} ${outfile}) ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) - ENDMACRO(CHECK_UB_1 testname testfile ufile) + ENDMACRO(UNJAMTEST testname infile ufile outfile) - MACRO (CHECK_NOUB testname testfile) + MACRO (JAMTEST testname jamfile infile chkfile outfile) IF (NOT HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( - NAME H5JAM-CHECK_NOUB-${testname} + NAME H5JAM-${testname}-clear-objects + COMMAND ${CMAKE_COMMAND} -E remove ${outfile} ${infile}.cpy.h5 + ) + ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) + ADD_TEST (NAME H5JAM-${testname} COMMAND $ -u testfiles/${jamfile} -i testfiles/${infile} -o ${outfile} ${ARGN}) + IF (NOT HDF5_ENABLE_USING_MEMCHECKER) + SET_TESTS_PROPERTIES (H5JAM-${testname} PROPERTIES DEPENDS H5JAM-${testname}-clear-objects) + SET (compare_test ${outfile}) + SET (compare_orig testfiles/${infile}) + IF ("${ARGN}" STREQUAL "--clobber") + SET (compare_orig "") + ENDIF ("${ARGN}" STREQUAL "--clobber") + + ADD_TEST ( + NAME H5JAM-${testname}-CHECK_UB_1-clear-objects + COMMAND ${CMAKE_COMMAND} + -E remove + ${compare_test}.len.txt + ${compare_test}.cmp + ${compare_test}-ub.cmp + ) + SET_TESTS_PROPERTIES (H5JAM-${testname}-CHECK_UB_1-clear-objects PROPERTIES DEPENDS "H5JAM-${testname}") + ADD_TEST ( + NAME H5JAM-${testname}-CHECK_UB_1 COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$" -D "TEST_GET_PROGRAM=$" - -D "TEST_CHECKUB=NO" + -D "TEST_CHECKUB=YES" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" - -D "TEST_HFILE=${testfile}" + -D "TEST_HFILE=${compare_test}" + -D "TEST_UFILE=testfiles/${jamfile}" -D "TEST_EXPECT=0" - -D "TEST_UFILE=NULL" - -D "TEST_OFILE=NULL" + -D "TEST_OFILE=${compare_orig}" -P "${HDF5_RESOURCES_DIR}/userblockTest.cmake" ) - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5JAM-CHECK_NOUB-${testname} PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "H5JAM-CHECK_NOUB-${testname}") + SET_TESTS_PROPERTIES (H5JAM-${testname}-CHECK_UB_1 PROPERTIES DEPENDS H5JAM-${testname}-CHECK_UB_1-clear-objects) + CHECKFILE (${testname} "H5JAM-${testname}-CHECK_UB_1" ${chkfile} ${outfile}) ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) - ENDMACRO(CHECK_NOUB testname testfile) + ENDMACRO (JAMTEST testname jamfile infile outfile) - MACRO (UNJAMTEST testname infile ufile outfile) - ADD_TEST ( - NAME H5JAM-UNJAM-${testname}-clear-objects - COMMAND ${CMAKE_COMMAND} -E remove ${outfile} - ) - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5JAM-UNJAM-${testname}-clear-objects PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - IF (NOT "${ufile}" STREQUAL "NONE") + MACRO (JAMTEST_NONE testname jamfile infile setfile chkfile) + IF (NOT HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( - NAME H5JAM-UNJAM_D-${testname}-clear-objects - COMMAND ${CMAKE_COMMAND} -E remove ${ufile} + NAME H5JAM-${testname}_NONE-clear-objects + COMMAND ${CMAKE_COMMAND} -E remove + ${chkfile} ${chkfile}.cpy.h5 ) - SET_TESTS_PROPERTIES (H5JAM-UNJAM_D-${testname}-clear-objects PROPERTIES DEPENDS H5JAM-UNJAM-${testname}-clear-objects) - ADD_TEST (NAME H5JAM-UNJAM-${testname} COMMAND $ -i ${infile} -u ${ufile} -o ${outfile}) - SET_TESTS_PROPERTIES (H5JAM-UNJAM-${testname} PROPERTIES DEPENDS H5JAM-UNJAM_D-${testname}-clear-objects) - SET (compare_test ${ufile}) - ELSE (NOT "${ufile}" STREQUAL "NONE") - IF (NOT "${ARGN}" STREQUAL "--delete") - ADD_TEST ( - NAME H5JAM-UNJAM_D-${testname}-clear-objects - COMMAND ${CMAKE_COMMAND} -E remove ${outfile}.ufile.txt ${outfile}.ufile.txt.err - ) - SET_TESTS_PROPERTIES (H5JAM-UNJAM_D-${testname}-clear-objects PROPERTIES DEPENDS H5JAM-UNJAM-${testname}-clear-objects) - IF (HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST (NAME H5JAM-UNJAM-${testname} COMMAND $ -i ${infile} -o ${outfile}) - ELSE (HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( - NAME H5JAM-UNJAM-${testname} - COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$" - -D "TEST_ARGS:STRING=-i;${infile};-o;${outfile}" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" - -D "TEST_OUTPUT=${outfile}.ufile.txt" - -D "TEST_EXPECT=0" - -D "TEST_SKIP_COMPARE=TRUE" - -P "${HDF5_RESOURCES_DIR}/runTest.cmake" - ) - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) - SET_TESTS_PROPERTIES (H5JAM-UNJAM-${testname} PROPERTIES DEPENDS H5JAM-UNJAM_D-${testname}-clear-objects) - SET (compare_test "${outfile}.ufile.txt") - ELSE (NOT "${ARGN}" STREQUAL "--delete") - ADD_TEST (NAME H5JAM-UNJAM-${testname} COMMAND $ -i ${infile} -o ${outfile}) - SET_TESTS_PROPERTIES (H5JAM-UNJAM-${testname} PROPERTIES DEPENDS H5JAM-UNJAM-${testname}-clear-objects) - SET (compare_test "") - ENDIF (NOT "${ARGN}" STREQUAL "--delete") - ENDIF (NOT "${ufile}" STREQUAL "NONE") - SET (last_test "H5JAM-UNJAM-${testname}") - IF (NOT "${compare_test}" STREQUAL "") - CHECK_UB_1 (${testname} ${infile} ${compare_test}) - ENDIF (NOT "${compare_test}" STREQUAL "") - CHECK_NOUB (${testname} ${outfile}) - ENDMACRO(UNJAMTEST testname infile ufile outfile) + ADD_TEST ( + NAME H5JAM-${testname}_NONE-SETUP + COMMAND ${CMAKE_COMMAND} -E copy_if_different testfiles/${setfile} ${chkfile} + ) + SET_TESTS_PROPERTIES (H5JAM-${testname}_NONE-SETUP PROPERTIES DEPENDS H5JAM-${testname}_NONE-clear-objects) - MACRO (JAMTEST testname jamfile infile outfile) - ADD_TEST ( - NAME H5JAM-${testname}-clear-objects - COMMAND ${CMAKE_COMMAND} -E remove ${outfile} ${infile}.cpy.h5 - ) - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5JAM-${testname}-clear-objects PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "H5JAM-${testname}-clear-objects") - IF ("${outfile}" STREQUAL "NONE") ADD_TEST ( - NAME H5JAM-NONE_COPY-${testname} - COMMAND ${CMAKE_COMMAND} -E copy_if_different ${infile} ${infile}.cpy.h5 + NAME H5JAM-${testname}_NONE_COPY + COMMAND ${CMAKE_COMMAND} -E copy_if_different ${chkfile} ${chkfile}.cpy.h5 ) - SET_TESTS_PROPERTIES (H5JAM-NONE_COPY-${testname} PROPERTIES DEPENDS ${last_test}) - SET (last_test "H5JAM-NONE_COPY-${testname}") - ADD_TEST (NAME H5JAM-${testname} COMMAND $ -u testfiles/${jamfile} -i ${infile} ${ARGN}) - SET (compare_test ${infile}) - SET (compare_orig ${infile}.cpy.h5) - ELSE ("${outfile}" STREQUAL "NONE") - ADD_TEST (NAME H5JAM-${testname} COMMAND $ -u testfiles/${jamfile} -i testfiles/${infile} -o ${outfile} ${ARGN}) - SET (compare_test ${outfile}) - SET (compare_orig testfiles/${infile}) - ENDIF ("${outfile}" STREQUAL "NONE") - SET_TESTS_PROPERTIES (H5JAM-${testname} PROPERTIES DEPENDS ${last_test}) - SET (last_test "H5JAM-${testname}") - IF ("${ARGN}" STREQUAL "--clobber") - SET (compare_orig "") - ENDIF ("${ARGN}" STREQUAL "--clobber") - CHECK_UB_1 (${testname} ${compare_test} testfiles/${jamfile} ${compare_orig}) - ENDMACRO (JAMTEST testname jamfile infile outfile) + SET_TESTS_PROPERTIES (H5JAM-${testname}_NONE_COPY PROPERTIES DEPENDS H5JAM-${testname}_NONE-SETUP) + + ADD_TEST (NAME H5JAM-${testname}_NONE COMMAND $ -u testfiles/${jamfile} -i ${chkfile} ${ARGN}) + SET_TESTS_PROPERTIES (H5JAM-${testname}_NONE PROPERTIES DEPENDS H5JAM-${testname}_NONE_COPY) + + SET (compare_test ${chkfile}) + SET (compare_orig ${chkfile}.cpy.h5) + IF ("${ARGN}" STREQUAL "--clobber") + SET (compare_orig "") + ENDIF ("${ARGN}" STREQUAL "--clobber") + + ADD_TEST ( + NAME H5JAM-${testname}_NONE-CHECK_UB_1-clear-objects + COMMAND ${CMAKE_COMMAND} + -E remove + ${compare_test}.len.txt + ${compare_test}.cmp + ${compare_test}-ub.cmp + ) + SET_TESTS_PROPERTIES (H5JAM-${testname}_NONE-CHECK_UB_1-clear-objects PROPERTIES DEPENDS "H5JAM-${testname}_NONE") + ADD_TEST ( + NAME H5JAM-${testname}_NONE-CHECK_UB_1 + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_GET_PROGRAM=$" + -D "TEST_CHECKUB=YES" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -D "TEST_HFILE=${compare_test}" + -D "TEST_UFILE=testfiles/${jamfile}" + -D "TEST_EXPECT=0" + -D "TEST_OFILE=${compare_orig}" + -P "${HDF5_RESOURCES_DIR}/userblockTest.cmake" + ) + SET_TESTS_PROPERTIES (H5JAM-${testname}_NONE-CHECK_UB_1 PROPERTIES DEPENDS H5JAM-${testname}_NONE-CHECK_UB_1-clear-objects) + CHECKFILE (${testname} "H5JAM-${testname}_NONE-CHECK_UB_1" ${infile} ${chkfile}) + ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) + ENDMACRO (JAMTEST_NONE testname jamfile infile setfile chkfile) ############################################################################## ############################################################################## @@ -377,118 +422,45 @@ IF (BUILD_TESTING) # don't allow HDF5 format file as an user block file TEST_H5JAM_OUTPUT(h5jam-ub-nohdf5 1 -i testfiles/tall.h5 -u testfiles/tall.h5 -o tall-tmp.h5) - JAMTEST (tall_u10 u10.txt tall.h5 ta2.h5) - CHECKFILE (tall_u10 tall.h5 ta2.h5) -# CLEANUP (tall_u10 ta2.h5) - JAMTEST (tall_u511 u511.txt tall.h5 ta3.h5) - CHECKFILE (tall_u511 tall.h5 ta3.h5) -# CLEANUP (tall_u511 ta3.h5) - JAMTEST (tall_u512 u512.txt tall.h5 ta4.h5) - CHECKFILE (tall_u512 tall.h5 ta4.h5) -# CLEANUP (tall_u512 ta4.h5) - JAMTEST (tall_u513 u513.txt tall.h5 ta5.h5) - CHECKFILE (tall_u513 tall.h5 ta5.h5) -# CLEANUP (tall_u513 ta5.h5) - - SETUP (ta_u10 tall.h5 ta.h5) - JAMTEST (ta_u10 u10.txt ta.h5 NONE) - CHECKFILE (ta_u10 tall.h5 ta.h5) - SETUP (ta_u511 tall.h5 ta.h5 NOCLEAN) - JAMTEST (ta_u511 u511.txt ta.h5 NONE) - CHECKFILE (ta_u511 tall.h5 ta.h5) - SETUP (ta_u512 tall.h5 ta.h5 NOCLEAN) - JAMTEST (ta_u512 u512.txt ta.h5 NONE) - CHECKFILE (ta_u512 tall.h5 ta.h5) - SETUP (ta_u513 tall.h5 ta.h5 NOCLEAN) - JAMTEST (ta_u513 u513.txt ta.h5 NONE) - CHECKFILE (ta_u513 tall.h5 ta.h5) -# CLEANUP (ta ta.h5) - - JAMTEST (twithub_u10 u10.txt twithub.h5 tax2.h5) - CHECKFILE (twithub_u10 tall.h5 tax2.h5) -# CLEANUP (twithub_u10 tax2.h5) - JAMTEST (twithub_u511 u511.txt twithub.h5 tax3.h5) - CHECKFILE (twithub_u511 tall.h5 tax3.h5) -# CLEANUP (twithub_u511 tax3.h5) - JAMTEST (twithub_u512 u512.txt twithub.h5 tax4.h5) - CHECKFILE (twithub_u512 tall.h5 tax4.h5) -# CLEANUP (twithub_u512 tax4.h5) - JAMTEST (twithub_u513 u513.txt twithub.h5 tax5.h5) - CHECKFILE (twithub_u513 tall.h5 tax5.h5) -# CLEANUP (twithub_u513 tax5.h5) - - JAMTEST (twithub513_u10 u10.txt twithub513.h5 tax6.h5) - CHECKFILE (twithub513_u10 tall.h5 tax6.h5) -# CLEANUP (twithub513_u10 tax6.h5) - JAMTEST (twithub513_u511 u511.txt twithub513.h5 tax7.h5) - CHECKFILE (twithub513_u511 tall.h5 tax7.h5) -# CLEANUP (twithub513_u511 tax7.h5) - JAMTEST (twithub513_u512 u512.txt twithub513.h5 tax8.h5) - CHECKFILE (twithub513_u512 tall.h5 tax8.h5) -# CLEANUP (twithub513_u512 tax8.h5) - JAMTEST (twithub513_u513 u513.txt twithub513.h5 tax9.h5) - CHECKFILE (twithub513_u513 tall.h5 tax9.h5) -# CLEANUP (twithub513_u513 tax9.h5) - - JAMTEST (twithub_u10_c u10.txt twithub.h5 taz2.h5 --clobber) - CHECKFILE (twithub_u10_c tall.h5 taz2.h5) -# CLEANUP (twithub_u10_c taz2.h5) - JAMTEST (twithub_u511_c u511.txt twithub.h5 taz3.h5 --clobber) - CHECKFILE (twithub_u511_c tall.h5 taz3.h5) -# CLEANUP (twithub_u511_c taz3.h5) - JAMTEST (twithub_u512_c u512.txt twithub.h5 taz4.h5 --clobber) - CHECKFILE (twithub_u512_c tall.h5 taz4.h5) -# CLEANUP (twithub_u512_c taz4.h5) - JAMTEST (twithub_u513_c u513.txt twithub.h5 taz5.h5 --clobber) - CHECKFILE (twithub_u513_c tall.h5 taz5.h5) -# CLEANUP (twithub_u513_c taz5.h5) - - JAMTEST (twithub513_u10_c u10.txt twithub513.h5 taz6.h5 --clobber) - CHECKFILE (twithub513_u10_c tall.h5 taz6.h5) -# CLEANUP (twithub513_u10_c taz6.h5) - JAMTEST (twithub513_u511_c u511.txt twithub513.h5 taz7.h5 --clobber) - CHECKFILE (twithub513_u511_c tall.h5 taz7.h5) -# CLEANUP (twithub513_u511_c taz7.h5) - JAMTEST (twithub513_u512_c u512.txt twithub513.h5 taz8.h5 --clobber) - CHECKFILE (twithub513_u512_c tall.h5 taz8.h5) -# CLEANUP (twithub513_u512_c taz8.h5) - JAMTEST (twithub513_u513_c u513.txt twithub513.h5 taz9.h5 --clobber) - CHECKFILE (twithub513_u513_c tall.h5 taz9.h5) -# CLEANUP (twithub513_u513_c taz9.h5) - - SETUP (N_twithub_u10_c twithub.h5 tay2.h5) - JAMTEST (N_twithub_u10_c u10.txt tay2.h5 NONE --clobber) - CHECKFILE (N_twithub_u10_c tall.h5 tay2.h5) -# CLEANUP (N_twithub_u10_c tay2.h5) - SETUP (N_twithub_u511_c twithub.h5 tay3.h5) - JAMTEST (N_twithub_u511_c u511.txt tay3.h5 NONE --clobber) - CHECKFILE (N_twithub_u511_c tall.h5 tay3.h5) -# CLEANUP (N_twithub_u511_c tay3.h5) - SETUP (N_twithub_u512_c twithub.h5 tay4.h5) - JAMTEST (N_twithub_u512_c u512.txt tay4.h5 NONE --clobber) - CHECKFILE (N_twithub_u512_c tall.h5 tay4.h5) -# CLEANUP (N_twithub_u512_c tay4.h5) - SETUP (N_twithub_u513_c twithub.h5 tay5.h5) - JAMTEST (N_twithub_u513_c u513.txt tay5.h5 NONE --clobber) - CHECKFILE (N_twithub_u513_c tall.h5 tay5.h5) -# CLEANUP (N_twithub_u513_c tay5.h5) - - SETUP (N_twithub513_u10_c twithub513.h5 tay6.h5) - JAMTEST (N_twithub513_u10_c u10.txt tay6.h5 NONE --clobber) - CHECKFILE (N_twithub513_u10_c tall.h5 tay6.h5) -# CLEANUP (N_twithub513_u10_c tay6.h5) - SETUP (N_twithub513_u511_c twithub513.h5 tay7.h5) - JAMTEST (N_twithub513_u511_c u511.txt tay7.h5 NONE --clobber) - CHECKFILE (N_twithub513_u511_c tall.h5 tay7.h5) -# CLEANUP (N_twithub513_u511_c tay7.h5) - SETUP (N_twithub513_u512_c twithub513.h5 tay8.h5) - JAMTEST (N_twithub513_u512_c u512.txt tay8.h5 NONE --clobber) - CHECKFILE (N_twithub513_u512_c tall.h5 tay8.h5) -# CLEANUP (N_twithub513_u512_c tay8.h5) - SETUP (N_twithub513_u513_c twithub513.h5 tay9.h5) - JAMTEST (N_twithub513_u513_c u513.txt tay9.h5 NONE --clobber) - CHECKFILE (N_twithub513_u513_c tall.h5 tay9.h5) -# CLEANUP (N_twithub513_u513_c tay9.h5) + JAMTEST (tall_u10 u10.txt tall.h5 tall.h5 ta2.h5) + JAMTEST (tall_u511 u511.txt tall.h5 tall.h5 ta3.h5) + JAMTEST (tall_u512 u512.txt tall.h5 tall.h5 ta4.h5) + JAMTEST (tall_u513 u513.txt tall.h5 tall.h5 ta5.h5) + + JAMTEST_NONE (N_ta_u10 u10.txt tall.h5 tall.h5 ta6.h5) + JAMTEST_NONE (N_ta_u511 u511.txt tall.h5 tall.h5 ta7.h5) + JAMTEST_NONE (N_ta_u512 u512.txt tall.h5 tall.h5 ta8.h5) + JAMTEST_NONE (N_ta_u513 u513.txt tall.h5 tall.h5 ta9.h5) + + JAMTEST (twithub_u10 u10.txt twithub.h5 tall.h5 tax2.h5) + JAMTEST (twithub_u511 u511.txt twithub.h5 tall.h5 tax3.h5) + JAMTEST (twithub_u512 u512.txt twithub.h5 tall.h5 tax4.h5) + JAMTEST (twithub_u513 u513.txt twithub.h5 tall.h5 tax5.h5) + + JAMTEST (twithub513_u10 u10.txt twithub513.h5 tall.h5 tax6.h5) + JAMTEST (twithub513_u511 u511.txt twithub513.h5 tall.h5 tax7.h5) + JAMTEST (twithub513_u512 u512.txt twithub513.h5 tall.h5 tax8.h5) + JAMTEST (twithub513_u513 u513.txt twithub513.h5 tall.h5 tax9.h5) + + JAMTEST (twithub_u10_c u10.txt twithub.h5 tall.h5 taz2.h5 --clobber) + JAMTEST (twithub_u511_c u511.txt twithub.h5 tall.h5 taz3.h5 --clobber) + JAMTEST (twithub_u512_c u512.txt twithub.h5 tall.h5 taz4.h5 --clobber) + JAMTEST (twithub_u513_c u513.txt twithub.h5 tall.h5 taz5.h5 --clobber) + + JAMTEST (twithub513_u10_c u10.txt twithub513.h5 tall.h5 taz6.h5 --clobber) + JAMTEST (twithub513_u511_c u511.txt twithub513.h5 tall.h5 taz7.h5 --clobber) + JAMTEST (twithub513_u512_c u512.txt twithub513.h5 tall.h5 taz8.h5 --clobber) + JAMTEST (twithub513_u513_c u513.txt twithub513.h5 tall.h5 taz9.h5 --clobber) + + JAMTEST_NONE (N_twithub_u10_c u10.txt tall.h5 twithub.h5 tay2.h5 --clobber) + JAMTEST_NONE (N_twithub_u511_c u511.txt tall.h5 twithub.h5 tay3.h5 --clobber) + JAMTEST_NONE (N_twithub_u512_c u512.txt tall.h5 twithub.h5 tay4.h5 --clobber) + JAMTEST_NONE (N_twithub_u513_c u513.txt tall.h5 twithub.h5 tay5.h5 --clobber) + + JAMTEST_NONE (N_twithub513_u10_c u10.txt tall.h5 twithub513.h5 tay6.h5 --clobber) + JAMTEST_NONE (N_twithub513_u511_c u511.txt tall.h5 twithub513.h5 tay7.h5 --clobber) + JAMTEST_NONE (N_twithub513_u512_c u512.txt tall.h5 twithub513.h5 tay8.h5 --clobber) + JAMTEST_NONE (N_twithub513_u513_c u513.txt tall.h5 twithub513.h5 tay9.h5 --clobber) #------------------------------- # Testing h5unjam @@ -496,32 +468,14 @@ IF (BUILD_TESTING) # help page TEST_H5UNJAM_OUTPUT(h5unjam-help 0 -h) - SETUP (twithub_tall twithub.h5 tai1.h5) - UNJAMTEST (twithub_tall tai1.h5 o10.txt taa1.h5) - CHECKFILE (twithub_tall tall.h5 taa1.h5) -# CLEANUP (twithub_tall taa1.h5 tai1.h5 o10.txt) - SETUP (twithub513_tall twithub513.h5 tai2.h5) - UNJAMTEST (twithub513_tall tai2.h5 o512.txt taa2.h5) - CHECKFILE (twithub513_tall tall.h5 taa2.h5) -# CLEANUP (twithub513_tall taa2.h5 tai2.h5 o512.txt) - - SETUP (N_twithub_tall twithub.h5 tai3.h5) - UNJAMTEST (N_twithub_tall tai3.h5 NONE taa3.h5) - CHECKFILE (N_twithub_tall tall.h5 taa3.h5) -# CLEANUP (N_twithub_tall taa3.h5 tai3.h5) - SETUP (N_twithub513_tall twithub513.h5 tai4.h5) - UNJAMTEST (N_twithub513_tall tai4.h5 NONE taa4.h5) - CHECKFILE (N_twithub513_tall tall.h5 taa4.h5) -# CLEANUP (N_twithub513_tall taa4.h5 tai4.h5) - - SETUP (D_twithub_tall twithub.h5 taj2.h5) - UNJAMTEST (D_twithub_tall taj2.h5 NONE tac2.h5 --delete) - CHECKFILE (D_twithub_tall tall.h5 tac2.h5) -# CLEANUP (D_twithub_tall tac2.h5 taj2.h5) - SETUP (D_twithub513_tall twithub513.h5 taj3.h5) - UNJAMTEST (D_twithub513_tall taj3.h5 NONE tac3.h5 --delete) - CHECKFILE (D_twithub513_tall tall.h5 tac3.h5) -# CLEANUP (D_twithub513_tall tac3.h5 taj3.h5) + UNJAMTEST (twithub_tall twithub.h5 tai1.h5 o10.txt tall.h5 taa1.h5) + UNJAMTEST (twithub513_tall twithub513.h5 tai2.h5 o512.txt tall.h5 taa2.h5) + + UNJAMTEST (N_twithub_tall twithub.h5 tai3.h5 NONE tall.h5 taa3.h5) + UNJAMTEST (N_twithub513_tall twithub513.h5 tai4.h5 NONE tall.h5 taa4.h5) + + UNJAMTEST (D_twithub_tall twithub.h5 taj2.h5 NONE tall.h5 tac2.h5 --delete) + UNJAMTEST (D_twithub513_tall twithub513.h5 taj3.h5 NONE tall.h5 tac3.h5 --delete) ENDIF (BUILD_TESTING) diff --git a/tools/h5jam/Makefile.in b/tools/h5jam/Makefile.in index ff8b089..fd170fd 100644 --- a/tools/h5jam/Makefile.in +++ b/tools/h5jam/Makefile.in @@ -248,6 +248,7 @@ H5_VERSION = @H5_VERSION@ HADDR_T = @HADDR_T@ HAVE_DMALLOC = @HAVE_DMALLOC@ HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@ +HAVE_PTHREAD = @HAVE_PTHREAD@ HDF5_HL = @HDF5_HL@ HDF5_INTERFACES = @HDF5_INTERFACES@ HDF_CXX = @HDF_CXX@ @@ -299,7 +300,6 @@ PACKAGE_VERSION = @PACKAGE_VERSION@ PARALLEL = @PARALLEL@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ -PTHREAD = @PTHREAD@ RANLIB = @RANLIB@ ROOT = @ROOT@ RUNPARALLEL = @RUNPARALLEL@ diff --git a/tools/h5jam/testh5jam.sh.in b/tools/h5jam/testh5jam.sh.in index b2c6bec..86edbee 100644 --- a/tools/h5jam/testh5jam.sh.in +++ b/tools/h5jam/testh5jam.sh.in @@ -377,7 +377,7 @@ JAMTEST() { compare_orig="xxofile.h5" cleanup="$cleanup $compare_orig" else - # output goes to $4, compare ofile to ubfile + # output goes to $3, compare ofile to ubfile ofile="$3" compare_test="$ofile" compare_orig="$ifile" @@ -539,19 +539,22 @@ JAMTEST $TESTDIR/u513.txt $TESTDIR/tall.h5 ta5.h5 CHECKFILE $TESTDIR/tall.h5 ta5.h5 CLEANUP ta5.h5 -SETUP $TESTDIR/tall.h5 ta.h5 -JAMTEST $TESTDIR/u10.txt ta.h5 -CHECKFILE $TESTDIR/tall.h5 ta.h5 -SETUP $TESTDIR/tall.h5 ta.h5 -JAMTEST $TESTDIR/u511.txt ta.h5 -CHECKFILE $TESTDIR/tall.h5 ta.h5 -SETUP $TESTDIR/tall.h5 ta.h5 -JAMTEST $TESTDIR/u512.txt ta.h5 -CHECKFILE $TESTDIR/tall.h5 ta.h5 -SETUP $TESTDIR/tall.h5 ta.h5 -JAMTEST $TESTDIR/u513.txt ta.h5 -CHECKFILE $TESTDIR/tall.h5 ta.h5 -CLEANUP ta.h5 +SETUP $TESTDIR/tall.h5 ta6.h5 +JAMTEST $TESTDIR/u10.txt ta6.h5 +CHECKFILE $TESTDIR/tall.h5 ta6.h5 +CLEANUP ta6.h5 +SETUP $TESTDIR/tall.h5 ta7.h5 +JAMTEST $TESTDIR/u511.txt ta7.h5 +CHECKFILE $TESTDIR/tall.h5 ta7.h5 +CLEANUP ta7.h5 +SETUP $TESTDIR/tall.h5 ta8.h5 +JAMTEST $TESTDIR/u512.txt ta8.h5 +CHECKFILE $TESTDIR/tall.h5 ta8.h5 +CLEANUP ta8.h5 +SETUP $TESTDIR/tall.h5 ta9.h5 +JAMTEST $TESTDIR/u513.txt ta9.h5 +CHECKFILE $TESTDIR/tall.h5 ta9.h5 +CLEANUP ta9.h5 JAMTEST $TESTDIR/u10.txt $TESTDIR/twithub.h5 tax2.h5 CHECKFILE $TESTDIR/tall.h5 tax2.h5 diff --git a/tools/h5ls/CMakeLists.txt b/tools/h5ls/CMakeLists.txt index 5cce6cb..70943b5 100644 --- a/tools/h5ls/CMakeLists.txt +++ b/tools/h5ls/CMakeLists.txt @@ -145,10 +145,9 @@ IF (BUILD_TESTING) IF (NOT "${last_test}" STREQUAL "") SET_TESTS_PROPERTIES (H5LS-${resultfile} PROPERTIES DEPENDS ${last_test}) ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "H5LS-${resultfile}") ELSE (HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( - NAME H5LS-clear-${resultfile}-objects + NAME H5LS-${resultfile}-clear-objects COMMAND ${CMAKE_COMMAND} -E remove ./testfiles/${resultfile}.out ./testfiles/${resultfile}.out.err ) @@ -163,7 +162,7 @@ IF (BUILD_TESTING) -D "TEST_REFERENCE=${resultfile}.ls" -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) - SET_TESTS_PROPERTIES (H5LS-${resultfile} PROPERTIES DEPENDS "H5LS-clear-${resultfile}-objects") + SET_TESTS_PROPERTIES (H5LS-${resultfile} PROPERTIES DEPENDS "H5LS-${resultfile}-clear-objects") ENDIF (HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (ADD_H5_TEST file) diff --git a/tools/h5ls/Makefile.in b/tools/h5ls/Makefile.in index 7aa4329..1861b03 100644 --- a/tools/h5ls/Makefile.in +++ b/tools/h5ls/Makefile.in @@ -228,6 +228,7 @@ H5_VERSION = @H5_VERSION@ HADDR_T = @HADDR_T@ HAVE_DMALLOC = @HAVE_DMALLOC@ HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@ +HAVE_PTHREAD = @HAVE_PTHREAD@ HDF5_HL = @HDF5_HL@ HDF5_INTERFACES = @HDF5_INTERFACES@ HDF_CXX = @HDF_CXX@ @@ -279,7 +280,6 @@ PACKAGE_VERSION = @PACKAGE_VERSION@ PARALLEL = @PARALLEL@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ -PTHREAD = @PTHREAD@ RANLIB = @RANLIB@ ROOT = @ROOT@ RUNPARALLEL = @RUNPARALLEL@ diff --git a/tools/h5repack/CMakeLists.txt b/tools/h5repack/CMakeLists.txt index 7166357..156f6d8 100644 --- a/tools/h5repack/CMakeLists.txt +++ b/tools/h5repack/CMakeLists.txt @@ -150,24 +150,23 @@ IF (BUILD_TESTING) IF (${testtype} STREQUAL "SKIP") IF (NOT HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( - NAME H5REPACK-${testname}-SKIPPED - COMMAND ${CMAKE_COMMAND} -E echo "SKIP ${ARGN} -i ${PROJECT_BINARY_DIR}/testfiles/${testfile} -o ${PROJECT_BINARY_DIR}/testfiles/out.${testfile}" + NAME H5REPACK_OLD-${testname}-SKIPPED + COMMAND ${CMAKE_COMMAND} -E echo "SKIP ${ARGN} -i ${PROJECT_BINARY_DIR}/testfiles/${testfile} -o ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile}" ) ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) ELSE (${testtype} STREQUAL "SKIP") ADD_TEST ( - NAME H5REPACK-${testname} - COMMAND $ ${ARGN} -i ${PROJECT_BINARY_DIR}/testfiles/${testfile} -o ${PROJECT_BINARY_DIR}/testfiles/out.${testfile} + NAME H5REPACK_OLD-${testname} + COMMAND $ ${ARGN} -i ${PROJECT_BINARY_DIR}/testfiles/${testfile} -o ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} ) IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5REPACK-${testname} PROPERTIES DEPENDS ${last_test}) + SET_TESTS_PROPERTIES (H5REPACK_OLD-${testname} PROPERTIES DEPENDS ${last_test}) ENDIF (NOT "${last_test}" STREQUAL "") ADD_TEST ( - NAME H5REPACK-DIFF_${testname} - COMMAND $ ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out.${testfile} + NAME H5REPACK_OLD-${testname}_DFF + COMMAND $ ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} ) - SET_TESTS_PROPERTIES (H5REPACK-DIFF_${testname} PROPERTIES DEPENDS H5REPACK-${testname}) - SET (last_test "H5REPACK-DIFF_${testname}") + SET_TESTS_PROPERTIES (H5REPACK_OLD-${testname}_DFF PROPERTIES DEPENDS H5REPACK_OLD-${testname}) ENDIF (${testtype} STREQUAL "SKIP") ENDMACRO (ADD_H5_TEST_OLD) @@ -176,23 +175,22 @@ IF (BUILD_TESTING) IF (NOT HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( NAME H5REPACK-${testname}-SKIPPED - COMMAND ${CMAKE_COMMAND} -E echo "SKIP ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out.${testfile}" + COMMAND ${CMAKE_COMMAND} -E echo "SKIP ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile}" ) ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) ELSE (${testtype} STREQUAL "SKIP") ADD_TEST ( NAME H5REPACK-${testname} - COMMAND $ ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out.${testfile} + COMMAND $ ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} ) IF (NOT "${last_test}" STREQUAL "") SET_TESTS_PROPERTIES (H5REPACK-${testname} PROPERTIES DEPENDS ${last_test}) ENDIF (NOT "${last_test}" STREQUAL "") ADD_TEST ( - NAME H5REPACK-DIFF_${testname} - COMMAND $ ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out.${testfile} + NAME H5REPACK-${testname}_DFF + COMMAND $ ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} ) - SET_TESTS_PROPERTIES (H5REPACK-DIFF_${testname} PROPERTIES DEPENDS H5REPACK-${testname}) - SET (last_test "H5REPACK-DIFF_${testname}") + SET_TESTS_PROPERTIES (H5REPACK-${testname}_DFF PROPERTIES DEPENDS H5REPACK-${testname}) ENDIF (${testtype} STREQUAL "SKIP") ENDMACRO (ADD_H5_TEST) @@ -200,22 +198,22 @@ IF (BUILD_TESTING) IF (${testtype} STREQUAL "SKIP") IF (NOT HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( - NAME H5REPACK-${testname}-SKIPPED - COMMAND ${CMAKE_COMMAND} -E echo "SKIP ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${resultfile} ${PROJECT_BINARY_DIR}/testfiles/out.${resultfile}" + NAME H5REPACK_CMP-${testname}-SKIPPED + COMMAND ${CMAKE_COMMAND} -E echo "SKIP ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${resultfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${resultfile}" ) ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) ELSE (${testtype} STREQUAL "SKIP") # If using memchecker add tests without using scripts IF (HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST (NAME H5REPACK-${testname} COMMAND $ ${ARGN} testfiles/${resultfile} testfiles/out.${resultfile}) + ADD_TEST (NAME H5REPACK_CMP-${testname} COMMAND $ ${ARGN} testfiles/${resultfile} testfiles/out-${testname}.${resultfile}) ELSE (HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( - NAME H5REPACK-${testname} + NAME H5REPACK_CMP-${testname} COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$" - -D "TEST_ARGS:STRING=${ARGN};testfiles/${resultfile};testfiles/out.${resultfile}" + -D "TEST_ARGS:STRING=${ARGN};testfiles/${resultfile};testfiles/out-${testname}.${resultfile}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" - -D "TEST_OUTPUT=./testfiles/${resultfile}.out" + -D "TEST_OUTPUT=./testfiles/${resultfile}-${testname}.out" -D "TEST_EXPECT=${resultcode}" -D "TEST_FILTER:STRING=${testfilter}" -D "TEST_REFERENCE=testfiles/${resultfile}.ddl" @@ -223,9 +221,8 @@ IF (BUILD_TESTING) ) ENDIF (HDF5_ENABLE_USING_MEMCHECKER) IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5REPACK-${testname} PROPERTIES DEPENDS ${last_test}) + SET_TESTS_PROPERTIES (H5REPACK_CMP-${testname} PROPERTIES DEPENDS ${last_test}) ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "H5REPACK-${testname}") ENDIF (${testtype} STREQUAL "SKIP") ENDMACRO (ADD_H5_CMP_TEST) @@ -234,28 +231,37 @@ IF (BUILD_TESTING) IF (NOT HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( NAME H5REPACK_VERIFY_LAYOUT-${testname}-SKIPPED - COMMAND ${CMAKE_COMMAND} -E echo "SKIP -d ${testdset} -pH ${PROJECT_BINARY_DIR}/testfiles/out.${resultfile}" + COMMAND ${CMAKE_COMMAND} -E echo "SKIP -d ${testdset} -pH ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${resultfile}" ) ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) ELSE (${testtype} STREQUAL "SKIP") IF (NOT HDF5_ENABLE_USING_MEMCHECKER) + ADD_TEST ( + NAME H5REPACK_VERIFY_LAYOUT-${testname} + COMMAND $ ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} + ) + IF (NOT "${last_test}" STREQUAL "") + SET_TESTS_PROPERTIES (H5REPACK_VERIFY_LAYOUT-${testname} PROPERTIES DEPENDS ${last_test}) + ENDIF (NOT "${last_test}" STREQUAL "") + ADD_TEST ( + NAME H5REPACK_VERIFY_LAYOUT-${testname}_DFF + COMMAND $ ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} + ) + SET_TESTS_PROPERTIES (H5REPACK_VERIFY_LAYOUT-${testname}_DFF PROPERTIES DEPENDS H5REPACK_VERIFY_LAYOUT-${testname}) IF (${resultcode} STREQUAL "0") ADD_TEST ( - NAME H5REPACK_VERIFY_LAYOUT-${testname} + NAME H5REPACK_VERIFY_LAYOUT-${testname}_DMP COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$" - -D "TEST_ARGS:STRING=-d;${testdset};-pH;testfiles/out.${testfile}" + -D "TEST_ARGS:STRING=-d;${testdset};-pH;testfiles/out-${testname}.${testfile}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" - -D "TEST_OUTPUT=./testfiles/${testfile}-v.out" + -D "TEST_OUTPUT=./testfiles/${testfile}-${testname}-v.out" -D "TEST_EXPECT=${resultcode}" -D "TEST_FILTER:STRING=${testfilter}" -D "TEST_REFERENCE=${testfilter}" -P "${HDF5_RESOURCES_DIR}/grepTest.cmake" ) - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5REPACK_VERIFY_LAYOUT-${testname} PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "H5REPACK_VERIFY_LAYOUT-${testname}") + SET_TESTS_PROPERTIES (H5REPACK_VERIFY_LAYOUT-${testname}_DMP PROPERTIES DEPENDS H5REPACK_VERIFY_LAYOUT-${testname}_DFF) ELSE (${resultcode} STREQUAL "0") IF (${testfilter} STREQUAL "CHUNKED") SET (nottestfilter "(CONTIGUOUS|COMPACT)") @@ -267,21 +273,18 @@ IF (BUILD_TESTING) SET (nottestfilter "(CONTIGUOUS|CHUNK)") ENDIF (${testfilter} STREQUAL "COMPACT") ADD_TEST ( - NAME H5REPACK_VERIFY_LAYOUT_ALL-${testname} + NAME H5REPACK_VERIFY_LAYOUT-${testname}_DMP COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$" - -D "TEST_ARGS:STRING=-pH;testfiles/out.${testfile}" + -D "TEST_ARGS:STRING=-pH;testfiles/out-${testname}.${testfile}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" - -D "TEST_OUTPUT=./testfiles/${testfile}-v.out" + -D "TEST_OUTPUT=./testfiles/${testfile}-${testname}-v.out" -D "TEST_EXPECT=${resultcode}" -D "TEST_FILTER:STRING=${nottestfilter}" -D "TEST_REFERENCE=${testfilter}" -P "${HDF5_RESOURCES_DIR}/grepTest.cmake" ) - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5REPACK_VERIFY_LAYOUT_ALL-${testname} PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "H5REPACK_VERIFY_LAYOUT_ALL-${testname}") + SET_TESTS_PROPERTIES (H5REPACK_VERIFY_LAYOUT-${testname}_DMP PROPERTIES DEPENDS H5REPACK_VERIFY_LAYOUT-${testname}_DFF) ENDIF (${resultcode} STREQUAL "0") ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) ENDIF (${testtype} STREQUAL "SKIP") @@ -289,25 +292,21 @@ IF (BUILD_TESTING) MACRO (ADD_H5_TEST_META testname testfile) ADD_TEST ( - NAME H5REPACK-${testname}_N - COMMAND $ ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out_N.${testname}.h5 + NAME H5REPACK_META-${testname}_N + COMMAND $ ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}_N.${testname}.h5 ) IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5REPACK-${testname}_N PROPERTIES DEPENDS ${last_test}) + SET_TESTS_PROPERTIES (H5REPACK_META-${testname}_N PROPERTIES DEPENDS ${last_test}) ENDIF (NOT "${last_test}" STREQUAL "") ADD_TEST ( - NAME H5REPACK-${testname}_M - COMMAND $ ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out_M.${testname}.h5 + NAME H5REPACK_META-${testname}_M + COMMAND $ ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}_M.${testname}.h5 ) - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5REPACK-${testname}_M PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - ADD_TEST (NAME H5REPACK-${testname} COMMAND ${CMAKE_COMMAND} -E compare_files ${PROJECT_BINARY_DIR}/testfiles/out_N.${testname}.h5 ${PROJECT_BINARY_DIR}/testfiles/out_M.${testname}.h5) - SET_TESTS_PROPERTIES (H5REPACK-${testname} PROPERTIES WILL_FAIL "true") - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5REPACK-${testname} PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "H5REPACK-${testname}") + SET_TESTS_PROPERTIES (H5REPACK_META-${testname}_M PROPERTIES DEPENDS H5REPACK_META-${testname}_N) + + ADD_TEST (NAME H5REPACK_META-${testname} COMMAND ${CMAKE_COMMAND} -E compare_files ${PROJECT_BINARY_DIR}/testfiles/out-${testname}_N.${testname}.h5 ${PROJECT_BINARY_DIR}/testfiles/out-${testname}_M.${testname}.h5) + SET_TESTS_PROPERTIES (H5REPACK_META-${testname} PROPERTIES WILL_FAIL "true") + SET_TESTS_PROPERTIES (H5REPACK_META-${testname} PROPERTIES DEPENDS H5REPACK_META-${testname}_M) ENDMACRO (ADD_H5_TEST_META) ############################################################################## @@ -316,43 +315,158 @@ IF (BUILD_TESTING) ############################################################################## ############################################################################## + # -------------------------------------------------------------------- + # test file names + # -------------------------------------------------------------------- + SET (INFO_FILE testfiles/h5repack.info) + + SET (FILE0 h5repack_fill.h5) + SET (FILE1 h5repack_objs.h5) + SET (FILE2 h5repack_attr.h5) + SET (FILE3 h5repack_hlink.h5) + SET (FILE4 h5repack_layout.h5) + SET (FILE5 h5repack_early.h5) + SET (FILE7 h5repack_szip.h5) + SET (FILE8 h5repack_deflate.h5) + SET (FILE9 h5repack_shuffle.h5) + SET (FILE10 h5repack_fletcher.h5) + SET (FILE11 h5repack_filters.h5) + SET (FILE12 h5repack_nbit.h5) + SET (FILE13 h5repack_soffset.h5) + SET (FILE14 h5repack_layouto.h5 ) # A file with an older version of the layout message (copy of test/tlayouto.h5) + SET (FILE15 h5repack_named_dtypes.h5) + SET (FILE16 tfamily%05d.h5) # located in common testfiles folder + SET (FILE18 h5repack_layout2.h5) + SET (FILE_REF h5repack_refs.h5) + SET (FILE_ATTR_REF h5repack_attr_refs.h5) + # Remove any output file left over from previous test run ADD_TEST ( NAME H5REPACK-clearall-objects COMMAND ${CMAKE_COMMAND} -E remove - ./testfiles/h5repack_filters.h5.out - ./testfiles/h5repack_filters.h5.out.err - ./testfiles/h5repack_layout.h5-v.out - ./testfiles/h5repack_layout.h5-v.out.err - ./testfiles/h5repack_layout2.h5-v.out - ./testfiles/h5repack_layout2.h5-v.out.err - ./testfiles/h5repack_layout3.h5-v.out - ./testfiles/h5repack_layout3.h5-v.out.err - ./testfiles/out.tfamily%05d.h5 - ./testfiles/out.h5diff_attr1.h5 - ./testfiles/out.h5repack_attr.h5 - ./testfiles/out.h5repack_attr_refs.h5 - ./testfiles/out.h5repack_deflate.h5 - ./testfiles/out.h5repack_early.h5 - ./testfiles/out.h5repack_fill.h5 - ./testfiles/out.h5repack_filters.h5 - ./testfiles/out.h5repack_fletcher.h5 - ./testfiles/out.h5repack_hlink.h5 - ./testfiles/out.h5repack_layout.h5 - ./testfiles/out.h5repack_layouto.h5 - ./testfiles/out.h5repack_layout2.h5 - ./testfiles/out.h5repack_layout3.h5 - ./testfiles/out.h5repack_named_dtypes.h5 - ./testfiles/out.h5repack_nbit.h5 - ./testfiles/out.h5repack_objs.h5 - ./testfiles/out.h5repack_refs.h5 - ./testfiles/out.h5repack_shuffle.h5 - ./testfiles/out.h5repack_soffset.h5 - ./testfiles/out_M.meta_short.h5 - ./testfiles/out_N.meta_short.h5 - ./testfiles/out_M.meta_long.h5 - ./testfiles/out_N.meta_long.h5 + ./testfiles/h5repack_filters.h5-gzip_verbose_filters.out + ./testfiles/h5repack_filters.h5-gzip_verbose_filters.out.err + ./testfiles/h5repack_layout.h5-chunk_18x13-v.out + ./testfiles/h5repack_layout.h5-chunk_18x13-v.out.err + ./testfiles/h5repack_layout.h5-chunk_20x10-v.out + ./testfiles/h5repack_layout.h5-chunk_20x10-v.out.err + ./testfiles/h5repack_layout.h5-chunk_compa-v.out + ./testfiles/h5repack_layout.h5-chunk_compa-v.out.err + ./testfiles/h5repack_layout.h5-chunk_conti-v.out + ./testfiles/h5repack_layout.h5-chunk_conti-v.out.err + ./testfiles/h5repack_layout.h5-compa-v.out + ./testfiles/h5repack_layout.h5-compa-v.out.err + ./testfiles/h5repack_layout.h5-conti-v.out + ./testfiles/h5repack_layout.h5-conti-v.out.err + ./testfiles/h5repack_layout.h5-dset2_chunk_20x10-v.out + ./testfiles/h5repack_layout.h5-dset2_chunk_20x10-v.out.err + ./testfiles/h5repack_layout.h5-dset2_compa-v.out + ./testfiles/h5repack_layout.h5-dset2_compa-v.out.err + ./testfiles/h5repack_layout.h5-dset2_conti-v.out + ./testfiles/h5repack_layout.h5-dset2_conti-v.out.err + ./testfiles/h5repack_layout.h5-dset_compa_chunk-v.out + ./testfiles/h5repack_layout.h5-dset_compa_chunk-v.out.err + ./testfiles/h5repack_layout.h5-dset_compa_compa-v.out + ./testfiles/h5repack_layout.h5-dset_compa_compa-v.out.err + ./testfiles/h5repack_layout.h5-dset_compa_conti-v.out + ./testfiles/h5repack_layout.h5-dset_compa_conti-v.out.err + ./testfiles/h5repack_layout.h5-dset_conti_chunk-v.out + ./testfiles/h5repack_layout.h5-dset_conti_chunk-v.out.err + ./testfiles/h5repack_layout.h5-dset_conti_compa-v.out + ./testfiles/h5repack_layout.h5-dset_conti_compa-v.out.err + ./testfiles/h5repack_layout.h5-dset_conti_conti-v.out + ./testfiles/h5repack_layout.h5-dset_conti_conti-v.out.err + ./testfiles/h5repack_layout.h5-layout_long_switches-v.out + ./testfiles/h5repack_layout.h5-layout_long_switches-v.out.err + ./testfiles/h5repack_layout.h5-layout_short_switches-v.out + ./testfiles/h5repack_layout.h5-layout_short_switches-v.out.err + ./testfiles/h5repack_layout2.h5-contig_small_compa-v.out + ./testfiles/h5repack_layout2.h5-contig_small_compa-v.out.err + ./testfiles/h5repack_layout2.h5-contig_small_fixed_compa-v.out + ./testfiles/h5repack_layout2.h5-contig_small_fixed_compa-v.out.err + ./testfiles/h5repack_layout3.h5-chunk2chunk-v.out + ./testfiles/h5repack_layout3.h5-chunk2chunk-v.out.err + ./testfiles/h5repack_layout3.h5-chunk2compa-v.out + ./testfiles/h5repack_layout3.h5-chunk2compa-v.out.err + ./testfiles/h5repack_layout3.h5-chunk2conti-v.out + ./testfiles/h5repack_layout3.h5-chunk2conti-v.out.err + ./testfiles/h5repack_layout3.h5-error1-v.out + ./testfiles/h5repack_layout3.h5-error1-v.out.err + ./testfiles/h5repack_layout3.h5-error2-v.out + ./testfiles/h5repack_layout3.h5-error2-v.out.err + ./testfiles/h5repack_layout3.h5-error3-v.out + ./testfiles/h5repack_layout3.h5-error3-v.out.err + ./testfiles/out-family.tfamily%05d.h5 + ./testfiles/out-HDFFV-7840.h5diff_attr1.h5 + ./testfiles/out-attr.h5repack_attr.h5 + ./testfiles/out-native_attr.h5repack_attr.h5 + ./testfiles/out-HDFFV-5932.h5repack_attr_refs.h5 + ./testfiles/out-deflate_copy.h5repack_deflate.h5 + ./testfiles/out-deflate_remove.h5repack_deflate.h5 + ./testfiles/out-early.h5repack_early.h5 + ./testfiles/out-fill.h5repack_fill.h5 + ./testfiles/out-native_fill.h5repack_fill.h5 + ./testfiles/out-gzip_verbose_filters.h5repack_filters.h5 + ./testfiles/out-fletcher_copy.h5repack_fletcher.h5 + ./testfiles/out-fletcher_remove.h5repack_fletcher.h5 + ./testfiles/out-hlink.h5repack_hlink.h5 + ./testfiles/out-chunk_18x13.h5repack_layout.h5 + ./testfiles/out-chunk_20x10.h5repack_layout.h5 + ./testfiles/out-chunk_compa.h5repack_layout.h5 + ./testfiles/out-chunk_conti.h5repack_layout.h5 + ./testfiles/out-compa.h5repack_layout.h5 + ./testfiles/out-conti.h5repack_layout.h5 + ./testfiles/out-deflate_file.h5repack_layout.h5 + ./testfiles/out-deflate_limit.h5repack_layout.h5 + ./testfiles/out-dset2_chunk_20x10.h5repack_layout.h5 + ./testfiles/out-dset2_compa.h5repack_layout.h5 + ./testfiles/out-dset2_conti.h5repack_layout.h5 + ./testfiles/out-dset_compa_chunk.h5repack_layout.h5 + ./testfiles/out-dset_compa_compa.h5repack_layout.h5 + ./testfiles/out-dset_compa_conti.h5repack_layout.h5 + ./testfiles/out-dset_conti_chunk.h5repack_layout.h5 + ./testfiles/out-dset_conti_compa.h5repack_layout.h5 + ./testfiles/out-dset_conti_conti.h5repack_layout.h5 + ./testfiles/out-fletcher_all.h5repack_layout.h5 + ./testfiles/out-fletcher_individual.h5repack_layout.h5 + ./testfiles/out-global_filters.h5repack_layout.h5 + ./testfiles/out-gzip_all.h5repack_layout.h5 + ./testfiles/out-gzip_individual.h5repack_layout.h5 + ./testfiles/out-layout.h5repack_layout.h5 + ./testfiles/out-layout_long_switches.h5repack_layout.h5 + ./testfiles/out-layout_short_switches.h5repack_layout.h5 + ./testfiles/out-old_style_layout_short_switches.h5repack_layout.h5 + ./testfiles/out-shuffle_all.h5repack_layout.h5 + ./testfiles/out-shuffle_individual.h5repack_layout.h5 + ./testfiles/out-upgrade_layout.h5repack_layouto.h5 + ./testfiles/out-contig_small_compa.h5repack_layout2.h5 + ./testfiles/out-contig_small_fixed_compa.h5repack_layout2.h5 + ./testfiles/out-chunk2chunk.h5repack_layout3.h5 + ./testfiles/out-chunk2compa.h5repack_layout3.h5 + ./testfiles/out-chunk2conti.h5repack_layout3.h5 + ./testfiles/out-error1.h5repack_layout3.h5 + ./testfiles/out-error2.h5repack_layout3.h5 + ./testfiles/out-error3.h5repack_layout3.h5 + ./testfiles/out-error4.h5repack_layout3.h5 + ./testfiles/out-committed_dt.h5repack_named_dtypes.h5 + ./testfiles/out-nbit_add.h5repack_nbit.h5 + ./testfiles/out-nbit_copy.h5repack_nbit.h5 + ./testfiles/out-nbit_remove.h5repack_nbit.h5 + ./testfiles/out-add_alignment.h5repack_objs.h5 + ./testfiles/out-add_userblock.h5repack_objs.h5 + ./testfiles/out-objs.h5repack_objs.h5 + ./testfiles/out-gt_mallocsize.h5repack_objs.h5 + ./testfiles/out-bug1814.h5repack_refs.h5 + ./testfiles/out-shuffle_copy.h5repack_shuffle.h5 + ./testfiles/out-shuffle_remove.h5repack_shuffle.h5 + ./testfiles/out-scale_add.h5repack_soffset.h5 + ./testfiles/out-scale_copy.h5repack_soffset.h5 + ./testfiles/out-scale_remove.h5repack_soffset.h5 + ./testfiles/out-meta_short_M.meta_short.h5 + ./testfiles/out-meta_short_N.meta_short.h5 + ./testfiles/out-meta_long_M.meta_long.h5 + ./testfiles/out-meta_long_N.meta_long.h5 # from the h5repacktst h5repack_attr.h5 h5repack_attr_out.h5 @@ -398,32 +512,6 @@ IF (BUILD_TESTING) IF (NOT "${last_test}" STREQUAL "") SET_TESTS_PROPERTIES (H5REPACK-clearall-objects PROPERTIES DEPENDS ${last_test}) ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "H5REPACK-clearall-objects") - - # -------------------------------------------------------------------- - # test file names - # -------------------------------------------------------------------- - SET (INFO_FILE testfiles/h5repack.info) - - SET (FILE0 h5repack_fill.h5) - SET (FILE1 h5repack_objs.h5) - SET (FILE2 h5repack_attr.h5) - SET (FILE3 h5repack_hlink.h5) - SET (FILE4 h5repack_layout.h5) - SET (FILE5 h5repack_early.h5) - SET (FILE7 h5repack_szip.h5) - SET (FILE8 h5repack_deflate.h5) - SET (FILE9 h5repack_shuffle.h5) - SET (FILE10 h5repack_fletcher.h5) - SET (FILE11 h5repack_filters.h5) - SET (FILE12 h5repack_nbit.h5) - SET (FILE13 h5repack_soffset.h5) - SET (FILE14 h5repack_layouto.h5 ) # A file with an older version of the layout message (copy of test/tlayouto.h5) - SET (FILE15 h5repack_named_dtypes.h5) - SET (FILE16 tfamily%05d.h5) # located in common testfiles folder - SET (FILE18 h5repack_layout2.h5) - SET (FILE_REF h5repack_refs.h5) - SET (FILE_ATTR_REF h5repack_attr_refs.h5) ADD_TEST (NAME H5REPACK-testh5repack_detect_szip COMMAND $) IF (HDF5_ENABLE_SZIP_SUPPORT) @@ -438,15 +526,10 @@ IF (BUILD_TESTING) SET (passRegex "no") SET_TESTS_PROPERTIES (H5REPACK-testh5repack_detect_szip PROPERTIES PASS_REGULAR_EXPRESSION "no") ENDIF (HDF5_ENABLE_SZIP_SUPPORT) - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5REPACK-testh5repack_detect_szip PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "H5REPACK-testh5repack_detect_szip") + SET_TESTS_PROPERTIES (H5REPACK-testh5repack_detect_szip PROPERTIES DEPENDS H5REPACK-clearall-objects) ADD_TEST (NAME H5REPACK-h5repacktest COMMAND $) - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5REPACK-h5repacktest PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") + SET_TESTS_PROPERTIES (H5REPACK-h5repacktest PROPERTIES DEPENDS H5REPACK-testh5repack_detect_szip) SET (last_test "H5REPACK-h5repacktest") # @@ -740,47 +823,29 @@ IF (BUILD_TESTING) ######################################################### # layout options (these files have no filters) ######################################################### - ADD_H5_TEST (dset2_chunk_20x10 "TEST" ${FILE4} --layout=dset2:CHUNK=20x10) - ADD_H5_VERIFY_TEST (dset2_chunk_20x10 "TEST" 0 ${FILE4} dset2 CHUNKED) - ADD_H5_TEST (chunk_20x10 "TEST" ${FILE4} -l CHUNK=20x10) - ADD_H5_VERIFY_TEST (chunk_20x10 "TEST" 1 ${FILE4} null CHUNKED) - ADD_H5_TEST (dset2_conti "TEST" ${FILE4} -l dset2:CONTI) - ADD_H5_VERIFY_TEST (dset2_conti "TEST" 0 ${FILE4} dset2 CONTIGUOUS) - ADD_H5_TEST (conti "TEST" ${FILE4} -l CONTI) - ADD_H5_VERIFY_TEST (conti "TEST" 1 ${FILE4} null CONTIGUOUS) - ADD_H5_TEST (dset2_compa "TEST" ${FILE4} -l dset2:COMPA) - ADD_H5_VERIFY_TEST (dset2_compa "TEST" 0 ${FILE4} dset2 COMPACT) - ADD_H5_TEST (compa "TEST" ${FILE4} -l COMPA) - ADD_H5_VERIFY_TEST (compa "TEST" 1 ${FILE4} null COMPACT) + ADD_H5_VERIFY_TEST (dset2_chunk_20x10 "TEST" 0 ${FILE4} dset2 CHUNKED --layout=dset2:CHUNK=20x10) + ADD_H5_VERIFY_TEST (chunk_20x10 "TEST" 1 ${FILE4} null CHUNKED -l CHUNK=20x10) + ADD_H5_VERIFY_TEST (dset2_conti "TEST" 0 ${FILE4} dset2 CONTIGUOUS -l dset2:CONTI) + ADD_H5_VERIFY_TEST (conti "TEST" 1 ${FILE4} null CONTIGUOUS -l CONTI) + ADD_H5_VERIFY_TEST (dset2_compa "TEST" 0 ${FILE4} dset2 COMPACT -l dset2:COMPA) + ADD_H5_VERIFY_TEST (compa "TEST" 1 ${FILE4} null COMPACT -l COMPA) ################################################################ # layout conversions (file has no filters) ############################################################### - ADD_H5_TEST (dset_compa_conti "TEST" ${FILE4} -l dset_compact:CONTI) - ADD_H5_VERIFY_TEST (dset_compa_conti "TEST" 0 ${FILE4} dset_compact CONTIGUOUS) - ADD_H5_TEST (dset_compa_chunk "TEST" ${FILE4} -l dset_compact:CHUNK=2x5) - ADD_H5_VERIFY_TEST (dset_compa_chunk "TEST" 0 ${FILE4} dset_compact CHUNKED) - ADD_H5_TEST (dset_compa_compa "TEST" ${FILE4} -l dset_compact:COMPA) - ADD_H5_VERIFY_TEST (dset_compa_compa "TEST" 0 ${FILE4} dset_compact COMPACT) - ADD_H5_TEST (dset_conti_compa "TEST" ${FILE4} -l dset_contiguous:COMPA) - ADD_H5_VERIFY_TEST (dset_conti_compa "TEST" 0 ${FILE4} dset_contiguous COMPACT) - ADD_H5_TEST (dset_conti_chunk "TEST" ${FILE4} -l dset_contiguous:CHUNK=3x6) - ADD_H5_VERIFY_TEST (dset_conti_chunk "TEST" 0 ${FILE4} dset_contiguous CHUNKED) - ADD_H5_TEST (dset_conti_conti "TEST" ${FILE4} -l dset_contiguous:CONTI) - ADD_H5_VERIFY_TEST (dset_conti_conti "TEST" 0 ${FILE4} dset_contiguous CONTIGUOUS) - ADD_H5_TEST (chunk_compa "TEST" ${FILE4} -l dset_chunk:COMPA) - ADD_H5_VERIFY_TEST (chunk_compa "TEST" 0 ${FILE4} dset_chunk COMPACT) - ADD_H5_TEST (chunk_conti "TEST" ${FILE4} -l dset_chunk:CONTI) - ADD_H5_VERIFY_TEST (chunk_conti "TEST" 0 ${FILE4} dset_chunk CONTIGUOUS) - ADD_H5_TEST (chunk_18x13 "TEST" ${FILE4} -l dset_chunk:CHUNK=18x13) - ADD_H5_VERIFY_TEST (chunk_18x13 "TEST" 0 ${FILE4} dset_chunk CHUNKED) + ADD_H5_VERIFY_TEST (dset_compa_conti "TEST" 0 ${FILE4} dset_compact CONTIGUOUS -l dset_compact:CONTI) + ADD_H5_VERIFY_TEST (dset_compa_chunk "TEST" 0 ${FILE4} dset_compact CHUNKED -l dset_compact:CHUNK=2x5) + ADD_H5_VERIFY_TEST (dset_compa_compa "TEST" 0 ${FILE4} dset_compact COMPACT -l dset_compact:COMPA) + ADD_H5_VERIFY_TEST (dset_conti_compa "TEST" 0 ${FILE4} dset_contiguous COMPACT -l dset_contiguous:COMPA) + ADD_H5_VERIFY_TEST (dset_conti_chunk "TEST" 0 ${FILE4} dset_contiguous CHUNKED -l dset_contiguous:CHUNK=3x6) + ADD_H5_VERIFY_TEST (dset_conti_conti "TEST" 0 ${FILE4} dset_contiguous CONTIGUOUS -l dset_contiguous:CONTI) + ADD_H5_VERIFY_TEST (chunk_compa "TEST" 0 ${FILE4} dset_chunk COMPACT -l dset_chunk:COMPA) + ADD_H5_VERIFY_TEST (chunk_conti "TEST" 0 ${FILE4} dset_chunk CONTIGUOUS -l dset_chunk:CONTI) + ADD_H5_VERIFY_TEST (chunk_18x13 "TEST" 0 ${FILE4} dset_chunk CHUNKED -l dset_chunk:CHUNK=18x13) # test convert small size dataset ( < 1k) to compact layout without -m - ADD_H5_TEST (contig_small_compa "TEST" ${FILE18} -l contig_small:COMPA) - ADD_H5_VERIFY_TEST (contig_small_compa "TEST" 0 ${FILE18} contig_small COMPACT) - - ADD_H5_TEST (contig_small_fixed_compa "TEST" ${FILE18} -l chunked_small_fixed:COMPA) - ADD_H5_VERIFY_TEST (contig_small_fixed_compa "TEST" 0 ${FILE18} chunked_small_fixed COMPACT) + ADD_H5_VERIFY_TEST (contig_small_compa "TEST" 0 ${FILE18} contig_small COMPACT -l contig_small:COMPA) + ADD_H5_VERIFY_TEST (contig_small_fixed_compa "TEST" 0 ${FILE18} chunked_small_fixed COMPACT -l chunked_small_fixed:COMPA) #--------------------------------------------------------------------------- # Test file contains chunked datasets (need multiple dsets) with @@ -788,17 +853,14 @@ IF (BUILD_TESTING) # Use first dset to test. #--------------------------------------------------------------------------- # chunk to chunk - specify chunk dim bigger than any current dim -ADD_H5_TEST (chunk2chunk "TEST" h5repack_layout3.h5 -l chunk_unlimit1:CHUNK=100x300) -ADD_H5_VERIFY_TEST (chunk2chunk "TEST" 0 h5repack_layout3.h5 chunk_unlimit1 CHUNK) +ADD_H5_VERIFY_TEST (chunk2chunk "TEST" 0 h5repack_layout3.h5 chunk_unlimit1 CHUNK -l chunk_unlimit1:CHUNK=100x300) # chunk to contiguous -ADD_H5_TEST (chunk2conti "TEST" h5repack_layout3.h5 -l chunk_unlimit1:CONTI) -ADD_H5_VERIFY_TEST (chunk2conti "TEST" 0 h5repack_layout3.h5 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_TEST (chunk2compa "TEST" h5repack_layout3.h5 -l chunk_unlimit1:COMPA) -ADD_H5_VERIFY_TEST (chunk2compa "TEST" 0 h5repack_layout3.h5 chunk_unlimit1 CHUNK) +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. @@ -808,16 +870,13 @@ 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_TEST (error1 "TEST" h5repack_layout3.h5 -f chunk_unlimit1:NONE) -ADD_H5_VERIFY_TEST (error1 "TEST" 0 h5repack_layout3.h5 chunk_unlimit1 H5S_UNLIMITED) +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_TEST (error2 "TEST" h5repack_layout3.h5 -f chunk_unlimit2:NONE) -ADD_H5_VERIFY_TEST (error2 "TEST" 0 h5repack_layout3.h5 chunk_unlimit2 H5S_UNLIMITED) +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_TEST (error3 "TEST" h5repack_layout3.h5 -f chunk_unlimit3:NONE) -ADD_H5_VERIFY_TEST (error3 "TEST" 0 h5repack_layout3.h5 chunk_unlimit3 H5S_UNLIMITED) +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) @@ -829,22 +888,20 @@ ADD_H5_TEST (error4 "TEST" h5repack_layout3.h5 -f NONE) ADD_H5_TEST (native_attr "TEST" ${FILE2} -n) # latest file format with long switches. use FILE4=h5repack_layout.h5 (no filters) - SET (arg ${FILE4} --layout CHUNK=20x10 --filter GZIP=1 --minimum=10 --native --latest --compact=8 --indexed=6 --ssize=8[:dtype]) + SET (arg --layout CHUNK=20x10 --filter GZIP=1 --minimum=10 --native --latest --compact=8 --indexed=6 --ssize=8[:dtype]) SET (TESTTYPE "TEST") IF (NOT USE_FILTER_DEFLATE) SET (TESTTYPE "SKIP") ENDIF (NOT USE_FILTER_DEFLATE) - ADD_H5_TEST (layout_long_switches ${TESTTYPE} ${arg}) - ADD_H5_VERIFY_TEST (layout_long_switches ${TESTTYPE} 1 ${FILE4} null CHUNKED) + ADD_H5_VERIFY_TEST (layout_long_switches ${TESTTYPE} 1 ${FILE4} null CHUNKED ${arg}) # latest file format with short switches. use FILE4=h5repack_layout.h5 (no filters) - SET (arg ${FILE4} -l CHUNK=20x10 -f GZIP=1 -m 10 -n -L -c 8 -d 6 -s 8[:dtype]) + SET (arg -l CHUNK=20x10 -f GZIP=1 -m 10 -n -L -c 8 -d 6 -s 8[:dtype]) SET (TESTTYPE "TEST") IF (NOT USE_FILTER_DEFLATE) SET (TESTTYPE "SKIP") ENDIF (NOT USE_FILTER_DEFLATE) - ADD_H5_TEST (layout_short_switches ${TESTTYPE} ${arg}) - ADD_H5_VERIFY_TEST (layout_short_switches ${TESTTYPE} 1 ${FILE4} null CHUNKED) + ADD_H5_VERIFY_TEST (layout_short_switches ${TESTTYPE} 1 ${FILE4} null CHUNKED ${arg}) # several global filters SET (arg ${FILE4} --filter GZIP=1 --filter SHUF) diff --git a/tools/h5repack/Makefile.in b/tools/h5repack/Makefile.in index 389339f..fe3a11c 100644 --- a/tools/h5repack/Makefile.in +++ b/tools/h5repack/Makefile.in @@ -248,6 +248,7 @@ H5_VERSION = @H5_VERSION@ HADDR_T = @HADDR_T@ HAVE_DMALLOC = @HAVE_DMALLOC@ HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@ +HAVE_PTHREAD = @HAVE_PTHREAD@ HDF5_HL = @HDF5_HL@ HDF5_INTERFACES = @HDF5_INTERFACES@ HDF_CXX = @HDF_CXX@ @@ -299,7 +300,6 @@ PACKAGE_VERSION = @PACKAGE_VERSION@ PARALLEL = @PARALLEL@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ -PTHREAD = @PTHREAD@ RANLIB = @RANLIB@ ROOT = @ROOT@ RUNPARALLEL = @RUNPARALLEL@ diff --git a/tools/h5repack/h5repack.sh.in b/tools/h5repack/h5repack.sh.in index a732ffb..dc90426 100644 --- a/tools/h5repack/h5repack.sh.in +++ b/tools/h5repack/h5repack.sh.in @@ -189,7 +189,9 @@ SKIP() { DIFFTEST() { VERIFY h5diff output $@ - $RUNSERIAL $H5DIFF_BIN -q "$@" + ( + $RUNSERIAL $H5DIFF_BIN -q "$@" + ) RET=$? if [ $RET != 0 ] ; then echo "*FAILED*" @@ -208,44 +210,57 @@ DIFFTEST() TOOLTEST() { echo $@ - TOOLTEST_MAIN $@ - outfile=$TESTDIR/out.$1 - rm -f $outfile -} + infile=$TESTDIR/$2 + outfile=$TESTDIR/out-$1.$2 + shift + shift -# TOOLTEST main function, doesn't delete $output file -TOOLTEST_MAIN() -{ # Run test. TESTING $H5REPACK $@ - - infile=$TESTDIR/$1 - outfile=$TESTDIR/out.$1 - shift - $RUNSERIAL $H5REPACK_BIN "$@" $infile $outfile + ( + $RUNSERIAL $H5REPACK_BIN "$@" $infile $outfile + ) RET=$? if [ $RET != 0 ] ; then - echo "*FAILED*" - nerrors="`expr $nerrors + 1`" + echo "*FAILED*" + nerrors="`expr $nerrors + 1`" else - echo " PASSED" - DIFFTEST $infile $outfile + echo " PASSED" + DIFFTEST $infile $outfile fi + rm -f $outfile } #------------------------------------------ # Verifying layouts of a dataset VERIFY_LAYOUT_DSET() { - outfile=$TESTDIR/out.$1 - layoutfile=$TESTDIR/layout.$1 - dset=$2 - expectlayout=$3 + layoutfile=$TESTDIR/layout-$1.$2 + dset=$3 + expectlayout=$4 + infile=$TESTDIR/$2 + outfile=$TESTDIR/out-$1.$2 + shift + shift + shift + shift + + $RUNSERIAL $H5REPACK_BIN "$@" $infile $outfile + RET=$? + if [ $RET != 0 ] ; then + echo "*FAILED*" + nerrors="`expr $nerrors + 1`" + else + echo " PASSED" + DIFFTEST $infile $outfile + fi #--------------------------------- # check the layout from a dataset VERIFY "a dataset layout" - $RUNSERIAL $H5DUMP_BIN -d $dset -pH $outfile > $layoutfile + ( + $RUNSERIAL $H5DUMP_BIN -d $dset -pH $outfile > $layoutfile + ) $GREP $expectlayout $layoutfile > /dev/null if [ $? -eq 0 ]; then echo " PASSED" @@ -262,17 +277,35 @@ VERIFY_LAYOUT_DSET() # Verifying layouts from entire file VERIFY_LAYOUT_ALL() { - outfile=$TESTDIR/out.$1 - layoutfile=$TESTDIR/layout.$1 - expectlayout=$2 + outfile=$TESTDIR/out-$1.$2 + layoutfile=$TESTDIR/layout-$1.$2 + expectlayout=$3 + shift + shift + shift + + $RUNSERIAL $H5REPACK_BIN "$@" $infile $outfile + RET=$? + if [ $RET != 0 ] ; then + echo "*FAILED*" + nerrors="`expr $nerrors + 1`" + else + echo " PASSED" + DIFFTEST $infile $outfile + fi + #--------------------------------- # check the layout from a dataset # check if the other layouts still exsit VERIFY "layouts" + ( # if CONTIGUOUS if [ $expectlayout = "CONTIGUOUS" ]; then - $RUNSERIAL $H5DUMP_BIN -pH $outfile > $layoutfile + TESTING $H5DUMP_BIN -pH $outfile + ( + $RUNSERIAL $H5DUMP_BIN -pH $outfile > $layoutfile + ) $GREP "COMPACT" $layoutfile > /dev/null if [ $? -eq 0 ]; then echo " FAILED" @@ -287,7 +320,10 @@ VERIFY_LAYOUT_ALL() else # if COMPACT if [ $expectlayout = "COMPACT" ]; then - $RUNSERIAL $H5DUMP_BIN -pH $outfile > $layoutfile + TESTING $H5DUMP_BIN -pH $outfile + ( + $RUNSERIAL $H5DUMP_BIN -pH $outfile > $layoutfile + ) $GREP "CHUNKED" $layoutfile > /dev/null if [ $? -eq 0 ]; then echo " FAILED" @@ -302,7 +338,10 @@ VERIFY_LAYOUT_ALL() else # if CHUNKED if [ $expectlayout = "CHUNKED" ]; then - $RUNSERIAL $H5DUMP_BIN -pH $outfile > $layoutfile + TESTING $H5DUMP_BIN -pH $outfile + ( + $RUNSERIAL $H5DUMP_BIN -pH $outfile > $layoutfile + ) $GREP "CONTIGUOUS" $layoutfile > /dev/null if [ $? -eq 0 ]; then echo " FAILED" @@ -317,6 +356,7 @@ VERIFY_LAYOUT_ALL() fi fi fi + ) # clean up tmp files rm -f $outfile @@ -327,13 +367,16 @@ VERIFY_LAYOUT_ALL() # TOOLTEST0() { + infile=$TESTDIR/$2 + outfile=$TESTDIR/out-$1.$2 + shift + shift + # Run test. TESTING $H5REPACK $@ - - infile=$TESTDIR/$1 - outfile=$TESTDIR/out.$1 - shift - $RUNSERIAL $H5REPACK_BIN -i $infile -o $outfile "$@" + ( + $RUNSERIAL $H5REPACK_BIN -i $infile -o $outfile "$@" + ) RET=$? if [ $RET != 0 ] ; then echo "*FAILED*" @@ -351,13 +394,16 @@ TOOLTEST0() # TOOLTEST1() { + infile=$TESTDIR/$2 + outfile=$TESTDIR/out-$1.$2 + shift + shift + # Run test. TESTING $H5REPACK $@ - - infile=$TESTDIR/$1 - outfile=$TESTDIR/out.$1 - shift - $RUNSERIAL $H5REPACK_BIN "$@" $infile $outfile + ( + $RUNSERIAL $H5REPACK_BIN "$@" $infile $outfile + ) RET=$? if [ $RET != 0 ] ; then echo "*FAILED*" @@ -374,16 +420,20 @@ TOOLTEST1() # TOOLTESTV() { - # Run test. - TESTING $H5REPACK $@ - expect="$TESTDIR/$1.ddl" - actual="$TESTDIR/`basename $1 .ddl`.out" - actual_err="$TESTDIR/`basename $1 .ddl`.err" + expect="$TESTDIR/$2.ddl" + actual="$TESTDIR/`basename $2 .ddl`.out" + actual_err="$TESTDIR/`basename $2 .ddl`.err" - infile=$TESTDIR/$1 - outfile=$TESTDIR/out.$1 + infile=$TESTDIR/$2 + outfile=$TESTDIR/out-$1.$2 + shift shift - $RUNSERIAL $H5REPACK_BIN "$@" $infile $outfile >$actual 2>$actual_err + + # Run test. + TESTING $H5REPACK $@ + ( + $RUNSERIAL $H5REPACK_BIN "$@" $infile $outfile + ) >$actual 2>$actual_err RET=$? if [ $RET != 0 ] ; then echo "*FAILED*" @@ -427,17 +477,41 @@ TOOLTESTV() # Verify the output file of second run is larger than the one of 1st run. TOOLTEST_META() { - input_file=$1 - outfile="$TESTDIR/out.$1" + infile=$TESTDIR/$2 + outfile=$TESTDIR/out-$1.$2 + shift + shift - # Use TOOLTEST_MAIN to run because it does not remove the output file. - # 1st run, without metadata option - TOOLTEST_MAIN $1 + # Run test. + TESTING $H5REPACK $@ + ( + $RUNSERIAL $H5REPACK_BIN $infile $outfile + ) + RET=$? + if [ $RET != 0 ] ; then + echo "*FAILED*" + nerrors="`expr $nerrors + 1`" + else + echo " PASSED" + DIFFTEST $infile $outfile + fi # get the size of the first output file size1=`wc -c $outfile | cut -d' ' -f1` # 2nd run with metadata option - TOOLTEST_MAIN $* + # Run test. + TESTING $H5REPACK $@ + ( + $RUNSERIAL $H5REPACK_BIN "$@" $infile $outfile + ) + RET=$? + if [ $RET != 0 ] ; then + echo "*FAILED*" + nerrors="`expr $nerrors + 1`" + else + echo " PASSED" + DIFFTEST $infile $outfile + fi # get the size of the second output file size2=`wc -c $outfile | cut -d' ' -f1` @@ -492,12 +566,12 @@ fi COPY_TESTFILES_TO_TESTDIR # copy files (these files have no filters) -TOOLTEST h5repack_fill.h5 -TOOLTEST h5repack_objs.h5 -TOOLTEST h5repack_attr.h5 -TOOLTEST h5repack_hlink.h5 -TOOLTEST h5repack_layout.h5 -TOOLTEST h5repack_early.h5 +TOOLTEST fill h5repack_fill.h5 +TOOLTEST objs h5repack_objs.h5 +TOOLTEST attr h5repack_attr.h5 +TOOLTEST hlink h5repack_hlink.h5 +TOOLTEST layout h5repack_layout.h5 +TOOLTEST early h5repack_early.h5 # use h5repack_layout.h5 to write some filters (this file has no filters) @@ -507,7 +581,7 @@ arg="h5repack_layout.h5 -f dset1:GZIP=1 -l dset1:CHUNK=20x10" if test $USE_FILTER_DEFLATE != "yes" ; then SKIP $arg else - TOOLTEST $arg + TOOLTEST gzip_individual $arg fi # gzip for all @@ -515,7 +589,7 @@ arg="h5repack_layout.h5 -f GZIP=1" if test $USE_FILTER_DEFLATE != "yes" ; then SKIP $arg else - TOOLTEST $arg + TOOLTEST gzip_all $arg fi # szip with individual object @@ -523,7 +597,7 @@ arg="h5repack_layout.h5 -f dset2:SZIP=8,EC -l dset2:CHUNK=20x10" if test $USE_FILTER_SZIP_ENCODER != "yes" -o $USE_FILTER_SZIP != "yes" ; then SKIP $arg else - TOOLTEST $arg + TOOLTEST szip_individual $arg fi # szip for all @@ -531,7 +605,7 @@ arg="h5repack_layout.h5 -f SZIP=8,NN" if test $USE_FILTER_SZIP_ENCODER != "yes" -o $USE_FILTER_SZIP != "yes" ; then SKIP $arg else - TOOLTEST $arg + TOOLTEST szip_all $arg fi # shuffle with individual object @@ -539,7 +613,7 @@ arg="h5repack_layout.h5 -f dset2:SHUF -l dset2:CHUNK=20x10" if test $USE_FILTER_SHUFFLE != "yes" ; then SKIP $arg else - TOOLTEST $arg + TOOLTEST shuffle_individual $arg fi @@ -548,7 +622,7 @@ arg="h5repack_layout.h5 -f SHUF" if test $USE_FILTER_SHUFFLE != "yes" ; then SKIP $arg else - TOOLTEST $arg + TOOLTEST shuffle_all $arg fi # fletcher32 with individual object @@ -556,7 +630,7 @@ arg="h5repack_layout.h5 -f dset2:FLET -l dset2:CHUNK=20x10" if test $USE_FILTER_FLETCHER32 != "yes" ; then SKIP $arg else - TOOLTEST $arg + TOOLTEST fletcher_individual $arg fi # fletcher32 for all @@ -564,7 +638,7 @@ arg="h5repack_layout.h5 -f FLET" if test $USE_FILTER_FLETCHER32 != "yes" ; then SKIP $arg else - TOOLTEST $arg + TOOLTEST fletcher_all $arg fi # all filters @@ -572,7 +646,7 @@ arg="h5repack_layout.h5 -f dset2:SHUF -f dset2:FLET -f dset2:SZIP=8,NN -f dset2: if test $USE_FILTER_SZIP_ENCODER != "yes" -o $USE_FILTER_SZIP != "yes" -o $USE_FILTER_SHUFFLE != "yes" -o $USE_FILTER_FLETCHER32 != "yes" -o $USE_FILTER_DEFLATE != "yes" ; then SKIP $arg else - TOOLTEST $arg + TOOLTEST all_filters $arg fi # verbose gzip with individual object @@ -581,7 +655,7 @@ if test $USE_FILTER_DEFLATE != "yes" ; then SKIP $arg else # compare output - TOOLTESTV $arg + TOOLTESTV gzip_verbose_filters $arg fi ########################################################### @@ -593,7 +667,7 @@ arg="h5repack_szip.h5" if test $USE_FILTER_SZIP_ENCODER != "yes" -o $USE_FILTER_SZIP != "yes" ; then SKIP $arg else - TOOLTEST $arg + TOOLTEST szip_copy $arg fi # szip remove @@ -601,7 +675,7 @@ arg="h5repack_szip.h5 --filter=dset_szip:NONE" if test $USE_FILTER_SZIP_ENCODER != "yes" -o $USE_FILTER_SZIP != "yes" ; then SKIP $arg else - TOOLTEST $arg + TOOLTEST szip_remove $arg fi # deflate copy @@ -609,7 +683,7 @@ arg="h5repack_deflate.h5" if test $USE_FILTER_DEFLATE != "yes" ; then SKIP $arg else - TOOLTEST $arg + TOOLTEST deflate_copy $arg fi # deflate remove @@ -617,7 +691,7 @@ arg="h5repack_deflate.h5 -f dset_deflate:NONE" if test $USE_FILTER_DEFLATE != "yes" ; then SKIP $arg else - TOOLTEST $arg + TOOLTEST deflate_remove $arg fi # shuffle copy @@ -625,7 +699,7 @@ arg="h5repack_shuffle.h5" if test $USE_FILTER_SHUFFLE != "yes" ; then SKIP $arg else - TOOLTEST $arg + TOOLTEST shuffle_copy $arg fi # shuffle remove @@ -633,7 +707,7 @@ arg="h5repack_shuffle.h5 -f dset_shuffle:NONE" if test $USE_FILTER_SHUFFLE != "yes" ; then SKIP $arg else - TOOLTEST $arg + TOOLTEST shuffle_remove $arg fi # fletcher32 copy @@ -641,7 +715,7 @@ arg="h5repack_fletcher.h5" if test $USE_FILTER_FLETCHER32 != "yes" ; then SKIP $arg else - TOOLTEST $arg + TOOLTEST fletcher_copy $arg fi # fletcher32 remove @@ -649,7 +723,7 @@ arg="h5repack_fletcher.h5 -f dset_fletcher32:NONE" if test $USE_FILTER_FLETCHER32 != "yes" ; then SKIP $arg else - TOOLTEST $arg + TOOLTEST fletcher_remove $arg fi # nbit copy @@ -657,7 +731,7 @@ arg="h5repack_nbit.h5" if test $USE_FILTER_NBIT != "yes" ; then SKIP $arg else - TOOLTEST $arg + TOOLTEST nbit_copy $arg fi # nbit remove @@ -665,7 +739,7 @@ arg="h5repack_nbit.h5 -f dset_nbit:NONE" if test $USE_FILTER_NBIT != "yes" ; then SKIP $arg else - TOOLTEST $arg + TOOLTEST nbit_remove $arg fi # nbit add @@ -673,7 +747,7 @@ arg="h5repack_nbit.h5 -f dset_int31:NBIT" if test $USE_FILTER_NBIT != "yes" ; then SKIP $arg else - TOOLTEST $arg + TOOLTEST nbit_add $arg fi # scaleoffset copy @@ -681,7 +755,7 @@ arg="h5repack_soffset.h5" if test $USE_FILTER_SCALEOFFSET != "yes" ; then SKIP $arg else - TOOLTEST $arg + TOOLTEST scale_copy $arg fi # scaleoffset add @@ -689,7 +763,7 @@ arg="h5repack_soffset.h5 -f dset_none:SOFF=31,IN" if test $USE_FILTER_SCALEOFFSET != "yes" ; then SKIP $arg else - TOOLTEST $arg + TOOLTEST scale_add $arg fi # scaleoffset remove @@ -697,7 +771,7 @@ arg="h5repack_soffset.h5 -f dset_scaleoffset:NONE" if test $USE_FILTER_SCALEOFFSET != "yes" ; then SKIP $arg else - TOOLTEST $arg + TOOLTEST scale_remove $arg fi # remove all filters @@ -705,7 +779,7 @@ arg="h5repack_filters.h5 -f NONE" if test $USE_FILTER_FLETCHER32 != "yes" -o $USE_FILTER_DEFLATE != "yes" -o $USE_FILTER_SZIP != "yes" -o $USE_FILTER_SZIP_ENCODER != "yes" -o $USE_FILTER_SHUFFLE != "yes" -o $USE_FILTER_NBIT != "yes" -o $USE_FILTER_SCALEOFFSET != "yes" ; then SKIP $arg else - TOOLTEST $arg + TOOLTEST remove_all $arg fi #filter conversions @@ -714,14 +788,14 @@ arg="h5repack_deflate.h5 -f dset_deflate:SZIP=8,NN" if test $USE_FILTER_SZIP_ENCODER != "yes" -o $USE_FILTER_SZIP != "yes" -o $USE_FILTER_DEFLATE != "yes" ; then SKIP $arg else - TOOLTEST $arg + TOOLTEST deflate_convert $arg fi arg="h5repack_szip.h5 -f dset_szip:GZIP=1" if test $USE_FILTER_SZIP != "yes" -o $USE_FILTER_SZIP_ENCODER != "yes" -o $USE_FILTER_DEFLATE != "yes" ; then SKIP $arg else - TOOLTEST $arg + TOOLTEST szip_convert $arg fi @@ -730,7 +804,7 @@ arg="h5repack_layout.h5 -f GZIP=1 -m 1024" if test $USE_FILTER_DEFLATE != "yes" ; then SKIP $arg else - TOOLTEST $arg + TOOLTEST deflate_limit $arg fi #file @@ -738,67 +812,50 @@ arg="h5repack_layout.h5 -e $TESTDIR/h5repack.info" if test $USE_FILTER_DEFLATE != "yes" ; then SKIP $arg else - TOOLTEST $arg + TOOLTEST deflate_file $arg fi ######################################################### # layout options (these files have no filters) ######################################################### -TOOLTEST_MAIN h5repack_layout.h5 --layout dset2:CHUNK=20x10 -VERIFY_LAYOUT_DSET h5repack_layout.h5 dset2 CHUNKED +VERIFY_LAYOUT_DSET dset2_chunk_20x10 h5repack_layout.h5 dset2 CHUNKED --layout dset2:CHUNK=20x10 -TOOLTEST_MAIN h5repack_layout.h5 -l CHUNK=20x10 -VERIFY_LAYOUT_ALL h5repack_layout.h5 CHUNKED +VERIFY_LAYOUT_ALL chunk_20x10 h5repack_layout.h5 CHUNKED -l CHUNK=20x10 -TOOLTEST_MAIN h5repack_layout.h5 -l dset2:CONTI -VERIFY_LAYOUT_DSET h5repack_layout.h5 dset2 CONTIGUOUS +VERIFY_LAYOUT_DSET dset2_conti h5repack_layout.h5 dset2 CONTIGUOUS -l dset2:CONTI -TOOLTEST_MAIN h5repack_layout.h5 -l CONTI -VERIFY_LAYOUT_ALL h5repack_layout.h5 CONTIGUOUS +VERIFY_LAYOUT_ALL conti h5repack_layout.h5 CONTIGUOUS -l CONTI -TOOLTEST_MAIN h5repack_layout.h5 -l dset2:COMPA -VERIFY_LAYOUT_DSET h5repack_layout.h5 dset2 COMPACT +VERIFY_LAYOUT_DSET dset2_compa h5repack_layout.h5 dset2 COMPACT -l dset2:COMPA -TOOLTEST_MAIN h5repack_layout.h5 -l COMPA -VERIFY_LAYOUT_ALL h5repack_layout.h5 COMPACT +VERIFY_LAYOUT_ALL compa h5repack_layout.h5 COMPACT -l COMPA ################################################################ # layout conversions (file has no filters) ############################################################### -TOOLTEST_MAIN h5repack_layout.h5 -l dset_compact:CONTI -VERIFY_LAYOUT_DSET h5repack_layout.h5 dset_compact CONTIGUOUS +VERIFY_LAYOUT_DSET dset_compa_conti h5repack_layout.h5 dset_compact CONTIGUOUS -l dset_compact:CONTI -TOOLTEST_MAIN h5repack_layout.h5 -l dset_compact:CHUNK=2x5 -VERIFY_LAYOUT_DSET h5repack_layout.h5 dset_compact CHUNKED +VERIFY_LAYOUT_DSET dset_compa_chunk h5repack_layout.h5 dset_compact CHUNKED -l dset_compact:CHUNK=2x5 -TOOLTEST_MAIN h5repack_layout.h5 -l dset_compact:COMPA -VERIFY_LAYOUT_DSET h5repack_layout.h5 dset_compact COMPACT +VERIFY_LAYOUT_DSET dset_compa_compa h5repack_layout.h5 dset_compact COMPACT -l dset_compact:COMPA -TOOLTEST_MAIN h5repack_layout.h5 -l dset_contiguous:COMPA -VERIFY_LAYOUT_DSET h5repack_layout.h5 dset_contiguous COMPACT +VERIFY_LAYOUT_DSET dset_conti_compa h5repack_layout.h5 dset_contiguous COMPACT -l dset_contiguous:COMPA -TOOLTEST_MAIN h5repack_layout.h5 -l dset_contiguous:CHUNK=3x6 -VERIFY_LAYOUT_DSET h5repack_layout.h5 dset_contiguous CHUNKED +VERIFY_LAYOUT_DSET dset_conti_chunk h5repack_layout.h5 dset_contiguous CHUNKED -l dset_contiguous:CHUNK=3x6 -TOOLTEST_MAIN h5repack_layout.h5 -l dset_contiguous:CONTI -VERIFY_LAYOUT_DSET h5repack_layout.h5 dset_contiguous CONTIGUOUS +VERIFY_LAYOUT_DSET dset_conti_conti h5repack_layout.h5 dset_contiguous CONTIGUOUS -l dset_contiguous:CONTI -TOOLTEST_MAIN h5repack_layout.h5 -l dset_chunk:COMPA -VERIFY_LAYOUT_DSET h5repack_layout.h5 dset_chunk COMPACT +VERIFY_LAYOUT_DSET chunk_compa h5repack_layout.h5 dset_chunk COMPACT -l dset_chunk:COMPA -TOOLTEST_MAIN h5repack_layout.h5 -l dset_chunk:CONTI -VERIFY_LAYOUT_DSET h5repack_layout.h5 dset_chunk CONTIGUOUS +VERIFY_LAYOUT_DSET chunk_conti h5repack_layout.h5 dset_chunk CONTIGUOUS -l dset_chunk:CONTI -TOOLTEST_MAIN h5repack_layout.h5 -l dset_chunk:CHUNK=18x13 -VERIFY_LAYOUT_DSET h5repack_layout.h5 dset_chunk CHUNKED +VERIFY_LAYOUT_DSET chunk_18x13 h5repack_layout.h5 dset_chunk CHUNKED -l dset_chunk:CHUNK=18x13 # test convert small size dataset ( < 1k) to compact layout without -m -TOOLTEST_MAIN h5repack_layout2.h5 -l contig_small:COMPA -VERIFY_LAYOUT_DSET h5repack_layout2.h5 contig_small COMPACT +VERIFY_LAYOUT_DSET contig_small_compa h5repack_layout2.h5 contig_small COMPACT -l contig_small:COMPA -TOOLTEST_MAIN h5repack_layout2.h5 -l chunked_small_fixed:COMPA -VERIFY_LAYOUT_DSET h5repack_layout2.h5 chunked_small_fixed COMPACT +VERIFY_LAYOUT_DSET contig_small_fixed_compa h5repack_layout2.h5 chunked_small_fixed COMPACT -l chunked_small_fixed:COMPA #--------------------------------------------------------------------------- # Test file contains chunked datasets (need multiple dsets) with @@ -806,17 +863,14 @@ VERIFY_LAYOUT_DSET h5repack_layout2.h5 chunked_small_fixed COMPACT # Use first dset to test. #--------------------------------------------------------------------------- # chunk to chunk - specify chunk dim bigger than any current dim -TOOLTEST_MAIN h5repack_layout3.h5 -l chunk_unlimit1:CHUNK=100x300 -VERIFY_LAYOUT_DSET h5repack_layout3.h5 chunk_unlimit1 CHUNK +VERIFY_LAYOUT_DSET chunk2chunk h5repack_layout3.h5 chunk_unlimit1 CHUNK -l chunk_unlimit1:CHUNK=100x300 # chunk to contiguous -TOOLTEST_MAIN h5repack_layout3.h5 -l chunk_unlimit1:CONTI -VERIFY_LAYOUT_DSET h5repack_layout3.h5 chunk_unlimit1 CONTI +VERIFY_LAYOUT_DSET chunk2conti 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) -TOOLTEST_MAIN h5repack_layout3.h5 -l chunk_unlimit1:COMPA -VERIFY_LAYOUT_DSET h5repack_layout3.h5 chunk_unlimit1 CHUNK +VERIFY_LAYOUT_DSET chunk2compa h5repack_layout3.h5 chunk_unlimit1 CHUNK -l chunk_unlimit1:COMPA #-------------------------------------------------------------------------- # Test -f for some specific cases. Chunked dataset with unlimited max dims. @@ -826,24 +880,22 @@ VERIFY_LAYOUT_DSET h5repack_layout3.h5 chunk_unlimit1 CHUNK # - should not change max dims from unlimit # chunk dim is bigger than dataset dim. ( dset size < 64k ) -TOOLTEST_MAIN h5repack_layout3.h5 -f chunk_unlimit1:NONE -VERIFY_LAYOUT_DSET h5repack_layout3.h5 chunk_unlimit1 H5S_UNLIMITED +VERIFY_LAYOUT_DSET error1 h5repack_layout3.h5 chunk_unlimit1 H5S_UNLIMITED -f chunk_unlimit1:NONE # chunk dim is bigger than dataset dim. ( dset size > 64k ) -TOOLTEST_MAIN h5repack_layout3.h5 -f chunk_unlimit2:NONE -VERIFY_LAYOUT_DSET h5repack_layout3.h5 chunk_unlimit2 H5S_UNLIMITED +VERIFY_LAYOUT_DSET error2 h5repack_layout3.h5 chunk_unlimit2 H5S_UNLIMITED -f chunk_unlimit2:NONE # chunk dims are smaller than dataset dims. ( dset size < 64k ) -TOOLTEST_MAIN h5repack_layout3.h5 -f chunk_unlimit3:NONE -VERIFY_LAYOUT_DSET h5repack_layout3.h5 chunk_unlimit3 H5S_UNLIMITED +#TOOLTEST_MAIN h5repack_layout3.h5 -f chunk_unlimit3:NONE +VERIFY_LAYOUT_DSET error3 h5repack_layout3.h5 chunk_unlimit3 H5S_UNLIMITED -f chunk_unlimit3:NONE # file input - should not fail -TOOLTEST h5repack_layout3.h5 -f NONE +TOOLTEST error4 h5repack_layout3.h5 -f NONE # Native option # Do not use FILE1, as the named dtype will be converted to native, and h5diff will # report a difference. -TOOLTEST h5repack_fill.h5 -n -TOOLTEST h5repack_attr.h5 -n +TOOLTEST native_fill h5repack_fill.h5 -n +TOOLTEST native_attr h5repack_attr.h5 -n # latest file format with long switches. use FILE4=h5repack_layout.h5 (no filters) @@ -851,8 +903,7 @@ arg="h5repack_layout.h5 --layout CHUNK=20x10 --filter GZIP=1 --minimum=10 --nati if test $USE_FILTER_DEFLATE != "yes" ; then SKIP $arg else - TOOLTEST_MAIN $arg - VERIFY_LAYOUT_ALL h5repack_layout.h5 CHUNKED + VERIFY_LAYOUT_ALL layout_long_switches h5repack_layout.h5 CHUNKED --layout CHUNK=20x10 --filter GZIP=1 --minimum=10 --native --latest --compact=8 --indexed=6 --ssize=8[:dtype] fi # latest file format with short switches. use FILE4=h5repack_layout.h5 (no filters) @@ -860,8 +911,7 @@ arg="h5repack_layout.h5 -l CHUNK=20x10 -f GZIP=1 -m 10 -n -L -c 8 -d 6 -s 8[:dty if test $USE_FILTER_DEFLATE != "yes" ; then SKIP $arg else - TOOLTEST_MAIN $arg - VERIFY_LAYOUT_ALL h5repack_layout.h5 CHUNKED + VERIFY_LAYOUT_ALL layout_short_switches h5repack_layout.h5 CHUNKED -l CHUNK=20x10 -f GZIP=1 -m 10 -n -L -c 8 -d 6 -s 8[:dtype] fi # several global filters @@ -870,7 +920,7 @@ arg="h5repack_layout.h5 --filter GZIP=1 --filter SHUF" if test $USE_FILTER_DEFLATE != "yes" -o $USE_FILTER_SHUFFLE != "yes" ; then SKIP $arg else - TOOLTEST $arg + TOOLTEST global_filters $arg fi # syntax of -i infile -o outfile @@ -879,46 +929,47 @@ arg="h5repack_layout.h5 -l CHUNK=20x10 -f GZIP=1 -m 10 -n -L -c 8 -d 6 -s 8[:dty if test $USE_FILTER_DEFLATE != "yes" ; then SKIP $arg else - TOOLTEST0 $arg + TOOLTEST0 old_style_layout_short_switches $arg fi # add a userblock to file -arg="h5repack_objs.h5 -u ublock.bin -b 2048" -TOOLTEST $arg +arg="h5repack_objs.h5 -u $TESTDIR/ublock.bin -b 2048" +TOOLTEST add_userblock $arg # add alignment arg="h5repack_objs.h5 -t 1 -a 1 " -TOOLTEST $arg +TOOLTEST add_alignment $arg # Check repacking file with old version of layout message (should get upgraded # to new version and be readable, etc.) -TOOLTEST h5repack_layouto.h5 +TOOLTEST pgrade_layout h5repack_layouto.h5 # test for datum size > H5TOOLS_MALLOCSIZE -TOOLTEST h5repack_objs.h5 -f GZIP=1 +TOOLTEST gt_mallocsize h5repack_objs.h5 -f GZIP=1 # Check repacking file with committed datatypes in odd configurations -TOOLTEST h5repack_named_dtypes.h5 +TOOLTEST committed_dt h5repack_named_dtypes.h5 # tests family driver (file is located in common testfiles folder, uses TOOLTEST1 -TOOLTEST1 tfamily%05d.h5 +TOOLTEST1 family tfamily%05d.h5 # test various references (bug 1814 and 1726) -TOOLTEST h5repack_refs.h5 +TOOLTEST bug1814 h5repack_refs.h5 # test attribute with various references (bug1797 / HDFFV-5932) # the references in attribute of compund or vlen datatype -TOOLTEST h5repack_attr_refs.h5 +TOOLTEST HDFFV-5932 h5repack_attr_refs.h5 # Add test for memory leak in attirbute. This test is verified by CTEST. # 1. leak from vlen string # 2. leak from compound type without reference member # (HDFFV-7840, ) # Note: this test is experimental for sharing test file among tools -TOOLTEST h5diff_attr1.h5 +TOOLTEST HDFFV-7840 h5diff_attr1.h5 # tests for metadata block size option -TOOLTEST_META h5repack_layout.h5 --metadata_block_size=8192 +TOOLTEST_META meta_short h5repack_layout.h5 -M 8192 +TOOLTEST_META meta_long h5repack_layout.h5 --metadata_block_size=8192 if test $nerrors -eq 0 ; then echo "All $TESTNAME tests passed." diff --git a/tools/h5stat/CMakeLists.txt b/tools/h5stat/CMakeLists.txt index 9afb365..447df70 100644 --- a/tools/h5stat/CMakeLists.txt +++ b/tools/h5stat/CMakeLists.txt @@ -99,10 +99,9 @@ IF (BUILD_TESTING) IF (NOT "${last_test}" STREQUAL "") SET_TESTS_PROPERTIES (H5STAT-${resultfile} PROPERTIES DEPENDS ${last_test}) ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "H5STAT-${resultfile}") ELSE (HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( - NAME H5STAT-clear-${resultfile}-objects + NAME H5STAT-${resultfile}-clear-objects COMMAND ${CMAKE_COMMAND} -E remove ${resultfile}.out ${resultfile}.out.err ) @@ -117,7 +116,7 @@ IF (BUILD_TESTING) -D "TEST_REFERENCE=${resultfile}.ddl" -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) - SET_TESTS_PROPERTIES (H5STAT-${resultfile} PROPERTIES DEPENDS "H5STAT-clear-${resultfile}-objects") + SET_TESTS_PROPERTIES (H5STAT-${resultfile} PROPERTIES DEPENDS "H5STAT-${resultfile}-clear-objects") ENDIF (HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (ADD_H5_TEST file) diff --git a/tools/h5stat/Makefile.in b/tools/h5stat/Makefile.in index 389e460..ec77732 100644 --- a/tools/h5stat/Makefile.in +++ b/tools/h5stat/Makefile.in @@ -263,6 +263,7 @@ H5_VERSION = @H5_VERSION@ HADDR_T = @HADDR_T@ HAVE_DMALLOC = @HAVE_DMALLOC@ HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@ +HAVE_PTHREAD = @HAVE_PTHREAD@ HDF5_HL = @HDF5_HL@ HDF5_INTERFACES = @HDF5_INTERFACES@ HDF_CXX = @HDF_CXX@ @@ -314,7 +315,6 @@ PACKAGE_VERSION = @PACKAGE_VERSION@ PARALLEL = @PARALLEL@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ -PTHREAD = @PTHREAD@ RANLIB = @RANLIB@ ROOT = @ROOT@ RUNPARALLEL = @RUNPARALLEL@ diff --git a/tools/lib/Makefile.in b/tools/lib/Makefile.in index 6a76e1d..743e158 100644 --- a/tools/lib/Makefile.in +++ b/tools/lib/Makefile.in @@ -226,6 +226,7 @@ H5_VERSION = @H5_VERSION@ HADDR_T = @HADDR_T@ HAVE_DMALLOC = @HAVE_DMALLOC@ HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@ +HAVE_PTHREAD = @HAVE_PTHREAD@ HDF5_HL = @HDF5_HL@ HDF5_INTERFACES = @HDF5_INTERFACES@ HDF_CXX = @HDF_CXX@ @@ -277,7 +278,6 @@ PACKAGE_VERSION = @PACKAGE_VERSION@ PARALLEL = @PARALLEL@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ -PTHREAD = @PTHREAD@ RANLIB = @RANLIB@ ROOT = @ROOT@ RUNPARALLEL = @RUNPARALLEL@ diff --git a/tools/lib/h5diff_attr.c b/tools/lib/h5diff_attr.c index 130a0d8..4899200 100644 --- a/tools/lib/h5diff_attr.c +++ b/tools/lib/h5diff_attr.c @@ -350,6 +350,13 @@ hsize_t diff_attr(hid_t loc1_id, if( build_match_list_attrs(loc1_id, loc2_id, &match_list_attrs, options) < 0) goto error; + /* if detect any unique extra attr */ + if(match_list_attrs->nattrs_only1 || match_list_attrs->nattrs_only2) + { + /* exit will be 1 */ + options->contents = 0; + } + for(u = 0; u < (unsigned)match_list_attrs->nattrs; u++) { if( (match_list_attrs->attrs[u].exist[0]) && (match_list_attrs->attrs[u].exist[1]) ) diff --git a/tools/lib/h5tools_dump.c b/tools/lib/h5tools_dump.c index f83c664..dbb5f98 100644 --- a/tools/lib/h5tools_dump.c +++ b/tools/lib/h5tools_dump.c @@ -302,7 +302,7 @@ h5tools_dump_simple_data(FILE *stream, const h5tool_format_t *info, hid_t contai */ curr_pos = ctx->sm_pos; - if (region_output && H5Tequal(type, H5T_STD_REF_DSETREG)) { + if (region_output && (size == H5R_DSET_REG_REF_BUF_SIZE)) { for (i = 0; i < nelmts; i++, ctx->cur_elmt++, elmt_counter++) { void* memref = mem + i * size; char ref_name[1024]; diff --git a/tools/lib/h5tools_str.c b/tools/lib/h5tools_str.c index 1646351..e17ae89 100644 --- a/tools/lib/h5tools_str.c +++ b/tools/lib/h5tools_str.c @@ -685,7 +685,8 @@ char * h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t container, hid_t type, void *vp, h5tools_context_t *ctx) { - size_t n, offset, size=0, nelmts, start; + size_t nsize, offset, size=0, nelmts, start; + H5T_sign_t nsign; char *name; unsigned char *ucp_vp = (unsigned char *)vp; char *cp_vp = (char *)vp; @@ -715,15 +716,16 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai /* Append value depending on data type */ start = h5tools_str_len(str); + nsize = H5Tget_size(type); + nsign = H5Tget_sign(type); if (info->raw) { size_t i; - n = H5Tget_size(type); - if (1 == n) { + if (1 == nsize) { h5tools_str_append(str, OPT(info->fmt_raw, "0x%02x"), ucp_vp[0]); } else { - for (i = 0; i < n; i++) { + for (i = 0; i < nsize; i++) { if (i) h5tools_str_append(str, ":"); h5tools_str_append(str, OPT(info->fmt_raw, "%02x"), ucp_vp[i]); @@ -735,20 +737,23 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai return NULL; switch (type_class) { case H5T_FLOAT: - if (H5Tequal(type, H5T_NATIVE_FLOAT)) { + if (sizeof(float) == nsize) { + /* if (H5Tequal(type, H5T_NATIVE_FLOAT)) */ float tempfloat; HDmemcpy(&tempfloat, vp, sizeof(float)); h5tools_str_append(str, OPT(info->fmt_float, "%g"), tempfloat); } - else if (H5Tequal(type, H5T_NATIVE_DOUBLE)) { + else if (sizeof(double) == nsize) { + /* if (H5Tequal(type, H5T_NATIVE_DOUBLE)) */ double tempdouble; HDmemcpy(&tempdouble, vp, sizeof(double)); h5tools_str_append(str, OPT(info->fmt_double, "%g"), tempdouble); #if H5_SIZEOF_LONG_DOUBLE !=0 } - else if (H5Tequal(type, H5T_NATIVE_LDOUBLE)) { + else if (sizeof(long double) == nsize) { + /* if (H5Tequal(type, H5T_NATIVE_LDOUBLE)) */ long double templdouble; HDmemcpy(&templdouble, vp, sizeof(long double)); @@ -833,147 +838,140 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai } break; case H5T_INTEGER: - if (H5Tequal(type, H5T_NATIVE_INT)) { - HDmemcpy(&tempint, vp, sizeof(int)); - if (packed_bits_num) { - if (packed_data_offset >= 8 * sizeof(int)) - tempint = 0; - else - tempint = (tempint >> packed_data_offset) & packed_data_mask; - } - h5tools_str_append(str, OPT(info->fmt_int, "%d"), tempint); - } - else if (H5Tequal(type, H5T_NATIVE_UINT)) { - HDmemcpy(&tempuint, vp, sizeof(unsigned int)); - if (packed_bits_num) { - if (packed_data_offset >= 8 * sizeof(unsigned int)) - tempuint = 0; - else - tempuint = (tempuint >> packed_data_offset) & packed_data_mask; - } - h5tools_str_append(str, OPT(info->fmt_uint, "%u"), tempuint); - } - else if (info->ascii && (H5Tequal(type, H5T_NATIVE_SCHAR) || H5Tequal(type, H5T_NATIVE_UCHAR))) { - h5tools_print_char(str, info, (char) (*ucp_vp)); - } - else if (H5Tequal(type, H5T_NATIVE_SCHAR)) { - signed char tempchar; - HDmemcpy(&tempchar, cp_vp, sizeof(char)); - if (packed_bits_num) { - if (packed_data_offset >= 8 * sizeof(char)) - tempchar = 0; - else - tempchar = (tempchar >> packed_data_offset) & packed_data_mask; - } -#ifdef H5_VMS - h5tools_str_append(str, OPT(info->fmt_schar, "%hd"), tempchar); -#else - h5tools_str_append(str, OPT(info->fmt_schar, "%hhd"), tempchar); -#endif - } - else if (H5Tequal(type, H5T_NATIVE_UCHAR)) { - unsigned char tempuchar; - HDmemcpy(&tempuchar, ucp_vp, sizeof(unsigned char)); - if (packed_bits_num) { - if (packed_data_offset >= 8 * sizeof(unsigned char)) - tempuchar = 0; - else - tempuchar = (tempuchar >> packed_data_offset) & packed_data_mask; - } - h5tools_str_append(str, OPT(info->fmt_uchar, "%u"), tempuchar); - } - else if (H5Tequal(type, H5T_NATIVE_SHORT)) { - short tempshort; - - HDmemcpy(&tempshort, vp, sizeof(short)); - if (packed_bits_num) { - if (packed_data_offset >= 8 * sizeof(short)) - tempshort = 0; - else - tempshort = (tempshort >> packed_data_offset) & packed_data_mask; - } - h5tools_str_append(str, OPT(info->fmt_short, "%d"), tempshort); - } - else if (H5Tequal(type, H5T_NATIVE_USHORT)) { - unsigned short tempushort; - - HDmemcpy(&tempushort, vp, sizeof(unsigned short)); - if (packed_bits_num) { - if (packed_data_offset >= 8 * sizeof(unsigned short)) - tempushort = 0; - else - tempushort = (tempushort >> packed_data_offset) & packed_data_mask; - } - h5tools_str_append(str, OPT(info->fmt_ushort, "%u"), tempushort); - } - else if (H5Tequal(type, H5T_NATIVE_LONG)) { - HDmemcpy(&templong, vp, sizeof(long)); - if (packed_bits_num) { - if (packed_data_offset >= 8 * sizeof(long)) - templong = 0; - else - templong = (templong >> packed_data_offset) & packed_data_mask; + if (sizeof(char) == nsize) { + /* if ((H5Tequal(type, H5T_NATIVE_SCHAR) || H5Tequal(type, H5T_NATIVE_UCHAR))) */ + if (info->ascii) { + h5tools_print_char(str, info, (char) (*ucp_vp)); } - h5tools_str_append(str, OPT(info->fmt_long, "%ld"), templong); - } - else if (H5Tequal(type, H5T_NATIVE_ULONG)) { - HDmemcpy(&tempulong, vp, sizeof(unsigned long)); - if (packed_bits_num) { - if (packed_data_offset >= 8 * sizeof(unsigned long)) - tempulong = 0; - else - tempulong = (tempulong >> packed_data_offset) & packed_data_mask; + else if(H5T_SGN_NONE == nsign) { + /* if (H5Tequal(type, H5T_NATIVE_UCHAR)) */ + unsigned char tempuchar; + HDmemcpy(&tempuchar, ucp_vp, sizeof(unsigned char)); + if (packed_bits_num) { + if (packed_data_offset >= 8 * sizeof(unsigned char)) + tempuchar = 0; + else + tempuchar = (tempuchar >> packed_data_offset) & packed_data_mask; + } + h5tools_str_append(str, OPT(info->fmt_uchar, "%u"), tempuchar); } - h5tools_str_append(str, OPT(info->fmt_ulong, "%lu"), tempulong); - } - else if (H5Tequal(type, H5T_NATIVE_LLONG)) { - HDmemcpy(&templlong, vp, sizeof(long long)); - if (packed_bits_num) { - if (packed_data_offset >= 8 * sizeof(long long)) - templlong = 0; - else - templlong = (templlong >> packed_data_offset) & packed_data_mask; + else { + /* if (H5Tequal(type, H5T_NATIVE_SCHAR)) */ + signed char tempchar; + HDmemcpy(&tempchar, cp_vp, sizeof(char)); + if (packed_bits_num) { + if (packed_data_offset >= 8 * sizeof(char)) + tempchar = 0; + else + tempchar = (tempchar >> packed_data_offset) & packed_data_mask; + } + #ifdef H5_VMS + h5tools_str_append(str, OPT(info->fmt_schar, "%hd"), tempchar); + #else + h5tools_str_append(str, OPT(info->fmt_schar, "%hhd"), tempchar); + #endif } - h5tools_str_append(str, OPT(info->fmt_llong, fmt_llong), templlong); - } - else if (H5Tequal(type, H5T_NATIVE_ULLONG)) { - HDmemcpy(&tempullong, vp, sizeof(unsigned long long)); - if (packed_bits_num) { - if (packed_data_offset >= 8 * sizeof(unsigned long long)) - tempullong = 0; - else - tempullong = (tempullong >> packed_data_offset) & packed_data_mask; + } /* end if (sizeof(char) == nsize) */ + else if (sizeof(int) == nsize) { + if(H5T_SGN_NONE == nsign) { + /* if (H5Tequal(type, H5T_NATIVE_UINT)) */ + HDmemcpy(&tempuint, vp, sizeof(unsigned int)); + if (packed_bits_num) { + if (packed_data_offset >= 8 * sizeof(unsigned int)) + tempuint = 0; + else + tempuint = (tempuint >> packed_data_offset) & packed_data_mask; + } + h5tools_str_append(str, OPT(info->fmt_uint, "%u"), tempuint); } - h5tools_str_append(str, OPT(info->fmt_ullong, fmt_ullong), tempullong); - } - else if (H5Tequal(type, H5T_NATIVE_HSSIZE)) { - if (sizeof(hssize_t) == sizeof(int)) { + else { + /* if (H5Tequal(type, H5T_NATIVE_INT)) */ HDmemcpy(&tempint, vp, sizeof(int)); + if (packed_bits_num) { + if (packed_data_offset >= 8 * sizeof(int)) + tempint = 0; + else + tempint = (tempint >> packed_data_offset) & packed_data_mask; + } h5tools_str_append(str, OPT(info->fmt_int, "%d"), tempint); } - else if (sizeof(hssize_t) == sizeof(long)) { - HDmemcpy(&templong, vp, sizeof(long)); - h5tools_str_append(str, OPT(info->fmt_long, "%ld"), templong); + } /* end if (sizeof(int) == nsize) */ + else if (sizeof(short) == nsize) { + if(H5T_SGN_NONE == nsign) { + /* if (H5Tequal(type, H5T_NATIVE_USHORT)) */ + unsigned short tempushort; + + HDmemcpy(&tempushort, vp, sizeof(unsigned short)); + if (packed_bits_num) { + if (packed_data_offset >= 8 * sizeof(unsigned short)) + tempushort = 0; + else + tempushort = (tempushort >> packed_data_offset) & packed_data_mask; + } + h5tools_str_append(str, OPT(info->fmt_ushort, "%u"), tempushort); } else { - HDmemcpy(&templlong, vp, sizeof(long long)); - h5tools_str_append(str, OPT(info->fmt_llong, fmt_llong), templlong); - } - } - else if (H5Tequal(type, H5T_NATIVE_HSIZE)) { - if (sizeof(hsize_t) == sizeof(int)) { - HDmemcpy(&tempuint, vp, sizeof(unsigned int)); - h5tools_str_append(str, OPT(info->fmt_uint, "%u"), tempuint); + /* if (H5Tequal(type, H5T_NATIVE_SHORT)) */ + short tempshort; + + HDmemcpy(&tempshort, vp, sizeof(short)); + if (packed_bits_num) { + if (packed_data_offset >= 8 * sizeof(short)) + tempshort = 0; + else + tempshort = (tempshort >> packed_data_offset) & packed_data_mask; + } + h5tools_str_append(str, OPT(info->fmt_short, "%d"), tempshort); } - else if (sizeof(hsize_t) == sizeof(long)) { - HDmemcpy(&tempulong, vp, sizeof(long)); + } /* end if (sizeof(short) == nsize) */ + else if (sizeof(long) == nsize) { + if(H5T_SGN_NONE == nsign) { + /* if (H5Tequal(type, H5T_NATIVE_ULONG)) */ + HDmemcpy(&tempulong, vp, sizeof(unsigned long)); + if (packed_bits_num) { + if (packed_data_offset >= 8 * sizeof(unsigned long)) + tempulong = 0; + else + tempulong = (tempulong >> packed_data_offset) & packed_data_mask; + } h5tools_str_append(str, OPT(info->fmt_ulong, "%lu"), tempulong); } else { + /* if (H5Tequal(type, H5T_NATIVE_LONG)) */ + HDmemcpy(&templong, vp, sizeof(long)); + if (packed_bits_num) { + if (packed_data_offset >= 8 * sizeof(long)) + templong = 0; + else + templong = (templong >> packed_data_offset) & packed_data_mask; + } + h5tools_str_append(str, OPT(info->fmt_long, "%ld"), templong); + } + } /* end if (sizeof(long) == nsize) */ + else if (sizeof(long long) == nsize) { + if(H5T_SGN_NONE == nsign) { + /* if (H5Tequal(type, H5T_NATIVE_ULLONG)) */ HDmemcpy(&tempullong, vp, sizeof(unsigned long long)); + if (packed_bits_num) { + if (packed_data_offset >= 8 * sizeof(unsigned long long)) + tempullong = 0; + else + tempullong = (tempullong >> packed_data_offset) & packed_data_mask; + } h5tools_str_append(str, OPT(info->fmt_ullong, fmt_ullong), tempullong); } - } + else { + /* if (H5Tequal(type, H5T_NATIVE_LLONG)) */ + HDmemcpy(&templlong, vp, sizeof(long long)); + if (packed_bits_num) { + if (packed_data_offset >= 8 * sizeof(long long)) + templlong = 0; + else + templlong = (templlong >> packed_data_offset) & packed_data_mask; + } + h5tools_str_append(str, OPT(info->fmt_llong, fmt_llong), templlong); + } + } /* end if (sizeof(long long) == nsize) */ break; case H5T_COMPOUND: { @@ -1024,75 +1022,71 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai } else { size_t i; - n = H5Tget_size(type); - if (1 == n) { + if (1 == nsize) { h5tools_str_append(str, "0x%02x", ucp_vp[0]); } else { - for (i = 0; i < n; i++) + for (i = 0; i < nsize; i++) h5tools_str_append(str, "%s%02x", i ? ":" : "", ucp_vp[i]); } } } break; case H5T_REFERENCE: - if (H5Tequal(type, H5T_STD_REF_DSETREG)) { - if (h5tools_str_is_zero(vp, H5Tget_size(type))) { - h5tools_str_append(str, "NULL"); - } - else { - h5tools_str_sprint_region(str, info, container, vp); - } + if (h5tools_str_is_zero(vp, nsize)) { + h5tools_str_append(str, "NULL"); } - else if (H5Tequal(type, H5T_STD_REF_OBJ)) { - /* - * Object references -- show the type and OID of the referenced - * object. - */ - if (h5tools_str_is_zero(vp, H5Tget_size(type))) { - h5tools_str_append(str, "NULL"); + else { + if (nsize == H5R_DSET_REG_REF_BUF_SIZE) { + /* if (H5Tequal(type, H5T_STD_REF_DSETREG)) */ + h5tools_str_sprint_region(str, info, container, vp); } - else { - H5O_info_t oi; - const char *path; - - obj = H5Rdereference2(container, H5P_DEFAULT, H5R_OBJECT, vp); - H5Oget_info(obj, &oi); - - /* Print object type and close object */ - switch (oi.type) { - case H5O_TYPE_GROUP: - h5tools_str_append(str, H5_TOOLS_GROUP); - break; - - case H5O_TYPE_DATASET: - h5tools_str_append(str, H5_TOOLS_DATASET); - break; - - case H5O_TYPE_NAMED_DATATYPE: - h5tools_str_append(str, H5_TOOLS_DATATYPE); - break; - - default: - h5tools_str_append(str, "%u-", (unsigned) oi.type); - break; - } /* end switch */ - H5Oclose(obj); - - /* Print OID */ - if (info->obj_hidefileno) - h5tools_str_append(str, info->obj_format, oi.addr); - else - h5tools_str_append(str, info->obj_format, oi.fileno, oi.addr); - - /* Print name */ - path = lookup_ref_path(*(haddr_t *) vp); - if (path) { - h5tools_str_append(str, " "); - h5tools_str_append(str, path); - h5tools_str_append(str, " "); - } /* end if */ - } /* end else */ + else if (nsize == H5R_OBJ_REF_BUF_SIZE) { + /* if (H5Tequal(type, H5T_STD_REF_OBJ)) */ + /* + * Object references -- show the type and OID of the referenced + * object. + */ + H5O_info_t oi; + const char *path; + + obj = H5Rdereference2(container, H5P_DEFAULT, H5R_OBJECT, vp); + H5Oget_info(obj, &oi); + + /* Print object type and close object */ + switch (oi.type) { + case H5O_TYPE_GROUP: + h5tools_str_append(str, H5_TOOLS_GROUP); + break; + + case H5O_TYPE_DATASET: + h5tools_str_append(str, H5_TOOLS_DATASET); + break; + + case H5O_TYPE_NAMED_DATATYPE: + h5tools_str_append(str, H5_TOOLS_DATATYPE); + break; + + default: + h5tools_str_append(str, "%u-", (unsigned) oi.type); + break; + } /* end switch */ + H5Oclose(obj); + + /* Print OID */ + if (info->obj_hidefileno) + h5tools_str_append(str, info->obj_format, oi.addr); + else + h5tools_str_append(str, info->obj_format, oi.fileno, oi.addr); + + /* Print name */ + path = lookup_ref_path(*(haddr_t *) vp); + if (path) { + h5tools_str_append(str, " "); + h5tools_str_append(str, path); + h5tools_str_append(str, " "); + } /* end if */ + } /* end else if (H5Tequal(type, H5T_STD_REF_OBJ)) */ } break; case H5T_ARRAY: @@ -1206,12 +1200,11 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai { /* All other types get printed as hexadecimal */ size_t i; - n = H5Tget_size(type); - if (1 == n) { + if (1 == nsize) { h5tools_str_append(str, "0x%02x", ucp_vp[0]); } else { - for (i = 0; i < n; i++) + for (i = 0; i < nsize; i++) h5tools_str_append(str, "%s%02x", i ? ":" : "", ucp_vp[i]); } } diff --git a/tools/misc/CMakeLists.txt b/tools/misc/CMakeLists.txt index d310d3d..e778d2f 100644 --- a/tools/misc/CMakeLists.txt +++ b/tools/misc/CMakeLists.txt @@ -62,7 +62,7 @@ IF (BUILD_TESTING) SET_TARGET_PROPERTIES (h5repart_test PROPERTIES FOLDER tools) # -------------------------------------------------------------------- - # Copy all the HDF5 files from the test directory into the source directory + # Copy all the HDF5 files from the source directory into the test directory # -------------------------------------------------------------------- SET (HDF5_REFERENCE_TEST_FILES family_file00000.h5 @@ -97,37 +97,43 @@ IF (BUILD_TESTING) ENDFOREACH (h5_file ${HDF5_REFERENCE_TEST_FILES}) SET (HDF5_MKGRP_TEST_FILES - #h5mkgrp_help + #h5mkgrp_help.txt #h5mkgrp_version - h5mkgrp_single - h5mkgrp_single_latest - h5mkgrp_several - h5mkgrp_several_latest - h5mkgrp_nested - h5mkgrp_nested_latest - h5mkgrp_nested_mult - h5mkgrp_nested_mult_latest + h5mkgrp_single.ls + h5mkgrp_single_v.ls + h5mkgrp_single_p.ls + h5mkgrp_single_l.ls + h5mkgrp_several.ls + h5mkgrp_several_v.ls + h5mkgrp_several_p.ls + h5mkgrp_several_l.ls + h5mkgrp_nested_p.ls + h5mkgrp_nested_lp.ls + h5mkgrp_nested_mult_p.ls + h5mkgrp_nested_mult_lp.ls ) - FILE (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/../testfiles") + # make test dir + FILE (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") + FOREACH (h5_mkgrp_file ${HDF5_MKGRP_TEST_FILES}) - SET (dest "${PROJECT_BINARY_DIR}/${h5_mkgrp_file}") + SET (dest "${PROJECT_BINARY_DIR}/testfiles/${h5_mkgrp_file}") #MESSAGE (STATUS " Copying ${h5_mkgrp_file}") ADD_CUSTOM_COMMAND ( TARGET h5mkgrp POST_BUILD - COMMAND ${XLATE_UTILITY} - ARGS ${HDF5_TOOLS_SRC_DIR}/testfiles/${h5_mkgrp_file}.ls ${dest}.ls -l3 + COMMAND ${CMAKE_COMMAND} + ARGS -E copy_if_different ${HDF5_TOOLS_SRC_DIR}/testfiles/${h5_mkgrp_file} ${dest} ) ENDFOREACH (h5_mkgrp_file ${HDF5_MKGRP_TEST_FILES}) ADD_CUSTOM_COMMAND ( TARGET h5mkgrp POST_BUILD - COMMAND ${XLATE_UTILITY} - ARGS ${PROJECT_SOURCE_DIR}/testfiles/h5mkgrp_help.txt ${PROJECT_BINARY_DIR}/h5mkgrp_help.txt -l0 + COMMAND ${CMAKE_COMMAND} + ARGS -E copy_if_different ${PROJECT_SOURCE_DIR}/testfiles/h5mkgrp_help.txt ${PROJECT_BINARY_DIR}/testfiles/h5mkgrp_help.txt ) - CONFIGURE_FILE (${PROJECT_SOURCE_DIR}/testfiles/h5mkgrp_version.txt.in ${PROJECT_BINARY_DIR}/h5mkgrp_version.txt @ONLY) + CONFIGURE_FILE (${PROJECT_SOURCE_DIR}/testfiles/h5mkgrp_version.txt.in ${PROJECT_BINARY_DIR}/testfiles/h5mkgrp_version.txt @ONLY) ############################################################################## ############################################################################## @@ -136,102 +142,71 @@ IF (BUILD_TESTING) ############################################################################## MACRO (ADD_H5_TEST resultfile resultcode resultoption) - IF (NOT ${resultoption} STREQUAL " ") - ADD_TEST ( - NAME H5MKGRP-clear-${resultfile}${resultoption} - COMMAND ${CMAKE_COMMAND} - -E remove - ${PROJECT_BINARY_DIR}/../testfiles/${resultfile}.h5 - ${PROJECT_BINARY_DIR}/${resultfile}.out - ${PROJECT_BINARY_DIR}/${resultfile}.out.err - ) - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5MKGRP-clear-${resultfile}${resultoption} PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - ADD_TEST ( - NAME H5MKGRP-${resultfile}${resultoption} - COMMAND $ ${resultoption} ${PROJECT_BINARY_DIR}/../testfiles/${resultfile}.h5 ${ARGN} - ) - SET_TESTS_PROPERTIES (H5MKGRP-${resultfile}${resultoption} PROPERTIES DEPENDS H5MKGRP-clear-${resultfile}${resultoption}) - SET (last_test "H5MKGRP-${resultfile}${resultoption}") - IF (NOT HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( - NAME H5MKGRP-h5ls-${resultfile}${resultoption} - COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$" - -D "TEST_ARGS:STRING=-v;-r;../testfiles/${resultfile}.h5" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" - -D "TEST_OUTPUT=${resultfile}.out" - -D "TEST_EXPECT=${resultcode}" - -D "TEST_MASK_MOD=true" - -D "TEST_REFERENCE=${resultfile}.ls" - -P "${HDF5_RESOURCES_DIR}/runTest.cmake" - ) - SET_TESTS_PROPERTIES (H5MKGRP-h5ls-${resultfile}${resultoption} PROPERTIES DEPENDS H5MKGRP-${resultfile}${resultoption}) - SET (last_test "H5MKGRP-h5ls-${resultfile}${resultoption}") - ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) - ELSE (NOT ${resultoption} STREQUAL " ") + IF (NOT HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( - NAME H5MKGRP-clear-${resultfile} + NAME H5MKGRP-${resultfile}-clear-objects COMMAND ${CMAKE_COMMAND} -E remove - ${PROJECT_BINARY_DIR}/../testfiles/${resultfile}.h5 - ${PROJECT_BINARY_DIR}/${resultfile}.out - ${PROJECT_BINARY_DIR}/${resultfile}.out.err + ${resultfile}.h5 + ${resultfile}.out + ${resultfile}.out.err ) + SET_TESTS_PROPERTIES (H5MKGRP-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") + ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) + + ADD_TEST ( + NAME H5MKGRP-${resultfile} + COMMAND $ ${resultoption} ${resultfile}.h5 ${ARGN} + ) + SET_TESTS_PROPERTIES (H5MKGRP-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") + IF (HDF5_ENABLE_USING_MEMCHECKER) IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5MKGRP-clear-${resultfile} PROPERTIES DEPENDS ${last_test}) + SET_TESTS_PROPERTIES (H5MKGRP-${resultfile} PROPERTIES DEPENDS ${last_test}) ENDIF (NOT "${last_test}" STREQUAL "") + ELSE (HDF5_ENABLE_USING_MEMCHECKER) + SET_TESTS_PROPERTIES (H5MKGRP-${resultfile} PROPERTIES DEPENDS H5MKGRP-${resultfile}-clear-objects) ADD_TEST ( - NAME H5MKGRP-${resultfile} - COMMAND $ ${PROJECT_BINARY_DIR}/../testfiles/${resultfile}.h5 ${ARGN} + NAME H5MKGRP-${resultfile}-h5ls + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=-v;-r;${resultfile}.h5" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" + -D "TEST_OUTPUT=${resultfile}.out" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_MASK_MOD=true" + -D "TEST_REFERENCE=${resultfile}.ls" + -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) - SET_TESTS_PROPERTIES (H5MKGRP-${resultfile} PROPERTIES DEPENDS H5MKGRP-clear-${resultfile}) - SET (last_test "H5MKGRP-${resultfile}") - IF (NOT HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( - NAME H5MKGRP-h5ls-${resultfile} - COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$" - -D "TEST_ARGS:STRING=-v;-r;../testfiles/${resultfile}.h5" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" - -D "TEST_OUTPUT=${resultfile}.out" - -D "TEST_EXPECT=${resultcode}" - -D "TEST_MASK_MOD=true" - -D "TEST_REFERENCE=${resultfile}.ls" - -P "${HDF5_RESOURCES_DIR}/runTest.cmake" - ) - SET_TESTS_PROPERTIES (H5MKGRP-h5ls-${resultfile} PROPERTIES DEPENDS H5MKGRP-${resultfile}) - SET (last_test "H5MKGRP-h5ls-${resultfile}") - ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) - ENDIF (NOT ${resultoption} STREQUAL " ") + SET_TESTS_PROPERTIES (H5MKGRP-${resultfile}-h5ls PROPERTIES DEPENDS H5MKGRP-${resultfile}) + ENDIF (HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (ADD_H5_TEST resultfile resultcode resultoption) MACRO (ADD_H5_CMP resultfile resultcode) - ADD_TEST ( - NAME H5MKGRP_CMP-clear-${resultfile} - COMMAND ${CMAKE_COMMAND} - -E remove - ${PROJECT_BINARY_DIR}/../testfiles/${resultfile}.h5 - ${PROJECT_BINARY_DIR}/${resultfile}.out - ${PROJECT_BINARY_DIR}/${resultfile}.out.err - ) IF (HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST (NAME H5MKGRP_CMP-${resultfile} COMMAND $ ${ARGN}) ELSE (HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( + NAME H5MKGRP_CMP-${resultfile}-clear-objects + COMMAND ${CMAKE_COMMAND} + -E remove + ${resultfile}.h5 + ${resultfile}.out + ${resultfile}.out.err + ) + SET_TESTS_PROPERTIES (H5MKGRP_CMP-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") + ADD_TEST ( NAME H5MKGRP_CMP-${resultfile} COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$" -D "TEST_ARGS:STRING=${ARGN}" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" -D "TEST_OUTPUT=${resultfile}.out" -D "TEST_EXPECT=${resultcode}" -D "TEST_REFERENCE=${resultfile}.txt" -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) + SET_TESTS_PROPERTIES (H5MKGRP_CMP-${resultfile} PROPERTIES DEPENDS H5MKGRP_CMP-${resultfile}-clear-objects) ENDIF (HDF5_ENABLE_USING_MEMCHECKER) - SET_TESTS_PROPERTIES (H5MKGRP_CMP-${resultfile} PROPERTIES DEPENDS H5MKGRP_CMP-clear-${resultfile}) ENDMACRO (ADD_H5_CMP resultfile resultcode) ############################################################################## @@ -242,71 +217,115 @@ IF (BUILD_TESTING) # Remove any output file left over from previous test run ADD_TEST ( - NAME h5repart_20K-clear-objects - COMMAND ${CMAKE_COMMAND} - -E remove - fst_family00000.h5 + NAME H5REPART-clearall-objects + COMMAND ${CMAKE_COMMAND} + -E remove + fst_family00000.h5 + scd_family00000.h5 + scd_family00001.h5 + scd_family00002.h5 + scd_family00003.h5 + family_to_sec2.h5 ) + IF (NOT "${last_test}" STREQUAL "") + SET_TESTS_PROPERTIES (H5REPART-clearall-objects PROPERTIES DEPENDS ${last_test}) + ENDIF (NOT "${last_test}" STREQUAL "") + SET (last_test "H5REPART-clearall-objects") + # repartition family member size to 20,000 bytes. - ADD_TEST (NAME h5repart_20K COMMAND $ -m 20000 family_file%05d.h5 fst_family%05d.h5) - SET_TESTS_PROPERTIES (h5repart_20K PROPERTIES DEPENDS h5repart_20K-clear-objects) + ADD_TEST (NAME H5REPART-h5repart_20K COMMAND $ -m 20000 family_file%05d.h5 fst_family%05d.h5) + SET_TESTS_PROPERTIES (H5REPART-h5repart_20K PROPERTIES DEPENDS H5REPART-clearall-objects) - # Remove any output file left over from previous test run - ADD_TEST ( - NAME h5repart_5K-clear-objects - COMMAND ${CMAKE_COMMAND} - -E remove - scd_family00000.h5 - scd_family00001.h5 - scd_family00002.h5 - scd_family00003.h5 - ) - SET_TESTS_PROPERTIES (h5repart_5K-clear-objects PROPERTIES DEPENDS h5repart_20K) # repartition family member size to 5 KB. - ADD_TEST (NAME h5repart_5K COMMAND $ -m 5k family_file%05d.h5 scd_family%05d.h5) - SET_TESTS_PROPERTIES (h5repart_5K PROPERTIES DEPENDS h5repart_5K-clear-objects) + ADD_TEST (NAME H5REPART-h5repart_5K COMMAND $ -m 5k family_file%05d.h5 scd_family%05d.h5) + SET_TESTS_PROPERTIES (H5REPART-h5repart_5K PROPERTIES DEPENDS H5REPART-clearall-objects) - # Remove any output file left over from previous test run - ADD_TEST ( - NAME h5repart_sec2-clear-objects - COMMAND ${CMAKE_COMMAND} - -E remove - family_to_sec2.h5 - ) - SET_TESTS_PROPERTIES (h5repart_sec2-clear-objects PROPERTIES DEPENDS h5repart_5K) # convert family file to sec2 file of 20,000 bytes - ADD_TEST (NAME h5repart_sec2 COMMAND $ -m 20000 -family_to_sec2 family_file%05d.h5 family_to_sec2.h5) - SET_TESTS_PROPERTIES (h5repart_sec2 PROPERTIES DEPENDS h5repart_sec2-clear-objects) + ADD_TEST (NAME H5REPART-h5repart_sec2 COMMAND $ -m 20000 -family_to_sec2 family_file%05d.h5 family_to_sec2.h5) + SET_TESTS_PROPERTIES (H5REPART-h5repart_sec2 PROPERTIES DEPENDS H5REPART-clearall-objects) # test the output files repartitioned above. - ADD_TEST (NAME h5repart_test COMMAND $) - SET_TESTS_PROPERTIES (h5repart_test PROPERTIES DEPENDS h5repart_sec2) + ADD_TEST (NAME H5REPART-h5repart_test COMMAND $) + SET_TESTS_PROPERTIES (H5REPART-h5repart_test PROPERTIES DEPENDS H5REPART-clearall-objects DEPENDS H5REPART-h5repart_20K DEPENDS H5REPART-h5repart_5K DEPENDS H5REPART-h5repart_sec2) SET (H5_DEP_EXECUTABLES ${H5_DEP_EXECUTABLES} h5repart_test ) + + IF (HDF5_ENABLE_USING_MEMCHECKER) + ADD_TEST ( + NAME H5MKGRP-clearall-objects + COMMAND ${CMAKE_COMMAND} + -E remove + h5mkgrp_help.out + h5mkgrp_help.out.err + h5mkgrp_version.out + h5mkgrp_version.out.err + h5mkgrp_single.h5 + h5mkgrp_single.out + h5mkgrp_single.out.err + h5mkgrp_single_v.h5 + h5mkgrp_single_v.out + h5mkgrp_single_v.out.err + h5mkgrp_single_p.h5 + h5mkgrp_single_p.out + h5mkgrp_single_p.out.err + h5mkgrp_single_l.h5 + h5mkgrp_single_l.out + h5mkgrp_single_l.out.err + h5mkgrp_several.h5 + h5mkgrp_several.out + h5mkgrp_several.out.err + h5mkgrp_several_v.h5 + h5mkgrp_several_v.out + h5mkgrp_several_v.out.err + h5mkgrp_several_p.h5 + h5mkgrp_several_p.out + h5mkgrp_several_p.out.err + h5mkgrp_several_l.h5 + h5mkgrp_several_l.out + h5mkgrp_several_l.out.err + h5mkgrp_nested_p.h5 + h5mkgrp_nested_p.out + h5mkgrp_nested_p.out.err + h5mkgrp_nested_lp.h5 + h5mkgrp_nested_lp.out + h5mkgrp_nested_lp.out.err + h5mkgrp_nested_mult_p.h5 + h5mkgrp_nested_mult_p.out + h5mkgrp_nested_mult_p.out.err + h5mkgrp_nested_mult_lp.h5 + h5mkgrp_nested_mult_lp.out + h5mkgrp_nested_mult_lp.out.err + ) + SET_TESTS_PROPERTIES (H5MKGRP-clearall-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") + IF (NOT "${last_test}" STREQUAL "") + SET_TESTS_PROPERTIES (H5MKGRP-clearall-objects PROPERTIES DEPENDS ${last_test}) + ENDIF (NOT "${last_test}" STREQUAL "") + SET (last_test "H5MKGRP-clearall-objects") + ENDIF (HDF5_ENABLE_USING_MEMCHECKER) # Check that help & version is displayed properly ADD_H5_CMP (h5mkgrp_help 0 "-h") ADD_H5_CMP (h5mkgrp_version 0 "-V") # Create single group at root level - ADD_H5_TEST (h5mkgrp_single 0 " " single) - ADD_H5_TEST (h5mkgrp_single 0 "-v" single) - ADD_H5_TEST (h5mkgrp_single 0 "-p" single) - ADD_H5_TEST (h5mkgrp_single_latest 0 "-l" latest) + ADD_H5_TEST (h5mkgrp_single 0 "" single) + ADD_H5_TEST (h5mkgrp_single_v 0 "-v" single) + ADD_H5_TEST (h5mkgrp_single_p 0 "-p" single) + ADD_H5_TEST (h5mkgrp_single_l 0 "-l" latest) # Create several groups at root level - ADD_H5_TEST (h5mkgrp_several 0 " " one two) - ADD_H5_TEST (h5mkgrp_several 0 "-v" one two) - ADD_H5_TEST (h5mkgrp_several 0 "-p" one two) - ADD_H5_TEST (h5mkgrp_several_latest 0 "-l" one two) + ADD_H5_TEST (h5mkgrp_several 0 "" one two) + ADD_H5_TEST (h5mkgrp_several_v 0 "-v" one two) + ADD_H5_TEST (h5mkgrp_several_p 0 "-p" one two) + ADD_H5_TEST (h5mkgrp_several_l 0 "-l" one two) # Create various nested groups - ADD_H5_TEST (h5mkgrp_nested 0 "-p" /one/two) - ADD_H5_TEST (h5mkgrp_nested_latest 0 "-lp" /one/two) - ADD_H5_TEST (h5mkgrp_nested_mult 0 "-p" /one/two /three/four) - ADD_H5_TEST (h5mkgrp_nested_mult_latest 0 "-lp" /one/two /three/four) + ADD_H5_TEST (h5mkgrp_nested_p 0 "-p" /one/two) + ADD_H5_TEST (h5mkgrp_nested_lp 0 "-lp" /one/two) + ADD_H5_TEST (h5mkgrp_nested_mult_p 0 "-p" /one/two /three/four) + ADD_H5_TEST (h5mkgrp_nested_mult_lp 0 "-lp" /one/two /three/four) ENDIF (BUILD_TESTING) ############################################################################## diff --git a/tools/misc/Makefile.in b/tools/misc/Makefile.in index 8c2e1c1..3320276 100644 --- a/tools/misc/Makefile.in +++ b/tools/misc/Makefile.in @@ -288,6 +288,7 @@ H5_VERSION = @H5_VERSION@ HADDR_T = @HADDR_T@ HAVE_DMALLOC = @HAVE_DMALLOC@ HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@ +HAVE_PTHREAD = @HAVE_PTHREAD@ HDF5_HL = @HDF5_HL@ HDF5_INTERFACES = @HDF5_INTERFACES@ HDF_CXX = @HDF_CXX@ @@ -339,7 +340,6 @@ PACKAGE_VERSION = @PACKAGE_VERSION@ PARALLEL = @PARALLEL@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ -PTHREAD = @PTHREAD@ RANLIB = @RANLIB@ ROOT = @ROOT@ RUNPARALLEL = @RUNPARALLEL@ diff --git a/tools/misc/testh5mkgrp.sh.in b/tools/misc/testh5mkgrp.sh.in index dc127e8..5ec1a28 100644 --- a/tools/misc/testh5mkgrp.sh.in +++ b/tools/misc/testh5mkgrp.sh.in @@ -31,15 +31,85 @@ H5LS=h5ls # The h5ls tool name H5LS_ARGS=-vr # Arguments to the h5ls tool H5LS_BIN=`pwd`/../h5ls/$H5LS # The path of the h5ls tool binary +CMP='cmp' +DIFF='diff -c' +CP='cp' +DIRNAME='dirname' +LS='ls' +AWK='awk' + nerrors=0 verbose=yes -INDIR=$srcdir/../testfiles -OUTDIR=../testfiles +# source dirs +SRC_TOOLS="$srcdir/../" + +SRC_TOOLS_TESTFILES="$SRC_TOOLS/testfiles" +# testfiles source dirs for tools +SRC_H5MKGRP_TESTFILES="$SRC_TOOLS/misc/testfiles" + +TESTDIR=./testfiles +test -d $TESTDIR || mkdir -p $TESTDIR + +###################################################################### +# test files +# -------------------------------------------------------------------- +# All the test files copy from source directory to test directory +# NOTE: Keep this framework to add/remove test files. +# Any test files from other tools can be used in this framework. +# This list are also used for checking exist. +# Comment '#' without space can be used. +# -------------------------------------------------------------------- + CMP='cmp -s' DIFF='diff -c' -test -d $OUTDIR || mkdir $OUTDIR +# +# copy test files and expected output files from source dirs to test dir +# +COPY_TESTFILES=" +$SRC_H5MKGRP_TESTFILES/h5mkgrp_help.txt +$SRC_TOOLS_TESTFILES/h5mkgrp_single.ls +$SRC_TOOLS_TESTFILES/h5mkgrp_single_v.ls +$SRC_TOOLS_TESTFILES/h5mkgrp_single_p.ls +$SRC_TOOLS_TESTFILES/h5mkgrp_single_l.ls +$SRC_TOOLS_TESTFILES/h5mkgrp_several.ls +$SRC_TOOLS_TESTFILES/h5mkgrp_several_v.ls +$SRC_TOOLS_TESTFILES/h5mkgrp_several_p.ls +$SRC_TOOLS_TESTFILES/h5mkgrp_several_l.ls +$SRC_TOOLS_TESTFILES/h5mkgrp_nested_p.ls +$SRC_TOOLS_TESTFILES/h5mkgrp_nested_lp.ls +$SRC_TOOLS_TESTFILES/h5mkgrp_nested_mult_p.ls +$SRC_TOOLS_TESTFILES/h5mkgrp_nested_mult_lp.ls +" + +COPY_TESTFILES_TO_TESTDIR() +{ + # copy test files. Used -f to make sure get a new copy + for tstfile in $COPY_TESTFILES + do + # ignore '#' comment + echo $tstfile | tr -d ' ' | grep '^#' > /dev/null + RET=$? + if [ $RET -eq 1 ]; then + # skip cp if srcdir is same as destdir + # this occurs when build/test performed in source dir and + # make cp fail + SDIR=`$DIRNAME $tstfile` + INODE_SDIR=`$LS -i -d $SDIR | $AWK -F' ' '{print $1}'` + INODE_DDIR=`$LS -i -d $TESTDIR | $AWK -F' ' '{print $1}'` + if [ "$INODE_SDIR" != "$INODE_DDIR" ]; then + $CP -f $tstfile $TESTDIR + if [ $? -ne 0 ]; then + echo "Error: FAILED to copy $tstfile ." + + # Comment out this to CREATE expected file + exit $EXIT_FAILURE + fi + fi + fi + done +} # Print a line-line message left justified in a field of 70 characters # beginning with the word "Testing". @@ -71,9 +141,7 @@ TOOLTEST() { TESTING $H5MKGRP $@ ( - echo "#############################" - echo " output for '$H5MKGRP $@'" - echo "#############################" + cd $TESTDIR $RUNSERIAL $H5MKGRP_BIN $@ ) > output.out RET=$? @@ -96,17 +164,15 @@ TOOLTEST() # H5LSTEST() { - expect="$INDIR/`basename $1 .h5`.ls" - actual="$OUTDIR/`basename $1 .h5`.out" + expect="$TESTDIR/`basename $1 .h5`.ls" + actual="$TESTDIR/`basename $1 .h5`.out" actual_sav=${actual}-sav # Stderr is included in stdout so that the diff can detect # any unexpected output from that stream too. VERIFY_H5LS $@ ( - echo "#############################" - echo "Expected output for '$H5LS $@'" - echo "#############################" + cd $TESTDIR $RUNSERIAL $H5LS_BIN $H5LS_ARGS $@ ) 2>&1 |sed 's/Modified:.*/Modified: XXXX-XX-XX XX:XX:XX XXX/' >$actual @@ -142,7 +208,7 @@ H5LSTEST() # $* are groups to create RUNTEST() { - FILEOUT=$OUTDIR/$1 + FILEOUT=$1 shift H5MKGRP_ARGS=$1 shift @@ -158,9 +224,8 @@ RUNTEST() # Remove output file created, if the "no cleanup" environment variable is # not defined -echo "FILEOUT=" $FILEOUT if test -z "$HDF5_NOCLEANUP"; then - rm -f $FILEOUT + rm -f $TESTDIR/$FILEOUT fi } @@ -172,16 +237,17 @@ echo "FILEOUT=" $FILEOUT # $* are groups to create CMPTEST() { - FILEOUT=$OUTDIR/$1 - expect="$srcdir/testfiles/`basename $1 .h5`.txt" - actual="$OUTDIR/`basename $1 .h5`.out" - actual_err="$OUTDIR/`basename $1 .h5`.err" + FILEOUT=$1 + expect="$TESTDIR/`basename $1 .h5`.txt" + actual="$TESTDIR/`basename $1 .h5`.out" + actual_err="$TESTDIR/`basename $1 .h5`.err" shift # Stderr is included in stdout so that the diff can detect # any unexpected output from that stream too. TESTING $H5MKGRP $@ ( + cd $TESTDIR $RUNSERIAL $H5MKGRP_BIN $@ ) >$actual 2>$actual_err cat $actual_err >> $actual @@ -208,28 +274,30 @@ CMPTEST() ############################################################################## ### T H E T E S T S ### ############################################################################## +# prepare for test +COPY_TESTFILES_TO_TESTDIR # Check that help & version is displayed properly CMPTEST h5mkgrp_help.h5 "-h" -RUNTEST h5mkgrp_version.h5 "-V" +#CMPTEST h5mkgrp_version.h5 "-V" # Create single group at root level RUNTEST h5mkgrp_single.h5 " " single -RUNTEST h5mkgrp_single.h5 "-v" single -RUNTEST h5mkgrp_single.h5 "-p" single -RUNTEST h5mkgrp_single_latest.h5 "-l" latest +RUNTEST h5mkgrp_single_v.h5 "-v" single +RUNTEST h5mkgrp_single_p.h5 "-p" single +RUNTEST h5mkgrp_single_l.h5 "-l" latest # Create several groups at root level RUNTEST h5mkgrp_several.h5 " " one two -RUNTEST h5mkgrp_several.h5 "-v" one two -RUNTEST h5mkgrp_several.h5 "-p" one two -RUNTEST h5mkgrp_several_latest.h5 "-l" one two +RUNTEST h5mkgrp_several_v.h5 "-v" one two +RUNTEST h5mkgrp_several_p.h5 "-p" one two +RUNTEST h5mkgrp_several_l.h5 "-l" one two # Create various nested groups -RUNTEST h5mkgrp_nested.h5 "-p" /one/two -RUNTEST h5mkgrp_nested_latest.h5 "-lp" /one/two -RUNTEST h5mkgrp_nested_mult.h5 "-p" /one/two /three/four -RUNTEST h5mkgrp_nested_mult_latest.h5 "-lp" /one/two /three/four +RUNTEST h5mkgrp_nested_p.h5 "-p" /one/two +RUNTEST h5mkgrp_nested_lp.h5 "-lp" /one/two +RUNTEST h5mkgrp_nested_mult_p.h5 "-p" /one/two /three/four +RUNTEST h5mkgrp_nested_mult_lp.h5 "-lp" /one/two /three/four if test $nerrors -eq 0 ; then diff --git a/tools/testfiles/h5mkgrp_help.ls b/tools/testfiles/h5mkgrp_help.ls deleted file mode 100644 index ad2bd0f..0000000 --- a/tools/testfiles/h5mkgrp_help.ls +++ /dev/null @@ -1,4 +0,0 @@ -############################# -Expected output for 'h5ls ../testfiles/h5mkgrp_help.h5' -############################# -../testfiles/h5mkgrp_help.h5: unable to open file diff --git a/tools/testfiles/h5mkgrp_nested.ls b/tools/testfiles/h5mkgrp_nested.ls deleted file mode 100644 index 472656d..0000000 --- a/tools/testfiles/h5mkgrp_nested.ls +++ /dev/null @@ -1,13 +0,0 @@ -############################# -Expected output for 'h5ls ../testfiles/h5mkgrp_nested.h5' -############################# -Opened "../testfiles/h5mkgrp_nested.h5" with sec2 driver. -/ Group - Location: 1:96 - Links: 1 -/one Group - Location: 1:800 - Links: 1 -/one/two Group - Location: 1:1832 - Links: 1 diff --git a/tools/testfiles/h5mkgrp_nested_latest.ls b/tools/testfiles/h5mkgrp_nested_latest.ls deleted file mode 100644 index c00292d..0000000 --- a/tools/testfiles/h5mkgrp_nested_latest.ls +++ /dev/null @@ -1,16 +0,0 @@ -############################# -Expected output for 'h5ls ../testfiles/h5mkgrp_nested_latest.h5' -############################# -Opened "../testfiles/h5mkgrp_nested_latest.h5" with sec2 driver. -/ Group - Location: 1:48 - Links: 1 - Modified: XXXX-XX-XX XX:XX:XX XXX -/one Group - Location: 1:195 - Links: 1 - Modified: XXXX-XX-XX XX:XX:XX XXX -/one/two Group - Location: 1:342 - Links: 1 - Modified: XXXX-XX-XX XX:XX:XX XXX diff --git a/tools/testfiles/h5mkgrp_nested_lp.ls b/tools/testfiles/h5mkgrp_nested_lp.ls new file mode 100644 index 0000000..1fe8ce8 --- /dev/null +++ b/tools/testfiles/h5mkgrp_nested_lp.ls @@ -0,0 +1,13 @@ +Opened "h5mkgrp_nested_lp.h5" with sec2 driver. +/ Group + Location: 1:48 + Links: 1 + Modified: XXXX-XX-XX XX:XX:XX XXX +/one Group + Location: 1:195 + Links: 1 + Modified: XXXX-XX-XX XX:XX:XX XXX +/one/two Group + Location: 1:342 + Links: 1 + Modified: XXXX-XX-XX XX:XX:XX XXX diff --git a/tools/testfiles/h5mkgrp_nested_mult.ls b/tools/testfiles/h5mkgrp_nested_mult.ls deleted file mode 100644 index 6a22ffd..0000000 --- a/tools/testfiles/h5mkgrp_nested_mult.ls +++ /dev/null @@ -1,19 +0,0 @@ -############################# -Expected output for 'h5ls ../testfiles/h5mkgrp_nested_mult.h5' -############################# -Opened "../testfiles/h5mkgrp_nested_mult.h5" with sec2 driver. -/ Group - Location: 1:96 - Links: 1 -/one Group - Location: 1:800 - Links: 1 -/one/two Group - Location: 1:1832 - Links: 1 -/three Group - Location: 1:2864 - Links: 1 -/three/four Group - Location: 1:3568 - Links: 1 diff --git a/tools/testfiles/h5mkgrp_nested_mult_latest.ls b/tools/testfiles/h5mkgrp_nested_mult_latest.ls deleted file mode 100644 index 0b19ff9..0000000 --- a/tools/testfiles/h5mkgrp_nested_mult_latest.ls +++ /dev/null @@ -1,24 +0,0 @@ -############################# -Expected output for 'h5ls ../testfiles/h5mkgrp_nested_mult_latest.h5' -############################# -Opened "../testfiles/h5mkgrp_nested_mult_latest.h5" with sec2 driver. -/ Group - Location: 1:48 - Links: 1 - Modified: XXXX-XX-XX XX:XX:XX XXX -/one Group - Location: 1:195 - Links: 1 - Modified: XXXX-XX-XX XX:XX:XX XXX -/one/two Group - Location: 1:342 - Links: 1 - Modified: XXXX-XX-XX XX:XX:XX XXX -/three Group - Location: 1:489 - Links: 1 - Modified: XXXX-XX-XX XX:XX:XX XXX -/three/four Group - Location: 1:636 - Links: 1 - Modified: XXXX-XX-XX XX:XX:XX XXX diff --git a/tools/testfiles/h5mkgrp_nested_mult_lp.ls b/tools/testfiles/h5mkgrp_nested_mult_lp.ls new file mode 100644 index 0000000..50380ec --- /dev/null +++ b/tools/testfiles/h5mkgrp_nested_mult_lp.ls @@ -0,0 +1,21 @@ +Opened "h5mkgrp_nested_mult_lp.h5" with sec2 driver. +/ Group + Location: 1:48 + Links: 1 + Modified: XXXX-XX-XX XX:XX:XX XXX +/one Group + Location: 1:195 + Links: 1 + Modified: XXXX-XX-XX XX:XX:XX XXX +/one/two Group + Location: 1:342 + Links: 1 + Modified: XXXX-XX-XX XX:XX:XX XXX +/three Group + Location: 1:489 + Links: 1 + Modified: XXXX-XX-XX XX:XX:XX XXX +/three/four Group + Location: 1:636 + Links: 1 + Modified: XXXX-XX-XX XX:XX:XX XXX diff --git a/tools/testfiles/h5mkgrp_nested_mult_p.ls b/tools/testfiles/h5mkgrp_nested_mult_p.ls new file mode 100644 index 0000000..f2b3b4b --- /dev/null +++ b/tools/testfiles/h5mkgrp_nested_mult_p.ls @@ -0,0 +1,16 @@ +Opened "h5mkgrp_nested_mult_p.h5" with sec2 driver. +/ Group + Location: 1:96 + Links: 1 +/one Group + Location: 1:800 + Links: 1 +/one/two Group + Location: 1:1832 + Links: 1 +/three Group + Location: 1:2864 + Links: 1 +/three/four Group + Location: 1:3568 + Links: 1 diff --git a/tools/testfiles/h5mkgrp_nested_p.ls b/tools/testfiles/h5mkgrp_nested_p.ls new file mode 100644 index 0000000..3034dbb --- /dev/null +++ b/tools/testfiles/h5mkgrp_nested_p.ls @@ -0,0 +1,10 @@ +Opened "h5mkgrp_nested_p.h5" with sec2 driver. +/ Group + Location: 1:96 + Links: 1 +/one Group + Location: 1:800 + Links: 1 +/one/two Group + Location: 1:1832 + Links: 1 diff --git a/tools/testfiles/h5mkgrp_several.ls b/tools/testfiles/h5mkgrp_several.ls index bbf5c92..68a3f9c 100644 --- a/tools/testfiles/h5mkgrp_several.ls +++ b/tools/testfiles/h5mkgrp_several.ls @@ -1,7 +1,4 @@ -############################# -Expected output for 'h5ls ../testfiles/h5mkgrp_several.h5' -############################# -Opened "../testfiles/h5mkgrp_several.h5" with sec2 driver. +Opened "h5mkgrp_several.h5" with sec2 driver. / Group Location: 1:96 Links: 1 diff --git a/tools/testfiles/h5mkgrp_several_l.ls b/tools/testfiles/h5mkgrp_several_l.ls new file mode 100644 index 0000000..5e1b4be --- /dev/null +++ b/tools/testfiles/h5mkgrp_several_l.ls @@ -0,0 +1,13 @@ +Opened "h5mkgrp_several_l.h5" with sec2 driver. +/ Group + Location: 1:48 + Links: 1 + Modified: XXXX-XX-XX XX:XX:XX XXX +/one Group + Location: 1:195 + Links: 1 + Modified: XXXX-XX-XX XX:XX:XX XXX +/two Group + Location: 1:342 + Links: 1 + Modified: XXXX-XX-XX XX:XX:XX XXX diff --git a/tools/testfiles/h5mkgrp_several_latest.ls b/tools/testfiles/h5mkgrp_several_latest.ls deleted file mode 100644 index a3b5224..0000000 --- a/tools/testfiles/h5mkgrp_several_latest.ls +++ /dev/null @@ -1,16 +0,0 @@ -############################# -Expected output for 'h5ls ../testfiles/h5mkgrp_several_latest.h5' -############################# -Opened "../testfiles/h5mkgrp_several_latest.h5" with sec2 driver. -/ Group - Location: 1:48 - Links: 1 - Modified: XXXX-XX-XX XX:XX:XX XXX -/one Group - Location: 1:195 - Links: 1 - Modified: XXXX-XX-XX XX:XX:XX XXX -/two Group - Location: 1:342 - Links: 1 - Modified: XXXX-XX-XX XX:XX:XX XXX diff --git a/tools/testfiles/h5mkgrp_several_p.ls b/tools/testfiles/h5mkgrp_several_p.ls new file mode 100644 index 0000000..43f1ce5 --- /dev/null +++ b/tools/testfiles/h5mkgrp_several_p.ls @@ -0,0 +1,10 @@ +Opened "h5mkgrp_several_p.h5" with sec2 driver. +/ Group + Location: 1:96 + Links: 1 +/one Group + Location: 1:800 + Links: 1 +/two Group + Location: 1:1832 + Links: 1 diff --git a/tools/testfiles/h5mkgrp_several_v.ls b/tools/testfiles/h5mkgrp_several_v.ls new file mode 100644 index 0000000..a6df87b --- /dev/null +++ b/tools/testfiles/h5mkgrp_several_v.ls @@ -0,0 +1,10 @@ +Opened "h5mkgrp_several_v.h5" with sec2 driver. +/ Group + Location: 1:96 + Links: 1 +/one Group + Location: 1:800 + Links: 1 +/two Group + Location: 1:1832 + Links: 1 diff --git a/tools/testfiles/h5mkgrp_single.ls b/tools/testfiles/h5mkgrp_single.ls index e9932f7..f2bd01c 100644 --- a/tools/testfiles/h5mkgrp_single.ls +++ b/tools/testfiles/h5mkgrp_single.ls @@ -1,7 +1,4 @@ -############################# -Expected output for 'h5ls ../testfiles/h5mkgrp_single.h5' -############################# -Opened "../testfiles/h5mkgrp_single.h5" with sec2 driver. +Opened "h5mkgrp_single.h5" with sec2 driver. / Group Location: 1:96 Links: 1 diff --git a/tools/testfiles/h5mkgrp_single_l.ls b/tools/testfiles/h5mkgrp_single_l.ls new file mode 100644 index 0000000..1763a61 --- /dev/null +++ b/tools/testfiles/h5mkgrp_single_l.ls @@ -0,0 +1,9 @@ +Opened "h5mkgrp_single_l.h5" with sec2 driver. +/ Group + Location: 1:48 + Links: 1 + Modified: XXXX-XX-XX XX:XX:XX XXX +/latest Group + Location: 1:195 + Links: 1 + Modified: XXXX-XX-XX XX:XX:XX XXX diff --git a/tools/testfiles/h5mkgrp_single_latest.ls b/tools/testfiles/h5mkgrp_single_latest.ls deleted file mode 100644 index b6e6ea4..0000000 --- a/tools/testfiles/h5mkgrp_single_latest.ls +++ /dev/null @@ -1,12 +0,0 @@ -############################# -Expected output for 'h5ls ../testfiles/h5mkgrp_single_latest.h5' -############################# -Opened "../testfiles/h5mkgrp_single_latest.h5" with sec2 driver. -/ Group - Location: 1:48 - Links: 1 - Modified: XXXX-XX-XX XX:XX:XX XXX -/latest Group - Location: 1:195 - Links: 1 - Modified: XXXX-XX-XX XX:XX:XX XXX diff --git a/tools/testfiles/h5mkgrp_single_p.ls b/tools/testfiles/h5mkgrp_single_p.ls new file mode 100644 index 0000000..e82dc31 --- /dev/null +++ b/tools/testfiles/h5mkgrp_single_p.ls @@ -0,0 +1,7 @@ +Opened "h5mkgrp_single_p.h5" with sec2 driver. +/ Group + Location: 1:96 + Links: 1 +/single Group + Location: 1:800 + Links: 1 diff --git a/tools/testfiles/h5mkgrp_single_v.ls b/tools/testfiles/h5mkgrp_single_v.ls new file mode 100644 index 0000000..7360865 --- /dev/null +++ b/tools/testfiles/h5mkgrp_single_v.ls @@ -0,0 +1,7 @@ +Opened "h5mkgrp_single_v.h5" with sec2 driver. +/ Group + Location: 1:96 + Links: 1 +/single Group + Location: 1:800 + Links: 1 diff --git a/tools/testfiles/h5mkgrp_version.ls b/tools/testfiles/h5mkgrp_version.ls deleted file mode 100644 index 907f0ad..0000000 --- a/tools/testfiles/h5mkgrp_version.ls +++ /dev/null @@ -1,4 +0,0 @@ -############################# -Expected output for 'h5ls ../testfiles/h5mkgrp_version.h5' -############################# -../testfiles/h5mkgrp_version.h5: unable to open file diff --git a/vms/src/h5pubconf.h b/vms/src/h5pubconf.h index 7787026..57f358d 100644 --- a/vms/src/h5pubconf.h +++ b/vms/src/h5pubconf.h @@ -502,7 +502,7 @@ #define H5_PACKAGE_NAME "HDF5" /* Define to the full name and version of this package. */ -#define H5_PACKAGE_STRING "HDF5 1.9.144" +#define H5_PACKAGE_STRING "HDF5 1.9.148" /* Define to the one symbol short name of this package. */ #define H5_PACKAGE_TARNAME "hdf5" @@ -511,7 +511,7 @@ #define H5_PACKAGE_URL "" /* Define to the version of this package. */ -#define H5_PACKAGE_VERSION "1.9.144" +#define H5_PACKAGE_VERSION "1.9.148" /* Width for printf() for type `long long' or `__int64', use `ll' */ #define H5_PRINTF_LL_WIDTH "ll" @@ -674,7 +674,7 @@ /* #undef H5_USING_MEMCHECKER */ /* Version number of package */ -#define H5_VERSION "1.9.144" +#define H5_VERSION "1.9.148" /* Define if vsnprintf() returns the correct value for formatted strings that don't fit into size allowed */ -- cgit v0.12 From e37ee97a58733d3739d5e2588bdea9a1453fa023 Mon Sep 17 00:00:00 2001 From: Raymond Lu Date: Thu, 14 Mar 2013 15:00:48 -0500 Subject: [svn-r23350] I cleaned up some code and added comments for my previous checkin of the DESY project. Tested on koala. --- src/H5PL.c | 66 +++++++++++++++++++++++++++------------------ src/H5PLpkg.h | 3 +++ src/H5PLpublic.h | 1 + src/H5Zpublic.h | 4 ++- test/plugin.c | 56 +++++++++++++++++--------------------- test/plugin_lib/Makefile.in | 19 +++++++++++++ test/plugin_lib/dynlib1.c | 21 +++++++++++++++ test/plugin_lib/dynlib1.h | 26 ++++++++++++++++++ test/test_plugin.sh.in | 5 +++- 9 files changed, 142 insertions(+), 59 deletions(-) diff --git a/src/H5PL.c b/src/H5PL.c index 4bf059c..afa1785 100644 --- a/src/H5PL.c +++ b/src/H5PL.c @@ -57,7 +57,7 @@ H5PL_init_interface(void) /*------------------------------------------------------------------------- * Function: H5PL_term_interface * - * Purpose: Terminate the H5I interface: release all memory, reset all + * Purpose: Terminate the H5PL interface: release all memory, reset all * global variables to initial values. This only happens if all * types have been destroyed from other interfaces. * @@ -69,6 +69,8 @@ H5PL_init_interface(void) * Programmer: Raymond Lu * 20 February 2013 * + * Modifications: + * *------------------------------------------------------------------------- */ int @@ -80,16 +82,17 @@ H5PL_term_interface(void) FUNC_ENTER_NOAPI_NOINIT_NOERR if(H5_interface_initialize_g) { - /* Free the table of dynamic libraries */ + /* Close opened dynamic libraries */ for(i=0; id_name, "lib", 3) && HDstrstr(dp->d_name, ".so")) { pathname = (char *)H5MM_malloc(strlen(dir) + strlen(dp->d_name) + 2); HDstrncpy(pathname, dir, strlen(dir)+1); @@ -248,21 +257,25 @@ H5PL_find(H5PL_type_t plugin_type, int type_id, char *dir, void **info) if(HDstat(pathname, &my_stat) == -1) HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "can't stat file: %s", strerror(errno)) - if(!S_ISDIR(my_stat.st_mode)) { /* if directory, skip it */ + if(!S_ISDIR(my_stat.st_mode)) { /* if it is a directory, skip it */ if(NULL == (handle = dlopen(pathname, RTLD_NOW|RTLD_LAZY))) { /*fprintf(stderr, "not open dl library: %s", dlerror());*/ - if(!HDstrcmp(dp->d_name, "libbogus2.so")) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCOPY, FAIL, "can't open dl library: %s", dlerror()) - else - continue; + /* There are different reasons why a library can't be open, e.g. wrong architecture. + * simply continue if we can't open it */ + continue; } - dlerror(); /*clear error*/ + dlerror(); /*clear error*/ + + /* Return a handle for the function H5PL_get_plugin_info in the dynamic library. + * The plugin library is suppose to define this function. */ if(NULL == (H5PL_get_plugin_info = dlsym(handle, "H5PL_get_plugin_info"))) { if(H5PL_close(handle) < 0) HGOTO_ERROR(H5E_PLUGIN, H5E_CLOSEERROR, FAIL, "can't close dynamic library") } + /* Envoke H5PL_get_plugin_info to verify this is the right library we are looking for. + * Move on if it isn't. */ if(H5PL_get_plugin_info) { if(NULL == (plugin_info = (*H5PL_get_plugin_info)())) { if(H5PL_close(handle) < 0) @@ -289,13 +302,13 @@ H5PL_find(H5PL_type_t plugin_type, int type_id, char *dir, void **info) if(pathname) pathname = (char *)H5MM_xfree(pathname); } - } - - if(HDclosedir(dirp) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CLOSEERROR, FAIL, "can't close directory: %s", strerror(errno)) - dirp = NULL; } + if(HDclosedir(dirp) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CLOSEERROR, FAIL, "can't close directory: %s", strerror(errno)) + dirp = NULL; + } + done: if(pathname) @@ -310,7 +323,8 @@ done: /*------------------------------------------------------------------------- * Function: H5PL_search_table * - * Purpose: + * Purpose: Search in the list of already opened dynamic libraries + * to see if the one we are looking for is already opened. * * Return: TRUE on success, * FALSE on not found, @@ -355,7 +369,7 @@ fprintf(stderr, "%s: H5PL_table_used_g=%d, id=%d\n", FUNC, H5PL_table_used_g, (H } } - /* Expand the table if it is small */ + /* Expand the table if it is too small */ if(H5PL_table_used_g >= H5PL_table_alloc_g) { size_t n = MAX(H5Z_MAX_NFILTERS, 2*H5PL_table_alloc_g); H5PL_table_t *table = (H5PL_table_t *)H5MM_realloc(H5PL_table_g, n * sizeof(H5PL_table_t)); @@ -375,7 +389,7 @@ done: /*------------------------------------------------------------------------- * Function: H5PL_close * - * Purpose: + * Purpose: Closes the handle for dynamic library * * Return: Non-negative on success/Negative on failure * diff --git a/src/H5PLpkg.h b/src/H5PLpkg.h index adbe38a..dae4c59 100644 --- a/src/H5PLpkg.h +++ b/src/H5PLpkg.h @@ -29,6 +29,7 @@ /* Local typedefs */ /****************************/ +/* Type for the list of info for opened plugin libraries */ typedef struct H5PL_table_t { H5PL_type_t pl_type; /* plugin type */ int pl_id; /* ID for the plugin */ @@ -39,10 +40,12 @@ typedef struct H5PL_table_t { /* Local variables */ /****************************/ +/* Table for opened plugin libraries */ static size_t H5PL_table_alloc_g = 0; static size_t H5PL_table_used_g = 0; static H5PL_table_t *H5PL_table_g = NULL; +/* Table of location paths for plugin libraries */ static char *path_table[MAX_PATH_NUM]; static size_t num_paths = 0; static htri_t path_found = FALSE; diff --git a/src/H5PLpublic.h b/src/H5PLpublic.h index 1f21f88..4c4a669 100644 --- a/src/H5PLpublic.h +++ b/src/H5PLpublic.h @@ -27,6 +27,7 @@ /* Library Public Typedefs */ /****************************/ +/* Plugin type */ typedef enum H5PL_type_t { H5PL_TYPE_ERROR = -1, /*error */ H5PL_TYPE_FILTER = 0, /*filter */ diff --git a/src/H5Zpublic.h b/src/H5Zpublic.h index b5ac475..24496e4 100644 --- a/src/H5Zpublic.h +++ b/src/H5Zpublic.h @@ -43,10 +43,12 @@ typedef int H5Z_filter_t; #define H5Z_FILTER_SCALEOFFSET 6 /*scale+offset compression */ #define H5Z_FILTER_RESERVED 256 /*filter ids below this value are reserved for library use */ +/* Filters for HDF5 internal test */ #define H5Z_FILTER_DYNLIB1 257 #define H5Z_FILTER_DYNLIB2 258 -#define H5Z_FILTER_BZIP2 300 +/* Registered third-party filters */ +#define H5Z_FILTER_BZIP2 307 #define H5Z_FILTER_MAX 65535 /*maximum filter id */ diff --git a/test/plugin.c b/test/plugin.c index 4385916..debc38b 100644 --- a/test/plugin.c +++ b/test/plugin.c @@ -188,7 +188,7 @@ int points_deflate[DSET_DIM1][DSET_DIM2], /*------------------------------------------------------------------------- * Function: test_filter_internal * - * Purpose: Tests + * Purpose: Tests writing entire data and partial data with filters * * Return: Success: 0 * Failure: -1 @@ -417,6 +417,8 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl, hsize_t *dset_size PASSED(); + /* Save the data written to the file for later comparison when the file + * is reopened for read test */ for(i=0; i #include #include #define FILTER_DYNLIB1_VERS 1 +const H5PL_type_t H5PL_get_plugin_type(void); +const int H5PL_get_plugin_version(void); +const char* H5PL_get_plugin_name(void); +const H5Z_class2_t* H5PL_get_plugin_info(void); + /* Local prototypes for filter functions */ static size_t H5Z_filter_dynlib1(unsigned int flags, size_t cd_nelmts, const unsigned int *cd_values, size_t nbytes, size_t *buf_size, void **buf); diff --git a/test/test_plugin.sh.in b/test/test_plugin.sh.in index a1287a5..a881198 100644 --- a/test/test_plugin.sh.in +++ b/test/test_plugin.sh.in @@ -13,7 +13,10 @@ # http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have # access to either file, you may request a copy from help@hdfgroup.org. # -# Tests for test_error and err_compat +# This script file first envokes the Makefile in plugin_lib to build dynamic +# plugin libraries. Then it moves the libraries to some locations and points +# HDF5_PLUGIN_PATH to these locations. In the end, it runs plugin.c test. +# srcdir=@srcdir@ TOP_BUILDDIR=@top_builddir@ -- cgit v0.12 From c1ddb82ac1d160d59d32f9a012dbffd11911292b Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Fri, 15 Mar 2013 10:28:32 -0500 Subject: [svn-r23356] Correct target name --- tools/lib/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/lib/CMakeLists.txt b/tools/lib/CMakeLists.txt index f0d0d01..ce8a5fa 100644 --- a/tools/lib/CMakeLists.txt +++ b/tools/lib/CMakeLists.txt @@ -46,7 +46,7 @@ H5_SET_LIB_OPTIONS ( HDF5_TOOLS_LIB_NAME_DEBUG ) #SET_TARGET_PROPERTIES (hdf5_tools PROPERTIES COMPILE_DEFINITIONS H5DIFF_DEBUG) -SET_TARGET_PROPERTIES (hdf5_tools PROPERTIES FOLDER libraries/tools) +SET_TARGET_PROPERTIES (${HDF5_TOOLS_LIB_TARGET} PROPERTIES FOLDER libraries/tools) ############################################################################## ############################################################################## -- cgit v0.12 From 2923f64c28650e55833dd9d9a088dd7c4804e3e8 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Fri, 15 Mar 2013 13:28:37 -0500 Subject: [svn-r23357] HDFFV-8338: Add cmake support, this commit only tested for linux Tested: local linux --- src/CMakeLists.txt | 16 +++++++++ test/CMakeLists.txt | 15 +++++++++ test/plugin_lib/CMakeLists.txt | 74 ++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 105 insertions(+) create mode 100644 test/plugin_lib/CMakeLists.txt diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index f964992..e560004 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -477,6 +477,16 @@ SET (H5P_HDRS ) IDE_GENERATED_PROPERTIES ("H5P" "${H5P_HDRS}" "${H5P_SRCS}" ) +SET (H5PL_SRCS + ${HDF5_SRC_DIR}/H5PL.c +) + +SET (H5PL_HDRS + ${HDF5_SRC_DIR}/H5PLpkg.h + ${HDF5_SRC_DIR}/H5PLpublic.h +) +IDE_GENERATED_PROPERTIES ("H5PL" "${H5PL_HDRS}" "${H5PL_SRCS}" ) + SET (H5R_SRCS ${HDF5_SRC_DIR}/H5R.c @@ -662,6 +672,7 @@ SET (common_SRCS ${H5MP_SRCS} ${H5O_SRCS} ${H5P_SRCS} + ${H5PL_SRCS} ${H5R_SRCS} ${H5RC_SRCS} ${H5RS_SRCS} @@ -701,6 +712,7 @@ SET (H5_PUBLIC_HEADERS ${H5MP_HDRS} ${H5O_HDRS} ${H5P_HDRS} + ${H5PL_HDRS} ${H5R_HDRS} ${H5S_HDRS} ${H5SM_HDRS} @@ -739,6 +751,7 @@ SET (H5_PRIVATE_HEADERS ${HDF5_SRC_DIR}/H5MPprivate.h ${HDF5_SRC_DIR}/H5Oprivate.h ${HDF5_SRC_DIR}/H5Pprivate.h + ${HDF5_SRC_DIR}/H5PLprivate.h ${HDF5_SRC_DIR}/H5RCprivate.h ${HDF5_SRC_DIR}/H5Rprivate.h ${HDF5_SRC_DIR}/H5RSprivate.h @@ -825,6 +838,9 @@ SET_SOURCE_FILES_PROPERTIES (${HDF5_BINARY_DIR}/H5overflow.h GENERATED) ADD_LIBRARY (${HDF5_LIB_TARGET} ${LIB_TYPE} ${common_SRCS} ${H5_PUBLIC_HEADERS} ${H5_PRIVATE_HEADERS}) TARGET_LINK_LIBRARIES (${HDF5_LIB_TARGET} ${LINK_LIBS}) +IF (NOT WIN32) + TARGET_LINK_LIBRARIES (${HDF5_LIB_TARGET} dl) +ENDIF (NOT WIN32) SET_GLOBAL_VARIABLE (HDF5_LIBRARIES_TO_EXPORT ${HDF5_LIB_TARGET}) H5_SET_LIB_OPTIONS (${HDF5_LIB_TARGET} ${HDF5_LIB_NAME} ${LIB_TYPE}) SET_TARGET_PROPERTIES (${HDF5_LIB_TARGET} PROPERTIES FOLDER libraries) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 6af1e94..d104978 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -7,6 +7,21 @@ PROJECT (HDF5_TEST) ADD_DEFINITIONS (${HDF5_EXTRA_C_FLAGS}) #----------------------------------------------------------------------------- +# If plugin library tests can be tested +#----------------------------------------------------------------------------- +IF (BUILD_SHARED_LIBS) + IF (EXISTS "${HDF5_TEST_SOURCE_DIR}/plugin_lib" AND IS_DIRECTORY "${HDF5_TEST_SOURCE_DIR}/plugin_lib") + ADD_SUBDIRECTORY (${HDF5_TEST_SOURCE_DIR}/plugin_lib ${PROJECT_BINARY_DIR}/plugin_lib) + ENDIF (EXISTS "${HDF5_TEST_SOURCE_DIR}/plugin_lib" AND IS_DIRECTORY "${HDF5_TEST_SOURCE_DIR}/plugin_lib") +ELSE (BUILD_SHARED_LIBS) + MESSAGE (STATUS " **** Plugins libraries must be built as shared libraries **** ") + ADD_TEST ( + NAME H5PLUGIN-SKIPPED + COMMAND ${CMAKE_COMMAND} -E echo "SKIP H5PLUGIN TESTING" + ) +ENDIF (BUILD_SHARED_LIBS) + +#----------------------------------------------------------------------------- # Define Sources #----------------------------------------------------------------------------- SET (TEST_LIB_SRCS diff --git a/test/plugin_lib/CMakeLists.txt b/test/plugin_lib/CMakeLists.txt new file mode 100644 index 0000000..f39e2df --- /dev/null +++ b/test/plugin_lib/CMakeLists.txt @@ -0,0 +1,74 @@ +cmake_minimum_required (VERSION 2.8.10) +PROJECT (HDF5_TEST_PLUGIN_LIB) + +#----------------------------------------------------------------------------- +# Set the core name of the library +#----------------------------------------------------------------------------- +SET (HDF5_TEST_PLUGIN_LIB_CORENAME "dynlib1") + +#----------------------------------------------------------------------------- +# Set the true names of all the libraries if customized by external project +#----------------------------------------------------------------------------- +SET (HDF5_TEST_PLUGIN_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_TEST_PLUGIN_LIB_CORENAME}") + +#----------------------------------------------------------------------------- +# Set the target names of all the libraries +#----------------------------------------------------------------------------- +SET (HDF5_TEST_PLUGIN_LIB_TARGET ${HDF5_TEST_PLUGIN_LIB_CORENAME}) + +#----------------------------------------------------------------------------- +# Apply Definitions to compiler in this directory and below +#----------------------------------------------------------------------------- +ADD_DEFINITIONS (${HDF5_EXTRA_C_FLAGS}) + +#----------------------------------------------------------------------------- +# Setup include Directories +#----------------------------------------------------------------------------- +INCLUDE_DIRECTORIES (${HDF5_SRC_DIR}) + +#----------------------------------------------------------------------------- +# Define Sources +#----------------------------------------------------------------------------- + +SET (H5_TEST_PLUGIN_LIB_SRCS + ${HDF5_TEST_PLUGIN_LIB_SOURCE_DIR}/dynlib1.c +) + +SET (H5_TEST_PLUGIN_LIB_HDRS + ${HDF5_TEST_PLUGIN_LIB_SOURCE_DIR}/dynlib1.h + ${HDF5_TEST_SOURCE_DIR}/H5srcdir.h + ${HDF5_TEST_SOURCE_DIR}/h5test.h +) + +#----------------------------------------------------------------------------- +# Generate the H5srcdir_str.h file containing user settings needed by compilation +#----------------------------------------------------------------------------- +SET (srcdir ${CMAKE_CURRENT_SOURCE_DIR}) +CONFIGURE_FILE (${HDF5_TEST_SOURCE_DIR}/H5srcdir_str.h.in H5srcdir_str.h @ONLY) +INCLUDE_DIRECTORIES (${CMAKE_CURRENT_BINARY_DIR}) + +ADD_LIBRARY (${HDF5_TEST_PLUGIN_LIB_TARGET} ${LIB_TYPE} ${H5_TEST_PLUGIN_LIB_SRCS} ${H5_TEST_PLUGIN_LIB_HDRS}) +TARGET_LINK_LIBRARIES (${HDF5_TEST_PLUGIN_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) +#SET_GLOBAL_VARIABLE( HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_TEST_PLUGIN_LIB_TARGET}") +H5_SET_LIB_OPTIONS ( + ${HDF5_TEST_PLUGIN_LIB_TARGET} ${HDF5_TEST_PLUGIN_LIB_NAME} + ${LIB_TYPE} + HDF5_TEST_PLUGIN_LIB_NAME_RELEASE + HDF5_TEST_PLUGIN_LIB_NAME_DEBUG +) +SET_TARGET_PROPERTIES (${HDF5_TEST_PLUGIN_LIB_TARGET} PROPERTIES FOLDER libraries/TEST_PLUGIN) + +############################################################################## +############################################################################## +### T E S T S ### +############################################################################## +############################################################################## + +#-- Adding test for plugin +ADD_EXECUTABLE (plugin ${HDF5_TEST_SOURCE_DIR}/plugin.c) +TARGET_NAMING (plugin ${LIB_TYPE}) +TARGET_LINK_LIBRARIES (plugin ${HDF5_TEST_PLUGIN_LIB_TARGET}) +SET_TARGET_PROPERTIES (plugin PROPERTIES FOLDER test) + +ADD_TEST (NAME H5PLUGIN-plugin COMMAND $) +SET_TESTS_PROPERTIES (H5PLUGIN-plugin PROPERTIES ENVIRONMENT HDF5_PLUGIN_PATH=${CMAKE_BINARY_DIR}/bin) -- cgit v0.12 From 7f44286aa57f7b67c47608022c1a48dfd71c98ad Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Fri, 15 Mar 2013 14:10:16 -0500 Subject: [svn-r23358] correct env var value for test --- test/plugin_lib/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/plugin_lib/CMakeLists.txt b/test/plugin_lib/CMakeLists.txt index f39e2df..6a6f4a7 100644 --- a/test/plugin_lib/CMakeLists.txt +++ b/test/plugin_lib/CMakeLists.txt @@ -71,4 +71,4 @@ TARGET_LINK_LIBRARIES (plugin ${HDF5_TEST_PLUGIN_LIB_TARGET}) SET_TARGET_PROPERTIES (plugin PROPERTIES FOLDER test) ADD_TEST (NAME H5PLUGIN-plugin COMMAND $) -SET_TESTS_PROPERTIES (H5PLUGIN-plugin PROPERTIES ENVIRONMENT HDF5_PLUGIN_PATH=${CMAKE_BINARY_DIR}/bin) +SET_TESTS_PROPERTIES (H5PLUGIN-plugin PROPERTIES ENVIRONMENT HDF5_PLUGIN_PATH=${CMAKE_RUNTIME_OUTPUT_DIRECTORY}) -- cgit v0.12 From f6f202dc71e0837c2bb721cb8fc8c6dd6ddded3a Mon Sep 17 00:00:00 2001 From: Raymond Lu Date: Fri, 15 Mar 2013 16:25:30 -0500 Subject: [svn-r23359] I added some macros and refactoring the code to prepare for Windows support. Tested on koala. --- src/H5Edefin.h | 1 + src/H5Einit.h | 5 ++ src/H5Epubgen.h | 2 + src/H5Eterm.h | 3 +- src/H5PL.c | 215 ++++++++++++++++++++++++++-------------------- src/H5PLpkg.h | 71 ++++++++++++++- src/H5PLprivate.h | 1 - src/H5err.txt | 3 + test/plugin_lib/dynlib1.c | 2 - test/plugin_lib/dynlib1.h | 2 - 10 files changed, 203 insertions(+), 102 deletions(-) diff --git a/src/H5Edefin.h b/src/H5Edefin.h index 8557f13..183f72c 100644 --- a/src/H5Edefin.h +++ b/src/H5Edefin.h @@ -133,6 +133,7 @@ hid_t H5E_PATH_g = FAIL; /* Problem with path to object */ hid_t H5E_NONE_MINOR_g = FAIL; /* No error */ /* Plugin errors */ +hid_t H5E_OPENERROR_g = FAIL; /* Can't open directory or file */ /* File accessibilty errors */ hid_t H5E_FILEEXISTS_g = FAIL; /* File already exists */ diff --git a/src/H5Einit.h b/src/H5Einit.h index edd9bf5..9724748 100644 --- a/src/H5Einit.h +++ b/src/H5Einit.h @@ -483,6 +483,11 @@ if((H5E_NONE_MINOR_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") /* Plugin errors */ +assert(H5E_OPENERROR_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Can't open directory or file"))==NULL) + HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") +if((H5E_OPENERROR_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) + HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") /* File accessibilty errors */ assert(H5E_FILEEXISTS_g==(-1)); diff --git a/src/H5Epubgen.h b/src/H5Epubgen.h index 3df7d7e..e79106f 100644 --- a/src/H5Epubgen.h +++ b/src/H5Epubgen.h @@ -224,6 +224,8 @@ H5_DLLVAR hid_t H5E_PATH_g; /* Problem with path to object */ H5_DLLVAR hid_t H5E_NONE_MINOR_g; /* No error */ /* Plugin errors */ +#define H5E_OPENERROR (H5OPEN H5E_OPENERROR_g) +H5_DLLVAR hid_t H5E_OPENERROR_g; /* Can't open directory or file */ /* File accessibilty errors */ #define H5E_FILEEXISTS (H5OPEN H5E_FILEEXISTS_g) diff --git a/src/H5Eterm.h b/src/H5Eterm.h index f782db5..5db503c 100644 --- a/src/H5Eterm.h +++ b/src/H5Eterm.h @@ -134,7 +134,8 @@ H5E_PATH_g= /* No error */ H5E_NONE_MINOR_g= -/* Plugin errors */ +/* Plugin errors */ +H5E_OPENERROR_g= /* File accessibilty errors */ H5E_FILEEXISTS_g= diff --git a/src/H5PL.c b/src/H5PL.c index afa1785..0a40d0c 100644 --- a/src/H5PL.c +++ b/src/H5PL.c @@ -95,7 +95,7 @@ H5PL_term_interface(void) /* Free the table of search paths */ for(i = 0; i < num_paths; i++) { if(path_table[i]) - path_table[i] = H5MM_xfree(path_table[i]); + path_table[i] = (char *)H5MM_xfree(path_table[i]); } num_paths = 0; path_found = FALSE; @@ -130,22 +130,18 @@ H5PL_load(H5PL_type_t type, int id) { char *dl_path = NULL; char *origin_dl_path = NULL; - char *pathname = NULL; size_t len = 0; char *dir = NULL; - DIR *dirp = NULL; - int i; - void *handle = NULL; + size_t i; htri_t found_in_table = FALSE; htri_t found_in_path = FALSE; - H5Z_class2_t* (*PL_get_plugin_info)(void) = NULL; H5Z_class2_t *plugin_info = NULL; void *ret_value = NULL; FUNC_ENTER_NOAPI(NULL) /* Search in the table of already loaded plugin libraries */ - if((found_in_table = H5PL_search_table(type, id, &plugin_info)) < 0) + if((found_in_table = H5PL_search_table(type, id, (void **)&plugin_info)) < 0) HGOTO_ERROR(H5E_PLUGIN, H5E_CANTGET, NULL, "search in table failed") /* Finish the function if found */ @@ -185,7 +181,7 @@ H5PL_load(H5PL_type_t type, int id) /* Iterate through the path table to find the right dynamic libraries */ for(i=0; id_name, "lib", 3) && HDstrstr(dp->d_name, ".so")) { - pathname = (char *)H5MM_malloc(strlen(dir) + strlen(dp->d_name) + 2); - HDstrncpy(pathname, dir, strlen(dir)+1); - HDstrcat(pathname, "/"); - HDstrcat(pathname, dp->d_name); - - /*fprintf(stderr, "dp->d_name=%s, pathname=%s. ", dp->d_name, pathname); - fprintf(stderr, "\n");*/ - - if(HDstat(pathname, &my_stat) == -1) - HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "can't stat file: %s", strerror(errno)) - - if(!S_ISDIR(my_stat.st_mode)) { /* if it is a directory, skip it */ - if(NULL == (handle = dlopen(pathname, RTLD_NOW|RTLD_LAZY))) { - /*fprintf(stderr, "not open dl library: %s", dlerror());*/ - /* There are different reasons why a library can't be open, e.g. wrong architecture. - * simply continue if we can't open it */ - continue; - } - - dlerror(); /*clear error*/ - - /* Return a handle for the function H5PL_get_plugin_info in the dynamic library. - * The plugin library is suppose to define this function. */ - if(NULL == (H5PL_get_plugin_info = dlsym(handle, "H5PL_get_plugin_info"))) { - if(H5PL_close(handle) < 0) - HGOTO_ERROR(H5E_PLUGIN, H5E_CLOSEERROR, FAIL, "can't close dynamic library") - } - - /* Envoke H5PL_get_plugin_info to verify this is the right library we are looking for. - * Move on if it isn't. */ - if(H5PL_get_plugin_info) { - if(NULL == (plugin_info = (*H5PL_get_plugin_info)())) { - if(H5PL_close(handle) < 0) - HGOTO_ERROR(H5E_PLUGIN, H5E_CLOSEERROR, FAIL, "can't close dynamic library") - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTGET, FAIL, "can't get plugin info") - } - - if(plugin_info->id == type_id) { - (H5PL_table_g[H5PL_table_used_g]).handle = handle; - (H5PL_table_g[H5PL_table_used_g]).pl_type = plugin_type; - (H5PL_table_g[H5PL_table_used_g]).pl_id = plugin_info->id; -/*fprintf(stderr, "%s: H5PL_table_used_g=%d, id=%d, id 2=%d\n", FUNC, H5PL_table_used_g, (H5PL_table_g[H5PL_table_used_g]).pl_id, plugin_info->id);*/ - H5PL_table_used_g++; - - *info = (void *)plugin_info; - ret_value = TRUE; - - HGOTO_DONE(ret_value) - } else if(H5PL_close(handle) < 0) - HGOTO_ERROR(H5E_PLUGIN, H5E_CLOSEERROR, FAIL, "can't close dynamic library") - } - } - - if(pathname) - pathname = (char *)H5MM_xfree(pathname); - } - } - - if(HDclosedir(dirp) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CLOSEERROR, FAIL, "can't close directory: %s", strerror(errno)) - dirp = NULL; + if(!(dirp = HDopendir(dir))) + HGOTO_ERROR(H5E_PLUGIN, H5E_OPENERROR, FAIL, "can't open directory") + + /* Iterates through all entries in the directory to find the right plugin library */ + while ((dp = HDreaddir(dirp)) != NULL) { + /* The library we are looking for should be called libxxx.so... */ + if(!HDstrncmp(dp->d_name, "lib", (size_t)3) && HDstrstr(dp->d_name, ".so")) { + pathname = (char *)H5MM_malloc(strlen(dir) + strlen(dp->d_name) + 2); + HDstrncpy(pathname, dir, strlen(dir)+1); + HDstrcat(pathname, "/"); + HDstrcat(pathname, dp->d_name); + + /*fprintf(stderr, "dp->d_name=%s, pathname=%s. ", dp->d_name, pathname); + fprintf(stderr, "\n");*/ + + if(HDstat(pathname, &my_stat) == -1) + HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "can't stat file: %s", strerror(errno)) + + /* If it is a directory, skip it */ + if(S_ISDIR(my_stat.st_mode)) + continue; + + if((found_in_dir = H5PL_open(plugin_type, pathname, type_id, info)) < 0) + HGOTO_ERROR(H5E_PLUGIN, H5E_CANTGET, FAIL, "search in directory failed") + + if(found_in_dir) { + ret_value = TRUE; + HGOTO_DONE(ret_value) + } else + if(pathname) + pathname = (char *)H5MM_xfree(pathname); + } } + if(HDclosedir(dirp) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CLOSEERROR, FAIL, "can't close directory: %s", strerror(errno)) + dirp = NULL; done: if(pathname) @@ -321,6 +279,78 @@ done: /*------------------------------------------------------------------------- + * Function: H5PL_open + * + * Purpose: Iterates through all files to find the right plugin library. + * It loads the dynamic plugin library and keeps it on the list + * of loaded libraries. + * + * Return: TRUE on success, + * FALSE on not found, + * negative on failure + * + * Programmer: Raymond Lu + * 13 February 2013 + * + * Modifications: + * + *------------------------------------------------------------------------- + */ +htri_t +H5PL_open(H5PL_type_t pl_type, char *libname, int pl_id, void **pl_info) +{ + H5PL_HANDLE handle = NULL; + H5Z_class2_t* (*H5PL_get_plugin_info)(void) = NULL; + H5Z_class2_t *plugin_info = NULL; + htri_t ret_value = FALSE; + + FUNC_ENTER_NOAPI(FAIL) + + /* There are different reasons why a library can't be open, e.g. wrong architecture. + * simply continue if we can't open it */ + if(NULL == (handle = H5PL_OPEN_DLIB(libname))) + /*fprintf(stderr, "not open dl library: %s", H5PL_CLR_ERR);*/ + HGOTO_DONE(ret_value) + + H5PL_CLR_ERR; /*clear error*/ + + /* Return a handle for the function H5PL_get_plugin_info in the dynamic library. + * The plugin library is suppose to define this function. */ + if(NULL == (H5PL_get_plugin_info = H5PL_GET_LIB_FUNC(handle, "H5PL_get_plugin_info"))) { + if(H5PL_close(handle) < 0) + HGOTO_ERROR(H5E_PLUGIN, H5E_CLOSEERROR, FAIL, "can't close dynamic library") + } + + /* Envoke H5PL_get_plugin_info to verify this is the right library we are looking for. + * Move on if it isn't. */ + if(H5PL_get_plugin_info) { + if(NULL == (plugin_info = (*H5PL_get_plugin_info)())) { + if(H5PL_close(handle) < 0) + HGOTO_ERROR(H5E_PLUGIN, H5E_CLOSEERROR, FAIL, "can't close dynamic library") + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTGET, FAIL, "can't get plugin info") + } + + if(plugin_info->id == pl_id) { + (H5PL_table_g[H5PL_table_used_g]).handle = handle; + (H5PL_table_g[H5PL_table_used_g]).pl_type = pl_type; + (H5PL_table_g[H5PL_table_used_g]).pl_id = plugin_info->id; +/*fprintf(stderr, "%s: H5PL_table_used_g=%d, id=%d, id 2=%d\n", FUNC, H5PL_table_used_g, (H5PL_table_g[H5PL_table_used_g]).pl_id, plugin_info->id);*/ + H5PL_table_used_g++; + + *pl_info = (void *)plugin_info; + ret_value = TRUE; + + HGOTO_DONE(ret_value) + } else if(H5PL_close(handle) < 0) + HGOTO_ERROR(H5E_PLUGIN, H5E_CLOSEERROR, FAIL, "can't close dynamic library") + } + +done: + FUNC_LEAVE_NOAPI(ret_value) +} + + +/*------------------------------------------------------------------------- * Function: H5PL_search_table * * Purpose: Search in the list of already opened dynamic libraries @@ -340,10 +370,9 @@ done: htri_t H5PL_search_table(H5PL_type_t plugin_type, int type_id, void **info) { - htri_t found = FALSE; H5Z_class2_t* (*H5PL_get_plugin_info)(void) = NULL; H5Z_class2_t *plugin_info = NULL; - int i; + size_t i; htri_t ret_value = FALSE; FUNC_ENTER_NOAPI(FAIL) @@ -355,8 +384,8 @@ fprintf(stderr, "%s: H5PL_table_used_g=%d, id=%d\n", FUNC, H5PL_table_used_g, (H if(0 < H5PL_table_used_g) { for(i=0; i Date: Sat, 16 Mar 2013 16:16:22 -0500 Subject: [svn-r23360] I added Windows support to H5PL_find function. Tested on koala but not on Windows yet. --- src/H5PL.c | 64 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 63 insertions(+), 1 deletion(-) diff --git a/src/H5PL.c b/src/H5PL.c index 0a40d0c..ca83835 100644 --- a/src/H5PL.c +++ b/src/H5PL.c @@ -204,7 +204,8 @@ done: * * Purpose: Given a path, this function opens the directory and envokes * another function to go through all files to find the right - * plugin library. + * plugin library. Two function definitions are for Unix and + * Windows. * * Return: TRUE on success, * FALSE on not found, @@ -217,6 +218,7 @@ done: * *------------------------------------------------------------------------- */ +#ifndef H5_HAVE_WIN32_API htri_t H5PL_find(H5PL_type_t plugin_type, int type_id, char *dir, void **info) { @@ -276,6 +278,66 @@ done: FUNC_LEAVE_NOAPI(ret_value) } +#else +htri_t +H5PL_find(H5PL_type_t plugin_type, int type_id, char *dir, void **info) +{ + char *pathname = NULL; + DIR *dirp = NULL; + struct dirent *dp = NULL; + struct stat my_stat; + + WIN32_FIND_DATA fdFile; + HANDLE hFind = NULL; + + htri_t found_in_dir = FALSE; + htri_t ret_value = FALSE; + + FUNC_ENTER_NOAPI(FAIL) + + if((hFind = FindFirstFile(dir, &fdFile)) == INVALID_HANDLE_VALUE) { + /*fprintf(stderr, "Path not found: [%s]\n", dir);*/ + HGOTO_ERROR(H5E_PLUGIN, H5E_OPENERROR, FAIL, "can't open directory") + } + + do { + /* Find first file will always return "." + * and ".." as the first two directories. */ + if(HDstrcmp(fdFile.cFileName, ".") != 0 && HDstrcmp(fdFile.cFileName, "..") != 0) { + pathname = (char *)H5MM_malloc(strlen(dir) + strlen(fdFile.cFileName) + 2); + HDstrncpy(pathname, dir, strlen(dir)+1); + HDstrcat(pathname, "\"); + HDstrcat(pathname, fdFile.cFileName); + + /* Is the entity a File or Folder? */ + if(fdFile.dwFileAttributes &FILE_ATTRIBUTE_DIRECTORY) + continue; + + if((found_in_dir = H5PL_open(plugin_type, pathname, type_id, info)) < 0) + HGOTO_ERROR(H5E_PLUGIN, H5E_CANTGET, FAIL, "search in directory failed") + + if(found_in_dir) { + ret_value = TRUE; + HGOTO_DONE(ret_value) + } else + if(pathname) + pathname = (char *)H5MM_xfree(pathname); + } + } while(FindNextFile(hFind, &fdFile)); /* Find the next file. */ + + /* Clean things up! */ + FindClose(hFind); + hFind = NULL; + +done: + if(pathname) + pathname = (char *)H5MM_xfree(pathname); + if(hFind) + FindClose(hFind); + + FUNC_LEAVE_NOAPI(ret_value) +} +#endif /*------------------------------------------------------------------------- -- cgit v0.12 From c7e0a521dba6d84263a6aa9071ed40927a0e7986 Mon Sep 17 00:00:00 2001 From: Raymond Lu Date: Mon, 18 Mar 2013 14:21:55 -0500 Subject: [svn-r23365] I opted out dirent.h for Windows. Not tested yet. --- src/H5PLprivate.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/H5PLprivate.h b/src/H5PLprivate.h index f0aa348..197212a 100644 --- a/src/H5PLprivate.h +++ b/src/H5PLprivate.h @@ -27,11 +27,12 @@ #include "H5private.h" /* Generic Functions */ #ifdef H5_HAVE_DLFCN_H - #include +#include #endif +#ifndef H5_HAVE_WIN32_API #include -/*#include */ +#endif /**************************/ /* Library Private Macros */ -- cgit v0.12 From ebfebfd7d5a9856eacf94fd1a77867fe757543e5 Mon Sep 17 00:00:00 2001 From: Raymond Lu Date: Mon, 18 Mar 2013 15:11:19 -0500 Subject: [svn-r23367] I took out a declaration of "DIR" for Windows support. Not tested. --- src/H5PL.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/H5PL.c b/src/H5PL.c index ca83835..b0c2291 100644 --- a/src/H5PL.c +++ b/src/H5PL.c @@ -237,8 +237,10 @@ H5PL_find(H5PL_type_t plugin_type, int type_id, char *dir, void **info) /* Iterates through all entries in the directory to find the right plugin library */ while ((dp = HDreaddir(dirp)) != NULL) { - /* The library we are looking for should be called libxxx.so... */ - if(!HDstrncmp(dp->d_name, "lib", (size_t)3) && HDstrstr(dp->d_name, ".so")) { + /* The library we are looking for should be called libxxx.so... on Unix + * or libxxx.xxx.dylib on Mac */ + if(!HDstrncmp(dp->d_name, "lib", (size_t)3) && + (HDstrstr(dp->d_name, ".so") || HDstrstr(dp->d_name, ".dylib"))) { pathname = (char *)H5MM_malloc(strlen(dir) + strlen(dp->d_name) + 2); HDstrncpy(pathname, dir, strlen(dir)+1); HDstrcat(pathname, "/"); @@ -283,7 +285,6 @@ htri_t H5PL_find(H5PL_type_t plugin_type, int type_id, char *dir, void **info) { char *pathname = NULL; - DIR *dirp = NULL; struct dirent *dp = NULL; struct stat my_stat; @@ -371,7 +372,7 @@ H5PL_open(H5PL_type_t pl_type, char *libname, int pl_id, void **pl_info) /* There are different reasons why a library can't be open, e.g. wrong architecture. * simply continue if we can't open it */ if(NULL == (handle = H5PL_OPEN_DLIB(libname))) - /*fprintf(stderr, "not open dl library: %s", H5PL_CLR_ERR);*/ + /*fprintf(stderr, "not open dl library: %s\n", H5PL_CLR_ERR);*/ HGOTO_DONE(ret_value) H5PL_CLR_ERR; /*clear error*/ -- cgit v0.12 From 23635d656a7ebb30f082960a27174453a27e96f6 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 18 Mar 2013 15:44:02 -0500 Subject: [svn-r23368] Correct names and add includes for windows --- src/H5PL.c | 5 ++--- src/H5PLpkg.h | 2 +- src/H5PLprivate.h | 13 +++++++++++++ 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/src/H5PL.c b/src/H5PL.c index b0c2291..5e1b224 100644 --- a/src/H5PL.c +++ b/src/H5PL.c @@ -286,7 +286,6 @@ H5PL_find(H5PL_type_t plugin_type, int type_id, char *dir, void **info) { char *pathname = NULL; struct dirent *dp = NULL; - struct stat my_stat; WIN32_FIND_DATA fdFile; HANDLE hFind = NULL; @@ -375,7 +374,7 @@ H5PL_open(H5PL_type_t pl_type, char *libname, int pl_id, void **pl_info) /*fprintf(stderr, "not open dl library: %s\n", H5PL_CLR_ERR);*/ HGOTO_DONE(ret_value) - H5PL_CLR_ERR; /*clear error*/ + H5PL_CLR_ERROR; /*clear error*/ /* Return a handle for the function H5PL_get_plugin_info in the dynamic library. * The plugin library is suppose to define this function. */ @@ -448,7 +447,7 @@ fprintf(stderr, "%s: H5PL_table_used_g=%d, id=%d\n", FUNC, H5PL_table_used_g, (H for(i=0; i +#endif + +#include + +#endif /*H5_HAVE_WIN32_API*/ + #ifdef H5_HAVE_DLFCN_H #include #endif -- cgit v0.12 From f2b142f6ed4bc50cedfbb652cb286d309e88718b Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 18 Mar 2013 16:56:32 -0500 Subject: [svn-r23369] Escape "\" char --- src/H5PL.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/H5PL.c b/src/H5PL.c index 5e1b224..a4bc0bf 100644 --- a/src/H5PL.c +++ b/src/H5PL.c @@ -306,7 +306,7 @@ H5PL_find(H5PL_type_t plugin_type, int type_id, char *dir, void **info) if(HDstrcmp(fdFile.cFileName, ".") != 0 && HDstrcmp(fdFile.cFileName, "..") != 0) { pathname = (char *)H5MM_malloc(strlen(dir) + strlen(fdFile.cFileName) + 2); HDstrncpy(pathname, dir, strlen(dir)+1); - HDstrcat(pathname, "\"); + HDstrcat(pathname, "\\"); HDstrcat(pathname, fdFile.cFileName); /* Is the entity a File or Folder? */ -- cgit v0.12 From 9a720f99fe33bbbe1de4efbfc9a15f0e512f2eb5 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 18 Mar 2013 17:00:24 -0500 Subject: [svn-r23370] Corrected macro name and removed optional function info in ERROR macro --- src/H5PL.c | 2 +- src/H5PLpkg.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/H5PL.c b/src/H5PL.c index a4bc0bf..6fcf7eb 100644 --- a/src/H5PL.c +++ b/src/H5PL.c @@ -447,7 +447,7 @@ fprintf(stderr, "%s: H5PL_table_used_g=%d, id=%d\n", FUNC, H5PL_table_used_g, (H for(i=0; i Date: Mon, 18 Mar 2013 17:16:59 -0500 Subject: [svn-r23373] Some updates for Windows. Not tested. --- src/H5PL.c | 6 +++--- src/H5PLprivate.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/H5PL.c b/src/H5PL.c index 6fcf7eb..4d18926 100644 --- a/src/H5PL.c +++ b/src/H5PL.c @@ -371,10 +371,10 @@ H5PL_open(H5PL_type_t pl_type, char *libname, int pl_id, void **pl_info) /* There are different reasons why a library can't be open, e.g. wrong architecture. * simply continue if we can't open it */ if(NULL == (handle = H5PL_OPEN_DLIB(libname))) - /*fprintf(stderr, "not open dl library: %s\n", H5PL_CLR_ERR);*/ + /*fprintf(stderr, "not open dl library: %s\n", H5PL_CLR_ERROR);*/ HGOTO_DONE(ret_value) - H5PL_CLR_ERROR; /*clear error*/ + H5PL_CLR_ERROR; /*clear error*/ /* Return a handle for the function H5PL_get_plugin_info in the dynamic library. * The plugin library is suppose to define this function. */ @@ -447,7 +447,7 @@ fprintf(stderr, "%s: H5PL_table_used_g=%d, id=%d\n", FUNC, H5PL_table_used_g, (H for(i=0; i - +#include /* For _getcwd() */ #endif /*H5_HAVE_WIN32_API*/ #ifdef H5_HAVE_DLFCN_H -- cgit v0.12 From 00c4e5f00d4051917b56c5806f4026d8e9d81b8d Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Mon, 18 Mar 2013 22:00:40 -0500 Subject: [svn-r23376] Description: Add dirent.h detection to configure.ac --- configure.ac | 1 + 1 file changed, 1 insertion(+) diff --git a/configure.ac b/configure.ac index e8ede42..e705340 100644 --- a/configure.ac +++ b/configure.ac @@ -1275,6 +1275,7 @@ AC_CHECK_FUNCS([clock_gettime],[have_clock_gettime="yes"],[have_clock_gettime="n AC_CHECK_HEADERS([sys/resource.h sys/time.h unistd.h sys/ioctl.h sys/stat.h]) AC_CHECK_HEADERS([sys/socket.h sys/types.h]) AC_CHECK_HEADERS([stddef.h setjmp.h features.h]) +AC_CHECK_HEADERS([dirent.h]) AC_CHECK_HEADERS([stdint.h], [C9x=yes]) ## Darwin -- cgit v0.12 From beccb8a0fcb8a380c7cd140852a486885b8e38c0 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Mon, 18 Mar 2013 22:14:28 -0500 Subject: [svn-r23377] Description: Re-run bon/reconfigure, to generate detection of dirent.h and set up macro. --- configure | 12 ++++++++++++ src/H5config.h.in | 3 +++ 2 files changed, 15 insertions(+) diff --git a/configure b/configure index 3af799b..6b4a82b 100755 --- a/configure +++ b/configure @@ -22781,6 +22781,18 @@ fi done +for ac_header in dirent.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "dirent.h" "ac_cv_header_dirent_h" "$ac_includes_default" +if test "x$ac_cv_header_dirent_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_DIRENT_H 1 +_ACEOF + +fi + +done + for ac_header in stdint.h do : ac_fn_c_check_header_mongrel "$LINENO" "stdint.h" "ac_cv_header_stdint_h" "$ac_includes_default" diff --git a/src/H5config.h.in b/src/H5config.h.in index c1cee13..fc41c5a 100644 --- a/src/H5config.h.in +++ b/src/H5config.h.in @@ -87,6 +87,9 @@ /* Define if the direct I/O virtual file driver should be compiled */ #undef HAVE_DIRECT +/* Define to 1 if you have the header file. */ +#undef HAVE_DIRENT_H + /* Define to 1 if you have the header file. */ #undef HAVE_DLFCN_H -- cgit v0.12 From af9a3abb3dcb01e719abf8eba5fd588c20c89d5c Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Mon, 18 Mar 2013 23:22:34 -0500 Subject: [svn-r23380] Description: Review & cleanup code. --- MANIFEST | 5 +- src/H5PL.c | 602 ++++++++++++++++++++++++++++--------------------- src/H5PLpkg.h | 127 ----------- src/H5PLprivate.h | 24 +- src/H5PLpublic.h | 3 +- src/H5Pocpl.c | 69 +++--- src/H5Pprivate.h | 2 - src/H5Z.c | 55 ++--- src/H5private.h | 11 + src/Makefile.am | 7 +- test/plugin.c | 5 +- test/test_plugin.sh.in | 4 +- 12 files changed, 428 insertions(+), 486 deletions(-) delete mode 100644 src/H5PLpkg.h diff --git a/MANIFEST b/MANIFEST index f15fa29..e1ab635 100644 --- a/MANIFEST +++ b/MANIFEST @@ -850,9 +850,8 @@ ./src/H5Pstrcpl.c ./src/H5Ptest.c ./src/H5PL.c -./src/H5PLpkg.c -./src/H5PLprivate.c -./src/H5PLpublic.c +./src/H5PLprivate.h +./src/H5PLpublic.h ./src/H5R.c ./src/H5Rdeprec.c ./src/H5Rpkg.h diff --git a/src/H5PL.c b/src/H5PL.c index 4d18926..4d84f31 100644 --- a/src/H5PL.c +++ b/src/H5PL.c @@ -13,32 +13,127 @@ * access to either file, you may request a copy from help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#define H5PL_PACKAGE /*suppress error about including H5PLpkg */ +/****************/ +/* Module Setup */ +/****************/ /* Interface initialization */ -#define H5_INTERFACE_INIT_FUNC H5PL_init_interface +#define H5_INTERFACE_INIT_FUNC H5PL__init_interface + +/***********/ +/* Headers */ +/***********/ #include "H5private.h" /* Generic Functions */ -#include "H5Dprivate.h" /* Dataset functions */ #include "H5Eprivate.h" /* Error handling */ -#include "H5Iprivate.h" /* IDs */ #include "H5MMprivate.h" /* Memory management */ -#include "H5Oprivate.h" /* Object headers */ -#include "H5Pprivate.h" /* Property lists */ -#include "H5Sprivate.h" /* Dataspace functions */ +#include "H5PLprivate.h" /* Plugin */ #include "H5Zprivate.h" /* Filter pipeline */ -#include "H5PLpkg.h" /* Plugin */ + + +/****************/ +/* Local Macros */ +/****************/ #define H5PL_DEFAULT_PATH "/usr:/usr/lib:/usr/local" -#define H5PL_PATH_SEPERATOR ":" +#define H5PL_PATH_SEPARATOR ":" +#define H5PL_MAX_PATH_NUM 16 + +/****************************/ +/* Macros for supporting + * both Windows and Unix */ +/****************************/ + +/* Handle for dynamic library */ +#ifdef H5_HAVE_WIN32_API +/* Handle for dynamic library */ +#define H5PL_HANDLE HINSTANCE + +/* Get a handle to a plugin library. Windows: TEXT macro handles Unicode strings */ +#define H5PL_OPEN_DLIB(S) LoadLibraryEx(TEXT(S), NULL, LOAD_WITH_ALTERED_SEARCH_PATH) + +/* Get the address of a symbol in dynamic library */ +#define H5PL_GET_LIB_FUNC(H,N) GetProcAddress(H,N) + +/* Close dynamic library */ +#define H5PL_CLOSE_LIB(H) FreeLibrary(H) + +/* Clear error - nothing to do */ +#define H5PL_CLR_ERROR + +#else /* H5_HAVE_WIN32_API */ +/* Handle for dynamic library */ +#define H5PL_HANDLE void * + +/* Get a handle to a plugin library. Windows: TEXT macro handles Unicode strings */ +#define H5PL_OPEN_DLIB(S) dlopen(S, RTLD_NOW|RTLD_LAZY) + +/* Get the address of a symbol in dynamic library */ +#define H5PL_GET_LIB_FUNC(H,N) dlsym(H,N) + +/* Close dynamic library */ +#define H5PL_CLOSE_LIB(H) dlclose(H) + +/* Clear error */ +#define H5PL_CLR_ERROR dlerror() + +#endif /* H5_HAVE_WIN32_API */ + + +/******************/ +/* Local Typedefs */ +/******************/ + +/* Type for the list of info for opened plugin libraries */ +typedef struct H5PL_table_t { + H5PL_type_t pl_type; /* plugin type */ + int pl_id; /* ID for the plugin */ + H5PL_HANDLE handle; /* plugin handle */ +} H5PL_table_t; + + +/********************/ +/* Local Prototypes */ +/********************/ + +static herr_t H5PL__init_path_table(void); +static htri_t H5PL__find(H5PL_type_t plugin_type, int type_id, char *dir, void **info); +static htri_t H5PL__open(H5PL_type_t pl_type, char *libname, int plugin_id, void **pl_info); +static htri_t H5PL__search_table(H5PL_type_t plugin_type, int type_id, void **info); +static herr_t H5PL__close(H5PL_HANDLE handle); + + +/*********************/ +/* Package Variables */ +/*********************/ + + +/*****************************/ +/* Library Private Variables */ +/*****************************/ + + +/*******************/ +/* Local Variables */ +/*******************/ + +/* Table for opened plugin libraries */ +static size_t H5PL_table_alloc_g = 0; +static size_t H5PL_table_used_g = 0; +static H5PL_table_t *H5PL_table_g = NULL; + +/* Table of location paths for plugin libraries */ +static char *H5PL_path_table_g[H5PL_MAX_PATH_NUM]; +static size_t H5PL_num_paths_g = 0; +static htri_t H5PL_path_found_g = FALSE; + /*-------------------------------------------------------------------------- NAME - H5PL_init_interface -- Initialize interface-specific information + H5PL__init_interface -- Initialize interface-specific information USAGE - herr_t H5PL_init_interface() - + herr_t H5PL__init_interface() RETURNS Non-negative on success/Negative on failure DESCRIPTION @@ -46,12 +141,12 @@ DESCRIPTION --------------------------------------------------------------------------*/ static herr_t -H5PL_init_interface(void) +H5PL__init_interface(void) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5PL_init_interface() */ +} /* end H5PL__init_interface() */ /*------------------------------------------------------------------------- @@ -69,36 +164,32 @@ H5PL_init_interface(void) * Programmer: Raymond Lu * 20 February 2013 * - * Modifications: - * *------------------------------------------------------------------------- */ int H5PL_term_interface(void) { - void *handle = NULL; - size_t i = 0; + int i = 0; FUNC_ENTER_NOAPI_NOINIT_NOERR if(H5_interface_initialize_g) { + size_t u; /* Local index variable */ + /* Close opened dynamic libraries */ - for(i=0; id_name, "lib", (size_t)3) && - (HDstrstr(dp->d_name, ".so") || HDstrstr(dp->d_name, ".dylib"))) { - pathname = (char *)H5MM_malloc(strlen(dir) + strlen(dp->d_name) + 2); - HDstrncpy(pathname, dir, strlen(dir)+1); - HDstrcat(pathname, "/"); - HDstrcat(pathname, dp->d_name); - - /*fprintf(stderr, "dp->d_name=%s, pathname=%s. ", dp->d_name, pathname); - fprintf(stderr, "\n");*/ - - if(HDstat(pathname, &my_stat) == -1) - HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "can't stat file: %s", strerror(errno)) - - /* If it is a directory, skip it */ - if(S_ISDIR(my_stat.st_mode)) - continue; - - if((found_in_dir = H5PL_open(plugin_type, pathname, type_id, info)) < 0) - HGOTO_ERROR(H5E_PLUGIN, H5E_CANTGET, FAIL, "search in directory failed") - - if(found_in_dir) { - ret_value = TRUE; - HGOTO_DONE(ret_value) - } else - if(pathname) - pathname = (char *)H5MM_xfree(pathname); - } - } - - if(HDclosedir(dirp) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CLOSEERROR, FAIL, "can't close directory: %s", strerror(errno)) - dirp = NULL; + while((dp = HDreaddir(dirp)) != NULL) { + /* The library we are looking for should be called libxxx.so... on Unix + * or libxxx.xxx.dylib on Mac. + */ + if(!HDstrncmp(dp->d_name, "lib", (size_t)3) && + (HDstrstr(dp->d_name, ".so") || HDstrstr(dp->d_name, ".dylib"))) { + h5_stat_t my_stat; + htri_t found_in_dir; + + pathname = (char *)H5MM_malloc(HDstrlen(dir) + HDstrlen(dp->d_name) + 2); + HDstrncpy(pathname, dir, HDstrlen(dir) + 1); + HDstrcat(pathname, "/"); + HDstrcat(pathname, dp->d_name); + + if(HDstat(pathname, &my_stat) == -1) + HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "can't stat file: %s", strerror(errno)) + + /* If it is a directory, skip it */ + if(S_ISDIR(my_stat.st_mode)) + continue; + + /* Attempt to open the dynamic library as a filter library */ + if((found_in_dir = H5PL__open(plugin_type, pathname, type_id, info)) < 0) + HGOTO_ERROR(H5E_PLUGIN, H5E_CANTGET, FAIL, "search in directory failed") + if(found_in_dir) { + /* Indicate success */ + ret_value = TRUE; + break; + } /* end if */ + else + if(pathname) + pathname = (char *)H5MM_xfree(pathname); + } /* end if */ + } /* end while */ done: + if(dirp) + if(HDclosedir(dirp) < 0) + HDONE_ERROR(H5E_FILE, H5E_CLOSEERROR, FAIL, "can't close directory: %s", strerror(errno)) if(pathname) pathname = (char *)H5MM_xfree(pathname); - if(dirp) - HDclosedir(dirp); FUNC_LEAVE_NOAPI(ret_value) -} +} /* end H5PL__find() */ #else -htri_t -H5PL_find(H5PL_type_t plugin_type, int type_id, char *dir, void **info) +static htri_t +H5PL__find(H5PL_type_t plugin_type, int type_id, char *dir, void **info) { - char *pathname = NULL; - struct dirent *dp = NULL; - WIN32_FIND_DATA fdFile; - HANDLE hFind = NULL; - - htri_t found_in_dir = FALSE; - htri_t ret_value = FALSE; + HANDLE hFind; + char *pathname = NULL; + htri_t ret_value = FALSE; - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_STATIC - if((hFind = FindFirstFile(dir, &fdFile)) == INVALID_HANDLE_VALUE) { - /*fprintf(stderr, "Path not found: [%s]\n", dir);*/ + if((hFind = FindFirstFile(dir, &fdFile)) == INVALID_HANDLE_VALUE) HGOTO_ERROR(H5E_PLUGIN, H5E_OPENERROR, FAIL, "can't open directory") - } do { /* Find first file will always return "." - * and ".." as the first two directories. */ + * and ".." as the first two directories. + */ if(HDstrcmp(fdFile.cFileName, ".") != 0 && HDstrcmp(fdFile.cFileName, "..") != 0) { - pathname = (char *)H5MM_malloc(strlen(dir) + strlen(fdFile.cFileName) + 2); - HDstrncpy(pathname, dir, strlen(dir)+1); + htri_t found_in_dir; + + pathname = (char *)H5MM_malloc(HDstrlen(dir) + HDstrlen(fdFile.cFileName) + 2); + HDstrncpy(pathname, dir, HDstrlen(dir)+1); HDstrcat(pathname, "\\"); HDstrcat(pathname, fdFile.cFileName); @@ -313,35 +417,32 @@ H5PL_find(H5PL_type_t plugin_type, int type_id, char *dir, void **info) if(fdFile.dwFileAttributes &FILE_ATTRIBUTE_DIRECTORY) continue; - if((found_in_dir = H5PL_open(plugin_type, pathname, type_id, info)) < 0) + if((found_in_dir = H5PL__open(plugin_type, pathname, type_id, info)) < 0) HGOTO_ERROR(H5E_PLUGIN, H5E_CANTGET, FAIL, "search in directory failed") - if(found_in_dir) { - ret_value = TRUE; - HGOTO_DONE(ret_value) - } else + /* Indicate success */ + ret_value = TRUE; + break; + } /* end if */ + else if(pathname) pathname = (char *)H5MM_xfree(pathname); - } + } /* end if */ } while(FindNextFile(hFind, &fdFile)); /* Find the next file. */ - /* Clean things up! */ - FindClose(hFind); - hFind = NULL; - done: - if(pathname) - pathname = (char *)H5MM_xfree(pathname); if(hFind) FindClose(hFind); + if(pathname) + pathname = (char *)H5MM_xfree(pathname); FUNC_LEAVE_NOAPI(ret_value) -} +} /* end H5PL__find() */ #endif /*------------------------------------------------------------------------- - * Function: H5PL_open + * Function: H5PL__open * * Purpose: Iterates through all files to find the right plugin library. * It loads the dynamic plugin library and keeps it on the list @@ -354,131 +455,129 @@ done: * Programmer: Raymond Lu * 13 February 2013 * - * Modifications: - * *------------------------------------------------------------------------- */ -htri_t -H5PL_open(H5PL_type_t pl_type, char *libname, int pl_id, void **pl_info) +static htri_t +H5PL__open(H5PL_type_t pl_type, char *libname, int pl_id, void **pl_info) { H5PL_HANDLE handle = NULL; - H5Z_class2_t* (*H5PL_get_plugin_info)(void) = NULL; - H5Z_class2_t *plugin_info = NULL; htri_t ret_value = FALSE; - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_STATIC /* There are different reasons why a library can't be open, e.g. wrong architecture. - * simply continue if we can't open it */ - if(NULL == (handle = H5PL_OPEN_DLIB(libname))) - /*fprintf(stderr, "not open dl library: %s\n", H5PL_CLR_ERROR);*/ - HGOTO_DONE(ret_value) - - H5PL_CLR_ERROR; /*clear error*/ - - /* Return a handle for the function H5PL_get_plugin_info in the dynamic library. - * The plugin library is suppose to define this function. */ - if(NULL == (H5PL_get_plugin_info = H5PL_GET_LIB_FUNC(handle, "H5PL_get_plugin_info"))) { - if(H5PL_close(handle) < 0) - HGOTO_ERROR(H5E_PLUGIN, H5E_CLOSEERROR, FAIL, "can't close dynamic library") - } - - /* Envoke H5PL_get_plugin_info to verify this is the right library we are looking for. - * Move on if it isn't. */ - if(H5PL_get_plugin_info) { - if(NULL == (plugin_info = (*H5PL_get_plugin_info)())) { - if(H5PL_close(handle) < 0) - HGOTO_ERROR(H5E_PLUGIN, H5E_CLOSEERROR, FAIL, "can't close dynamic library") - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTGET, FAIL, "can't get plugin info") - } - - if(plugin_info->id == pl_id) { - (H5PL_table_g[H5PL_table_used_g]).handle = handle; - (H5PL_table_g[H5PL_table_used_g]).pl_type = pl_type; - (H5PL_table_g[H5PL_table_used_g]).pl_id = plugin_info->id; -/*fprintf(stderr, "%s: H5PL_table_used_g=%d, id=%d, id 2=%d\n", FUNC, H5PL_table_used_g, (H5PL_table_g[H5PL_table_used_g]).pl_id, plugin_info->id);*/ - H5PL_table_used_g++; - - *pl_info = (void *)plugin_info; - ret_value = TRUE; - - HGOTO_DONE(ret_value) - } else if(H5PL_close(handle) < 0) - HGOTO_ERROR(H5E_PLUGIN, H5E_CLOSEERROR, FAIL, "can't close dynamic library") - } + * simply continue if we can't open it. + */ + if(NULL == (handle = H5PL_OPEN_DLIB(libname))) { + H5PL_CLR_ERROR; /* clear error */ + } /* end if */ + else { + H5Z_class2_t * (*H5PL_get_plugin_info)(void); + + /* Return a handle for the function H5PL_get_plugin_info in the dynamic library. + * The plugin library is suppose to define this function. + */ + if(NULL == (H5PL_get_plugin_info = (H5Z_class2_t *(*)(void))H5PL_GET_LIB_FUNC(handle, "H5PL_get_plugin_info"))) { + if(H5PL__close(handle) < 0) + HGOTO_ERROR(H5E_PLUGIN, H5E_CLOSEERROR, FAIL, "can't close dynamic library") + } /* end if */ + else { + H5Z_class2_t *plugin_info; + + /* Invoke H5PL_get_plugin_info to verify this is the right library we are looking for. + * Move on if it isn't. + */ + if(NULL == (plugin_info = (*H5PL_get_plugin_info)())) { + if(H5PL__close(handle) < 0) + HGOTO_ERROR(H5E_PLUGIN, H5E_CLOSEERROR, FAIL, "can't close dynamic library") + HGOTO_ERROR(H5E_PLUGIN, H5E_CANTGET, FAIL, "can't get plugin info") + } /* end if */ + + /* Successfully found plugin library, check if it's the right one */ + if(plugin_info->id == pl_id) { + /* Expand the table if it is too small */ + if(H5PL_table_used_g >= H5PL_table_alloc_g) { + size_t n = MAX(H5Z_MAX_NFILTERS, 2 * H5PL_table_alloc_g); + H5PL_table_t *table = (H5PL_table_t *)H5MM_realloc(H5PL_table_g, n * sizeof(H5PL_table_t)); + + if(!table) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "unable to extend dynamic library table") + + H5PL_table_g = table; + H5PL_table_alloc_g = n; + } /* end if */ + + (H5PL_table_g[H5PL_table_used_g]).handle = handle; + (H5PL_table_g[H5PL_table_used_g]).pl_type = pl_type; + (H5PL_table_g[H5PL_table_used_g]).pl_id = plugin_info->id; + H5PL_table_used_g++; + + /* Set the plugin info to return */ + *pl_info = (void *)plugin_info; + + /* Indicate success */ + ret_value = TRUE; + } /* end if */ + else + if(H5PL__close(handle) < 0) + HGOTO_ERROR(H5E_PLUGIN, H5E_CLOSEERROR, FAIL, "can't close dynamic library") + } /* end if */ + } /* end else */ done: FUNC_LEAVE_NOAPI(ret_value) -} +} /* end H5PL__open() */ /*------------------------------------------------------------------------- - * Function: H5PL_search_table + * Function: H5PL__search_table * * Purpose: Search in the list of already opened dynamic libraries * to see if the one we are looking for is already opened. * * Return: TRUE on success, * FALSE on not found, - * negative on failure + * Negative on failure * * Programmer: Raymond Lu * 13 February 2013 * - * Modifications: - * *------------------------------------------------------------------------- */ -htri_t -H5PL_search_table(H5PL_type_t plugin_type, int type_id, void **info) +static htri_t +H5PL__search_table(H5PL_type_t plugin_type, int type_id, void **info) { - H5Z_class2_t* (*H5PL_get_plugin_info)(void) = NULL; - H5Z_class2_t *plugin_info = NULL; size_t i; htri_t ret_value = FALSE; - FUNC_ENTER_NOAPI(FAIL) - -/*if(0 < H5PL_table_used_g) -fprintf(stderr, "%s: H5PL_table_used_g=%d, id=%d\n", FUNC, H5PL_table_used_g, (H5PL_table_g[H5PL_table_used_g-1]).pl_id);*/ + FUNC_ENTER_STATIC /* Search in the table of already opened dynamic libraries */ - if(0 < H5PL_table_used_g) { - for(i=0; i 0) { + for(i = 0; i < H5PL_table_used_g; i++) { if((plugin_type == (H5PL_table_g[i]).pl_type) && (type_id == (H5PL_table_g[i]).pl_id)) { - if(NULL == (H5PL_get_plugin_info = H5PL_GET_LIB_FUNC((H5PL_table_g[i]).handle, "H5PL_get_plugin_info"))) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTGET, FAIL, "can't get function for H5PL_get_plugin_info") + H5Z_class2_t *(*H5PL_get_plugin_info)(void); + H5Z_class2_t *plugin_info; + if(NULL == (H5PL_get_plugin_info = (H5Z_class2_t *(*)(void))H5PL_GET_LIB_FUNC((H5PL_table_g[i]).handle, "H5PL_get_plugin_info"))) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTGET, FAIL, "can't get function for H5PL_get_plugin_info") if(NULL == (plugin_info = (*H5PL_get_plugin_info)())) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTGET, FAIL, "can't get plugin info") - /*fprintf(stderr, "%s: handle=%p, H5PL_get_plugin_info=%p, plugin_info=%p, id=%d\n", FUNC, (H5PL_table_g[i]).handle, H5PL_get_plugin_info, plugin_info, plugin_info->id);*/ - *info = (void *)plugin_info; ret_value = TRUE; - } - } - } - - /* Expand the table if it is too small */ - if(H5PL_table_used_g >= H5PL_table_alloc_g) { - size_t n = MAX(H5Z_MAX_NFILTERS, 2*H5PL_table_alloc_g); - H5PL_table_t *table = (H5PL_table_t *)H5MM_realloc(H5PL_table_g, n * sizeof(H5PL_table_t)); - - if(!table) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "unable to extend dynamic library table") - - H5PL_table_g = table; - H5PL_table_alloc_g = n; + break; + } /* end if */ + } /* end for */ } /* end if */ done: FUNC_LEAVE_NOAPI(ret_value) -} +} /* end H5PL__search_table() */ /*------------------------------------------------------------------------- - * Function: H5PL_close + * Function: H5PL__close * * Purpose: Closes the handle for dynamic library * @@ -487,20 +586,15 @@ done: * Programmer: Raymond Lu * 13 February 2013 * - * Modifications: - * *------------------------------------------------------------------------- */ -herr_t -H5PL_close(H5PL_HANDLE handle) +static herr_t +H5PL__close(H5PL_HANDLE handle) { - herr_t ret_value = SUCCEED; + FUNC_ENTER_STATIC_NOERR - FUNC_ENTER_NOAPI(FAIL) -/*fprintf(stderr, "%s: closing. handle=%p\n", FUNC, handle);*/ H5PL_CLOSE_LIB(handle); -done: - FUNC_LEAVE_NOAPI(ret_value) -} + FUNC_LEAVE_NOAPI(SUCCEED) +} /* end H5PL__close() */ diff --git a/src/H5PLpkg.h b/src/H5PLpkg.h deleted file mode 100644 index 616bd23..0000000 --- a/src/H5PLpkg.h +++ /dev/null @@ -1,127 +0,0 @@ -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * - * 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 files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * - * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ - -#ifndef H5PL_PACKAGE -#error "Do not include this file outside the H5PL package!" -#endif - -#ifndef _H5PLpkg_H -#define _H5PLpkg_H - -/* Include private header file */ -#include "H5PLprivate.h" - -#define MAX_PATH_NUM 16 - -/****************************/ -/* Macros for supporting - * both Windows and Unix */ -/****************************/ - -/* Handle for dynamic library */ -#ifdef H5_HAVE_WIN32_API -/* Handle for dynamic library */ -#define H5PL_HANDLE HINSTANCE - -/* Get a handle to a plugin library. Windows: TEXT macro handles Unicode strings */ -#define H5PL_OPEN_DLIB(S) LoadLibraryEx(TEXT(S), NULL, LOAD_WITH_ALTERED_SEARCH_PATH) - -/* Get the address of a symbol in dynamic library */ -#define H5PL_GET_LIB_FUNC(H,N) GetProcAddress(H,N) - -/* Close dynamic library */ -#define H5PL_CLOSE_LIB(H) FreeLibrary(H) - -/* Declare error string */ -#define H5PL_ERROR DWORD dw; char *error - -/* Clear error - nothing to do */ -#define H5PL_CLR_ERROR - -/* Print error message */ -#define H5PL_CHECK_ERR(R) { \ - if(R==NULL) { \ - dw = GetLastError(); \ - sprintf(error, "%ld", dw); \ - } \ - else error = NULL; \ -} - -#else -/* Handle for dynamic library */ -#define H5PL_HANDLE void * - -/* Get a handle to a plugin library. Windows: TEXT macro handles Unicode strings */ -#define H5PL_OPEN_DLIB(S) dlopen(S, RTLD_NOW|RTLD_LAZY) - -/* Get the address of a symbol in dynamic library */ -#define H5PL_GET_LIB_FUNC(H,N) dlsym(H,N) - -/* Close dynamic library */ -#define H5PL_CLOSE_LIB(H) dlclose(H) - -/* Declare error string */ -#define H5PL_ERROR char *error - -/* Clear error */ -#define H5PL_CLR_ERROR dlerror() - -/* Print error message */ -#define H5PL_CHECK_ERR(R) { \ - if(R==NULL) { \ - error = dlerror(); \ - } \ - else error = NULL; \ -} - -#endif - -/****************************/ -/* Local typedefs */ -/****************************/ - -/* Type for the list of info for opened plugin libraries */ -typedef struct H5PL_table_t { - H5PL_type_t pl_type; /* plugin type */ - int pl_id; /* ID for the plugin */ - H5PL_HANDLE handle; /* plugin handle */ -} H5PL_table_t; - -/****************************/ -/* Local variables */ -/****************************/ - -/* Table for opened plugin libraries */ -static size_t H5PL_table_alloc_g = 0; -static size_t H5PL_table_used_g = 0; -static H5PL_table_t *H5PL_table_g = NULL; - -/* Table of location paths for plugin libraries */ -static char *path_table[MAX_PATH_NUM]; -static size_t num_paths = 0; -static htri_t path_found = FALSE; - -/******************************/ -/* Package Private Prototypes */ -/******************************/ - -/* Function prototypes for H5PL package scope */ -H5_DLL htri_t H5PL_find(H5PL_type_t plugin_type, int type_id, char *dir, void **info); -H5_DLL htri_t H5PL_open(H5PL_type_t pl_type, char *libname, int plugin_id, void **pl_info); -H5_DLL htri_t H5PL_search_table(H5PL_type_t plugin_type, int type_id, void **info); -H5_DLL herr_t H5PL_close(H5PL_HANDLE handle); - -#endif /* _H5PLpkg_H */ - diff --git a/src/H5PLprivate.h b/src/H5PLprivate.h index 61cfcda..25fbc51 100644 --- a/src/H5PLprivate.h +++ b/src/H5PLprivate.h @@ -26,26 +26,6 @@ /* Private headers needed by this file */ #include "H5private.h" /* Generic Functions */ -#ifdef H5_HAVE_WIN32_API -/* The following two defines must be before any windows headers are included */ -#define WIN32_LEAN_AND_MEAN /* Exclude rarely-used stuff from Windows headers */ -#define NOGDI /* Exclude Graphic Display Interface macros */ - -#ifdef H5_HAVE_WINSOCK2_H -#include -#endif - -#include -#include /* For _getcwd() */ -#endif /*H5_HAVE_WIN32_API*/ - -#ifdef H5_HAVE_DLFCN_H -#include -#endif - -#ifndef H5_HAVE_WIN32_API -#include -#endif /**************************/ /* Library Private Macros */ @@ -67,6 +47,6 @@ /***************************************/ /* Internal API routines */ -H5_DLL void* H5PL_load(H5PL_type_t plugin_type, int type_id); +H5_DLL void *H5PL_load(H5PL_type_t plugin_type, int type_id); -#endif +#endif /* _H5PLprivate_H */ diff --git a/src/H5PLpublic.h b/src/H5PLpublic.h index 4c4a669..65a94cc 100644 --- a/src/H5PLpublic.h +++ b/src/H5PLpublic.h @@ -43,4 +43,5 @@ extern "C" { #ifdef __cplusplus } #endif -#endif +#endif /* _H5PLpublic_H */ + diff --git a/src/H5Pocpl.c b/src/H5Pocpl.c index 032162a..d3de509 100644 --- a/src/H5Pocpl.c +++ b/src/H5Pocpl.c @@ -38,10 +38,10 @@ #include "H5Eprivate.h" /* Error handling */ #include "H5Iprivate.h" /* IDs */ #include "H5MMprivate.h" /* Memory management */ -#include "H5PLprivate.h" /* Dynamic plugin */ -#include "H5Zprivate.h" /* Filter pipeline */ #include "H5Opkg.h" /* Object headers */ #include "H5Ppkg.h" /* Property lists */ +#include "H5PLprivate.h" /* Dynamic plugin */ +#include "H5Zprivate.h" /* Filter pipeline */ /****************/ @@ -92,6 +92,9 @@ static herr_t H5P__ocrt_pipeline_enc(const void *value, void **_pp, size_t *size static herr_t H5P__ocrt_pipeline_dec(const void **_pp, void *value); static int H5P__ocrt_pipeline_cmp(const void *value1, const void *value2, size_t size); +/* Local routines */ +static herr_t H5P__set_filter(H5P_genplist_t *plist, H5Z_filter_t filter, + unsigned int flags, size_t cd_nelmts, const unsigned int cd_values[/*cd_nelmts*/]); /*********************/ /* Package Variables */ @@ -748,9 +751,9 @@ herr_t H5Pset_filter(hid_t plist_id, H5Z_filter_t filter, unsigned int flags, size_t cd_nelmts, const unsigned int cd_values[/*cd_nelmts*/]) { - H5P_genplist_t *plist; /* Property list */ - H5O_pline_t pline; /* Filter pipeline */ - herr_t ret_value=SUCCEED; /* return value */ + H5P_genplist_t *plist; /* Property list */ + H5O_pline_t pline; /* Filter pipeline */ + herr_t ret_value=SUCCEED; /* return value */ FUNC_ENTER_API(FAIL) H5TRACE5("e", "iZfIuz*[a3]Iu", plist_id, filter, flags, cd_nelmts, cd_values); @@ -768,7 +771,7 @@ H5Pset_filter(hid_t plist_id, H5Z_filter_t filter, unsigned int flags, HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID") /* Call the private function */ - if(H5P_set_filter(plist, filter, flags, cd_nelmts, cd_values) < 0) + if(H5P__set_filter(plist, filter, flags, cd_nelmts, cd_values) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "failed to call private function") done: @@ -777,7 +780,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5P_set_filter + * Function: H5P__set_filter * * Purpose: Adds the specified FILTER and corresponding properties to the * end of the data or link output filter pipeline @@ -798,53 +801,40 @@ done: * failed; the filter will not participate in the pipeline * during an H5Dread() of the chunk. If this bit is clear and * the filter fails then the entire I/O operation fails. - * If this bit is set but encoding is disabled for a filter, - * attempting to write will generate an error. + * If this bit is set but encoding is disabled for a filter, + * attempting to write will generate an error. * * Return: Non-negative on success/Negative on failure * * Programmer: Robb Matzke * Wednesday, April 15, 1998 * - * Modifications: - * - * Raymond Lu - * Tuesday, October 2, 2001 - * Changed the way to check parameter and set property for - * generic property list. - * - * Neil Fortner - * Wednesday, May 20, 2009 - * Overloaded to accept gcpl's as well as dcpl's and moved to - * H5Pocpl.c - * *------------------------------------------------------------------------- */ -herr_t -H5P_set_filter(H5P_genplist_t *plist, H5Z_filter_t filter, unsigned int flags, +static herr_t +H5P__set_filter(H5P_genplist_t *plist, H5Z_filter_t filter, unsigned int flags, size_t cd_nelmts, const unsigned int cd_values[/*cd_nelmts*/]) { - H5O_pline_t pline; /* Filter pipeline */ - H5Z_class2_t *filter_info = NULL; - htri_t filter_avail = FALSE; /* Filter availability */ - herr_t ret_value=SUCCEED; /* return value */ + H5O_pline_t pline; /* Filter pipeline */ + htri_t filter_avail; /* Filter availability */ + herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_STATIC + /* Check if filter is already available */ if((filter_avail = H5Z_filter_avail(filter)) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't check filter availability") + /* If filter is not available, try to dynamically load it */ if(!filter_avail) { - if((filter_info = (H5Z_class2_t *)H5PL_load(H5PL_TYPE_FILTER, (int)filter)) == NULL) - HGOTO_ERROR(H5E_PLUGIN, H5E_CANTLOAD, FAIL, "failed to load dynamically loaded plugin") -/*if(filter_info) -fprintf(stderr, "%s: filter_info=%p, filter_info->id=%d\n", FUNC, filter_info, filter_info->id);*/ - if (H5Z_register (filter_info)<0) - HGOTO_ERROR (H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register filter") - - } - -#ifndef TMP + H5Z_class2_t *filter_info; + + if(NULL == (filter_info = (H5Z_class2_t *)H5PL_load(H5PL_TYPE_FILTER, (int)filter))) + HGOTO_ERROR(H5E_PLINE, H5E_CANTLOAD, FAIL, "failed to load dynamically loaded plugin") + if(H5Z_register(filter_info) < 0) + HGOTO_ERROR(H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register filter") + } /* end if */ + /* Get the pipeline property to append to */ if(H5P_get(plist, H5O_CRT_PIPELINE_NAME, &pline) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get pipeline") @@ -856,11 +846,10 @@ fprintf(stderr, "%s: filter_info=%p, filter_info->id=%d\n", FUNC, filter_info, f /* Put the I/O pipeline information back into the property list */ if(H5P_set(plist, H5O_CRT_PIPELINE_NAME, &pline) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set pipeline") -#endif done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5P_set_filter() */ +} /* end H5P__set_filter() */ /*------------------------------------------------------------------------- diff --git a/src/H5Pprivate.h b/src/H5Pprivate.h index 2006ced..6560064 100644 --- a/src/H5Pprivate.h +++ b/src/H5Pprivate.h @@ -108,8 +108,6 @@ H5_DLL herr_t H5P_modify_filter(H5P_genplist_t *plist, H5Z_filter_t filter, H5_DLL herr_t H5P_get_filter_by_id(H5P_genplist_t *plist, H5Z_filter_t id, unsigned int *flags, size_t *cd_nelmts, unsigned cd_values[], size_t namelen, char name[], unsigned *filter_config); -H5_DLL herr_t H5P_set_filter(H5P_genplist_t *plist, H5Z_filter_t filter, - unsigned int flags, size_t cd_nelmts, const unsigned int cd_values[/*cd_nelmts*/]); /* *SPECIAL* Don't make more of these! -QAK */ H5_DLL htri_t H5P_isa_class(hid_t plist_id, hid_t pclass_id); diff --git a/src/H5Z.c b/src/H5Z.c index 8e8d80c..bfd0045 100644 --- a/src/H5Z.c +++ b/src/H5Z.c @@ -304,8 +304,6 @@ H5Z_register (const H5Z_class2_t *cls) herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) -/*if(cls) -fprintf(stderr, "cls=%p, cls->id=%d\n", cls, cls->id);*/ HDassert(cls); HDassert(cls->id >= 0 && cls->id <= H5Z_FILTER_MAX); @@ -463,7 +461,7 @@ H5Zfilter_avail(H5Z_filter_t id) HGOTO_ERROR (H5E_ARGS, H5E_BADVALUE, FAIL, "invalid filter identification number") if((ret_value = H5Z_filter_avail(id)) < 0) - HGOTO_ERROR (H5E_PLINE, H5E_NOTFOUND, FAIL, "unable to check the availability of the filter") + HGOTO_ERROR(H5E_PLINE, H5E_NOTFOUND, FAIL, "unable to check the availability of the filter") done: FUNC_LEAVE_API(ret_value) @@ -480,24 +478,20 @@ done: * Programmer: Raymond Lu * 13 February 2013 * - * Modifications: - * *------------------------------------------------------------------------- */ htri_t H5Z_filter_avail(H5Z_filter_t id) { size_t i; /* Local index variable */ - htri_t ret_value=FALSE; /* Return value */ + htri_t ret_value = FALSE; /* Return value */ FUNC_ENTER_NOAPI(FAIL) /* Is the filter already registered? */ - for(i=0; ifilter[idx].id))<0) { - H5Z_class2_t *filter_info = NULL; + if((fclass_idx = H5Z_find_idx(pline->filter[idx].id)) < 0) { + H5Z_class2_t *filter_info; - if((filter_info = (H5Z_class2_t *)H5PL_load(H5PL_TYPE_FILTER, (int)(pline->filter[idx].id))) != NULL) { - if (H5Z_register(filter_info)<0) - HGOTO_ERROR (H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register filter") - } else { + if(NULL != (filter_info = (H5Z_class2_t *)H5PL_load(H5PL_TYPE_FILTER, (int)(pline->filter[idx].id)))) { + if(H5Z_register(filter_info) < 0) + HGOTO_ERROR(H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register filter") + } /* end if */ + else { /* Print out the filter name to give more info. But the name is optional for * the filter */ if(pline->filter[idx].name) - HGOTO_ERROR(H5E_PLINE, H5E_READERROR, FAIL, "required filter '%s' is not registered", - pline->filter[idx].name) + HGOTO_ERROR(H5E_PLINE, H5E_READERROR, FAIL, "required filter '%s' is not registered", pline->filter[idx].name) else HGOTO_ERROR(H5E_PLINE, H5E_READERROR, FAIL, "required filter (name unavailable) is not registered") - } - } + } /* end else */ - /* Search in the table of registered filters again to find the dynamic filter just loaded and registered */ - if ((fclass_idx=H5Z_find_idx(pline->filter[idx].id))<0) { - /* Print out the filter name to give more info. But the name is optional for - * the filter */ - if(pline->filter[idx].name) - HGOTO_ERROR(H5E_PLINE, H5E_READERROR, FAIL, "required filter '%s' is not registered", - pline->filter[idx].name) - else - HGOTO_ERROR(H5E_PLINE, H5E_READERROR, FAIL, "required filter (name unavailable) is not registered") - } + /* Search in the table of registered filters again to find the dynamic filter just loaded and registered */ + if((fclass_idx = H5Z_find_idx(pline->filter[idx].id)) < 0) { + /* Print out the filter name to give more info. But the name is optional for + * the filter */ + if(pline->filter[idx].name) + HGOTO_ERROR(H5E_PLINE, H5E_READERROR, FAIL, "required filter '%s' is not registered", pline->filter[idx].name) + else + HGOTO_ERROR(H5E_PLINE, H5E_READERROR, FAIL, "required filter (name unavailable) is not registered") + } /* end if */ + } /* end if */ fclass=&H5Z_table_g[fclass_idx]; #ifdef H5Z_DEBUG diff --git a/src/H5private.h b/src/H5private.h index f1f5dbb..78d3d9d 100644 --- a/src/H5private.h +++ b/src/H5private.h @@ -149,6 +149,17 @@ # include #endif +/* + * Dynamic library handling. These are needed for dynamically loading I/O + * filters and VFDs. + */ +#ifdef H5_HAVE_DLFCN_H +#include +#endif +#ifdef H5_HAVE_DIRENT_H +#include +#endif + #ifdef H5_HAVE_WIN32_API /* The following two defines must be before any windows headers are included */ diff --git a/src/Makefile.am b/src/Makefile.am index 262bdc7..a7f7bd9 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -88,8 +88,9 @@ libhdf5_la_SOURCES= H5.c H5checksum.c H5dbg.c H5system.c H5timer.c H5trace.c \ H5P.c H5Pacpl.c H5Pdapl.c H5Pdcpl.c \ H5Pdeprec.c H5Pdxpl.c H5Pencdec.c \ H5Pfapl.c H5Pfcpl.c H5Pfmpl.c \ - H5Pgcpl.c H5Pint.c H5PL.c \ + H5Pgcpl.c H5Pint.c \ H5Plapl.c H5Plcpl.c H5Pocpl.c H5Pocpypl.c H5Pstrcpl.c H5Ptest.c \ + H5PL.c \ H5R.c H5Rdeprec.c \ H5RC.c \ H5RS.c \ @@ -117,7 +118,9 @@ include_HEADERS = hdf5.h H5api_adpt.h H5overflow.h H5pubconf.h H5public.h H5vers H5FDfamily.h H5FDlog.h H5FDmpi.h H5FDmpio.h H5FDmpiposix.h \ H5FDmulti.h H5FDsec2.h H5FDstdio.h \ H5Gpublic.h H5Ipublic.h H5Lpublic.h \ - H5MMpublic.h H5Opublic.h H5PLpublic.h H5Ppublic.h H5Rpublic.h H5Spublic.h \ + H5MMpublic.h H5Opublic.h H5Ppublic.h \ + H5PLpublic.h \ + H5Rpublic.h H5Spublic.h \ H5Tpublic.h H5Zpublic.h # install libhdf5.settings in lib directory diff --git a/test/plugin.c b/test/plugin.c index debc38b..dd9a1f7 100644 --- a/test/plugin.c +++ b/test/plugin.c @@ -791,14 +791,15 @@ main(void) if(nerrors) TEST_ERROR - printf("All dataset tests passed.\n"); + printf("All plugin tests passed.\n"); h5_cleanup(FILENAME, fapl); return 0; error: nerrors = MAX(1, nerrors); - printf("***** %d DATASET TEST%s FAILED! *****\n", + printf("***** %d PLUGIN TEST%s FAILED! *****\n", nerrors, 1 == nerrors ? "" : "S"); return 1; } + diff --git a/test/test_plugin.sh.in b/test/test_plugin.sh.in index a881198..c00df8c 100644 --- a/test/test_plugin.sh.in +++ b/test/test_plugin.sh.in @@ -24,7 +24,7 @@ TOP_BUILDDIR=@top_builddir@ echo $srcdir echo $TOP_BUILDDIR -# Determine backward compatibility options eneabled +# Determine backward compatibility options enabled DEPRECATED_SYMBOLS="@DEPRECATED_SYMBOLS@" nerrors=0 @@ -54,7 +54,7 @@ TESTING() { } if test $nerrors -eq 0 ; then - echo "All Error API tests passed." + echo "All Plugin API tests passed." fi exit $nerrors -- cgit v0.12 From 32ffaa89822903c0b3f3e4c78db690050ebaafc1 Mon Sep 17 00:00:00 2001 From: Raymond Lu Date: Tue, 19 Mar 2013 11:25:44 -0500 Subject: [svn-r23381] More update for Windows. Tested on koala --- src/H5PL.c | 75 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 72 insertions(+), 3 deletions(-) diff --git a/src/H5PL.c b/src/H5PL.c index 4d84f31..5580e51 100644 --- a/src/H5PL.c +++ b/src/H5PL.c @@ -43,8 +43,7 @@ /* Macros for supporting * both Windows and Unix */ /****************************/ - -/* Handle for dynamic library */ +/* Windows support */ #ifdef H5_HAVE_WIN32_API /* Handle for dynamic library */ #define H5PL_HANDLE HINSTANCE @@ -61,6 +60,20 @@ /* Clear error - nothing to do */ #define H5PL_CLR_ERROR +#define H5PL_GET_PLUGIN_TYPE(H, ret_val) { \ +typedef const int (__cdecl *get_plugin_type_t)(); \ +get_plugin_type_t get_plugin_type; \ +get_plugin_type = (get_plugin_type_t)H5PL_GET_LIB_FUNC(H, "H5PL_get_plugin_type"); \ +ret_val = get_plugin_type(); \ +} + +#define H5PL_GET_PLUGIN_INFO(H, ret_val) { \ +typedef const H5Z_class2_t *(__cdecl *get_filter_info_t)(); \ +get_filter_info_t get_filter_info; \ +get_filter_info = (get_filter_info_t)H5PL_GET_LIB_FUNC(H, "H5PL_get_plugin_info"); \ +ret_val = get_filter_info(); \ +} + #else /* H5_HAVE_WIN32_API */ /* Handle for dynamic library */ #define H5PL_HANDLE void * @@ -77,6 +90,20 @@ /* Clear error */ #define H5PL_CLR_ERROR dlerror() +#define H5PL_GET_PLUGIN_TYPE(H, ret_val) { \ +typedef const int (*get_plugin_type_t)(); \ +get_plugin_type_t get_plugin_type; \ +get_plugin_type = (get_plugin_type_t)H5PL_GET_LIBRARY_FUNCTION(H, "H5PL_get_plugin_type"); \ +ret_val = (*get_plugin_type)(); \ +} + +#define H5PL_GET_PLUGIN_INFO(H, ret_val) { \ +typedef const H5Z_class2_t *(*get_filter_info_t)(); \ +get_filter_info_t get_filter_info; \ +*(void**)(&get_filter_info) = (get_filter_info_t)H5PL_GET_LIB_FUNC(H, "H5PL_get_plugin_info"); \ +ret_val = get_filter_info(); \ +} + #endif /* H5_HAVE_WIN32_API */ @@ -461,6 +488,7 @@ static htri_t H5PL__open(H5PL_type_t pl_type, char *libname, int pl_id, void **pl_info) { H5PL_HANDLE handle = NULL; + H5Z_class2_t *plugin_info = NULL; htri_t ret_value = FALSE; FUNC_ENTER_STATIC @@ -472,6 +500,7 @@ H5PL__open(H5PL_type_t pl_type, char *libname, int pl_id, void **pl_info) H5PL_CLR_ERROR; /* clear error */ } /* end if */ else { +#ifdef TMP H5Z_class2_t * (*H5PL_get_plugin_info)(void); /* Return a handle for the function H5PL_get_plugin_info in the dynamic library. @@ -522,6 +551,42 @@ H5PL__open(H5PL_type_t pl_type, char *libname, int pl_id, void **pl_info) if(H5PL__close(handle) < 0) HGOTO_ERROR(H5E_PLUGIN, H5E_CLOSEERROR, FAIL, "can't close dynamic library") } /* end if */ +#else + H5PL_GET_PLUGIN_INFO(handle, plugin_info); + if(NULL == plugin_info) { + if(H5PL__close(handle) < 0) + HGOTO_ERROR(H5E_PLUGIN, H5E_CLOSEERROR, FAIL, "can't close dynamic library") + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTGET, FAIL, "can't get plugin info") + } + + if(plugin_info->id == pl_id) { + /* Expand the table if it is too small */ + if(H5PL_table_used_g >= H5PL_table_alloc_g) { + size_t n = MAX(H5Z_MAX_NFILTERS, 2 * H5PL_table_alloc_g); + H5PL_table_t *table = (H5PL_table_t *)H5MM_realloc(H5PL_table_g, n * sizeof(H5PL_table_t)); + + if(!table) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "unable to extend dynamic library table") + + H5PL_table_g = table; + H5PL_table_alloc_g = n; + } /* end if */ + + (H5PL_table_g[H5PL_table_used_g]).handle = handle; + (H5PL_table_g[H5PL_table_used_g]).pl_type = pl_type; + (H5PL_table_g[H5PL_table_used_g]).pl_id = plugin_info->id; +/*fprintf(stderr, "%s: H5PL_table_used_g=%d, id=%d, id 2=%d\n", FUNC, H5PL_table_used_g, (H5PL_table_g[H5PL_table_used_g]).pl_id, plugin_info->id);*/ + H5PL_table_used_g++; + + *pl_info = (void *)plugin_info; + ret_value = TRUE; + + HGOTO_DONE(ret_value) + } else + if(H5PL__close(handle) < 0) + HGOTO_ERROR(H5E_PLUGIN, H5E_CLOSEERROR, FAIL, "can't close dynamic library") + +#endif } /* end else */ done: @@ -548,6 +613,7 @@ static htri_t H5PL__search_table(H5PL_type_t plugin_type, int type_id, void **info) { size_t i; + H5Z_class2_t *plugin_info; htri_t ret_value = FALSE; FUNC_ENTER_STATIC @@ -556,6 +622,7 @@ H5PL__search_table(H5PL_type_t plugin_type, int type_id, void **info) if(H5PL_table_used_g > 0) { for(i = 0; i < H5PL_table_used_g; i++) { if((plugin_type == (H5PL_table_g[i]).pl_type) && (type_id == (H5PL_table_g[i]).pl_id)) { +#ifdef TMP H5Z_class2_t *(*H5PL_get_plugin_info)(void); H5Z_class2_t *plugin_info; @@ -563,7 +630,9 @@ H5PL__search_table(H5PL_type_t plugin_type, int type_id, void **info) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTGET, FAIL, "can't get function for H5PL_get_plugin_info") if(NULL == (plugin_info = (*H5PL_get_plugin_info)())) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTGET, FAIL, "can't get plugin info") - +#else + H5PL_GET_PLUGIN_INFO((H5PL_table_g[i]).handle, plugin_info); +#endif *info = (void *)plugin_info; ret_value = TRUE; break; -- cgit v0.12 From a9de601138282ac3ad1f0ca7a01e2fd56fe7c660 Mon Sep 17 00:00:00 2001 From: Raymond Lu Date: Tue, 19 Mar 2013 11:27:45 -0500 Subject: [svn-r23382] I took out H5PLpkg.h. It no longer exist. --- src/CMakeLists.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index e560004..4b70259 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -482,7 +482,6 @@ SET (H5PL_SRCS ) SET (H5PL_HDRS - ${HDF5_SRC_DIR}/H5PLpkg.h ${HDF5_SRC_DIR}/H5PLpublic.h ) IDE_GENERATED_PROPERTIES ("H5PL" "${H5PL_HDRS}" "${H5PL_SRCS}" ) -- cgit v0.12 From b58732109690975b557dc27c7f76234c9f12fbd5 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 19 Mar 2013 14:20:54 -0500 Subject: [svn-r23384] Copy dynamic lib to a plugins folder for testing. This will avoid the segfault with looking for the library with other libraries. Tested: local linux --- config/cmake/ConfigureChecks.cmake | 2 ++ config/cmake/H5pubconf.h.in | 6 ++++++ test/plugin_lib/CMakeLists.txt | 19 +++++++++++++++++-- 3 files changed, 25 insertions(+), 2 deletions(-) diff --git a/config/cmake/ConfigureChecks.cmake b/config/cmake/ConfigureChecks.cmake index 6db6d78..b2078e2 100644 --- a/config/cmake/ConfigureChecks.cmake +++ b/config/cmake/ConfigureChecks.cmake @@ -205,6 +205,7 @@ ENDIF (CYGWIN) #----------------------------------------------------------------------------- IF (NOT WINDOWS) CHECK_LIBRARY_EXISTS_CONCAT ("m" ceil H5_HAVE_LIBM) + CHECK_LIBRARY_EXISTS_CONCAT ("dl" dlopen H5_HAVE_LIBDL) CHECK_LIBRARY_EXISTS_CONCAT ("ws2_32" WSAStartup H5_HAVE_LIBWS2_32) CHECK_LIBRARY_EXISTS_CONCAT ("wsock32" gethostbyname H5_HAVE_LIBWSOCK32) ENDIF (NOT WINDOWS) @@ -367,6 +368,7 @@ CHECK_INCLUDE_FILE_CONCAT ("sys/types.h" H5_HAVE_SYS_TYPES_H) CHECK_INCLUDE_FILE_CONCAT ("stddef.h" H5_HAVE_STDDEF_H) CHECK_INCLUDE_FILE_CONCAT ("setjmp.h" H5_HAVE_SETJMP_H) CHECK_INCLUDE_FILE_CONCAT ("features.h" H5_HAVE_FEATURES_H) +CHECK_INCLUDE_FILE_CONCAT ("dirent.h" H5_HAVE_DIRENT_H) CHECK_INCLUDE_FILE_CONCAT ("stdint.h" H5_HAVE_STDINT_H) # IF the c compiler found stdint, check the C++ as well. On some systems this diff --git a/config/cmake/H5pubconf.h.in b/config/cmake/H5pubconf.h.in index d9f0997..2736daf 100644 --- a/config/cmake/H5pubconf.h.in +++ b/config/cmake/H5pubconf.h.in @@ -124,6 +124,9 @@ /* Define if the direct I/O virtual file driver should be compiled */ #cmakedefine H5_HAVE_DIRECT @H5_HAVE_DIRECT@ +/* Define to 1 if you have the header file. */ +#cmakedefine H5_HAVE_DIRENT_H @H5_HAVE_DIRENT_H@ + /* Define to 1 if you have the header file. */ #cmakedefine H5_HAVE_DLFCN_H @H5_HAVE_DLFCN_H@ @@ -230,6 +233,9 @@ /* Define to 1 if you have the header file. */ #cmakedefine H5_HAVE_IO_H @H5_HAVE_IO_H@ +/* Define to 1 if you have the `dl' library (-ldl). */ +#cmakedefine H5_HAVE_LIBDL @H5_HAVE_LIBDL@ + /* Define to 1 if you have the `dmalloc' library (-ldmalloc). */ #cmakedefine H5_HAVE_LIBDMALLOC @H5_HAVE_LIBDMALLOC@ diff --git a/test/plugin_lib/CMakeLists.txt b/test/plugin_lib/CMakeLists.txt index 6a6f4a7..8bd7ea1 100644 --- a/test/plugin_lib/CMakeLists.txt +++ b/test/plugin_lib/CMakeLists.txt @@ -54,10 +54,25 @@ H5_SET_LIB_OPTIONS ( ${HDF5_TEST_PLUGIN_LIB_TARGET} ${HDF5_TEST_PLUGIN_LIB_NAME} ${LIB_TYPE} HDF5_TEST_PLUGIN_LIB_NAME_RELEASE - HDF5_TEST_PLUGIN_LIB_NAME_DEBUG + HDF5_TEST_PLUGIN_LIB_NAME_DEBUG ) SET_TARGET_PROPERTIES (${HDF5_TEST_PLUGIN_LIB_TARGET} PROPERTIES FOLDER libraries/TEST_PLUGIN) +# +# Copy plugin library to a plugins folder +# + +# make plugins dir +FILE (MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/plugins") +ADD_CUSTOM_COMMAND ( + TARGET ${HDF5_TEST_PLUGIN_LIB_TARGET} + POST_BUILD + COMMAND ${CMAKE_COMMAND} + ARGS -E copy_if_different + "$" + "${CMAKE_BINARY_DIR}/plugins/$" + ) + ############################################################################## ############################################################################## ### T E S T S ### @@ -71,4 +86,4 @@ TARGET_LINK_LIBRARIES (plugin ${HDF5_TEST_PLUGIN_LIB_TARGET}) SET_TARGET_PROPERTIES (plugin PROPERTIES FOLDER test) ADD_TEST (NAME H5PLUGIN-plugin COMMAND $) -SET_TESTS_PROPERTIES (H5PLUGIN-plugin PROPERTIES ENVIRONMENT HDF5_PLUGIN_PATH=${CMAKE_RUNTIME_OUTPUT_DIRECTORY}) +SET_TESTS_PROPERTIES (H5PLUGIN-plugin PROPERTIES ENVIRONMENT HDF5_PLUGIN_PATH=${CMAKE_BINARY_DIR}/plugins) -- cgit v0.12 From 721b337b157aac9002b92418bdf3d526c0d8b784 Mon Sep 17 00:00:00 2001 From: Raymond Lu Date: Tue, 19 Mar 2013 15:07:03 -0500 Subject: [svn-r23386] More updates for Windows. Tested on koala. --- src/H5PL.c | 58 +++++++++------------------------------------------------- 1 file changed, 9 insertions(+), 49 deletions(-) diff --git a/src/H5PL.c b/src/H5PL.c index 5580e51..bc0b90e 100644 --- a/src/H5PL.c +++ b/src/H5PL.c @@ -74,6 +74,8 @@ get_filter_info = (get_filter_info_t)H5PL_GET_LIB_FUNC(H, "H5PL_get_plugin_info" ret_val = get_filter_info(); \ } +typedef const H5Z_class2_t *(__cdecl *get_filter_info_t)(); + #else /* H5_HAVE_WIN32_API */ /* Handle for dynamic library */ #define H5PL_HANDLE void * @@ -104,6 +106,7 @@ get_filter_info_t get_filter_info; \ ret_val = get_filter_info(); \ } +typedef const H5Z_class2_t *(*get_filter_info_t)(); #endif /* H5_HAVE_WIN32_API */ @@ -488,7 +491,7 @@ static htri_t H5PL__open(H5PL_type_t pl_type, char *libname, int pl_id, void **pl_info) { H5PL_HANDLE handle = NULL; - H5Z_class2_t *plugin_info = NULL; + get_filter_info_t H5PL_get_plugin_info = NULL; htri_t ret_value = FALSE; FUNC_ENTER_STATIC @@ -500,13 +503,10 @@ H5PL__open(H5PL_type_t pl_type, char *libname, int pl_id, void **pl_info) H5PL_CLR_ERROR; /* clear error */ } /* end if */ else { -#ifdef TMP - H5Z_class2_t * (*H5PL_get_plugin_info)(void); - /* Return a handle for the function H5PL_get_plugin_info in the dynamic library. * The plugin library is suppose to define this function. */ - if(NULL == (H5PL_get_plugin_info = (H5Z_class2_t *(*)(void))H5PL_GET_LIB_FUNC(handle, "H5PL_get_plugin_info"))) { + if(NULL == (H5PL_get_plugin_info = (get_filter_info_t)H5PL_GET_LIB_FUNC(handle, "H5PL_get_plugin_info"))) { if(H5PL__close(handle) < 0) HGOTO_ERROR(H5E_PLUGIN, H5E_CLOSEERROR, FAIL, "can't close dynamic library") } /* end if */ @@ -551,42 +551,6 @@ H5PL__open(H5PL_type_t pl_type, char *libname, int pl_id, void **pl_info) if(H5PL__close(handle) < 0) HGOTO_ERROR(H5E_PLUGIN, H5E_CLOSEERROR, FAIL, "can't close dynamic library") } /* end if */ -#else - H5PL_GET_PLUGIN_INFO(handle, plugin_info); - if(NULL == plugin_info) { - if(H5PL__close(handle) < 0) - HGOTO_ERROR(H5E_PLUGIN, H5E_CLOSEERROR, FAIL, "can't close dynamic library") - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTGET, FAIL, "can't get plugin info") - } - - if(plugin_info->id == pl_id) { - /* Expand the table if it is too small */ - if(H5PL_table_used_g >= H5PL_table_alloc_g) { - size_t n = MAX(H5Z_MAX_NFILTERS, 2 * H5PL_table_alloc_g); - H5PL_table_t *table = (H5PL_table_t *)H5MM_realloc(H5PL_table_g, n * sizeof(H5PL_table_t)); - - if(!table) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "unable to extend dynamic library table") - - H5PL_table_g = table; - H5PL_table_alloc_g = n; - } /* end if */ - - (H5PL_table_g[H5PL_table_used_g]).handle = handle; - (H5PL_table_g[H5PL_table_used_g]).pl_type = pl_type; - (H5PL_table_g[H5PL_table_used_g]).pl_id = plugin_info->id; -/*fprintf(stderr, "%s: H5PL_table_used_g=%d, id=%d, id 2=%d\n", FUNC, H5PL_table_used_g, (H5PL_table_g[H5PL_table_used_g]).pl_id, plugin_info->id);*/ - H5PL_table_used_g++; - - *pl_info = (void *)plugin_info; - ret_value = TRUE; - - HGOTO_DONE(ret_value) - } else - if(H5PL__close(handle) < 0) - HGOTO_ERROR(H5E_PLUGIN, H5E_CLOSEERROR, FAIL, "can't close dynamic library") - -#endif } /* end else */ done: @@ -614,6 +578,7 @@ H5PL__search_table(H5PL_type_t plugin_type, int type_id, void **info) { size_t i; H5Z_class2_t *plugin_info; + get_filter_info_t H5PL_get_plugin_info = NULL; htri_t ret_value = FALSE; FUNC_ENTER_STATIC @@ -622,17 +587,12 @@ H5PL__search_table(H5PL_type_t plugin_type, int type_id, void **info) if(H5PL_table_used_g > 0) { for(i = 0; i < H5PL_table_used_g; i++) { if((plugin_type == (H5PL_table_g[i]).pl_type) && (type_id == (H5PL_table_g[i]).pl_id)) { -#ifdef TMP - H5Z_class2_t *(*H5PL_get_plugin_info)(void); - H5Z_class2_t *plugin_info; - - if(NULL == (H5PL_get_plugin_info = (H5Z_class2_t *(*)(void))H5PL_GET_LIB_FUNC((H5PL_table_g[i]).handle, "H5PL_get_plugin_info"))) + if(NULL == (H5PL_get_plugin_info = (get_filter_info_t)H5PL_GET_LIB_FUNC((H5PL_table_g[i]).handle, "H5PL_get_plugin_info"))) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTGET, FAIL, "can't get function for H5PL_get_plugin_info") + if(NULL == (plugin_info = (*H5PL_get_plugin_info)())) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTGET, FAIL, "can't get plugin info") -#else - H5PL_GET_PLUGIN_INFO((H5PL_table_g[i]).handle, plugin_info); -#endif + *info = (void *)plugin_info; ret_value = TRUE; break; -- cgit v0.12 From 40b7936a5b3f8e9a17fc7dd0d587a1c700074643 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 19 Mar 2013 15:19:06 -0500 Subject: [svn-r23387] Add dynamic windows decorations --- test/plugin_lib/dynlib1.h | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/test/plugin_lib/dynlib1.h b/test/plugin_lib/dynlib1.h index f3bb8c3..9357b1b 100644 --- a/test/plugin_lib/dynlib1.h +++ b/test/plugin_lib/dynlib1.h @@ -19,15 +19,28 @@ * * Purpose: Tests the plugin module (H5PL) */ +#ifndef DYNLIB1_H__ +#define DYNLIB1_H__ + #include #include #include #define FILTER_DYNLIB1_VERS 1 -const H5PL_type_t H5PL_get_plugin_type(void); -const H5Z_class2_t* H5PL_get_plugin_info(void); +#ifdef __cplusplus +extern "C" { +#endif + + H5TEST_DLL const H5PL_type_t H5PL_get_plugin_type(void); + H5TEST_DLL const H5Z_class2_t* H5PL_get_plugin_info(void); /* Local prototypes for filter functions */ -static size_t H5Z_filter_dynlib1(unsigned int flags, size_t cd_nelmts, - const unsigned int *cd_values, size_t nbytes, size_t *buf_size, void **buf); + H5TEST_DLL static size_t H5Z_filter_dynlib1(unsigned int flags, size_t cd_nelmts, + const unsigned int *cd_values, size_t nbytes, size_t *buf_size, void **buf); + +#ifdef __cplusplus +} +#endif + +#endif /* DYNLIB1_H__ */ -- cgit v0.12 From cec54e1fa04f703175b6d6c9bbcb78aba98e64a9 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 19 Mar 2013 15:57:18 -0500 Subject: [svn-r23389] HDFFV-8338: remove unused headers --- test/plugin_lib/CMakeLists.txt | 2 -- 1 file changed, 2 deletions(-) diff --git a/test/plugin_lib/CMakeLists.txt b/test/plugin_lib/CMakeLists.txt index 8bd7ea1..e45e848 100644 --- a/test/plugin_lib/CMakeLists.txt +++ b/test/plugin_lib/CMakeLists.txt @@ -36,8 +36,6 @@ SET (H5_TEST_PLUGIN_LIB_SRCS SET (H5_TEST_PLUGIN_LIB_HDRS ${HDF5_TEST_PLUGIN_LIB_SOURCE_DIR}/dynlib1.h - ${HDF5_TEST_SOURCE_DIR}/H5srcdir.h - ${HDF5_TEST_SOURCE_DIR}/h5test.h ) #----------------------------------------------------------------------------- -- cgit v0.12 From 4f1c1bbf1abeae3b452d9dcd61defd35005e11e3 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 19 Mar 2013 16:10:39 -0500 Subject: [svn-r23390] Remove dll decoration from local function --- test/plugin_lib/dynlib1.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/plugin_lib/dynlib1.h b/test/plugin_lib/dynlib1.h index 9357b1b..028cb00 100644 --- a/test/plugin_lib/dynlib1.h +++ b/test/plugin_lib/dynlib1.h @@ -32,11 +32,11 @@ extern "C" { #endif - H5TEST_DLL const H5PL_type_t H5PL_get_plugin_type(void); - H5TEST_DLL const H5Z_class2_t* H5PL_get_plugin_info(void); + H5_DLL const H5PL_type_t H5PL_get_plugin_type(void); + H5_DLL const H5Z_class2_t* H5PL_get_plugin_info(void); /* Local prototypes for filter functions */ - H5TEST_DLL static size_t H5Z_filter_dynlib1(unsigned int flags, size_t cd_nelmts, + static size_t H5Z_filter_dynlib1(unsigned int flags, size_t cd_nelmts, const unsigned int *cd_values, size_t nbytes, size_t *buf_size, void **buf); #ifdef __cplusplus -- cgit v0.12 From 7c70c816f596fe505b84033d7f163e9ef7affc2d Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 20 Mar 2013 09:26:04 -0500 Subject: [svn-r23399] Add missing CMakeLists.txt file --- MANIFEST | 1 + 1 file changed, 1 insertion(+) diff --git a/MANIFEST b/MANIFEST index e1ab635..3b6e913 100644 --- a/MANIFEST +++ b/MANIFEST @@ -2421,6 +2421,7 @@ ./perform/CMakeLists.txt ./src/CMakeLists.txt ./test/CMakeLists.txt +./test/plugin_lib/CMakeLists.txt ./testpar/CMakeLists.txt ./tools/CMakeLists.txt ./tools/h5copy/CMakeLists.txt -- cgit v0.12 From 61b39ecc7c171dc3a6efae61d321653b493d7981 Mon Sep 17 00:00:00 2001 From: Raymond Lu Date: Wed, 20 Mar 2013 10:13:17 -0500 Subject: [svn-r23400] I updated Makefile.in for Mac. Tested on MacGoblin and koala. --- test/plugin_lib/Makefile.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/plugin_lib/Makefile.in b/test/plugin_lib/Makefile.in index 83d350c..00a2ea5 100644 --- a/test/plugin_lib/Makefile.in +++ b/test/plugin_lib/Makefile.in @@ -36,7 +36,7 @@ $(NAME1).o: $(SRCDIR)/$(NAME1).c $(CC) $(CFLAGS) $(INCLUDES) -c $(SRCDIR)/$(NAME1).c lib$(NAME1).so.$(VERSION): $(NAME1).o - $(CC) -shared -Wl,-soname,lib$(NAME1).so.$(MAJOR) $^ -o $@ + $(CC) -shared $^ -o $@ clean: $(RM) *.o *.so* Makefile -- cgit v0.12 From 76d6b9f4db4424f6ae52703cc43cbfe1130a439c Mon Sep 17 00:00:00 2001 From: Raymond Lu Date: Wed, 20 Mar 2013 10:50:52 -0500 Subject: [svn-r23401] I cleaned up the test. Tested on koala. --- test/plugin.c | 157 +++------------------------------------------------------- 1 file changed, 8 insertions(+), 149 deletions(-) diff --git a/test/plugin.c b/test/plugin.c index dd9a1f7..3cadb3c 100644 --- a/test/plugin.c +++ b/test/plugin.c @@ -36,94 +36,12 @@ const char *FILENAME[] = { NULL }; #define FILENAME_BUF_SIZE 1024 -#define KB 1024 - -#define FILE_DEFLATE_NAME "deflate.h5" /* Dataset names for testing filters */ -#define DSET_DEFAULT_NAME "default" -#define DSET_CHUNKED_NAME "chunked" -#define DSET_COMPACT_NAME "compact" -#define DSET_SIMPLE_IO_NAME "simple_io" -#define DSET_USERBLOCK_IO_NAME "userblock_io" -#define DSET_COMPACT_IO_NAME "compact_io" -#define DSET_COMPACT_MAX_NAME "max_compact" -#define DSET_COMPACT_MAX2_NAME "max_compact_2" -#define DSET_CONV_BUF_NAME "conv_buf" -#define DSET_TCONV_NAME "tconv" #define DSET_DEFLATE_NAME "deflate" #define DSET_BZIP2_NAME "bzip2" #define DSET_DYNLIB1_NAME "dynlib1" #define DSET_DYNLIB2_NAME "dynlib2" -#ifdef H5_HAVE_FILTER_SZIP -#define DSET_SZIP_NAME "szip" -#endif /* H5_HAVE_FILTER_SZIP */ -#define DSET_SHUFFLE_NAME "shuffle" -#define DSET_FLETCHER32_NAME "fletcher32" -#define DSET_FLETCHER32_NAME_2 "fletcher32_2" -#define DSET_FLETCHER32_NAME_3 "fletcher32_3" -#define DSET_SHUF_DEF_FLET_NAME "shuffle+deflate+fletcher32" -#define DSET_SHUF_DEF_FLET_NAME_2 "shuffle+deflate+fletcher32_2" -#if defined H5_HAVE_FILTER_SZIP && defined H5_HAVE_FILTER_SHUFFLE && defined H5_HAVE_FILTER_FLETCHER32 -#define DSET_SHUF_SZIP_FLET_NAME "shuffle+szip+fletcher32" -#define DSET_SHUF_SZIP_FLET_NAME_2 "shuffle+szip+fletcher32_2" -#endif /* defined H5_HAVE_FILTER_SZIP && defined H5_HAVE_FILTER_SHUFFLE && defined H5_HAVE_FILTER_FLETCHER32 */ - -#define DSET_MISSING_NAME "missing" -#define DSET_CAN_APPLY_NAME "can_apply" -#define DSET_CAN_APPLY_NAME2 "can_apply2" -#ifdef H5_HAVE_FILTER_SZIP -#define DSET_CAN_APPLY_SZIP_NAME "can_apply_szip" -#endif /* H5_HAVE_FILTER_SZIP */ -#define DSET_SET_LOCAL_NAME "set_local" -#define DSET_SET_LOCAL_NAME_2 "set_local_2" -#define DSET_ONEBYTE_SHUF_NAME "onebyte_shuffle" -#define DSET_NBIT_INT_NAME "nbit_int" -#define DSET_NBIT_FLOAT_NAME "nbit_float" -#define DSET_NBIT_DOUBLE_NAME "nbit_double" -#define DSET_NBIT_ARRAY_NAME "nbit_array" -#define DSET_NBIT_COMPOUND_NAME "nbit_compound" -#define DSET_NBIT_COMPOUND_NAME_2 "nbit_compound_2" -#define DSET_NBIT_COMPOUND_NAME_3 "nbit_compound_3" -#define DSET_NBIT_INT_SIZE_NAME "nbit_int_size" -#define DSET_NBIT_FLT_SIZE_NAME "nbit_flt_size" -#define DSET_SCALEOFFSET_INT_NAME "scaleoffset_int" -#define DSET_SCALEOFFSET_INT_NAME_2 "scaleoffset_int_2" -#define DSET_SCALEOFFSET_FLOAT_NAME "scaleoffset_float" -#define DSET_SCALEOFFSET_FLOAT_NAME_2 "scaleoffset_float_2" -#define DSET_SCALEOFFSET_DOUBLE_NAME "scaleoffset_double" -#define DSET_SCALEOFFSET_DOUBLE_NAME_2 "scaleoffset_double_2" -#define DSET_COMPARE_DCPL_NAME "compare_dcpl" -#define DSET_COMPARE_DCPL_NAME_2 "compare_dcpl_2" -#define DSET_COPY_DCPL_NAME_1 "copy_dcpl_1" -#define DSET_COPY_DCPL_NAME_2 "copy_dcpl_2" -#define COPY_DCPL_EXTFILE_NAME "ext_file" -#define DSET_DEPREC_NAME "deprecated" -#define DSET_DEPREC_NAME_CHUNKED "deprecated_chunked" -#define DSET_DEPREC_NAME_COMPACT "deprecated_compact" -#define DSET_DEPREC_NAME_FILTER "deprecated_filter" - -#define USER_BLOCK 1024 -#define SIXTY_FOUR_KB 65536 - -/* Temporary filter IDs used for testing */ - -/* Flags for testing filters */ -#define DISABLE_FLETCHER32 0 -#define ENABLE_FLETCHER32 1 -#define DATA_CORRUPTED 1 -#define DATA_NOT_CORRUPTED 0 - -/* Parameters for the "set local" test */ -#define BOGUS2_PERM_NPARMS 2 /* Number of "permanent" parameters */ -#define BOGUS2_PARAM_1 13 /* (No particular meaning, just for checking value) */ -#define BOGUS2_PARAM_2 35 /* (No particular meaning, just for checking value) */ -#define BOGUS2_ALL_NPARMS 4 /* Total number of parameter = permanent + "local" parameters */ - -/* Dimensionality for conversion buffer test */ -#define DIM1 100 /* Dim. Size of data member # 1 */ -#define DIM2 5000 /* Dim. Size of data member # 2 */ -#define DIM3 10 /* Dim. Size of data member # 3 */ /* Parameters for internal filter test */ #define FILTER_CHUNK_DIM1 2 @@ -133,48 +51,6 @@ const char *FILENAME[] = { #define FILTER_HS_SIZE1 4 #define FILTER_HS_SIZE2 50 -/* Names for noencoder test */ -#ifdef H5_HAVE_FILTER_SZIP -#define NOENCODER_FILENAME "noencoder.h5" -#define NOENCODER_COPY_FILENAME "noencoder.h5.copy" -#define NOENCODER_TEST_DATASET "noencoder_tdset.h5" -#define NOENCODER_SZIP_DATASET "noencoder_szip_dset.h5" -#define NOENCODER_SZIP_SHUFF_FLETCH_DATASET "noencoder_szip_shuffle_fletcher_dset.h5" -#endif /* H5_HAVE_FILTER_SZIP */ - -/* Names for zero-dim test */ -#define ZERODIM_DATASET "zerodim" - -/* Parameters for zero-dim test */ -#define MISSING_CHUNK_DATASET "missing_chunk" -#define MISSING_CHUNK_DIM 100 - -/* Names for random chunks test */ -#define NPOINTS 50 - -/* Parameters for huge chunks test */ -#define HUGE_DATASET "Dataset" -#define HUGE_DIM ((hsize_t)16 * 1024 * 1024 * 1024) -#define HUGE_CHUNK_DIM ((hsize_t)2 * 1024 * 1024 * 1024) -#define TOO_HUGE_CHUNK_DIM ((hsize_t)4 * 1024 * 1024 * 1024) -#define HUGE_DATASET2 "Dataset2" -#define HUGE_DIM2_0 ((hsize_t)16 * 1024) -#define HUGE_DIM2_1 ((hsize_t)16 * 1024) -#define HUGE_DIM2_2 ((hsize_t)16 * 1024) -#define HUGE_CHUNK_DIM2_0 ((hsize_t)2 * 1024) -#define HUGE_CHUNK_DIM2_1 ((hsize_t)1024) -#define HUGE_CHUNK_DIM2_2 ((hsize_t)1024) -#define TOO_HUGE_CHUNK_DIM2_0 ((hsize_t)4 * 1024) -#define TOO_HUGE_CHUNK_DIM2_1 ((hsize_t)1024) -#define TOO_HUGE_CHUNK_DIM2_2 ((hsize_t)1024) - -/* Parameters for testing bypassing chunk cache */ -#define BYPASS_DATASET1 "Dset1" -#define BYPASS_DATASET2 "Dset2" -#define BYPASS_DIM 1000 -#define BYPASS_CHUNK_DIM 500 -#define BYPASS_FILL_VALUE 7 - /* Shared global arrays */ #define DSET_DIM1 100 #define DSET_DIM2 200 @@ -199,7 +75,7 @@ int points_deflate[DSET_DIM1][DSET_DIM2], *------------------------------------------------------------------------- */ static herr_t -test_filter_internal(hid_t fid, const char *name, hid_t dcpl, hsize_t *dset_size) +test_filter_internal(hid_t fid, const char *name, hid_t dcpl) { hid_t dataset; /* Dataset ID */ hid_t dxpl; /* Dataset xfer property list ID */ @@ -212,7 +88,6 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl, hsize_t *dset_size int points[DSET_DIM1][DSET_DIM2], check[DSET_DIM1][DSET_DIM2]; size_t i, j; /* Local index variables */ int n = 0; - herr_t status; /* Error status */ /* Create the data space */ if((sid = H5Screate_simple(2, size, NULL)) < 0) goto error; @@ -279,8 +154,6 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl, hsize_t *dset_size if(H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, write_dxpl, points) < 0) TEST_ERROR; - if((*dset_size=H5Dget_storage_size(dataset))==0) TEST_ERROR; - PASSED(); /*---------------------------------------------------------------------- @@ -344,7 +217,6 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl, hsize_t *dset_size } } - if((*dset_size=H5Dget_storage_size(dataset))==0) TEST_ERROR; PASSED(); /*---------------------------------------------------------------------- @@ -433,8 +305,6 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl, hsize_t *dset_size } } - /* Get the storage size of the dataset */ - if((*dset_size=H5Dget_storage_size(dataset))==0) goto error; /* Clean up objects used for this test */ if(H5Dclose (dataset) < 0) goto error; if(H5Sclose (sid) < 0) goto error; @@ -468,12 +338,7 @@ test_filters(hid_t file, hid_t fapl) { hid_t dc; /* Dataset creation property list ID */ const hsize_t chunk_size[2] = {FILTER_CHUNK_DIM1, FILTER_CHUNK_DIM2}; /* Chunk dimensions */ - hsize_t null_size; /* Size of dataset with null filter */ - int compress_level = 9; - -#ifdef H5_HAVE_FILTER_DEFLATE - hsize_t deflate_size; /* Size of dataset with deflate filter */ -#endif /* H5_HAVE_FILTER_DEFLATE */ + unsigned int compress_level = 9; /*---------------------------------------------------------- * STEP 2: Test deflation by itself. @@ -485,7 +350,7 @@ test_filters(hid_t file, hid_t fapl) if(H5Pset_chunk (dc, 2, chunk_size) < 0) goto error; if(H5Pset_deflate (dc, 6) < 0) goto error; - if(test_filter_internal(file,DSET_DEFLATE_NAME,dc,&deflate_size) < 0) goto error; + if(test_filter_internal(file,DSET_DEFLATE_NAME,dc) < 0) goto error; /* Clean up objects used for this test */ if(H5Pclose (dc) < 0) goto error; #else /* H5_HAVE_FILTER_DEFLATE */ @@ -501,9 +366,9 @@ test_filters(hid_t file, hid_t fapl) puts("Testing DYNLIB1 filter"); if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error; if(H5Pset_chunk (dc, 2, chunk_size) < 0) goto error; - if(H5Pset_filter (dc, H5Z_FILTER_DYNLIB1, H5Z_FLAG_MANDATORY, 1, &compress_level) < 0) goto error; + if(H5Pset_filter (dc, H5Z_FILTER_DYNLIB1, H5Z_FLAG_MANDATORY, (size_t)1, &compress_level) < 0) goto error; - if(test_filter_internal(file,DSET_DYNLIB1_NAME,dc,&deflate_size) < 0) goto error; + if(test_filter_internal(file,DSET_DYNLIB1_NAME,dc) < 0) goto error; /* Clean up objects used for this test */ if(H5Pclose (dc) < 0) goto error; @@ -523,7 +388,7 @@ test_filters(hid_t file, hid_t fapl) if(H5Pset_chunk (dc, 2, chunk_size) < 0) goto error; if(H5Pset_filter (dc, H5Z_FILTER_DYNLIB2, H5Z_FLAG_MANDATORY, 1, &compress_level) < 0) goto error; - if(test_filter_internal(file,DSET_DYNLIB2_NAME,dc,&deflate_size) < 0) goto error; + if(test_filter_internal(file,DSET_DYNLIB2_NAME,dc) < 0) goto error; /* Clean up objects used for this test */ if(H5Pclose (dc) < 0) goto error; @@ -543,7 +408,7 @@ test_filters(hid_t file, hid_t fapl) if(H5Pset_chunk (dc, 2, chunk_size) < 0) goto error; if(H5Pset_filter (dc, H5Z_FILTER_BZIP2, H5Z_FLAG_MANDATORY, 1, &compress_level) < 0) goto error; - if(test_filter_internal(file,DSET_BZIP2_NAME,dc,&deflate_size) < 0) goto error; + if(test_filter_internal(file,DSET_BZIP2_NAME,dc) < 0) goto error; /* Clean up objects used for this test */ if(H5Pclose (dc) < 0) goto error; @@ -624,12 +489,6 @@ static herr_t test_read_with_filters(hid_t file, hid_t fapl) { hid_t dset; /* Dataset ID */ - hsize_t null_size; /* Size of dataset with null filter */ - int compress_level = 9; - -#ifdef H5_HAVE_FILTER_DEFLATE - hsize_t deflate_size; /* Size of dataset with deflate filter */ -#endif /* H5_HAVE_FILTER_DEFLATE */ /*---------------------------------------------------------- * STEP 2: Test deflation by itself. @@ -717,7 +576,7 @@ int main(void) { char filename[FILENAME_BUF_SIZE]; - hid_t file, grp, fapl, fapl2; + hid_t file, fapl, fapl2; hbool_t new_format; int mdc_nelmts; size_t rdcc_nelmts; -- cgit v0.12 From 6563fc39b17543f01fd8e888774c43a75628737f Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 20 Mar 2013 11:14:53 -0500 Subject: [svn-r23402] Plugin Library needs own dll decorator Tested: windows --- test/plugin_lib/dynlib1.h | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/test/plugin_lib/dynlib1.h b/test/plugin_lib/dynlib1.h index 028cb00..fba626f 100644 --- a/test/plugin_lib/dynlib1.h +++ b/test/plugin_lib/dynlib1.h @@ -26,14 +26,23 @@ #include #include +/* plugins always export */ + #if defined (_MSC_VER) /* MSVC Compiler Case */ + #define H5PLUGIN_DLL __declspec(dllexport) + #define H5PLUGIN_DLLVAR extern __declspec(dllexport) + #elif (__GNUC__ >= 4) /* GCC 4.x has support for visibility options */ + #define H5PLUGIN_DLL __attribute__ ((visibility("default"))) + #define H5PLUGIN_DLLVAR extern __attribute__ ((visibility("default"))) + #endif + #define FILTER_DYNLIB1_VERS 1 #ifdef __cplusplus extern "C" { #endif - H5_DLL const H5PL_type_t H5PL_get_plugin_type(void); - H5_DLL const H5Z_class2_t* H5PL_get_plugin_info(void); + H5PLUGIN_DLL const H5PL_type_t H5PL_get_plugin_type(void); + H5PLUGIN_DLL const H5Z_class2_t* H5PL_get_plugin_info(void); /* Local prototypes for filter functions */ static size_t H5Z_filter_dynlib1(unsigned int flags, size_t cd_nelmts, -- cgit v0.12 From 59a9d9a0c67ea2a848a6aaad544db651a9fa4192 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 20 Mar 2013 13:21:28 -0500 Subject: [svn-r23403] Refactor windows code: windows uses ';' as path separator windows default path is different windows find files needs '*.*' --- MANIFEST | 1 - src/H5PL.c | 11 ++++++--- src/H5PLpublic.h | 13 +++++++++- test/plugin_lib/CMakeLists.txt | 8 ++---- test/plugin_lib/dynlib1.c | 8 +++++- test/plugin_lib/dynlib1.h | 55 ------------------------------------------ 6 files changed, 29 insertions(+), 67 deletions(-) delete mode 100644 test/plugin_lib/dynlib1.h diff --git a/MANIFEST b/MANIFEST index 3b6e913..17de021 100644 --- a/MANIFEST +++ b/MANIFEST @@ -1096,7 +1096,6 @@ ./test/chunk_info.c ./test/plugin_lib/dynlib1.c -./test/plugin_lib/dynlib1.h ./test/plugin_lib/Makefile.in ./test/testfiles/err_compat_1 diff --git a/src/H5PL.c b/src/H5PL.c index bc0b90e..5fb8147 100644 --- a/src/H5PL.c +++ b/src/H5PL.c @@ -35,8 +35,6 @@ /* Local Macros */ /****************/ -#define H5PL_DEFAULT_PATH "/usr:/usr/lib:/usr/local" -#define H5PL_PATH_SEPARATOR ":" #define H5PL_MAX_PATH_NUM 16 /****************************/ @@ -45,6 +43,8 @@ /****************************/ /* Windows support */ #ifdef H5_HAVE_WIN32_API +#define H5PL_DEFAULT_PATH ".;/ProgramData;/Users/Public" +#define H5PL_PATH_SEPARATOR ";" /* Handle for dynamic library */ #define H5PL_HANDLE HINSTANCE @@ -77,6 +77,8 @@ ret_val = get_filter_info(); \ typedef const H5Z_class2_t *(__cdecl *get_filter_info_t)(); #else /* H5_HAVE_WIN32_API */ +#define H5PL_DEFAULT_PATH "/usr:/usr/lib:/usr/local" +#define H5PL_PATH_SEPARATOR ":" /* Handle for dynamic library */ #define H5PL_HANDLE void * @@ -425,10 +427,13 @@ H5PL__find(H5PL_type_t plugin_type, int type_id, char *dir, void **info) HANDLE hFind; char *pathname = NULL; htri_t ret_value = FALSE; + char service[2048]; FUNC_ENTER_STATIC - if((hFind = FindFirstFile(dir, &fdFile)) == INVALID_HANDLE_VALUE) + /* Specify a file mask. *.* = We want everything! */ + sprintf(service, "%s*.*", dir); + if((hFind = FindFirstFile(service, &fdFile)) == INVALID_HANDLE_VALUE) HGOTO_ERROR(H5E_PLUGIN, H5E_OPENERROR, FAIL, "can't open directory") do { diff --git a/src/H5PLpublic.h b/src/H5PLpublic.h index 65a94cc..6b17197 100644 --- a/src/H5PLpublic.h +++ b/src/H5PLpublic.h @@ -21,7 +21,7 @@ #define _H5PLpublic_H /* Public headers needed by this file */ -#include "H5public.h" +#include "H5Zpublic.h" /****************************/ /* Library Public Typedefs */ @@ -36,12 +36,23 @@ typedef enum H5PL_type_t { } H5PL_type_t; +/* plugins always export */ +#if defined (_MSC_VER) /* MSVC Compiler Case */ + #define H5PLUGIN_DLL __declspec(dllexport) +#elif (__GNUC__ >= 4) /* GCC 4.x has support for visibility options */ + #define H5PLUGIN_DLL __attribute__ ((visibility("default"))) +#endif + #ifdef __cplusplus extern "C" { #endif + H5PLUGIN_DLL const H5PL_type_t H5PL_get_plugin_type(void); + H5PLUGIN_DLL const H5Z_class2_t* H5PL_get_plugin_info(void); + #ifdef __cplusplus } #endif + #endif /* _H5PLpublic_H */ diff --git a/test/plugin_lib/CMakeLists.txt b/test/plugin_lib/CMakeLists.txt index e45e848..6435688 100644 --- a/test/plugin_lib/CMakeLists.txt +++ b/test/plugin_lib/CMakeLists.txt @@ -34,10 +34,6 @@ SET (H5_TEST_PLUGIN_LIB_SRCS ${HDF5_TEST_PLUGIN_LIB_SOURCE_DIR}/dynlib1.c ) -SET (H5_TEST_PLUGIN_LIB_HDRS - ${HDF5_TEST_PLUGIN_LIB_SOURCE_DIR}/dynlib1.h -) - #----------------------------------------------------------------------------- # Generate the H5srcdir_str.h file containing user settings needed by compilation #----------------------------------------------------------------------------- @@ -45,7 +41,7 @@ SET (srcdir ${CMAKE_CURRENT_SOURCE_DIR}) CONFIGURE_FILE (${HDF5_TEST_SOURCE_DIR}/H5srcdir_str.h.in H5srcdir_str.h @ONLY) INCLUDE_DIRECTORIES (${CMAKE_CURRENT_BINARY_DIR}) -ADD_LIBRARY (${HDF5_TEST_PLUGIN_LIB_TARGET} ${LIB_TYPE} ${H5_TEST_PLUGIN_LIB_SRCS} ${H5_TEST_PLUGIN_LIB_HDRS}) +ADD_LIBRARY (${HDF5_TEST_PLUGIN_LIB_TARGET} ${LIB_TYPE} ${H5_TEST_PLUGIN_LIB_SRCS}) TARGET_LINK_LIBRARIES (${HDF5_TEST_PLUGIN_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) #SET_GLOBAL_VARIABLE( HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_TEST_PLUGIN_LIB_TARGET}") H5_SET_LIB_OPTIONS ( @@ -84,4 +80,4 @@ TARGET_LINK_LIBRARIES (plugin ${HDF5_TEST_PLUGIN_LIB_TARGET}) SET_TARGET_PROPERTIES (plugin PROPERTIES FOLDER test) ADD_TEST (NAME H5PLUGIN-plugin COMMAND $) -SET_TESTS_PROPERTIES (H5PLUGIN-plugin PROPERTIES ENVIRONMENT HDF5_PLUGIN_PATH=${CMAKE_BINARY_DIR}/plugins) +SET_TESTS_PROPERTIES (H5PLUGIN-plugin PROPERTIES ENVIRONMENT "HDF5_PLUGIN_PATH=${CMAKE_BINARY_DIR}/plugins/ diff --git a/test/plugin_lib/dynlib1.c b/test/plugin_lib/dynlib1.c index 1f4fff8..d663bd7 100644 --- a/test/plugin_lib/dynlib1.c +++ b/test/plugin_lib/dynlib1.c @@ -19,7 +19,13 @@ * * Purpose: Tests the plugin module (H5PL) */ -#include "dynlib1.h" + +#include +#include +#include + +static size_t H5Z_filter_dynlib1(unsigned int flags, size_t cd_nelmts, + const unsigned int *cd_values, size_t nbytes, size_t *buf_size, void **buf); /* This message derives from H5Z */ const H5Z_class2_t H5Z_DYNLIB1[1] = {{ diff --git a/test/plugin_lib/dynlib1.h b/test/plugin_lib/dynlib1.h deleted file mode 100644 index fba626f..0000000 --- a/test/plugin_lib/dynlib1.h +++ /dev/null @@ -1,55 +0,0 @@ -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * - * 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 files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * - * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ - -/* - * Programmer: Raymond Lu - * 13 February 2013 - * - * Purpose: Tests the plugin module (H5PL) - */ -#ifndef DYNLIB1_H__ -#define DYNLIB1_H__ - -#include -#include -#include - -/* plugins always export */ - #if defined (_MSC_VER) /* MSVC Compiler Case */ - #define H5PLUGIN_DLL __declspec(dllexport) - #define H5PLUGIN_DLLVAR extern __declspec(dllexport) - #elif (__GNUC__ >= 4) /* GCC 4.x has support for visibility options */ - #define H5PLUGIN_DLL __attribute__ ((visibility("default"))) - #define H5PLUGIN_DLLVAR extern __attribute__ ((visibility("default"))) - #endif - -#define FILTER_DYNLIB1_VERS 1 - -#ifdef __cplusplus -extern "C" { -#endif - - H5PLUGIN_DLL const H5PL_type_t H5PL_get_plugin_type(void); - H5PLUGIN_DLL const H5Z_class2_t* H5PL_get_plugin_info(void); - -/* Local prototypes for filter functions */ - static size_t H5Z_filter_dynlib1(unsigned int flags, size_t cd_nelmts, - const unsigned int *cd_values, size_t nbytes, size_t *buf_size, void **buf); - -#ifdef __cplusplus -} -#endif - -#endif /* DYNLIB1_H__ */ -- cgit v0.12 From fb169f7aa93db566f3e64149fcab2a701a0f382a Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 20 Mar 2013 13:37:35 -0500 Subject: [svn-r23405] Correct typo --- test/plugin_lib/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/plugin_lib/CMakeLists.txt b/test/plugin_lib/CMakeLists.txt index 6435688..9428153 100644 --- a/test/plugin_lib/CMakeLists.txt +++ b/test/plugin_lib/CMakeLists.txt @@ -80,4 +80,4 @@ TARGET_LINK_LIBRARIES (plugin ${HDF5_TEST_PLUGIN_LIB_TARGET}) SET_TARGET_PROPERTIES (plugin PROPERTIES FOLDER test) ADD_TEST (NAME H5PLUGIN-plugin COMMAND $) -SET_TESTS_PROPERTIES (H5PLUGIN-plugin PROPERTIES ENVIRONMENT "HDF5_PLUGIN_PATH=${CMAKE_BINARY_DIR}/plugins/ +SET_TESTS_PROPERTIES (H5PLUGIN-plugin PROPERTIES ENVIRONMENT "HDF5_PLUGIN_PATH=${CMAKE_BINARY_DIR}/plugins") -- cgit v0.12 From f0e328cc04ae9cf6032e740cf223fcfdd83a5f6d Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 20 Mar 2013 15:24:55 -0500 Subject: [svn-r23406] Correct typo --- src/H5PL.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/H5PL.c b/src/H5PL.c index 5fb8147..54d3407 100644 --- a/src/H5PL.c +++ b/src/H5PL.c @@ -432,7 +432,7 @@ H5PL__find(H5PL_type_t plugin_type, int type_id, char *dir, void **info) FUNC_ENTER_STATIC /* Specify a file mask. *.* = We want everything! */ - sprintf(service, "%s*.*", dir); + sprintf(service, "%s\/*.*", dir); if((hFind = FindFirstFile(service, &fdFile)) == INVALID_HANDLE_VALUE) HGOTO_ERROR(H5E_PLUGIN, H5E_OPENERROR, FAIL, "can't open directory") -- cgit v0.12 From 8ffd55478e11904f193b4a98477b3bcb452b93ac Mon Sep 17 00:00:00 2001 From: Raymond Lu Date: Fri, 22 Mar 2013 16:39:53 -0500 Subject: [svn-r23432] I added a new macro HDF5_PLUGIN_PRELOAD to skip plugin loading during data reading. Tested on koala and jam. --- MANIFEST | 1 + src/H5PL.c | 98 +++++++++++++++++++++++++++---------------- src/H5PLprivate.h | 3 +- src/H5Z.c | 14 +++++-- src/H5Zpublic.h | 3 -- test/plugin.c | 7 ++++ test/testerror.sh.in | 9 +++- tools/h5dump/testh5dump.sh.in | 5 ++- 8 files changed, 94 insertions(+), 46 deletions(-) diff --git a/MANIFEST b/MANIFEST index 17de021..ca718f5 100644 --- a/MANIFEST +++ b/MANIFEST @@ -1097,6 +1097,7 @@ ./test/plugin_lib/dynlib1.c ./test/plugin_lib/Makefile.in +./test/plugin_lib/CMakeLists.txt ./test/testfiles/err_compat_1 ./test/testfiles/err_compat_2 diff --git a/src/H5PL.c b/src/H5PL.c index 54d3407..85ca97d 100644 --- a/src/H5PL.c +++ b/src/H5PL.c @@ -43,8 +43,10 @@ /****************************/ /* Windows support */ #ifdef H5_HAVE_WIN32_API + #define H5PL_DEFAULT_PATH ".;/ProgramData;/Users/Public" #define H5PL_PATH_SEPARATOR ";" + /* Handle for dynamic library */ #define H5PL_HANDLE HINSTANCE @@ -60,25 +62,14 @@ /* Clear error - nothing to do */ #define H5PL_CLR_ERROR -#define H5PL_GET_PLUGIN_TYPE(H, ret_val) { \ -typedef const int (__cdecl *get_plugin_type_t)(); \ -get_plugin_type_t get_plugin_type; \ -get_plugin_type = (get_plugin_type_t)H5PL_GET_LIB_FUNC(H, "H5PL_get_plugin_type"); \ -ret_val = get_plugin_type(); \ -} - -#define H5PL_GET_PLUGIN_INFO(H, ret_val) { \ -typedef const H5Z_class2_t *(__cdecl *get_filter_info_t)(); \ -get_filter_info_t get_filter_info; \ -get_filter_info = (get_filter_info_t)H5PL_GET_LIB_FUNC(H, "H5PL_get_plugin_info"); \ -ret_val = get_filter_info(); \ -} - typedef const H5Z_class2_t *(__cdecl *get_filter_info_t)(); +/* Unix support */ #else /* H5_HAVE_WIN32_API */ + #define H5PL_DEFAULT_PATH "/usr:/usr/lib:/usr/local" #define H5PL_PATH_SEPARATOR ":" + /* Handle for dynamic library */ #define H5PL_HANDLE void * @@ -94,23 +85,11 @@ typedef const H5Z_class2_t *(__cdecl *get_filter_info_t)(); /* Clear error */ #define H5PL_CLR_ERROR dlerror() -#define H5PL_GET_PLUGIN_TYPE(H, ret_val) { \ -typedef const int (*get_plugin_type_t)(); \ -get_plugin_type_t get_plugin_type; \ -get_plugin_type = (get_plugin_type_t)H5PL_GET_LIBRARY_FUNCTION(H, "H5PL_get_plugin_type"); \ -ret_val = (*get_plugin_type)(); \ -} - -#define H5PL_GET_PLUGIN_INFO(H, ret_val) { \ -typedef const H5Z_class2_t *(*get_filter_info_t)(); \ -get_filter_info_t get_filter_info; \ -*(void**)(&get_filter_info) = (get_filter_info_t)H5PL_GET_LIB_FUNC(H, "H5PL_get_plugin_info"); \ -ret_val = get_filter_info(); \ -} - typedef const H5Z_class2_t *(*get_filter_info_t)(); #endif /* H5_HAVE_WIN32_API */ +/* Special symbol to indicate no plugin loading */ +#define H5PL_NO_PLUGIN "::" /******************/ /* Local Typedefs */ @@ -159,6 +138,10 @@ static char *H5PL_path_table_g[H5PL_MAX_PATH_NUM]; static size_t H5PL_num_paths_g = 0; static htri_t H5PL_path_found_g = FALSE; +/* Table of preload pathnames for plugin libraries */ +static char *H5PL_preload_table_g[H5PL_MAX_PATH_NUM]; +static size_t H5PL_num_preload_g = 0; +static hbool_t H5PL_no_plugin_g = FALSE; /*-------------------------------------------------------------------------- @@ -175,13 +158,56 @@ DESCRIPTION static herr_t H5PL__init_interface(void) { - FUNC_ENTER_STATIC_NOERR + char *preload_path = NULL; + herr_t ret_value = SUCCEED; /* Return value */ - FUNC_LEAVE_NOAPI(SUCCEED) + FUNC_ENTER_STATIC + + /* Retrieve pathnames from HDF5_PLUGIN_PRELOAD if the user sets it + * to tell the library to load plugin libraries without search. + */ + if(!(preload_path = HDgetenv("HDF5_PLUGIN_PRELOAD"))) + HGOTO_DONE(ret_value) + + /* Special symbal "::" means no plugin during data reading. */ + if(!HDstrcmp(preload_path, H5PL_NO_PLUGIN)) { + H5PL_no_plugin_g = TRUE; + HGOTO_DONE(ret_value) + } + +done: + FUNC_LEAVE_NOAPI(ret_value) } /* end H5PL__init_interface() */ /*------------------------------------------------------------------------- + * Function: H5PL_no_plugin + * + * Purpose: Quick way for filter module to query whether to load plugin + * + * Return: TRUE: No plugin loading during data reading + * + * FALSE: Load plugin during data reading + * + * Programmer: Raymond Lu + * 20 February 2013 + * + *------------------------------------------------------------------------- + */ +hbool_t H5PL_no_plugin(void) +{ + hbool_t ret_value = FALSE; + + FUNC_ENTER_NOAPI(ret_value) + + ret_value = H5PL_no_plugin_g; + +done: + FUNC_LEAVE_NOAPI(ret_value) +} + + +/*------------------------------------------------------------------------- * Function: H5PL_term_interface * * Purpose: Terminate the H5PL interface: release all memory, reset all @@ -496,7 +522,7 @@ static htri_t H5PL__open(H5PL_type_t pl_type, char *libname, int pl_id, void **pl_info) { H5PL_HANDLE handle = NULL; - get_filter_info_t H5PL_get_plugin_info = NULL; + get_filter_info_t get_plugin_info = NULL; htri_t ret_value = FALSE; FUNC_ENTER_STATIC @@ -511,7 +537,7 @@ H5PL__open(H5PL_type_t pl_type, char *libname, int pl_id, void **pl_info) /* Return a handle for the function H5PL_get_plugin_info in the dynamic library. * The plugin library is suppose to define this function. */ - if(NULL == (H5PL_get_plugin_info = (get_filter_info_t)H5PL_GET_LIB_FUNC(handle, "H5PL_get_plugin_info"))) { + if(NULL == (get_plugin_info = (get_filter_info_t)H5PL_GET_LIB_FUNC(handle, "H5PL_get_plugin_info"))) { if(H5PL__close(handle) < 0) HGOTO_ERROR(H5E_PLUGIN, H5E_CLOSEERROR, FAIL, "can't close dynamic library") } /* end if */ @@ -521,7 +547,7 @@ H5PL__open(H5PL_type_t pl_type, char *libname, int pl_id, void **pl_info) /* Invoke H5PL_get_plugin_info to verify this is the right library we are looking for. * Move on if it isn't. */ - if(NULL == (plugin_info = (*H5PL_get_plugin_info)())) { + if(NULL == (plugin_info = (*get_plugin_info)())) { if(H5PL__close(handle) < 0) HGOTO_ERROR(H5E_PLUGIN, H5E_CLOSEERROR, FAIL, "can't close dynamic library") HGOTO_ERROR(H5E_PLUGIN, H5E_CANTGET, FAIL, "can't get plugin info") @@ -583,7 +609,7 @@ H5PL__search_table(H5PL_type_t plugin_type, int type_id, void **info) { size_t i; H5Z_class2_t *plugin_info; - get_filter_info_t H5PL_get_plugin_info = NULL; + get_filter_info_t get_plugin_info = NULL; htri_t ret_value = FALSE; FUNC_ENTER_STATIC @@ -592,10 +618,10 @@ H5PL__search_table(H5PL_type_t plugin_type, int type_id, void **info) if(H5PL_table_used_g > 0) { for(i = 0; i < H5PL_table_used_g; i++) { if((plugin_type == (H5PL_table_g[i]).pl_type) && (type_id == (H5PL_table_g[i]).pl_id)) { - if(NULL == (H5PL_get_plugin_info = (get_filter_info_t)H5PL_GET_LIB_FUNC((H5PL_table_g[i]).handle, "H5PL_get_plugin_info"))) + if(NULL == (get_plugin_info = (get_filter_info_t)H5PL_GET_LIB_FUNC((H5PL_table_g[i]).handle, "H5PL_get_plugin_info"))) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTGET, FAIL, "can't get function for H5PL_get_plugin_info") - if(NULL == (plugin_info = (*H5PL_get_plugin_info)())) + if(NULL == (plugin_info = (*get_plugin_info)())) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTGET, FAIL, "can't get plugin info") *info = (void *)plugin_info; diff --git a/src/H5PLprivate.h b/src/H5PLprivate.h index 25fbc51..127ba98 100644 --- a/src/H5PLprivate.h +++ b/src/H5PLprivate.h @@ -47,6 +47,7 @@ /***************************************/ /* Internal API routines */ -H5_DLL void *H5PL_load(H5PL_type_t plugin_type, int type_id); +H5_DLL void *H5PL_load(H5PL_type_t plugin_type, int type_id); +H5_DLL hbool_t H5PL_no_plugin(void); #endif /* _H5PLprivate_H */ diff --git a/src/H5Z.c b/src/H5Z.c index bfd0045..f838328 100644 --- a/src/H5Z.c +++ b/src/H5Z.c @@ -1115,8 +1115,9 @@ H5Z_pipeline(const H5O_pline_t *pline, unsigned flags, continue;/*filter excluded*/ } - /* If the filter isn't registered, try to load it dynamically and register it. Otherwise, return failure */ - if((fclass_idx = H5Z_find_idx(pline->filter[idx].id)) < 0) { + /* If the filter isn't registered and the application doesn't indicate no plugin through HDF5_PRELOAD_PLUG (using the symbol "::"), + * try to load it dynamically and register it. Otherwise, return failure */ + if((fclass_idx = H5Z_find_idx(pline->filter[idx].id)) < 0 && !H5PL_no_plugin()) { H5Z_class2_t *filter_info; if(NULL != (filter_info = (H5Z_class2_t *)H5PL_load(H5PL_TYPE_FILTER, (int)(pline->filter[idx].id)))) { @@ -1141,7 +1142,14 @@ H5Z_pipeline(const H5O_pline_t *pline, unsigned flags, else HGOTO_ERROR(H5E_PLINE, H5E_READERROR, FAIL, "required filter (name unavailable) is not registered") } /* end if */ - } /* end if */ + } else if((fclass_idx = H5Z_find_idx(pline->filter[idx].id)) < 0 && H5PL_no_plugin()) { + /* Print out the filter name to give more info. But the name is optional for + * the filter */ + if(pline->filter[idx].name) + HGOTO_ERROR(H5E_PLINE, H5E_READERROR, FAIL, "required filter '%s' is not registered", pline->filter[idx].name) + else + HGOTO_ERROR(H5E_PLINE, H5E_READERROR, FAIL, "required filter (name unavailable) is not registered") + } fclass=&H5Z_table_g[fclass_idx]; #ifdef H5Z_DEBUG diff --git a/src/H5Zpublic.h b/src/H5Zpublic.h index 24496e4..c7c3562 100644 --- a/src/H5Zpublic.h +++ b/src/H5Zpublic.h @@ -47,9 +47,6 @@ typedef int H5Z_filter_t; #define H5Z_FILTER_DYNLIB1 257 #define H5Z_FILTER_DYNLIB2 258 -/* Registered third-party filters */ -#define H5Z_FILTER_BZIP2 307 - #define H5Z_FILTER_MAX 65535 /*maximum filter id */ /* General macros */ diff --git a/test/plugin.c b/test/plugin.c index 3cadb3c..d5a30f9 100644 --- a/test/plugin.c +++ b/test/plugin.c @@ -31,6 +31,13 @@ #define H5Z_PACKAGE #include "H5Zpkg.h" +/* Filters for HDF5 internal test */ +#define H5Z_FILTER_DYNLIB1 257 +#define H5Z_FILTER_DYNLIB2 258 + +/* Bzip2 filter */ +#define H5Z_FILTER_BZIP2 307 + const char *FILENAME[] = { "plugin", NULL diff --git a/test/testerror.sh.in b/test/testerror.sh.in index b68fa7e..eb01fb1 100644 --- a/test/testerror.sh.in +++ b/test/testerror.sh.in @@ -23,6 +23,9 @@ DEPRECATED_SYMBOLS="@DEPRECATED_SYMBOLS@" CMP='cmp -s' DIFF='diff -c' +# Skip plugin module to test missing filter +ENVCMD="env HDF5_PLUGIN_PRELOAD=::" + nerrors=0 verbose=yes @@ -61,7 +64,9 @@ TEST() { echo "#############################" echo "Expected output for $TEST_ERR" echo "#############################" - $RUNSERIAL $TEST_ERR_BIN + + # Skip the plugin for testing missing filter. + $ENVCMD $RUNSERIAL $TEST_ERR_BIN ) >$actual 2>$actual_err # Extract file name, line number, version and thread IDs because they may be different sed -e 's/thread [0-9]*/thread (IDs)/' -e 's/: .*\.c /: (file name) /' \ @@ -109,7 +114,7 @@ else TEST err_compat fi -# test for error_test +# test for error_test. Skip the plugin for testing missing filter. TEST error_test if test $nerrors -eq 0 ; then diff --git a/tools/h5dump/testh5dump.sh.in b/tools/h5dump/testh5dump.sh.in index 238eee9..cdd292a 100644 --- a/tools/h5dump/testh5dump.sh.in +++ b/tools/h5dump/testh5dump.sh.in @@ -38,6 +38,9 @@ DIRNAME='dirname' LS='ls' AWK='awk' +# Skip plugin module to test missing filter +ENVCMD="env HDF5_PLUGIN_PRELOAD=::" + nerrors=0 verbose=yes @@ -675,7 +678,7 @@ TOOLTEST4() { TESTING $DUMPER $@ ( cd $TESTDIR - $RUNSERIAL $DUMPER_BIN "$@" + $ENVCMD $RUNSERIAL $DUMPER_BIN "$@" ) >$actual 2>$actual_err # save actual and actual_err in case they are needed later. -- cgit v0.12 From 01765e30799186806e50f59ff98b5e970a545264 Mon Sep 17 00:00:00 2001 From: Elena Pourmal Date: Sat, 23 Mar 2013 10:40:50 -0500 Subject: [svn-r23437] Removed duplicated line in the MANIFEST file (exposed by the daily tests) --- MANIFEST | 1 - 1 file changed, 1 deletion(-) diff --git a/MANIFEST b/MANIFEST index ca718f5..40112d4 100644 --- a/MANIFEST +++ b/MANIFEST @@ -2421,7 +2421,6 @@ ./perform/CMakeLists.txt ./src/CMakeLists.txt ./test/CMakeLists.txt -./test/plugin_lib/CMakeLists.txt ./testpar/CMakeLists.txt ./tools/CMakeLists.txt ./tools/h5copy/CMakeLists.txt -- cgit v0.12 From dabebe412fee2d1b0eed6ef0a8e59495d8539b68 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 25 Mar 2013 12:39:14 -0500 Subject: [svn-r23447] Add new env var to prevent filter plugin loading Tested: jam --- test/CMakeLists.txt | 1 + tools/h5dump/CMakeLists.txt | 1 + tools/h5dump/testh5dump.sh.in | 66 ++++++++++++++++++++++++++++++++++++++++++- 3 files changed, 67 insertions(+), 1 deletion(-) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index d104978..dfd6a8e 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -523,6 +523,7 @@ ADD_TEST (NAME error_test COMMAND "${CMAKE_COMMAND}" -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) SET_TESTS_PROPERTIES(error_test PROPERTIES DEPENDS h5test-clear-error_test-objects) +SET_TESTS_PROPERTIES (error_test PROPERTIES ENVIRONMENT "HDF5_PLUGIN_PRELOAD=::") #-- Adding test for links_env ADD_EXECUTABLE (links_env ${HDF5_TEST_SOURCE_DIR}/links_env.c) diff --git a/tools/h5dump/CMakeLists.txt b/tools/h5dump/CMakeLists.txt index 3f39ae3..bcabdee 100644 --- a/tools/h5dump/CMakeLists.txt +++ b/tools/h5dump/CMakeLists.txt @@ -1656,6 +1656,7 @@ IF (BUILD_TESTING) # test for error stack display (BZ2048) ADD_H5ERR_MASK_TEST (filter_fail 1 --enable-error-stack filter_fail.h5) + SET_TESTS_PROPERTIES (H5DUMP-filter_fail PROPERTIES ENVIRONMENT "HDF5_PLUGIN_PRELOAD=::") # test for -o -y for dataset with attributes ADD_H5_TEST_EXPORT (tall-6 tall.h5 0 --enable-error-stack -d /g1/g1.1/dset1.1.1 -y -o) diff --git a/tools/h5dump/testh5dump.sh.in b/tools/h5dump/testh5dump.sh.in index cdd292a..ceefc08 100644 --- a/tools/h5dump/testh5dump.sh.in +++ b/tools/h5dump/testh5dump.sh.in @@ -678,6 +678,70 @@ TOOLTEST4() { TESTING $DUMPER $@ ( cd $TESTDIR + $RUNSERIAL $DUMPER_BIN "$@" + ) >$actual 2>$actual_err + + # save actual and actual_err in case they are needed later. + cp $actual $actual_sav + STDOUT_FILTER $actual + cp $actual_err $actual_err_sav + STDERR_FILTER $actual_err + + # Extract file name, line number, version and thread IDs because they may be different + sed -e 's/thread [0-9]*/thread (IDs)/' -e 's/: .*\.c /: (file name) /' \ + -e 's/line [0-9]*/line (number)/' \ + -e 's/v[1-9]*\.[0-9]*\./version (number)\./' \ + -e 's/[1-9]*\.[0-9]*\.[0-9]*[^)]*/version (number)/' \ + -e 's/H5Eget_auto[1-2]*/H5Eget_auto(1 or 2)/' \ + -e 's/H5Eset_auto[1-2]*/H5Eset_auto(1 or 2)/' \ + $actual_err > $actual_ext + #cat $actual_ext >> $actual + + if [ ! -f $expect ]; then + # Create the expect file if it doesn't yet exist. + echo " CREATED" + cp $actual $expect + elif $CMP $expect $actual; then + if $CMP $expect_err $actual_ext; then + echo " PASSED" + else + echo "*FAILED*" + echo " Expected result (*.err) differs from actual result (*.oerr)" + nerrors="`expr $nerrors + 1`" + test yes = "$verbose" && $DIFF $expect_err $actual_ext |sed 's/^/ /' + fi + else + echo "*FAILED*" + echo " Expected result (*.ddl) differs from actual result (*.out)" + nerrors="`expr $nerrors + 1`" + test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' + fi + + # Clean up output file + if test -z "$HDF5_NOCLEANUP"; then + rm -f $actual $actual_err $actual_sav $actual_err_sav + fi + +} + +# same as TOOLTEST4 but disables plugin filter loading +# silences extra error output on some platforms +# ADD_H5ERR_MASK_TEST +TOOLTEST5() { + + expect="$TESTDIR/$1" + expect_err="$TESTDIR/`basename $1 .ddl`.err" + actual="$TESTDIR/`basename $1 .ddl`.out" + actual_err="$TESTDIR/`basename $1 .ddl`.oerr" + actual_ext="$TESTDIR/`basename $1 .ddl`.ext" + actual_sav=${actual}-sav + actual_err_sav=${actual_err}-sav + shift + + # Run test. + TESTING $DUMPER $@ + ( + cd $TESTDIR $ENVCMD $RUNSERIAL $DUMPER_BIN "$@" ) >$actual 2>$actual_err @@ -1131,7 +1195,7 @@ TOOLTEST4 textlinkfar.ddl --enable-error-stack textlinkfar.h5 TOOLTEST4 textlink.ddl --enable-error-stack textlink.h5 # test for error stack display (BZ2048) -TOOLTEST4 filter_fail.ddl --enable-error-stack filter_fail.h5 +TOOLTEST5 filter_fail.ddl --enable-error-stack filter_fail.h5 # test for -o -y for dataset with attributes TOOLTEST2 tall-6.exp --enable-error-stack -y -o tall-6.txt -d /g1/g1.1/dset1.1.1 tall.h5 -- cgit v0.12 From b1c594d52df0c744792729f514a207823f462b77 Mon Sep 17 00:00:00 2001 From: Raymond Lu Date: Mon, 25 Mar 2013 15:34:05 -0500 Subject: [svn-r23451] I took out RTLD_LAZY for dlopen. Tested on koala. --- src/H5PL.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/H5PL.c b/src/H5PL.c index 85ca97d..86c6615 100644 --- a/src/H5PL.c +++ b/src/H5PL.c @@ -74,7 +74,7 @@ typedef const H5Z_class2_t *(__cdecl *get_filter_info_t)(); #define H5PL_HANDLE void * /* Get a handle to a plugin library. Windows: TEXT macro handles Unicode strings */ -#define H5PL_OPEN_DLIB(S) dlopen(S, RTLD_NOW|RTLD_LAZY) +#define H5PL_OPEN_DLIB(S) dlopen(S, RTLD_NOW) /* Get the address of a symbol in dynamic library */ #define H5PL_GET_LIB_FUNC(H,N) dlsym(H,N) -- cgit v0.12 From cfbbd9462707db9f7fde6b8f8adf8936d05cffe4 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 25 Mar 2013 16:37:09 -0500 Subject: [svn-r23453] FIX plugin DLL decoration --- src/H5PLpublic.h | 40 ++++++++++++++++++++++++++++++++++------ 1 file changed, 34 insertions(+), 6 deletions(-) diff --git a/src/H5PLpublic.h b/src/H5PLpublic.h index 6b17197..6a8a612 100644 --- a/src/H5PLpublic.h +++ b/src/H5PLpublic.h @@ -36,12 +36,40 @@ typedef enum H5PL_type_t { } H5PL_type_t; -/* plugins always export */ -#if defined (_MSC_VER) /* MSVC Compiler Case */ - #define H5PLUGIN_DLL __declspec(dllexport) -#elif (__GNUC__ >= 4) /* GCC 4.x has support for visibility options */ - #define H5PLUGIN_DLL __attribute__ ((visibility("default"))) -#endif +#ifdef H5_BUILT_AS_DYNAMIC_LIB + + #if defined (hdf5_EXPORTS) + /* hdf5 library imports from plugin */ + #if defined (_MSC_VER) /* MSVC Compiler Case */ + #define H5PLUGIN_DLL __declspec(dllimport) + #elif (__GNUC__ >= 4) /* GCC 4.x has support for visibility options */ + #define H5PLUGIN_DLL __attribute__ ((visibility("default"))) + #endif + #else + /* plugins always export */ + #if defined (_MSC_VER) /* MSVC Compiler Case */ + #define H5PLUGIN_DLL __declspec(dllexport) + #elif (__GNUC__ >= 4) /* GCC 4.x has support for visibility options */ + #define H5PLUGIN_DLL __attribute__ ((visibility("default"))) + #endif + #endif + +#elif defined(H5_BUILT_AS_STATIC_LIB) + #define H5PLUGIN_DLL +#else + + #if defined(H5_HAVE_WIN32_API) + #if defined(_HDF5DLL_) + #pragma warning(disable: 4273) /* Disable the dll linkage warnings */ + #define H5PLUGIN_DLL __declspec(dllimport) + #elif defined(_HDF5USEDLL_) + #define H5PLUGIN_DLL __declspec(dllexport) + #endif /* _HDF5DLL_ */ + #else /*H5_HAVE_WIN32_API*/ + #define H5PLUGIN_DLL + #endif /*H5_HAVE_WIN32_API*/ + +#endif /* H5_BUILT_AS_xxx_LIB */ #ifdef __cplusplus extern "C" { -- cgit v0.12 From bda2e5da5af056752db021fbb861ea95d30c6afd Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 25 Mar 2013 16:38:42 -0500 Subject: [svn-r23454] Update script for reporting errors from configure, build, test. Tested: jam --- bin/cmakehdf5 | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/bin/cmakehdf5 b/bin/cmakehdf5 index c024ad1..2480497 100755 --- a/bin/cmakehdf5 +++ b/bin/cmakehdf5 @@ -70,6 +70,7 @@ set (CTEST_SOURCE_DIRECTORY "../hdf5") set (CTEST_BINARY_DIRECTORY ".") set (CTEST_CMAKE_GENERATOR "Unix Makefiles") set (CTEST_BUILD_CONFIGURATION "Release") +set (CTEST_MAX_N 8) # -- CDash variables set (LOCAL_NO_SUBMIT TRUE) # No CDash submit. @@ -87,6 +88,9 @@ set (ADD_BUILD_OPTIONS "-DCMAKE_INSTALL_PREFIX:PATH=/usr/local/hdf5.1.8 -DHDF5_A include(ProcessorCount) ProcessorCount(N) if(NOT N EQUAL 0) + if(N GREATER ${CTEST_MAX_N}) + set(N ${CTEST_MAX_N}) + endif(N GREATER ${CTEST_MAX_N}) set(CTEST_BUILD_FLAGS -j${N}) set(ctest_test_args ${ctest_test_args} PARALLEL_LEVEL ${N}) endif() @@ -188,22 +192,31 @@ CTEST_START (${MODEL} TRACK ${MODEL}) if (NOT LOCAL_SKIP_UPDATE) CTEST_UPDATE (SOURCE "${CTEST_SOURCE_DIRECTORY}") endif (NOT LOCAL_SKIP_UPDATE) -CTEST_CONFIGURE (BUILD "${CTEST_BINARY_DIRECTORY}") +CTEST_CONFIGURE (BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) +if(NOT res STREQUAL "0") + message (FATAL_ERROR "Configure FAILED") +endif() message ("Configure DONE") CTEST_READ_CUSTOM_FILES ("${CTEST_BINARY_DIRECTORY}") if (NOT LOCAL_NO_SUBMIT) CTEST_SUBMIT (PARTS Update Configure Notes) endif (NOT LOCAL_NO_SUBMIT) -CTEST_BUILD (BUILD "${CTEST_BINARY_DIRECTORY}" APPEND) +CTEST_BUILD (BUILD "${CTEST_BINARY_DIRECTORY}" APPEND RETURN_VALUE res) if (NOT LOCAL_NO_SUBMIT) CTEST_SUBMIT (PARTS Build) endif (NOT LOCAL_NO_SUBMIT) +if(NOT res STREQUAL "0") + message (FATAL_ERROR "Build FAILED") +endif() message ("build DONE") if (NOT LOCAL_SKIP_TEST) - CTEST_TEST (BUILD "${CTEST_BINARY_DIRECTORY}" APPEND) + CTEST_TEST (BUILD "${CTEST_BINARY_DIRECTORY}" APPEND ${ctest_test_args} RETURN_VALUE res) if (NOT LOCAL_NO_SUBMIT) CTEST_SUBMIT (PARTS Test) endif (NOT LOCAL_NO_SUBMIT) + if(NOT res STREQUAL "0") + message (FATAL_ERROR "Test FAILED") + endif() message ("test DONE") endif (NOT LOCAL_SKIP_TEST) -- cgit v0.12 From 5b12b8e1227d70dab65a90ab1478cbf88b9e0930 Mon Sep 17 00:00:00 2001 From: Raymond Lu Date: Wed, 27 Mar 2013 10:39:16 -0500 Subject: [svn-r23465] I moved dynlib1.c to test/ directory and revised the Makefile.am in test/. I added the condition to skip plugin.c test when the library is built for static. Tested on jam, koala, and emu. --- MANIFEST | 5 +-- Makefile.in | 11 ++---- configure | 28 +++++++++++--- configure.ac | 6 ++- src/Makefile.in | 11 ++++-- test/Makefile.am | 37 +++++++++++++----- test/Makefile.in | 100 ++++++++++++++++++++++++++++++++----------------- test/dynlib1.c | 93 +++++++++++++++++++++++++++++++++++++++++++++ test/test_plugin.sh.in | 10 +---- 9 files changed, 228 insertions(+), 73 deletions(-) create mode 100644 test/dynlib1.c diff --git a/MANIFEST b/MANIFEST index 40112d4..c0e8bdf 100644 --- a/MANIFEST +++ b/MANIFEST @@ -961,6 +961,7 @@ ./test/dt_arith.c ./test/dtypes.c ./test/dtransform.c +./test/dynlib1.c ./test/earray.c ./test/efc.c ./test/enc_dec_plist.c @@ -1095,10 +1096,6 @@ ./test/gen_filters.c ./test/chunk_info.c -./test/plugin_lib/dynlib1.c -./test/plugin_lib/Makefile.in -./test/plugin_lib/CMakeLists.txt - ./test/testfiles/err_compat_1 ./test/testfiles/err_compat_2 ./test/testfiles/error_test_1 diff --git a/Makefile.in b/Makefile.in index 2ecc508..a53e904 100644 --- a/Makefile.in +++ b/Makefile.in @@ -88,10 +88,9 @@ DIST_COMMON = $(am__configure_deps) $(srcdir)/Makefile.am \ $(top_srcdir)/bin/ltmain.sh $(top_srcdir)/bin/missing \ $(top_srcdir)/bin/mkinstalldirs \ $(top_srcdir)/config/commence.am $(top_srcdir)/configure \ - $(top_srcdir)/test/plugin_lib/Makefile.in COPYING bin/COPYING \ - bin/README bin/compile bin/config.guess bin/config.sub \ - bin/depcomp bin/install-sh bin/ltmain.sh bin/missing \ - bin/mkinstalldirs + COPYING bin/COPYING bin/README bin/compile bin/config.guess \ + bin/config.sub bin/depcomp bin/install-sh bin/ltmain.sh \ + bin/missing bin/mkinstalldirs subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac @@ -101,7 +100,7 @@ am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(SHELL) $(top_srcdir)/bin/mkinstalldirs CONFIG_HEADER = $(top_builddir)/src/H5config.h -CONFIG_CLEAN_FILES = test/plugin_lib/Makefile +CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) @@ -520,8 +519,6 @@ $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) $(am__aclocal_m4_deps): -test/plugin_lib/Makefile: $(top_builddir)/config.status $(top_srcdir)/test/plugin_lib/Makefile.in - cd $(top_builddir) && $(SHELL) ./config.status $@ mostlyclean-libtool: -rm -f *.lo diff --git a/configure b/configure index 55bb4b3..4afa0a9 100755 --- a/configure +++ b/configure @@ -689,6 +689,8 @@ USE_FILTER_SZIP USE_FILTER_DEFLATE AM_MAKEFLAGS LT_STATIC_EXEC +HAVE_SHARED_CONDITIONAL_FALSE +HAVE_SHARED_CONDITIONAL_TRUE CPP OTOOL64 OTOOL @@ -5242,9 +5244,10 @@ if test "X$HDF_FORTRAN" = "Xyes"; then ## -------------------------------------------------------------------- ## General Fortran flags - ## - AM_FCFLAGS="${AM_FCFLAGS} ${FFLAGS}" - FCFLAGS="${FCFLAGS} ${FFLAGS}" + ## Only add FFLAGS to FCFLAGS if it's set. + if test "x$FFLAGS" != "x" ; then + FCFLAGS="${FCFLAGS} ${FFLAGS}" + fi ## -------------------------------------------------------------------- ## Fortran source extention @@ -22019,6 +22022,18 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu ## ---------------------------------------------------------------------- +## Set a macro if shared library is enabled. +## + if test "X$enable_shared" = "Xyes"; then + HAVE_SHARED_CONDITIONAL_TRUE= + HAVE_SHARED_CONDITIONAL_FALSE='#' +else + HAVE_SHARED_CONDITIONAL_TRUE='#' + HAVE_SHARED_CONDITIONAL_FALSE= +fi + + +## ---------------------------------------------------------------------- ## Check if we should install only statically linked executables. ## This check needs to occur after libtool is initialized because ## we check a libtool cache value and may issue a warning based @@ -31223,7 +31238,7 @@ if test -n "$TESTPARALLEL"; then fi fi -ac_config_files="$ac_config_files src/libhdf5.settings Makefile src/Makefile test/Makefile test/testcheck_version.sh test/testerror.sh test/H5srcdir_str.h test/testlibinfo.sh test/testlinks_env.sh test/test_plugin.sh test/plugin_lib/Makefile testpar/Makefile testpar/testph5.sh perform/Makefile tools/Makefile tools/h5dump/Makefile tools/h5dump/testh5dump.sh tools/h5dump/testh5dumppbits.sh tools/h5dump/testh5dumpxml.sh tools/h5ls/testh5ls.sh tools/h5import/Makefile tools/h5import/h5importtestutil.sh tools/h5diff/Makefile tools/h5diff/testh5diff.sh tools/h5diff/testph5diff.sh tools/h5jam/Makefile tools/h5jam/testh5jam.sh tools/h5repack/Makefile tools/h5repack/h5repack.sh tools/h5ls/Makefile tools/h5copy/Makefile tools/h5copy/testh5copy.sh tools/lib/Makefile tools/misc/Makefile tools/misc/h5cc tools/misc/testh5mkgrp.sh tools/misc/testh5repart.sh tools/h5stat/testh5stat.sh tools/h5stat/Makefile examples/Makefile examples/run-c-ex.sh examples/testh5cc.sh c++/Makefile c++/src/Makefile c++/src/h5c++ c++/test/Makefile c++/test/H5srcdir_str.h c++/examples/Makefile c++/examples/run-c++-ex.sh c++/examples/testh5c++.sh fortran/Makefile fortran/src/h5fc fortran/src/Makefile fortran/test/Makefile fortran/testpar/Makefile fortran/examples/Makefile fortran/examples/run-fortran-ex.sh fortran/examples/testh5fc.sh hl/Makefile hl/src/Makefile hl/test/Makefile hl/test/H5srcdir_str.h hl/tools/Makefile hl/tools/gif2h5/Makefile hl/tools/gif2h5/h52giftest.sh hl/examples/Makefile hl/examples/run-hlc-ex.sh hl/c++/Makefile hl/c++/src/Makefile hl/c++/test/Makefile hl/c++/examples/Makefile hl/c++/examples/run-hlc++-ex.sh hl/fortran/Makefile hl/fortran/src/Makefile hl/fortran/test/Makefile hl/fortran/examples/Makefile hl/fortran/examples/run-hlfortran-ex.sh" +ac_config_files="$ac_config_files src/libhdf5.settings Makefile src/Makefile test/Makefile test/testcheck_version.sh test/testerror.sh test/H5srcdir_str.h test/testlibinfo.sh test/testlinks_env.sh test/test_plugin.sh testpar/Makefile testpar/testph5.sh perform/Makefile tools/Makefile tools/h5dump/Makefile tools/h5dump/testh5dump.sh tools/h5dump/testh5dumppbits.sh tools/h5dump/testh5dumpxml.sh tools/h5ls/testh5ls.sh tools/h5import/Makefile tools/h5import/h5importtestutil.sh tools/h5diff/Makefile tools/h5diff/testh5diff.sh tools/h5diff/testph5diff.sh tools/h5jam/Makefile tools/h5jam/testh5jam.sh tools/h5repack/Makefile tools/h5repack/h5repack.sh tools/h5ls/Makefile tools/h5copy/Makefile tools/h5copy/testh5copy.sh tools/lib/Makefile tools/misc/Makefile tools/misc/h5cc tools/misc/testh5mkgrp.sh tools/misc/testh5repart.sh tools/h5stat/testh5stat.sh tools/h5stat/Makefile examples/Makefile examples/run-c-ex.sh examples/testh5cc.sh c++/Makefile c++/src/Makefile c++/src/h5c++ c++/test/Makefile c++/test/H5srcdir_str.h c++/examples/Makefile c++/examples/run-c++-ex.sh c++/examples/testh5c++.sh fortran/Makefile fortran/src/h5fc fortran/src/Makefile fortran/test/Makefile fortran/testpar/Makefile fortran/examples/Makefile fortran/examples/run-fortran-ex.sh fortran/examples/testh5fc.sh hl/Makefile hl/src/Makefile hl/test/Makefile hl/test/H5srcdir_str.h hl/tools/Makefile hl/tools/gif2h5/Makefile hl/tools/gif2h5/h52giftest.sh hl/examples/Makefile hl/examples/run-hlc-ex.sh hl/c++/Makefile hl/c++/src/Makefile hl/c++/test/Makefile hl/c++/examples/Makefile hl/c++/examples/run-hlc++-ex.sh hl/fortran/Makefile hl/fortran/src/Makefile hl/fortran/test/Makefile hl/fortran/examples/Makefile hl/fortran/examples/run-hlfortran-ex.sh" cat >confcache <<\_ACEOF @@ -31387,6 +31402,10 @@ if test -z "${CXX_SHARED_CONDITIONAL_TRUE}" && test -z "${CXX_SHARED_CONDITIONAL as_fn_error $? "conditional \"CXX_SHARED_CONDITIONAL\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi +if test -z "${HAVE_SHARED_CONDITIONAL_TRUE}" && test -z "${HAVE_SHARED_CONDITIONAL_FALSE}"; then + as_fn_error $? "conditional \"HAVE_SHARED_CONDITIONAL\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi if test -z "${BUILD_SHARED_SZIP_CONDITIONAL_TRUE}" && test -z "${BUILD_SHARED_SZIP_CONDITIONAL_FALSE}"; then as_fn_error $? "conditional \"BUILD_SHARED_SZIP_CONDITIONAL\" was never defined. @@ -32485,7 +32504,6 @@ do "test/testlibinfo.sh") CONFIG_FILES="$CONFIG_FILES test/testlibinfo.sh" ;; "test/testlinks_env.sh") CONFIG_FILES="$CONFIG_FILES test/testlinks_env.sh" ;; "test/test_plugin.sh") CONFIG_FILES="$CONFIG_FILES test/test_plugin.sh" ;; - "test/plugin_lib/Makefile") CONFIG_FILES="$CONFIG_FILES test/plugin_lib/Makefile" ;; "testpar/Makefile") CONFIG_FILES="$CONFIG_FILES testpar/Makefile" ;; "testpar/testph5.sh") CONFIG_FILES="$CONFIG_FILES testpar/testph5.sh" ;; "perform/Makefile") CONFIG_FILES="$CONFIG_FILES perform/Makefile" ;; diff --git a/configure.ac b/configure.ac index cfe6cec..4f9f7a5 100644 --- a/configure.ac +++ b/configure.ac @@ -1037,6 +1037,11 @@ LT_PREREQ([2.2]) LT_INIT([dlopen]) ## ---------------------------------------------------------------------- +## Set a macro if shared library is enabled. +## +AM_CONDITIONAL([HAVE_SHARED_CONDITIONAL], [test "X$enable_shared" = "Xyes"]) + +## ---------------------------------------------------------------------- ## Check if we should install only statically linked executables. ## This check needs to occur after libtool is initialized because ## we check a libtool cache value and may issue a warning based @@ -4446,7 +4451,6 @@ AC_CONFIG_FILES([src/libhdf5.settings test/testlibinfo.sh test/testlinks_env.sh test/test_plugin.sh - test/plugin_lib/Makefile testpar/Makefile testpar/testph5.sh perform/Makefile diff --git a/src/Makefile.in b/src/Makefile.in index f280987..5f3b2c4 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -158,9 +158,9 @@ am_libhdf5_la_OBJECTS = H5.lo H5checksum.lo H5dbg.lo H5system.lo \ H5Orefcount.lo H5Osdspace.lo H5Oshared.lo H5Ostab.lo \ H5Oshmesg.lo H5Otest.lo H5Ounknown.lo H5P.lo H5Pacpl.lo \ H5Pdapl.lo H5Pdcpl.lo H5Pdeprec.lo H5Pdxpl.lo H5Pencdec.lo \ - H5Pfapl.lo H5Pfcpl.lo H5Pfmpl.lo H5Pgcpl.lo H5Pint.lo H5PL.lo \ + H5Pfapl.lo H5Pfcpl.lo H5Pfmpl.lo H5Pgcpl.lo H5Pint.lo \ H5Plapl.lo H5Plcpl.lo H5Pocpl.lo H5Pocpypl.lo H5Pstrcpl.lo \ - H5Ptest.lo H5R.lo H5Rdeprec.lo H5RC.lo H5RS.lo H5S.lo \ + H5Ptest.lo H5PL.lo H5R.lo H5Rdeprec.lo H5RC.lo H5RS.lo H5S.lo \ H5Sall.lo H5Sdbg.lo H5Shyper.lo H5Smpio.lo H5Snone.lo \ H5Spoint.lo H5Sselect.lo H5Stest.lo H5SL.lo H5SM.lo \ H5SMbtree2.lo H5SMcache.lo H5SMmessage.lo H5SMtest.lo H5ST.lo \ @@ -585,8 +585,9 @@ libhdf5_la_SOURCES = H5.c H5checksum.c H5dbg.c H5system.c H5timer.c H5trace.c \ H5P.c H5Pacpl.c H5Pdapl.c H5Pdcpl.c \ H5Pdeprec.c H5Pdxpl.c H5Pencdec.c \ H5Pfapl.c H5Pfcpl.c H5Pfmpl.c \ - H5Pgcpl.c H5Pint.c H5PL.c \ + H5Pgcpl.c H5Pint.c \ H5Plapl.c H5Plcpl.c H5Pocpl.c H5Pocpypl.c H5Pstrcpl.c H5Ptest.c \ + H5PL.c \ H5R.c H5Rdeprec.c \ H5RC.c \ H5RS.c \ @@ -614,7 +615,9 @@ include_HEADERS = hdf5.h H5api_adpt.h H5overflow.h H5pubconf.h H5public.h H5vers H5FDfamily.h H5FDlog.h H5FDmpi.h H5FDmpio.h H5FDmpiposix.h \ H5FDmulti.h H5FDsec2.h H5FDstdio.h \ H5Gpublic.h H5Ipublic.h H5Lpublic.h \ - H5MMpublic.h H5Opublic.h H5PLpublic.h H5Ppublic.h H5Rpublic.h H5Spublic.h \ + H5MMpublic.h H5Opublic.h H5Ppublic.h \ + H5PLpublic.h \ + H5Rpublic.h H5Spublic.h \ H5Tpublic.h H5Zpublic.h diff --git a/test/Makefile.am b/test/Makefile.am index 37975f2..df6a9e5 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -24,10 +24,15 @@ include $(top_srcdir)/config/commence.am INCLUDES=-I$(top_srcdir)/src -I$(top_builddir)/src # Test script for error_test and err_compat -TEST_SCRIPT = testerror.sh testlibinfo.sh testcheck_version.sh testlinks_env.sh test_plugin.sh -check_SCRIPTS = $(TEST_SCRIPT) -SCRIPT_DEPEND = error_test$(EXEEXT) err_compat$(EXEEXT) links_env$(EXEEXT) plugin$(EXEEXT) +if HAVE_SHARED_CONDITIONAL + TEST_SCRIPT = testerror.sh testlibinfo.sh testcheck_version.sh testlinks_env.sh test_plugin.sh + SCRIPT_DEPEND = error_test$(EXEEXT) err_compat$(EXEEXT) links_env$(EXEEXT) plugin$(EXEEXT) +else + TEST_SCRIPT = testerror.sh testlibinfo.sh testcheck_version.sh testlinks_env.sh + SCRIPT_DEPEND = error_test$(EXEEXT) err_compat$(EXEEXT) links_env$(EXEEXT) +endif +check_SCRIPTS = $(TEST_SCRIPT) # These are our main targets. They should be listed in the order to be # executed, generally most specific tests to least specific tests. @@ -50,8 +55,11 @@ TEST_PROG= testhdf5 lheap ohdr stab gheap cache cache_api cache_tagging \ # 'make check' doesn't run them directly, so they are not included in TEST_PROG. # Also build testmeta, which is used for timings test. It builds quickly, # and this lets automake keep all its test programs in one place. -check_PROGRAMS=$(TEST_PROG) error_test err_compat tcheck_version testmeta links_env plugin - +if HAVE_SHARED_CONDITIONAL + check_PROGRAMS=$(TEST_PROG) error_test err_compat tcheck_version testmeta links_env plugin +else + check_PROGRAMS=$(TEST_PROG) error_test err_compat tcheck_version testmeta links_env +endif # These programs generate test files for the tests. They don't need to be # compiled every time we want to test the library. However, putting @@ -69,8 +77,19 @@ if BUILD_ALL_CONDITIONAL noinst_PROGRAMS=$(BUILD_ALL_PROGS) endif -# The libh5test library provides common support code for the tests. -noinst_LTLIBRARIES=libh5test.la +if HAVE_SHARED_CONDITIONAL + # The libh5test library provides common support code for the tests. + noinst_LTLIBRARIES=libh5test.la libdynlib1.la + + # The libdynlib1 library for testing plugin module plugin.c. + # Build it as shared library if configure is enabled for shared library. + libdynlib1_la_SOURCES=dynlib1.c + libdynlib1_la_LDFLAGS=-rpath /tmp +else + # The libh5test library provides common support code for the tests. + noinst_LTLIBRARIES=libh5test.la +endif + libh5test_la_SOURCES=h5test.c testframe.c cache_common.c # Use libhd5test.la to compile all of the tests @@ -120,7 +139,7 @@ CHECK_CLEANFILES+=accum.h5 cmpd_dset.h5 compact_dataset.h5 dataset.h5 dset_offse tmisc[0-9]*.h5 set_extent[1-5].h5 ext[12].bin \ getname.h5 getname[1-3].h5 sec2_file.h5 direct_file.h5 \ family_file000[0-3][0-9].h5 new_family_v16_000[0-3][0-9].h5 \ - multi_file-[rs].h5 core_file \ + multi_file-[rs].h5 core_file plugin.h5 \ new_move_[ab].h5 ntypes.h5 dangle.h5 error_test.h5 err_compat.h5 \ dtransform.h5 test_filters.h5 get_file_name.h5 tstint[1-2].h5 \ unlink_chunked.h5 btree2.h5 objcopy_src.h5 objcopy_dst.h5 \ @@ -128,7 +147,7 @@ CHECK_CLEANFILES+=accum.h5 cmpd_dset.h5 compact_dataset.h5 dataset.h5 dset_offse earray.h5 efc[0-5].h5 log_vfd_out.log \ new_multi_file_v16-r.h5 new_multi_file_v16-s.h5 \ split_get_file_image_test-m.h5 split_get_file_image_test-r.h5 \ - file_image_core_test.h5.copy plugin.h5 + file_image_core_test.h5.copy # Sources for testhdf5 executable testhdf5_SOURCES=testhdf5.c tarray.c tattr.c tchecksum.c tconfig.c tfile.c \ diff --git a/test/Makefile.in b/test/Makefile.in index 81681ef..2864a56 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -75,9 +75,19 @@ DIST_COMMON = $(srcdir)/H5srcdir_str.h.in $(srcdir)/Makefile.am \ $(top_srcdir)/bin/depcomp $(top_srcdir)/bin/mkinstalldirs \ $(top_srcdir)/config/commence.am \ $(top_srcdir)/config/conclude.am COPYING -check_PROGRAMS = $(am__EXEEXT_1) error_test$(EXEEXT) \ - err_compat$(EXEEXT) tcheck_version$(EXEEXT) testmeta$(EXEEXT) \ - links_env$(EXEEXT) plugin$(EXEEXT) +@HAVE_SHARED_CONDITIONAL_FALSE@check_PROGRAMS = $(am__EXEEXT_1) \ +@HAVE_SHARED_CONDITIONAL_FALSE@ error_test$(EXEEXT) \ +@HAVE_SHARED_CONDITIONAL_FALSE@ err_compat$(EXEEXT) \ +@HAVE_SHARED_CONDITIONAL_FALSE@ tcheck_version$(EXEEXT) \ +@HAVE_SHARED_CONDITIONAL_FALSE@ testmeta$(EXEEXT) \ +@HAVE_SHARED_CONDITIONAL_FALSE@ links_env$(EXEEXT) +@HAVE_SHARED_CONDITIONAL_TRUE@check_PROGRAMS = $(am__EXEEXT_1) \ +@HAVE_SHARED_CONDITIONAL_TRUE@ error_test$(EXEEXT) \ +@HAVE_SHARED_CONDITIONAL_TRUE@ err_compat$(EXEEXT) \ +@HAVE_SHARED_CONDITIONAL_TRUE@ tcheck_version$(EXEEXT) \ +@HAVE_SHARED_CONDITIONAL_TRUE@ testmeta$(EXEEXT) \ +@HAVE_SHARED_CONDITIONAL_TRUE@ links_env$(EXEEXT) \ +@HAVE_SHARED_CONDITIONAL_TRUE@ plugin$(EXEEXT) @BUILD_ALL_CONDITIONAL_TRUE@noinst_PROGRAMS = $(am__EXEEXT_2) TESTS = $(am__EXEEXT_1) $(TEST_SCRIPT) subdir = test @@ -91,13 +101,23 @@ CONFIG_CLEAN_FILES = testcheck_version.sh testerror.sh H5srcdir_str.h \ testlibinfo.sh testlinks_env.sh test_plugin.sh CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) -libh5test_la_LIBADD = -am_libh5test_la_OBJECTS = h5test.lo testframe.lo cache_common.lo -libh5test_la_OBJECTS = $(am_libh5test_la_OBJECTS) +libdynlib1_la_LIBADD = +am__libdynlib1_la_SOURCES_DIST = dynlib1.c +@HAVE_SHARED_CONDITIONAL_TRUE@am_libdynlib1_la_OBJECTS = dynlib1.lo +libdynlib1_la_OBJECTS = $(am_libdynlib1_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = +libdynlib1_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(libdynlib1_la_LDFLAGS) $(LDFLAGS) -o $@ +@HAVE_SHARED_CONDITIONAL_TRUE@am_libdynlib1_la_rpath = +libh5test_la_LIBADD = +am_libh5test_la_OBJECTS = h5test.lo testframe.lo cache_common.lo +libh5test_la_OBJECTS = $(am_libh5test_la_OBJECTS) +@HAVE_SHARED_CONDITIONAL_FALSE@am_libh5test_la_rpath = +@HAVE_SHARED_CONDITIONAL_TRUE@am_libh5test_la_rpath = am__EXEEXT_1 = testhdf5$(EXEEXT) lheap$(EXEEXT) ohdr$(EXEEXT) \ stab$(EXEEXT) gheap$(EXEEXT) cache$(EXEEXT) cache_api$(EXEEXT) \ cache_tagging$(EXEEXT) pool$(EXEEXT) accum$(EXEEXT) \ @@ -469,7 +489,25 @@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = -SOURCES = $(libh5test_la_SOURCES) accum.c app_ref.c big.c bittests.c \ +SOURCES = $(libdynlib1_la_SOURCES) $(libh5test_la_SOURCES) accum.c \ + app_ref.c big.c bittests.c btree2.c cache.c cache_api.c \ + cache_tagging.c cmpd_dset.c cross_read.c dangle.c dsets.c \ + dt_arith.c dtransform.c dtypes.c earray.c efc.c \ + enc_dec_plist.c enc_dec_plist_with_endianess.c enum.c \ + err_compat.c error_test.c extend.c external.c farray.c fheap.c \ + file_image.c fillval.c filter_fail.c flush1.c flush2.c \ + freespace.c gen_bad_ohdr.c gen_bogus.c gen_cross.c \ + gen_deflate.c gen_file_image.c gen_filespace.c gen_filters.c \ + gen_new_array.c gen_new_fill.c gen_new_group.c gen_new_mtime.c \ + gen_new_super.c gen_noencoder.c gen_nullspace.c gen_plist.c \ + gen_sizes_lheap.c gen_specmetaread.c gen_udlinks.c getname.c \ + gheap.c hyperslab.c istore.c lheap.c links.c links_env.c mf.c \ + mount.c mtime.c ntypes.c objcopy.c ohdr.c plugin.c pool.c \ + reserved.c set_extent.c space_overflow.c stab.c \ + tcheck_version.c $(testhdf5_SOURCES) testmeta.c \ + $(ttsafe_SOURCES) unlink.c vfd.c +DIST_SOURCES = $(am__libdynlib1_la_SOURCES_DIST) \ + $(libh5test_la_SOURCES) accum.c app_ref.c big.c bittests.c \ btree2.c cache.c cache_api.c cache_tagging.c cmpd_dset.c \ cross_read.c dangle.c dsets.c dt_arith.c dtransform.c dtypes.c \ earray.c efc.c enc_dec_plist.c enc_dec_plist_with_endianess.c \ @@ -485,23 +523,6 @@ SOURCES = $(libh5test_la_SOURCES) accum.c app_ref.c big.c bittests.c \ reserved.c set_extent.c space_overflow.c stab.c \ tcheck_version.c $(testhdf5_SOURCES) testmeta.c \ $(ttsafe_SOURCES) unlink.c vfd.c -DIST_SOURCES = $(libh5test_la_SOURCES) accum.c app_ref.c big.c \ - bittests.c btree2.c cache.c cache_api.c cache_tagging.c \ - cmpd_dset.c cross_read.c dangle.c dsets.c dt_arith.c \ - dtransform.c dtypes.c earray.c efc.c enc_dec_plist.c \ - enc_dec_plist_with_endianess.c enum.c err_compat.c \ - error_test.c extend.c external.c farray.c fheap.c file_image.c \ - fillval.c filter_fail.c flush1.c flush2.c freespace.c \ - gen_bad_ohdr.c gen_bogus.c gen_cross.c gen_deflate.c \ - gen_file_image.c gen_filespace.c gen_filters.c gen_new_array.c \ - gen_new_fill.c gen_new_group.c gen_new_mtime.c gen_new_super.c \ - gen_noencoder.c gen_nullspace.c gen_plist.c gen_sizes_lheap.c \ - gen_specmetaread.c gen_udlinks.c getname.c gheap.c hyperslab.c \ - istore.c lheap.c links.c links_env.c mf.c mount.c mtime.c \ - ntypes.c objcopy.c ohdr.c plugin.c pool.c reserved.c \ - set_extent.c space_overflow.c stab.c tcheck_version.c \ - $(testhdf5_SOURCES) testmeta.c $(ttsafe_SOURCES) unlink.c \ - vfd.c am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ @@ -815,21 +836,22 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog accum.h5 cmpd_dset.h5 \ tmisc[0-9]*.h5 set_extent[1-5].h5 ext[12].bin getname.h5 \ getname[1-3].h5 sec2_file.h5 direct_file.h5 \ family_file000[0-3][0-9].h5 new_family_v16_000[0-3][0-9].h5 \ - multi_file-[rs].h5 core_file new_move_[ab].h5 ntypes.h5 \ - dangle.h5 error_test.h5 err_compat.h5 dtransform.h5 \ + multi_file-[rs].h5 core_file plugin.h5 new_move_[ab].h5 \ + ntypes.h5 dangle.h5 error_test.h5 err_compat.h5 dtransform.h5 \ test_filters.h5 get_file_name.h5 tstint[1-2].h5 \ unlink_chunked.h5 btree2.h5 objcopy_src.h5 objcopy_dst.h5 \ objcopy_ext.dat trefer1.h5 trefer2.h5 app_ref.h5 farray.h5 \ earray.h5 efc[0-5].h5 log_vfd_out.log new_multi_file_v16-r.h5 \ new_multi_file_v16-s.h5 split_get_file_image_test-m.h5 \ - split_get_file_image_test-r.h5 file_image_core_test.h5.copy \ - plugin.h5 + split_get_file_image_test-r.h5 file_image_core_test.h5.copy INCLUDES = -I$(top_srcdir)/src -I$(top_builddir)/src +@HAVE_SHARED_CONDITIONAL_FALSE@TEST_SCRIPT = testerror.sh testlibinfo.sh testcheck_version.sh testlinks_env.sh # Test script for error_test and err_compat -TEST_SCRIPT = testerror.sh testlibinfo.sh testcheck_version.sh testlinks_env.sh test_plugin.sh +@HAVE_SHARED_CONDITIONAL_TRUE@TEST_SCRIPT = testerror.sh testlibinfo.sh testcheck_version.sh testlinks_env.sh test_plugin.sh +@HAVE_SHARED_CONDITIONAL_FALSE@SCRIPT_DEPEND = error_test$(EXEEXT) err_compat$(EXEEXT) links_env$(EXEEXT) +@HAVE_SHARED_CONDITIONAL_TRUE@SCRIPT_DEPEND = error_test$(EXEEXT) err_compat$(EXEEXT) links_env$(EXEEXT) plugin$(EXEEXT) check_SCRIPTS = $(TEST_SCRIPT) -SCRIPT_DEPEND = error_test$(EXEEXT) err_compat$(EXEEXT) links_env$(EXEEXT) plugin$(EXEEXT) # These are our main targets. They should be listed in the order to be # executed, generally most specific tests to least specific tests. @@ -859,9 +881,10 @@ BUILD_ALL_PROGS = gen_bad_ohdr gen_bogus gen_cross gen_deflate gen_filters gen_n gen_nullspace gen_udlinks space_overflow gen_filespace gen_specmetaread \ gen_sizes_lheap gen_file_image gen_plist - -# The libh5test library provides common support code for the tests. -noinst_LTLIBRARIES = libh5test.la +@HAVE_SHARED_CONDITIONAL_FALSE@noinst_LTLIBRARIES = libh5test.la +@HAVE_SHARED_CONDITIONAL_TRUE@noinst_LTLIBRARIES = libh5test.la libdynlib1.la +@HAVE_SHARED_CONDITIONAL_TRUE@libdynlib1_la_SOURCES = dynlib1.c +@HAVE_SHARED_CONDITIONAL_TRUE@libdynlib1_la_LDFLAGS = -rpath /tmp libh5test_la_SOURCES = h5test.c testframe.c cache_common.c # Use libhd5test.la to compile all of the tests @@ -961,8 +984,10 @@ clean-noinstLTLIBRARIES: echo rm -f $${locs}; \ rm -f $${locs}; \ } +libdynlib1.la: $(libdynlib1_la_OBJECTS) $(libdynlib1_la_DEPENDENCIES) $(EXTRA_libdynlib1_la_DEPENDENCIES) + $(AM_V_CCLD)$(libdynlib1_la_LINK) $(am_libdynlib1_la_rpath) $(libdynlib1_la_OBJECTS) $(libdynlib1_la_LIBADD) $(LIBS) libh5test.la: $(libh5test_la_OBJECTS) $(libh5test_la_DEPENDENCIES) $(EXTRA_libh5test_la_DEPENDENCIES) - $(AM_V_CCLD)$(LINK) $(libh5test_la_OBJECTS) $(libh5test_la_LIBADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(am_libh5test_la_rpath) $(libh5test_la_OBJECTS) $(libh5test_la_LIBADD) $(LIBS) clean-checkPROGRAMS: @list='$(check_PROGRAMS)'; test -n "$$list" || exit 0; \ @@ -1229,6 +1254,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dt_arith.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dtransform.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dtypes.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dynlib1.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/earray.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/efc.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/enc_dec_plist.Po@am__quote@ @@ -1580,6 +1606,12 @@ uninstall-am: help: @$(top_srcdir)/bin/makehelp +@HAVE_SHARED_CONDITIONAL_TRUE@ # The libh5test library provides common support code for the tests. + +@HAVE_SHARED_CONDITIONAL_TRUE@ # The libdynlib1 library for testing plugin module plugin.c. +@HAVE_SHARED_CONDITIONAL_TRUE@ # Build it as shared library if configure is enabled for shared library. +@HAVE_SHARED_CONDITIONAL_FALSE@ # The libh5test library provides common support code for the tests. + # Additional target for running timing test timings _timings: testmeta @for timing in $(TIMINGS) dummy; do \ diff --git a/test/dynlib1.c b/test/dynlib1.c new file mode 100644 index 0000000..b879ca2 --- /dev/null +++ b/test/dynlib1.c @@ -0,0 +1,93 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by The HDF Group. * + * Copyright by the Board of Trustees of the University of Illinois. * + * 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 files COPYING and Copyright.html. COPYING can be found at the root * + * of the source code distribution tree; Copyright.html can be found at the * + * root level of an installed copy of the electronic HDF5 document set and * + * is linked from the top-level documents page. It can also be found at * + * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * + * access to either file, you may request a copy from help@hdfgroup.org. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* + * Programmer: Raymond Lu + * 13 February 2013 + * + * Purpose: Tests the plugin module (H5PL) + */ + +#include +#include +#include + +static size_t H5Z_filter_dynlib1(unsigned int flags, size_t cd_nelmts, + const unsigned int *cd_values, size_t nbytes, size_t *buf_size, void **buf); + +/* This message derives from H5Z */ +const H5Z_class2_t H5Z_DYNLIB1[1] = {{ + H5Z_CLASS_T_VERS, /* H5Z_class_t version */ + H5Z_FILTER_DYNLIB1, /* Filter id number */ + 1, 1, /* Encoding and decoding enabled */ + "dynlib1", /* Filter name for debugging */ + NULL, /* The "can apply" callback */ + NULL, /* The "set local" callback */ + (H5Z_func_t)H5Z_filter_dynlib1, /* The actual filter function */ +}}; + +const H5PL_type_t H5PL_get_plugin_type(void) {return H5PL_TYPE_FILTER;} +const H5Z_class2_t* H5PL_get_plugin_info(void) {return H5Z_DYNLIB1;} + +/*------------------------------------------------------------------------- + * Function: H5Z_filter_dynlib1 + * + * Purpose: A dynlib1 compression method that doesn't do anything. + * + * Return: Success: Data chunk size + * + * Failure: 0 + * + * Programmer: Robb Matzke + * Tuesday, April 21, 1998 + * + *------------------------------------------------------------------------- + */ +static size_t +H5Z_filter_dynlib1(unsigned int flags, size_t cd_nelmts, + const unsigned int *cd_values, size_t nbytes, + size_t *buf_size, void **buf) +{ + int *int_ptr=(int *)*buf; /* Pointer to the data values */ + size_t buf_left=*buf_size; /* Amount of data buffer left to process */ + int add_on = 0; + + /* Check for the correct number of parameters */ + if(cd_nelmts==0) + return(0); + + /* Check that permanent parameters are set correctly */ + if(cd_values[0]<0 || cd_values[0]>9) + return(0); + + add_on = cd_values[0]; + + if(flags & H5Z_FLAG_REVERSE) { /*read*/ + /* Substract the "add on" value to all the data values */ + while(buf_left>0) { + *int_ptr++ -= add_on; + buf_left -= sizeof(int); + } /* end while */ + } /* end if */ + else { /*write*/ + /* Add the "add on" value to all the data values */ + while(buf_left>0) { + *int_ptr++ += add_on; + buf_left -= sizeof(int); + } /* end while */ + } /* end else */ + + return nbytes; +} diff --git a/test/test_plugin.sh.in b/test/test_plugin.sh.in index c00df8c..f2f3a1a 100644 --- a/test/test_plugin.sh.in +++ b/test/test_plugin.sh.in @@ -30,20 +30,12 @@ DEPRECATED_SYMBOLS="@DEPRECATED_SYMBOLS@" nerrors=0 verbose=yes -#test -d ./plugin_lib -MAKE_CMD=make -CD=cd TEST_NAME=plugin TEST_BIN=`pwd`/$TEST_NAME -ENVCMD="env HDF5_PLUGIN_PATH=`pwd`/plugin_lib" +ENVCMD="env HDF5_PLUGIN_PATH=`pwd`/.libs" # Run the test -$CD ./plugin_lib -echo "$MAKE_CMD" -$MAKE_CMD -$CD ../ $ENVCMD $TEST_BIN -echo "$HDF5_PLUGIN_PATH" # Print a line-line message left justified in a field of 70 characters # beginning with the word "Testing". -- cgit v0.12 From 5f8f3dcb793ac58a084ed38e841bf98f4bfd486b Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 27 Mar 2013 11:11:21 -0500 Subject: [svn-r23467] Remove subdirectory. Tested: local linux --- test/CMakeLists.txt | 88 ++++++++++++++++++++++++++++--------- test/plugin_lib/CMakeLists.txt | 83 ----------------------------------- test/plugin_lib/Makefile.in | 45 ------------------- test/plugin_lib/dynlib1.c | 98 ------------------------------------------ 4 files changed, 68 insertions(+), 246 deletions(-) delete mode 100644 test/plugin_lib/CMakeLists.txt delete mode 100644 test/plugin_lib/Makefile.in delete mode 100644 test/plugin_lib/dynlib1.c diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index dfd6a8e..75f398d 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -7,22 +7,14 @@ PROJECT (HDF5_TEST) ADD_DEFINITIONS (${HDF5_EXTRA_C_FLAGS}) #----------------------------------------------------------------------------- -# If plugin library tests can be tested +# Generate the H5srcdir_str.h file containing user settings needed by compilation #----------------------------------------------------------------------------- -IF (BUILD_SHARED_LIBS) - IF (EXISTS "${HDF5_TEST_SOURCE_DIR}/plugin_lib" AND IS_DIRECTORY "${HDF5_TEST_SOURCE_DIR}/plugin_lib") - ADD_SUBDIRECTORY (${HDF5_TEST_SOURCE_DIR}/plugin_lib ${PROJECT_BINARY_DIR}/plugin_lib) - ENDIF (EXISTS "${HDF5_TEST_SOURCE_DIR}/plugin_lib" AND IS_DIRECTORY "${HDF5_TEST_SOURCE_DIR}/plugin_lib") -ELSE (BUILD_SHARED_LIBS) - MESSAGE (STATUS " **** Plugins libraries must be built as shared libraries **** ") - ADD_TEST ( - NAME H5PLUGIN-SKIPPED - COMMAND ${CMAKE_COMMAND} -E echo "SKIP H5PLUGIN TESTING" - ) -ENDIF (BUILD_SHARED_LIBS) +SET (srcdir ${CMAKE_CURRENT_SOURCE_DIR}) +CONFIGURE_FILE (${HDF5_TEST_SOURCE_DIR}/H5srcdir_str.h.in H5srcdir_str.h @ONLY) +INCLUDE_DIRECTORIES (${CMAKE_CURRENT_BINARY_DIR}) #----------------------------------------------------------------------------- -# Define Sources +# Define Test Library Sources #----------------------------------------------------------------------------- SET (TEST_LIB_SRCS ${HDF5_TEST_SOURCE_DIR}/h5test.c @@ -34,13 +26,6 @@ SET (TEST_LIB_HEADERS ${HDF5_TEST_SOURCE_DIR}/h5test.h ) -#----------------------------------------------------------------------------- -# Generate the H5srcdir_str.h file containing user settings needed by compilation -#----------------------------------------------------------------------------- -SET (srcdir ${CMAKE_CURRENT_SOURCE_DIR}) -CONFIGURE_FILE (${HDF5_TEST_SOURCE_DIR}/H5srcdir_str.h.in H5srcdir_str.h @ONLY) -INCLUDE_DIRECTORIES (${CMAKE_CURRENT_BINARY_DIR}) - ADD_LIBRARY (${HDF5_TEST_LIB_TARGET} ${LIB_TYPE} ${TEST_LIB_SRCS} ${TEST_LIB_HEADERS}) IF (MSVC) TARGET_LINK_LIBRARIES (${HDF5_TEST_LIB_TARGET} "ws2_32.lib") @@ -52,6 +37,50 @@ TARGET_LINK_LIBRARIES (${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET}) H5_SET_LIB_OPTIONS (${HDF5_TEST_LIB_TARGET} ${HDF5_TEST_LIB_NAME} ${LIB_TYPE}) SET_TARGET_PROPERTIES (${HDF5_TEST_LIB_TARGET} PROPERTIES FOLDER libraries/test) +#----------------------------------------------------------------------------- +# If plugin library tests can be tested +#----------------------------------------------------------------------------- +IF (BUILD_SHARED_LIBS) + SET (HDF5_TEST_PLUGIN_LIB_CORENAME "dynlib1") + SET (HDF5_TEST_PLUGIN_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_TEST_PLUGIN_LIB_CORENAME}") + SET (HDF5_TEST_PLUGIN_LIB_TARGET ${HDF5_TEST_PLUGIN_LIB_CORENAME}) + ADD_DEFINITIONS (${HDF5_EXTRA_C_FLAGS}) + INCLUDE_DIRECTORIES (${HDF5_SRC_DIR}) + + #----------------------------------------------------------------------------- + # Define Sources + #----------------------------------------------------------------------------- + + SET (H5_TEST_PLUGIN_LIB_SRCS + ${HDF5_TEST_SOURCE_DIR}/dynlib1.c + ) + + ADD_LIBRARY (${HDF5_TEST_PLUGIN_LIB_TARGET} ${LIB_TYPE} ${H5_TEST_PLUGIN_LIB_SRCS}) + TARGET_LINK_LIBRARIES (${HDF5_TEST_PLUGIN_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) + H5_SET_LIB_OPTIONS ( + ${HDF5_TEST_PLUGIN_LIB_TARGET} ${HDF5_TEST_PLUGIN_LIB_NAME} + ${LIB_TYPE} + HDF5_TEST_PLUGIN_LIB_NAME_RELEASE + HDF5_TEST_PLUGIN_LIB_NAME_DEBUG + ) + SET_TARGET_PROPERTIES (${HDF5_TEST_PLUGIN_LIB_TARGET} PROPERTIES FOLDER libraries/TEST_PLUGIN) + + #----------------------------------------------------------------------------- + # Copy plugin library to a plugins folder + #----------------------------------------------------------------------------- + + # make plugins dir + FILE (MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/plugins") + ADD_CUSTOM_COMMAND ( + TARGET ${HDF5_TEST_PLUGIN_LIB_TARGET} + POST_BUILD + COMMAND ${CMAKE_COMMAND} + ARGS -E copy_if_different + "$" + "${CMAKE_BINARY_DIR}/plugins/$" + ) +ENDIF (BUILD_SHARED_LIBS) + # -------------------------------------------------------------------- # Copy all the HDF5 files from the test directory into the source directory # -------------------------------------------------------------------- @@ -569,6 +598,25 @@ ENDIF (\${TEST_RESULT} STREQUAL \"0\") ADD_TEST (NAME testlibinfo COMMAND ${CMAKE_COMMAND} -D "TEST_PROGRAM=$" -P "${GREP_RUNNER}") ############################################################################## +### P L U G I N T E S T S +############################################################################## +IF (BUILD_SHARED_LIBS) + ADD_EXECUTABLE (plugin ${HDF5_TEST_SOURCE_DIR}/plugin.c) + TARGET_NAMING (plugin ${LIB_TYPE}) + TARGET_LINK_LIBRARIES (plugin ${HDF5_TEST_PLUGIN_LIB_TARGET}) + SET_TARGET_PROPERTIES (plugin PROPERTIES FOLDER test) + + ADD_TEST (NAME H5PLUGIN-plugin COMMAND $) + SET_TESTS_PROPERTIES (H5PLUGIN-plugin PROPERTIES ENVIRONMENT "HDF5_PLUGIN_PATH=${CMAKE_BINARY_DIR}/plugins") +ELSE (BUILD_SHARED_LIBS) + MESSAGE (STATUS " **** Plugins libraries must be built as shared libraries **** ") + ADD_TEST ( + NAME H5PLUGIN-SKIPPED + COMMAND ${CMAKE_COMMAND} -E echo "SKIP H5PLUGIN TESTING" + ) +ENDIF (BUILD_SHARED_LIBS) + +############################################################################## ############################################################################## ### V F D T E S T S ### ############################################################################## diff --git a/test/plugin_lib/CMakeLists.txt b/test/plugin_lib/CMakeLists.txt deleted file mode 100644 index 9428153..0000000 --- a/test/plugin_lib/CMakeLists.txt +++ /dev/null @@ -1,83 +0,0 @@ -cmake_minimum_required (VERSION 2.8.10) -PROJECT (HDF5_TEST_PLUGIN_LIB) - -#----------------------------------------------------------------------------- -# Set the core name of the library -#----------------------------------------------------------------------------- -SET (HDF5_TEST_PLUGIN_LIB_CORENAME "dynlib1") - -#----------------------------------------------------------------------------- -# Set the true names of all the libraries if customized by external project -#----------------------------------------------------------------------------- -SET (HDF5_TEST_PLUGIN_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_TEST_PLUGIN_LIB_CORENAME}") - -#----------------------------------------------------------------------------- -# Set the target names of all the libraries -#----------------------------------------------------------------------------- -SET (HDF5_TEST_PLUGIN_LIB_TARGET ${HDF5_TEST_PLUGIN_LIB_CORENAME}) - -#----------------------------------------------------------------------------- -# Apply Definitions to compiler in this directory and below -#----------------------------------------------------------------------------- -ADD_DEFINITIONS (${HDF5_EXTRA_C_FLAGS}) - -#----------------------------------------------------------------------------- -# Setup include Directories -#----------------------------------------------------------------------------- -INCLUDE_DIRECTORIES (${HDF5_SRC_DIR}) - -#----------------------------------------------------------------------------- -# Define Sources -#----------------------------------------------------------------------------- - -SET (H5_TEST_PLUGIN_LIB_SRCS - ${HDF5_TEST_PLUGIN_LIB_SOURCE_DIR}/dynlib1.c -) - -#----------------------------------------------------------------------------- -# Generate the H5srcdir_str.h file containing user settings needed by compilation -#----------------------------------------------------------------------------- -SET (srcdir ${CMAKE_CURRENT_SOURCE_DIR}) -CONFIGURE_FILE (${HDF5_TEST_SOURCE_DIR}/H5srcdir_str.h.in H5srcdir_str.h @ONLY) -INCLUDE_DIRECTORIES (${CMAKE_CURRENT_BINARY_DIR}) - -ADD_LIBRARY (${HDF5_TEST_PLUGIN_LIB_TARGET} ${LIB_TYPE} ${H5_TEST_PLUGIN_LIB_SRCS}) -TARGET_LINK_LIBRARIES (${HDF5_TEST_PLUGIN_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) -#SET_GLOBAL_VARIABLE( HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_TEST_PLUGIN_LIB_TARGET}") -H5_SET_LIB_OPTIONS ( - ${HDF5_TEST_PLUGIN_LIB_TARGET} ${HDF5_TEST_PLUGIN_LIB_NAME} - ${LIB_TYPE} - HDF5_TEST_PLUGIN_LIB_NAME_RELEASE - HDF5_TEST_PLUGIN_LIB_NAME_DEBUG -) -SET_TARGET_PROPERTIES (${HDF5_TEST_PLUGIN_LIB_TARGET} PROPERTIES FOLDER libraries/TEST_PLUGIN) - -# -# Copy plugin library to a plugins folder -# - -# make plugins dir -FILE (MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/plugins") -ADD_CUSTOM_COMMAND ( - TARGET ${HDF5_TEST_PLUGIN_LIB_TARGET} - POST_BUILD - COMMAND ${CMAKE_COMMAND} - ARGS -E copy_if_different - "$" - "${CMAKE_BINARY_DIR}/plugins/$" - ) - -############################################################################## -############################################################################## -### T E S T S ### -############################################################################## -############################################################################## - -#-- Adding test for plugin -ADD_EXECUTABLE (plugin ${HDF5_TEST_SOURCE_DIR}/plugin.c) -TARGET_NAMING (plugin ${LIB_TYPE}) -TARGET_LINK_LIBRARIES (plugin ${HDF5_TEST_PLUGIN_LIB_TARGET}) -SET_TARGET_PROPERTIES (plugin PROPERTIES FOLDER test) - -ADD_TEST (NAME H5PLUGIN-plugin COMMAND $) -SET_TESTS_PROPERTIES (H5PLUGIN-plugin PROPERTIES ENVIRONMENT "HDF5_PLUGIN_PATH=${CMAKE_BINARY_DIR}/plugins") diff --git a/test/plugin_lib/Makefile.in b/test/plugin_lib/Makefile.in deleted file mode 100644 index 00a2ea5..0000000 --- a/test/plugin_lib/Makefile.in +++ /dev/null @@ -1,45 +0,0 @@ -# Copyright by The HDF Group. -# Copyright by the Board of Trustees of the University of Illinois. -# 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 files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. -# -# HDF5 Library Test Makefile(.in) -# -# This Makefile.in is NOT generated by automake. Since we want to build -# shared libraries for testing, automake can't create shared libraries when -# configure asks to build static library. -# -CFLAGS = -fPIC -g -CC = @CC@ -SRCDIR = @srcdir@ -TOP_SRCDIR = @top_srcdir@ -TOP_BUILDDIR = @top_builddir@ -MAJOR = 0 -MINOR = 1 -NAME1 = dynlib1 -VERSION = $(MAJOR).$(MINOR) - -# Include files in hdf5/src build/src directories for hdf5.h and H5pubconf.h -INCLUDES = -I$(TOP_SRCDIR)/src -I$(TOP_BUILDDIR)/src - -lib: lib$(NAME1).so.$(VERSION) - -$(NAME1).o: $(SRCDIR)/$(NAME1).c - $(CC) $(CFLAGS) $(INCLUDES) -c $(SRCDIR)/$(NAME1).c - -lib$(NAME1).so.$(VERSION): $(NAME1).o - $(CC) -shared $^ -o $@ - -clean: - $(RM) *.o *.so* Makefile - -distclean: - $(RM) *.o *.so* Makefile diff --git a/test/plugin_lib/dynlib1.c b/test/plugin_lib/dynlib1.c deleted file mode 100644 index d663bd7..0000000 --- a/test/plugin_lib/dynlib1.c +++ /dev/null @@ -1,98 +0,0 @@ -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * - * 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 files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * - * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ - -/* - * Programmer: Raymond Lu - * 13 February 2013 - * - * Purpose: Tests the plugin module (H5PL) - */ - -#include -#include -#include - -static size_t H5Z_filter_dynlib1(unsigned int flags, size_t cd_nelmts, - const unsigned int *cd_values, size_t nbytes, size_t *buf_size, void **buf); - -/* This message derives from H5Z */ -const H5Z_class2_t H5Z_DYNLIB1[1] = {{ - H5Z_CLASS_T_VERS, /* H5Z_class_t version */ - H5Z_FILTER_DYNLIB1, /* Filter id number */ - 1, 1, /* Encoding and decoding enabled */ - "dynlib1", /* Filter name for debugging */ - NULL, /* The "can apply" callback */ - NULL, /* The "set local" callback */ - (H5Z_func_t)H5Z_filter_dynlib1, /* The actual filter function */ -}}; - -const H5PL_type_t H5PL_get_plugin_type(void) {return H5PL_TYPE_FILTER;} -const H5Z_class2_t* H5PL_get_plugin_info(void) {return H5Z_DYNLIB1;} - -/*------------------------------------------------------------------------- - * Function: H5Z_filter_dynlib1 - * - * Purpose: A dynlib1 compression method that doesn't do anything. - * - * Return: Success: Data chunk size - * - * Failure: 0 - * - * Programmer: Robb Matzke - * Tuesday, April 21, 1998 - * - *------------------------------------------------------------------------- - */ -static size_t -H5Z_filter_dynlib1(unsigned int flags, size_t cd_nelmts, - const unsigned int *cd_values, size_t nbytes, - size_t *buf_size, void **buf) -{ - int *int_ptr=(int *)*buf; /* Pointer to the data values */ - size_t buf_left=*buf_size; /* Amount of data buffer left to process */ - int add_on = 0; - -/*fprintf(stderr, "cd_nelmts=%d, cd_values=%d\n", cd_nelmts, cd_values[0]);*/ - /* Check for the correct number of parameters */ - if(cd_nelmts==0) - return(0); - - /* Check that permanent parameters are set correctly */ - if(cd_values[0]<0 || cd_values[0]>9) - return(0); - - add_on = cd_values[0]; - -/*fprintf(stderr, "add_on=%d\n", add_on);*/ - - if(flags & H5Z_FLAG_REVERSE) { /*read*/ - /* Substract the "add on" value to all the data values */ - while(buf_left>0) { - *int_ptr++ -= add_on; - buf_left -= sizeof(int); - } /* end while */ - } /* end if */ - else { /*write*/ - /* Add the "add on" value to all the data values */ - while(buf_left>0) { - *int_ptr++ += add_on; - buf_left -= sizeof(int); - } /* end while */ - } /* end else */ - -/*fprintf(stderr, "nbytes=%d\n", nbytes);*/ - - return nbytes; -} -- cgit v0.12 From c76847d107d5fab28e6b9ced5b054669064e984a Mon Sep 17 00:00:00 2001 From: Raymond Lu Date: Wed, 27 Mar 2013 17:30:21 -0500 Subject: [svn-r23472] I updated the default search path for plugin module to be /usr/local/hdf5/lib/plugin for Unix and "%ALLUSERSPROFILE%/hdf5/lib/plugin" for Windows. Tested with Albert's committest on 6 systesm. --- src/H5PL.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/H5PL.c b/src/H5PL.c index 86c6615..3cb5708 100644 --- a/src/H5PL.c +++ b/src/H5PL.c @@ -44,7 +44,7 @@ /* Windows support */ #ifdef H5_HAVE_WIN32_API -#define H5PL_DEFAULT_PATH ".;/ProgramData;/Users/Public" +#define H5PL_DEFAULT_PATH "%ALLUSERSPROFILE%/hdf5/lib/plugin" #define H5PL_PATH_SEPARATOR ";" /* Handle for dynamic library */ @@ -67,7 +67,7 @@ typedef const H5Z_class2_t *(__cdecl *get_filter_info_t)(); /* Unix support */ #else /* H5_HAVE_WIN32_API */ -#define H5PL_DEFAULT_PATH "/usr:/usr/lib:/usr/local" +#define H5PL_DEFAULT_PATH "/usr/local/hdf5/lib/plugin" #define H5PL_PATH_SEPARATOR ":" /* Handle for dynamic library */ -- cgit v0.12 From d7724485b0363f99f8f97a633d30cff503a2b6d4 Mon Sep 17 00:00:00 2001 From: Scot Breitenfeld Date: Thu, 28 Mar 2013 11:11:34 -0500 Subject: [svn-r23475] added dll for verify_Fortran_INTEGER_4 --- fortran/test/tf.f90 | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/fortran/test/tf.f90 b/fortran/test/tf.f90 index 1060747..4f73fda 100644 --- a/fortran/test/tf.f90 +++ b/fortran/test/tf.f90 @@ -115,7 +115,7 @@ END SUBROUTINE verify !This definition is needed for Windows DLLs !DEC$if defined(BUILD_HDF5_DLL) -!DEC$attributes dllexport :: verify +!DEC$attributes dllexport :: verify_Fortran_INTEGER_4 !DEC$endif SUBROUTINE verify_Fortran_INTEGER_4(string,value,correct_value,total_error) USE HDF5 @@ -129,9 +129,6 @@ SUBROUTINE verify_Fortran_INTEGER_4(string,value,correct_value,total_error) RETURN END SUBROUTINE verify_Fortran_INTEGER_4 - - - !This definition is needed for Windows DLLs !DEC$if defined(BUILD_HDF5_DLL) !DEC$attributes dllexport :: verifyLogical @@ -151,7 +148,7 @@ END SUBROUTINE verifyLogical !DEC$if defined(BUILD_HDF5_DLL) !DEC$attributes dllexport :: verifyString !DEC$endif -SUBROUTINE verifystring(string, value,correct_value,total_error) +SUBROUTINE verifyString(string, value,correct_value,total_error) CHARACTER*(*) :: string CHARACTER*(*) :: value, correct_value INTEGER :: total_error @@ -160,7 +157,7 @@ SUBROUTINE verifystring(string, value,correct_value,total_error) WRITE(*,*) "ERROR: INCORRECT VALIDATION ", string ENDIF RETURN -END SUBROUTINE verifystring +END SUBROUTINE verifyString !---------------------------------------------------------------------- -- cgit v0.12 From 02b1c11ecd0d06acc26de368846449fbfcfe66fa Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 28 Mar 2013 11:38:12 -0500 Subject: [svn-r23476] HDFFV-8359: correct script function calls. Tested: local linux --- tools/h5copy/testh5copy.sh.in | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tools/h5copy/testh5copy.sh.in b/tools/h5copy/testh5copy.sh.in index d30d8d8..bec3bfc 100644 --- a/tools/h5copy/testh5copy.sh.in +++ b/tools/h5copy/testh5copy.sh.in @@ -513,7 +513,7 @@ COPY_REFERENCES() TESTFILE="$TESTDIR/h5copy_ref.h5" echo "Test copying object and region references" - TOOLTEST_F -f ref -i $TESTFILE -o $TESTDIR/region_ref.out.h5 -v -s / -d /COPY + TOOLTEST -f ref -i $TESTFILE -o $TESTDIR/region_ref.out.h5 -v -s / -d /COPY } # Copy external links. @@ -529,25 +529,25 @@ COPY_EXT_LINKS() TOOLTEST -v -i $TESTFILE -o $TESTDIR/ext_link.out.h5 -s /group_ext/extlink_dset -d /copy1_dset echo "Test copying external link directly with -f ext" - TOOLTEST_F -f ext -i $TESTFILE -o $TESTDIR/ext_link_f.out.h5 -v -s /group_ext/extlink_dset -d /copy2_dset + TOOLTEST -f ext -i $TESTFILE -o $TESTDIR/ext_link_f.out.h5 -v -s /group_ext/extlink_dset -d /copy2_dset echo "Test copying dangling external link (no obj) directly without -f ext" TOOLTEST -v -i $TESTFILE -o $TESTDIR/ext_dangle_noobj.out.h5 -s /group_ext/extlink_notyet1 -d /copy_dangle1_1 echo "Test copying dangling external link (no obj) directly with -f ext" - TOOLTEST_F -f ext -i $TESTFILE -o $TESTDIR/ext_dangle_noobj_f.out.h5 -v -s /group_ext/extlink_notyet1 -d /copy_dangle1_2 + TOOLTEST -f ext -i $TESTFILE -o $TESTDIR/ext_dangle_noobj_f.out.h5 -v -s /group_ext/extlink_notyet1 -d /copy_dangle1_2 echo "Test copying dangling external link (no file) directly without -f ext" TOOLTEST -v -i $TESTFILE -o $TESTDIR/ext_dangle_nofile.out.h5 -s /group_ext/extlink_notyet2 -d /copy_dangle2_1 echo "Test copying dangling external link (no file) directly with -f ext" - TOOLTEST_F -f ext -i $TESTFILE -o $TESTDIR/ext_dangle_nofile_f.out.h5 -v -s /group_ext/extlink_notyet2 -d /copy_dangle2_2 + TOOLTEST -f ext -i $TESTFILE -o $TESTDIR/ext_dangle_nofile_f.out.h5 -v -s /group_ext/extlink_notyet2 -d /copy_dangle2_2 echo "Test copying a group contains external links without -f ext" TOOLTEST -v -i $TESTFILE -o $TESTDIR/ext_link_group.out.h5 -s /group_ext -d /copy1_group echo "Test copying a group contains external links with -f ext" - TOOLTEST_F -f ext -i $TESTFILE -o $TESTDIR/ext_link_group_f.out.h5 -v -s /group_ext -d /copy2_group + TOOLTEST -f ext -i $TESTFILE -o $TESTDIR/ext_link_group_f.out.h5 -v -s /group_ext -d /copy2_group } # Test misc. -- cgit v0.12 From 9138b343aa6b3e314ef6e0a332a2ba3570311427 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 28 Mar 2013 12:17:19 -0500 Subject: [svn-r23480] Reposition conditional and libtool commands. --- configure.ac | 116 +++++++++++++++++++++++++++---------------------------- test/Makefile.am | 18 ++++----- 2 files changed, 66 insertions(+), 68 deletions(-) diff --git a/configure.ac b/configure.ac index 4f9f7a5..ff5151f 100644 --- a/configure.ac +++ b/configure.ac @@ -1037,11 +1037,6 @@ LT_PREREQ([2.2]) LT_INIT([dlopen]) ## ---------------------------------------------------------------------- -## Set a macro if shared library is enabled. -## -AM_CONDITIONAL([HAVE_SHARED_CONDITIONAL], [test "X$enable_shared" = "Xyes"]) - -## ---------------------------------------------------------------------- ## Check if we should install only statically linked executables. ## This check needs to occur after libtool is initialized because ## we check a libtool cache value and may issue a warning based @@ -4440,6 +4435,64 @@ if test -n "$TESTPARALLEL"; then FORTRAN_PARALLEL_MAKE=fortran/$TESTPARALLEL/Makefile fi fi +LT_OUTPUT +no_create=$saved_no_create + +## Then the stamp2 file for H5config.h +touch ./config/stamp2 + +## Finally the makefiles +test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 + +## Post processing to patch up some deficiencies in libtool +case $host_os in + linux* | freebsd* ) + ## If gcc is not used, need to set $wl to use "-Wl," + if $CC -v 2>&1 | grep '^gcc' > /dev/null ; then + : using gcc + else + echo 'fixing $wl in' $ofile +ed - $ofile < /dev/null +g/^wl=""/s//wl="-Wl,"/ +w +q +EOF + fi + ;; +esac + +## Are we compiling static libraries, shared libraries, or both? This +## is only used for the libhdf5.settings file. We can't just look at +## $enable_static and $enable_shared because if they're yes the ltconfig +## might have decided that one or the other is simply not possible. +## Therefore we have to ask the generated `libtool' shell script +## which 'features' it has enabled. +if (./libtool --features | grep '^enable shared libraries' > /dev/null); then + enable_shared=yes +else + enable_shared=no +fi + +if (./libtool --features | grep '^enable static libraries' > /dev/null); then + enable_static=yes +else + enable_static=no +fi + +if test "X$enable_static" = "Xyes" && test "X$enable_shared" = "Xyes"; then + STATIC_SHARED="static, shared" +elif test "X$enable_static" = "Xyes"; then + STATIC_SHARED="static" +elif test "X$enable_shared" = "Xyes"; then + STATIC_SHARED="shared" +else + STATIC_SHARED="none" +fi + +## ---------------------------------------------------------------------- +## Set a macro if shared library is enabled. +## +AM_CONDITIONAL([HAVE_SHARED_CONDITIONAL], [test "X$enable_shared" = "Xyes"]) AC_CONFIG_FILES([src/libhdf5.settings Makefile @@ -4519,59 +4572,6 @@ AC_CONFIG_FILES([src/libhdf5.settings hl/fortran/examples/run-hlfortran-ex.sh]) AC_OUTPUT -LT_OUTPUT -no_create=$saved_no_create - -## Then the stamp2 file for H5config.h -touch ./config/stamp2 - -## Finally the makefiles -test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 - -## Post processing to patch up some deficiencies in libtool -case $host_os in - linux* | freebsd* ) - ## If gcc is not used, need to set $wl to use "-Wl," - if $CC -v 2>&1 | grep '^gcc' > /dev/null ; then - : using gcc - else - echo 'fixing $wl in' $ofile -ed - $ofile < /dev/null -g/^wl=""/s//wl="-Wl,"/ -w -q -EOF - fi - ;; -esac - -## Are we compiling static libraries, shared libraries, or both? This -## is only used for the libhdf5.settings file. We can't just look at -## $enable_static and $enable_shared because if they're yes the ltconfig -## might have decided that one or the other is simply not possible. -## Therefore we have to ask the generated `libtool' shell script -## which 'features' it has enabled. -if (./libtool --features | grep '^enable shared libraries' > /dev/null); then - enable_shared=yes -else - enable_shared=no -fi - -if (./libtool --features | grep '^enable static libraries' > /dev/null); then - enable_static=yes -else - enable_static=no -fi - -if test "X$enable_static" = "Xyes" && test "X$enable_shared" = "Xyes"; then - STATIC_SHARED="static, shared" -elif test "X$enable_static" = "Xyes"; then - STATIC_SHARED="static" -elif test "X$enable_shared" = "Xyes"; then - STATIC_SHARED="shared" -else - STATIC_SHARED="none" -fi chmod 755 tools/misc/h5cc diff --git a/test/Makefile.am b/test/Makefile.am index df6a9e5..62b309d 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -24,12 +24,11 @@ include $(top_srcdir)/config/commence.am INCLUDES=-I$(top_srcdir)/src -I$(top_builddir)/src # Test script for error_test and err_compat +TEST_SCRIPT = testerror.sh testlibinfo.sh testcheck_version.sh testlinks_env.sh +SCRIPT_DEPEND = error_test$(EXEEXT) err_compat$(EXEEXT) links_env$(EXEEXT) if HAVE_SHARED_CONDITIONAL - TEST_SCRIPT = testerror.sh testlibinfo.sh testcheck_version.sh testlinks_env.sh test_plugin.sh - SCRIPT_DEPEND = error_test$(EXEEXT) err_compat$(EXEEXT) links_env$(EXEEXT) plugin$(EXEEXT) -else - TEST_SCRIPT = testerror.sh testlibinfo.sh testcheck_version.sh testlinks_env.sh - SCRIPT_DEPEND = error_test$(EXEEXT) err_compat$(EXEEXT) links_env$(EXEEXT) + TEST_SCRIPT += test_plugin.sh + SCRIPT_DEPEND += plugin$(EXEEXT) endif check_SCRIPTS = $(TEST_SCRIPT) @@ -55,10 +54,10 @@ TEST_PROG= testhdf5 lheap ohdr stab gheap cache cache_api cache_tagging \ # 'make check' doesn't run them directly, so they are not included in TEST_PROG. # Also build testmeta, which is used for timings test. It builds quickly, # and this lets automake keep all its test programs in one place. +check_PROGRAMS=$(TEST_PROG) error_test err_compat tcheck_version testmeta links_env if HAVE_SHARED_CONDITIONAL - check_PROGRAMS=$(TEST_PROG) error_test err_compat tcheck_version testmeta links_env plugin + check_PROGRAMS+= plugin else - check_PROGRAMS=$(TEST_PROG) error_test err_compat tcheck_version testmeta links_env endif # These programs generate test files for the tests. They don't need to be @@ -99,10 +98,9 @@ LDADD=libh5test.la $(LIBHDF5) ttsafe_SOURCES=ttsafe.c ttsafe_dcreate.c ttsafe_error.c ttsafe_cancel.c \ ttsafe_acreate.c +VFD_LIST = sec2 stdio core split multi family if DIRECT_VFD_CONDITIONAL - VFD_LIST = sec2 stdio core split multi family direct -else - VFD_LIST = sec2 stdio core split multi family + VFD_LIST += direct endif # Additional target for running timing test -- cgit v0.12 From 3374ffecf828a4e7a4e7566c3bd7315121c656d1 Mon Sep 17 00:00:00 2001 From: Raymond Lu Date: Thu, 28 Mar 2013 15:14:11 -0500 Subject: [svn-r23482] I changed the plugin library to be built as shared library only when configure enables shared. libtool will install the shared plugin library. I put a remove command in test/Makefile.am to delete the unnecessary plugin library. Tested on jam, koala, and emu. --- configure | 2872 +++++++++++++++++++++++++++--------------------------- test/Makefile.am | 8 +- test/Makefile.in | 154 ++- 3 files changed, 1551 insertions(+), 1483 deletions(-) diff --git a/configure b/configure index 4afa0a9..f5bf889 100755 --- a/configure +++ b/configure @@ -638,6 +638,8 @@ ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS LIBOBJS +HAVE_SHARED_CONDITIONAL_FALSE +HAVE_SHARED_CONDITIONAL_TRUE SETX SEARCH BUILD_HDF5_HL_CONDITIONAL_FALSE @@ -689,8 +691,6 @@ USE_FILTER_SZIP USE_FILTER_DEFLATE AM_MAKEFLAGS LT_STATIC_EXEC -HAVE_SHARED_CONDITIONAL_FALSE -HAVE_SHARED_CONDITIONAL_TRUE CPP OTOOL64 OTOOL @@ -22022,18 +22022,6 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu ## ---------------------------------------------------------------------- -## Set a macro if shared library is enabled. -## - if test "X$enable_shared" = "Xyes"; then - HAVE_SHARED_CONDITIONAL_TRUE= - HAVE_SHARED_CONDITIONAL_FALSE='#' -else - HAVE_SHARED_CONDITIONAL_TRUE='#' - HAVE_SHARED_CONDITIONAL_FALSE= -fi - - -## ---------------------------------------------------------------------- ## Check if we should install only statically linked executables. ## This check needs to occur after libtool is initialized because ## we check a libtool cache value and may issue a warning based @@ -31237,227 +31225,18 @@ if test -n "$TESTPARALLEL"; then FORTRAN_PARALLEL_MAKE=fortran/$TESTPARALLEL/Makefile fi fi - -ac_config_files="$ac_config_files src/libhdf5.settings Makefile src/Makefile test/Makefile test/testcheck_version.sh test/testerror.sh test/H5srcdir_str.h test/testlibinfo.sh test/testlinks_env.sh test/test_plugin.sh testpar/Makefile testpar/testph5.sh perform/Makefile tools/Makefile tools/h5dump/Makefile tools/h5dump/testh5dump.sh tools/h5dump/testh5dumppbits.sh tools/h5dump/testh5dumpxml.sh tools/h5ls/testh5ls.sh tools/h5import/Makefile tools/h5import/h5importtestutil.sh tools/h5diff/Makefile tools/h5diff/testh5diff.sh tools/h5diff/testph5diff.sh tools/h5jam/Makefile tools/h5jam/testh5jam.sh tools/h5repack/Makefile tools/h5repack/h5repack.sh tools/h5ls/Makefile tools/h5copy/Makefile tools/h5copy/testh5copy.sh tools/lib/Makefile tools/misc/Makefile tools/misc/h5cc tools/misc/testh5mkgrp.sh tools/misc/testh5repart.sh tools/h5stat/testh5stat.sh tools/h5stat/Makefile examples/Makefile examples/run-c-ex.sh examples/testh5cc.sh c++/Makefile c++/src/Makefile c++/src/h5c++ c++/test/Makefile c++/test/H5srcdir_str.h c++/examples/Makefile c++/examples/run-c++-ex.sh c++/examples/testh5c++.sh fortran/Makefile fortran/src/h5fc fortran/src/Makefile fortran/test/Makefile fortran/testpar/Makefile fortran/examples/Makefile fortran/examples/run-fortran-ex.sh fortran/examples/testh5fc.sh hl/Makefile hl/src/Makefile hl/test/Makefile hl/test/H5srcdir_str.h hl/tools/Makefile hl/tools/gif2h5/Makefile hl/tools/gif2h5/h52giftest.sh hl/examples/Makefile hl/examples/run-hlc-ex.sh hl/c++/Makefile hl/c++/src/Makefile hl/c++/test/Makefile hl/c++/examples/Makefile hl/c++/examples/run-hlc++-ex.sh hl/fortran/Makefile hl/fortran/src/Makefile hl/fortran/test/Makefile hl/fortran/examples/Makefile hl/fortran/examples/run-hlfortran-ex.sh" - - -cat >confcache <<\_ACEOF -# This file is a shell script that caches the results of configure -# tests run on this system so they can be shared between configure -# scripts and configure runs, see configure's option --config-cache. -# It is not useful on other systems. If it contains results you don't -# want to keep, you may remove or edit it. -# -# config.status only pays attention to the cache file if you give it -# the --recheck option to rerun configure. -# -# `ac_cv_env_foo' variables (set or unset) will be overridden when -# loading this file, other *unset* `ac_cv_foo' will be assigned the -# following values. - -_ACEOF - -# The following way of writing the cache mishandles newlines in values, -# but we know of no workaround that is simple, portable, and efficient. -# So, we kill variables containing newlines. -# Ultrix sh set writes to stderr and can't be redirected directly, -# and sets the high bit in the cache file unless we assign to the vars. -( - for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do - eval ac_val=\$$ac_var - case $ac_val in #( - *${as_nl}*) - case $ac_var in #( - *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 -$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; - esac - case $ac_var in #( - _ | IFS | as_nl) ;; #( - BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( - *) { eval $ac_var=; unset $ac_var;} ;; - esac ;; - esac - done - - (set) 2>&1 | - case $as_nl`(ac_space=' '; set) 2>&1` in #( - *${as_nl}ac_space=\ *) - # `set' does not quote correctly, so add quotes: double-quote - # substitution turns \\\\ into \\, and sed turns \\ into \. - sed -n \ - "s/'/'\\\\''/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" - ;; #( - *) - # `set' quotes correctly as required by POSIX, so do not add quotes. - sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" - ;; - esac | - sort -) | - sed ' - /^ac_cv_env_/b end - t clear - :clear - s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ - t end - s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ - :end' >>confcache -if diff "$cache_file" confcache >/dev/null 2>&1; then :; else - if test -w "$cache_file"; then - if test "x$cache_file" != "x/dev/null"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 -$as_echo "$as_me: updating cache $cache_file" >&6;} - if test ! -f "$cache_file" || test -h "$cache_file"; then - cat confcache >"$cache_file" - else - case $cache_file in #( - */* | ?:*) - mv -f confcache "$cache_file"$$ && - mv -f "$cache_file"$$ "$cache_file" ;; #( - *) - mv -f confcache "$cache_file" ;; - esac - fi - fi - else - { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 -$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} - fi -fi -rm -f confcache - -test "x$prefix" = xNONE && prefix=$ac_default_prefix -# Let make expand exec_prefix. -test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' - -DEFS=-DHAVE_CONFIG_H - -ac_libobjs= -ac_ltlibobjs= -U= -for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue - # 1. Remove the extension, and $U if already installed. - ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' - ac_i=`$as_echo "$ac_i" | sed "$ac_script"` - # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR - # will be set to the directory where LIBOBJS objects are built. - as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" - as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' -done -LIBOBJS=$ac_libobjs - -LTLIBOBJS=$ac_ltlibobjs - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 -$as_echo_n "checking that generated files are newer than configure... " >&6; } - if test -n "$am_sleep_pid"; then - # Hide warnings about reused PIDs. - wait $am_sleep_pid 2>/dev/null - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5 -$as_echo "done" >&6; } - if test -n "$EXEEXT"; then - am__EXEEXT_TRUE= - am__EXEEXT_FALSE='#' -else - am__EXEEXT_TRUE='#' - am__EXEEXT_FALSE= -fi - -if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then - as_fn_error $? "conditional \"MAINTAINER_MODE\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then - as_fn_error $? "conditional \"AMDEP\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then - as_fn_error $? "conditional \"am__fastdepCC\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${FORTRAN_HAVE_SIZEOF_TRUE}" && test -z "${FORTRAN_HAVE_SIZEOF_FALSE}"; then - as_fn_error $? "conditional \"FORTRAN_HAVE_SIZEOF\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${FORTRAN_2003_CONDITIONAL_F_TRUE}" && test -z "${FORTRAN_2003_CONDITIONAL_F_FALSE}"; then - as_fn_error $? "conditional \"FORTRAN_2003_CONDITIONAL_F\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${FORTRAN_DEFAULT_REALisDBLE_F_TRUE}" && test -z "${FORTRAN_DEFAULT_REALisDBLE_F_FALSE}"; then - as_fn_error $? "conditional \"FORTRAN_DEFAULT_REALisDBLE_F\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then - as_fn_error $? "conditional \"am__fastdepCXX\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${FORTRAN_SHARED_CONDITIONAL_TRUE}" && test -z "${FORTRAN_SHARED_CONDITIONAL_FALSE}"; then - as_fn_error $? "conditional \"FORTRAN_SHARED_CONDITIONAL\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${CXX_SHARED_CONDITIONAL_TRUE}" && test -z "${CXX_SHARED_CONDITIONAL_FALSE}"; then - as_fn_error $? "conditional \"CXX_SHARED_CONDITIONAL\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${HAVE_SHARED_CONDITIONAL_TRUE}" && test -z "${HAVE_SHARED_CONDITIONAL_FALSE}"; then - as_fn_error $? "conditional \"HAVE_SHARED_CONDITIONAL\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi - -if test -z "${BUILD_SHARED_SZIP_CONDITIONAL_TRUE}" && test -z "${BUILD_SHARED_SZIP_CONDITIONAL_FALSE}"; then - as_fn_error $? "conditional \"BUILD_SHARED_SZIP_CONDITIONAL\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${DIRECT_VFD_CONDITIONAL_TRUE}" && test -z "${DIRECT_VFD_CONDITIONAL_FALSE}"; then - as_fn_error $? "conditional \"DIRECT_VFD_CONDITIONAL\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${BUILD_ALL_CONDITIONAL_TRUE}" && test -z "${BUILD_ALL_CONDITIONAL_FALSE}"; then - as_fn_error $? "conditional \"BUILD_ALL_CONDITIONAL\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${BUILD_CXX_CONDITIONAL_TRUE}" && test -z "${BUILD_CXX_CONDITIONAL_FALSE}"; then - as_fn_error $? "conditional \"BUILD_CXX_CONDITIONAL\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${BUILD_PARALLEL_CONDITIONAL_TRUE}" && test -z "${BUILD_PARALLEL_CONDITIONAL_FALSE}"; then - as_fn_error $? "conditional \"BUILD_PARALLEL_CONDITIONAL\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${BUILD_FORTRAN_CONDITIONAL_TRUE}" && test -z "${BUILD_FORTRAN_CONDITIONAL_FALSE}"; then - as_fn_error $? "conditional \"BUILD_FORTRAN_CONDITIONAL\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${BUILD_HDF5_HL_CONDITIONAL_TRUE}" && test -z "${BUILD_HDF5_HL_CONDITIONAL_FALSE}"; then - as_fn_error $? "conditional \"BUILD_HDF5_HL_CONDITIONAL\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi - -: "${CONFIG_STATUS=./config.status}" -ac_write_fail=0 -ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files $CONFIG_STATUS" -{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 -$as_echo "$as_me: creating $CONFIG_STATUS" >&6;} +: ${CONFIG_LT=./config.lt} +{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_LT" >&5 +$as_echo "$as_me: creating $CONFIG_LT" >&6;} as_write_fail=0 -cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 +cat >"$CONFIG_LT" <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. -# Run this file to recreate the current configuration. -# Compiler output produced by configure, useful for debugging -# configure, is in config.log if it exists. - -debug=false -ac_cs_recheck=false -ac_cs_silent=false - +# Run this file to recreate a libtool stub with the current configuration. SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF -cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 +cat >>"$CONFIG_LT" <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## @@ -31821,203 +31600,71 @@ as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 -## ----------------------------------- ## -## Main body of $CONFIG_STATUS script. ## -## ----------------------------------- ## +## --------------------------------- ## +## Main body of "$CONFIG_LT" script. ## +## --------------------------------- ## _ASEOF -test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -# Save the log message, to keep $0 and so on meaningful, and to -# report actual input values of CONFIG_FILES etc. instead of their -# values after options handling. -ac_log=" -This file was extended by HDF5 $as_me 1.9.149, which was -generated by GNU Autoconf 2.69. Invocation command line was - - CONFIG_FILES = $CONFIG_FILES - CONFIG_HEADERS = $CONFIG_HEADERS - CONFIG_LINKS = $CONFIG_LINKS - CONFIG_COMMANDS = $CONFIG_COMMANDS - $ $0 $@ - -on `(hostname || uname -n) 2>/dev/null | sed 1q` -" - -_ACEOF - -case $ac_config_files in *" -"*) set x $ac_config_files; shift; ac_config_files=$*;; -esac - -case $ac_config_headers in *" -"*) set x $ac_config_headers; shift; ac_config_headers=$*;; -esac - - -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -# Files that config.status was made for. -config_files="$ac_config_files" -config_headers="$ac_config_headers" -config_commands="$ac_config_commands" - -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -ac_cs_usage="\ -\`$as_me' instantiates files and other configuration actions -from templates according to the current configuration. Unless the files -and actions are specified as TAGs, all are instantiated by default. - -Usage: $0 [OPTION]... [TAG]... - - -h, --help print this help, then exit - -V, --version print version number and configuration settings, then exit - --config print configuration, then exit - -q, --quiet, --silent - do not print progress messages - -d, --debug don't remove temporary files - --recheck update $as_me by reconfiguring in the same conditions - --file=FILE[:TEMPLATE] - instantiate the configuration file FILE - --header=FILE[:TEMPLATE] - instantiate the configuration header FILE +test $as_write_fail = 0 && chmod +x "$CONFIG_LT" -Configuration files: -$config_files +cat >>"$CONFIG_LT" <<\_LTEOF +lt_cl_silent=false +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX +} >&5 -Configuration headers: -$config_headers +lt_cl_help="\ +\`$as_me' creates a local libtool stub from the current configuration, +for use in further configure time tests before the real libtool is +generated. -Configuration commands: -$config_commands +Usage: $0 [OPTIONS] -Report bugs to ." + -h, --help print this help, then exit + -V, --version print version number, then exit + -q, --quiet do not print progress messages + -d, --debug don't remove temporary files -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" -ac_cs_version="\\ -HDF5 config.status 1.9.149 -configured by $0, generated by GNU Autoconf 2.69, - with options \\"\$ac_cs_config\\" +Report bugs to ." -Copyright (C) 2012 Free Software Foundation, Inc. -This config.status script is free software; the Free Software Foundation -gives unlimited permission to copy, distribute and modify it." +lt_cl_version="\ +HDF5 config.lt 1.9.149 +configured by $0, generated by GNU Autoconf 2.69. -ac_pwd='$ac_pwd' -srcdir='$srcdir' -INSTALL='$INSTALL' -MKDIR_P='$MKDIR_P' -AWK='$AWK' -test -n "\$AWK" || AWK=awk -_ACEOF +Copyright (C) 2011 Free Software Foundation, Inc. +This config.lt script is free software; the Free Software Foundation +gives unlimited permision to copy, distribute and modify it." -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -# The default lists apply if the user does not specify any file. -ac_need_defaults=: while test $# != 0 do case $1 in - --*=?*) - ac_option=`expr "X$1" : 'X\([^=]*\)='` - ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` - ac_shift=: - ;; - --*=) - ac_option=`expr "X$1" : 'X\([^=]*\)='` - ac_optarg= - ac_shift=: - ;; - *) - ac_option=$1 - ac_optarg=$2 - ac_shift=shift - ;; - esac - - case $ac_option in - # Handling of the options. - -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) - ac_cs_recheck=: ;; - --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) - $as_echo "$ac_cs_version"; exit ;; - --config | --confi | --conf | --con | --co | --c ) - $as_echo "$ac_cs_config"; exit ;; - --debug | --debu | --deb | --de | --d | -d ) - debug=: ;; - --file | --fil | --fi | --f ) - $ac_shift - case $ac_optarg in - *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; - '') as_fn_error $? "missing file argument" ;; - esac - as_fn_append CONFIG_FILES " '$ac_optarg'" - ac_need_defaults=false;; - --header | --heade | --head | --hea ) - $ac_shift - case $ac_optarg in - *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; - esac - as_fn_append CONFIG_HEADERS " '$ac_optarg'" - ac_need_defaults=false;; - --he | --h) - # Conflict between --help and --header - as_fn_error $? "ambiguous option: \`$1' -Try \`$0 --help' for more information.";; - --help | --hel | -h ) - $as_echo "$ac_cs_usage"; exit ;; - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil | --si | --s) - ac_cs_silent=: ;; - - # This is an error. - -*) as_fn_error $? "unrecognized option: \`$1' -Try \`$0 --help' for more information." ;; + --version | --v* | -V ) + echo "$lt_cl_version"; exit 0 ;; + --help | --h* | -h ) + echo "$lt_cl_help"; exit 0 ;; + --debug | --d* | -d ) + debug=: ;; + --quiet | --q* | --silent | --s* | -q ) + lt_cl_silent=: ;; - *) as_fn_append ac_config_targets " $1" - ac_need_defaults=false ;; + -*) as_fn_error $? "unrecognized option: $1 +Try \`$0 --help' for more information." "$LINENO" 5 ;; + *) as_fn_error $? "unrecognized argument: $1 +Try \`$0 --help' for more information." "$LINENO" 5 ;; esac shift done -ac_configure_extra_args= - -if $ac_cs_silent; then +if $lt_cl_silent; then exec 6>/dev/null - ac_configure_extra_args="$ac_configure_extra_args --silent" fi +_LTEOF -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -if \$ac_cs_recheck; then - set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion - shift - \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 - CONFIG_SHELL='$SHELL' - export CONFIG_SHELL - exec "\$@" -fi - -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -exec 5>>config.log -{ - echo - sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX -## Running $as_me. ## -_ASBOX - $as_echo "$ac_log" -} >&5 - -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -# -# INIT-COMMANDS -# -AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" +cat >>"$CONFIG_LT" <<_LTEOF # The HP-UX ksh and POSIX shell print the target directory to stdout @@ -32481,802 +32128,13 @@ fi +_LTEOF -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 - -# Handling of arguments. -for ac_config_target in $ac_config_targets -do - case $ac_config_target in - "src/H5config.h") CONFIG_HEADERS="$CONFIG_HEADERS src/H5config.h" ;; - "pubconf") CONFIG_COMMANDS="$CONFIG_COMMANDS pubconf" ;; - "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; - "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; - "src/libhdf5.settings") CONFIG_FILES="$CONFIG_FILES src/libhdf5.settings" ;; - "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; - "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; - "test/Makefile") CONFIG_FILES="$CONFIG_FILES test/Makefile" ;; - "test/testcheck_version.sh") CONFIG_FILES="$CONFIG_FILES test/testcheck_version.sh" ;; - "test/testerror.sh") CONFIG_FILES="$CONFIG_FILES test/testerror.sh" ;; - "test/H5srcdir_str.h") CONFIG_FILES="$CONFIG_FILES test/H5srcdir_str.h" ;; - "test/testlibinfo.sh") CONFIG_FILES="$CONFIG_FILES test/testlibinfo.sh" ;; - "test/testlinks_env.sh") CONFIG_FILES="$CONFIG_FILES test/testlinks_env.sh" ;; - "test/test_plugin.sh") CONFIG_FILES="$CONFIG_FILES test/test_plugin.sh" ;; - "testpar/Makefile") CONFIG_FILES="$CONFIG_FILES testpar/Makefile" ;; - "testpar/testph5.sh") CONFIG_FILES="$CONFIG_FILES testpar/testph5.sh" ;; - "perform/Makefile") CONFIG_FILES="$CONFIG_FILES perform/Makefile" ;; - "tools/Makefile") CONFIG_FILES="$CONFIG_FILES tools/Makefile" ;; - "tools/h5dump/Makefile") CONFIG_FILES="$CONFIG_FILES tools/h5dump/Makefile" ;; - "tools/h5dump/testh5dump.sh") CONFIG_FILES="$CONFIG_FILES tools/h5dump/testh5dump.sh" ;; - "tools/h5dump/testh5dumppbits.sh") CONFIG_FILES="$CONFIG_FILES tools/h5dump/testh5dumppbits.sh" ;; - "tools/h5dump/testh5dumpxml.sh") CONFIG_FILES="$CONFIG_FILES tools/h5dump/testh5dumpxml.sh" ;; - "tools/h5ls/testh5ls.sh") CONFIG_FILES="$CONFIG_FILES tools/h5ls/testh5ls.sh" ;; - "tools/h5import/Makefile") CONFIG_FILES="$CONFIG_FILES tools/h5import/Makefile" ;; - "tools/h5import/h5importtestutil.sh") CONFIG_FILES="$CONFIG_FILES tools/h5import/h5importtestutil.sh" ;; - "tools/h5diff/Makefile") CONFIG_FILES="$CONFIG_FILES tools/h5diff/Makefile" ;; - "tools/h5diff/testh5diff.sh") CONFIG_FILES="$CONFIG_FILES tools/h5diff/testh5diff.sh" ;; - "tools/h5diff/testph5diff.sh") CONFIG_FILES="$CONFIG_FILES tools/h5diff/testph5diff.sh" ;; - "tools/h5jam/Makefile") CONFIG_FILES="$CONFIG_FILES tools/h5jam/Makefile" ;; - "tools/h5jam/testh5jam.sh") CONFIG_FILES="$CONFIG_FILES tools/h5jam/testh5jam.sh" ;; - "tools/h5repack/Makefile") CONFIG_FILES="$CONFIG_FILES tools/h5repack/Makefile" ;; - "tools/h5repack/h5repack.sh") CONFIG_FILES="$CONFIG_FILES tools/h5repack/h5repack.sh" ;; - "tools/h5ls/Makefile") CONFIG_FILES="$CONFIG_FILES tools/h5ls/Makefile" ;; - "tools/h5copy/Makefile") CONFIG_FILES="$CONFIG_FILES tools/h5copy/Makefile" ;; - "tools/h5copy/testh5copy.sh") CONFIG_FILES="$CONFIG_FILES tools/h5copy/testh5copy.sh" ;; - "tools/lib/Makefile") CONFIG_FILES="$CONFIG_FILES tools/lib/Makefile" ;; - "tools/misc/Makefile") CONFIG_FILES="$CONFIG_FILES tools/misc/Makefile" ;; - "tools/misc/h5cc") CONFIG_FILES="$CONFIG_FILES tools/misc/h5cc" ;; - "tools/misc/testh5mkgrp.sh") CONFIG_FILES="$CONFIG_FILES tools/misc/testh5mkgrp.sh" ;; - "tools/misc/testh5repart.sh") CONFIG_FILES="$CONFIG_FILES tools/misc/testh5repart.sh" ;; - "tools/h5stat/testh5stat.sh") CONFIG_FILES="$CONFIG_FILES tools/h5stat/testh5stat.sh" ;; - "tools/h5stat/Makefile") CONFIG_FILES="$CONFIG_FILES tools/h5stat/Makefile" ;; - "examples/Makefile") CONFIG_FILES="$CONFIG_FILES examples/Makefile" ;; - "examples/run-c-ex.sh") CONFIG_FILES="$CONFIG_FILES examples/run-c-ex.sh" ;; - "examples/testh5cc.sh") CONFIG_FILES="$CONFIG_FILES examples/testh5cc.sh" ;; - "c++/Makefile") CONFIG_FILES="$CONFIG_FILES c++/Makefile" ;; - "c++/src/Makefile") CONFIG_FILES="$CONFIG_FILES c++/src/Makefile" ;; - "c++/src/h5c++") CONFIG_FILES="$CONFIG_FILES c++/src/h5c++" ;; - "c++/test/Makefile") CONFIG_FILES="$CONFIG_FILES c++/test/Makefile" ;; - "c++/test/H5srcdir_str.h") CONFIG_FILES="$CONFIG_FILES c++/test/H5srcdir_str.h" ;; - "c++/examples/Makefile") CONFIG_FILES="$CONFIG_FILES c++/examples/Makefile" ;; - "c++/examples/run-c++-ex.sh") CONFIG_FILES="$CONFIG_FILES c++/examples/run-c++-ex.sh" ;; - "c++/examples/testh5c++.sh") CONFIG_FILES="$CONFIG_FILES c++/examples/testh5c++.sh" ;; - "fortran/Makefile") CONFIG_FILES="$CONFIG_FILES fortran/Makefile" ;; - "fortran/src/h5fc") CONFIG_FILES="$CONFIG_FILES fortran/src/h5fc" ;; - "fortran/src/Makefile") CONFIG_FILES="$CONFIG_FILES fortran/src/Makefile" ;; - "fortran/test/Makefile") CONFIG_FILES="$CONFIG_FILES fortran/test/Makefile" ;; - "fortran/testpar/Makefile") CONFIG_FILES="$CONFIG_FILES fortran/testpar/Makefile" ;; - "fortran/examples/Makefile") CONFIG_FILES="$CONFIG_FILES fortran/examples/Makefile" ;; - "fortran/examples/run-fortran-ex.sh") CONFIG_FILES="$CONFIG_FILES fortran/examples/run-fortran-ex.sh" ;; - "fortran/examples/testh5fc.sh") CONFIG_FILES="$CONFIG_FILES fortran/examples/testh5fc.sh" ;; - "hl/Makefile") CONFIG_FILES="$CONFIG_FILES hl/Makefile" ;; - "hl/src/Makefile") CONFIG_FILES="$CONFIG_FILES hl/src/Makefile" ;; - "hl/test/Makefile") CONFIG_FILES="$CONFIG_FILES hl/test/Makefile" ;; - "hl/test/H5srcdir_str.h") CONFIG_FILES="$CONFIG_FILES hl/test/H5srcdir_str.h" ;; - "hl/tools/Makefile") CONFIG_FILES="$CONFIG_FILES hl/tools/Makefile" ;; - "hl/tools/gif2h5/Makefile") CONFIG_FILES="$CONFIG_FILES hl/tools/gif2h5/Makefile" ;; - "hl/tools/gif2h5/h52giftest.sh") CONFIG_FILES="$CONFIG_FILES hl/tools/gif2h5/h52giftest.sh" ;; - "hl/examples/Makefile") CONFIG_FILES="$CONFIG_FILES hl/examples/Makefile" ;; - "hl/examples/run-hlc-ex.sh") CONFIG_FILES="$CONFIG_FILES hl/examples/run-hlc-ex.sh" ;; - "hl/c++/Makefile") CONFIG_FILES="$CONFIG_FILES hl/c++/Makefile" ;; - "hl/c++/src/Makefile") CONFIG_FILES="$CONFIG_FILES hl/c++/src/Makefile" ;; - "hl/c++/test/Makefile") CONFIG_FILES="$CONFIG_FILES hl/c++/test/Makefile" ;; - "hl/c++/examples/Makefile") CONFIG_FILES="$CONFIG_FILES hl/c++/examples/Makefile" ;; - "hl/c++/examples/run-hlc++-ex.sh") CONFIG_FILES="$CONFIG_FILES hl/c++/examples/run-hlc++-ex.sh" ;; - "hl/fortran/Makefile") CONFIG_FILES="$CONFIG_FILES hl/fortran/Makefile" ;; - "hl/fortran/src/Makefile") CONFIG_FILES="$CONFIG_FILES hl/fortran/src/Makefile" ;; - "hl/fortran/test/Makefile") CONFIG_FILES="$CONFIG_FILES hl/fortran/test/Makefile" ;; - "hl/fortran/examples/Makefile") CONFIG_FILES="$CONFIG_FILES hl/fortran/examples/Makefile" ;; - "hl/fortran/examples/run-hlfortran-ex.sh") CONFIG_FILES="$CONFIG_FILES hl/fortran/examples/run-hlfortran-ex.sh" ;; - - *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; - esac -done - - -# If the user did not use the arguments to specify the items to instantiate, -# then the envvar interface is used. Set only those that are not. -# We use the long form for the default assignment because of an extremely -# bizarre bug on SunOS 4.1.3. -if $ac_need_defaults; then - test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files - test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers - test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands -fi - -# Have a temporary directory for convenience. Make it in the build tree -# simply because there is no reason against having it here, and in addition, -# creating and moving files from /tmp can sometimes cause problems. -# Hook for its removal unless debugging. -# Note that there is a small window in which the directory will not be cleaned: -# after its creation but before its name has been assigned to `$tmp'. -$debug || -{ - tmp= ac_tmp= - trap 'exit_status=$? - : "${ac_tmp:=$tmp}" - { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status -' 0 - trap 'as_fn_exit 1' 1 2 13 15 -} -# Create a (secure) tmp directory for tmp files. - -{ - tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && - test -d "$tmp" -} || -{ - tmp=./conf$$-$RANDOM - (umask 077 && mkdir "$tmp") -} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 -ac_tmp=$tmp - -# Set up the scripts for CONFIG_FILES section. -# No need to generate them if there are no CONFIG_FILES. -# This happens for instance with `./config.status config.h'. -if test -n "$CONFIG_FILES"; then - - -ac_cr=`echo X | tr X '\015'` -# On cygwin, bash can eat \r inside `` if the user requested igncr. -# But we know of no other shell where ac_cr would be empty at this -# point, so we can use a bashism as a fallback. -if test "x$ac_cr" = x; then - eval ac_cr=\$\'\\r\' -fi -ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` -if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then - ac_cs_awk_cr='\\r' -else - ac_cs_awk_cr=$ac_cr -fi - -echo 'BEGIN {' >"$ac_tmp/subs1.awk" && -_ACEOF - - -{ - echo "cat >conf$$subs.awk <<_ACEOF" && - echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && - echo "_ACEOF" -} >conf$$subs.sh || - as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 -ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` -ac_delim='%!_!# ' -for ac_last_try in false false false false false :; do - . ./conf$$subs.sh || - as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 - - ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` - if test $ac_delim_n = $ac_delim_num; then - break - elif $ac_last_try; then - as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 - else - ac_delim="$ac_delim!$ac_delim _$ac_delim!! " - fi -done -rm -f conf$$subs.sh - -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && -_ACEOF -sed -n ' -h -s/^/S["/; s/!.*/"]=/ -p -g -s/^[^!]*!// -:repl -t repl -s/'"$ac_delim"'$// -t delim -:nl -h -s/\(.\{148\}\)..*/\1/ -t more1 -s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ -p -n -b repl -:more1 -s/["\\]/\\&/g; s/^/"/; s/$/"\\/ -p -g -s/.\{148\}// -t nl -:delim -h -s/\(.\{148\}\)..*/\1/ -t more2 -s/["\\]/\\&/g; s/^/"/; s/$/"/ -p -b -:more2 -s/["\\]/\\&/g; s/^/"/; s/$/"\\/ -p -g -s/.\{148\}// -t delim -' >$CONFIG_STATUS || ac_write_fail=1 -rm -f conf$$subs.awk -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -_ACAWK -cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && - for (key in S) S_is_set[key] = 1 - FS = "" - -} -{ - line = $ 0 - nfields = split(line, field, "@") - substed = 0 - len = length(field[1]) - for (i = 2; i < nfields; i++) { - key = field[i] - keylen = length(key) - if (S_is_set[key]) { - value = S[key] - line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) - len += length(value) + length(field[++i]) - substed = 1 - } else - len += 1 + keylen - } - - print line -} - -_ACAWK -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then - sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" -else - cat -fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ - || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 -_ACEOF - -# VPATH may cause trouble with some makes, so we remove sole $(srcdir), -# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and -# trailing colons and then remove the whole line if VPATH becomes empty -# (actually we leave an empty line to preserve line numbers). -if test "x$srcdir" = x.; then - ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ -h -s/// -s/^/:/ -s/[ ]*$/:/ -s/:\$(srcdir):/:/g -s/:\${srcdir}:/:/g -s/:@srcdir@:/:/g -s/^:*// -s/:*$// -x -s/\(=[ ]*\).*/\1/ -G -s/\n// -s/^[^=]*=[ ]*$// -}' -fi - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -fi # test -n "$CONFIG_FILES" - -# Set up the scripts for CONFIG_HEADERS section. -# No need to generate them if there are no CONFIG_HEADERS. -# This happens for instance with `./config.status Makefile'. -if test -n "$CONFIG_HEADERS"; then -cat >"$ac_tmp/defines.awk" <<\_ACAWK || -BEGIN { -_ACEOF - -# Transform confdefs.h into an awk script `defines.awk', embedded as -# here-document in config.status, that substitutes the proper values into -# config.h.in to produce config.h. - -# Create a delimiter string that does not exist in confdefs.h, to ease -# handling of long lines. -ac_delim='%!_!# ' -for ac_last_try in false false :; do - ac_tt=`sed -n "/$ac_delim/p" confdefs.h` - if test -z "$ac_tt"; then - break - elif $ac_last_try; then - as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 - else - ac_delim="$ac_delim!$ac_delim _$ac_delim!! " - fi -done - -# For the awk script, D is an array of macro values keyed by name, -# likewise P contains macro parameters if any. Preserve backslash -# newline sequences. - -ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* -sed -n ' -s/.\{148\}/&'"$ac_delim"'/g -t rset -:rset -s/^[ ]*#[ ]*define[ ][ ]*/ / -t def -d -:def -s/\\$// -t bsnl -s/["\\]/\\&/g -s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ -D["\1"]=" \3"/p -s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p -d -:bsnl -s/["\\]/\\&/g -s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ -D["\1"]=" \3\\\\\\n"\\/p -t cont -s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p -t cont -d -:cont -n -s/.\{148\}/&'"$ac_delim"'/g -t clear -:clear -s/\\$// -t bsnlc -s/["\\]/\\&/g; s/^/"/; s/$/"/p -d -:bsnlc -s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p -b cont -' >$CONFIG_STATUS || ac_write_fail=1 - -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 - for (key in D) D_is_set[key] = 1 - FS = "" -} -/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { - line = \$ 0 - split(line, arg, " ") - if (arg[1] == "#") { - defundef = arg[2] - mac1 = arg[3] - } else { - defundef = substr(arg[1], 2) - mac1 = arg[2] - } - split(mac1, mac2, "(") #) - macro = mac2[1] - prefix = substr(line, 1, index(line, defundef) - 1) - if (D_is_set[macro]) { - # Preserve the white space surrounding the "#". - print prefix "define", macro P[macro] D[macro] - next - } else { - # Replace #undef with comments. This is necessary, for example, - # in the case of _POSIX_SOURCE, which is predefined and required - # on some systems where configure will not decide to define it. - if (defundef == "undef") { - print "/*", prefix defundef, macro, "*/" - next - } - } -} -{ print } -_ACAWK -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 - as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 -fi # test -n "$CONFIG_HEADERS" - - -eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" -shift -for ac_tag -do - case $ac_tag in - :[FHLC]) ac_mode=$ac_tag; continue;; - esac - case $ac_mode$ac_tag in - :[FHL]*:*);; - :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; - :[FH]-) ac_tag=-:-;; - :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; - esac - ac_save_IFS=$IFS - IFS=: - set x $ac_tag - IFS=$ac_save_IFS - shift - ac_file=$1 - shift - - case $ac_mode in - :L) ac_source=$1;; - :[FH]) - ac_file_inputs= - for ac_f - do - case $ac_f in - -) ac_f="$ac_tmp/stdin";; - *) # Look for the file first in the build tree, then in the source tree - # (if the path is not absolute). The absolute path cannot be DOS-style, - # because $ac_f cannot contain `:'. - test -f "$ac_f" || - case $ac_f in - [\\/$]*) false;; - *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; - esac || - as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; - esac - case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac - as_fn_append ac_file_inputs " '$ac_f'" - done - - # Let's still pretend it is `configure' which instantiates (i.e., don't - # use $as_me), people would be surprised to read: - # /* config.h. Generated by config.status. */ - configure_input='Generated from '` - $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' - `' by configure.' - if test x"$ac_file" != x-; then - configure_input="$ac_file. $configure_input" - { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 -$as_echo "$as_me: creating $ac_file" >&6;} - fi - # Neutralize special characters interpreted by sed in replacement strings. - case $configure_input in #( - *\&* | *\|* | *\\* ) - ac_sed_conf_input=`$as_echo "$configure_input" | - sed 's/[\\\\&|]/\\\\&/g'`;; #( - *) ac_sed_conf_input=$configure_input;; - esac - - case $ac_tag in - *:-:* | *:-) cat >"$ac_tmp/stdin" \ - || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; - esac - ;; - esac - - ac_dir=`$as_dirname -- "$ac_file" || -$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$ac_file" : 'X\(//\)[^/]' \| \ - X"$ac_file" : 'X\(//\)$' \| \ - X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$ac_file" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - as_dir="$ac_dir"; as_fn_mkdir_p - ac_builddir=. - -case "$ac_dir" in -.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; -*) - ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` - # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` - case $ac_top_builddir_sub in - "") ac_top_builddir_sub=. ac_top_build_prefix= ;; - *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; - esac ;; -esac -ac_abs_top_builddir=$ac_pwd -ac_abs_builddir=$ac_pwd$ac_dir_suffix -# for backward compatibility: -ac_top_builddir=$ac_top_build_prefix - -case $srcdir in - .) # We are building in place. - ac_srcdir=. - ac_top_srcdir=$ac_top_builddir_sub - ac_abs_top_srcdir=$ac_pwd ;; - [\\/]* | ?:[\\/]* ) # Absolute name. - ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir - ac_abs_top_srcdir=$srcdir ;; - *) # Relative name. - ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_build_prefix$srcdir - ac_abs_top_srcdir=$ac_pwd/$srcdir ;; -esac -ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix - - - case $ac_mode in - :F) - # - # CONFIG_FILE - # - - case $INSTALL in - [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; - *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; - esac - ac_MKDIR_P=$MKDIR_P - case $MKDIR_P in - [\\/$]* | ?:[\\/]* ) ;; - */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; - esac -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -# If the template does not know about datarootdir, expand it. -# FIXME: This hack should be removed a few years after 2.60. -ac_datarootdir_hack=; ac_datarootdir_seen= -ac_sed_dataroot=' -/datarootdir/ { - p - q -} -/@datadir@/p -/@docdir@/p -/@infodir@/p -/@localedir@/p -/@mandir@/p' -case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in -*datarootdir*) ac_datarootdir_seen=yes;; -*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 -$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 - ac_datarootdir_hack=' - s&@datadir@&$datadir&g - s&@docdir@&$docdir&g - s&@infodir@&$infodir&g - s&@localedir@&$localedir&g - s&@mandir@&$mandir&g - s&\\\${datarootdir}&$datarootdir&g' ;; -esac -_ACEOF - -# Neutralize VPATH when `$srcdir' = `.'. -# Shell code in configure.ac might set extrasub. -# FIXME: do we really want to maintain this feature? -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -ac_sed_extra="$ac_vpsub -$extrasub -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -:t -/@[a-zA-Z_][a-zA-Z_0-9]*@/!b -s|@configure_input@|$ac_sed_conf_input|;t t -s&@top_builddir@&$ac_top_builddir_sub&;t t -s&@top_build_prefix@&$ac_top_build_prefix&;t t -s&@srcdir@&$ac_srcdir&;t t -s&@abs_srcdir@&$ac_abs_srcdir&;t t -s&@top_srcdir@&$ac_top_srcdir&;t t -s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t -s&@builddir@&$ac_builddir&;t t -s&@abs_builddir@&$ac_abs_builddir&;t t -s&@abs_top_builddir@&$ac_abs_top_builddir&;t t -s&@INSTALL@&$ac_INSTALL&;t t -s&@MKDIR_P@&$ac_MKDIR_P&;t t -$ac_datarootdir_hack -" -eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ - >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 - -test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && - { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && - { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ - "$ac_tmp/out"`; test -z "$ac_out"; } && - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' -which seems to be undefined. Please make sure it is defined" >&5 -$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' -which seems to be undefined. Please make sure it is defined" >&2;} - - rm -f "$ac_tmp/stdin" - case $ac_file in - -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; - *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; - esac \ - || as_fn_error $? "could not create $ac_file" "$LINENO" 5 - ;; - :H) - # - # CONFIG_HEADER - # - if test x"$ac_file" != x-; then - { - $as_echo "/* $configure_input */" \ - && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" - } >"$ac_tmp/config.h" \ - || as_fn_error $? "could not create $ac_file" "$LINENO" 5 - if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then - { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 -$as_echo "$as_me: $ac_file is unchanged" >&6;} - else - rm -f "$ac_file" - mv "$ac_tmp/config.h" "$ac_file" \ - || as_fn_error $? "could not create $ac_file" "$LINENO" 5 - fi - else - $as_echo "/* $configure_input */" \ - && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ - || as_fn_error $? "could not create -" "$LINENO" 5 - fi -# Compute "$ac_file"'s index in $config_headers. -_am_arg="$ac_file" -_am_stamp_count=1 -for _am_header in $config_headers :; do - case $_am_header in - $_am_arg | $_am_arg:* ) - break ;; - * ) - _am_stamp_count=`expr $_am_stamp_count + 1` ;; - esac -done -echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || -$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$_am_arg" : 'X\(//\)[^/]' \| \ - X"$_am_arg" : 'X\(//\)$' \| \ - X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$_am_arg" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'`/stamp-h$_am_stamp_count - ;; - - :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 -$as_echo "$as_me: executing $ac_file commands" >&6;} - ;; - esac +cat >>"$CONFIG_LT" <<\_LTEOF +{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $ofile" >&5 +$as_echo "$as_me: creating $ofile" >&6;} - case $ac_file$ac_mode in - "pubconf":C) - echo "creating src/H5pubconf.h" - sed 's/#define /#define H5_/' pubconf - if test ! -f src/H5pubconf.h; then - /bin/mv -f pubconf src/H5pubconf.h - elif (diff pubconf src/H5pubconf.h >/dev/null); then - rm -f pubconf - echo "src/H5pubconf.h is unchanged" - else - /bin/mv -f pubconf src/H5pubconf.h - fi - echo "Post process src/libhdf5.settings" - sed '/^#/d' < src/libhdf5.settings > libhdf5.settings.TMP - cp libhdf5.settings.TMP src/libhdf5.settings - rm -f libhdf5.settings.TMP - ;; - "depfiles":C) test x"$AMDEP_TRUE" != x"" || { - # Autoconf 2.62 quotes --file arguments for eval, but not when files - # are listed without --file. Let's play safe and only enable the eval - # if we detect the quoting. - case $CONFIG_FILES in - *\'*) eval set x "$CONFIG_FILES" ;; - *) set x $CONFIG_FILES ;; - esac - shift - for mf - do - # Strip MF so we end up with the name of the file. - mf=`echo "$mf" | sed -e 's/:.*$//'` - # Check whether this is an Automake generated Makefile or not. - # We used to match only the files named 'Makefile.in', but - # some people rename them; so instead we look at the file content. - # Grep'ing the first line is not enough: some people post-process - # each Makefile.in and add a new line on top of each file to say so. - # Grep'ing the whole file is not good either: AIX grep has a line - # limit of 2048, but all sed's we know have understand at least 4000. - if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then - dirpart=`$as_dirname -- "$mf" || -$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$mf" : 'X\(//\)[^/]' \| \ - X"$mf" : 'X\(//\)$' \| \ - X"$mf" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$mf" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - else - continue - fi - # Extract the definition of DEPDIR, am__include, and am__quote - # from the Makefile without running 'make'. - DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` - test -z "$DEPDIR" && continue - am__include=`sed -n 's/^am__include = //p' < "$mf"` - test -z "am__include" && continue - am__quote=`sed -n 's/^am__quote = //p' < "$mf"` - # Find all dependency output files, they are included files with - # $(DEPDIR) in their names. We invoke sed twice because it is the - # simplest approach to changing $(DEPDIR) to its actual value in the - # expansion. - for file in `sed -n " - s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ - sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do - # Make sure the directory exists. - test -f "$dirpart/$file" && continue - fdir=`$as_dirname -- "$file" || -$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$file" : 'X\(//\)[^/]' \| \ - X"$file" : 'X\(//\)$' \| \ - X"$file" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$file" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - as_dir=$dirpart/$fdir; as_fn_mkdir_p - # echo "creating $dirpart/$file" - echo '# dummy' > "$dirpart/$file" - done - done -} - ;; - "libtool":C) - # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then @@ -34186,98 +33044,349 @@ inherit_rpath=$inherit_rpath_FC # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs_FC -# Set to "yes" if exported symbols are required. -always_export_symbols=$always_export_symbols_FC +# Set to "yes" if exported symbols are required. +always_export_symbols=$always_export_symbols_FC + +# The commands to list exported symbols. +export_symbols_cmds=$lt_export_symbols_cmds_FC + +# Symbols that should not be listed in the preloaded symbols. +exclude_expsyms=$lt_exclude_expsyms_FC + +# Symbols that must always be exported. +include_expsyms=$lt_include_expsyms_FC + +# Commands necessary for linking programs (against libraries) with templates. +prelink_cmds=$lt_prelink_cmds_FC + +# Commands necessary for finishing linking programs. +postlink_cmds=$lt_postlink_cmds_FC + +# Specify filename containing input files. +file_list_spec=$lt_file_list_spec_FC + +# How to hardcode a shared library path into an executable. +hardcode_action=$hardcode_action_FC + +# The directories searched by this compiler when creating a shared library. +compiler_lib_search_dirs=$lt_compiler_lib_search_dirs_FC + +# Dependencies to place before and after the objects being linked to +# create a shared library. +predep_objects=$lt_predep_objects_FC +postdep_objects=$lt_postdep_objects_FC +predeps=$lt_predeps_FC +postdeps=$lt_postdeps_FC + +# The library search path used internally by the compiler when linking +# a shared library. +compiler_lib_search_path=$lt_compiler_lib_search_path_FC + +# ### END LIBTOOL TAG CONFIG: FC +_LT_EOF + + +as_fn_exit 0 +_LTEOF +chmod +x "$CONFIG_LT" + +# configure is writing to config.log, but config.lt does its own redirection, +# appending to config.log, which fails on DOS, as config.log is still kept +# open by configure. Here we exec the FD to /dev/null, effectively closing +# config.log, so it can be properly (re)opened and appended to by config.lt. +lt_cl_success=: +test "$silent" = yes && + lt_config_lt_args="$lt_config_lt_args --quiet" +exec 5>/dev/null +$SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false +exec 5>>config.log +$lt_cl_success || as_fn_exit 1 + +no_create=$saved_no_create + +## Then the stamp2 file for H5config.h +touch ./config/stamp2 + +## Finally the makefiles +test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 + +## Post processing to patch up some deficiencies in libtool +case $host_os in + linux* | freebsd* ) + ## If gcc is not used, need to set $wl to use "-Wl," + if $CC -v 2>&1 | grep '^gcc' > /dev/null ; then + : using gcc + else + echo 'fixing $wl in' $ofile +ed - $ofile < /dev/null +g/^wl=""/s//wl="-Wl,"/ +w +q +EOF + fi + ;; +esac + +## Are we compiling static libraries, shared libraries, or both? This +## is only used for the libhdf5.settings file. We can't just look at +## $enable_static and $enable_shared because if they're yes the ltconfig +## might have decided that one or the other is simply not possible. +## Therefore we have to ask the generated `libtool' shell script +## which 'features' it has enabled. +if (./libtool --features | grep '^enable shared libraries' > /dev/null); then + enable_shared=yes +else + enable_shared=no +fi -# The commands to list exported symbols. -export_symbols_cmds=$lt_export_symbols_cmds_FC +if (./libtool --features | grep '^enable static libraries' > /dev/null); then + enable_static=yes +else + enable_static=no +fi -# Symbols that should not be listed in the preloaded symbols. -exclude_expsyms=$lt_exclude_expsyms_FC +if test "X$enable_static" = "Xyes" && test "X$enable_shared" = "Xyes"; then + STATIC_SHARED="static, shared" +elif test "X$enable_static" = "Xyes"; then + STATIC_SHARED="static" +elif test "X$enable_shared" = "Xyes"; then + STATIC_SHARED="shared" +else + STATIC_SHARED="none" +fi -# Symbols that must always be exported. -include_expsyms=$lt_include_expsyms_FC +## ---------------------------------------------------------------------- +## Set a macro if shared library is enabled. +## + if test "X$enable_shared" = "Xyes"; then + HAVE_SHARED_CONDITIONAL_TRUE= + HAVE_SHARED_CONDITIONAL_FALSE='#' +else + HAVE_SHARED_CONDITIONAL_TRUE='#' + HAVE_SHARED_CONDITIONAL_FALSE= +fi -# Commands necessary for linking programs (against libraries) with templates. -prelink_cmds=$lt_prelink_cmds_FC -# Commands necessary for finishing linking programs. -postlink_cmds=$lt_postlink_cmds_FC +ac_config_files="$ac_config_files src/libhdf5.settings Makefile src/Makefile test/Makefile test/testcheck_version.sh test/testerror.sh test/H5srcdir_str.h test/testlibinfo.sh test/testlinks_env.sh test/test_plugin.sh testpar/Makefile testpar/testph5.sh perform/Makefile tools/Makefile tools/h5dump/Makefile tools/h5dump/testh5dump.sh tools/h5dump/testh5dumppbits.sh tools/h5dump/testh5dumpxml.sh tools/h5ls/testh5ls.sh tools/h5import/Makefile tools/h5import/h5importtestutil.sh tools/h5diff/Makefile tools/h5diff/testh5diff.sh tools/h5diff/testph5diff.sh tools/h5jam/Makefile tools/h5jam/testh5jam.sh tools/h5repack/Makefile tools/h5repack/h5repack.sh tools/h5ls/Makefile tools/h5copy/Makefile tools/h5copy/testh5copy.sh tools/lib/Makefile tools/misc/Makefile tools/misc/h5cc tools/misc/testh5mkgrp.sh tools/misc/testh5repart.sh tools/h5stat/testh5stat.sh tools/h5stat/Makefile examples/Makefile examples/run-c-ex.sh examples/testh5cc.sh c++/Makefile c++/src/Makefile c++/src/h5c++ c++/test/Makefile c++/test/H5srcdir_str.h c++/examples/Makefile c++/examples/run-c++-ex.sh c++/examples/testh5c++.sh fortran/Makefile fortran/src/h5fc fortran/src/Makefile fortran/test/Makefile fortran/testpar/Makefile fortran/examples/Makefile fortran/examples/run-fortran-ex.sh fortran/examples/testh5fc.sh hl/Makefile hl/src/Makefile hl/test/Makefile hl/test/H5srcdir_str.h hl/tools/Makefile hl/tools/gif2h5/Makefile hl/tools/gif2h5/h52giftest.sh hl/examples/Makefile hl/examples/run-hlc-ex.sh hl/c++/Makefile hl/c++/src/Makefile hl/c++/test/Makefile hl/c++/examples/Makefile hl/c++/examples/run-hlc++-ex.sh hl/fortran/Makefile hl/fortran/src/Makefile hl/fortran/test/Makefile hl/fortran/examples/Makefile hl/fortran/examples/run-hlfortran-ex.sh" -# Specify filename containing input files. -file_list_spec=$lt_file_list_spec_FC -# How to hardcode a shared library path into an executable. -hardcode_action=$hardcode_action_FC +cat >confcache <<\_ACEOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs, see configure's option --config-cache. +# It is not useful on other systems. If it contains results you don't +# want to keep, you may remove or edit it. +# +# config.status only pays attention to the cache file if you give it +# the --recheck option to rerun configure. +# +# `ac_cv_env_foo' variables (set or unset) will be overridden when +# loading this file, other *unset* `ac_cv_foo' will be assigned the +# following values. -# The directories searched by this compiler when creating a shared library. -compiler_lib_search_dirs=$lt_compiler_lib_search_dirs_FC +_ACEOF -# Dependencies to place before and after the objects being linked to -# create a shared library. -predep_objects=$lt_predep_objects_FC -postdep_objects=$lt_postdep_objects_FC -predeps=$lt_predeps_FC -postdeps=$lt_postdeps_FC +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, we kill variables containing newlines. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +( + for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done -# The library search path used internally by the compiler when linking -# a shared library. -compiler_lib_search_path=$lt_compiler_lib_search_path_FC + (set) 2>&1 | + case $as_nl`(ac_space=' '; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + # `set' does not quote correctly, so add quotes: double-quote + # substitution turns \\\\ into \\, and sed turns \\ into \. + sed -n \ + "s/'/'\\\\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" + ;; #( + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) | + sed ' + /^ac_cv_env_/b end + t clear + :clear + s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + t end + s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + :end' >>confcache +if diff "$cache_file" confcache >/dev/null 2>&1; then :; else + if test -w "$cache_file"; then + if test "x$cache_file" != "x/dev/null"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 +$as_echo "$as_me: updating cache $cache_file" >&6;} + if test ! -f "$cache_file" || test -h "$cache_file"; then + cat confcache >"$cache_file" + else + case $cache_file in #( + */* | ?:*) + mv -f confcache "$cache_file"$$ && + mv -f "$cache_file"$$ "$cache_file" ;; #( + *) + mv -f confcache "$cache_file" ;; + esac + fi + fi + else + { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 +$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} + fi +fi +rm -f confcache -# ### END LIBTOOL TAG CONFIG: FC -_LT_EOF +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' - ;; +DEFS=-DHAVE_CONFIG_H - esac -done # for ac_tag +ac_libobjs= +ac_ltlibobjs= +U= +for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue + # 1. Remove the extension, and $U if already installed. + ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' + ac_i=`$as_echo "$ac_i" | sed "$ac_script"` + # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR + # will be set to the directory where LIBOBJS objects are built. + as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" + as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' +done +LIBOBJS=$ac_libobjs +LTLIBOBJS=$ac_ltlibobjs -as_fn_exit 0 -_ACEOF -ac_clean_files=$ac_clean_files_save -test $ac_write_fail = 0 || - as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 +$as_echo_n "checking that generated files are newer than configure... " >&6; } + if test -n "$am_sleep_pid"; then + # Hide warnings about reused PIDs. + wait $am_sleep_pid 2>/dev/null + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5 +$as_echo "done" >&6; } + if test -n "$EXEEXT"; then + am__EXEEXT_TRUE= + am__EXEEXT_FALSE='#' +else + am__EXEEXT_TRUE='#' + am__EXEEXT_FALSE= +fi +if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then + as_fn_error $? "conditional \"MAINTAINER_MODE\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then + as_fn_error $? "conditional \"AMDEP\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then + as_fn_error $? "conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${FORTRAN_HAVE_SIZEOF_TRUE}" && test -z "${FORTRAN_HAVE_SIZEOF_FALSE}"; then + as_fn_error $? "conditional \"FORTRAN_HAVE_SIZEOF\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${FORTRAN_2003_CONDITIONAL_F_TRUE}" && test -z "${FORTRAN_2003_CONDITIONAL_F_FALSE}"; then + as_fn_error $? "conditional \"FORTRAN_2003_CONDITIONAL_F\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${FORTRAN_DEFAULT_REALisDBLE_F_TRUE}" && test -z "${FORTRAN_DEFAULT_REALisDBLE_F_FALSE}"; then + as_fn_error $? "conditional \"FORTRAN_DEFAULT_REALisDBLE_F\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then + as_fn_error $? "conditional \"am__fastdepCXX\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${FORTRAN_SHARED_CONDITIONAL_TRUE}" && test -z "${FORTRAN_SHARED_CONDITIONAL_FALSE}"; then + as_fn_error $? "conditional \"FORTRAN_SHARED_CONDITIONAL\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${CXX_SHARED_CONDITIONAL_TRUE}" && test -z "${CXX_SHARED_CONDITIONAL_FALSE}"; then + as_fn_error $? "conditional \"CXX_SHARED_CONDITIONAL\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi -# configure is writing to config.log, and then calls config.status. -# config.status does its own redirection, appending to config.log. -# Unfortunately, on DOS this fails, as config.log is still kept open -# by configure, so config.status won't be able to write to it; its -# output is simply discarded. So we exec the FD to /dev/null, -# effectively closing config.log, so it can be properly (re)opened and -# appended to by config.status. When coming back to configure, we -# need to make the FD available again. -if test "$no_create" != yes; then - ac_cs_success=: - ac_config_status_args= - test "$silent" = yes && - ac_config_status_args="$ac_config_status_args --quiet" - exec 5>/dev/null - $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false - exec 5>>config.log - # Use ||, not &&, to avoid exiting from the if with $? = 1, which - # would make configure fail if this is the last instruction. - $ac_cs_success || as_fn_exit 1 +if test -z "${BUILD_SHARED_SZIP_CONDITIONAL_TRUE}" && test -z "${BUILD_SHARED_SZIP_CONDITIONAL_FALSE}"; then + as_fn_error $? "conditional \"BUILD_SHARED_SZIP_CONDITIONAL\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi -if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 -$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} +if test -z "${DIRECT_VFD_CONDITIONAL_TRUE}" && test -z "${DIRECT_VFD_CONDITIONAL_FALSE}"; then + as_fn_error $? "conditional \"DIRECT_VFD_CONDITIONAL\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${BUILD_ALL_CONDITIONAL_TRUE}" && test -z "${BUILD_ALL_CONDITIONAL_FALSE}"; then + as_fn_error $? "conditional \"BUILD_ALL_CONDITIONAL\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${BUILD_CXX_CONDITIONAL_TRUE}" && test -z "${BUILD_CXX_CONDITIONAL_FALSE}"; then + as_fn_error $? "conditional \"BUILD_CXX_CONDITIONAL\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${BUILD_PARALLEL_CONDITIONAL_TRUE}" && test -z "${BUILD_PARALLEL_CONDITIONAL_FALSE}"; then + as_fn_error $? "conditional \"BUILD_PARALLEL_CONDITIONAL\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${BUILD_FORTRAN_CONDITIONAL_TRUE}" && test -z "${BUILD_FORTRAN_CONDITIONAL_FALSE}"; then + as_fn_error $? "conditional \"BUILD_FORTRAN_CONDITIONAL\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${BUILD_HDF5_HL_CONDITIONAL_TRUE}" && test -z "${BUILD_HDF5_HL_CONDITIONAL_FALSE}"; then + as_fn_error $? "conditional \"BUILD_HDF5_HL_CONDITIONAL\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HAVE_SHARED_CONDITIONAL_TRUE}" && test -z "${HAVE_SHARED_CONDITIONAL_FALSE}"; then + as_fn_error $? "conditional \"HAVE_SHARED_CONDITIONAL\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi -: ${CONFIG_LT=./config.lt} -{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_LT" >&5 -$as_echo "$as_me: creating $CONFIG_LT" >&6;} +: "${CONFIG_STATUS=./config.status}" +ac_write_fail=0 +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files $CONFIG_STATUS" +{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 +$as_echo "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 -cat >"$CONFIG_LT" <<_ASEOF || as_write_fail=1 +cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. -# Run this file to recreate a libtool stub with the current configuration. +# Run this file to recreate the current configuration. +# Compiler output produced by configure, useful for debugging +# configure, is in config.log if it exists. + +debug=false +ac_cs_recheck=false +ac_cs_silent=false + SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF -cat >>"$CONFIG_LT" <<\_ASEOF || as_write_fail=1 +cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## @@ -34641,71 +33750,203 @@ as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 -## --------------------------------- ## -## Main body of "$CONFIG_LT" script. ## -## --------------------------------- ## +## ----------------------------------- ## +## Main body of $CONFIG_STATUS script. ## +## ----------------------------------- ## _ASEOF -test $as_write_fail = 0 && chmod +x "$CONFIG_LT" +test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 -cat >>"$CONFIG_LT" <<\_LTEOF -lt_cl_silent=false -exec 5>>config.log -{ - echo - sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX -## Running $as_me. ## -_ASBOX -} >&5 +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# Save the log message, to keep $0 and so on meaningful, and to +# report actual input values of CONFIG_FILES etc. instead of their +# values after options handling. +ac_log=" +This file was extended by HDF5 $as_me 1.9.149, which was +generated by GNU Autoconf 2.69. Invocation command line was -lt_cl_help="\ -\`$as_me' creates a local libtool stub from the current configuration, -for use in further configure time tests before the real libtool is -generated. + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + $ $0 $@ -Usage: $0 [OPTIONS] +on `(hostname || uname -n) 2>/dev/null | sed 1q` +" - -h, --help print this help, then exit - -V, --version print version number, then exit - -q, --quiet do not print progress messages - -d, --debug don't remove temporary files +_ACEOF -Report bugs to ." +case $ac_config_files in *" +"*) set x $ac_config_files; shift; ac_config_files=$*;; +esac -lt_cl_version="\ -HDF5 config.lt 1.9.149 -configured by $0, generated by GNU Autoconf 2.69. +case $ac_config_headers in *" +"*) set x $ac_config_headers; shift; ac_config_headers=$*;; +esac -Copyright (C) 2011 Free Software Foundation, Inc. -This config.lt script is free software; the Free Software Foundation -gives unlimited permision to copy, distribute and modify it." +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# Files that config.status was made for. +config_files="$ac_config_files" +config_headers="$ac_config_headers" +config_commands="$ac_config_commands" + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +ac_cs_usage="\ +\`$as_me' instantiates files and other configuration actions +from templates according to the current configuration. Unless the files +and actions are specified as TAGs, all are instantiated by default. + +Usage: $0 [OPTION]... [TAG]... + + -h, --help print this help, then exit + -V, --version print version number and configuration settings, then exit + --config print configuration, then exit + -q, --quiet, --silent + do not print progress messages + -d, --debug don't remove temporary files + --recheck update $as_me by reconfiguring in the same conditions + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + --header=FILE[:TEMPLATE] + instantiate the configuration header FILE + +Configuration files: +$config_files + +Configuration headers: +$config_headers + +Configuration commands: +$config_commands + +Report bugs to ." + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" +ac_cs_version="\\ +HDF5 config.status 1.9.149 +configured by $0, generated by GNU Autoconf 2.69, + with options \\"\$ac_cs_config\\" + +Copyright (C) 2012 Free Software Foundation, Inc. +This config.status script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it." + +ac_pwd='$ac_pwd' +srcdir='$srcdir' +INSTALL='$INSTALL' +MKDIR_P='$MKDIR_P' +AWK='$AWK' +test -n "\$AWK" || AWK=awk +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# The default lists apply if the user does not specify any file. +ac_need_defaults=: while test $# != 0 do case $1 in - --version | --v* | -V ) - echo "$lt_cl_version"; exit 0 ;; - --help | --h* | -h ) - echo "$lt_cl_help"; exit 0 ;; - --debug | --d* | -d ) - debug=: ;; - --quiet | --q* | --silent | --s* | -q ) - lt_cl_silent=: ;; + --*=?*) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` + ac_shift=: + ;; + --*=) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg= + ac_shift=: + ;; + *) + ac_option=$1 + ac_optarg=$2 + ac_shift=shift + ;; + esac - -*) as_fn_error $? "unrecognized option: $1 -Try \`$0 --help' for more information." "$LINENO" 5 ;; + case $ac_option in + # Handling of the options. + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + ac_cs_recheck=: ;; + --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) + $as_echo "$ac_cs_version"; exit ;; + --config | --confi | --conf | --con | --co | --c ) + $as_echo "$ac_cs_config"; exit ;; + --debug | --debu | --deb | --de | --d | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + '') as_fn_error $? "missing file argument" ;; + esac + as_fn_append CONFIG_FILES " '$ac_optarg'" + ac_need_defaults=false;; + --header | --heade | --head | --hea ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + as_fn_append CONFIG_HEADERS " '$ac_optarg'" + ac_need_defaults=false;; + --he | --h) + # Conflict between --help and --header + as_fn_error $? "ambiguous option: \`$1' +Try \`$0 --help' for more information.";; + --help | --hel | -h ) + $as_echo "$ac_cs_usage"; exit ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil | --si | --s) + ac_cs_silent=: ;; + + # This is an error. + -*) as_fn_error $? "unrecognized option: \`$1' +Try \`$0 --help' for more information." ;; + + *) as_fn_append ac_config_targets " $1" + ac_need_defaults=false ;; - *) as_fn_error $? "unrecognized argument: $1 -Try \`$0 --help' for more information." "$LINENO" 5 ;; esac shift done -if $lt_cl_silent; then +ac_configure_extra_args= + +if $ac_cs_silent; then exec 6>/dev/null + ac_configure_extra_args="$ac_configure_extra_args --silent" fi -_LTEOF -cat >>"$CONFIG_LT" <<_LTEOF +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +if \$ac_cs_recheck; then + set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + shift + \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 + CONFIG_SHELL='$SHELL' + export CONFIG_SHELL + exec "\$@" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX + $as_echo "$ac_log" +} >&5 + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# +# INIT-COMMANDS +# +AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" # The HP-UX ksh and POSIX shell print the target directory to stdout @@ -35092,90 +34333,879 @@ compiler_lib_search_path_FC; do eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac -done +done + +# Double-quote double-evaled strings. +for var in reload_cmds \ +old_postinstall_cmds \ +old_postuninstall_cmds \ +old_archive_cmds \ +extract_expsyms_cmds \ +old_archive_from_new_cmds \ +old_archive_from_expsyms_cmds \ +archive_cmds \ +archive_expsym_cmds \ +module_cmds \ +module_expsym_cmds \ +export_symbols_cmds \ +prelink_cmds \ +postlink_cmds \ +postinstall_cmds \ +postuninstall_cmds \ +finish_cmds \ +sys_lib_search_path_spec \ +sys_lib_dlsearch_path_spec \ +reload_cmds_CXX \ +reload_cmds_FC \ +old_archive_cmds_CXX \ +old_archive_cmds_FC \ +old_archive_from_new_cmds_CXX \ +old_archive_from_new_cmds_FC \ +old_archive_from_expsyms_cmds_CXX \ +old_archive_from_expsyms_cmds_FC \ +archive_cmds_CXX \ +archive_cmds_FC \ +archive_expsym_cmds_CXX \ +archive_expsym_cmds_FC \ +module_cmds_CXX \ +module_cmds_FC \ +module_expsym_cmds_CXX \ +module_expsym_cmds_FC \ +export_symbols_cmds_CXX \ +export_symbols_cmds_FC \ +prelink_cmds_CXX \ +prelink_cmds_FC \ +postlink_cmds_CXX \ +postlink_cmds_FC; do + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in + *[\\\\\\\`\\"\\\$]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done + +ac_aux_dir='$ac_aux_dir' +xsi_shell='$xsi_shell' +lt_shell_append='$lt_shell_append' + +# See if we are running on zsh, and set the options which allow our +# commands through without removal of \ escapes INIT. +if test -n "\${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST +fi + + + PACKAGE='$PACKAGE' + VERSION='$VERSION' + TIMESTAMP='$TIMESTAMP' + RM='$RM' + ofile='$ofile' + + + + + +ac_aux_dir='$ac_aux_dir' + + + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + +# Handling of arguments. +for ac_config_target in $ac_config_targets +do + case $ac_config_target in + "src/H5config.h") CONFIG_HEADERS="$CONFIG_HEADERS src/H5config.h" ;; + "pubconf") CONFIG_COMMANDS="$CONFIG_COMMANDS pubconf" ;; + "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; + "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; + "src/libhdf5.settings") CONFIG_FILES="$CONFIG_FILES src/libhdf5.settings" ;; + "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; + "test/Makefile") CONFIG_FILES="$CONFIG_FILES test/Makefile" ;; + "test/testcheck_version.sh") CONFIG_FILES="$CONFIG_FILES test/testcheck_version.sh" ;; + "test/testerror.sh") CONFIG_FILES="$CONFIG_FILES test/testerror.sh" ;; + "test/H5srcdir_str.h") CONFIG_FILES="$CONFIG_FILES test/H5srcdir_str.h" ;; + "test/testlibinfo.sh") CONFIG_FILES="$CONFIG_FILES test/testlibinfo.sh" ;; + "test/testlinks_env.sh") CONFIG_FILES="$CONFIG_FILES test/testlinks_env.sh" ;; + "test/test_plugin.sh") CONFIG_FILES="$CONFIG_FILES test/test_plugin.sh" ;; + "testpar/Makefile") CONFIG_FILES="$CONFIG_FILES testpar/Makefile" ;; + "testpar/testph5.sh") CONFIG_FILES="$CONFIG_FILES testpar/testph5.sh" ;; + "perform/Makefile") CONFIG_FILES="$CONFIG_FILES perform/Makefile" ;; + "tools/Makefile") CONFIG_FILES="$CONFIG_FILES tools/Makefile" ;; + "tools/h5dump/Makefile") CONFIG_FILES="$CONFIG_FILES tools/h5dump/Makefile" ;; + "tools/h5dump/testh5dump.sh") CONFIG_FILES="$CONFIG_FILES tools/h5dump/testh5dump.sh" ;; + "tools/h5dump/testh5dumppbits.sh") CONFIG_FILES="$CONFIG_FILES tools/h5dump/testh5dumppbits.sh" ;; + "tools/h5dump/testh5dumpxml.sh") CONFIG_FILES="$CONFIG_FILES tools/h5dump/testh5dumpxml.sh" ;; + "tools/h5ls/testh5ls.sh") CONFIG_FILES="$CONFIG_FILES tools/h5ls/testh5ls.sh" ;; + "tools/h5import/Makefile") CONFIG_FILES="$CONFIG_FILES tools/h5import/Makefile" ;; + "tools/h5import/h5importtestutil.sh") CONFIG_FILES="$CONFIG_FILES tools/h5import/h5importtestutil.sh" ;; + "tools/h5diff/Makefile") CONFIG_FILES="$CONFIG_FILES tools/h5diff/Makefile" ;; + "tools/h5diff/testh5diff.sh") CONFIG_FILES="$CONFIG_FILES tools/h5diff/testh5diff.sh" ;; + "tools/h5diff/testph5diff.sh") CONFIG_FILES="$CONFIG_FILES tools/h5diff/testph5diff.sh" ;; + "tools/h5jam/Makefile") CONFIG_FILES="$CONFIG_FILES tools/h5jam/Makefile" ;; + "tools/h5jam/testh5jam.sh") CONFIG_FILES="$CONFIG_FILES tools/h5jam/testh5jam.sh" ;; + "tools/h5repack/Makefile") CONFIG_FILES="$CONFIG_FILES tools/h5repack/Makefile" ;; + "tools/h5repack/h5repack.sh") CONFIG_FILES="$CONFIG_FILES tools/h5repack/h5repack.sh" ;; + "tools/h5ls/Makefile") CONFIG_FILES="$CONFIG_FILES tools/h5ls/Makefile" ;; + "tools/h5copy/Makefile") CONFIG_FILES="$CONFIG_FILES tools/h5copy/Makefile" ;; + "tools/h5copy/testh5copy.sh") CONFIG_FILES="$CONFIG_FILES tools/h5copy/testh5copy.sh" ;; + "tools/lib/Makefile") CONFIG_FILES="$CONFIG_FILES tools/lib/Makefile" ;; + "tools/misc/Makefile") CONFIG_FILES="$CONFIG_FILES tools/misc/Makefile" ;; + "tools/misc/h5cc") CONFIG_FILES="$CONFIG_FILES tools/misc/h5cc" ;; + "tools/misc/testh5mkgrp.sh") CONFIG_FILES="$CONFIG_FILES tools/misc/testh5mkgrp.sh" ;; + "tools/misc/testh5repart.sh") CONFIG_FILES="$CONFIG_FILES tools/misc/testh5repart.sh" ;; + "tools/h5stat/testh5stat.sh") CONFIG_FILES="$CONFIG_FILES tools/h5stat/testh5stat.sh" ;; + "tools/h5stat/Makefile") CONFIG_FILES="$CONFIG_FILES tools/h5stat/Makefile" ;; + "examples/Makefile") CONFIG_FILES="$CONFIG_FILES examples/Makefile" ;; + "examples/run-c-ex.sh") CONFIG_FILES="$CONFIG_FILES examples/run-c-ex.sh" ;; + "examples/testh5cc.sh") CONFIG_FILES="$CONFIG_FILES examples/testh5cc.sh" ;; + "c++/Makefile") CONFIG_FILES="$CONFIG_FILES c++/Makefile" ;; + "c++/src/Makefile") CONFIG_FILES="$CONFIG_FILES c++/src/Makefile" ;; + "c++/src/h5c++") CONFIG_FILES="$CONFIG_FILES c++/src/h5c++" ;; + "c++/test/Makefile") CONFIG_FILES="$CONFIG_FILES c++/test/Makefile" ;; + "c++/test/H5srcdir_str.h") CONFIG_FILES="$CONFIG_FILES c++/test/H5srcdir_str.h" ;; + "c++/examples/Makefile") CONFIG_FILES="$CONFIG_FILES c++/examples/Makefile" ;; + "c++/examples/run-c++-ex.sh") CONFIG_FILES="$CONFIG_FILES c++/examples/run-c++-ex.sh" ;; + "c++/examples/testh5c++.sh") CONFIG_FILES="$CONFIG_FILES c++/examples/testh5c++.sh" ;; + "fortran/Makefile") CONFIG_FILES="$CONFIG_FILES fortran/Makefile" ;; + "fortran/src/h5fc") CONFIG_FILES="$CONFIG_FILES fortran/src/h5fc" ;; + "fortran/src/Makefile") CONFIG_FILES="$CONFIG_FILES fortran/src/Makefile" ;; + "fortran/test/Makefile") CONFIG_FILES="$CONFIG_FILES fortran/test/Makefile" ;; + "fortran/testpar/Makefile") CONFIG_FILES="$CONFIG_FILES fortran/testpar/Makefile" ;; + "fortran/examples/Makefile") CONFIG_FILES="$CONFIG_FILES fortran/examples/Makefile" ;; + "fortran/examples/run-fortran-ex.sh") CONFIG_FILES="$CONFIG_FILES fortran/examples/run-fortran-ex.sh" ;; + "fortran/examples/testh5fc.sh") CONFIG_FILES="$CONFIG_FILES fortran/examples/testh5fc.sh" ;; + "hl/Makefile") CONFIG_FILES="$CONFIG_FILES hl/Makefile" ;; + "hl/src/Makefile") CONFIG_FILES="$CONFIG_FILES hl/src/Makefile" ;; + "hl/test/Makefile") CONFIG_FILES="$CONFIG_FILES hl/test/Makefile" ;; + "hl/test/H5srcdir_str.h") CONFIG_FILES="$CONFIG_FILES hl/test/H5srcdir_str.h" ;; + "hl/tools/Makefile") CONFIG_FILES="$CONFIG_FILES hl/tools/Makefile" ;; + "hl/tools/gif2h5/Makefile") CONFIG_FILES="$CONFIG_FILES hl/tools/gif2h5/Makefile" ;; + "hl/tools/gif2h5/h52giftest.sh") CONFIG_FILES="$CONFIG_FILES hl/tools/gif2h5/h52giftest.sh" ;; + "hl/examples/Makefile") CONFIG_FILES="$CONFIG_FILES hl/examples/Makefile" ;; + "hl/examples/run-hlc-ex.sh") CONFIG_FILES="$CONFIG_FILES hl/examples/run-hlc-ex.sh" ;; + "hl/c++/Makefile") CONFIG_FILES="$CONFIG_FILES hl/c++/Makefile" ;; + "hl/c++/src/Makefile") CONFIG_FILES="$CONFIG_FILES hl/c++/src/Makefile" ;; + "hl/c++/test/Makefile") CONFIG_FILES="$CONFIG_FILES hl/c++/test/Makefile" ;; + "hl/c++/examples/Makefile") CONFIG_FILES="$CONFIG_FILES hl/c++/examples/Makefile" ;; + "hl/c++/examples/run-hlc++-ex.sh") CONFIG_FILES="$CONFIG_FILES hl/c++/examples/run-hlc++-ex.sh" ;; + "hl/fortran/Makefile") CONFIG_FILES="$CONFIG_FILES hl/fortran/Makefile" ;; + "hl/fortran/src/Makefile") CONFIG_FILES="$CONFIG_FILES hl/fortran/src/Makefile" ;; + "hl/fortran/test/Makefile") CONFIG_FILES="$CONFIG_FILES hl/fortran/test/Makefile" ;; + "hl/fortran/examples/Makefile") CONFIG_FILES="$CONFIG_FILES hl/fortran/examples/Makefile" ;; + "hl/fortran/examples/run-hlfortran-ex.sh") CONFIG_FILES="$CONFIG_FILES hl/fortran/examples/run-hlfortran-ex.sh" ;; + + *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; + esac +done + + +# If the user did not use the arguments to specify the items to instantiate, +# then the envvar interface is used. Set only those that are not. +# We use the long form for the default assignment because of an extremely +# bizarre bug on SunOS 4.1.3. +if $ac_need_defaults; then + test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files + test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers + test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands +fi + +# Have a temporary directory for convenience. Make it in the build tree +# simply because there is no reason against having it here, and in addition, +# creating and moving files from /tmp can sometimes cause problems. +# Hook for its removal unless debugging. +# Note that there is a small window in which the directory will not be cleaned: +# after its creation but before its name has been assigned to `$tmp'. +$debug || +{ + tmp= ac_tmp= + trap 'exit_status=$? + : "${ac_tmp:=$tmp}" + { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status +' 0 + trap 'as_fn_exit 1' 1 2 13 15 +} +# Create a (secure) tmp directory for tmp files. + +{ + tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && + test -d "$tmp" +} || +{ + tmp=./conf$$-$RANDOM + (umask 077 && mkdir "$tmp") +} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 +ac_tmp=$tmp + +# Set up the scripts for CONFIG_FILES section. +# No need to generate them if there are no CONFIG_FILES. +# This happens for instance with `./config.status config.h'. +if test -n "$CONFIG_FILES"; then + + +ac_cr=`echo X | tr X '\015'` +# On cygwin, bash can eat \r inside `` if the user requested igncr. +# But we know of no other shell where ac_cr would be empty at this +# point, so we can use a bashism as a fallback. +if test "x$ac_cr" = x; then + eval ac_cr=\$\'\\r\' +fi +ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` +if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then + ac_cs_awk_cr='\\r' +else + ac_cs_awk_cr=$ac_cr +fi + +echo 'BEGIN {' >"$ac_tmp/subs1.awk" && +_ACEOF + + +{ + echo "cat >conf$$subs.awk <<_ACEOF" && + echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && + echo "_ACEOF" +} >conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 +ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` +ac_delim='%!_!# ' +for ac_last_try in false false false false false :; do + . ./conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + + ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` + if test $ac_delim_n = $ac_delim_num; then + break + elif $ac_last_try; then + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done +rm -f conf$$subs.sh + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && +_ACEOF +sed -n ' +h +s/^/S["/; s/!.*/"]=/ +p +g +s/^[^!]*!// +:repl +t repl +s/'"$ac_delim"'$// +t delim +:nl +h +s/\(.\{148\}\)..*/\1/ +t more1 +s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ +p +n +b repl +:more1 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t nl +:delim +h +s/\(.\{148\}\)..*/\1/ +t more2 +s/["\\]/\\&/g; s/^/"/; s/$/"/ +p +b +:more2 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t delim +' >$CONFIG_STATUS || ac_write_fail=1 +rm -f conf$$subs.awk +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +_ACAWK +cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && + for (key in S) S_is_set[key] = 1 + FS = "" + +} +{ + line = $ 0 + nfields = split(line, field, "@") + substed = 0 + len = length(field[1]) + for (i = 2; i < nfields; i++) { + key = field[i] + keylen = length(key) + if (S_is_set[key]) { + value = S[key] + line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) + len += length(value) + length(field[++i]) + substed = 1 + } else + len += 1 + keylen + } + + print line +} + +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then + sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" +else + cat +fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ + || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 +_ACEOF + +# VPATH may cause trouble with some makes, so we remove sole $(srcdir), +# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ +h +s/// +s/^/:/ +s/[ ]*$/:/ +s/:\$(srcdir):/:/g +s/:\${srcdir}:/:/g +s/:@srcdir@:/:/g +s/^:*// +s/:*$// +x +s/\(=[ ]*\).*/\1/ +G +s/\n// +s/^[^=]*=[ ]*$// +}' +fi + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +fi # test -n "$CONFIG_FILES" + +# Set up the scripts for CONFIG_HEADERS section. +# No need to generate them if there are no CONFIG_HEADERS. +# This happens for instance with `./config.status Makefile'. +if test -n "$CONFIG_HEADERS"; then +cat >"$ac_tmp/defines.awk" <<\_ACAWK || +BEGIN { +_ACEOF + +# Transform confdefs.h into an awk script `defines.awk', embedded as +# here-document in config.status, that substitutes the proper values into +# config.h.in to produce config.h. + +# Create a delimiter string that does not exist in confdefs.h, to ease +# handling of long lines. +ac_delim='%!_!# ' +for ac_last_try in false false :; do + ac_tt=`sed -n "/$ac_delim/p" confdefs.h` + if test -z "$ac_tt"; then + break + elif $ac_last_try; then + as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done + +# For the awk script, D is an array of macro values keyed by name, +# likewise P contains macro parameters if any. Preserve backslash +# newline sequences. + +ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* +sed -n ' +s/.\{148\}/&'"$ac_delim"'/g +t rset +:rset +s/^[ ]*#[ ]*define[ ][ ]*/ / +t def +d +:def +s/\\$// +t bsnl +s/["\\]/\\&/g +s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ +D["\1"]=" \3"/p +s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p +d +:bsnl +s/["\\]/\\&/g +s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ +D["\1"]=" \3\\\\\\n"\\/p +t cont +s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p +t cont +d +:cont +n +s/.\{148\}/&'"$ac_delim"'/g +t clear +:clear +s/\\$// +t bsnlc +s/["\\]/\\&/g; s/^/"/; s/$/"/p +d +:bsnlc +s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p +b cont +' >$CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + for (key in D) D_is_set[key] = 1 + FS = "" +} +/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { + line = \$ 0 + split(line, arg, " ") + if (arg[1] == "#") { + defundef = arg[2] + mac1 = arg[3] + } else { + defundef = substr(arg[1], 2) + mac1 = arg[2] + } + split(mac1, mac2, "(") #) + macro = mac2[1] + prefix = substr(line, 1, index(line, defundef) - 1) + if (D_is_set[macro]) { + # Preserve the white space surrounding the "#". + print prefix "define", macro P[macro] D[macro] + next + } else { + # Replace #undef with comments. This is necessary, for example, + # in the case of _POSIX_SOURCE, which is predefined and required + # on some systems where configure will not decide to define it. + if (defundef == "undef") { + print "/*", prefix defundef, macro, "*/" + next + } + } +} +{ print } +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 +fi # test -n "$CONFIG_HEADERS" + + +eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" +shift +for ac_tag +do + case $ac_tag in + :[FHLC]) ac_mode=$ac_tag; continue;; + esac + case $ac_mode$ac_tag in + :[FHL]*:*);; + :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; + :[FH]-) ac_tag=-:-;; + :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; + esac + ac_save_IFS=$IFS + IFS=: + set x $ac_tag + IFS=$ac_save_IFS + shift + ac_file=$1 + shift + + case $ac_mode in + :L) ac_source=$1;; + :[FH]) + ac_file_inputs= + for ac_f + do + case $ac_f in + -) ac_f="$ac_tmp/stdin";; + *) # Look for the file first in the build tree, then in the source tree + # (if the path is not absolute). The absolute path cannot be DOS-style, + # because $ac_f cannot contain `:'. + test -f "$ac_f" || + case $ac_f in + [\\/$]*) false;; + *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; + esac || + as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; + esac + case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac + as_fn_append ac_file_inputs " '$ac_f'" + done + + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + configure_input='Generated from '` + $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' + `' by configure.' + if test x"$ac_file" != x-; then + configure_input="$ac_file. $configure_input" + { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 +$as_echo "$as_me: creating $ac_file" >&6;} + fi + # Neutralize special characters interpreted by sed in replacement strings. + case $configure_input in #( + *\&* | *\|* | *\\* ) + ac_sed_conf_input=`$as_echo "$configure_input" | + sed 's/[\\\\&|]/\\\\&/g'`;; #( + *) ac_sed_conf_input=$configure_input;; + esac -# Double-quote double-evaled strings. -for var in reload_cmds \ -old_postinstall_cmds \ -old_postuninstall_cmds \ -old_archive_cmds \ -extract_expsyms_cmds \ -old_archive_from_new_cmds \ -old_archive_from_expsyms_cmds \ -archive_cmds \ -archive_expsym_cmds \ -module_cmds \ -module_expsym_cmds \ -export_symbols_cmds \ -prelink_cmds \ -postlink_cmds \ -postinstall_cmds \ -postuninstall_cmds \ -finish_cmds \ -sys_lib_search_path_spec \ -sys_lib_dlsearch_path_spec \ -reload_cmds_CXX \ -reload_cmds_FC \ -old_archive_cmds_CXX \ -old_archive_cmds_FC \ -old_archive_from_new_cmds_CXX \ -old_archive_from_new_cmds_FC \ -old_archive_from_expsyms_cmds_CXX \ -old_archive_from_expsyms_cmds_FC \ -archive_cmds_CXX \ -archive_cmds_FC \ -archive_expsym_cmds_CXX \ -archive_expsym_cmds_FC \ -module_cmds_CXX \ -module_cmds_FC \ -module_expsym_cmds_CXX \ -module_expsym_cmds_FC \ -export_symbols_cmds_CXX \ -export_symbols_cmds_FC \ -prelink_cmds_CXX \ -prelink_cmds_FC \ -postlink_cmds_CXX \ -postlink_cmds_FC; do - case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in - *[\\\\\\\`\\"\\\$]*) - eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" - ;; - *) - eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" - ;; + case $ac_tag in + *:-:* | *:-) cat >"$ac_tmp/stdin" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac -done + ;; + esac -ac_aux_dir='$ac_aux_dir' -xsi_shell='$xsi_shell' -lt_shell_append='$lt_shell_append' + ac_dir=`$as_dirname -- "$ac_file" || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + as_dir="$ac_dir"; as_fn_mkdir_p + ac_builddir=. -# See if we are running on zsh, and set the options which allow our -# commands through without removal of \ escapes INIT. -if test -n "\${ZSH_VERSION+set}" ; then - setopt NO_GLOB_SUBST -fi +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix - PACKAGE='$PACKAGE' - VERSION='$VERSION' - TIMESTAMP='$TIMESTAMP' - RM='$RM' - ofile='$ofile' + case $ac_mode in + :F) + # + # CONFIG_FILE + # + case $INSTALL in + [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; + *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; + esac + ac_MKDIR_P=$MKDIR_P + case $MKDIR_P in + [\\/$]* | ?:[\\/]* ) ;; + */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; + esac +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# If the template does not know about datarootdir, expand it. +# FIXME: This hack should be removed a few years after 2.60. +ac_datarootdir_hack=; ac_datarootdir_seen= +ac_sed_dataroot=' +/datarootdir/ { + p + q +} +/@datadir@/p +/@docdir@/p +/@infodir@/p +/@localedir@/p +/@mandir@/p' +case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in +*datarootdir*) ac_datarootdir_seen=yes;; +*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + ac_datarootdir_hack=' + s&@datadir@&$datadir&g + s&@docdir@&$docdir&g + s&@infodir@&$infodir&g + s&@localedir@&$localedir&g + s&@mandir@&$mandir&g + s&\\\${datarootdir}&$datarootdir&g' ;; +esac +_ACEOF +# Neutralize VPATH when `$srcdir' = `.'. +# Shell code in configure.ac might set extrasub. +# FIXME: do we really want to maintain this feature? +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_sed_extra="$ac_vpsub +$extrasub +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s|@configure_input@|$ac_sed_conf_input|;t t +s&@top_builddir@&$ac_top_builddir_sub&;t t +s&@top_build_prefix@&$ac_top_build_prefix&;t t +s&@srcdir@&$ac_srcdir&;t t +s&@abs_srcdir@&$ac_abs_srcdir&;t t +s&@top_srcdir@&$ac_top_srcdir&;t t +s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t +s&@builddir@&$ac_builddir&;t t +s&@abs_builddir@&$ac_abs_builddir&;t t +s&@abs_top_builddir@&$ac_abs_top_builddir&;t t +s&@INSTALL@&$ac_INSTALL&;t t +s&@MKDIR_P@&$ac_MKDIR_P&;t t +$ac_datarootdir_hack +" +eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ + >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 -ac_aux_dir='$ac_aux_dir' +test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && + { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ + "$ac_tmp/out"`; test -z "$ac_out"; } && + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&5 +$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&2;} + rm -f "$ac_tmp/stdin" + case $ac_file in + -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; + *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; + esac \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + ;; + :H) + # + # CONFIG_HEADER + # + if test x"$ac_file" != x-; then + { + $as_echo "/* $configure_input */" \ + && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" + } >"$ac_tmp/config.h" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then + { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 +$as_echo "$as_me: $ac_file is unchanged" >&6;} + else + rm -f "$ac_file" + mv "$ac_tmp/config.h" "$ac_file" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + fi + else + $as_echo "/* $configure_input */" \ + && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ + || as_fn_error $? "could not create -" "$LINENO" 5 + fi +# Compute "$ac_file"'s index in $config_headers. +_am_arg="$ac_file" +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $_am_arg | $_am_arg:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || +$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$_am_arg" : 'X\(//\)[^/]' \| \ + X"$_am_arg" : 'X\(//\)$' \| \ + X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$_am_arg" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'`/stamp-h$_am_stamp_count + ;; -_LTEOF + :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 +$as_echo "$as_me: executing $ac_file commands" >&6;} + ;; + esac -cat >>"$CONFIG_LT" <<\_LTEOF -{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $ofile" >&5 -$as_echo "$as_me: creating $ofile" >&6;} + case $ac_file$ac_mode in + "pubconf":C) + echo "creating src/H5pubconf.h" + sed 's/#define /#define H5_/' pubconf + if test ! -f src/H5pubconf.h; then + /bin/mv -f pubconf src/H5pubconf.h + elif (diff pubconf src/H5pubconf.h >/dev/null); then + rm -f pubconf + echo "src/H5pubconf.h is unchanged" + else + /bin/mv -f pubconf src/H5pubconf.h + fi + echo "Post process src/libhdf5.settings" + sed '/^#/d' < src/libhdf5.settings > libhdf5.settings.TMP + cp libhdf5.settings.TMP src/libhdf5.settings + rm -f libhdf5.settings.TMP + ;; + "depfiles":C) test x"$AMDEP_TRUE" != x"" || { + # Autoconf 2.62 quotes --file arguments for eval, but not when files + # are listed without --file. Let's play safe and only enable the eval + # if we detect the quoting. + case $CONFIG_FILES in + *\'*) eval set x "$CONFIG_FILES" ;; + *) set x $CONFIG_FILES ;; + esac + shift + for mf + do + # Strip MF so we end up with the name of the file. + mf=`echo "$mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile or not. + # We used to match only the files named 'Makefile.in', but + # some people rename them; so instead we look at the file content. + # Grep'ing the first line is not enough: some people post-process + # each Makefile.in and add a new line on top of each file to say so. + # Grep'ing the whole file is not good either: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then + dirpart=`$as_dirname -- "$mf" || +$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$mf" : 'X\(//\)[^/]' \| \ + X"$mf" : 'X\(//\)$' \| \ + X"$mf" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$mf" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + else + continue + fi + # Extract the definition of DEPDIR, am__include, and am__quote + # from the Makefile without running 'make'. + DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` + test -z "$DEPDIR" && continue + am__include=`sed -n 's/^am__include = //p' < "$mf"` + test -z "am__include" && continue + am__quote=`sed -n 's/^am__quote = //p' < "$mf"` + # Find all dependency output files, they are included files with + # $(DEPDIR) in their names. We invoke sed twice because it is the + # simplest approach to changing $(DEPDIR) to its actual value in the + # expansion. + for file in `sed -n " + s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`$as_dirname -- "$file" || +$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$file" : 'X\(//\)[^/]' \| \ + X"$file" : 'X\(//\)$' \| \ + X"$file" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + as_dir=$dirpart/$fdir; as_fn_mkdir_p + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done + done +} + ;; + "libtool":C) # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes. @@ -36127,75 +36157,45 @@ compiler_lib_search_path=$lt_compiler_lib_search_path_FC # ### END LIBTOOL TAG CONFIG: FC _LT_EOF + ;; -as_fn_exit 0 -_LTEOF -chmod +x "$CONFIG_LT" - -# configure is writing to config.log, but config.lt does its own redirection, -# appending to config.log, which fails on DOS, as config.log is still kept -# open by configure. Here we exec the FD to /dev/null, effectively closing -# config.log, so it can be properly (re)opened and appended to by config.lt. -lt_cl_success=: -test "$silent" = yes && - lt_config_lt_args="$lt_config_lt_args --quiet" -exec 5>/dev/null -$SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false -exec 5>>config.log -$lt_cl_success || as_fn_exit 1 + esac +done # for ac_tag -no_create=$saved_no_create -## Then the stamp2 file for H5config.h -touch ./config/stamp2 +as_fn_exit 0 +_ACEOF +ac_clean_files=$ac_clean_files_save -## Finally the makefiles -test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 +test $ac_write_fail = 0 || + as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 -## Post processing to patch up some deficiencies in libtool -case $host_os in - linux* | freebsd* ) - ## If gcc is not used, need to set $wl to use "-Wl," - if $CC -v 2>&1 | grep '^gcc' > /dev/null ; then - : using gcc - else - echo 'fixing $wl in' $ofile -ed - $ofile < /dev/null -g/^wl=""/s//wl="-Wl,"/ -w -q -EOF - fi - ;; -esac -## Are we compiling static libraries, shared libraries, or both? This -## is only used for the libhdf5.settings file. We can't just look at -## $enable_static and $enable_shared because if they're yes the ltconfig -## might have decided that one or the other is simply not possible. -## Therefore we have to ask the generated `libtool' shell script -## which 'features' it has enabled. -if (./libtool --features | grep '^enable shared libraries' > /dev/null); then - enable_shared=yes -else - enable_shared=no +# configure is writing to config.log, and then calls config.status. +# config.status does its own redirection, appending to config.log. +# Unfortunately, on DOS this fails, as config.log is still kept open +# by configure, so config.status won't be able to write to it; its +# output is simply discarded. So we exec the FD to /dev/null, +# effectively closing config.log, so it can be properly (re)opened and +# appended to by config.status. When coming back to configure, we +# need to make the FD available again. +if test "$no_create" != yes; then + ac_cs_success=: + ac_config_status_args= + test "$silent" = yes && + ac_config_status_args="$ac_config_status_args --quiet" + exec 5>/dev/null + $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false + exec 5>>config.log + # Use ||, not &&, to avoid exiting from the if with $? = 1, which + # would make configure fail if this is the last instruction. + $ac_cs_success || as_fn_exit 1 fi - -if (./libtool --features | grep '^enable static libraries' > /dev/null); then - enable_static=yes -else - enable_static=no +if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 +$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi -if test "X$enable_static" = "Xyes" && test "X$enable_shared" = "Xyes"; then - STATIC_SHARED="static, shared" -elif test "X$enable_static" = "Xyes"; then - STATIC_SHARED="static" -elif test "X$enable_shared" = "Xyes"; then - STATIC_SHARED="shared" -else - STATIC_SHARED="none" -fi chmod 755 tools/misc/h5cc diff --git a/test/Makefile.am b/test/Makefile.am index 62b309d..61f1ed5 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -78,12 +78,16 @@ endif if HAVE_SHARED_CONDITIONAL # The libh5test library provides common support code for the tests. - noinst_LTLIBRARIES=libh5test.la libdynlib1.la + noinst_LTLIBRARIES=libh5test.la # The libdynlib1 library for testing plugin module plugin.c. # Build it as shared library if configure is enabled for shared library. + lib_LTLIBRARIES=libdynlib1.la libdynlib1_la_SOURCES=dynlib1.c - libdynlib1_la_LDFLAGS=-rpath /tmp + +install-data-local: + $(RM) $(DESTDIR)$(libdir)/*dynlib1* + else # The libh5test library provides common support code for the tests. noinst_LTLIBRARIES=libh5test.la diff --git a/test/Makefile.in b/test/Makefile.in index 2864a56..958ec33 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -75,20 +75,14 @@ DIST_COMMON = $(srcdir)/H5srcdir_str.h.in $(srcdir)/Makefile.am \ $(top_srcdir)/bin/depcomp $(top_srcdir)/bin/mkinstalldirs \ $(top_srcdir)/config/commence.am \ $(top_srcdir)/config/conclude.am COPYING -@HAVE_SHARED_CONDITIONAL_FALSE@check_PROGRAMS = $(am__EXEEXT_1) \ -@HAVE_SHARED_CONDITIONAL_FALSE@ error_test$(EXEEXT) \ -@HAVE_SHARED_CONDITIONAL_FALSE@ err_compat$(EXEEXT) \ -@HAVE_SHARED_CONDITIONAL_FALSE@ tcheck_version$(EXEEXT) \ -@HAVE_SHARED_CONDITIONAL_FALSE@ testmeta$(EXEEXT) \ -@HAVE_SHARED_CONDITIONAL_FALSE@ links_env$(EXEEXT) -@HAVE_SHARED_CONDITIONAL_TRUE@check_PROGRAMS = $(am__EXEEXT_1) \ -@HAVE_SHARED_CONDITIONAL_TRUE@ error_test$(EXEEXT) \ -@HAVE_SHARED_CONDITIONAL_TRUE@ err_compat$(EXEEXT) \ -@HAVE_SHARED_CONDITIONAL_TRUE@ tcheck_version$(EXEEXT) \ -@HAVE_SHARED_CONDITIONAL_TRUE@ testmeta$(EXEEXT) \ -@HAVE_SHARED_CONDITIONAL_TRUE@ links_env$(EXEEXT) \ -@HAVE_SHARED_CONDITIONAL_TRUE@ plugin$(EXEEXT) -@BUILD_ALL_CONDITIONAL_TRUE@noinst_PROGRAMS = $(am__EXEEXT_2) +@HAVE_SHARED_CONDITIONAL_TRUE@am__append_1 = test_plugin.sh +@HAVE_SHARED_CONDITIONAL_TRUE@am__append_2 = plugin$(EXEEXT) +check_PROGRAMS = $(am__EXEEXT_1) error_test$(EXEEXT) \ + err_compat$(EXEEXT) tcheck_version$(EXEEXT) testmeta$(EXEEXT) \ + links_env$(EXEEXT) $(am__EXEEXT_2) +@HAVE_SHARED_CONDITIONAL_TRUE@am__append_3 = plugin +@BUILD_ALL_CONDITIONAL_TRUE@noinst_PROGRAMS = $(am__EXEEXT_3) +@DIRECT_VFD_CONDITIONAL_TRUE@am__append_4 = direct TESTS = $(am__EXEEXT_1) $(TEST_SCRIPT) subdir = test ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 @@ -100,7 +94,35 @@ CONFIG_HEADER = $(top_builddir)/src/H5config.h CONFIG_CLEAN_FILES = testcheck_version.sh testerror.sh H5srcdir_str.h \ testlibinfo.sh testlinks_env.sh test_plugin.sh CONFIG_CLEAN_VPATH_FILES = -LTLIBRARIES = $(noinst_LTLIBRARIES) +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +am__installdirs = "$(DESTDIR)$(libdir)" +LTLIBRARIES = $(lib_LTLIBRARIES) $(noinst_LTLIBRARIES) libdynlib1_la_LIBADD = am__libdynlib1_la_SOURCES_DIST = dynlib1.c @HAVE_SHARED_CONDITIONAL_TRUE@am_libdynlib1_la_OBJECTS = dynlib1.lo @@ -109,10 +131,8 @@ AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = -libdynlib1_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(libdynlib1_la_LDFLAGS) $(LDFLAGS) -o $@ -@HAVE_SHARED_CONDITIONAL_TRUE@am_libdynlib1_la_rpath = +@HAVE_SHARED_CONDITIONAL_TRUE@am_libdynlib1_la_rpath = -rpath \ +@HAVE_SHARED_CONDITIONAL_TRUE@ $(libdir) libh5test_la_LIBADD = am_libh5test_la_OBJECTS = h5test.lo testframe.lo cache_common.lo libh5test_la_OBJECTS = $(am_libh5test_la_OBJECTS) @@ -134,7 +154,8 @@ am__EXEEXT_1 = testhdf5$(EXEEXT) lheap$(EXEEXT) ohdr$(EXEEXT) \ dtransform$(EXEEXT) reserved$(EXEEXT) cross_read$(EXEEXT) \ freespace$(EXEEXT) mf$(EXEEXT) farray$(EXEEXT) earray$(EXEEXT) \ btree2$(EXEEXT) fheap$(EXEEXT) file_image$(EXEEXT) -am__EXEEXT_2 = gen_bad_ohdr$(EXEEXT) gen_bogus$(EXEEXT) \ +@HAVE_SHARED_CONDITIONAL_TRUE@am__EXEEXT_2 = plugin$(EXEEXT) +am__EXEEXT_3 = gen_bad_ohdr$(EXEEXT) gen_bogus$(EXEEXT) \ gen_cross$(EXEEXT) gen_deflate$(EXEEXT) gen_filters$(EXEEXT) \ gen_new_array$(EXEEXT) gen_new_fill$(EXEEXT) \ gen_new_group$(EXEEXT) gen_new_mtime$(EXEEXT) \ @@ -845,12 +866,12 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog accum.h5 cmpd_dset.h5 \ new_multi_file_v16-s.h5 split_get_file_image_test-m.h5 \ split_get_file_image_test-r.h5 file_image_core_test.h5.copy INCLUDES = -I$(top_srcdir)/src -I$(top_builddir)/src -@HAVE_SHARED_CONDITIONAL_FALSE@TEST_SCRIPT = testerror.sh testlibinfo.sh testcheck_version.sh testlinks_env.sh # Test script for error_test and err_compat -@HAVE_SHARED_CONDITIONAL_TRUE@TEST_SCRIPT = testerror.sh testlibinfo.sh testcheck_version.sh testlinks_env.sh test_plugin.sh -@HAVE_SHARED_CONDITIONAL_FALSE@SCRIPT_DEPEND = error_test$(EXEEXT) err_compat$(EXEEXT) links_env$(EXEEXT) -@HAVE_SHARED_CONDITIONAL_TRUE@SCRIPT_DEPEND = error_test$(EXEEXT) err_compat$(EXEEXT) links_env$(EXEEXT) plugin$(EXEEXT) +TEST_SCRIPT = testerror.sh testlibinfo.sh testcheck_version.sh \ + testlinks_env.sh $(am__append_1) +SCRIPT_DEPEND = error_test$(EXEEXT) err_compat$(EXEEXT) \ + links_env$(EXEEXT) $(am__append_2) check_SCRIPTS = $(TEST_SCRIPT) # These are our main targets. They should be listed in the order to be @@ -882,9 +903,9 @@ BUILD_ALL_PROGS = gen_bad_ohdr gen_bogus gen_cross gen_deflate gen_filters gen_n gen_sizes_lheap gen_file_image gen_plist @HAVE_SHARED_CONDITIONAL_FALSE@noinst_LTLIBRARIES = libh5test.la -@HAVE_SHARED_CONDITIONAL_TRUE@noinst_LTLIBRARIES = libh5test.la libdynlib1.la +@HAVE_SHARED_CONDITIONAL_TRUE@noinst_LTLIBRARIES = libh5test.la +@HAVE_SHARED_CONDITIONAL_TRUE@lib_LTLIBRARIES = libdynlib1.la @HAVE_SHARED_CONDITIONAL_TRUE@libdynlib1_la_SOURCES = dynlib1.c -@HAVE_SHARED_CONDITIONAL_TRUE@libdynlib1_la_LDFLAGS = -rpath /tmp libh5test_la_SOURCES = h5test.c testframe.c cache_common.c # Use libhd5test.la to compile all of the tests @@ -894,8 +915,7 @@ LDADD = libh5test.la $(LIBHDF5) ttsafe_SOURCES = ttsafe.c ttsafe_dcreate.c ttsafe_error.c ttsafe_cancel.c \ ttsafe_acreate.c -@DIRECT_VFD_CONDITIONAL_FALSE@VFD_LIST = sec2 stdio core split multi family -@DIRECT_VFD_CONDITIONAL_TRUE@VFD_LIST = sec2 stdio core split multi family direct +VFD_LIST = sec2 stdio core split multi family $(am__append_4) # Sources for testhdf5 executable testhdf5_SOURCES = testhdf5.c tarray.c tattr.c tchecksum.c tconfig.c tfile.c \ @@ -973,6 +993,40 @@ testlinks_env.sh: $(top_builddir)/config.status $(srcdir)/testlinks_env.sh.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ test_plugin.sh: $(top_builddir)/config.status $(srcdir)/test_plugin.sh.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ +install-libLTLIBRARIES: $(lib_LTLIBRARIES) + @$(NORMAL_INSTALL) + @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ + list2=; for p in $$list; do \ + if test -f $$p; then \ + list2="$$list2 $$p"; \ + else :; fi; \ + done; \ + test -z "$$list2" || { \ + echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ + } + +uninstall-libLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ + for p in $$list; do \ + $(am__strip_dir) \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ + done + +clean-libLTLIBRARIES: + -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) + @list='$(lib_LTLIBRARIES)'; \ + locs=`for p in $$list; do echo $$p; done | \ + sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ + sort -u`; \ + test -z "$$locs" || { \ + echo rm -f $${locs}; \ + rm -f $${locs}; \ + } clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @@ -985,7 +1039,7 @@ clean-noinstLTLIBRARIES: rm -f $${locs}; \ } libdynlib1.la: $(libdynlib1_la_OBJECTS) $(libdynlib1_la_DEPENDENCIES) $(EXTRA_libdynlib1_la_DEPENDENCIES) - $(AM_V_CCLD)$(libdynlib1_la_LINK) $(am_libdynlib1_la_rpath) $(libdynlib1_la_OBJECTS) $(libdynlib1_la_LIBADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(am_libdynlib1_la_rpath) $(libdynlib1_la_OBJECTS) $(libdynlib1_la_LIBADD) $(LIBS) libh5test.la: $(libh5test_la_OBJECTS) $(libh5test_la_DEPENDENCIES) $(EXTRA_libh5test_la_DEPENDENCIES) $(AM_V_CCLD)$(LINK) $(am_libh5test_la_rpath) $(libh5test_la_OBJECTS) $(libh5test_la_LIBADD) $(LIBS) @@ -1475,6 +1529,9 @@ check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) all-local installdirs: + for dir in "$(DESTDIR)$(libdir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done install: install-am install-exec: install-exec-am install-data: install-data-am @@ -1506,10 +1563,12 @@ distclean-generic: maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." +@HAVE_SHARED_CONDITIONAL_FALSE@install-data-local: clean: clean-am -clean-am: clean-checkPROGRAMS clean-generic clean-libtool \ - clean-noinstLTLIBRARIES clean-noinstPROGRAMS mostlyclean-am +clean-am: clean-checkPROGRAMS clean-generic clean-libLTLIBRARIES \ + clean-libtool clean-noinstLTLIBRARIES clean-noinstPROGRAMS \ + mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) @@ -1529,13 +1588,13 @@ info: info-am info-am: -install-data-am: +install-data-am: install-data-local install-dvi: install-dvi-am install-dvi-am: -install-exec-am: +install-exec-am: install-libLTLIBRARIES install-html: install-html-am @@ -1575,24 +1634,25 @@ ps: ps-am ps-am: -uninstall-am: +uninstall-am: uninstall-libLTLIBRARIES .MAKE: check-am install-am install-strip .PHONY: CTAGS GTAGS all all-am all-local check check-TESTS check-am \ - clean clean-checkPROGRAMS clean-generic clean-libtool \ - clean-noinstLTLIBRARIES clean-noinstPROGRAMS cscopelist ctags \ - distclean distclean-compile distclean-generic \ + clean clean-checkPROGRAMS clean-generic clean-libLTLIBRARIES \ + clean-libtool clean-noinstLTLIBRARIES clean-noinstPROGRAMS \ + cscopelist ctags distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ - install-data-am install-dvi install-dvi-am install-exec \ - install-exec-am install-html install-html-am install-info \ - install-info-am install-man install-pdf install-pdf-am \ - install-ps install-ps-am install-strip installcheck \ - installcheck-am installdirs maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-compile \ - mostlyclean-generic mostlyclean-libtool mostlyclean-local pdf \ - pdf-am ps ps-am tags uninstall uninstall-am + install-data-am install-data-local install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-libLTLIBRARIES \ + install-man install-pdf install-pdf-am install-ps \ + install-ps-am install-strip installcheck installcheck-am \ + installdirs maintainer-clean maintainer-clean-generic \ + mostlyclean mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool mostlyclean-local pdf pdf-am ps ps-am tags \ + uninstall uninstall-am uninstall-libLTLIBRARIES # List all build rules defined by HDF5 Makefiles as "PHONY" targets here. @@ -1610,6 +1670,10 @@ help: @HAVE_SHARED_CONDITIONAL_TRUE@ # The libdynlib1 library for testing plugin module plugin.c. @HAVE_SHARED_CONDITIONAL_TRUE@ # Build it as shared library if configure is enabled for shared library. + +@HAVE_SHARED_CONDITIONAL_TRUE@install-data-local: +@HAVE_SHARED_CONDITIONAL_TRUE@ $(RM) $(DESTDIR)$(libdir)/*dynlib1* + @HAVE_SHARED_CONDITIONAL_FALSE@ # The libh5test library provides common support code for the tests. # Additional target for running timing test -- cgit v0.12 From c1c11c021b09a8deefb1fd08e133e716080bc69e Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Fri, 29 Mar 2013 14:51:49 -0500 Subject: [svn-r23491] Add test_plugin.sh to list of cleanup files --- test/Makefile.am | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/Makefile.am b/test/Makefile.am index 61f1ed5..a2f3600 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -57,7 +57,6 @@ TEST_PROG= testhdf5 lheap ohdr stab gheap cache cache_api cache_tagging \ check_PROGRAMS=$(TEST_PROG) error_test err_compat tcheck_version testmeta links_env if HAVE_SHARED_CONDITIONAL check_PROGRAMS+= plugin -else endif # These programs generate test files for the tests. They don't need to be @@ -159,5 +158,8 @@ testhdf5_SOURCES=testhdf5.c tarray.c tattr.c tchecksum.c tconfig.c tfile.c \ # Temporary files. DISTCLEANFILES=testerror.sh testlibinfo.sh testcheck_version.sh testlinks_env.sh test_plugin.sh +if HAVE_SHARED_CONDITIONAL + DISTCLEANFILES += test_plugin.sh +endif include $(top_srcdir)/config/conclude.am -- cgit v0.12 From 59bb6d185e4e8afd65af4f33dec5c13627c9f8b7 Mon Sep 17 00:00:00 2001 From: Albert Cheng Date: Fri, 29 Mar 2013 15:22:40 -0500 Subject: [svn-r23492] Bug fix: Test was not checking error result. It basically return succeess to make check all the time. Fixed it so that it does check the return code of the test (plugin) and set nerror accordingly. It then exit 1 if there is any error detected. Test: use the desy committest to pass on jam, koala, ostrich, duck and emu. Also hand test by "rm test/.lib/libdynlib1* to verify the test script can indeed response to errors properly. --- test/test_plugin.sh.in | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/test/test_plugin.sh.in b/test/test_plugin.sh.in index f2f3a1a..630a689 100644 --- a/test/test_plugin.sh.in +++ b/test/test_plugin.sh.in @@ -34,9 +34,6 @@ TEST_NAME=plugin TEST_BIN=`pwd`/$TEST_NAME ENVCMD="env HDF5_PLUGIN_PATH=`pwd`/.libs" -# Run the test -$ENVCMD $TEST_BIN - # Print a line-line message left justified in a field of 70 characters # beginning with the word "Testing". # @@ -45,8 +42,18 @@ TESTING() { echo "Testing $* $SPACES" | cut -c1-70 | tr -d '\012' } -if test $nerrors -eq 0 ; then - echo "All Plugin API tests passed." +# Main Body +# Run the test +$ENVCMD $TEST_BIN +if [ $? != 0 ]; then + nerrors=`expr $nerrors + 1` fi -exit $nerrors +# print results +if test $nerrors -ne 0 ; then + echo "$nerrors errors encountered" + exit 1 +else + echo "All Plugin API tests passed." + exit 0 +fi -- cgit v0.12 From 5e5e9e3987ddb5ce005f346e95e378e57ad5c762 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Fri, 29 Mar 2013 15:46:48 -0500 Subject: [svn-r23493] Correct improper addition --- test/Makefile.am | 3 --- 1 file changed, 3 deletions(-) diff --git a/test/Makefile.am b/test/Makefile.am index a2f3600..6e1f845 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -158,8 +158,5 @@ testhdf5_SOURCES=testhdf5.c tarray.c tattr.c tchecksum.c tconfig.c tfile.c \ # Temporary files. DISTCLEANFILES=testerror.sh testlibinfo.sh testcheck_version.sh testlinks_env.sh test_plugin.sh -if HAVE_SHARED_CONDITIONAL - DISTCLEANFILES += test_plugin.sh -endif include $(top_srcdir)/config/conclude.am -- cgit v0.12 From ed621aae38837e90c7273087de22f1752eee7cc7 Mon Sep 17 00:00:00 2001 From: Raymond Lu Date: Fri, 29 Mar 2013 15:59:15 -0500 Subject: [svn-r23494] I added another filter library dynlib2.c for plugin.c test. The test script moves the libdynlib2.so to /tmp then runs plugin.c. Tested on jam and koala. --- test/Makefile.am | 7 ++-- test/Makefile.in | 43 ++++++++++++++--------- test/dynlib1.c | 7 ++-- test/dynlib2.c | 93 ++++++++++++++++++++++++++++++++++++++++++++++++++ test/plugin.c | 55 ++++++----------------------- test/test_plugin.sh.in | 8 ++--- 6 files changed, 142 insertions(+), 71 deletions(-) create mode 100644 test/dynlib2.c diff --git a/test/Makefile.am b/test/Makefile.am index 6e1f845..ec0f416 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -79,13 +79,14 @@ if HAVE_SHARED_CONDITIONAL # The libh5test library provides common support code for the tests. noinst_LTLIBRARIES=libh5test.la - # The libdynlib1 library for testing plugin module plugin.c. + # The libdynlib1 and libdynlib2 library for testing plugin module plugin.c. # Build it as shared library if configure is enabled for shared library. - lib_LTLIBRARIES=libdynlib1.la + lib_LTLIBRARIES=libdynlib1.la libdynlib2.la libdynlib1_la_SOURCES=dynlib1.c + libdynlib2_la_SOURCES=dynlib2.c install-data-local: - $(RM) $(DESTDIR)$(libdir)/*dynlib1* + $(RM) $(DESTDIR)$(libdir)/*dynlib* else # The libh5test library provides common support code for the tests. diff --git a/test/Makefile.in b/test/Makefile.in index 958ec33..49b8d70 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -133,6 +133,12 @@ am__v_lt_0 = --silent am__v_lt_1 = @HAVE_SHARED_CONDITIONAL_TRUE@am_libdynlib1_la_rpath = -rpath \ @HAVE_SHARED_CONDITIONAL_TRUE@ $(libdir) +libdynlib2_la_LIBADD = +am__libdynlib2_la_SOURCES_DIST = dynlib2.c +@HAVE_SHARED_CONDITIONAL_TRUE@am_libdynlib2_la_OBJECTS = dynlib2.lo +libdynlib2_la_OBJECTS = $(am_libdynlib2_la_OBJECTS) +@HAVE_SHARED_CONDITIONAL_TRUE@am_libdynlib2_la_rpath = -rpath \ +@HAVE_SHARED_CONDITIONAL_TRUE@ $(libdir) libh5test_la_LIBADD = am_libh5test_la_OBJECTS = h5test.lo testframe.lo cache_common.lo libh5test_la_OBJECTS = $(am_libh5test_la_OBJECTS) @@ -510,13 +516,13 @@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = -SOURCES = $(libdynlib1_la_SOURCES) $(libh5test_la_SOURCES) accum.c \ - app_ref.c big.c bittests.c btree2.c cache.c cache_api.c \ - cache_tagging.c cmpd_dset.c cross_read.c dangle.c dsets.c \ - dt_arith.c dtransform.c dtypes.c earray.c efc.c \ - enc_dec_plist.c enc_dec_plist_with_endianess.c enum.c \ - err_compat.c error_test.c extend.c external.c farray.c fheap.c \ - file_image.c fillval.c filter_fail.c flush1.c flush2.c \ +SOURCES = $(libdynlib1_la_SOURCES) $(libdynlib2_la_SOURCES) \ + $(libh5test_la_SOURCES) accum.c app_ref.c big.c bittests.c \ + btree2.c cache.c cache_api.c cache_tagging.c cmpd_dset.c \ + cross_read.c dangle.c dsets.c dt_arith.c dtransform.c dtypes.c \ + earray.c efc.c enc_dec_plist.c enc_dec_plist_with_endianess.c \ + enum.c err_compat.c error_test.c extend.c external.c farray.c \ + fheap.c file_image.c fillval.c filter_fail.c flush1.c flush2.c \ freespace.c gen_bad_ohdr.c gen_bogus.c gen_cross.c \ gen_deflate.c gen_file_image.c gen_filespace.c gen_filters.c \ gen_new_array.c gen_new_fill.c gen_new_group.c gen_new_mtime.c \ @@ -528,12 +534,13 @@ SOURCES = $(libdynlib1_la_SOURCES) $(libh5test_la_SOURCES) accum.c \ tcheck_version.c $(testhdf5_SOURCES) testmeta.c \ $(ttsafe_SOURCES) unlink.c vfd.c DIST_SOURCES = $(am__libdynlib1_la_SOURCES_DIST) \ - $(libh5test_la_SOURCES) accum.c app_ref.c big.c bittests.c \ - btree2.c cache.c cache_api.c cache_tagging.c cmpd_dset.c \ - cross_read.c dangle.c dsets.c dt_arith.c dtransform.c dtypes.c \ - earray.c efc.c enc_dec_plist.c enc_dec_plist_with_endianess.c \ - enum.c err_compat.c error_test.c extend.c external.c farray.c \ - fheap.c file_image.c fillval.c filter_fail.c flush1.c flush2.c \ + $(am__libdynlib2_la_SOURCES_DIST) $(libh5test_la_SOURCES) \ + accum.c app_ref.c big.c bittests.c btree2.c cache.c \ + cache_api.c cache_tagging.c cmpd_dset.c cross_read.c dangle.c \ + dsets.c dt_arith.c dtransform.c dtypes.c earray.c efc.c \ + enc_dec_plist.c enc_dec_plist_with_endianess.c enum.c \ + err_compat.c error_test.c extend.c external.c farray.c fheap.c \ + file_image.c fillval.c filter_fail.c flush1.c flush2.c \ freespace.c gen_bad_ohdr.c gen_bogus.c gen_cross.c \ gen_deflate.c gen_file_image.c gen_filespace.c gen_filters.c \ gen_new_array.c gen_new_fill.c gen_new_group.c gen_new_mtime.c \ @@ -904,8 +911,9 @@ BUILD_ALL_PROGS = gen_bad_ohdr gen_bogus gen_cross gen_deflate gen_filters gen_n @HAVE_SHARED_CONDITIONAL_FALSE@noinst_LTLIBRARIES = libh5test.la @HAVE_SHARED_CONDITIONAL_TRUE@noinst_LTLIBRARIES = libh5test.la -@HAVE_SHARED_CONDITIONAL_TRUE@lib_LTLIBRARIES = libdynlib1.la +@HAVE_SHARED_CONDITIONAL_TRUE@lib_LTLIBRARIES = libdynlib1.la libdynlib2.la @HAVE_SHARED_CONDITIONAL_TRUE@libdynlib1_la_SOURCES = dynlib1.c +@HAVE_SHARED_CONDITIONAL_TRUE@libdynlib2_la_SOURCES = dynlib2.c libh5test_la_SOURCES = h5test.c testframe.c cache_common.c # Use libhd5test.la to compile all of the tests @@ -1040,6 +1048,8 @@ clean-noinstLTLIBRARIES: } libdynlib1.la: $(libdynlib1_la_OBJECTS) $(libdynlib1_la_DEPENDENCIES) $(EXTRA_libdynlib1_la_DEPENDENCIES) $(AM_V_CCLD)$(LINK) $(am_libdynlib1_la_rpath) $(libdynlib1_la_OBJECTS) $(libdynlib1_la_LIBADD) $(LIBS) +libdynlib2.la: $(libdynlib2_la_OBJECTS) $(libdynlib2_la_DEPENDENCIES) $(EXTRA_libdynlib2_la_DEPENDENCIES) + $(AM_V_CCLD)$(LINK) $(am_libdynlib2_la_rpath) $(libdynlib2_la_OBJECTS) $(libdynlib2_la_LIBADD) $(LIBS) libh5test.la: $(libh5test_la_OBJECTS) $(libh5test_la_DEPENDENCIES) $(EXTRA_libh5test_la_DEPENDENCIES) $(AM_V_CCLD)$(LINK) $(am_libh5test_la_rpath) $(libh5test_la_OBJECTS) $(libh5test_la_LIBADD) $(LIBS) @@ -1309,6 +1319,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dtransform.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dtypes.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dynlib1.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dynlib2.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/earray.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/efc.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/enc_dec_plist.Po@am__quote@ @@ -1668,11 +1679,11 @@ help: @HAVE_SHARED_CONDITIONAL_TRUE@ # The libh5test library provides common support code for the tests. -@HAVE_SHARED_CONDITIONAL_TRUE@ # The libdynlib1 library for testing plugin module plugin.c. +@HAVE_SHARED_CONDITIONAL_TRUE@ # The libdynlib1 and libdynlib2 library for testing plugin module plugin.c. @HAVE_SHARED_CONDITIONAL_TRUE@ # Build it as shared library if configure is enabled for shared library. @HAVE_SHARED_CONDITIONAL_TRUE@install-data-local: -@HAVE_SHARED_CONDITIONAL_TRUE@ $(RM) $(DESTDIR)$(libdir)/*dynlib1* +@HAVE_SHARED_CONDITIONAL_TRUE@ $(RM) $(DESTDIR)$(libdir)/*dynlib* @HAVE_SHARED_CONDITIONAL_FALSE@ # The libh5test library provides common support code for the tests. diff --git a/test/dynlib1.c b/test/dynlib1.c index b879ca2..2e0c593 100644 --- a/test/dynlib1.c +++ b/test/dynlib1.c @@ -44,14 +44,17 @@ const H5Z_class2_t* H5PL_get_plugin_info(void) {return H5Z_DYNLIB1;} /*------------------------------------------------------------------------- * Function: H5Z_filter_dynlib1 * - * Purpose: A dynlib1 compression method that doesn't do anything. + * Purpose: A dynlib1 filter method that adds on and subtract from + * the original value with another value. It will be built + * as a shared library. plugin.c test will load and use + * this filter library. * * Return: Success: Data chunk size * * Failure: 0 * * Programmer: Robb Matzke - * Tuesday, April 21, 1998 + * 29 March 2013 * *------------------------------------------------------------------------- */ diff --git a/test/dynlib2.c b/test/dynlib2.c new file mode 100644 index 0000000..b1c1707 --- /dev/null +++ b/test/dynlib2.c @@ -0,0 +1,93 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by The HDF Group. * + * Copyright by the Board of Trustees of the University of Illinois. * + * 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 files COPYING and Copyright.html. COPYING can be found at the root * + * of the source code distribution tree; Copyright.html can be found at the * + * root level of an installed copy of the electronic HDF5 document set and * + * is linked from the top-level documents page. It can also be found at * + * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * + * access to either file, you may request a copy from help@hdfgroup.org. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* + * Programmer: Raymond Lu + * 13 February 2013 + * + * Purpose: Tests the plugin module (H5PL) + */ + +#include +#include +#include +#include + +static size_t H5Z_filter_dynlib2(unsigned int flags, size_t cd_nelmts, + const unsigned int *cd_values, size_t nbytes, size_t *buf_size, void **buf); + +/* This message derives from H5Z */ +const H5Z_class2_t H5Z_DYNLIB2[1] = {{ + H5Z_CLASS_T_VERS, /* H5Z_class_t version */ + H5Z_FILTER_DYNLIB2, /* Filter id number */ + 1, 1, /* Encoding and decoding enabled */ + "dynlib2", /* Filter name for debugging */ + NULL, /* The "can apply" callback */ + NULL, /* The "set local" callback */ + (H5Z_func_t)H5Z_filter_dynlib2, /* The actual filter function */ +}}; + +const H5PL_type_t H5PL_get_plugin_type(void) {return H5PL_TYPE_FILTER;} +const H5Z_class2_t* H5PL_get_plugin_info(void) {return H5Z_DYNLIB2;} + +/*------------------------------------------------------------------------- + * Function: H5Z_filter_dynlib2 + * + * Purpose: A dynlib2 filter method that assigns the power of 2 of the + * original value during write and calculates the square root + * of the original value during read. It will be built as a + * shared library. plugin.c test will load and use this filter + * library. + * + * Return: Success: Data chunk size + * + * Failure: 0 + * + * Programmer: Raymond Lu + * 29 March 2013 + * + *------------------------------------------------------------------------- + */ +static size_t +H5Z_filter_dynlib2(unsigned int flags, size_t cd_nelmts, + const unsigned int *cd_values, size_t nbytes, + size_t *buf_size, void **buf) +{ + int *int_ptr=(int *)*buf; /* Pointer to the data values */ + size_t buf_left=*buf_size; /* Amount of data buffer left to process */ + + /* Check for the correct number of parameters */ + if(cd_nelmts>0) + return(0); + + if(flags & H5Z_FLAG_REVERSE) { /*read*/ + /* Calculate and assign the square root for all the data values */ + while(buf_left>0) { + *int_ptr = (int)sqrt((double)*int_ptr); + *int_ptr++; + buf_left -= sizeof(int); + } /* end while */ + } /* end if */ + else { /*write*/ + /* Calculate and assign the power of 2 to all the data values */ + while(buf_left>0) { + *int_ptr = (int)pow((double)*int_ptr, 2); + *int_ptr++; + buf_left -= sizeof(int); + } /* end while */ + } /* end else */ + + return nbytes; +} diff --git a/test/plugin.c b/test/plugin.c index d5a30f9..4fc8115 100644 --- a/test/plugin.c +++ b/test/plugin.c @@ -62,6 +62,9 @@ const char *FILENAME[] = { #define DSET_DIM1 100 #define DSET_DIM2 200 +/* Limit random number within 20000 */ +#define RANDOM_LIMIT 20000 + int points_deflate[DSET_DIM1][DSET_DIM2], points_dynlib1[DSET_DIM1][DSET_DIM2], points_dynlib2[DSET_DIM1][DSET_DIM2], @@ -200,8 +203,7 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl) for(i=0; i Date: Fri, 29 Mar 2013 18:13:05 -0500 Subject: [svn-r23495] ported revisions 23433:23494 from the trunk --- MANIFEST | 1 + c++/src/H5Location.cpp | 33 +++++++++++++++++ c++/src/H5Location.h | 10 +++-- c++/test/tattr.cpp | 76 ++++++++++++++++++++++++++++++++++++-- config/apple | 48 ++++++++++++++++++++++-- fortran/src/hdf5_fortrandll.def.in | 1 + fortran/test/tf.f90 | 11 ++---- release_docs/INSTALL_parallel | 67 +++++++++++++++++++++++++++++++++ release_docs/RELEASE.txt | 4 ++ src/H5AC.c | 6 +-- src/H5Dchunk.c | 2 +- src/H5HFsection.c | 2 +- src/H5Pfapl.c | 6 +-- tools/h5copy/testh5copy.sh.in | 10 ++--- tools/h5diff/ph5diff_main.c | 5 ++- tools/h5repack/h5repack.sh.in | 22 +++++++++-- tools/lib/h5tools_dump.c | 16 ++++++-- tools/testfiles/tfletcher32.ddl | 2 +- tools/testfiles/tshuffle.ddl | 2 +- tools/testfiles/tuserfilter.ddl | 4 +- 20 files changed, 286 insertions(+), 42 deletions(-) diff --git a/MANIFEST b/MANIFEST index c0e8bdf..4fde6b7 100644 --- a/MANIFEST +++ b/MANIFEST @@ -962,6 +962,7 @@ ./test/dtypes.c ./test/dtransform.c ./test/dynlib1.c +./test/dynlib2.c ./test/earray.c ./test/efc.c ./test/enc_dec_plist.c diff --git a/c++/src/H5Location.cpp b/c++/src/H5Location.cpp index b93cd86..98878d7 100644 --- a/c++/src/H5Location.cpp +++ b/c++/src/H5Location.cpp @@ -250,6 +250,39 @@ int H5Location::getNumAttrs() const } //-------------------------------------------------------------------------- +// Function: H5Location::attrExists +///\brief Checks whether the named attribute exists at this location. +///\param name - IN: Name of the attribute to be queried +///\exception H5::AttributeIException +// Programmer Binh-Minh Ribler - 2013 +//-------------------------------------------------------------------------- +bool H5Location::attrExists(const char* name) const +{ + // Call C routine H5Aexists to determine whether an attribute exists + // at this location, which could be specified by a file, group, dataset, + // or named datatype. + herr_t ret_value = H5Aexists(getId(), name); + if( ret_value > 0 ) + return true; + else if(ret_value == 0) + return false; + else // Raise exception when H5Aexists returns a negative value + throw AttributeIException(inMemFunc("attrExists"), "H5Aexists failed"); +} + +//-------------------------------------------------------------------------- +// Function: H5Location::attrExists +///\brief This is an overloaded member function, provided for convenience. +/// It differs from the above function in that it takes +/// a reference to an \c H5std_string for \a name. +// Programmer Binh-Minh Ribler - 2000 +//-------------------------------------------------------------------------- +bool H5Location::attrExists(const H5std_string& name) const +{ + return(attrExists(name.c_str())); +} + +//-------------------------------------------------------------------------- // Function: H5Location::removeAttr ///\brief Removes the named attribute from this object. ///\param name - IN: Name of the attribute to be removed diff --git a/c++/src/H5Location.h b/c++/src/H5Location.h index d1dd892..8eae454 100644 --- a/c++/src/H5Location.h +++ b/c++/src/H5Location.h @@ -79,11 +79,15 @@ class H5_DLLCPP H5Location : public IdComponent { // misleading, so getRefObjType is used in the new function instead. // Iterate user's function over the attributes at this location. - int iterateAttrs( attr_operator_t user_op, unsigned* idx = NULL, void* op_data = NULL ); + int iterateAttrs(attr_operator_t user_op, unsigned* idx = NULL, void* op_data = NULL); + + // Checks whether the named attribute exists at this location. + bool attrExists(const char* name) const; + bool attrExists(const H5std_string& name) const; // Removes the named attribute from this location. - void removeAttr( const char* name ) const; - void removeAttr( const H5std_string& name ) const; + void removeAttr(const char* name) const; + void removeAttr(const H5std_string& name) const; // Renames the named attribute to a new name. void renameAttr(const char* oldname, const char* newname) const; diff --git a/c++/test/tattr.cpp b/c++/test/tattr.cpp index 1a15aea..7e77e85 100644 --- a/c++/test/tattr.cpp +++ b/c++/test/tattr.cpp @@ -252,14 +252,19 @@ static void test_attr_rename() int read_data1[ATTR1_DIM1]={0}; // Buffer for reading the attribute int i; - // Output message about test being performed - SUBTEST("Rename Attribute Function"); + // Output message about test being performed + SUBTEST("Checking for Existence and Renaming Attribute"); try { // Open file H5File fid1(FILE_BASIC, H5F_ACC_RDWR); - // Check rename of attribute belonging to a file + // Check and rename attribute belonging to a file + + // Check for existence of attribute + bool attr_exists = fid1.attrExists(FATTR1_NAME); + if (attr_exists == false) + throw InvalidActionException("H5File::attrExists", "Attribute should exist but does not"); // Change attribute name fid1.renameAttr(FATTR1_NAME, FATTR_TMP_NAME); @@ -280,7 +285,12 @@ static void test_attr_rename() // Open the dataset DataSet dataset = fid1.openDataSet(DSET1_NAME); - // Check rename of attribute belonging to a dataset + // Check and rename attribute belonging to a dataset + + // Check for existence of attribute + attr_exists = dataset.attrExists(ATTR1_NAME); + if (attr_exists == false) + throw InvalidActionException("H5File::attrExists", "Attribute should exist but does not"); // Change attribute name dataset.renameAttr(ATTR1_NAME, ATTR_TMP_NAME); @@ -303,6 +313,11 @@ static void test_attr_rename() // Close attribute attr1.close(); + // Check for existence of second attribute + attr_exists = dataset.attrExists(ATTR2_NAME); + if (attr_exists == false) + throw InvalidActionException("H5File::attrExists", "Attribute should exist but does not"); + // Open the second attribute Attribute attr2(dataset.openAttribute(ATTR2_NAME)); @@ -324,6 +339,11 @@ static void test_attr_rename() // Change first attribute back to the original name dataset.renameAttr(ATTR_TMP_NAME, ATTR1_NAME); + // Check for existence of attribute after renaming + attr_exists = dataset.attrExists(ATTR1_NAME); + if (attr_exists == false) + throw InvalidActionException("H5File::attrExists", "Attribute should exist but does not"); + PASSED(); } // end try block @@ -1354,6 +1374,53 @@ static void test_string_attr() /**************************************************************** ** +** test_attr_exists(): Test checking for attribute existence. +** (additional attrExists tests are in test_attr_rename()) +** +****************************************************************/ +static void test_attr_exists() +{ + // Output message about test being performed + SUBTEST("Check Attribute Existence"); + + try { + // Open file. + H5File fid1(FILE_BASIC, H5F_ACC_RDWR); + + // Open the root group. + Group root = fid1.openGroup("/"); + + // Check for existence of attribute + bool attr_exists = fid1.attrExists(ATTR1_FL_STR_NAME); + if (attr_exists == false) + throw InvalidActionException("H5File::attrExists", "fid1, ATTR1_FL_STR_NAMEAttribute should exist but does not"); + + // Check for existence of attribute + attr_exists = fid1.attrExists(FATTR1_NAME); + if (attr_exists == false) + throw InvalidActionException("H5File::attrExists", "fid1,FATTR2_NAMEAttribute should exist but does not"); + + // Open a group. + Group group = fid1.openGroup(GROUP1_NAME); + + // Check for existence of attribute + attr_exists = group.attrExists(ATTR2_NAME); + if (attr_exists == false) + throw InvalidActionException("H5File::attrExists", "group, ATTR2_NAMEAttribute should exist but does not"); + + PASSED(); + } // end try block + + catch (InvalidActionException E) { + issue_fail_msg("test_attr_exists()", __LINE__, __FILE__, E.getCDetailMsg()); + } + catch (Exception E) { + issue_fail_msg("test_attr_exists()", __LINE__, __FILE__, E.getCDetailMsg()); + } +} // test_attr_exists() + +/**************************************************************** +** ** test_attr(): Main attribute testing routine. ** ****************************************************************/ @@ -1382,6 +1449,7 @@ void test_attr() test_attr_dtype_shared(); // Test using shared datatypes in attributes test_string_attr(); // Test read/write string attribute + test_attr_exists(); // Test H5Location::attrExists } // test_attr() diff --git a/config/apple b/config/apple index c5c0a19..ac93ea5 100644 --- a/config/apple +++ b/config/apple @@ -20,17 +20,25 @@ # # See BlankForm in this directory for details. -# The default compiler is `gcc' +# The default compiler is `clang'. +# No support for OS older than darwin 10.X. if test "X-" = "X-$CC"; then - CC=gcc - CC_BASENAME=gcc + case "$host_os" in + darwin10.*) # Snow Leopard. Use gcc/g++ because clang++ is not available. + CC=gcc + CC_BASENAME=gcc + ;; + *) + CC=clang + CC_BASENAME=clang + ;; + esac fi # Figure out compiler flags . $srcdir/config/gnu-flags # temp patch: if GCC 4.2.1 is used in Lion or Mountain Lion systems, do not # use -O option as it causes failures in test/dt_arith. -#echo host_os=$host_os case "$host_os" in darwin1[12].*) # lion & mountain lion #echo cc_vendor=$cc_vendor'-'cc_version=$cc_version @@ -48,6 +56,11 @@ esac . $srcdir/config/intel-flags if test "X-" = "X-$FC"; then case $CC_BASENAME in + clang) + # clang has no fortran compiler. Use gfortran. + FC=gfortran + FC_BASENAME=gfortran + ;; gcc*) FC=gfortran FC_BASENAME=gfortran @@ -59,8 +72,30 @@ if test "X-" = "X-$FC"; then esac fi +if test "X-" = "X-$CXX"; then + case $CC_BASENAME in + clang) + CXX=clang++ + CXX_BASENAME=clang++ + ;; + gcc) + CXX=g++ + CXX_BASENAME=g++ + ;; + icc) + CXX=icpc + CXX_BASENAME=icpc + ;; + esac +fi + # compiler version strings case $CC in + clang) + cc_version_info=`$CC $CFLAGS $H5_CFLAGS --version 2>&1 |\ + grep 'Apple' | sed 's/(.*//'` + ;; + *gcc*) cc_version_info=`$CC $CFLAGS $H5_CFLAGS --version 2>&1 | grep -v 'PathScale' |\ grep 'GCC' | sed 's/.*\((GCC) [-a-z0-9\. ]*.*\)/\1/'` @@ -97,6 +132,11 @@ esac # get c++ version info case $CXX in + clang++) + cxx_version_info=`$CXX $CXXFLAGS $H5_CXXFLAGS --version 2>&1 |\ + grep 'Apple' | sed 's/(.*//'` + ;; + *g++*) cxx_version_info=`$CXX $CXXFLAGS $H5_CXXFLAGS --version 2>&1 |\ grep 'GCC' | sed 's/.*\((GCC) [-a-z0-9\. ]*.*\)/\1/'` diff --git a/fortran/src/hdf5_fortrandll.def.in b/fortran/src/hdf5_fortrandll.def.in index 4ce185b..62030f0 100644 --- a/fortran/src/hdf5_fortrandll.def.in +++ b/fortran/src/hdf5_fortrandll.def.in @@ -6,6 +6,7 @@ H5LIB_mp_H5GET_LIBVERSION_F H5LIB_mp_H5CHECK_VERSION_F H5LIB_mp_H5GARBAGE_COLLECT_F H5LIB_mp_H5DONT_ATEXIT_F +H5LIB_mp_H5KIND_TO_TYPE @H5_NOF03EXP@H5LIB_PROVISIONAL_mp_H5OFFSETOF ; H5_DBLE_INTERFACE H5_DBLE_INTERFACE_mp_H5AREAD_DOUBLE_SCALAR diff --git a/fortran/test/tf.f90 b/fortran/test/tf.f90 index d5c32c8..4f73fda 100644 --- a/fortran/test/tf.f90 +++ b/fortran/test/tf.f90 @@ -30,7 +30,7 @@ !This definition is needed for Windows DLLs !DEC$if defined(BUILD_HDF5_DLL) -!DEC$attributes dllexport :: verify_real +!DEC$attributes dllexport :: verify_real_kind_7 !DEC$endif SUBROUTINE verify_real_kind_7(string,value,correct_value,total_error) USE HDF5 @@ -115,7 +115,7 @@ END SUBROUTINE verify !This definition is needed for Windows DLLs !DEC$if defined(BUILD_HDF5_DLL) -!DEC$attributes dllexport :: verify +!DEC$attributes dllexport :: verify_Fortran_INTEGER_4 !DEC$endif SUBROUTINE verify_Fortran_INTEGER_4(string,value,correct_value,total_error) USE HDF5 @@ -129,9 +129,6 @@ SUBROUTINE verify_Fortran_INTEGER_4(string,value,correct_value,total_error) RETURN END SUBROUTINE verify_Fortran_INTEGER_4 - - - !This definition is needed for Windows DLLs !DEC$if defined(BUILD_HDF5_DLL) !DEC$attributes dllexport :: verifyLogical @@ -151,7 +148,7 @@ END SUBROUTINE verifyLogical !DEC$if defined(BUILD_HDF5_DLL) !DEC$attributes dllexport :: verifyString !DEC$endif -SUBROUTINE verifystring(string, value,correct_value,total_error) +SUBROUTINE verifyString(string, value,correct_value,total_error) CHARACTER*(*) :: string CHARACTER*(*) :: value, correct_value INTEGER :: total_error @@ -160,7 +157,7 @@ SUBROUTINE verifystring(string, value,correct_value,total_error) WRITE(*,*) "ERROR: INCORRECT VALIDATION ", string ENDIF RETURN -END SUBROUTINE verifystring +END SUBROUTINE verifyString !---------------------------------------------------------------------- diff --git a/release_docs/INSTALL_parallel b/release_docs/INSTALL_parallel index eacaf68..03b3ecf 100644 --- a/release_docs/INSTALL_parallel +++ b/release_docs/INSTALL_parallel @@ -186,6 +186,73 @@ TOOLTEST tgroup-1.ls 1 -w80 -r -g tgroup.h5 echo SKIP TOOLTEST tgroup-1.ls 1 -w80 -r -g tgroup.h5 ======== end of bypass ======== +2.5. Hopper (Cray XE6) (for v1.8 and later) +------------------------- + +2.5.1 Building HDF5 for Hopper +------------------------------------------ +The following steps are for building HDF5 for the Hopper compute +nodes. They would probably work for other Cray XE6 systems but have +not been verified. + +Obtain a copy from the HDF ftp server: +http://www.hdfgroup.org/ftp/HDF5/current/src/ +(link might change, so always double check the HDF group website). + +$ wget http://www.hdfgroup.org/ftp/HDF5/current/src/hdf5-x.x.x.tar.gz + +unpack the tarball + +$ cd hdf5-x.x.x/ +$ CC=cc FC=ftn ./configure \ +--prefix=/project/hdf5/hdf5 --enable-parallel --enable-fortran \ +--disable-shared --disable-production +$ make + +Run make check. make check should be run on the compute nodes, not the +front end nodes. So using a PBS batch script, allocate 4 or more +cores. Always consult with the machine's website on how to create PBS +scripts and allocate nodes for your job. For Hopper, all the +information can be found on: +http://www.nersc.gov/systems/hopper-cray-xe6/ + +save the PBS script into your HDF5 build directory. The PBS script +should contain (besides the PBS node allocation requests)the +following: + +-------------------------------------------------------------- +cd $PBS_O_WORKDIR + +##set RUNSERIAL and RUNPARALLEL like this in the PBS script: +export RUNPARALLEL="aprun -n 6" +export RUNSERIAL="aprun -n 1" + +##execute make check: +make check +-------------------------------------------------------------- + +Once the job runs and all is well, install the binary: +$ make install + +2.5.2 Hopper known issues +------------------------------ +Sometimes when building the library with make, you might get this problem: + +LD_LIBRARY_PATH="$LD_LIBRARY_PATH`echo | \ +sed -e 's/-L/:/g' -e 's/ +//g'`" \ +./H5make_libsettings > H5lib_settings.c +|| \ +(test $HDF5_Make_Ignore && echo "*** Error ignored") +|| \ +(rm -f H5lib_settings.c ; exit 1) +/bin/sh: line 4: 9644 Segmentation fault +LD_LIBRARY_PATH="$LD_LIBRARY_PATH`echo | sed -e 's/-L/:/g' -e 's/ +//g'`" ./H5make_libsettings > H5lib_settings.c + +If that happens, you are probable running with make -j . In that +case, you need to cleanup everything and start again as detailed above +but use serial make (do not use -j ). 3. Detail explanation --------------------- diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 8a54b21..dbd3b75 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -276,6 +276,10 @@ New Features Tools: ------ + - h5dump: Fixed displaying comporession ratio for unknown or user-defined + filters. HDFFV-8344 (XCAO 2013/03/19) + - h5dump: Changed UNKNOWN_FILTER to USER_DEFINED_FILTER for user defined filter. + HDFFV-8346 (XCAO 2013/03/19) - h5dump: Added capability for "-a" option to show attributes containing "/" by using an escape character. For example, for a dataset "/dset" containing attribute "speed(m/h)", use "h5dump -a "/dset/speed(\/h)" diff --git a/src/H5AC.c b/src/H5AC.c index ed79813..db8446a 100644 --- a/src/H5AC.c +++ b/src/H5AC.c @@ -2998,7 +2998,7 @@ done: *------------------------------------------------------------------------- */ #ifdef H5_HAVE_PARALLEL -herr_t +static herr_t H5AC_construct_candidate_list(H5AC_t * cache_ptr, H5AC_aux_t * aux_ptr, int sync_point_op) @@ -3212,7 +3212,7 @@ done: * *------------------------------------------------------------------------- */ -herr_t +static herr_t H5AC_ext_config_2_int_config(H5AC_cache_config_t * ext_conf_ptr, H5C_auto_size_ctl_t * int_conf_ptr) { @@ -4157,7 +4157,7 @@ done: *------------------------------------------------------------------------- */ #ifdef H5_HAVE_PARALLEL -herr_t +static herr_t H5AC_propagate_flushed_and_still_clean_entries_list(H5F_t * f, hid_t dxpl_id, H5AC_t * cache_ptr) diff --git a/src/H5Dchunk.c b/src/H5Dchunk.c index e3f060a..497846b 100644 --- a/src/H5Dchunk.c +++ b/src/H5Dchunk.c @@ -2174,7 +2174,7 @@ done: * *------------------------------------------------------------------------- */ -herr_t +static herr_t H5D__chunk_cinfo_cache_reset(H5D_chunk_cached_t *last) { FUNC_ENTER_PACKAGE_NOERR diff --git a/src/H5HFsection.c b/src/H5HFsection.c index 72ea100..bf779a6 100644 --- a/src/H5HFsection.c +++ b/src/H5HFsection.c @@ -449,7 +449,7 @@ done: * *------------------------------------------------------------------------- */ -herr_t +static herr_t H5HF_sect_node_free(H5HF_free_section_t *sect, H5HF_indirect_t *iblock) { herr_t ret_value = SUCCEED; /* Return value */ diff --git a/src/H5Pfapl.c b/src/H5Pfapl.c index 4faed4f..befec84 100644 --- a/src/H5Pfapl.c +++ b/src/H5Pfapl.c @@ -2267,7 +2267,7 @@ done: * *------------------------------------------------------------------------- */ -herr_t +static herr_t H5P_file_image_info_del(hid_t UNUSED prop_id, const char UNUSED *name, size_t UNUSED size, void *value) { H5FD_file_image_info_t info; /* Image info struct */ @@ -2321,7 +2321,7 @@ done: * *------------------------------------------------------------------------- */ -herr_t +static herr_t H5P_file_image_info_copy(const char UNUSED *name, size_t UNUSED size, void *value) { herr_t ret_value = SUCCEED; /* Return value */ @@ -2396,7 +2396,7 @@ done: * *------------------------------------------------------------------------- */ -herr_t +static herr_t H5P_file_image_info_close(const char UNUSED *name, size_t UNUSED size, void *value) { herr_t ret_value = SUCCEED; /* Return value */ diff --git a/tools/h5copy/testh5copy.sh.in b/tools/h5copy/testh5copy.sh.in index d30d8d8..bec3bfc 100644 --- a/tools/h5copy/testh5copy.sh.in +++ b/tools/h5copy/testh5copy.sh.in @@ -513,7 +513,7 @@ COPY_REFERENCES() TESTFILE="$TESTDIR/h5copy_ref.h5" echo "Test copying object and region references" - TOOLTEST_F -f ref -i $TESTFILE -o $TESTDIR/region_ref.out.h5 -v -s / -d /COPY + TOOLTEST -f ref -i $TESTFILE -o $TESTDIR/region_ref.out.h5 -v -s / -d /COPY } # Copy external links. @@ -529,25 +529,25 @@ COPY_EXT_LINKS() TOOLTEST -v -i $TESTFILE -o $TESTDIR/ext_link.out.h5 -s /group_ext/extlink_dset -d /copy1_dset echo "Test copying external link directly with -f ext" - TOOLTEST_F -f ext -i $TESTFILE -o $TESTDIR/ext_link_f.out.h5 -v -s /group_ext/extlink_dset -d /copy2_dset + TOOLTEST -f ext -i $TESTFILE -o $TESTDIR/ext_link_f.out.h5 -v -s /group_ext/extlink_dset -d /copy2_dset echo "Test copying dangling external link (no obj) directly without -f ext" TOOLTEST -v -i $TESTFILE -o $TESTDIR/ext_dangle_noobj.out.h5 -s /group_ext/extlink_notyet1 -d /copy_dangle1_1 echo "Test copying dangling external link (no obj) directly with -f ext" - TOOLTEST_F -f ext -i $TESTFILE -o $TESTDIR/ext_dangle_noobj_f.out.h5 -v -s /group_ext/extlink_notyet1 -d /copy_dangle1_2 + TOOLTEST -f ext -i $TESTFILE -o $TESTDIR/ext_dangle_noobj_f.out.h5 -v -s /group_ext/extlink_notyet1 -d /copy_dangle1_2 echo "Test copying dangling external link (no file) directly without -f ext" TOOLTEST -v -i $TESTFILE -o $TESTDIR/ext_dangle_nofile.out.h5 -s /group_ext/extlink_notyet2 -d /copy_dangle2_1 echo "Test copying dangling external link (no file) directly with -f ext" - TOOLTEST_F -f ext -i $TESTFILE -o $TESTDIR/ext_dangle_nofile_f.out.h5 -v -s /group_ext/extlink_notyet2 -d /copy_dangle2_2 + TOOLTEST -f ext -i $TESTFILE -o $TESTDIR/ext_dangle_nofile_f.out.h5 -v -s /group_ext/extlink_notyet2 -d /copy_dangle2_2 echo "Test copying a group contains external links without -f ext" TOOLTEST -v -i $TESTFILE -o $TESTDIR/ext_link_group.out.h5 -s /group_ext -d /copy1_group echo "Test copying a group contains external links with -f ext" - TOOLTEST_F -f ext -i $TESTFILE -o $TESTDIR/ext_link_group_f.out.h5 -v -s /group_ext -d /copy2_group + TOOLTEST -f ext -i $TESTFILE -o $TESTDIR/ext_link_group_f.out.h5 -v -s /group_ext -d /copy2_group } # Test misc. diff --git a/tools/h5diff/ph5diff_main.c b/tools/h5diff/ph5diff_main.c index 1fc563b..b9bd404 100644 --- a/tools/h5diff/ph5diff_main.c +++ b/tools/h5diff/ph5diff_main.c @@ -275,6 +275,9 @@ void h5diff_exit(int status) if(g_Parallel) MPI_Finalize(); - exit(status); + /* Always exit(0), since MPI implementations do weird stuff when they + * receive a non-zero exit value. - QAK + */ + exit(0); } diff --git a/tools/h5repack/h5repack.sh.in b/tools/h5repack/h5repack.sh.in index 14e1d04..ca25183 100644 --- a/tools/h5repack/h5repack.sh.in +++ b/tools/h5repack/h5repack.sh.in @@ -244,8 +244,11 @@ VERIFY_LAYOUT_DSET() shift shift shift - - $RUNSERIAL $H5REPACK_BIN "$@" $infile $outfile + + TESTING $H5REPACK $@ + ( + $RUNSERIAL $H5REPACK_BIN "$@" $infile $outfile + ) RET=$? if [ $RET != 0 ] ; then echo "*FAILED*" @@ -266,6 +269,7 @@ VERIFY_LAYOUT_DSET() echo " PASSED" else echo " FAILED" + nerrors="`expr $nerrors + 1`" fi # clean up tmp files @@ -277,6 +281,7 @@ VERIFY_LAYOUT_DSET() # Verifying layouts from entire file VERIFY_LAYOUT_ALL() { + infile=$2 outfile=$TESTDIR/out-$1.$2 layoutfile=$TESTDIR/layout-$1.$2 expectlayout=$3 @@ -284,7 +289,10 @@ VERIFY_LAYOUT_ALL() shift shift - $RUNSERIAL $H5REPACK_BIN "$@" $infile $outfile + TESTING $H5REPACK $@ + ( + $RUNSERIAL $H5REPACK_BIN "$@" $infile $outfile + ) RET=$? if [ $RET != 0 ] ; then echo "*FAILED*" @@ -300,6 +308,7 @@ VERIFY_LAYOUT_ALL() # check if the other layouts still exsit VERIFY "layouts" ( + echo # if CONTIGUOUS if [ $expectlayout = "CONTIGUOUS" ]; then TESTING $H5DUMP_BIN -pH $outfile @@ -309,10 +318,12 @@ VERIFY_LAYOUT_ALL() $GREP "COMPACT" $layoutfile > /dev/null if [ $? -eq 0 ]; then echo " FAILED" + nerrors="`expr $nerrors + 1`" else $GREP "CHUNKED" $layoutfile > /dev/null if [ $? -eq 0 ]; then echo " FAILED" + nerrors="`expr $nerrors + 1`" else echo " PASSED" fi @@ -327,10 +338,12 @@ VERIFY_LAYOUT_ALL() $GREP "CHUNKED" $layoutfile > /dev/null if [ $? -eq 0 ]; then echo " FAILED" + nerrors="`expr $nerrors + 1`" else $GREP "CONTIGUOUS" $layoutfile > /dev/null if [ $? -eq 0 ]; then echo " FAILED" + nerrors="`expr $nerrors + 1`" else echo " PASSED" fi @@ -345,10 +358,12 @@ VERIFY_LAYOUT_ALL() $GREP "CONTIGUOUS" $layoutfile > /dev/null if [ $? -eq 0 ]; then echo " FAILED" + nerrors="`expr $nerrors + 1`" else $GREP "COMPACT" $layoutfile > /dev/null if [ $? -eq 0 ]; then echo " FAILED" + nerrors="`expr $nerrors + 1`" else echo " PASSED" fi @@ -523,6 +538,7 @@ TOOLTEST_META() else #fail echo "*FAILED*" + nerrors="`expr $nerrors + 1`" fi rm -f $outfile diff --git a/tools/lib/h5tools_dump.c b/tools/lib/h5tools_dump.c index dbb5f98..d6cd0a0 100644 --- a/tools/lib/h5tools_dump.c +++ b/tools/lib/h5tools_dump.c @@ -2958,11 +2958,14 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, int ndims = H5Sget_simple_extent_dims(sid, dims, NULL); /* only print the compression ratio for these filters */ - for(i = 0; i < nfilters; i++) { + for(i = 0; i < nfilters && !ok; i++) { cd_nelmts = NELMTS(cd_values); filtn = H5Pget_filter2(dcpl_id, (unsigned)i, &filt_flags, &cd_nelmts, cd_values, sizeof(f_name), f_name, NULL); - + ok = (filtn>=0); + + /* this following code will not show compression ratio for + user defined filter. For example, see HDFFV-8344 --xcao@hdfgroup.org switch(filtn) { case H5Z_FILTER_DEFLATE: case H5Z_FILTER_SZIP: @@ -2971,6 +2974,7 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, ok = 1; break; } + */ } if(ndims && ok) { @@ -3148,6 +3152,9 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, cd_nelmts = NELMTS(cd_values); filtn = H5Pget_filter2(dcpl_id, (unsigned)i, &filt_flags, &cd_nelmts, cd_values, sizeof(f_name), f_name, NULL); + + if (filtn<0) + continue; /* nothing to print for invalid filter */ ctx->need_prefix = TRUE; h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); @@ -3241,10 +3248,13 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, ncols, 0, 0); break; default: + /* filter do not have to be avaiable for showing registered filter info. + see HDFFV-8346 for details. --xcao@hdfgroup.org if(H5Zfilter_avail(filtn)) h5tools_str_append(&buffer, "%s %s", "USER_REGISTERED_FILTER", BEGIN); else - h5tools_str_append(&buffer, "%s %s", "UNKNOWN_FILTER", BEGIN); + */ + h5tools_str_append(&buffer, "%s %s", "USER_DEFINED_FILTER", BEGIN); h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, ncols, 0, 0); ctx->indent_level++; diff --git a/tools/testfiles/tfletcher32.ddl b/tools/testfiles/tfletcher32.ddl index 072ef23..c341ded 100644 --- a/tools/testfiles/tfletcher32.ddl +++ b/tools/testfiles/tfletcher32.ddl @@ -4,7 +4,7 @@ DATASET "fletcher32" { DATASPACE SIMPLE { ( 20, 10 ) / ( 20, 10 ) } STORAGE_LAYOUT { CHUNKED ( 10, 5 ) - SIZE 816 + SIZE 816 (0.980:1 COMPRESSION) } FILTERS { CHECKSUM FLETCHER32 diff --git a/tools/testfiles/tshuffle.ddl b/tools/testfiles/tshuffle.ddl index cd1b5f8..5c183fe 100644 --- a/tools/testfiles/tshuffle.ddl +++ b/tools/testfiles/tshuffle.ddl @@ -4,7 +4,7 @@ DATASET "shuffle" { DATASPACE SIMPLE { ( 20, 10 ) / ( 20, 10 ) } STORAGE_LAYOUT { CHUNKED ( 10, 5 ) - SIZE 800 + SIZE 800 (1.000:1 COMPRESSION) } FILTERS { PREPROCESSING SHUFFLE diff --git a/tools/testfiles/tuserfilter.ddl b/tools/testfiles/tuserfilter.ddl index 07b478f..24745b9 100644 --- a/tools/testfiles/tuserfilter.ddl +++ b/tools/testfiles/tuserfilter.ddl @@ -4,10 +4,10 @@ DATASET "myfilter" { DATASPACE SIMPLE { ( 20, 10 ) / ( 20, 10 ) } STORAGE_LAYOUT { CHUNKED ( 10, 5 ) - SIZE 800 + SIZE 800 (1.000:1 COMPRESSION) } FILTERS { - UNKNOWN_FILTER { + USER_DEFINED_FILTER { FILTER_ID 405 COMMENT myfilter PARAMS { 5 6 } -- cgit v0.12 From 913b88d15b78e027bdcdcb5b9356d4b6dfe59b18 Mon Sep 17 00:00:00 2001 From: Albert Cheng Date: Sat, 30 Mar 2013 00:55:15 -0500 Subject: [svn-r23497] Bug fix: HDFFV-8358 Change h5redeploy to change all 4 lines, prefix=..., exec_prefix=..., libdir=..., and includedir=... This way, it reset all 4 lines. Should work for both version of h5cc created by configure or by rpm. Tested: hand tested in jam. --- tools/misc/h5redeploy.in | 71 +++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 64 insertions(+), 7 deletions(-) diff --git a/tools/misc/h5redeploy.in b/tools/misc/h5redeploy.in index ae79b70..f90ff13 100644 --- a/tools/misc/h5redeploy.in +++ b/tools/misc/h5redeploy.in @@ -14,9 +14,10 @@ # access to either file, you may request a copy from help@hdfgroup.org. # -## Update HDF5 compiler tools after the HDF5 software has been installed -## in a new location. -## For help page, use "h5redeploy -help" +## Update HDF5 compiler tools after the HDF5 software has been installed ## +## in a new location. ## +## For help page, use "h5redeploy -help" ## +## ## # Constants definitions EXIT_SUCCESS=0 @@ -70,17 +71,38 @@ ERROR() # Main # +############################################################################ +## Installation directories: ## +## prefix architecture-independent files. ## +## exec_prefix architecture-dependent files, default is . ## +## libdir libraries, default is /lib. ## +## includedir header files, default is . ## +## Not used here: ## +## bindir executables, . ## +############################################################################ # Initialization h5tools="h5cc h5pcc h5fc h5pfc h5c++" # possible hdf5 tools foundtools= # tools found and will be modified fmode= # force mode, default is off -prefix=`(cd ..;pwd)` +prefix= +eprefix= +libdir= +includedir= # Parse options for arg in $@ ; do case "$arg" in -prefix=*) - prefix="`expr "$arg" : '-prefix=\(.*\)'`" + prefix="`echo $arg | cut -f2 -d=`" + ;; + -eprefix=*) + eprefix="`echo $arg | cut -f2 -d=`" + ;; + -libdir=*) + libdir="`echo $arg | cut -f2 -d=`" + ;; + -includedir=*) + includedir="`echo $arg | cut -f2 -d=`" ;; -echo) set -x @@ -89,7 +111,7 @@ for arg in $@ ; do SHOW="echo" ;; -tool=*) - h5tools="`expr "$arg" : '-tool=\(.*\)'`" + h5tools="`echo $arg | cut -f2 -d=`" ;; -help|help) usage @@ -105,11 +127,37 @@ for arg in $@ ; do esac done +# Set to default value if not given by user +if [ -z "$prefix" ]; then + prefix=`(cd ..;pwd)` +fi +if [ -z "$eprefix" ]; then + eprefix=$prefix +fi +if [ -z "$libdir" ]; then + libdir=$eprefix/lib +fi +if [ -z "$includedir" ]; then + includedir=$prefix/include +fi + # Sanity checks if [ ! -d $prefix ]; then ERROR "prefix($prefix) is not an existing directory" exit $EXIT_FAILURE fi +if [ ! -d $prefix ]; then + ERROR "prefix($prefix) is not an existing directory" + exit $EXIT_FAILURE +fi +if [ ! -d $prefix ]; then + ERROR "prefix($prefix) is not an existing directory" + exit $EXIT_FAILURE +fi +if [ ! -d $prefix ]; then + ERROR "prefix($prefix) is not an existing directory" + exit $EXIT_FAILURE +fi for x in $h5tools; do if [ -f $x ]; then @@ -144,9 +192,18 @@ fi CMDFILE=/tmp/h5redeploy.$$ touch $CMDFILE chmod 0600 $CMDFILE -echo "/^prefix/c" >> $CMDFILE +echo "/^prefix=/c" >> $CMDFILE echo prefix=\""$prefix"\" >> $CMDFILE echo . >> $CMDFILE +echo "/^exec_prefix=/c" >> $CMDFILE +echo exec_prefix=\""$eprefix"\" >> $CMDFILE +echo . >> $CMDFILE +echo "/^libdir=/c" >> $CMDFILE +echo libdir=\""$libdir"\" >> $CMDFILE +echo . >> $CMDFILE +echo "/^includedir=/c" >> $CMDFILE +echo includedir=\""$includedir"\" >> $CMDFILE +echo . >> $CMDFILE (echo w; echo q) >> $CMDFILE -- cgit v0.12 From cc3fdd8ba48633530114f45428dd63d1bdd14360 Mon Sep 17 00:00:00 2001 From: Scot Breitenfeld Date: Sun, 31 Mar 2013 21:03:05 -0500 Subject: [svn-r23505] reverted FFLAGS bug fix. Tested: jam (intel) --- configure | 1 + configure.ac | 1 + 2 files changed, 2 insertions(+) diff --git a/configure b/configure index f5bf889..77a76ae 100755 --- a/configure +++ b/configure @@ -5246,6 +5246,7 @@ if test "X$HDF_FORTRAN" = "Xyes"; then ## General Fortran flags ## Only add FFLAGS to FCFLAGS if it's set. if test "x$FFLAGS" != "x" ; then + AM_FCFLAGS="${AM_FCFLAGS} ${FFLAGS}" FCFLAGS="${FCFLAGS} ${FFLAGS}" fi diff --git a/configure.ac b/configure.ac index ff5151f..ad15bdf 100644 --- a/configure.ac +++ b/configure.ac @@ -436,6 +436,7 @@ if test "X$HDF_FORTRAN" = "Xyes"; then ## General Fortran flags ## Only add FFLAGS to FCFLAGS if it's set. if test "x$FFLAGS" != "x" ; then + AM_FCFLAGS="${AM_FCFLAGS} ${FFLAGS}" FCFLAGS="${FCFLAGS} ${FFLAGS}" fi -- cgit v0.12 From 581f5fc68d90b75e15043a0f13ac8664c49c61c9 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Mon, 1 Apr 2013 13:54:18 -0500 Subject: [svn-r23508] Removed some dead code that belonged to the multi dxpl functions that were removed in HDF5 1.8.11. Tested on: jam w/ fortran & C++, tested with check-vfd I did not test on other platforms (h5committest) since there is nothing even remotely platform-specific here. --- src/H5FDmulti.c | 28 ---------------------------- 1 file changed, 28 deletions(-) diff --git a/src/H5FDmulti.c b/src/H5FDmulti.c index 9d6e065..a3ce7f8 100644 --- a/src/H5FDmulti.c +++ b/src/H5FDmulti.c @@ -73,10 +73,6 @@ #define END_MEMBERS }} - -#define H5FD_MULTI_DXPL_PROP_NAME "H5FD_MULTI_DXPL" -#define H5FD_MULTI_DXPL_PROP_SIZE sizeof(H5FD_multi_dxpl_t) - #define H5FD_MULT_MAX_FILE_NAME_LEN 1024 /* The driver identification number, initialized at runtime */ @@ -1792,18 +1788,6 @@ H5FD_multi_read(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, /* Clear the error stack */ H5Eclear2(H5E_DEFAULT); - /* Get the data transfer properties */ - if(H5P_FILE_ACCESS_DEFAULT != dxpl_id) { - /* Check for existence of multi VFD DXPL property in DXPL */ - if((prop_exists = H5Pexist(dxpl_id, H5FD_MULTI_DXPL_PROP_NAME)) < 0) - H5Epush_ret(func, H5E_ERR_CLS, H5E_PLIST, H5E_CANTGET, "can't check for multi VFD property", -1) - - /* Get the DXPL value, if it exists */ - if(prop_exists) - if(H5Pget(dxpl_id, H5FD_MULTI_DXPL_PROP_NAME, &dx) < 0) - H5Epush_ret(func, H5E_ERR_CLS, H5E_PLIST, H5E_CANTGET, "can't get property value", -1) - } /* end if */ - /* Find the file to which this address belongs */ for(mt = H5FD_MEM_SUPER; mt < H5FD_MEM_NTYPES; mt = (H5FD_mem_t)(mt + 1)) { mmt = file->fa.memb_map[mt]; @@ -1856,18 +1840,6 @@ H5FD_multi_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, /* Clear the error stack */ H5Eclear2(H5E_DEFAULT); - /* Get the data transfer properties */ - if(H5P_FILE_ACCESS_DEFAULT != dxpl_id) { - /* Check for existence of multi VFD DXPL property in DXPL */ - if((prop_exists = H5Pexist(dxpl_id, H5FD_MULTI_DXPL_PROP_NAME)) < 0) - H5Epush_ret(func, H5E_ERR_CLS, H5E_PLIST, H5E_CANTGET, "can't check for multi VFD property", -1) - - /* Get the DXPL value, if it exists */ - if(prop_exists) - if(H5Pget(dxpl_id, H5FD_MULTI_DXPL_PROP_NAME, &dx) < 0) - H5Epush_ret(func, H5E_ERR_CLS, H5E_PLIST, H5E_CANTGET, "can't get property value", -1) - } /* end if */ - /* Find the file to which this address belongs */ for(mt = H5FD_MEM_SUPER; mt < H5FD_MEM_NTYPES; mt = (H5FD_mem_t)(mt + 1)) { mmt = file->fa.memb_map[mt]; -- cgit v0.12 From 47a25f0d0ca3d10d1396cf0dda7ad5302d896722 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Mon, 1 Apr 2013 14:05:15 -0500 Subject: [svn-r23509] Duplicated Bin-Minh's changes in the 1.8 branch (r23503) that delete the removed multi dxpl function names from the class. Tested on: jam w/ fortran & C++ I did not test on other platforms (h5committest) since there is nothing even remotely platform-specific here. --- c++/src/H5DxferProp.h | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/c++/src/H5DxferProp.h b/c++/src/H5DxferProp.h index 66216d8..bf481c3 100644 --- a/c++/src/H5DxferProp.h +++ b/c++/src/H5DxferProp.h @@ -66,12 +66,6 @@ class H5_DLLCPP DSetMemXferPropList : public PropList { void getVlenMemManager( H5MM_allocate_t& alloc, void** alloc_info, H5MM_free_t& free, void** free_info ) const; - // Sets the data transfer property list for the multi-file driver. - void setMulti(const hid_t *memb_dxpl); - - // Returns multi-file data transfer property list information. - void getMulti(hid_t *memb_dxpl); - // Sets the size of a contiguous block reserved for small data. void setSmallDataBlockSize(hsize_t size); @@ -109,3 +103,4 @@ class H5_DLLCPP DSetMemXferPropList : public PropList { } #endif #endif + -- cgit v0.12 From e679eed61b59bd5e434b43ca749e6c885020afb2 Mon Sep 17 00:00:00 2001 From: Larry Knox Date: Mon, 1 Apr 2013 17:45:02 -0500 Subject: [svn-r23511] Replaced install-data-local with install-exec-hook in test/Makefile.am. tested with h5committest --- test/Makefile.am | 2 +- test/Makefile.in | 15 ++++++++------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/test/Makefile.am b/test/Makefile.am index ec0f416..54bc4d2 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -85,7 +85,7 @@ if HAVE_SHARED_CONDITIONAL libdynlib1_la_SOURCES=dynlib1.c libdynlib2_la_SOURCES=dynlib2.c -install-data-local: +install-exec-hook: $(RM) $(DESTDIR)$(libdir)/*dynlib* else diff --git a/test/Makefile.in b/test/Makefile.in index 49b8d70..f0817f5 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -1574,7 +1574,7 @@ distclean-generic: maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -@HAVE_SHARED_CONDITIONAL_FALSE@install-data-local: +@HAVE_SHARED_CONDITIONAL_FALSE@install-exec-hook: clean: clean-am clean-am: clean-checkPROGRAMS clean-generic clean-libLTLIBRARIES \ @@ -1599,14 +1599,15 @@ info: info-am info-am: -install-data-am: install-data-local +install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-libLTLIBRARIES - + @$(NORMAL_INSTALL) + $(MAKE) $(AM_MAKEFLAGS) install-exec-hook install-html: install-html-am install-html-am: @@ -1647,7 +1648,7 @@ ps-am: uninstall-am: uninstall-libLTLIBRARIES -.MAKE: check-am install-am install-strip +.MAKE: check-am install-am install-exec-am install-strip .PHONY: CTAGS GTAGS all all-am all-local check check-TESTS check-am \ clean clean-checkPROGRAMS clean-generic clean-libLTLIBRARIES \ @@ -1655,8 +1656,8 @@ uninstall-am: uninstall-libLTLIBRARIES cscopelist ctags distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ - install-data-am install-data-local install-dvi install-dvi-am \ - install-exec install-exec-am install-html install-html-am \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-exec-hook install-html install-html-am \ install-info install-info-am install-libLTLIBRARIES \ install-man install-pdf install-pdf-am install-ps \ install-ps-am install-strip installcheck installcheck-am \ @@ -1682,7 +1683,7 @@ help: @HAVE_SHARED_CONDITIONAL_TRUE@ # The libdynlib1 and libdynlib2 library for testing plugin module plugin.c. @HAVE_SHARED_CONDITIONAL_TRUE@ # Build it as shared library if configure is enabled for shared library. -@HAVE_SHARED_CONDITIONAL_TRUE@install-data-local: +@HAVE_SHARED_CONDITIONAL_TRUE@install-exec-hook: @HAVE_SHARED_CONDITIONAL_TRUE@ $(RM) $(DESTDIR)$(libdir)/*dynlib* @HAVE_SHARED_CONDITIONAL_FALSE@ # The libh5test library provides common support code for the tests. -- cgit v0.12 From 72e84fcd8253661a3cee60f4adcbb9c0b4999067 Mon Sep 17 00:00:00 2001 From: Raymond Lu Date: Mon, 1 Apr 2013 18:28:48 -0500 Subject: [svn-r23513] I added a test case in plugin.c for testing using filter for groups and created a dummy filter library for this test case. Tested on jam and koala. --- src/H5Zpublic.h | 4 ---- test/Makefile.am | 3 ++- test/Makefile.in | 28 +++++++++++++++++-------- test/dynlib1.c | 2 ++ test/dynlib2.c | 2 ++ test/plugin.c | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++++---- 6 files changed, 84 insertions(+), 17 deletions(-) diff --git a/src/H5Zpublic.h b/src/H5Zpublic.h index c7c3562..8daa5f4 100644 --- a/src/H5Zpublic.h +++ b/src/H5Zpublic.h @@ -43,10 +43,6 @@ typedef int H5Z_filter_t; #define H5Z_FILTER_SCALEOFFSET 6 /*scale+offset compression */ #define H5Z_FILTER_RESERVED 256 /*filter ids below this value are reserved for library use */ -/* Filters for HDF5 internal test */ -#define H5Z_FILTER_DYNLIB1 257 -#define H5Z_FILTER_DYNLIB2 258 - #define H5Z_FILTER_MAX 65535 /*maximum filter id */ /* General macros */ diff --git a/test/Makefile.am b/test/Makefile.am index 54bc4d2..ac5d169 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -81,9 +81,10 @@ if HAVE_SHARED_CONDITIONAL # The libdynlib1 and libdynlib2 library for testing plugin module plugin.c. # Build it as shared library if configure is enabled for shared library. - lib_LTLIBRARIES=libdynlib1.la libdynlib2.la + lib_LTLIBRARIES=libdynlib1.la libdynlib2.la libdynlib3.la libdynlib1_la_SOURCES=dynlib1.c libdynlib2_la_SOURCES=dynlib2.c + libdynlib3_la_SOURCES=dynlib3.c install-exec-hook: $(RM) $(DESTDIR)$(libdir)/*dynlib* diff --git a/test/Makefile.in b/test/Makefile.in index f0817f5..65c0fca 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -139,6 +139,12 @@ am__libdynlib2_la_SOURCES_DIST = dynlib2.c libdynlib2_la_OBJECTS = $(am_libdynlib2_la_OBJECTS) @HAVE_SHARED_CONDITIONAL_TRUE@am_libdynlib2_la_rpath = -rpath \ @HAVE_SHARED_CONDITIONAL_TRUE@ $(libdir) +libdynlib3_la_LIBADD = +am__libdynlib3_la_SOURCES_DIST = dynlib3.c +@HAVE_SHARED_CONDITIONAL_TRUE@am_libdynlib3_la_OBJECTS = dynlib3.lo +libdynlib3_la_OBJECTS = $(am_libdynlib3_la_OBJECTS) +@HAVE_SHARED_CONDITIONAL_TRUE@am_libdynlib3_la_rpath = -rpath \ +@HAVE_SHARED_CONDITIONAL_TRUE@ $(libdir) libh5test_la_LIBADD = am_libh5test_la_OBJECTS = h5test.lo testframe.lo cache_common.lo libh5test_la_OBJECTS = $(am_libh5test_la_OBJECTS) @@ -517,12 +523,13 @@ am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(libdynlib1_la_SOURCES) $(libdynlib2_la_SOURCES) \ - $(libh5test_la_SOURCES) accum.c app_ref.c big.c bittests.c \ - btree2.c cache.c cache_api.c cache_tagging.c cmpd_dset.c \ - cross_read.c dangle.c dsets.c dt_arith.c dtransform.c dtypes.c \ - earray.c efc.c enc_dec_plist.c enc_dec_plist_with_endianess.c \ - enum.c err_compat.c error_test.c extend.c external.c farray.c \ - fheap.c file_image.c fillval.c filter_fail.c flush1.c flush2.c \ + $(libdynlib3_la_SOURCES) $(libh5test_la_SOURCES) accum.c \ + app_ref.c big.c bittests.c btree2.c cache.c cache_api.c \ + cache_tagging.c cmpd_dset.c cross_read.c dangle.c dsets.c \ + dt_arith.c dtransform.c dtypes.c earray.c efc.c \ + enc_dec_plist.c enc_dec_plist_with_endianess.c enum.c \ + err_compat.c error_test.c extend.c external.c farray.c fheap.c \ + file_image.c fillval.c filter_fail.c flush1.c flush2.c \ freespace.c gen_bad_ohdr.c gen_bogus.c gen_cross.c \ gen_deflate.c gen_file_image.c gen_filespace.c gen_filters.c \ gen_new_array.c gen_new_fill.c gen_new_group.c gen_new_mtime.c \ @@ -534,7 +541,8 @@ SOURCES = $(libdynlib1_la_SOURCES) $(libdynlib2_la_SOURCES) \ tcheck_version.c $(testhdf5_SOURCES) testmeta.c \ $(ttsafe_SOURCES) unlink.c vfd.c DIST_SOURCES = $(am__libdynlib1_la_SOURCES_DIST) \ - $(am__libdynlib2_la_SOURCES_DIST) $(libh5test_la_SOURCES) \ + $(am__libdynlib2_la_SOURCES_DIST) \ + $(am__libdynlib3_la_SOURCES_DIST) $(libh5test_la_SOURCES) \ accum.c app_ref.c big.c bittests.c btree2.c cache.c \ cache_api.c cache_tagging.c cmpd_dset.c cross_read.c dangle.c \ dsets.c dt_arith.c dtransform.c dtypes.c earray.c efc.c \ @@ -911,9 +919,10 @@ BUILD_ALL_PROGS = gen_bad_ohdr gen_bogus gen_cross gen_deflate gen_filters gen_n @HAVE_SHARED_CONDITIONAL_FALSE@noinst_LTLIBRARIES = libh5test.la @HAVE_SHARED_CONDITIONAL_TRUE@noinst_LTLIBRARIES = libh5test.la -@HAVE_SHARED_CONDITIONAL_TRUE@lib_LTLIBRARIES = libdynlib1.la libdynlib2.la +@HAVE_SHARED_CONDITIONAL_TRUE@lib_LTLIBRARIES = libdynlib1.la libdynlib2.la libdynlib3.la @HAVE_SHARED_CONDITIONAL_TRUE@libdynlib1_la_SOURCES = dynlib1.c @HAVE_SHARED_CONDITIONAL_TRUE@libdynlib2_la_SOURCES = dynlib2.c +@HAVE_SHARED_CONDITIONAL_TRUE@libdynlib3_la_SOURCES = dynlib3.c libh5test_la_SOURCES = h5test.c testframe.c cache_common.c # Use libhd5test.la to compile all of the tests @@ -1050,6 +1059,8 @@ libdynlib1.la: $(libdynlib1_la_OBJECTS) $(libdynlib1_la_DEPENDENCIES) $(EXTRA_li $(AM_V_CCLD)$(LINK) $(am_libdynlib1_la_rpath) $(libdynlib1_la_OBJECTS) $(libdynlib1_la_LIBADD) $(LIBS) libdynlib2.la: $(libdynlib2_la_OBJECTS) $(libdynlib2_la_DEPENDENCIES) $(EXTRA_libdynlib2_la_DEPENDENCIES) $(AM_V_CCLD)$(LINK) $(am_libdynlib2_la_rpath) $(libdynlib2_la_OBJECTS) $(libdynlib2_la_LIBADD) $(LIBS) +libdynlib3.la: $(libdynlib3_la_OBJECTS) $(libdynlib3_la_DEPENDENCIES) $(EXTRA_libdynlib3_la_DEPENDENCIES) + $(AM_V_CCLD)$(LINK) $(am_libdynlib3_la_rpath) $(libdynlib3_la_OBJECTS) $(libdynlib3_la_LIBADD) $(LIBS) libh5test.la: $(libh5test_la_OBJECTS) $(libh5test_la_DEPENDENCIES) $(EXTRA_libh5test_la_DEPENDENCIES) $(AM_V_CCLD)$(LINK) $(am_libh5test_la_rpath) $(libh5test_la_OBJECTS) $(libh5test_la_LIBADD) $(LIBS) @@ -1320,6 +1331,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dtypes.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dynlib1.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dynlib2.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dynlib3.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/earray.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/efc.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/enc_dec_plist.Po@am__quote@ diff --git a/test/dynlib1.c b/test/dynlib1.c index 2e0c593..e252623 100644 --- a/test/dynlib1.c +++ b/test/dynlib1.c @@ -24,6 +24,8 @@ #include #include +#define H5Z_FILTER_DYNLIB1 257 + static size_t H5Z_filter_dynlib1(unsigned int flags, size_t cd_nelmts, const unsigned int *cd_values, size_t nbytes, size_t *buf_size, void **buf); diff --git a/test/dynlib2.c b/test/dynlib2.c index b1c1707..1ee6ed7 100644 --- a/test/dynlib2.c +++ b/test/dynlib2.c @@ -25,6 +25,8 @@ #include #include +#define H5Z_FILTER_DYNLIB2 258 + static size_t H5Z_filter_dynlib2(unsigned int flags, size_t cd_nelmts, const unsigned int *cd_values, size_t nbytes, size_t *buf_size, void **buf); diff --git a/test/plugin.c b/test/plugin.c index 4fc8115..6f85dd4 100644 --- a/test/plugin.c +++ b/test/plugin.c @@ -34,6 +34,7 @@ /* Filters for HDF5 internal test */ #define H5Z_FILTER_DYNLIB1 257 #define H5Z_FILTER_DYNLIB2 258 +#define H5Z_FILTER_DYNLIB3 259 /* Bzip2 filter */ #define H5Z_FILTER_BZIP2 307 @@ -65,6 +66,8 @@ const char *FILENAME[] = { /* Limit random number within 20000 */ #define RANDOM_LIMIT 20000 +#define ITER 100 + int points_deflate[DSET_DIM1][DSET_DIM2], points_dynlib1[DSET_DIM1][DSET_DIM2], points_dynlib2[DSET_DIM1][DSET_DIM2], @@ -329,7 +332,7 @@ error: } /*------------------------------------------------------------------------- - * Function: test_filters + * Function: test_filters_for_datasets * * Purpose: Tests creating datasets and writing data with dynamically * loaded filters @@ -343,7 +346,7 @@ error: *------------------------------------------------------------------------- */ static herr_t -test_filters(hid_t file, hid_t fapl) +test_filters_for_datasets(hid_t file, hid_t fapl) { hid_t dc; /* Dataset creation property list ID */ const hsize_t chunk_size[2] = {FILTER_CHUNK_DIM1, FILTER_CHUNK_DIM2}; /* Chunk dimensions */ @@ -529,6 +532,55 @@ error: return -1; } +/*------------------------------------------------------------------------- + * Function: test_filters_for_groups + * + * Purpose: Tests creating group with dynamically loaded filters + * + * Return: Success: 0 + * Failure: -1 + * + * Programmer: Raymond Lu + * 1 April 2013 + * + *------------------------------------------------------------------------- + */ +static herr_t +test_filters_for_groups(hid_t file, hid_t fapl) +{ + hid_t gcpl, gid, group; + int i; + char name[256]; + + puts("Testing DYNLIB3 filter for group"); + + if((gcpl = H5Pcreate(H5P_GROUP_CREATE)) < 0) goto error; + + if(H5Pset_filter (gcpl, H5Z_FILTER_DYNLIB3, H5Z_FLAG_MANDATORY, (size_t)0, NULL) < 0) goto error; + + /* Create a group using this filter */ + if((gid = H5Gcreate2(file, "group1", H5P_DEFAULT, gcpl, H5P_DEFAULT)) < 0) goto error; + + for (i=0; i < ITER; i++) { + sprintf(name, "group_%d", i); + if((group = H5Gcreate (gid, name, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto error; + if(H5Gclose(group) < 0) goto error; + } + + /* Close the group */ + if(H5Gclose(gid) < 0) goto error; + + /* Clean up objects used for this test */ + if(H5Pclose (gcpl) < 0) goto error; + + PASSED(); + + return 0; + +error: + return -1; +} + /*------------------------------------------------------------------------- * Function: main @@ -593,8 +645,10 @@ main(void) if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, my_fapl)) < 0) TEST_ERROR - /* Test dynamically loaded filters */ - nerrors += (test_filters(file, my_fapl) < 0 ? 1 : 0); + /* Test dynamically loaded filters for chunked dataset */ + nerrors += (test_filters_for_datasets(file, my_fapl) < 0 ? 1 : 0); + + nerrors += (test_filters_for_groups(file, my_fapl) < 0 ? 1 : 0); if(H5Fclose(file) < 0) TEST_ERROR -- cgit v0.12 From 075334af966e34ba1a701a57cdcd4b78fc2cb790 Mon Sep 17 00:00:00 2001 From: Raymond Lu Date: Mon, 1 Apr 2013 18:30:08 -0500 Subject: [svn-r23514] I forgot to add the new file dynlib3.c in last commit. --- test/dynlib3.c | 83 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 test/dynlib3.c diff --git a/test/dynlib3.c b/test/dynlib3.c new file mode 100644 index 0000000..d1c57d2 --- /dev/null +++ b/test/dynlib3.c @@ -0,0 +1,83 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by The HDF Group. * + * Copyright by the Board of Trustees of the University of Illinois. * + * 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 files COPYING and Copyright.html. COPYING can be found at the root * + * of the source code distribution tree; Copyright.html can be found at the * + * root level of an installed copy of the electronic HDF5 document set and * + * is linked from the top-level documents page. It can also be found at * + * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * + * access to either file, you may request a copy from help@hdfgroup.org. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* + * Programmer: Raymond Lu + * 1 April 2013 + * + * Purpose: Tests the plugin module (H5PL) + */ + +#include +#include +#include + +#define H5Z_FILTER_DYNLIB3 259 + +static size_t H5Z_filter_dynlib3(unsigned int flags, size_t cd_nelmts, + const unsigned int *cd_values, size_t nbytes, size_t *buf_size, void **buf); + +/* This message derives from H5Z */ +const H5Z_class2_t H5Z_DYNLIB3[1] = {{ + H5Z_CLASS_T_VERS, /* H5Z_class_t version */ + H5Z_FILTER_DYNLIB3, /* Filter id number */ + 1, 1, /* Encoding and decoding enabled */ + "dynlib3", /* Filter name for debugging */ + NULL, /* The "can apply" callback */ + NULL, /* The "set local" callback */ + (H5Z_func_t)H5Z_filter_dynlib3, /* The actual filter function */ +}}; + +const H5PL_type_t H5PL_get_plugin_type(void) {return H5PL_TYPE_FILTER;} +const H5Z_class2_t* H5PL_get_plugin_info(void) {return H5Z_DYNLIB3;} + +/*------------------------------------------------------------------------- + * Function: H5Z_filter_dynlib3 + * + * Purpose: A dynlib3 filter method that adds on and subtract from + * the original value with another value. It will be built + * as a shared library. plugin.c test will load and use + * this filter library. + * + * Return: Success: Data chunk size + * + * Failure: 0 + * + * Programmer: Robb Matzke + * 1 April 2013 + * + *------------------------------------------------------------------------- + */ +static size_t +H5Z_filter_dynlib3(unsigned int flags, size_t cd_nelmts, + const unsigned int *cd_values, size_t nbytes, + size_t *buf_size, void **buf) +{ + int *int_ptr=(int *)*buf; /* Pointer to the data values */ + size_t buf_left=*buf_size; /* Amount of data buffer left to process */ + int add_on = 0; + + /* Check for the correct number of parameters */ + if(cd_nelmts>0) + return(0); + + if(flags & H5Z_FLAG_REVERSE) { /*read*/ + ; + } else { /*write*/ + ; + } /* end else */ + + return nbytes; +} -- cgit v0.12 From 46b63fe7d875e2dc096165f9837a2a820fb0022d Mon Sep 17 00:00:00 2001 From: Raymond Lu Date: Mon, 1 Apr 2013 18:38:40 -0500 Subject: [svn-r23515] I added test/dynlib3.c. --- MANIFEST | 1 + 1 file changed, 1 insertion(+) diff --git a/MANIFEST b/MANIFEST index 4fde6b7..a1ae698 100644 --- a/MANIFEST +++ b/MANIFEST @@ -963,6 +963,7 @@ ./test/dtransform.c ./test/dynlib1.c ./test/dynlib2.c +./test/dynlib3.c ./test/earray.c ./test/efc.c ./test/enc_dec_plist.c -- cgit v0.12 From 1b6963230b1c096ff186137bf8bace27a7e8bc07 Mon Sep 17 00:00:00 2001 From: Scot Breitenfeld Date: Mon, 1 Apr 2013 19:58:44 -0500 Subject: [svn-r23516] Updated documentation. --- fortran/src/H5Off.f90 | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/fortran/src/H5Off.f90 b/fortran/src/H5Off.f90 index 1437e9f..8a40079 100644 --- a/fortran/src/H5Off.f90 +++ b/fortran/src/H5Off.f90 @@ -191,7 +191,7 @@ CONTAINS SUBROUTINE h5oclose_f(object_id, hdferr) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: object_id - INTEGER , INTENT(OUT) :: hdferr + INTEGER , INTENT(OUT) :: hdferr !***** INTERFACE INTEGER FUNCTION h5oclose_c(object_id) @@ -565,7 +565,7 @@ CONTAINS ! obj_id - Object identifier. ! ! Outputs: -! hdferr - Returns 0 if successful and -1 if fails. +! hdferr - Returns 0 if successful and -1 if fails. ! ! AUTHOR ! M. Scot Breitenfeld @@ -717,16 +717,16 @@ CONTAINS ! Sets comment for specified object. ! ! Inputs: -! loc_id - Identifier of a file, group, dataset, or named datatype. -! name - Name of the object whose comment is to be set or reset, +! loc_id - Identifier of a file, group, dataset, or named datatype. +! name - Name of the object whose comment is to be set or reset, ! specified as a path relative to loc_id. -! comment - The new comment. +! comment - The new comment. ! ! Outputs: -! hdferr - Returns 0 if successful and -1 if fails. +! hdferr - Returns 0 if successful and -1 if fails. ! ! Optional parameters: -! lapl_id - Link access property list identifier. +! lapl_id - Link access property list identifier. ! ! AUTHOR ! M. Scot Breitenfeld -- cgit v0.12 From fc4c7a05f644fe1183bf8e7944dd7f66c9eb9e85 Mon Sep 17 00:00:00 2001 From: Albert Cheng Date: Tue, 2 Apr 2013 00:07:20 -0500 Subject: [svn-r23517] Rewrirte part of the script that copy the libdynlib libraries and check for result. h5committested. (Cmake in Duck has errors but the error are not related to this change. --- test/test_plugin.sh.in | 38 +++++++++++++++++++++++++++++++++----- 1 file changed, 33 insertions(+), 5 deletions(-) diff --git a/test/test_plugin.sh.in b/test/test_plugin.sh.in index 1d06956..1a3dfc1 100644 --- a/test/test_plugin.sh.in +++ b/test/test_plugin.sh.in @@ -24,13 +24,20 @@ TOP_BUILDDIR=@top_builddir@ # Determine backward compatibility options enabled DEPRECATED_SYMBOLS="@DEPRECATED_SYMBOLS@" +EXIT_SUCCESS=0 +EXIT_FAILURE=1 + nerrors=0 verbose=yes +exit_code=$EXIT_SUCCESS TEST_NAME=plugin TEST_BIN=`pwd`/$TEST_NAME -CP="cp .libs/libdynlib2.so.* /tmp" -ENVCMD="env HDF5_PLUGIN_PATH=/tmp:`pwd`/.libs" +FROM_DIR=`pwd`/.libs +PLUGIN_LIB2="$FROM_DIR/libdynlib2.so.*" +PLUGIN_LIBDIR2=testdir2 +CP="cp -p" # Use -p to preserve mode,ownership,timestamps +RM="rm -rf" # Print a line-line message left justified in a field of 70 characters # beginning with the word "Testing". @@ -41,8 +48,25 @@ TESTING() { } # Main Body +# Create test directory if not exists yet. +test -d $PLUGIN_LIBDIR2 || mkdir -p $PLUGIN_LIBDIR2 +if [ $? != 0 ]; then + echo "Failed to create test directory($PLUGIN_LIBDIR2)" + exit $EXIT_FAILURE +fi + +# copy plugin library for test +$CP $PLUGIN_LIB2 $PLUGIN_LIBDIR2 +if [ $? != 0 ]; then + echo "Failed to copy plugin library ($PLUGIN_LIB2) for test." + exit $EXIT_FAILURE +fi + +# setup plugin path +ENVCMD="env HDF5_PLUGIN_PATH=${PLUGIN_LIBDIR2}:$FROM_DIR" + # Run the test -$CP; $ENVCMD $TEST_BIN +$ENVCMD $TEST_BIN if [ $? != 0 ]; then nerrors=`expr $nerrors + 1` fi @@ -50,8 +74,12 @@ fi # print results if test $nerrors -ne 0 ; then echo "$nerrors errors encountered" - exit 1 + exit_code=$EXIT_FAILURE else echo "All Plugin API tests passed." - exit 0 + exit_code=$EXIT_SUCCESS fi + +# Clean up temporary files/directories and leave +$RM $PLUGIN_LIBDIR2 +exit $exit_code -- cgit v0.12 From b8c258a9700e6633b681891794458e57598d55ae Mon Sep 17 00:00:00 2001 From: Raymond Lu Date: Tue, 2 Apr 2013 11:12:20 -0500 Subject: [svn-r23519] I used H5Gcreate instead of H5Gcreate2 in plugin.c. I corrected it and added some real operation in the dummy filter library dynlib3.c. Tested on jam and koala. --- test/dynlib1.c | 2 +- test/dynlib3.c | 41 +++++++++++++++++++++++++++----------- test/plugin.c | 62 +++++++++++++++++++++++++++++++++++++++++++++++++++------- 3 files changed, 86 insertions(+), 19 deletions(-) diff --git a/test/dynlib1.c b/test/dynlib1.c index e252623..69d0bdd 100644 --- a/test/dynlib1.c +++ b/test/dynlib1.c @@ -55,7 +55,7 @@ const H5Z_class2_t* H5PL_get_plugin_info(void) {return H5Z_DYNLIB1;} * * Failure: 0 * - * Programmer: Robb Matzke + * Programmer: Raymond Lu * 29 March 2013 * *------------------------------------------------------------------------- diff --git a/test/dynlib3.c b/test/dynlib3.c index d1c57d2..e040052 100644 --- a/test/dynlib3.c +++ b/test/dynlib3.c @@ -22,9 +22,12 @@ #include #include +#include #include #define H5Z_FILTER_DYNLIB3 259 +#define SUFFIX_LEN 8 +#define GROUP_SUFFIX ".h5group" static size_t H5Z_filter_dynlib3(unsigned int flags, size_t cd_nelmts, const unsigned int *cd_values, size_t nbytes, size_t *buf_size, void **buf); @@ -46,16 +49,15 @@ const H5Z_class2_t* H5PL_get_plugin_info(void) {return H5Z_DYNLIB3;} /*------------------------------------------------------------------------- * Function: H5Z_filter_dynlib3 * - * Purpose: A dynlib3 filter method that adds on and subtract from - * the original value with another value. It will be built - * as a shared library. plugin.c test will load and use - * this filter library. + * Purpose: A dynlib3 filter method that is used to test groups. It + * appends the suffix ".h5group" to each group name during + * write and takes it out during read. * * Return: Success: Data chunk size * * Failure: 0 * - * Programmer: Robb Matzke + * Programmer: Raymond Lu * 1 April 2013 * *------------------------------------------------------------------------- @@ -65,19 +67,36 @@ H5Z_filter_dynlib3(unsigned int flags, size_t cd_nelmts, const unsigned int *cd_values, size_t nbytes, size_t *buf_size, void **buf) { - int *int_ptr=(int *)*buf; /* Pointer to the data values */ - size_t buf_left=*buf_size; /* Amount of data buffer left to process */ - int add_on = 0; + size_t ret_value; /* Return value */ /* Check for the correct number of parameters */ if(cd_nelmts>0) return(0); if(flags & H5Z_FLAG_REVERSE) { /*read*/ - ; + ret_value = *buf_size = nbytes - SUFFIX_LEN; } else { /*write*/ - ; + void *outbuf = NULL; /* Pointer to new buffer */ + unsigned char *dst; /* Temporary pointer to destination buffer */ + + dst=outbuf=malloc(nbytes+SUFFIX_LEN); + + /* Copy raw data */ + memcpy((void*)dst, (void*)(*buf), nbytes); + + /* Append suffix to raw data for storage */ + dst += nbytes; + memcpy((void*)dst, (void*)GROUP_SUFFIX, SUFFIX_LEN); + + /* Free input buffer */ + free(*buf); + + /* Set return values */ + *buf_size = nbytes + SUFFIX_LEN; + *buf = outbuf; + outbuf = NULL; + ret_value = *buf_size; } /* end else */ - return nbytes; + return ret_value; } diff --git a/test/plugin.c b/test/plugin.c index 6f85dd4..4f28520 100644 --- a/test/plugin.c +++ b/test/plugin.c @@ -66,7 +66,7 @@ const char *FILENAME[] = { /* Limit random number within 20000 */ #define RANDOM_LIMIT 20000 -#define ITER 100 +#define GROUP_ITERATION 1000 int points_deflate[DSET_DIM1][DSET_DIM2], points_dynlib1[DSET_DIM1][DSET_DIM2], @@ -550,20 +550,22 @@ test_filters_for_groups(hid_t file, hid_t fapl) { hid_t gcpl, gid, group; int i; - char name[256]; + char gname[256]; - puts("Testing DYNLIB3 filter for group"); + TESTING("Testing DYNLIB3 filter for group"); if((gcpl = H5Pcreate(H5P_GROUP_CREATE)) < 0) goto error; - + + /* Use DYNLIB3 for creating groups */ if(H5Pset_filter (gcpl, H5Z_FILTER_DYNLIB3, H5Z_FLAG_MANDATORY, (size_t)0, NULL) < 0) goto error; /* Create a group using this filter */ if((gid = H5Gcreate2(file, "group1", H5P_DEFAULT, gcpl, H5P_DEFAULT)) < 0) goto error; - for (i=0; i < ITER; i++) { - sprintf(name, "group_%d", i); - if((group = H5Gcreate (gid, name, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto error; + /* Create multiple groups under "group1" */ + for (i=0; i < GROUP_ITERATION; i++) { + sprintf(gname, "group_%d", i); + if((group = H5Gcreate2(gid, gname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto error; if(H5Gclose(group) < 0) goto error; } @@ -581,6 +583,49 @@ error: return -1; } +/*------------------------------------------------------------------------- + * Function: test_groups_with_filters + * + * Purpose: Tests opening group with dynamically loaded filters + * + * Return: Success: 0 + * Failure: -1 + * + * Programmer: Raymond Lu + * 1 April 2013 + * + *------------------------------------------------------------------------- + */ +static herr_t +test_groups_with_filters(hid_t file, hid_t fapl) +{ + hid_t gcpl, gid, group; + int i; + char gname[256]; + + TESTING("Testing opening groups with DYNLIB3 filter"); + + /* Open the top group */ + if((gid = H5Gopen2(file, "group1", H5P_DEFAULT)) < 0) goto error; + + /* Create multiple groups under "group1" */ + for (i=0; i < GROUP_ITERATION; i++) { + sprintf(gname, "group_%d", i); + if((group = H5Gopen2(gid, gname, H5P_DEFAULT)) < 0) goto error; + if(H5Gclose(group) < 0) goto error; + } + + /* Close the group */ + if(H5Gclose(gid) < 0) goto error; + + PASSED(); + + return 0; + +error: + return -1; +} + /*------------------------------------------------------------------------- * Function: main @@ -671,6 +716,9 @@ main(void) /* Read the data with filters */ nerrors += (test_read_with_filters(file, fapl) < 0 ? 1 : 0); + /* Open the groups with filters */ + nerrors += (test_groups_with_filters(file, fapl) < 0 ? 1 : 0); + if(H5Fclose(file) < 0) TEST_ERROR -- cgit v0.12 From 91831f41ad8c6fe7d88cf44d7384176a9d0751f5 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 2 Apr 2013 11:27:46 -0500 Subject: [svn-r23520] Add new plugin library to build list for test. Tested: local linux, windows --- test/CMakeLists.txt | 70 ++++++++++++++++++++++++++++------------------------- 1 file changed, 37 insertions(+), 33 deletions(-) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 75f398d..3d958ca 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -41,44 +41,48 @@ SET_TARGET_PROPERTIES (${HDF5_TEST_LIB_TARGET} PROPERTIES FOLDER libraries/test) # If plugin library tests can be tested #----------------------------------------------------------------------------- IF (BUILD_SHARED_LIBS) - SET (HDF5_TEST_PLUGIN_LIB_CORENAME "dynlib1") - SET (HDF5_TEST_PLUGIN_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_TEST_PLUGIN_LIB_CORENAME}") - SET (HDF5_TEST_PLUGIN_LIB_TARGET ${HDF5_TEST_PLUGIN_LIB_CORENAME}) - ADD_DEFINITIONS (${HDF5_EXTRA_C_FLAGS}) - INCLUDE_DIRECTORIES (${HDF5_SRC_DIR}) - #----------------------------------------------------------------------------- - # Define Sources - #----------------------------------------------------------------------------- - - SET (H5_TEST_PLUGIN_LIB_SRCS - ${HDF5_TEST_SOURCE_DIR}/dynlib1.c - ) - - ADD_LIBRARY (${HDF5_TEST_PLUGIN_LIB_TARGET} ${LIB_TYPE} ${H5_TEST_PLUGIN_LIB_SRCS}) - TARGET_LINK_LIBRARIES (${HDF5_TEST_PLUGIN_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) - H5_SET_LIB_OPTIONS ( - ${HDF5_TEST_PLUGIN_LIB_TARGET} ${HDF5_TEST_PLUGIN_LIB_NAME} - ${LIB_TYPE} - HDF5_TEST_PLUGIN_LIB_NAME_RELEASE - HDF5_TEST_PLUGIN_LIB_NAME_DEBUG - ) - SET_TARGET_PROPERTIES (${HDF5_TEST_PLUGIN_LIB_TARGET} PROPERTIES FOLDER libraries/TEST_PLUGIN) + # make plugins dir + FILE (MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/plugins") #----------------------------------------------------------------------------- - # Copy plugin library to a plugins folder + # Define Test Library Sources #----------------------------------------------------------------------------- - - # make plugins dir - FILE (MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/plugins") - ADD_CUSTOM_COMMAND ( - TARGET ${HDF5_TEST_PLUGIN_LIB_TARGET} - POST_BUILD - COMMAND ${CMAKE_COMMAND} - ARGS -E copy_if_different - "$" - "${CMAKE_BINARY_DIR}/plugins/$" + SET (TEST_PLUGIN_LIBS + dynlib1 + dynlib2 + dynlib3 ) + + FOREACH (test_lib ${TEST_PLUGIN_LIBS}) + SET (HDF5_TEST_PLUGIN_LIB_CORENAME "${test_lib}") + SET (HDF5_TEST_PLUGIN_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_TEST_PLUGIN_LIB_CORENAME}") + SET (HDF5_TEST_PLUGIN_LIB_TARGET ${HDF5_TEST_PLUGIN_LIB_CORENAME}) + ADD_DEFINITIONS (${HDF5_EXTRA_C_FLAGS}) + INCLUDE_DIRECTORIES (${HDF5_SRC_DIR}) + + ADD_LIBRARY (${HDF5_TEST_PLUGIN_LIB_TARGET} ${LIB_TYPE} ${HDF5_TEST_SOURCE_DIR}/${test_lib}.c) + TARGET_LINK_LIBRARIES (${HDF5_TEST_PLUGIN_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) + H5_SET_LIB_OPTIONS ( + ${HDF5_TEST_PLUGIN_LIB_TARGET} ${HDF5_TEST_PLUGIN_LIB_NAME} + ${LIB_TYPE} + HDF5_TEST_PLUGIN_LIB_NAME_RELEASE + HDF5_TEST_PLUGIN_LIB_NAME_DEBUG + ) + SET_TARGET_PROPERTIES (${HDF5_TEST_PLUGIN_LIB_TARGET} PROPERTIES FOLDER libraries/TEST_PLUGIN) + + #----------------------------------------------------------------------------- + # Copy plugin library to a plugins folder + #----------------------------------------------------------------------------- + ADD_CUSTOM_COMMAND ( + TARGET ${HDF5_TEST_PLUGIN_LIB_TARGET} + POST_BUILD + COMMAND ${CMAKE_COMMAND} + ARGS -E copy_if_different + "$" + "${CMAKE_BINARY_DIR}/plugins/$" + ) + ENDFOREACH (test_lib ${TEST_PLUGIN_LIBS}) ENDIF (BUILD_SHARED_LIBS) # -------------------------------------------------------------------- -- cgit v0.12 From 26785f6af58cf92214f1c4065f88b7f5f402a1e0 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 2 Apr 2013 14:12:06 -0500 Subject: [svn-r23524] Use two plugin folders for testing plugin Path --- test/CMakeLists.txt | 51 +++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 45 insertions(+), 6 deletions(-) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 3d958ca..84709b7 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -41,18 +41,20 @@ SET_TARGET_PROPERTIES (${HDF5_TEST_LIB_TARGET} PROPERTIES FOLDER libraries/test) # If plugin library tests can be tested #----------------------------------------------------------------------------- IF (BUILD_SHARED_LIBS) - # make plugins dir - FILE (MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/plugins") + FILE (MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/testdir1") + FILE (MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/testdir2") #----------------------------------------------------------------------------- # Define Test Library Sources #----------------------------------------------------------------------------- SET (TEST_PLUGIN_LIBS dynlib1 - dynlib2 dynlib3 ) + SET (TEST2_PLUGIN_LIBS + dynlib2 + ) FOREACH (test_lib ${TEST_PLUGIN_LIBS}) SET (HDF5_TEST_PLUGIN_LIB_CORENAME "${test_lib}") @@ -80,9 +82,39 @@ IF (BUILD_SHARED_LIBS) COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different "$" - "${CMAKE_BINARY_DIR}/plugins/$" + "${CMAKE_BINARY_DIR}/testdir1/$" ) ENDFOREACH (test_lib ${TEST_PLUGIN_LIBS}) + + FOREACH (test_lib ${TEST2_PLUGIN_LIBS}) + SET (HDF5_TEST_PLUGIN_LIB_CORENAME "${test_lib}") + SET (HDF5_TEST_PLUGIN_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_TEST_PLUGIN_LIB_CORENAME}") + SET (HDF5_TEST_PLUGIN_LIB_TARGET ${HDF5_TEST_PLUGIN_LIB_CORENAME}) + ADD_DEFINITIONS (${HDF5_EXTRA_C_FLAGS}) + INCLUDE_DIRECTORIES (${HDF5_SRC_DIR}) + + ADD_LIBRARY (${HDF5_TEST_PLUGIN_LIB_TARGET} ${LIB_TYPE} ${HDF5_TEST_SOURCE_DIR}/${test_lib}.c) + TARGET_LINK_LIBRARIES (${HDF5_TEST_PLUGIN_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) + H5_SET_LIB_OPTIONS ( + ${HDF5_TEST_PLUGIN_LIB_TARGET} ${HDF5_TEST_PLUGIN_LIB_NAME} + ${LIB_TYPE} + HDF5_TEST_PLUGIN_LIB_NAME_RELEASE + HDF5_TEST_PLUGIN_LIB_NAME_DEBUG + ) + SET_TARGET_PROPERTIES (${HDF5_TEST_PLUGIN_LIB_TARGET} PROPERTIES FOLDER libraries/TEST_PLUGIN) + + #----------------------------------------------------------------------------- + # Copy plugin library to a plugins folder + #----------------------------------------------------------------------------- + ADD_CUSTOM_COMMAND ( + TARGET ${HDF5_TEST_PLUGIN_LIB_TARGET} + POST_BUILD + COMMAND ${CMAKE_COMMAND} + ARGS -E copy_if_different + "$" + "${CMAKE_BINARY_DIR}/testdir2/$" + ) + ENDFOREACH (test_lib ${TEST2_PLUGIN_LIBS}) ENDIF (BUILD_SHARED_LIBS) # -------------------------------------------------------------------- @@ -335,7 +367,7 @@ ADD_TEST ( extlinks19B00003.h5 extlinks19B00004.h5 extlinks19B00005.h5 - extlinks19B00006.h5 + extlinks19B00006.h5plugins extlinks19B00007.h5 extlinks19B00008.h5 extlinks19B00009.h5 @@ -605,13 +637,20 @@ ADD_TEST (NAME testlibinfo COMMAND ${CMAKE_COMMAND} -D "TEST_PROGRAM=$) - SET_TESTS_PROPERTIES (H5PLUGIN-plugin PROPERTIES ENVIRONMENT "HDF5_PLUGIN_PATH=${CMAKE_BINARY_DIR}/plugins") + SET_TESTS_PROPERTIES (H5PLUGIN-plugin PROPERTIES ENVIRONMENT "HDF5_PLUGIN_PATH=${CMAKE_BINARY_DIR}/testdir1${CMAKE_SEP}${CMAKE_BINARY_DIR}/testdir2") ELSE (BUILD_SHARED_LIBS) MESSAGE (STATUS " **** Plugins libraries must be built as shared libraries **** ") ADD_TEST ( -- cgit v0.12 From 7ee9828c2614ac320a65ed9def45133fc15663d0 Mon Sep 17 00:00:00 2001 From: Albert Cheng Date: Tue, 2 Apr 2013 16:26:14 -0500 Subject: [svn-r23526] Bug fix: Mac system has dynamic library name in the form of libxyz.dylib. Changed test_plugin.in to copy library file names in the form of libdynlib{123].*. Another problem: Even when copy failed in copying the libray files (was in the form of *.so*), the test still passed. That was because .libs was included in $HDF5_PLUGIN_PATH and the needed plug in libraries were generated there. Fixed by copying the plug in library files to separate directories and seetup HDF5_PLUGIN_PATH to include them but NOT .libs. Tested: used desycommittest (duck, emu, jam, koala, ostrich) plus cmakehdf5 in jam. The cmakehdf5 in jam reported a failure in Test #594: H5REPART-h5repart_test ....................................***Failed Since this failure could not be caused by my change in test_plugin.sh, I reported it to Allen and proceed to check this in. --- test/test_plugin.sh.in | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/test/test_plugin.sh.in b/test/test_plugin.sh.in index 1a3dfc1..e8e37d0 100644 --- a/test/test_plugin.sh.in +++ b/test/test_plugin.sh.in @@ -34,7 +34,9 @@ exit_code=$EXIT_SUCCESS TEST_NAME=plugin TEST_BIN=`pwd`/$TEST_NAME FROM_DIR=`pwd`/.libs -PLUGIN_LIB2="$FROM_DIR/libdynlib2.so.*" +PLUGIN_LIB1="$FROM_DIR/libdynlib1.* $FROM_DIR/libdynlib3.*" +PLUGIN_LIB2="$FROM_DIR/libdynlib2.*" +PLUGIN_LIBDIR1=testdir1 PLUGIN_LIBDIR2=testdir2 CP="cp -p" # Use -p to preserve mode,ownership,timestamps RM="rm -rf" @@ -48,7 +50,13 @@ TESTING() { } # Main Body -# Create test directory if not exists yet. +# Create test directories if not exists yet. +test -d $PLUGIN_LIBDIR1 || mkdir -p $PLUGIN_LIBDIR1 +if [ $? != 0 ]; then + echo "Failed to create test directory($PLUGIN_LIBDIR1)" + exit $EXIT_FAILURE +fi + test -d $PLUGIN_LIBDIR2 || mkdir -p $PLUGIN_LIBDIR2 if [ $? != 0 ]; then echo "Failed to create test directory($PLUGIN_LIBDIR2)" @@ -56,6 +64,12 @@ if [ $? != 0 ]; then fi # copy plugin library for test +$CP $PLUGIN_LIB1 $PLUGIN_LIBDIR1 +if [ $? != 0 ]; then + echo "Failed to copy plugin library ($PLUGIN_LIB1) for test." + exit $EXIT_FAILURE +fi + $CP $PLUGIN_LIB2 $PLUGIN_LIBDIR2 if [ $? != 0 ]; then echo "Failed to copy plugin library ($PLUGIN_LIB2) for test." @@ -63,7 +77,7 @@ if [ $? != 0 ]; then fi # setup plugin path -ENVCMD="env HDF5_PLUGIN_PATH=${PLUGIN_LIBDIR2}:$FROM_DIR" +ENVCMD="env HDF5_PLUGIN_PATH=${PLUGIN_LIBDIR1}:${PLUGIN_LIBDIR2}" # Run the test $ENVCMD $TEST_BIN -- cgit v0.12 From 0b16cecb994ad3d1f31883933706decefecc68df Mon Sep 17 00:00:00 2001 From: Larry Knox Date: Tue, 2 Apr 2013 17:54:20 -0500 Subject: [svn-r23527] Revised usage to reflect change to use -shlib as default when no static libraries were built. No test - text only revision of compile scripts. --- c++/src/h5c++.in | 5 +++-- fortran/src/h5fc.in | 5 +++-- tools/misc/h5cc.in | 5 +++-- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/c++/src/h5c++.in b/c++/src/h5c++.in index 8928d13..4c86c6a 100644 --- a/c++/src/h5c++.in +++ b/c++/src/h5c++.in @@ -122,8 +122,9 @@ usage() { echo " subdirectories [default: $prefix]" echo " -show Show the commands without executing them" echo " -showconfig Show the HDF5 library configuration summary" - echo " -shlib Compile with shared HDF5 libraries" - echo " -noshlib Compile with static HDF5 libraries [default]" + echo " -shlib Compile with shared HDF5 libraries [default when built with" + echo " disable-static]" + echo " -noshlib Compile with static HDF5 libraries [default when static available]" echo " " echo " - the normal compile line options for your compiler." echo " $prog_name uses the same compiler you used to compile" diff --git a/fortran/src/h5fc.in b/fortran/src/h5fc.in index c58eab0..d052046 100644 --- a/fortran/src/h5fc.in +++ b/fortran/src/h5fc.in @@ -118,8 +118,9 @@ usage() { echo " subdirectories [default: $prefix]" echo " -show Show the commands without executing them" echo " -showconfig Show the HDF5 library configuration summary" - echo " -shlib Compile with shared HDF5 libraries" - echo " -noshlib Compile with static HDF5 libraries [default]" + echo " -shlib Compile with shared HDF5 libraries [default when built with" + echo " disable-static]" + echo " -noshlib Compile with static HDF5 libraries [default when static available]" echo " " echo " - the normal compile line options for your compiler." echo " $prog_name uses the same compiler you used to compile" diff --git a/tools/misc/h5cc.in b/tools/misc/h5cc.in index 45143e4..f62c66f 100644 --- a/tools/misc/h5cc.in +++ b/tools/misc/h5cc.in @@ -132,8 +132,9 @@ usage() { echo " subdirectories [default: $prefix]" echo " -show Show the commands without executing them" echo " -showconfig Show the HDF5 library configuration summary" - echo " -shlib Compile with shared HDF5 libraries" - echo " -noshlib Compile with static HDF5 libraries [default]" + echo " -shlib Compile with shared HDF5 libraries [default when built with" + echo " disable-static]" + echo " -noshlib Compile with static HDF5 libraries [default when static available]" echo " " echo " - the normal compile line options for your compiler." echo " $prog_name uses the same compiler you used to compile" -- cgit v0.12 From b4331b2ff33549d7401ed63d830b8a7907679677 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Tue, 2 Apr 2013 21:50:50 -0500 Subject: [svn-r23529] Description: Stop aliasing property to indicate internal collective metadata operations with property to perform collective raw data operations from the application. Tested on: Mac OSX/64 10.8.3 (amazon) w/paralllel --- src/H5AC.c | 31 ++++++++------ src/H5ACprivate.h | 5 +++ src/H5C.c | 37 +++++++--------- test/testframe.c | 4 +- testpar/t_cache.c | 119 ---------------------------------------------------- testpar/t_dset.c | 60 ++++++++++++++++++++++++++ testpar/testphdf5.c | 4 ++ testpar/testphdf5.h | 1 + 8 files changed, 106 insertions(+), 155 deletions(-) diff --git a/src/H5AC.c b/src/H5AC.c index db8446a..a26fae1 100644 --- a/src/H5AC.c +++ b/src/H5AC.c @@ -259,6 +259,7 @@ H5AC_init_interface(void) H5P_genclass_t *xfer_pclass; /* Dataset transfer property list class object */ H5P_genplist_t *xfer_plist; /* Dataset transfer property list object */ unsigned block_before_meta_write; /* "block before meta write" property value */ + unsigned coll_meta_write; /* "collective metadata write" property value */ unsigned library_internal=1; /* "library internal" property value */ H5FD_mpio_xfer_t xfer_mode; /* I/O transfer mode property value */ herr_t ret_value=SUCCEED; /* Return value */ @@ -272,6 +273,7 @@ H5AC_init_interface(void) if (NULL == (xfer_pclass = H5I_object(H5P_CLS_DATASET_XFER_g))) HGOTO_ERROR(H5E_CACHE, H5E_BADATOM, FAIL, "can't get property list class") + /* Get an ID for the blocking, collective H5AC dxpl */ if ((H5AC_dxpl_id=H5P_create_id(xfer_pclass,FALSE)) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTCREATE, FAIL, "unable to register property list") @@ -291,10 +293,12 @@ H5AC_init_interface(void) NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL)<0) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't insert metadata cache dxpl property") - /* Set the transfer mode */ - xfer_mode=H5FD_MPIO_COLLECTIVE; - if (H5P_set(xfer_plist,H5D_XFER_IO_XFER_MODE_NAME,&xfer_mode)<0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "unable to set value") + /* Insert 'collective metadata write' property */ + coll_meta_write = 1; + if(H5P_insert(xfer_plist, H5AC_COLLECTIVE_META_WRITE_NAME, H5AC_COLLECTIVE_META_WRITE_SIZE, &coll_meta_write, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't insert metadata cache dxpl property") + /* Get an ID for the non-blocking, collective H5AC dxpl */ if ((H5AC_noblock_dxpl_id=H5P_create_id(xfer_pclass,FALSE)) < 0) @@ -315,10 +319,12 @@ H5AC_init_interface(void) NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL)<0) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't insert metadata cache dxpl property") - /* Set the transfer mode */ - xfer_mode=H5FD_MPIO_COLLECTIVE; - if (H5P_set(xfer_plist,H5D_XFER_IO_XFER_MODE_NAME,&xfer_mode)<0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "unable to set value") + /* Insert 'collective metadata write' property */ + coll_meta_write = 1; + if(H5P_insert(xfer_plist, H5AC_COLLECTIVE_META_WRITE_NAME, H5AC_COLLECTIVE_META_WRITE_SIZE, &coll_meta_write, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't insert metadata cache dxpl property") + /* Get an ID for the non-blocking, independent H5AC dxpl */ if ((H5AC_ind_dxpl_id=H5P_create_id(xfer_pclass,FALSE)) < 0) @@ -339,10 +345,11 @@ H5AC_init_interface(void) NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL)<0) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't insert metadata cache dxpl property") - /* Set the transfer mode */ - xfer_mode=H5FD_MPIO_INDEPENDENT; - if (H5P_set(xfer_plist,H5D_XFER_IO_XFER_MODE_NAME,&xfer_mode)<0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "unable to set value") + /* Insert 'collective metadata write' property */ + coll_meta_write = 0; + if(H5P_insert(xfer_plist, H5AC_COLLECTIVE_META_WRITE_NAME, H5AC_COLLECTIVE_META_WRITE_SIZE, &coll_meta_write, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't insert metadata cache dxpl property") done: FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5ACprivate.h b/src/H5ACprivate.h index 17ce310..cc669a7 100644 --- a/src/H5ACprivate.h +++ b/src/H5ACprivate.h @@ -199,6 +199,11 @@ typedef H5C_t H5AC_t; #define H5AC_BLOCK_BEFORE_META_WRITE_SIZE sizeof(unsigned) #define H5AC_BLOCK_BEFORE_META_WRITE_DEF 0 +/* Definitions for "collective metadata write" property */ +#define H5AC_COLLECTIVE_META_WRITE_NAME "H5AC_collective_metadata_write" +#define H5AC_COLLECTIVE_META_WRITE_SIZE sizeof(unsigned) +#define H5AC_COLLECTIVE_META_WRITE_DEF 0 + /* Definitions for "library internal" property */ #define H5AC_LIBRARY_INTERNAL_NAME "H5AC_library_internal" #define H5AC_LIBRARY_INTERNAL_SIZE sizeof(unsigned) diff --git a/src/H5C.c b/src/H5C.c index c229a46..fa385fa 100644 --- a/src/H5C.c +++ b/src/H5C.c @@ -75,6 +75,9 @@ #include "H5private.h" /* Generic Functions */ +#ifdef H5_HAVE_PARALLEL +#include "H5ACprivate.h" /* Metadata cache */ +#endif /* H5_HAVE_PARALLEL */ #include "H5Cpkg.h" /* Cache */ #include "H5Dprivate.h" /* Dataset functions */ #include "H5Eprivate.h" /* Error handling */ @@ -8277,37 +8280,27 @@ H5C_flush_single_entry(H5F_t * f, #ifdef H5_HAVE_PARALLEL #ifndef NDEBUG - /* If MPI based VFD is used, do special parallel I/O sanity checks. * Note that we only do these sanity checks when the clear_only flag * is not set, and the entry to be flushed is dirty. Don't bother * otherwise as no file I/O can result. */ - if ( ( ! clear_only ) && - ( entry_ptr->is_dirty ) && - (H5F_HAS_FEATURE(f, H5FD_FEAT_HAS_MPI) ) ) { - - H5P_genplist_t *dxpl; /* Dataset transfer property list */ - H5FD_mpio_xfer_t xfer_mode; /* I/O xfer mode property value */ + if(!clear_only && entry_ptr->is_dirty && + H5F_HAS_FEATURE(f, H5FD_FEAT_HAS_MPI)) { + H5P_genplist_t *dxpl; /* Dataset transfer property list */ + unsigned coll_meta; /* Collective metadata write flag */ /* Get the dataset transfer property list */ - if ( NULL == (dxpl = H5I_object(primary_dxpl_id)) ) { - - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, \ - "not a dataset transfer property list") - } + if(NULL == (dxpl = H5I_object(primary_dxpl_id))) + HGOTO_ERROR(H5E_CACHE, H5E_BADTYPE, FAIL, "not a dataset transfer property list") - /* Get the transfer mode property */ - if( H5P_get(dxpl, H5D_XFER_IO_XFER_MODE_NAME, &xfer_mode) < 0 ) { - - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, \ - "can't retrieve xfer mode") - } - - /* Sanity check transfer mode */ - HDassert( xfer_mode == H5FD_MPIO_COLLECTIVE ); - } + /* Get the collective metadata write property */ + if(H5P_get(dxpl, H5AC_COLLECTIVE_META_WRITE_NAME, &coll_meta) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_CANTGET, FAIL, "can't retrieve xfer mode") + /* Sanity check collective metadata write flag */ + HDassert(coll_meta); + } /* end if */ #endif /* NDEBUG */ #endif /* H5_HAVE_PARALLEL */ diff --git a/test/testframe.c b/test/testframe.c index 8ab7a5b..af6e975 100644 --- a/test/testframe.c +++ b/test/testframe.c @@ -26,7 +26,7 @@ /* * Definitions for the testing structure. */ -#define MAXNUMOFTESTS 50 +#define MAXNUMOFTESTS 60 #define MAXTESTNAME 16 #define MAXTESTDESC 64 @@ -73,7 +73,7 @@ AddTest(const char *TheName, void (*TheCall) (void), void (*Cleanup) (void), con { /* Sanity checking */ if (Index >= MAXNUMOFTESTS) { - printf("Too many tests added, increase MAXNUMOFTEST(%d).\n", + printf("Too many tests added, increase MAXNUMOFTESTS(%d).\n", MAXNUMOFTESTS); exit(-1); } /* end if */ diff --git a/testpar/t_cache.c b/testpar/t_cache.c index 8f193cd..b0fea36 100644 --- a/testpar/t_cache.c +++ b/testpar/t_cache.c @@ -4218,125 +4218,6 @@ verify_writes(int num_writes, /***************************************************************************** * - * Function: setup_noblock_dxpl_id() - * - * Purpose: Setup the noblock_dxpl_id global. Increment nerrors if - * errors are detected. Do nothing if nerrors is non-zero - * on entry. - * - * Return: void. - * - * Programmer: JRM -- 1/5/06 - * - * Modifications: - * - * None. - * - *****************************************************************************/ -/* So far we haven't needed this, but that may change. - * Keep it around for now - */ -#if 0 -void -setup_noblock_dxpl_id(void) -{ - const char * fcn_name = "setup_noblock_dxpl_id()"; - H5P_genclass_t *xfer_pclass; /* Dataset transfer property list - * class object - */ - H5P_genplist_t *xfer_plist; /* Dataset transfer property list object */ - unsigned block_before_meta_write; /* "block before meta write" - * property value - */ - unsigned library_internal = 1; /* "library internal" property value */ - H5FD_mpio_xfer_t xfer_mode; /* I/O transfer mode property value */ - - /* Sanity check */ - HDassert(H5P_CLS_DATASET_XFER_g!=(-1)); - - /* Get the dataset transfer property list class object */ - if ( ( nerrors == 0 ) && - ( NULL == (xfer_pclass = H5I_object(H5P_CLS_DATASET_XFER_g)) ) ) { - - nerrors++; - if ( verbose ) { - HDfprintf(stdout, "%d:%s: can't get property list class.\n", - world_mpi_rank, fcn_name); - } - } - - /* Get an ID for the non-blocking, collective H5AC dxpl */ - if ( ( nerrors == 0 ) && - ( (noblock_dxpl_id = H5P_create_id(xfer_pclass)) < 0 ) ) { - - nerrors++; - if ( verbose ) { - HDfprintf(stdout, "%d:%s: can't register property list.\n", - world_mpi_rank, fcn_name); - } - } - - /* Get the property list object */ - if ( ( nerrors == 0 ) && - ( NULL == (xfer_plist = H5I_object(H5AC_noblock_dxpl_id)) ) ) { - - nerrors++; - if ( verbose ) { - HDfprintf(stdout, "%d:%s: can't get new property list object.\n", - world_mpi_rank, fcn_name); - } - } - - /* Insert 'block before metadata write' property */ - block_before_meta_write=0; - if ( ( nerrors == 0 ) && - ( H5P_insert(xfer_plist, H5AC_BLOCK_BEFORE_META_WRITE_NAME, - H5AC_BLOCK_BEFORE_META_WRITE_SIZE, - &block_before_meta_write, - NULL, NULL, NULL, NULL, NULL, NULL) < 0 ) ) { - - nerrors++; - if ( verbose ) { - HDfprintf(stdout, - "%d:%s: can't insert metadata cache dxpl property 1.\n", - world_mpi_rank, fcn_name); - } - } - - /* Insert 'library internal' property */ - if ( ( nerrors == 0 ) && - ( H5P_insert(xfer_plist, H5AC_LIBRARY_INTERNAL_NAME, - H5AC_LIBRARY_INTERNAL_SIZE, &library_internal, - NULL, NULL, NULL, NULL, NULL, NULL ) < 0 ) ) { - - nerrors++; - if ( verbose ) { - HDfprintf(stdout, - "%d:%s: can't insert metadata cache dxpl property 2.\n", - world_mpi_rank, fcn_name); - } - } - - /* Set the transfer mode */ - xfer_mode = H5FD_MPIO_COLLECTIVE; - if ( ( nerrors == 0 ) && - ( H5P_set(xfer_plist, H5D_XFER_IO_XFER_MODE_NAME, &xfer_mode) < 0 ) ) { - - nerrors++; - if ( verbose ) { - HDfprintf(stdout, "%d:%s: unable to set value.\n", world_mpi_rank, - fcn_name); - } - } - - return(success); - -} /* setup_noblock_dxpl_id() */ -#endif - - -/***************************************************************************** - * * Function: setup_rand() * * Purpose: Use gettimeofday() to obtain a seed for rand(), print the diff --git a/testpar/t_dset.c b/testpar/t_dset.c index 79a5555..4be0296 100644 --- a/testpar/t_dset.c +++ b/testpar/t_dset.c @@ -4038,3 +4038,63 @@ dataset_atomicity(void) VRFY((ret >= 0), "H5Fclose succeeded"); } + +/* Function: dense_attr_test + * + * Purpose: Test cases for writing dense attributes in parallel + * + * Programmer: Quincey Koziol + * Date: April, 2013 + */ +void +test_dense_attr(void) +{ + int mpi_size, mpi_rank; + hid_t fpid, fid; + hid_t gid, gpid; + hid_t atFileSpace, atid; + hsize_t atDims[1] = {10000}; + herr_t status; + + /* set up MPI parameters */ + MPI_Comm_size(MPI_COMM_WORLD,&mpi_size); + MPI_Comm_rank(MPI_COMM_WORLD,&mpi_rank); + + fpid = H5Pcreate(H5P_FILE_ACCESS); + VRFY((fpid > 0), "H5Pcreate succeeded"); + status = H5Pset_libver_bounds(fpid, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST); + VRFY((status >= 0), "H5Pset_libver_bounds succeeded"); + status = H5Pset_fapl_mpio(fpid, MPI_COMM_WORLD, MPI_INFO_NULL); + VRFY((status >= 0), "H5Pset_fapl_mpio succeeded"); + fid = H5Fcreate("ph5Dense.h5", H5F_ACC_TRUNC, H5P_DEFAULT, fpid); + VRFY((fid > 0), "H5Fcreate succeeded"); + status = H5Pclose(fpid); + VRFY((status >= 0), "H5Pclose succeeded"); + + gpid = H5Pcreate(H5P_GROUP_CREATE); + VRFY((gpid > 0), "H5Pcreate succeeded"); + status = H5Pset_attr_phase_change(gpid, 0, 0); + VRFY((status >= 0), "H5Pset_attr_phase_change succeeded"); + gid = H5Gcreate2(fid, "foo", H5P_DEFAULT, gpid, H5P_DEFAULT); + VRFY((gid > 0), "H5Gcreate2 succeeded"); + status = H5Pclose(gpid); + VRFY((status >= 0), "H5Pclose succeeded"); + + atFileSpace = H5Screate_simple(1, atDims, NULL); + VRFY((atFileSpace > 0), "H5Screate_simple succeeded"); + atid = H5Acreate(gid, "bar", H5T_STD_U64LE, atFileSpace, H5P_DEFAULT, H5P_DEFAULT); + VRFY((atid > 0), "H5Acreate succeeded"); + status = H5Sclose(atFileSpace); + VRFY((status >= 0), "H5Sclose succeeded"); + + status = H5Aclose(atid); + VRFY((status >= 0), "H5Aclose succeeded"); + + status = H5Gclose(gid); + VRFY((status >= 0), "H5Gclose succeeded"); + status = H5Fclose(fid); + VRFY((status >= 0), "H5Fclose succeeded"); + + return; +} + diff --git a/testpar/testphdf5.c b/testpar/testphdf5.c index 784892a..89230f1 100644 --- a/testpar/testphdf5.c +++ b/testpar/testphdf5.c @@ -532,6 +532,10 @@ int main(int argc, char **argv) "dataset atomic updates", PARATESTFILE); } + AddTest("denseattr", test_dense_attr, NULL, + "Store Dense Attributes", NULL); + + /* Display testing information */ TestInfo(argv[0]); diff --git a/testpar/testphdf5.h b/testpar/testphdf5.h index fa83697..15ff884 100644 --- a/testpar/testphdf5.h +++ b/testpar/testphdf5.h @@ -289,6 +289,7 @@ void file_image_daisy_chain_test(void); #ifdef H5_HAVE_FILTER_DEFLATE void compress_readAll(void); #endif /* H5_HAVE_FILTER_DEFLATE */ +void test_dense_attr(void); /* commonly used prototypes */ hid_t create_faccess_plist(MPI_Comm comm, MPI_Info info, int l_facc_type, hbool_t use_gpfs); -- cgit v0.12 From f03301ce82e4fb4cd5ace537d8eab408f3238f27 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 3 Apr 2013 10:08:52 -0500 Subject: [svn-r23530] Moved test property into test macro. Tested: local linux --- tools/h5dump/CMakeLists.txt | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/tools/h5dump/CMakeLists.txt b/tools/h5dump/CMakeLists.txt index bcabdee..365326e 100644 --- a/tools/h5dump/CMakeLists.txt +++ b/tools/h5dump/CMakeLists.txt @@ -906,6 +906,33 @@ IF (BUILD_TESTING) ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (ADD_H5ERR_MASK_TEST file) + MACRO (ADD_H5ERR_MASK_ENV_TEST resultfile resultcode envvar envval) + IF (NOT HDF5_ENABLE_USING_MEMCHECKER) + ADD_TEST ( + NAME H5DUMP-${resultfile}-clear-objects + COMMAND ${CMAKE_COMMAND} + -E remove ${resultfile}.out ${resultfile}.out.err + ) + SET_TESTS_PROPERTIES (H5DUMP-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") + ADD_TEST ( + NAME H5DUMP-${resultfile} + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=${ARGN}" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles/std" + -D "TEST_OUTPUT=${resultfile}.out" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_REFERENCE=${resultfile}.ddl" + -D "TEST_ERRREF=${resultfile}.err" + -D "TEST_MASK_ERROR=true" + -D "TEST_ENV_VAR:STRING=${envvar}" + -D "TEST_ENV_VALUE:STRING=${envval}" + -P "${HDF5_RESOURCES_DIR}/runTest.cmake" + ) + SET_TESTS_PROPERTIES (H5DUMP-${resultfile} PROPERTIES DEPENDS "H5DUMP-${resultfile}-clear-objects") + ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) + ENDMACRO (ADD_H5ERR_MASK_TEST file) + MACRO (ADD_H5_TEST_IMPORT conffile resultfile testfile resultcode) # If using memchecker add tests without using scripts IF (NOT HDF5_ENABLE_USING_MEMCHECKER) @@ -1655,8 +1682,7 @@ IF (BUILD_TESTING) ADD_H5ERR_MASK_TEST (textlink 0 --enable-error-stack textlink.h5) # test for error stack display (BZ2048) - ADD_H5ERR_MASK_TEST (filter_fail 1 --enable-error-stack filter_fail.h5) - SET_TESTS_PROPERTIES (H5DUMP-filter_fail PROPERTIES ENVIRONMENT "HDF5_PLUGIN_PRELOAD=::") + ADD_H5ERR_MASK_ENV_TEST (filter_fail 1 "HDF5_PLUGIN_PRELOAD" "::" --enable-error-stack filter_fail.h5) # test for -o -y for dataset with attributes ADD_H5_TEST_EXPORT (tall-6 tall.h5 0 --enable-error-stack -d /g1/g1.1/dset1.1.1 -y -o) -- cgit v0.12 From 97caaff719f6916c255c56101d4528676784e406 Mon Sep 17 00:00:00 2001 From: Raymond Lu Date: Wed, 3 Apr 2013 11:30:46 -0500 Subject: [svn-r23533] I changed the operation in dynlib2.c from math operations pow and sqrt to simpler multiplication and division to avoid potential rounding problem in math operations. Tested on jam - simple change. --- test/dynlib2.c | 19 +++++++++---------- test/plugin.c | 5 +++-- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/test/dynlib2.c b/test/dynlib2.c index 1ee6ed7..df5d91c 100644 --- a/test/dynlib2.c +++ b/test/dynlib2.c @@ -22,10 +22,10 @@ #include #include -#include #include #define H5Z_FILTER_DYNLIB2 258 +#define MULTIPLIER 3 static size_t H5Z_filter_dynlib2(unsigned int flags, size_t cd_nelmts, const unsigned int *cd_values, size_t nbytes, size_t *buf_size, void **buf); @@ -47,11 +47,10 @@ const H5Z_class2_t* H5PL_get_plugin_info(void) {return H5Z_DYNLIB2;} /*------------------------------------------------------------------------- * Function: H5Z_filter_dynlib2 * - * Purpose: A dynlib2 filter method that assigns the power of 2 of the - * original value during write and calculates the square root - * of the original value during read. It will be built as a - * shared library. plugin.c test will load and use this filter - * library. + * Purpose: A dynlib2 filter method that multiplies the original value + * during write and divide the original value during read. It + * will be built as a shared library. plugin.c test will load + * and use this filter library. * * Return: Success: Data chunk size * @@ -75,17 +74,17 @@ H5Z_filter_dynlib2(unsigned int flags, size_t cd_nelmts, return(0); if(flags & H5Z_FLAG_REVERSE) { /*read*/ - /* Calculate and assign the square root for all the data values */ + /* Divide the original value with MULTIPLIER */ while(buf_left>0) { - *int_ptr = (int)sqrt((double)*int_ptr); + *int_ptr /= MULTIPLIER; *int_ptr++; buf_left -= sizeof(int); } /* end while */ } /* end if */ else { /*write*/ - /* Calculate and assign the power of 2 to all the data values */ + /* Multiply the original value with MULTIPLIER */ while(buf_left>0) { - *int_ptr = (int)pow((double)*int_ptr, 2); + *int_ptr *= MULTIPLIER; *int_ptr++; buf_left -= sizeof(int); } /* end while */ diff --git a/test/plugin.c b/test/plugin.c index 4f28520..92be6ce 100644 --- a/test/plugin.c +++ b/test/plugin.c @@ -691,9 +691,10 @@ main(void) TEST_ERROR /* Test dynamically loaded filters for chunked dataset */ - nerrors += (test_filters_for_datasets(file, my_fapl) < 0 ? 1 : 0); + nerrors += (test_filters_for_datasets(file, my_fapl) < 0 ? 1 : 0); - nerrors += (test_filters_for_groups(file, my_fapl) < 0 ? 1 : 0); + /* Test dynamically loaded filters for groups */ + nerrors += (test_filters_for_groups(file, my_fapl) < 0 ? 1 : 0); if(H5Fclose(file) < 0) TEST_ERROR -- cgit v0.12 From 86c0d2aa05fb860be3c2dac2427c4ac9d2bfee12 Mon Sep 17 00:00:00 2001 From: Raymond Lu Date: Wed, 3 Apr 2013 14:15:13 -0500 Subject: [svn-r23536] I corrected the copyright information and added some comment in H5Pocpl.c. Tested on jam - no code change. --- src/H5PL.c | 11 +++++------ src/H5PLprivate.h | 11 +++++------ src/H5PLpublic.h | 11 +++++------ src/H5Pocpl.c | 3 +++ test/dynlib1.c | 12 +++++------- test/dynlib2.c | 12 +++++------- test/dynlib3.c | 12 +++++------- test/plugin.c | 12 +++++------- test/test_plugin.sh.in | 28 +++++++++++----------------- 9 files changed, 49 insertions(+), 63 deletions(-) diff --git a/src/H5PL.c b/src/H5PL.c index 3cb5708..6c3c5ad 100644 --- a/src/H5PL.c +++ b/src/H5PL.c @@ -1,16 +1,15 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * - * This file is part of HDF5. The full HDF5 copyright notice, including * + * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * * the files COPYING and Copyright.html. COPYING can be found at the root * * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * root level of an installed copy of the electronic document set and is * + * linked from the top-level documents page. It can also be found at * + * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have access * + * to either file, you may request a copy from help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /****************/ diff --git a/src/H5PLprivate.h b/src/H5PLprivate.h index 127ba98..4c3cf69 100644 --- a/src/H5PLprivate.h +++ b/src/H5PLprivate.h @@ -1,16 +1,15 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * - * This file is part of HDF5. The full HDF5 copyright notice, including * + * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * * the files COPYING and Copyright.html. COPYING can be found at the root * * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * root level of an installed copy of the electronic document set and is * + * linked from the top-level documents page. It can also be found at * + * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have access * + * to either file, you may request a copy from help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* Programmer: Raymond Lu diff --git a/src/H5PLpublic.h b/src/H5PLpublic.h index 6a8a612..519ac38 100644 --- a/src/H5PLpublic.h +++ b/src/H5PLpublic.h @@ -1,16 +1,15 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * - * This file is part of HDF5. The full HDF5 copyright notice, including * + * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * * the files COPYING and Copyright.html. COPYING can be found at the root * * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * root level of an installed copy of the electronic document set and is * + * linked from the top-level documents page. It can also be found at * + * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have access * + * to either file, you may request a copy from help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/src/H5Pocpl.c b/src/H5Pocpl.c index d3de509..82c4b5d 100644 --- a/src/H5Pocpl.c +++ b/src/H5Pocpl.c @@ -804,6 +804,9 @@ done: * If this bit is set but encoding is disabled for a filter, * attempting to write will generate an error. * + * If the filter is not registered, this function tries to load + * it dynamically during run time. + * * Return: Non-negative on success/Negative on failure * * Programmer: Robb Matzke diff --git a/test/dynlib1.c b/test/dynlib1.c index 69d0bdd..47499b8 100644 --- a/test/dynlib1.c +++ b/test/dynlib1.c @@ -1,18 +1,16 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * - * This file is part of HDF5. The full HDF5 copyright notice, including * + * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * * the files COPYING and Copyright.html. COPYING can be found at the root * * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * root level of an installed copy of the electronic document set and is * + * linked from the top-level documents page. It can also be found at * + * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have access * + * to either file, you may request a copy from help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ - /* * Programmer: Raymond Lu * 13 February 2013 diff --git a/test/dynlib2.c b/test/dynlib2.c index df5d91c..733202c 100644 --- a/test/dynlib2.c +++ b/test/dynlib2.c @@ -1,18 +1,16 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * - * This file is part of HDF5. The full HDF5 copyright notice, including * + * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * * the files COPYING and Copyright.html. COPYING can be found at the root * * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * root level of an installed copy of the electronic document set and is * + * linked from the top-level documents page. It can also be found at * + * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have access * + * to either file, you may request a copy from help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ - /* * Programmer: Raymond Lu * 13 February 2013 diff --git a/test/dynlib3.c b/test/dynlib3.c index e040052..230096d 100644 --- a/test/dynlib3.c +++ b/test/dynlib3.c @@ -1,18 +1,16 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * - * This file is part of HDF5. The full HDF5 copyright notice, including * + * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * * the files COPYING and Copyright.html. COPYING can be found at the root * * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * root level of an installed copy of the electronic document set and is * + * linked from the top-level documents page. It can also be found at * + * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have access * + * to either file, you may request a copy from help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ - /* * Programmer: Raymond Lu * 1 April 2013 diff --git a/test/plugin.c b/test/plugin.c index 92be6ce..b37cfa3 100644 --- a/test/plugin.c +++ b/test/plugin.c @@ -1,18 +1,16 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * - * This file is part of HDF5. The full HDF5 copyright notice, including * + * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * * the files COPYING and Copyright.html. COPYING can be found at the root * * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * root level of an installed copy of the electronic document set and is * + * linked from the top-level documents page. It can also be found at * + * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have access * + * to either file, you may request a copy from help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ - /* * Programmer: Raymond Lu * 13 February 2013 diff --git a/test/test_plugin.sh.in b/test/test_plugin.sh.in index e8e37d0..569e938 100644 --- a/test/test_plugin.sh.in +++ b/test/test_plugin.sh.in @@ -1,23 +1,17 @@ #! /bin/sh # -# Copyright by The HDF Group. -# Copyright by the Board of Trustees of the University of Illinois. -# All rights reserved. +# 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 files COPYING and Copyright.html. COPYING can be found at the root +# of the source code distribution tree; Copyright.html can be found at the +# root level of an installed copy of the electronic document set and is +# linked from the top-level documents page. It can also be found at +# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have access +# to either file, you may request a copy from help@hdfgroup.org. # -# This file is part of HDF5. The full HDF5 copyright notice, including -# terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. -# -# This script file first envokes the Makefile in plugin_lib to build dynamic -# plugin libraries. Then it moves the libraries to some locations and points -# HDF5_PLUGIN_PATH to these locations. In the end, it runs plugin.c test. -# - srcdir=@srcdir@ TOP_BUILDDIR=@top_builddir@ -- cgit v0.12 From f2e9f4e8c66c35ed2f0541039da9028940a8b0a3 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 3 Apr 2013 15:47:37 -0500 Subject: [svn-r23538] Correct incorrect unset var name --- configure | 2 +- configure.ac | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/configure b/configure index 77a76ae..55f2112 100755 --- a/configure +++ b/configure @@ -25927,7 +25927,7 @@ if test "x$ac_cv_header_szlib_h" = xyes; then : _ACEOF HAVE_SZLIB_H="yes" else - CPPFLAGS="$saved_CPPFLAGS"; AM_CPPFLAGS="$saved_AM_CPPFLAGS" unset HAVE_SZIP + CPPFLAGS="$saved_CPPFLAGS"; AM_CPPFLAGS="$saved_AM_CPPFLAGS" unset HAVE_SZLIB fi done diff --git a/configure.ac b/configure.ac index ad15bdf..7b313e0 100644 --- a/configure.ac +++ b/configure.ac @@ -1851,7 +1851,7 @@ case $withval in AC_CHECK_HEADERS([szlib.h], [HAVE_SZLIB_H="yes"], - [CPPFLAGS="$saved_CPPFLAGS"; AM_CPPFLAGS="$saved_AM_CPPFLAGS"] [unset HAVE_SZIP]) + [CPPFLAGS="$saved_CPPFLAGS"; AM_CPPFLAGS="$saved_AM_CPPFLAGS"] [unset HAVE_SZLIB]) if test -n "$szlib_lib"; then LDFLAGS="$LDFLAGS -L$szlib_lib" -- cgit v0.12 From 68b0945687c29ce157280b66ec1773d6b0890069 Mon Sep 17 00:00:00 2001 From: Raymond Lu Date: Wed, 3 Apr 2013 15:53:13 -0500 Subject: [svn-r23540] I took out the "const" symbol from H5PL_get_plugin_type and H5PL_get_plugin_info functions. Tested on jam - simple change. --- src/H5PLpublic.h | 5 ++--- test/dynlib1.c | 4 ++-- test/dynlib2.c | 4 ++-- test/dynlib3.c | 4 ++-- 4 files changed, 8 insertions(+), 9 deletions(-) diff --git a/src/H5PLpublic.h b/src/H5PLpublic.h index 519ac38..9b71164 100644 --- a/src/H5PLpublic.h +++ b/src/H5PLpublic.h @@ -74,12 +74,11 @@ typedef enum H5PL_type_t { extern "C" { #endif - H5PLUGIN_DLL const H5PL_type_t H5PL_get_plugin_type(void); - H5PLUGIN_DLL const H5Z_class2_t* H5PL_get_plugin_info(void); + H5PLUGIN_DLL H5PL_type_t H5PL_get_plugin_type(void); + H5PLUGIN_DLL H5Z_class2_t* H5PL_get_plugin_info(void); #ifdef __cplusplus } #endif #endif /* _H5PLpublic_H */ - diff --git a/test/dynlib1.c b/test/dynlib1.c index 47499b8..de14f6f 100644 --- a/test/dynlib1.c +++ b/test/dynlib1.c @@ -38,8 +38,8 @@ const H5Z_class2_t H5Z_DYNLIB1[1] = {{ (H5Z_func_t)H5Z_filter_dynlib1, /* The actual filter function */ }}; -const H5PL_type_t H5PL_get_plugin_type(void) {return H5PL_TYPE_FILTER;} -const H5Z_class2_t* H5PL_get_plugin_info(void) {return H5Z_DYNLIB1;} +H5PL_type_t H5PL_get_plugin_type(void) {return H5PL_TYPE_FILTER;} +H5Z_class2_t* H5PL_get_plugin_info(void) {return H5Z_DYNLIB1;} /*------------------------------------------------------------------------- * Function: H5Z_filter_dynlib1 diff --git a/test/dynlib2.c b/test/dynlib2.c index 733202c..648f7e0 100644 --- a/test/dynlib2.c +++ b/test/dynlib2.c @@ -39,8 +39,8 @@ const H5Z_class2_t H5Z_DYNLIB2[1] = {{ (H5Z_func_t)H5Z_filter_dynlib2, /* The actual filter function */ }}; -const H5PL_type_t H5PL_get_plugin_type(void) {return H5PL_TYPE_FILTER;} -const H5Z_class2_t* H5PL_get_plugin_info(void) {return H5Z_DYNLIB2;} +H5PL_type_t H5PL_get_plugin_type(void) {return H5PL_TYPE_FILTER;} +H5Z_class2_t* H5PL_get_plugin_info(void) {return H5Z_DYNLIB2;} /*------------------------------------------------------------------------- * Function: H5Z_filter_dynlib2 diff --git a/test/dynlib3.c b/test/dynlib3.c index 230096d..276a5b7 100644 --- a/test/dynlib3.c +++ b/test/dynlib3.c @@ -41,8 +41,8 @@ const H5Z_class2_t H5Z_DYNLIB3[1] = {{ (H5Z_func_t)H5Z_filter_dynlib3, /* The actual filter function */ }}; -const H5PL_type_t H5PL_get_plugin_type(void) {return H5PL_TYPE_FILTER;} -const H5Z_class2_t* H5PL_get_plugin_info(void) {return H5Z_DYNLIB3;} +H5PL_type_t H5PL_get_plugin_type(void) {return H5PL_TYPE_FILTER;} +H5Z_class2_t* H5PL_get_plugin_info(void) {return H5Z_DYNLIB3;} /*------------------------------------------------------------------------- * Function: H5Z_filter_dynlib3 -- cgit v0.12 From 9ab7c470005209b36eeb87a7f02e479f4379f107 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Thu, 4 Apr 2013 08:29:14 -0500 Subject: [svn-r23543] Description: Bring r23542 from desy_1_8 branch to trunk: Further revisions to dynamic library loading code, to clean it up. Tested on: Mac OSX/64 10.8.3 (amazon) w/parallel --- src/H5PL.c | 110 +++++++++++++++++++++++++++--------------------------- src/H5PLprivate.h | 2 +- src/H5Z.c | 50 +++++++++++++------------ 3 files changed, 83 insertions(+), 79 deletions(-) diff --git a/src/H5PL.c b/src/H5PL.c index 6c3c5ad..35925e1 100644 --- a/src/H5PL.c +++ b/src/H5PL.c @@ -61,7 +61,7 @@ /* Clear error - nothing to do */ #define H5PL_CLR_ERROR -typedef const H5Z_class2_t *(__cdecl *get_filter_info_t)(); +typedef const H5Z_class2_t *(__cdecl *H5PL_get_filter_info_t)(void); /* Unix support */ #else /* H5_HAVE_WIN32_API */ @@ -84,7 +84,7 @@ typedef const H5Z_class2_t *(__cdecl *get_filter_info_t)(); /* Clear error */ #define H5PL_CLR_ERROR dlerror() -typedef const H5Z_class2_t *(*get_filter_info_t)(); +typedef const H5Z_class2_t *(*H5PL_get_filter_info_t)(void); #endif /* H5_HAVE_WIN32_API */ /* Special symbol to indicate no plugin loading */ @@ -135,11 +135,9 @@ static H5PL_table_t *H5PL_table_g = NULL; /* Table of location paths for plugin libraries */ static char *H5PL_path_table_g[H5PL_MAX_PATH_NUM]; static size_t H5PL_num_paths_g = 0; -static htri_t H5PL_path_found_g = FALSE; +static hbool_t H5PL_path_found_g = FALSE; -/* Table of preload pathnames for plugin libraries */ -static char *H5PL_preload_table_g[H5PL_MAX_PATH_NUM]; -static size_t H5PL_num_preload_g = 0; +/* Whether to preload pathnames for plugin libraries */ static hbool_t H5PL_no_plugin_g = FALSE; @@ -157,25 +155,20 @@ DESCRIPTION static herr_t H5PL__init_interface(void) { - char *preload_path = NULL; - herr_t ret_value = SUCCEED; /* Return value */ + char *preload_path; - FUNC_ENTER_STATIC + FUNC_ENTER_STATIC_NOERR /* Retrieve pathnames from HDF5_PLUGIN_PRELOAD if the user sets it * to tell the library to load plugin libraries without search. */ - if(!(preload_path = HDgetenv("HDF5_PLUGIN_PRELOAD"))) - HGOTO_DONE(ret_value) - - /* Special symbal "::" means no plugin during data reading. */ - if(!HDstrcmp(preload_path, H5PL_NO_PLUGIN)) { - H5PL_no_plugin_g = TRUE; - HGOTO_DONE(ret_value) - } + if(NULL != (preload_path = HDgetenv("HDF5_PLUGIN_PRELOAD"))) { + /* Special symbal "::" means no plugin during data reading. */ + if(!HDstrcmp(preload_path, H5PL_NO_PLUGIN)) + H5PL_no_plugin_g = TRUE; + } /* end if */ -done: - FUNC_LEAVE_NOAPI(ret_value) + FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5PL__init_interface() */ @@ -193,17 +186,18 @@ done: * *------------------------------------------------------------------------- */ -hbool_t H5PL_no_plugin(void) +htri_t +H5PL_no_plugin(void) { - hbool_t ret_value = FALSE; + htri_t ret_value; - FUNC_ENTER_NOAPI(ret_value) + FUNC_ENTER_NOAPI(FAIL) ret_value = H5PL_no_plugin_g; done: FUNC_LEAVE_NOAPI(ret_value) -} +} /* end H5PL_no_plugin() */ /*------------------------------------------------------------------------- @@ -351,6 +345,9 @@ H5PL__init_path_table(void) /* Put paths in the path table. They are separated by ":" */ dir = HDstrtok(dl_path, H5PL_PATH_SEPARATOR); while(dir) { + /* Check for too many directories in path */ + if(H5PL_num_paths_g == H5PL_MAX_PATH_NUM) + HGOTO_ERROR(H5E_PLUGIN, H5E_NOSPACE, FAIL, "too many directories in path for table") if(NULL == (H5PL_path_table_g[H5PL_num_paths_g] = HDstrdup(dir))) HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "can't allocate memory for path") H5PL_num_paths_g++; @@ -400,20 +397,23 @@ H5PL__find(H5PL_type_t plugin_type, int type_id, char *dir, void **info) HGOTO_ERROR(H5E_PLUGIN, H5E_OPENERROR, FAIL, "can't open directory") /* Iterates through all entries in the directory to find the right plugin library */ - while((dp = HDreaddir(dirp)) != NULL) { + while(NULL != (dp = HDreaddir(dirp))) { /* The library we are looking for should be called libxxx.so... on Unix * or libxxx.xxx.dylib on Mac. */ if(!HDstrncmp(dp->d_name, "lib", (size_t)3) && (HDstrstr(dp->d_name, ".so") || HDstrstr(dp->d_name, ".dylib"))) { h5_stat_t my_stat; + size_t pathname_len; htri_t found_in_dir; - pathname = (char *)H5MM_malloc(HDstrlen(dir) + HDstrlen(dp->d_name) + 2); - HDstrncpy(pathname, dir, HDstrlen(dir) + 1); - HDstrcat(pathname, "/"); - HDstrcat(pathname, dp->d_name); + /* Allocate & initialize the path name */ + pathname_len = HDstrlen(dir) + HDstrlen(dp->d_name) + 2; + if(NULL == (pathname = (char *)H5MM_malloc(pathname_len))) + HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "can't allocate memory for path") + HDsnprintf(pathname, pathname_len, "%s/%s", dir, dp->d_name); + /* Get info for directory entry */ if(HDstat(pathname, &my_stat) == -1) HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "can't stat file: %s", strerror(errno)) @@ -426,12 +426,11 @@ H5PL__find(H5PL_type_t plugin_type, int type_id, char *dir, void **info) HGOTO_ERROR(H5E_PLUGIN, H5E_CANTGET, FAIL, "search in directory failed") if(found_in_dir) { /* Indicate success */ - ret_value = TRUE; - break; + HGOTO_DONE(TRUE) } /* end if */ else - if(pathname) - pathname = (char *)H5MM_xfree(pathname); + HDassert(pathname); + pathname = (char *)H5MM_xfree(pathname); } /* end if */ } /* end while */ @@ -444,15 +443,15 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5PL__find() */ -#else +#else /* H5_HAVE_WIN32_API */ static htri_t H5PL__find(H5PL_type_t plugin_type, int type_id, char *dir, void **info) { WIN32_FIND_DATA fdFile; HANDLE hFind; char *pathname = NULL; - htri_t ret_value = FALSE; char service[2048]; + htri_t ret_value = FALSE; FUNC_ENTER_STATIC @@ -466,27 +465,28 @@ H5PL__find(H5PL_type_t plugin_type, int type_id, char *dir, void **info) * and ".." as the first two directories. */ if(HDstrcmp(fdFile.cFileName, ".") != 0 && HDstrcmp(fdFile.cFileName, "..") != 0) { - htri_t found_in_dir; + size_t pathname_len; + htri_t found_in_dir; - pathname = (char *)H5MM_malloc(HDstrlen(dir) + HDstrlen(fdFile.cFileName) + 2); - HDstrncpy(pathname, dir, HDstrlen(dir)+1); - HDstrcat(pathname, "\\"); - HDstrcat(pathname, fdFile.cFileName); + /* Allocate & initialize the path name */ + pathname_len = HDstrlen(dir) + HDstrlen(fdFile.cFileName) + 2; + if(NULL == (pathname = (char *)H5MM_malloc(pathname_len))) + HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "can't allocate memory for path") + HDsnprintf(pathname, pathname_len, "%s\\%s", dir, fdFile.cFileName); /* Is the entity a File or Folder? */ - if(fdFile.dwFileAttributes &FILE_ATTRIBUTE_DIRECTORY) + if(fdFile.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) continue; if((found_in_dir = H5PL__open(plugin_type, pathname, type_id, info)) < 0) HGOTO_ERROR(H5E_PLUGIN, H5E_CANTGET, FAIL, "search in directory failed") if(found_in_dir) { /* Indicate success */ - ret_value = TRUE; - break; + HGOTO_DONE(TRUE) } /* end if */ else - if(pathname) - pathname = (char *)H5MM_xfree(pathname); + HDassert(pathname); + pathname = (char *)H5MM_xfree(pathname); } /* end if */ } while(FindNextFile(hFind, &fdFile)); /* Find the next file. */ @@ -498,7 +498,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5PL__find() */ -#endif +#endif /* H5_HAVE_WIN32_API */ /*------------------------------------------------------------------------- @@ -521,7 +521,6 @@ static htri_t H5PL__open(H5PL_type_t pl_type, char *libname, int pl_id, void **pl_info) { H5PL_HANDLE handle = NULL; - get_filter_info_t get_plugin_info = NULL; htri_t ret_value = FALSE; FUNC_ENTER_STATIC @@ -533,10 +532,12 @@ H5PL__open(H5PL_type_t pl_type, char *libname, int pl_id, void **pl_info) H5PL_CLR_ERROR; /* clear error */ } /* end if */ else { + H5PL_get_filter_info_t get_plugin_info = NULL; + /* Return a handle for the function H5PL_get_plugin_info in the dynamic library. * The plugin library is suppose to define this function. */ - if(NULL == (get_plugin_info = (get_filter_info_t)H5PL_GET_LIB_FUNC(handle, "H5PL_get_plugin_info"))) { + if(NULL == (get_plugin_info = (H5PL_get_filter_info_t)H5PL_GET_LIB_FUNC(handle, "H5PL_get_plugin_info"))) { if(H5PL__close(handle) < 0) HGOTO_ERROR(H5E_PLUGIN, H5E_CLOSEERROR, FAIL, "can't close dynamic library") } /* end if */ @@ -560,7 +561,7 @@ H5PL__open(H5PL_type_t pl_type, char *libname, int pl_id, void **pl_info) H5PL_table_t *table = (H5PL_table_t *)H5MM_realloc(H5PL_table_g, n * sizeof(H5PL_table_t)); if(!table) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "unable to extend dynamic library table") + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "unable to extend dynamic library table") H5PL_table_g = table; H5PL_table_alloc_g = n; @@ -606,26 +607,27 @@ done: static htri_t H5PL__search_table(H5PL_type_t plugin_type, int type_id, void **info) { - size_t i; - H5Z_class2_t *plugin_info; - get_filter_info_t get_plugin_info = NULL; htri_t ret_value = FALSE; FUNC_ENTER_STATIC /* Search in the table of already opened dynamic libraries */ if(H5PL_table_used_g > 0) { + size_t i; + for(i = 0; i < H5PL_table_used_g; i++) { if((plugin_type == (H5PL_table_g[i]).pl_type) && (type_id == (H5PL_table_g[i]).pl_id)) { - if(NULL == (get_plugin_info = (get_filter_info_t)H5PL_GET_LIB_FUNC((H5PL_table_g[i]).handle, "H5PL_get_plugin_info"))) + H5PL_get_filter_info_t get_plugin_info; + H5Z_class2_t *plugin_info; + + if(NULL == (get_plugin_info = (H5PL_get_filter_info_t)H5PL_GET_LIB_FUNC((H5PL_table_g[i]).handle, "H5PL_get_plugin_info"))) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTGET, FAIL, "can't get function for H5PL_get_plugin_info") if(NULL == (plugin_info = (*get_plugin_info)())) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTGET, FAIL, "can't get plugin info") *info = (void *)plugin_info; - ret_value = TRUE; - break; + HGOTO_DONE(TRUE) } /* end if */ } /* end for */ } /* end if */ diff --git a/src/H5PLprivate.h b/src/H5PLprivate.h index 4c3cf69..037a3ec 100644 --- a/src/H5PLprivate.h +++ b/src/H5PLprivate.h @@ -47,6 +47,6 @@ /* Internal API routines */ H5_DLL void *H5PL_load(H5PL_type_t plugin_type, int type_id); -H5_DLL hbool_t H5PL_no_plugin(void); +H5_DLL htri_t H5PL_no_plugin(void); #endif /* _H5PLprivate_H */ diff --git a/src/H5Z.c b/src/H5Z.c index f838328..8095dce 100644 --- a/src/H5Z.c +++ b/src/H5Z.c @@ -1115,26 +1115,35 @@ H5Z_pipeline(const H5O_pline_t *pline, unsigned flags, continue;/*filter excluded*/ } - /* If the filter isn't registered and the application doesn't indicate no plugin through HDF5_PRELOAD_PLUG (using the symbol "::"), - * try to load it dynamically and register it. Otherwise, return failure */ - if((fclass_idx = H5Z_find_idx(pline->filter[idx].id)) < 0 && !H5PL_no_plugin()) { - H5Z_class2_t *filter_info; - - if(NULL != (filter_info = (H5Z_class2_t *)H5PL_load(H5PL_TYPE_FILTER, (int)(pline->filter[idx].id)))) { - if(H5Z_register(filter_info) < 0) - HGOTO_ERROR(H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register filter") - } /* end if */ + /* If the filter isn't registered and the application doesn't + * indicate no plugin through HDF5_PRELOAD_PLUG (using the symbol "::"), + * try to load it dynamically and register it. Otherwise, return failure + */ + if((fclass_idx = H5Z_find_idx(pline->filter[idx].id)) < 0) { + hbool_t issue_error = FALSE; + + /* Check for "no plugins" indicated" */ + if(H5PL_no_plugin()) + issue_error = TRUE; else { - /* Print out the filter name to give more info. But the name is optional for - * the filter */ - if(pline->filter[idx].name) - HGOTO_ERROR(H5E_PLINE, H5E_READERROR, FAIL, "required filter '%s' is not registered", pline->filter[idx].name) + H5Z_class2_t *filter_info; + + /* Try loading the filter */ + if(NULL != (filter_info = (H5Z_class2_t *)H5PL_load(H5PL_TYPE_FILTER, (int)(pline->filter[idx].id)))) { + /* Register the filter we loaded */ + if(H5Z_register(filter_info) < 0) + HGOTO_ERROR(H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register filter") + + /* Search in the table of registered filters again to find the dynamic filter just loaded and registered */ + if((fclass_idx = H5Z_find_idx(pline->filter[idx].id)) < 0) + issue_error = TRUE; + } /* end if */ else - HGOTO_ERROR(H5E_PLINE, H5E_READERROR, FAIL, "required filter (name unavailable) is not registered") + issue_error = TRUE; } /* end else */ - /* Search in the table of registered filters again to find the dynamic filter just loaded and registered */ - if((fclass_idx = H5Z_find_idx(pline->filter[idx].id)) < 0) { + /* Check for error */ + if(issue_error) { /* Print out the filter name to give more info. But the name is optional for * the filter */ if(pline->filter[idx].name) @@ -1142,14 +1151,7 @@ H5Z_pipeline(const H5O_pline_t *pline, unsigned flags, else HGOTO_ERROR(H5E_PLINE, H5E_READERROR, FAIL, "required filter (name unavailable) is not registered") } /* end if */ - } else if((fclass_idx = H5Z_find_idx(pline->filter[idx].id)) < 0 && H5PL_no_plugin()) { - /* Print out the filter name to give more info. But the name is optional for - * the filter */ - if(pline->filter[idx].name) - HGOTO_ERROR(H5E_PLINE, H5E_READERROR, FAIL, "required filter '%s' is not registered", pline->filter[idx].name) - else - HGOTO_ERROR(H5E_PLINE, H5E_READERROR, FAIL, "required filter (name unavailable) is not registered") - } + } /* end if */ fclass=&H5Z_table_g[fclass_idx]; #ifdef H5Z_DEBUG -- cgit v0.12 From 46342f639876ebe60be6b27a7fd6712f61941d0e Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Thu, 4 Apr 2013 08:30:45 -0500 Subject: [svn-r23544] Description: Correct API version mistake w/H5Acreate -> H5Acreate2 Tested on: Mac OSX/64 10.8.3 (amazon) w/parallel --- testpar/t_dset.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testpar/t_dset.c b/testpar/t_dset.c index 4be0296..02c809d 100644 --- a/testpar/t_dset.c +++ b/testpar/t_dset.c @@ -4082,7 +4082,7 @@ test_dense_attr(void) atFileSpace = H5Screate_simple(1, atDims, NULL); VRFY((atFileSpace > 0), "H5Screate_simple succeeded"); - atid = H5Acreate(gid, "bar", H5T_STD_U64LE, atFileSpace, H5P_DEFAULT, H5P_DEFAULT); + atid = H5Acreate2(gid, "bar", H5T_STD_U64LE, atFileSpace, H5P_DEFAULT, H5P_DEFAULT); VRFY((atid > 0), "H5Acreate succeeded"); status = H5Sclose(atFileSpace); VRFY((status >= 0), "H5Sclose succeeded"); -- cgit v0.12 From a259cbdda792c4167a082d10d8b9496ab19a8993 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 4 Apr 2013 10:04:16 -0500 Subject: [svn-r23546] Correct typo --- test/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 84709b7..19f610f 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -367,7 +367,7 @@ ADD_TEST ( extlinks19B00003.h5 extlinks19B00004.h5 extlinks19B00005.h5 - extlinks19B00006.h5plugins + extlinks19B00006.h5 extlinks19B00007.h5 extlinks19B00008.h5 extlinks19B00009.h5 -- cgit v0.12 From 12616e370c006764602a1c4f77136851f9397ca1 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 4 Apr 2013 10:41:15 -0500 Subject: [svn-r23547] Windows plugins will always be "dll"'s. CMake also uses ";" as a separator - escape it Tested: windows --- src/H5PL.c | 2 +- test/CMakeLists.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/H5PL.c b/src/H5PL.c index 35925e1..ef470b7 100644 --- a/src/H5PL.c +++ b/src/H5PL.c @@ -456,7 +456,7 @@ H5PL__find(H5PL_type_t plugin_type, int type_id, char *dir, void **info) FUNC_ENTER_STATIC /* Specify a file mask. *.* = We want everything! */ - sprintf(service, "%s\/*.*", dir); + sprintf(service, "%s\/*.dll", dir); if((hFind = FindFirstFile(service, &fdFile)) == INVALID_HANDLE_VALUE) HGOTO_ERROR(H5E_PLUGIN, H5E_OPENERROR, FAIL, "can't open directory") diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 19f610f..8904fee 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -639,7 +639,7 @@ ADD_TEST (NAME testlibinfo COMMAND ${CMAKE_COMMAND} -D "TEST_PROGRAM=$ Date: Thu, 4 Apr 2013 11:35:22 -0500 Subject: [svn-r23548] Fix typo in macro end macro Warning only. --- tools/h5dump/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/h5dump/CMakeLists.txt b/tools/h5dump/CMakeLists.txt index 365326e..c7ebe63 100644 --- a/tools/h5dump/CMakeLists.txt +++ b/tools/h5dump/CMakeLists.txt @@ -931,7 +931,7 @@ IF (BUILD_TESTING) ) SET_TESTS_PROPERTIES (H5DUMP-${resultfile} PROPERTIES DEPENDS "H5DUMP-${resultfile}-clear-objects") ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) - ENDMACRO (ADD_H5ERR_MASK_TEST file) + ENDMACRO (ADD_H5ERR_MASK_ENV_TEST) MACRO (ADD_H5_TEST_IMPORT conffile resultfile testfile resultcode) # If using memchecker add tests without using scripts -- cgit v0.12 From 8277409a9b52049af6f18aa2a6688c85cebb7695 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Thu, 4 Apr 2013 15:57:59 -0500 Subject: [svn-r23549] Description: More misc. cleanups, but main change is to make an "extern" header file for the plugin interface. Tested on: Mac OSX/64 10.8.3 (amazon) --- MANIFEST | 2 +- src/CMakeLists.txt | 2 +- src/H5PL.c | 58 ++++++++++++++++++------------------- src/H5PLextern.h | 84 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/H5PLprivate.h | 7 +++-- src/H5PLpublic.h | 84 ------------------------------------------------------ src/H5Pocpl.c | 5 ++-- src/H5Z.c | 4 +-- src/Makefile.am | 2 +- src/Makefile.in | 2 +- src/hdf5.h | 1 - test/dynlib1.c | 25 ++++++++-------- test/dynlib2.c | 25 ++++++++-------- test/dynlib3.c | 18 ++++++------ test/plugin.c | 33 +++++++++------------ 15 files changed, 174 insertions(+), 178 deletions(-) create mode 100644 src/H5PLextern.h delete mode 100644 src/H5PLpublic.h diff --git a/MANIFEST b/MANIFEST index a1ae698..993c734 100644 --- a/MANIFEST +++ b/MANIFEST @@ -851,7 +851,7 @@ ./src/H5Ptest.c ./src/H5PL.c ./src/H5PLprivate.h -./src/H5PLpublic.h +./src/H5PLextern.h ./src/H5R.c ./src/H5Rdeprec.c ./src/H5Rpkg.h diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 4b70259..7132d80 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -482,7 +482,7 @@ SET (H5PL_SRCS ) SET (H5PL_HDRS - ${HDF5_SRC_DIR}/H5PLpublic.h + ${HDF5_SRC_DIR}/H5PLextern.h ) IDE_GENERATED_PROPERTIES ("H5PL" "${H5PL_HDRS}" "${H5PL_SRCS}" ) diff --git a/src/H5PL.c b/src/H5PL.c index ef470b7..07e90af 100644 --- a/src/H5PL.c +++ b/src/H5PL.c @@ -61,7 +61,7 @@ /* Clear error - nothing to do */ #define H5PL_CLR_ERROR -typedef const H5Z_class2_t *(__cdecl *H5PL_get_filter_info_t)(void); +typedef const void *(__cdecl *H5PL_get_plugin_info_t)(void); /* Unix support */ #else /* H5_HAVE_WIN32_API */ @@ -84,7 +84,7 @@ typedef const H5Z_class2_t *(__cdecl *H5PL_get_filter_info_t)(void); /* Clear error */ #define H5PL_CLR_ERROR dlerror() -typedef const H5Z_class2_t *(*H5PL_get_filter_info_t)(void); +typedef const void *(*H5PL_get_plugin_info_t)(void); #endif /* H5_HAVE_WIN32_API */ /* Special symbol to indicate no plugin loading */ @@ -107,9 +107,9 @@ typedef struct H5PL_table_t { /********************/ static herr_t H5PL__init_path_table(void); -static htri_t H5PL__find(H5PL_type_t plugin_type, int type_id, char *dir, void **info); -static htri_t H5PL__open(H5PL_type_t pl_type, char *libname, int plugin_id, void **pl_info); -static htri_t H5PL__search_table(H5PL_type_t plugin_type, int type_id, void **info); +static htri_t H5PL__find(H5PL_type_t plugin_type, int type_id, char *dir, const void **info); +static htri_t H5PL__open(H5PL_type_t pl_type, char *libname, int plugin_id, const void **pl_info); +static htri_t H5PL__search_table(H5PL_type_t plugin_type, int type_id, const void **info); static herr_t H5PL__close(H5PL_HANDLE handle); @@ -193,7 +193,7 @@ H5PL_no_plugin(void) FUNC_ENTER_NOAPI(FAIL) - ret_value = H5PL_no_plugin_g; + ret_value = (htri_t)H5PL_no_plugin_g; done: FUNC_LEAVE_NOAPI(ret_value) @@ -264,12 +264,12 @@ H5PL_term_interface(void) * *------------------------------------------------------------------------- */ -void * +const void * H5PL_load(H5PL_type_t type, int id) { - htri_t found; /* Whether the plugin was found */ - H5Z_class2_t *plugin_info = NULL; - void *ret_value = NULL; + htri_t found; /* Whether the plugin was found */ + const void *plugin_info = NULL; + const void *ret_value = NULL; FUNC_ENTER_NOAPI(NULL) @@ -281,7 +281,7 @@ H5PL_load(H5PL_type_t type, int id) HGOTO_ERROR(H5E_PLUGIN, H5E_CANTINIT, NULL, "can't initialize search path table") /* Search in the table of already loaded plugin libraries */ - if((found = H5PL__search_table(type, id, (void **)&plugin_info)) < 0) + if((found = H5PL__search_table(type, id, &plugin_info)) < 0) HGOTO_ERROR(H5E_PLUGIN, H5E_CANTGET, NULL, "search in table failed") /* If not found, iterate through the path table to find the right dynamic library */ @@ -289,7 +289,7 @@ H5PL_load(H5PL_type_t type, int id) size_t i; /* Local index variable */ for(i = 0; i < H5PL_num_paths_g; i++) { - if((found = H5PL__find(type, id, H5PL_path_table_g[i], (void **)&plugin_info)) < 0) + if((found = H5PL__find(type, id, H5PL_path_table_g[i], &plugin_info)) < 0) HGOTO_ERROR(H5E_PLUGIN, H5E_CANTGET, NULL, "search in paths failed") /* Break out if found */ @@ -383,7 +383,7 @@ done: */ #ifndef H5_HAVE_WIN32_API static htri_t -H5PL__find(H5PL_type_t plugin_type, int type_id, char *dir, void **info) +H5PL__find(H5PL_type_t plugin_type, int type_id, char *dir, const void **info) { char *pathname = NULL; DIR *dirp = NULL; @@ -445,7 +445,7 @@ done: } /* end H5PL__find() */ #else /* H5_HAVE_WIN32_API */ static htri_t -H5PL__find(H5PL_type_t plugin_type, int type_id, char *dir, void **info) +H5PL__find(H5PL_type_t plugin_type, int type_id, char *dir, const void **info) { WIN32_FIND_DATA fdFile; HANDLE hFind; @@ -518,7 +518,7 @@ done: *------------------------------------------------------------------------- */ static htri_t -H5PL__open(H5PL_type_t pl_type, char *libname, int pl_id, void **pl_info) +H5PL__open(H5PL_type_t pl_type, char *libname, int pl_id, const void **pl_info) { H5PL_HANDLE handle = NULL; htri_t ret_value = FALSE; @@ -532,22 +532,22 @@ H5PL__open(H5PL_type_t pl_type, char *libname, int pl_id, void **pl_info) H5PL_CLR_ERROR; /* clear error */ } /* end if */ else { - H5PL_get_filter_info_t get_plugin_info = NULL; + H5PL_get_plugin_info_t get_plugin_info = NULL; - /* Return a handle for the function H5PL_get_plugin_info in the dynamic library. + /* Return a handle for the function H5PLget_plugin_info in the dynamic library. * The plugin library is suppose to define this function. */ - if(NULL == (get_plugin_info = (H5PL_get_filter_info_t)H5PL_GET_LIB_FUNC(handle, "H5PL_get_plugin_info"))) { + if(NULL == (get_plugin_info = (H5PL_get_plugin_info_t)H5PL_GET_LIB_FUNC(handle, "H5PLget_plugin_info"))) { if(H5PL__close(handle) < 0) HGOTO_ERROR(H5E_PLUGIN, H5E_CLOSEERROR, FAIL, "can't close dynamic library") } /* end if */ else { - H5Z_class2_t *plugin_info; + const H5Z_class2_t *plugin_info; - /* Invoke H5PL_get_plugin_info to verify this is the right library we are looking for. + /* Invoke H5PLget_plugin_info to verify this is the right library we are looking for. * Move on if it isn't. */ - if(NULL == (plugin_info = (*get_plugin_info)())) { + if(NULL == (plugin_info = (const H5Z_class2_t *)(*get_plugin_info)())) { if(H5PL__close(handle) < 0) HGOTO_ERROR(H5E_PLUGIN, H5E_CLOSEERROR, FAIL, "can't close dynamic library") HGOTO_ERROR(H5E_PLUGIN, H5E_CANTGET, FAIL, "can't get plugin info") @@ -573,7 +573,7 @@ H5PL__open(H5PL_type_t pl_type, char *libname, int pl_id, void **pl_info) H5PL_table_used_g++; /* Set the plugin info to return */ - *pl_info = (void *)plugin_info; + *pl_info = (const void *)plugin_info; /* Indicate success */ ret_value = TRUE; @@ -605,7 +605,7 @@ done: *------------------------------------------------------------------------- */ static htri_t -H5PL__search_table(H5PL_type_t plugin_type, int type_id, void **info) +H5PL__search_table(H5PL_type_t plugin_type, int type_id, const void **info) { htri_t ret_value = FALSE; @@ -617,16 +617,16 @@ H5PL__search_table(H5PL_type_t plugin_type, int type_id, void **info) for(i = 0; i < H5PL_table_used_g; i++) { if((plugin_type == (H5PL_table_g[i]).pl_type) && (type_id == (H5PL_table_g[i]).pl_id)) { - H5PL_get_filter_info_t get_plugin_info; - H5Z_class2_t *plugin_info; + H5PL_get_plugin_info_t get_plugin_info; + const H5Z_class2_t *plugin_info; - if(NULL == (get_plugin_info = (H5PL_get_filter_info_t)H5PL_GET_LIB_FUNC((H5PL_table_g[i]).handle, "H5PL_get_plugin_info"))) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTGET, FAIL, "can't get function for H5PL_get_plugin_info") + if(NULL == (get_plugin_info = (H5PL_get_plugin_info_t)H5PL_GET_LIB_FUNC((H5PL_table_g[i]).handle, "H5PLget_plugin_info"))) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTGET, FAIL, "can't get function for H5PLget_plugin_info") - if(NULL == (plugin_info = (*get_plugin_info)())) + if(NULL == (plugin_info = (const H5Z_class2_t *)(*get_plugin_info)())) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTGET, FAIL, "can't get plugin info") - *info = (void *)plugin_info; + *info = plugin_info; HGOTO_DONE(TRUE) } /* end if */ } /* end for */ diff --git a/src/H5PLextern.h b/src/H5PLextern.h new file mode 100644 index 0000000..943e3aa --- /dev/null +++ b/src/H5PLextern.h @@ -0,0 +1,84 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * 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 files COPYING and Copyright.html. COPYING can be found at the root * + * of the source code distribution tree; Copyright.html can be found at the * + * root level of an installed copy of the electronic document set and is * + * linked from the top-level documents page. It can also be found at * + * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have access * + * to either file, you may request a copy from help@hdfgroup.org. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* + * Programmer: Raymond Lu + * 13 February 2013 + */ +#ifndef _H5PLextern_H +#define _H5PLextern_H + +/* Include HDF5 header */ +#include "hdf5.h" + +/*******************/ +/* Public Typedefs */ +/*******************/ + +/* Plugin type */ +typedef enum H5PL_type_t { + H5PL_TYPE_ERROR = -1, /*error */ + H5PL_TYPE_FILTER = 0, /*filter */ + H5PL_TYPE_NONE = 1 /*this must be last! */ +} H5PL_type_t; + + +#ifdef H5_BUILT_AS_DYNAMIC_LIB + + #if defined (hdf5_EXPORTS) + /* hdf5 library imports from plugin */ + #if defined (_MSC_VER) /* MSVC Compiler Case */ + #define H5PLUGIN_DLL __declspec(dllimport) + #elif (__GNUC__ >= 4) /* GCC 4.x has support for visibility options */ + #define H5PLUGIN_DLL __attribute__ ((visibility("default"))) + #endif + #else + /* plugins always export */ + #if defined (_MSC_VER) /* MSVC Compiler Case */ + #define H5PLUGIN_DLL __declspec(dllexport) + #elif (__GNUC__ >= 4) /* GCC 4.x has support for visibility options */ + #define H5PLUGIN_DLL __attribute__ ((visibility("default"))) + #endif + #endif + +#elif defined(H5_BUILT_AS_STATIC_LIB) + #define H5PLUGIN_DLL +#else + + #if defined(H5_HAVE_WIN32_API) + #if defined(_HDF5DLL_) + #pragma warning(disable: 4273) /* Disable the dll linkage warnings */ + #define H5PLUGIN_DLL __declspec(dllimport) + #elif defined(_HDF5USEDLL_) + #define H5PLUGIN_DLL __declspec(dllexport) + #endif /* _HDF5DLL_ */ + #else /*H5_HAVE_WIN32_API*/ + #define H5PLUGIN_DLL + #endif /*H5_HAVE_WIN32_API*/ + +#endif /* H5_BUILT_AS_xxx_LIB */ + +#ifdef __cplusplus +extern "C" { +#endif + +H5PLUGIN_DLL H5PL_type_t H5PLget_plugin_type(void); +H5PLUGIN_DLL const void *H5PLget_plugin_info(void); + +#ifdef __cplusplus +} +#endif + +#endif /* _H5PLextern_H */ + diff --git a/src/H5PLprivate.h b/src/H5PLprivate.h index 037a3ec..b117613 100644 --- a/src/H5PLprivate.h +++ b/src/H5PLprivate.h @@ -19,8 +19,8 @@ #ifndef _H5PLprivate_H #define _H5PLprivate_H -/* Include package's public header */ -#include "H5PLpublic.h" +/* Include package's "external" header */ +#include "H5PLextern.h" /* Private headers needed by this file */ #include "H5private.h" /* Generic Functions */ @@ -46,7 +46,8 @@ /***************************************/ /* Internal API routines */ -H5_DLL void *H5PL_load(H5PL_type_t plugin_type, int type_id); +H5_DLL const void *H5PL_load(H5PL_type_t plugin_type, int type_id); H5_DLL htri_t H5PL_no_plugin(void); #endif /* _H5PLprivate_H */ + diff --git a/src/H5PLpublic.h b/src/H5PLpublic.h deleted file mode 100644 index 9b71164..0000000 --- a/src/H5PLpublic.h +++ /dev/null @@ -1,84 +0,0 @@ -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - * 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 files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic document set and is * - * linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have access * - * to either file, you may request a copy from help@hdfgroup.org. * - * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ - -/* - * Programmer: Raymond Lu - * 13 February 2013 - */ -#ifndef _H5PLpublic_H -#define _H5PLpublic_H - -/* Public headers needed by this file */ -#include "H5Zpublic.h" - -/****************************/ -/* Library Public Typedefs */ -/****************************/ - -/* Plugin type */ -typedef enum H5PL_type_t { - H5PL_TYPE_ERROR = -1, /*error */ - H5PL_TYPE_FILTER = 0, /*filter */ - H5PL_TYPE_VFD = 1, /*virtual file driver */ - H5PL_TYPE_NONE = 2 /*this must be last! */ -} H5PL_type_t; - - -#ifdef H5_BUILT_AS_DYNAMIC_LIB - - #if defined (hdf5_EXPORTS) - /* hdf5 library imports from plugin */ - #if defined (_MSC_VER) /* MSVC Compiler Case */ - #define H5PLUGIN_DLL __declspec(dllimport) - #elif (__GNUC__ >= 4) /* GCC 4.x has support for visibility options */ - #define H5PLUGIN_DLL __attribute__ ((visibility("default"))) - #endif - #else - /* plugins always export */ - #if defined (_MSC_VER) /* MSVC Compiler Case */ - #define H5PLUGIN_DLL __declspec(dllexport) - #elif (__GNUC__ >= 4) /* GCC 4.x has support for visibility options */ - #define H5PLUGIN_DLL __attribute__ ((visibility("default"))) - #endif - #endif - -#elif defined(H5_BUILT_AS_STATIC_LIB) - #define H5PLUGIN_DLL -#else - - #if defined(H5_HAVE_WIN32_API) - #if defined(_HDF5DLL_) - #pragma warning(disable: 4273) /* Disable the dll linkage warnings */ - #define H5PLUGIN_DLL __declspec(dllimport) - #elif defined(_HDF5USEDLL_) - #define H5PLUGIN_DLL __declspec(dllexport) - #endif /* _HDF5DLL_ */ - #else /*H5_HAVE_WIN32_API*/ - #define H5PLUGIN_DLL - #endif /*H5_HAVE_WIN32_API*/ - -#endif /* H5_BUILT_AS_xxx_LIB */ - -#ifdef __cplusplus -extern "C" { -#endif - - H5PLUGIN_DLL H5PL_type_t H5PL_get_plugin_type(void); - H5PLUGIN_DLL H5Z_class2_t* H5PL_get_plugin_info(void); - -#ifdef __cplusplus -} -#endif - -#endif /* _H5PLpublic_H */ diff --git a/src/H5Pocpl.c b/src/H5Pocpl.c index 82c4b5d..880b46a 100644 --- a/src/H5Pocpl.c +++ b/src/H5Pocpl.c @@ -752,7 +752,6 @@ H5Pset_filter(hid_t plist_id, H5Z_filter_t filter, unsigned int flags, size_t cd_nelmts, const unsigned int cd_values[/*cd_nelmts*/]) { H5P_genplist_t *plist; /* Property list */ - H5O_pline_t pline; /* Filter pipeline */ herr_t ret_value=SUCCEED; /* return value */ FUNC_ENTER_API(FAIL) @@ -830,9 +829,9 @@ H5P__set_filter(H5P_genplist_t *plist, H5Z_filter_t filter, unsigned int flags, /* If filter is not available, try to dynamically load it */ if(!filter_avail) { - H5Z_class2_t *filter_info; + const H5Z_class2_t *filter_info; - if(NULL == (filter_info = (H5Z_class2_t *)H5PL_load(H5PL_TYPE_FILTER, (int)filter))) + if(NULL == (filter_info = (const H5Z_class2_t *)H5PL_load(H5PL_TYPE_FILTER, (int)filter))) HGOTO_ERROR(H5E_PLINE, H5E_CANTLOAD, FAIL, "failed to load dynamically loaded plugin") if(H5Z_register(filter_info) < 0) HGOTO_ERROR(H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register filter") diff --git a/src/H5Z.c b/src/H5Z.c index 8095dce..9f8b59d 100644 --- a/src/H5Z.c +++ b/src/H5Z.c @@ -1126,10 +1126,10 @@ H5Z_pipeline(const H5O_pline_t *pline, unsigned flags, if(H5PL_no_plugin()) issue_error = TRUE; else { - H5Z_class2_t *filter_info; + const H5Z_class2_t *filter_info; /* Try loading the filter */ - if(NULL != (filter_info = (H5Z_class2_t *)H5PL_load(H5PL_TYPE_FILTER, (int)(pline->filter[idx].id)))) { + if(NULL != (filter_info = (const H5Z_class2_t *)H5PL_load(H5PL_TYPE_FILTER, (int)(pline->filter[idx].id)))) { /* Register the filter we loaded */ if(H5Z_register(filter_info) < 0) HGOTO_ERROR(H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register filter") diff --git a/src/Makefile.am b/src/Makefile.am index a7f7bd9..5f383e0 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -119,7 +119,7 @@ include_HEADERS = hdf5.h H5api_adpt.h H5overflow.h H5pubconf.h H5public.h H5vers H5FDmulti.h H5FDsec2.h H5FDstdio.h \ H5Gpublic.h H5Ipublic.h H5Lpublic.h \ H5MMpublic.h H5Opublic.h H5Ppublic.h \ - H5PLpublic.h \ + H5PLextern.h \ H5Rpublic.h H5Spublic.h \ H5Tpublic.h H5Zpublic.h diff --git a/src/Makefile.in b/src/Makefile.in index 5f3b2c4..e2495a1 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -616,7 +616,7 @@ include_HEADERS = hdf5.h H5api_adpt.h H5overflow.h H5pubconf.h H5public.h H5vers H5FDmulti.h H5FDsec2.h H5FDstdio.h \ H5Gpublic.h H5Ipublic.h H5Lpublic.h \ H5MMpublic.h H5Opublic.h H5Ppublic.h \ - H5PLpublic.h \ + H5PLextern.h \ H5Rpublic.h H5Spublic.h \ H5Tpublic.h H5Zpublic.h diff --git a/src/hdf5.h b/src/hdf5.h index c2e4866..a37329d 100644 --- a/src/hdf5.h +++ b/src/hdf5.h @@ -34,7 +34,6 @@ #include "H5MMpublic.h" /* Memory management */ #include "H5Opublic.h" /* Object headers */ #include "H5Ppublic.h" /* Property lists */ -#include "H5PLpublic.h" /* Plugin */ #include "H5Rpublic.h" /* References */ #include "H5Spublic.h" /* Dataspaces */ #include "H5Tpublic.h" /* Datatypes */ diff --git a/test/dynlib1.c b/test/dynlib1.c index de14f6f..1ccc33a 100644 --- a/test/dynlib1.c +++ b/test/dynlib1.c @@ -20,7 +20,7 @@ #include #include -#include +#include "H5PLextern.h" #define H5Z_FILTER_DYNLIB1 257 @@ -38,8 +38,8 @@ const H5Z_class2_t H5Z_DYNLIB1[1] = {{ (H5Z_func_t)H5Z_filter_dynlib1, /* The actual filter function */ }}; -H5PL_type_t H5PL_get_plugin_type(void) {return H5PL_TYPE_FILTER;} -H5Z_class2_t* H5PL_get_plugin_info(void) {return H5Z_DYNLIB1;} +H5PL_type_t H5PLget_plugin_type(void) {return H5PL_TYPE_FILTER;} +const void *H5PLget_plugin_info(void) {return H5Z_DYNLIB1;} /*------------------------------------------------------------------------- * Function: H5Z_filter_dynlib1 @@ -63,34 +63,35 @@ H5Z_filter_dynlib1(unsigned int flags, size_t cd_nelmts, const unsigned int *cd_values, size_t nbytes, size_t *buf_size, void **buf) { - int *int_ptr=(int *)*buf; /* Pointer to the data values */ - size_t buf_left=*buf_size; /* Amount of data buffer left to process */ - int add_on = 0; + int *int_ptr = (int *)*buf; /* Pointer to the data values */ + size_t buf_left = *buf_size; /* Amount of data buffer left to process */ + int add_on = 0; /* Check for the correct number of parameters */ - if(cd_nelmts==0) + if(cd_nelmts == 0) return(0); /* Check that permanent parameters are set correctly */ - if(cd_values[0]<0 || cd_values[0]>9) + if(cd_values[0] > 9) return(0); - add_on = cd_values[0]; + add_on = (int)cd_values[0]; if(flags & H5Z_FLAG_REVERSE) { /*read*/ /* Substract the "add on" value to all the data values */ - while(buf_left>0) { + while(buf_left > 0) { *int_ptr++ -= add_on; buf_left -= sizeof(int); } /* end while */ } /* end if */ else { /*write*/ /* Add the "add on" value to all the data values */ - while(buf_left>0) { + while(buf_left > 0) { *int_ptr++ += add_on; buf_left -= sizeof(int); } /* end while */ } /* end else */ return nbytes; -} +} /* end H5Z_filter_dynlib1() */ + diff --git a/test/dynlib2.c b/test/dynlib2.c index 648f7e0..a853ed0 100644 --- a/test/dynlib2.c +++ b/test/dynlib2.c @@ -20,7 +20,7 @@ #include #include -#include +#include "H5PLextern.h" #define H5Z_FILTER_DYNLIB2 258 #define MULTIPLIER 3 @@ -39,8 +39,8 @@ const H5Z_class2_t H5Z_DYNLIB2[1] = {{ (H5Z_func_t)H5Z_filter_dynlib2, /* The actual filter function */ }}; -H5PL_type_t H5PL_get_plugin_type(void) {return H5PL_TYPE_FILTER;} -H5Z_class2_t* H5PL_get_plugin_info(void) {return H5Z_DYNLIB2;} +H5PL_type_t H5PLget_plugin_type(void) {return H5PL_TYPE_FILTER;} +const void *H5PLget_plugin_info(void) {return H5Z_DYNLIB2;} /*------------------------------------------------------------------------- * Function: H5Z_filter_dynlib2 @@ -64,29 +64,28 @@ H5Z_filter_dynlib2(unsigned int flags, size_t cd_nelmts, const unsigned int *cd_values, size_t nbytes, size_t *buf_size, void **buf) { - int *int_ptr=(int *)*buf; /* Pointer to the data values */ - size_t buf_left=*buf_size; /* Amount of data buffer left to process */ + int *int_ptr = (int *)*buf; /* Pointer to the data values */ + size_t buf_left = *buf_size; /* Amount of data buffer left to process */ /* Check for the correct number of parameters */ - if(cd_nelmts>0) + if(cd_nelmts > 0) return(0); if(flags & H5Z_FLAG_REVERSE) { /*read*/ /* Divide the original value with MULTIPLIER */ - while(buf_left>0) { - *int_ptr /= MULTIPLIER; - *int_ptr++; + while(buf_left > 0) { + *int_ptr++ /= MULTIPLIER; buf_left -= sizeof(int); } /* end while */ } /* end if */ else { /*write*/ /* Multiply the original value with MULTIPLIER */ - while(buf_left>0) { - *int_ptr *= MULTIPLIER; - *int_ptr++; + while(buf_left > 0) { + *int_ptr++ *= MULTIPLIER; buf_left -= sizeof(int); } /* end while */ } /* end else */ return nbytes; -} +} /* end H5Z_filter_dynlib2() */ + diff --git a/test/dynlib3.c b/test/dynlib3.c index 276a5b7..9560b86 100644 --- a/test/dynlib3.c +++ b/test/dynlib3.c @@ -21,7 +21,7 @@ #include #include #include -#include +#include "H5PLextern.h" #define H5Z_FILTER_DYNLIB3 259 #define SUFFIX_LEN 8 @@ -41,8 +41,8 @@ const H5Z_class2_t H5Z_DYNLIB3[1] = {{ (H5Z_func_t)H5Z_filter_dynlib3, /* The actual filter function */ }}; -H5PL_type_t H5PL_get_plugin_type(void) {return H5PL_TYPE_FILTER;} -H5Z_class2_t* H5PL_get_plugin_info(void) {return H5Z_DYNLIB3;} +H5PL_type_t H5PLget_plugin_type(void) {return H5PL_TYPE_FILTER;} +const void *H5PLget_plugin_info(void) {return H5Z_DYNLIB3;} /*------------------------------------------------------------------------- * Function: H5Z_filter_dynlib3 @@ -68,23 +68,24 @@ H5Z_filter_dynlib3(unsigned int flags, size_t cd_nelmts, size_t ret_value; /* Return value */ /* Check for the correct number of parameters */ - if(cd_nelmts>0) + if(cd_nelmts > 0) return(0); if(flags & H5Z_FLAG_REVERSE) { /*read*/ ret_value = *buf_size = nbytes - SUFFIX_LEN; - } else { /*write*/ + } /* end if */ + else { /*write*/ void *outbuf = NULL; /* Pointer to new buffer */ unsigned char *dst; /* Temporary pointer to destination buffer */ - dst=outbuf=malloc(nbytes+SUFFIX_LEN); + dst = (unsigned char *)(outbuf = malloc(nbytes + SUFFIX_LEN)); /* Copy raw data */ memcpy((void*)dst, (void*)(*buf), nbytes); /* Append suffix to raw data for storage */ dst += nbytes; - memcpy((void*)dst, (void*)GROUP_SUFFIX, SUFFIX_LEN); + memcpy(dst, (void*)GROUP_SUFFIX, SUFFIX_LEN); /* Free input buffer */ free(*buf); @@ -97,4 +98,5 @@ H5Z_filter_dynlib3(unsigned int flags, size_t cd_nelmts, } /* end else */ return ret_value; -} +} /* H5Z_filter_dynlib3() */ + diff --git a/test/plugin.c b/test/plugin.c index b37cfa3..86bc952 100644 --- a/test/plugin.c +++ b/test/plugin.c @@ -34,9 +34,6 @@ #define H5Z_FILTER_DYNLIB2 258 #define H5Z_FILTER_DYNLIB3 259 -/* Bzip2 filter */ -#define H5Z_FILTER_BZIP2 307 - const char *FILENAME[] = { "plugin", NULL @@ -45,7 +42,6 @@ const char *FILENAME[] = { /* Dataset names for testing filters */ #define DSET_DEFLATE_NAME "deflate" -#define DSET_BZIP2_NAME "bzip2" #define DSET_DYNLIB1_NAME "dynlib1" #define DSET_DYNLIB2_NAME "dynlib2" @@ -156,7 +152,8 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl) */ TESTING(" filters (write)"); - for(i=n=0; i Date: Fri, 5 Apr 2013 12:37:55 -0500 Subject: [svn-r23554] Added HDFFV-8247 to the Known Problems section. --- release_docs/RELEASE.txt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index dbd3b75..03c425a 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -1303,6 +1303,14 @@ The following platforms are not supported but have been tested for this release. Known Problems ============== +* The h5dump and h5diff utilities occasionally produce different output + between Linux and Windows systems. This is caused by lower-level library + routines that fail to write fill values to the user's buffer when reading + unallocated chunks from datasets that have a fill value set to + H5D_FILL_VALUE_DEFAULT. Due to platform differences the return of + spurious data values have only been encountered on Windows 32-bit systems. + (Issue HDFFV-8247; JP - 2013/03/27) + * The 5.9 C++ compiler on Sun failed to compile a C++ test ttypes.cpp. It complains with this message: "/home/hdf5/src/H5Vprivate.h", line 130: Error: __func__ is not defined. -- cgit v0.12 From 6b00c16d2aceb8e2a301b5086c8a9370c80f1f8a Mon Sep 17 00:00:00 2001 From: Albert Cheng Date: Fri, 5 Apr 2013 13:29:46 -0500 Subject: [svn-r23555] Bug fix: HDFFV-8358 The previous change set exec_prefix, libdir and includedir to actual values. That removed the option for user to hand edit just the first prefix=... to make "everything" to work. Changed h5redeploy to do this by default: ## Installation directories: ## ## prefix architecture-independent files. ## ## exec_prefix architecture-dependent files, default is . ## ## libdir libraries, default is /lib. ## ## includedir header files, default is . ## ############################################################################ This allows users to just change the first line of prefix=<...> and the effect will change libdir and includedir too. This was also try to accommodate the -prefix option of h5XX. Unfortunately, after changing h5redeploy, I found out the h5XX code to support -prefix actually does not provide the stated efffect. This will be fixed in the release. Tested: h5committested plus hand test. --- tools/misc/h5redeploy.in | 89 +++++++++++++++++++----------------------------- 1 file changed, 35 insertions(+), 54 deletions(-) diff --git a/tools/misc/h5redeploy.in b/tools/misc/h5redeploy.in index f90ff13..6b6ef87 100644 --- a/tools/misc/h5redeploy.in +++ b/tools/misc/h5redeploy.in @@ -30,14 +30,20 @@ usage() { # A wonderfully informative "usage" message. echo "usage: $prog_name [OPTIONS]" echo " OPTIONS:" - echo " -help|help This help message" - echo " -echo Show all the shell commands executed" - echo " -force No prompt, just do it" - echo " -prefix=DIR New directory to find HDF5 lib/ and include/" - echo " subdirectories [default: current directory]" - echo " -tool=TOOL Tool to update. TOOL must be in the current" - echo " directory and writable. [default: $h5tools]" - echo " -show Show the commands without executing them" + echo " -help|help This help message" + echo " -echo Show all the shell commands executed" + echo " -force No prompt, just do it" + echo " -prefix=DIR New directory to find HDF5 lib/ and include/" + echo " subdirectories [default: current directory]" + echo " -exec-prefix=DIR New directory to find HDF5 lib/" + echo " subdirectory [default: ]" + echo " -libdir=DIR New directory for the HDF5 lib directory" + echo " [default: /lib]" + echo " -includedir=DIR New directory for the HDF5 header files" + echo " [default: /include]" + echo " -tool=TOOL Tool to update. TOOL must be in the current" + echo " directory and writable. [default: $h5tools]" + echo " -show Show the commands without executing them" echo " " exit $EXIT_FAILURE } @@ -85,7 +91,7 @@ h5tools="h5cc h5pcc h5fc h5pfc h5c++" # possible hdf5 tools foundtools= # tools found and will be modified fmode= # force mode, default is off prefix= -eprefix= +exec_prefix= libdir= includedir= @@ -95,8 +101,8 @@ for arg in $@ ; do -prefix=*) prefix="`echo $arg | cut -f2 -d=`" ;; - -eprefix=*) - eprefix="`echo $arg | cut -f2 -d=`" + -exec-prefix=*) + exec_prefix="`echo $arg | cut -f2 -d=`" ;; -libdir=*) libdir="`echo $arg | cut -f2 -d=`" @@ -127,36 +133,18 @@ for arg in $@ ; do esac done -# Set to default value if not given by user +# Set to default value, one above where i am, if not given by user if [ -z "$prefix" ]; then prefix=`(cd ..;pwd)` fi -if [ -z "$eprefix" ]; then - eprefix=$prefix +if [ -z "$exec_prefix" ]; then + exec_prefix='${prefix}' # use single quotes to prevent expansion of $ fi if [ -z "$libdir" ]; then - libdir=$eprefix/lib + libdir='${exec_prefix}'/lib # use single quotes to prevent expansion of $ fi if [ -z "$includedir" ]; then - includedir=$prefix/include -fi - -# Sanity checks -if [ ! -d $prefix ]; then - ERROR "prefix($prefix) is not an existing directory" - exit $EXIT_FAILURE -fi -if [ ! -d $prefix ]; then - ERROR "prefix($prefix) is not an existing directory" - exit $EXIT_FAILURE -fi -if [ ! -d $prefix ]; then - ERROR "prefix($prefix) is not an existing directory" - exit $EXIT_FAILURE -fi -if [ ! -d $prefix ]; then - ERROR "prefix($prefix) is not an existing directory" - exit $EXIT_FAILURE + includedir='${prefix}'/include # use single quotes to prevent expansion of $ fi for x in $h5tools; do @@ -192,19 +180,19 @@ fi CMDFILE=/tmp/h5redeploy.$$ touch $CMDFILE chmod 0600 $CMDFILE -echo "/^prefix=/c" >> $CMDFILE -echo prefix=\""$prefix"\" >> $CMDFILE -echo . >> $CMDFILE -echo "/^exec_prefix=/c" >> $CMDFILE -echo exec_prefix=\""$eprefix"\" >> $CMDFILE -echo . >> $CMDFILE -echo "/^libdir=/c" >> $CMDFILE -echo libdir=\""$libdir"\" >> $CMDFILE -echo . >> $CMDFILE -echo "/^includedir=/c" >> $CMDFILE -echo includedir=\""$includedir"\" >> $CMDFILE -echo . >> $CMDFILE -(echo w; echo q) >> $CMDFILE +echo "/^prefix=/c" >> $CMDFILE +echo prefix=\""$prefix"\" >> $CMDFILE +echo . >> $CMDFILE +echo "/^exec_prefix=/c" >> $CMDFILE +echo exec_prefix=\""$exec_prefix"\" >> $CMDFILE +echo . >> $CMDFILE +echo "/^libdir=/c" >> $CMDFILE +echo libdir=\""$libdir"\" >> $CMDFILE +echo . >> $CMDFILE +echo "/^includedir=/c" >> $CMDFILE +echo includedir=\""$includedir"\" >> $CMDFILE +echo . >> $CMDFILE +(echo w; echo q) >> $CMDFILE # Update them @@ -228,10 +216,3 @@ done # Cleanup rm -f $CMDFILE exit $EXIT_SUCCESS - -# Some possible future features to add -# CCBASE - Name of the alternative C compiler -# CLINKERBASE - Name of the alternative linker -# LDFLAGS - Path to different libraries your application will link with -# (this path should include the path to the zlib library) -# LIBS - Libraries your application will link with -- cgit v0.12 From 3e841b44be4047edfb1a28fcbcd37a2f71725d8d Mon Sep 17 00:00:00 2001 From: Raymond Lu Date: Mon, 8 Apr 2013 11:22:00 -0500 Subject: [svn-r23561] I added the info about dynamically loaded filter. --- release_docs/RELEASE.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 03c425a..32eaf16 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -106,6 +106,9 @@ New Features Library: -------- + - The library can load filter libraries dynamically during runtime. Users + can set the search path through environment variable HDF5_PLUGIN_PATH + and call H5Pset_filter to enable a dynamic filter. (SLU - 2013/04/08) - Added new API functions H5Dscatter and H5Dgather to scatter data to and and gather data from a selection within a memory buffer. (NAF - 2013/02/05) -- cgit v0.12 From dd577725d157522e554d4cec04723f751209f335 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Wed, 10 Apr 2013 11:49:28 -0500 Subject: [svn-r23572] Removed inappropriate executable properties from a few files. These are often added by Windows text editors. Tested on: jam (just tested to make sure it builds - no code changes) --- config/cmake/CTestCustom.cmake | 0 config/cmake/cacheinit.cmake | 0 config/cmake/mccacheinit.cmake | 0 tools/misc/h5perf_gentest.c | 0 4 files changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 config/cmake/CTestCustom.cmake mode change 100755 => 100644 config/cmake/cacheinit.cmake mode change 100755 => 100644 config/cmake/mccacheinit.cmake mode change 100755 => 100644 tools/misc/h5perf_gentest.c diff --git a/config/cmake/CTestCustom.cmake b/config/cmake/CTestCustom.cmake old mode 100755 new mode 100644 diff --git a/config/cmake/cacheinit.cmake b/config/cmake/cacheinit.cmake old mode 100755 new mode 100644 diff --git a/config/cmake/mccacheinit.cmake b/config/cmake/mccacheinit.cmake old mode 100755 new mode 100644 diff --git a/tools/misc/h5perf_gentest.c b/tools/misc/h5perf_gentest.c old mode 100755 new mode 100644 -- cgit v0.12 From 337242feeae4517e4ebec867391681471375a1c1 Mon Sep 17 00:00:00 2001 From: Scot Breitenfeld Date: Thu, 11 Apr 2013 14:40:57 -0500 Subject: [svn-r23576] added missing argument in check call. tested: jam (g95,gcc)) --- fortran/test/tH5O.f90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fortran/test/tH5O.f90 b/fortran/test/tH5O.f90 index b68e7ca..ea91631 100644 --- a/fortran/test/tH5O.f90 +++ b/fortran/test/tH5O.f90 @@ -535,7 +535,7 @@ SUBROUTINE test_h5o_link(total_error) ! close the datatype CALL h5tclose_f(tid, error) - CALL check("h5tclose_f",error) + CALL check("h5tclose_f",error, total_error) CALL h5ocopy_f(file_id, NAME_DATATYPE_SIMPLE, file_id, NAME_DATATYPE_SIMPLE2, error) CALL check("h5ocopy_f",error,total_error) -- cgit v0.12 From 523675b2c180608c445c7073d26ebe1e3a9028e3 Mon Sep 17 00:00:00 2001 From: Raymond Lu Date: Fri, 12 Apr 2013 14:48:07 -0500 Subject: [svn-r23580] I updated the compiler info, system info, and HDF5 support table of fred, emu, and ostrich. No test is needed. --- release_docs/RELEASE.txt | 44 +++++++++++++++++--------------------------- 1 file changed, 17 insertions(+), 27 deletions(-) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 32eaf16..08ca573 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -1129,10 +1129,11 @@ Supported Platforms MPICH mpich2-1.4.1p1 compiled with gcc 4.1.2 and gfortran 4.1.2 - Linux 2.6.32-220.7.1.el6.ppc64 gcc (GCC) 4.4.6 20120305 (Red Hat 4.4.6-4) - #1 SMP ppc64 GNU/Linux g++ (GCC) 4.4.6 20120305 (Red Hat 4.4.6-4) - (ostrich) GNU Fortran (GCC) 4.4.6 20120305 (Red Hat 4.4.6-4) - + Linux 2.6.32-358.2.1.el6.ppc64 gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-3) + #1 SMP ppc64 GNU/Linux g++ (GCC) 4.4.7 20120313 (Red Hat 4.4.7-3) + (ostrich) GNU Fortran (GCC) 4.4.7 20120313 (Red Hat 4.4.7-3) + IBM XL C/C++ V11.1 + IBM XL Fortran V13.1 Linux 2.6.32-220.23.1.1chaos Intel C, C++, Fortran Compilers ch5.x86_64 GNU/Linux Version 12.1.5.339 (LLNL Aztec) @@ -1141,12 +1142,9 @@ Supported Platforms (LLNL uDawn) XL C++ for Blue Gene/P, bgxlC V9.0 XL Fortran for Blue Gene/P, bgxlf90 V11.1 - SunOS 5.10 32- and 64-bit Sun C 5.9 Sun OS_sparc Patch 124867-16 - (linew) Sun Fortran 95 8.3 Sun OS_sparc Patch 127000-13 - Sun C++ 5.9 Sun OS_sparc Patch 124863-26 - Sun C 5.11 SunOS_sparc - Sun Fortran 95 8.5 SunOS_sparc - Sun C++ 5.11 SunOS_sparc + SunOS 5.11 32- and 64-bit Sun C 5.12 SunOS_sparc + (emu) Sun Fortran 95 8.6 SunOS_sparc + Sun C++ 5.12 SunOS_sparc Windows XP Visual Studio 2008 w/ Intel Fortran 10.1 (project files) @@ -1164,15 +1162,9 @@ Supported Platforms Mac OS X Snow Leopard 10.6.8 gcc i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 from Xcode 3.2.6 Darwin Kernel Version 10.8.0 g++ i686-apple-darwin11-llvm-g++-4.2 (GCC) 4.2.1 from Xcode 3.2.6 - (fred) gfortran GNU Fortran (GCC) 4.6.2 - Intel C (icc), Fortran (ifort), C++ (icpc) - 12.1.0.038 Build 20110811 - - Mac OS X Snow Leopard 10.6.8 gcc i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 from Xcode 3.2.6 - Darwin Kernel Version 10.8.0 g++ i686-apple-darwin11-llvm-g++-4.2 (GCC) 4.2.1 from Xcode 3.2.6 - Intel 32-bit gfortran GNU Fortran (GCC) 4.6.1 - (tejeda) Intel C (icc), Fortran (ifort), C++ (icpc) - 12.1.0.038 Build 20110811 + 64-bit gfortran GNU Fortran (GCC) 4.6.2 + (fred) Intel C (icc), Fortran (ifort), C++ (icpc) + 12.1 Build 20120928 Mac OS X Lion 10.7.3 gcc i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 from Xcode 4.2.1 32- and 64-bit g++ i686-apple-darwin11-llvm-g++-4.2 (GCC) 4.2.1 from Xcode 4.2.1 @@ -1200,11 +1192,10 @@ Tested Configuration Features Summary Platform C F90/ F90 C++ zlib SZIP parallel F2003 parallel -Solaris2.10 32-bit n y/y n y y y -Solaris2.10 64-bit n y/n n y y y +Solaris2.11 32-bit n y/y n y y y +Solaris2.11 64-bit n y/n n y y y Windows 7 y y/n n y y y Windows 7 x64 y y/n n y y y -Mac OS X Snow Leopard 10.6.8 32-bit n y/y n y y n Mac OS X Snow Leopard 10.6.8 64-bit n y/y n y y y Mac OS X Lion 10.7.3 32-bit n y/y n y y n Mac OS X Lion 10.7.3 64-bit n y/y n y y y @@ -1216,16 +1207,15 @@ CentOS 5.5 Linux 2.6.18-308 i686 PGI n y/y n y y y CentOS 5.5 Linux 2.6.18 x86_64 GNU y y/y y y y y CentOS 5.5 Linux 2.6.18 x86_64 Intel n y/y n y y y CentOS 5.5 Linux 2.6.18 x86_64 PGI n y/y n y y y -Linux 2.6.32-220.7.1.el6.ppc64 n y/n n y y y +Linux 2.6.32-358.2.1.el6.ppc64 n y/n n y y y Platform Shared Shared Shared Thread- C libs F90 libs C++ libs safe -Solaris2.10 32-bit y y y y -Solaris2.10 64-bit n n n n +Solaris2.11 32-bit y y y y +Solaris2.11 64-bit y y y y Windows 7 y y y y Windows 7 x64 y y y y -Mac OS X Snow Leopard 10.6.8 32-bit y n y n Mac OS X Snow Leopard 10.6.8 64-bit y n y n Mac OS X Lion 10.7.3 32-bit y n y y Mac OS X Lion 10.7.3 64-bit y n y y @@ -1237,7 +1227,7 @@ CentOS 5.5 Linux 2.6.18-308 i686 PGI y y y n CentOS 5.5 Linux 2.6.18 x86_64 GNU y y y y CentOS 5.5 Linux 2.6.18 x86_64 Intel y y y n CentOS 5.5 Linux 2.6.18 x86_64 PGI y y y n -Linux 2.6.32-220.7.1.el6.ppc64 y y y n +Linux 2.6.32-358.2.1.el6.ppc64 y y y n Compiler versions for each platform are listed in the preceding "Supported Platforms" table. -- cgit v0.12 From 608559deade171c385e2855fe42895e1fd25a4b0 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Sat, 13 Apr 2013 18:18:05 -0500 Subject: [svn-r23584] Description: Update with new compiler warnings for gcc 4.8.x Tested on: Mac OSX/64 10.8.3 (amazon) w/gcc 4.8.0 --- config/gnu-flags | 83 ++++++++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 77 insertions(+), 6 deletions(-) diff --git a/config/gnu-flags b/config/gnu-flags index 40aa1da..a79cc72 100644 --- a/config/gnu-flags +++ b/config/gnu-flags @@ -186,10 +186,10 @@ esac # the information from the previous version and adding modifications to that. case "$cc_vendor-$cc_version" in -# Closer to the gcc 4.8 release, we should check for additional flags to +# Closer to the gcc 4.9 release, we should check for additional flags to # include and break it out into it's own section, like the other versions # below. -QAK - gcc-4.[78]*) + gcc-4.[89]*) # Replace -ansi flag with -std=c99 flag H5_CFLAGS="`echo $H5_CFLAGS | sed -e 's/-ansi/-std=c99/g'`" @@ -252,7 +252,81 @@ case "$cc_vendor-$cc_version" in H5_CFLAGS="$H5_CFLAGS -Wdouble-promotion -Wsuggest-attribute=const -Wtrampolines" # Append more extra warning flags that only gcc 4.7+ know about - H5_CFLAGS="$H5_CFLAGS -Wstack-usage=8192 -Wvector-operation-performance" + H5_CFLAGS="$H5_CFLAGS -Wstack-usage=8192 -Wvector-operation-performance -Wsuggest-attribute=pure -Wsuggest-attribute=noreturn" + + # Append more extra warning flags that only gcc 4.8+ know about + H5_CFLAGS="$H5_CFLAGS -Wsuggest-attribute=format" + + # Try out the new "stack protector" feature in gcc 4.1 + # (Strictly speaking this isn't really a "warning" flag, so it's added to + # the debugging flags) + #DEBUG_CFLAGS="$DEBUG_CFLAGS -Wstack-protector -fstack-protector-all" + ;; + + gcc-4.7*) + # Replace -ansi flag with -std=c99 flag + H5_CFLAGS="`echo $H5_CFLAGS | sed -e 's/-ansi/-std=c99/g'`" + + # Append warning flags + # Don't use the '-Wtraditional' flag, we're way past having K&R C code + # H5_CFLAGS="$H5_CFLAGS -Wtraditional" + # Don't use the '-Wtraditional-conversion' flag, there's too many warnings + # from GCC's assert macro + # H5_CFLAGS="$H5_CFLAGS -Wtraditional-conversion" + + # Append warning flags from gcc-3* case + # (don't use -Wpadded flag for normal builds, many of the warnings its + # issuing can't be fixed and they are making it hard to detect other, + # more important warnings) + #H5_CFLAGS="$H5_CFLAGS -Wfloat-equal -Wmissing-format-attribute -Wpadded" + H5_CFLAGS="$H5_CFLAGS -Wfloat-equal -Wmissing-format-attribute" + + # Append warning flags from gcc-3.2* case + H5_CFLAGS="$H5_CFLAGS -Wmissing-noreturn -Wpacked -Wdisabled-optimization" + + # Enable more format checking flags, beyond the basic -Wformat included + # in -Wall + H5_CFLAGS="$H5_CFLAGS -Wformat=2" + + # The "unreachable code" warning appears to be reliable now... + # (this warning was removed in gcc 4.5+) + #H5_CFLAGS="$H5_CFLAGS -Wunreachable-code" + + # Append warning flags from gcc-3.3* case + H5_CFLAGS="$H5_CFLAGS -Wendif-labels" + + # Append warning flags from gcc-3.4* case + H5_CFLAGS="$H5_CFLAGS -Wdeclaration-after-statement -Wold-style-definition -Winvalid-pch" + + # Replace old -W flag with new -Wextra flag + H5_CFLAGS="`echo $H5_CFLAGS | sed -e 's/-W\ /-Wextra\ /g'`" + + # Append more extra warning flags that only gcc4.0+ know about + H5_CFLAGS="$H5_CFLAGS -Wvariadic-macros -Winit-self -Wmissing-include-dirs -Wswitch-default -Wswitch-enum -Wunused-macros" + + # Append more extra warning flags that only gcc 4.1+ know about + H5_CFLAGS="$H5_CFLAGS -Wunsafe-loop-optimizations -Wc++-compat" + + # Append more extra warning flags that only gcc 4.2+ know about + H5_CFLAGS="$H5_CFLAGS -Wstrict-overflow" + + # Append more extra warning flags that only gcc 4.3+ know about + # + # Technically, variable-length arrays are part of the C99 standard, but + # we should approach them a bit cautiously... -QAK + H5_CFLAGS="$H5_CFLAGS -Wlogical-op -Wlarger-than=2048 -Wvla" + + # Append more extra warning flags that only gcc 4.4+ know about + H5_CFLAGS="$H5_CFLAGS -Wsync-nand -Wframe-larger-than=16384 -Wpacked-bitfield-compat" + + # Append more extra warning flags that only gcc 4.5+ know about + H5_CFLAGS="$H5_CFLAGS -Wstrict-overflow=5 -Wjump-misses-init -Wunsuffixed-float-constants" + + # Append more extra warning flags that only gcc 4.6+ know about + H5_CFLAGS="$H5_CFLAGS -Wdouble-promotion -Wsuggest-attribute=const -Wtrampolines" + + # Append more extra warning flags that only gcc 4.7+ know about + H5_CFLAGS="$H5_CFLAGS -Wstack-usage=8192 -Wvector-operation-performance -Wsuggest-attribute=pure -Wsuggest-attribute=noreturn" # Try out the new "stack protector" feature in gcc 4.1 # (Strictly speaking this isn't really a "warning" flag, so it's added to @@ -260,9 +334,6 @@ case "$cc_vendor-$cc_version" in #DEBUG_CFLAGS="$DEBUG_CFLAGS -Wstack-protector -fstack-protector-all" ;; -# Closer to the gcc 4.7 release, we should check for additional flags to -# include and break it out into it's own section, like the other versions -# below. -QAK gcc-4.6*) # Replace -ansi flag with -std=c99 flag H5_CFLAGS="`echo $H5_CFLAGS | sed -e 's/-ansi/-std=c99/g'`" -- cgit v0.12 From c61fb7260a35fe9b9a61078d170c5a082689f47a Mon Sep 17 00:00:00 2001 From: Scot Breitenfeld Date: Sun, 14 Apr 2013 16:19:40 -0500 Subject: [svn-r23585] changed the integer kind in the enum to satisfy g95. Tested: jam (g95, gfortran) --- fortran/test/tH5T_F03.f90 | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/fortran/test/tH5T_F03.f90 b/fortran/test/tH5T_F03.f90 index f7efcc4..a9a6487 100644 --- a/fortran/test/tH5T_F03.f90 +++ b/fortran/test/tH5T_F03.f90 @@ -3137,10 +3137,15 @@ SUBROUTINE t_enum_conv(total_error) ! Enumerated data array ! Some values are out of range for testing. The library should accept them - INTEGER(KIND(E1_RED)), DIMENSION(1:20), TARGET :: data1 = (/E1_RED, E1_GREEN, E1_BLUE, E1_GREEN, E1_WHITE,& - E1_WHITE, E1_BLACK, E1_GREEN, E1_BLUE, E1_RED,& - E1_RED, E1_BLUE, E1_GREEN, E1_BLACK, E1_WHITE,& - E1_RED, E1_WHITE, INT(0,KIND(E1_RED)), INT(-1,KIND(E1_RED)), INT(-2,KIND(E1_RED))/) + INTEGER(KIND(E1_RED)), DIMENSION(1:20), TARGET :: data1 = (/INT(E1_RED,KIND(E1_RED)), & + INT(E1_GREEN,KIND(E1_RED)), INT(E1_BLUE,KIND(E1_RED)), & + INT(E1_GREEN,KIND(E1_RED)), INT(E1_WHITE,KIND(E1_RED)), & + INT(E1_WHITE,KIND(E1_RED)), INT(E1_BLACK,KIND(E1_RED)), & + INT(E1_GREEN,KIND(E1_RED)), INT(E1_BLUE,KIND(E1_RED)), & + INT(E1_RED,KIND(E1_RED)), INT(E1_RED,KIND(E1_RED)), INT(E1_BLUE,KIND(E1_RED)), & + INT(E1_GREEN,KIND(E1_RED)), INT(E1_BLACK,KIND(E1_RED)), INT(E1_WHITE,KIND(E1_RED)),& + INT(E1_RED,KIND(E1_RED)), INT(E1_WHITE,KIND(E1_RED)), & + INT(0,KIND(E1_RED)), INT(-1,KIND(E1_RED)), INT(-2,KIND(E1_RED))/) ! Reading array for enum data INTEGER(KIND(E1_RED)), DIMENSION(1:20), TARGET :: data2 -- cgit v0.12 From e112a68bf8ba6906c108f8c96b1f470300292bc0 Mon Sep 17 00:00:00 2001 From: Raymond Lu Date: Mon, 15 Apr 2013 11:12:13 -0500 Subject: [svn-r23590] I added SunOS 5.11 (emu) as a newly supported system. --- release_docs/RELEASE.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 08ca573..7d102fb 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -410,6 +410,8 @@ Support for new platforms, languages and compilers. - Intel V11.1 uses now -O3 optimization in production mode (EIP - 2010/10/08) - PathScale compilers are recognized and can build the HDF5 library properly. AKC - 2009/7/28 - + - SunOS 5.11 (emu) 32-bit and 64-bit with Sun C/C++ 5.12 compiler and + Sun Fortran 95 8.6 compiler. (SLU - 2013/04/15) Bug Fixes since HDF5-1.8.0 release ================================== -- cgit v0.12 From 5acd9c4053fe0dbfaf3e3d8be018fde30850a110 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Wed, 17 Apr 2013 07:49:56 -0500 Subject: [svn-r23597] Description: Bring r20683 from Coverity branch back to trunk: Isues 1309-1333: Changed strcpy/strcat to strncpy/strncat with maximum size expected. Tested on: Max OSX/64 10.8.3 (amazon) w/C++ & FORTRAN --- hl/test/test_ds.c | 694 +++++++++++++++++++++++------------------------------- 1 file changed, 290 insertions(+), 404 deletions(-) diff --git a/hl/test/test_ds.c b/hl/test/test_ds.c index b81f8d4..1bfa23f 100644 --- a/hl/test/test_ds.c +++ b/hl/test/test_ds.c @@ -219,9 +219,8 @@ static hid_t create_test_file(const char *fileext) { char filename[65]; - HDstrcpy(filename, FILENAME); - HDstrcat(filename, fileext); - HDstrcat(filename, FILEEXT); + HDsnprintf(filename, sizeof(filename), "%s%s%s", FILENAME, fileext, FILEEXT); + return H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); } @@ -229,9 +228,7 @@ static hid_t open_test_file(const char *fileext) { char filename[65]; - HDstrcpy(filename, FILENAME); - HDstrcat(filename, fileext); - HDstrcat(filename, FILEEXT); + HDsnprintf(filename, sizeof(filename), "%s%s%s", FILENAME, fileext, FILEEXT); return H5Fopen(filename, H5F_ACC_RDWR, H5P_DEFAULT); } @@ -258,10 +255,10 @@ herr_t create_char_dataset(hid_t fid, const char *dsidx, int fulldims) char s31_wbuf[DIM3_SIZE] = {1,1,1,2,2,2,3,3,3,4,4,4}; char s32_wbuf[DIM3_SIZE] = {5,5,5,10,10,10,50,50,50,100,100,100}; char s33_wbuf[DIM3_SIZE] = {6,6,6,12,12,12,53,53,53,120,120,120}; - char name[32]; + char name[64]; + + HDsnprintf(name, sizeof(name), "%s%s", DATASET_NAME, dsidx); - HDstrcpy(name, DATASET_NAME); - HDstrcat(name, dsidx); /* make a dataset */ if(H5LTmake_dataset_char(fid, name, rank, dims, buf) >= 0) { if(fulldims==0) { @@ -307,14 +304,13 @@ herr_t create_short_dataset(hid_t fid, const char *dsidx, int fulldims) short s2_wbuf[DIM2_SIZE] = {100,200,300,400}; short s21_wbuf[DIM2_SIZE] = {10,20,30,40}; short s22_wbuf[DIM2_SIZE] = {5,10,50,300}; - short s3_wbuf[DIM3_SIZE] = {10,10,10,20,20,20,30,30,30,40,40,40}; - short s31_wbuf[DIM3_SIZE] = {1,1,1,2,2,2,3,3,3,4,4,4}; - short s32_wbuf[DIM3_SIZE] = {5,5,5,10,10,10,50,50,50,100,100,100}; - short s33_wbuf[DIM3_SIZE] = {6,6,6,12,12,12,53,53,53,140,140,140}; - char name[32]; + short s3_wbuf[DIM3_SIZE] = {10,10,10,20,20,20,30,30,30,40,40,40}; + short s31_wbuf[DIM3_SIZE] = {1,1,1,2,2,2,3,3,3,4,4,4}; + short s32_wbuf[DIM3_SIZE] = {5,5,5,10,10,10,50,50,50,100,100,100}; + short s33_wbuf[DIM3_SIZE] = {6,6,6,12,12,12,53,53,53,140,140,140}; + char name[64]; - HDstrcpy(name, DATASET_NAME); - HDstrcat(name, dsidx); + HDsnprintf(name, sizeof(name), "%s%s", DATASET_NAME, dsidx); /* make a dataset */ if(H5LTmake_dataset_short(fid, name, rank, dims, buf) >= 0) { @@ -360,10 +356,9 @@ herr_t create_int_dataset(hid_t fid, const char *dsidx, int fulldims) int s2_wbuf[DIM2_SIZE] = {100,200,300,400}; int s21_wbuf[DIM2_SIZE] = {10,20,30,40}; int s22_wbuf[DIM2_SIZE] = {5,10,50,300}; - char name[32]; + char name[64]; - HDstrcpy(name, DATASET_NAME); - HDstrcat(name, dsidx); + HDsnprintf(name, sizeof(name), "%s%s", DATASET_NAME, dsidx); /* make a dataset */ if(H5LTmake_dataset_int(fid, name, rank, dims, buf) >= 0) { @@ -413,12 +408,9 @@ herr_t create_long_dataset(hid_t fid, const char *dsname, const char *dsidx, int long s42_wbuf[DIM4_SIZE] = {80,80}; long s43_wbuf[DIM4_SIZE] = {180,180}; long s44_wbuf[DIM4_SIZE] = {280,280}; - char name[32]; - - HDstrcpy(name, dsname); /* make a dataset */ - if(H5LTmake_dataset_long(fid, name, rank, dims, buf) >= 0) { + if(H5LTmake_dataset_long(fid, dsname, rank, dims, buf) >= 0) { if(fulldims==0) { /* make a DS dataset for the first dimension */ if(create_DS1_long_datasets(fid, dsidx, rankds, s1_dim, s1_wbuf, NULL) < 0) @@ -468,10 +460,9 @@ herr_t create_float_dataset(hid_t fid, const char *dsidx, int fulldims) float s2_wbuf[DIM2_SIZE] = {100,200,300,400}; float s21_wbuf[DIM2_SIZE] = {10,20,30,40}; float s22_wbuf[DIM2_SIZE] = {5,10,50,300}; - char name[32]; + char name[64]; - HDstrcpy(name, DATASET_NAME); - HDstrcat(name, dsidx); + HDsnprintf(name, sizeof(name), "%s%s", DATASET_NAME, dsidx); /* make a dataset */ if(H5LTmake_dataset_float(fid, name, rank, dims, buf) >= 0) { @@ -503,17 +494,17 @@ herr_t create_float_dataset(hid_t fid, const char *dsidx, int fulldims) */ herr_t create_DS1_char_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_dim, char *s_wbuf, char *s1_wbuf) { - char name[32]; + char name[64]; + + HDsnprintf(name, sizeof(name), "%s%s", DS_1_NAME, dsidx); - HDstrcpy(name, DS_1_NAME); - HDstrcat(name, dsidx); /* make a DS dataset for the first dimension */ if(H5LTmake_dataset_char(fid, name, rankds, s_dim, s_wbuf) < 0) return FAIL; - if(s1_wbuf!=NULL) { - HDstrcpy(name, DS_11_NAME); - HDstrcat(name, dsidx); + if(s1_wbuf != NULL) { + HDsnprintf(name, sizeof(name), "%s%s", DS_11_NAME, dsidx); + /* make a DS dataset with an alternate scale for the first dimension */ if(H5LTmake_dataset_char(fid, name, rankds, s_dim, s1_wbuf) < 0) return FAIL; @@ -528,25 +519,25 @@ herr_t create_DS1_char_datasets(hid_t fid, const char *dsidx, int rankds, hsize_ */ herr_t create_DS2_char_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_dim, char *s_wbuf, char *s1_wbuf, char *s2_wbuf) { - char name[32]; + char name[64]; + + HDsnprintf(name, sizeof(name), "%s%s", DS_2_NAME, dsidx); - HDstrcpy(name, DS_2_NAME); - HDstrcat(name, dsidx); /* make a DS dataset for the second dimension */ if(H5LTmake_dataset_char(fid, name, rankds, s_dim, s_wbuf) < 0) return FAIL; - if(s1_wbuf!=NULL) { - HDstrcpy(name, DS_21_NAME); - HDstrcat(name, dsidx); + if(s1_wbuf != NULL) { + HDsnprintf(name, sizeof(name), "%s%s", DS_21_NAME, dsidx); + /* make a DS dataset with an alternate scale for the second dimension */ if(H5LTmake_dataset_char(fid, name, rankds, s_dim, s1_wbuf) < 0) return FAIL; } - if(s2_wbuf!=NULL) { - HDstrcpy(name, DS_22_NAME); - HDstrcat(name, dsidx); + if(s2_wbuf != NULL) { + HDsnprintf(name, sizeof(name), "%s%s", DS_22_NAME, dsidx); + /* make a DS dataset with an alternate scale for the second dimension */ if(H5LTmake_dataset_char(fid, name, rankds, s_dim, s2_wbuf) < 0) return FAIL; @@ -561,33 +552,33 @@ herr_t create_DS2_char_datasets(hid_t fid, const char *dsidx, int rankds, hsize_ */ herr_t create_DS3_char_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_dim, char *s_wbuf, char *s1_wbuf, char *s2_wbuf, char *s3_wbuf) { - char name[32]; + char name[64]; + + HDsnprintf(name, sizeof(name), "%s%s", DS_3_NAME, dsidx); - HDstrcpy(name, DS_3_NAME); - HDstrcat(name, dsidx); /* make a DS dataset for the first dimension */ if(H5LTmake_dataset_char(fid, name, rankds, s_dim, s_wbuf) < 0) return FAIL; - if(s1_wbuf!=NULL) { - HDstrcpy(name, DS_31_NAME); - HDstrcat(name, dsidx); + if(s1_wbuf != NULL) { + HDsnprintf(name, sizeof(name), "%s%s", DS_31_NAME, dsidx); + /* make a DS dataset with an alternate scale for the second dimension */ if(H5LTmake_dataset_char(fid, name, rankds, s_dim, s1_wbuf) < 0) return FAIL; } - if(s2_wbuf!=NULL) { - HDstrcpy(name, DS_32_NAME); - HDstrcat(name, dsidx); + if(s2_wbuf != NULL) { + HDsnprintf(name, sizeof(name), "%s%s", DS_32_NAME, dsidx); + /* make a DS dataset with an alternate scale for the second dimension */ if(H5LTmake_dataset_char(fid, name, rankds, s_dim, s2_wbuf) < 0) return FAIL; } - if(s3_wbuf!=NULL) { - HDstrcpy(name, DS_33_NAME); - HDstrcat(name, dsidx); + if(s3_wbuf != NULL) { + HDsnprintf(name, sizeof(name), "%s%s", DS_33_NAME, dsidx); + /* make a DS dataset with an alternate scale for the second dimension */ if(H5LTmake_dataset_char(fid, name, rankds, s_dim, s3_wbuf) < 0) return FAIL; @@ -602,17 +593,17 @@ herr_t create_DS3_char_datasets(hid_t fid, const char *dsidx, int rankds, hsize_ */ herr_t create_DS1_short_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_dim, short *s_wbuf, short *s1_wbuf) { - char name[32]; + char name[64]; + + HDsnprintf(name, sizeof(name), "%s%s", DS_1_NAME, dsidx); - HDstrcpy(name, DS_1_NAME); - HDstrcat(name, dsidx); /* make a DS dataset for the first dimension */ if(H5LTmake_dataset_short(fid, name, rankds, s_dim, s_wbuf) < 0) return FAIL; - if(s1_wbuf!=NULL) { - HDstrcpy(name, DS_11_NAME); - HDstrcat(name, dsidx); + if(s1_wbuf != NULL) { + HDsnprintf(name, sizeof(name), "%s%s", DS_11_NAME, dsidx); + /* make a DS dataset with an alternate scale for the first dimension */ if(H5LTmake_dataset_short(fid, name, rankds, s_dim, s1_wbuf) < 0) return FAIL; @@ -627,26 +618,25 @@ herr_t create_DS1_short_datasets(hid_t fid, const char *dsidx, int rankds, hsize */ herr_t create_DS2_short_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_dim, short *s_wbuf, short *s1_wbuf, short *s2_wbuf) { - char name[32]; + char name[64]; - HDstrcpy(name, DS_2_NAME); - HDstrcat(name, dsidx); + HDsnprintf(name, sizeof(name), "%s%s", DS_2_NAME, dsidx); /* make a DS dataset for the second dimension */ if(H5LTmake_dataset_short(fid, name, rankds, s_dim, s_wbuf) < 0) return FAIL; - if(s1_wbuf!=NULL) { - HDstrcpy(name, DS_21_NAME); - HDstrcat(name, dsidx); + if(s1_wbuf != NULL) { + HDsnprintf(name, sizeof(name), "%s%s", DS_21_NAME, dsidx); + /* make a DS dataset with an alternate scale for the second dimension */ if(H5LTmake_dataset_short(fid, name, rankds, s_dim, s1_wbuf) < 0) return FAIL; } - if(s2_wbuf!=NULL) { - HDstrcpy(name, DS_22_NAME); - HDstrcat(name, dsidx); + if(s2_wbuf != NULL) { + HDsnprintf(name, sizeof(name), "%s%s", DS_22_NAME, dsidx); + /* make a DS dataset with an alternate scale for the second dimension */ if(H5LTmake_dataset_short(fid, name, rankds, s_dim, s2_wbuf) < 0) return FAIL; @@ -661,34 +651,33 @@ herr_t create_DS2_short_datasets(hid_t fid, const char *dsidx, int rankds, hsize */ herr_t create_DS3_short_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_dim, short *s_wbuf, short *s1_wbuf, short *s2_wbuf, short *s3_wbuf) { - char name[32]; + char name[64]; - HDstrcpy(name, DS_3_NAME); - HDstrcat(name, dsidx); + HDsnprintf(name, sizeof(name), "%s%s", DS_3_NAME, dsidx); /* make a DS dataset for the first dimension */ if(H5LTmake_dataset_short(fid, name, rankds, s_dim, s_wbuf) < 0) return FAIL; - if(s1_wbuf!=NULL) { - HDstrcpy(name, DS_31_NAME); - HDstrcat(name, dsidx); + if(s1_wbuf != NULL) { + HDsnprintf(name, sizeof(name), "%s%s", DS_31_NAME, dsidx); + /* make a DS dataset for the first dimension */ if(H5LTmake_dataset_short(fid, name, rankds, s_dim, s1_wbuf) < 0) return FAIL; } - if(s2_wbuf!=NULL) { - HDstrcpy(name, DS_32_NAME); - HDstrcat(name, dsidx); + if(s2_wbuf != NULL) { + HDsnprintf(name, sizeof(name), "%s%s", DS_32_NAME, dsidx); + /* make a DS dataset for the first dimension */ if(H5LTmake_dataset_short(fid, name, rankds, s_dim, s2_wbuf) < 0) return FAIL; } - if(s3_wbuf!=NULL) { - HDstrcpy(name, DS_33_NAME); - HDstrcat(name, dsidx); + if(s3_wbuf != NULL) { + HDsnprintf(name, sizeof(name), "%s%s", DS_33_NAME, dsidx); + /* make a DS dataset for the first dimension */ if(H5LTmake_dataset_short(fid, name, rankds, s_dim, s3_wbuf) < 0) return FAIL; @@ -703,18 +692,17 @@ herr_t create_DS3_short_datasets(hid_t fid, const char *dsidx, int rankds, hsize */ herr_t create_DS1_int_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_dim, int *s_wbuf, int *s1_wbuf) { - char name[32]; + char name[64]; - HDstrcpy(name, DS_1_NAME); - HDstrcat(name, dsidx); + HDsnprintf(name, sizeof(name), "%s%s", DS_1_NAME, dsidx); /* make a DS dataset for the first dimension */ if(H5LTmake_dataset_int(fid, name, rankds, s_dim, s_wbuf) < 0) return FAIL; - if(s1_wbuf!=NULL) { - HDstrcpy(name, DS_11_NAME); - HDstrcat(name, dsidx); + if(s1_wbuf != NULL) { + HDsnprintf(name, sizeof(name), "%s%s", DS_11_NAME, dsidx); + /* make a DS dataset with an alternate scale for the first dimension */ if(H5LTmake_dataset_int(fid, name, rankds, s_dim, s1_wbuf) < 0) return FAIL; @@ -729,26 +717,25 @@ herr_t create_DS1_int_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t */ herr_t create_DS2_int_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_dim, int *s_wbuf, int *s1_wbuf, int *s2_wbuf) { - char name[32]; + char name[64]; - HDstrcpy(name, DS_2_NAME); - HDstrcat(name, dsidx); + HDsnprintf(name, sizeof(name), "%s%s", DS_2_NAME, dsidx); /* make a DS dataset for the second dimension */ if(H5LTmake_dataset_int(fid, name, rankds, s_dim, s_wbuf) < 0) return FAIL; - if(s1_wbuf!=NULL) { - HDstrcpy(name, DS_21_NAME); - HDstrcat(name, dsidx); + if(s1_wbuf != NULL) { + HDsnprintf(name, sizeof(name), "%s%s", DS_21_NAME, dsidx); + /* make a DS dataset with an alternate scale for the second dimension */ if(H5LTmake_dataset_int(fid, name, rankds, s_dim, s1_wbuf) < 0) return FAIL; } - if(s2_wbuf!=NULL) { - HDstrcpy(name, DS_22_NAME); - HDstrcat(name, dsidx); + if(s2_wbuf != NULL) { + HDsnprintf(name, sizeof(name), "%s%s", DS_22_NAME, dsidx); + /* make a DS dataset with an alternate scale for the second dimension */ if(H5LTmake_dataset_int(fid, name, rankds, s_dim, s2_wbuf) < 0) return FAIL; @@ -763,34 +750,33 @@ herr_t create_DS2_int_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t */ herr_t create_DS3_int_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_dim, int *s_wbuf, int *s1_wbuf, int *s2_wbuf, int *s3_wbuf) { - char name[32]; + char name[64]; - HDstrcpy(name, DS_3_NAME); - HDstrcat(name, dsidx); + HDsnprintf(name, sizeof(name), "%s%s", DS_3_NAME, dsidx); /* make a DS dataset for the first dimension */ if(H5LTmake_dataset_int(fid, name, rankds, s_dim, s_wbuf) < 0) return FAIL; - if(s1_wbuf!=NULL) { - HDstrcpy(name, DS_31_NAME); - HDstrcat(name, dsidx); + if(s1_wbuf != NULL) { + HDsnprintf(name, sizeof(name), "%s%s", DS_31_NAME, dsidx); + /* make a DS dataset with an alternate scale for the first dimension */ if(H5LTmake_dataset_int(fid, name, rankds, s_dim, s1_wbuf) < 0) return FAIL; } - if(s2_wbuf!=NULL) { - HDstrcpy(name, DS_32_NAME); - HDstrcat(name, dsidx); + if(s2_wbuf != NULL) { + HDsnprintf(name, sizeof(name), "%s%s", DS_32_NAME, dsidx); + /* make a DS dataset with an alternate scale for the first dimension */ if(H5LTmake_dataset_int(fid, name, rankds, s_dim, s2_wbuf) < 0) return FAIL; } - if(s3_wbuf!=NULL) { - HDstrcpy(name, DS_33_NAME); - HDstrcat(name, dsidx); + if(s3_wbuf != NULL) { + HDsnprintf(name, sizeof(name), "%s%s", DS_33_NAME, dsidx); + /* make a DS dataset with an alternate scale for the first dimension */ if(H5LTmake_dataset_int(fid, name, rankds, s_dim, s3_wbuf) < 0) return FAIL; @@ -805,18 +791,17 @@ herr_t create_DS3_int_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t */ herr_t create_DS1_long_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_dim, long *s_wbuf, long *s1_wbuf) { - char name[32]; + char name[64]; - HDstrcpy(name, DS_1_NAME); - HDstrcat(name, dsidx); + HDsnprintf(name, sizeof(name), "%s%s", DS_1_NAME, dsidx); /* make a DS dataset for the first dimension */ if(H5LTmake_dataset_long(fid, name, rankds, s_dim, s_wbuf) < 0) return FAIL; - if(s1_wbuf!=NULL) { - HDstrcpy(name, DS_11_NAME); - HDstrcat(name, dsidx); + if(s1_wbuf != NULL) { + HDsnprintf(name, sizeof(name), "%s%s", DS_11_NAME, dsidx); + /* make a DS dataset with an alternate scale for the first dimension */ if(H5LTmake_dataset_long(fid, name, rankds, s_dim, s1_wbuf) < 0) return FAIL; @@ -831,26 +816,25 @@ herr_t create_DS1_long_datasets(hid_t fid, const char *dsidx, int rankds, hsize_ */ herr_t create_DS2_long_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_dim, long *s_wbuf, long *s1_wbuf, long *s2_wbuf) { - char name[32]; + char name[64]; - HDstrcpy(name, DS_2_NAME); - HDstrcat(name, dsidx); + HDsnprintf(name, sizeof(name), "%s%s", DS_2_NAME, dsidx); /* make a DS dataset for the second dimension */ if(H5LTmake_dataset_long(fid, name, rankds, s_dim, s_wbuf) < 0) return FAIL; - if(s1_wbuf!=NULL) { - HDstrcpy(name, DS_21_NAME); - HDstrcat(name, dsidx); + if(s1_wbuf != NULL) { + HDsnprintf(name, sizeof(name), "%s%s", DS_21_NAME, dsidx); + /* make a DS dataset with an alternate scale for the second dimension */ if(H5LTmake_dataset_long(fid, name, rankds, s_dim, s1_wbuf) < 0) return FAIL; } - if(s2_wbuf!=NULL) { - HDstrcpy(name, DS_22_NAME); - HDstrcat(name, dsidx); + if(s2_wbuf != NULL) { + HDsnprintf(name, sizeof(name), "%s%s", DS_22_NAME, dsidx); + /* make a DS dataset with an alternate scale for the second dimension */ if(H5LTmake_dataset_long(fid, name, rankds, s_dim, s2_wbuf) < 0) return FAIL; @@ -865,34 +849,33 @@ herr_t create_DS2_long_datasets(hid_t fid, const char *dsidx, int rankds, hsize_ */ herr_t create_DS3_long_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_dim, long *s_wbuf, long *s1_wbuf, long *s2_wbuf, long *s3_wbuf) { - char name[32]; + char name[64]; - HDstrcpy(name, DS_3_NAME); - HDstrcat(name, dsidx); + HDsnprintf(name, sizeof(name), "%s%s", DS_3_NAME, dsidx); /* make a DS dataset for the first dimension */ if(H5LTmake_dataset_long(fid, name, rankds, s_dim, s_wbuf) < 0) return FAIL; - if(s1_wbuf!=NULL) { - HDstrcpy(name, DS_31_NAME); - HDstrcat(name, dsidx); + if(s1_wbuf != NULL) { + HDsnprintf(name, sizeof(name), "%s%s", DS_31_NAME, dsidx); + /* make a DS dataset with an alternate scale for the second dimension */ if(H5LTmake_dataset_long(fid, name, rankds, s_dim, s1_wbuf) < 0) return FAIL; } - if(s2_wbuf!=NULL) { - HDstrcpy(name, DS_32_NAME); - HDstrcat(name, dsidx); + if(s2_wbuf != NULL) { + HDsnprintf(name, sizeof(name), "%s%s", DS_32_NAME, dsidx); + /* make a DS dataset with an alternate scale for the second dimension */ if(H5LTmake_dataset_long(fid, name, rankds, s_dim, s2_wbuf) < 0) return FAIL; } - if(s3_wbuf!=NULL) { - HDstrcpy(name, DS_33_NAME); - HDstrcat(name, dsidx); + if(s3_wbuf != NULL) { + HDsnprintf(name, sizeof(name), "%s%s", DS_33_NAME, dsidx); + /* make a DS dataset with an alternate scale for the second dimension */ if(H5LTmake_dataset_long(fid, name, rankds, s_dim, s3_wbuf) < 0) return FAIL; @@ -907,42 +890,41 @@ herr_t create_DS3_long_datasets(hid_t fid, const char *dsidx, int rankds, hsize_ */ herr_t create_DS4_long_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_dim, long *s_wbuf, long *s1_wbuf, long *s2_wbuf, long *s3_wbuf, long *s4_wbuf) { - char name[32]; + char name[64]; - HDstrcpy(name, DS_4_NAME); - HDstrcat(name, dsidx); + HDsnprintf(name, sizeof(name), "%s%s", DS_4_NAME, dsidx); /* make a DS dataset for the first dimension */ if(H5LTmake_dataset_long(fid, name, rankds, s_dim, s_wbuf) < 0) return FAIL; - if(s1_wbuf!=NULL) { - HDstrcpy(name, DS_41_NAME); - HDstrcat(name, dsidx); + if(s1_wbuf != NULL) { + HDsnprintf(name, sizeof(name), "%s%s", DS_41_NAME, dsidx); + /* make a DS dataset with an alternate scale for the second dimension */ if(H5LTmake_dataset_long(fid, name, rankds, s_dim, s1_wbuf) < 0) return FAIL; } - if(s2_wbuf!=NULL) { - HDstrcpy(name, DS_42_NAME); - HDstrcat(name, dsidx); + if(s2_wbuf != NULL) { + HDsnprintf(name, sizeof(name), "%s%s", DS_42_NAME, dsidx); + /* make a DS dataset with an alternate scale for the second dimension */ if(H5LTmake_dataset_long(fid, name, rankds, s_dim, s2_wbuf) < 0) return FAIL; } - if(s3_wbuf!=NULL) { - HDstrcpy(name, DS_43_NAME); - HDstrcat(name, dsidx); + if(s3_wbuf != NULL) { + HDsnprintf(name, sizeof(name), "%s%s", DS_43_NAME, dsidx); + /* make a DS dataset with an alternate scale for the second dimension */ if(H5LTmake_dataset_long(fid, name, rankds, s_dim, s3_wbuf) < 0) return FAIL; } - if(s4_wbuf!=NULL) { - HDstrcpy(name, DS_44_NAME); - HDstrcat(name, dsidx); + if(s4_wbuf != NULL) { + HDsnprintf(name, sizeof(name), "%s%s", DS_44_NAME, dsidx); + /* make a DS dataset with an alternate scale for the second dimension */ if(H5LTmake_dataset_long(fid, name, rankds, s_dim, s4_wbuf) < 0) return FAIL; @@ -957,18 +939,17 @@ herr_t create_DS4_long_datasets(hid_t fid, const char *dsidx, int rankds, hsize_ */ herr_t create_DS1_float_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_dim, float *s_wbuf, float *s1_wbuf) { - char name[32]; + char name[64]; - HDstrcpy(name, DS_1_NAME); - HDstrcat(name, dsidx); + HDsnprintf(name, sizeof(name), "%s%s", DS_1_NAME, dsidx); /* make a DS dataset for the first dimension */ if(H5LTmake_dataset_float(fid, name, rankds, s_dim, s_wbuf) < 0) return FAIL; - if(s1_wbuf!=NULL) { - HDstrcpy(name, DS_11_NAME); - HDstrcat(name, dsidx); + if(s1_wbuf != NULL) { + HDsnprintf(name, sizeof(name), "%s%s", DS_11_NAME, dsidx); + /* make a DS dataset with an alternate scale for the first dimension */ if(H5LTmake_dataset_float(fid, name, rankds, s_dim, s1_wbuf) < 0) return FAIL; @@ -983,26 +964,25 @@ herr_t create_DS1_float_datasets(hid_t fid, const char *dsidx, int rankds, hsize */ herr_t create_DS2_float_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_dim, float *s_wbuf, float *s1_wbuf, float *s2_wbuf) { - char name[32]; + char name[64]; - HDstrcpy(name, DS_2_NAME); - HDstrcat(name, dsidx); + HDsnprintf(name, sizeof(name), "%s%s", DS_2_NAME, dsidx); /* make a DS dataset for the second dimension */ if(H5LTmake_dataset_float(fid, name, rankds, s_dim, s_wbuf) < 0) return FAIL; - if(s1_wbuf!=NULL) { - HDstrcpy(name, DS_21_NAME); - HDstrcat(name, dsidx); + if(s1_wbuf != NULL) { + HDsnprintf(name, sizeof(name), "%s%s", DS_21_NAME, dsidx); + /* make a DS dataset with an alternate scale for the second dimension */ if(H5LTmake_dataset_float(fid, name, rankds, s_dim, s1_wbuf) < 0) return FAIL; } - if(s2_wbuf!=NULL) { - HDstrcpy(name, DS_22_NAME); - HDstrcat(name, dsidx); + if(s2_wbuf != NULL) { + HDsnprintf(name, sizeof(name), "%s%s", DS_22_NAME, dsidx); + /* make a DS dataset with an alternate scale for the second dimension */ if(H5LTmake_dataset_float(fid, name, rankds, s_dim, s2_wbuf) < 0) return FAIL; @@ -1017,34 +997,33 @@ herr_t create_DS2_float_datasets(hid_t fid, const char *dsidx, int rankds, hsize */ herr_t create_DS3_float_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_dim, float *s_wbuf, float *s1_wbuf, float *s2_wbuf, float *s3_wbuf) { - char name[32]; + char name[64]; - HDstrcpy(name, DS_3_NAME); - HDstrcat(name, dsidx); + HDsnprintf(name, sizeof(name), "%s%s", DS_3_NAME, dsidx); /* make a DS dataset for the first dimension */ if(H5LTmake_dataset_float(fid, name, rankds, s_dim, s_wbuf) < 0) return FAIL; - if(s1_wbuf!=NULL) { - HDstrcpy(name, DS_31_NAME); - HDstrcat(name, dsidx); + if(s1_wbuf != NULL) { + HDsnprintf(name, sizeof(name), "%s%s", DS_31_NAME, dsidx); + /* make a DS dataset with an alternate scale for the second dimension */ if(H5LTmake_dataset_float(fid, name, rankds, s_dim, s1_wbuf) < 0) return FAIL; } - if(s2_wbuf!=NULL) { - HDstrcpy(name, DS_32_NAME); - HDstrcat(name, dsidx); + if(s2_wbuf != NULL) { + HDsnprintf(name, sizeof(name), "%s%s", DS_32_NAME, dsidx); + /* make a DS dataset with an alternate scale for the second dimension */ if(H5LTmake_dataset_float(fid, name, rankds, s_dim, s2_wbuf) < 0) return FAIL; } - if(s3_wbuf!=NULL) { - HDstrcpy(name, DS_33_NAME); - HDstrcat(name, dsidx); + if(s3_wbuf != NULL) { + HDsnprintf(name, sizeof(name), "%s%s", DS_33_NAME, dsidx); + /* make a DS dataset with an alternate scale for the second dimension */ if(H5LTmake_dataset_float(fid, name, rankds, s_dim, s3_wbuf) < 0) return FAIL; @@ -1062,7 +1041,6 @@ herr_t test_attach_scale(hid_t fid, hid_t did, const char *name, unsigned int id if(H5DSis_attached(did, dsid, idx) == 0) { if(H5DSattach_scale(did, dsid, idx) >= 0) { if(H5DSis_attached(did, dsid, idx) > 0) { - /* printf(" scale attached "); */ ret_value = SUCCEED; } else if(H5DSis_attached(did, dsid, idx) == 0) { @@ -1127,10 +1105,10 @@ herr_t test_cmp_scalename(hid_t fid, hid_t did, const char *name, const char *sc if((dsid = H5Dopen2(fid, name, H5P_DEFAULT)) >= 0) { if(H5DSis_attached(did, dsid, idx) == 1) { if((name_len=H5DSget_scale_name(dsid,NULL,(size_t)0)) > 0) { - name_out = (char*)HDmalloc((name_len+1) * sizeof (char)); + name_out = (char*)HDmalloc(((size_t)name_len+1) * sizeof (char)); if(name_out != NULL) { if(H5DSget_scale_name(dsid, name_out, (size_t)name_len+1) >= 0) { - if(HDstrcmp(scalename,name_out)==0) { + if(HDstrncmp(scalename, name_out, (size_t)name_len)==0) { ret_value = SUCCEED; } HDfree(name_out); @@ -1294,8 +1272,8 @@ static int test_char_attachscales(const char *fileext) hid_t did = -1; char dsname[32]; char scalename[32]; - HDstrcpy(dsname, DATASET_NAME); - HDstrcat(dsname, "ac"); + + HDsnprintf(dsname, sizeof(dsname), "%s%s", DATASET_NAME, "ac"); TESTING2("test_char_attachscales"); @@ -1307,18 +1285,15 @@ static int test_char_attachscales(const char *fileext) goto out; if((did = H5Dopen2(fid, dsname, H5P_DEFAULT)) >= 0) { - HDstrcpy(scalename, DS_1_NAME); - HDstrcat(scalename, "ac"); + HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_1_NAME, "ac"); if(test_attach_scale(fid, did, scalename, DIM0) < 0) goto out; - HDstrcpy(scalename, DS_2_NAME); - HDstrcat(scalename, "ac"); + HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_2_NAME, "ac"); if(test_attach_scale(fid, did, scalename, DIM1) < 0) goto out; - HDstrcpy(scalename, DS_3_NAME); - HDstrcat(scalename, "ac"); + HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_3_NAME, "ac"); if(test_attach_scale(fid, did, scalename, DIM2) < 0) goto out; @@ -1350,8 +1325,8 @@ static int test_short_attachscales(const char *fileext) hid_t did = -1; char dsname[32]; char scalename[32]; - HDstrcpy(dsname, DATASET_NAME); - HDstrcat(dsname, "as"); + + HDsnprintf(dsname, sizeof(dsname), "%s%s", DATASET_NAME, "as"); TESTING2("test_short_attachscales"); @@ -1363,48 +1338,39 @@ static int test_short_attachscales(const char *fileext) goto out; if((did = H5Dopen2(fid, dsname, H5P_DEFAULT)) >= 0) { - HDstrcpy(scalename, DS_1_NAME); - HDstrcat(scalename, "as"); + HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_1_NAME, "as"); if(test_attach_scale(fid, did, scalename, DIM0) < 0) goto out; - HDstrcpy(scalename, DS_11_NAME); - HDstrcat(scalename, "as"); + HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_11_NAME, "as"); if(test_attach_scale(fid, did, scalename, DIM0) < 0) goto out; - HDstrcpy(scalename, DS_2_NAME); - HDstrcat(scalename, "as"); + HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_2_NAME, "as"); if(test_attach_scale(fid, did, scalename, DIM1) < 0) goto out; - HDstrcpy(scalename, DS_21_NAME); - HDstrcat(scalename, "as"); + HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_21_NAME, "as"); if(test_attach_scale(fid, did, scalename, DIM1) < 0) goto out; - HDstrcpy(scalename, DS_22_NAME); - HDstrcat(scalename, "as"); + HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_22_NAME, "as"); if(test_attach_scale(fid, did, scalename, DIM1) < 0) goto out; - HDstrcpy(scalename, DS_3_NAME); - HDstrcat(scalename, "as"); + HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_3_NAME, "as"); if(test_attach_scale(fid, did, scalename, DIM2) < 0) goto out; - HDstrcpy(scalename, DS_31_NAME); - HDstrcat(scalename, "as"); + HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_31_NAME, "as"); if(test_attach_scale(fid, did, scalename, DIM2) < 0) goto out; - HDstrcpy(scalename, DS_32_NAME); - HDstrcat(scalename, "as"); + HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_32_NAME, "as"); if(test_attach_scale(fid, did, scalename, DIM2) < 0) goto out; - HDstrcpy(scalename, DS_33_NAME); - HDstrcat(scalename, "as"); + HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_33_NAME, "as"); if(test_attach_scale(fid, did, scalename, DIM2) < 0) goto out; @@ -1436,8 +1402,8 @@ static int test_int_attachscales(const char *fileext) hid_t did = -1; char dsname[32]; char scalename[32]; - HDstrcpy(dsname, DATASET_NAME); - HDstrcat(dsname, "a"); + + HDsnprintf(dsname, sizeof(dsname), "%s%s", DATASET_NAME, "a"); TESTING2("test_int_attachscales"); @@ -1449,28 +1415,23 @@ static int test_int_attachscales(const char *fileext) goto out; if((did = H5Dopen2(fid, dsname, H5P_DEFAULT)) >= 0) { - HDstrcpy(scalename, DS_1_NAME); - HDstrcat(scalename, "a"); + HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_1_NAME, "a"); if(test_attach_scale(fid, did, scalename, DIM0) < 0) goto out; - HDstrcpy(scalename, DS_11_NAME); - HDstrcat(scalename, "a"); + HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_11_NAME, "a"); if(test_attach_scale(fid, did, scalename, DIM0) < 0) goto out; - HDstrcpy(scalename, DS_2_NAME); - HDstrcat(scalename, "a"); + HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_2_NAME, "a"); if(test_attach_scale(fid, did, scalename, DIM1) < 0) goto out; - HDstrcpy(scalename, DS_21_NAME); - HDstrcat(scalename, "a"); + HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_21_NAME, "a"); if(test_attach_scale(fid, did, scalename, DIM1) < 0) goto out; - HDstrcpy(scalename, DS_22_NAME); - HDstrcat(scalename, "a"); + HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_22_NAME, "a"); if(test_attach_scale(fid, did, scalename, DIM1) < 0) goto out; @@ -1502,8 +1463,8 @@ static int test_long_attachscales(const char *fileext) hid_t did = -1; char dsname[32]; char scalename[32]; - HDstrcpy(dsname, DATASET_NAME); - HDstrcat(dsname, "al"); + + HDsnprintf(dsname, sizeof(dsname), "%s%s", DATASET_NAME, "al"); TESTING2("test_long_attachscales"); @@ -1515,23 +1476,19 @@ static int test_long_attachscales(const char *fileext) goto out; if((did = H5Dopen2(fid, dsname, H5P_DEFAULT)) >= 0) { - HDstrcpy(scalename, DS_1_NAME); - HDstrcat(scalename, "al"); + HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_1_NAME, "al"); if(test_attach_scale(fid, did, scalename, DIM0) < 0) goto out; - HDstrcpy(scalename, DS_2_NAME); - HDstrcat(scalename, "al"); + HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_2_NAME, "al"); if(test_attach_scale(fid, did, scalename, DIM1) < 0) goto out; - HDstrcpy(scalename, DS_3_NAME); - HDstrcat(scalename, "al"); + HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_3_NAME, "al"); if(test_attach_scale(fid, did, scalename, DIM2) < 0) goto out; - HDstrcpy(scalename, DS_4_NAME); - HDstrcat(scalename, "al"); + HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_4_NAME, "al"); if(test_attach_scale(fid, did, scalename, DIM3) < 0) goto out; @@ -1563,8 +1520,8 @@ static int test_duplicatelong_attachscales(const char *fileext) hid_t did = -1; char dsname[32]; char scalename[32]; - HDstrcpy(dsname, DATASET_NAME); - HDstrcat(dsname, "al2"); + + HDsnprintf(dsname, sizeof(dsname), "%s%s", DATASET_NAME, "al2"); TESTING2("test_duplicatelong_attachscales"); @@ -1576,23 +1533,19 @@ static int test_duplicatelong_attachscales(const char *fileext) goto out; if((did = H5Dopen2(fid, dsname, H5P_DEFAULT)) >= 0) { - HDstrcpy(scalename, DS_1_NAME); - HDstrcat(scalename, "al"); + HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_1_NAME, "al"); if(test_attach_scale(fid, did, scalename, DIM0) < 0) goto out; - HDstrcpy(scalename, DS_2_NAME); - HDstrcat(scalename, "al"); + HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_2_NAME, "al"); if(test_attach_scale(fid, did, scalename, DIM1) < 0) goto out; - HDstrcpy(scalename, DS_3_NAME); - HDstrcat(scalename, "al"); + HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_3_NAME, "al"); if(test_attach_scale(fid, did, scalename, DIM2) < 0) goto out; - HDstrcpy(scalename, DS_4_NAME); - HDstrcat(scalename, "al"); + HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_4_NAME, "al"); if(test_attach_scale(fid, did, scalename, DIM3) < 0) goto out; @@ -1624,8 +1577,8 @@ static int test_float_attachscales(const char *fileext) hid_t did = -1; char dsname[32]; char scalename[32]; - HDstrcpy(dsname, DATASET_NAME); - HDstrcat(dsname, "af"); + + HDsnprintf(dsname, sizeof(dsname), "%s%s", DATASET_NAME, "af"); TESTING2("test_float_attachscales"); @@ -1637,28 +1590,23 @@ static int test_float_attachscales(const char *fileext) goto out; if((did = H5Dopen2(fid, dsname, H5P_DEFAULT)) >= 0) { - HDstrcpy(scalename, DS_1_NAME); - HDstrcat(scalename, "af"); + HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_1_NAME, "af"); if(test_attach_scale(fid, did, scalename, DIM0) < 0) goto out; - HDstrcpy(scalename, DS_11_NAME); - HDstrcat(scalename, "af"); + HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_11_NAME, "af"); if(test_attach_scale(fid, did, scalename, DIM0) < 0) goto out; - HDstrcpy(scalename, DS_2_NAME); - HDstrcat(scalename, "af"); + HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_2_NAME, "af"); if(test_attach_scale(fid, did, scalename, DIM1) < 0) goto out; - HDstrcpy(scalename, DS_21_NAME); - HDstrcat(scalename, "af"); + HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_21_NAME, "af"); if(test_attach_scale(fid, did, scalename, DIM1) < 0) goto out; - HDstrcpy(scalename, DS_22_NAME); - HDstrcat(scalename, "af"); + HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_22_NAME, "af"); if(test_attach_scale(fid, did, scalename, DIM1) < 0) goto out; @@ -1691,8 +1639,8 @@ static int test_numberofscales(const char *fileext) int nscales; /* number of scales in DIM */ char dsname[32]; char scalename[32]; - HDstrcpy(dsname, DATASET_NAME); - HDstrcat(dsname, "a"); + + HDsnprintf(dsname, sizeof(dsname), "%s%s", DATASET_NAME, "a"); TESTING2("test_numberofscales"); @@ -1718,8 +1666,7 @@ static int test_numberofscales(const char *fileext) else goto out; - HDstrcpy(dsname, DATASET_NAME); - HDstrcat(dsname, "b"); + HDsnprintf(dsname, sizeof(dsname), "%s%s", DATASET_NAME, "b"); /* make a dataset */ if(create_int_dataset(fid, "b", 1) < 0) @@ -1727,8 +1674,7 @@ static int test_numberofscales(const char *fileext) /* make a DS dataset for the first dimension */ if((did = H5Dopen2(fid, dsname, H5P_DEFAULT)) >= 0) { - HDstrcpy(scalename, DS_1_NAME); - HDstrcat(scalename, "b"); + HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_1_NAME, "b"); if(test_attach_scale(fid, did, scalename, DIM0) < 0) goto out; @@ -1772,38 +1718,32 @@ static int test_char_scalenames(const char *fileext) { char dsname[32]; char scalename[32]; char name[32]; - HDstrcpy(dsname, DATASET_NAME); - HDstrcat(dsname, "ac"); + + HDsnprintf(dsname, sizeof(dsname), "%s%s", DATASET_NAME, "ac"); if((fid = open_test_file(fileext)) < 0) goto out; TESTING2("set char scale/cmp scale name"); if((did = H5Dopen2(fid, dsname, H5P_DEFAULT)) >= 0) { - HDstrcpy(scalename, DS_1_NAME); - HDstrcat(scalename, "ac"); - HDstrcpy(name, SCALE_1_NAME); - HDstrcat(name, "ac"); + HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_1_NAME, "ac"); + HDsnprintf(name, sizeof(name), "%s%s", SCALE_1_NAME, "ac"); if(test_set_scalename(fid, did, scalename, name, DIM0) < 0) goto out; if(test_cmp_scalename(fid, did, scalename, name, DIM0) < 0) goto out; - HDstrcpy(scalename, DS_2_NAME); - HDstrcat(scalename, "ac"); - HDstrcpy(name, SCALE_2_NAME); - HDstrcat(name, "ac"); + HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_2_NAME, "ac"); + HDsnprintf(name, sizeof(name), "%s%s", SCALE_2_NAME, "ac"); if(test_set_scalename(fid, did, scalename, name, DIM1) < 0) goto out; if(test_cmp_scalename(fid, did, scalename, name, DIM1) < 0) goto out; - HDstrcpy(scalename, DS_3_NAME); - HDstrcat(scalename, "ac"); - HDstrcpy(name, SCALE_3_NAME); - HDstrcat(name, "ac"); + HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_3_NAME, "ac"); + HDsnprintf(name, sizeof(name), "%s%s", SCALE_3_NAME, "ac"); if(test_set_scalename(fid, did, scalename, name, DIM2) < 0) goto out; @@ -1838,98 +1778,80 @@ static int test_short_scalenames(const char *fileext) { char dsname[32]; char scalename[32]; char name[32]; - HDstrcpy(dsname, DATASET_NAME); - HDstrcat(dsname, "as"); + + HDsnprintf(dsname, sizeof(dsname), "%s%s", DATASET_NAME, "as"); if((fid = open_test_file(fileext)) < 0) goto out; TESTING2("set short scale/cmp scale name"); if((did = H5Dopen2(fid, dsname, H5P_DEFAULT)) >= 0) { - HDstrcpy(scalename, DS_1_NAME); - HDstrcat(scalename, "as"); - HDstrcpy(name, SCALE_1_NAME); - HDstrcat(name, "as"); + HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_1_NAME, "as"); + HDsnprintf(name, sizeof(name), "%s%s", SCALE_1_NAME, "as"); if(test_set_scalename(fid, did, scalename, name, DIM0) < 0) goto out; if(test_cmp_scalename(fid, did, scalename, name, DIM0) < 0) goto out; - HDstrcpy(scalename, DS_11_NAME); - HDstrcat(scalename, "as"); - HDstrcpy(name, SCALE_11_NAME); - HDstrcat(name, "as"); + HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_11_NAME, "as"); + HDsnprintf(name, sizeof(name), "%s%s", SCALE_11_NAME, "as"); if(test_set_scalename(fid, did, scalename, name, DIM0) < 0) goto out; if(test_cmp_scalename(fid, did, scalename, name, DIM0) < 0) goto out; - HDstrcpy(scalename, DS_2_NAME); - HDstrcat(scalename, "as"); - HDstrcpy(name, SCALE_2_NAME); - HDstrcat(name, "as"); + HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_2_NAME, "as"); + HDsnprintf(name, sizeof(name), "%s%s", SCALE_2_NAME, "as"); if(test_set_scalename(fid, did, scalename, name, DIM1) < 0) goto out; if(test_cmp_scalename(fid, did, scalename, name, DIM1) < 0) goto out; - HDstrcpy(scalename, DS_21_NAME); - HDstrcat(scalename, "as"); - HDstrcpy(name, SCALE_21_NAME); - HDstrcat(name, "as"); + HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_21_NAME, "as"); + HDsnprintf(name, sizeof(name), "%s%s", SCALE_21_NAME, "as"); if(test_set_scalename(fid, did, scalename, name, DIM1) < 0) goto out; if(test_cmp_scalename(fid, did, scalename, name, DIM1) < 0) goto out; - HDstrcpy(scalename, DS_22_NAME); - HDstrcat(scalename, "as"); - HDstrcpy(name, SCALE_22_NAME); - HDstrcat(name, "as"); + HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_22_NAME, "as"); + HDsnprintf(name, sizeof(name), "%s%s", SCALE_22_NAME, "as"); if(test_set_scalename(fid, did, scalename, name, DIM1) < 0) goto out; if(test_cmp_scalename(fid, did, scalename, name, DIM1) < 0) goto out; - HDstrcpy(scalename, DS_3_NAME); - HDstrcat(scalename, "as"); - HDstrcpy(name, SCALE_3_NAME); - HDstrcat(name, "as"); + HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_3_NAME, "as"); + HDsnprintf(name, sizeof(name), "%s%s", SCALE_3_NAME, "as"); if(test_set_scalename(fid, did, scalename, name, DIM2) < 0) goto out; if(test_cmp_scalename(fid, did, scalename, name, DIM2) < 0) goto out; - HDstrcpy(scalename, DS_31_NAME); - HDstrcat(scalename, "as"); - HDstrcpy(name, SCALE_31_NAME); - HDstrcat(name, "as"); + HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_31_NAME, "as"); + HDsnprintf(name, sizeof(name), "%s%s", SCALE_31_NAME, "as"); if(test_set_scalename(fid, did, scalename, name, DIM2) < 0) goto out; if(test_cmp_scalename(fid, did, scalename, name, DIM2) < 0) goto out; - HDstrcpy(scalename, DS_32_NAME); - HDstrcat(scalename, "as"); - HDstrcpy(name, SCALE_32_NAME); - HDstrcat(name, "as"); + HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_32_NAME, "as"); + HDsnprintf(name, sizeof(name), "%s%s", SCALE_32_NAME, "as"); if(test_set_scalename(fid, did, scalename, name, DIM2) < 0) goto out; if(test_cmp_scalename(fid, did, scalename, name, DIM2) < 0) goto out; - HDstrcpy(scalename, DS_33_NAME); - HDstrcat(scalename, "as"); - HDstrcpy(name, SCALE_33_NAME); - HDstrcat(name, "as"); + HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_33_NAME, "as"); + HDsnprintf(name, sizeof(name), "%s%s", SCALE_33_NAME, "as"); if(test_set_scalename(fid, did, scalename, name, DIM2) < 0) goto out; @@ -1964,58 +1886,48 @@ static int test_int_scalenames(const char *fileext) { char dsname[32]; char scalename[32]; char name[32]; - HDstrcpy(dsname, DATASET_NAME); - HDstrcat(dsname, "a"); + + HDsnprintf(dsname, sizeof(dsname), "%s%s", DATASET_NAME, "a"); if((fid = open_test_file(fileext)) < 0) goto out; TESTING2("set int scale/cmp scale name"); if((did = H5Dopen2(fid, dsname, H5P_DEFAULT)) >= 0) { - HDstrcpy(scalename, DS_1_NAME); - HDstrcat(scalename, "a"); - HDstrcpy(name, SCALE_1_NAME); - HDstrcat(name, "a"); + HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_1_NAME, "a"); + HDsnprintf(name, sizeof(name), "%s%s", SCALE_1_NAME, "a"); if(test_set_scalename(fid, did, scalename, name, DIM0) < 0) goto out; if(test_cmp_scalename(fid, did, scalename, name, DIM0) < 0) goto out; - HDstrcpy(scalename, DS_11_NAME); - HDstrcat(scalename, "a"); - HDstrcpy(name, SCALE_11_NAME); - HDstrcat(name, "a"); + HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_11_NAME, "a"); + HDsnprintf(name, sizeof(name), "%s%s", SCALE_11_NAME, "a"); if(test_set_scalename(fid, did, scalename, name, DIM0) < 0) goto out; if(test_cmp_scalename(fid, did, scalename, name, DIM0) < 0) goto out; - HDstrcpy(scalename, DS_2_NAME); - HDstrcat(scalename, "a"); - HDstrcpy(name, SCALE_2_NAME); - HDstrcat(name, "a"); + HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_2_NAME, "a"); + HDsnprintf(name, sizeof(name), "%s%s", SCALE_2_NAME, "a"); if(test_set_scalename(fid, did, scalename, name, DIM1) < 0) goto out; if(test_cmp_scalename(fid, did, scalename, name, DIM1) < 0) goto out; - HDstrcpy(scalename, DS_21_NAME); - HDstrcat(scalename, "a"); - HDstrcpy(name, SCALE_21_NAME); - HDstrcat(name, "a"); + HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_21_NAME, "a"); + HDsnprintf(name, sizeof(name), "%s%s", SCALE_21_NAME, "a"); if(test_set_scalename(fid, did, scalename, name, DIM1) < 0) goto out; if(test_cmp_scalename(fid, did, scalename, name, DIM1) < 0) goto out; - HDstrcpy(scalename, DS_22_NAME); - HDstrcat(scalename, "a"); - HDstrcpy(name, SCALE_22_NAME); - HDstrcat(name, "a"); + HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_22_NAME, "a"); + HDsnprintf(name, sizeof(name), "%s%s", SCALE_22_NAME, "a"); if(test_set_scalename(fid, did, scalename, name, DIM1) < 0) goto out; @@ -2050,48 +1962,40 @@ static int test_long_scalenames(const char *fileext) { char dsname[32]; char scalename[32]; char name[32]; - HDstrcpy(dsname, DATASET_NAME); - HDstrcat(dsname, "al"); + + HDsnprintf(dsname, sizeof(dsname), "%s%s", DATASET_NAME, "al"); if((fid = open_test_file(fileext)) < 0) goto out; TESTING2("set long scale/cmp scale name"); if((did = H5Dopen2(fid, dsname, H5P_DEFAULT)) >= 0) { - HDstrcpy(scalename, DS_1_NAME); - HDstrcat(scalename, "al"); - HDstrcpy(name, SCALE_1_NAME); - HDstrcat(name, "al"); + HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_1_NAME, "al"); + HDsnprintf(name, sizeof(name), "%s%s", SCALE_1_NAME, "al"); if(test_set_scalename(fid, did, scalename, name, DIM0) < 0) goto out; if(test_cmp_scalename(fid, did, scalename, name, DIM0) < 0) goto out; - HDstrcpy(scalename, DS_2_NAME); - HDstrcat(scalename, "al"); - HDstrcpy(name, SCALE_2_NAME); - HDstrcat(name, "al"); + HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_2_NAME, "al"); + HDsnprintf(name, sizeof(name), "%s%s", SCALE_2_NAME, "al"); if(test_set_scalename(fid, did, scalename, name, DIM1) < 0) goto out; if(test_cmp_scalename(fid, did, scalename, name, DIM1) < 0) goto out; - HDstrcpy(scalename, DS_3_NAME); - HDstrcat(scalename, "al"); - HDstrcpy(name, SCALE_3_NAME); - HDstrcat(name, "al"); + HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_3_NAME, "al"); + HDsnprintf(name, sizeof(name), "%s%s", SCALE_3_NAME, "al"); if(test_set_scalename(fid, did, scalename, name, DIM2) < 0) goto out; if(test_cmp_scalename(fid, did, scalename, name, DIM2) < 0) goto out; - HDstrcpy(scalename, DS_4_NAME); - HDstrcat(scalename, "al"); - HDstrcpy(name, SCALE_4_NAME); - HDstrcat(name, "al"); + HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_4_NAME, "al"); + HDsnprintf(name, sizeof(name), "%s%s", SCALE_4_NAME, "al"); if(test_set_scalename(fid, did, scalename, name, DIM3) < 0) goto out; @@ -2126,48 +2030,40 @@ static int test_samelong_scalenames(const char *fileext) { char dsname[32]; char scalename[32]; char name[32]; - HDstrcpy(dsname, DATASET_NAME); - HDstrcat(dsname, "al2"); + + HDsnprintf(dsname, sizeof(dsname), "%s%s", DATASET_NAME, "al2"); if((fid = open_test_file(fileext)) < 0) goto out; TESTING2("set same long scale/cmp scale name"); if((did = H5Dopen2(fid, dsname, H5P_DEFAULT)) >= 0) { - HDstrcpy(scalename, DS_1_NAME); - HDstrcat(scalename, "al"); - HDstrcpy(name, DS_1_NAME); - HDstrcat(name, "al"); + HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_1_NAME, "al"); + HDsnprintf(name, sizeof(name), "%s%s", DS_1_NAME, "al"); if(test_set_scalename(fid, did, scalename, name, DIM0) < 0) goto out; if(test_cmp_scalename(fid, did, scalename, name, DIM0) < 0) goto out; - HDstrcpy(scalename, DS_2_NAME); - HDstrcat(scalename, "al"); - HDstrcpy(name, DS_2_NAME); - HDstrcat(name, "al"); + HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_2_NAME, "al"); + HDsnprintf(name, sizeof(name), "%s%s", DS_2_NAME, "al"); if(test_set_scalename(fid, did, scalename, name, DIM1) < 0) goto out; if(test_cmp_scalename(fid, did, scalename, name, DIM1) < 0) goto out; - HDstrcpy(scalename, DS_3_NAME); - HDstrcat(scalename, "al"); - HDstrcpy(name, DS_3_NAME); - HDstrcat(name, "al"); + HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_3_NAME, "al"); + HDsnprintf(name, sizeof(name), "%s%s", DS_3_NAME, "al"); if(test_set_scalename(fid, did, scalename, name, DIM2) < 0) goto out; if(test_cmp_scalename(fid, did, scalename, name, DIM2) < 0) goto out; - HDstrcpy(scalename, DS_4_NAME); - HDstrcat(scalename, "al"); - HDstrcpy(name, DS_4_NAME); - HDstrcat(name, "al"); + HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_4_NAME, "al"); + HDsnprintf(name, sizeof(name), "%s%s", DS_4_NAME, "al"); if(test_set_scalename(fid, did, scalename, name, DIM3) < 0) goto out; @@ -2202,58 +2098,48 @@ static int test_float_scalenames(const char *fileext) { char dsname[32]; char scalename[32]; char name[32]; - HDstrcpy(dsname, DATASET_NAME); - HDstrcat(dsname, "af"); + + HDsnprintf(dsname, sizeof(dsname), "%s%s", DATASET_NAME, "af"); if((fid = open_test_file(fileext)) < 0) goto out; TESTING2("set float scale/cmp scale name"); if((did = H5Dopen2(fid, dsname, H5P_DEFAULT)) >= 0) { - HDstrcpy(scalename, DS_1_NAME); - HDstrcat(scalename, "af"); - HDstrcpy(name, SCALE_1_NAME); - HDstrcat(name, "af"); + HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_1_NAME, "af"); + HDsnprintf(name, sizeof(name), "%s%s", SCALE_1_NAME, "af"); if(test_set_scalename(fid, did, scalename, name, DIM0) < 0) goto out; if(test_cmp_scalename(fid, did, scalename, name, DIM0) < 0) goto out; - HDstrcpy(scalename, DS_11_NAME); - HDstrcat(scalename, "af"); - HDstrcpy(name, SCALE_11_NAME); - HDstrcat(name, "af"); + HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_11_NAME, "af"); + HDsnprintf(name, sizeof(name), "%s%s", SCALE_11_NAME, "af"); if(test_set_scalename(fid, did, scalename, name, DIM0) < 0) goto out; if(test_cmp_scalename(fid, did, scalename, name, DIM0) < 0) goto out; - HDstrcpy(scalename, DS_2_NAME); - HDstrcat(scalename, "af"); - HDstrcpy(name, SCALE_2_NAME); - HDstrcat(name, "af"); + HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_2_NAME, "af"); + HDsnprintf(name, sizeof(name), "%s%s", SCALE_2_NAME, "af"); if(test_set_scalename(fid, did, scalename, name, DIM1) < 0) goto out; if(test_cmp_scalename(fid, did, scalename, name, DIM1) < 0) goto out; - HDstrcpy(scalename, DS_21_NAME); - HDstrcat(scalename, "af"); - HDstrcpy(name, SCALE_21_NAME); - HDstrcat(name, "af"); + HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_21_NAME, "af"); + HDsnprintf(name, sizeof(name), "%s%s", SCALE_21_NAME, "af"); if(test_set_scalename(fid, did, scalename, name, DIM1) < 0) goto out; if(test_cmp_scalename(fid, did, scalename, name, DIM1) < 0) goto out; - HDstrcpy(scalename, DS_22_NAME); - HDstrcat(scalename, "af"); - HDstrcpy(name, SCALE_22_NAME); - HDstrcat(name, "af"); + HDsnprintf(scalename, sizeof(scalename), "%s%s", DS_22_NAME, "af"); + HDsnprintf(name, sizeof(name), "%s%s", SCALE_22_NAME, "af"); if(test_set_scalename(fid, did, scalename, name, DIM1) < 0) goto out; @@ -3150,9 +3036,9 @@ static int test_simple(void) goto out; if(H5DSget_label(did,DIM1,dim1_label,sizeof(dim1_label)) < 0) goto out; - if(HDstrcmp(DIM0_LABEL,dim0_label)!=0) + if(HDstrncmp(DIM0_LABEL,dim0_label,sizeof(dim0_label))!=0) goto out; - if(HDstrcmp(DIM1_LABEL,dim1_label)!=0) + if(HDstrncmp(DIM1_LABEL,dim1_label,sizeof(dim1_label))!=0) goto out; /*------------------------------------------------------------------------- @@ -3166,8 +3052,8 @@ static int test_simple(void) goto out; /* allocate */ - dim0_labeld = (char*)HDmalloc(dim0_label_size * sizeof (char)); - dim1_labeld = (char*)HDmalloc(dim1_label_size * sizeof (char)); + dim0_labeld = (char*)HDmalloc((size_t)dim0_label_size * sizeof (char)); + dim1_labeld = (char*)HDmalloc((size_t)dim1_label_size * sizeof (char)); if( dim0_labeld==NULL || dim1_labeld==NULL) goto out; if(H5DSget_label(did,DIM0,dim0_labeld,(size_t)dim0_label_size) < 0) @@ -3197,9 +3083,9 @@ static int test_simple(void) goto out; if(H5DSget_label(did,DIM1,dim1_labels,sizeof(dim1_labels)) < 0) goto out; - if(HDstrncmp(DIM0_LABEL,dim0_label,sizeof(dim0_labels)-1)!=0) + if(HDstrncmp(DIM0_LABEL,dim0_labels,sizeof(dim0_labels)-1)!=0) goto out; - if(HDstrncmp(DIM1_LABEL,dim1_label,sizeof(dim1_labels)-1)!=0) + if(HDstrncmp(DIM1_LABEL,dim1_labels,sizeof(dim1_labels)-1)!=0) goto out; if(H5Dclose(did)) goto out; @@ -3232,7 +3118,7 @@ static int test_simple(void) goto out; /* allocate a buffer */ - name_out = (char*)HDmalloc((name_len+1) * sizeof (char)); + name_out = (char*)HDmalloc(((size_t)name_len+1) * sizeof (char)); if(name_out == NULL) goto out; @@ -3240,7 +3126,7 @@ static int test_simple(void) if(H5DSget_scale_name(dsid, name_out, (size_t)name_len+1) < 0) goto out; - if(HDstrcmp("Latitude set 0",name_out)!=0) + if(HDstrncmp("Latitude set 0",name_out, sizeof(name_out))!=0) goto out; if(name_out) { HDfree(name_out); @@ -3253,10 +3139,10 @@ static int test_simple(void) */ /* get the scale name using this buffer */ - if(H5DSget_scale_name(dsid, sname, sizeof (sname)) < 0) + if(H5DSget_scale_name(dsid, sname, sizeof(sname)) < 0) goto out; - if(HDstrcmp("Latitude set 0",sname)!=0) + if(HDstrncmp("Latitude set 0", sname, sizeof(sname))!=0) goto out; /*------------------------------------------------------------------------- @@ -3642,7 +3528,7 @@ static herr_t read_scale(hid_t dset, unsigned dim, hid_t scale_id, void *visitor goto out; if(nelmts) { - buf=(char *)HDmalloc((size_t)(nelmts*size)); + buf=(char *)HDmalloc(((size_t)nelmts*size)); if(buf==NULL) goto out; if(H5Dread(scale_id,mtid,H5S_ALL,H5S_ALL,H5P_DEFAULT,buf) < 0) @@ -4529,9 +4415,9 @@ static int test_rank(void) goto out; if(H5DSget_label(did,(unsigned)i,namel,sizeof(namel)) < 0) goto out; - if(HDstrcmp(name,names)!=0) + if(HDstrncmp(name, names, sizeof(names))!=0) goto out; - if(HDstrcmp(name,namel)!=0) + if(HDstrncmp(name, namel, sizeof(namel))!=0) goto out; } @@ -4986,8 +4872,8 @@ static int read_data( const char* fname, for(i=0, nelms=1; i < ndims; i++) { fscanf( f, "%s %u", str, &j); fscanf( f, "%d",&n ); - dims[i] = n; - nelms *= n; + dims[i] = (hsize_t)n; + nelms *= (size_t)n; } *buf = (float*) HDmalloc (nelms * sizeof( float )); -- cgit v0.12 From 00648b6875e09602231b953b3b28b270cc308a11 Mon Sep 17 00:00:00 2001 From: Albert Cheng Date: Mon, 22 Apr 2013 13:44:17 -0500 Subject: [svn-r23607] Purpose: Daily test failed in koala with parallel and v16compat API from the previous commit r22735. Descriptoin: Changed to use H5Dopen2() instead of H5Dopen(). Tested: koala --enable-parallel --with-default-api-version=v16. No h5committest test since this is limited to parallel test program. --- testpar/t_dset.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testpar/t_dset.c b/testpar/t_dset.c index 02c809d..743de3a 100644 --- a/testpar/t_dset.c +++ b/testpar/t_dset.c @@ -3620,7 +3620,7 @@ test_no_collective_cause_mode_filter(int selection_mode) VRFY((fapl_read >= 0), "create_faccess_plist() succeeded"); fid = H5Fopen (filename, H5F_ACC_RDONLY, fapl_read); - dataset = H5Dopen (fid, DSET_NOCOLCAUSE, H5P_DEFAULT); + dataset = H5Dopen2 (fid, DSET_NOCOLCAUSE, H5P_DEFAULT); /* Set collective I/O properties in the dxpl. */ ret = H5Pset_dxpl_mpio(dxpl, H5FD_MPIO_COLLECTIVE); -- cgit v0.12 From ed5a2bc1c1b8b4d81a3eaeedb7d523d3365dc32a Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 23 Apr 2013 12:50:15 -0500 Subject: [svn-r23614] Remove subfolders for includes --- c++/src/CMakeLists.txt | 2 +- config/cmake/hdf5-config.cmake.install.in | 8 ++++---- fortran/src/CMakeLists.txt | 6 +++--- hl/c++/src/CMakeLists.txt | 2 +- hl/fortran/src/CMakeLists.txt | 4 ++-- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/c++/src/CMakeLists.txt b/c++/src/CMakeLists.txt index fea68cd..cf5bd07 100644 --- a/c++/src/CMakeLists.txt +++ b/c++/src/CMakeLists.txt @@ -96,7 +96,7 @@ INSTALL ( FILES ${CPP_HDRS} DESTINATION - ${HDF5_INSTALL_INCLUDE_DIR}/cpp + ${HDF5_INSTALL_INCLUDE_DIR} COMPONENT cppheaders ) diff --git a/config/cmake/hdf5-config.cmake.install.in b/config/cmake/hdf5-config.cmake.install.in index 6b90496..e3d8bfc 100644 --- a/config/cmake/hdf5-config.cmake.install.in +++ b/config/cmake/hdf5-config.cmake.install.in @@ -29,19 +29,19 @@ SET (HDF5_PACKAGE_EXTLIBS @HDF5_PACKAGE_EXTLIBS@) SET (HDF5_INCLUDE_DIR "${_IMPORT_PREFIX}/include" ) IF (HDF5_BUILD_FORTRAN) - SET (HDF5_INCLUDE_DIR_FORTRAN "${_IMPORT_PREFIX}/include/fortran" ) + SET (HDF5_INCLUDE_DIR_FORTRAN "${_IMPORT_PREFIX}/include" ) ENDIF (HDF5_BUILD_FORTRAN) IF (HDF5_BUILD_CPP_LIB) - SET (HDF5_INCLUDE_DIR_CPP "${_IMPORT_PREFIX}/include/cpp" ) + SET (HDF5_INCLUDE_DIR_CPP "${_IMPORT_PREFIX}/include" ) ENDIF (HDF5_BUILD_CPP_LIB) IF (HDF5_BUILD_HL_LIB) - SET (HDF5_INCLUDE_DIR_HL "${_IMPORT_PREFIX}/include/hl" ) + SET (HDF5_INCLUDE_DIR_HL "${_IMPORT_PREFIX}/include" ) ENDIF (HDF5_BUILD_HL_LIB) IF (HDF5_BUILD_HL_LIB AND HDF5_BUILD_CPP_LIB) - SET (HDF5_INCLUDE_DIR_HL_CPP "${_IMPORT_PREFIX}/include/hl/cpp" ) + SET (HDF5_INCLUDE_DIR_HL_CPP "${_IMPORT_PREFIX}/include" ) ENDIF (HDF5_BUILD_HL_LIB AND HDF5_BUILD_CPP_LIB) IF (HDF5_BUILD_TOOLS) diff --git a/fortran/src/CMakeLists.txt b/fortran/src/CMakeLists.txt index c41916a..1bddc56 100644 --- a/fortran/src/CMakeLists.txt +++ b/fortran/src/CMakeLists.txt @@ -254,7 +254,7 @@ INSTALL ( ${HDF5_F90_BINARY_DIR}/H5f90i_gen.h ${HDF5_F90_BINARY_DIR}/H5fortran_types.f90 DESTINATION - ${HDF5_INSTALL_INCLUDE_DIR}/fortran + ${HDF5_INSTALL_INCLUDE_DIR} COMPONENT fortheaders ) @@ -264,7 +264,7 @@ IF (WIN32 AND NOT CYGWIN) DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/\${BUILD_TYPE}/ DESTINATION - ${HDF5_INSTALL_INCLUDE_DIR}/fortran + ${HDF5_INSTALL_INCLUDE_DIR} COMPONENT fortheaders ) @@ -273,7 +273,7 @@ ELSE (WIN32 AND NOT CYGWIN) DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/ DESTINATION - ${HDF5_INSTALL_INCLUDE_DIR}/fortran + ${HDF5_INSTALL_INCLUDE_DIR} COMPONENT fortheaders ) diff --git a/hl/c++/src/CMakeLists.txt b/hl/c++/src/CMakeLists.txt index 5a2a7c4..89de4ca 100644 --- a/hl/c++/src/CMakeLists.txt +++ b/hl/c++/src/CMakeLists.txt @@ -27,7 +27,7 @@ INSTALL ( FILES ${HDF5_HL_CPP_HDRS} DESTINATION - ${HDF5_INSTALL_INCLUDE_DIR}/hl/cpp + ${HDF5_INSTALL_INCLUDE_DIR} COMPONENT hlcppheaders ) diff --git a/hl/fortran/src/CMakeLists.txt b/hl/fortran/src/CMakeLists.txt index c580516..9ab0fb2 100644 --- a/hl/fortran/src/CMakeLists.txt +++ b/hl/fortran/src/CMakeLists.txt @@ -76,7 +76,7 @@ IF (WIN32 AND NOT CYGWIN) DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/\${BUILD_TYPE}/ DESTINATION - ${HDF5_INSTALL_INCLUDE_DIR}/fortran + ${HDF5_INSTALL_INCLUDE_DIR} COMPONENT fortheaders ) @@ -85,7 +85,7 @@ ELSE (WIN32 AND NOT CYGWIN) DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/ DESTINATION - ${HDF5_INSTALL_INCLUDE_DIR}/fortran + ${HDF5_INSTALL_INCLUDE_DIR} COMPONENT fortheaders ) -- cgit v0.12 From 357424423c6771ad3caee2c61e90b4745080d432 Mon Sep 17 00:00:00 2001 From: Albert Cheng Date: Wed, 24 Apr 2013 13:27:04 -0500 Subject: [svn-r23618] Bug fix: HDFFV-8390 Threadsafe works in v1.8.10 release. But it fails v1.8.11-pre1 tarball in configure stage now. There was a typo in the configure around the checking of pthread library. Fixed it. Tested: AIX and also h5committested. --- configure | 4 ++-- configure.ac | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/configure b/configure index 55f2112..002357f 100755 --- a/configure +++ b/configure @@ -26212,7 +26212,7 @@ fi done - if test "x$HAVE_DMALLOC" = "xyes"; then + if test "x$HAVE_PTHREAD" = "xyes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_self in -lpthread" >&5 $as_echo_n "checking for pthread_self in -lpthread... " >&6; } if ${ac_cv_lib_pthread_pthread_self+:} false; then : @@ -26336,7 +26336,7 @@ done fi - if test "x$HAVE_DMALLOC" = "xyes"; then + if test "x$HAVE_PTHREAD" = "xyes"; then if test -n "$pthread_lib"; then saved_LDFLAGS="$LDFLAGS" saved_AM_LDFLAGS="$AM_LDFLAGS" diff --git a/configure.ac b/configure.ac index 7b313e0..6a1ab73 100644 --- a/configure.ac +++ b/configure.ac @@ -1945,7 +1945,7 @@ AC_ARG_WITH([pthread], case "$withval" in yes) AC_CHECK_HEADERS([pthread.h],, [unset HAVE_PTHREAD]) - if test "x$HAVE_DMALLOC" = "xyes"; then + if test "x$HAVE_PTHREAD" = "xyes"; then AC_CHECK_LIB([pthread], [pthread_self],, [unset HAVE_PTHREAD]) fi ;; @@ -1987,7 +1987,7 @@ case "$withval" in AC_CHECK_HEADERS([pthread.h],, [unset HAVE_PTHREAD]) fi - if test "x$HAVE_DMALLOC" = "xyes"; then + if test "x$HAVE_PTHREAD" = "xyes"; then if test -n "$pthread_lib"; then saved_LDFLAGS="$LDFLAGS" saved_AM_LDFLAGS="$AM_LDFLAGS" -- cgit v0.12 From 613c5e8046dfdc037470821f77a52ee2bf7e3fcc Mon Sep 17 00:00:00 2001 From: Albert Cheng Date: Fri, 26 Apr 2013 18:02:57 -0500 Subject: [svn-r23638] Removed INSTALL_MinGW because, 1. The file states that: NOTE: We are no longer actively supporting MinGW as of 1.8.5. 2. It is not tested for v1.8.11. 3. If we ever supports it again, it can be "restored" from previous release (e.g. v1.8.10).) --- MANIFEST | 1 - release_docs/INSTALL_MinGW.txt | 269 ----------------------------------------- 2 files changed, 270 deletions(-) delete mode 100644 release_docs/INSTALL_MinGW.txt diff --git a/MANIFEST b/MANIFEST index 993c734..542ad13 100644 --- a/MANIFEST +++ b/MANIFEST @@ -535,7 +535,6 @@ ./release_docs/HISTORY-1_9.txt ./release_docs/INSTALL ./release_docs/INSTALL_Cygwin.txt -./release_docs/INSTALL_MinGW.txt ./release_docs/INSTALL_parallel ./release_docs/INSTALL_VMS.txt ./release_docs/INSTALL_Windows.txt diff --git a/release_docs/INSTALL_MinGW.txt b/release_docs/INSTALL_MinGW.txt deleted file mode 100644 index 245e3ff..0000000 --- a/release_docs/INSTALL_MinGW.txt +++ /dev/null @@ -1,269 +0,0 @@ -************************************************************************ - HDF5 Build and Install Instructions for MinGW -************************************************************************ - -NOTE: -We are no longer actively supporting MinGW as of 1.8.5. ------- 1.8.9 notes ------ -Autotools configure failed to correctly generate the *config.h files. -CMake 2.8.6 can configure and build the library, however fortran programs did - not execute correctly. Some tests may fail. Used the "MSYS Makefiles" - generator for the "-G" parameter. Follow the CMake.txt document. - -Below are the old instructions from the 1.8.4 release. - -************************************************************************ -************************************************************************ -************************************************************************ - -Preconditions: --------------- - -1. Installed MinGW (5.1.6 or higher) and MSYS (1.0.11 or higher) - - To install the MinGW net release, go to http://www.mingw.org and - follow the instructions for a manual installation. - -2. Compilers Installed - - 2.1 C/C++ Compilers HDF5-1.8.4 Supported - - gcc-4.4.0 is included in MinGW, which includes: - gcc : GNU C compiler - gcc-g++: GNU C++ compiler - gfortran: GNU Fortran compiler - - 2.2 Using Compilers Not Supported - - The compilers in 2.1 are supported and tested by The HDF - Group. Any other compilers may still work but they are not - guaranteed by HDF group. - - If users want to use other compilers except those in 2.1, - try to set the following variables to override the default - choices. - - CC : C compiler command - CXX : C++ compiler command - FC : Fortran compiler command - -3. HDF5 Dependencies - - 3.1 Zlib - - zlib-1.2.2 or later is supported and tested on MinGW. - - 3.2 Szip - The HDF5 library has a predefined compression filter that uses - the extended-Rice lossless compression algorithm for chunked - datatsets. For more information about Szip compression and - license terms see - http://hdfgroup.org/HDF5/doc_resource/SZIP/index.html. - - Szip is currently not supported on MinGW, although we plan to add - support in the future. - - -Build HDF5 on MinGW ----------------------- - -1. Get HDF5 source code package - Users can download HDF5 source code package from HDF website - (http://hdfgroup.org). - -2. Unpacking the distribution - - The HDF5 source code is distributed in a variety of formats which - can be unpacked with the following commands, each of which creates - an `hdf5-1.8.4' directory. - - 2.1 Non-compressed tar archive (*.tar) - - $ tar xf hdf5-1.8.4.tar - - 2.2 Gzip'd tar archive (*.tar.gz) - - $ gunzip < hdf5-1.8.4.tar.gz | tar xf - - - 2.3 Bzip'd tar archive (*.tar.bz2) - - $ bunzip2 < hdf5-1.8.4.tar.bz2 | tar xf - - -3. Setup Environment - - Building HDF5 1.8.4 requires an explicit link to libws2_32.a - to handle Windows Sockets. To do this, issue the command: - - $ export LIBS=-lws2_32 - - Also, the default search path can cause trouble using ./configure in HDF5 - 1.8.4. Check that non-MinGW or non-msys directories are not added to the - PATH. You can do this by: - - $ echo $PATH - - If there are spurious entries, specifically those related to other Windows - compilers or tools, remove them by setting a new PATH without them. For - example, - - $ export PATH=.:/usr/local/bin:/mingw/bin:/bin - - -4. Remove Unsupported Source - - There are some projects which are built by default to test performance on - POSIX systems. They are irrelevent on MinGW, and can cause compiler errors. - - To remove these projects from the build script, open ./perform/Makefile.in - Find all instances of "h5perf_serial", and remove them (along with their - respective extension or targets, if they exist). Then save the file. - - -5. Remove Tests - - When building with MinGW, many tests must be removed from the - test suite run with "make check". This is because of the way - MinGW and Windows handles certain parsing. For example, MinGW - treats any command parameter starting with '/' as a path, and - replaces it with it's root directory on Windows, such as - 'C:\msys\1.0\'. - - To remove the tests, open the given 'Makefile.in' and edit the - line begining with "TEST_SCRIPT = " to remove the test script. - For example, to remove the "testerror.sh" from ./test/Makefile.in: - - 1) Open ./test/Makefile.in - - 2) Find the line "TEST_SCRIPT = $(top_srcdir)/test/testerror.sh" - - 3) Change it to simply read "TEST_SCRIPT =", and save. - - Do this for the following Makefiles and tests: - - - ./test/Makefile.in: "testerror.sh testlibinfo.sh testcheckinfo.sh" - - - ./tools/h5diff/Makefile.in: "testh5diff.sh" - - - ./tools/h5ls/Makefile.in: "testh5ls.sh" - - - ./tools/misc/Makefile.in: "testh5mkgrp.sh" - - - ./tools/h5copy/Makefile.in: "testh5copy.sh" - - - ./tools/h5stat/Makefile.in: "testh5stat.sh" - - - ./tools/h5dump/Makefile.in: "testh5dump.sh" and "testh5dumpxml.sh" - - -6. Configuring - - Notes: - 1) Note: MinGW is c++ package is missing the libstdc++.dll.a file - and c++ linking fails. Do not enable c++ option in configure. - - 2) See detailed information in hdf5/release_docs/INSTALL, - part 5. Full installation instructions for source - distributions - - In short, - - To configure HDF5 with C Library, use - - $ ./configure - - If you would like to build the C++ library, add the parameter: - - --enable-cxx (12-11-2009 MinGW C++ package is missing a file) - - If you would like to build without the Zlib library, add the parameter: - - --without-zlib - - If you would like to specify the the Zlib library, there are two ways: - - Using - - --with-zlib=INCDIR,LIBDIR - - For example, if the zlib library is installed in - /usr, which is the parent directory of directories - "include" and "lib", - - --with-zlib=/usr/include,/usr/lib - - Through the CPPFLAGS and LDFLAGS Variables - - For example, if zlib was installed in the directory - /c/usr then using the following command to configure - HDF5 with zib - - $ export CPPFLAGS=-I/usr/include - $ export LDFLAGS=-L/usr/lib - - If you would like to specify the install directory, add the parameter: - - --prefix="path for installation" - - By default, HDF5 library, header files, examples, and - support programs will be installed in /usr/local/lib, - /usr/local/include, /usr/local/doc/hdf5/examples, and - /usr/local/bin. To use a path other than /usr/local specify - the path with the `--prefix=PATH' switch as in the above - command. - - Combination of Switches - - All of the above switches can be combined together. For - example, if users want to configure HDF5 C/Fortran - library, with zlib library at /c/usr/, and - install HDF5 into directory /c/hdf5 using - gcc/gfortran as C/Fortran compiler: - - $ ./configure - --with-zlib=/usr/include,/usr/lib - --prefix=/c/hdf5 - --enable-fortran - <"If no more switches, then hit Enter"> - - Notes: The command format above is for readilibity. In practice, - please type in the command above with at least one - space between each line, No "Enter" until users finish - the switches and want to run the configure. - - - or do it through CPPFLAGS and LDFLAGS variables: - - $ CPPFLAGS=-I/usr/include \ - $ LDFLAGS=-L/usr/lib \ - - $ ./configure - --prefix=/c/hdf5 - --enable-fortran - <"If no more switches, then hit Enter"> - -7. Make and Make Check - - After configuration is done successfully, run the following series of - commands to build, test and install HDF5 - - $ make > "output file name" - $ make check > "output file name" - - Before run "make install", check output file for "make check", there - should be no failures at all. - -8. Make Install - - $ make install > "output file name" - - -9. Check installed HDF5 library - - After step 8, go to your installation directory, there should be - three subdirectories: "bin" "include" and "lib". - - $ make installcheck > "output file name" - ------------------------------------------------------------------------ - -Need Further assistance, email help@hdfgroup.org -- cgit v0.12 From 1f09e9d19e4b40e7d988fce8aa6351a13d452946 Mon Sep 17 00:00:00 2001 From: HDF Tester Date: Sun, 28 Apr 2013 03:37:26 -0500 Subject: [svn-r23642] Snapshot version 1.9 release 149 --- README.txt | 2 +- c++/src/Makefile.in | 2 +- config/lt_vers.am | 2 +- configure | 22 +++++++++++----------- configure.ac | 2 +- fortran/src/Makefile.in | 2 +- hl/c++/src/Makefile.in | 2 +- hl/fortran/src/Makefile.in | 2 +- hl/src/Makefile.in | 2 +- release_docs/RELEASE.txt | 2 +- src/H5public.h | 4 ++-- src/Makefile.in | 2 +- vms/src/h5pubconf.h | 6 +++--- 13 files changed, 26 insertions(+), 26 deletions(-) diff --git a/README.txt b/README.txt index 96c1121..fb3f387 100644 --- a/README.txt +++ b/README.txt @@ -1,4 +1,4 @@ -HDF5 version 1.9.149 currently under development +HDF5 version 1.9.150 currently under development Please refer to the release_docs/INSTALL file for installation instructions. ------------------------------------------------------------------------------ diff --git a/c++/src/Makefile.in b/c++/src/Makefile.in index 37e5d1b..6bcd7f0 100644 --- a/c++/src/Makefile.in +++ b/c++/src/Makefile.in @@ -467,7 +467,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 139 +LT_VERS_REVISION = 140 LT_VERS_AGE = 0 # Include src directory diff --git a/config/lt_vers.am b/config/lt_vers.am index 8df77f3..89eb9f7 100644 --- a/config/lt_vers.am +++ b/config/lt_vers.am @@ -17,7 +17,7 @@ # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 139 +LT_VERS_REVISION = 140 LT_VERS_AGE = 0 ## If the API changes *at all*, increment LT_VERS_INTERFACE and diff --git a/configure b/configure index 002357f..f0da7b4 100755 --- a/configure +++ b/configure @@ -1,7 +1,7 @@ #! /bin/sh # From configure.ac Id: configure.ac 22697 2012-08-19 14:35:47Z hdftest . # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for HDF5 1.9.149. +# Generated by GNU Autoconf 2.69 for HDF5 1.9.150. # # Report bugs to . # @@ -591,8 +591,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='HDF5' PACKAGE_TARNAME='hdf5' -PACKAGE_VERSION='1.9.149' -PACKAGE_STRING='HDF5 1.9.149' +PACKAGE_VERSION='1.9.150' +PACKAGE_STRING='HDF5 1.9.150' PACKAGE_BUGREPORT='help@hdfgroup.org' PACKAGE_URL='' @@ -1486,7 +1486,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures HDF5 1.9.149 to adapt to many kinds of systems. +\`configure' configures HDF5 1.9.150 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1556,7 +1556,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of HDF5 1.9.149:";; + short | recursive ) echo "Configuration of HDF5 1.9.150:";; esac cat <<\_ACEOF @@ -1752,7 +1752,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -HDF5 configure 1.9.149 +HDF5 configure 1.9.150 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2846,7 +2846,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by HDF5 $as_me 1.9.149, which was +It was created by HDF5 $as_me 1.9.150, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -3678,7 +3678,7 @@ fi # Define the identity of the package. PACKAGE='hdf5' - VERSION='1.9.149' + VERSION='1.9.150' cat >>confdefs.h <<_ACEOF @@ -31632,7 +31632,7 @@ Usage: $0 [OPTIONS] Report bugs to ." lt_cl_version="\ -HDF5 config.lt 1.9.149 +HDF5 config.lt 1.9.150 configured by $0, generated by GNU Autoconf 2.69. Copyright (C) 2011 Free Software Foundation, Inc. @@ -33762,7 +33762,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by HDF5 $as_me 1.9.149, which was +This file was extended by HDF5 $as_me 1.9.150, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -33828,7 +33828,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -HDF5 config.status 1.9.149 +HDF5 config.status 1.9.150 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff --git a/configure.ac b/configure.ac index 6a1ab73..9eb90e0 100644 --- a/configure.ac +++ b/configure.ac @@ -26,7 +26,7 @@ AC_PREREQ([2.69]) ## NOTE: Do not forget to change the version number here when we do a ## release!!! ## -AC_INIT([HDF5], [1.9.149], [help@hdfgroup.org]) +AC_INIT([HDF5], [1.9.150], [help@hdfgroup.org]) AC_CONFIG_SRCDIR([src/H5.c]) AC_CONFIG_HEADER([src/H5config.h]) diff --git a/fortran/src/Makefile.in b/fortran/src/Makefile.in index 7379980..682f2cf 100644 --- a/fortran/src/Makefile.in +++ b/fortran/src/Makefile.in @@ -518,7 +518,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 139 +LT_VERS_REVISION = 140 LT_VERS_AGE = 0 # Include src directory in both Fortran and C flags (C compiler is used diff --git a/hl/c++/src/Makefile.in b/hl/c++/src/Makefile.in index b360bf3..a2c028d 100644 --- a/hl/c++/src/Makefile.in +++ b/hl/c++/src/Makefile.in @@ -458,7 +458,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 139 +LT_VERS_REVISION = 140 LT_VERS_AGE = 0 # Include src directory diff --git a/hl/fortran/src/Makefile.in b/hl/fortran/src/Makefile.in index fb54a54..a536ea7 100644 --- a/hl/fortran/src/Makefile.in +++ b/hl/fortran/src/Makefile.in @@ -474,7 +474,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 139 +LT_VERS_REVISION = 140 LT_VERS_AGE = 0 INCLUDES = -I$(top_srcdir)/src -I$(top_srcdir)/hl/src -I$(top_builddir)/hl/src \ -I$(top_srcdir)/fortran/src -I$(top_builddir)/fortran/src diff --git a/hl/src/Makefile.in b/hl/src/Makefile.in index 37d5af8..c2d6adb 100644 --- a/hl/src/Makefile.in +++ b/hl/src/Makefile.in @@ -457,7 +457,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 139 +LT_VERS_REVISION = 140 LT_VERS_AGE = 0 # This library is our main target. diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 7d102fb..4af32d8 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -1,4 +1,4 @@ -HDF5 version 1.9.149 currently under development +HDF5 version 1.9.150 currently under development ================================================================================ diff --git a/src/H5public.h b/src/H5public.h index deb4587..88b8de1 100644 --- a/src/H5public.h +++ b/src/H5public.h @@ -75,10 +75,10 @@ extern "C" { /* Version numbers */ #define H5_VERS_MAJOR 1 /* For major interface/format changes */ #define H5_VERS_MINOR 9 /* For minor interface/format changes */ -#define H5_VERS_RELEASE 149 /* For tweaks, bug-fixes, or development */ +#define H5_VERS_RELEASE 150 /* For tweaks, bug-fixes, or development */ #define H5_VERS_SUBRELEASE "" /* For pre-releases like snap0 */ /* Empty string for real releases. */ -#define H5_VERS_INFO "HDF5 library version: 1.9.149" /* Full version string */ +#define H5_VERS_INFO "HDF5 library version: 1.9.150" /* Full version string */ #define H5check() H5check_version(H5_VERS_MAJOR,H5_VERS_MINOR, \ H5_VERS_RELEASE) diff --git a/src/Makefile.in b/src/Makefile.in index e2495a1..a987dbe 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -522,7 +522,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 139 +LT_VERS_REVISION = 140 LT_VERS_AGE = 0 H5detect_CFLAGS = -g $(AM_CFLAGS) diff --git a/vms/src/h5pubconf.h b/vms/src/h5pubconf.h index f4c0eab..ecc5f38 100644 --- a/vms/src/h5pubconf.h +++ b/vms/src/h5pubconf.h @@ -502,7 +502,7 @@ #define H5_PACKAGE_NAME "HDF5" /* Define to the full name and version of this package. */ -#define H5_PACKAGE_STRING "HDF5 1.9.149" +#define H5_PACKAGE_STRING "HDF5 1.9.150" /* Define to the one symbol short name of this package. */ #define H5_PACKAGE_TARNAME "hdf5" @@ -511,7 +511,7 @@ #define H5_PACKAGE_URL "" /* Define to the version of this package. */ -#define H5_PACKAGE_VERSION "1.9.149" +#define H5_PACKAGE_VERSION "1.9.150" /* Width for printf() for type `long long' or `__int64', use `ll' */ #define H5_PRINTF_LL_WIDTH "ll" @@ -674,7 +674,7 @@ /* #undef H5_USING_MEMCHECKER */ /* Version number of package */ -#define H5_VERSION "1.9.149" +#define H5_VERSION "1.9.150" /* Define if vsnprintf() returns the correct value for formatted strings that don't fit into size allowed */ -- cgit v0.12 From 3c79c08dbe0015bbf07d30d4caf8df9d6162daf3 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 29 Apr 2013 09:18:34 -0500 Subject: [svn-r23649] Correct file reference in pack list Rename and update CMake docs. --- CMakeLists.txt | 6 +- MANIFEST | 6 +- release_docs/CMake.txt | 709 --------------------------------- release_docs/INSTALL_CMake.txt | 804 ++++++++++++++++++++++++++++++++++++++ release_docs/INSTALL_Windows.txt | 11 +- release_docs/USING_CMake.txt | 272 ------------- release_docs/USING_HDF5_CMake.txt | 279 +++++++++++++ release_docs/USING_HDF5_VS.txt | 88 +++++ release_docs/USING_Windows.txt | 35 -- 9 files changed, 1185 insertions(+), 1025 deletions(-) delete mode 100644 release_docs/CMake.txt create mode 100644 release_docs/INSTALL_CMake.txt delete mode 100644 release_docs/USING_CMake.txt create mode 100644 release_docs/USING_HDF5_CMake.txt create mode 100644 release_docs/USING_HDF5_VS.txt delete mode 100644 release_docs/USING_Windows.txt diff --git a/CMakeLists.txt b/CMakeLists.txt index 60655ae..b536980 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -487,6 +487,8 @@ IF (HDF5_ENABLE_PARALLEL) # Used by Fortran + MPI CHECK_SYMBOL_EXISTS (MPI_Comm_c2f "${MPI_C_INCLUDE_PATH}/mpi.h" H5_HAVE_MPI_MULTI_LANG_Comm) CHECK_SYMBOL_EXISTS (MPI_Info_c2f "${MPI_C_INCLUDE_PATH}/mpi.h" H5_HAVE_MPI_MULTI_LANG_Info) + ELSE (MPI_C_FOUND) + MESSAGE (STATUS "Parallel libraries not found") ENDIF (MPI_C_FOUND) ENDIF (HDF5_ENABLE_PARALLEL) @@ -962,8 +964,8 @@ IF (NOT HDF5_EXTERNALLY_CONFIGURED) ) IF (EXISTS "${HDF5_SOURCE_DIR}/release_docs" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/release_docs") SET (release_files - ${HDF5_SOURCE_DIR}/release_docs/CMake.txt - ${HDF5_SOURCE_DIR}/release_docs/USING_CMake.txt + ${HDF5_SOURCE_DIR}/release_docs/INSTALL_CMake.txt + ${HDF5_SOURCE_DIR}/release_docs/USING_HDF5_CMake.txt ${HDF5_SOURCE_DIR}/release_docs/COPYING ${HDF5_SOURCE_DIR}/release_docs/HISTORY-1_9.txt ${HDF5_SOURCE_DIR}/release_docs/INSTALL diff --git a/MANIFEST b/MANIFEST index 542ad13..8fd716a 100644 --- a/MANIFEST +++ b/MANIFEST @@ -529,7 +529,7 @@ ./perform/sio_timer.h ./perform/zip_perf.c -./release_docs/CMake.txt +./release_docs/INSTALL_CMake.txt ./release_docs/COPYING ./release_docs/HISTORY-1_0-1_8_0_rc3.txt ./release_docs/HISTORY-1_9.txt @@ -539,8 +539,8 @@ ./release_docs/INSTALL_VMS.txt ./release_docs/INSTALL_Windows.txt ./release_docs/RELEASE.txt -./release_docs/USING_CMake.txt -./release_docs/USING_Windows.txt +./release_docs/USING_HDF5_CMake.txt +./release_docs/USING_HDF5_VS.txt ./src/.indent.pro _DO_NOT_DISTRIBUTE_ ./src/hdf5.lnt _DO_NOT_DISTRIBUTE_ diff --git a/release_docs/CMake.txt b/release_docs/CMake.txt deleted file mode 100644 index 81dfb61..0000000 --- a/release_docs/CMake.txt +++ /dev/null @@ -1,709 +0,0 @@ -************************************************************************ -* Build and Install HDF5 C/C++ Library with CMake * -************************************************************************ - -Notes: This short instruction is written for users who want to quickly build - HDF5 library and tools from the HDF5 source code package using the - CMake tools. - - More information about using CMake can be found at the KitWare site, - www.cmake.org. - - CMake uses the command line, however the visual CMake tool is - recommended for the configuration step. The steps are similar for - all the operating systems supported by CMake. - - NOTES: - 1. Using CMake for building and using HDF5 is under active development. - While we have attempted to provide error-free files, please - understand that development with CMake has not been extensively - tested outside of HDF. The CMake specific files may change - before the next release. - - 2. CMake was originally introduced to support development on Windows, - however it should be usable on any system where CMake is supported. - Please send us any comments on how CMake support can be improved on - any system. Visit the KitWare site for more information about CMake. - - 3. Build and test results can be submitted to our CDash server at: - cdash.hdfgroup.uiuc.edu. - Please read the HDF and CDash document at: - www.hdfgroup.org/CDash/HowToSubmit. - - 4. See the appendix at the bottom of this file for examples of using - a ctest script for building and testing. - - -======================================================================== - Preconditions -======================================================================== - - 1. We suggest you obtain the latest CMake for windows from the Kitware - web site. The HDF5 1.8.x product requires CMake version 2.8.10. - - 2. If you plan to use Zlib or Szip; - A. Download the packages and install them - in a central location. For example on Windows, create a folder extlibs - and install the packages there. - B. Use source packages from a SVN server by adding the following CMake - options: - HDF5_ALLOW_EXTERNAL_SUPPORT:STRING="SVN" - ZLIB_SVN_URL:STRING="http://some_location/zlib/trunk" - SZIP_SVN_URL:STRING="http://some_location/szip/trunk" - where "some_location" is the URL to the SVN repository. - C. Use source packages from a compressed file by adding the following CMake - options: - HDF5_ALLOW_EXTERNAL_SUPPORT:STRING="TGZ" - ZLIB_TGZ_NAME:STRING="zlib_src.ext" - SZIP_TGZ_NAME:STRING="szip_src.ext" - TGZ_PATH:STRING="some_location" - where "some_location" is the URL or full path to the compressed file and - ext is the type of compression file. - - 3. Building on Apple Darwin platforms should add the following options: - Compiler choice - use xcode by setting the ENV variables of CC and CXX - Shared fortran is not supported, build static: - BUILD_SHARED_LIBS:BOOL=OFF - Additional options: - CMAKE_ANSI_CFLAGS:STRING=-fPIC - CTEST_USE_LAUNCHERS:BOOL=ON - CMAKE_BUILD_WITH_INSTALL_RPATH:BOOL=OFF - - -======================================================================== - Building HDF5 C/C++ Libraries with CMake -======================================================================== - - 1. Run CMake - - The CMake executable is named "cmake-gui.exe" on Windows and should be - available in your Start menu. For Linux, UNIX, and Mac users the - executable is named "cmake-gui" and can be found where CMake was - installed. - Specify the source and build directories. - ***** It is recommemded that you choose a build directory ****** - ***** different then the source directory ****** - (for example on Windows, if the source is at c:\MyHDFstuff\hdf5, then - use c:\MyHDFstuff\hdf5\build or c:\MyHDFstuff\build\hdf5). - - OPTIONAL: - Users can perform the configuration step without using the visual cmake-gui - program. We use the file cacheinit.cmake in the config/cmake folder for - our testing. This file enables all the basic options and we turn specific - options on or off for testing using the following command line within the build - directory: - - cmake -C /config/cmake/cacheinit.cmake -G "" [-D] - - Where is - * Borland Makefiles - * MSYS Makefiles - * MinGW Makefiles - * NMake Makefiles - * Unix Makefiles - * Visual Studio 10 - * Visual Studio 10 Win64 - * Visual Studio 6 - * Visual Studio 7 - * Visual Studio 7 .NET 2003 - * Visual Studio 8 2005 - * Visual Studio 8 2005 Win64 - * Visual Studio 9 2008 - * Visual Studio 9 2008 Win64 - - is: - * SZIP_INCLUDE_DIR:PATH= - * SZIP_LIBRARY:FILEPATH= - * ZLIB_INCLUDE_DIR:PATH= - * ZLIB_LIBRARY:FILEPATH= - * :BOOL=[ON | OFF] - - is: - # This is the CMakeCache file. - ######################## - # EXTERNAL cache entries - ######################## - SET (BUILD_SHARED_LIBS ON CACHE BOOL "Build Shared Libraries" FORCE) - SET (BUILD_TESTING ON CACHE BOOL "Build HDF5 Unit Testing" FORCE) - SET (HDF_PACKAGE_EXT "" CACHE STRING "Name of HDF package extension" FORCE) - SET (HDF5_BUILD_CPP_LIB ON CACHE BOOL "Build HDF5 C++ Library" FORCE) - SET (HDF5_BUILD_EXAMPLES ON CACHE BOOL "Build HDF5 Library Examples" FORCE) - SET (HDF5_BUILD_FORTRAN ON CACHE BOOL "Build FORTRAN support" FORCE) - SET (HDF5_ENABLE_F2003 OFF CACHE BOOL "Enable FORTRAN 2003 Standard" FORCE) - SET (HDF5_BUILD_HL_LIB ON CACHE BOOL "Build HIGH Level HDF5 Library" FORCE) - SET (HDF5_BUILD_TOOLS ON CACHE BOOL "Build HDF5 Tools" FORCE) - SET (HDF5_BUILD_GENERATORS OFF CACHE BOOL "Build Test Generators" FORCE) - SET (HDF5_ENABLE_Z_LIB_SUPPORT ON CACHE BOOL "Enable Zlib Filters" FORCE) - SET (HDF5_ENABLE_SZIP_SUPPORT ON CACHE BOOL "Use SZip Filter" FORCE) - SET (HDF5_ENABLE_SZIP_ENCODING ON CACHE BOOL "Use SZip Encoding" FORCE) - SET (HDF5_ENABLE_HSIZET ON CACHE BOOL "Enable datasets larger than memory" FORCE) - SET (HDF5_ENABLE_UNSUPPORTED OFF CACHE BOOL "Enable unsupported combinations of configuration options" FORCE) - SET (HDF5_ENABLE_DEPRECATED_SYMBOLS ON CACHE BOOL "Enable deprecated public API symbols" FORCE) - SET (HDF5_ENABLE_DIRECT_VFD OFF CACHE BOOL "Build the Direct I/O Virtual File Driver" FORCE) - SET (HDF5_ENABLE_PARALLEL OFF CACHE BOOL "Enable parallel build (requires MPI)" FORCE) - SET (MPIEXEC_MAX_NUMPROCS "3" CACHE STRING "Minimum number of processes for HDF parallel tests" FORCE) - SET (HDF5_BUILD_PARALLEL_ALL OFF CACHE BOOL "Build Parallel Programs" FORCE) - SET (HDF5_ENABLE_COVERAGE OFF CACHE BOOL "Enable code coverage for Libraries and Programs" FORCE) - SET (HDF5_ENABLE_USING_MEMCHECKER OFF CACHE BOOL "Indicate that a memory checker is used" FORCE) - SET (HDF5_DISABLE_COMPILER_WARNINGS OFF CACHE BOOL "Disable compiler warnings" FORCE) - SET (HDF5_USE_FOLDERS ON CACHE BOOL "Enable folder grouping of projects in IDEs." FORCE) - SET (HDF5_USE_16_API_DEFAULT OFF CACHE BOOL "Use the HDF5 1.6.x API by default" FORCE) - SET (HDF5_USE_18_API_DEFAULT OFF CACHE BOOL "Use the HDF5 1.8.x API by default" FORCE) - SET (HDF5_ENABLE_THREADSAFE OFF CACHE BOOL "(WINDOWS)Enable Threadsafety" FORCE) - SET (HDF5_PACKAGE_EXTLIBS OFF CACHE BOOL "(WINDOWS)CPACK - include external libraries" FORCE) - SET (HDF5_NO_PACKAGES OFF CACHE BOOL "CPACK - Disable packaging" FORCE) - SET (HDF5_ALLOW_EXTERNAL_SUPPORT "NO" CACHE STRING "Allow External Library Building" FORCE) - SET (ZLIB_SVN_URL "http://svn.hdfgroup.uiuc.edu/zlib/trunk" CACHE STRING "Use ZLib from HDF repository" FORCE) - SET (SZIP_SVN_URL "http://svn.hdfgroup.uiuc.edu/szip/trunk" CACHE STRING "Use SZip from HDF repository" FORCE) - SET (ZLIB_TGZ_NAME "ZLib.tar.gz" CACHE STRING "Use ZLib from compressed file" FORCE) - SET (SZIP_TGZ_NAME "SZip.tar.gz" CACHE STRING "Use SZip from compressed file" FORCE) - SET (ZLIB_PACKAGE_NAME "zlib" CACHE STRING "Name of ZLIB package" FORCE) - SET (SZIP_PACKAGE_NAME "szip" CACHE STRING "Name of SZIP package" FORCE) - - 2. Configure the cache settings - - 2.1 Click the Configure button. If this is the first time you are - running cmake-gui in this directory, you will be prompted for the - generator you wish to use (for example on Windows, Visual Studio 9 2008). - CMake will read in the CMakeLists.txt files from the source directory and - display options for the HDF5 project. After the first configure you - can adjust the cache settings and/or specify locations of other programs. - - Any conflicts or new values will be highlighted by the configure - process in red. Once you are happy with all the settings and there are no - more values in red, click the Generate button to produce the appropriate - build files. - - On Windows, if you are using a Visual Studio generator, the solution and - project files will be created in the build folder. - - On linux, if you are using the Unix Makefiles generator, the Makefiles will - be created in the build folder. - - 2.2 Alternative command line example on Windows in c:\MyHDFstuff\hdf5\build directory: - - cmake -C ../config/cmake/cacheinit.cmake -G "Visual Studio 9 2008" \ - -DHDF5_ENABLE_SZIP_SUPPORT:BOOL=OFF -DHDF5_ENABLE_Z_LIB_SUPPORT:BOOL=OFF .. - - 2.3 On Windows, if you are using a VS Express version you must be sure that the - following two options are correctly set/unset: - - HDF5_NO_PACKAGES:BOOL=ON - HDF5_USE_FOLDERS:BOOL=OFF - - 3. Build HDF5 - - On Windows, you can build HDF5 using either the Visual Studio Environment - or the command line. The command line is used on linux, Unix, and Mac. - - To build from the command line, navigate to your build directory and - execute the following; - - cmake --build . --config {Debug | Release} - - NOTE: "--config {Debug | Release}" may be optional on your platform. We - recommend choosing either Debug or Release on Windows. - - 3.1 If you wish to use the Visual Studio environment, open the solution - file in your build directory. Be sure to select either Debug or - Release and build the solution. - - 3.2.1 The external libraries (zlib and szip) can be configured - to allow building the libraries by downloading from a SVN repository. - The option is 'HDF5_ALLOW_EXTERNAL_SUPPORT'; by adding the following - configuration option: - -DHDF5_ALLOW_EXTERNAL_SUPPORT:STRING="SVN" - - The options to control the SVN URL (config/cmake/cacheinit.cmake file): - ZLIB_SVN_URL:STRING="http://svn.hdfgroup.uiuc.edu/zlib/trunk" - SZIP_SVN_URL:STRING="http://svn.hdfgroup.uiuc.edu/szip/trunk" - These should be changed to your location. - - 3.2.2 Or the external libraries (zlib and szip) can be configured - to allow building the libraries by using a compressed file. - The option is 'HDF5_ALLOW_EXTERNAL_SUPPORT'; by adding the following - configuration option: - -DHDF5_ALLOW_EXTERNAL_SUPPORT:STRING="TGZ" - - The options to control the SVN URL (config/cmake/cacheinit.cmake file): - ZLIB_TGZ_NAME:STRING="zlib_src.ext" - SZIP_TGZ_NAME:STRING="szip_src.ext" - TGZ_PATH:STRING="some_location" - where "some_location/xxxx_src.ext" is the URL or full path to the - compressed file and where ext is the type of the compression file like: - .bz2, .tar, .tar.gz, .tgz, .zip - - 4. Test HDF5. - - To test the build, navigate to your build directory and execute; - - ctest . -C {Debug | Release} - - NOTE: "-C {Debug | Release}" may be optional on your platform. We - recommend choosing either Debug or Release to match the build - step on Windows. - - 5. Packaging HDF5 - - To package the build into a simple installer using the NullSoft installer NSIS - on Windows, or into compressed files (.tar.gz, .sh, .zip), use the CPack tool. - - To package the build, navigate to your build directory and execute; - - cpack -C {Debug | Release} CPackConfig.cmake - - NOTE: We have just introduced the packaging capability and it has not been - extensively tested. Please send us comments on how it can be improved. - See NSIS note 8 of this document. - Also, if you are using a VS Express version or do not want to enable - the packaging components, set HDF5_NO_PACKAGES to ON (on the command - line add -DHDF5_NO_PACKAGES:BOOL=ON) - - 6. The files that support building HDF5 with CMake are all the files in the - config/cmake folder, the CMakeLists.txt files in each source folder, and - CTestConfig.cmake. CTestConfig.cmake is specific to the internal testing - performed by The HDF Group. It should be altered for the users - installation and needs. - - 7. More information about using CMake can be found at the KitWare site, - www.cmake.org. - - 8. Nullsoft Scriptable Install System - The Nullsoft Scriptable Install System (NSIS) is an open source installation - system. It was created by the WinAmp authors to distribute that application, - but it is now a general-purpose system which anyone might use. NSIS installers - recognize /S for silent installation and /D=dir to specify the - "output directory", which is where the program will be installed. These - options are case-sensitive, so be sure to type them in upper case. - - -======================================================================== - All options for HDF5 C/C++ Libraries with CMake - Option Name --- Option Description --- Option Default -======================================================================== ----------------- General Build Options --------------------- -BUILD_SHARED_LIBS "Build Shared Libraries" OFF -BUILD_STATIC_EXECS "Build Static Executabless" OFF -BUILD_STATIC_PIC "Build Static PIC" OFF -BUILD_TESTING "Build HDF5 Unit Testing" OFF - ----------------- HDF5 Build Options --------------------- -HDF5_BUILD_CPP_LIB "Build HDF5 C++ Library" OFF -HDF5_BUILD_EXAMPLES "Build HDF5 Library Examples" OFF -HDF5_BUILD_FORTRAN "Build FORTRAN support" OFF -HDF5_BUILD_HL_LIB "Build HIGH Level HDF5 Library" OFF -HDF5_BUILD_TOOLS "Build HDF5 Tools" OFF -IF (HDF5_BUILD_FORTRAN) - HDF5_ENABLE_F2003 "Enable FORTRAN 2003 Standard" OFF - ----------------- HDF5 Advanced Options --------------------- -HDF5_DISABLE_COMPILER_WARNINGS "Disable compiler warnings" OFF -HDF5_Enable_Clear_File_Buffers "Securely clear file buffers before writing to file" ON -HDF5_Enable_Instrument "Instrument The library" HDF5_Enable_Instrument -HDF5_ENABLE_CODESTACK "Enable the function stack tracing (for developer debugging)." OFF -HDF5_ENABLE_COVERAGE "Enable code coverage for Libraries and Programs" OFF -HDF5_ENABLE_DEPRECATED_SYMBOLS "Enable deprecated public API symbols" ON -HDF5_ENABLE_EMBEDDED_LIBINFO "embed library info into executables" ON -HDF5_ENABLE_GPFS "Enable GPFS hints for the MPI/POSIX file driver" OFF -HDF5_ENABLE_HSIZET "Enable datasets larger than memory" ON -HDF5_ENABLE_LARGE_FILE "Enable support for large (64-bit) files on Linux." ON -HDF5_ENABLE_PARALLEL "Enable parallel build (requires MPI)" OFF -HDF5_ENABLE_TRACE "Enable API tracing capability" OFF -HDF5_ENABLE_USING_MEMCHECKER "Indicate that a memory checker is used" OFF -HDF5_METADATA_TRACE_FILE "Enable metadata trace file collection" OFF -HDF5_NO_PACKAGES "Do not include CPack Packaging" OFF -HDF5_PACKAGE_EXTLIBS "CPACK - include external libraries" OFF -HDF5_STRICT_FORMAT_CHECKS "Whether to perform strict file format checks" OFF -HDF5_TEST_VFD "Execute tests with different VFDs" OFF -HDF5_USE_16_API_DEFAULT "Use the HDF5 1.6.x API by default" OFF -HDF5_USE_18_API_DEFAULT "Use the HDF5 1.8.x API by default" OFF -HDF5_USE_FOLDERS "Enable folder grouping of projects in IDEs." OFF -HDF5_WANT_DATA_ACCURACY "IF data accuracy is guaranteed during data conversions" ON -HDF5_WANT_DCONV_EXCEPTION "exception handling functions is checked during data conversions" ON -IF (APPLE) - HDF5_BUILD_WITH_INSTALL_NAME "Build with library install_name set to the installation path" OFF -IF (CMAKE_BUILD_TYPE MATCHES Debug) - HDF5_ENABLE_TRACE "Enable API tracing capability" ON -IF (HDF5_TEST_VFD) - HDF5_TEST_FHEAP_VFD "Execute fheap test with different VFDs" ON -IF (WIN32 AND NOT CYGWIN) - HDF_LEGACY_NAMING "Use Legacy Names for Libraries and Programs" OFF -HDF5_ENABLE_THREADSAFE "Enable Threadsafety" OFF - ----------------- External Library Options --------------------- -HDF5_ALLOW_EXTERNAL_SUPPORT "Allow External Library Building" "NO" -HDF5_ENABLE_SZIP_SUPPORT "Use SZip Filter" OFF -HDF5_ENABLE_Z_LIB_SUPPORT "Enable Zlib Filters" OFF -ZLIB_USE_EXTERNAL "Use External Library Building for ZLIB" 0 -SZIP_USE_EXTERNAL "Use External Library Building for SZIP" 0 -HDF5_USE_FILTER_FLETCHER32 "Use the FLETCHER32 Filter" ON -HDF5_USE_FILTER_NBIT "Use the NBIT Filter" ON -HDF5_USE_FILTER_SCALEOFFSET "Use the SCALEOFFSET Filter" ON -HDF5_USE_FILTER_SHUFFLE "Use the SHUFFLE Filter" ON -IF (HDF5_ENABLE_SZIP_SUPPORT) - HDF5_ENABLE_SZIP_ENCODING "Use SZip Encoding" OFF - - -************************************************************************ - APPENDIX - -Below are examples of the ctest scripts used by The HDF Group. -See the script, cmakehdf5, in the bin folder for a smaller and limited -function shell script version of the following general scripts. -The example is for a linux machine, but the same scripts can be used on -a windows machine by adjusting the CTEST_CMAKE_GENERATOR option in the -product specific script. - -************************************************************************ - -CTestScript.cmake: common ctest script used to build, test and package -======================================================================== - -cmake_minimum_required(VERSION 2.8.6 FATAL_ERROR) -######################################################## -# This dashboard is maintained by The HDF Group -# For any comments please contact cdashhelp@hdfgroup.org -# -######################################################## -# ----------------------------------------------------------- -# -- Get environment -# ----------------------------------------------------------- -if(NOT SITE_OS_NAME) - ## machine name not provided - attempt to discover with uname - ## -- set hostname - ## -------------------------- - find_program(HOSTNAME_CMD NAMES hostname) - exec_program(${HOSTNAME_CMD} ARGS OUTPUT_VARIABLE HOSTNAME) - set(CTEST_SITE "${HOSTNAME}${CTEST_SITE_EXT}") - find_program(UNAME NAMES uname) - macro(getuname name flag) - exec_program("${UNAME}" ARGS "${flag}" OUTPUT_VARIABLE "${name}") - endmacro(getuname) - - getuname(osname -s) - getuname(osrel -r) - getuname(cpu -m) - message("Dashboard script uname output: ${osname}-${osrel}-${cpu}\n") - - set(CTEST_BUILD_NAME "${osname}-${osrel}-${cpu}") - if(USE_AUTOTOOLS) - set(CTEST_BUILD_NAME "AT-${CTEST_BUILD_NAME}") - endif(USE_AUTOTOOLS) - if(SITE_BUILDNAME_SUFFIX) - set(CTEST_BUILD_NAME "${CTEST_BUILD_NAME}-${SITE_BUILDNAME_SUFFIX}") - endif(SITE_BUILDNAME_SUFFIX) - set(BUILD_OPTIONS "${ADD_BUILD_OPTIONS}") -else(NOT SITE_OS_NAME) - ## machine name provided - ## -------------------------- - if(CMAKE_HOST_UNIX) - set(CTEST_BUILD_NAME "${SITE_OS_NAME}-${SITE_OS_VERSION}-${SITE_OS_BITS}-${SITE_COMPILER_NAME}-${SITE_COMPILER_VERSION}") - else(CMAKE_HOST_UNIX) - set(CTEST_BUILD_NAME "${SITE_OS_NAME}-${SITE_OS_VERSION}-${SITE_COMPILER_NAME}") - endif(CMAKE_HOST_UNIX) - if(SITE_BUILDNAME_SUFFIX) - set(CTEST_BUILD_NAME ${CTEST_BUILD_NAME}-${SITE_BUILDNAME_SUFFIX}) - endif() - set(BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DSITE:STRING=${CTEST_SITE} -DBUILDNAME:STRING=${CTEST_BUILD_NAME}") -endif(NOT SITE_OS_NAME) - -#----------------------------------------------------------------------------- -# MAC machines need special option -#----------------------------------------------------------------------------- -if(APPLE) - # Compiler choice - execute_process(COMMAND xcrun --find cc OUTPUT_VARIABLE XCODE_CC OUTPUT_STRIP_TRAILING_WHITESPACE) - execute_process(COMMAND xcrun --find c++ OUTPUT_VARIABLE XCODE_CXX OUTPUT_STRIP_TRAILING_WHITESPACE) - SET(ENV{CC} "${XCODE_CC}") - SET(ENV{CXX} "${XCODE_CXX}") - # Shared fortran is not supported, build static - set (BUILD_OPTIONS "${BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=OFF -DCMAKE_ANSI_CFLAGS:STRING=-fPIC") - set(BUILD_OPTIONS "${BUILD_OPTIONS} -DCTEST_USE_LAUNCHERS:BOOL=ON -DCMAKE_BUILD_WITH_INSTALL_RPATH:BOOL=OFF") -endif(APPLE) - -#----------------------------------------------------------------------------- -## cygwin does not handle the find_package() call -## -------------------------- -if(NOT SITE_CYGWIN}) - find_package (Subversion) - set(CTEST_UPDATE_COMMAND "${Subversion_SVN_EXECUTABLE}") -else(NOT SITE_CYGWIN}) - set(CTEST_UPDATE_COMMAND "/usr/bin/svn") -endif(NOT SITE_CYGWIN}) - -#----------------------------------------------------------------------------- -set(NEED_REPOSITORY_CHECKOUT 0) -set(CTEST_CMAKE_COMMAND "\"${CMAKE_COMMAND}\"") -if (CTEST_USE_TAR_SOURCE) - ## Uncompress source if tar file provided - ## -------------------------- - if(WIN32) - set(CTEST_7Z_COMMAND "C:/Program Files/7-Zip/7z.exe") - message("extracting... [${CTEST_7Z_COMMAND} x ${CTEST_USE_TAR_SOURCE}.zip]") - execute_process(COMMAND ${CTEST_7Z_COMMAND} x ${CTEST_USE_TAR_SOURCE}.zip RESULT_VARIABLE rv) - else(WIN32) - message("extracting... [${CTEST_CMAKE_COMMAND} -E tar -xvf ${CTEST_USE_TAR_SOURCE}.tar]") - execute_process(COMMAND tar -xvf ${CTEST_USE_TAR_SOURCE}.tar RESULT_VARIABLE rv) - endif(WIN32) - - if(NOT rv EQUAL 0) - message("extracting... [error-(${rv}) clean up]") - file(REMOVE_RECURSE "${CTEST_SOURCE_DIRECTORY}") - message(FATAL_ERROR "error: extract of ${CTEST_USE_TAR_SOURCE} failed") - endif(NOT rv EQUAL 0) - - file(RENAME ${CTEST_USE_TAR_SOURCE} ${CTEST_SOURCE_DIRECTORY}) - set(LOCAL_SKIP_UPDATE "TRUE") -else (CTEST_USE_TAR_SOURCE) - ## use subversion to get source - ## -------------------------- - if (NOT EXISTS "${CTEST_SOURCE_DIRECTORY}") - set (NEED_REPOSITORY_CHECKOUT 1) - endif (NOT EXISTS "${CTEST_SOURCE_DIRECTORY}") - - if (${NEED_REPOSITORY_CHECKOUT}) - set (CTEST_CHECKOUT_COMMAND - "${CTEST_UPDATE_COMMAND} co ${REPOSITORY_URL} \"${CTEST_SOURCE_DIRECTORY}\" -r HEAD") - else (${NEED_REPOSITORY_CHECKOUT}) - set (CTEST_CHECKOUT_COMMAND "${CTEST_UPDATE_COMMAND} update") - endif (${NEED_REPOSITORY_CHECKOUT}) -endif (CTEST_USE_TAR_SOURCE) - -#----------------------------------------------------------------------------- -## Clear the build directory -## -------------------------- -set(CTEST_START_WITH_EMPTY_BINARY_DIRECTORY TRUE) -file(MAKE_DIRECTORY "${CTEST_BINARY_DIRECTORY}") -#include(${CTEST_SOURCE_DIRECTORY}/CTestConfig.cmake) -ctest_empty_binary_directory(${CTEST_BINARY_DIRECTORY}) - -# Use multiple CPU cores to build -include(ProcessorCount) -ProcessorCount(N) -if(NOT N EQUAL 0) - if(NOT WIN32) - set(CTEST_BUILD_FLAGS -j${N}) - endif(NOT WIN32) - set(ctest_test_args ${ctest_test_args} PARALLEL_LEVEL ${N}) -endif() - -#----------------------------------------------------------------------------- -# Send the main script as a note. -if(USE_AUTOTOOLS) - ## autotools builds need to use make and does not use the cacheinit.cmake file - ## -- make command - ## ----------------- - find_program(MAKE NAMES make) - - list(APPEND CTEST_NOTES_FILES - "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}" - "${CMAKE_CURRENT_LIST_FILE}" - ) -else(USE_AUTOTOOLS) - list(APPEND CTEST_NOTES_FILES - "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}" - "${CMAKE_CURRENT_LIST_FILE}" - "${CTEST_SOURCE_DIRECTORY}/config/cmake/cacheinit.cmake" - ) -endif(USE_AUTOTOOLS) - -#----------------------------------------------------------------------------- -# Check for required variables. -# -------------------------- -foreach(req - CTEST_CMAKE_GENERATOR - CTEST_SITE - CTEST_BUILD_NAME - ) - if(NOT DEFINED ${req}) - message(FATAL_ERROR "The containing script must set ${req}") - endif(NOT DEFINED ${req}) -endforeach(req) - -#----------------------------------------------------------------------------- -# Initialize the CTEST commands -#------------------------------ -if(USE_AUTOTOOLS) - set(CTEST_CONFIGURE_COMMAND "${CTEST_SOURCE_DIRECTORY}/configure ${ADD_BUILD_OPTIONS}") - set(CTEST_BUILD_COMMAND "${MAKE} ${CTEST_BUILD_FLAGS}") - ## -- CTest Config - #configure_file($ENV{HOME}/CTestConfiguration/CTestConfig.cmake ${CTEST_SOURCE_DIRECTORY}/CTestConfig.cmake) - configure_file(${CTEST_SOURCE_DIRECTORY}/config/cmake/CTestCustom.cmake ${CTEST_BINARY_DIRECTORY}/CTestCustom.cmake) - ## -- CTest Testfile -# configure_file(${CTEST_SCRIPT_DIRECTORY}/CTestTestfile.cmake ${CTEST_BINARY_DIRECTORY}/CTestTestfile.cmake) - file(WRITE ${CTEST_BINARY_DIRECTORY}/CTestTestfile.cmake "ADD_TEST(makecheck \"${MAKE}\" \"${CTEST_BUILD_FLAGS}\" \"-i\" \"check\")") -else(USE_AUTOTOOLS) - if(LOCAL_MEMCHECK_TEST) - find_program(CTEST_MEMORYCHECK_COMMAND NAMES valgrind) - set (CTEST_CONFIGURE_COMMAND - "${CTEST_CMAKE_COMMAND} -C \"${CTEST_SOURCE_DIRECTORY}/config/cmake/mccacheinit.cmake\" -DCMAKE_BUILD_TYPE:STRING=${CTEST_BUILD_CONFIGURATION} ${BUILD_OPTIONS} \"-G${CTEST_CMAKE_GENERATOR}\" \"${CTEST_SOURCE_DIRECTORY}\"" - ) - else(LOCAL_MEMCHECK_TEST) - find_program(CTEST_COVERAGE_COMMAND NAMES gcov) - set (CTEST_CONFIGURE_COMMAND - "${CTEST_CMAKE_COMMAND} -C \"${CTEST_SOURCE_DIRECTORY}/config/cmake/cacheinit.cmake\" -DCMAKE_BUILD_TYPE:STRING=${CTEST_BUILD_CONFIGURATION} ${BUILD_OPTIONS} \"-G${CTEST_CMAKE_GENERATOR}\" \"${CTEST_SOURCE_DIRECTORY}\"" - ) - endif(LOCAL_MEMCHECK_TEST) -endif(USE_AUTOTOOLS) - -#----------------------------------------------------------------------------- -## -- set output to english -set($ENV{LC_MESSAGES} "en_EN") - -# Print summary information. -foreach(v - CTEST_SITE - CTEST_BUILD_NAME - CTEST_SOURCE_DIRECTORY - CTEST_BINARY_DIRECTORY - CTEST_CMAKE_GENERATOR - CTEST_BUILD_CONFIGURATION - CTEST_GIT_COMMAND - CTEST_CHECKOUT_COMMAND - CTEST_CONFIGURE_COMMAND - CTEST_SCRIPT_DIRECTORY - CTEST_USE_LAUNCHERS - ) - set(vars "${vars} ${v}=[${${v}}]\n") -endforeach(v) -message("Dashboard script configuration:\n${vars}\n") - -#----------------------------------------------------------------------------- -if(${MODEL} STREQUAL "Continuous") - ## Continuous mode is used for commit test processing - ## -------------------------- - while (${CTEST_ELAPSED_TIME} LESS 36000) - set(START_TIME ${CTEST_ELAPSED_TIME}) - CTEST_START (Continuous) - CTEST_UPDATE (SOURCE "${CTEST_SOURCE_DIRECTORY}" RETURN_VALUE res) - set (CTEST_CHECKOUT_COMMAND) # checkout on first iteration only - message("Dashboard updated files: ${res}\n") - if(res GREATER 0) - CTEST_CONFIGURE (BUILD "${CTEST_BINARY_DIRECTORY}") - CTEST_READ_CUSTOM_FILES ("${CTEST_BINARY_DIRECTORY}") - CTEST_SUBMIT (PARTS Update Configure Notes) - CTEST_BUILD (BUILD "${CTEST_BINARY_DIRECTORY}" APPEND) - CTEST_SUBMIT (PARTS Build) - CTEST_TEST (BUILD "${CTEST_BINARY_DIRECTORY}" APPEND ${ctest_test_args}) - CTEST_SUBMIT (PARTS Test) - - execute_process (COMMAND cpack -C ${CTEST_BUILD_CONFIGURATION} - WORKING_DIRECTORY ${CTEST_BINARY_DIRECTORY} - RESULT_VARIABLE cpackResult - OUTPUT_VARIABLE cpackLog - ERROR_VARIABLE cpackLog.err - ) - file (WRITE ${CTEST_BINARY_DIRECTORY}/cpack.log "${cpackLog.err}" "${cpackLog}") - endif(${res} GREATER 0) - - CTEST_SLEEP(${START_TIME} 300 ${CTEST_ELAPSED_TIME}) - endwhile (${CTEST_ELAPSED_TIME} LESS 36000) -#----------------------------------------------------------------------------- -else(${MODEL} STREQUAL "Continuous") -#----------------------------------------------------------------------------- - ## NORMAL process - ## -- LOCAL_SKIP_UPDATE skips updating the source folder from svn - ## -- LOCAL_NO_SUBMIT skips reporting to CDash server - ## -- LOCAL_SKIP_TEST skips the test process (only builds) - ## -- LOCAL_MEMCHECK_TEST executes the Valgrind testing - ## -- LOCAL_COVERAGE_TEST executes code coverage process - ## -------------------------- - CTEST_START (${MODEL} TRACK ${MODEL}) - if(NOT LOCAL_SKIP_UPDATE) - CTEST_UPDATE (SOURCE "${CTEST_SOURCE_DIRECTORY}") - endif(NOT LOCAL_SKIP_UPDATE) - CTEST_CONFIGURE (BUILD "${CTEST_BINARY_DIRECTORY}") - CTEST_READ_CUSTOM_FILES ("${CTEST_BINARY_DIRECTORY}") - if(NOT LOCAL_NO_SUBMIT) - CTEST_SUBMIT (PARTS Update Configure Notes) - endif(NOT LOCAL_NO_SUBMIT) - CTEST_BUILD (BUILD "${CTEST_BINARY_DIRECTORY}" APPEND) - if(NOT LOCAL_NO_SUBMIT) - CTEST_SUBMIT (PARTS Build) - endif(NOT LOCAL_NO_SUBMIT) - if(NOT LOCAL_SKIP_TEST) - if(NOT LOCAL_MEMCHECK_TEST) - CTEST_TEST (BUILD "${CTEST_BINARY_DIRECTORY}" APPEND ${ctest_test_args}) - if(NOT LOCAL_NO_SUBMIT) - CTEST_SUBMIT (PARTS Test) - endif(NOT LOCAL_NO_SUBMIT) - else(NOT LOCAL_MEMCHECK_TEST) - CTEST_MEMCHECK (BUILD "${CTEST_BINARY_DIRECTORY}" APPEND ${ctest_test_args}) - if(NOT LOCAL_NO_SUBMIT) - CTEST_SUBMIT (PARTS MemCheck) - endif(NOT LOCAL_NO_SUBMIT) - endif(NOT LOCAL_MEMCHECK_TEST) - if(LOCAL_COVERAGE_TEST) - CTEST_COVERAGE (BUILD "${CTEST_BINARY_DIRECTORY}" APPEND) - if(NOT LOCAL_NO_SUBMIT) - CTEST_SUBMIT (PARTS Coverage) - endif(NOT LOCAL_NO_SUBMIT) - endif(LOCAL_COVERAGE_TEST) - endif(NOT LOCAL_SKIP_TEST) - if(NOT LOCAL_MEMCHECK_TEST) - ##----------------------------------------------- - ## Package the product - ##----------------------------------------------- - execute_process(COMMAND cpack -C ${CTEST_BUILD_CONFIGURATION} -V - WORKING_DIRECTORY ${CTEST_BINARY_DIRECTORY} - RESULT_VARIABLE cpackResult - OUTPUT_VARIABLE cpackLog - ERROR_VARIABLE cpackLog.err - ) - file(WRITE ${CTEST_BINARY_DIRECTORY}/cpack.log "${cpackLog.err}" "${cpackLog}") - endif(NOT LOCAL_MEMCHECK_TEST) -endif(${MODEL} STREQUAL "Continuous") -#----------------------------------------------------------------------------- - -message("DONE:CTestScript") -************************************************************************ - -************************************************************************ -Product specific script, HDF518Static.cmake, that uses the -CTestScript.cmake file (see above). Usage: -"ctest -S HDF518Static.cmake,hdf518 -C Release -O hdf518static.log" -where hdf518 is the source folder relative to the location of these scripts -======================================================================== - -cmake_minimum_required(VERSION 2.8.6 FATAL_ERROR) - -# CTEST_SCRIPT_ARG is the source folder passed on the command line -set(CTEST_SOURCE_NAME ${CTEST_SCRIPT_ARG}) -set(CTEST_BINARY_NAME ${CTEST_SOURCE_NAME}/buildstatic) -set(CTEST_DASHBOARD_ROOT ${CTEST_SCRIPT_DIRECTORY}) -set(CTEST_SOURCE_DIRECTORY "${CTEST_DASHBOARD_ROOT}/${CTEST_SOURCE_NAME}") -set(CTEST_BINARY_DIRECTORY "${CTEST_DASHBOARD_ROOT}/${CTEST_BINARY_NAME}") -set(CTEST_BUILD_CONFIGURATION "Release") -set(MODEL "Experimental") - -# build generator name, see cmake generator list -set(CTEST_CMAKE_GENERATOR "Unix Makefiles") - -# machine description, can be removed on linux -set(CTEST_SITE "machine.domain") -set(SITE_OS_NAME "os name") -set(SITE_OS_VERSION "os version") -set(SITE_OS_BITS "os size") -set(SITE_COMPILER_NAME "compiler name") -set(SITE_COMPILER_VERSION "compiler version") - -# extra CDash build name description -set(SITE_BUILDNAME_SUFFIX "STATIC") - -# needed for source updates, change as required -set(REPOSITORY_URL "http://svn.hdfgroup.uiuc.edu/hdf5/branches/hdf5_1_8") - -# options to add/change from the cacheinit.cmake in the config/cmake folder -set(ADD_BUILD_OPTIONS "-DBUILD_SHARED_LIBS:BOOL=OFF -DCMAKE_INSTALL_PREFIX:PATH=/usr/local/hdf5.1.8_static") -set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DCMAKE_ANSI_CFLAGS:STRING=-fPIC -DHDF5_PACKAGE_EXTLIBS:BOOL=ON") -set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ALLOW_EXTERNAL_SUPPORT:STRING=\"SVN\"") - -# include common script file -include(${CTEST_SCRIPT_DIRECTORY}/CTestScript.cmake) - -message("DONE") - -************************************************************************ - -Need further assistance, send email to help@hdfgroup.org - diff --git a/release_docs/INSTALL_CMake.txt b/release_docs/INSTALL_CMake.txt new file mode 100644 index 0000000..95ebec9 --- /dev/null +++ b/release_docs/INSTALL_CMake.txt @@ -0,0 +1,804 @@ +************************************************************************ +* Build and Install HDF5 C/C++ Library with CMake * +************************************************************************ + + Table of Contents + +Section I: Quick Step Building HDF5 Libraries with CMake +Section II: Preconditions +Section III: Building HDF5 C/C++ Libraries with CMake +Section IV: All Options for HDF5 C/C++ Libraries with CMake +Section V: APPENDIX + +************************************************************************ + + + +======================================================================== +I. Quick Step Building HDF5 Libraries with CMake +======================================================================== +Notes: This short set of instructions is written for users who want to + quickly build the HDF5 Library and tools from the HDF5 source code + package using the CMake tools. + + A. Windows Quick Step Building HDF5 Libraries with CMake Using VS2010 + + Go through these steps: + + 1. Locate the source files in: + c:\MyHDFstuff\hdf5 + + 2. Create a build folder at: + c:\MyHDFstuff\hdf5\build + + 3. Open a command prompt at: + c:\MyHDFstuff\hdf5\build + + 4. Configure the C library, tools and tests with this command: + cmake -G "Visual Studio 10" -DBUILD_TESTING:BOOL=ON -DHDF5_BUILD_TOOLS:BOOL=ON .. + + 3. Build the C library, tools and tests with this command: + cmake --build . --config Release + + 4. Test the C library and tools with this command: + ctest . -C Release + + 5. Create an install image with this command: + cpack -C Release CPackConfig.cmake + + 6. Install with this command: + HDF5-1.8.11-win32.exe + + B. Linux Quick Step Building HDF5 Libraries with CMake Using GCC + + Go through these steps: + + 1. Locate the source files in: + ~\MyHDFstuff\hdf5 + + 2. Create a build folder at: + ~\MyHDFstuff\hdf5\build + + 3. Open a command prompt at: + ~\MyHDFstuff\hdf5\build + + 4. Configure the C library, tools and tests with this command: + cmake -G "Unix Makefiles" -DBUILD_TESTING:BOOL=ON -DHDF5_BUILD_TOOLS:BOOL=ON .. + + 3. Build the C library, tools and tests with this command: + cmake --build . --config Release + + 4. Test the C library and tools with this command: + ctest . -C Release + + 5. Create an install image with this command: + cpack -C Release CPackConfig.cmake + + 6. Install with this command: + HDF5-1.8.11-Linux.sh + + + + +======================================================================== +II. Preconditions +======================================================================== + + 1. We suggest you obtain the latest CMake for windows from the Kitware + web site. The HDF5 1.8.x product requires a minimum CMake version 2.8.10. + + 2. If you plan to use Zlib or Szip: + A. Download the packages and install them in a central location. + For example on Windows, create a folder extlibs and install the + packages there. + B. Use source packages from an SVN server by adding the following CMake + options: + HDF5_ALLOW_EXTERNAL_SUPPORT:STRING="SVN" + ZLIB_SVN_URL:STRING="http://some_location/zlib/trunk" + SZIP_SVN_URL:STRING="http://some_location/szip/trunk" + where "some_location" is the URL to the SVN repository. + C. Use source packages from a compressed file by adding the following + CMake options: + HDF5_ALLOW_EXTERNAL_SUPPORT:STRING="TGZ" + ZLIB_TGZ_NAME:STRING="zlib_src.ext" + SZIP_TGZ_NAME:STRING="szip_src.ext" + TGZ_PATH:STRING="some_location" + where "some_location" is the URL or full path to the compressed + file and ext is the type of compression file. + + 3. If you are building on Apple Darwin platforms, you should add the + following options: + Compiler choice - use xcode by setting the ENV variables of CC and CXX + Shared fortran is not supported, build static: + BUILD_SHARED_LIBS:BOOL=OFF + Additional options: + CMAKE_ANSI_CFLAGS:STRING=-fPIC + CTEST_USE_LAUNCHERS:BOOL=ON + CMAKE_BUILD_WITH_INSTALL_RPATH:BOOL=OFF + + 4. Windows developers should install NSIS to create an install image with CPack. + Visual Studio Express users will not be able to package HDF5 into + an install image executable. + + +Notes: More information about using CMake can be found at the KitWare site, + www.cmake.org. + + CMake uses the command line; however, the visual CMake tool is + recommended for the configuration step. The steps are similar for + all the operating systems supported by CMake. + + NOTES: + 1. Using CMake for building and using HDF5 is under active development. + While we have attempted to provide error-free files, please + understand that development with CMake has not been extensively + tested outside of HDF. The CMake specific files may change + before the next release. + + 2. CMake support for HDF5 development should be usable on any + system where CMake is supported. Please send us any comments on + how CMake support can be improved on any system. Visit the + KitWare site for more information about CMake. + + 3. Build and test results can be submitted to our CDash server at: + cdash.hdfgroup.uiuc.edu. + Please read the HDF and CDash document at: + www.hdfgroup.org/CDash/HowToSubmit. + + 4. See the appendix at the bottom of this file for examples of using + a ctest script for building and testing. + + + + +======================================================================== +III. Building HDF5 C/C++ Libraries with CMake +======================================================================== + +To build the HDF5 C/C++ Libraries with CMake, go through these five steps: + + 1. Run CMake + 2. Configure the cache settings + 3. Build HDF5 + 4. Test HDF5 + 5. Packaging HDF5 (create install image) + +These five steps are described in detail below. + +======================================================================== + + 1. Run CMake + + The CMake executable is named "cmake-gui.exe" on Windows and should be + available in your Start menu. For Linux, UNIX, and Mac users the + executable is named "cmake-gui" and can be found where CMake was + installed. + + Specify the source and build directories. + + ***** Make the build and source directories different. ****** + + For example on Windows, if the source is at c:\MyHDFstuff\hdf5, + then use c:\MyHDFstuff\hdf5\build or c:\MyHDFstuff\build\hdf5 as the + build directory. + + OPTIONAL: + Users can perform the configuration step without using the visual + cmake-gui program. We use the file cacheinit.cmake in the + config/cmake folder for our testing. This file enables all the + basic options and we turn specific options on or off for testing + using the following command line within the build directory: + + cmake -C /config/cmake/cacheinit.cmake -G "" [-D] + + Where is + * Borland Makefiles + * MSYS Makefiles + * MinGW Makefiles + * NMake Makefiles + * Unix Makefiles + * Visual Studio 11 + * Visual Studio 11 Win64 + * Visual Studio 10 + * Visual Studio 10 Win64 + * Visual Studio 6 + * Visual Studio 7 + * Visual Studio 7 .NET 2003 + * Visual Studio 8 2005 + * Visual Studio 8 2005 Win64 + * Visual Studio 9 2008 + * Visual Studio 9 2008 Win64 + + is: + * SZIP_INCLUDE_DIR:PATH= + * SZIP_LIBRARY:FILEPATH= + * ZLIB_INCLUDE_DIR:PATH= + * ZLIB_LIBRARY:FILEPATH= + * :BOOL=[ON | OFF] + + is: + # This is the CMakeCache file used by HDF Group for daily tests. + ######################## + # EXTERNAL cache entries + ######################## + SET (BUILD_SHARED_LIBS ON CACHE BOOL "Build Shared Libraries" FORCE) + SET (BUILD_TESTING ON CACHE BOOL "Build HDF5 Unit Testing" FORCE) + SET (HDF_PACKAGE_EXT "" CACHE STRING "Name of HDF package extension" FORCE) + SET (HDF5_BUILD_CPP_LIB ON CACHE BOOL "Build HDF5 C++ Library" FORCE) + SET (HDF5_BUILD_EXAMPLES ON CACHE BOOL "Build HDF5 Library Examples" FORCE) + SET (HDF5_BUILD_FORTRAN ON CACHE BOOL "Build FORTRAN support" FORCE) + SET (HDF5_ENABLE_F2003 OFF CACHE BOOL "Enable FORTRAN 2003 Standard" FORCE) + SET (HDF5_BUILD_HL_LIB ON CACHE BOOL "Build HIGH Level HDF5 Library" FORCE) + SET (HDF5_BUILD_TOOLS ON CACHE BOOL "Build HDF5 Tools" FORCE) + SET (HDF5_BUILD_GENERATORS OFF CACHE BOOL "Build Test Generators" FORCE) + SET (HDF5_ENABLE_Z_LIB_SUPPORT ON CACHE BOOL "Enable Zlib Filters" FORCE) + SET (HDF5_ENABLE_SZIP_SUPPORT ON CACHE BOOL "Use SZip Filter" FORCE) + SET (HDF5_ENABLE_SZIP_ENCODING ON CACHE BOOL "Use SZip Encoding" FORCE) + SET (HDF5_ENABLE_HSIZET ON CACHE BOOL "Enable datasets larger than memory" FORCE) + SET (HDF5_ENABLE_UNSUPPORTED OFF CACHE BOOL "Enable unsupported combinations of configuration options" FORCE) + SET (HDF5_ENABLE_DEPRECATED_SYMBOLS ON CACHE BOOL "Enable deprecated public API symbols" FORCE) + SET (HDF5_ENABLE_DIRECT_VFD OFF CACHE BOOL "Build the Direct I/O Virtual File Driver" FORCE) + SET (HDF5_ENABLE_PARALLEL OFF CACHE BOOL "Enable parallel build (requires MPI)" FORCE) + SET (MPIEXEC_MAX_NUMPROCS "3" CACHE STRING "Minimum number of processes for HDF parallel tests" FORCE) + SET (HDF5_BUILD_PARALLEL_ALL OFF CACHE BOOL "Build Parallel Programs" FORCE) + SET (HDF5_ENABLE_COVERAGE OFF CACHE BOOL "Enable code coverage for Libraries and Programs" FORCE) + SET (HDF5_ENABLE_USING_MEMCHECKER OFF CACHE BOOL "Indicate that a memory checker is used" FORCE) + SET (HDF5_DISABLE_COMPILER_WARNINGS OFF CACHE BOOL "Disable compiler warnings" FORCE) + SET (HDF5_USE_FOLDERS ON CACHE BOOL "Enable folder grouping of projects in IDEs." FORCE) + SET (HDF5_USE_16_API_DEFAULT OFF CACHE BOOL "Use the HDF5 1.6.x API by default" FORCE) + SET (HDF5_USE_18_API_DEFAULT OFF CACHE BOOL "Use the HDF5 1.8.x API by default" FORCE) + SET (HDF5_ENABLE_THREADSAFE OFF CACHE BOOL "(WINDOWS)Enable Threadsafety" FORCE) + SET (HDF5_PACKAGE_EXTLIBS OFF CACHE BOOL "(WINDOWS)CPACK - include external libraries" FORCE) + SET (HDF5_NO_PACKAGES OFF CACHE BOOL "CPACK - Disable packaging" FORCE) + SET (HDF5_ALLOW_EXTERNAL_SUPPORT "NO" CACHE STRING "Allow External Library Building" FORCE) + SET (ZLIB_SVN_URL "http://svn.hdfgroup.uiuc.edu/zlib/trunk" CACHE STRING "Use ZLib from HDF repository" FORCE) + SET (SZIP_SVN_URL "http://svn.hdfgroup.uiuc.edu/szip/trunk" CACHE STRING "Use SZip from HDF repository" FORCE) + SET (ZLIB_TGZ_NAME "ZLib.tar.gz" CACHE STRING "Use ZLib from compressed file" FORCE) + SET (SZIP_TGZ_NAME "SZip.tar.gz" CACHE STRING "Use SZip from compressed file" FORCE) + SET (ZLIB_PACKAGE_NAME "zlib" CACHE STRING "Name of ZLIB package" FORCE) + SET (SZIP_PACKAGE_NAME "szip" CACHE STRING "Name of SZIP package" FORCE) + + 2. Configure the cache settings + + 2.1 Click the Configure button. If this is the first time you are + running cmake-gui in this directory, you will be prompted for the + generator you wish to use (for example on Windows, Visual Studio 9 2008). + CMake will read in the CMakeLists.txt files from the source directory and + display options for the HDF5 project. After the first configure you + can adjust the cache settings and/or specify the locations of other programs. + + Any conflicts or new values will be highlighted by the configure + process in red. Once you are happy with all the settings and there are no + more values in red, click the Generate button to produce the appropriate + build files. + + On Windows, if you are using a Visual Studio generator, the solution and + project files will be created in the build folder. + + On linux, if you are using the Unix Makefiles generator, the Makefiles will + be created in the build folder. + + 2.2 Alternative command line example on Windows in c:\MyHDFstuff\hdf5\build directory: + + cmake -C ../config/cmake/cacheinit.cmake -G "Visual Studio 9 2008" \ + -DHDF5_ENABLE_SZIP_SUPPORT:BOOL=OFF -DHDF5_ENABLE_Z_LIB_SUPPORT:BOOL=OFF .. + + 2.3 On Windows, if you are using a Visual Studio Express version you must + be sure that the following two options are correctly set/unset: + + HDF5_NO_PACKAGES:BOOL=ON + HDF5_USE_FOLDERS:BOOL=OFF + + 3. Build HDF5 + + On Windows, you can build HDF5 using either the Visual Studio Environment + or the command line. The command line is used on linux, Unix, and Mac. + + To build from the command line, navigate to your build directory and + execute the following: + + cmake --build . --config {Debug | Release} + + NOTE: "--config {Debug | Release}" may be optional on your platform. We + recommend choosing either Debug or Release on Windows. + + 3.1 If you wish to use the Visual Studio environment, open the solution + file in your build directory. Be sure to select either Debug or + Release and build the solution. + + 3.2.1 The external libraries (zlib and szip) can be configured + to allow building the libraries by downloading from an SVN repository. + The option is 'HDF5_ALLOW_EXTERNAL_SUPPORT'; by adding the following + configuration option: + -DHDF5_ALLOW_EXTERNAL_SUPPORT:STRING="SVN" + + The options to control the SVN URL (config/cmake/cacheinit.cmake file) are: + ZLIB_SVN_URL:STRING="http://svn.hdfgroup.uiuc.edu/zlib/trunk" + SZIP_SVN_URL:STRING="http://svn.hdfgroup.uiuc.edu/szip/trunk" + These should be changed to your location. + + 3.2.2 Or the external libraries (zlib and szip) can be configured + to allow building the libraries by using a compressed file. + The option is 'HDF5_ALLOW_EXTERNAL_SUPPORT' and is enabled by + adding the following configuration option: + -DHDF5_ALLOW_EXTERNAL_SUPPORT:STRING="TGZ" + + The options to control the SVN URL (config/cmake/cacheinit.cmake + file) are: + ZLIB_TGZ_NAME:STRING="zlib_src.ext" + SZIP_TGZ_NAME:STRING="szip_src.ext" + TGZ_PATH:STRING="some_location" + where "some_location/xxxx_src.ext" is the URL or full path to + the compressed file and where ext is the type of the compression + file such as .bz2, .tar, .tar.gz, .tgz, or .zip. + + 4. Test HDF5 + + To test the build, navigate to your build directory and execute: + + ctest . -C {Debug | Release} + + NOTE: "-C {Debug | Release}" may be optional on your platform. We + recommend choosing either Debug or Release to match the build + step on Windows. + + 5. Packaging HDF5 (create an install image) + + To package the build into a simple installer using the NullSoft installer NSIS + on Windows, or into compressed files (.tar.gz, .sh, .zip), use the CPack tool. + + To package the build, navigate to your build directory and execute; + + cpack -C {Debug | Release} CPackConfig.cmake + + NOTE: See note 8 of this document for NSIS information. + Also, if you are using a Visual Studio Express version or do not + want to enable the packaging components, set HDF5_NO_PACKAGES + to ON (on the command line add -DHDF5_NO_PACKAGES:BOOL=ON) + + 6. The files that support building HDF5 with CMake are all the files in the + config/cmake folder, the CMakeLists.txt files in each source folder, and + CTestConfig.cmake. CTestConfig.cmake is specific to the internal testing + performed by The HDF Group. It should be altered for the user's + installation and needs. The cacheinit.cmake file settings are used by + The HDF Group for daily testing. It should be altered/ignored for the user's + installation and needs. + + 7. More information about using CMake can be found at the KitWare site, + www.cmake.org. + + 8. Nullsoft Scriptable Install System + The Nullsoft Scriptable Install System (NSIS) is an open source installation + system. It was created by the WinAmp authors to distribute that application, + but it is now a general-purpose system which anyone might use. NSIS installers + recognize /S for silent installation and /D=dir to specify the + "output directory", which is where the program will be installed. These + options are case-sensitive, so be sure to type them in upper case. + + + +======================================================================== +IV. All Options for HDF5 C/C++ Libraries with CMake +======================================================================== + +In the options listed below, there are three columns of information: +Option Name, Option Description, and Option Default. + +---------------- General Build Options --------------------- +BUILD_SHARED_LIBS "Build Shared Libraries" OFF +BUILD_STATIC_EXECS "Build Static Executabless" OFF +BUILD_STATIC_PIC "Build Static PIC" OFF +BUILD_TESTING "Build HDF5 Unit Testing" OFF + +---------------- HDF5 Build Options --------------------- +HDF5_BUILD_CPP_LIB "Build HDF5 C++ Library" OFF +HDF5_BUILD_EXAMPLES "Build HDF5 Library Examples" OFF +HDF5_BUILD_FORTRAN "Build FORTRAN support" OFF +HDF5_BUILD_HL_LIB "Build HIGH Level HDF5 Library" OFF +HDF5_BUILD_TOOLS "Build HDF5 Tools" OFF +IF (HDF5_BUILD_FORTRAN) + HDF5_ENABLE_F2003 "Enable FORTRAN 2003 Standard" OFF + +---------------- HDF5 Advanced Options --------------------- +HDF5_DISABLE_COMPILER_WARNINGS "Disable compiler warnings" OFF +HDF5_Enable_Clear_File_Buffers "Securely clear file buffers before writing to file" ON +HDF5_Enable_Instrument "Instrument The library" OFF +HDF5_ENABLE_CODESTACK "Enable the function stack tracing (for developer debugging)." OFF +HDF5_ENABLE_COVERAGE "Enable code coverage for Libraries and Programs" OFF +HDF5_ENABLE_DEPRECATED_SYMBOLS "Enable deprecated public API symbols" ON +HDF5_ENABLE_EMBEDDED_LIBINFO "embed library info into executables" ON +HDF5_ENABLE_GPFS "Enable GPFS hints for the MPI/POSIX file driver" OFF +HDF5_ENABLE_HSIZET "Enable datasets larger than memory" ON +HDF5_ENABLE_LARGE_FILE "Enable support for large (64-bit) files on Linux." ON +HDF5_ENABLE_PARALLEL "Enable parallel build (requires MPI)" OFF +HDF5_ENABLE_TRACE "Enable API tracing capability" OFF +HDF5_ENABLE_USING_MEMCHECKER "Indicate that a memory checker is used" OFF +HDF5_METADATA_TRACE_FILE "Enable metadata trace file collection" OFF +HDF5_NO_PACKAGES "Do not include CPack Packaging" OFF +HDF5_PACKAGE_EXTLIBS "CPACK - include external libraries" OFF +HDF5_STRICT_FORMAT_CHECKS "Whether to perform strict file format checks" OFF +HDF5_TEST_VFD "Execute tests with different VFDs" OFF +HDF5_USE_16_API_DEFAULT "Use the HDF5 1.6.x API by default" OFF +HDF5_USE_18_API_DEFAULT "Use the HDF5 1.8.x API by default" OFF +HDF5_USE_FOLDERS "Enable folder grouping of projects in IDEs." OFF +HDF5_WANT_DATA_ACCURACY "IF data accuracy is guaranteed during data conversions" ON +HDF5_WANT_DCONV_EXCEPTION "exception handling functions is checked during data conversions" ON +HDF5_ENABLE_THREADSAFE "Enable Threadsafety" OFF +IF (APPLE) + HDF5_BUILD_WITH_INSTALL_NAME "Build with library install_name set to the installation path" OFF +IF (CMAKE_BUILD_TYPE MATCHES Debug) + HDF5_ENABLE_TRACE "Enable API tracing capability" ON +IF (HDF5_TEST_VFD) + HDF5_TEST_FHEAP_VFD "Execute fheap test with different VFDs" ON +IF (WIN32 AND NOT CYGWIN) + HDF_LEGACY_NAMING "Use Legacy Names for Libraries and Programs" OFF + +---------------- External Library Options --------------------- +HDF5_ALLOW_EXTERNAL_SUPPORT "Allow External Library Building" "NO" +HDF5_ENABLE_SZIP_SUPPORT "Use SZip Filter" OFF +HDF5_ENABLE_Z_LIB_SUPPORT "Enable Zlib Filters" OFF +ZLIB_USE_EXTERNAL "Use External Library Building for ZLIB" 0 +SZIP_USE_EXTERNAL "Use External Library Building for SZIP" 0 +HDF5_USE_FILTER_FLETCHER32 "Use the FLETCHER32 Filter" ON +HDF5_USE_FILTER_NBIT "Use the NBIT Filter" ON +HDF5_USE_FILTER_SCALEOFFSET "Use the SCALEOFFSET Filter" ON +HDF5_USE_FILTER_SHUFFLE "Use the SHUFFLE Filter" ON +IF (HDF5_ENABLE_SZIP_SUPPORT) + HDF5_ENABLE_SZIP_ENCODING "Use SZip Encoding" OFF + + + +======================================================================== +V. APPENDIX +======================================================================== + +Below are examples of the ctest scripts used by The HDF Group. +See the script, cmakehdf5, in the bin folder for a smaller and limited +function shell script version of the following general scripts. +The example is for a linux machine, but the same scripts can be used on +a Windows machine by adjusting the CTEST_CMAKE_GENERATOR option in the +product specific script. + +CTestScript.cmake + + + +======================================================================== +CTestScript.cmake +======================================================================== + +The CTestScript.cmake script, shown below, is a common ctest script that +is used to build, test, and package HDF5 Library files. + + + +cmake_minimum_required(VERSION 2.8.10 FATAL_ERROR) +######################################################## +# This dashboard is maintained by The HDF Group +# For any comments please contact cdashhelp@hdfgroup.org +# +######################################################## +# ----------------------------------------------------------- +# -- Get environment +# ----------------------------------------------------------- +if(NOT SITE_OS_NAME) + ## machine name not provided - attempt to discover with uname + ## -- set hostname + ## -------------------------- + find_program(HOSTNAME_CMD NAMES hostname) + exec_program(${HOSTNAME_CMD} ARGS OUTPUT_VARIABLE HOSTNAME) + set(CTEST_SITE "${HOSTNAME}${CTEST_SITE_EXT}") + find_program(UNAME NAMES uname) + macro(getuname name flag) + exec_program("${UNAME}" ARGS "${flag}" OUTPUT_VARIABLE "${name}") + endmacro(getuname) + + getuname(osname -s) + getuname(osrel -r) + getuname(cpu -m) + message("Dashboard script uname output: ${osname}-${osrel}-${cpu}\n") + + set(CTEST_BUILD_NAME "${osname}-${osrel}-${cpu}") + if(USE_AUTOTOOLS) + set(CTEST_BUILD_NAME "AT-${CTEST_BUILD_NAME}") + endif(USE_AUTOTOOLS) + if(SITE_BUILDNAME_SUFFIX) + set(CTEST_BUILD_NAME "${CTEST_BUILD_NAME}-${SITE_BUILDNAME_SUFFIX}") + endif(SITE_BUILDNAME_SUFFIX) + set(BUILD_OPTIONS "${ADD_BUILD_OPTIONS}") +else(NOT SITE_OS_NAME) + ## machine name provided + ## -------------------------- + if(CMAKE_HOST_UNIX) + set(CTEST_BUILD_NAME "${SITE_OS_NAME}-${SITE_OS_VERSION}-${SITE_OS_BITS}-${SITE_COMPILER_NAME}-${SITE_COMPILER_VERSION}") + else(CMAKE_HOST_UNIX) + set(CTEST_BUILD_NAME "${SITE_OS_NAME}-${SITE_OS_VERSION}-${SITE_COMPILER_NAME}") + endif(CMAKE_HOST_UNIX) + if(SITE_BUILDNAME_SUFFIX) + set(CTEST_BUILD_NAME ${CTEST_BUILD_NAME}-${SITE_BUILDNAME_SUFFIX}) + endif() + set(BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DSITE:STRING=${CTEST_SITE} -DBUILDNAME:STRING=${CTEST_BUILD_NAME}") +endif(NOT SITE_OS_NAME) + +#----------------------------------------------------------------------------- +# MAC machines need special option +#----------------------------------------------------------------------------- +if(APPLE) + # Compiler choice + execute_process(COMMAND xcrun --find cc OUTPUT_VARIABLE XCODE_CC OUTPUT_STRIP_TRAILING_WHITESPACE) + execute_process(COMMAND xcrun --find c++ OUTPUT_VARIABLE XCODE_CXX OUTPUT_STRIP_TRAILING_WHITESPACE) + SET(ENV{CC} "${XCODE_CC}") + SET(ENV{CXX} "${XCODE_CXX}") + # Shared fortran is not supported, build static + set (BUILD_OPTIONS "${BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=OFF -DCMAKE_ANSI_CFLAGS:STRING=-fPIC") + set(BUILD_OPTIONS "${BUILD_OPTIONS} -DCTEST_USE_LAUNCHERS:BOOL=ON -DCMAKE_BUILD_WITH_INSTALL_RPATH:BOOL=OFF") +endif(APPLE) + +#----------------------------------------------------------------------------- +## cygwin does not handle the find_package() call +## -------------------------- +if(NOT SITE_CYGWIN}) + find_package (Subversion) + set(CTEST_UPDATE_COMMAND "${Subversion_SVN_EXECUTABLE}") +else(NOT SITE_CYGWIN}) + set(CTEST_UPDATE_COMMAND "/usr/bin/svn") +endif(NOT SITE_CYGWIN}) + +#----------------------------------------------------------------------------- +set(NEED_REPOSITORY_CHECKOUT 0) +set(CTEST_CMAKE_COMMAND "\"${CMAKE_COMMAND}\"") +if (CTEST_USE_TAR_SOURCE) + ## Uncompress source if tar file provided + ## -------------------------- + if(WIN32) + set(CTEST_7Z_COMMAND "C:/Program Files/7-Zip/7z.exe") + message("extracting... [${CTEST_7Z_COMMAND} x ${CTEST_USE_TAR_SOURCE}.zip]") + execute_process(COMMAND ${CTEST_7Z_COMMAND} x ${CTEST_USE_TAR_SOURCE}.zip RESULT_VARIABLE rv) + else(WIN32) + message("extracting... [${CTEST_CMAKE_COMMAND} -E tar -xvf ${CTEST_USE_TAR_SOURCE}.tar]") + execute_process(COMMAND tar -xvf ${CTEST_USE_TAR_SOURCE}.tar RESULT_VARIABLE rv) + endif(WIN32) + + if(NOT rv EQUAL 0) + message("extracting... [error-(${rv}) clean up]") + file(REMOVE_RECURSE "${CTEST_SOURCE_DIRECTORY}") + message(FATAL_ERROR "error: extract of ${CTEST_USE_TAR_SOURCE} failed") + endif(NOT rv EQUAL 0) + + file(RENAME ${CTEST_USE_TAR_SOURCE} ${CTEST_SOURCE_DIRECTORY}) + set(LOCAL_SKIP_UPDATE "TRUE") +else (CTEST_USE_TAR_SOURCE) + ## use subversion to get source + ## -------------------------- + if (NOT EXISTS "${CTEST_SOURCE_DIRECTORY}") + set (NEED_REPOSITORY_CHECKOUT 1) + endif (NOT EXISTS "${CTEST_SOURCE_DIRECTORY}") + + if (${NEED_REPOSITORY_CHECKOUT}) + set (CTEST_CHECKOUT_COMMAND + "${CTEST_UPDATE_COMMAND} co ${REPOSITORY_URL} \"${CTEST_SOURCE_DIRECTORY}\" -r HEAD") + else (${NEED_REPOSITORY_CHECKOUT}) + set (CTEST_CHECKOUT_COMMAND "${CTEST_UPDATE_COMMAND} update") + endif (${NEED_REPOSITORY_CHECKOUT}) +endif (CTEST_USE_TAR_SOURCE) + +#----------------------------------------------------------------------------- +## Clear the build directory +## -------------------------- +set(CTEST_START_WITH_EMPTY_BINARY_DIRECTORY TRUE) +file(MAKE_DIRECTORY "${CTEST_BINARY_DIRECTORY}") +#include(${CTEST_SOURCE_DIRECTORY}/CTestConfig.cmake) +ctest_empty_binary_directory(${CTEST_BINARY_DIRECTORY}) + +# Use multiple CPU cores to build +include(ProcessorCount) +ProcessorCount(N) +if(NOT N EQUAL 0) + if(NOT WIN32) + set(CTEST_BUILD_FLAGS -j${N}) + endif(NOT WIN32) + set(ctest_test_args ${ctest_test_args} PARALLEL_LEVEL ${N}) +endif() + +#----------------------------------------------------------------------------- +# Send the main script as a note. +if(USE_AUTOTOOLS) + ## autotools builds need to use make and does not use the cacheinit.cmake file + ## -- make command + ## ----------------- + find_program(MAKE NAMES make) + + list(APPEND CTEST_NOTES_FILES + "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}" + "${CMAKE_CURRENT_LIST_FILE}" + ) +else(USE_AUTOTOOLS) + list(APPEND CTEST_NOTES_FILES + "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}" + "${CMAKE_CURRENT_LIST_FILE}" + "${CTEST_SOURCE_DIRECTORY}/config/cmake/cacheinit.cmake" + ) +endif(USE_AUTOTOOLS) + +#----------------------------------------------------------------------------- +# Check for required variables. +# -------------------------- +foreach(req + CTEST_CMAKE_GENERATOR + CTEST_SITE + CTEST_BUILD_NAME + ) + if(NOT DEFINED ${req}) + message(FATAL_ERROR "The containing script must set ${req}") + endif(NOT DEFINED ${req}) +endforeach(req) + +#----------------------------------------------------------------------------- +# Initialize the CTEST commands +#------------------------------ +if(USE_AUTOTOOLS) + set(CTEST_CONFIGURE_COMMAND "${CTEST_SOURCE_DIRECTORY}/configure ${ADD_BUILD_OPTIONS}") + set(CTEST_BUILD_COMMAND "${MAKE} ${CTEST_BUILD_FLAGS}") + ## -- CTest Config + #configure_file($ENV{HOME}/CTestConfiguration/CTestConfig.cmake ${CTEST_SOURCE_DIRECTORY}/CTestConfig.cmake) + configure_file(${CTEST_SOURCE_DIRECTORY}/config/cmake/CTestCustom.cmake ${CTEST_BINARY_DIRECTORY}/CTestCustom.cmake) + ## -- CTest Testfile +# configure_file(${CTEST_SCRIPT_DIRECTORY}/CTestTestfile.cmake ${CTEST_BINARY_DIRECTORY}/CTestTestfile.cmake) + file(WRITE ${CTEST_BINARY_DIRECTORY}/CTestTestfile.cmake "ADD_TEST(makecheck \"${MAKE}\" \"${CTEST_BUILD_FLAGS}\" \"-i\" \"check\")") +else(USE_AUTOTOOLS) + if(LOCAL_MEMCHECK_TEST) + find_program(CTEST_MEMORYCHECK_COMMAND NAMES valgrind) + set (CTEST_CONFIGURE_COMMAND + "${CTEST_CMAKE_COMMAND} -C \"${CTEST_SOURCE_DIRECTORY}/config/cmake/mccacheinit.cmake\" -DCMAKE_BUILD_TYPE:STRING=${CTEST_BUILD_CONFIGURATION} ${BUILD_OPTIONS} \"-G${CTEST_CMAKE_GENERATOR}\" \"${CTEST_SOURCE_DIRECTORY}\"" + ) + else(LOCAL_MEMCHECK_TEST) + find_program(CTEST_COVERAGE_COMMAND NAMES gcov) + set (CTEST_CONFIGURE_COMMAND + "${CTEST_CMAKE_COMMAND} -C \"${CTEST_SOURCE_DIRECTORY}/config/cmake/cacheinit.cmake\" -DCMAKE_BUILD_TYPE:STRING=${CTEST_BUILD_CONFIGURATION} ${BUILD_OPTIONS} \"-G${CTEST_CMAKE_GENERATOR}\" \"${CTEST_SOURCE_DIRECTORY}\"" + ) + endif(LOCAL_MEMCHECK_TEST) +endif(USE_AUTOTOOLS) + +#----------------------------------------------------------------------------- +## -- set output to english +set($ENV{LC_MESSAGES} "en_EN") + +# Print summary information. +foreach(v + CTEST_SITE + CTEST_BUILD_NAME + CTEST_SOURCE_DIRECTORY + CTEST_BINARY_DIRECTORY + CTEST_CMAKE_GENERATOR + CTEST_BUILD_CONFIGURATION + CTEST_GIT_COMMAND + CTEST_CHECKOUT_COMMAND + CTEST_CONFIGURE_COMMAND + CTEST_SCRIPT_DIRECTORY + CTEST_USE_LAUNCHERS + ) + set(vars "${vars} ${v}=[${${v}}]\n") +endforeach(v) +message("Dashboard script configuration:\n${vars}\n") + +#----------------------------------------------------------------------------- +## NORMAL process +## -- LOCAL_SKIP_UPDATE skips updating the source folder from svn +## -- LOCAL_NO_SUBMIT skips reporting to CDash server +## -- LOCAL_SKIP_TEST skips the test process (only builds) +## -- LOCAL_MEMCHECK_TEST executes the Valgrind testing +## -- LOCAL_COVERAGE_TEST executes code coverage process +## -------------------------- +CTEST_START (${MODEL} TRACK ${MODEL}) +if(NOT LOCAL_SKIP_UPDATE) + CTEST_UPDATE (SOURCE "${CTEST_SOURCE_DIRECTORY}") +endif(NOT LOCAL_SKIP_UPDATE) +CTEST_CONFIGURE (BUILD "${CTEST_BINARY_DIRECTORY}") +CTEST_READ_CUSTOM_FILES ("${CTEST_BINARY_DIRECTORY}") +if(NOT LOCAL_NO_SUBMIT) + CTEST_SUBMIT (PARTS Update Configure Notes) +endif(NOT LOCAL_NO_SUBMIT) + CTEST_BUILD (BUILD "${CTEST_BINARY_DIRECTORY}" APPEND) +if(NOT LOCAL_NO_SUBMIT) + CTEST_SUBMIT (PARTS Build) +endif(NOT LOCAL_NO_SUBMIT) +if(NOT LOCAL_SKIP_TEST) + if(NOT LOCAL_MEMCHECK_TEST) + CTEST_TEST (BUILD "${CTEST_BINARY_DIRECTORY}" APPEND ${ctest_test_args}) + if(NOT LOCAL_NO_SUBMIT) + CTEST_SUBMIT (PARTS Test) + endif(NOT LOCAL_NO_SUBMIT) + else(NOT LOCAL_MEMCHECK_TEST) + CTEST_MEMCHECK (BUILD "${CTEST_BINARY_DIRECTORY}" APPEND ${ctest_test_args}) + if(NOT LOCAL_NO_SUBMIT) + CTEST_SUBMIT (PARTS MemCheck) + endif(NOT LOCAL_NO_SUBMIT) + endif(NOT LOCAL_MEMCHECK_TEST) + if(LOCAL_COVERAGE_TEST) + CTEST_COVERAGE (BUILD "${CTEST_BINARY_DIRECTORY}" APPEND) + if(NOT LOCAL_NO_SUBMIT) + CTEST_SUBMIT (PARTS Coverage) + endif(NOT LOCAL_NO_SUBMIT) + endif(LOCAL_COVERAGE_TEST) +endif(NOT LOCAL_SKIP_TEST) +if(NOT LOCAL_MEMCHECK_TEST) + ##----------------------------------------------- + ## Package the product + ##----------------------------------------------- + execute_process(COMMAND cpack -C ${CTEST_BUILD_CONFIGURATION} -V + WORKING_DIRECTORY ${CTEST_BINARY_DIRECTORY} + RESULT_VARIABLE cpackResult + OUTPUT_VARIABLE cpackLog + ERROR_VARIABLE cpackLog.err + ) + file(WRITE ${CTEST_BINARY_DIRECTORY}/cpack.log "${cpackLog.err}" "${cpackLog}") +endif(NOT LOCAL_MEMCHECK_TEST) +#----------------------------------------------------------------------------- +message("DONE:CTestScript") + + + +======================================================================== +ctest +======================================================================== + +Below is an example of the ctest script used by The HDF Group. The +CTestScript.cmake file used by this script is shown above. Adjust the values +as necessary. Note that the source folder is entered on the command line +and the build folder is created as a sub-folder. + + + +############################################################################ +# Product specific script, HDF518Static.cmake, that uses the +# CTestScript.cmake file (see above). Usage: +# "ctest -S HDF518Static.cmake,hdf518 -C Release -O hdf518static.log" +# where hdf518 is the source folder relative to the location of these scripts +############################################################################ + +cmake_minimum_required(VERSION 2.8.10 FATAL_ERROR) + +# CTEST_SCRIPT_ARG is the source folder passed on the command line +set(CTEST_DASHBOARD_ROOT ${CTEST_SCRIPT_DIRECTORY}) +set(CTEST_SOURCE_NAME ${CTEST_SCRIPT_ARG}) +set(CTEST_BINARY_NAME ${CTEST_SOURCE_NAME}/buildstatic) +set(CTEST_SOURCE_DIRECTORY "${CTEST_DASHBOARD_ROOT}/${CTEST_SOURCE_NAME}") +set(CTEST_BINARY_DIRECTORY "${CTEST_DASHBOARD_ROOT}/${CTEST_BINARY_NAME}") +set(CTEST_BUILD_CONFIGURATION "Release") +set(MODEL "Experimental") + +# build generator name, see cmake generator list +set(CTEST_CMAKE_GENERATOR "Unix Makefiles") + +# machine description, can be removed on linux +set(CTEST_SITE "machine.domain") +set(SITE_OS_NAME "os name") +set(SITE_OS_VERSION "os version") +set(SITE_OS_BITS "os size") +set(SITE_COMPILER_NAME "compiler name") +set(SITE_COMPILER_VERSION "compiler version") + +# extra CDash build name description +set(SITE_BUILDNAME_SUFFIX "STATIC") + +# needed for source updates, change as required +set(REPOSITORY_URL "http://svn.hdfgroup.uiuc.edu/hdf5/branches/hdf5_1_8") + +# options to add/change from the cacheinit.cmake in the config/cmake folder +set(ADD_BUILD_OPTIONS "-DBUILD_SHARED_LIBS:BOOL=OFF -DCMAKE_INSTALL_PREFIX:PATH=/usr/local/hdf5.1.8_static") +set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DCMAKE_ANSI_CFLAGS:STRING=-fPIC -DHDF5_PACKAGE_EXTLIBS:BOOL=ON") +set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ALLOW_EXTERNAL_SUPPORT:STRING=\"SVN\"") + +# include common script file +include(${CTEST_SCRIPT_DIRECTORY}/CTestScript.cmake) + +message("DONE") + + + +======================================================================== +For further assistance, send email to help@hdfgroup.org +======================================================================== + + + diff --git a/release_docs/INSTALL_Windows.txt b/release_docs/INSTALL_Windows.txt index 4344ea4..7873709 100644 --- a/release_docs/INSTALL_Windows.txt +++ b/release_docs/INSTALL_Windows.txt @@ -6,8 +6,11 @@ We now recommend that users build, test and install HDF5 using CMake. -Instructions for building and testing HDF5 using CMake can be found in -the CMake.txt file found in this folder. +Instructions for building and testing HDF5 using CMake can be found in the +INSTALL_CMake.txt file found in this folder. -The old INSTALL_Windows documentation can be found in the -obsolete_windows_docs\ folder located with this document. +For instructions of building and testing an application with HDF5, see +USING_HDF5_CMake.txt file found in this folder. + +Users who want to build and run an application with HDF5 in Visual Studio +without using CMake should consult the USING_HDF5_VS.txt file. diff --git a/release_docs/USING_CMake.txt b/release_docs/USING_CMake.txt deleted file mode 100644 index 0e980ea..0000000 --- a/release_docs/USING_CMake.txt +++ /dev/null @@ -1,272 +0,0 @@ -************************************************************************ -* Build and Install HDF5 Applications with CMake * -************************************************************************ - -Notes: This short instruction is written for users who want to quickly build - HDF5 Applications from the HDF5 Examples package using the CMake tools. - Users can adapt these instructions for their own applications, see the - "Minimum Project Files" section. - - More information about using CMake can be found at the KitWare site, - www.cmake.org. - - CMake uses the command line, however the visual CMake tool is - available for the configuration step. The steps are similar for - all the operating systems supported by CMake. - - NOTES: - 1. Using CMake for building and using HDF5 is under active development. - While we have attempted to provide error-free files, please - understand that development with CMake has not been extensively - tested outside of HDF. The CMake specific files may change - before the next release. - - 2. CMake was originally introduced to support development on Windows, - however it should be usable on any system where CMake is supported. - Please send us any comments on how CMake support can be improved on - any system. Visit the KitWare site for more information about CMake. - - 3. HDF5 library build and test results can be submitted to our CDash server at: - cdash.hdfgroup.uiuc.edu. - Please read the HDF and CDash document at: - www.hdfgroup.org/CDash/HowToSubmit. - - 4. See the appendix at the bottom of this file for an example of using - a ctest script for building and testing. See CMake.txt for more - information. - - -======================================================================== - Preconditions -======================================================================== - - 1. We suggest you obtain the latest CMake for windows from the Kitware - web site. The HDF5 1.8.x product requires CMake version 2.8.10 (minimum). - - 2. You have installed the HDF5 library built with CMake, by executing the - HDF Install Utility (The *.exe file in the binary package for Windows). - If you are using a Windows platform, you can obtain a pre-built Windows - binary from The HDF Group's website at www.hdfgroup.org. - - 3. On Windows with Visual Studio, if you have installed the static HDF5 - library, you will need to add the HDF5\lib folder to the library - search list. See the "Using Static Libraries with Visual Studio" section. - - 4. Set the environment variable HDF5_ROOT to the installed location of HDF5. - On Windows HDF5_ROOT=C:\Program Files\HDF Group\HDF5\hdf5-1.8.x - (Note there are no quote characters used on windows) - -======================================================================== - Building HDF5 Applications with CMake -======================================================================== - - 1. Run CMake - - The CMake executable is named "cmake-gui.exe" on Windows and should be - available in your Start menu. For Linux, UNIX, and Mac users the - executable is named "cmake-gui" and can be found where CMake was - installed. - Specify the source and build directories. It is recommended that you - choose a build directory different then the source directory - (for example on Windows, if the source is at c:\MyHDFstuff\hdf5, then - use c:\MyHDFstuff\hdf5\build or c:\MyHDFstuff\build\hdf5). - - OPTIONAL: - Users can perform the configuration step without using the visual cmake-gui - program. Example configuration step executed within the build directory: - - cmake -G "" [-D] - - Where is - * Borland Makefiles - * MSYS Makefiles - * MinGW Makefiles - * NMake Makefiles - * Unix Makefiles - * Visual Studio 10 - * Visual Studio 10 Win64 - * Visual Studio 6 - * Visual Studio 7 - * Visual Studio 7 .NET 2003 - * Visual Studio 8 2005 - * Visual Studio 8 2005 Win64 - * Visual Studio 9 2008 - * Visual Studio 9 2008 Win64 - - is: - * BUILD_TESTING:BOOL=ON - * USE_SHARED_LIBS:BOOL=[ON | OFF] - - 2. Configure the cache settings - - 2.1 Click the Configure button. If this is the first time you are - running cmake-gui in this directory, you will be prompted for the - generator you wish to use (for example on Windows, Visual Studio 9 2008). - CMake will read in the CMakeLists.txt files from the source directory and - display options for the HDF5 project. After the first configure you - can adjust the cache settings and/or specify locations of other programs. - - Any conflicts or new values will be highlighted by the configure - process in red. Once you are happy with all the settings and there are no - more values in red, click the Generate button to produce the appropriate - build files. - - On Windows, if you are using a Visual Studio generator, the solution and - project files will be created in the build folder. - - On linux, if you are using the Unix Makefiles generator, the Makefiles will - be created in the build folder. - - 2.2 Alternative command line example on Windows in c:\MyHDFstuff\hdf5\build directory: - - cmake -G "Visual Studio 9 2008" -DBUILD_TESTING:BOOL=ON -DUSE_SHARED_LIBS:BOOL=ON .. - - 3. Build HDF5 Applications - - On Windows, you can build HDF5 applications using either the Visual Studio Environment - or the command line. The command line is normally used on linux, Unix, and Mac. - - To build from the command line, navigate to your build directory and - execute the following; - - cmake --build . --config {Debug | Release} - - NOTE: "--config {Debug | Release}" may be optional on your platform. We - recommend choosing either Debug or Release on Windows. If you are - using the pre-built binaries from HDF, use Release. - - 3.1 If you wish to use the Visual Studio environment, open the solution - file in your build directory. Be sure to select either Debug or - Release and build the solution. - - 4. Test HDF5 Applications. - - To test the build, navigate to your build directory and execute; - - ctest . -C {Debug | Release} - - NOTE: "-C {Debug | Release}" may be optional on your platform. We - recommend choosing either Debug or Release to match the build - step on Windows. - - 6. The files that support building with CMake are all the files in the - config/cmake folder, the CMakeLists.txt files in each source folder, and - CTestConfig.cmake. CTestConfig.cmake is specific to the internal testing - performed by The HDF Group. It should be altered for the users - installation and needs. - - 7. More information about using CMake can be found at the KitWare site, - www.cmake.org. - - -======================================================================== - Using Visual Studio 2008 with HDF5 Libraries built with Visual Studio 2008 -======================================================================== - - 8. Set up path for external libraries and headers - - Invoke Microsoft Visual Studio and go to "Tools" and select "Options", - find "Projects", and then "VC++ Directories". - - 8.1 If you are building on 64-bit Windows, find the "Platform" dropdown - and select "x64". - - 8.2 Find the box "Show directories for", choose "Include files", add the - header path (i.e. c:\Program Files\HDF Group\HDF5\hdf5-1.8.x\include) - to the included directories. - - 8.3 Find the box "Show directories for", choose "Library files", add the - library path (i.e. c:\Program Files\HDF Group\HDF5\hdf5-1.8.x\lib) - to the library directories. - - 8.4 If using Fortran libraries, you will also need to setup the path - for the Intel Fortran compiler. - - -======================================================================== - Using Visual Studio 2010 with HDF5 Libraries built with Visual Studio 2010 -======================================================================== - - 9. Set up path for external libraries and headers - - The path settings will need to be in project property sheets per project. - Go to "Project" and select "Properties", find "Configuration Properties", - and then "VC++ Directories". - - 9.1 If you are building on 64-bit Windows, find the "Platform" dropdown - and select "x64". - - 9.2 Add the header path to the "Include Directories" setting. - - 9.3 Add the library path to the "Library Directories" setting. - - -======================================================================== - Minimum C Project Files for CMake -======================================================================== - - 10. Create a CMakeLists.txt file at the source root. -.......................................................................... -cmake_minimum_required (VERSION 2.8.10) -PROJECT (HDF5MyApp C CXX) - -FIND_PACKAGE (HDF5 REQURIED) -INCLUDE_DIRECTORIES (${HDF5_INCLUDE_DIRS}) -SET (LINK_LIBS ${LINK_LIBS} ${HDF5_LIBRARIES}) - -ADD_EXECUTABLE (hdf_example ${PROJECT_SOURCE_DIR}/hdf_example.c) -TARGET_LINK_LIBRARIES (hdf_example ${LINK_LIBS}) -.......................................................................... - - -************************************************************************ - APPENDIX - -Below ia an example of the ctest script used by The HDF Group. See the -Appendix in the CMake.txt file for the CTestScript.cmake file used by this -script. - -************************************************************************ -Product specific script, HDF518Example.cmake, that uses the -CTestScript.cmake file (see Appendix in the CMake.txt). Usage: -"ctest -S HDF518Example.cmake,hdf518Examples -C Release -O hdf518EX.log" -where hdf518Examples is the source folder relative to the location of these scripts -======================================================================== - -cmake_minimum_required(VERSION 2.8.6 FATAL_ERROR) - -set(CTEST_SOURCE_NAME ${CTEST_SCRIPT_ARG}) -set(CTEST_BINARY_NAME ${CTEST_SOURCE_NAME}/build) -set(CTEST_DASHBOARD_ROOT ${CTEST_SCRIPT_DIRECTORY}) -set(CTEST_SOURCE_DIRECTORY "${CTEST_DASHBOARD_ROOT}/${CTEST_SOURCE_NAME}") -set(CTEST_BINARY_DIRECTORY "${CTEST_DASHBOARD_ROOT}/${CTEST_BINARY_NAME}") -set(CTEST_BUILD_CONFIGURATION "Release") -set(MODEL "Experimental") - -# build generator name, see cmake generator list -set(CTEST_CMAKE_GENERATOR "Unix Makefiles") - -# machine description, can be removed on linux -set(CTEST_SITE "machine.domain") -set(SITE_OS_NAME "os name") -set(SITE_OS_VERSION "os version") -set(SITE_OS_BITS "os size") -set(SITE_COMPILER_NAME "compiler name") -set(SITE_COMPILER_VERSION "compiler version") - - -# needed for source updates, change as required -set(REPOSITORY_URL "http://svn.hdfgroup.uiuc.edu/hdf5-examples/trunk/1_8") - -set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DCMAKE_INSTALL_PREFIX:PATH=/usr/local/hdf5Examples-1.8") - -# location of the installed hdf5 (cmake configuration folder) -set(ENV{HDF5_DIR} "/usr/share/cmake/hdf5") - -include(${CTEST_SCRIPT_DIRECTORY}/CTestScript.cmake) - -message("DONE") - - -Need further assistance, send email to help@hdfgroup.org - diff --git a/release_docs/USING_HDF5_CMake.txt b/release_docs/USING_HDF5_CMake.txt new file mode 100644 index 0000000..2b3c02b --- /dev/null +++ b/release_docs/USING_HDF5_CMake.txt @@ -0,0 +1,279 @@ +************************************************************************ +* Build and Install HDF5 Applications with CMake * +************************************************************************ + +Notes: This short instruction is written for users who want to quickly + build HDF5 applications using the CMake tools. Users can adapt + these instructions for their own applications. For more information, + see the "Minimum C Project Files for CMake" section. + + More information about using CMake can be found at the KitWare + site, www.cmake.org. + + CMake uses the command line; however, the visual CMake tool is + available for the configuration step. The steps are similar for + all of the operating systems supported by CMake. + + NOTES: + 1. Using CMake for building and using HDF5 is under active + development. While we have attempted to provide error-free + files, please understand that development with CMake has not + been extensively tested outside of HDF. The CMake specific + files may change before the next release. + + 2. CMake for HDF5 development should be usable on any system + where CMake is supported. Please send us any comments on how + CMake support can be improved on any system. + + 3. See the appendix at the bottom of this file for an example + of using a ctest script for building and testing. See + CMake.txt for more information. + + + +======================================================================== +I. Preconditions +======================================================================== + + 1. We suggest you obtain the latest CMake for windows from the Kitware + web site. The HDF5 1.8.x product requires a minimum CMake version + of 2.8.10. + + 2. You have installed the HDF5 library built with CMake, by executing + the HDF Install Utility (the *.exe file in the binary package for + Windows). If you are using a Windows platform, you can obtain a + pre-built Windows binary from The HDF Group's website at + www.hdfgroup.org. + + 3. Set the environment variable HDF5_DIR to the installed location of + the config files for HDF5. On Windows: + HDF5_DIR=C:/Program Files/HDF_Group/HDF5/1.8.x/cmake/hdf5 + + (Note there are no quote characters used on Windows and all platforms + use forward slashes) + + 4. Created separate source and build directories. + (CMake commands are executed in the build directory) + + 5. Created a CMakeLists.txt file(s) for your source. See Section III + below. + + + +======================================================================== +II. Building HDF5 Applications with CMake +======================================================================== + +Go through these steps to build HDF5 applications with CMake. + + 1. Run CMake + 2. Configure the cache settings + 3. Build HDF5 Applications + 4. Test HDF5 Applications. + +These steps are described in more detail below. + + + + 1. Run CMake + + The CMake executable is named "cmake-gui.exe" on Windows and should be + available in your Start menu. For Linux, UNIX, and Mac users the + executable is named "cmake-gui" and can be found where CMake was + installed. + + Specify the source and build directories. Make the build and source + directories different. For example on Windows, if the source is at + c:\MyHDFstuff\hdf5, then use c:\MyHDFstuff\hdf5\build or + c:\MyHDFstuff\build\hdf5 for the build directory. + + OPTIONAL: + Users can perform the configuration step without using the visual + cmake-gui program. The following is an example command line + configuration step executed within the build directory: + + cmake -G "" [-D] + + Where is + * Borland Makefiles + * MSYS Makefiles + * MinGW Makefiles + * NMake Makefiles + * Unix Makefiles + * Visual Studio 11 + * Visual Studio 11 Win64 + * Visual Studio 10 + * Visual Studio 10 Win64 + * Visual Studio 6 + * Visual Studio 7 + * Visual Studio 7 .NET 2003 + * Visual Studio 8 2005 + * Visual Studio 8 2005 Win64 + * Visual Studio 9 2008 + * Visual Studio 9 2008 Win64 + + is: + * BUILD_TESTING:BOOL=ON + * USE_SHARED_LIBS:BOOL=[ON | OFF] + + 2. Configure the cache settings + + 2.1 Click the Configure button. If this is the first time you are + running cmake-gui in this directory, you will be prompted for the + generator you wish to use (for example on Windows, Visual Studio 9 2008). + CMake will read in the CMakeLists.txt files from the source directory and + display options for the HDF5 project. After the first configure you + can adjust the cache settings and/or specify locations of other programs. + + Any conflicts or new values will be highlighted by the configure + process in red. Once you are happy with all the settings and there are no + more values in red, click the Generate button to produce the appropriate + build files. + + On Windows, if you are using a Visual Studio generator, the solution and + project files will be created in the build folder. + + On linux, if you are using the Unix Makefiles generator, the Makefiles will + be created in the build folder. + + 2.2 Alternative command line example on Windows in c:\MyHDFstuff\hdf5\build directory: + + cmake -G "Visual Studio 9 2008" -DBUILD_TESTING:BOOL=ON -DUSE_SHARED_LIBS:BOOL=ON .. + + 3. Build HDF5 Applications + + On Windows, you can build HDF5 applications using either the Visual Studio Environment + or the command line. The command line is normally used on linux, Unix, and Mac. + + To build from the command line, navigate to your build directory and + execute the following: + + cmake --build . --config {Debug | Release} + + NOTE: "--config {Debug | Release}" may be optional on your platform. We + recommend choosing either Debug or Release on Windows. If you are + using the pre-built binaries from HDF, use Release. + + 3.1 If you wish to use the Visual Studio environment, open the solution + file in your build directory. Be sure to select either Debug or + Release and build the solution. + + 4. Test HDF5 Applications + + To test the build, navigate to your build directory and execute: + + ctest . -C {Debug | Release} + + NOTE: "-C {Debug | Release}" may be optional on your platform. We + recommend choosing either Debug or Release to match the build + step on Windows. + + 5. The files that support building with CMake are all of the files in the + config/cmake folder, the CMakeLists.txt files in each source folder, and + CTestConfig.cmake. CTestConfig.cmake is specific to the internal testing + performed by The HDF Group. It should be altered for the user's + installation and needs. The cacheinit.cmake file settings are used by + The HDF Group for daily testing. It should be altered/ignored for the user's + installation and needs. + + + +======================================================================== +III. Minimum C Project Files for CMake +======================================================================== + + 6. Create a CMakeLists.txt file at the source root. Include the + following text in the file: + +########################################################## +cmake_minimum_required (VERSION 2.8.10) +PROJECT (HDF5MyApp C CXX) + +FIND_PACKAGE (HDF5 NAMES hdf5) +# FIND_PACKAGE (HDF5) # Find non-cmake built HDF5 +INCLUDE_DIRECTORIES (${HDF5_INCLUDE_DIR}) +SET (LINK_LIBS ${LINK_LIBS} ${HDF5_LIBRARIES}) + +SET (example hdf_example) + +ADD_EXECUTABLE (${example} ${PROJECT_SOURCE_DIR}/${example}.c) +TARGET_LINK_LIBRARIES (${example} ${LINK_LIBS}) + +ENABLE_TESTING () +INCLUDE (CTest) + +ADD_TEST (NAME test_example COMMAND ${example}) +########################################################## + + + +======================================================================== +IV. APPENDIX +======================================================================== + +Below is an example of the ctest script used by The HDF Group. See the +Appendix in the INSTALL_CMake.txt file for the CTestScript.cmake file used +by this script. Adjust the values as necessary. Note that the source folder +is entered on the command line and the build folder is created as a sub-folder. +Windows should adjust the forward slash to double backslashes, except for +the HDF_DIR environment variable. + + + +======================================================================== +ctest +======================================================================== + +############################################################################ +# Product specific script, HDF518Example.cmake, that uses the +# CTestScript.cmake file (see Appendix in the CMake.txt). Usage: +# "ctest -S HDF518Example.cmake,hdf518Examples -C Release -O hdf518EX.log" +# where hdf518Examples is the source folder relative to the location of these scripts +############################################################################ + +cmake_minimum_required(VERSION 2.8.10 FATAL_ERROR) + +set(CTEST_DASHBOARD_ROOT ${CTEST_SCRIPT_DIRECTORY}) +set(CTEST_SOURCE_NAME ${CTEST_SCRIPT_ARG}) +set(CTEST_BINARY_NAME ${CTEST_SOURCE_NAME}/build) +set(CTEST_SOURCE_DIRECTORY "${CTEST_DASHBOARD_ROOT}/${CTEST_SOURCE_NAME}") +set(CTEST_BINARY_DIRECTORY "${CTEST_DASHBOARD_ROOT}/${CTEST_BINARY_NAME}") +set(CTEST_BUILD_CONFIGURATION "Release") +set(MODEL "Experimental") + +# build generator name, see cmake generator list +set(CTEST_CMAKE_GENERATOR "Unix Makefiles") + +# machine description, can be removed on linux +set(CTEST_SITE "machine.domain") +set(SITE_OS_NAME "os name") +set(SITE_OS_VERSION "os version") +set(SITE_OS_BITS "os size") +set(SITE_COMPILER_NAME "compiler name") +set(SITE_COMPILER_VERSION "compiler version") + +# skip submit to cdash +set(LOCAL_NO_SUBMIT "True") +# skip update source from repository +set(LOCAL_SKIP_UPDATE "True") + +# needed for source updates, change as required +set(REPOSITORY_URL "http://svn.hdfgroup.uiuc.edu/hdf5-examples/trunk/1_8") + +set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DCMAKE_INSTALL_PREFIX:PATH=/usr/local/hdf5Examples-1.8") + +# location of the installed hdf5 (cmake configuration folder) +set(ENV{HDF5_DIR} "/usr/share/cmake/hdf5") + +include(${CTEST_SCRIPT_DIRECTORY}/CTestScript.cmake) + +message("DONE") +################################################################################# + + + +======================================================================== +For further assistance, send email to help@hdfgroup.org +======================================================================== + + diff --git a/release_docs/USING_HDF5_VS.txt b/release_docs/USING_HDF5_VS.txt new file mode 100644 index 0000000..bd928bc --- /dev/null +++ b/release_docs/USING_HDF5_VS.txt @@ -0,0 +1,88 @@ + +*********************************************************************** +* HDF5 Build and Install Suggestions for Windows and Visual Studio * +* (Full Version) * +*********************************************************************** + +These suggestions are for Visual Studio users. + +Instructions for building and testing HDF5 applications using CMake can +be found in the USING_CMake.txt file found in this folder. + +The following two sections are helpful if you do not use CMake to build +your applications. + +======================================================================== +Using Visual Studio 2010 with HDF5 Libraries built with Visual Studio 2010 +======================================================================== + + 1. Set up path for external libraries and headers + + The path settings will need to be in project property sheets per project. + Go to "Project" and select "Properties", find "Configuration Properties", + and then "VC++ Directories". + + 1.1 If you are building on 64-bit Windows, find the "Platform" dropdown + and select "x64". + + 1.2 Add the header path to the "Include Directories" setting. + + 1.3 Add the library path to the "Library Directories" setting. + + 1.4 Select Linker->Input and beginning with the + "Additional Dependencies" line, enter the library names. The + external libraries should be listed first, followed by the HDF5 + library, and then optionally the HDF5 High Level, Fortran or C++ + libraries. For example, to compile a C++ application, enter: + + szip.lib zlib.lib hdf5dll.lib hdf5_cppdll.lib + + +========================================================================== +Using Visual Studio 2008 with HDF5 Libraries built with Visual Studio 2008 +========================================================================== + + 2. Set up path for external libraries and headers + + Invoke Microsoft Visual Studio and go to "Tools" and select "Options", + find "Projects", and then "VC++ Directories". + + 2.1 If you are building on 64-bit Windows, find the "Platform" dropdown + and select "x64". + + 2.2 Find the box "Show directories for", choose "Include files", add the + header path (i.e. c:\Program Files\HDF_Group\HDF5\1.8.x\include) + to the included directories. + + 2.3 Find the box "Show directories for", choose "Library files", add the + library path (i.e. c:\Program Files\HDF_Group\HDF5\1.8.x\lib) + to the library directories. + + 2.4 If using Fortran libraries, you will also need to setup the path + for the Intel Fortran compiler. + + 2.5 Select Project->Properties->Linker->Input and beginning with the + "Additional Dependencies" line, enter the library names. The + external libraries should be listed first, followed by the HDF5 + library, and then optionally the HDF5 High Level, Fortran or C++ + libraries. For example, to compile a C++ application, enter: + + szip.lib zlib.lib hdf5dll.lib hdf5_cppdll.lib + +======================================================================== +3. Helpful Pointers +======================================================================== + + 3.1 FAQ + + Many other common questions and hints are located online and being updated + in the HDF5 FAQ. For Windows-specific questions, please see: + + http://www.hdfgroup.org/windows/faq.html + + For all other general questions, you can look in the general FAQ: + + http://hdfgroup.org/HDF5-FAQ.html + +************************************************************************ + Please send email to help@hdfgroup.org for further assistance. diff --git a/release_docs/USING_Windows.txt b/release_docs/USING_Windows.txt deleted file mode 100644 index 97ac4ad..0000000 --- a/release_docs/USING_Windows.txt +++ /dev/null @@ -1,35 +0,0 @@ - -*********************************************************************** -* HDF5 Build and Install Instructions for Windows * -* (Full Version) * -*********************************************************************** - -We now recommend that users build, test and install HDF5 using CMake. - -Instructions for building and testing HDF5 applications using CMake can be found in -the USING_CMake.txt file found in this folder. - - -======================================================================== - Section VI: Misc. -======================================================================== - -1. Helpful Pointers - -Here are some helpful notes if you are not familiar with -using the Visual C++ Development Environment. - - 1.1 FAQ - - Many other common questions and hints are located online and being updated - in the HDF5 FAQ. For Windows-specific questions, please see: - - http://www.hdfgroup.org/windows/faq.html - - For all other general questions, you can look in the general FAQ: - - http://hdfgroup.org/HDF5-FAQ.html - - -************************************************************************ - Please send email to help@hdfgroup.org for further assistance. -- cgit v0.12 From 029e143471397de6ddc204be0c21f0c04ee5f2e2 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 29 Apr 2013 10:12:47 -0500 Subject: [svn-r23651] Add MPI configuration information to includes and libs --- config/cmake/hdf5-config.cmake.build.in | 10 +++++++++- config/cmake/hdf5-config.cmake.install.in | 18 +++++++++++++----- 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/config/cmake/hdf5-config.cmake.build.in b/config/cmake/hdf5-config.cmake.build.in index 881985e..fbe97ac 100644 --- a/config/cmake/hdf5-config.cmake.build.in +++ b/config/cmake/hdf5-config.cmake.build.in @@ -18,9 +18,17 @@ SET (HDF5_ENABLE_SZIP_ENCODING @HDF5_ENABLE_SZIP_ENCODING@) SET (HDF5_BUILD_SHARED_LIBS @BUILD_SHARED_LIBS@) #----------------------------------------------------------------------------- +# Dependencies +#----------------------------------------------------------------------------- +IF(HDF5_ENABLE_PARALLEL) + SET(HDF5_MPI_C_INCLUDE_PATH "@MPI_C_INCLUDE_PATH@") + SET(HDF5_MPI_C_LIBRARIES "@MPI_C_LIBRARIES@") +ENDIF(HDF5_ENABLE_PARALLEL) + +#----------------------------------------------------------------------------- # Directories #----------------------------------------------------------------------------- -SET (HDF5_INCLUDE_DIR "@HDF5_INCLUDES_BUILD_TIME@") +SET (HDF5_INCLUDE_DIR "@HDF5_INCLUDES_BUILD_TIME@" "${HDF5_MPI_C_INCLUDE_PATH}" ) IF (HDF5_BUILD_FORTRAN) SET (HDF5_INCLUDE_DIR_FORTRAN "@CMAKE_Fortran_MODULE_DIRECTORY@" ) diff --git a/config/cmake/hdf5-config.cmake.install.in b/config/cmake/hdf5-config.cmake.install.in index e3d8bfc..9c5a5a1 100644 --- a/config/cmake/hdf5-config.cmake.install.in +++ b/config/cmake/hdf5-config.cmake.install.in @@ -24,24 +24,32 @@ SET (HDF5_BUILD_SHARED_LIBS @BUILD_SHARED_LIBS@) SET (HDF5_PACKAGE_EXTLIBS @HDF5_PACKAGE_EXTLIBS@) #----------------------------------------------------------------------------- +# Dependencies +#----------------------------------------------------------------------------- +IF(HDF5_ENABLE_PARALLEL) + SET(HDF5_MPI_C_INCLUDE_PATH "@MPI_C_INCLUDE_PATH@") + SET(HDF5_MPI_C_LIBRARIES "@MPI_C_LIBRARIES@") +ENDIF(HDF5_ENABLE_PARALLEL) + +#----------------------------------------------------------------------------- # Directories #----------------------------------------------------------------------------- -SET (HDF5_INCLUDE_DIR "${_IMPORT_PREFIX}/include" ) +SET (HDF5_INCLUDE_DIR "${_IMPORT_PREFIX}/include" "${HDF5_MPI_C_INCLUDE_PATH}" ) IF (HDF5_BUILD_FORTRAN) - SET (HDF5_INCLUDE_DIR_FORTRAN "${_IMPORT_PREFIX}/include" ) + SET (HDF5_INCLUDE_DIR_FORTRAN "${_IMPORT_PREFIX}/include/fortran" ) ENDIF (HDF5_BUILD_FORTRAN) IF (HDF5_BUILD_CPP_LIB) - SET (HDF5_INCLUDE_DIR_CPP "${_IMPORT_PREFIX}/include" ) + SET (HDF5_INCLUDE_DIR_CPP "${_IMPORT_PREFIX}/include/cpp" ) ENDIF (HDF5_BUILD_CPP_LIB) IF (HDF5_BUILD_HL_LIB) - SET (HDF5_INCLUDE_DIR_HL "${_IMPORT_PREFIX}/include" ) + SET (HDF5_INCLUDE_DIR_HL "${_IMPORT_PREFIX}/include/hl" ) ENDIF (HDF5_BUILD_HL_LIB) IF (HDF5_BUILD_HL_LIB AND HDF5_BUILD_CPP_LIB) - SET (HDF5_INCLUDE_DIR_HL_CPP "${_IMPORT_PREFIX}/include" ) + SET (HDF5_INCLUDE_DIR_HL_CPP "${_IMPORT_PREFIX}/include/hl/cpp" ) ENDIF (HDF5_BUILD_HL_LIB AND HDF5_BUILD_CPP_LIB) IF (HDF5_BUILD_TOOLS) -- cgit v0.12 From bada3f7a86cb30b24fad3a24f88114861527ed58 Mon Sep 17 00:00:00 2001 From: Raymond Lu Date: Mon, 29 Apr 2013 14:23:04 -0500 Subject: [svn-r23656] Issue 8380 H5Zunregister caused seg fault: I added some protection measures: 1. If any opened object uses the filter, let it fail. 2. Flush all opened files to push any cached data to files. Tested with h5committest. --- MANIFEST | 1 + src/H5D.c | 47 ++++++++-- src/H5Dprivate.h | 1 + src/H5G.c | 46 +++++++++- src/H5Gprivate.h | 1 + src/H5I.c | 42 ++++++++- src/H5Iprivate.h | 1 + src/H5Pocpl.c | 37 ++++++++ src/H5Pprivate.h | 1 + src/H5Z.c | 163 ++++++++++++++++++++++++++++++++-- src/H5Zprivate.h | 1 + test/Makefile.am | 4 +- test/Makefile.in | 20 +++-- test/unregister.c | 258 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 14 files changed, 595 insertions(+), 28 deletions(-) create mode 100644 test/unregister.c diff --git a/MANIFEST b/MANIFEST index 8fd716a..944072a 100644 --- a/MANIFEST +++ b/MANIFEST @@ -1091,6 +1091,7 @@ ./test/tvlstr.c ./test/tvltypes.c ./test/unlink.c +./test/unregister.c ./test/vfd.c ./test/test_filters_le.h5 ./test/test_filters_be.h5 diff --git a/src/H5D.c b/src/H5D.c index d204712..d81d4c7 100644 --- a/src/H5D.c +++ b/src/H5D.c @@ -572,19 +572,56 @@ done: hid_t H5Dget_create_plist(hid_t dset_id) { - H5D_t *dset; /* Dataset structure */ + H5D_t *dataset; /* Dataset structure */ H5P_genplist_t *dcpl_plist; /* Dataset's DCPL */ H5P_genplist_t *new_plist; /* Copy of dataset's DCPL */ H5O_fill_t copied_fill; /* Fill value to tweak */ hid_t new_dcpl_id = FAIL; - hid_t ret_value; /* Return value */ + hid_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE1("i", "i", dset_id); /* Check args */ - if(NULL == (dset = (H5D_t *)H5I_object_verify(dset_id, H5I_DATASET))) + if(NULL == (dataset = (H5D_t *)H5I_object_verify(dset_id, H5I_DATASET))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset") + + if((ret_value = H5D_get_create_plist(dataset)) < 0) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset") + +done: + FUNC_LEAVE_API(ret_value) +} /* end H5Dget_create_plist() */ + + +/*------------------------------------------------------------------------- + * Function: H5D_get_create_plist + * + * Purpose: Private function for H5Dget_create_plist + * + * Return: Success: ID for a copy of the dataset creation + * property list. The template should be + * released by calling H5P_close(). + * + * Failure: FAIL + * + * Programmer: Robb Matzke + * Tuesday, February 3, 1998 + * + *------------------------------------------------------------------------- + */ +hid_t +H5D_get_create_plist(H5D_t *dset) +{ + H5P_genplist_t *dcpl_plist; /* Dataset's DCPL */ + H5P_genplist_t *new_plist; /* Copy of dataset's DCPL */ + H5O_fill_t copied_fill; /* Fill value to tweak */ + hid_t new_dcpl_id = FAIL; + hid_t ret_value; /* Return value */ + + FUNC_ENTER_NOAPI(FAIL) + + /* Check args */ if(NULL == (dcpl_plist = (H5P_genplist_t *)H5I_object(dset->shared->dcpl_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "can't get property list") @@ -670,8 +707,8 @@ done: if(H5I_dec_app_ref(new_dcpl_id) < 0) HDONE_ERROR(H5E_DATASET, H5E_CANTDEC, FAIL, "unable to close temporary object") - FUNC_LEAVE_API(ret_value) -} /* end H5Dget_create_plist() */ + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5D_get_create_plist() */ /*------------------------------------------------------------------------- diff --git a/src/H5Dprivate.h b/src/H5Dprivate.h index 1e2b91d..7adc231 100644 --- a/src/H5Dprivate.h +++ b/src/H5Dprivate.h @@ -162,6 +162,7 @@ H5_DLL H5O_loc_t *H5D_oloc(H5D_t *dataset); H5_DLL H5G_name_t *H5D_nameof(H5D_t *dataset); H5_DLL H5T_t *H5D_typeof(const H5D_t *dset); H5_DLL herr_t H5D_flush(const H5F_t *f, hid_t dxpl_id); +H5_DLL hid_t H5D_get_create_plist(H5D_t *dset); /* Functions that operate on vlen data */ H5_DLL herr_t H5D_vlen_reclaim(hid_t type_id, H5S_t *space, hid_t plist_id, diff --git a/src/H5G.c b/src/H5G.c index a0e7767..bd4ad9b 100644 --- a/src/H5G.c +++ b/src/H5G.c @@ -499,7 +499,7 @@ H5Gget_create_plist(hid_t group_id) htri_t ginfo_exists; htri_t linfo_exists; htri_t pline_exists; - H5G_t *grp = NULL; + H5G_t *group = NULL; H5P_genplist_t *gcpl_plist; H5P_genplist_t *new_plist; hid_t new_gcpl_id = FAIL; @@ -509,9 +509,47 @@ H5Gget_create_plist(hid_t group_id) H5TRACE1("i", "i", group_id); /* Check args */ - if(NULL == (grp = (H5G_t *)H5I_object_verify(group_id, H5I_GROUP))) + if(NULL == (group = (H5G_t *)H5I_object_verify(group_id, H5I_GROUP))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a group") + if((ret_value = H5G_get_create_plist(group)) < 0) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a group") + +done: + FUNC_LEAVE_API(ret_value) +} /* end H5Gget_create_plist() */ + + +/*------------------------------------------------------------------------- + * Function: H5G_get_create_plist + * + * Purpose: Private function for H5Gget_create_plist + * + * Return: Success: ID for a copy of the group creation + * property list. The property list ID should be + * released by calling H5Pclose(). + * + * Failure: FAIL + * + * Programmer: Quincey Koziol + * Tuesday, October 25, 2005 + * + *------------------------------------------------------------------------- + */ +hid_t +H5G_get_create_plist(H5G_t *grp) +{ + H5O_linfo_t linfo; /* Link info message */ + htri_t ginfo_exists; + htri_t linfo_exists; + htri_t pline_exists; + H5P_genplist_t *gcpl_plist; + H5P_genplist_t *new_plist; + hid_t new_gcpl_id = FAIL; + hid_t ret_value = FAIL; + + FUNC_ENTER_NOAPI(FAIL) + /* Copy the default group creation property list */ if(NULL == (gcpl_plist = (H5P_genplist_t *)H5I_object(H5P_LST_GROUP_CREATE_g))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "can't get default group creation property list") @@ -573,8 +611,8 @@ done: HDONE_ERROR(H5E_SYM, H5E_CANTDEC, FAIL, "can't free") } /* end if */ - FUNC_LEAVE_API(ret_value) -} /* end H5Gget_create_plist() */ + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5G_get_create_plist() */ /*------------------------------------------------------------------------- diff --git a/src/H5Gprivate.h b/src/H5Gprivate.h index f765b52..50f8bda 100644 --- a/src/H5Gprivate.h +++ b/src/H5Gprivate.h @@ -243,6 +243,7 @@ H5_DLL herr_t H5G_obj_remove_by_idx(const struct H5O_loc_t *grp_oloc, H5RS_str_t H5_index_t idx_type, H5_iter_order_t order, hsize_t n, hid_t dxpl_id); H5_DLL herr_t H5G_obj_lookup_by_idx(const struct H5O_loc_t *grp_oloc, H5_index_t idx_type, H5_iter_order_t order, hsize_t n, struct H5O_link_t *lnk, hid_t dxpl_id); +H5_DLL hid_t H5G_get_create_plist(H5G_t *grp); /* * These functions operate on symbol table nodes. diff --git a/src/H5I.c b/src/H5I.c index 581356e..6a8c269 100644 --- a/src/H5I.c +++ b/src/H5I.c @@ -2002,21 +2002,55 @@ H5Isearch(H5I_type_t type, H5I_search_func_t func, void *key) if(H5I_IS_LIB_TYPE(type)) HGOTO_ERROR(H5E_ATOM, H5E_BADGROUP, NULL, "cannot call public function on library type") + if((ret_value = H5I_search(type, func, key)) == NULL) + HGOTO_ERROR(H5E_ATOM, H5E_BADGROUP, NULL, "cannot call public function on library type") + +done: + FUNC_LEAVE_API(ret_value) +} /* end H5Isearch() */ + + +/*------------------------------------------------------------------------- + * Function: H5I_search + * + * Purpose: Private function for H5Isearch + * + * Return: Success: The first object in the type for which FUNC + * returns non-zero. NULL if FUNC returned zero + * for every object in the type. + * + * Failure: NULL + * + * Programmer: James Laird + * Nathaniel Furrer + * Friday, April 23, 2004 + * + *------------------------------------------------------------------------- + */ +void * +H5I_search(H5I_type_t _type, H5I_search_func_t _func, void *_key) +{ + H5I_search_ud_t udata; /* Context for iteration */ + void *ret_value; /* Return value */ + + FUNC_ENTER_NOAPI(NULL) + /* Set up udata struct */ - udata.app_cb = func; - udata.app_key = key; + udata.app_cb = _func; + udata.app_key = _key; udata.ret_obj = NULL; /* Note that H5I_iterate returns an error code. We ignore it * here, as we can't do anything with it without revising the API. */ - H5I_iterate(type, H5I_search_cb, &udata, TRUE); + if(H5I_iterate(_type, H5I_search_cb, &udata, TRUE) < 0) + HGOTO_ERROR(H5E_ATOM, H5E_BADGROUP, NULL, "cannot call public function on library type") /* Set return value */ ret_value = udata.ret_obj; done: - FUNC_LEAVE_API(ret_value) + FUNC_LEAVE_NOAPI(ret_value) } /* end H5Isearch() */ diff --git a/src/H5Iprivate.h b/src/H5Iprivate.h index ff1463d..28b6327 100644 --- a/src/H5Iprivate.h +++ b/src/H5Iprivate.h @@ -78,6 +78,7 @@ H5_DLL H5I_type_t H5I_get_type(hid_t id); H5_DLL hid_t H5I_get_file_id(hid_t obj_id, hbool_t app_ref); H5_DLL void *H5I_remove(hid_t id); H5_DLL void *H5I_remove_verify(hid_t id, H5I_type_t id_type); +H5_DLL void *H5I_search(H5I_type_t _type, H5I_search_func_t _func, void *_key); H5_DLL herr_t H5I_iterate(H5I_type_t type, H5I_search_func_t func, void *udata, hbool_t app_ref); H5_DLL int H5I_get_ref(hid_t id, hbool_t app_ref); H5_DLL int H5I_inc_ref(hid_t id, hbool_t app_ref); diff --git a/src/H5Pocpl.c b/src/H5Pocpl.c index 880b46a..f80e4e7 100644 --- a/src/H5Pocpl.c +++ b/src/H5Pocpl.c @@ -1177,6 +1177,43 @@ done: /*------------------------------------------------------------------------- + * Function: H5P_filter_in_pline + * + * Purpose: Check whether the filter is in the pipeline of the object + * creation property list. + * + * Return: TRUE: found + * FALSE: not found + * FAIL: error + * + * Programmer: Raymond Lu + * 26 April 2013 + * + *------------------------------------------------------------------------- + */ +htri_t +H5P_filter_in_pline(H5P_genplist_t *plist, H5Z_filter_t id) +{ + H5O_pline_t pline; /* Filter pipeline */ + H5Z_filter_info_t *filter; /* Pointer to filter information */ + htri_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI(FAIL) + + /* Get pipeline info */ + if(H5P_get(plist, H5O_CRT_PIPELINE_NAME, &pline) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get pipeline") + + /* Check if the file is in the pipeline */ + if((ret_value = H5Z_filter_in_pline(&pline, id)) < 0) + HGOTO_ERROR(H5E_PLINE, H5E_CANTCOMPARE, FAIL, "can't find filter") + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5P_get_filter_by_id() */ + + +/*------------------------------------------------------------------------- * Function: H5Premove_filter * * Purpose: Deletes a filter from the dataset creation property list; diff --git a/src/H5Pprivate.h b/src/H5Pprivate.h index 6560064..083619b 100644 --- a/src/H5Pprivate.h +++ b/src/H5Pprivate.h @@ -108,6 +108,7 @@ H5_DLL herr_t H5P_modify_filter(H5P_genplist_t *plist, H5Z_filter_t filter, H5_DLL herr_t H5P_get_filter_by_id(H5P_genplist_t *plist, H5Z_filter_t id, unsigned int *flags, size_t *cd_nelmts, unsigned cd_values[], size_t namelen, char name[], unsigned *filter_config); +H5_DLL htri_t H5P_filter_in_pline(H5P_genplist_t *plist, H5Z_filter_t id); /* *SPECIAL* Don't make more of these! -QAK */ H5_DLL htri_t H5P_isa_class(hid_t plist_id, hid_t pclass_id); diff --git a/src/H5Z.c b/src/H5Z.c index 9f8b59d..5d68c25 100644 --- a/src/H5Z.c +++ b/src/H5Z.c @@ -22,6 +22,7 @@ #include "H5private.h" /* Generic Functions */ #include "H5Dprivate.h" /* Dataset functions */ #include "H5Eprivate.h" /* Error handling */ +#include "H5Fprivate.h" /* File */ #include "H5Iprivate.h" /* IDs */ #include "H5MMprivate.h" /* Memory management */ #include "H5Oprivate.h" /* Object headers */ @@ -51,6 +52,9 @@ typedef enum { H5Z_PRELUDE_SET_LOCAL /* Call "set local" callback */ } H5Z_prelude_type_t; +/* Maximal number of the list of opened objects (2^16) */ +#define NUM_OBJS 65536 + /* Local variables */ static size_t H5Z_table_alloc_g = 0; static size_t H5Z_table_used_g = 0; @@ -403,33 +407,133 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Z_unregister (H5Z_filter_t id) +H5Z_unregister (H5Z_filter_t filter_id) { - size_t i; /* Local index variable */ + hid_t *file_list = NULL; + hid_t *obj_id_list = NULL; + size_t num_obj_id = 0; + size_t num_file_id = 0; + H5F_t *f = NULL; /* File to query */ + H5I_type_t id_type; + hid_t ocpl_id; + H5P_genplist_t *plist; /* Property list */ + size_t filter_index; /* Local index variable for filter */ + int i; + htri_t filter_in_pline = FALSE; herr_t ret_value=SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) - assert (id>=0 && id<=H5Z_FILTER_MAX); + assert (filter_id>=0 && filter_id<=H5Z_FILTER_MAX); /* Is the filter already registered? */ - for (i=0; i=H5Z_table_used_g) + if (filter_index>=H5Z_table_used_g) HGOTO_ERROR(H5E_PLINE, H5E_NOTFOUND, FAIL, "filter is not registered") + /* Count the number of opened datasets and groups among all opened files */ + if(H5F_get_obj_count(NULL, H5F_OBJ_DATASET | H5F_OBJ_GROUP, FALSE, &num_obj_id) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "can't get object number") + + if(num_obj_id) { + if(NULL == (obj_id_list = (hid_t *)H5MM_malloc(num_obj_id*sizeof(hid_t)))) + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "failed to allocate space") + + /* Find all opened objects that may use the filter (datasets and groups). Passing NULL as a pointer to + * file structure indicates searching among all opened files */ + if(H5F_get_obj_ids(NULL, H5F_OBJ_DATASET | H5F_OBJ_GROUP, num_obj_id, obj_id_list, FALSE, &num_obj_id) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "can't get object IDs") + } + + /* Check if any opened object (dataset or group) uses the filter. If so, fail with a message */ + for(i=0; i=0 && filter<=H5Z_FILTER_MAX); + + /* Locate the filter in the pipeline */ + for(idx=0; idxnused; idx++) + if(pline->filter[idx].id==filter) + break; + + /* Check if the filter was not already in the pipeline */ + if(idx>=pline->nused) + ret_value = FALSE; + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5Z_filter_in_pline() */ + + + +/*------------------------------------------------------------------------- * Function: H5Z_all_filters_avail * * Purpose: Verify that all the filters in a pipeline are currently diff --git a/src/H5Zprivate.h b/src/H5Zprivate.h index f53b50c..6c0a46f 100644 --- a/src/H5Zprivate.h +++ b/src/H5Zprivate.h @@ -91,6 +91,7 @@ H5_DLL herr_t H5Z_can_apply_direct(const struct H5O_pline_t *pline); H5_DLL herr_t H5Z_set_local_direct(const struct H5O_pline_t *pline); H5_DLL H5Z_filter_info_t *H5Z_filter_info(const struct H5O_pline_t *pline, H5Z_filter_t filter); +H5_DLL htri_t H5Z_filter_in_pline(const struct H5O_pline_t *pline, H5Z_filter_t filter); H5_DLL htri_t H5Z_all_filters_avail(const struct H5O_pline_t *pline); H5_DLL htri_t H5Z_filter_avail(H5Z_filter_t id); H5_DLL herr_t H5Z_delete(struct H5O_pline_t *pline, H5Z_filter_t filter); diff --git a/test/Makefile.am b/test/Makefile.am index ac5d169..5e476d3 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -46,7 +46,7 @@ TEST_PROG= testhdf5 lheap ohdr stab gheap cache cache_api cache_tagging \ big mtime fillval mount flush1 flush2 app_ref enum \ set_extent ttsafe enc_dec_plist enc_dec_plist_with_endianess\ getname vfd ntypes dangle dtransform reserved cross_read \ - freespace mf farray earray btree2 fheap file_image + freespace mf farray earray btree2 fheap file_image unregister # List programs to be built when testing here. error_test and err_compat are # built at the same time as the other tests, but executed by testerror.sh. @@ -150,7 +150,7 @@ CHECK_CLEANFILES+=accum.h5 cmpd_dset.h5 compact_dataset.h5 dataset.h5 dset_offse earray.h5 efc[0-5].h5 log_vfd_out.log \ new_multi_file_v16-r.h5 new_multi_file_v16-s.h5 \ split_get_file_image_test-m.h5 split_get_file_image_test-r.h5 \ - file_image_core_test.h5.copy + file_image_core_test.h5.copy unregister_filter_1.h5 unregister_filter_2.h5 # Sources for testhdf5 executable testhdf5_SOURCES=testhdf5.c tarray.c tattr.c tchecksum.c tconfig.c tfile.c \ diff --git a/test/Makefile.in b/test/Makefile.in index 65c0fca..e9e2faa 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -165,7 +165,8 @@ am__EXEEXT_1 = testhdf5$(EXEEXT) lheap$(EXEEXT) ohdr$(EXEEXT) \ vfd$(EXEEXT) ntypes$(EXEEXT) dangle$(EXEEXT) \ dtransform$(EXEEXT) reserved$(EXEEXT) cross_read$(EXEEXT) \ freespace$(EXEEXT) mf$(EXEEXT) farray$(EXEEXT) earray$(EXEEXT) \ - btree2$(EXEEXT) fheap$(EXEEXT) file_image$(EXEEXT) + btree2$(EXEEXT) fheap$(EXEEXT) file_image$(EXEEXT) \ + unregister$(EXEEXT) @HAVE_SHARED_CONDITIONAL_TRUE@am__EXEEXT_2 = plugin$(EXEEXT) am__EXEEXT_3 = gen_bad_ohdr$(EXEEXT) gen_bogus$(EXEEXT) \ gen_cross$(EXEEXT) gen_deflate$(EXEEXT) gen_filters$(EXEEXT) \ @@ -484,6 +485,10 @@ unlink_SOURCES = unlink.c unlink_OBJECTS = unlink.$(OBJEXT) unlink_LDADD = $(LDADD) unlink_DEPENDENCIES = libh5test.la $(LIBHDF5) +unregister_SOURCES = unregister.c +unregister_OBJECTS = unregister.$(OBJEXT) +unregister_LDADD = $(LDADD) +unregister_DEPENDENCIES = libh5test.la $(LIBHDF5) vfd_SOURCES = vfd.c vfd_OBJECTS = vfd.$(OBJEXT) vfd_LDADD = $(LDADD) @@ -539,7 +544,7 @@ SOURCES = $(libdynlib1_la_SOURCES) $(libdynlib2_la_SOURCES) \ mount.c mtime.c ntypes.c objcopy.c ohdr.c plugin.c pool.c \ reserved.c set_extent.c space_overflow.c stab.c \ tcheck_version.c $(testhdf5_SOURCES) testmeta.c \ - $(ttsafe_SOURCES) unlink.c vfd.c + $(ttsafe_SOURCES) unlink.c unregister.c vfd.c DIST_SOURCES = $(am__libdynlib1_la_SOURCES_DIST) \ $(am__libdynlib2_la_SOURCES_DIST) \ $(am__libdynlib3_la_SOURCES_DIST) $(libh5test_la_SOURCES) \ @@ -558,7 +563,7 @@ DIST_SOURCES = $(am__libdynlib1_la_SOURCES_DIST) \ mount.c mtime.c ntypes.c objcopy.c ohdr.c plugin.c pool.c \ reserved.c set_extent.c space_overflow.c stab.c \ tcheck_version.c $(testhdf5_SOURCES) testmeta.c \ - $(ttsafe_SOURCES) unlink.c vfd.c + $(ttsafe_SOURCES) unlink.c unregister.c vfd.c am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ @@ -879,7 +884,8 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog accum.h5 cmpd_dset.h5 \ objcopy_ext.dat trefer1.h5 trefer2.h5 app_ref.h5 farray.h5 \ earray.h5 efc[0-5].h5 log_vfd_out.log new_multi_file_v16-r.h5 \ new_multi_file_v16-s.h5 split_get_file_image_test-m.h5 \ - split_get_file_image_test-r.h5 file_image_core_test.h5.copy + split_get_file_image_test-r.h5 file_image_core_test.h5.copy \ + unregister_filter_1.h5 unregister_filter_2.h5 INCLUDES = -I$(top_srcdir)/src -I$(top_builddir)/src # Test script for error_test and err_compat @@ -902,7 +908,7 @@ TEST_PROG = testhdf5 lheap ohdr stab gheap cache cache_api cache_tagging \ big mtime fillval mount flush1 flush2 app_ref enum \ set_extent ttsafe enc_dec_plist enc_dec_plist_with_endianess\ getname vfd ntypes dangle dtransform reserved cross_read \ - freespace mf farray earray btree2 fheap file_image + freespace mf farray earray btree2 fheap file_image unregister # These programs generate test files for the tests. They don't need to be @@ -1303,6 +1309,9 @@ ttsafe$(EXEEXT): $(ttsafe_OBJECTS) $(ttsafe_DEPENDENCIES) $(EXTRA_ttsafe_DEPENDE unlink$(EXEEXT): $(unlink_OBJECTS) $(unlink_DEPENDENCIES) $(EXTRA_unlink_DEPENDENCIES) @rm -f unlink$(EXEEXT) $(AM_V_CCLD)$(LINK) $(unlink_OBJECTS) $(unlink_LDADD) $(LIBS) +unregister$(EXEEXT): $(unregister_OBJECTS) $(unregister_DEPENDENCIES) $(EXTRA_unregister_DEPENDENCIES) + @rm -f unregister$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(unregister_OBJECTS) $(unregister_LDADD) $(LIBS) vfd$(EXEEXT): $(vfd_OBJECTS) $(vfd_DEPENDENCIES) $(EXTRA_vfd_DEPENDENCIES) @rm -f vfd$(EXEEXT) $(AM_V_CCLD)$(LINK) $(vfd_OBJECTS) $(vfd_LDADD) $(LIBS) @@ -1421,6 +1430,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tvlstr.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tvltypes.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unlink.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unregister.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vfd.Po@am__quote@ .c.o: diff --git a/test/unregister.c b/test/unregister.c new file mode 100644 index 0000000..88f4d1b --- /dev/null +++ b/test/unregister.c @@ -0,0 +1,258 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * 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 files COPYING and Copyright.html. COPYING can be found at the root * + * of the source code distribution tree; Copyright.html can be found at the * + * root level of an installed copy of the electronic document set and is * + * linked from the top-level documents page. It can also be found at * + * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have access * + * to either file, you may request a copy from help@hdfgroup.org. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/* + * Programmer: Raymond Lu + * 24 April 2013 + * + * Purpose: Tests H5Zunregister function + */ +#include "h5test.h" + +const char *FILENAME[] = { + "unregister_filter_1", + "unregister_filter_2", + NULL +}; + +#define GROUP_NAME "group" +#define DSET_NAME "dataset" +#define FILENAME_BUF_SIZE 1024 +#define DSET_DIM1 100 +#define DSET_DIM2 200 +#define FILTER_CHUNK_DIM1 2 +#define FILTER_CHUNK_DIM2 25 +#define GROUP_ITERATION 1000 + +#define H5Z_FILTER_DUMMY 312 + +static size_t filter_dummy(unsigned int flags, size_t cd_nelmts, + const unsigned int *cd_values, size_t nbytes, size_t *buf_size, void **buf); + +/* Dummy filter for test_unregister_filters only */ +const H5Z_class2_t H5Z_DUMMY[1] = {{ + H5Z_CLASS_T_VERS, /* H5Z_class_t version */ + H5Z_FILTER_DUMMY, /* Filter id number */ + 1, 1, /* Encoding and decoding enabled */ + "dummy", /* Filter name for debugging */ + NULL, /* The "can apply" callback */ + NULL, /* The "set local" callback */ + filter_dummy, /* The actual filter function */ +}}; + + +/*------------------------------------------------------------------------- + * Function: filter_dummy + * + * Purpose: A dummy compression method that doesn't do anything. This + * filter is only for test_unregister_filters. Please don't + * use it for other tests because it may mess up this test. + * + * Return: Success: Data chunk size + * + * Failure: 0 + * + * Programmer: Raymond Lu + * April 24, 2013 + * + *------------------------------------------------------------------------- + */ +static size_t +filter_dummy(unsigned int UNUSED flags, size_t UNUSED cd_nelmts, + const unsigned int UNUSED *cd_values, size_t nbytes, + size_t UNUSED *buf_size, void UNUSED **buf) +{ + return nbytes; +} + +/*------------------------------------------------------------------------- + * Function: test_unregister_filters + * + * Purpose: Tests unregistering filter before closing the file + * + * Return: Success: 0 + * Failure: -1 + * + * Programmer: Raymond Lu + * 11 April 2013 + * + *------------------------------------------------------------------------- + */ +static herr_t +test_unregister_filters(hid_t my_fapl) +{ + hid_t file1, file2; + hid_t dc; + hid_t gcpl, gid, group; + hid_t dataset, space; + int i, j, n; + char gname[256]; + char filename[FILENAME_BUF_SIZE]; + const hsize_t chunk_size[2] = {FILTER_CHUNK_DIM1, FILTER_CHUNK_DIM2}; /* Chunk dimensions */ + hsize_t dims[2]; + int points[DSET_DIM1][DSET_DIM2]; + herr_t ret; + + TESTING("Unregistering filter"); + + /* Create first file */ + h5_fixname(FILENAME[0], my_fapl, filename, sizeof filename); + if((file1 = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, my_fapl)) < 0) goto error; + + /* Create second file */ + h5_fixname(FILENAME[1], my_fapl, filename, sizeof filename); + if((file2 = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, my_fapl)) < 0) goto error; + + /* Register DUMMY filter */ + if(H5Zregister(H5Z_DUMMY) < 0) goto error; + + if(H5Zfilter_avail(H5Z_FILTER_DUMMY)!=TRUE) goto error; + + if((gcpl = H5Pcreate(H5P_GROUP_CREATE)) < 0) goto error; + + /* Use DUMMY filter for creating groups */ + if(H5Pset_filter (gcpl, H5Z_FILTER_DUMMY, H5Z_FLAG_MANDATORY, (size_t)0, NULL) < 0) goto error; + + /* Create a group using this filter */ + if((gid = H5Gcreate2(file1, GROUP_NAME, H5P_DEFAULT, gcpl, H5P_DEFAULT)) < 0) goto error; + + /* Create multiple groups under the main group */ + for (i=0; i < GROUP_ITERATION; i++) { + sprintf(gname, "group_%d", i); + if((group = H5Gcreate2(gid, gname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto error; + if(H5Gclose(group) < 0) goto error; + } + + if(H5Fflush(file1, H5F_SCOPE_GLOBAL) < 0) goto error; + + /* Unregister the filter before closing the group. It should fail */ + H5E_BEGIN_TRY { + ret = H5Zunregister(H5Z_FILTER_DUMMY); + } H5E_END_TRY; + if(ret>=0) { + H5_FAILED(); + printf(" Line %d: Should not be able to unregister filter\n", __LINE__); + goto error; + } /* end if */ + + + /* Close the group */ + if(H5Gclose(gid) < 0) goto error; + + /* Clean up objects used for this test */ + if(H5Pclose (gcpl) < 0) goto error; + + if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error; + if(H5Pset_chunk (dc, 2, chunk_size) < 0) goto error; + + if(H5Pset_filter(dc, H5Z_FILTER_DUMMY, 0, (size_t)0, NULL) < 0) goto error; + + /* Initialize the dataset */ + for(i = n = 0; i < DSET_DIM1; i++) + for(j = 0; j < DSET_DIM2; j++) + points[i][j] = n++; + + /* Create the data space */ + dims[0] = DSET_DIM1; + dims[1] = DSET_DIM2; + if((space = H5Screate_simple(2, dims, NULL)) < 0) goto error; + + /* Create a dataset in the first file */ + if((dataset = H5Dcreate2(file1, DSET_NAME, H5T_NATIVE_INT, space, + H5P_DEFAULT, dc, H5P_DEFAULT)) < 0) goto error; + + /* Write the data to the dataset */ + if(H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, points) < 0) + goto error; + + /* Unregister the filter before closing the dataset. It should fail */ + /*if(H5Zunregister(H5Z_FILTER_DUMMY) < 0) goto error;*/ + H5E_BEGIN_TRY { + ret = H5Zunregister(H5Z_FILTER_DUMMY); + } H5E_END_TRY; + if(ret>=0) { + H5_FAILED(); + printf(" Line %d: Should not be able to unregister filter\n", __LINE__); + goto error; + } /* end if */ + + if(H5Dclose(dataset) < 0) goto error; + + /* Create a dataset in the second file */ + if((dataset = H5Dcreate2(file2, DSET_NAME, H5T_NATIVE_INT, space, + H5P_DEFAULT, dc, H5P_DEFAULT)) < 0) goto error; + + /* Write the data to the dataset */ + if(H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, points) < 0) + goto error; + + if(H5Dclose(dataset) < 0) goto error; + + /* Unregister the filter after closing all objects but before closing files. + * It should flush all files. */ + if(H5Zunregister(H5Z_FILTER_DUMMY) < 0) goto error; + + /* Clean up objects used for this test */ + if(H5Pclose (dc) < 0) goto error; + if(H5Fclose(file1) < 0) goto error; + if(H5Fclose(file2) < 0) goto error; + + PASSED(); + return 0; + +error: + return -1; +} + + +/*------------------------------------------------------------------------- + * Function: main + * + * Purpose: Tests unregistering filter with H5Zunregister + * + * Return: Success: exit(0) + * + * Failure: exit(1) + * + * Programmer: Raymond Lu + * 11 April 2013 + * + *------------------------------------------------------------------------- + */ +int +main(void) +{ + hid_t fapl; + int nerrors = 0; + + /* Testing setup */ + h5_reset(); + fapl = h5_fileaccess(); + + /* Test unregistering filter in its own file */ + nerrors += (test_unregister_filters(fapl) < 0 ? 1 : 0); + + if(nerrors) + goto error; + printf("All dataset tests passed.\n"); + h5_cleanup(FILENAME, fapl); + + return 0; + +error: + nerrors = MAX(1, nerrors); + printf("***** %d DATASET TEST%s FAILED! *****\n", + nerrors, 1 == nerrors ? "" : "S"); + return 1; +} + -- cgit v0.12 From 7d0aded13a6dd20f64c7c8e2977629e8551896b5 Mon Sep 17 00:00:00 2001 From: Albert Cheng Date: Thu, 2 May 2013 07:50:08 -0500 Subject: [svn-r23662] Bug fix: HDFFV-8236 Some files are not distributed when release tarball is created by bin/release according to MANIFEST. But --enable-build-all compiles them in test/. Solution: Distributed those missing files for now. Need to resolve if these files should be distributed or not. And if not, fix --enable-build-all NOT to compile them. Tested: use bin/release to generate the tarball and run --enable-build-all with it. Error is gone and all passed. --- MANIFEST | 52 ++++++++++++++++++++++++++++------------------------ 1 file changed, 28 insertions(+), 24 deletions(-) diff --git a/MANIFEST b/MANIFEST index 944072a..d9ff5db 100644 --- a/MANIFEST +++ b/MANIFEST @@ -990,29 +990,31 @@ ./test/filter_fail.c ./test/flush1.c ./test/flush2.c -./test/gen_bad_ohdr.c _DO_NOT_DISTRIBUTE_ -./test/gen_bad_compound.c _DO_NOT_DISTRIBUTE_ -./test/gen_bogus.c _DO_NOT_DISTRIBUTE_ -./test/gen_cross.c _DO_NOT_DISTRIBUTE_ -./test/gen_deflate.c _DO_NOT_DISTRIBUTE_ -./test/gen_file_image.c _DO_NOT_DISTRIBUTE_ -./test/gen_filespace.c _DO_NOT_DISTRIBUTE_ -./test/gen_mergemsg.c _DO_NOT_DISTRIBUTE_ -./test/gen_new_array.c _DO_NOT_DISTRIBUTE_ -./test/gen_new_fill.c _DO_NOT_DISTRIBUTE_ -./test/gen_new_group.c _DO_NOT_DISTRIBUTE_ -./test/gen_new_mtime.c _DO_NOT_DISTRIBUTE_ -./test/gen_new_super.c _DO_NOT_DISTRIBUTE_ -./test/gen_noencoder.c _DO_NOT_DISTRIBUTE_ -./test/gen_nullspace.c _DO_NOT_DISTRIBUTE_ -./test/gen_old_array.c _DO_NOT_DISTRIBUTE_ -./test/gen_old_group.c _DO_NOT_DISTRIBUTE_ -./test/gen_old_layout.c _DO_NOT_DISTRIBUTE_ -./test/gen_old_mtime.c _DO_NOT_DISTRIBUTE_ -./test/gen_plist.c _DO_NOT_DISTRIBUTE_ -./test/gen_sizes_lheap.c _DO_NOT_DISTRIBUTE_ -./test/gen_specmetaread.c _DO_NOT_DISTRIBUTE_ -./test/gen_udlinks.c _DO_NOT_DISTRIBUTE_ +# ====distribute this for now. See HDFFV-8236==== +./test/gen_bad_ohdr.c +./test/gen_bad_compound.c +./test/gen_bogus.c +./test/gen_cross.c +./test/gen_deflate.c +./test/gen_file_image.c +./test/gen_filespace.c +./test/gen_mergemsg.c +./test/gen_new_array.c +./test/gen_new_fill.c +./test/gen_new_group.c +./test/gen_new_mtime.c +./test/gen_new_super.c +./test/gen_noencoder.c +./test/gen_nullspace.c +./test/gen_old_array.c +./test/gen_old_group.c +./test/gen_old_layout.c +./test/gen_old_mtime.c +./test/gen_plist.c +./test/gen_sizes_lheap.c +./test/gen_specmetaread.c +./test/gen_udlinks.c +# ====end distribute this for now. See HDFFV-8236==== ./test/getname.c ./test/gheap.c ./test/group_old.h5 @@ -1039,7 +1041,9 @@ ./test/reserved.c ./test/pool.c ./test/set_extent.c -./test/space_overflow.c _DO_NOT_DISTRIBUTE_ +# ====distribute this for now. See HDFFV-8236==== +./test/space_overflow.c +# ====end distribute this for now. See HDFFV-8236==== ./test/specmetaread.h5 ./test/stab.c ./test/tarray.c -- cgit v0.12 From 7d205bba0a80a5ac8b68806c9c7b17f3005e30a4 Mon Sep 17 00:00:00 2001 From: Joel Plutchak Date: Thu, 2 May 2013 14:19:06 -0500 Subject: [svn-r23665] Added test cases to expose potential fill value issues. --- test/fillval.c | 281 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 281 insertions(+) diff --git a/test/fillval.c b/test/fillval.c index 847dfbd..28cb5aa 100644 --- a/test/fillval.c +++ b/test/fillval.c @@ -37,6 +37,7 @@ const char *FILENAME[] = { "fillval_6", "fillval_7", "fillval_8", + "fillval_9", NULL }; @@ -2085,6 +2086,285 @@ error: return 1; } +/*------------------------------------------------------------------------- + * Function: test_partalloc_cases + * + * Purpose: Tests fill values read and write for datasets. + * + * Return: Success: 0 + * + * Failure: 1 + * + * Programmer: Joel Plutchak + * April 15, 2013 + * + * Modifications: + * This function is called by test_rdwr to write and read + * dataset for different cases of chunked datasets with + * unallocated chunks. + * + *------------------------------------------------------------------------- + */ + +#define ROWS 4 +#define COLS 4 +static int +test_partalloc_cases(hid_t file, hid_t dcpl, const char *dname, H5D_fill_time_t fill_time) +{ + hid_t fspace=-1, dset1=-1, rspace = -1; + herr_t ret; + hsize_t ds_size[2] = {4, 4}; + hsize_t max_size[2] = {H5S_UNLIMITED,4}; + hsize_t chunk_size[2] = {1, 4}; + int fillval=(-1); + int w_values[] = {42}; /* New value to be written */ + int f_values[4] = {88,88,88,88}; /* pre-seed read buffer with known values */ + int r_values[4] = {88,88,88,88}; /* pre-seed read buffer with known values */ + hsize_t coord[1][2]; /* coordinate(s) of point to write */ + hsize_t start[2], count[2]; + + fillval = 0; /* default fill value is zero */ + + /* Create dataset with 4x4 integer dataset */ + if((fspace = H5Screate_simple(2, ds_size, max_size)) < 0) + goto error; + if((dset1 = H5Dcreate2(file, dname, H5T_NATIVE_INT, fspace, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) + goto error; + + /* + * Select a point in the file dataspace. + */ + coord[0][0]=0; coord[0][1]=0; + if (H5Sselect_elements( fspace, H5S_SELECT_SET, (size_t)1, (const hsize_t *)coord)) + goto error; + + /* + * Write single data point to the dataset. + */ + /*fprintf( stdout, "Writing (%llu,%llu) to file\n", coord[0][0], coord[0][1] );*/ + if ((ret = H5Dwrite(dset1, H5T_NATIVE_INT, H5S_ALL, fspace, H5P_DEFAULT, w_values))< 0) { + H5Eprint( H5E_DEFAULT, stderr ); + goto error; + } + + /* Read a line/chunk and make sure values are right */ + rspace = H5Screate_simple(2, chunk_size, NULL); + + /* Read the first row of elements: one known plus three fill */ + start[0] = 0; + start[1] = 0; + count[0] = 1; + count[1] = 4; + /* + fprintf( stdout, "Reading (%llu,%llu) --> (%llu,%llu) from file\n", + start[0]+1, start[1]+1, count[0]+start[0], count[1]+start[1] ); + */ + if ((ret = H5Sselect_hyperslab(fspace, H5S_SELECT_SET, start, NULL, count, NULL)) < 0) + goto error; + if ((ret = H5Sselect_all(rspace)) < 0) + goto error; + if(H5Dread(dset1, H5T_NATIVE_INT, rspace, fspace, H5P_DEFAULT, &r_values) < 0) + goto error; +/* + HDfprintf(stdout, "%u: Allocated chunk value read:\n", (unsigned)__LINE__); + printf(" {%ld,%ld,%ld,%ld} should be {%ld,%ld,%ld,%ld}\n", + (long)r_values[0], (long)r_values[1], + (long)r_values[2], (long)r_values[3], + (long)w_values[0], (long)fillval, + (long)fillval, (long)fillval ); +*/ + /* Read the third row of elements: all fill */ + start[0] = 2; + start[1] = 0; + count[0] = 1; + count[1] = 4; + /* + fprintf( stdout, "Reading (%llu,%llu) --> (%llu,%llu) from file\n", + start[0]+1, start[1]+1, count[0]+start[0], count[1]+start[1] ); + */ + if ((ret = H5Sselect_hyperslab(fspace, H5S_SELECT_SET, start, NULL, count, NULL)) < 0) + goto error; + if(H5Dread(dset1, H5T_NATIVE_INT, rspace, fspace, H5P_DEFAULT, &f_values) < 0) + goto error; + + if(fill_time != H5D_FILL_TIME_NEVER) { + /* check allocated chunk */ + if ((r_values[0] != w_values[0]) || + (r_values[1] != fillval) || + (r_values[2] != fillval) || + (r_values[3] != fillval)) { + H5_FAILED(); + HDfprintf(stdout, "%u: Allocated chunk value read was not correct.\n", (unsigned)__LINE__); + printf(" {%ld,%ld,%ld,%ld} should be {%ld,%ld,%ld,%ld}\n", + (long)r_values[0], (long)r_values[1], + (long)r_values[2], (long)r_values[3], + (long)w_values[0], (long)fillval, + (long)fillval, (long)fillval ); + goto error; + } + /* check unallocated chunk */ + if ((f_values[0] != fillval) || + (f_values[1] != fillval) || + (f_values[2] != fillval) || + (f_values[3] != fillval)) { + H5_FAILED(); + HDfprintf(stdout, "%u: Unallocated chunk value read was not correct.\n", (unsigned)__LINE__); + printf(" {%ld,%ld,%ld,%ld} should be {%ld,%ld,%ld,%ld}\n", + (long)f_values[0], (long)f_values[1], + (long)f_values[2], (long)f_values[3], + (long)fillval, (long)fillval, + (long)fillval, (long)fillval ); + goto error; + } + /* for the "never fill" case expect to get trash values, so skip */ + } + else if(fill_time == H5D_FILL_TIME_NEVER) { + } + + if(H5Sclose(rspace) < 0) goto error; + if(H5Dclose(dset1) < 0) goto error; + if(H5Sclose(fspace) < 0) goto error; + return 0; + + error: + H5E_BEGIN_TRY { + H5Dclose(dset1); + H5Sclose(fspace); + H5Sclose(rspace); + } H5E_END_TRY; + + return 1; +} + + +/*------------------------------------------------------------------------- + * Function: test_partalloc + * + * Purpose: Tests fill values for chunked, partially-allocated datasets. + * Regression test for HDFFV-8247. + * + * Return: Success: 0 + * + * Failure: number of errors + * + * Programmer: Joel Plutchak + * April 15, 2013 + * + *------------------------------------------------------------------------- + */ +static int +test_partalloc(hid_t fapl, const char *base_name) +{ + char filename[1024]; + hid_t file=-1, dcpl=-1; + hsize_t ch_size[2] = {1, 4}; + int nerrors=0; + + TESTING("chunked dataset partially allocated I/O"); + + h5_fixname(base_name, fapl, filename, sizeof filename); + if((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) + goto error; + + if((dcpl=H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error; + if(H5Pset_chunk(dcpl, 2, ch_size) < 0) goto error; + + /* I. Test H5D_ALLOC_TIME_LATE space allocation cases */ + if(H5Pset_alloc_time(dcpl, H5D_ALLOC_TIME_LATE) < 0) goto error; +#ifdef DEBUG + fprintf( stdout, "\nALLOC_TIME_LATE\n" ); +#endif + + /* case for H5D_FILL_TIME_ALLOC as fill write time and fill value to be default */ + if(H5Pset_fill_time(dcpl, H5D_FILL_TIME_ALLOC) < 0) goto error; +#ifdef DEBUG + fprintf( stdout, " FILL_TIME_ALLOC\n" ); +#endif + nerrors += test_partalloc_cases(file, dcpl, "dset1", H5D_FILL_TIME_ALLOC); + + /* case for H5D_FILL_TIME_NEVER as fill write time and fill value to be default */ + if(H5Pset_fill_time(dcpl, H5D_FILL_TIME_NEVER) < 0) goto error; +#ifdef DEBUG + fprintf( stdout, " FILL_TIME_NEVER\n" ); +#endif + nerrors += test_partalloc_cases(file, dcpl, "dset2", H5D_FILL_TIME_NEVER ); + + /* case for H5D_FILL_TIME_IFSET as fill write time and fill value to be default */ + if(H5Pset_fill_time(dcpl, H5D_FILL_TIME_IFSET) < 0) goto error; +#ifdef DEBUG + fprintf( stdout, " FILL_TIME_IFSET\n" ); +#endif + nerrors += test_partalloc_cases(file, dcpl, "dset3", H5D_FILL_TIME_IFSET ); + + /* II. Test H5D_ALLOC_TIME_INCR space allocation cases */ + if(H5Pset_alloc_time(dcpl, H5D_ALLOC_TIME_INCR) < 0) goto error; +#ifdef DEBUG + fprintf( stdout, "\nALLOC_TIME_INCR\n" ); +#endif + + /* case for H5D_FILL_TIME_ALLOC as fill write time and fill value to be default */ + if(H5Pset_fill_time(dcpl, H5D_FILL_TIME_ALLOC) < 0) goto error; +#ifdef DEBUG + fprintf( stdout, " FILL_TIME_ALLOC\n" ); +#endif + nerrors += test_partalloc_cases(file, dcpl, "dset4", H5D_FILL_TIME_ALLOC ); + + /* case for H5D_FILL_TIME_NEVER as fill write time and fill value to be default */ + if(H5Pset_fill_time(dcpl, H5D_FILL_TIME_NEVER) < 0) goto error; +#ifdef DEBUG + fprintf( stdout, " FILL_TIME_NEVER\n" ); +#endif + nerrors += test_partalloc_cases(file, dcpl, "dset5", H5D_FILL_TIME_NEVER ); + + /* case for H5D_FILL_TIME_IFSET as fill write time and fill value to be default */ + if(H5Pset_fill_time(dcpl, H5D_FILL_TIME_IFSET) < 0) goto error; +#ifdef DEBUG + fprintf( stdout, " FILL_TIME_IFSET\n" ); +#endif + nerrors += test_partalloc_cases(file, dcpl, "dset6", H5D_FILL_TIME_IFSET ); + + /* III. Test H5D_ALLOC_TIME_EARLY space allocation cases */ + if(H5Pset_alloc_time(dcpl, H5D_ALLOC_TIME_EARLY) < 0) goto error; +#ifdef DEBUG + fprintf( stdout, "\nALLOC_TIME_EARLY\n" ); +#endif + + /* case for H5D_FILL_TIME_ALLOC as fill write time and fill value to be default */ + if(H5Pset_fill_time(dcpl, H5D_FILL_TIME_ALLOC) < 0) goto error; +#ifdef DEBUG + fprintf( stdout, " FILL_TIME_ALLOC\n" ); +#endif + nerrors += test_partalloc_cases(file, dcpl, "dset7", H5D_FILL_TIME_ALLOC ); + + /* case for H5D_FILL_TIME_NEVER as fill write time and fill value to be default */ + if(H5Pset_fill_time(dcpl, H5D_FILL_TIME_NEVER) < 0) goto error; +#ifdef DEBUG + fprintf( stdout, " FILL_TIME_NEVER\n" ); +#endif + nerrors += test_partalloc_cases(file, dcpl, "dset8", H5D_FILL_TIME_NEVER ); + + /* case for H5D_FILL_TIME_IFSET as fill write time and fill value to be default */ + if(H5Pset_fill_time(dcpl, H5D_FILL_TIME_IFSET) < 0) goto error; +#ifdef DEBUG + fprintf( stdout, " FILL_TIME_IFSET\n" ); +#endif + nerrors += test_partalloc_cases(file, dcpl, "dset9", H5D_FILL_TIME_IFSET ); + + if(nerrors) + goto error; + if(H5Pclose(dcpl) < 0) goto error; + if(H5Fclose(file) < 0) goto error; + PASSED(); + return 0; + + error: + H5E_BEGIN_TRY { + H5Pclose(dcpl); + H5Fclose(file); + } H5E_END_TRY; + return nerrors; +} + /*------------------------------------------------------------------------- * Function: main @@ -2157,6 +2437,7 @@ main(int argc, char *argv[]) nerrors += test_create(my_fapl, FILENAME[0], H5D_CHUNKED); nerrors += test_rdwr (my_fapl, FILENAME[2], H5D_CHUNKED); nerrors += test_extend(my_fapl, FILENAME[4], H5D_CHUNKED); + nerrors += test_partalloc(my_fapl, FILENAME[8]); } /* end if */ /* Contiguous storage layout tests */ -- cgit v0.12 From 62f6b579d0999a3ff46eb74a6bb35841f0a18eaa Mon Sep 17 00:00:00 2001 From: Joel Plutchak Date: Thu, 2 May 2013 14:20:14 -0500 Subject: [svn-r23666] Fix for fill value problem for chunked files with mixed allocated/unallocated chunks. --- src/H5Dchunk.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/H5Dchunk.c b/src/H5Dchunk.c index 497846b..31e3179 100644 --- a/src/H5Dchunk.c +++ b/src/H5Dchunk.c @@ -1709,8 +1709,9 @@ H5D__chunk_cacheable(const H5D_io_info_t *io_info, haddr_t caddr, hbool_t write_ /* If the fill value needs to be written then we will need * to use the cache to write the fill value */ if(fill->fill_time == H5D_FILL_TIME_ALLOC || - (fill->fill_time == H5D_FILL_TIME_IFSET - && fill_status == H5D_FILL_VALUE_USER_DEFINED)) + (fill->fill_time == H5D_FILL_TIME_IFSET && + (fill_status == H5D_FILL_VALUE_USER_DEFINED || + fill_status == H5D_FILL_VALUE_DEFAULT))) ret_value = TRUE; else ret_value = FALSE; @@ -1796,7 +1797,8 @@ H5D__chunk_read(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, * but they aren't set, set the flag to skip missing chunks. */ if(fill->fill_time == H5D_FILL_TIME_NEVER || - (fill->fill_time == H5D_FILL_TIME_IFSET && fill_status != H5D_FILL_VALUE_USER_DEFINED)) + (fill->fill_time == H5D_FILL_TIME_IFSET && fill_status != H5D_FILL_VALUE_USER_DEFINED && + fill_status != H5D_FILL_VALUE_DEFAULT)) skip_missing_chunks = TRUE; } -- cgit v0.12 From 30f904dbe995184c81f2d3a71214a73b6abc090f Mon Sep 17 00:00:00 2001 From: Joel Plutchak Date: Fri, 3 May 2013 10:39:44 -0500 Subject: [svn-r23667] Removed H5E call. --- test/fillval.c | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/test/fillval.c b/test/fillval.c index 28cb5aa..9271f80 100644 --- a/test/fillval.c +++ b/test/fillval.c @@ -2106,8 +2106,6 @@ error: *------------------------------------------------------------------------- */ -#define ROWS 4 -#define COLS 4 static int test_partalloc_cases(hid_t file, hid_t dcpl, const char *dname, H5D_fill_time_t fill_time) { @@ -2141,9 +2139,7 @@ test_partalloc_cases(hid_t file, hid_t dcpl, const char *dname, H5D_fill_time_t /* * Write single data point to the dataset. */ - /*fprintf( stdout, "Writing (%llu,%llu) to file\n", coord[0][0], coord[0][1] );*/ if ((ret = H5Dwrite(dset1, H5T_NATIVE_INT, H5S_ALL, fspace, H5P_DEFAULT, w_values))< 0) { - H5Eprint( H5E_DEFAULT, stderr ); goto error; } @@ -2155,33 +2151,18 @@ test_partalloc_cases(hid_t file, hid_t dcpl, const char *dname, H5D_fill_time_t start[1] = 0; count[0] = 1; count[1] = 4; - /* - fprintf( stdout, "Reading (%llu,%llu) --> (%llu,%llu) from file\n", - start[0]+1, start[1]+1, count[0]+start[0], count[1]+start[1] ); - */ if ((ret = H5Sselect_hyperslab(fspace, H5S_SELECT_SET, start, NULL, count, NULL)) < 0) goto error; if ((ret = H5Sselect_all(rspace)) < 0) goto error; if(H5Dread(dset1, H5T_NATIVE_INT, rspace, fspace, H5P_DEFAULT, &r_values) < 0) goto error; -/* - HDfprintf(stdout, "%u: Allocated chunk value read:\n", (unsigned)__LINE__); - printf(" {%ld,%ld,%ld,%ld} should be {%ld,%ld,%ld,%ld}\n", - (long)r_values[0], (long)r_values[1], - (long)r_values[2], (long)r_values[3], - (long)w_values[0], (long)fillval, - (long)fillval, (long)fillval ); -*/ + /* Read the third row of elements: all fill */ start[0] = 2; start[1] = 0; count[0] = 1; count[1] = 4; - /* - fprintf( stdout, "Reading (%llu,%llu) --> (%llu,%llu) from file\n", - start[0]+1, start[1]+1, count[0]+start[0], count[1]+start[1] ); - */ if ((ret = H5Sselect_hyperslab(fspace, H5S_SELECT_SET, start, NULL, count, NULL)) < 0) goto error; if(H5Dread(dset1, H5T_NATIVE_INT, rspace, fspace, H5P_DEFAULT, &f_values) < 0) -- cgit v0.12 From 99e1300a0f5f93a159d054393eaf1f446ab9ccf5 Mon Sep 17 00:00:00 2001 From: Joel Plutchak Date: Fri, 3 May 2013 14:23:50 -0500 Subject: [svn-r23668] Added fix report for Jira issue HDFFV-8247, and removed it from the "Known Problem" section. --- release_docs/RELEASE.txt | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 4af32d8..cd197f9 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -418,6 +418,12 @@ Bug Fixes since HDF5-1.8.0 release Library ------- + - Fixed an error involving failure to write fill values to the user's + buffer when reading unallocated chunks from datasets that have a + fill value set to H5D_FILL_VALUE_DEFAULT. A consequence of this + was the reporting of spurious data values in h5dump and h5diff + output. + (HDFFV-8247; JP - 2013/05/03) - Fixed an error that could occur when calling H5Ocopy within an H5Literate callback (and possibly other situations). (NAF - 2012/7/25 - HDFFV-5853) @@ -1298,14 +1304,6 @@ The following platforms are not supported but have been tested for this release. Known Problems ============== -* The h5dump and h5diff utilities occasionally produce different output - between Linux and Windows systems. This is caused by lower-level library - routines that fail to write fill values to the user's buffer when reading - unallocated chunks from datasets that have a fill value set to - H5D_FILL_VALUE_DEFAULT. Due to platform differences the return of - spurious data values have only been encountered on Windows 32-bit systems. - (Issue HDFFV-8247; JP - 2013/03/27) - * The 5.9 C++ compiler on Sun failed to compile a C++ test ttypes.cpp. It complains with this message: "/home/hdf5/src/H5Vprivate.h", line 130: Error: __func__ is not defined. -- cgit v0.12 From 8f3aee85de3d7202e82379647f8411258e7321fb Mon Sep 17 00:00:00 2001 From: HDF Tester Date: Sun, 5 May 2013 03:32:05 -0500 Subject: [svn-r23669] Snapshot version 1.9 release 150 --- README.txt | 2 +- c++/src/Makefile.in | 2 +- config/lt_vers.am | 2 +- configure | 22 +++++++++++----------- configure.ac | 2 +- fortran/src/Makefile.in | 2 +- hl/c++/src/Makefile.in | 2 +- hl/fortran/src/Makefile.in | 2 +- hl/src/Makefile.in | 2 +- release_docs/RELEASE.txt | 2 +- src/H5public.h | 4 ++-- src/Makefile.in | 2 +- vms/src/h5pubconf.h | 6 +++--- 13 files changed, 26 insertions(+), 26 deletions(-) diff --git a/README.txt b/README.txt index fb3f387..bb77343 100644 --- a/README.txt +++ b/README.txt @@ -1,4 +1,4 @@ -HDF5 version 1.9.150 currently under development +HDF5 version 1.9.151 currently under development Please refer to the release_docs/INSTALL file for installation instructions. ------------------------------------------------------------------------------ diff --git a/c++/src/Makefile.in b/c++/src/Makefile.in index 6bcd7f0..103da91 100644 --- a/c++/src/Makefile.in +++ b/c++/src/Makefile.in @@ -467,7 +467,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 140 +LT_VERS_REVISION = 141 LT_VERS_AGE = 0 # Include src directory diff --git a/config/lt_vers.am b/config/lt_vers.am index 89eb9f7..ac9fc70 100644 --- a/config/lt_vers.am +++ b/config/lt_vers.am @@ -17,7 +17,7 @@ # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 140 +LT_VERS_REVISION = 141 LT_VERS_AGE = 0 ## If the API changes *at all*, increment LT_VERS_INTERFACE and diff --git a/configure b/configure index f0da7b4..7520cc4 100755 --- a/configure +++ b/configure @@ -1,7 +1,7 @@ #! /bin/sh # From configure.ac Id: configure.ac 22697 2012-08-19 14:35:47Z hdftest . # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for HDF5 1.9.150. +# Generated by GNU Autoconf 2.69 for HDF5 1.9.151. # # Report bugs to . # @@ -591,8 +591,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='HDF5' PACKAGE_TARNAME='hdf5' -PACKAGE_VERSION='1.9.150' -PACKAGE_STRING='HDF5 1.9.150' +PACKAGE_VERSION='1.9.151' +PACKAGE_STRING='HDF5 1.9.151' PACKAGE_BUGREPORT='help@hdfgroup.org' PACKAGE_URL='' @@ -1486,7 +1486,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures HDF5 1.9.150 to adapt to many kinds of systems. +\`configure' configures HDF5 1.9.151 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1556,7 +1556,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of HDF5 1.9.150:";; + short | recursive ) echo "Configuration of HDF5 1.9.151:";; esac cat <<\_ACEOF @@ -1752,7 +1752,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -HDF5 configure 1.9.150 +HDF5 configure 1.9.151 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2846,7 +2846,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by HDF5 $as_me 1.9.150, which was +It was created by HDF5 $as_me 1.9.151, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -3678,7 +3678,7 @@ fi # Define the identity of the package. PACKAGE='hdf5' - VERSION='1.9.150' + VERSION='1.9.151' cat >>confdefs.h <<_ACEOF @@ -31632,7 +31632,7 @@ Usage: $0 [OPTIONS] Report bugs to ." lt_cl_version="\ -HDF5 config.lt 1.9.150 +HDF5 config.lt 1.9.151 configured by $0, generated by GNU Autoconf 2.69. Copyright (C) 2011 Free Software Foundation, Inc. @@ -33762,7 +33762,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by HDF5 $as_me 1.9.150, which was +This file was extended by HDF5 $as_me 1.9.151, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -33828,7 +33828,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -HDF5 config.status 1.9.150 +HDF5 config.status 1.9.151 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff --git a/configure.ac b/configure.ac index 9eb90e0..87e1cea 100644 --- a/configure.ac +++ b/configure.ac @@ -26,7 +26,7 @@ AC_PREREQ([2.69]) ## NOTE: Do not forget to change the version number here when we do a ## release!!! ## -AC_INIT([HDF5], [1.9.150], [help@hdfgroup.org]) +AC_INIT([HDF5], [1.9.151], [help@hdfgroup.org]) AC_CONFIG_SRCDIR([src/H5.c]) AC_CONFIG_HEADER([src/H5config.h]) diff --git a/fortran/src/Makefile.in b/fortran/src/Makefile.in index 682f2cf..bae0cae 100644 --- a/fortran/src/Makefile.in +++ b/fortran/src/Makefile.in @@ -518,7 +518,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 140 +LT_VERS_REVISION = 141 LT_VERS_AGE = 0 # Include src directory in both Fortran and C flags (C compiler is used diff --git a/hl/c++/src/Makefile.in b/hl/c++/src/Makefile.in index a2c028d..717e0ae 100644 --- a/hl/c++/src/Makefile.in +++ b/hl/c++/src/Makefile.in @@ -458,7 +458,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 140 +LT_VERS_REVISION = 141 LT_VERS_AGE = 0 # Include src directory diff --git a/hl/fortran/src/Makefile.in b/hl/fortran/src/Makefile.in index a536ea7..ff77de7 100644 --- a/hl/fortran/src/Makefile.in +++ b/hl/fortran/src/Makefile.in @@ -474,7 +474,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 140 +LT_VERS_REVISION = 141 LT_VERS_AGE = 0 INCLUDES = -I$(top_srcdir)/src -I$(top_srcdir)/hl/src -I$(top_builddir)/hl/src \ -I$(top_srcdir)/fortran/src -I$(top_builddir)/fortran/src diff --git a/hl/src/Makefile.in b/hl/src/Makefile.in index c2d6adb..70e0bbe 100644 --- a/hl/src/Makefile.in +++ b/hl/src/Makefile.in @@ -457,7 +457,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 140 +LT_VERS_REVISION = 141 LT_VERS_AGE = 0 # This library is our main target. diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index cd197f9..9961c55 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -1,4 +1,4 @@ -HDF5 version 1.9.150 currently under development +HDF5 version 1.9.151 currently under development ================================================================================ diff --git a/src/H5public.h b/src/H5public.h index 88b8de1..88d8984 100644 --- a/src/H5public.h +++ b/src/H5public.h @@ -75,10 +75,10 @@ extern "C" { /* Version numbers */ #define H5_VERS_MAJOR 1 /* For major interface/format changes */ #define H5_VERS_MINOR 9 /* For minor interface/format changes */ -#define H5_VERS_RELEASE 150 /* For tweaks, bug-fixes, or development */ +#define H5_VERS_RELEASE 151 /* For tweaks, bug-fixes, or development */ #define H5_VERS_SUBRELEASE "" /* For pre-releases like snap0 */ /* Empty string for real releases. */ -#define H5_VERS_INFO "HDF5 library version: 1.9.150" /* Full version string */ +#define H5_VERS_INFO "HDF5 library version: 1.9.151" /* Full version string */ #define H5check() H5check_version(H5_VERS_MAJOR,H5_VERS_MINOR, \ H5_VERS_RELEASE) diff --git a/src/Makefile.in b/src/Makefile.in index a987dbe..5617634 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -522,7 +522,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 140 +LT_VERS_REVISION = 141 LT_VERS_AGE = 0 H5detect_CFLAGS = -g $(AM_CFLAGS) diff --git a/vms/src/h5pubconf.h b/vms/src/h5pubconf.h index ecc5f38..b45125f 100644 --- a/vms/src/h5pubconf.h +++ b/vms/src/h5pubconf.h @@ -502,7 +502,7 @@ #define H5_PACKAGE_NAME "HDF5" /* Define to the full name and version of this package. */ -#define H5_PACKAGE_STRING "HDF5 1.9.150" +#define H5_PACKAGE_STRING "HDF5 1.9.151" /* Define to the one symbol short name of this package. */ #define H5_PACKAGE_TARNAME "hdf5" @@ -511,7 +511,7 @@ #define H5_PACKAGE_URL "" /* Define to the version of this package. */ -#define H5_PACKAGE_VERSION "1.9.150" +#define H5_PACKAGE_VERSION "1.9.151" /* Width for printf() for type `long long' or `__int64', use `ll' */ #define H5_PRINTF_LL_WIDTH "ll" @@ -674,7 +674,7 @@ /* #undef H5_USING_MEMCHECKER */ /* Version number of package */ -#define H5_VERSION "1.9.150" +#define H5_VERSION "1.9.151" /* Define if vsnprintf() returns the correct value for formatted strings that don't fit into size allowed */ -- cgit v0.12 From 8ec42ced8063d739ec6c3d656b0556c3aafbc395 Mon Sep 17 00:00:00 2001 From: Raymond Lu Date: Mon, 6 May 2013 15:51:26 -0500 Subject: [svn-r23675] Issue 8380 - H5Zunregister caused seg fault. This is the followup commit. Quincey reviewed my previous commit and suggested me to use H5I_iterate to iterate through all opened objects in H5Z_unregister. I changed it in this commit. Tested with h5committest. --- src/H5Z.c | 200 ++++++++++++++++++++++++++++++---------------------- test/CMakeLists.txt | 4 ++ test/unregister.c | 2 - 3 files changed, 120 insertions(+), 86 deletions(-) diff --git a/src/H5Z.c b/src/H5Z.c index 5d68c25..1652a7d 100644 --- a/src/H5Z.c +++ b/src/H5Z.c @@ -46,6 +46,11 @@ typedef struct H5Z_stats_t { } H5Z_stats_t; #endif /* H5Z_DEBUG */ +typedef struct H5Z_object_t { + H5Z_filter_t filter_id; /* ID of the filter we're looking for */ + htri_t found; /* Whether we find an object using the filter */ +} H5Z_object_t; + /* Enumerated type for dataset creation prelude callbacks */ typedef enum { H5Z_PRELUDE_CAN_APPLY, /* Call "can apply" callback */ @@ -65,6 +70,7 @@ static H5Z_stats_t *H5Z_stat_table_g = NULL; /* Local functions */ static int H5Z_find_idx(H5Z_filter_t id); +static int H5Z_get_object_cb(void *obj_ptr, hid_t obj_id, void *key); /*------------------------------------------------------------------------- @@ -409,18 +415,11 @@ done: herr_t H5Z_unregister (H5Z_filter_t filter_id) { - hid_t *file_list = NULL; - hid_t *obj_id_list = NULL; - size_t num_obj_id = 0; - size_t num_file_id = 0; - H5F_t *f = NULL; /* File to query */ - H5I_type_t id_type; - hid_t ocpl_id; - H5P_genplist_t *plist; /* Property list */ - size_t filter_index; /* Local index variable for filter */ - int i; - htri_t filter_in_pline = FALSE; - herr_t ret_value=SUCCEED; /* Return value */ + size_t num_obj_id = 0; + size_t num_file_id = 0; + size_t filter_index; /* Local index variable for filter */ + H5Z_object_t object; + herr_t ret_value=SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -440,86 +439,33 @@ H5Z_unregister (H5Z_filter_t filter_id) HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "can't get object number") if(num_obj_id) { - if(NULL == (obj_id_list = (hid_t *)H5MM_malloc(num_obj_id*sizeof(hid_t)))) - HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "failed to allocate space") - - /* Find all opened objects that may use the filter (datasets and groups). Passing NULL as a pointer to - * file structure indicates searching among all opened files */ - if(H5F_get_obj_ids(NULL, H5F_OBJ_DATASET | H5F_OBJ_GROUP, num_obj_id, obj_id_list, FALSE, &num_obj_id) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "can't get object IDs") - } - - /* Check if any opened object (dataset or group) uses the filter. If so, fail with a message */ - for(i=0; ifilter_id)) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't check filter in pipeline") + + /* H5I_iterate expects TRUE to stop the loop over objects. Stop the loop and let + * H5Z_unregister return failure */ + if(filter_in_pline) { + object->found = TRUE; + ret_value = TRUE; + } + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5F_get_objects_cb() */ + + + +/*------------------------------------------------------------------------- * Function: H5Zfilter_avail * * Purpose: Check if a filter is available diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 8904fee..766ed7b 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -397,6 +397,8 @@ ADD_TEST ( testmeta.h5 tstint1.h5 tstint2.h5 + unregister_filter_1.h5 + unregister_filter_2.h5 ) SET (H5_TESTS @@ -453,6 +455,7 @@ SET (H5_TESTS file_image enc_dec_plist enc_dec_plist_with_endianess + unregister ) FOREACH (test ${H5_TESTS}) @@ -728,6 +731,7 @@ IF (HDF5_TEST_VFD) tcheck_version testmeta links_env + unregister ) IF (DIRECT_VFD) diff --git a/test/unregister.c b/test/unregister.c index 88f4d1b..297035d 100644 --- a/test/unregister.c +++ b/test/unregister.c @@ -145,7 +145,6 @@ test_unregister_filters(hid_t my_fapl) goto error; } /* end if */ - /* Close the group */ if(H5Gclose(gid) < 0) goto error; @@ -176,7 +175,6 @@ test_unregister_filters(hid_t my_fapl) goto error; /* Unregister the filter before closing the dataset. It should fail */ - /*if(H5Zunregister(H5Z_FILTER_DUMMY) < 0) goto error;*/ H5E_BEGIN_TRY { ret = H5Zunregister(H5Z_FILTER_DUMMY); } H5E_END_TRY; -- cgit v0.12 From 90ccb5c3c3efe341071ae4cdf41db8cc3d2e8906 Mon Sep 17 00:00:00 2001 From: Raymond Lu Date: Wed, 8 May 2013 11:36:58 -0500 Subject: [svn-r23685] Issue 8380 H5Zunregister caused seg fault. I simplied the iteration process over datasets, groups, and files as Quincey suggested. I also removed H5I_search that I introduced in last commit but didn't actually used it. Tested on jam and koala - simple change. --- src/H5I.c | 42 +++-------------------- src/H5Iprivate.h | 1 - src/H5Z.c | 101 ++++++++++++++++++++++++++++-------------------------- test/unregister.c | 4 +-- 4 files changed, 58 insertions(+), 90 deletions(-) diff --git a/src/H5I.c b/src/H5I.c index 6a8c269..581356e 100644 --- a/src/H5I.c +++ b/src/H5I.c @@ -2002,55 +2002,21 @@ H5Isearch(H5I_type_t type, H5I_search_func_t func, void *key) if(H5I_IS_LIB_TYPE(type)) HGOTO_ERROR(H5E_ATOM, H5E_BADGROUP, NULL, "cannot call public function on library type") - if((ret_value = H5I_search(type, func, key)) == NULL) - HGOTO_ERROR(H5E_ATOM, H5E_BADGROUP, NULL, "cannot call public function on library type") - -done: - FUNC_LEAVE_API(ret_value) -} /* end H5Isearch() */ - - -/*------------------------------------------------------------------------- - * Function: H5I_search - * - * Purpose: Private function for H5Isearch - * - * Return: Success: The first object in the type for which FUNC - * returns non-zero. NULL if FUNC returned zero - * for every object in the type. - * - * Failure: NULL - * - * Programmer: James Laird - * Nathaniel Furrer - * Friday, April 23, 2004 - * - *------------------------------------------------------------------------- - */ -void * -H5I_search(H5I_type_t _type, H5I_search_func_t _func, void *_key) -{ - H5I_search_ud_t udata; /* Context for iteration */ - void *ret_value; /* Return value */ - - FUNC_ENTER_NOAPI(NULL) - /* Set up udata struct */ - udata.app_cb = _func; - udata.app_key = _key; + udata.app_cb = func; + udata.app_key = key; udata.ret_obj = NULL; /* Note that H5I_iterate returns an error code. We ignore it * here, as we can't do anything with it without revising the API. */ - if(H5I_iterate(_type, H5I_search_cb, &udata, TRUE) < 0) - HGOTO_ERROR(H5E_ATOM, H5E_BADGROUP, NULL, "cannot call public function on library type") + H5I_iterate(type, H5I_search_cb, &udata, TRUE); /* Set return value */ ret_value = udata.ret_obj; done: - FUNC_LEAVE_NOAPI(ret_value) + FUNC_LEAVE_API(ret_value) } /* end H5Isearch() */ diff --git a/src/H5Iprivate.h b/src/H5Iprivate.h index 28b6327..ff1463d 100644 --- a/src/H5Iprivate.h +++ b/src/H5Iprivate.h @@ -78,7 +78,6 @@ H5_DLL H5I_type_t H5I_get_type(hid_t id); H5_DLL hid_t H5I_get_file_id(hid_t obj_id, hbool_t app_ref); H5_DLL void *H5I_remove(hid_t id); H5_DLL void *H5I_remove_verify(hid_t id, H5I_type_t id_type); -H5_DLL void *H5I_search(H5I_type_t _type, H5I_search_func_t _func, void *_key); H5_DLL herr_t H5I_iterate(H5I_type_t type, H5I_search_func_t func, void *udata, hbool_t app_ref); H5_DLL int H5I_get_ref(hid_t id, hbool_t app_ref); H5_DLL int H5I_inc_ref(hid_t id, hbool_t app_ref); diff --git a/src/H5Z.c b/src/H5Z.c index 1652a7d..5861e0e 100644 --- a/src/H5Z.c +++ b/src/H5Z.c @@ -71,6 +71,7 @@ static H5Z_stats_t *H5Z_stat_table_g = NULL; /* Local functions */ static int H5Z_find_idx(H5Z_filter_t id); static int H5Z_get_object_cb(void *obj_ptr, hid_t obj_id, void *key); +static int H5Z_get_file_cb(void *obj_ptr, hid_t obj_id, void *key); /*------------------------------------------------------------------------- @@ -415,8 +416,6 @@ done: herr_t H5Z_unregister (H5Z_filter_t filter_id) { - size_t num_obj_id = 0; - size_t num_file_id = 0; size_t filter_index; /* Local index variable for filter */ H5Z_object_t object; herr_t ret_value=SUCCEED; /* Return value */ @@ -434,39 +433,27 @@ H5Z_unregister (H5Z_filter_t filter_id) if (filter_index>=H5Z_table_used_g) HGOTO_ERROR(H5E_PLINE, H5E_NOTFOUND, FAIL, "filter is not registered") - /* Count the number of opened datasets and groups among all opened files */ - if(H5F_get_obj_count(NULL, H5F_OBJ_DATASET | H5F_OBJ_GROUP, FALSE, &num_obj_id) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "can't get object number") + /* Initialize the structure object for iteration */ + object.filter_id = filter_id; + object.found = FALSE; - if(num_obj_id) { - /* Initialize it here because it isn't needed when the object is file */ - object.filter_id = filter_id; - object.found = FALSE; + /* Iterate through all opened datasets, returns a failure if any of them uses the filter */ + if(H5I_iterate(H5I_DATASET, H5Z_get_object_cb, &object, FALSE) < 0) + HGOTO_ERROR(H5E_FILE, H5E_BADITER, FAIL, "iteration failed") - /* Iterate through all opened datasets, returns a failure if any of them uses the filter */ - if(H5I_iterate(H5I_DATASET, H5Z_get_object_cb, &object, FALSE) < 0) - HGOTO_ERROR(H5E_FILE, H5E_BADITER, FAIL, "iteration failed") + if(object.found) + HGOTO_ERROR(H5E_PLINE, H5E_CANTRELEASE, FAIL, "can't unregister filter because a dataset is still using it") - if(object.found) - HGOTO_ERROR(H5E_PLINE, H5E_CANTRELEASE, FAIL, "can't unregister filter because a dataset is still using it") + /* Iterate through all opened groups, returns a failure if any of them uses the filter */ + if(H5I_iterate(H5I_GROUP, H5Z_get_object_cb, &object, FALSE) < 0) + HGOTO_ERROR(H5E_FILE, H5E_BADITER, FAIL, "iteration failed") - /* Iterate through all opened groups, returns a failure if any of them uses the filter */ - if(H5I_iterate(H5I_GROUP, H5Z_get_object_cb, &object, FALSE) < 0) - HGOTO_ERROR(H5E_FILE, H5E_BADITER, FAIL, "iteration failed") + if(object.found) + HGOTO_ERROR(H5E_PLINE, H5E_CANTRELEASE, FAIL, "can't unregister filter because a group is still using it") - if(object.found) - HGOTO_ERROR(H5E_PLINE, H5E_CANTRELEASE, FAIL, "can't unregister filter because a group is still using it") - } - - /* Count the number of opened files */ - if(H5F_get_obj_count(NULL, H5F_OBJ_FILE, FALSE, &num_file_id) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "can't get file number") - /* Iterate through all opened files and flush them */ - if(num_file_id) { - if(H5I_iterate(H5I_FILE, H5Z_get_object_cb, &object, FALSE) < 0) - HGOTO_ERROR(H5E_FILE, H5E_BADITER, FAIL, "iteration failed") - } + if(H5I_iterate(H5I_FILE, H5Z_get_file_cb, NULL, FALSE) < 0) + HGOTO_ERROR(H5E_FILE, H5E_BADITER, FAIL, "iteration failed") /* Remove filter from table */ /* Don't worry about shrinking table size (for now) */ @@ -487,8 +474,7 @@ done: * Purpose: The callback function for H5Z_unregister. It iterates * through all opened objects. If the object is a dataset * or a group and it uses the filter to be unregistered, the - * function returns TRUE. If the object is a file, the function - * flushes it to the disk. + * function returns TRUE. * * Return: TRUE if the object uses the filter. * FALSE otherwise. @@ -516,23 +502,6 @@ H5Z_get_object_cb(void *obj_ptr, hid_t obj_id, void *key) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "bad object id"); switch(id_type) { - case H5I_FILE: - { - H5F_t *f = NULL; /* File to query */ - - if(NULL == (f = (H5F_t *)H5I_object_verify(obj_id, H5I_FILE))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file") - - /* Call the flush routine for mounted file hierarchies. Do a global flush - * if the file is opened for write */ - if(H5F_ACC_RDWR & H5F_INTENT(f)) { - if(H5F_flush_mounts(f, H5AC_dxpl_id) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTFLUSH, FAIL, "unable to flush file hierarchy") - } /* end if */ - - /* H5I_iterate expects FALSE to continue to other files */ - HGOTO_DONE(FALSE) - } case H5I_GROUP: if((ocpl_id = H5G_get_create_plist(obj_ptr)) < 0) HGOTO_ERROR(H5E_ARGS, H5E_CANTGET, FAIL, "can't get group creation property list") @@ -566,8 +535,42 @@ H5Z_get_object_cb(void *obj_ptr, hid_t obj_id, void *key) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5F_get_objects_cb() */ +} /* end H5F_get_object_cb() */ + + +/*------------------------------------------------------------------------- + * Function: H5Z_get_file_cb + * + * Purpose: The callback function for H5Z_unregister. It iterates + * through all opened files and flush them. + * + * Return: FALSE if finishes flushing and moves on + * FAIL if there is an error + * + * Programmer: Raymond Lu + * 6 May 2013 + * + *------------------------------------------------------------------------- + */ +static int +H5Z_get_file_cb(void *obj_ptr, hid_t obj_id, void *key) +{ + int ret_value = FALSE; /* Return value */ + + FUNC_ENTER_NOAPI(FAIL) + + HDassert(obj_ptr); + /* Call the flush routine for mounted file hierarchies. Do a global flush + * if the file is opened for write */ + if(H5F_ACC_RDWR & H5F_INTENT((H5F_t *)obj_ptr)) { + if(H5F_flush_mounts((H5F_t *)obj_ptr, H5AC_dxpl_id) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTFLUSH, FAIL, "unable to flush file hierarchy") + } /* end if */ + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5F_get_file_cb() */ /*------------------------------------------------------------------------- diff --git a/test/unregister.c b/test/unregister.c index 297035d..383958d 100644 --- a/test/unregister.c +++ b/test/unregister.c @@ -242,14 +242,14 @@ main(void) if(nerrors) goto error; - printf("All dataset tests passed.\n"); + printf("All filter unregistration tests passed.\n"); h5_cleanup(FILENAME, fapl); return 0; error: nerrors = MAX(1, nerrors); - printf("***** %d DATASET TEST%s FAILED! *****\n", + printf("***** %d FILTER UNREGISTRATION TEST%s FAILED! *****\n", nerrors, 1 == nerrors ? "" : "S"); return 1; } -- cgit v0.12 From fb396557fc760780f8b53433174b64d609f417e3 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 9 May 2013 09:56:18 -0500 Subject: [svn-r23691] Fix valgrind leak by closing fapl Tested: local linux --- test/file_image.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/file_image.c b/test/file_image.c index c734db8..d4056a7 100644 --- a/test/file_image.c +++ b/test/file_image.c @@ -1207,6 +1207,9 @@ test_get_file_image_error_rejection(void) err = H5Fclose(file_id); VERIFY(err == SUCCEED, "H5Fclose(2) failed."); + /* tidy up */ + result = h5_cleanup(FILENAME2, fapl_id); + VERIFY(result != 0, "h5_cleanup(2 failed."); /************************** Test #4 **********************************/ /* set up a family file driver test file, and try to get its image -- cgit v0.12 From 5ecebe5b9bc161153a3391bf32eb64687f675172 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 9 May 2013 13:07:36 -0500 Subject: [svn-r23692] Remove INSTALL_VMS file. Added if block around INSTALL files --- CMakeLists.txt | 46 ++++++++++++++++++++++++++++------------------ 1 file changed, 28 insertions(+), 18 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b536980..8f7a2fe 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -964,36 +964,46 @@ IF (NOT HDF5_EXTERNALLY_CONFIGURED) ) IF (EXISTS "${HDF5_SOURCE_DIR}/release_docs" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/release_docs") SET (release_files - ${HDF5_SOURCE_DIR}/release_docs/INSTALL_CMake.txt ${HDF5_SOURCE_DIR}/release_docs/USING_HDF5_CMake.txt ${HDF5_SOURCE_DIR}/release_docs/COPYING - ${HDF5_SOURCE_DIR}/release_docs/HISTORY-1_9.txt - ${HDF5_SOURCE_DIR}/release_docs/INSTALL ${HDF5_SOURCE_DIR}/release_docs/RELEASE.txt ) IF (WIN32 AND NOT CYGWIN) SET (release_files ${release_files} - ${HDF5_SOURCE_DIR}/release_docs/INSTALL_Windows.txt - ) - ELSE (WIN32 AND NOT CYGWIN) - SET (release_files - ${release_files} - ${HDF5_SOURCE_DIR}/release_docs/INSTALL_Cygwin.txt - ${HDF5_SOURCE_DIR}/release_docs/INSTALL_VMS.txt + ${HDF5_SOURCE_DIR}/release_docs/USING_HDF5_VS.txt ) ENDIF (WIN32 AND NOT CYGWIN) - IF (HDF5_ENABLE_PARALLEL) + IF (HDF5_PACK_INSTALL_DOCS) SET (release_files ${release_files} - ${HDF5_SOURCE_DIR}/release_docs/INSTALL_parallel + ${HDF5_SOURCE_DIR}/release_docs/INSTALL_CMake.txt + ${HDF5_SOURCE_DIR}/release_docs/HISTORY-1_8.txt + ${HDF5_SOURCE_DIR}/release_docs/INSTALL ) - ENDIF (HDF5_ENABLE_PARALLEL) - INSTALL ( - FILES ${release_files} - DESTINATION ${HDF5_INSTALL_DATA_DIR}/release_docs - COMPONENT hdfdocuments - ) + IF (WIN32 AND NOT CYGWIN) + SET (release_files + ${release_files} + ${HDF5_SOURCE_DIR}/release_docs/INSTALL_Windows.txt + ) + ELSE (WIN32 AND NOT CYGWIN) + SET (release_files + ${release_files} + ${HDF5_SOURCE_DIR}/release_docs/INSTALL_Cygwin.txt + ) + ENDIF (WIN32 AND NOT CYGWIN) + IF (HDF5_ENABLE_PARALLEL) + SET (release_files + ${release_files} + ${HDF5_SOURCE_DIR}/release_docs/INSTALL_parallel + ) + ENDIF (HDF5_ENABLE_PARALLEL) + INSTALL ( + FILES ${release_files} + DESTINATION ${HDF5_INSTALL_DATA_DIR}/release_docs + COMPONENT hdfdocuments + ) + ENDIF (HDF5_PACK_INSTALL_DOCS) ENDIF (EXISTS "${HDF5_SOURCE_DIR}/release_docs" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/release_docs") ENDIF (NOT HDF5_EXTERNALLY_CONFIGURED) -- cgit v0.12