From f1360e4d06c6e75a3ee51f5e79973aaed9b53800 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Thu, 24 Sep 2009 06:25:37 -0500 Subject: [svn-r17515] Description: Bring r17496:17514 from trunk to revise_chunks branch Tested on: FreeBSD/32 6.3 (duty) in debug mode FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode Linux/32 2.6 (jam) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe, in debug mode Linux/64-amd64 2.6 (smirom) w/Intel compilers w/default API=1.6.x, w/C++ & FORTRAN, in production mode Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN, w/szip filter, in production mode Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN, in production mode Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in debug mode Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode Mac OS X/32 10.5.8 (amazon) in debug mode Mac OS X/32 10.5.8 (amazon) w/C++ & FORTRAN, w/threadsafe, in production mode --- MANIFEST | 1 + bin/snapshot | 2 +- configure | 3 +- configure.in | 1 + fortran/src/H5_f.c | 42 ++++++++------- fortran/src/H5f90global.f90 | 44 +++++++-------- src/H5.c | 20 ++++--- src/H5detect.c | 76 +++++++++++++++++++------- src/H5private.h | 1 + test/Makefile.am | 2 +- test/Makefile.in | 9 ++-- test/testlibinfo.sh.in | 128 ++++++++++++++++++++++++++++++++++++++++++++ 12 files changed, 255 insertions(+), 74 deletions(-) create mode 100644 test/testlibinfo.sh.in diff --git a/MANIFEST b/MANIFEST index c23af7b..17fe9c1 100644 --- a/MANIFEST +++ b/MANIFEST @@ -893,6 +893,7 @@ ./test/testframe.c ./test/testhdf5.c ./test/testhdf5.h +./test/testlibinfo.sh.in ./test/testmeta.c ./test/testswmr.sh ./test/tfile.c diff --git a/bin/snapshot b/bin/snapshot index e1c1f32..82bf557 100755 --- a/bin/snapshot +++ b/bin/snapshot @@ -412,7 +412,7 @@ if [ "$cmd" = "all" -o -n "$cmdtest" -o -n "$cmddiff" ]; then TIMESTAMP "check-install" && \ ${MAKE} check-install && DISKUSAGE \ TIMESTAMP "uninstall" && \ - ${MAKE} uninstall-all) && DISKUSAGE ; then + ${MAKE} uninstall-all && DISKUSAGE); then : else errcode=$? diff --git a/configure b/configure index 96000b6..5daa241 100755 --- a/configure +++ b/configure @@ -28203,7 +28203,7 @@ if test -n "$TESTPARALLEL"; then fi fi -ac_config_files="$ac_config_files src/libhdf5.settings Makefile src/Makefile test/Makefile test/testerror.sh testpar/Makefile testpar/testph5.sh perform/Makefile tools/Makefile tools/h5dump/Makefile tools/h5dump/testh5dump.sh tools/h5dump/testh5dumpxml.sh tools/h5ls/testh5ls.sh tools/h5import/Makefile tools/h5diff/Makefile tools/h5jam/Makefile tools/h5jam/testh5jam.sh tools/h5repack/Makefile tools/h5repack/h5repack.sh tools/h5ls/Makefile tools/h5copy/Makefile tools/lib/Makefile tools/misc/Makefile tools/misc/h5cc tools/misc/testh5repart.sh tools/h5stat/testh5stat.sh tools/h5stat/Makefile examples/Makefile examples/testh5cc.sh c++/Makefile c++/src/Makefile c++/src/h5c++ c++/test/Makefile c++/examples/Makefile c++/examples/testh5c++.sh fortran/Makefile fortran/src/h5fc fortran/src/Makefile fortran/test/Makefile fortran/testpar/Makefile fortran/examples/Makefile fortran/examples/testh5fc.sh hl/Makefile hl/src/Makefile hl/test/Makefile hl/tools/Makefile hl/tools/gif2h5/Makefile hl/examples/Makefile hl/c++/Makefile hl/c++/src/Makefile hl/c++/test/Makefile hl/c++/examples/Makefile hl/fortran/Makefile hl/fortran/src/Makefile hl/fortran/test/Makefile hl/fortran/examples/Makefile" +ac_config_files="$ac_config_files src/libhdf5.settings Makefile src/Makefile test/Makefile test/testerror.sh test/testlibinfo.sh testpar/Makefile testpar/testph5.sh perform/Makefile tools/Makefile tools/h5dump/Makefile tools/h5dump/testh5dump.sh tools/h5dump/testh5dumpxml.sh tools/h5ls/testh5ls.sh tools/h5import/Makefile tools/h5diff/Makefile tools/h5jam/Makefile tools/h5jam/testh5jam.sh tools/h5repack/Makefile tools/h5repack/h5repack.sh tools/h5ls/Makefile tools/h5copy/Makefile tools/lib/Makefile tools/misc/Makefile tools/misc/h5cc tools/misc/testh5repart.sh tools/h5stat/testh5stat.sh tools/h5stat/Makefile examples/Makefile examples/testh5cc.sh c++/Makefile c++/src/Makefile c++/src/h5c++ c++/test/Makefile c++/examples/Makefile c++/examples/testh5c++.sh fortran/Makefile fortran/src/h5fc fortran/src/Makefile fortran/test/Makefile fortran/testpar/Makefile fortran/examples/Makefile fortran/examples/testh5fc.sh hl/Makefile hl/src/Makefile hl/test/Makefile hl/tools/Makefile hl/tools/gif2h5/Makefile hl/examples/Makefile hl/c++/Makefile hl/c++/src/Makefile hl/c++/test/Makefile hl/c++/examples/Makefile hl/fortran/Makefile hl/fortran/src/Makefile hl/fortran/test/Makefile hl/fortran/examples/Makefile" cat >confcache <<\_ACEOF @@ -29414,6 +29414,7 @@ do "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; "test/Makefile") CONFIG_FILES="$CONFIG_FILES test/Makefile" ;; "test/testerror.sh") CONFIG_FILES="$CONFIG_FILES test/testerror.sh" ;; + "test/testlibinfo.sh") CONFIG_FILES="$CONFIG_FILES test/testlibinfo.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" ;; diff --git a/configure.in b/configure.in index 3fd05cb..e955ec8 100644 --- a/configure.in +++ b/configure.in @@ -3993,6 +3993,7 @@ AC_CONFIG_FILES([src/libhdf5.settings src/Makefile test/Makefile test/testerror.sh + test/testlibinfo.sh testpar/Makefile testpar/testph5.sh perform/Makefile diff --git a/fortran/src/H5_f.c b/fortran/src/H5_f.c index a8b2d95..e0748b5b 100644 --- a/fortran/src/H5_f.c +++ b/fortran/src/H5_f.c @@ -557,26 +557,28 @@ nh5init_flags_c( int_f *h5d_flags, int_f *h5f_flags, h5t_flags[10] = (int_f)H5T_ORDER_LE; h5t_flags[11] = (int_f)H5T_ORDER_BE; h5t_flags[12] = (int_f)H5T_ORDER_VAX; - h5t_flags[13] = (int_f)H5T_PAD_ZERO; - h5t_flags[14] = (int_f)H5T_PAD_ONE; - h5t_flags[15] = (int_f)H5T_PAD_BACKGROUND; - h5t_flags[16] = (int_f)H5T_PAD_ERROR; - h5t_flags[17] = (int_f)H5T_SGN_NONE; - h5t_flags[18] = (int_f)H5T_SGN_2; - h5t_flags[19] = (int_f)H5T_SGN_ERROR; - h5t_flags[20] = (int_f)H5T_NORM_IMPLIED; - h5t_flags[21] = (int_f)H5T_NORM_MSBSET; - h5t_flags[22] = (int_f)H5T_NORM_NONE; - h5t_flags[23] = (int_f)H5T_CSET_ASCII; - h5t_flags[24] = (int_f)H5T_CSET_UTF8; - h5t_flags[25] = (int_f)H5T_STR_NULLTERM; - h5t_flags[26] = (int_f)H5T_STR_NULLPAD; - h5t_flags[27] = (int_f)H5T_STR_SPACEPAD; - h5t_flags[28] = (int_f)H5T_STR_ERROR; - h5t_flags[29] = (int_f)H5T_VLEN; - h5t_flags[30] = (int_f)H5T_ARRAY; - h5t_flags[31] = (int_f)H5T_DIR_ASCEND; - h5t_flags[32] = (int_f)H5T_DIR_DESCEND; + h5t_flags[13] = (int_f)H5T_ORDER_NONE; + h5t_flags[14] = (int_f)H5T_PAD_ZERO; + h5t_flags[15] = (int_f)H5T_PAD_ONE; + h5t_flags[16] = (int_f)H5T_PAD_BACKGROUND; + h5t_flags[17] = (int_f)H5T_PAD_ERROR; + h5t_flags[18] = (int_f)H5T_SGN_NONE; + h5t_flags[19] = (int_f)H5T_SGN_2; + h5t_flags[20] = (int_f)H5T_SGN_ERROR; + h5t_flags[21] = (int_f)H5T_NORM_IMPLIED; + h5t_flags[22] = (int_f)H5T_NORM_MSBSET; + h5t_flags[23] = (int_f)H5T_NORM_NONE; + h5t_flags[24] = (int_f)H5T_CSET_ASCII; + h5t_flags[25] = (int_f)H5T_CSET_UTF8; + h5t_flags[26] = (int_f)H5T_STR_NULLTERM; + h5t_flags[27] = (int_f)H5T_STR_NULLPAD; + h5t_flags[28] = (int_f)H5T_STR_SPACEPAD; + h5t_flags[29] = (int_f)H5T_STR_ERROR; + h5t_flags[30] = (int_f)H5T_VLEN; + h5t_flags[31] = (int_f)H5T_ARRAY; + h5t_flags[32] = (int_f)H5T_DIR_ASCEND; + h5t_flags[33] = (int_f)H5T_DIR_DESCEND; + /* * H5Z flags */ diff --git a/fortran/src/H5f90global.f90 b/fortran/src/H5f90global.f90 index 3fc247f..28d00f7 100644 --- a/fortran/src/H5f90global.f90 +++ b/fortran/src/H5f90global.f90 @@ -687,7 +687,7 @@ MODULE H5GLOBAL ! ! H5T flags declaration ! - INTEGER, PARAMETER :: H5T_FLAGS_LEN = 33 + INTEGER, PARAMETER :: H5T_FLAGS_LEN = 34 INTEGER H5T_flags(H5T_FLAGS_LEN) !DEC$if defined(BUILD_HDF5_DLL) !DEC$ATTRIBUTES DLLEXPORT :: /H5T_FLAGS/ @@ -709,6 +709,7 @@ MODULE H5GLOBAL INTEGER :: H5T_ORDER_LE_F INTEGER :: H5T_ORDER_BE_F INTEGER :: H5T_ORDER_VAX_F + INTEGER :: H5T_ORDER_NONE_F INTEGER :: H5T_PAD_ZERO_F INTEGER :: H5T_PAD_ONE_F INTEGER :: H5T_PAD_BACKGROUND_F @@ -741,26 +742,27 @@ MODULE H5GLOBAL EQUIVALENCE(H5T_flags(11), H5T_ORDER_LE_F) EQUIVALENCE(H5T_flags(12), H5T_ORDER_BE_F) EQUIVALENCE(H5T_flags(13), H5T_ORDER_VAX_F) - EQUIVALENCE(H5T_flags(14), H5T_PAD_ZERO_F) - EQUIVALENCE(H5T_flags(15), H5T_PAD_ONE_F) - EQUIVALENCE(H5T_flags(16), H5T_PAD_BACKGROUND_F) - EQUIVALENCE(H5T_flags(17), H5T_PAD_ERROR_F) - EQUIVALENCE(H5T_flags(18), H5T_SGN_NONE_F) - EQUIVALENCE(H5T_flags(19), H5T_SGN_2_F) - EQUIVALENCE(H5T_flags(20), H5T_SGN_ERROR_F) - EQUIVALENCE(H5T_flags(21), H5T_NORM_IMPLIED_F) - EQUIVALENCE(H5T_flags(22), H5T_NORM_MSBSET_F) - EQUIVALENCE(H5T_flags(23), H5T_NORM_NONE_F) - EQUIVALENCE(H5T_flags(24), H5T_CSET_ASCII_F) - EQUIVALENCE(H5T_flags(25), H5T_CSET_UTF8_F) - EQUIVALENCE(H5T_flags(26), H5T_STR_NULLTERM_F) - EQUIVALENCE(H5T_flags(27), H5T_STR_NULLPAD_F) - EQUIVALENCE(H5T_flags(28), H5T_STR_SPACEPAD_F) - EQUIVALENCE(H5T_flags(29), H5T_STR_ERROR_F) - EQUIVALENCE(H5T_flags(30), H5T_VLEN_F) - EQUIVALENCE(H5T_flags(31), H5T_ARRAY_F) - EQUIVALENCE(H5T_flags(32), H5T_DIR_ASCEND_F) - EQUIVALENCE(H5T_flags(33), H5T_DIR_DESCEND_F) + EQUIVALENCE(H5T_flags(14), H5T_ORDER_NONE_F) + EQUIVALENCE(H5T_flags(15), H5T_PAD_ZERO_F) + EQUIVALENCE(H5T_flags(16), H5T_PAD_ONE_F) + EQUIVALENCE(H5T_flags(17), H5T_PAD_BACKGROUND_F) + EQUIVALENCE(H5T_flags(18), H5T_PAD_ERROR_F) + EQUIVALENCE(H5T_flags(19), H5T_SGN_NONE_F) + EQUIVALENCE(H5T_flags(20), H5T_SGN_2_F) + EQUIVALENCE(H5T_flags(21), H5T_SGN_ERROR_F) + EQUIVALENCE(H5T_flags(22), H5T_NORM_IMPLIED_F) + EQUIVALENCE(H5T_flags(23), H5T_NORM_MSBSET_F) + EQUIVALENCE(H5T_flags(24), H5T_NORM_NONE_F) + EQUIVALENCE(H5T_flags(25), H5T_CSET_ASCII_F) + EQUIVALENCE(H5T_flags(26), H5T_CSET_UTF8_F) + EQUIVALENCE(H5T_flags(27), H5T_STR_NULLTERM_F) + EQUIVALENCE(H5T_flags(28), H5T_STR_NULLPAD_F) + EQUIVALENCE(H5T_flags(29), H5T_STR_SPACEPAD_F) + EQUIVALENCE(H5T_flags(30), H5T_STR_ERROR_F) + EQUIVALENCE(H5T_flags(31), H5T_VLEN_F) + EQUIVALENCE(H5T_flags(32), H5T_ARRAY_F) + EQUIVALENCE(H5T_flags(33), H5T_DIR_ASCEND_F) + EQUIVALENCE(H5T_flags(34), H5T_DIR_DESCEND_F) ! ! H5Z flags declaration diff --git a/src/H5.c b/src/H5.c index b49db8d..f11e8b7 100644 --- a/src/H5.c +++ b/src/H5.c @@ -28,7 +28,7 @@ #include "H5Lprivate.h" /* Links */ #include "H5Pprivate.h" /* Property lists */ #include "H5Tprivate.h" /* Datatypes */ -#include "H5SLprivate.h" /* Skip lists */ +#include "H5SLprivate.h" /* Skip lists */ /****************/ @@ -623,6 +623,7 @@ H5check_version(unsigned majnum, unsigned minnum, unsigned relnum) static int checked = 0; /* If we've already checked the version info */ static int disable_version_check = 0; /* Set if the version check should be disabled */ herr_t ret_value=SUCCEED; /* Return value */ + static char *version_mismatch_warning=VERSION_MISMATCH_WARNING; FUNC_ENTER_API_NOINIT_NOFS(H5check_version) H5TRACE3("e", "IuIuIu", majnum, minnum, relnum); @@ -644,15 +645,16 @@ H5check_version(unsigned majnum, unsigned minnum, unsigned relnum) H5_VERS_RELEASE!=relnum) { switch (disable_version_check) { case 0: - HDfputs (VERSION_MISMATCH_WARNING + HDfprintf(stderr, "%s%s", version_mismatch_warning, "You can, at your own risk, disable this warning by setting the environment\n" "variable 'HDF5_DISABLE_VERSION_CHECK' to a value of '1'.\n" - "Setting it to 2 will suppress the warning messages totally.\n", - stderr); + "Setting it to 2 will suppress the warning messages totally.\n"); /* Mention the versions we are referring to */ HDfprintf (stderr, "Headers are %u.%u.%u, library is %u.%u.%u\n", majnum, minnum, relnum, (unsigned)H5_VERS_MAJOR, (unsigned)H5_VERS_MINOR, (unsigned)H5_VERS_RELEASE); + /* Show library settings if available */ + HDfprintf (stderr, "%s", H5libhdf5_settings); /* Bail out now. */ HDfputs ("Bye...\n", stderr); @@ -662,14 +664,18 @@ H5check_version(unsigned majnum, unsigned minnum, unsigned relnum) break; default: /* continue with a warning */ - HDfprintf (stderr, VERSION_MISMATCH_WARNING - "'HDF5_DISABLE_VERSION_CHECK' " + /* Note that the warning message is embedded in the format string. */ + HDfprintf (stderr, + "%s'HDF5_DISABLE_VERSION_CHECK' " "environment variable is set to %d, application will\n" - "continue at your own risk.\n", disable_version_check); + "continue at your own risk.\n", + version_mismatch_warning, disable_version_check); /* Mention the versions we are referring to */ HDfprintf (stderr, "Headers are %u.%u.%u, library is %u.%u.%u\n", majnum, minnum, relnum, (unsigned)H5_VERS_MAJOR, (unsigned)H5_VERS_MINOR, (unsigned)H5_VERS_RELEASE); + /* Show library settings if available */ + HDfprintf (stderr, "%s", H5libhdf5_settings); break; } /* end switch */ diff --git a/src/H5detect.c b/src/H5detect.c index 8d7b93b..d5801ef 100644 --- a/src/H5detect.c +++ b/src/H5detect.c @@ -108,7 +108,8 @@ static void detect_C99_integers16(void); static void detect_C99_integers32(void); static void detect_C99_integers64(void); static void detect_alignments(void); -static void insert_libhdf5_settings(void); +static void insert_libhdf5_settings(FILE *flibinfo); +static void make_libinfo(void); static size_t align_g[] = {1, 2, 4, 8, 16}; static jmp_buf jbuf_g; @@ -505,8 +506,10 @@ sigbus_handler(int UNUSED signo) /*------------------------------------------------------------------------- * Function: insert_libhdf5_settings * - * Purpose: Insert contents of libhdf5.settings so that it is included - * in all hdf5 executables. + * Purpose: insert the contents of libhdf5.settings into a file + * represented by flibinfo. + * Make it an empty string if H5_HAVE_EMBEDDED_LIBINFO is not + * defined, i.e., not enabled. * * Return: void * @@ -519,9 +522,10 @@ sigbus_handler(int UNUSED signo) */ #define LIBSETTINGSFNAME "libhdf5.settings" static void -insert_libhdf5_settings(void) +insert_libhdf5_settings(FILE *flibinfo) { - FILE *fsettings; +#ifdef H5_HAVE_EMBEDDED_LIBINFO + FILE *fsettings; /* for files libhdf5.settings */ int inchar; int bol=0; /* indicates the beginning of a new line */ @@ -529,34 +533,66 @@ insert_libhdf5_settings(void) perror(LIBSETTINGSFNAME); exit(1); } - /* print variable definition */ - printf("extern char H5libhdf5_settings[]=\n"); + /* print variable definition and the string */ + fprintf(flibinfo, "char H5libhdf5_settings[]=\n"); bol++; while (EOF != (inchar = getc(fsettings))){ if (bol){ /* Start a new line */ - printf("\t\""); + fprintf(flibinfo, "\t\""); bol = 0; } if (inchar == '\n'){ /* end of a line */ - printf("\\n\"\n"); + fprintf(flibinfo, "\\n\"\n"); bol++; }else{ - putchar(inchar); + putc(inchar, flibinfo); } } if (feof(fsettings)){ /* wrap up */ if (!bol){ /* EOF found without a new line */ - printf("\\n\"\n"); + fprintf(flibinfo, "\\n\"\n"); }; - printf(";\n\n"); + fprintf(flibinfo, ";\n\n"); }else{ fprintf(stderr, "Read errors encountered with %s\n", LIBSETTINGSFNAME); exit(1); } + if (0 != fclose(fsettings)){ + perror(LIBSETTINGSFNAME); + exit(1); + } +#else + /* print variable definition and an empty string */ + fprintf(flibinfo, "char H5libhdf5_settings[]=\"\";\n"); +#endif +} + + +/*------------------------------------------------------------------------- + * Function: make_libinfo + * + * Purpose: Create the embedded library information definition. + * This sets up for a potential extension that the declaration + * is printed to a file different from stdout. + * + * Return: void + * + * Programmer: Albert Cheng + * Sep 15, 2009 + * + * Modifications: + * + *------------------------------------------------------------------------- + */ +static void +make_libinfo(void) +{ + /* print variable definition and then the string as a macro. */ + insert_libhdf5_settings(stdout); } @@ -623,11 +659,13 @@ print_results(int nd, detected_t *d, int na, malign_t *misc_align) /********************/\n\ /* Public Variables */\n\ /********************/\n\ -\n\n\ +\n\ +\n\ /*****************************/\n\ /* Library Private Variables */\n\ /*****************************/\n\ -\n\n\ +\n\ +\n\ /*********************/\n\ /* Package Variables */\n\ /*********************/\n\ @@ -639,10 +677,8 @@ print_results(int nd, detected_t *d, int na, malign_t *misc_align) /*******************/\n\ \n"); -#ifdef H5_HAVE_EMBEDDED_LIBINFO - /* Insert content of libhdf5.settings */ - insert_libhdf5_settings(); -#endif + /* Generate embedded library information variable definition */ + make_libinfo(); /* The interface initialization function */ printf("\n\ @@ -1119,8 +1155,8 @@ find_bias(int epos, int esize, int *perm, void *_a) /*------------------------------------------------------------------------- * Function: print_header - * - * Purpose: Prints the C file header for the generated file. + * + * Purpose: Prints the C file header for the generated file. * * Return: void * diff --git a/src/H5private.h b/src/H5private.h index 9c18be2..2c4576f 100644 --- a/src/H5private.h +++ b/src/H5private.h @@ -1520,6 +1520,7 @@ typedef struct H5_debug_t { extern H5_debug_t H5_debug_g; #define H5DEBUG(X) (H5_debug_g.pkg[H5_PKG_##X].stream) +extern char H5libhdf5_settings[]; /* embedded library information */ /*------------------------------------------------------------------------- * Purpose: These macros are inserted automatically just after the diff --git a/test/Makefile.am b/test/Makefile.am index 81c7362..d52606a 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -24,7 +24,7 @@ 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 $(srcdir)/testswmr.sh +TEST_SCRIPT = testerror.sh testlibinfo.sh $(srcdir)/testswmr.sh check_SCRIPTS = $(TEST_SCRIPT) SCRIPT_DEPEND = error_test$(EXEEXT) err_compat$(EXEEXT) diff --git a/test/Makefile.in b/test/Makefile.in index 406f02c..7d75ec1 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -53,7 +53,8 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ - $(srcdir)/testerror.sh.in $(top_srcdir)/config/commence.am \ + $(srcdir)/testerror.sh.in $(srcdir)/testlibinfo.sh.in \ + $(top_srcdir)/config/commence.am \ $(top_srcdir)/config/conclude.am COPYING bin_PROGRAMS = swmr_generator$(EXEEXT) swmr_reader$(EXEEXT) \ swmr_writer$(EXEEXT) @@ -68,7 +69,7 @@ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/bin/mkinstalldirs CONFIG_HEADER = $(top_builddir)/src/H5config.h -CONFIG_CLEAN_FILES = testerror.sh +CONFIG_CLEAN_FILES = testerror.sh testlibinfo.sh CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libh5test_la_LIBADD = @@ -679,7 +680,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog cmpd_dset.h5 \ INCLUDES = -I$(top_srcdir)/src -I$(top_builddir)/src # Test script for error_test and err_compat -TEST_SCRIPT = testerror.sh $(srcdir)/testswmr.sh +TEST_SCRIPT = testerror.sh testlibinfo.sh $(srcdir)/testswmr.sh check_SCRIPTS = $(TEST_SCRIPT) SCRIPT_DEPEND = error_test$(EXEEXT) err_compat$(EXEEXT) @@ -786,6 +787,8 @@ $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) $(am__aclocal_m4_deps): testerror.sh: $(top_builddir)/config.status $(srcdir)/testerror.sh.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ +testlibinfo.sh: $(top_builddir)/config.status $(srcdir)/testlibinfo.sh.in + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) diff --git a/test/testlibinfo.sh.in b/test/testlibinfo.sh.in new file mode 100644 index 0000000..97fb59d --- /dev/null +++ b/test/testlibinfo.sh.in @@ -0,0 +1,128 @@ +#! /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 the embedded library information feature. +# Part 1: +# Verify the HDF5 library does contains an exact copy of the content of the +# libhdf5.settings file. +# Part 2: +# If executable is linked with the static hdf5 library (how to determine?), +# verify an executable indeed contains an exact copy of hte content of the +# libhdf5.settings file. +# +# Programmer: Albert Cheng +# Sep 18, 2009 + +# Determine the configure options of the hdf5 library and executables. + +Shared_Lib=@enable_shared@ +Static_Lib=@enable_static@ +Static_exec=@STATIC_EXEC@ + + +# Print a line-line message left justified in a field of 70 characters. +# +LINEMSG() { + SPACES=" " + echo "Check file $* $SPACES" | cut -c1-70 | tr -d '\012' +} + + +# Print a "SKIP" message +SKIP() { + LINEMSG $* + echo " -SKIP-" +} + +# Function definitions +CHECK_LIBINFO(){ + LINEMSG $1 + if strings $1 | grep "SUMMARY OF THE HDF5 CONFIGURATION" > /dev/null; then + echo " PASSED" + else + echo " FAILED" + nerrors=`expr $nerrors + 1` + fi +} + + +# MAIN Body +nerrors=0 +H5_HAVE_EMBEDDED_LIBINFO=`grep '#define H5_HAVE_EMBEDDED_LIBINFO ' ../src/H5pubconf.h` + +# Skip the rest if embedded-libinfo is not enabled. +if [ -z "$H5_HAVE_EMBEDDED_LIBINFO" ]; then + echo "embedded-libinfo is not enabled. Test skipped." + exit 0 +fi + +# The location of HDF library file(s) depends on whether shared lib is +# built too. +if [ -n $Shared_Lib ]; then + h5libdir=../src/.libs +else + h5libdir=../src +fi + +# Different OS uses different naming for shared libs. +case `uname -s` in + Darwin) # MacOS + shlibsuffix=.dylib + break + ;; + *) # default + shlibsuffix=.so + break + ;; +esac + +h5libsettings=../src/libhdf5.settings + +# Part 1: +# Verify the HDF5 library does contains an exact copy of the content of the +# libhdf5.settings file. +# Check dynamic library file if built. +if [ x-$Shared_Lib = x-yes ]; then + CHECK_LIBINFO ${h5libdir}/libhdf5${shlibsuffix} +else + SKIP ${h5libdir}/libhdf5${shlibsuffix} +fi + +# Though rare, libhdf5.a may not have been built. +if [ x-$Static_Lib = x-yes ]; then + CHECK_LIBINFO ${h5libdir}/libhdf5.a +else + SKIP ${h5libdir}/libhdf5.a +fi + +# Check if executables has the lib information only if shared lib is not +# built or static-exec is used. (Don't care static-exec since it affects +# tools binary only.) +if [ x-$Shared_Lib != x-yes ]; then + CHECK_LIBINFO testhdf5 +else + SKIP testhdf5 +fi + + +if [ $nerrors -gt 0 ]; then + echo "***$nerrors errors encountered***" + exit 1 +else + echo "No error encountered" + exit 0 +fi -- cgit v0.12