From 9dc573798dc9d748c218999baac74561a331db02 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Fri, 14 Feb 2014 09:15:28 -0500 Subject: [svn-r24713] Update Windows VS version for README.txt --- CMakeInstallation.cmake | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/CMakeInstallation.cmake b/CMakeInstallation.cmake index 98c75c9..5ee7d7e 100644 --- a/CMakeInstallation.cmake +++ b/CMakeInstallation.cmake @@ -155,7 +155,13 @@ IF (WIN32) SET (BINARY_PLATFORM "${BINARY_PLATFORM} 8") ENDIF (${CMAKE_SYSTEM_VERSION} MATCHES "6.1") SET (BINARY_PLATFORM "${BINARY_PLATFORM} ${MSVC_C_ARCHITECTURE_ID}") - SET (BINARY_PLATFORM "${BINARY_PLATFORM}, using VISUAL STUDIO ${CMAKE_C_COMPILER_VERSION}") + IF (${CMAKE_C_COMPILER_VERSION} MATCHES "16.*") + SET (BINARY_PLATFORM "${BINARY_PLATFORM}, using VISUAL STUDIO 2010") + ELSEIF (${CMAKE_C_COMPILER_VERSION} MATCHES "17.*") + SET (BINARY_PLATFORM "${BINARY_PLATFORM}, using VISUAL STUDIO 2012") + ELSE (${CMAKE_C_COMPILER_VERSION} MATCHES "16.*") + SET (BINARY_PLATFORM "${BINARY_PLATFORM}, using VISUAL STUDIO ${CMAKE_C_COMPILER_VERSION}") + ENDIF (${CMAKE_C_COMPILER_VERSION} MATCHES "16.*") ELSEIF (APPLE) SET (BINARY_EXAMPLE_ENDING "tar.gz") SET (BINARY_INSTALL_ENDING "dmg") -- cgit v0.12 From 7c54d413ae3a26013394a179cc3c971d1d8e7d1b Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Fri, 14 Feb 2014 09:30:30 -0500 Subject: [svn-r24715] Add Windows VS version for README.txt --- CMakeInstallation.cmake | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CMakeInstallation.cmake b/CMakeInstallation.cmake index 5ee7d7e..7d4824a 100644 --- a/CMakeInstallation.cmake +++ b/CMakeInstallation.cmake @@ -157,6 +157,8 @@ IF (WIN32) SET (BINARY_PLATFORM "${BINARY_PLATFORM} ${MSVC_C_ARCHITECTURE_ID}") IF (${CMAKE_C_COMPILER_VERSION} MATCHES "16.*") SET (BINARY_PLATFORM "${BINARY_PLATFORM}, using VISUAL STUDIO 2010") + ELSEIF (${CMAKE_C_COMPILER_VERSION} MATCHES "15.*") + SET (BINARY_PLATFORM "${BINARY_PLATFORM}, using VISUAL STUDIO 2008") ELSEIF (${CMAKE_C_COMPILER_VERSION} MATCHES "17.*") SET (BINARY_PLATFORM "${BINARY_PLATFORM}, using VISUAL STUDIO 2012") ELSE (${CMAKE_C_COMPILER_VERSION} MATCHES "16.*") -- cgit v0.12 From d7f00b8002ff0b0fc291fa755cde54bc39d24f59 Mon Sep 17 00:00:00 2001 From: HDF Tester Date: Sun, 16 Feb 2014 03:32:48 -0500 Subject: [svn-r24716] Snapshot version 1.9 release 172 --- 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 d4f13e8..e15c454 100644 --- a/README.txt +++ b/README.txt @@ -1,4 +1,4 @@ -HDF5 version 1.9.172 currently under development +HDF5 version 1.9.173 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 8f303f3..5938d2d 100644 --- a/c++/src/Makefile.in +++ b/c++/src/Makefile.in @@ -469,7 +469,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 = 162 +LT_VERS_REVISION = 163 LT_VERS_AGE = 0 # Include src directory diff --git a/config/lt_vers.am b/config/lt_vers.am index 390a8f4..02f4ff5 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 = 162 +LT_VERS_REVISION = 163 LT_VERS_AGE = 0 ## If the API changes *at all*, increment LT_VERS_INTERFACE and diff --git a/configure b/configure index 6ec8850..903ab9d 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.172. +# Generated by GNU Autoconf 2.69 for HDF5 1.9.173. # # Report bugs to . # @@ -591,8 +591,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='HDF5' PACKAGE_TARNAME='hdf5' -PACKAGE_VERSION='1.9.172' -PACKAGE_STRING='HDF5 1.9.172' +PACKAGE_VERSION='1.9.173' +PACKAGE_STRING='HDF5 1.9.173' PACKAGE_BUGREPORT='help@hdfgroup.org' PACKAGE_URL='' @@ -1492,7 +1492,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.172 to adapt to many kinds of systems. +\`configure' configures HDF5 1.9.173 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1562,7 +1562,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of HDF5 1.9.172:";; + short | recursive ) echo "Configuration of HDF5 1.9.173:";; esac cat <<\_ACEOF @@ -1761,7 +1761,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -HDF5 configure 1.9.172 +HDF5 configure 1.9.173 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2855,7 +2855,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.172, which was +It was created by HDF5 $as_me 1.9.173, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -3687,7 +3687,7 @@ fi # Define the identity of the package. PACKAGE='hdf5' - VERSION='1.9.172' + VERSION='1.9.173' cat >>confdefs.h <<_ACEOF @@ -31676,7 +31676,7 @@ Usage: $0 [OPTIONS] Report bugs to ." lt_cl_version="\ -HDF5 config.lt 1.9.172 +HDF5 config.lt 1.9.173 configured by $0, generated by GNU Autoconf 2.69. Copyright (C) 2011 Free Software Foundation, Inc. @@ -33814,7 +33814,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.172, which was +This file was extended by HDF5 $as_me 1.9.173, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -33880,7 +33880,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.172 +HDF5 config.status 1.9.173 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff --git a/configure.ac b/configure.ac index bd41dba..1994226 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.172], [help@hdfgroup.org]) +AC_INIT([HDF5], [1.9.173], [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 0a2f8c5..6b0b3ff 100644 --- a/fortran/src/Makefile.in +++ b/fortran/src/Makefile.in @@ -520,7 +520,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 = 162 +LT_VERS_REVISION = 163 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 2a0040c..841fed7 100644 --- a/hl/c++/src/Makefile.in +++ b/hl/c++/src/Makefile.in @@ -460,7 +460,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 = 162 +LT_VERS_REVISION = 163 LT_VERS_AGE = 0 # Include src directory diff --git a/hl/fortran/src/Makefile.in b/hl/fortran/src/Makefile.in index 7aa93cc2..b7e0963 100644 --- a/hl/fortran/src/Makefile.in +++ b/hl/fortran/src/Makefile.in @@ -476,7 +476,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 = 162 +LT_VERS_REVISION = 163 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 29ea7ad..09c53df 100644 --- a/hl/src/Makefile.in +++ b/hl/src/Makefile.in @@ -459,7 +459,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 = 162 +LT_VERS_REVISION = 163 LT_VERS_AGE = 0 # This library is our main target. diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index b57254b..28d170e 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -1,4 +1,4 @@ -HDF5 version 1.9.172 currently under development +HDF5 version 1.9.173 currently under development ================================================================================ diff --git a/src/H5public.h b/src/H5public.h index 5bfc909..73ce009 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 172 /* For tweaks, bug-fixes, or development */ +#define H5_VERS_RELEASE 173 /* 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.172" /* Full version string */ +#define H5_VERS_INFO "HDF5 library version: 1.9.173" /* 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 edfa1dd..fb65265 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -520,7 +520,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 = 162 +LT_VERS_REVISION = 163 LT_VERS_AGE = 0 # Our main target, the HDF5 library diff --git a/vms/src/h5pubconf.h b/vms/src/h5pubconf.h index d647d0d..3b92a72 100644 --- a/vms/src/h5pubconf.h +++ b/vms/src/h5pubconf.h @@ -511,7 +511,7 @@ #define H5_PACKAGE_NAME "HDF5" /* Define to the full name and version of this package. */ -#define H5_PACKAGE_STRING "HDF5 1.9.172" +#define H5_PACKAGE_STRING "HDF5 1.9.173" /* Define to the one symbol short name of this package. */ #define H5_PACKAGE_TARNAME "hdf5" @@ -520,7 +520,7 @@ #define H5_PACKAGE_URL "" /* Define to the version of this package. */ -#define H5_PACKAGE_VERSION "1.9.172" +#define H5_PACKAGE_VERSION "1.9.173" /* Width for printf() for type `long long' or `__int64', use `ll' */ #define H5_PRINTF_LL_WIDTH "ll" @@ -683,7 +683,7 @@ /* #undef H5_USING_MEMCHECKER */ /* Version number of package */ -#define H5_VERSION "1.9.172" +#define H5_VERSION "1.9.173" /* Define if vsnprintf() returns the correct value for formatted strings that don't fit into size allowed */ -- cgit v0.12 From bf908ca553e3eadcb069b67e104462b7f00c3449 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 18 Feb 2014 10:07:53 -0500 Subject: [svn-r24722] Set NSIS display name --- CMakeInstallation.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/CMakeInstallation.cmake b/CMakeInstallation.cmake index 7d4824a..5da5007 100644 --- a/CMakeInstallation.cmake +++ b/CMakeInstallation.cmake @@ -275,6 +275,7 @@ IF (NOT HDF5_EXTERNALLY_CONFIGURED AND NOT HDF5_NO_PACKAGES) SET (CPACK_NSIS_PACKAGE_NAME "${HDF5_PACKAGE_STRING}") SET (CPACK_PACKAGE_INSTALL_REGISTRY_KEY "${HDF5_PACKAGE_STRING}-${LIB_TYPE}") ENDIF (CMAKE_CL_64) + SET (CPACK_NSIS_DISPLAY_NAME "@CPACK_NSIS_PACKAGE_NAME@, is a data model, library, and file format for storing and managing data") SET (CPACK_PACKAGE_INSTALL_DIRECTORY "${CPACK_PACKAGE_VENDOR}\\\\${CPACK_PACKAGE_NAME}\\\\${CPACK_PACKAGE_VERSION}") SET (CPACK_MONOLITHIC_INSTALL ON) SET (CPACK_NSIS_CONTACT "${HDF5_PACKAGE_BUGREPORT}") -- cgit v0.12 From d0ae86bc64d2bfedeeb605951eb2ca73a4d6b0b9 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 20 Feb 2014 15:18:42 -0500 Subject: [svn-r24724] Fix MPI linker flags with quotes --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 36fe47c..4664942 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -682,7 +682,7 @@ ENDIF (HDF5_ENABLE_PARALLEL) IF (H5_HAVE_PARALLEL) SET (LINK_LIBS ${LINK_LIBS} ${MPI_C_LIBRARIES}) IF (MPI_C_LINK_FLAGS) - SET (CMAKE_EXE_LINKER_FLAGS ${MPI_C_LINK_FLAGS} ${CMAKE_EXE_LINKER_FLAGS}) + SET (CMAKE_EXE_LINKER_FLAGS "${MPI_C_LINK_FLAGS} ${CMAKE_EXE_LINKER_FLAGS}") ENDIF (MPI_C_LINK_FLAGS) ENDIF (H5_HAVE_PARALLEL) -- cgit v0.12 From b30e37ea78a85c9a2e3abda7fddaabb636935b1c Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 20 Feb 2014 15:21:08 -0500 Subject: [svn-r24725] HDFFV-8629: h5repack will not attempt to remove UD filters. h5repack requires a check for UD filters that also must check if the filter can be dynamically loaded. This require a change in the library that checks for this. Tested: locally and reviewed --- src/H5Z.c | 38 +++--- tools/h5repack/CMakeTests.cmake | 2 +- tools/lib/h5tools_filters.c | 289 ++++++++++++++++++++-------------------- 3 files changed, 167 insertions(+), 162 deletions(-) diff --git a/src/H5Z.c b/src/H5Z.c index 901b506..c55a5e3 100644 --- a/src/H5Z.c +++ b/src/H5Z.c @@ -664,7 +664,13 @@ 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") + else if(ret_value == FALSE) { + const H5Z_class2_t *filter_info; + + if(NULL != (filter_info = (const H5Z_class2_t *)H5PL_load(H5PL_TYPE_FILTER, (int)id))) + ret_value = TRUE; + } /* end if */ done: FUNC_LEAVE_API(ret_value) @@ -1324,22 +1330,20 @@ H5Z_pipeline(const H5O_pline_t *pline, unsigned flags, */ if((fclass_idx = H5Z_find_idx(pline->filter[idx].id)) < 0) { hbool_t issue_error = FALSE; - - /* Check for "no plugins" indicated" */ - const H5Z_class2_t *filter_info; - - /* Try loading the filter */ - 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") - - /* 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 - issue_error = TRUE; + const H5Z_class2_t *filter_info; + + /* Try loading the filter */ + 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") + + /* 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 + issue_error = TRUE; /* Check for error */ if(issue_error) { diff --git a/tools/h5repack/CMakeTests.cmake b/tools/h5repack/CMakeTests.cmake index 95288f0..3252c30 100644 --- a/tools/h5repack/CMakeTests.cmake +++ b/tools/h5repack/CMakeTests.cmake @@ -1066,7 +1066,7 @@ ADD_H5_VERIFY_TEST (ckdim_smaller "TEST" 0 h5repack_layout3.h5 chunk_unlimit3 CO ############################################################################## IF (BUILD_SHARED_LIBS) ADD_H5_UD_TEST (plugin_test 0 h5repack_layout.h5 -v -f UD=257,1,9) -# ADD_H5_UD_TEST (plugin_none 0 h5repack_layout.UD.h5 -v -f NONE) + ADD_H5_UD_TEST (plugin_none 0 h5repack_layout.UD.h5 -v -f NONE) ELSE (BUILD_SHARED_LIBS) MESSAGE (STATUS " **** Plugins libraries must be built as shared libraries **** ") ADD_TEST ( diff --git a/tools/lib/h5tools_filters.c b/tools/lib/h5tools_filters.c index 2da21ef..3664a29 100644 --- a/tools/lib/h5tools_filters.c +++ b/tools/lib/h5tools_filters.c @@ -20,10 +20,10 @@ * print a warning message *------------------------------------------------------------------------- */ -static void print_warning(const char *dname, const char *fname) -{ - fprintf(stderr,"warning: dataset <%s> cannot be read, %s filter is not available\n", - dname,fname); +static void print_warning(const char *dname, const char *fname) { + fprintf(stderr, + "warning: dataset <%s> cannot be read, %s filter is not available\n", + dname, fname); } /*------------------------------------------------------------------------- @@ -46,109 +46,111 @@ int h5tools_canreadf(const char* name, /* object name, serves also as boolean pr hid_t dcpl_id) /* dataset creation property list */ { - int nfilters; /* number of filters */ - H5Z_filter_t filtn; /* filter identification number */ - int i; /* index */ - - - /* get information about filters */ - if ((nfilters = H5Pget_nfilters(dcpl_id))<0) - return -1; - - /* if we do not have filters, we can read the dataset safely */ - if (!nfilters) - return 1; - - /* check availability of filters */ - for(i = 0; i < nfilters; i++) - { - if((filtn = H5Pget_filter2(dcpl_id, (unsigned)i, 0, 0, 0, (size_t)0, 0, NULL)) < 0) - return -1; - - switch(filtn) - { -/*------------------------------------------------------------------------- - * user defined filter - *------------------------------------------------------------------------- - */ - default: - if(name) - print_warning(name, "user defined"); - return 0; - -/*------------------------------------------------------------------------- - * H5Z_FILTER_DEFLATE 1 , deflation like gzip - *------------------------------------------------------------------------- - */ - case H5Z_FILTER_DEFLATE: + int nfilters; /* number of filters */ + H5Z_filter_t filtn; /* filter identification number */ + int i; /* index */ + int udfilter_avail; /* index */ + + /* get information about filters */ + if ((nfilters = H5Pget_nfilters(dcpl_id)) < 0) + return -1; + + /* if we do not have filters, we can read the dataset safely */ + if (!nfilters) + return 1; + + /* check availability of filters */ + for (i = 0; i < nfilters; i++) { + if ((filtn = H5Pget_filter2(dcpl_id, (unsigned) i, 0, 0, 0, (size_t) 0, 0, NULL)) < 0) + return -1; + + switch (filtn) { + /*------------------------------------------------------------------------- + * user defined filter + *------------------------------------------------------------------------- + */ + default: + if ((udfilter_avail = H5Zfilter_avail(filtn)) < 0) + return -1; + else if (udfilter_avail == 0) { + if (name) + print_warning(name, "user defined"); + return 0; + } + break; + + /*------------------------------------------------------------------------- + * H5Z_FILTER_DEFLATE 1 , deflation like gzip + *------------------------------------------------------------------------- + */ + case H5Z_FILTER_DEFLATE: #ifndef H5_HAVE_FILTER_DEFLATE - if (name) - print_warning(name,"deflate"); - return 0; + if (name) + print_warning(name,"deflate"); + return 0; #endif - break; -/*------------------------------------------------------------------------- - * H5Z_FILTER_SZIP 4 , szip compression - *------------------------------------------------------------------------- - */ - case H5Z_FILTER_SZIP: + break; + /*------------------------------------------------------------------------- + * H5Z_FILTER_SZIP 4 , szip compression + *------------------------------------------------------------------------- + */ + case H5Z_FILTER_SZIP: #ifndef H5_HAVE_FILTER_SZIP - if (name) - print_warning(name,"SZIP"); - return 0; + if (name) + print_warning(name,"SZIP"); + return 0; #endif - break; -/*------------------------------------------------------------------------- - * H5Z_FILTER_SHUFFLE 2 , shuffle the data - *------------------------------------------------------------------------- - */ - case H5Z_FILTER_SHUFFLE: + break; + /*------------------------------------------------------------------------- + * H5Z_FILTER_SHUFFLE 2 , shuffle the data + *------------------------------------------------------------------------- + */ + case H5Z_FILTER_SHUFFLE: #ifndef H5_HAVE_FILTER_SHUFFLE - if (name) - print_warning(name,"shuffle"); - return 0; + if (name) + print_warning(name,"shuffle"); + return 0; #endif - break; -/*------------------------------------------------------------------------- - * H5Z_FILTER_FLETCHER32 3 , fletcher32 checksum of EDC - *------------------------------------------------------------------------- - */ - case H5Z_FILTER_FLETCHER32: + break; + /*------------------------------------------------------------------------- + * H5Z_FILTER_FLETCHER32 3 , fletcher32 checksum of EDC + *------------------------------------------------------------------------- + */ + case H5Z_FILTER_FLETCHER32: #ifndef H5_HAVE_FILTER_FLETCHER32 - if (name) - print_warning(name,"fletcher32"); - return 0; + if (name) + print_warning(name,"fletcher32"); + return 0; #endif - break; -/*------------------------------------------------------------------------- - * H5Z_FILTER_NBIT - *------------------------------------------------------------------------- - */ - case H5Z_FILTER_NBIT: + break; + /*------------------------------------------------------------------------- + * H5Z_FILTER_NBIT + *------------------------------------------------------------------------- + */ + case H5Z_FILTER_NBIT: #ifndef H5_HAVE_FILTER_NBIT - if (name) - print_warning(name,"nbit"); - return 0; + if (name) + print_warning(name,"nbit"); + return 0; #endif - break; -/*------------------------------------------------------------------------- - * H5Z_FILTER_SCALEOFFSET - *------------------------------------------------------------------------- - */ - case H5Z_FILTER_SCALEOFFSET: + break; + /*------------------------------------------------------------------------- + * H5Z_FILTER_SCALEOFFSET + *------------------------------------------------------------------------- + */ + case H5Z_FILTER_SCALEOFFSET: #ifndef H5_HAVE_FILTER_SCALEOFFSET - if (name) - print_warning(name,"scaleoffset"); - return 0; + if (name) + print_warning(name,"scaleoffset"); + return 0; #endif - break; - }/*switch*/ - }/*for*/ + break; + }/*switch*/ + }/*for*/ - return 1; + return 1; } - /*------------------------------------------------------------------------- * Function: h5tools_canwritef * @@ -164,71 +166,70 @@ int h5tools_canreadf(const char* name, /* object name, serves also as boolean pr * *------------------------------------------------------------------------- */ -int h5tools_can_encode( H5Z_filter_t filtn) -{ - switch (filtn) - { - /* user defined filter */ - default: - return 0; +int h5tools_can_encode(H5Z_filter_t filtn) { + switch (filtn) { + /* user defined filter */ + default: + return 0; - case H5Z_FILTER_DEFLATE: + case H5Z_FILTER_DEFLATE: #ifndef H5_HAVE_FILTER_DEFLATE - return 0; + return 0; #endif - break; - case H5Z_FILTER_SZIP: + break; + case H5Z_FILTER_SZIP: #ifndef H5_HAVE_FILTER_SZIP - return 0; + return 0; #else - { - unsigned int filter_config_flags; - - if(H5Zget_filter_info(filtn, &filter_config_flags)<0) - return -1; - if ((filter_config_flags & - (H5Z_FILTER_CONFIG_ENCODE_ENABLED|H5Z_FILTER_CONFIG_DECODE_ENABLED)) == 0) { - /* filter present but neither encode nor decode is supported (???) */ - return -1; - } else if ((filter_config_flags & - (H5Z_FILTER_CONFIG_ENCODE_ENABLED|H5Z_FILTER_CONFIG_DECODE_ENABLED)) == - H5Z_FILTER_CONFIG_DECODE_ENABLED) { - /* decoder only: read but not write */ - return 0; - } else if ((filter_config_flags & - (H5Z_FILTER_CONFIG_ENCODE_ENABLED|H5Z_FILTER_CONFIG_DECODE_ENABLED)) == - H5Z_FILTER_CONFIG_ENCODE_ENABLED) { - /* encoder only: write but not read (???) */ - return -1; - } else if ((filter_config_flags & - (H5Z_FILTER_CONFIG_ENCODE_ENABLED|H5Z_FILTER_CONFIG_DECODE_ENABLED)) == - (H5Z_FILTER_CONFIG_ENCODE_ENABLED|H5Z_FILTER_CONFIG_DECODE_ENABLED)) { - return 1; - } - } + { + unsigned int filter_config_flags; + + if (H5Zget_filter_info(filtn, &filter_config_flags) < 0) + return -1; + if ((filter_config_flags + & (H5Z_FILTER_CONFIG_ENCODE_ENABLED | H5Z_FILTER_CONFIG_DECODE_ENABLED)) == 0) { + /* filter present but neither encode nor decode is supported (???) */ + return -1; + } + else if ((filter_config_flags + & (H5Z_FILTER_CONFIG_ENCODE_ENABLED | H5Z_FILTER_CONFIG_DECODE_ENABLED)) == H5Z_FILTER_CONFIG_DECODE_ENABLED) { + /* decoder only: read but not write */ + return 0; + } + else if ((filter_config_flags + & (H5Z_FILTER_CONFIG_ENCODE_ENABLED | H5Z_FILTER_CONFIG_DECODE_ENABLED)) == H5Z_FILTER_CONFIG_ENCODE_ENABLED) { + /* encoder only: write but not read (???) */ + return -1; + } + else if ((filter_config_flags + & (H5Z_FILTER_CONFIG_ENCODE_ENABLED | H5Z_FILTER_CONFIG_DECODE_ENABLED)) + == (H5Z_FILTER_CONFIG_ENCODE_ENABLED | H5Z_FILTER_CONFIG_DECODE_ENABLED)) { + return 1; + } + } #endif - break; - case H5Z_FILTER_SHUFFLE: + break; + case H5Z_FILTER_SHUFFLE: #ifndef H5_HAVE_FILTER_SHUFFLE - return 0; + return 0; #endif - break; - case H5Z_FILTER_FLETCHER32: + break; + case H5Z_FILTER_FLETCHER32: #ifndef H5_HAVE_FILTER_FLETCHER32 - return 0; + return 0; #endif - break; - case H5Z_FILTER_NBIT: + break; + case H5Z_FILTER_NBIT: #ifndef H5_HAVE_FILTER_NBIT - return 0; + return 0; #endif - break; - case H5Z_FILTER_SCALEOFFSET: + break; + case H5Z_FILTER_SCALEOFFSET: #ifndef H5_HAVE_FILTER_SCALEOFFSET - return 0; + return 0; #endif - break; - }/*switch*/ + break; + }/*switch*/ - return 1; + return 1; } -- cgit v0.12 From 1e36b5a348415501aa8eb992fd57c09d834900cd Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Thu, 20 Feb 2014 16:29:26 -0500 Subject: [svn-r24726] Description: Revert some earlier usage of strncpy, which was incorrect. Bring Coverity changes from branch back to trunk: r20821: Use HDstrncpy. --gh (Fixed already, with strdup) r20822: (Not merged, incorrect use of HDstrncpy()) r20823: (Not merged, incorrect use of HDstrncpy()) r20824: Maintenance: Bug fix: addressed CID 666. Value stored at *expression_len should be used in the call to HD5packFstring to avoid overflow (and unnecessary arithmetic calculation and casting) r20825: Issue 642: Added check for error and handler with print to stderr and exit. r20826: Undo revision 20818, as that issue has already been fixed in the 1.8 branch and trunk (but not coverity branch) r20827: (Not merged, incorrect use of HDstrncpy()) r20828: Use HDstrncpy. --gh (Corrected use of strncpy()) r20829: Check return of H5Lget_val(print_udata->fid, path, targbuf, linfo->u.val_size + 1, H5P_DEFAULT) and if error set trgbuf[0] to 0. Check if H5Lunpack_elink_val(targbuf, linfo->u.val_size, NULL, &filename, &objname) was successful and allow print. Otherwise filename and objname are not created. (init those to NULL) r20830: resolved coverity issues 939, 940, 941, 944, and 947. all were complaints about use of sprintf, and in all cases, the buffers used were large enough for all eventualities. Resolved issue by replacing calls to sprintf with calls to snprintf. r20831: Maintenance: Addressed CID 852 Replaced sprintf with snprintf r20832: Purpose: Fix valgrind issues with hl/examples/ex_image2 Description: Modified hl/examples/ex_image2 to free global "gbuf" before exit. Tested on: Mac OSX/64 10.9.1 (amaon) w/C++, FORTRAN & Threadsafety (too minor to require h5committest) --- fortran/src/H5Pf.c | 77 +++++++++++-------------------- fortran/src/H5match_types.c | 47 +++++++++---------- hl/examples/ex_image2.c | 17 +++++-- perform/pio_engine.c | 3 +- perform/sio_engine.c | 3 +- src/H5HGdbg.c | 74 ++++++++++++++--------------- src/H5HLdbg.c | 26 ++++++----- src/H5Lexternal.c | 12 +++-- src/H5Oattr.c | 20 ++++---- src/H5Oefl.c | 11 +++-- src/H5system.c | 24 ++++++---- test/h5test.c | 8 ++-- tools/h5dump/h5dump_xml.c | 110 ++++++++++++++++++++++---------------------- tools/lib/h5trav.c | 36 ++++++++++----- tools/misc/h5debug.c | 5 +- 15 files changed, 243 insertions(+), 230 deletions(-) diff --git a/fortran/src/H5Pf.c b/fortran/src/H5Pf.c index 262ce55..cf10efc 100644 --- a/fortran/src/H5Pf.c +++ b/fortran/src/H5Pf.c @@ -324,30 +324,23 @@ nh5pset_chunk_c ( hid_t_f *prp_id, int_f *rank, hsize_t_f *dims ) /******/ { int ret_value = -1; - hid_t c_prp_id; - int c_rank; - hsize_t *c_dims; + hid_t c_prp_id = (hid_t)*prp_id; + int c_rank = (int)*rank; + hsize_t c_dims[H5S_MAX_RANK]; herr_t status; int i; - c_dims = (hsize_t *)HDmalloc(sizeof(hsize_t) * (*rank )); - if (!c_dims) return ret_value; - /* * Transpose dimension arrays because of C-FORTRAN storage order */ - for (i = 0; i < *rank ; i++) { - c_dims[i] = dims[*rank - i - 1]; - } + for (i = 0; i < c_rank ; i++) + c_dims[i] = (hsize_t)dims[c_rank - i - 1]; - c_prp_id = (hid_t)*prp_id; - c_rank = (int)*rank; status = H5Pset_chunk(c_prp_id, c_rank, c_dims); if (status < 0) goto DONE; ret_value = 0; DONE: - HDfree (c_dims); return ret_value; } @@ -375,26 +368,19 @@ nh5pget_chunk_c ( hid_t_f *prp_id, int_f *max_rank, hsize_t_f *dims ) /******/ { int ret_value = -1; - hid_t c_prp_id; - hsize_t *c_dims; + hid_t c_prp_id = (hid_t)*prp_id; + hsize_t c_dims[H5S_MAX_RANK]; int rank; - int c_max_rank; + int c_max_rank = (int)*max_rank; int i; - c_dims = (hsize_t *)HDmalloc(sizeof(hsize_t) * (*max_rank )); - if (!c_dims) return ret_value; - - c_prp_id = (hid_t)*prp_id; - c_max_rank = (int)*max_rank; rank = H5Pget_chunk(c_prp_id, c_max_rank, c_dims); /* * Transpose dimension arrays because of C-FORTRAN storage order */ - for (i = 0; i < *max_rank ; i++) { - dims[*max_rank - i - 1] = (hsize_t_f)c_dims[i]; - } - HDfree (c_dims); + for (i = 0; i < c_max_rank ; i++) + dims[c_max_rank - i - 1] = (hsize_t_f)c_dims[i]; if (rank < 0) return ret_value; ret_value = (int_f)rank; return ret_value; @@ -1801,18 +1787,15 @@ nh5pset_filter_c (hid_t_f *prp_id, int_f* filter, int_f* flags, size_t_f* cd_nel /******/ { int ret_value = -1; - hid_t c_prp_id; + hid_t c_prp_id = (hid_t)*prp_id; herr_t ret; - size_t c_cd_nelmts; - unsigned int c_flags; - H5Z_filter_t c_filter; + size_t c_cd_nelmts = (size_t)*cd_nelmts; + unsigned int c_flags = (unsigned)*flags; + H5Z_filter_t c_filter = (H5Z_filter_t)*filter; unsigned int * c_cd_values; unsigned i; - c_filter = (H5Z_filter_t)*filter; - c_flags = (unsigned)*flags; - c_cd_nelmts = (size_t)*cd_nelmts; - c_cd_values = (unsigned int*)HDmalloc(sizeof(unsigned int) * ((int)c_cd_nelmts)); + c_cd_values = (unsigned int*)HDmalloc(sizeof(unsigned int) * c_cd_nelmts); if (!c_cd_values) return ret_value; for (i = 0; i < c_cd_nelmts; i++) c_cd_values[i] = (unsigned int)cd_values[i]; @@ -1820,7 +1803,6 @@ nh5pset_filter_c (hid_t_f *prp_id, int_f* filter, int_f* flags, size_t_f* cd_nel /* * Call H5Pset_filter function. */ - c_prp_id = (hid_t)*prp_id; ret = H5Pset_filter(c_prp_id, c_filter, c_flags, c_cd_nelmts,c_cd_values ); if (ret < 0) goto DONE; @@ -1967,13 +1949,12 @@ nh5pset_external_c (hid_t_f *prp_id, _fcd name, int_f* namelen, off_t_f* offset, herr_t ret; hsize_t c_bytes; char* c_name; - size_t c_namelen; + size_t c_namelen = (size_t)*namelen; off_t c_offset; c_bytes = (hsize_t) *bytes; c_offset = (off_t) *offset; - c_namelen = (int)*namelen; c_name = (char *)HD5f2cstring(name, c_namelen); if (c_name == NULL) return ret_value; @@ -3819,7 +3800,7 @@ nh5pset_fapl_multi_c ( hid_t_f *prp_id , int_f *memb_map, hid_t_f *memb_fapl, _f * Check that we got correct values from Fortran for memb_addr array */ for (i=0; i < H5FD_MEM_NTYPES; i++) { - if(memb_addr[i] >= 1.) return ret_value; + if(memb_addr[i] >= 1.0f) return ret_value; } /* * Take care of names array @@ -3971,7 +3952,7 @@ HD5packFstring(tmp, _fcdtocp(memb_name), (size_t)(c_lenmax*H5FD_MEM_NTYPES)); memb_map[i] = (int_f)c_memb_map[i]; memb_fapl[i] = (hid_t_f)c_memb_fapl[i]; if(c_memb_addr[i] == HADDR_UNDEF) memb_addr[i] = -1; - else memb_addr[i] = (real_f) ((long)c_memb_addr[i]/HADDR_MAX); + else memb_addr[i] = (real_f) (c_memb_addr[i]/HADDR_MAX); } *flag = (int_f)relax; *maxlen_out = (int_f)length; @@ -4104,7 +4085,7 @@ nh5pget_filter_by_id_c(hid_t_f *prp_id, int_f* filter_id, int_f* flags, size_t_f if(NULL == (c_name = (char *)HDmalloc((size_t)*namelen + 1))) goto DONE; - if(NULL == (c_cd_values = (unsigned int *)HDmalloc(sizeof(unsigned int) * ((int)c_cd_nelmts_in)))) + if(NULL == (c_cd_values = (unsigned int *)HDmalloc(sizeof(unsigned int) * c_cd_nelmts_in))) goto DONE; /* @@ -4157,18 +4138,15 @@ nh5pmodify_filter_c (hid_t_f *prp_id, int_f* filter, int_f* flags, size_t_f* cd_ /******/ { int_f ret_value = -1; - hid_t c_prp_id; + hid_t c_prp_id = (hid_t)*prp_id; herr_t ret; - size_t c_cd_nelmts; - unsigned int c_flags; - H5Z_filter_t c_filter; + size_t c_cd_nelmts = (size_t)*cd_nelmts; + unsigned int c_flags = (unsigned)*flags; + H5Z_filter_t c_filter = (H5Z_filter_t)*filter; unsigned int * c_cd_values; unsigned i; - c_filter = (H5Z_filter_t)*filter; - c_flags = (unsigned)*flags; - c_cd_nelmts = (size_t)*cd_nelmts; - c_cd_values = (unsigned int *)HDmalloc(sizeof(unsigned int) * ((int)c_cd_nelmts)); + c_cd_values = (unsigned int *)HDmalloc(sizeof(unsigned int) * c_cd_nelmts); if (!c_cd_values) return ret_value; for (i = 0; i < c_cd_nelmts; i++) c_cd_values[i] = (unsigned int)cd_values[i]; @@ -4176,7 +4154,6 @@ nh5pmodify_filter_c (hid_t_f *prp_id, int_f* filter, int_f* flags, size_t_f* cd_ /* * Call H5Pmodify_filter function. */ - c_prp_id = (hid_t)*prp_id; ret = H5Pmodify_filter(c_prp_id, c_filter, c_flags, c_cd_nelmts,c_cd_values ); if (ret < 0) goto DONE; @@ -4905,12 +4882,10 @@ nh5pget_data_transform_c(hid_t_f *plist_id, _fcd expression, int_f *expression_l /******/ { char *c_expression = NULL; /* Buffer to hold C string */ - size_t c_expression_len; + size_t c_expression_len = (size_t)*expression_len + 1; ssize_t ret; int_f ret_value = 0; - c_expression_len = (size_t)*expression_len + 1; - /* * Allocate memory to store the expression. */ @@ -4928,7 +4903,7 @@ nh5pget_data_transform_c(hid_t_f *plist_id, _fcd expression, int_f *expression_l HGOTO_DONE(FAIL) /* or strlen ? */ - HD5packFstring(c_expression, _fcdtocp(expression), c_expression_len - 1); + HD5packFstring(c_expression, _fcdtocp(expression), (size_t)*expression_len); *size = (size_t_f)ret; diff --git a/fortran/src/H5match_types.c b/fortran/src/H5match_types.c index eb30775..3ae4bdb 100644 --- a/fortran/src/H5match_types.c +++ b/fortran/src/H5match_types.c @@ -51,8 +51,8 @@ FILE * fort_header; void writeTypedef(const char* c_type, unsigned int size); void writeFloatTypedef(const char* c_type, unsigned int size); void writeTypedefDefault(unsigned int size); -void writeToFiles(const char* fortran_type, const char* c_type, unsigned int size, unsigned int kind); -void writeFloatToFiles(const char* fortran_type, const char* c_type, unsigned int size, unsigned int kind); +void writeToFiles(const char* fortran_type, const char* c_type, int size, unsigned int kind); +void writeFloatToFiles(const char* fortran_type, const char* c_type, int size, unsigned int kind); static void initCfile(void) @@ -141,26 +141,26 @@ void writeTypedefDefault(unsigned int size) } /* Create matching Fortran and C types by writing to both files */ -void writeToFiles(const char* fortran_type, const char* c_type, unsigned int size, unsigned int kind) +void writeToFiles(const char* fortran_type, const char* c_type, int size, unsigned int kind) { fprintf(fort_header, " INTEGER, PARAMETER :: %s = %u\n", fortran_type, kind); - fprintf(c_header, "typedef c_int_%u %s;\n", size, c_type); + fprintf(c_header, "typedef c_int_%d %s;\n", size, c_type); } /* Create matching Fortran and C floating types by writing to both files */ -void writeFloatToFiles(const char* fortran_type, const char* c_type, unsigned int size, unsigned int kind) +void writeFloatToFiles(const char* fortran_type, const char* c_type, int size, unsigned int kind) { fprintf(fort_header, " INTEGER, PARAMETER :: %s = %u\n", fortran_type, kind); - fprintf(c_header, "typedef c_float_%u %s;\n", size, c_type); + fprintf(c_header, "typedef c_float_%d %s;\n", size, c_type); } int main(void) { int FoundIntSize[4]; - int FoundIntSizeKind[4]; + unsigned FoundIntSizeKind[4]; int FoundRealSize[3]; - int FoundRealSizeKind[3]; + unsigned FoundRealSizeKind[3]; int i,j,flag; char chrA[20],chrB[20]; int H5_C_HAS_REAL_NATIVE_16; @@ -395,8 +395,8 @@ int main(void) for(i=0;i<4;i++) { if( FoundIntSize[i] > 0) /* Found the integer type */ { - sprintf(chrA, "Fortran_INTEGER_%d", FoundIntSize[i]); - sprintf(chrB, "int_%d_f", FoundIntSize[i]); + snprintf(chrA, sizeof(chrA), "Fortran_INTEGER_%d", FoundIntSize[i]); + snprintf(chrB, sizeof(chrB), "int_%d_f", FoundIntSize[i]); writeToFiles(chrA, chrB, FoundIntSize[i], FoundIntSizeKind[i]); } else /* Did not find the integer type */ @@ -406,8 +406,8 @@ int main(void) { if( FoundIntSize[j] > 0) /* Found the next highest */ { - sprintf(chrA, "Fortran_INTEGER_%d", (-1)*FoundIntSize[i]); - sprintf(chrB, "int_%d_f", (-1)*FoundIntSize[i]); + snprintf(chrA, sizeof(chrA), "Fortran_INTEGER_%d", (-1)*FoundIntSize[i]); + snprintf(chrB, sizeof(chrB), "int_%d_f", (-1)*FoundIntSize[i]); writeToFiles(chrA, chrB, FoundIntSize[j], FoundIntSizeKind[j]); flag = 1; break; @@ -419,8 +419,8 @@ int main(void) { if( FoundIntSize[j] > 0) /* Found the next lowest */ { - sprintf(chrA, "Fortran_INTEGER_%d", (-1)*FoundIntSize[i]); - sprintf(chrB, "int_%d_f", (-1)*FoundIntSize[i]); + snprintf(chrA, sizeof(chrA), "Fortran_INTEGER_%d", (-1)*FoundIntSize[i]); + snprintf(chrB, sizeof(chrB), "int_%d_f", (-1)*FoundIntSize[i]); writeToFiles(chrA, chrB, FoundIntSize[j], FoundIntSizeKind[j]); flag = 1; break; @@ -428,9 +428,7 @@ int main(void) } } if(flag == 0) /* No higher or lower one found, indicating an error */ - { return -1; - } } } @@ -464,8 +462,8 @@ int main(void) for(i=0;i<3;i++) { if( FoundRealSize[i] > 0) /* Found the real type */ { - sprintf(chrA, "Fortran_REAL_%d", FoundRealSize[i]); - sprintf(chrB, "real_%d_f", FoundRealSize[i]); + snprintf(chrA, sizeof(chrA), "Fortran_REAL_%d", FoundRealSize[i]); + snprintf(chrB, sizeof(chrB), "real_%d_f", FoundRealSize[i]); writeFloatToFiles(chrA, chrB, FoundRealSize[i], FoundRealSizeKind[i]); } else /* Did not find the real type */ @@ -475,8 +473,8 @@ int main(void) { if( FoundRealSize[j] > 0) /* Found the next highest */ { - sprintf(chrA, "Fortran_REAL_%d", (-1)*FoundRealSize[i]); - sprintf(chrB, "real_%d_f", (-1)*FoundRealSize[i]); + snprintf(chrA, sizeof(chrA), "Fortran_REAL_%d", (-1)*FoundRealSize[i]); + snprintf(chrB, sizeof(chrB), "real_%d_f", (-1)*FoundRealSize[i]); if(FoundRealSize[j]>4) { writeFloatToFiles(chrA, chrB, FoundRealSize[j], FoundRealSizeKind[j]); flag = 1; @@ -494,11 +492,10 @@ int main(void) { if( FoundRealSize[j] > 0) /* Found the next lowest */ { - sprintf(chrA, "Fortran_REAL_%d", (-1)*FoundRealSize[i]); - sprintf(chrB, "real_%d_f", (-1)*FoundRealSize[i]); - if(FoundRealSize[j]>4) { + snprintf(chrA, sizeof(chrA), "Fortran_REAL_%d", (-1)*FoundRealSize[i]); + snprintf(chrB, sizeof(chrB), "real_%d_f", (-1)*FoundRealSize[i]); + if(FoundRealSize[j]>4) writeFloatToFiles(chrA, chrB, FoundRealSize[j], FoundRealSizeKind[j]); - } /* else { */ /* writeFloatToFiles(chrA, chrB, FoundRealSize[j]); */ /* } */ @@ -508,9 +505,7 @@ int main(void) } } if(flag == 0) /* No higher or lower one found, indicating an error */ - { return -1; - } } } diff --git a/hl/examples/ex_image2.c b/hl/examples/ex_image2.c index 76c3a75..3276f7c 100644 --- a/hl/examples/ex_image2.c +++ b/hl/examples/ex_image2.c @@ -26,7 +26,7 @@ #define PAL_ENTRIES 256 static int read_data(const char* file_name, hsize_t *width, hsize_t *height ); -unsigned char *gbuf = 0; /* global buffer for image data */ +unsigned char *gbuf = NULL; /* global buffer for image data */ int main( void ) { @@ -79,18 +79,25 @@ int main( void ) /* make dataset */ status=H5IMmake_image_24bit( file_id, IMAGE2_NAME, width, height, "INTERLACE_PIXEL", gbuf ); - if (gbuf) { - free(gbuf); - gbuf = NULL; - } /* close the file. */ H5Fclose( file_id ); + if(gbuf) { + free(gbuf); + gbuf = NULL; + } + return 0; out: printf("Error on return function...Exiting\n"); + + if(gbuf) { + free(gbuf); + gbuf = NULL; + } + return 1; } diff --git a/perform/pio_engine.c b/perform/pio_engine.c index 87fa82c..d34fe38 100644 --- a/perform/pio_engine.c +++ b/perform/pio_engine.c @@ -464,7 +464,8 @@ pio_create_filename(iotype iot, const char *base_name, char *fullname, size_t si } else { /* We didn't append the prefix yet */ - HDstrncpy(fullname, prefix, MIN(HDstrlen(prefix), size)); + HDstrncpy(fullname, prefix, size); + fullname[size - 1] = '\0'; } if ((HDstrlen(fullname) + HDstrlen(base_name) + 1) < size) { diff --git a/perform/sio_engine.c b/perform/sio_engine.c index 8539f75..4ce3aa0 100644 --- a/perform/sio_engine.c +++ b/perform/sio_engine.c @@ -371,7 +371,8 @@ sio_create_filename(iotype iot, const char *base_name, char *fullname, size_t si fullname[i] = subdir[j]; } else { /* We didn't append the prefix yet */ - HDstrncpy(fullname, prefix, MIN(HDstrlen(prefix), size)); + HDstrncpy(fullname, prefix, size); + fullname[size - 1] = '\0'; } if ((HDstrlen(fullname) + HDstrlen(base_name) + 1) < size) { diff --git a/src/H5HGdbg.c b/src/H5HGdbg.c index 74044cb..16d8c49 100644 --- a/src/H5HGdbg.c +++ b/src/H5HGdbg.c @@ -91,9 +91,8 @@ H5HG_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, unsigned u, nused, maxobj; unsigned j, k; H5HG_heap_t *h = NULL; - char buf[64]; uint8_t *p = NULL; - herr_t ret_value=SUCCEED; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -107,66 +106,69 @@ H5HG_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, if(NULL == (h = H5HG_protect(f, dxpl_id, addr, H5AC_READ))) HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, FAIL, "unable to protect global heap collection"); - fprintf(stream, "%*sGlobal Heap Collection...\n", indent, ""); - fprintf(stream, "%*s%-*s %d\n", indent, "", fwidth, + HDfprintf(stream, "%*sGlobal Heap Collection...\n", indent, ""); + HDfprintf(stream, "%*s%-*s %d\n", indent, "", fwidth, "Dirty:", (int)(h->cache_info.is_dirty)); - fprintf(stream, "%*s%-*s %lu\n", indent, "", fwidth, + HDfprintf(stream, "%*s%-*s %lu\n", indent, "", fwidth, "Total collection size in file:", (unsigned long)(h->size)); - for (u=1, nused=0, maxobj=0; unused; u++) { - if (h->obj[u].begin) { + for(u = 1, nused = 0, maxobj = 0; u < h->nused; u++) + if(h->obj[u].begin) { nused++; - if (u>maxobj) maxobj = u; + if (u>maxobj) + maxobj = u; } - } - fprintf (stream, "%*s%-*s %u/%lu/", indent, "", fwidth, + HDfprintf(stream, "%*s%-*s %u/%lu/", indent, "", fwidth, "Objects defined/allocated/max:", - nused, (unsigned long)h->nalloc); + nused, + (unsigned long)h->nalloc); if(nused) - fprintf(stream, "%u\n", maxobj); + HDfprintf(stream, "%u\n", maxobj); else - fprintf(stream, "NA\n"); + HDfprintf(stream, "NA\n"); - fprintf (stream, "%*s%-*s %lu\n", indent, "", fwidth, + HDfprintf(stream, "%*s%-*s %lu\n", indent, "", fwidth, "Free space:", (unsigned long)(h->obj[0].size)); - for (u=1; unused; u++) { - if (h->obj[u].begin) { - sprintf (buf, "Object %u", u); - fprintf (stream, "%*s%s\n", indent, "", buf); - fprintf (stream, "%*s%-*s %lu\n", indent+3, "", MIN(fwidth-3, 0), + for(u = 1; u < h->nused; u++) + if(h->obj[u].begin) { + char buf[64]; + + HDsnprintf(buf, sizeof(buf), "Object %u", u); + HDfprintf(stream, "%*s%s\n", indent, "", buf); + HDfprintf(stream, "%*s%-*s %lu\n", indent + 3, "", MIN(fwidth - 3, 0), "Obffset in block:", (unsigned long)(h->obj[u].begin - h->chunk)); - fprintf (stream, "%*s%-*s %d\n", indent+3, "", MIN(fwidth-3, 0), + HDfprintf(stream, "%*s%-*s %d\n", indent + 3, "", MIN(fwidth - 3, 0), "Reference count:", h->obj[u].nrefs); - fprintf (stream, "%*s%-*s %lu/%lu\n", indent+3, "", - MIN(fwidth-3, 0), + HDfprintf(stream, "%*s%-*s %lu/%lu\n", indent + 3, "", + MIN(fwidth - 3, 0), "Size of object body:", (unsigned long)(h->obj[u].size), (unsigned long)H5HG_ALIGN(h->obj[u].size)); - p = h->obj[u].begin + H5HG_SIZEOF_OBJHDR (f); - for (j=0; jobj[u].size; j+=16) { - fprintf (stream, "%*s%04u: ", indent+6, "", j); - for (k=0; k<16; k++) { - if (8==k) fprintf (stream, " "); - if (j+kobj[u].size) { - fprintf (stream, "%02x ", p[j+k]); - } else { + p = h->obj[u].begin + H5HG_SIZEOF_OBJHDR(f); + for(j = 0; j < h->obj[u].size; j += 16) { + HDfprintf(stream, "%*s%04u: ", indent + 6, "", j); + for(k = 0; k < 16; k++) { + if(8 == k) + HDfprintf(stream, " "); + if(j + k < h->obj[u].size) + HDfprintf(stream, "%02x ", p[j + k]); + else HDfputs(" ", stream); - } } - for (k=0; k<16 && j+kobj[u].size; k++) { - if (8==k) fprintf (stream, " "); - HDfputc(p[j+k]>' ' && p[j+k]<='~' ? p[j+k] : '.', stream); + for(k = 0; k < 16 && j + k < h->obj[u].size; k++) { + if(8 == k) + HDfprintf(stream, " "); + HDfputc(p[j + k]>' ' && p[j + k] <= '~' ? p[j + k] : '.', stream); } - fprintf (stream, "\n"); + HDfprintf(stream, "\n"); } } - } done: if (h && H5AC_unprotect(f, dxpl_id, H5AC_GHEAP, addr, h, H5AC__NO_FLAGS_SET) < 0) diff --git a/src/H5HLdbg.c b/src/H5HLdbg.c index 29d5c82..4ac22b8 100644 --- a/src/H5HLdbg.c +++ b/src/H5HLdbg.c @@ -54,8 +54,8 @@ herr_t H5HL_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE * stream, int indent, int fwidth) { H5HL_t *h = NULL; - int i, overlap, free_block; - H5HL_free_t *freelist = NULL; + int free_block; + H5HL_free_t *freelist; uint8_t *marker = NULL; size_t amount_free = 0; herr_t ret_value = SUCCEED; /* Return value */ @@ -72,8 +72,8 @@ H5HL_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE * stream, int indent, int if(NULL == (h = (H5HL_t *)H5HL_protect(f, dxpl_id, addr, H5AC_READ))) HGOTO_ERROR(H5E_HEAP, H5E_CANTLOAD, FAIL, "unable to load heap") - fprintf(stream, "%*sLocal Heap...\n", indent, ""); - fprintf(stream, "%*s%-*s %lu\n", indent, "", fwidth, + HDfprintf(stream, "%*sLocal Heap...\n", indent, ""); + HDfprintf(stream, "%*s%-*s %lu\n", indent, "", fwidth, "Header size (in bytes):", (unsigned long)h->prfx_size); HDfprintf(stream, "%*s%-*s %a\n", indent, "", fwidth, @@ -90,34 +90,36 @@ H5HL_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE * stream, int indent, int if(NULL == (marker = (uint8_t *)H5MM_calloc(h->dblk_size))) HGOTO_ERROR(H5E_HEAP, H5E_CANTALLOC, FAIL, "memory allocation failed") - fprintf(stream, "%*sFree Blocks (offset, size):\n", indent, ""); - + HDfprintf(stream, "%*sFree Blocks (offset, size):\n", indent, ""); for(free_block = 0, freelist = h->freelist; freelist; freelist = freelist->next, free_block++) { char temp_str[32]; - sprintf(temp_str,"Block #%d:",free_block); + HDsnprintf(temp_str, sizeof(temp_str), "Block #%d:", free_block); HDfprintf(stream, "%*s%-*s %8Zu, %8Zu\n", indent+3, "", MAX(0,fwidth-9), temp_str, freelist->offset, freelist->size); if((freelist->offset + freelist->size) > h->dblk_size) - fprintf(stream, "***THAT FREE BLOCK IS OUT OF BOUNDS!\n"); + HDfprintf(stream, "***THAT FREE BLOCK IS OUT OF BOUNDS!\n"); else { - for(i = overlap = 0; i < (int)(freelist->size); i++) { + int overlap = 0; + size_t i; + + for(i = 0; i < freelist->size; i++) { if(marker[freelist->offset + i]) overlap++; marker[freelist->offset + i] = 1; } /* end for */ if(overlap) - fprintf(stream, "***THAT FREE BLOCK OVERLAPPED A PREVIOUS ONE!\n"); + HDfprintf(stream, "***THAT FREE BLOCK OVERLAPPED A PREVIOUS ONE!\n"); else amount_free += freelist->size; } /* end for */ } /* end for */ if(h->dblk_size) - fprintf(stream, "%*s%-*s %.2f%%\n", indent, "", fwidth, + HDfprintf(stream, "%*s%-*s %.2f%%\n", indent, "", fwidth, "Percent of heap used:", - (100.0 * (double)(h->dblk_size - amount_free) / (double)h->dblk_size)); + ((double)100.0f * (double)(h->dblk_size - amount_free) / (double)h->dblk_size)); /* * Print the data in a VMS-style octal dump. diff --git a/src/H5Lexternal.c b/src/H5Lexternal.c index a1245ba..a5302e0 100644 --- a/src/H5Lexternal.c +++ b/src/H5Lexternal.c @@ -208,6 +208,7 @@ H5L_extern_traverse(const char UNUSED *link_name, hid_t cur_group, char *parent_group_name = NULL;/* Temporary pointer to group name */ char local_group_name[H5L_EXT_TRAVERSE_BUF_SIZE]; /* Local buffer to hold group name */ char *temp_file_name = NULL; /* Temporary pointer to file name */ + size_t temp_file_name_len; /* Length of temporary file name */ char *actual_file_name = NULL; /* Parent file's actual name */ H5P_genplist_t *fa_plist; /* File access property list pointer */ H5F_close_degree_t fc_degree = H5F_CLOSE_WEAK; /* File close degree for target file */ @@ -312,6 +313,7 @@ H5L_extern_traverse(const char UNUSED *link_name, hid_t cur_group, /* Copy the file name to use */ if(NULL == (temp_file_name = H5MM_strdup(file_name))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed") + temp_file_name_len = HDstrlen(temp_file_name); /* target file_name is an absolute pathname: see RM for detailed description */ if(H5_CHECK_ABSOLUTE(file_name) || H5_CHECK_ABS_PATH(file_name)) { @@ -329,7 +331,8 @@ H5L_extern_traverse(const char UNUSED *link_name, hid_t cur_group, ptr++; /* Copy into the temp. file name */ - HDstrncpy(temp_file_name, ptr, HDstrlen(ptr) + 1); + HDstrncpy(temp_file_name, ptr, temp_file_name_len); + temp_file_name[temp_file_name_len - 1] = '\0'; } /* end if */ } /* end if */ else if(H5_CHECK_ABS_DRIVE(file_name)) { @@ -339,7 +342,8 @@ H5L_extern_traverse(const char UNUSED *link_name, hid_t cur_group, H5E_clear_stack(NULL); /* strip ":" */ - HDstrncpy(temp_file_name, &file_name[2], (HDstrlen(file_name) - 2) + 1); + HDstrncpy(temp_file_name, &file_name[2], temp_file_name_len); + temp_file_name[temp_file_name_len - 1] = '\0'; } /* end if */ } /* end if */ @@ -579,9 +583,9 @@ H5Lcreate_external(const char *file_name, const char *obj_name, /* Encode the external link information */ p = (uint8_t *)ext_link_buf; *p++ = (H5L_EXT_VERSION << 4) | H5L_EXT_FLAGS_ALL; /* External link version & flags */ - HDstrncpy((char *)p, file_name, file_name_len); /* Name of file containing external link's object */ + HDstrncpy((char *)p, file_name, buf_size - 1); /* 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 */ + HDstrncpy((char *)p, norm_obj_name, buf_size - (file_name_len + 1)); /* 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/H5Oattr.c b/src/H5Oattr.c index b8e6b32..2269bd3 100644 --- a/src/H5Oattr.c +++ b/src/H5Oattr.c @@ -793,7 +793,7 @@ H5O_attr_debug(H5F_t *f, hid_t dxpl_id, const void *_mesg, FILE * stream, int in { const H5A_t *mesg = (const H5A_t *)_mesg; const char *s; /* Temporary string pointer */ - char buf[256]; /* Temporary string buffer */ + char buf[128]; /* Temporary string buffer */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -804,7 +804,7 @@ H5O_attr_debug(H5F_t *f, hid_t dxpl_id, const void *_mesg, FILE * stream, int in HDassert(indent >= 0); HDassert(fwidth >= 0); - fprintf(stream, "%*s%-*s \"%s\"\n", indent, "", fwidth, + HDfprintf(stream, "%*s%-*s \"%s\"\n", indent, "", fwidth, "Name:", mesg->shared->name); switch(mesg->shared->encoding) { @@ -830,17 +830,17 @@ H5O_attr_debug(H5F_t *f, hid_t dxpl_id, const void *_mesg, FILE * stream, int in case H5T_CSET_RESERVED_13: case H5T_CSET_RESERVED_14: case H5T_CSET_RESERVED_15: - sprintf(buf, "H5T_CSET_RESERVED_%d", (int)(mesg->shared->encoding)); + HDsnprintf(buf, sizeof(buf), "H5T_CSET_RESERVED_%d", (int)(mesg->shared->encoding)); s = buf; break; case H5T_CSET_ERROR: default: - sprintf(buf, "Unknown character set: %d", (int)(mesg->shared->encoding)); + HDsnprintf(buf, sizeof(buf), "Unknown character set: %d", (int)(mesg->shared->encoding)); s = buf; break; } /* end switch */ - fprintf(stream, "%*s%-*s %s\n", indent, "", fwidth, + HDfprintf(stream, "%*s%-*s %s\n", indent, "", fwidth, "Character Set of Name:", s); HDfprintf(stream, "%*s%-*s %t\n", indent, "", fwidth, @@ -856,18 +856,18 @@ H5O_attr_debug(H5F_t *f, hid_t dxpl_id, const void *_mesg, FILE * stream, int in "Creation Index:", (unsigned)mesg->shared->crt_idx); - fprintf(stream, "%*sDatatype...\n", indent, ""); - fprintf(stream, "%*s%-*s %lu\n", indent+3, "", MAX(0,fwidth-3), + HDfprintf(stream, "%*sDatatype...\n", indent, ""); + HDfprintf(stream, "%*s%-*s %lu\n", indent + 3, "", MAX(0,fwidth - 3), "Encoded Size:", (unsigned long)(mesg->shared->dt_size)); if((H5O_MSG_DTYPE->debug)(f, dxpl_id, mesg->shared->dt, stream, indent + 3, MAX(0, fwidth - 3)) < 0) HGOTO_ERROR(H5E_OHDR, H5E_WRITEERROR, FAIL, "unable to display datatype message info") - fprintf(stream, "%*sDataspace...\n", indent, ""); - fprintf(stream, "%*s%-*s %lu\n", indent+3, "", MAX(0, fwidth - 3), + HDfprintf(stream, "%*sDataspace...\n", indent, ""); + HDfprintf(stream, "%*s%-*s %lu\n", indent + 3, "", MAX(0, fwidth - 3), "Encoded Size:", (unsigned long)(mesg->shared->ds_size)); - if(H5S_debug(f, dxpl_id, mesg->shared->ds, stream, indent+3, MAX(0, fwidth - 3)) < 0) + if(H5S_debug(f, dxpl_id, mesg->shared->ds, stream, indent + 3, MAX(0, fwidth - 3)) < 0) HGOTO_ERROR(H5E_OHDR, H5E_WRITEERROR, FAIL, "unable to display dataspace message info") done: diff --git a/src/H5Oefl.c b/src/H5Oefl.c index 487b6f4..c6db7c3 100644 --- a/src/H5Oefl.c +++ b/src/H5Oefl.c @@ -545,7 +545,6 @@ H5O_efl_debug(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, const void *_mesg, FILE * s int indent, int fwidth) { const H5O_efl_t *mesg = (const H5O_efl_t *) _mesg; - char buf[64]; size_t u; FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -565,8 +564,10 @@ H5O_efl_debug(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, const void *_mesg, FILE * s mesg->nused, mesg->nalloc); for(u = 0; u < mesg->nused; u++) { - sprintf (buf, "File %u", (unsigned)u); - HDfprintf (stream, "%*s%s:\n", indent, "", buf); + char buf[64]; + + HDsnprintf(buf, sizeof(buf), "File %u", (unsigned)u); + HDfprintf(stream, "%*s%s:\n", indent, "", buf); HDfprintf(stream, "%*s%-*s \"%s\"\n", indent+3, "", MAX (fwidth-3, 0), "Name:", @@ -576,11 +577,11 @@ H5O_efl_debug(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, const void *_mesg, FILE * s "Name offset:", (unsigned long)(mesg->slot[u].name_offset)); - HDfprintf (stream, "%*s%-*s %lu\n", indent+3, "", MAX (fwidth-3, 0), + HDfprintf(stream, "%*s%-*s %lu\n", indent+3, "", MAX (fwidth-3, 0), "Offset of data in file:", (unsigned long)(mesg->slot[u].offset)); - HDfprintf (stream, "%*s%-*s %lu\n", indent+3, "", MAX (fwidth-3, 0), + HDfprintf(stream, "%*s%-*s %lu\n", indent+3, "", MAX (fwidth-3, 0), "Bytes reserved for data:", (unsigned long)(mesg->slot[u].size)); } /* end for */ diff --git a/src/H5system.c b/src/H5system.c index 614b8b9..437a004 100644 --- a/src/H5system.c +++ b/src/H5system.c @@ -200,20 +200,28 @@ HDfprintf(FILE *stream, const char *fmt, ...) case 'H': if(sizeof(hsize_t) < sizeof(long)) modifier[0] = '\0'; - else if(sizeof(hsize_t) == sizeof(long)) - HDstrncpy(modifier, "l", (size_t)2); - else - HDstrncpy(modifier, H5_PRINTF_LL_WIDTH, HDstrlen(H5_PRINTF_LL_WIDTH) + 1); + else if(sizeof(hsize_t) == sizeof(long)) { + HDstrncpy(modifier, "l", sizeof(modifier)); + modifier[sizeof(modifier) - 1] = '\0'; + } /* end if */ + else { + HDstrncpy(modifier, H5_PRINTF_LL_WIDTH, sizeof(modifier)); + modifier[sizeof(modifier) - 1] = '\0'; + } /* end else */ break; case 'Z': case 'z': if(sizeof(size_t) < sizeof(long)) modifier[0] = '\0'; - else if(sizeof(size_t) == sizeof(long)) - HDstrncpy(modifier, "l", (size_t)2); - else - HDstrncpy(modifier, H5_PRINTF_LL_WIDTH, HDstrlen(H5_PRINTF_LL_WIDTH) + 1); + else if(sizeof(size_t) == sizeof(long)) { + HDstrncpy(modifier, "l", sizeof(modifier)); + modifier[sizeof(modifier) - 1] = '\0'; + } /* end if */ + else { + HDstrncpy(modifier, H5_PRINTF_LL_WIDTH, sizeof(modifier)); + modifier[sizeof(modifier) - 1] = '\0'; + } /* end else */ break; default: diff --git a/test/h5test.c b/test/h5test.c index 30a3adf..f361c49 100644 --- a/test/h5test.c +++ b/test/h5test.c @@ -379,7 +379,7 @@ h5_fixname(const char *base_name, hid_t fapl, char *fullname, size_t size) /* Prepend the prefix value to the base name */ if (prefix && *prefix) { - if (isppdriver){ + if (isppdriver) { /* This is a parallel system */ char *subdir; @@ -406,9 +406,11 @@ h5_fixname(const char *base_name, hid_t fapl, char *fullname, size_t size) } } - if (!fullname[0]) + if (!fullname[0]) { /* We didn't append the prefix yet */ - HDstrncpy(fullname, prefix, MIN(HDstrlen(prefix), size)); + HDstrncpy(fullname, prefix, size); + fullname[size -1] = '\0'; + } if (HDstrlen(fullname) + HDstrlen(base_name) + 1 < size) { /* diff --git a/tools/h5dump/h5dump_xml.c b/tools/h5dump/h5dump_xml.c index 03e1254..b94879c 100644 --- a/tools/h5dump/h5dump_xml.c +++ b/tools/h5dump/h5dump_xml.c @@ -644,6 +644,7 @@ xml_escape_the_name(const char *str) const char *cp; char *ncp; char *rcp; + size_t ncp_len; if (!str) return NULL; @@ -653,21 +654,16 @@ xml_escape_the_name(const char *str) extra = 0; for (i = 0; i < len; i++) { - if (*cp == '\"') { + if (*cp == '\"') extra += (HDstrlen(quote) - 1); - } - else if (*cp == '\'') { + else if (*cp == '\'') extra += (HDstrlen(apos) - 1); - } - else if (*cp == '<') { + else if (*cp == '<') extra += (HDstrlen(lt) - 1); - } - else if (*cp == '>') { + else if (*cp == '>') extra += (HDstrlen(gt) - 1); - } - else if (*cp == '&') { + else if (*cp == '&') extra += (HDstrlen(amp) - 1); - } cp++; } @@ -676,40 +672,43 @@ xml_escape_the_name(const char *str) return HDstrdup(str); cp = str; - rcp = ncp = (char *)HDmalloc(len + extra + 1); + ncp_len = len + extra + 1; + rcp = ncp = (char *)HDmalloc(ncp_len); if (!ncp) return NULL; /* ?? */ for (i = 0; i < len; i++) { + size_t esc_len; + + HDassert(ncp_len); if (*cp == '\'') { - HDstrncpy(ncp, apos, HDstrlen(apos)); - ncp += HDstrlen(apos); - cp++; + HDstrncpy(ncp, apos, ncp_len); + esc_len = HDstrlen(apos); } else if (*cp == '<') { - HDstrncpy(ncp, lt, HDstrlen(lt)); - ncp += HDstrlen(lt); - cp++; + HDstrncpy(ncp, lt, ncp_len); + esc_len = HDstrlen(lt); } else if (*cp == '>') { - HDstrncpy(ncp, gt, HDstrlen(gt)); - ncp += HDstrlen(gt); - cp++; + HDstrncpy(ncp, gt, ncp_len); + esc_len = HDstrlen(gt); } else if (*cp == '\"') { - HDstrncpy(ncp, quote, HDstrlen(quote)); - ncp += HDstrlen(quote); - cp++; + HDstrncpy(ncp, quote, ncp_len); + esc_len = HDstrlen(quote); } else if (*cp == '&') { - HDstrncpy(ncp, amp, HDstrlen(amp)); - ncp += HDstrlen(amp); - cp++; + HDstrncpy(ncp, amp, ncp_len); + esc_len = HDstrlen(amp); } else { - *ncp++ = *cp++; + *ncp = *cp; + esc_len = 1; } + ncp += esc_len; + ncp_len -= esc_len; + cp++; } *ncp = '\0'; @@ -739,6 +738,7 @@ xml_escape_the_string(const char *str, int slen) const char *cp; char *ncp; char *rcp; + size_t ncp_len; if (!str) return NULL; @@ -753,65 +753,65 @@ xml_escape_the_string(const char *str, int slen) extra = 0; for (i = 0; i < len; i++) { - if (*cp == '\\') { + if (*cp == '\\') extra++; - } - else if (*cp == '\"') { + else if (*cp == '\"') extra++; - } - else if (*cp == '\'') { + else if (*cp == '\'') extra += (HDstrlen(apos) - 1); - } - else if (*cp == '<') { + else if (*cp == '<') extra += (HDstrlen(lt) - 1); - } - else if (*cp == '>') { + else if (*cp == '>') extra += (HDstrlen(gt) - 1); - } - else if (*cp == '&') { + else if (*cp == '&') extra += (HDstrlen(amp) - 1); - } cp++; } cp = str; - rcp = ncp = (char *) HDcalloc((len + extra + 1), sizeof(char)); + ncp_len = len + extra + 1; + rcp = ncp = (char *) HDcalloc(ncp_len, sizeof(char)); if (ncp == NULL) return NULL; /* ?? */ for (i = 0; i < len; i++) { + size_t esc_len; + + HDassert(ncp_len); if (*cp == '\\') { *ncp++ = '\\'; - *ncp++ = *cp++; + *ncp = *cp; + esc_len = 1; } else if (*cp == '\"') { *ncp++ = '\\'; - *ncp++ = *cp++; + *ncp = *cp; + esc_len = 1; } else if (*cp == '\'') { - HDstrncpy(ncp, apos, HDstrlen(apos)); - ncp += HDstrlen(apos); - cp++; + HDstrncpy(ncp, apos, ncp_len); + esc_len = HDstrlen(apos); } else if (*cp == '<') { - HDstrncpy(ncp, lt, HDstrlen(lt)); - ncp += HDstrlen(lt); - cp++; + HDstrncpy(ncp, lt, ncp_len); + esc_len = HDstrlen(lt); } else if (*cp == '>') { - HDstrncpy(ncp, gt, HDstrlen(gt)); - ncp += HDstrlen(gt); - cp++; + HDstrncpy(ncp, gt, ncp_len); + esc_len = HDstrlen(gt); } else if (*cp == '&') { - HDstrncpy(ncp, amp, HDstrlen(amp)); - ncp += HDstrlen(amp); - cp++; + HDstrncpy(ncp, amp, ncp_len); + esc_len = HDstrlen(amp); } else { - *ncp++ = *cp++; + *ncp = *cp; + esc_len = 1; } + ncp += esc_len; + ncp_len -= esc_len; + cp++; } *ncp = '\0'; diff --git a/tools/lib/h5trav.c b/tools/lib/h5trav.c index a475ded..fca3096 100644 --- a/tools/lib/h5trav.c +++ b/tools/lib/h5trav.c @@ -49,7 +49,9 @@ typedef struct { } trav_print_udata_t; /* format for hsize_t */ +#ifdef H5TRAV_PRINT_SPACE #define HSIZE_T_FORMAT "%" H5_PRINTF_LL_WIDTH "u" +#endif /* H5TRAV_PRINT_SPACE */ /*------------------------------------------------------------------------- * local functions @@ -680,11 +682,11 @@ h5trav_getindext(const char *name, const trav_table_t *table) for(i = 0; i < table->nobjs; i++) { /* Check for object name having full path (with leading '/') */ if(HDstrcmp(name, table->objs[i].name) == 0) - return(i); + return((int)i); /* Check for object name without leading '/' */ if(HDstrcmp(name, table->objs[i].name + 1) == 0) - return(i); + return((int)i); /* search also in the list of links */ if(table->objs[i].nlinks) { @@ -693,11 +695,11 @@ h5trav_getindext(const char *name, const trav_table_t *table) for ( j=0; jobjs[i].nlinks; j++) { /* Check for object name having full path (with leading '/') */ if(HDstrcmp(name, table->objs[i].links[j].new_name) == 0) - return(i); + return((int)i); /* Check for object name without leading '/' */ if(HDstrcmp(name, table->objs[i].links[j].new_name + 1) == 0) - return(i); + return((int)i); } /* end for */ } /* end if */ } /* end for */ @@ -807,7 +809,7 @@ void trav_table_addflags(unsigned *flags, h5trav_type_t type, trav_table_t *table) { - unsigned int new_obj; + size_t new_obj; if(table->nobjs == table->size) { table->size = MAX(1, table->size * 2); @@ -995,6 +997,8 @@ trav_print_visit_obj(const char *path, const H5O_info_t *oinfo, printf(" %-10s %s", "datatype", path); break; + case H5O_TYPE_UNKNOWN: + case H5O_TYPE_NTYPES: default: printf(" %-10s %s", "unknown object type", path); break; @@ -1005,7 +1009,7 @@ trav_print_visit_obj(const char *path, const H5O_info_t *oinfo, /* Finish printing line about object */ printf("\n"); if(trav_verbosity > 0) - H5Aiterate_by_name(print_udata->fid, path, trav_index_by, trav_index_order, NULL, trav_attr, path, H5P_DEFAULT); + H5Aiterate_by_name(print_udata->fid, path, trav_index_by, trav_index_order, NULL, trav_attr, (void *)path, H5P_DEFAULT); } else /* Print the link's original name */ @@ -1040,7 +1044,8 @@ trav_print_visit_lnk(const char *path, const H5L_info_t *linfo, void *udata) char *targbuf = (char*)HDmalloc(linfo->u.val_size + 1); HDassert(targbuf); - H5Lget_val(print_udata->fid, path, targbuf, linfo->u.val_size + 1, H5P_DEFAULT); + if(H5Lget_val(print_udata->fid, path, targbuf, linfo->u.val_size + 1, H5P_DEFAULT) < 0) + targbuf[0] = 0; printf(" %-10s %s -> %s\n", "link", path, targbuf); HDfree(targbuf); } /* end if */ @@ -1051,21 +1056,28 @@ trav_print_visit_lnk(const char *path, const H5L_info_t *linfo, void *udata) case H5L_TYPE_EXTERNAL: if(linfo->u.val_size > 0) { char *targbuf; - const char *filename; - const char *objname; + const char *filename = NULL; + const char *objname = NULL; targbuf = (char*)HDmalloc(linfo->u.val_size + 1); HDassert(targbuf); - H5Lget_val(print_udata->fid, path, targbuf, linfo->u.val_size + 1, H5P_DEFAULT); - H5Lunpack_elink_val(targbuf, linfo->u.val_size, NULL, &filename, &objname); - printf(" %-10s %s -> %s %s\n", "ext link", path, filename, objname); + if(H5Lget_val(print_udata->fid, path, targbuf, linfo->u.val_size + 1, H5P_DEFAULT) < 0) + targbuf[0] = 0; + if(H5Lunpack_elink_val(targbuf, linfo->u.val_size, NULL, &filename, &objname) >= 0) + printf(" %-10s %s -> %s %s\n", "ext link", path, filename, objname); HDfree(targbuf); } /* end if */ else printf(" %-10s %s ->\n", "ext link", path); break; + case H5L_TYPE_HARD: + /* Should be handled elsewhere */ + return(-1); + + case H5L_TYPE_ERROR: + case H5L_TYPE_MAX: default: printf(" %-10s %s -> ???\n", "unknown type of UD link", path); break; diff --git a/tools/misc/h5debug.c b/tools/misc/h5debug.c index 9df49cf..617e614 100644 --- a/tools/misc/h5debug.c +++ b/tools/misc/h5debug.c @@ -248,7 +248,10 @@ main(int argc, char *argv[]) HDexit(1); } /* end if */ if(HDstrchr(argv[1], '%')) - H5Pset_fapl_family (fapl, (hsize_t)0, H5P_DEFAULT); + if(H5Pset_fapl_family (fapl, (hsize_t)0, H5P_DEFAULT) < 0) { + fprintf(stderr, "cannot set file access property list\n"); + HDexit(1); + } if((fid = H5Fopen(argv[1], H5F_ACC_RDONLY, fapl)) < 0) { HDfprintf(stderr, "cannot open file\n"); HDexit(1); -- cgit v0.12 From 1162465570895657929286c8f5b3958db827833f Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Fri, 21 Feb 2014 11:53:33 -0500 Subject: [svn-r24727] Description: Revert change of sprintf -> snprintf, due to failures on Windows. We'll need to figure out the correct course of action in the future. Tested on: MacOSX/64 10.9.1 (amazon) w/C++, FORTRAN (too minor to require h5committest) --- fortran/src/H5match_types.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/fortran/src/H5match_types.c b/fortran/src/H5match_types.c index 3ae4bdb..3fa0efc 100644 --- a/fortran/src/H5match_types.c +++ b/fortran/src/H5match_types.c @@ -395,8 +395,8 @@ int main(void) for(i=0;i<4;i++) { if( FoundIntSize[i] > 0) /* Found the integer type */ { - snprintf(chrA, sizeof(chrA), "Fortran_INTEGER_%d", FoundIntSize[i]); - snprintf(chrB, sizeof(chrB), "int_%d_f", FoundIntSize[i]); + sprintf(chrA, "Fortran_INTEGER_%d", FoundIntSize[i]); + sprintf(chrB, "int_%d_f", FoundIntSize[i]); writeToFiles(chrA, chrB, FoundIntSize[i], FoundIntSizeKind[i]); } else /* Did not find the integer type */ @@ -406,8 +406,8 @@ int main(void) { if( FoundIntSize[j] > 0) /* Found the next highest */ { - snprintf(chrA, sizeof(chrA), "Fortran_INTEGER_%d", (-1)*FoundIntSize[i]); - snprintf(chrB, sizeof(chrB), "int_%d_f", (-1)*FoundIntSize[i]); + sprintf(chrA, "Fortran_INTEGER_%d", (-1)*FoundIntSize[i]); + sprintf(chrB, "int_%d_f", (-1)*FoundIntSize[i]); writeToFiles(chrA, chrB, FoundIntSize[j], FoundIntSizeKind[j]); flag = 1; break; @@ -419,8 +419,8 @@ int main(void) { if( FoundIntSize[j] > 0) /* Found the next lowest */ { - snprintf(chrA, sizeof(chrA), "Fortran_INTEGER_%d", (-1)*FoundIntSize[i]); - snprintf(chrB, sizeof(chrB), "int_%d_f", (-1)*FoundIntSize[i]); + sprintf(chrA, "Fortran_INTEGER_%d", (-1)*FoundIntSize[i]); + sprintf(chrB, "int_%d_f", (-1)*FoundIntSize[i]); writeToFiles(chrA, chrB, FoundIntSize[j], FoundIntSizeKind[j]); flag = 1; break; @@ -462,8 +462,8 @@ int main(void) for(i=0;i<3;i++) { if( FoundRealSize[i] > 0) /* Found the real type */ { - snprintf(chrA, sizeof(chrA), "Fortran_REAL_%d", FoundRealSize[i]); - snprintf(chrB, sizeof(chrB), "real_%d_f", FoundRealSize[i]); + sprintf(chrA, "Fortran_REAL_%d", FoundRealSize[i]); + sprintf(chrB, "real_%d_f", FoundRealSize[i]); writeFloatToFiles(chrA, chrB, FoundRealSize[i], FoundRealSizeKind[i]); } else /* Did not find the real type */ @@ -473,8 +473,8 @@ int main(void) { if( FoundRealSize[j] > 0) /* Found the next highest */ { - snprintf(chrA, sizeof(chrA), "Fortran_REAL_%d", (-1)*FoundRealSize[i]); - snprintf(chrB, sizeof(chrB), "real_%d_f", (-1)*FoundRealSize[i]); + sprintf(chrA, "Fortran_REAL_%d", (-1)*FoundRealSize[i]); + sprintf(chrB, "real_%d_f", (-1)*FoundRealSize[i]); if(FoundRealSize[j]>4) { writeFloatToFiles(chrA, chrB, FoundRealSize[j], FoundRealSizeKind[j]); flag = 1; @@ -492,8 +492,8 @@ int main(void) { if( FoundRealSize[j] > 0) /* Found the next lowest */ { - snprintf(chrA, sizeof(chrA), "Fortran_REAL_%d", (-1)*FoundRealSize[i]); - snprintf(chrB, sizeof(chrB), "real_%d_f", (-1)*FoundRealSize[i]); + sprintf(chrA, "Fortran_REAL_%d", (-1)*FoundRealSize[i]); + sprintf(chrB, "real_%d_f", (-1)*FoundRealSize[i]); if(FoundRealSize[j]>4) writeFloatToFiles(chrA, chrB, FoundRealSize[j], FoundRealSizeKind[j]); /* else { */ -- cgit v0.12 From c2bf6ea162a0481742d1fb742e3c6e094812dfa8 Mon Sep 17 00:00:00 2001 From: Albert Cheng Date: Wed, 26 Feb 2014 16:29:55 -0500 Subject: [svn-r24739] Bug fix: HDFFV-8684 h5committest failed in platypus because cmakehdf5 failed in installation because cmake generates a install-tarball based on incomplete version number (subrelease string is missing). Solution: Fixed $HDF5_PACKAGE_VERSION to contain the subrelease string. Fixed $HDF5_PACKAGE_VERSION_STRING to be the same as $HDF5_PACKAGE_VERSION. Tested: jam and platypus in both trunk and v18 branches because the current version number is trunk has a null sub-release and v18 has a non-null sub-release. That covers both grounds. --- CMakeLists.txt | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4664942..6789d6b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -198,14 +198,15 @@ MESSAGE (STATUS "SOVERSION: ${H5_SOVERS_MAJOR}.${H5_SOVERS_RELEASE}.${H5_SOVERS_ #----------------------------------------------------------------------------- SET (HDF5_PACKAGE "hdf5") SET (HDF5_PACKAGE_NAME "HDF5") -SET (HDF5_PACKAGE_VERSION "${H5_VERS_MAJOR}.${H5_VERS_MINOR}.${H5_VERS_RELEASE}") +#SET (HDF5_PACKAGE_VERSION "${H5_VERS_MAJOR}.${H5_VERS_MINOR}.${H5_VERS_RELEASE}") +IF ("${H5_VERS_SUBRELEASE}" STREQUAL "") + SET (HDF5_PACKAGE_VERSION "${H5_VERS_MAJOR}.${H5_VERS_MINOR}.${H5_VERS_RELEASE}") +ELSE ("${H5_VERS_SUBRELEASE}" STREQUAL "") + SET (HDF5_PACKAGE_VERSION "${H5_VERS_MAJOR}.${H5_VERS_MINOR}.${H5_VERS_RELEASE}-${H5_VERS_SUBRELEASE}") +ENDIF ("${H5_VERS_SUBRELEASE}" STREQUAL "") SET (HDF5_PACKAGE_VERSION_MAJOR "${H5_VERS_MAJOR}.${H5_VERS_MINOR}") SET (HDF5_PACKAGE_VERSION_MINOR "${H5_VERS_RELEASE}") -IF (NOT "${H5_VERS_SUBRELEASE}" STREQUAL "") - SET (HDF5_PACKAGE_VERSION_STRING "${HDF5_PACKAGE_VERSION}-${H5_VERS_SUBRELEASE}") -ELSE (NOT "${H5_VERS_SUBRELEASE}" STREQUAL "") - SET (HDF5_PACKAGE_VERSION_STRING "${HDF5_PACKAGE_VERSION}") -ENDIF (NOT "${H5_VERS_SUBRELEASE}" STREQUAL "") +SET (HDF5_PACKAGE_VERSION_STRING "${HDF5_PACKAGE_VERSION}") SET (HDF5_PACKAGE_SOVERSION "${H5_SOVERS_MAJOR}.${H5_SOVERS_RELEASE}.${H5_SOVERS_MINOR}") SET (HDF5_PACKAGE_STRING "${HDF5_PACKAGE_NAME} ${HDF5_PACKAGE_VERSION_STRING}") SET (HDF5_PACKAGE_TARNAME "${HDF5_PACKAGE}${HDF_PACKAGE_EXT}") -- cgit v0.12 From db1b11b69bd5c7da66a82304dd23daf99afdc9d7 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 27 Feb 2014 10:43:08 -0500 Subject: [svn-r24741] HDFFV-8684: Change Package name depending on CDASH_LOCAL configuration variable. Tested: local linux --- CMakeInstallation.cmake | 6 +++++- CMakeLists.txt | 13 ++++++------- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/CMakeInstallation.cmake b/CMakeInstallation.cmake index 5da5007..57376c5 100644 --- a/CMakeInstallation.cmake +++ b/CMakeInstallation.cmake @@ -247,7 +247,11 @@ ENDIF (NOT HDF5_EXTERNALLY_CONFIGURED) IF (NOT HDF5_EXTERNALLY_CONFIGURED AND NOT HDF5_NO_PACKAGES) SET (CPACK_PACKAGE_VENDOR "HDF_Group") SET (CPACK_PACKAGE_NAME "${HDF5_PACKAGE_NAME}") - SET (CPACK_PACKAGE_VERSION "${HDF5_PACKAGE_VERSION}") + IF (CDASH_LOCAL) + SET (CPACK_PACKAGE_VERSION "${HDF5_PACKAGE_VERSION}") + ELSE (CDASH_LOCAL) + SET (CPACK_PACKAGE_VERSION "${HDF5_PACKAGE_VERSION_STRING}") + ENDIF (CDASH_LOCAL) SET (CPACK_PACKAGE_VERSION_MAJOR "${HDF5_PACKAGE_VERSION_MAJOR}") SET (CPACK_PACKAGE_VERSION_MINOR "${HDF5_PACKAGE_VERSION_MINOR}") SET (CPACK_PACKAGE_VERSION_PATCH "") diff --git a/CMakeLists.txt b/CMakeLists.txt index 6789d6b..4664942 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -198,15 +198,14 @@ MESSAGE (STATUS "SOVERSION: ${H5_SOVERS_MAJOR}.${H5_SOVERS_RELEASE}.${H5_SOVERS_ #----------------------------------------------------------------------------- SET (HDF5_PACKAGE "hdf5") SET (HDF5_PACKAGE_NAME "HDF5") -#SET (HDF5_PACKAGE_VERSION "${H5_VERS_MAJOR}.${H5_VERS_MINOR}.${H5_VERS_RELEASE}") -IF ("${H5_VERS_SUBRELEASE}" STREQUAL "") - SET (HDF5_PACKAGE_VERSION "${H5_VERS_MAJOR}.${H5_VERS_MINOR}.${H5_VERS_RELEASE}") -ELSE ("${H5_VERS_SUBRELEASE}" STREQUAL "") - SET (HDF5_PACKAGE_VERSION "${H5_VERS_MAJOR}.${H5_VERS_MINOR}.${H5_VERS_RELEASE}-${H5_VERS_SUBRELEASE}") -ENDIF ("${H5_VERS_SUBRELEASE}" STREQUAL "") +SET (HDF5_PACKAGE_VERSION "${H5_VERS_MAJOR}.${H5_VERS_MINOR}.${H5_VERS_RELEASE}") SET (HDF5_PACKAGE_VERSION_MAJOR "${H5_VERS_MAJOR}.${H5_VERS_MINOR}") SET (HDF5_PACKAGE_VERSION_MINOR "${H5_VERS_RELEASE}") -SET (HDF5_PACKAGE_VERSION_STRING "${HDF5_PACKAGE_VERSION}") +IF (NOT "${H5_VERS_SUBRELEASE}" STREQUAL "") + SET (HDF5_PACKAGE_VERSION_STRING "${HDF5_PACKAGE_VERSION}-${H5_VERS_SUBRELEASE}") +ELSE (NOT "${H5_VERS_SUBRELEASE}" STREQUAL "") + SET (HDF5_PACKAGE_VERSION_STRING "${HDF5_PACKAGE_VERSION}") +ENDIF (NOT "${H5_VERS_SUBRELEASE}" STREQUAL "") SET (HDF5_PACKAGE_SOVERSION "${H5_SOVERS_MAJOR}.${H5_SOVERS_RELEASE}.${H5_SOVERS_MINOR}") SET (HDF5_PACKAGE_STRING "${HDF5_PACKAGE_NAME} ${HDF5_PACKAGE_VERSION_STRING}") SET (HDF5_PACKAGE_TARNAME "${HDF5_PACKAGE}${HDF_PACKAGE_EXT}") -- cgit v0.12 From f68f4be233eb86b2c2e79c3be15337d320cc69d8 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 27 Feb 2014 11:53:12 -0500 Subject: [svn-r24742] Synchronize Apple bundle packaging with latest changes discovered during hdf-java work. --- CMakeInstallation.cmake | 38 ++++++++++++++++++++++++++++++-------- MANIFEST | 6 +++++- config/cmake/PkgInfo.in | 1 + config/cmake/hdf.bmp | Bin 0 -> 1254 bytes config/cmake/hdf.gif | Bin 1016 -> 0 bytes config/cmake/hdf.icns | Bin 0 -> 2632 bytes config/cmake/hdf.ico | Bin 0 -> 23558 bytes config/cmake/version.plist.in | 17 +++++++++++++++++ 8 files changed, 53 insertions(+), 9 deletions(-) create mode 100644 config/cmake/PkgInfo.in create mode 100644 config/cmake/hdf.bmp delete mode 100644 config/cmake/hdf.gif create mode 100755 config/cmake/hdf.icns create mode 100644 config/cmake/hdf.ico create mode 100644 config/cmake/version.plist.in diff --git a/CMakeInstallation.cmake b/CMakeInstallation.cmake index 57376c5..45c8885 100644 --- a/CMakeInstallation.cmake +++ b/CMakeInstallation.cmake @@ -255,13 +255,14 @@ IF (NOT HDF5_EXTERNALLY_CONFIGURED AND NOT HDF5_NO_PACKAGES) SET (CPACK_PACKAGE_VERSION_MAJOR "${HDF5_PACKAGE_VERSION_MAJOR}") SET (CPACK_PACKAGE_VERSION_MINOR "${HDF5_PACKAGE_VERSION_MINOR}") SET (CPACK_PACKAGE_VERSION_PATCH "") - SET (CPACK_PACKAGE_INSTALL_DIRECTORY "${CPACK_PACKAGE_VENDOR}/${CPACK_PACKAGE_NAME}/${CPACK_PACKAGE_VERSION}") IF (EXISTS "${HDF5_SOURCE_DIR}/release_docs") SET (CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/release_docs/RELEASE.txt") SET (CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/release_docs/COPYING") SET (CPACK_RESOURCE_FILE_README "${CMAKE_CURRENT_SOURCE_DIR}/release_docs/RELEASE.txt") ENDIF (EXISTS "${HDF5_SOURCE_DIR}/release_docs") SET (CPACK_PACKAGE_RELOCATABLE TRUE) + SET (CPACK_PACKAGE_INSTALL_DIRECTORY "${CPACK_PACKAGE_VENDOR}/${CPACK_PACKAGE_NAME}/${CPACK_PACKAGE_VERSION}") + SET (CPACK_PACKAGE_ICON "${HDF5_RESOURCES_DIR}/hdf.bmp") SET (CPACK_GENERATOR "TGZ") IF (WIN32) @@ -270,15 +271,20 @@ IF (NOT HDF5_EXTERNALLY_CONFIGURED AND NOT HDF5_NO_PACKAGES) # - Root install directory (displayed to end user at installer-run time) # - "NSIS package/display name" (text used in the installer GUI) # - Registry key used to store info about the installation + SET (CPACK_NSIS_PACKAGE_NAME "${HDF5_PACKAGE_STRING}-${CPACK_PACKAGE_VERSION}") IF (CMAKE_CL_64) SET (CPACK_NSIS_INSTALL_ROOT "$PROGRAMFILES64") - SET (CPACK_NSIS_PACKAGE_NAME "${HDF5_PACKAGE_STRING} (Win64)") - SET (CPACK_PACKAGE_INSTALL_REGISTRY_KEY "${HDF5_PACKAGE_STRING}-${LIB_TYPE} (Win64)") + SET (CPACK_PACKAGE_INSTALL_REGISTRY_KEY "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION} (Win64)") ELSE (CMAKE_CL_64) SET (CPACK_NSIS_INSTALL_ROOT "$PROGRAMFILES") - SET (CPACK_NSIS_PACKAGE_NAME "${HDF5_PACKAGE_STRING}") - SET (CPACK_PACKAGE_INSTALL_REGISTRY_KEY "${HDF5_PACKAGE_STRING}-${LIB_TYPE}") + SET (CPACK_PACKAGE_INSTALL_REGISTRY_KEY "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}") ENDIF (CMAKE_CL_64) + # set the install/unistall icon used for the installer itself + # There is a bug in NSI that does not handle full unix paths properly. + SET (CPACK_NSIS_MUI_ICON "${HDF5_RESOURCES_DIR}\\\\hdf.ico") + SET (CPACK_NSIS_MUI_UNIICON "${HDF5_RESOURCES_DIR}\\\\hdf.ico") + # set the package header icon for MUI + SET (CPACK_PACKAGE_ICON "${HDF5_RESOURCES_DIR}\\\\hdf.bmp") SET (CPACK_NSIS_DISPLAY_NAME "@CPACK_NSIS_PACKAGE_NAME@, is a data model, library, and file format for storing and managing data") SET (CPACK_PACKAGE_INSTALL_DIRECTORY "${CPACK_PACKAGE_VENDOR}\\\\${CPACK_PACKAGE_NAME}\\\\${CPACK_PACKAGE_VERSION}") SET (CPACK_MONOLITHIC_INSTALL ON) @@ -289,7 +295,7 @@ IF (NOT HDF5_EXTERNALLY_CONFIGURED AND NOT HDF5_NO_PACKAGES) SET (CPACK_COMPONENTS_ALL_IN_ONE_PACKAGE ON) SET (CPACK_PACKAGE_DEFAULT_LOCATION "/opt/${CPACK_PACKAGE_NAME}") SET (CPACK_PACKAGING_INSTALL_PREFIX "/") - SET (CPACK_PACKAGE_ICON "${HDF5_RESOURCES_DIR}/hdf.gif") + SET (CPACK_PACKAGE_ICON "${HDF5_RESOURCES_DIR}/hdf.icns") SET (CPACK_SET_DESTDIR TRUE) # Required when packaging, and set CMAKE_INSTALL_PREFIX to "/". IF (HDF5_PACK_MACOSX_BUNDLE) @@ -297,11 +303,14 @@ IF (NOT HDF5_EXTERNALLY_CONFIGURED AND NOT HDF5_NO_PACKAGES) SET (CPACK_BUNDLE_NAME "${HDF5_PACKAGE_STRING}") SET (CPACK_BUNDLE_LOCATION "/") # make sure CMAKE_INSTALL_PREFIX ends in / SET (CMAKE_INSTALL_PREFIX "/${CPACK_BUNDLE_NAME}.framework/Versions/${CPACK_PACKAGE_VERSION}/${CPACK_PACKAGE_NAME}/") - SET (CPACK_BUNDLE_ICON "${HDF5_RESOURCES_DIR}/hdf.gif") + SET (CPACK_BUNDLE_ICON "${HDF5_RESOURCES_DIR}/hdf.icns") SET (CPACK_BUNDLE_PLIST "${HDF5_BINARY_DIR}/CMakeFiles/Info.plist") SET (CPACK_APPLE_GUI_INFO_STRING "HDF5 (Hierarchical Data Format 5) Software Library and Utilities") - SET (CPACK_APPLE_GUI_COPYRIGHT "Copyright © 2006-2013 by The HDF Group. All rights reserved.") + SET (CPACK_APPLE_GUI_COPYRIGHT "Copyright © 2006-2014 by The HDF Group. All rights reserved.") SET (CPACK_SHORT_VERSION_STRING "${CPACK_PACKAGE_VERSION}") + SET (CPACK_APPLE_GUI_BUNDLE_NAME "${HDF5_PACKAGE_STRING}") + SET (CPACK_APPLE_GUI_VERSION_STRING "${CPACK_PACKAGE_VERSION_STRING}") + SET (CPACK_APPLE_GUI_SHORT_VERSION_STRING "${CPACK_PACKAGE_VERSION}") #----------------------------------------------------------------------------- # Configure the Info.plist file for the install bundle #----------------------------------------------------------------------------- @@ -309,6 +318,19 @@ IF (NOT HDF5_EXTERNALLY_CONFIGURED AND NOT HDF5_NO_PACKAGES) ${HDF5_RESOURCES_DIR}/CPack.Info.plist.in ${HDF5_BINARY_DIR}/CMakeFiles/Info.plist @ONLY ) + CONFIGURE_FILE ( + ${HDF5_RESOURCES_DIR}/PkgInfo.in + ${HDF5_BINARY_DIR}/CMakeFiles/PkgInfo @ONLY + ) + CONFIGURE_FILE ( + ${HDF5_RESOURCES_DIR}/version.plist.in + ${HDF5_BINARY_DIR}/CMakeFiles/version.plist @ONLY + ) + INSTALL ( + FILES ${HDF5_BINARY_DIR}/CMakeFiles/PkgInfo + ${HDF5_BINARY_DIR}/CMakeFiles/version.plist + DESTINATION .. + ) ENDIF(HDF5_PACK_MACOSX_BUNDLE) ELSE (WIN32) LIST (APPEND CPACK_GENERATOR "STGZ") diff --git a/MANIFEST b/MANIFEST index 8c74b28..b79b3cb 100644 --- a/MANIFEST +++ b/MANIFEST @@ -2445,7 +2445,11 @@ ./config/cmake/CTestCustom.cmake ./config/cmake/ConfigureChecks.cmake ./config/cmake/CPack.Info.plist.in -./config/cmake/hdf.gif +./config/cmake/hdf.bmp +./config/cmake/hdf.icns +./config/cmake/hdf.ico +./config/cmake/PkgInfo.in +./config/cmake/version.plist.in ./config/cmake/NSIS.template.in ./config/cmake/NSIS.InstallOptions.ini.in ./config/cmake/README.txt.cmake.in diff --git a/config/cmake/PkgInfo.in b/config/cmake/PkgInfo.in new file mode 100644 index 0000000..e530f88 --- /dev/null +++ b/config/cmake/PkgInfo.in @@ -0,0 +1 @@ +FMWK???? \ No newline at end of file diff --git a/config/cmake/hdf.bmp b/config/cmake/hdf.bmp new file mode 100644 index 0000000..9e9e4aa Binary files /dev/null and b/config/cmake/hdf.bmp differ diff --git a/config/cmake/hdf.gif b/config/cmake/hdf.gif deleted file mode 100644 index 656617b..0000000 Binary files a/config/cmake/hdf.gif and /dev/null differ diff --git a/config/cmake/hdf.icns b/config/cmake/hdf.icns new file mode 100755 index 0000000..22afa2e Binary files /dev/null and b/config/cmake/hdf.icns differ diff --git a/config/cmake/hdf.ico b/config/cmake/hdf.ico new file mode 100644 index 0000000..26abc96 Binary files /dev/null and b/config/cmake/hdf.ico differ diff --git a/config/cmake/version.plist.in b/config/cmake/version.plist.in new file mode 100644 index 0000000..817d89e --- /dev/null +++ b/config/cmake/version.plist.in @@ -0,0 +1,17 @@ + + + + + + BuildVersion + @CPACK_PACKAGE_VERSION_MAJOR@ + CFBundleShortVersionString + @CPACK_APPLE_GUI_SHORT_VERSION_STRING@ + CFBundleVersion + @CPACK_APPLE_GUI_SHORT_VERSION_STRING@ + ProjectName + @CPACK_APPLE_GUI_BUNDLE_NAME@ + SourceVersion + @CPACK_PACKAGE_VERSION_MINOR@ + + -- cgit v0.12 From e1e136ea1d49e7df7d77748c33cc4f182443f377 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 27 Feb 2014 12:42:31 -0500 Subject: [svn-r24744] Correct NSIS name --- CMakeInstallation.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeInstallation.cmake b/CMakeInstallation.cmake index 45c8885..1d74786 100644 --- a/CMakeInstallation.cmake +++ b/CMakeInstallation.cmake @@ -271,7 +271,7 @@ IF (NOT HDF5_EXTERNALLY_CONFIGURED AND NOT HDF5_NO_PACKAGES) # - Root install directory (displayed to end user at installer-run time) # - "NSIS package/display name" (text used in the installer GUI) # - Registry key used to store info about the installation - SET (CPACK_NSIS_PACKAGE_NAME "${HDF5_PACKAGE_STRING}-${CPACK_PACKAGE_VERSION}") + SET (CPACK_NSIS_PACKAGE_NAME "${HDF5_PACKAGE_STRING}") IF (CMAKE_CL_64) SET (CPACK_NSIS_INSTALL_ROOT "$PROGRAMFILES64") SET (CPACK_PACKAGE_INSTALL_REGISTRY_KEY "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION} (Win64)") -- cgit v0.12 From f683d9a035302bac4764ed2083d9020752ee40dc Mon Sep 17 00:00:00 2001 From: HDF Tester Date: Sun, 2 Mar 2014 04:16:37 -0500 Subject: [svn-r24753] Snapshot version 1.9 release 173 --- 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 e15c454..f6b44a1 100644 --- a/README.txt +++ b/README.txt @@ -1,4 +1,4 @@ -HDF5 version 1.9.173 currently under development +HDF5 version 1.9.174 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 5938d2d..e9c4206 100644 --- a/c++/src/Makefile.in +++ b/c++/src/Makefile.in @@ -469,7 +469,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 = 163 +LT_VERS_REVISION = 164 LT_VERS_AGE = 0 # Include src directory diff --git a/config/lt_vers.am b/config/lt_vers.am index 02f4ff5..63d1215 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 = 163 +LT_VERS_REVISION = 164 LT_VERS_AGE = 0 ## If the API changes *at all*, increment LT_VERS_INTERFACE and diff --git a/configure b/configure index 903ab9d..be0b9ec 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.173. +# Generated by GNU Autoconf 2.69 for HDF5 1.9.174. # # Report bugs to . # @@ -591,8 +591,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='HDF5' PACKAGE_TARNAME='hdf5' -PACKAGE_VERSION='1.9.173' -PACKAGE_STRING='HDF5 1.9.173' +PACKAGE_VERSION='1.9.174' +PACKAGE_STRING='HDF5 1.9.174' PACKAGE_BUGREPORT='help@hdfgroup.org' PACKAGE_URL='' @@ -1492,7 +1492,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.173 to adapt to many kinds of systems. +\`configure' configures HDF5 1.9.174 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1562,7 +1562,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of HDF5 1.9.173:";; + short | recursive ) echo "Configuration of HDF5 1.9.174:";; esac cat <<\_ACEOF @@ -1761,7 +1761,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -HDF5 configure 1.9.173 +HDF5 configure 1.9.174 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2855,7 +2855,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.173, which was +It was created by HDF5 $as_me 1.9.174, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -3687,7 +3687,7 @@ fi # Define the identity of the package. PACKAGE='hdf5' - VERSION='1.9.173' + VERSION='1.9.174' cat >>confdefs.h <<_ACEOF @@ -31676,7 +31676,7 @@ Usage: $0 [OPTIONS] Report bugs to ." lt_cl_version="\ -HDF5 config.lt 1.9.173 +HDF5 config.lt 1.9.174 configured by $0, generated by GNU Autoconf 2.69. Copyright (C) 2011 Free Software Foundation, Inc. @@ -33814,7 +33814,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.173, which was +This file was extended by HDF5 $as_me 1.9.174, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -33880,7 +33880,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.173 +HDF5 config.status 1.9.174 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff --git a/configure.ac b/configure.ac index 1994226..8e71895 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.173], [help@hdfgroup.org]) +AC_INIT([HDF5], [1.9.174], [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 6b0b3ff..455c44e 100644 --- a/fortran/src/Makefile.in +++ b/fortran/src/Makefile.in @@ -520,7 +520,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 = 163 +LT_VERS_REVISION = 164 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 841fed7..a1c4a8d 100644 --- a/hl/c++/src/Makefile.in +++ b/hl/c++/src/Makefile.in @@ -460,7 +460,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 = 163 +LT_VERS_REVISION = 164 LT_VERS_AGE = 0 # Include src directory diff --git a/hl/fortran/src/Makefile.in b/hl/fortran/src/Makefile.in index b7e0963..eed0856 100644 --- a/hl/fortran/src/Makefile.in +++ b/hl/fortran/src/Makefile.in @@ -476,7 +476,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 = 163 +LT_VERS_REVISION = 164 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 09c53df..fde9676 100644 --- a/hl/src/Makefile.in +++ b/hl/src/Makefile.in @@ -459,7 +459,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 = 163 +LT_VERS_REVISION = 164 LT_VERS_AGE = 0 # This library is our main target. diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 28d170e..7bf5703 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -1,4 +1,4 @@ -HDF5 version 1.9.173 currently under development +HDF5 version 1.9.174 currently under development ================================================================================ diff --git a/src/H5public.h b/src/H5public.h index 73ce009..748d059 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 173 /* For tweaks, bug-fixes, or development */ +#define H5_VERS_RELEASE 174 /* 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.173" /* Full version string */ +#define H5_VERS_INFO "HDF5 library version: 1.9.174" /* 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 fb65265..72fa81a 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -520,7 +520,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 = 163 +LT_VERS_REVISION = 164 LT_VERS_AGE = 0 # Our main target, the HDF5 library diff --git a/vms/src/h5pubconf.h b/vms/src/h5pubconf.h index 3b92a72..7f6ae4d 100644 --- a/vms/src/h5pubconf.h +++ b/vms/src/h5pubconf.h @@ -511,7 +511,7 @@ #define H5_PACKAGE_NAME "HDF5" /* Define to the full name and version of this package. */ -#define H5_PACKAGE_STRING "HDF5 1.9.173" +#define H5_PACKAGE_STRING "HDF5 1.9.174" /* Define to the one symbol short name of this package. */ #define H5_PACKAGE_TARNAME "hdf5" @@ -520,7 +520,7 @@ #define H5_PACKAGE_URL "" /* Define to the version of this package. */ -#define H5_PACKAGE_VERSION "1.9.173" +#define H5_PACKAGE_VERSION "1.9.174" /* Width for printf() for type `long long' or `__int64', use `ll' */ #define H5_PRINTF_LL_WIDTH "ll" @@ -683,7 +683,7 @@ /* #undef H5_USING_MEMCHECKER */ /* Version number of package */ -#define H5_VERSION "1.9.173" +#define H5_VERSION "1.9.174" /* Define if vsnprintf() returns the correct value for formatted strings that don't fit into size allowed */ -- cgit v0.12 From e367f64e24b95876d7c2673c7181aa12533d3f31 Mon Sep 17 00:00:00 2001 From: Neil Fortner Date: Mon, 3 Mar 2014 17:54:14 -0500 Subject: [svn-r24757] Change assertion to condition check/error return. Should fix periodic assertion failure in fheap test (in test that is expected to fail cleanly). Fix type in H5detect.c Tested: ostrich, platypus (h5committest - jam and koala having issues) --- src/H5HFman.c | 6 ++++-- src/H5detect.c | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/H5HFman.c b/src/H5HFman.c index 882d2ba..58dab10 100644 --- a/src/H5HFman.c +++ b/src/H5HFman.c @@ -312,12 +312,14 @@ H5HF_man_op_real(H5HF_hdr_t *hdr, hid_t dxpl_id, const uint8_t *id, /* Decode the object offset within the heap & its length */ UINT64DECODE_VAR(id, obj_off, hdr->heap_off_size); UINT64DECODE_VAR(id, obj_len, hdr->heap_len_size); - HDassert(obj_off > 0); - HDassert(obj_len > 0); /* Check for bad offset or length */ + if(obj_off == 0) + HGOTO_ERROR(H5E_HEAP, H5E_BADRANGE, FAIL, "invalid fractal heap offset") if(obj_off > hdr->man_size) HGOTO_ERROR(H5E_HEAP, H5E_BADRANGE, FAIL, "fractal heap object offset too large") + if(obj_len == 0) + HGOTO_ERROR(H5E_HEAP, H5E_BADRANGE, FAIL, "invalid fractal heap object size") if(obj_len > hdr->man_dtable.cparam.max_direct_size) HGOTO_ERROR(H5E_HEAP, H5E_BADRANGE, FAIL, "fractal heap object size too large for direct block") if(obj_len > hdr->max_man_size) diff --git a/src/H5detect.c b/src/H5detect.c index 0f8d051..aed7514 100644 --- a/src/H5detect.c +++ b/src/H5detect.c @@ -332,7 +332,7 @@ precision (detected_t *d) if(_v1 != _v2) \ _pad_mask[_i] |= _byte_mask; \ _buf1[_i] ^= _byte_mask; \ - } /* enf for */ \ + } /* end for */ \ \ /* Byte Order */ \ for(_i = 0, _v1 = 0.0, _v2 = 1.0; _i < (int)sizeof(TYPE); _i++) { \ -- cgit v0.12 From ac0ef34a4132dcf8c27eb6731cb2686acc593205 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Fri, 7 Mar 2014 14:12:20 -0500 Subject: [svn-r24769] Description: Check in Mohamad's changes to support collective I/O on point selections, along with some other minor cleanups. Tested on: Mac OSX/64 10.9.2 (amazon) w/parallel & serial (h5committest forthcoming) --- MANIFEST | 1 - hl/src/H5DO.c | 122 +++++--------- hl/src/H5DOprivate.h | 37 ----- src/H5Dchunk.c | 84 ++++++---- src/H5Dcompact.c | 2 +- src/H5Dcontig.c | 2 +- src/H5Dint.c | 8 +- src/H5Dio.c | 31 ++-- src/H5Dmpio.c | 129 ++++++++++---- src/H5Dpkg.h | 16 +- src/H5Dprivate.h | 3 - src/H5Pdxpl.c | 9 +- src/H5Smpio.c | 443 ++++++++++++++++++++++++++++++++++++++++++++----- src/H5Sprivate.h | 13 +- src/H5Sselect.c | 53 +++--- src/H5private.h | 4 +- testpar/t_coll_chunk.c | 401 ++++++++++++++++++++++++++++++++++---------- testpar/t_dset.c | 406 ++++++++++++++++++++++++++++++++++++++++---- testpar/testphdf5.h | 19 ++- 19 files changed, 1382 insertions(+), 401 deletions(-) delete mode 100644 hl/src/H5DOprivate.h diff --git a/MANIFEST b/MANIFEST index b79b3cb..768a559 100644 --- a/MANIFEST +++ b/MANIFEST @@ -2246,7 +2246,6 @@ ./hl/src/Makefile.am ./hl/src/Makefile.in ./hl/src/H5DO.c -./hl/src/H5DOprivate.h ./hl/src/H5DOpublic.h ./hl/src/H5DS.c ./hl/src/H5DSprivate.h diff --git a/hl/src/H5DO.c b/hl/src/H5DO.c index 9cfd8c1..99dbd93 100644 --- a/hl/src/H5DO.c +++ b/hl/src/H5DO.c @@ -18,8 +18,14 @@ #include #include -#include "H5DOprivate.h" +/* High-level library internal header file */ +#include "H5HLprivate2.h" +/* public LT prototypes */ +#include "H5DOpublic.h" + + + /*------------------------------------------------------------------------- * Function: H5DOwrite_chunk * @@ -30,108 +36,64 @@ * Programmer: Raymond Lu * 30 July 2012 * - * Modifications: *------------------------------------------------------------------------- */ herr_t H5DOwrite_chunk(hid_t dset_id, hid_t dxpl_id, uint32_t filters, const hsize_t *offset, size_t data_size, const void *buf) { - hbool_t created_dxpl = FALSE; - herr_t ret_value = SUCCEED; /* Return value */ + hbool_t created_dxpl = FALSE; /* Whether we created a DXPL */ + hbool_t do_direct_write = TRUE; /* Flag for direct writes */ + uint32_t data_size_32; /* Chunk data size (limited to 32-bits currently) */ + herr_t ret_value = FAIL; /* Return value */ - if(dset_id < 0) { - ret_value = FAIL; + /* Check arguments */ + if(dset_id < 0) goto done; - } - - if(!buf) { - ret_value = FAIL; + if(!buf) goto done; - } - - if(!offset) { - ret_value = FAIL; + if(!offset) goto done; - } - - if(!data_size) { - ret_value = FAIL; + if(!data_size) + goto done; + data_size_32 = (uint32_t)data_size; + if(data_size != (size_t)data_size_32) goto done; - } + /* If the user passed in a default DXPL, create one to pass to H5Dwrite() */ if(H5P_DEFAULT == dxpl_id) { - if((dxpl_id = H5Pcreate(H5P_DATASET_XFER)) < 0) { - ret_value = FAIL; + if((dxpl_id = H5Pcreate(H5P_DATASET_XFER)) < 0) goto done; - } - created_dxpl = TRUE; - } + } /* end if */ - if(H5DO_write_chunk(dset_id, dxpl_id, filters, offset, data_size, buf) < 0) { - ret_value = FAIL; + /* Set direct write parameters */ + if(H5Pset(dxpl_id, H5D_XFER_DIRECT_CHUNK_WRITE_FLAG_NAME, &do_direct_write) < 0) goto done; - } - -done: - if(created_dxpl) { - if(H5Pclose(dxpl_id) < 0) - ret_value = FAIL; - } - - return ret_value; -} - -/*------------------------------------------------------------------------- - * Function: H5DO_write_chunk - * - * Purpose: Private function for H5DOwrite_chunk - * - * Return: Non-negative on success/Negative on failure - * - * Programmer: Raymond Lu - * 30 July 2012 - * - * Modifications: - *------------------------------------------------------------------------- - */ -herr_t -H5DO_write_chunk(hid_t dset_id, hid_t dxpl_id, uint32_t filters, const hsize_t *offset, - size_t data_size, const void *buf) -{ - hbool_t do_direct_write = TRUE; - herr_t ret_value = SUCCEED; /* Return value */ - - if(H5Pset(dxpl_id, H5D_XFER_DIRECT_CHUNK_WRITE_FLAG_NAME, &do_direct_write) < 0) { - ret_value = FAIL; + if(H5Pset(dxpl_id, H5D_XFER_DIRECT_CHUNK_WRITE_FILTERS_NAME, &filters) < 0) goto done; - } - - if(H5Pset(dxpl_id, H5D_XFER_DIRECT_CHUNK_WRITE_FILTERS_NAME, &filters) < 0) { - ret_value = FAIL; + if(H5Pset(dxpl_id, H5D_XFER_DIRECT_CHUNK_WRITE_OFFSET_NAME, &offset) < 0) goto done; - } - - if(H5Pset(dxpl_id, H5D_XFER_DIRECT_CHUNK_WRITE_OFFSET_NAME, &offset) < 0) { - ret_value = FAIL; + if(H5Pset(dxpl_id, H5D_XFER_DIRECT_CHUNK_WRITE_DATASIZE_NAME, &data_size_32) < 0) goto done; - } - if(H5Pset(dxpl_id, H5D_XFER_DIRECT_CHUNK_WRITE_DATASIZE_NAME, &data_size) < 0) { - ret_value = FAIL; + /* Write chunk */ + if(H5Dwrite(dset_id, 0, H5S_ALL, H5S_ALL, dxpl_id, buf) < 0) goto done; - } - if(H5Dwrite(dset_id, 0, H5S_ALL, H5S_ALL, dxpl_id, buf) < 0) { - ret_value = FAIL; - goto done; - } + /* Indicate success */ + ret_value = SUCCEED; done: - do_direct_write = FALSE; - if(H5Pset(dxpl_id, H5D_XFER_DIRECT_CHUNK_WRITE_FLAG_NAME, &do_direct_write) < 0) - ret_value = FAIL; + if(created_dxpl) { + if(H5Pclose(dxpl_id) < 0) + ret_value = FAIL; + } /* end if */ + else + /* Reset the direct write flag on user DXPL */ + if(H5Pset(dxpl_id, H5D_XFER_DIRECT_CHUNK_WRITE_FLAG_NAME, &do_direct_write) < 0) + ret_value = FAIL; + + return(ret_value); +} /* end H5DOwrite_chunk() */ - return ret_value; -} diff --git a/hl/src/H5DOprivate.h b/hl/src/H5DOprivate.h deleted file mode 100644 index fcea585..0000000 --- a/hl/src/H5DOprivate.h +++ /dev/null @@ -1,37 +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 _H5DOprivate_H -#define _H5DOprivate_H - -/* High-level library internal header file */ -#include "H5HLprivate2.h" - -/* public LT prototypes */ -#include "H5DOpublic.h" - -/*------------------------------------------------------------------------- - * Private functions - *------------------------------------------------------------------------- - */ - -H5_HLDLL herr_t H5DO_write_chunk(hid_t dset_id, - hid_t dxpl_id, - uint32_t filters, - const hsize_t *offset, - size_t data_size, - const void *buf); - -#endif diff --git a/src/H5Dchunk.c b/src/H5Dchunk.c index e834aa3..92db446 100644 --- a/src/H5Dchunk.c +++ b/src/H5Dchunk.c @@ -164,10 +164,18 @@ typedef struct H5D_chunk_it_ud4_t { /* Callback info for nonexistent readvv operation */ typedef struct H5D_chunk_readvv_ud_t { unsigned char *rbuf; /* Read buffer to initialize */ - H5D_t *dset; /* Dataset to operate on */ + const H5D_t *dset; /* Dataset to operate on */ hid_t dxpl_id; /* DXPL for operation */ } H5D_chunk_readvv_ud_t; +/* Callback info for file selection iteration */ +typedef struct H5D_chunk_file_iter_ud_t { + H5D_chunk_map_t *fm; /* File->memory chunk mapping info */ +#ifdef H5_HAVE_PARALLEL + const H5D_io_info_t *io_info; /* I/O info for operation */ +#endif /* H5_HAVE_PARALLEL */ +} H5D_chunk_file_iter_ud_t; + /********************/ /* Local Prototypes */ @@ -297,7 +305,7 @@ H5FL_BLK_DEFINE_STATIC(chunk); */ herr_t H5D__chunk_direct_write(const H5D_t *dset, hid_t dxpl_id, uint32_t filters, hsize_t *offset, - size_t data_size, const void *buf) + uint32_t data_size, const void *buf) { const H5O_layout_t *layout = &(dset->shared->layout); /* Dataset layout */ H5D_chunk_ud_t udata; /* User data for querying chunk info */ @@ -329,8 +337,7 @@ H5D__chunk_direct_write(const H5D_t *dset, hid_t dxpl_id, uint32_t filters, hsiz HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't get chunk index") /* Find out the file address of the chunk */ - if(H5D__chunk_lookup(dset, dxpl_id, offset, chunk_idx, - &udata) < 0) + if(H5D__chunk_lookup(dset, dxpl_id, offset, chunk_idx, &udata) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "error looking up chunk address") udata.filter_mask = filters; @@ -685,7 +692,7 @@ H5D__chunk_io_init(const H5D_io_info_t *io_info, const H5D_type_info_t *type_inf hsize_t nelmts, const H5S_t *file_space, const H5S_t *mem_space, H5D_chunk_map_t *fm) { - H5D_t *dataset = io_info->dset; /* Local pointer to dataset info */ + const H5D_t *dataset = io_info->dset; /* Local pointer to dataset info */ const H5T_t *mem_type = type_info->mem_type; /* Local pointer to memory datatype */ H5S_t *tmp_mspace = NULL; /* Temporary memory dataspace */ hssize_t old_offset[H5O_LAYOUT_NDIMS]; /* Old selection offset */ @@ -698,7 +705,6 @@ H5D__chunk_io_init(const H5D_io_info_t *io_info, const H5D_type_info_t *type_inf H5S_sel_type fsel_type; /* Selection type on disk */ char bogus; /* "bogus" buffer to pass to selection iterator */ unsigned u; /* Local index variable */ - hbool_t sel_hyper_flag; herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_STATIC @@ -796,6 +802,8 @@ H5D__chunk_io_init(const H5D_io_info_t *io_info, const H5D_type_info_t *type_inf HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to create chunk selections for single element") } /* end if */ else { + hbool_t sel_hyper_flag; /* Whether file selection is a hyperslab */ + /* Initialize skip list for chunk selections */ if(NULL == dataset->shared->cache.chunk.sel_chunks) { if(NULL == (dataset->shared->cache.chunk.sel_chunks = H5SL_create(H5SL_TYPE_HSIZE, NULL))) @@ -843,12 +851,20 @@ H5D__chunk_io_init(const H5D_io_info_t *io_info, const H5D_type_info_t *type_inf } /* end while */ } /* end if */ else { + H5D_chunk_file_iter_ud_t udata; /* User data for iteration */ + /* Create temporary datatypes for selection iteration */ if((f_tid = H5I_register(H5I_DATATYPE, H5T_copy(dataset->shared->type, H5T_COPY_ALL), FALSE)) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, "unable to register file datatype") + /* Initialize the user data */ + udata.fm = fm; +#ifdef H5_HAVE_PARALLEL + udata.io_info = io_info; +#endif /* H5_HAVE_PARALLEL */ + /* Spaces might not be the same shape, iterate over the file selection directly */ - if(H5S_select_iterate(&bogus, f_tid, file_space, H5D__chunk_file_cb, fm) < 0) + if(H5S_select_iterate(&bogus, f_tid, file_space, H5D__chunk_file_cb, &udata) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to create file chunk selections") /* Reset "last chunk" info */ @@ -1265,7 +1281,7 @@ H5D__create_chunk_file_map_hyper(H5D_chunk_map_t *fm, const H5D_io_info_t /* Add temporary chunk to the list of chunks */ /* Allocate the file & memory chunk information */ - if (NULL==(new_chunk_info = H5FL_MALLOC (H5D_chunk_info_t))) { + if (NULL==(new_chunk_info = H5FL_MALLOC(H5D_chunk_info_t))) { (void)H5S_close(tmp_fchunk); HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate chunk info") } /* end if */ @@ -1276,7 +1292,7 @@ H5D__create_chunk_file_map_hyper(H5D_chunk_map_t *fm, const H5D_io_info_t new_chunk_info->index=chunk_index; #ifdef H5_HAVE_PARALLEL - /* store chunk selection information */ + /* Store chunk selection information, for multi-chunk I/O */ if(io_info->using_mpi_vfd) fm->select_chunk[chunk_index] = new_chunk_info; #endif /* H5_HAVE_PARALLEL */ @@ -1476,9 +1492,10 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5D__chunk_file_cb(void UNUSED *elem, hid_t UNUSED type_id, unsigned ndims, const hsize_t *coords, void *_fm) +H5D__chunk_file_cb(void UNUSED *elem, hid_t UNUSED type_id, unsigned ndims, const hsize_t *coords, void *_udata) { - H5D_chunk_map_t *fm = (H5D_chunk_map_t *)_fm; /* File<->memory chunk mapping info */ + H5D_chunk_file_iter_ud_t *udata = (H5D_chunk_file_iter_ud_t *)_udata; /* User data for operation */ + H5D_chunk_map_t *fm = udata->fm; /* File<->memory chunk mapping info */ H5D_chunk_info_t *chunk_info; /* Chunk information for current chunk */ hsize_t coords_in_chunk[H5O_LAYOUT_NDIMS]; /* Coordinates of element in chunk */ hsize_t chunk_index; /* Chunk index */ @@ -1496,7 +1513,7 @@ H5D__chunk_file_cb(void UNUSED *elem, hid_t UNUSED type_id, unsigned ndims, cons /* If the chunk index is the same as the last chunk index we used, * get the cached info to operate on. */ - chunk_info=fm->last_chunk_info; + chunk_info = fm->last_chunk_info; } /* end if */ else { /* If the chunk index is not the same as the last chunk index we used, @@ -1553,14 +1570,20 @@ H5D__chunk_file_cb(void UNUSED *elem, hid_t UNUSED type_id, unsigned ndims, cons } /* end if */ } /* end if */ +#ifdef H5_HAVE_PARALLEL + /* Store chunk selection information, for collective multi-chunk I/O */ + if(udata->io_info->using_mpi_vfd) + fm->select_chunk[chunk_index] = chunk_info; +#endif /* H5_HAVE_PARALLEL */ + /* Update the "last chunk seen" information */ - fm->last_index=chunk_index; - fm->last_chunk_info=chunk_info; + fm->last_index = chunk_index; + fm->last_chunk_info = chunk_info; } /* end else */ - /* Get the coordinates of the element in the chunk */ + /* Get the offset of the element within the chunk */ for(u = 0; u < fm->f_ndims; u++) - coords_in_chunk[u] = coords[u] % fm->layout->u.chunk.dim[u]; + coords_in_chunk[u] = coords[u] - chunk_info->coords[u]; /* Add point to file selection for chunk */ if(H5S_select_elements(chunk_info->fspace, H5S_SELECT_APPEND, (size_t)1, coords_in_chunk) < 0) @@ -1669,8 +1692,8 @@ done: htri_t H5D__chunk_cacheable(const H5D_io_info_t *io_info, haddr_t caddr, hbool_t write_op) { - const H5D_t *dataset = io_info->dset; - htri_t ret_value = FAIL; + const H5D_t *dataset = io_info->dset; /* Local pointer to dataset info */ + htri_t ret_value = FAIL; /* Return value */ FUNC_ENTER_PACKAGE @@ -1815,8 +1838,7 @@ H5D__chunk_read(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, chunk_info = H5D_CHUNK_GET_NODE_INFO(fm, chunk_node); /* Get the info for the chunk in the file */ - if(H5D__chunk_lookup(io_info->dset, io_info->dxpl_id, - chunk_info->coords, chunk_info->index, &udata) < 0) + if(H5D__chunk_lookup(io_info->dset, io_info->dxpl_id, chunk_info->coords, chunk_info->index, &udata) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "error looking up chunk address") /* Check for non-existant chunk & skip it if appropriate */ @@ -1945,8 +1967,7 @@ H5D__chunk_write(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, /* Load the chunk into cache. But if the whole chunk is written, * simply allocate space instead of load the chunk. */ - if(H5D__chunk_lookup(io_info->dset, io_info->dxpl_id, chunk_info->coords, - chunk_info->index, &udata) < 0) + if(H5D__chunk_lookup(io_info->dset, io_info->dxpl_id, chunk_info->coords, chunk_info->index, &udata) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "error looking up chunk address") if((cacheable = H5D__chunk_cacheable(io_info, udata.addr, TRUE)) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't tell if chunk is cacheable") @@ -2296,7 +2317,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5D__chunk_create(H5D_t *dset /*in,out*/, hid_t dxpl_id) +H5D__chunk_create(const H5D_t *dset /*in,out*/, hid_t dxpl_id) { H5D_chk_idx_info_t idx_info; /* Chunked index info */ herr_t ret_value = SUCCEED; /* Return value */ @@ -2777,7 +2798,7 @@ void * H5D__chunk_lock(const H5D_io_info_t *io_info, H5D_chunk_ud_t *udata, hbool_t relax) { - H5D_t *dset = io_info->dset; /* Local pointer to the dataset info */ + const H5D_t *dset = io_info->dset; /* Local pointer to the dataset info */ const H5O_pline_t *pline = &(dset->shared->dcpl_cache.pline); /* I/O pipeline info - always equal to the pline passed to H5D__chunk_alloc */ const H5O_layout_t *layout = &(dset->shared->layout); /* Dataset layout */ const H5O_fill_t *fill = &(dset->shared->dcpl_cache.fill); /* Fill value info */ @@ -3216,7 +3237,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5D__chunk_allocate(H5D_t *dset, hid_t dxpl_id, hbool_t full_overwrite, +H5D__chunk_allocate(const H5D_t *dset, hid_t dxpl_id, hbool_t full_overwrite, hsize_t old_dim[]) { H5D_chk_idx_info_t idx_info; /* Chunked index info */ @@ -3417,8 +3438,7 @@ H5D__chunk_allocate(H5D_t *dset, hid_t dxpl_id, hbool_t full_overwrite, &chunk_idx) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't get chunk index") - if(H5D__chunk_lookup(dset, dxpl_id, chunk_offset, chunk_idx, - &udata) < 0) + if(H5D__chunk_lookup(dset, dxpl_id, chunk_offset, chunk_idx, &udata) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "error looking up chunk address") HDassert(!H5F_addr_defined(udata.addr)); @@ -3583,7 +3603,7 @@ static herr_t H5D__chunk_prune_fill(H5D_chunk_it_ud1_t *udata) { const H5D_io_info_t *io_info = udata->io_info; /* Local pointer to I/O info */ - H5D_t *dset = io_info->dset; /* Local pointer to the dataset info */ + const H5D_t *dset = io_info->dset; /* Local pointer to the dataset info */ const H5O_layout_t *layout = &(dset->shared->layout); /* Dataset's layout */ unsigned rank = udata->common.layout->ndims - 1; /* Dataset rank */ const hsize_t *chunk_offset = io_info->store->chunk.offset; /* Chunk offset */ @@ -3605,8 +3625,7 @@ H5D__chunk_prune_fill(H5D_chunk_it_ud1_t *udata) H5_ASSIGN_OVERFLOW(chunk_size, layout->u.chunk.size, uint32_t, size_t); /* Get the info for the chunk in the file */ - if(H5D__chunk_lookup(dset, io_info->dxpl_id, chunk_offset, - io_info->store->chunk.index, &chk_udata) < 0) + if(H5D__chunk_lookup(dset, io_info->dxpl_id, chunk_offset, io_info->store->chunk.index, &chk_udata) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "error looking up chunk address") /* If this chunk does not exist in cache or on disk, no need to do anything @@ -4015,8 +4034,7 @@ H5D__chunk_prune_by_extent(H5D_t *dset, hid_t dxpl_id, const hsize_t *old_dim) #endif /* NDEBUG */ /* Check if the chunk exists in cache or on disk */ - if(H5D__chunk_lookup(dset, dxpl_id, chunk_offset, - chk_io_info.store->chunk.index, &chk_udata) < 0) + if(H5D__chunk_lookup(dset, dxpl_id, chunk_offset, chk_io_info.store->chunk.index, &chk_udata) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "error looking up chunk") /* Evict the entry from the cache if present, but do not flush @@ -4155,7 +4173,7 @@ herr_t H5D__chunk_addrmap(const H5D_io_info_t *io_info, haddr_t chunk_addr[]) { H5D_chk_idx_info_t idx_info; /* Chunked index info */ - H5D_t *dset = io_info->dset; /* Local pointer to dataset info */ + const H5D_t *dset = io_info->dset; /* Local pointer to dataset info */ H5D_chunk_it_ud2_t udata; /* User data for iteration callback */ herr_t ret_value = SUCCEED; /* Return value */ diff --git a/src/H5Dcompact.c b/src/H5Dcompact.c index 0b34c07..789beab 100644 --- a/src/H5Dcompact.c +++ b/src/H5Dcompact.c @@ -117,7 +117,7 @@ H5FL_BLK_EXTERN(type_conv); *------------------------------------------------------------------------- */ herr_t -H5D__compact_fill(H5D_t *dset, hid_t dxpl_id) +H5D__compact_fill(const H5D_t *dset, hid_t dxpl_id) { H5D_fill_buf_info_t fb_info; /* Dataset's fill buffer info */ hbool_t fb_info_init = FALSE; /* Whether the fill value buffer has been initialized */ diff --git a/src/H5Dcontig.c b/src/H5Dcontig.c index 69db7d4..8d4cd02 100644 --- a/src/H5Dcontig.c +++ b/src/H5Dcontig.c @@ -192,7 +192,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5D__contig_fill(H5D_t *dset, hid_t dxpl_id) +H5D__contig_fill(const H5D_t *dset, hid_t dxpl_id) { H5D_io_info_t ioinfo; /* Dataset I/O info */ H5D_storage_t store; /* Union of storage info for dataset */ diff --git a/src/H5Dint.c b/src/H5Dint.c index bc24c4f..15f5df7 100644 --- a/src/H5Dint.c +++ b/src/H5Dint.c @@ -66,7 +66,7 @@ static herr_t H5D__init_space(H5F_t *file, const H5D_t *dset, const H5S_t *space static herr_t H5D__update_oh_info(H5F_t *file, hid_t dxpl_id, H5D_t *dset, hid_t dapl_id); static herr_t H5D__open_oid(H5D_t *dataset, hid_t dapl_id, hid_t dxpl_id); -static herr_t H5D__init_storage(H5D_t *dataset, hbool_t full_overwrite, +static herr_t H5D__init_storage(const H5D_t *dataset, hbool_t full_overwrite, hsize_t old_dim[], hid_t dxpl_id); @@ -1578,7 +1578,7 @@ H5D_typeof(const H5D_t *dset) *------------------------------------------------------------------------- */ herr_t -H5D__alloc_storage(H5D_t *dset/*in,out*/, hid_t dxpl_id, H5D_time_alloc_t time_alloc, +H5D__alloc_storage(const H5D_t *dset, hid_t dxpl_id, H5D_time_alloc_t time_alloc, hbool_t full_overwrite, hsize_t old_dim[]) { H5F_t *f = dset->oloc.file; /* The dataset's file pointer */ @@ -1741,7 +1741,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5D__init_storage(H5D_t *dset, hbool_t full_overwrite, hsize_t old_dim[], +H5D__init_storage(const H5D_t *dset, hbool_t full_overwrite, hsize_t old_dim[], hid_t dxpl_id) { herr_t ret_value = SUCCEED; /* Return value */ @@ -2357,7 +2357,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5D__mark(H5D_t *dataset, hid_t UNUSED dxpl_id, unsigned flags) +H5D__mark(const H5D_t *dataset, hid_t UNUSED dxpl_id, unsigned flags) { herr_t ret_value = SUCCEED; /* Return value */ diff --git a/src/H5Dio.c b/src/H5Dio.c index 9b2f8ff..2687c5f 100644 --- a/src/H5Dio.c +++ b/src/H5Dio.c @@ -59,7 +59,11 @@ static herr_t H5D__pre_write(hid_t dset_id, hid_t mem_type_id, hid_t mem_space_i hid_t file_space_id, hid_t dxpl_id, const void *buf); /* Setup/teardown routines */ -static herr_t H5D__ioinfo_init(H5D_t *dset, const H5D_dxpl_cache_t *dxpl_cache, +static herr_t H5D__ioinfo_init(H5D_t *dset, +#ifndef H5_HAVE_PARALLEL +const +#endif /* H5_HAVE_PARALLEL */ + H5D_dxpl_cache_t *dxpl_cache, hid_t dxpl_id, const H5D_type_info_t *type_info, H5D_storage_t *store, H5D_io_info_t *io_info); static herr_t H5D__typeinfo_init(const H5D_t *dset, const H5D_dxpl_cache_t *dxpl_cache, @@ -275,14 +279,15 @@ H5D__pre_write(hid_t dset_id, hid_t mem_type_id, hid_t mem_space_id, if(NULL == (plist = (H5P_genplist_t *)H5I_object(dxpl_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset transfer property list") + /* Retrieve the 'direct write' flag */ if(H5P_get(plist, H5D_XFER_DIRECT_CHUNK_WRITE_FLAG_NAME, &direct_write) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "error getting flag for direct chunk write") /* Direct chunk write */ if(direct_write) { - uint32_t direct_filters = 0; + uint32_t direct_filters; hsize_t *direct_offset; - size_t direct_datasize = 0; + uint32_t direct_datasize; int ndims = 0; hsize_t dims[H5O_LAYOUT_NDIMS]; hsize_t internal_offset[H5O_LAYOUT_NDIMS]; @@ -291,12 +296,11 @@ H5D__pre_write(hid_t dset_id, hid_t mem_type_id, hid_t mem_space_id, if(H5D_CHUNKED != dset->shared->layout.type) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a chunked dataset") + /* Retrieve parameters for direct chunk write */ if(H5P_get(plist, H5D_XFER_DIRECT_CHUNK_WRITE_FILTERS_NAME, &direct_filters) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "error getting filter info for direct chunk write") - if(H5P_get(plist, H5D_XFER_DIRECT_CHUNK_WRITE_OFFSET_NAME, &direct_offset) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "error getting offset info for direct chunk write") - if(H5P_get(plist, H5D_XFER_DIRECT_CHUNK_WRITE_DATASIZE_NAME, &direct_datasize) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "error getting data size for direct chunk write") @@ -305,7 +309,7 @@ H5D__pre_write(hid_t dset_id, hid_t mem_type_id, hid_t mem_space_id, if((ndims = H5S_get_simple_extent_dims(dset->shared->space, dims, NULL)) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTGET, FAIL, "can't retrieve dataspace extent dims") - for(i=0; i dims[i]) HGOTO_ERROR(H5E_DATASPACE, H5E_BADTYPE, FAIL, "offset exceeds dimensions of dataset") @@ -315,7 +319,7 @@ H5D__pre_write(hid_t dset_id, hid_t mem_type_id, hid_t mem_space_id, HGOTO_ERROR(H5E_DATASPACE, H5E_BADTYPE, FAIL, "offset doesn't fall on chunks's boundary") internal_offset[i] = direct_offset[i]; - } + } /* end for */ /* Terminate the offset with a zero */ internal_offset[ndims] = 0; @@ -323,7 +327,8 @@ H5D__pre_write(hid_t dset_id, hid_t mem_type_id, hid_t mem_space_id, /* write raw data */ if(H5D__chunk_direct_write(dset, dxpl_id, direct_filters, internal_offset, direct_datasize, buf) < 0) HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "can't write chunk directly") - } else { /* Normal write */ + } /* end if */ + else { /* Normal write */ const H5S_t *mem_space = NULL; const H5S_t *file_space = NULL; char fake_char; @@ -472,7 +477,7 @@ H5D__read(H5D_t *dataset, hid_t mem_type_id, const H5S_t *mem_space, /* Attempt to construct projected dataspace for memory dataspace */ if(H5S_select_construct_projection(mem_space, &projected_mem_space, - (unsigned)H5S_GET_EXTENT_NDIMS(file_space), buf, &adj_buf, type_info.dst_type_size) < 0) + (unsigned)H5S_GET_EXTENT_NDIMS(file_space), buf, (const void **)&adj_buf, type_info.dst_type_size) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to construct projected memory dataspace") HDassert(projected_mem_space); HDassert(adj_buf); @@ -698,7 +703,7 @@ H5D__write(H5D_t *dataset, hid_t mem_type_id, const H5S_t *mem_space, /* Attempt to construct projected dataspace for memory dataspace */ if(H5S_select_construct_projection(mem_space, &projected_mem_space, - (unsigned)H5S_GET_EXTENT_NDIMS(file_space), buf, &adj_buf, type_info.src_type_size) < 0) + (unsigned)H5S_GET_EXTENT_NDIMS(file_space), buf, (const void **)&adj_buf, type_info.src_type_size) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to construct projected memory dataspace") HDassert(projected_mem_space); HDassert(adj_buf); @@ -825,7 +830,11 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5D__ioinfo_init(H5D_t *dset, const H5D_dxpl_cache_t *dxpl_cache, hid_t dxpl_id, +H5D__ioinfo_init(H5D_t *dset, +#ifndef H5_HAVE_PARALLEL +const +#endif /* H5_HAVE_PARALLEL */ + H5D_dxpl_cache_t *dxpl_cache, hid_t dxpl_id, const H5D_type_info_t *type_info, H5D_storage_t *store, H5D_io_info_t *io_info) { FUNC_ENTER_STATIC_NOERR diff --git a/src/H5Dmpio.c b/src/H5Dmpio.c index 3b5bb30..684f510 100644 --- a/src/H5Dmpio.c +++ b/src/H5Dmpio.c @@ -183,42 +183,30 @@ H5D__mpio_opt_possible(const H5D_io_info_t *io_info, const H5S_t *file_space, /* Optimized MPI types flag must be set and it must be collective IO */ /* (Don't allow parallel I/O for the MPI-posix driver, since it doesn't do real collective I/O) */ if(!(H5S_mpi_opt_types_g && io_info->dxpl_cache->xfer_mode == H5FD_MPIO_COLLECTIVE - && !IS_H5FD_MPIPOSIX(io_info->dset->oloc.file))) { + && !IS_H5FD_MPIPOSIX(io_info->dset->oloc.file))) local_cause |= H5D_MPIO_SET_MPIPOSIX; - } /* end if */ /* Don't allow collective operations if datatype conversions need to happen */ - if(!type_info->is_conv_noop) { + if(!type_info->is_conv_noop) local_cause |= H5D_MPIO_DATATYPE_CONVERSION; - } /* end if */ /* Don't allow collective operations if data transform operations should occur */ - if(!type_info->is_xform_noop) { + if(!type_info->is_xform_noop) local_cause |= H5D_MPIO_DATA_TRANSFORMS; - } /* end if */ /* Check whether these are both simple or scalar dataspaces */ if(!((H5S_SIMPLE == H5S_GET_EXTENT_TYPE(mem_space) || H5S_SCALAR == H5S_GET_EXTENT_TYPE(mem_space)) - && (H5S_SIMPLE == H5S_GET_EXTENT_TYPE(file_space) || H5S_SCALAR == H5S_GET_EXTENT_TYPE(file_space)))) { + && (H5S_SIMPLE == H5S_GET_EXTENT_TYPE(file_space) || H5S_SCALAR == H5S_GET_EXTENT_TYPE(file_space)))) local_cause |= H5D_MPIO_NOT_SIMPLE_OR_SCALAR_DATASPACES; - } /* end if */ - - /* Can't currently handle point selections */ - if(H5S_SEL_POINTS == H5S_GET_SELECT_TYPE(mem_space) - || H5S_SEL_POINTS == H5S_GET_SELECT_TYPE(file_space)) { - local_cause |= H5D_MPIO_POINT_SELECTIONS; - } /* end if */ /* Dataset storage must be contiguous or chunked */ if(!(io_info->dset->shared->layout.type == H5D_CONTIGUOUS || - io_info->dset->shared->layout.type == H5D_CHUNKED)) { + io_info->dset->shared->layout.type == H5D_CHUNKED)) local_cause |= H5D_MPIO_NOT_CONTIGUOUS_OR_CHUNKED_DATASET; - } /* end if */ /* check if external-file storage is used */ - if (io_info->dset->shared->dcpl_cache.efl.nused > 0) { + if(io_info->dset->shared->dcpl_cache.efl.nused > 0) local_cause |= H5D_MPIO_NOT_CONTIGUOUS_OR_CHUNKED_DATASET; - } /* The handling of memory space is different for chunking and contiguous * storage. For contiguous storage, mem_space and file_space won't change @@ -228,11 +216,9 @@ H5D__mpio_opt_possible(const H5D_io_info_t *io_info, const H5S_t *file_space, */ /* Don't allow collective operations if filters need to be applied */ - if(io_info->dset->shared->layout.type == H5D_CHUNKED) { - if(io_info->dset->shared->dcpl_cache.pline.nused > 0) { - local_cause |= H5D_MPIO_FILTERS; - } /* end if */ - } /* end if */ + if(io_info->dset->shared->layout.type == H5D_CHUNKED && + io_info->dset->shared->dcpl_cache.pline.nused > 0) + local_cause |= H5D_MPIO_FILTERS; /* Form consensus opinion among all processes about whether to perform * collective I/O @@ -242,7 +228,6 @@ H5D__mpio_opt_possible(const H5D_io_info_t *io_info, const H5S_t *file_space, ret_value = global_cause > 0 ? FALSE : TRUE; - done: /* Write the local value of no-collective-cause to the DXPL. */ if(H5P_set(dx_plist, H5D_MPIO_LOCAL_NO_COLLECTIVE_CAUSE_NAME, &local_cause) < 0) @@ -946,15 +931,58 @@ if(H5DEBUG(D)) /* Obtain MPI derived datatype from all individual chunks */ for(u = 0; u < num_chunk; u++) { - /* Disk MPI derived datatype */ + hsize_t *permute_map = NULL; /* array that holds the mapping from the old, + out-of-order displacements to the in-order + displacements of the MPI datatypes of the + point selection of the file space */ + hbool_t is_permuted = FALSE; + + /* Obtain disk and memory MPI derived datatype */ + /* NOTE: The permute_map array can be allocated within H5S_mpio_space_type + * and will be fed into the next call to H5S_mpio_space_type + * where it will be freed. + */ if(H5S_mpio_space_type(chunk_addr_info_array[u].chunk_info.fspace, - type_info->src_type_size, &chunk_ftype[u], &chunk_mpi_file_counts[u], &(chunk_mft_is_derived_array[u])) < 0) + type_info->src_type_size, + &chunk_ftype[u], /* OUT: datatype created */ + &chunk_mpi_file_counts[u], /* OUT */ + &(chunk_mft_is_derived_array[u]), /* OUT */ + TRUE, /* this is a file space, + so permute the + datatype if the point + selections are out of + order */ + &permute_map,/* OUT: a map to indicate the + permutation of points + selected in case they + are out of order */ + &is_permuted /* OUT */) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_BADTYPE, FAIL, "couldn't create MPI file type") - - /* Buffer MPI derived datatype */ + /* Sanity check */ + if(is_permuted) + HDassert(permute_map); if(H5S_mpio_space_type(chunk_addr_info_array[u].chunk_info.mspace, - type_info->dst_type_size, &chunk_mtype[u], &chunk_mpi_mem_counts[u], &(chunk_mbt_is_derived_array[u])) < 0) + type_info->dst_type_size, &chunk_mtype[u], + &chunk_mpi_mem_counts[u], + &(chunk_mbt_is_derived_array[u]), + FALSE, /* this is a memory + space, so if the file + space is not + permuted, there is no + need to permute the + datatype if the point + selections are out of + order*/ + &permute_map, /* IN: the permutation map + generated by the + file_space selection + and applied to the + memory selection */ + &is_permuted /* IN */) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_BADTYPE, FAIL, "couldn't create MPI buf type") + /* Sanity check */ + if(is_permuted) + HDassert(!permute_map); /* Chunk address relative to the first chunk */ chunk_addr_info_array[u].chunk_addr -= ctg_store.contig.dset_addr; @@ -1309,12 +1337,51 @@ H5D__inter_collective_io(H5D_io_info_t *io_info, const H5D_type_info_t *type_inf if((file_space != NULL) && (mem_space != NULL)) { int mpi_file_count; /* Number of file "objects" to transfer */ + hsize_t *permute_map = NULL; /* array that holds the mapping from the old, + out-of-order displacements to the in-order + displacements of the MPI datatypes of the + point selection of the file space */ + hbool_t is_permuted = FALSE; /* Obtain disk and memory MPI derived datatype */ - if(H5S_mpio_space_type(file_space, type_info->src_type_size, &mpi_file_type, &mpi_file_count, &mft_is_derived) < 0) + /* NOTE: The permute_map array can be allocated within H5S_mpio_space_type + * and will be fed into the next call to H5S_mpio_space_type + * where it will be freed. + */ + if(H5S_mpio_space_type(file_space, type_info->src_type_size, + &mpi_file_type, &mpi_file_count, &mft_is_derived, /* OUT: datatype created */ + TRUE, /* this is a file space, so + permute the datatype if the + point selection is out of + order */ + &permute_map, /* OUT: a map to indicate + the permutation of + points selected in + case they are out of + order */ + &is_permuted /* OUT */) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_BADTYPE, FAIL, "couldn't create MPI file type") - if(H5S_mpio_space_type(mem_space, type_info->src_type_size, &mpi_buf_type, &mpi_buf_count, &mbt_is_derived) < 0) + /* Sanity check */ + if(is_permuted) + HDassert(permute_map); + if(H5S_mpio_space_type(mem_space, type_info->src_type_size, + &mpi_buf_type, &mpi_buf_count, &mbt_is_derived, /* OUT: datatype created */ + FALSE, /* this is a memory space, so if + the file space is not + permuted, there is no need to + permute the datatype if the + point selections are out of + order*/ + &permute_map /* IN: the permutation map + generated by the + file_space selection + and applied to the + memory selection */, + &is_permuted /* IN */) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_BADTYPE, FAIL, "couldn't create MPI buffer type") + /* Sanity check */ + if(is_permuted) + HDassert(!permute_map); } /* end if */ else { /* For non-selection, participate with a none MPI derived datatype, the count is 0. */ diff --git a/src/H5Dpkg.h b/src/H5Dpkg.h index 7e6eb4b..c3cee61 100644 --- a/src/H5Dpkg.h +++ b/src/H5Dpkg.h @@ -187,7 +187,7 @@ typedef enum H5D_io_op_type_t { } H5D_io_op_type_t; typedef struct H5D_io_info_t { - H5D_t *dset; /* Pointer to dataset being operated on */ + const H5D_t *dset; /* Pointer to dataset being operated on */ #ifndef H5_HAVE_PARALLEL const #endif /* H5_HAVE_PARALLEL */ @@ -531,7 +531,7 @@ H5_DLL H5D_t *H5D__create_named(const H5G_loc_t *loc, const char *name, hid_t dapl_id, hid_t dxpl_id); H5_DLL herr_t H5D__get_space_status(H5D_t *dset, H5D_space_status_t *allocation, hid_t dxpl_id); -H5_DLL herr_t H5D__alloc_storage(H5D_t *dset, hid_t dxpl_id, H5D_time_alloc_t time_alloc, +H5_DLL herr_t H5D__alloc_storage(const H5D_t *dset, hid_t dxpl_id, H5D_time_alloc_t time_alloc, hbool_t full_overwrite, hsize_t old_dim[]); H5_DLL herr_t H5D__get_storage_size(H5D_t *dset, hid_t dxpl_id, hsize_t *storage_size); H5_DLL haddr_t H5D__get_offset(const H5D_t *dset); @@ -544,7 +544,7 @@ H5_DLL herr_t H5D__check_filters(H5D_t *dataset); H5_DLL herr_t H5D__set_extent(H5D_t *dataset, const hsize_t *size, hid_t dxpl_id); H5_DLL herr_t H5D__get_dxpl_cache(hid_t dxpl_id, H5D_dxpl_cache_t **cache); H5_DLL herr_t H5D__flush_sieve_buf(H5D_t *dataset, hid_t dxpl_id); -H5_DLL herr_t H5D__mark(H5D_t *dataset, hid_t dxpl_id, unsigned flags); +H5_DLL herr_t H5D__mark(const H5D_t *dataset, hid_t dxpl_id, unsigned flags); H5_DLL herr_t H5D__flush_real(H5D_t *dataset, hid_t dxpl_id); /* Internal I/O routines */ @@ -586,7 +586,7 @@ H5_DLL herr_t H5D__layout_oh_write(H5D_t *dataset, hid_t dxpl_id, H5O_t *oh, H5_DLL herr_t H5D__contig_alloc(H5F_t *f, hid_t dxpl_id, H5O_storage_contig_t *storage); H5_DLL hbool_t H5D__contig_is_space_alloc(const H5O_storage_t *storage); -H5_DLL herr_t H5D__contig_fill(H5D_t *dset, hid_t dxpl_id); +H5_DLL herr_t H5D__contig_fill(const H5D_t *dset, hid_t dxpl_id); H5_DLL herr_t H5D__contig_read(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, hsize_t nelmts, const H5S_t *file_space, const H5S_t *mem_space, H5D_chunk_map_t *fm); @@ -603,7 +603,7 @@ H5_DLL herr_t H5D__contig_delete(H5F_t *f, hid_t dxpl_id, /* Functions that operate on chunked dataset storage */ H5_DLL htri_t H5D__chunk_cacheable(const H5D_io_info_t *io_info, haddr_t caddr, hbool_t write_op); -H5_DLL herr_t H5D__chunk_create(H5D_t *dset /*in,out*/, hid_t dxpl_id); +H5_DLL herr_t H5D__chunk_create(const H5D_t *dset /*in,out*/, hid_t dxpl_id); H5_DLL herr_t H5D__chunk_set_info(const H5D_t *dset); H5_DLL herr_t H5D__chunk_init(H5F_t *f, hid_t dxpl_id, const H5D_t *dset, hid_t dapl_id); @@ -616,7 +616,7 @@ H5_DLL herr_t H5D__chunk_unlock(const H5D_io_info_t *io_info, const H5D_chunk_ud_t *udata, hbool_t dirty, void *chunk, uint32_t naccessed); H5_DLL herr_t H5D__chunk_allocated(H5D_t *dset, hid_t dxpl_id, hsize_t *nbytes); -H5_DLL herr_t H5D__chunk_allocate(H5D_t *dset, hid_t dxpl_id, +H5_DLL herr_t H5D__chunk_allocate(const H5D_t *dset, hid_t dxpl_id, hbool_t full_overwrite, hsize_t old_dim[]); H5_DLL herr_t H5D__chunk_prune_by_extent(H5D_t *dset, hid_t dxpl_id, const hsize_t *old_dim); @@ -634,12 +634,14 @@ H5_DLL herr_t H5D__chunk_dump_index(H5D_t *dset, hid_t dxpl_id, FILE *stream); H5_DLL herr_t H5D__chunk_dest(H5F_t *f, hid_t dxpl_id, H5D_t *dset); H5_DLL herr_t H5D__chunk_delete(H5F_t *f, hid_t dxpl_id, H5O_t *oh, H5O_storage_t *store); +H5_DLL herr_t H5D__chunk_direct_write(const H5D_t *dset, hid_t dxpl_id, uint32_t filters, + hsize_t *offset, uint32_t data_size, const void *buf); #ifdef H5D_CHUNK_DEBUG H5_DLL herr_t H5D__chunk_stats(const H5D_t *dset, hbool_t headers); #endif /* H5D_CHUNK_DEBUG */ /* Functions that operate on compact dataset storage */ -H5_DLL herr_t H5D__compact_fill(H5D_t *dset, hid_t dxpl_id); +H5_DLL herr_t H5D__compact_fill(const H5D_t *dset, hid_t dxpl_id); H5_DLL herr_t H5D__compact_copy(H5F_t *f_src, H5O_storage_compact_t *storage_src, H5F_t *f_dst, H5O_storage_compact_t *storage_dst, H5T_t *src_dtype, H5O_copy_t *cpy_info, hid_t dxpl_id); diff --git a/src/H5Dprivate.h b/src/H5Dprivate.h index 7adc231..d4ecedc 100644 --- a/src/H5Dprivate.h +++ b/src/H5Dprivate.h @@ -175,8 +175,5 @@ H5_DLL herr_t H5D_chunk_idx_reset(H5O_storage_chunk_t *storage, hbool_t reset_ad H5_DLL herr_t H5D_btree_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE * stream, int indent, int fwidth, unsigned ndims); -H5_DLL herr_t H5D__chunk_direct_write(const H5D_t *dset, hid_t dxpl_id, uint32_t filters, - hsize_t *offset, size_t data_size, const void *buf); - #endif /* _H5Dprivate_H */ diff --git a/src/H5Pdxpl.c b/src/H5Pdxpl.c index b5d688b..472700a 100644 --- a/src/H5Pdxpl.c +++ b/src/H5Pdxpl.c @@ -165,7 +165,7 @@ #define H5D_XFER_DIRECT_CHUNK_WRITE_FILTERS_DEF 0 #define H5D_XFER_DIRECT_CHUNK_WRITE_OFFSET_SIZE sizeof(hsize_t *) #define H5D_XFER_DIRECT_CHUNK_WRITE_OFFSET_DEF NULL -#define H5D_XFER_DIRECT_CHUNK_WRITE_DATASIZE_SIZE sizeof(size_t) +#define H5D_XFER_DIRECT_CHUNK_WRITE_DATASIZE_SIZE sizeof(uint32_t) #define H5D_XFER_DIRECT_CHUNK_WRITE_DATASIZE_DEF 0 /******************/ @@ -267,7 +267,7 @@ static const void *H5D_def_xfer_xform_g = H5D_XFER_XFORM_DEF; /* Defaul static const hbool_t H5D_def_direct_chunk_flag_g = H5D_XFER_DIRECT_CHUNK_WRITE_FLAG_DEF; /* Default value for the flag of direct chunk write */ static const uint32_t H5D_def_direct_chunk_filters_g = H5D_XFER_DIRECT_CHUNK_WRITE_FILTERS_DEF; /* Default value for the filters of direct chunk write */ static const hsize_t *H5D_def_direct_chunk_offset_g = H5D_XFER_DIRECT_CHUNK_WRITE_OFFSET_DEF; /* Default value for the offset of direct chunk write */ -static const size_t H5D_def_direct_chunk_datasize_g = H5D_XFER_DIRECT_CHUNK_WRITE_DATASIZE_DEF; /* Default value for the datasize of direct chunk write */ +static const uint32_t H5D_def_direct_chunk_datasize_g = H5D_XFER_DIRECT_CHUNK_WRITE_DATASIZE_DEF; /* Default value for the datasize of direct chunk write */ /*------------------------------------------------------------------------- @@ -1493,8 +1493,9 @@ H5Pset_btree_ratios(hid_t plist_id, double left, double middle, H5TRACE4("e", "iddd", plist_id, left, middle, right); /* Check arguments */ - if(left < 0.0 || left > 1.0 || middle < 0.0 || middle > 1.0 || - right < 0.0 || right > 1.0) + if(left < (double)0.0f || left > (double)1.0f + || middle < (double)0.0f || middle > (double)1.0f + || right < (double)0.0f || right > (double)1.0f) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "split ratio must satisfy 0.0<=X<=1.0") /* Get the plist structure */ diff --git a/src/H5Smpio.c b/src/H5Smpio.c index 77e902f..284e16f 100644 --- a/src/H5Smpio.c +++ b/src/H5Smpio.c @@ -43,6 +43,14 @@ static herr_t H5S_mpio_all_type(const H5S_t *space, size_t elmt_size, MPI_Datatype *new_type, int *count, hbool_t *is_derived_type); static herr_t H5S_mpio_none_type(MPI_Datatype *new_type, int *count, hbool_t *is_derived_type); +static herr_t H5S_mpio_create_point_datatype(size_t elmt_size, hsize_t num_points, + MPI_Aint *disp, MPI_Datatype *new_type); +static herr_t H5S_mpio_point_type(const H5S_t *space, size_t elmt_size, + MPI_Datatype *new_type, int *count, hbool_t *is_derived_type, + hbool_t do_permute, hsize_t **permute_map, hbool_t *is_permuted); +static herr_t H5S_mpio_permute_type(const H5S_t *space, size_t elmt_size, + hsize_t **permute_map, MPI_Datatype *new_type, int *count, + hbool_t *is_derived_type); static herr_t H5S_mpio_hyper_type(const H5S_t *space, size_t elmt_size, MPI_Datatype *new_type, int *count, hbool_t *is_derived_type); static herr_t H5S_mpio_span_hyper_type(const H5S_t *space, size_t elmt_size, @@ -131,6 +139,335 @@ H5S_mpio_none_type(MPI_Datatype *new_type, int *count, hbool_t *is_derived_type) /*------------------------------------------------------------------------- + * Function: H5S_mpio_create_point_datatype + * + * Purpose: Create a derived datatype for point selections. + * + * Return: non-negative on success, negative on failure. + * + * Outputs: *new_type the MPI type corresponding to the selection + * + * Programmer: Mohamad Chaarawi + * + *------------------------------------------------------------------------- + */ +static herr_t +H5S_mpio_create_point_datatype (size_t elmt_size, hsize_t num_points, + MPI_Aint *disp, MPI_Datatype *new_type) +{ + MPI_Datatype elmt_type; /* MPI datatype for individual element */ + hbool_t elmt_type_created = FALSE; /* Whether the element MPI datatype was created */ + int mpi_code; /* MPI error code */ + int *blocks = NULL; /* Array of block sizes for MPI hindexed create call */ + hsize_t u; /* Local index variable */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI_NOINIT + + /* Create an MPI datatype for an element */ + if(MPI_SUCCESS != (mpi_code = MPI_Type_contiguous((int)elmt_size, MPI_BYTE, &elmt_type))) + HMPI_GOTO_ERROR(FAIL, "MPI_Type_contiguous failed", mpi_code) + elmt_type_created = TRUE; + + /* Allocate block sizes for MPI datatype call */ + if(NULL == (blocks = (int *)H5MM_malloc(sizeof(int) * num_points))) + HGOTO_ERROR(H5E_DATASPACE, H5E_CANTALLOC, FAIL, "can't allocate array of blocks") + + /* Would be nice to have Create_Hindexed_block to avoid this array of all ones */ + for(u = 0; u < num_points; u++) + blocks[u] = 1; + + /* Create an MPI datatype for the whole point selection */ + if(MPI_SUCCESS != (mpi_code = MPI_Type_create_hindexed((int)num_points, blocks, disp, elmt_type, new_type))) + HMPI_GOTO_ERROR(FAIL, "MPI_Type_create_indexed_block failed", mpi_code) + + /* Commit MPI datatype for later use */ + if(MPI_SUCCESS != (mpi_code = MPI_Type_commit(new_type))) + HMPI_GOTO_ERROR(FAIL, "MPI_Type_commit failed", mpi_code) + +done: + if(elmt_type_created) + MPI_Type_free(&elmt_type); + if(blocks) + H5MM_free(blocks); + + FUNC_LEAVE_NOAPI(ret_value) +} /* H5S_mpio_create_point_datatype() */ + + +/*------------------------------------------------------------------------- + * Function: H5S_mpio_point_type + * + * Purpose: Translate an HDF5 "point" selection into an MPI type. + * Create a permutation array to handle out-of-order point selections. + * + * Return: non-negative on success, negative on failure. + * + * Outputs: *new_type the MPI type corresponding to the selection + * *count how many objects of the new_type in selection + * (useful if this is the buffer type for xfer) + * *is_derived_type 0 if MPI primitive type, 1 if derived + * *permute_map the permutation of the displacements to create + * the MPI_Datatype + * *is_permuted 0 if the displacements are permuted, 1 if not + * + * Programmer: Mohamad Chaarawi + * + *------------------------------------------------------------------------- + */ +static herr_t +H5S_mpio_point_type(const H5S_t *space, size_t elmt_size, MPI_Datatype *new_type, + int *count, hbool_t *is_derived_type, hbool_t do_permute, hsize_t **permute, + hbool_t *is_permuted) +{ + MPI_Aint *disp = NULL; /* Datatype displacement for each point*/ + H5S_pnt_node_t *curr = NULL; /* Current point being operated on in from the selection */ + hssize_t snum_points; /* Signed number of elements in selection */ + hsize_t num_points; /* Sumber of points in the selection */ + hsize_t u; /* Local index variable */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI_NOINIT + + /* Check args */ + HDassert(space); + + /* Get the total number of points selected */ + if((snum_points = (hssize_t)H5S_GET_SELECT_NPOINTS(space)) < 0) + HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCOUNT, FAIL, "can't get number of elements selected") + num_points = (hsize_t)snum_points; + + /* Allocate array for element displacements */ + if(NULL == (disp = (MPI_Aint *)H5MM_malloc(sizeof(MPI_Aint) * num_points))) + HGOTO_ERROR(H5E_DATASPACE, H5E_CANTALLOC, FAIL, "can't allocate array of displacements") + + /* Allocate array for element permutation - returned to caller */ + if(do_permute) + if(NULL == (*permute = (hsize_t *)H5MM_malloc(sizeof(hsize_t) * num_points))) + HGOTO_ERROR(H5E_DATASPACE, H5E_CANTALLOC, FAIL, "can't allocate permutation array") + + /* Iterate through list of elements */ + curr = space->select.sel_info.pnt_lst->head; + for(u = 0 ; u < num_points ; u++) { + /* calculate the displacement of the current point */ + disp[u] = H5VM_array_offset(space->extent.rank, space->extent.size, curr->pnt); + disp[u] *= elmt_size; + + /* This is a File Space used to set the file view, so adjust the displacements + * to have them monotonically non-decreasing. + * Generate the permutation array by indicating at each point being selected, + * the position it will shifted in the new displacement. Example: + * Suppose 4 points with corresponding are selected + * Pt 1: disp=6 ; Pt 2: disp=3 ; Pt 3: disp=0 ; Pt 4: disp=4 + * The permute map to sort the displacements in order will be: + * point 1: map[0] = L, indicating that this point is not moved (1st point selected) + * point 2: map[1] = 0, indicating that this point is moved to the first position, + * since disp_pt1(6) > disp_pt2(3) + * point 3: map[2] = 0, move to position 0, bec it has the lowest disp between + * the points selected so far. + * point 4: map[3] = 2, move the 2nd position since point 1 has a higher disp, + * but points 2 and 3 have lower displacements. + */ + if(do_permute) { + if(u > 0 && disp[u] < disp[u - 1]) { + unsigned s = 0, l = u, m = u / 2; + + *is_permuted = TRUE; + do { + if(disp[u] > disp[m]) + s = m + 1; + else if(disp[u] < disp[m]) + l = m; + else + break; + m = s + ((l - s) / 2); + } while(s < l); + + if(m < u) { + MPI_Aint temp; + + temp = disp[u]; + HDmemmove(disp + m + 1, disp + m, (u - m) * sizeof(MPI_Aint)); + disp[m] = temp; + } /* end if */ + (*permute)[u] = m; + } /* end if */ + else + (*permute)[u] = num_points; + } /* end if */ + /* this is a memory space, and no permutation is necessary to create + the derived datatype */ + else { + ;/* do nothing */ + } /* end else */ + + /* get the next point */ + curr = curr->next; + } /* end for */ + + /* Create the MPI datatype for the set of element displacements */ + if(H5S_mpio_create_point_datatype(elmt_size, num_points, disp, new_type) < 0) + HGOTO_ERROR(H5E_DATASPACE, H5E_BADTYPE, FAIL, "couldn't create an MPI Datatype from point selection") + + /* Set values about MPI datatype created */ + *count = 1; + *is_derived_type = TRUE; + +done: + if(NULL != disp) + H5MM_free(disp); + + /* Release the permutation buffer, if it wasn't used */ + if(!(*is_permuted) && (*permute)) { + H5MM_free(*permute); + *permute = NULL; + } /* end if */ + + FUNC_LEAVE_NOAPI(ret_value) +} /* H5S_mpio_point_type() */ + + +/*------------------------------------------------------------------------- + * Function: H5S_mpio_permute_type + * + * Purpose: Translate an HDF5 "all/hyper/point" selection into an MPI type, + * while applying the permutation map. This function is called if + * the file space selection is permuted due to out-of-order point + * selection and so the memory datatype has to be permuted using the + * permutation map created by the file selection. + * + * Note: This routine is called from H5S_mpio_space_type(), which is + * called first for the file dataspace and creates + * + * Return: non-negative on success, negative on failure. + * + * Outputs: *new_type the MPI type corresponding to the selection + * *count how many objects of the new_type in selection + * (useful if this is the buffer type for xfer) + * *is_derived_type 0 if MPI primitive type, 1 if derived + * + * Programmer: Mohamad Chaarawi + * + *------------------------------------------------------------------------- + */ +static herr_t +H5S_mpio_permute_type(const H5S_t *space, size_t elmt_size, hsize_t **permute, + MPI_Datatype *new_type, int *count, hbool_t *is_derived_type) +{ + MPI_Aint *disp = NULL; /* Datatype displacement for each point*/ + H5S_sel_iter_t sel_iter; /* Selection iteration info */ + hbool_t sel_iter_init = FALSE; /* Selection iteration info has been initialized */ + hsize_t off[H5D_IO_VECTOR_SIZE]; /* Array to store sequence offsets */ + size_t len[H5D_IO_VECTOR_SIZE]; /* Array to store sequence lengths */ + hssize_t snum_points; /* Signed number of elements in selection */ + hsize_t num_points; /* Number of points in the selection */ + size_t max_elem; /* Maximum number of elements allowed in sequences */ + hsize_t u; /* Local index variable */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI_NOINIT + + /* Check args */ + HDassert(space); + + /* Get the total number of points selected */ + if((snum_points = (hssize_t)H5S_GET_SELECT_NPOINTS(space)) < 0) + HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCOUNT, FAIL, "can't get number of elements selected") + num_points = (hsize_t)snum_points; + + /* Allocate array to store point displacements */ + if(NULL == (disp = (MPI_Aint *)H5MM_malloc(sizeof(MPI_Aint) * num_points))) + HGOTO_ERROR(H5E_DATASPACE, H5E_CANTALLOC, FAIL, "can't allocate array of displacements") + + /* Initialize selection iterator */ + if(H5S_select_iter_init(&sel_iter, space, elmt_size) < 0) + HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINIT, FAIL, "unable to initialize selection iterator") + sel_iter_init = TRUE; /* Selection iteration info has been initialized */ + + /* Set the number of elements to iterate over */ + H5_ASSIGN_OVERFLOW(max_elem, num_points, hsize_t, size_t); + + /* Loop, while elements left in selection */ + u = 0; + while(max_elem > 0) { + hsize_t off[H5D_IO_VECTOR_SIZE]; /* Array to store sequence offsets */ + size_t len[H5D_IO_VECTOR_SIZE]; /* Array to store sequence lengths */ + size_t nelem; /* Number of elements used in sequences */ + size_t nseq; /* Number of sequences generated */ + size_t curr_seq; /* Current sequence being worked on */ + + /* Get the sequences of bytes */ + if(H5S_SELECT_GET_SEQ_LIST(space, 0, &sel_iter, (size_t)H5D_IO_VECTOR_SIZE, max_elem, &nseq, &nelem, off, len) < 0) + HGOTO_ERROR(H5E_DATASPACE, H5E_UNSUPPORTED, FAIL, "sequence length generation failed") + + /* Loop, while sequences left to process */ + for(curr_seq = 0; curr_seq < nseq; curr_seq++) { + hsize_t curr_off; /* Current offset within sequence */ + size_t curr_len; /* Length of bytes left to process in sequence */ + + /* Get the current offset */ + curr_off = off[curr_seq]; + + /* Get the number of bytes in sequence */ + curr_len = len[curr_seq]; + + /* Loop, while bytes left in sequence */ + while(curr_len > 0) { + /* Set the displacement of the current point */ + disp[u] = curr_off; + + /* This is a memory displacement, so for each point selected, + * apply the map that was generated by the file selection */ + if((*permute)[u] != num_points) { + MPI_Aint temp = disp[u]; + + HDmemmove(disp + (*permute)[u] + 1, disp + (*permute)[u], + (u - (*permute)[u]) * sizeof(MPI_Aint)); + disp[(*permute)[u]] = temp; + } /* end if */ + + /* Advance to next element */ + u++; + + /* Increment offset in dataspace */ + curr_off += elmt_size; + + /* Decrement number of bytes left in sequence */ + curr_len -= elmt_size; + } /* end while */ + } /* end for */ + + /* Decrement number of elements left to process */ + max_elem -= nelem; + } /* end while */ + + /* Create the MPI datatype for the set of element displacements */ + if(H5S_mpio_create_point_datatype(elmt_size, num_points, disp, new_type) < 0) + HGOTO_ERROR(H5E_DATASPACE, H5E_BADTYPE, FAIL, "couldn't create an MPI Datatype from point selection") + + /* Set values about MPI datatype created */ + *count = 1; + *is_derived_type = TRUE; + +done: + /* Release selection iterator */ + if(sel_iter_init) + if(H5S_SELECT_ITER_RELEASE(&sel_iter) < 0) + HDONE_ERROR(H5E_DATASPACE, H5E_CANTRELEASE, FAIL, "unable to release selection iterator") + + /* Free memory */ + if(disp) + H5MM_free(disp); + if(*permute) { + H5MM_free(*permute); + *permute = NULL; + } /* end if */ + + FUNC_LEAVE_NOAPI(ret_value) +} /* H5S_mpio_permute_type() */ + + +/*------------------------------------------------------------------------- * Function: H5S_mpio_hyper_type * * Purpose: Translate an HDF5 hyperslab selection into an MPI type. @@ -478,7 +815,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5S_obtain datatype + * Function: H5S_obtain_datatype * * Purpose: Obtain an MPI derived datatype based on span-tree * implementation @@ -673,8 +1010,9 @@ done: *------------------------------------------------------------------------- */ herr_t -H5S_mpio_space_type(const H5S_t *space, size_t elmt_size, - MPI_Datatype *new_type, int *count, hbool_t *is_derived_type) +H5S_mpio_space_type(const H5S_t *space, size_t elmt_size, MPI_Datatype *new_type, + int *count, hbool_t *is_derived_type, hbool_t do_permute, hsize_t **permute_map, + hbool_t *is_permuted) { herr_t ret_value = SUCCEED; /* Return value */ @@ -684,44 +1022,75 @@ H5S_mpio_space_type(const H5S_t *space, size_t elmt_size, HDassert(space); HDassert(elmt_size); - /* Creat MPI type based on the kind of selection */ + /* Create MPI type based on the kind of selection */ switch(H5S_GET_EXTENT_TYPE(space)) { case H5S_NULL: case H5S_SCALAR: case H5S_SIMPLE: - switch(H5S_GET_SELECT_TYPE(space)) { - case H5S_SEL_NONE: - if(H5S_mpio_none_type(new_type, count, is_derived_type) < 0) - HGOTO_ERROR(H5E_DATASPACE, H5E_BADTYPE, FAIL,"couldn't convert 'none' selection to MPI type") - break; - - case H5S_SEL_ALL: - if(H5S_mpio_all_type(space, elmt_size, new_type, count, is_derived_type) < 0) - HGOTO_ERROR(H5E_DATASPACE, H5E_BADTYPE, FAIL,"couldn't convert 'all' selection to MPI type") - break; - - case H5S_SEL_POINTS: - /* not yet implemented */ - ret_value = FAIL; - break; - - case H5S_SEL_HYPERSLABS: - if((H5S_SELECT_IS_REGULAR(space) == TRUE)) { - if(H5S_mpio_hyper_type(space, elmt_size, new_type, count, is_derived_type) < 0) - HGOTO_ERROR(H5E_DATASPACE, H5E_BADTYPE, FAIL,"couldn't convert regular 'hyperslab' selection to MPI type") - } /* end if */ - else { - if(H5S_mpio_span_hyper_type(space, elmt_size, new_type, count, is_derived_type) < 0) - HGOTO_ERROR(H5E_DATASPACE, H5E_BADTYPE, FAIL,"couldn't convert irregular 'hyperslab' selection to MPI type") - } /* end else */ - break; - - case H5S_SEL_ERROR: - case H5S_SEL_N: - default: - HDassert("unknown selection type" && 0); - break; - } /* end switch */ + /* If the file space has been permuted previously due to + * out-of-order point selection, then permute this selection which + * should be a memory selection to match the file space permutation. + */ + if(TRUE == *is_permuted) { + switch(H5S_GET_SELECT_TYPE(space)) { + case H5S_SEL_NONE: + if(H5S_mpio_none_type(new_type, count, is_derived_type) < 0) + HGOTO_ERROR(H5E_DATASPACE, H5E_BADTYPE, FAIL, "couldn't convert 'none' selection to MPI type") + break; + + case H5S_SEL_ALL: + case H5S_SEL_POINTS: + case H5S_SEL_HYPERSLABS: + /* Sanity check */ + HDassert(!do_permute); + + if(H5S_mpio_permute_type(space, elmt_size, permute_map, new_type, count, is_derived_type) < 0) + HGOTO_ERROR(H5E_DATASPACE, H5E_BADTYPE, FAIL, "couldn't convert 'all' selection to MPI type") + break; + + case H5S_SEL_ERROR: + case H5S_SEL_N: + default: + HDassert("unknown selection type" && 0); + break; + } /* end switch */ + } /* end if */ + /* the file space is not permuted, so do a regular selection */ + else { + switch(H5S_GET_SELECT_TYPE(space)) { + case H5S_SEL_NONE: + if(H5S_mpio_none_type(new_type, count, is_derived_type) < 0) + HGOTO_ERROR(H5E_DATASPACE, H5E_BADTYPE, FAIL,"couldn't convert 'none' selection to MPI type") + break; + + case H5S_SEL_ALL: + if(H5S_mpio_all_type(space, elmt_size, new_type, count, is_derived_type) < 0) + HGOTO_ERROR(H5E_DATASPACE, H5E_BADTYPE, FAIL,"couldn't convert 'all' selection to MPI type") + break; + + case H5S_SEL_POINTS: + if(H5S_mpio_point_type(space, elmt_size, new_type, count, is_derived_type, do_permute, permute_map, is_permuted) < 0) + HGOTO_ERROR(H5E_DATASPACE, H5E_BADTYPE, FAIL, "couldn't convert 'point' selection to MPI type") + break; + + case H5S_SEL_HYPERSLABS: + if((H5S_SELECT_IS_REGULAR(space) == TRUE)) { + if(H5S_mpio_hyper_type(space, elmt_size, new_type, count, is_derived_type) < 0) + HGOTO_ERROR(H5E_DATASPACE, H5E_BADTYPE, FAIL,"couldn't convert regular 'hyperslab' selection to MPI type") + } /* end if */ + else { + if(H5S_mpio_span_hyper_type(space, elmt_size, new_type, count, is_derived_type) < 0) + HGOTO_ERROR(H5E_DATASPACE, H5E_BADTYPE, FAIL,"couldn't convert irregular 'hyperslab' selection to MPI type") + } /* end else */ + break; + + case H5S_SEL_ERROR: + case H5S_SEL_N: + default: + HDassert("unknown selection type" && 0); + break; + } /* end switch */ + } /* end else */ break; case H5S_NO_CLASS: diff --git a/src/H5Sprivate.h b/src/H5Sprivate.h index 0e67af1..be8a28f 100644 --- a/src/H5Sprivate.h +++ b/src/H5Sprivate.h @@ -272,12 +272,13 @@ H5_DLL herr_t H5S_select_iter_release(H5S_sel_iter_t *sel_iter); /* (Defined in H5S.c) */ H5_DLLVAR hbool_t H5S_mpi_opt_types_g; -H5_DLL herr_t -H5S_mpio_space_type( const H5S_t *space, size_t elmt_size, - /* out: */ - MPI_Datatype *new_type, - int *count, - hbool_t *is_derived_type ); +H5_DLL herr_t H5S_mpio_space_type(const H5S_t *space, size_t elmt_size, + /* out: */ MPI_Datatype *new_type, + int *count, + hbool_t *is_derived_type, + hbool_t do_permute, + hsize_t **permute_map, + hbool_t * is_permuted); #endif /* H5_HAVE_PARALLEL */ #endif /* _H5Sprivate_H */ diff --git a/src/H5Sselect.c b/src/H5Sselect.c index 44688b6..2cb4b38 100644 --- a/src/H5Sselect.c +++ b/src/H5Sselect.c @@ -34,8 +34,8 @@ /* Local functions */ #ifdef LATER -static herr_t H5S_select_iter_block (const H5S_sel_iter_t *iter, hsize_t *start, hsize_t *end); -static htri_t H5S_select_iter_has_next_block (const H5S_sel_iter_t *iter); +static herr_t H5S_select_iter_block(const H5S_sel_iter_t *iter, hsize_t *start, hsize_t *end); +static htri_t H5S_select_iter_has_next_block(const H5S_sel_iter_t *iter); static herr_t H5S_select_iter_next_block(H5S_sel_iter_t *iter); #endif /* LATER */ @@ -922,7 +922,7 @@ H5S_select_iter_init(H5S_sel_iter_t *sel_iter, const H5S_t *space, size_t elmt_s REVISION LOG --------------------------------------------------------------------------*/ herr_t -H5S_select_iter_coords (const H5S_sel_iter_t *sel_iter, hsize_t *coords) +H5S_select_iter_coords(const H5S_sel_iter_t *sel_iter, hsize_t *coords) { herr_t ret_value; /* return value */ @@ -964,7 +964,7 @@ H5S_select_iter_coords (const H5S_sel_iter_t *sel_iter, hsize_t *coords) REVISION LOG --------------------------------------------------------------------------*/ static herr_t -H5S_select_iter_block (const H5S_sel_iter_t *iter, hsize_t *start, hsize_t *end) +H5S_select_iter_block(const H5S_sel_iter_t *iter, hsize_t *start, hsize_t *end) { herr_t ret_value; /* return value */ @@ -1004,7 +1004,7 @@ H5S_select_iter_block (const H5S_sel_iter_t *iter, hsize_t *start, hsize_t *end) REVISION LOG --------------------------------------------------------------------------*/ hsize_t -H5S_select_iter_nelmts (const H5S_sel_iter_t *sel_iter) +H5S_select_iter_nelmts(const H5S_sel_iter_t *sel_iter) { hsize_t ret_value; /* return value */ @@ -1043,7 +1043,7 @@ H5S_select_iter_nelmts (const H5S_sel_iter_t *sel_iter) REVISION LOG --------------------------------------------------------------------------*/ static htri_t -H5S_select_iter_has_next_block (const H5S_sel_iter_t *iter) +H5S_select_iter_has_next_block(const H5S_sel_iter_t *iter) { herr_t ret_value; /* return value */ @@ -1217,24 +1217,13 @@ H5S_select_iterate(void *buf, hid_t type_id, const H5S_t *space, H5D_operator_t H5T_t *dt; /* Datatype structure */ H5S_sel_iter_t iter; /* Selection iteration info */ hbool_t iter_init = FALSE; /* Selection iteration info has been initialized */ - uint8_t *loc; /* Current element location in buffer */ - hsize_t coords[H5O_LAYOUT_NDIMS]; /* Coordinates of element in dataspace */ hssize_t nelmts; /* Number of elements in selection */ hsize_t space_size[H5O_LAYOUT_NDIMS]; /* Dataspace size */ - hsize_t off[H5D_IO_VECTOR_SIZE]; /* Array to store sequence offsets */ - hsize_t curr_off; /* Current offset within sequence */ - hsize_t tmp_off; /* Temporary offset within sequence */ - size_t len[H5D_IO_VECTOR_SIZE]; /* Array to store sequence lengths */ - size_t curr_len; /* Length of bytes left to process in sequence */ - size_t nseq; /* Number of sequences generated */ - size_t curr_seq; /* Current sequnce being worked on */ - size_t nelem; /* Number of elements used in sequences */ size_t max_elem; /* Maximum number of elements allowed in sequences */ size_t elmt_size; /* Datatype size */ unsigned ndims; /* Number of dimensions in dataspace */ - int i; /* Local Index variable */ - herr_t user_ret=0; /* User's return value */ - herr_t ret_value=SUCCEED; /* Return value */ + herr_t user_ret = 0; /* User's return value */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -1274,12 +1263,21 @@ H5S_select_iterate(void *buf, hid_t type_id, const H5S_t *space, H5D_operator_t /* Loop, while elements left in selection */ while(max_elem > 0 && user_ret == 0) { + hsize_t off[H5D_IO_VECTOR_SIZE]; /* Array to store sequence offsets */ + size_t len[H5D_IO_VECTOR_SIZE]; /* Array to store sequence lengths */ + size_t nelem; /* Number of elements used in sequences */ + size_t nseq; /* Number of sequences generated */ + size_t curr_seq; /* Current sequence being worked on */ + /* Get the sequences of bytes */ if(H5S_SELECT_GET_SEQ_LIST(space, 0, &iter, (size_t)H5D_IO_VECTOR_SIZE, max_elem, &nseq, &nelem, off, len) < 0) HGOTO_ERROR(H5E_INTERNAL, H5E_UNSUPPORTED, FAIL, "sequence length generation failed") /* Loop, while sequences left to process */ - for(curr_seq=0; curr_seq 0 && user_ret == 0) { + hsize_t coords[H5O_LAYOUT_NDIMS]; /* Coordinates of element in dataspace */ + hsize_t tmp_off; /* Temporary offset within sequence */ + uint8_t *loc; /* Current element location in buffer */ + int i; /* Local Index variable */ + /* Compute the coordinate from the offset */ for(i = (int)ndims, tmp_off = curr_off; i >= 0; i--) { coords[i] = tmp_off % space_size[i]; @@ -1298,22 +1301,22 @@ H5S_select_iterate(void *buf, hid_t type_id, const H5S_t *space, H5D_operator_t loc = (unsigned char *)buf + curr_off; /* Call user's callback routine */ - user_ret=(*op)(loc,type_id,ndims,coords,operator_data); + user_ret = (*op)(loc, type_id, ndims, coords, operator_data); /* Increment offset in dataspace */ - curr_off+=elmt_size; + curr_off += elmt_size; /* Decrement number of bytes left in sequence */ - curr_len-=elmt_size; + curr_len -= elmt_size; } /* end while */ } /* end for */ /* Decrement number of elements left to process */ - max_elem-=nelem; + max_elem -= nelem; } /* end while */ /* Set return value */ - ret_value=user_ret; + ret_value = user_ret; done: /* Release selection iterator */ diff --git a/src/H5private.h b/src/H5private.h index 0e6ff1e..26ccf57 100644 --- a/src/H5private.h +++ b/src/H5private.h @@ -439,8 +439,8 @@ /* * Maximum & minimum values for our typedefs. */ -#define HSIZET_MAX ((hsize_t)ULLONG_MAX) -#define HSSIZET_MAX ((hssize_t)LLONG_MAX) +#define HSIZET_MAX ((hsize_t)ULLONG_MAX) +#define HSSIZET_MAX ((hssize_t)LLONG_MAX) #define HSSIZET_MIN (~(HSSIZET_MAX)) /* diff --git a/testpar/t_coll_chunk.c b/testpar/t_coll_chunk.c index 5dac36f..61b25f8 100644 --- a/testpar/t_coll_chunk.c +++ b/testpar/t_coll_chunk.c @@ -16,6 +16,9 @@ #include "testphdf5.h" #include "H5Dprivate.h" +#define HYPER 1 +#define POINT 2 +#define ALL 3 /* some commonly used routines for collective chunk IO tests*/ @@ -23,14 +26,17 @@ static void ccslab_set(int mpi_rank,int mpi_size,hsize_t start[],hsize_t count[] hsize_t stride[],hsize_t block[],int mode); static void ccdataset_fill(hsize_t start[],hsize_t count[], - hsize_t stride[],hsize_t block[],DATATYPE*dataset); + hsize_t stride[],hsize_t block[],DATATYPE*dataset, + int mem_selection); static void ccdataset_print(hsize_t start[],hsize_t block[],DATATYPE*dataset); static int ccdataset_vrfy(hsize_t start[], hsize_t count[], hsize_t stride[], - hsize_t block[], DATATYPE *dataset, DATATYPE *original); + hsize_t block[], DATATYPE *dataset, DATATYPE *original, + int mem_selection); -static void coll_chunktest(const char* filename,int chunk_factor,int select_factor,int api_option); +static void coll_chunktest(const char* filename, int chunk_factor, int select_factor, + int api_option, int file_selection, int mem_selection, int mode); /*------------------------------------------------------------------------- @@ -73,7 +79,15 @@ coll_chunk1(void) { const char *filename = GetTestParameters(); - coll_chunktest(filename, 1, BYROW_CONT, API_NONE); + coll_chunktest(filename, 1, BYROW_CONT, API_NONE, HYPER, HYPER, OUT_OF_ORDER); + coll_chunktest(filename, 1, BYROW_CONT, API_NONE, HYPER, POINT, OUT_OF_ORDER); + coll_chunktest(filename, 1, BYROW_CONT, API_NONE, POINT, ALL, OUT_OF_ORDER); + coll_chunktest(filename, 1, BYROW_CONT, API_NONE, POINT, POINT, OUT_OF_ORDER); + coll_chunktest(filename, 1, BYROW_CONT, API_NONE, POINT, HYPER, OUT_OF_ORDER); + + coll_chunktest(filename, 1, BYROW_CONT, API_NONE, POINT, ALL, IN_ORDER); + coll_chunktest(filename, 1, BYROW_CONT, API_NONE, POINT, POINT, IN_ORDER); + coll_chunktest(filename, 1, BYROW_CONT, API_NONE, POINT, HYPER, IN_ORDER); } @@ -117,7 +131,15 @@ coll_chunk2(void) { const char *filename = GetTestParameters(); - coll_chunktest(filename, 1, BYROW_DISCONT, API_NONE); + coll_chunktest(filename, 1, BYROW_DISCONT, API_NONE, HYPER, HYPER, OUT_OF_ORDER); + coll_chunktest(filename, 1, BYROW_DISCONT, API_NONE, HYPER, POINT, OUT_OF_ORDER); + coll_chunktest(filename, 1, BYROW_DISCONT, API_NONE, POINT, ALL, OUT_OF_ORDER); + coll_chunktest(filename, 1, BYROW_DISCONT, API_NONE, POINT, POINT, OUT_OF_ORDER); + coll_chunktest(filename, 1, BYROW_DISCONT, API_NONE, POINT, HYPER, OUT_OF_ORDER); + + coll_chunktest(filename, 1, BYROW_DISCONT, API_NONE, POINT, ALL, IN_ORDER); + coll_chunktest(filename, 1, BYROW_DISCONT, API_NONE, POINT, POINT, IN_ORDER); + coll_chunktest(filename, 1, BYROW_DISCONT, API_NONE, POINT, HYPER, IN_ORDER); } @@ -164,7 +186,15 @@ coll_chunk3(void) int mpi_size; MPI_Comm_size(MPI_COMM_WORLD, &mpi_size); - coll_chunktest(filename, mpi_size, BYROW_CONT, API_NONE); + coll_chunktest(filename, mpi_size, BYROW_CONT, API_NONE, HYPER, HYPER, OUT_OF_ORDER); + coll_chunktest(filename, mpi_size, BYROW_CONT, API_NONE, HYPER, POINT, OUT_OF_ORDER); + coll_chunktest(filename, mpi_size, BYROW_CONT, API_NONE, POINT, ALL, OUT_OF_ORDER); + coll_chunktest(filename, mpi_size, BYROW_CONT, API_NONE, POINT, POINT, OUT_OF_ORDER); + coll_chunktest(filename, mpi_size, BYROW_CONT, API_NONE, POINT, HYPER, OUT_OF_ORDER); + + coll_chunktest(filename, mpi_size, BYROW_CONT, API_NONE, POINT, ALL, IN_ORDER); + coll_chunktest(filename, mpi_size, BYROW_CONT, API_NONE, POINT, POINT, IN_ORDER); + coll_chunktest(filename, mpi_size, BYROW_CONT, API_NONE, POINT, HYPER, IN_ORDER); } /*------------------------------------------------------------------------- @@ -208,7 +238,15 @@ coll_chunk4(void) { const char *filename = GetTestParameters(); - coll_chunktest(filename, 1, BYROW_SELECTNONE, API_NONE); + coll_chunktest(filename, 1, BYROW_SELECTNONE, API_NONE, HYPER, HYPER, OUT_OF_ORDER); + coll_chunktest(filename, 1, BYROW_SELECTNONE, API_NONE, HYPER, POINT, OUT_OF_ORDER); + coll_chunktest(filename, 1, BYROW_SELECTNONE, API_NONE, POINT, ALL, OUT_OF_ORDER); + coll_chunktest(filename, 1, BYROW_SELECTNONE, API_NONE, POINT, POINT, OUT_OF_ORDER); + coll_chunktest(filename, 1, BYROW_SELECTNONE, API_NONE, POINT, HYPER, OUT_OF_ORDER); + + coll_chunktest(filename, 1, BYROW_SELECTNONE, API_NONE, POINT, ALL, IN_ORDER); + coll_chunktest(filename, 1, BYROW_SELECTNONE, API_NONE, POINT, POINT, IN_ORDER); + coll_chunktest(filename, 1, BYROW_SELECTNONE, API_NONE, POINT, HYPER, IN_ORDER); } /*------------------------------------------------------------------------- @@ -252,7 +290,15 @@ coll_chunk5(void) { const char *filename = GetTestParameters(); - coll_chunktest(filename, 4, BYROW_SELECTUNBALANCE, API_LINK_HARD); + coll_chunktest(filename, 4, BYROW_SELECTUNBALANCE, API_LINK_HARD, HYPER, HYPER, OUT_OF_ORDER); + coll_chunktest(filename, 4, BYROW_SELECTUNBALANCE, API_LINK_HARD, HYPER, POINT, OUT_OF_ORDER); + coll_chunktest(filename, 4, BYROW_SELECTUNBALANCE, API_LINK_HARD, POINT, ALL, OUT_OF_ORDER); + coll_chunktest(filename, 4, BYROW_SELECTUNBALANCE, API_LINK_HARD, POINT, POINT, OUT_OF_ORDER); + coll_chunktest(filename, 4, BYROW_SELECTUNBALANCE, API_LINK_HARD, POINT, HYPER, OUT_OF_ORDER); + + coll_chunktest(filename, 4, BYROW_SELECTUNBALANCE, API_LINK_HARD, POINT, ALL, IN_ORDER); + coll_chunktest(filename, 4, BYROW_SELECTUNBALANCE, API_LINK_HARD, POINT, POINT, IN_ORDER); + coll_chunktest(filename, 4, BYROW_SELECTUNBALANCE, API_LINK_HARD, POINT, HYPER, IN_ORDER); } /*------------------------------------------------------------------------- @@ -298,7 +344,15 @@ coll_chunk6(void) { const char *filename = GetTestParameters(); - coll_chunktest(filename, 4, BYROW_SELECTUNBALANCE, API_MULTI_HARD); + coll_chunktest(filename, 4, BYROW_SELECTUNBALANCE, API_MULTI_HARD, HYPER, HYPER, OUT_OF_ORDER); + coll_chunktest(filename, 4, BYROW_SELECTUNBALANCE, API_MULTI_HARD, HYPER, POINT, OUT_OF_ORDER); + coll_chunktest(filename, 4, BYROW_SELECTUNBALANCE, API_MULTI_HARD, POINT, ALL, OUT_OF_ORDER); + coll_chunktest(filename, 4, BYROW_SELECTUNBALANCE, API_MULTI_HARD, POINT, POINT, OUT_OF_ORDER); + coll_chunktest(filename, 4, BYROW_SELECTUNBALANCE, API_MULTI_HARD, POINT, HYPER, OUT_OF_ORDER); + + coll_chunktest(filename, 4, BYROW_SELECTUNBALANCE, API_MULTI_HARD, POINT, ALL, IN_ORDER); + coll_chunktest(filename, 4, BYROW_SELECTUNBALANCE, API_MULTI_HARD, POINT, POINT, IN_ORDER); + coll_chunktest(filename, 4, BYROW_SELECTUNBALANCE, API_MULTI_HARD, POINT, HYPER, IN_ORDER); } /*------------------------------------------------------------------------- @@ -342,7 +396,15 @@ coll_chunk7(void) { const char *filename = GetTestParameters(); - coll_chunktest(filename, 4, BYROW_SELECTUNBALANCE, API_LINK_TRUE); + coll_chunktest(filename, 4, BYROW_SELECTUNBALANCE, API_LINK_TRUE, HYPER, HYPER, OUT_OF_ORDER); + coll_chunktest(filename, 4, BYROW_SELECTUNBALANCE, API_LINK_TRUE, HYPER, POINT, OUT_OF_ORDER); + coll_chunktest(filename, 4, BYROW_SELECTUNBALANCE, API_LINK_TRUE, POINT, ALL, OUT_OF_ORDER); + coll_chunktest(filename, 4, BYROW_SELECTUNBALANCE, API_LINK_TRUE, POINT, POINT, OUT_OF_ORDER); + coll_chunktest(filename, 4, BYROW_SELECTUNBALANCE, API_LINK_TRUE, POINT, HYPER, OUT_OF_ORDER); + + coll_chunktest(filename, 4, BYROW_SELECTUNBALANCE, API_LINK_TRUE, POINT, ALL, IN_ORDER); + coll_chunktest(filename, 4, BYROW_SELECTUNBALANCE, API_LINK_TRUE, POINT, POINT, IN_ORDER); + coll_chunktest(filename, 4, BYROW_SELECTUNBALANCE, API_LINK_TRUE, POINT, HYPER, IN_ORDER); } /*------------------------------------------------------------------------- @@ -386,7 +448,15 @@ coll_chunk8(void) { const char *filename = GetTestParameters(); - coll_chunktest(filename, 4, BYROW_SELECTUNBALANCE, API_LINK_FALSE); + coll_chunktest(filename, 4, BYROW_SELECTUNBALANCE, API_LINK_FALSE, HYPER, HYPER, OUT_OF_ORDER); + coll_chunktest(filename, 4, BYROW_SELECTUNBALANCE, API_LINK_FALSE, HYPER, POINT, OUT_OF_ORDER); + coll_chunktest(filename, 4, BYROW_SELECTUNBALANCE, API_LINK_FALSE, POINT, ALL, OUT_OF_ORDER); + coll_chunktest(filename, 4, BYROW_SELECTUNBALANCE, API_LINK_FALSE, POINT, POINT, OUT_OF_ORDER); + coll_chunktest(filename, 4, BYROW_SELECTUNBALANCE, API_LINK_FALSE, POINT, HYPER, OUT_OF_ORDER); + + coll_chunktest(filename, 4, BYROW_SELECTUNBALANCE, API_LINK_FALSE, POINT, ALL, IN_ORDER); + coll_chunktest(filename, 4, BYROW_SELECTUNBALANCE, API_LINK_FALSE, POINT, POINT, IN_ORDER); + coll_chunktest(filename, 4, BYROW_SELECTUNBALANCE, API_LINK_FALSE, POINT, HYPER, IN_ORDER); } /*------------------------------------------------------------------------- @@ -430,7 +500,15 @@ coll_chunk9(void) { const char *filename = GetTestParameters(); - coll_chunktest(filename, 4, BYROW_SELECTUNBALANCE, API_MULTI_COLL); + coll_chunktest(filename, 4, BYROW_SELECTUNBALANCE, API_MULTI_COLL, HYPER, HYPER, OUT_OF_ORDER); + coll_chunktest(filename, 4, BYROW_SELECTUNBALANCE, API_MULTI_COLL, HYPER, POINT, OUT_OF_ORDER); + coll_chunktest(filename, 4, BYROW_SELECTUNBALANCE, API_MULTI_COLL, POINT, ALL, OUT_OF_ORDER); + coll_chunktest(filename, 4, BYROW_SELECTUNBALANCE, API_MULTI_COLL, POINT, POINT, OUT_OF_ORDER); + coll_chunktest(filename, 4, BYROW_SELECTUNBALANCE, API_MULTI_COLL, POINT, HYPER, OUT_OF_ORDER); + + coll_chunktest(filename, 4, BYROW_SELECTUNBALANCE, API_MULTI_COLL, POINT, ALL, IN_ORDER); + coll_chunktest(filename, 4, BYROW_SELECTUNBALANCE, API_MULTI_COLL, POINT, POINT, IN_ORDER); + coll_chunktest(filename, 4, BYROW_SELECTUNBALANCE, API_MULTI_COLL, POINT, HYPER, IN_ORDER); } /*------------------------------------------------------------------------- @@ -474,7 +552,15 @@ coll_chunk10(void) { const char *filename = GetTestParameters(); - coll_chunktest(filename, 4, BYROW_SELECTINCHUNK, API_MULTI_IND); + coll_chunktest(filename, 4, BYROW_SELECTINCHUNK, API_MULTI_IND, HYPER, HYPER, OUT_OF_ORDER); + coll_chunktest(filename, 4, BYROW_SELECTINCHUNK, API_MULTI_IND, HYPER, POINT, OUT_OF_ORDER); + coll_chunktest(filename, 4, BYROW_SELECTINCHUNK, API_MULTI_IND, POINT, ALL, OUT_OF_ORDER); + coll_chunktest(filename, 4, BYROW_SELECTINCHUNK, API_MULTI_IND, POINT, POINT, OUT_OF_ORDER); + coll_chunktest(filename, 4, BYROW_SELECTINCHUNK, API_MULTI_IND, POINT, HYPER, OUT_OF_ORDER); + + coll_chunktest(filename, 4, BYROW_SELECTINCHUNK, API_MULTI_IND, POINT, ALL, IN_ORDER); + coll_chunktest(filename, 4, BYROW_SELECTINCHUNK, API_MULTI_IND, POINT, POINT, IN_ORDER); + coll_chunktest(filename, 4, BYROW_SELECTINCHUNK, API_MULTI_IND, POINT, HYPER, IN_ORDER); } @@ -505,14 +591,16 @@ coll_chunk10(void) *------------------------------------------------------------------------- */ - static void coll_chunktest(const char* filename, int chunk_factor, int select_factor, - int api_option) + int api_option, + int file_selection, + int mem_selection, + int mode) { - hid_t file,dataset, file_dataspace; + hid_t file, dataset, file_dataspace, mem_dataspace; hid_t acc_plist,xfer_plist,crp_plist; hsize_t dims[RANK], chunk_dims[RANK]; @@ -532,6 +620,11 @@ coll_chunktest(const char* filename, MPI_Comm comm = MPI_COMM_WORLD; MPI_Info info = MPI_INFO_NULL; + size_t num_points; /* for point selection */ + hsize_t *coords =NULL; /* for point selection */ + hsize_t current_dims; /* for point selection */ + int i; + /* set up MPI parameters */ MPI_Comm_size(comm,&mpi_size); MPI_Comm_rank(comm,&mpi_rank); @@ -551,7 +644,6 @@ coll_chunktest(const char* filename, dims[0] = SPACE_DIM1*mpi_size; dims[1] = SPACE_DIM2; - /* allocate memory for data buffer */ data_array1 = (int *)HDmalloc(dims[0] * dims[1] * sizeof(int)); VRFY((data_array1 != NULL), "data_array1 malloc succeeded"); @@ -559,9 +651,25 @@ coll_chunktest(const char* filename, /* set up dimensions of the slab this process accesses */ ccslab_set(mpi_rank, mpi_size, start, count, stride, block, select_factor); + /* set up the coords array selection */ + num_points = block[0] * block[1] * count[0] * count[1]; + coords = (hsize_t *)HDmalloc(num_points * RANK * sizeof(hsize_t)); + VRFY((coords != NULL), "coords malloc succeeded"); + point_set(start, count, stride, block, num_points, coords, mode); + file_dataspace = H5Screate_simple(2, dims, NULL); VRFY((file_dataspace >= 0), "file dataspace created succeeded"); + if(ALL != mem_selection) { + mem_dataspace = H5Screate_simple(2, dims, NULL); + VRFY((mem_dataspace >= 0), "mem dataspace created succeeded"); + } + else { + current_dims = num_points; + mem_dataspace = H5Screate_simple (1, ¤t_dims, NULL); + VRFY((mem_dataspace >= 0), "mem_dataspace create succeeded"); + } + crp_plist = H5Pcreate(H5P_DATASET_CREATE); VRFY((crp_plist >= 0),""); @@ -569,25 +677,67 @@ coll_chunktest(const char* filename, chunk_dims[0] = dims[0]/chunk_factor; /* to decrease the testing time, maintain bigger chunk size */ - (chunk_factor == 1) ? (chunk_dims[1] = SPACE_DIM2) : (chunk_dims[1] = SPACE_DIM2/2); status = H5Pset_chunk(crp_plist, 2, chunk_dims); VRFY((status >= 0),"chunk creation property list succeeded"); dataset = H5Dcreate2(file, DSET_COLLECTIVE_CHUNK_NAME, H5T_NATIVE_INT, - file_dataspace, H5P_DEFAULT, crp_plist, H5P_DEFAULT); + file_dataspace, H5P_DEFAULT, crp_plist, H5P_DEFAULT); VRFY((dataset >= 0),"dataset created succeeded"); status = H5Pclose(crp_plist); VRFY((status >= 0), ""); /*put some trivial data in the data array */ - ccdataset_fill(start, stride, count,block, data_array1); + ccdataset_fill(start, stride, count,block, data_array1, mem_selection); + MESG("data_array initialized"); - status = H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, - count, block); - VRFY((status >= 0),"hyperslab selection succeeded"); + switch (file_selection) { + case HYPER: + status = H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block); + VRFY((status >= 0),"hyperslab selection succeeded"); + break; + + case POINT: + if (num_points) { + status = H5Sselect_elements(file_dataspace, H5S_SELECT_SET, num_points, coords); + VRFY((status >= 0),"Element selection succeeded"); + } + else { + status = H5Sselect_none(file_dataspace); + VRFY((status >= 0),"none selection succeeded"); + } + break; + + case ALL: + status = H5Sselect_all(file_dataspace); + VRFY((status >= 0), "H5Sselect_all succeeded"); + break; + } + + switch (mem_selection) { + case HYPER: + status = H5Sselect_hyperslab(mem_dataspace, H5S_SELECT_SET, start, stride, count, block); + VRFY((status >= 0),"hyperslab selection succeeded"); + break; + + case POINT: + if (num_points) { + status = H5Sselect_elements(mem_dataspace, H5S_SELECT_SET, num_points, coords); + VRFY((status >= 0),"Element selection succeeded"); + } + else { + status = H5Sselect_none(mem_dataspace); + VRFY((status >= 0),"none selection succeeded"); + } + break; + + case ALL: + status = H5Sselect_all(mem_dataspace); + VRFY((status >= 0), "H5Sselect_all succeeded"); + break; + } /* set up the collective transfer property list */ xfer_plist = H5Pcreate(H5P_DATASET_XFER); @@ -604,33 +754,39 @@ coll_chunktest(const char* filename, case API_LINK_HARD: status = H5Pset_dxpl_mpio_chunk_opt(xfer_plist,H5FD_MPIO_CHUNK_ONE_IO); VRFY((status>= 0),"collective chunk optimization succeeded"); - break; + break; + case API_MULTI_HARD: status = H5Pset_dxpl_mpio_chunk_opt(xfer_plist,H5FD_MPIO_CHUNK_MULTI_IO); VRFY((status>= 0),"collective chunk optimization succeeded "); - break; + break; + case API_LINK_TRUE: status = H5Pset_dxpl_mpio_chunk_opt_num(xfer_plist,2); VRFY((status>= 0),"collective chunk optimization set chunk number succeeded"); - break; + break; + case API_LINK_FALSE: status = H5Pset_dxpl_mpio_chunk_opt_num(xfer_plist,6); VRFY((status>= 0),"collective chunk optimization set chunk number succeeded"); - break; + break; + case API_MULTI_COLL: status = H5Pset_dxpl_mpio_chunk_opt_num(xfer_plist,8);/* make sure it is using multi-chunk IO */ VRFY((status>= 0),"collective chunk optimization set chunk number succeeded"); status = H5Pset_dxpl_mpio_chunk_opt_ratio(xfer_plist,50); VRFY((status>= 0),"collective chunk optimization set chunk ratio succeeded"); - break; + break; + case API_MULTI_IND: status = H5Pset_dxpl_mpio_chunk_opt_num(xfer_plist,8);/* make sure it is using multi-chunk IO */ VRFY((status>= 0),"collective chunk optimization set chunk number succeeded"); status = H5Pset_dxpl_mpio_chunk_opt_ratio(xfer_plist,100); VRFY((status>= 0),"collective chunk optimization set chunk ratio succeeded"); - break; + break; + default: - ; + ; } #ifdef H5_HAVE_INSTRUMENTED_LIBRARY @@ -641,44 +797,42 @@ coll_chunktest(const char* filename, status = H5Pinsert2(xfer_plist, H5D_XFER_COLL_CHUNK_LINK_HARD_NAME, H5D_XFER_COLL_CHUNK_SIZE, &prop_value, NULL, NULL, NULL, NULL, NULL, NULL); VRFY((status >= 0),"testing property list inserted succeeded"); - - break; + break; case API_MULTI_HARD: prop_value = H5D_XFER_COLL_CHUNK_DEF; status = H5Pinsert2(xfer_plist, H5D_XFER_COLL_CHUNK_MULTI_HARD_NAME, H5D_XFER_COLL_CHUNK_SIZE, &prop_value, NULL, NULL, NULL, NULL, NULL, NULL); VRFY((status >= 0),"testing property list inserted succeeded"); - break; + break; case API_LINK_TRUE: prop_value = H5D_XFER_COLL_CHUNK_DEF; status = H5Pinsert2(xfer_plist, H5D_XFER_COLL_CHUNK_LINK_NUM_TRUE_NAME, H5D_XFER_COLL_CHUNK_SIZE, &prop_value, NULL, NULL, NULL, NULL, NULL, NULL); VRFY((status >= 0),"testing property list inserted succeeded"); - - break; + break; case API_LINK_FALSE: prop_value = H5D_XFER_COLL_CHUNK_DEF; status = H5Pinsert2(xfer_plist, H5D_XFER_COLL_CHUNK_LINK_NUM_FALSE_NAME, H5D_XFER_COLL_CHUNK_SIZE, &prop_value, NULL, NULL, NULL, NULL, NULL, NULL); VRFY((status >= 0),"testing property list inserted succeeded"); - break; + break; case API_MULTI_COLL: prop_value = H5D_XFER_COLL_CHUNK_DEF; status = H5Pinsert2(xfer_plist, H5D_XFER_COLL_CHUNK_MULTI_RATIO_COLL_NAME, H5D_XFER_COLL_CHUNK_SIZE, &prop_value, NULL, NULL, NULL, NULL, NULL, NULL); VRFY((status >= 0),"testing property list inserted succeeded"); - break; + break; case API_MULTI_IND: prop_value = H5D_XFER_COLL_CHUNK_DEF; status = H5Pinsert2(xfer_plist, H5D_XFER_COLL_CHUNK_MULTI_RATIO_IND_NAME, H5D_XFER_COLL_CHUNK_SIZE, &prop_value, NULL, NULL, NULL, NULL, NULL, NULL); VRFY((status >= 0),"testing property list inserted succeeded"); - break; + break; default: ; @@ -687,7 +841,7 @@ coll_chunktest(const char* filename, #endif /* write data collectively */ - status = H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, file_dataspace, + status = H5Dwrite(dataset, H5T_NATIVE_INT, mem_dataspace, file_dataspace, xfer_plist, data_array1); VRFY((status >= 0),"dataset write succeeded"); @@ -698,32 +852,38 @@ coll_chunktest(const char* filename, status = H5Pget(xfer_plist,H5D_XFER_COLL_CHUNK_LINK_HARD_NAME,&prop_value); VRFY((status >= 0),"testing property list get succeeded"); VRFY((prop_value == 0),"API to set LINK COLLECTIVE IO directly succeeded"); - break; + break; + case API_MULTI_HARD: status = H5Pget(xfer_plist,H5D_XFER_COLL_CHUNK_MULTI_HARD_NAME,&prop_value); VRFY((status >= 0),"testing property list get succeeded"); VRFY((prop_value == 0),"API to set MULTI-CHUNK COLLECTIVE IO optimization succeeded"); - break; + break; + case API_LINK_TRUE: status = H5Pget(xfer_plist,H5D_XFER_COLL_CHUNK_LINK_NUM_TRUE_NAME,&prop_value); VRFY((status >= 0),"testing property list get succeeded"); VRFY((prop_value == 0),"API to set LINK COLLECTIVE IO succeeded"); - break; + break; + case API_LINK_FALSE: status = H5Pget(xfer_plist,H5D_XFER_COLL_CHUNK_LINK_NUM_FALSE_NAME,&prop_value); VRFY((status >= 0),"testing property list get succeeded"); VRFY((prop_value == 0),"API to set LINK IO transferring to multi-chunk IO succeeded"); - break; + break; + case API_MULTI_COLL: status = H5Pget(xfer_plist,H5D_XFER_COLL_CHUNK_MULTI_RATIO_COLL_NAME,&prop_value); VRFY((status >= 0),"testing property list get succeeded"); VRFY((prop_value == 0),"API to set MULTI-CHUNK COLLECTIVE IO with optimization succeeded"); - break; + break; + case API_MULTI_IND: status = H5Pget(xfer_plist,H5D_XFER_COLL_CHUNK_MULTI_RATIO_IND_NAME,&prop_value); VRFY((status >= 0),"testing property list get succeeded"); VRFY((prop_value == 0),"API to set MULTI-CHUNK IO transferring to independent IO succeeded"); - break; + break; + default: ; } @@ -739,12 +899,15 @@ coll_chunktest(const char* filename, status = H5Sclose(file_dataspace); VRFY((status >= 0),""); + status = H5Sclose(mem_dataspace); + VRFY((status >= 0),""); + + status = H5Fclose(file); VRFY((status >= 0),""); if (data_array1) HDfree(data_array1); - /* Use collective read to verify the correctness of collective write. */ /* allocate memory for data buffer */ @@ -771,15 +934,68 @@ coll_chunktest(const char* filename, /* set up dimensions of the slab this process accesses */ ccslab_set(mpi_rank, mpi_size, start, count, stride, block, select_factor); - /* obtain the file dataspace*/ + /* obtain the file and mem dataspace*/ file_dataspace = H5Dget_space (dataset); VRFY((file_dataspace >= 0), ""); - status=H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block); - VRFY((status >= 0), ""); + if (ALL != mem_selection) { + mem_dataspace = H5Dget_space (dataset); + VRFY((mem_dataspace >= 0), ""); + } + else { + current_dims = num_points; + mem_dataspace = H5Screate_simple (1, ¤t_dims, NULL); + VRFY((mem_dataspace >= 0), "mem_dataspace create succeeded"); + } + + switch (file_selection) { + case HYPER: + status = H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block); + VRFY((status >= 0),"hyperslab selection succeeded"); + break; + + case POINT: + if (num_points) { + status = H5Sselect_elements(file_dataspace, H5S_SELECT_SET, num_points, coords); + VRFY((status >= 0),"Element selection succeeded"); + } + else { + status = H5Sselect_none(file_dataspace); + VRFY((status >= 0),"none selection succeeded"); + } + break; + + case ALL: + status = H5Sselect_all(file_dataspace); + VRFY((status >= 0), "H5Sselect_all succeeded"); + break; + } + + switch (mem_selection) { + case HYPER: + status = H5Sselect_hyperslab(mem_dataspace, H5S_SELECT_SET, start, stride, count, block); + VRFY((status >= 0),"hyperslab selection succeeded"); + break; + + case POINT: + if (num_points) { + status = H5Sselect_elements(mem_dataspace, H5S_SELECT_SET, num_points, coords); + VRFY((status >= 0),"Element selection succeeded"); + } + else { + status = H5Sselect_none(mem_dataspace); + VRFY((status >= 0),"none selection succeeded"); + } + break; + + case ALL: + status = H5Sselect_all(mem_dataspace); + VRFY((status >= 0), "H5Sselect_all succeeded"); + break; + } /* fill dataset with test data */ - ccdataset_fill(start, stride,count,block, data_origin1); + ccdataset_fill(start, stride,count,block, data_origin1, mem_selection); xfer_plist = H5Pcreate (H5P_DATASET_XFER); VRFY((xfer_plist >= 0),""); @@ -790,13 +1006,12 @@ coll_chunktest(const char* filename, VRFY((status>= 0),"set independent IO collectively succeeded"); } - - status = H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, file_dataspace, + status = H5Dread(dataset, H5T_NATIVE_INT, mem_dataspace, file_dataspace, xfer_plist, data_array1); VRFY((status >=0),"dataset read succeeded"); /* verify the read data with original expected data */ - status = ccdataset_vrfy(start, count, stride, block, data_array1, data_origin1); + status = ccdataset_vrfy(start, count, stride, block, data_array1, data_origin1, mem_selection); if (status) nerrors++; status = H5Pclose(xfer_plist); @@ -804,15 +1019,21 @@ coll_chunktest(const char* filename, /* close dataset collectively */ status=H5Dclose(dataset); - VRFY((status >= 0), ""); + VRFY((status >= 0), "H5Dclose"); /* release all IDs created */ - H5Sclose(file_dataspace); + status = H5Sclose(file_dataspace); + VRFY((status >= 0),"H5Sclose"); + + status = H5Sclose(mem_dataspace); + VRFY((status >= 0),"H5Sclose"); /* close the file collectively */ - H5Fclose(file); + status = H5Fclose(file); + VRFY((status >= 0),"H5Fclose"); /* release data buffers */ + if (coords) free(coords); if (data_array1) HDfree(data_array1); if (data_origin1) HDfree(data_origin1); @@ -933,12 +1154,12 @@ ccdataset_fill(hsize_t start[], hsize_t stride[], hsize_t count[], hsize_t block[], - DATATYPE * dataset) + DATATYPE * dataset, + int mem_selection) { DATATYPE *dataptr = dataset; DATATYPE *tmptr; - hsize_t i,j,k1,k2; - + hsize_t i,j,k1,k2,k=0; /* put some trivial data in the data_array */ tmptr = dataptr; @@ -950,10 +1171,16 @@ ccdataset_fill(hsize_t start[], for(k2 = 0; k2 < count[1]; k2++) { for(j = 0;j < block[1]; j++) { - dataptr = tmptr + ((start[0]+k1*stride[0]+i)*SPACE_DIM2+ - start[1]+k2*stride[1]+j); + if (ALL != mem_selection) { + dataptr = tmptr + ((start[0]+k1*stride[0]+i)*SPACE_DIM2+ + start[1]+k2*stride[1]+j); + } + else { + dataptr = tmptr + k; + k++; + } - *dataptr = (DATATYPE)(k1+k2+i+j); + *dataptr = (DATATYPE)(k1+k2+i+j); } } } @@ -1000,9 +1227,10 @@ ccdataset_vrfy(hsize_t start[], hsize_t stride[], hsize_t block[], DATATYPE *dataset, - DATATYPE *original) + DATATYPE *original, + int mem_selection) { - hsize_t i, j,k1,k2; + hsize_t i, j,k1,k2,k=0; int vrfyerrs; DATATYPE *dataptr,*oriptr; @@ -1020,26 +1248,31 @@ ccdataset_vrfy(hsize_t start[], vrfyerrs = 0; - for (k1 = 0; k1 < count[0];k1++) { - for(i = 0;i < block[0];i++) { - for(k2 = 0; k2 MAX_ERR_REPORT && !VERBOSE_MED) printf("[more errors ...]\n"); diff --git a/testpar/t_dset.c b/testpar/t_dset.c index 246d2d9..3929ff3 100644 --- a/testpar/t_dset.c +++ b/testpar/t_dset.c @@ -118,6 +118,54 @@ if(VERBOSE_MED){ } } +/* + * Setup the coordinates for point selection. + */ +void point_set(hsize_t start[], + hsize_t count[], + hsize_t stride[], + hsize_t block[], + size_t num_points, + hsize_t coords[], + int order) +{ + hsize_t i,j, k = 0, m ,n, s1 ,s2; + + HDcompile_assert(RANK == 2); + + if(OUT_OF_ORDER == order) + k = (num_points * RANK) - 1; + else if(IN_ORDER == order) + k = 0; + + s1 = start[0]; + s2 = start[1]; + + for(i = 0 ; i < count[0]; i++) + for(j = 0 ; j < count[1]; j++) + for(m = 0 ; m < block[0]; m++) + for(n = 0 ; n < block[1]; n++) + if(OUT_OF_ORDER == order) { + coords[k--] = s2 + (stride[1] * j) + n; + coords[k--] = s1 + (stride[0] * i) + m; + } + else if(IN_ORDER == order) { + coords[k++] = s1 + stride[0] * i + m; + coords[k++] = s2 + stride[1] * j + n; + } + + if(VERBOSE_MED) { + printf("start[]=(%lu, %lu), count[]=(%lu, %lu), stride[]=(%lu, %lu), block[]=(%lu, %lu), total datapoints=%lu\n", + (unsigned long)start[0], (unsigned long)start[1], (unsigned long)count[0], (unsigned long)count[1], + (unsigned long)stride[0], (unsigned long)stride[1], (unsigned long)block[0], (unsigned long)block[1], + (unsigned long)(block[0] * block[1] * count[0] * count[1])); + k = 0; + for(i = 0; i < num_points ; i++) { + printf("(%d, %d)\n", (int)coords[k], (int)coords[k + 1]); + k += 2; + } + } +} /* * Fill the dataset with trivial data for testing. @@ -501,7 +549,8 @@ dataset_writeAll(void) hid_t sid; /* Dataspace ID */ hid_t file_dataspace; /* File dataspace ID */ hid_t mem_dataspace; /* memory dataspace ID */ - hid_t dataset1, dataset2, dataset3, dataset4; /* Dataset ID */ + hid_t dataset1, dataset2, dataset3, dataset4; /* Dataset ID */ + hid_t dataset5, dataset6, dataset7; /* Dataset ID */ hid_t datatype; /* Datatype ID */ hbool_t use_gpfs = FALSE; /* Use GPFS hints */ hsize_t dims[RANK]; /* dataset dim sizes */ @@ -512,6 +561,11 @@ dataset_writeAll(void) hsize_t count[RANK], stride[RANK]; /* for hyperslab setting */ hsize_t block[RANK]; /* for hyperslab setting */ + size_t num_points = dim1; /* for point selection */ + hsize_t coords [RANK*dim1]; /* for point selection */ + hsize_t current_dims; /* for point selection */ + int i; + herr_t ret; /* Generic return value */ int mpi_size, mpi_rank; @@ -573,6 +627,13 @@ dataset_writeAll(void) dataset3 = H5Dcreate2(fid, DATASETNAME3, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); VRFY((dataset3 >= 0), "H5Dcreate2 succeeded"); + dataset5 = H5Dcreate2(fid, DATASETNAME7, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + VRFY((dataset5 >= 0), "H5Dcreate2 succeeded"); + dataset6 = H5Dcreate2(fid, DATASETNAME8, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + VRFY((dataset6 >= 0), "H5Dcreate2 succeeded"); + dataset7 = H5Dcreate2(fid, DATASETNAME9, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + VRFY((dataset7 >= 0), "H5Dcreate2 succeeded"); + /* release 2-D space ID created */ H5Sclose(sid); @@ -827,8 +888,6 @@ dataset_writeAll(void) VRFY((ret>= 0),"set independent IO collectively succeeded"); } - - /* write data collectively */ MESG("writeAll with scalar dataspace"); ret = H5Dwrite(dataset4, H5T_NATIVE_INT, mem_dataspace, file_dataspace, @@ -846,6 +905,137 @@ dataset_writeAll(void) H5Sclose(mem_dataspace); H5Pclose(xfer_plist); + + if(data_array1) free(data_array1); + data_array1 = (DATATYPE *)malloc(dim0*dim1*sizeof(DATATYPE)); + VRFY((data_array1 != NULL), "data_array1 malloc succeeded"); + + block[0] = 1; + block[1] = dim1; + stride[0] = 1; + stride[1] = dim1; + count[0] = 1; + count[1] = 1; + start[0] = dim0/mpi_size * mpi_rank; + start[1] = 0; + + dataset_fill(start, block, data_array1); + MESG("data_array initialized"); + if(VERBOSE_MED){ + MESG("data_array created"); + dataset_print(start, block, data_array1); + } + + /* Dataset5: point selection in File - Hyperslab selection in Memory*/ + /* create a file dataspace independently */ + point_set (start, count, stride, block, num_points, coords, OUT_OF_ORDER); + file_dataspace = H5Dget_space (dataset5); + VRFY((file_dataspace >= 0), "H5Dget_space succeeded"); + ret = H5Sselect_elements(file_dataspace, H5S_SELECT_SET, num_points, coords); + VRFY((ret >= 0), "H5Sselect_elements succeeded"); + + start[0] = 0; + start[1] = 0; + mem_dataspace = H5Dget_space (dataset5); + VRFY((mem_dataspace >= 0), "H5Dget_space succeeded"); + ret = H5Sselect_hyperslab(mem_dataspace, H5S_SELECT_SET, start, stride, count, block); + VRFY((ret >= 0), "H5Sset_hyperslab succeeded"); + + /* set up the collective transfer properties list */ + xfer_plist = H5Pcreate (H5P_DATASET_XFER); + VRFY((xfer_plist >= 0), ""); + ret = H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_COLLECTIVE); + VRFY((ret >= 0), "H5Pcreate xfer succeeded"); + if(dxfer_coll_type == DXFER_INDEPENDENT_IO) { + ret = H5Pset_dxpl_mpio_collective_opt(xfer_plist,H5FD_MPIO_INDIVIDUAL_IO); + VRFY((ret>= 0),"set independent IO collectively succeeded"); + } + + /* write data collectively */ + ret = H5Dwrite(dataset5, H5T_NATIVE_INT, mem_dataspace, file_dataspace, + xfer_plist, data_array1); + VRFY((ret >= 0), "H5Dwrite dataset5 succeeded"); + + /* release all temporary handles. */ + H5Sclose(file_dataspace); + H5Sclose(mem_dataspace); + H5Pclose(xfer_plist); + + /* Dataset6: point selection in File - Point selection in Memory*/ + /* create a file dataspace independently */ + start[0] = dim0/mpi_size * mpi_rank; + start[1] = 0; + point_set (start, count, stride, block, num_points, coords, OUT_OF_ORDER); + file_dataspace = H5Dget_space (dataset6); + VRFY((file_dataspace >= 0), "H5Dget_space succeeded"); + ret = H5Sselect_elements(file_dataspace, H5S_SELECT_SET, num_points, coords); + VRFY((ret >= 0), "H5Sselect_elements succeeded"); + + start[0] = 0; + start[1] = 0; + point_set (start, count, stride, block, num_points, coords, IN_ORDER); + mem_dataspace = H5Dget_space (dataset6); + VRFY((mem_dataspace >= 0), "H5Dget_space succeeded"); + ret = H5Sselect_elements(mem_dataspace, H5S_SELECT_SET, num_points, coords); + VRFY((ret >= 0), "H5Sselect_elements succeeded"); + + /* set up the collective transfer properties list */ + xfer_plist = H5Pcreate (H5P_DATASET_XFER); + VRFY((xfer_plist >= 0), ""); + ret = H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_COLLECTIVE); + VRFY((ret >= 0), "H5Pcreate xfer succeeded"); + if(dxfer_coll_type == DXFER_INDEPENDENT_IO) { + ret = H5Pset_dxpl_mpio_collective_opt(xfer_plist,H5FD_MPIO_INDIVIDUAL_IO); + VRFY((ret>= 0),"set independent IO collectively succeeded"); + } + + /* write data collectively */ + ret = H5Dwrite(dataset6, H5T_NATIVE_INT, mem_dataspace, file_dataspace, + xfer_plist, data_array1); + VRFY((ret >= 0), "H5Dwrite dataset6 succeeded"); + + /* release all temporary handles. */ + H5Sclose(file_dataspace); + H5Sclose(mem_dataspace); + H5Pclose(xfer_plist); + + /* Dataset7: point selection in File - All selection in Memory*/ + /* create a file dataspace independently */ + start[0] = dim0/mpi_size * mpi_rank; + start[1] = 0; + point_set (start, count, stride, block, num_points, coords, IN_ORDER); + file_dataspace = H5Dget_space (dataset7); + VRFY((file_dataspace >= 0), "H5Dget_space succeeded"); + ret = H5Sselect_elements(file_dataspace, H5S_SELECT_SET, num_points, coords); + VRFY((ret >= 0), "H5Sselect_elements succeeded"); + + current_dims = num_points; + mem_dataspace = H5Screate_simple (1, ¤t_dims, NULL); + VRFY((mem_dataspace >= 0), "mem_dataspace create succeeded"); + + ret = H5Sselect_all(mem_dataspace); + VRFY((ret >= 0), "H5Sselect_all succeeded"); + + /* set up the collective transfer properties list */ + xfer_plist = H5Pcreate (H5P_DATASET_XFER); + VRFY((xfer_plist >= 0), ""); + ret = H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_COLLECTIVE); + VRFY((ret >= 0), "H5Pcreate xfer succeeded"); + if(dxfer_coll_type == DXFER_INDEPENDENT_IO) { + ret = H5Pset_dxpl_mpio_collective_opt(xfer_plist,H5FD_MPIO_INDIVIDUAL_IO); + VRFY((ret>= 0),"set independent IO collectively succeeded"); + } + + /* write data collectively */ + ret = H5Dwrite(dataset7, H5T_NATIVE_INT, mem_dataspace, file_dataspace, + xfer_plist, data_array1); + VRFY((ret >= 0), "H5Dwrite dataset7 succeeded"); + + /* release all temporary handles. */ + H5Sclose(file_dataspace); + H5Sclose(mem_dataspace); + H5Pclose(xfer_plist); + /* * All writes completed. Close datasets collectively */ @@ -856,7 +1046,13 @@ dataset_writeAll(void) ret = H5Dclose(dataset3); VRFY((ret >= 0), "H5Dclose3 succeeded"); ret = H5Dclose(dataset4); - VRFY((ret >= 0), "H5Dclose3 succeeded"); + VRFY((ret >= 0), "H5Dclose4 succeeded"); + ret = H5Dclose(dataset5); + VRFY((ret >= 0), "H5Dclose5 succeeded"); + ret = H5Dclose(dataset6); + VRFY((ret >= 0), "H5Dclose6 succeeded"); + ret = H5Dclose(dataset7); + VRFY((ret >= 0), "H5Dclose7 succeeded"); /* close the file collectively */ H5Fclose(fid); @@ -882,7 +1078,7 @@ dataset_readAll(void) hid_t xfer_plist; /* Dataset transfer properties list */ hid_t file_dataspace; /* File dataspace ID */ hid_t mem_dataspace; /* memory dataspace ID */ - hid_t dataset1, dataset2; /* Dataset ID */ + hid_t dataset1, dataset2, dataset5, dataset6, dataset7; /* Dataset ID */ hbool_t use_gpfs = FALSE; /* Use GPFS hints */ DATATYPE *data_array1 = NULL; /* data buffer */ DATATYPE *data_origin1 = NULL; /* expected data buffer */ @@ -892,6 +1088,11 @@ dataset_readAll(void) hsize_t count[RANK], stride[RANK]; /* for hyperslab setting */ hsize_t block[RANK]; /* for hyperslab setting */ + size_t num_points = dim1; /* for point selection */ + hsize_t coords [RANK*dim0*dim1]; /* for point selection */ + hsize_t current_dims; /* for point selection */ + int i,j,k; + herr_t ret; /* Generic return value */ int mpi_size, mpi_rank; @@ -939,6 +1140,14 @@ dataset_readAll(void) dataset2 = H5Dopen2(fid, DATASETNAME2, H5P_DEFAULT); VRFY((dataset2 >= 0), "H5Dopen2 2 succeeded"); + /* open another dataset collectively */ + dataset5 = H5Dopen2(fid, DATASETNAME7, H5P_DEFAULT); + VRFY((dataset5 >= 0), "H5Dopen2 5 succeeded"); + dataset6 = H5Dopen2(fid, DATASETNAME8, H5P_DEFAULT); + VRFY((dataset6 >= 0), "H5Dopen2 6 succeeded"); + dataset7 = H5Dopen2(fid, DATASETNAME9, H5P_DEFAULT); + VRFY((dataset7 >= 0), "H5Dopen2 7 succeeded"); + /* * Set up dimensions of the slab this process accesses. */ @@ -1077,6 +1286,162 @@ dataset_readAll(void) H5Sclose(mem_dataspace); H5Pclose(xfer_plist); + if(data_array1) free(data_array1); + if(data_origin1) free(data_origin1); + data_array1 = (DATATYPE *)malloc(dim0*dim1*sizeof(DATATYPE)); + VRFY((data_array1 != NULL), "data_array1 malloc succeeded"); + data_origin1 = (DATATYPE *)malloc(dim0*dim1*sizeof(DATATYPE)); + VRFY((data_origin1 != NULL), "data_origin1 malloc succeeded"); + + block[0] = 1; + block[1] = dim1; + stride[0] = 1; + stride[1] = dim1; + count[0] = 1; + count[1] = 1; + start[0] = dim0/mpi_size * mpi_rank; + start[1] = 0; + + dataset_fill(start, block, data_origin1); + MESG("data_array initialized"); + if(VERBOSE_MED){ + MESG("data_array created"); + dataset_print(start, block, data_origin1); + } + + /* Dataset5: point selection in memory - Hyperslab selection in file*/ + /* create a file dataspace independently */ + file_dataspace = H5Dget_space (dataset5); + VRFY((file_dataspace >= 0), "H5Dget_space succeeded"); + ret = H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block); + VRFY((ret >= 0), "H5Sset_hyperslab succeeded"); + + start[0] = 0; + start[1] = 0; + point_set (start, count, stride, block, num_points, coords, OUT_OF_ORDER); + mem_dataspace = H5Dget_space (dataset5); + VRFY((mem_dataspace >= 0), "H5Dget_space succeeded"); + ret = H5Sselect_elements(mem_dataspace, H5S_SELECT_SET, num_points, coords); + VRFY((ret >= 0), "H5Sselect_elements succeeded"); + + /* set up the collective transfer properties list */ + xfer_plist = H5Pcreate (H5P_DATASET_XFER); + VRFY((xfer_plist >= 0), ""); + ret = H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_COLLECTIVE); + VRFY((ret >= 0), "H5Pcreate xfer succeeded"); + if(dxfer_coll_type == DXFER_INDEPENDENT_IO) { + ret = H5Pset_dxpl_mpio_collective_opt(xfer_plist,H5FD_MPIO_INDIVIDUAL_IO); + VRFY((ret>= 0),"set independent IO collectively succeeded"); + } + + /* read data collectively */ + ret = H5Dread(dataset5, H5T_NATIVE_INT, mem_dataspace, file_dataspace, + xfer_plist, data_array1); + VRFY((ret >= 0), "H5Dread dataset5 succeeded"); + + + ret = dataset_vrfy(start, count, stride, block, data_array1, data_origin1); + if(ret) nerrors++; + + /* release all temporary handles. */ + H5Sclose(file_dataspace); + H5Sclose(mem_dataspace); + H5Pclose(xfer_plist); + + + if(data_array1) free(data_array1); + data_array1 = (DATATYPE *)malloc(dim0*dim1*sizeof(DATATYPE)); + VRFY((data_array1 != NULL), "data_array1 malloc succeeded"); + + /* Dataset6: point selection in File - Point selection in Memory*/ + /* create a file dataspace independently */ + start[0] = dim0/mpi_size * mpi_rank; + start[1] = 0; + point_set (start, count, stride, block, num_points, coords, IN_ORDER); + file_dataspace = H5Dget_space (dataset6); + VRFY((file_dataspace >= 0), "H5Dget_space succeeded"); + ret = H5Sselect_elements(file_dataspace, H5S_SELECT_SET, num_points, coords); + VRFY((ret >= 0), "H5Sselect_elements succeeded"); + + start[0] = 0; + start[1] = 0; + point_set (start, count, stride, block, num_points, coords, OUT_OF_ORDER); + mem_dataspace = H5Dget_space (dataset6); + VRFY((mem_dataspace >= 0), "H5Dget_space succeeded"); + ret = H5Sselect_elements(mem_dataspace, H5S_SELECT_SET, num_points, coords); + VRFY((ret >= 0), "H5Sselect_elements succeeded"); + + /* set up the collective transfer properties list */ + xfer_plist = H5Pcreate (H5P_DATASET_XFER); + VRFY((xfer_plist >= 0), ""); + ret = H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_COLLECTIVE); + VRFY((ret >= 0), "H5Pcreate xfer succeeded"); + if(dxfer_coll_type == DXFER_INDEPENDENT_IO) { + ret = H5Pset_dxpl_mpio_collective_opt(xfer_plist,H5FD_MPIO_INDIVIDUAL_IO); + VRFY((ret>= 0),"set independent IO collectively succeeded"); + } + + /* read data collectively */ + ret = H5Dread(dataset6, H5T_NATIVE_INT, mem_dataspace, file_dataspace, + xfer_plist, data_array1); + VRFY((ret >= 0), "H5Dread dataset6 succeeded"); + + ret = dataset_vrfy(start, count, stride, block, data_array1, data_origin1); + if(ret) nerrors++; + + /* release all temporary handles. */ + H5Sclose(file_dataspace); + H5Sclose(mem_dataspace); + H5Pclose(xfer_plist); + + if(data_array1) free(data_array1); + data_array1 = (DATATYPE *)malloc(dim0*dim1*sizeof(DATATYPE)); + VRFY((data_array1 != NULL), "data_array1 malloc succeeded"); + + /* Dataset7: point selection in memory - All selection in file*/ + /* create a file dataspace independently */ + file_dataspace = H5Dget_space (dataset7); + VRFY((file_dataspace >= 0), "H5Dget_space succeeded"); + ret = H5Sselect_all(file_dataspace); + VRFY((ret >= 0), "H5Sselect_all succeeded"); + + num_points = dim0 * dim1; + k=0; + for (i=0 ; i= 0), "H5Dget_space succeeded"); + ret = H5Sselect_elements(mem_dataspace, H5S_SELECT_SET, num_points, coords); + VRFY((ret >= 0), "H5Sselect_elements succeeded"); + + /* set up the collective transfer properties list */ + xfer_plist = H5Pcreate (H5P_DATASET_XFER); + VRFY((xfer_plist >= 0), ""); + ret = H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_COLLECTIVE); + VRFY((ret >= 0), "H5Pcreate xfer succeeded"); + if(dxfer_coll_type == DXFER_INDEPENDENT_IO) { + ret = H5Pset_dxpl_mpio_collective_opt(xfer_plist,H5FD_MPIO_INDIVIDUAL_IO); + VRFY((ret>= 0),"set independent IO collectively succeeded"); + } + + /* read data collectively */ + ret = H5Dread(dataset7, H5T_NATIVE_INT, mem_dataspace, file_dataspace, + xfer_plist, data_array1); + VRFY((ret >= 0), "H5Dread dataset7 succeeded"); + + start[0] = dim0/mpi_size * mpi_rank; + start[1] = 0; + ret = dataset_vrfy(start, count, stride, block, data_array1+(dim0/mpi_size * dim1 * mpi_rank), data_origin1); + if(ret) nerrors++; + + /* release all temporary handles. */ + H5Sclose(file_dataspace); + H5Sclose(mem_dataspace); + H5Pclose(xfer_plist); /* * All reads completed. Close datasets collectively @@ -1085,6 +1450,12 @@ dataset_readAll(void) VRFY((ret >= 0), "H5Dclose1 succeeded"); ret = H5Dclose(dataset2); VRFY((ret >= 0), "H5Dclose2 succeeded"); + ret = H5Dclose(dataset5); + VRFY((ret >= 0), "H5Dclose5 succeeded"); + ret = H5Dclose(dataset6); + VRFY((ret >= 0), "H5Dclose6 succeeded"); + ret = H5Dclose(dataset7); + VRFY((ret >= 0), "H5Dclose7 succeeded"); /* close the file collectively */ H5Fclose(fid); @@ -3073,9 +3444,6 @@ actual_io_mode_tests(void) { * TEST_NOT_SIMPLE_OR_SCALAR_DATASPACES: * Test for NULL dataspace as the cause of breaking collective I/O. * - * TEST_POINT_SELECTIONS: - * Test for selecting elements of dataspce as the cause of breaking collective I/O. - * * TEST_NOT_CONTIGUOUS_OR_CHUNKED_DATASET_COMPACT: * Test for Compact layout as the cause of breaking collective I/O. * @@ -3247,12 +3615,6 @@ test_no_collective_cause_mode(int selection_mode) no_collective_cause_global_expected |= H5D_MPIO_NOT_SIMPLE_OR_SCALAR_DATASPACES; } - if (selection_mode & TEST_POINT_SELECTIONS ) { - test_name = "Broken Collective I/O - Point Selection"; - no_collective_cause_local_expected |= H5D_MPIO_POINT_SELECTIONS; - no_collective_cause_global_expected |= H5D_MPIO_POINT_SELECTIONS; - } - if (selection_mode & TEST_NOT_CONTIGUOUS_OR_CHUNKED_DATASET_COMPACT || selection_mode & TEST_NOT_CONTIGUOUS_OR_CHUNKED_DATASET_EXTERNAL) { test_name = "Broken Collective I/O - No CONTI or CHUNKED Dataset"; @@ -3311,17 +3673,6 @@ test_no_collective_cause_mode(int selection_mode) VRFY((mem_space >= 0), "mem_space created"); } - if (selection_mode & TEST_POINT_SELECTIONS) { - coord[0][0] = 0; coord[0][1] = 0; - coord[1][0] = 1; coord[1][1] = 1; - ret = H5Sselect_elements (file_space, H5S_SELECT_SET, NELM, (const hsize_t *)coord); - VRFY((ret >= 0), "H5Sselect_elements succeeded"); - - ret = H5Sselect_elements (mem_space, H5S_SELECT_SET, NELM, (const hsize_t *)coord); - VRFY((ret >= 0), "H5Sselect_elements succeeded"); - } - - /* Get the number of elements in the selection */ length = dim0 * dim1; @@ -3437,7 +3788,7 @@ test_no_collective_cause_mode(int selection_mode) * have the correct values. * * NOTE: - * This is a temprary function. + * This is a temporary function. * test_no_collective_cause_mode(TEST_FILTERS) will replace this when * H5Dcreate and H5write support for mpio and filter feature. * @@ -3688,7 +4039,6 @@ no_collective_cause_tests(void) test_no_collective_cause_mode (TEST_DATA_TRANSFORMS); test_no_collective_cause_mode (TEST_SET_MPIPOSIX); test_no_collective_cause_mode (TEST_NOT_SIMPLE_OR_SCALAR_DATASPACES); - test_no_collective_cause_mode (TEST_POINT_SELECTIONS); test_no_collective_cause_mode (TEST_NOT_CONTIGUOUS_OR_CHUNKED_DATASET_COMPACT); test_no_collective_cause_mode (TEST_NOT_CONTIGUOUS_OR_CHUNKED_DATASET_EXTERNAL); #ifdef H5_HAVE_FILTER_FLETCHER32 @@ -3704,7 +4054,7 @@ no_collective_cause_tests(void) */ test_no_collective_cause_mode (TEST_SET_MPIPOSIX | TEST_DATATYPE_CONVERSION); test_no_collective_cause_mode (TEST_DATATYPE_CONVERSION | TEST_DATA_TRANSFORMS); - test_no_collective_cause_mode (TEST_DATATYPE_CONVERSION | TEST_DATA_TRANSFORMS | TEST_POINT_SELECTIONS); + test_no_collective_cause_mode (TEST_SET_MPIPOSIX | TEST_DATATYPE_CONVERSION | TEST_DATA_TRANSFORMS); return; } diff --git a/testpar/testphdf5.h b/testpar/testphdf5.h index 15ff884..0b39160 100644 --- a/testpar/testphdf5.h +++ b/testpar/testphdf5.h @@ -45,6 +45,13 @@ enum H5TEST_COLL_CHUNK_API {API_NONE=0,API_LINK_HARD, #define DATASETNAME4 "Data4" #define DATASETNAME5 "Data5" #define DATASETNAME6 "Data6" +#define DATASETNAME7 "Data7" +#define DATASETNAME8 "Data8" +#define DATASETNAME9 "Data9" + +/* point selection order */ +#define IN_ORDER 1 +#define OUT_OF_ORDER 2 /* Hyperslab layout styles */ #define BYROW 1 /* divide into slabs of rows */ @@ -181,13 +188,12 @@ enum H5TEST_COLL_CHUNK_API {API_NONE=0,API_LINK_HARD, #define TEST_DATA_TRANSFORMS 0x008 #define TEST_SET_MPIPOSIX 0x010 #define TEST_NOT_SIMPLE_OR_SCALAR_DATASPACES 0x020 -#define TEST_POINT_SELECTIONS 0x040 -#define TEST_NOT_CONTIGUOUS_OR_CHUNKED_DATASET_COMPACT 0x080 -#define TEST_NOT_CONTIGUOUS_OR_CHUNKED_DATASET_EXTERNAL 0x100 -#define TEST_FILTERS 0x200 +#define TEST_NOT_CONTIGUOUS_OR_CHUNKED_DATASET_COMPACT 0x040 +#define TEST_NOT_CONTIGUOUS_OR_CHUNKED_DATASET_EXTERNAL 0x080 +#define TEST_FILTERS 0x100 /* TEST_FILTERS will take place of this after supporting mpio + filter for * H5Dcreate and H5Dwrite */ -#define TEST_FILTERS_READ 0x400 +#define TEST_FILTERS_READ 0x200 /* Don't erase these lines, they are put here for debugging purposes */ /* @@ -296,5 +302,6 @@ hid_t create_faccess_plist(MPI_Comm comm, MPI_Info info, int l_facc_type, hbool_ MPI_Offset h5_mpi_get_file_size(const char *filename, MPI_Comm comm, MPI_Info info); int dataset_vrfy(hsize_t start[], hsize_t count[], hsize_t stride[], hsize_t block[], DATATYPE *dataset, DATATYPE *original); - +void point_set (hsize_t start[], hsize_t count[], hsize_t stride[], hsize_t block[], + size_t num_points, hsize_t coords[], int order); #endif /* PHDF5TEST_H */ -- cgit v0.12 From 4a9ea60adc72f66d290da5b890bc3b480ea4f914 Mon Sep 17 00:00:00 2001 From: HDF Tester Date: Sun, 9 Mar 2014 05:17:47 -0500 Subject: [svn-r24770] Snapshot version 1.9 release 174 --- 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 f6b44a1..a40f158 100644 --- a/README.txt +++ b/README.txt @@ -1,4 +1,4 @@ -HDF5 version 1.9.174 currently under development +HDF5 version 1.9.175 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 e9c4206..dfc3167 100644 --- a/c++/src/Makefile.in +++ b/c++/src/Makefile.in @@ -469,7 +469,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 = 164 +LT_VERS_REVISION = 165 LT_VERS_AGE = 0 # Include src directory diff --git a/config/lt_vers.am b/config/lt_vers.am index 63d1215..153a579 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 = 164 +LT_VERS_REVISION = 165 LT_VERS_AGE = 0 ## If the API changes *at all*, increment LT_VERS_INTERFACE and diff --git a/configure b/configure index be0b9ec..6d0c172 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.174. +# Generated by GNU Autoconf 2.69 for HDF5 1.9.175. # # Report bugs to . # @@ -591,8 +591,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='HDF5' PACKAGE_TARNAME='hdf5' -PACKAGE_VERSION='1.9.174' -PACKAGE_STRING='HDF5 1.9.174' +PACKAGE_VERSION='1.9.175' +PACKAGE_STRING='HDF5 1.9.175' PACKAGE_BUGREPORT='help@hdfgroup.org' PACKAGE_URL='' @@ -1492,7 +1492,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.174 to adapt to many kinds of systems. +\`configure' configures HDF5 1.9.175 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1562,7 +1562,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of HDF5 1.9.174:";; + short | recursive ) echo "Configuration of HDF5 1.9.175:";; esac cat <<\_ACEOF @@ -1761,7 +1761,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -HDF5 configure 1.9.174 +HDF5 configure 1.9.175 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2855,7 +2855,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.174, which was +It was created by HDF5 $as_me 1.9.175, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -3687,7 +3687,7 @@ fi # Define the identity of the package. PACKAGE='hdf5' - VERSION='1.9.174' + VERSION='1.9.175' cat >>confdefs.h <<_ACEOF @@ -31676,7 +31676,7 @@ Usage: $0 [OPTIONS] Report bugs to ." lt_cl_version="\ -HDF5 config.lt 1.9.174 +HDF5 config.lt 1.9.175 configured by $0, generated by GNU Autoconf 2.69. Copyright (C) 2011 Free Software Foundation, Inc. @@ -33814,7 +33814,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.174, which was +This file was extended by HDF5 $as_me 1.9.175, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -33880,7 +33880,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.174 +HDF5 config.status 1.9.175 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff --git a/configure.ac b/configure.ac index 8e71895..8121326 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.174], [help@hdfgroup.org]) +AC_INIT([HDF5], [1.9.175], [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 455c44e..9c3ab8c 100644 --- a/fortran/src/Makefile.in +++ b/fortran/src/Makefile.in @@ -520,7 +520,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 = 164 +LT_VERS_REVISION = 165 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 a1c4a8d..235cb81 100644 --- a/hl/c++/src/Makefile.in +++ b/hl/c++/src/Makefile.in @@ -460,7 +460,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 = 164 +LT_VERS_REVISION = 165 LT_VERS_AGE = 0 # Include src directory diff --git a/hl/fortran/src/Makefile.in b/hl/fortran/src/Makefile.in index eed0856..37aac6b 100644 --- a/hl/fortran/src/Makefile.in +++ b/hl/fortran/src/Makefile.in @@ -476,7 +476,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 = 164 +LT_VERS_REVISION = 165 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 fde9676..f9f73c8 100644 --- a/hl/src/Makefile.in +++ b/hl/src/Makefile.in @@ -459,7 +459,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 = 164 +LT_VERS_REVISION = 165 LT_VERS_AGE = 0 # This library is our main target. diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 7bf5703..48ff4e0 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -1,4 +1,4 @@ -HDF5 version 1.9.174 currently under development +HDF5 version 1.9.175 currently under development ================================================================================ diff --git a/src/H5public.h b/src/H5public.h index 748d059..544f7be 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 174 /* For tweaks, bug-fixes, or development */ +#define H5_VERS_RELEASE 175 /* 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.174" /* Full version string */ +#define H5_VERS_INFO "HDF5 library version: 1.9.175" /* 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 72fa81a..5e9edab 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -520,7 +520,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 = 164 +LT_VERS_REVISION = 165 LT_VERS_AGE = 0 # Our main target, the HDF5 library diff --git a/vms/src/h5pubconf.h b/vms/src/h5pubconf.h index 7f6ae4d..798732f 100644 --- a/vms/src/h5pubconf.h +++ b/vms/src/h5pubconf.h @@ -511,7 +511,7 @@ #define H5_PACKAGE_NAME "HDF5" /* Define to the full name and version of this package. */ -#define H5_PACKAGE_STRING "HDF5 1.9.174" +#define H5_PACKAGE_STRING "HDF5 1.9.175" /* Define to the one symbol short name of this package. */ #define H5_PACKAGE_TARNAME "hdf5" @@ -520,7 +520,7 @@ #define H5_PACKAGE_URL "" /* Define to the version of this package. */ -#define H5_PACKAGE_VERSION "1.9.174" +#define H5_PACKAGE_VERSION "1.9.175" /* Width for printf() for type `long long' or `__int64', use `ll' */ #define H5_PRINTF_LL_WIDTH "ll" @@ -683,7 +683,7 @@ /* #undef H5_USING_MEMCHECKER */ /* Version number of package */ -#define H5_VERSION "1.9.174" +#define H5_VERSION "1.9.175" /* Define if vsnprintf() returns the correct value for formatted strings that don't fit into size allowed */ -- cgit v0.12 From 5b7c8c7a7d0b40e36a744f7e1dc68cd189e321b2 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Mon, 10 Mar 2014 13:03:35 -0500 Subject: [svn-r24772] Description: Correct some dynamically sized arrays that fail on Windows. Tested on: Mac OSX/64 10.9.2 (amazon) w/parallel --- testpar/t_coll_chunk.c | 12 ++++++------ testpar/t_dset.c | 24 ++++++++++++++++++------ 2 files changed, 24 insertions(+), 12 deletions(-) diff --git a/testpar/t_coll_chunk.c b/testpar/t_coll_chunk.c index 61b25f8..45fe3da 100644 --- a/testpar/t_coll_chunk.c +++ b/testpar/t_coll_chunk.c @@ -620,9 +620,9 @@ coll_chunktest(const char* filename, MPI_Comm comm = MPI_COMM_WORLD; MPI_Info info = MPI_INFO_NULL; - size_t num_points; /* for point selection */ - hsize_t *coords =NULL; /* for point selection */ - hsize_t current_dims; /* for point selection */ + size_t num_points; /* for point selection */ + hsize_t *coords = NULL; /* for point selection */ + hsize_t current_dims; /* for point selection */ int i; /* set up MPI parameters */ @@ -1033,9 +1033,9 @@ coll_chunktest(const char* filename, VRFY((status >= 0),"H5Fclose"); /* release data buffers */ - if (coords) free(coords); - if (data_array1) HDfree(data_array1); - if (data_origin1) HDfree(data_origin1); + if(coords) HDfree(coords); + if(data_array1) HDfree(data_array1); + if(data_origin1) HDfree(data_origin1); } diff --git a/testpar/t_dset.c b/testpar/t_dset.c index 3929ff3..b3ec4b8 100644 --- a/testpar/t_dset.c +++ b/testpar/t_dset.c @@ -561,9 +561,9 @@ dataset_writeAll(void) hsize_t count[RANK], stride[RANK]; /* for hyperslab setting */ hsize_t block[RANK]; /* for hyperslab setting */ - size_t num_points = dim1; /* for point selection */ - hsize_t coords [RANK*dim1]; /* for point selection */ - hsize_t current_dims; /* for point selection */ + size_t num_points; /* for point selection */ + hsize_t *coords = NULL; /* for point selection */ + hsize_t current_dims; /* for point selection */ int i; herr_t ret; /* Generic return value */ @@ -580,6 +580,11 @@ dataset_writeAll(void) MPI_Comm_size(MPI_COMM_WORLD,&mpi_size); MPI_Comm_rank(MPI_COMM_WORLD,&mpi_rank); + /* set up the coords array selection */ + num_points = dim1; + coords = (hsize_t *)HDmalloc(dim1 * RANK * sizeof(hsize_t)); + VRFY((coords != NULL), "coords malloc succeeded"); + /* allocate memory for data buffer */ data_array1 = (DATATYPE *)HDmalloc(dim0*dim1*sizeof(DATATYPE)); VRFY((data_array1 != NULL), "data_array1 HDmalloc succeeded"); @@ -1058,6 +1063,7 @@ dataset_writeAll(void) H5Fclose(fid); /* release data buffers */ + if(coords) HDfree(coords); if(data_array1) HDfree(data_array1); } @@ -1088,9 +1094,9 @@ dataset_readAll(void) hsize_t count[RANK], stride[RANK]; /* for hyperslab setting */ hsize_t block[RANK]; /* for hyperslab setting */ - size_t num_points = dim1; /* for point selection */ - hsize_t coords [RANK*dim0*dim1]; /* for point selection */ - hsize_t current_dims; /* for point selection */ + size_t num_points; /* for point selection */ + hsize_t *coords = NULL; /* for point selection */ + hsize_t current_dims; /* for point selection */ int i,j,k; herr_t ret; /* Generic return value */ @@ -1107,6 +1113,11 @@ dataset_readAll(void) MPI_Comm_size(MPI_COMM_WORLD,&mpi_size); MPI_Comm_rank(MPI_COMM_WORLD,&mpi_rank); + /* set up the coords array selection */ + num_points = dim1; + coords = (hsize_t *)HDmalloc(dim0 * dim1 * RANK * sizeof(hsize_t)); + VRFY((coords != NULL), "coords malloc succeeded"); + /* allocate memory for data buffer */ data_array1 = (DATATYPE *)HDmalloc(dim0*dim1*sizeof(DATATYPE)); VRFY((data_array1 != NULL), "data_array1 HDmalloc succeeded"); @@ -1461,6 +1472,7 @@ dataset_readAll(void) H5Fclose(fid); /* release data buffers */ + if(coords) HDfree(coords); if(data_array1) HDfree(data_array1); if(data_origin1) HDfree(data_origin1); } -- cgit v0.12 From a3292a77cef4fc760aab8b496cd6b105c5370890 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 11 Mar 2014 16:14:57 -0500 Subject: [svn-r24781] HDFFV-8700 - KitWare recommendations: Change CMake commands to lower case. Remove INCLUDE_DIRECTORIES in src for target level includes. Change ADD_DEFINITIONS package debug defines into CMake option. Remove -DNDEBUG --- CMakeFilters.cmake | 186 +++--- CMakeInstallation.cmake | 388 +++++------ CMakeLists.txt | 990 ++++++++++++++-------------- CTestConfig.cmake | 36 +- UserMacros.cmake | 8 +- bin/cmakehdf5 | 4 +- c++/CMakeLists.txt | 28 +- c++/examples/CMakeLists.txt | 30 +- c++/examples/CMakeTests.cmake | 32 +- c++/src/CMakeLists.txt | 30 +- c++/test/CMakeLists.txt | 14 +- c++/test/CMakeTests.cmake | 20 +- config/cmake/CTestCustom.cmake | 6 +- config/cmake/CheckTypeSize.cmake | 36 +- config/cmake/ConfigureChecks.cmake | 1004 ++++++++++++++--------------- config/cmake/FindHDF5.cmake.in | 18 +- config/cmake/FindSZIP.cmake | 158 ++--- config/cmake/HDF5Macros.cmake | 38 +- config/cmake/HDF5UseFortran.cmake | 58 +- config/cmake/HDFLibMacros.cmake | 230 +++---- config/cmake/HDFMacros.cmake | 140 ++-- config/cmake/UserMacros/Windows_MT.cmake | 34 +- config/cmake/cacheinit.cmake | 72 +-- config/cmake/grepTest.cmake | 66 +- config/cmake/hdf5-config-version.cmake.in | 22 +- config/cmake/hdf5-config.cmake.build.in | 76 +-- config/cmake/hdf5-config.cmake.install.in | 86 +-- config/cmake/mccacheinit.cmake | 76 +-- config/cmake/prunTest.cmake | 144 ++--- config/cmake/runTest.cmake | 210 +++--- config/cmake/userblockTest.cmake | 96 +-- config/cmake/vfdTest.cmake | 56 +- examples/CMakeLists.txt | 30 +- examples/CMakeTests.cmake | 26 +- fortran/CMakeLists.txt | 16 +- fortran/examples/CMakeLists.txt | 68 +- fortran/examples/CMakeTests.cmake | 34 +- fortran/src/CMakeLists.txt | 190 +++--- fortran/test/CMakeLists.txt | 110 ++-- fortran/test/CMakeTests.cmake | 4 +- fortran/testpar/CMakeLists.txt | 16 +- hl/CMakeLists.txt | 32 +- hl/c++/CMakeLists.txt | 8 +- hl/c++/examples/CMakeLists.txt | 12 +- hl/c++/src/CMakeLists.txt | 24 +- hl/c++/test/CMakeLists.txt | 8 +- hl/examples/CMakeLists.txt | 18 +- hl/examples/CMakeTests.cmake | 28 +- hl/fortran/CMakeLists.txt | 8 +- hl/fortran/examples/CMakeLists.txt | 20 +- hl/fortran/examples/CMakeTests.cmake | 4 +- hl/fortran/src/CMakeLists.txt | 68 +- hl/fortran/test/CMakeLists.txt | 34 +- hl/src/CMakeLists.txt | 26 +- hl/test/CMakeLists.txt | 20 +- hl/test/CMakeTests.cmake | 20 +- hl/tools/CMakeLists.txt | 34 +- hl/tools/CMakeTests.cmake | 4 +- perform/CMakeLists.txt | 100 +-- perform/CMakeTests.cmake | 18 +- release_docs/INSTALL_CMake.txt | 90 +-- release_docs/USING_HDF5_CMake.txt | 10 +- src/CMakeLists.txt | 276 ++++---- test/CMakeLists.txt | 164 ++--- test/CMakeTests.cmake | 116 ++-- testpar/CMakeLists.txt | 28 +- testpar/CMakeTests.cmake | 34 +- tools/CMakeLists.txt | 6 +- tools/h5copy/CMakeLists.txt | 26 +- tools/h5copy/CMakeTests.cmake | 134 ++-- tools/h5diff/CMakeLists.txt | 42 +- tools/h5diff/CMakeTests.cmake | 170 ++--- tools/h5dump/CMakeLists.txt | 30 +- tools/h5dump/CMakeTests.cmake | 220 +++---- tools/h5dump/CMakeTestsPBITS.cmake | 60 +- tools/h5dump/CMakeTestsXML.cmake | 66 +- tools/h5import/CMakeLists.txt | 24 +- tools/h5import/CMakeTests.cmake | 90 +-- tools/h5jam/CMakeLists.txt | 44 +- tools/h5jam/CMakeTests.cmake | 112 ++-- tools/h5ls/CMakeLists.txt | 16 +- tools/h5ls/CMakeTests.cmake | 56 +- tools/h5repack/CMakeLists.txt | 48 +- tools/h5repack/CMakeTests.cmake | 632 +++++++++--------- tools/h5stat/CMakeLists.txt | 26 +- tools/h5stat/CMakeTests.cmake | 48 +- tools/lib/CMakeLists.txt | 38 +- tools/misc/CMakeLists.txt | 48 +- tools/misc/CMakeTests.cmake | 64 +- 89 files changed, 4045 insertions(+), 4045 deletions(-) diff --git a/CMakeFilters.cmake b/CMakeFilters.cmake index bc78fa6..1a74460 100644 --- a/CMakeFilters.cmake +++ b/CMakeFilters.cmake @@ -3,12 +3,12 @@ # Options for HDF5 Filters #----------------------------------------------------------------------------- MACRO (HDF5_SETUP_FILTERS FILTER) - OPTION (HDF5_USE_FILTER_${FILTER} "Use the ${FILTER} Filter" ON) - IF (HDF5_USE_FILTER_${FILTER}) - SET (H5_HAVE_FILTER_${FILTER} 1) - SET (FILTERS "${FILTERS} ${FILTER}") - ENDIF (HDF5_USE_FILTER_${FILTER}) - # MESSAGE (STATUS "Filter ${FILTER} is ${HDF5_USE_FILTER_${FILTER}}") + option (HDF5_USE_FILTER_${FILTER} "Use the ${FILTER} Filter" ON) + if (HDF5_USE_FILTER_${FILTER}) + set (H5_HAVE_FILTER_${FILTER} 1) + set (FILTERS "${FILTERS} ${FILTER}") + endif (HDF5_USE_FILTER_${FILTER}) + # message (STATUS "Filter ${FILTER} is ${HDF5_USE_FILTER_${FILTER}}") ENDMACRO (HDF5_SETUP_FILTERS) HDF5_SETUP_FILTERS (SHUFFLE) @@ -16,107 +16,107 @@ HDF5_SETUP_FILTERS (FLETCHER32) HDF5_SETUP_FILTERS (NBIT) HDF5_SETUP_FILTERS (SCALEOFFSET) -INCLUDE (ExternalProject) -OPTION (HDF5_ALLOW_EXTERNAL_SUPPORT "Allow External Library Building (NO SVN TGZ)" "NO") -IF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") - OPTION (ZLIB_USE_EXTERNAL "Use External Library Building for ZLIB" 1) - OPTION (SZIP_USE_EXTERNAL "Use External Library Building for SZIP" 1) - IF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN") - SET (ZLIB_URL ${ZLIB_SVN_URL}) - SET (SZIP_URL ${SZIP_SVN_URL}) - ELSEIF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") - IF (NOT TGZPATH) - SET (TGZPATH ${HDF5_SOURCE_DIR}) - ENDIF (NOT TGZPATH) - SET (ZLIB_URL ${TGZPATH}/${ZLIB_TGZ_NAME}) - SET (SZIP_URL ${TGZPATH}/${SZIP_TGZ_NAME}) - ELSE (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN") - SET (ZLIB_USE_EXTERNAL 0) - SET (SZIP_USE_EXTERNAL 0) - ENDIF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN") -ENDIF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") +include (ExternalProject) +option (HDF5_ALLOW_EXTERNAL_SUPPORT "Allow External Library Building (NO SVN TGZ)" "NO") +if (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") + option (ZLIB_USE_EXTERNAL "Use External Library Building for ZLIB" 1) + option (SZIP_USE_EXTERNAL "Use External Library Building for SZIP" 1) + if (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN") + set (ZLIB_URL ${ZLIB_SVN_URL}) + set (SZIP_URL ${SZIP_SVN_URL}) + elseif (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") + if (NOT TGZPATH) + set (TGZPATH ${HDF5_SOURCE_DIR}) + endif (NOT TGZPATH) + set (ZLIB_URL ${TGZPATH}/${ZLIB_TGZ_NAME}) + set (SZIP_URL ${TGZPATH}/${SZIP_TGZ_NAME}) + else (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN") + set (ZLIB_USE_EXTERNAL 0) + set (SZIP_USE_EXTERNAL 0) + endif (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN") +endif (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") #----------------------------------------------------------------------------- # Option for ZLib support #----------------------------------------------------------------------------- -OPTION (HDF5_ENABLE_Z_LIB_SUPPORT "Enable Zlib Filters" OFF) -IF (HDF5_ENABLE_Z_LIB_SUPPORT) - IF (NOT H5_ZLIB_HEADER) - IF (NOT ZLIB_USE_EXTERNAL) +option (HDF5_ENABLE_Z_LIB_SUPPORT "Enable Zlib Filters" OFF) +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) + 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) - SET (H5_HAVE_ZLIB_H 1) - SET (H5_HAVE_LIBZ 1) - SET (H5_ZLIB_HEADER "zlib.h") - SET (ZLIB_INCLUDE_DIR_GEN ${ZLIB_INCLUDE_DIR}) - SET (ZLIB_INCLUDE_DIRS ${ZLIB_INCLUDE_DIR}) - ELSE (ZLIB_FOUND) - IF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") + endif (NOT ZLIB_FOUND) + endif (NOT ZLIB_USE_EXTERNAL) + if (ZLIB_FOUND) + set (H5_HAVE_FILTER_DEFLATE 1) + set (H5_HAVE_ZLIB_H 1) + set (H5_HAVE_LIBZ 1) + set (H5_ZLIB_HEADER "zlib.h") + set (ZLIB_INCLUDE_DIR_GEN ${ZLIB_INCLUDE_DIR}) + set (ZLIB_INCLUDE_DIRS ${ZLIB_INCLUDE_DIR}) + else (ZLIB_FOUND) + if (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") EXTERNAL_ZLIB_LIBRARY (${HDF5_ALLOW_EXTERNAL_SUPPORT} ${LIB_TYPE}) - SET (H5_HAVE_FILTER_DEFLATE 1) - SET (H5_HAVE_ZLIB_H 1) - SET (H5_HAVE_LIBZ 1) - MESSAGE (STATUS "Filter ZLIB is built") - ELSE (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") - MESSAGE (FATAL_ERROR " ZLib is Required for ZLib support in HDF5") - ENDIF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") - ENDIF (ZLIB_FOUND) - ELSE (NOT H5_ZLIB_HEADER) + set (H5_HAVE_FILTER_DEFLATE 1) + set (H5_HAVE_ZLIB_H 1) + set (H5_HAVE_LIBZ 1) + message (STATUS "Filter ZLIB is built") + else (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") + message (FATAL_ERROR " ZLib is Required for ZLib support in HDF5") + endif (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") + endif (ZLIB_FOUND) + else (NOT H5_ZLIB_HEADER) # This project is being called from within another and ZLib is already configured - SET (H5_HAVE_FILTER_DEFLATE 1) - SET (H5_HAVE_ZLIB_H 1) - SET (H5_HAVE_LIBZ 1) - ENDIF (NOT H5_ZLIB_HEADER) - IF (H5_HAVE_FILTER_DEFLATE) - SET (EXTERNAL_FILTERS "${EXTERNAL_FILTERS} DEFLATE") - ENDIF (H5_HAVE_FILTER_DEFLATE) - SET (LINK_LIBS ${LINK_LIBS} ${ZLIB_LIBRARIES}) + set (H5_HAVE_FILTER_DEFLATE 1) + set (H5_HAVE_ZLIB_H 1) + set (H5_HAVE_LIBZ 1) + endif (NOT H5_ZLIB_HEADER) + if (H5_HAVE_FILTER_DEFLATE) + set (EXTERNAL_FILTERS "${EXTERNAL_FILTERS} DEFLATE") + endif (H5_HAVE_FILTER_DEFLATE) + set (LINK_LIBS ${LINK_LIBS} ${ZLIB_LIBRARIES}) INCLUDE_DIRECTORIES (${ZLIB_INCLUDE_DIRS}) - MESSAGE (STATUS "Filter ZLIB is ON") -ENDIF (HDF5_ENABLE_Z_LIB_SUPPORT) + message (STATUS "Filter ZLIB is ON") +endif (HDF5_ENABLE_Z_LIB_SUPPORT) #----------------------------------------------------------------------------- # Option for SzLib support #----------------------------------------------------------------------------- -OPTION (HDF5_ENABLE_SZIP_SUPPORT "Use SZip Filter" OFF) -IF (HDF5_ENABLE_SZIP_SUPPORT) - OPTION (HDF5_ENABLE_SZIP_ENCODING "Use SZip Encoding" OFF) - IF (NOT SZIP_USE_EXTERNAL) +option (HDF5_ENABLE_SZIP_SUPPORT "Use SZip Filter" OFF) +if (HDF5_ENABLE_SZIP_SUPPORT) + option (HDF5_ENABLE_SZIP_ENCODING "Use SZip Encoding" OFF) + if (NOT SZIP_USE_EXTERNAL) FIND_PACKAGE (SZIP NAMES ${SZIP_PACKAGE_NAME}${HDF_PACKAGE_EXT}) - IF (NOT SZIP_FOUND) + if (NOT SZIP_FOUND) FIND_PACKAGE (SZIP) # Legacy find - ENDIF (NOT SZIP_FOUND) - ENDIF (NOT SZIP_USE_EXTERNAL) - IF (SZIP_FOUND) - SET (H5_HAVE_FILTER_SZIP 1) - SET (H5_HAVE_SZLIB_H 1) - SET (H5_HAVE_LIBSZ 1) - SET (SZIP_INCLUDE_DIR_GEN ${SZIP_INCLUDE_DIR}) - SET (SZIP_INCLUDE_DIRS ${SZIP_INCLUDE_DIR}) - ELSE (SZIP_FOUND) - IF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") + endif (NOT SZIP_FOUND) + endif (NOT SZIP_USE_EXTERNAL) + if (SZIP_FOUND) + set (H5_HAVE_FILTER_SZIP 1) + set (H5_HAVE_SZLIB_H 1) + set (H5_HAVE_LIBSZ 1) + set (SZIP_INCLUDE_DIR_GEN ${SZIP_INCLUDE_DIR}) + set (SZIP_INCLUDE_DIRS ${SZIP_INCLUDE_DIR}) + else (SZIP_FOUND) + if (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") EXTERNAL_SZIP_LIBRARY (${HDF5_ALLOW_EXTERNAL_SUPPORT} ${LIB_TYPE} ${HDF5_ENABLE_SZIP_ENCODING}) - SET (H5_HAVE_FILTER_SZIP 1) - SET (H5_HAVE_SZLIB_H 1) - SET (H5_HAVE_LIBSZ 1) - MESSAGE (STATUS "Filter SZIP is built") - ELSE (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") - MESSAGE (FATAL_ERROR "SZIP is Required for SZIP support in HDF5") - ENDIF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") - ENDIF (SZIP_FOUND) - SET (LINK_LIBS ${LINK_LIBS} ${SZIP_LIBRARIES}) + set (H5_HAVE_FILTER_SZIP 1) + set (H5_HAVE_SZLIB_H 1) + set (H5_HAVE_LIBSZ 1) + message (STATUS "Filter SZIP is built") + else (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") + message (FATAL_ERROR "SZIP is Required for SZIP support in HDF5") + endif (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") + endif (SZIP_FOUND) + set (LINK_LIBS ${LINK_LIBS} ${SZIP_LIBRARIES}) INCLUDE_DIRECTORIES (${SZIP_INCLUDE_DIR}) - MESSAGE (STATUS "Filter SZIP is ON") - IF (H5_HAVE_FILTER_SZIP) - SET (EXTERNAL_FILTERS "${EXTERNAL_FILTERS} DECODE") - ENDIF (H5_HAVE_FILTER_SZIP) - IF (HDF5_ENABLE_SZIP_ENCODING) - SET (H5_HAVE_SZIP_ENCODER 1) - SET (EXTERNAL_FILTERS "${EXTERNAL_FILTERS} ENCODE") - ENDIF (HDF5_ENABLE_SZIP_ENCODING) -ENDIF (HDF5_ENABLE_SZIP_SUPPORT) + message (STATUS "Filter SZIP is ON") + if (H5_HAVE_FILTER_SZIP) + set (EXTERNAL_FILTERS "${EXTERNAL_FILTERS} DECODE") + endif (H5_HAVE_FILTER_SZIP) + if (HDF5_ENABLE_SZIP_ENCODING) + set (H5_HAVE_SZIP_ENCODER 1) + set (EXTERNAL_FILTERS "${EXTERNAL_FILTERS} ENCODE") + endif (HDF5_ENABLE_SZIP_ENCODING) +endif (HDF5_ENABLE_SZIP_SUPPORT) diff --git a/CMakeInstallation.cmake b/CMakeInstallation.cmake index 1d74786..6506e15 100644 --- a/CMakeInstallation.cmake +++ b/CMakeInstallation.cmake @@ -2,46 +2,46 @@ #----------------------------------------------------------------------------- # Add file(s) to CMake Install #----------------------------------------------------------------------------- -IF (NOT HDF5_INSTALL_NO_DEVELOPMENT) - INSTALL ( +if (NOT HDF5_INSTALL_NO_DEVELOPMENT) + install ( FILES ${PROJECT_BINARY_DIR}/H5pubconf.h DESTINATION ${HDF5_INSTALL_INCLUDE_DIR} COMPONENT headers ) -ENDIF (NOT HDF5_INSTALL_NO_DEVELOPMENT) +endif (NOT HDF5_INSTALL_NO_DEVELOPMENT) #----------------------------------------------------------------------------- # Add Target(s) to CMake Install for import into other projects #----------------------------------------------------------------------------- -IF (NOT HDF5_EXTERNALLY_CONFIGURED) - INSTALL ( +if (NOT HDF5_EXTERNALLY_CONFIGURED) + install ( EXPORT ${HDF5_EXPORTED_TARGETS} DESTINATION ${HDF5_INSTALL_CMAKE_DIR}/${HDF5_PACKAGE} FILE ${HDF5_PACKAGE}${HDF_PACKAGE_EXT}-targets.cmake COMPONENT configinstall ) -ENDIF (NOT HDF5_EXTERNALLY_CONFIGURED) +endif (NOT HDF5_EXTERNALLY_CONFIGURED) #----------------------------------------------------------------------------- # Export all exported targets to the build tree for use by parent project #----------------------------------------------------------------------------- -IF (NOT HDF5_EXTERNALLY_CONFIGURED) +if (NOT HDF5_EXTERNALLY_CONFIGURED) EXPORT ( TARGETS ${HDF5_LIBRARIES_TO_EXPORT} ${HDF5_LIB_DEPENDENCIES} FILE ${HDF5_PACKAGE}${HDF_PACKAGE_EXT}-targets.cmake ) -ENDIF (NOT HDF5_EXTERNALLY_CONFIGURED) +endif (NOT HDF5_EXTERNALLY_CONFIGURED) #----------------------------------------------------------------------------- # Configure the hdf5-config.cmake file for the build directory #----------------------------------------------------------------------------- -SET (HDF5_INCLUDES_BUILD_TIME +set (HDF5_INCLUDES_BUILD_TIME ${HDF5_SRC_DIR} ${HDF5_CPP_SRC_DIR} ${HDF5_HL_SRC_DIR} ${HDF5_TOOLS_SRC_DIR} ${HDF5_BINARY_DIR} ) -SET (HDF5_VERSION_STRING @HDF5_PACKAGE_VERSION@) -SET (HDF5_VERSION_MAJOR @HDF5_PACKAGE_VERSION_MAJOR@) -SET (HDF5_VERSION_MINOR @HDF5_PACKAGE_VERSION_MINOR@) +set (HDF5_VERSION_STRING @HDF5_PACKAGE_VERSION@) +set (HDF5_VERSION_MAJOR @HDF5_PACKAGE_VERSION_MAJOR@) +set (HDF5_VERSION_MINOR @HDF5_PACKAGE_VERSION_MINOR@) CONFIGURE_FILE ( ${HDF5_RESOURCES_DIR}/hdf5-config.cmake.build.in @@ -51,61 +51,61 @@ CONFIGURE_FILE ( #----------------------------------------------------------------------------- # Configure the FindHDF5.cmake file for the install directory #----------------------------------------------------------------------------- -IF (NOT HDF5_EXTERNALLY_CONFIGURED) +if (NOT HDF5_EXTERNALLY_CONFIGURED) CONFIGURE_FILE ( ${HDF5_RESOURCES_DIR}/FindHDF5.cmake.in ${HDF5_BINARY_DIR}/CMakeFiles/FindHDF5${HDF_PACKAGE_EXT}.cmake @ONLY ) - INSTALL ( + install ( FILES ${HDF5_BINARY_DIR}/CMakeFiles/FindHDF5${HDF_PACKAGE_EXT}.cmake DESTINATION ${HDF5_INSTALL_CMAKE_DIR}/${HDF5_PACKAGE} COMPONENT configinstall ) -ENDIF (NOT HDF5_EXTERNALLY_CONFIGURED) +endif (NOT HDF5_EXTERNALLY_CONFIGURED) #----------------------------------------------------------------------------- # Configure the hdf5-config.cmake file for the install directory #----------------------------------------------------------------------------- -IF (NOT HDF5_EXTERNALLY_CONFIGURED) +if (NOT HDF5_EXTERNALLY_CONFIGURED) CONFIGURE_FILE ( ${HDF5_RESOURCES_DIR}/hdf5-config.cmake.install.in ${HDF5_BINARY_DIR}/CMakeFiles/${HDF5_PACKAGE}${HDF_PACKAGE_EXT}-config.cmake @ONLY ) - INSTALL ( + install ( FILES ${HDF5_BINARY_DIR}/CMakeFiles/${HDF5_PACKAGE}${HDF_PACKAGE_EXT}-config.cmake DESTINATION ${HDF5_INSTALL_CMAKE_DIR}/${HDF5_PACKAGE} COMPONENT configinstall ) -ENDIF (NOT HDF5_EXTERNALLY_CONFIGURED) +endif (NOT HDF5_EXTERNALLY_CONFIGURED) #----------------------------------------------------------------------------- # Configure the hdf5-config-version .cmake file for the install directory #----------------------------------------------------------------------------- -IF (NOT HDF5_EXTERNALLY_CONFIGURED) +if (NOT HDF5_EXTERNALLY_CONFIGURED) CONFIGURE_FILE ( ${HDF5_RESOURCES_DIR}/hdf5-config-version.cmake.in ${HDF5_BINARY_DIR}/CMakeFiles/${HDF5_PACKAGE}${HDF_PACKAGE_EXT}-config-version.cmake @ONLY ) - INSTALL ( + install ( FILES ${HDF5_BINARY_DIR}/CMakeFiles/${HDF5_PACKAGE}${HDF_PACKAGE_EXT}-config-version.cmake DESTINATION ${HDF5_INSTALL_CMAKE_DIR}/${HDF5_PACKAGE} COMPONENT configinstall ) -ENDIF (NOT HDF5_EXTERNALLY_CONFIGURED) +endif (NOT HDF5_EXTERNALLY_CONFIGURED) #----------------------------------------------------------------------------- # Configure the libhdf5.settings file for the lib info #----------------------------------------------------------------------------- -IF (H5_WORDS_BIGENDIAN) - SET (BYTESEX big-endian) -ELSE (H5_WORDS_BIGENDIAN) - SET (BYTESEX little-endian) -ENDIF (H5_WORDS_BIGENDIAN) +if (H5_WORDS_BIGENDIAN) + set (BYTESEX big-endian) +else (H5_WORDS_BIGENDIAN) + set (BYTESEX little-endian) +endif (H5_WORDS_BIGENDIAN) CONFIGURE_FILE ( ${HDF5_RESOURCES_DIR}/libhdf5.settings.cmake.in ${HDF5_BINARY_DIR}/libhdf5.settings @ONLY ) -INSTALL ( +install ( FILES ${HDF5_BINARY_DIR}/libhdf5.settings DESTINATION ${HDF5_INSTALL_CMAKE_DIR}/${HDF5_PACKAGE} COMPONENT libraries @@ -114,70 +114,70 @@ INSTALL ( #----------------------------------------------------------------------------- # Configure the HDF518_Examples.cmake file and the examples #----------------------------------------------------------------------------- -OPTION (HDF5_PACK_EXAMPLES "Package the HDF5 Library Examples Compressed File" OFF) -IF (HDF5_PACK_EXAMPLES) +option (HDF5_PACK_EXAMPLES "Package the HDF5 Library Examples Compressed File" OFF) +if (HDF5_PACK_EXAMPLES) CONFIGURE_FILE ( ${HDF5_RESOURCES_DIR}/HDF518_Examples.cmake.in ${HDF5_BINARY_DIR}/HDF518_Examples.cmake @ONLY ) - INSTALL ( + install ( FILES ${HDF5_BINARY_DIR}/HDF518_Examples.cmake DESTINATION ${HDF5_INSTALL_DATA_DIR} COMPONENT hdfdocuments ) - IF (EXISTS "${HDF5_EXAMPLES_COMPRESSED_DIR}/${HDF5_EXAMPLES_COMPRESSED}") - INSTALL ( + if (EXISTS "${HDF5_EXAMPLES_COMPRESSED_DIR}/${HDF5_EXAMPLES_COMPRESSED}") + install ( FILES ${HDF5_EXAMPLES_COMPRESSED_DIR}/${HDF5_EXAMPLES_COMPRESSED} ${HDF5_SOURCE_DIR}/release_docs/USING_CMake_Examples.txt DESTINATION ${HDF5_INSTALL_DATA_DIR} COMPONENT hdfdocuments ) - ENDIF (EXISTS "${HDF5_EXAMPLES_COMPRESSED_DIR}/${HDF5_EXAMPLES_COMPRESSED}") -ENDIF (HDF5_PACK_EXAMPLES) + endif (EXISTS "${HDF5_EXAMPLES_COMPRESSED_DIR}/${HDF5_EXAMPLES_COMPRESSED}") +endif (HDF5_PACK_EXAMPLES) #----------------------------------------------------------------------------- # Configure the README.txt file for the binary package #----------------------------------------------------------------------------- -SET (BINARY_SYSTEM_NAME ${CMAKE_SYSTEM_NAME}) -SET (BINARY_PLATFORM "${CMAKE_SYSTEM_NAME}") -IF (WIN32) - SET (BINARY_EXAMPLE_ENDING "zip") - SET (BINARY_INSTALL_ENDING "exe") - IF (CMAKE_CL_64) - SET (BINARY_SYSTEM_NAME "win64") - ELSE (CMAKE_CL_64) - SET (BINARY_SYSTEM_NAME "win32") - ENDIF (CMAKE_CL_64) - IF (${CMAKE_SYSTEM_VERSION} MATCHES "6.1") - SET (BINARY_PLATFORM "${BINARY_PLATFORM} 7") - ELSEIF (${CMAKE_SYSTEM_VERSION} MATCHES "6.2") - SET (BINARY_PLATFORM "${BINARY_PLATFORM} 8") - ENDIF (${CMAKE_SYSTEM_VERSION} MATCHES "6.1") - SET (BINARY_PLATFORM "${BINARY_PLATFORM} ${MSVC_C_ARCHITECTURE_ID}") - IF (${CMAKE_C_COMPILER_VERSION} MATCHES "16.*") - SET (BINARY_PLATFORM "${BINARY_PLATFORM}, using VISUAL STUDIO 2010") - ELSEIF (${CMAKE_C_COMPILER_VERSION} MATCHES "15.*") - SET (BINARY_PLATFORM "${BINARY_PLATFORM}, using VISUAL STUDIO 2008") - ELSEIF (${CMAKE_C_COMPILER_VERSION} MATCHES "17.*") - SET (BINARY_PLATFORM "${BINARY_PLATFORM}, using VISUAL STUDIO 2012") - ELSE (${CMAKE_C_COMPILER_VERSION} MATCHES "16.*") - SET (BINARY_PLATFORM "${BINARY_PLATFORM}, using VISUAL STUDIO ${CMAKE_C_COMPILER_VERSION}") - ENDIF (${CMAKE_C_COMPILER_VERSION} MATCHES "16.*") -ELSEIF (APPLE) - SET (BINARY_EXAMPLE_ENDING "tar.gz") - SET (BINARY_INSTALL_ENDING "dmg") - SET (BINARY_PLATFORM "${BINARY_PLATFORM} ${CMAKE_SYSTEM_VERSION} ${CMAKE_SYSTEM_PROCESSOR}") - SET (BINARY_PLATFORM "${BINARY_PLATFORM}, using ${CMAKE_C_COMPILER_ID} C ${CMAKE_C_COMPILER_VERSION}") -ELSE (WIN32) - SET (BINARY_EXAMPLE_ENDING "tar.gz") - SET (BINARY_INSTALL_ENDING "sh") - SET (BINARY_PLATFORM "${BINARY_PLATFORM} ${CMAKE_SYSTEM_VERSION} ${CMAKE_SYSTEM_PROCESSOR}") - SET (BINARY_PLATFORM "${BINARY_PLATFORM}, using ${CMAKE_C_COMPILER_ID} C ${CMAKE_C_COMPILER_VERSION}") -ENDIF (WIN32) -IF (HDF4_BUILD_FORTRAN) - SET (BINARY_PLATFORM "${BINARY_PLATFORM} / ${CMAKE_Fortran_COMPILER_ID} Fortran") -ENDIF (HDF4_BUILD_FORTRAN) +set (BINARY_SYSTEM_NAME ${CMAKE_SYSTEM_NAME}) +set (BINARY_PLATFORM "${CMAKE_SYSTEM_NAME}") +if (WIN32) + set (BINARY_EXAMPLE_ENDING "zip") + set (BINARY_INSTALL_ENDING "exe") + if (CMAKE_CL_64) + set (BINARY_SYSTEM_NAME "win64") + else (CMAKE_CL_64) + set (BINARY_SYSTEM_NAME "win32") + endif (CMAKE_CL_64) + if (${CMAKE_SYSTEM_VERSION} MATCHES "6.1") + set (BINARY_PLATFORM "${BINARY_PLATFORM} 7") + elseif (${CMAKE_SYSTEM_VERSION} MATCHES "6.2") + set (BINARY_PLATFORM "${BINARY_PLATFORM} 8") + endif (${CMAKE_SYSTEM_VERSION} MATCHES "6.1") + set (BINARY_PLATFORM "${BINARY_PLATFORM} ${MSVC_C_ARCHITECTURE_ID}") + if (${CMAKE_C_COMPILER_VERSION} MATCHES "16.*") + set (BINARY_PLATFORM "${BINARY_PLATFORM}, using VISUAL STUDIO 2010") + elseif (${CMAKE_C_COMPILER_VERSION} MATCHES "15.*") + set (BINARY_PLATFORM "${BINARY_PLATFORM}, using VISUAL STUDIO 2008") + elseif (${CMAKE_C_COMPILER_VERSION} MATCHES "17.*") + set (BINARY_PLATFORM "${BINARY_PLATFORM}, using VISUAL STUDIO 2012") + else (${CMAKE_C_COMPILER_VERSION} MATCHES "16.*") + set (BINARY_PLATFORM "${BINARY_PLATFORM}, using VISUAL STUDIO ${CMAKE_C_COMPILER_VERSION}") + endif (${CMAKE_C_COMPILER_VERSION} MATCHES "16.*") +elseif (APPLE) + set (BINARY_EXAMPLE_ENDING "tar.gz") + set (BINARY_INSTALL_ENDING "dmg") + set (BINARY_PLATFORM "${BINARY_PLATFORM} ${CMAKE_SYSTEM_VERSION} ${CMAKE_SYSTEM_PROCESSOR}") + set (BINARY_PLATFORM "${BINARY_PLATFORM}, using ${CMAKE_C_COMPILER_ID} C ${CMAKE_C_COMPILER_VERSION}") +else (WIN32) + set (BINARY_EXAMPLE_ENDING "tar.gz") + set (BINARY_INSTALL_ENDING "sh") + set (BINARY_PLATFORM "${BINARY_PLATFORM} ${CMAKE_SYSTEM_VERSION} ${CMAKE_SYSTEM_PROCESSOR}") + set (BINARY_PLATFORM "${BINARY_PLATFORM}, using ${CMAKE_C_COMPILER_ID} C ${CMAKE_C_COMPILER_VERSION}") +endif (WIN32) +if (HDF4_BUILD_FORTRAN) + set (BINARY_PLATFORM "${BINARY_PLATFORM} / ${CMAKE_Fortran_COMPILER_ID} Fortran") +endif (HDF4_BUILD_FORTRAN) CONFIGURE_FILE ( ${HDF5_RESOURCES_DIR}/README.txt.cmake.in @@ -187,130 +187,130 @@ CONFIGURE_FILE ( #----------------------------------------------------------------------------- # Add Document File(s) to CMake Install #----------------------------------------------------------------------------- -IF (NOT HDF5_EXTERNALLY_CONFIGURED) - INSTALL ( +if (NOT HDF5_EXTERNALLY_CONFIGURED) + install ( FILES ${HDF5_SOURCE_DIR}/COPYING DESTINATION ${HDF5_INSTALL_DATA_DIR} COMPONENT hdfdocuments ) - IF (EXISTS "${HDF5_SOURCE_DIR}/release_docs" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/release_docs") - SET (release_files + if (EXISTS "${HDF5_SOURCE_DIR}/release_docs" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/release_docs") + set (release_files ${HDF5_SOURCE_DIR}/release_docs/USING_HDF5_CMake.txt ${HDF5_SOURCE_DIR}/release_docs/COPYING ${HDF5_SOURCE_DIR}/release_docs/RELEASE.txt ) - IF (WIN32 AND NOT CYGWIN) - SET (release_files + if (WIN32 AND NOT CYGWIN) + set (release_files ${release_files} ${HDF5_SOURCE_DIR}/release_docs/USING_HDF5_VS.txt ) - ENDIF (WIN32 AND NOT CYGWIN) - IF (HDF5_PACK_INSTALL_DOCS) - SET (release_files + endif (WIN32 AND NOT CYGWIN) + if (HDF5_PACK_INSTALL_DOCS) + set (release_files ${release_files} ${HDF5_SOURCE_DIR}/release_docs/INSTALL_CMake.txt ${HDF5_SOURCE_DIR}/release_docs/HISTORY-1_8.txt ${HDF5_SOURCE_DIR}/release_docs/INSTALL ) - IF (WIN32) - IF (NOT CYGWIN) - SET (release_files + if (WIN32) + if (NOT CYGWIN) + set (release_files ${release_files} ${HDF5_SOURCE_DIR}/release_docs/INSTALL_Windows.txt ) - ELSE (NOT CYGWIN) - SET (release_files + else (NOT CYGWIN) + set (release_files ${release_files} ${HDF5_SOURCE_DIR}/release_docs/INSTALL_Cygwin.txt ) - ENDIF (NOT CYGWIN) - ENDIF (WIN32) - IF (HDF5_ENABLE_PARALLEL) - SET (release_files + endif (NOT CYGWIN) + endif (WIN32) + if (HDF5_ENABLE_PARALLEL) + set (release_files ${release_files} ${HDF5_SOURCE_DIR}/release_docs/INSTALL_parallel ) - ENDIF (HDF5_ENABLE_PARALLEL) - ENDIF (HDF5_PACK_INSTALL_DOCS) - INSTALL ( + endif (HDF5_ENABLE_PARALLEL) + endif (HDF5_PACK_INSTALL_DOCS) + install ( FILES ${release_files} DESTINATION ${HDF5_INSTALL_DATA_DIR} COMPONENT hdfdocuments ) - ENDIF (EXISTS "${HDF5_SOURCE_DIR}/release_docs" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/release_docs") -ENDIF (NOT HDF5_EXTERNALLY_CONFIGURED) + endif (EXISTS "${HDF5_SOURCE_DIR}/release_docs" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/release_docs") +endif (NOT HDF5_EXTERNALLY_CONFIGURED) #----------------------------------------------------------------------------- # Set the cpack variables #----------------------------------------------------------------------------- -IF (NOT HDF5_EXTERNALLY_CONFIGURED AND NOT HDF5_NO_PACKAGES) - SET (CPACK_PACKAGE_VENDOR "HDF_Group") - SET (CPACK_PACKAGE_NAME "${HDF5_PACKAGE_NAME}") - IF (CDASH_LOCAL) - SET (CPACK_PACKAGE_VERSION "${HDF5_PACKAGE_VERSION}") - ELSE (CDASH_LOCAL) - SET (CPACK_PACKAGE_VERSION "${HDF5_PACKAGE_VERSION_STRING}") - ENDIF (CDASH_LOCAL) - SET (CPACK_PACKAGE_VERSION_MAJOR "${HDF5_PACKAGE_VERSION_MAJOR}") - SET (CPACK_PACKAGE_VERSION_MINOR "${HDF5_PACKAGE_VERSION_MINOR}") - SET (CPACK_PACKAGE_VERSION_PATCH "") - IF (EXISTS "${HDF5_SOURCE_DIR}/release_docs") - SET (CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/release_docs/RELEASE.txt") - SET (CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/release_docs/COPYING") - SET (CPACK_RESOURCE_FILE_README "${CMAKE_CURRENT_SOURCE_DIR}/release_docs/RELEASE.txt") - ENDIF (EXISTS "${HDF5_SOURCE_DIR}/release_docs") - SET (CPACK_PACKAGE_RELOCATABLE TRUE) - SET (CPACK_PACKAGE_INSTALL_DIRECTORY "${CPACK_PACKAGE_VENDOR}/${CPACK_PACKAGE_NAME}/${CPACK_PACKAGE_VERSION}") - SET (CPACK_PACKAGE_ICON "${HDF5_RESOURCES_DIR}/hdf.bmp") +if (NOT HDF5_EXTERNALLY_CONFIGURED AND NOT HDF5_NO_PACKAGES) + set (CPACK_PACKAGE_VENDOR "HDF_Group") + set (CPACK_PACKAGE_NAME "${HDF5_PACKAGE_NAME}") + if (CDASH_LOCAL) + set (CPACK_PACKAGE_VERSION "${HDF5_PACKAGE_VERSION}") + else (CDASH_LOCAL) + set (CPACK_PACKAGE_VERSION "${HDF5_PACKAGE_VERSION_STRING}") + endif (CDASH_LOCAL) + set (CPACK_PACKAGE_VERSION_MAJOR "${HDF5_PACKAGE_VERSION_MAJOR}") + set (CPACK_PACKAGE_VERSION_MINOR "${HDF5_PACKAGE_VERSION_MINOR}") + set (CPACK_PACKAGE_VERSION_PATCH "") + if (EXISTS "${HDF5_SOURCE_DIR}/release_docs") + set (CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/release_docs/RELEASE.txt") + set (CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/release_docs/COPYING") + set (CPACK_RESOURCE_FILE_README "${CMAKE_CURRENT_SOURCE_DIR}/release_docs/RELEASE.txt") + endif (EXISTS "${HDF5_SOURCE_DIR}/release_docs") + set (CPACK_PACKAGE_RELOCATABLE TRUE) + set (CPACK_PACKAGE_INSTALL_DIRECTORY "${CPACK_PACKAGE_VENDOR}/${CPACK_PACKAGE_NAME}/${CPACK_PACKAGE_VERSION}") + set (CPACK_PACKAGE_ICON "${HDF5_RESOURCES_DIR}/hdf.bmp") - SET (CPACK_GENERATOR "TGZ") - IF (WIN32) + set (CPACK_GENERATOR "TGZ") + if (WIN32) LIST (APPEND CPACK_GENERATOR "NSIS") # Installers for 32- vs. 64-bit CMake: # - Root install directory (displayed to end user at installer-run time) # - "NSIS package/display name" (text used in the installer GUI) # - Registry key used to store info about the installation - SET (CPACK_NSIS_PACKAGE_NAME "${HDF5_PACKAGE_STRING}") - IF (CMAKE_CL_64) - SET (CPACK_NSIS_INSTALL_ROOT "$PROGRAMFILES64") - SET (CPACK_PACKAGE_INSTALL_REGISTRY_KEY "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION} (Win64)") - ELSE (CMAKE_CL_64) - SET (CPACK_NSIS_INSTALL_ROOT "$PROGRAMFILES") - SET (CPACK_PACKAGE_INSTALL_REGISTRY_KEY "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}") - ENDIF (CMAKE_CL_64) + set (CPACK_NSIS_PACKAGE_NAME "${HDF5_PACKAGE_STRING}") + if (CMAKE_CL_64) + set (CPACK_NSIS_INSTALL_ROOT "$PROGRAMFILES64") + set (CPACK_PACKAGE_INSTALL_REGISTRY_KEY "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION} (Win64)") + else (CMAKE_CL_64) + set (CPACK_NSIS_INSTALL_ROOT "$PROGRAMFILES") + set (CPACK_PACKAGE_INSTALL_REGISTRY_KEY "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}") + endif (CMAKE_CL_64) # set the install/unistall icon used for the installer itself # There is a bug in NSI that does not handle full unix paths properly. - SET (CPACK_NSIS_MUI_ICON "${HDF5_RESOURCES_DIR}\\\\hdf.ico") - SET (CPACK_NSIS_MUI_UNIICON "${HDF5_RESOURCES_DIR}\\\\hdf.ico") + set (CPACK_NSIS_MUI_ICON "${HDF5_RESOURCES_DIR}\\\\hdf.ico") + set (CPACK_NSIS_MUI_UNIICON "${HDF5_RESOURCES_DIR}\\\\hdf.ico") # set the package header icon for MUI - SET (CPACK_PACKAGE_ICON "${HDF5_RESOURCES_DIR}\\\\hdf.bmp") - SET (CPACK_NSIS_DISPLAY_NAME "@CPACK_NSIS_PACKAGE_NAME@, is a data model, library, and file format for storing and managing data") - SET (CPACK_PACKAGE_INSTALL_DIRECTORY "${CPACK_PACKAGE_VENDOR}\\\\${CPACK_PACKAGE_NAME}\\\\${CPACK_PACKAGE_VERSION}") - SET (CPACK_MONOLITHIC_INSTALL ON) - SET (CPACK_NSIS_CONTACT "${HDF5_PACKAGE_BUGREPORT}") - SET (CPACK_NSIS_MODIFY_PATH ON) - ELSEIF (APPLE) + set (CPACK_PACKAGE_ICON "${HDF5_RESOURCES_DIR}\\\\hdf.bmp") + set (CPACK_NSIS_DISPLAY_NAME "@CPACK_NSIS_PACKAGE_NAME@, is a data model, library, and file format for storing and managing data") + set (CPACK_PACKAGE_INSTALL_DIRECTORY "${CPACK_PACKAGE_VENDOR}\\\\${CPACK_PACKAGE_NAME}\\\\${CPACK_PACKAGE_VERSION}") + set (CPACK_MONOLITHIC_INSTALL ON) + set (CPACK_NSIS_CONTACT "${HDF5_PACKAGE_BUGREPORT}") + set (CPACK_NSIS_MODIFY_PATH ON) + elseif (APPLE) LIST (APPEND CPACK_GENERATOR "DragNDrop") - SET (CPACK_COMPONENTS_ALL_IN_ONE_PACKAGE ON) - SET (CPACK_PACKAGE_DEFAULT_LOCATION "/opt/${CPACK_PACKAGE_NAME}") - SET (CPACK_PACKAGING_INSTALL_PREFIX "/") - SET (CPACK_PACKAGE_ICON "${HDF5_RESOURCES_DIR}/hdf.icns") - SET (CPACK_SET_DESTDIR TRUE) # Required when packaging, and set CMAKE_INSTALL_PREFIX to "/". + set (CPACK_COMPONENTS_ALL_IN_ONE_PACKAGE ON) + set (CPACK_PACKAGE_DEFAULT_LOCATION "/opt/${CPACK_PACKAGE_NAME}") + set (CPACK_PACKAGING_INSTALL_PREFIX "/") + set (CPACK_PACKAGE_ICON "${HDF5_RESOURCES_DIR}/hdf.icns") + set (CPACK_SET_DESTDIR TRUE) # Required when packaging, and set CMAKE_INSTALL_PREFIX to "/". - IF (HDF5_PACK_MACOSX_BUNDLE) + if (HDF5_PACK_MACOSX_BUNDLE) LIST (APPEND CPACK_GENERATOR "Bundle") - SET (CPACK_BUNDLE_NAME "${HDF5_PACKAGE_STRING}") - SET (CPACK_BUNDLE_LOCATION "/") # make sure CMAKE_INSTALL_PREFIX ends in / - SET (CMAKE_INSTALL_PREFIX "/${CPACK_BUNDLE_NAME}.framework/Versions/${CPACK_PACKAGE_VERSION}/${CPACK_PACKAGE_NAME}/") - SET (CPACK_BUNDLE_ICON "${HDF5_RESOURCES_DIR}/hdf.icns") - SET (CPACK_BUNDLE_PLIST "${HDF5_BINARY_DIR}/CMakeFiles/Info.plist") - SET (CPACK_APPLE_GUI_INFO_STRING "HDF5 (Hierarchical Data Format 5) Software Library and Utilities") - SET (CPACK_APPLE_GUI_COPYRIGHT "Copyright © 2006-2014 by The HDF Group. All rights reserved.") - SET (CPACK_SHORT_VERSION_STRING "${CPACK_PACKAGE_VERSION}") - SET (CPACK_APPLE_GUI_BUNDLE_NAME "${HDF5_PACKAGE_STRING}") - SET (CPACK_APPLE_GUI_VERSION_STRING "${CPACK_PACKAGE_VERSION_STRING}") - SET (CPACK_APPLE_GUI_SHORT_VERSION_STRING "${CPACK_PACKAGE_VERSION}") + set (CPACK_BUNDLE_NAME "${HDF5_PACKAGE_STRING}") + set (CPACK_BUNDLE_LOCATION "/") # make sure CMAKE_INSTALL_PREFIX ends in / + set (CMAKE_INSTALL_PREFIX "/${CPACK_BUNDLE_NAME}.framework/Versions/${CPACK_PACKAGE_VERSION}/${CPACK_PACKAGE_NAME}/") + set (CPACK_BUNDLE_ICON "${HDF5_RESOURCES_DIR}/hdf.icns") + set (CPACK_BUNDLE_PLIST "${HDF5_BINARY_DIR}/CMakeFiles/Info.plist") + set (CPACK_APPLE_GUI_INFO_STRING "HDF5 (Hierarchical Data Format 5) Software Library and Utilities") + set (CPACK_APPLE_GUI_COPYRIGHT "Copyright © 2006-2014 by The HDF Group. All rights reserved.") + set (CPACK_SHORT_VERSION_STRING "${CPACK_PACKAGE_VERSION}") + set (CPACK_APPLE_GUI_BUNDLE_NAME "${HDF5_PACKAGE_STRING}") + set (CPACK_APPLE_GUI_VERSION_STRING "${CPACK_PACKAGE_VERSION_STRING}") + set (CPACK_APPLE_GUI_SHORT_VERSION_STRING "${CPACK_PACKAGE_VERSION}") #----------------------------------------------------------------------------- # Configure the Info.plist file for the install bundle #----------------------------------------------------------------------------- @@ -326,29 +326,29 @@ IF (NOT HDF5_EXTERNALLY_CONFIGURED AND NOT HDF5_NO_PACKAGES) ${HDF5_RESOURCES_DIR}/version.plist.in ${HDF5_BINARY_DIR}/CMakeFiles/version.plist @ONLY ) - INSTALL ( + install ( FILES ${HDF5_BINARY_DIR}/CMakeFiles/PkgInfo ${HDF5_BINARY_DIR}/CMakeFiles/version.plist DESTINATION .. ) ENDIF(HDF5_PACK_MACOSX_BUNDLE) - ELSE (WIN32) + else (WIN32) LIST (APPEND CPACK_GENERATOR "STGZ") - SET (CPACK_PACKAGING_INSTALL_PREFIX "/${CPACK_PACKAGE_INSTALL_DIRECTORY}") - SET (CPACK_COMPONENTS_ALL_IN_ONE_PACKAGE ON) + set (CPACK_PACKAGING_INSTALL_PREFIX "/${CPACK_PACKAGE_INSTALL_DIRECTORY}") + set (CPACK_COMPONENTS_ALL_IN_ONE_PACKAGE ON) - SET (CPACK_DEBIAN_PACKAGE_SECTION "Libraries") - SET (CPACK_DEBIAN_PACKAGE_MAINTAINER "${HDF5_PACKAGE_BUGREPORT}") + set (CPACK_DEBIAN_PACKAGE_SECTION "Libraries") + set (CPACK_DEBIAN_PACKAGE_MAINTAINER "${HDF5_PACKAGE_BUGREPORT}") # LIST (APPEND CPACK_GENERATOR "RPM") - SET (CPACK_RPM_PACKAGE_RELEASE "1") - SET (CPACK_RPM_COMPONENT_INSTALL ON) - SET (CPACK_RPM_PACKAGE_RELOCATABLE ON) - SET (CPACK_RPM_PACKAGE_LICENSE "BSD-style") - SET (CPACK_RPM_PACKAGE_GROUP "Development/Libraries") - SET (CPACK_RPM_PACKAGE_URL "${HDF5_PACKAGE_URL}") - SET (CPACK_RPM_PACKAGE_SUMMARY "HDF5 is a unique technology suite that makes possible the management of extremely large and complex data collections.") - SET (CPACK_RPM_PACKAGE_DESCRIPTION + set (CPACK_RPM_PACKAGE_RELEASE "1") + set (CPACK_RPM_COMPONENT_INSTALL ON) + set (CPACK_RPM_PACKAGE_RELOCATABLE ON) + set (CPACK_RPM_PACKAGE_LICENSE "BSD-style") + set (CPACK_RPM_PACKAGE_GROUP "Development/Libraries") + set (CPACK_RPM_PACKAGE_URL "${HDF5_PACKAGE_URL}") + set (CPACK_RPM_PACKAGE_SUMMARY "HDF5 is a unique technology suite that makes possible the management of extremely large and complex data collections.") + set (CPACK_RPM_PACKAGE_DESCRIPTION "The HDF5 technology suite includes: * A versatile data model that can represent very complex data objects and a wide variety of metadata. @@ -369,33 +369,33 @@ The HDF5 data model, file format, API, library, and tools are open and distribut # Configure the spec file for the install RPM #----------------------------------------------------------------------------- # CONFIGURE_FILE ("${HDF5_RESOURCES_DIR}/hdf5.spec.in" "${CMAKE_CURRENT_BINARY_DIR}/${HDF5_PACKAGE_NAME}.spec" @ONLY IMMEDIATE) -# SET (CPACK_RPM_USER_BINARY_SPECFILE "${CMAKE_CURRENT_BINARY_DIR}/${HDF5_PACKAGE_NAME}.spec") - ENDIF (WIN32) +# set (CPACK_RPM_USER_BINARY_SPECFILE "${CMAKE_CURRENT_BINARY_DIR}/${HDF5_PACKAGE_NAME}.spec") + endif (WIN32) # By default, do not warn when built on machines using only VS Express: - IF (NOT DEFINED CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS) - SET (CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS ON) + if (NOT DEFINED CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS) + set (CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS ON) ENDIF(NOT DEFINED CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS) INCLUDE(InstallRequiredSystemLibraries) - SET (CPACK_INSTALL_CMAKE_PROJECTS "${HDF5_BINARY_DIR};HDF5;ALL;/") + set (CPACK_INSTALL_CMAKE_PROJECTS "${HDF5_BINARY_DIR};HDF5;ALL;/") - IF (HDF5_PACKAGE_EXTLIBS) - IF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") - IF (ZLIB_FOUND AND ZLIB_USE_EXTERNAL) - SET (CPACK_INSTALL_CMAKE_PROJECTS "${CPACK_INSTALL_CMAKE_PROJECTS};${ZLIB_INCLUDE_DIR_GEN};ZLIB;libraries;/") - SET (CPACK_INSTALL_CMAKE_PROJECTS "${CPACK_INSTALL_CMAKE_PROJECTS};${ZLIB_INCLUDE_DIR_GEN};ZLIB;headers;/") - SET (CPACK_INSTALL_CMAKE_PROJECTS "${CPACK_INSTALL_CMAKE_PROJECTS};${ZLIB_INCLUDE_DIR_GEN};ZLIB;configinstall;/") - ENDIF (ZLIB_FOUND AND ZLIB_USE_EXTERNAL) - IF (SZIP_FOUND AND SZIP_USE_EXTERNAL) - SET (CPACK_INSTALL_CMAKE_PROJECTS "${CPACK_INSTALL_CMAKE_PROJECTS};${SZIP_INCLUDE_DIR_GEN};SZIP;libraries;/") - SET (CPACK_INSTALL_CMAKE_PROJECTS "${CPACK_INSTALL_CMAKE_PROJECTS};${SZIP_INCLUDE_DIR_GEN};SZIP;headers;/") - SET (CPACK_INSTALL_CMAKE_PROJECTS "${CPACK_INSTALL_CMAKE_PROJECTS};${SZIP_INCLUDE_DIR_GEN};SZIP;configinstall;/") - ENDIF (SZIP_FOUND AND SZIP_USE_EXTERNAL) - ENDIF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") - ENDIF (HDF5_PACKAGE_EXTLIBS) + if (HDF5_PACKAGE_EXTLIBS) + if (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") + if (ZLIB_FOUND AND ZLIB_USE_EXTERNAL) + set (CPACK_INSTALL_CMAKE_PROJECTS "${CPACK_INSTALL_CMAKE_PROJECTS};${ZLIB_INCLUDE_DIR_GEN};ZLIB;libraries;/") + set (CPACK_INSTALL_CMAKE_PROJECTS "${CPACK_INSTALL_CMAKE_PROJECTS};${ZLIB_INCLUDE_DIR_GEN};ZLIB;headers;/") + set (CPACK_INSTALL_CMAKE_PROJECTS "${CPACK_INSTALL_CMAKE_PROJECTS};${ZLIB_INCLUDE_DIR_GEN};ZLIB;configinstall;/") + endif (ZLIB_FOUND AND ZLIB_USE_EXTERNAL) + if (SZIP_FOUND AND SZIP_USE_EXTERNAL) + set (CPACK_INSTALL_CMAKE_PROJECTS "${CPACK_INSTALL_CMAKE_PROJECTS};${SZIP_INCLUDE_DIR_GEN};SZIP;libraries;/") + set (CPACK_INSTALL_CMAKE_PROJECTS "${CPACK_INSTALL_CMAKE_PROJECTS};${SZIP_INCLUDE_DIR_GEN};SZIP;headers;/") + set (CPACK_INSTALL_CMAKE_PROJECTS "${CPACK_INSTALL_CMAKE_PROJECTS};${SZIP_INCLUDE_DIR_GEN};SZIP;configinstall;/") + endif (SZIP_FOUND AND SZIP_USE_EXTERNAL) + endif (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") + endif (HDF5_PACKAGE_EXTLIBS) - INCLUDE (CPack) + include (CPack) #--------------------------------------------------------------------------- # Now list the cpack commands @@ -424,7 +424,7 @@ The HDF5 data model, file format, API, library, and tools are open and distribut GROUP Development ) - IF (HDF5_BUILD_FORTRAN) + if (HDF5_BUILD_FORTRAN) CPACK_ADD_COMPONENT (fortlibraries DISPLAY_NAME "HDF5 Fortran Libraries" DEPENDS libraries @@ -435,9 +435,9 @@ The HDF5 data model, file format, API, library, and tools are open and distribut DEPENDS fortlibraries GROUP Development ) - ENDIF (HDF5_BUILD_FORTRAN) + endif (HDF5_BUILD_FORTRAN) - IF (HDF5_BUILD_CPP_LIB) + if (HDF5_BUILD_CPP_LIB) CPACK_ADD_COMPONENT (cpplibraries DISPLAY_NAME "HDF5 C++ Libraries" DEPENDS libraries @@ -448,9 +448,9 @@ The HDF5 data model, file format, API, library, and tools are open and distribut DEPENDS cpplibraries GROUP Development ) - ENDIF (HDF5_BUILD_CPP_LIB) + endif (HDF5_BUILD_CPP_LIB) - IF (HDF5_BUILD_TOOLS) + if (HDF5_BUILD_TOOLS) CPACK_ADD_COMPONENT (toolsapplications DISPLAY_NAME "HDF5 Tools Applications" DEPENDS toolslibraries @@ -466,9 +466,9 @@ The HDF5 data model, file format, API, library, and tools are open and distribut DEPENDS toolslibraries GROUP Development ) - ENDIF (HDF5_BUILD_TOOLS) + endif (HDF5_BUILD_TOOLS) - IF (HDF5_BUILD_HL_LIB) + if (HDF5_BUILD_HL_LIB) CPACK_ADD_COMPONENT (hllibraries DISPLAY_NAME "HDF5 HL Libraries" DEPENDS libraries @@ -499,6 +499,6 @@ The HDF5 data model, file format, API, library, and tools are open and distribut DEPENDS fortlibraries GROUP Runtime ) - ENDIF (HDF5_BUILD_HL_LIB) + endif (HDF5_BUILD_HL_LIB) -ENDIF (NOT HDF5_EXTERNALLY_CONFIGURED AND NOT HDF5_NO_PACKAGES) +endif (NOT HDF5_EXTERNALLY_CONFIGURED AND NOT HDF5_NO_PACKAGES) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4664942..e56e76e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -20,7 +20,7 @@ PROJECT (HDF5 C CXX) # HDF5_EXPORTED_TARGETS : # Set this to the name of the targets variable which controls exports # If unset (because parent project does not support/use the -# INSTALL (EXPORT target...) syntax), then targets are not configured +# install (EXPORT target...) syntax), then targets are not configured # for export during install. # # HDF5_LIB_DEPENDENCIES : @@ -44,25 +44,25 @@ PROJECT (HDF5 C CXX) # any project making use of this build of HDF5 will use the correct zlib # # # Tell hdf5 that we are manually overriding certain settings -# SET(HDF5_EXTERNALLY_CONFIGURED 1) +# set (HDF5_EXTERNALLY_CONFIGURED 1) # # Avoid duplicating names of installed libraries -# SET(HDF5_EXTERNAL_LIB_PREFIX "vtk") +# set (HDF5_EXTERNAL_LIB_PREFIX "vtk") # # Export configuration to this export variable -# SET(HDF5_EXPORTED_TARGETS "paraview-targets") +# set (HDF5_EXPORTED_TARGETS "paraview-targets") # # # Setup all necessary overrides for zlib so that HDF5 uses our # # internally compiled zlib rather than any other version # IF(HDF5_ENABLE_Z_LIB_SUPPORT) # # We must tell the main HDF5 library that it depends on our zlib -# SET(HDF5_LIB_DEPENDENCIES vtkzlib) +# set (HDF5_LIB_DEPENDENCIES vtkzlib) # # Override the zlib header file # IF(VTK_USE_SYSTEM_ZLIB) -# SET(H5_ZLIB_HEADER "zlib.h") +# set (H5_ZLIB_HEADER "zlib.h") # ELSE(VTK_USE_SYSTEM_ZLIB) -# SET(H5_ZLIB_HEADER "vtk_zlib.h") +# set (H5_ZLIB_HEADER "vtk_zlib.h") # # Set vars that FindZlib would have set if used in sub project -# SET(ZLIB_INCLUDE_DIRS "${VTK_ZLIB_INCLUDE_DIRS}") -# SET(ZLIB_LIBRARIES vtkzlib) +# set (ZLIB_INCLUDE_DIRS "${VTK_ZLIB_INCLUDE_DIRS}") +# set (ZLIB_LIBRARIES vtkzlib) # ENDIF(VTK_USE_SYSTEM_ZLIB) # ENDIF(HDF5_ENABLE_Z_LIB_SUPPORT) # @@ -77,281 +77,277 @@ PROJECT (HDF5 C CXX) # organization feature. Default to ON for non-Express users. Express users must # explicitly turn off this option to build HDF5 in the Express IDE... # -OPTION (HDF5_USE_FOLDERS "Enable folder grouping of projects in IDEs." ON) +option (HDF5_USE_FOLDERS "Enable folder grouping of projects in IDEs." ON) MARK_AS_ADVANCED (HDF5_USE_FOLDERS) -IF (HDF5_USE_FOLDERS) - SET_PROPERTY (GLOBAL PROPERTY USE_FOLDERS ON) -ENDIF (HDF5_USE_FOLDERS) -OPTION (HDF5_NO_PACKAGES "CPACK - Disable packaging" OFF) +if (HDF5_USE_FOLDERS) + set_property (GLOBAL PROPERTY USE_FOLDERS ON) +endif (HDF5_USE_FOLDERS) +option (HDF5_NO_PACKAGES "CPACK - Disable packaging" OFF) MARK_AS_ADVANCED (HDF5_NO_PACKAGES) #----------------------------------------------------------------------------- # Set the core names of all the libraries #----------------------------------------------------------------------------- -SET (HDF5_LIB_CORENAME "hdf5") -SET (HDF5_TEST_LIB_CORENAME "hdf5_test") -SET (HDF5_CPP_LIB_CORENAME "hdf5_cpp") -SET (HDF5_HL_LIB_CORENAME "hdf5_hl") -SET (HDF5_HL_CPP_LIB_CORENAME "hdf5_hl_cpp") -SET (HDF5_TOOLS_LIB_CORENAME "hdf5_tools") -SET (HDF5_F90_LIB_CORENAME "hdf5_fortran") -SET (HDF5_F90_C_LIB_CORENAME "hdf5_f90cstub") -SET (HDF5_F90_TEST_LIB_CORENAME "hdf5_test_fortran") -SET (HDF5_F90_C_TEST_LIB_CORENAME "hdf5_test_f90cstub") -SET (HDF5_HL_F90_LIB_CORENAME "hdf5_hl_fortran") -SET (HDF5_HL_F90_C_LIB_CORENAME "hdf5_hl_f90cstub") +set (HDF5_LIB_CORENAME "hdf5") +set (HDF5_TEST_LIB_CORENAME "hdf5_test") +set (HDF5_CPP_LIB_CORENAME "hdf5_cpp") +set (HDF5_HL_LIB_CORENAME "hdf5_hl") +set (HDF5_HL_CPP_LIB_CORENAME "hdf5_hl_cpp") +set (HDF5_TOOLS_LIB_CORENAME "hdf5_tools") +set (HDF5_F90_LIB_CORENAME "hdf5_fortran") +set (HDF5_F90_C_LIB_CORENAME "hdf5_f90cstub") +set (HDF5_F90_TEST_LIB_CORENAME "hdf5_test_fortran") +set (HDF5_F90_C_TEST_LIB_CORENAME "hdf5_test_f90cstub") +set (HDF5_HL_F90_LIB_CORENAME "hdf5_hl_fortran") +set (HDF5_HL_F90_C_LIB_CORENAME "hdf5_hl_f90cstub") #----------------------------------------------------------------------------- # Set the true names of all the libraries if customized by external project #----------------------------------------------------------------------------- -SET (HDF5_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_LIB_CORENAME}") -SET (HDF5_TEST_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_TEST_LIB_CORENAME}") -SET (HDF5_CPP_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_CPP_LIB_CORENAME}") -SET (HDF5_HL_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_HL_LIB_CORENAME}") -SET (HDF5_HL_CPP_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_HL_CPP_LIB_CORENAME}") -SET (HDF5_TOOLS_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_TOOLS_LIB_CORENAME}") -SET (HDF5_F90_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_F90_LIB_CORENAME}") -SET (HDF5_F90_C_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_F90_C_LIB_CORENAME}") -SET (HDF5_F90_TEST_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_F90_TEST_LIB_CORENAME}") -SET (HDF5_F90_C_TEST_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_F90_C_TEST_LIB_CORENAME}") -SET (HDF5_HL_F90_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_HL_F90_LIB_CORENAME}") -SET (HDF5_HL_F90_C_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_HL_F90_C_LIB_CORENAME}") +set (HDF5_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_LIB_CORENAME}") +set (HDF5_TEST_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_TEST_LIB_CORENAME}") +set (HDF5_CPP_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_CPP_LIB_CORENAME}") +set (HDF5_HL_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_HL_LIB_CORENAME}") +set (HDF5_HL_CPP_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_HL_CPP_LIB_CORENAME}") +set (HDF5_TOOLS_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_TOOLS_LIB_CORENAME}") +set (HDF5_F90_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_F90_LIB_CORENAME}") +set (HDF5_F90_C_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_F90_C_LIB_CORENAME}") +set (HDF5_F90_TEST_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_F90_TEST_LIB_CORENAME}") +set (HDF5_F90_C_TEST_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_F90_C_TEST_LIB_CORENAME}") +set (HDF5_HL_F90_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_HL_F90_LIB_CORENAME}") +set (HDF5_HL_F90_C_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_HL_F90_C_LIB_CORENAME}") #----------------------------------------------------------------------------- # Set the target names of all the libraries #----------------------------------------------------------------------------- -SET (HDF5_LIB_TARGET ${HDF5_LIB_CORENAME}) -SET (HDF5_TEST_LIB_TARGET ${HDF5_TEST_LIB_CORENAME}) -SET (HDF5_CPP_LIB_TARGET ${HDF5_CPP_LIB_CORENAME}) -SET (HDF5_HL_LIB_TARGET ${HDF5_HL_LIB_CORENAME}) -SET (HDF5_HL_CPP_LIB_TARGET ${HDF5_HL_CPP_LIB_CORENAME}) -SET (HDF5_TOOLS_LIB_TARGET ${HDF5_TOOLS_LIB_CORENAME}) -SET (HDF5_F90_LIB_TARGET ${HDF5_F90_LIB_CORENAME}) -SET (HDF5_F90_C_LIB_TARGET ${HDF5_F90_C_LIB_CORENAME}) -SET (HDF5_F90_TEST_LIB_TARGET ${HDF5_F90_TEST_LIB_CORENAME}) -SET (HDF5_F90_C_TEST_LIB_TARGET ${HDF5_F90_C_TEST_LIB_CORENAME}) -SET (HDF5_HL_F90_LIB_TARGET ${HDF5_HL_F90_LIB_CORENAME}) -SET (HDF5_HL_F90_C_LIB_TARGET ${HDF5_HL_F90_C_LIB_CORENAME}) +set (HDF5_LIB_TARGET ${HDF5_LIB_CORENAME}) +set (HDF5_TEST_LIB_TARGET ${HDF5_TEST_LIB_CORENAME}) +set (HDF5_CPP_LIB_TARGET ${HDF5_CPP_LIB_CORENAME}) +set (HDF5_HL_LIB_TARGET ${HDF5_HL_LIB_CORENAME}) +set (HDF5_HL_CPP_LIB_TARGET ${HDF5_HL_CPP_LIB_CORENAME}) +set (HDF5_TOOLS_LIB_TARGET ${HDF5_TOOLS_LIB_CORENAME}) +set (HDF5_F90_LIB_TARGET ${HDF5_F90_LIB_CORENAME}) +set (HDF5_F90_C_LIB_TARGET ${HDF5_F90_C_LIB_CORENAME}) +set (HDF5_F90_TEST_LIB_TARGET ${HDF5_F90_TEST_LIB_CORENAME}) +set (HDF5_F90_C_TEST_LIB_TARGET ${HDF5_F90_C_TEST_LIB_CORENAME}) +set (HDF5_HL_F90_LIB_TARGET ${HDF5_HL_F90_LIB_CORENAME}) +set (HDF5_HL_F90_C_LIB_TARGET ${HDF5_HL_F90_C_LIB_CORENAME}) #----------------------------------------------------------------------------- # Define some CMake variables for use later in the project #----------------------------------------------------------------------------- -SET (HDF5_RESOURCES_DIR ${HDF5_SOURCE_DIR}/config/cmake) -SET (HDF5_SRC_DIR ${HDF5_SOURCE_DIR}/src) -SET (HDF5_TEST_SRC_DIR ${HDF5_SOURCE_DIR}/test) -SET (HDF5_CPP_SRC_DIR ${HDF5_SOURCE_DIR}/c++) -SET (HDF5_CPP_TST_DIR ${HDF5_SOURCE_DIR}/c++/test) -SET (HDF5_HL_SRC_DIR ${HDF5_SOURCE_DIR}/hl) -SET (HDF5_HL_CPP_SRC_DIR ${HDF5_SOURCE_DIR}/hl/c++) -SET (HDF5_TOOLS_SRC_DIR ${HDF5_SOURCE_DIR}/tools) -SET (HDF5_PERFORM_SRC_DIR ${HDF5_SOURCE_DIR}/perform) -SET (HDF5_F90_SRC_DIR ${HDF5_SOURCE_DIR}/fortran) - -IF (NOT HDF5_INSTALL_BIN_DIR) - SET (HDF5_INSTALL_BIN_DIR bin) -ENDIF (NOT HDF5_INSTALL_BIN_DIR) -IF (NOT HDF5_INSTALL_LIB_DIR) - SET (HDF5_INSTALL_LIB_DIR lib) -ENDIF (NOT HDF5_INSTALL_LIB_DIR) -IF (NOT HDF5_INSTALL_INCLUDE_DIR) - SET (HDF5_INSTALL_INCLUDE_DIR include) -ENDIF (NOT HDF5_INSTALL_INCLUDE_DIR) -IF (NOT HDF5_INSTALL_DATA_DIR) - IF (NOT WIN32) - SET (HDF5_INSTALL_DATA_DIR share) - SET (HDF5_INSTALL_CMAKE_DIR share/cmake) - ELSE (NOT WIN32) - SET (HDF5_INSTALL_DATA_DIR ".") - SET (HDF5_INSTALL_CMAKE_DIR cmake) - ENDIF (NOT WIN32) -ENDIF (NOT HDF5_INSTALL_DATA_DIR) +set (HDF5_RESOURCES_DIR ${HDF5_SOURCE_DIR}/config/cmake) +set (HDF5_SRC_DIR ${HDF5_SOURCE_DIR}/src) +set (HDF5_TEST_SRC_DIR ${HDF5_SOURCE_DIR}/test) +set (HDF5_CPP_SRC_DIR ${HDF5_SOURCE_DIR}/c++) +set (HDF5_CPP_TST_DIR ${HDF5_SOURCE_DIR}/c++/test) +set (HDF5_HL_SRC_DIR ${HDF5_SOURCE_DIR}/hl) +set (HDF5_HL_CPP_SRC_DIR ${HDF5_SOURCE_DIR}/hl/c++) +set (HDF5_TOOLS_SRC_DIR ${HDF5_SOURCE_DIR}/tools) +set (HDF5_PERFORM_SRC_DIR ${HDF5_SOURCE_DIR}/perform) +set (HDF5_F90_SRC_DIR ${HDF5_SOURCE_DIR}/fortran) + +if (NOT HDF5_INSTALL_BIN_DIR) + set (HDF5_INSTALL_BIN_DIR bin) +endif (NOT HDF5_INSTALL_BIN_DIR) +if (NOT HDF5_INSTALL_LIB_DIR) + set (HDF5_INSTALL_LIB_DIR lib) +endif (NOT HDF5_INSTALL_LIB_DIR) +if (NOT HDF5_INSTALL_INCLUDE_DIR) + set (HDF5_INSTALL_INCLUDE_DIR include) +endif (NOT HDF5_INSTALL_INCLUDE_DIR) +if (NOT HDF5_INSTALL_DATA_DIR) + if (NOT WIN32) + set (HDF5_INSTALL_DATA_DIR share) + set (HDF5_INSTALL_CMAKE_DIR share/cmake) + else (NOT WIN32) + set (HDF5_INSTALL_DATA_DIR ".") + set (HDF5_INSTALL_CMAKE_DIR cmake) + endif (NOT WIN32) +endif (NOT HDF5_INSTALL_DATA_DIR) #----------------------------------------------------------------------------- # parse the full version number from H5public.h and include in H5_VERS_INFO #----------------------------------------------------------------------------- FILE (READ ${HDF5_SRC_DIR}/H5public.h _h5public_h_contents) -STRING (REGEX REPLACE ".*#define[ \t]+H5_VERS_MAJOR[ \t]+([0-9]*).*$" +string (REGEX REPLACE ".*#define[ \t]+H5_VERS_MAJOR[ \t]+([0-9]*).*$" "\\1" H5_VERS_MAJOR ${_h5public_h_contents}) -STRING (REGEX REPLACE ".*#define[ \t]+H5_VERS_MINOR[ \t]+([0-9]*).*$" +string (REGEX REPLACE ".*#define[ \t]+H5_VERS_MINOR[ \t]+([0-9]*).*$" "\\1" H5_VERS_MINOR ${_h5public_h_contents}) -STRING (REGEX REPLACE ".*#define[ \t]+H5_VERS_RELEASE[ \t]+([0-9]*).*$" +string (REGEX REPLACE ".*#define[ \t]+H5_VERS_RELEASE[ \t]+([0-9]*).*$" "\\1" H5_VERS_RELEASE ${_h5public_h_contents}) -STRING (REGEX REPLACE ".*#define[ \t]+H5_VERS_SUBRELEASE[ \t]+\"([0-9A-Za-z._]*)\".*$" +string (REGEX REPLACE ".*#define[ \t]+H5_VERS_SUBRELEASE[ \t]+\"([0-9A-Za-z._]*)\".*$" "\\1" H5_VERS_SUBRELEASE ${_h5public_h_contents}) -#MESSAGE (STATUS "VERSION: ${H5_VERS_MAJOR}.${H5_VERS_MINOR}.${H5_VERS_RELEASE}-${H5_VERS_SUBRELEASE}") +#message (STATUS "VERSION: ${H5_VERS_MAJOR}.${H5_VERS_MINOR}.${H5_VERS_RELEASE}-${H5_VERS_SUBRELEASE}") #----------------------------------------------------------------------------- # parse the full soversion number from config/lt_vers.am and include in H5_SOVERS_INFO #----------------------------------------------------------------------------- FILE (READ ${HDF5_SOURCE_DIR}/config/lt_vers.am _lt_vers_am_contents) -STRING (REGEX REPLACE ".*LT_VERS_INTERFACE[ \t]+=[ \t]+([0-9]*).*$" +string (REGEX REPLACE ".*LT_VERS_INTERFACE[ \t]+=[ \t]+([0-9]*).*$" "\\1" H5_SOVERS_INTERFACE ${_lt_vers_am_contents}) -STRING (REGEX REPLACE ".*LT_VERS_REVISION[ \t]+=[ \t]+([0-9]*).*$" +string (REGEX REPLACE ".*LT_VERS_REVISION[ \t]+=[ \t]+([0-9]*).*$" "\\1" H5_SOVERS_MINOR ${_lt_vers_am_contents}) -STRING (REGEX REPLACE ".*LT_VERS_AGE[ \t]+=[ \t]+([0-9]*).*$" +string (REGEX REPLACE ".*LT_VERS_AGE[ \t]+=[ \t]+([0-9]*).*$" "\\1" H5_SOVERS_RELEASE ${_lt_vers_am_contents}) MATH(EXPR H5_SOVERS_MAJOR ${H5_SOVERS_INTERFACE}-${H5_SOVERS_RELEASE}) -MESSAGE (STATUS "SOVERSION: ${H5_SOVERS_MAJOR}.${H5_SOVERS_RELEASE}.${H5_SOVERS_MINOR}") +message (STATUS "SOVERSION: ${H5_SOVERS_MAJOR}.${H5_SOVERS_RELEASE}.${H5_SOVERS_MINOR}") #----------------------------------------------------------------------------- # Basic HDF5 stuff here #----------------------------------------------------------------------------- -SET (HDF5_PACKAGE "hdf5") -SET (HDF5_PACKAGE_NAME "HDF5") -SET (HDF5_PACKAGE_VERSION "${H5_VERS_MAJOR}.${H5_VERS_MINOR}.${H5_VERS_RELEASE}") -SET (HDF5_PACKAGE_VERSION_MAJOR "${H5_VERS_MAJOR}.${H5_VERS_MINOR}") -SET (HDF5_PACKAGE_VERSION_MINOR "${H5_VERS_RELEASE}") -IF (NOT "${H5_VERS_SUBRELEASE}" STREQUAL "") - SET (HDF5_PACKAGE_VERSION_STRING "${HDF5_PACKAGE_VERSION}-${H5_VERS_SUBRELEASE}") -ELSE (NOT "${H5_VERS_SUBRELEASE}" STREQUAL "") - SET (HDF5_PACKAGE_VERSION_STRING "${HDF5_PACKAGE_VERSION}") -ENDIF (NOT "${H5_VERS_SUBRELEASE}" STREQUAL "") -SET (HDF5_PACKAGE_SOVERSION "${H5_SOVERS_MAJOR}.${H5_SOVERS_RELEASE}.${H5_SOVERS_MINOR}") -SET (HDF5_PACKAGE_STRING "${HDF5_PACKAGE_NAME} ${HDF5_PACKAGE_VERSION_STRING}") -SET (HDF5_PACKAGE_TARNAME "${HDF5_PACKAGE}${HDF_PACKAGE_EXT}") -SET (HDF5_PACKAGE_URL "http://www.hdfgroup.org") -SET (HDF5_PACKAGE_BUGREPORT "help@hdfgroup.org") +set (HDF5_PACKAGE "hdf5") +set (HDF5_PACKAGE_NAME "HDF5") +set (HDF5_PACKAGE_VERSION "${H5_VERS_MAJOR}.${H5_VERS_MINOR}.${H5_VERS_RELEASE}") +set (HDF5_PACKAGE_VERSION_MAJOR "${H5_VERS_MAJOR}.${H5_VERS_MINOR}") +set (HDF5_PACKAGE_VERSION_MINOR "${H5_VERS_RELEASE}") +if (NOT "${H5_VERS_SUBRELEASE}" STREQUAL "") + set (HDF5_PACKAGE_VERSION_STRING "${HDF5_PACKAGE_VERSION}-${H5_VERS_SUBRELEASE}") +else (NOT "${H5_VERS_SUBRELEASE}" STREQUAL "") + set (HDF5_PACKAGE_VERSION_STRING "${HDF5_PACKAGE_VERSION}") +endif (NOT "${H5_VERS_SUBRELEASE}" STREQUAL "") +set (HDF5_PACKAGE_SOVERSION "${H5_SOVERS_MAJOR}.${H5_SOVERS_RELEASE}.${H5_SOVERS_MINOR}") +set (HDF5_PACKAGE_STRING "${HDF5_PACKAGE_NAME} ${HDF5_PACKAGE_VERSION_STRING}") +set (HDF5_PACKAGE_TARNAME "${HDF5_PACKAGE}${HDF_PACKAGE_EXT}") +set (HDF5_PACKAGE_URL "http://www.hdfgroup.org") +set (HDF5_PACKAGE_BUGREPORT "help@hdfgroup.org") #----------------------------------------------------------------------------- # Set Install folder value #----------------------------------------------------------------------------- -IF (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) +if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) IF(CMAKE_HOST_UNIX) - SET(CMAKE_INSTALL_PREFIX "/HDF_Group/${HDF5_PACKAGE_NAME}/${HDF5_PACKAGE_VERSION}" + set (CMAKE_INSTALL_PREFIX "/HDF_Group/${HDF5_PACKAGE_NAME}/${HDF5_PACKAGE_VERSION}" CACHE PATH "Install path prefix, prepended onto install directories." FORCE) ELSE(CMAKE_HOST_UNIX) GetDefaultWindowsPrefixBase(CMAKE_GENERIC_PROGRAM_FILES) - SET(CMAKE_INSTALL_PREFIX + set (CMAKE_INSTALL_PREFIX "${CMAKE_GENERIC_PROGRAM_FILES}/HDF_Group/${HDF5_PACKAGE_NAME}/${HDF5_PACKAGE_VERSION}" CACHE PATH "Install path prefix, prepended onto install directories." FORCE) - SET(CMAKE_GENERIC_PROGRAM_FILES) + set (CMAKE_GENERIC_PROGRAM_FILES) ENDIF(CMAKE_HOST_UNIX) -ENDIF (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) +endif (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) #----------------------------------------------------------------------------- # Include some macros for reusable code #----------------------------------------------------------------------------- -INCLUDE (${HDF5_RESOURCES_DIR}/HDFMacros.cmake) -INCLUDE (${HDF5_RESOURCES_DIR}/HDFLibMacros.cmake) -INCLUDE (${HDF5_RESOURCES_DIR}/HDF5Macros.cmake) +include (${HDF5_RESOURCES_DIR}/HDFMacros.cmake) +include (${HDF5_RESOURCES_DIR}/HDFLibMacros.cmake) +include (${HDF5_RESOURCES_DIR}/HDF5Macros.cmake) #----------------------------------------------------------------------------- # Setup output Directories #----------------------------------------------------------------------------- -IF (NOT HDF5_EXTERNALLY_CONFIGURED) - SET (CMAKE_RUNTIME_OUTPUT_DIRECTORY +if (NOT HDF5_EXTERNALLY_CONFIGURED) + set (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin CACHE PATH "Single Directory for all Executables." ) - SET (CMAKE_LIBRARY_OUTPUT_DIRECTORY + set (CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin CACHE PATH "Single Directory for all Libraries" ) - SET (CMAKE_ARCHIVE_OUTPUT_DIRECTORY + set (CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin CACHE PATH "Single Directory for all static libraries." ) - SET (CMAKE_Fortran_MODULE_DIRECTORY + set (CMAKE_Fortran_MODULE_DIRECTORY ${PROJECT_BINARY_DIR}/bin/fortran CACHE PATH "Single Directory for all fortran modules." ) -ELSE (NOT HDF5_EXTERNALLY_CONFIGURED) +else (NOT HDF5_EXTERNALLY_CONFIGURED) # if we are externally configured, but the project uses old cmake scripts # this may not be set and utilities like H5detect will fail - IF (NOT CMAKE_RUNTIME_OUTPUT_DIRECTORY) - SET (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${EXECUTABLE_OUTPUT_PATH}) - ENDIF (NOT CMAKE_RUNTIME_OUTPUT_DIRECTORY) -ENDIF (NOT HDF5_EXTERNALLY_CONFIGURED) + if (NOT CMAKE_RUNTIME_OUTPUT_DIRECTORY) + set (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${EXECUTABLE_OUTPUT_PATH}) + endif (NOT CMAKE_RUNTIME_OUTPUT_DIRECTORY) +endif (NOT HDF5_EXTERNALLY_CONFIGURED) #----------------------------------------------------------------------------- # Targets built within this project are exported at Install time for use # by other projects using FindHDF5. #----------------------------------------------------------------------------- -IF (NOT HDF5_EXPORTED_TARGETS) - SET (HDF5_EXPORTED_TARGETS "hdf5-targets") -ENDIF (NOT HDF5_EXPORTED_TARGETS) +if (NOT HDF5_EXPORTED_TARGETS) + set (HDF5_EXPORTED_TARGETS "hdf5-targets") +endif (NOT HDF5_EXPORTED_TARGETS) #----------------------------------------------------------------------------- # To include a library in the list exported by the project AT BUILD TIME, # add it to this variable. This is NOT used by Make Install, but for projects # which include hdf5 as a sub-project within their build tree #----------------------------------------------------------------------------- -SET_GLOBAL_VARIABLE (HDF5_LIBRARIES_TO_EXPORT "") -SET (EXTERNAL_HEADER_LIST "") -SET (EXTERNAL_LIBRARY_LIST "") -SET (EXTERNAL_LIBRARYDLL_LIST "") +set_global_variable (HDF5_LIBRARIES_TO_EXPORT "") +set (EXTERNAL_HEADER_LIST "") +set (EXTERNAL_LIBRARY_LIST "") +set (EXTERNAL_LIBRARYDLL_LIST "") #----------------------------------------------------------------------------- # Run all the CMake configuration tests for our build environment #----------------------------------------------------------------------------- -INCLUDE (${HDF5_RESOURCES_DIR}/ConfigureChecks.cmake) +include (${HDF5_RESOURCES_DIR}/ConfigureChecks.cmake) + +set (CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE ON) #----------------------------------------------------------------------------- # Option to Build Shared/Static libs, default is static #----------------------------------------------------------------------------- -OPTION (BUILD_SHARED_LIBS "Build Shared Libraries" OFF) -SET (LIB_TYPE STATIC) -SET (H5_ENABLE_SHARED_LIB NO) -SET (H5_ENABLE_STATIC_LIB NO) -IF (BUILD_SHARED_LIBS) - SET (LIB_TYPE SHARED) - SET (H5_BUILT_AS_DYNAMIC_LIB 1) - SET (H5_ENABLE_SHARED_LIB YES) -ELSE (BUILD_SHARED_LIBS) - SET (H5_BUILT_AS_STATIC_LIB 1) - SET (H5_ENABLE_STATIC_LIB YES) - IF (NOT WIN32) - # should this be a user setting : Everyone uses it anyway ? - ADD_DEFINITIONS (-DPIC) - IF (${CMAKE_SYSTEM_NAME} MATCHES "SunOS") - ADD_DEFINITIONS (-KPIC) - ENDIF (${CMAKE_SYSTEM_NAME} MATCHES "SunOS") - ENDIF (NOT WIN32) -ENDIF (BUILD_SHARED_LIBS) +option (BUILD_SHARED_LIBS "Build Shared Libraries" OFF) +set (LIB_TYPE STATIC) +set (H5_ENABLE_SHARED_LIB NO) +set (H5_ENABLE_STATIC_LIB NO) +if (BUILD_SHARED_LIBS) + set (LIB_TYPE SHARED) + set (H5_BUILT_AS_DYNAMIC_LIB 1) + set (H5_ENABLE_SHARED_LIB YES) +else (BUILD_SHARED_LIBS) + set (H5_BUILT_AS_STATIC_LIB 1) + set (H5_ENABLE_STATIC_LIB YES) + set (CMAKE_POSITION_INDEPENDENT_CODE ON) +endif (BUILD_SHARED_LIBS) #----------------------------------------------------------------------------- # Option to Build Static executables #----------------------------------------------------------------------------- -OPTION (BUILD_STATIC_EXECS "Build Static Executabless" OFF) -IF (BUILD_STATIC_EXECS) - IF (NOT WIN32) - SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -static") - SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static") - ENDIF (NOT WIN32) -ENDIF (BUILD_STATIC_EXECS) +option (BUILD_STATIC_EXECS "Build Static Executabless" OFF) +if (BUILD_STATIC_EXECS) + if (NOT WIN32) + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -static") + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static") + endif (NOT WIN32) +endif (BUILD_STATIC_EXECS) #----------------------------------------------------------------------------- # Option to use code coverage #----------------------------------------------------------------------------- -OPTION (HDF5_ENABLE_COVERAGE "Enable code coverage for Libraries and Programs" OFF) -IF (HDF5_ENABLE_COVERAGE) - SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -O0 -fprofile-arcs -ftest-coverage") - SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -O0 -fprofile-arcs -ftest-coverage") - SET (LDFLAGS "${LDFLAGS} -fprofile-arcs -ftest-coverage") -ENDIF (HDF5_ENABLE_COVERAGE) +option (HDF5_ENABLE_COVERAGE "Enable code coverage for Libraries and Programs" OFF) +if (HDF5_ENABLE_COVERAGE) + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -O0 -fprofile-arcs -ftest-coverage") + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -O0 -fprofile-arcs -ftest-coverage") + set (LDFLAGS "${LDFLAGS} -fprofile-arcs -ftest-coverage") +endif (HDF5_ENABLE_COVERAGE) #----------------------------------------------------------------------------- # Option to indicate using dmalloc #----------------------------------------------------------------------------- -# OPTION (HDF5_ENABLE_USING_DMALLOC "Indicate that dmalloc is used" OFF) -# IF (HDF5_ENABLE_USING_DMALLOC) +# option (HDF5_ENABLE_USING_DMALLOC "Indicate that dmalloc is used" OFF) +# if (HDF5_ENABLE_USING_DMALLOC) # FIND_PACKAGE (DMALLOC) -# SET (H5_HAVE_DMALLOC DMALLOC_FOUND) -# ENDIF (HDF5_ENABLE_USING_DMALLOC) +# set (H5_HAVE_DMALLOC DMALLOC_FOUND) +# endif (HDF5_ENABLE_USING_DMALLOC) #----------------------------------------------------------------------------- # Option to indicate using a memory checker #----------------------------------------------------------------------------- -OPTION (HDF5_ENABLE_USING_MEMCHECKER "Indicate that a memory checker is used" OFF) -IF (HDF5_ENABLE_USING_MEMCHECKER) - SET (H5_USING_MEMCHECKER 1) -ENDIF (HDF5_ENABLE_USING_MEMCHECKER) +option (HDF5_ENABLE_USING_MEMCHECKER "Indicate that a memory checker is used" OFF) +if (HDF5_ENABLE_USING_MEMCHECKER) + set (H5_USING_MEMCHECKER 1) +endif (HDF5_ENABLE_USING_MEMCHECKER) #----------------------------------------------------------------------------- # Option to use deprecated public API symbols #----------------------------------------------------------------------------- -OPTION (HDF5_ENABLE_DEPRECATED_SYMBOLS "Enable deprecated public API symbols" ON) -IF (HDF5_ENABLE_DEPRECATED_SYMBOLS) - SET (H5_NO_DEPRECATED_SYMBOLS 0) -ELSE (HDF5_ENABLE_DEPRECATED_SYMBOLS) - SET (H5_NO_DEPRECATED_SYMBOLS 1) -ENDIF (HDF5_ENABLE_DEPRECATED_SYMBOLS) +option (HDF5_ENABLE_DEPRECATED_SYMBOLS "Enable deprecated public API symbols" ON) +if (HDF5_ENABLE_DEPRECATED_SYMBOLS) + set (H5_NO_DEPRECATED_SYMBOLS 0) +else (HDF5_ENABLE_DEPRECATED_SYMBOLS) + set (H5_NO_DEPRECATED_SYMBOLS 1) +endif (HDF5_ENABLE_DEPRECATED_SYMBOLS) #----------------------------------------------------------------------------- # When building utility executables that generate other (source) files : @@ -359,296 +355,290 @@ ENDIF (HDF5_ENABLE_DEPRECATED_SYMBOLS) # Certain systems may add /Debug or /Release to output paths # and we need to call the executable from inside the CMake configuration #----------------------------------------------------------------------------- -SET (EXE_EXT "") -IF (WIN32) - SET (EXE_EXT ".exe") - IF (NOT CYGWIN) - ADD_DEFINITIONS (-D_BIND_TO_CURRENT_VCLIBS_VERSION=1) - ADD_DEFINITIONS (-D_CRT_SECURE_NO_WARNINGS) - ADD_DEFINITIONS (-D_CONSOLE) - ENDIF (NOT CYGWIN) -ENDIF (WIN32) - -IF (MSVC) - SET (CMAKE_MFC_FLAG 0) - SET (WIN_COMPILE_FLAGS "") - SET (WIN_LINK_FLAGS "") -ENDIF (MSVC) - -SET (MAKE_SYSTEM) -IF (CMAKE_BUILD_TOOL MATCHES "make") - SET (MAKE_SYSTEM 1) -ENDIF (CMAKE_BUILD_TOOL MATCHES "make") - -SET (CFG_INIT "/${CMAKE_CFG_INTDIR}") -IF (MAKE_SYSTEM) - SET (CFG_INIT "") -ENDIF (MAKE_SYSTEM) +set (EXE_EXT "") +if (WIN32) + set (EXE_EXT ".exe") + if (NOT CYGWIN) + add_definitions (-D_BIND_TO_CURRENT_VCLIBS_VERSION=1) + add_definitions (-D_CRT_SECURE_NO_WARNINGS) + add_definitions (-D_CONSOLE) + endif (NOT CYGWIN) +endif (WIN32) + +if (MSVC) + set (CMAKE_MFC_FLAG 0) + set (WIN_COMPILE_FLAGS "") + set (WIN_LINK_FLAGS "") +endif (MSVC) + +set (MAKE_SYSTEM) +if (CMAKE_BUILD_TOOL MATCHES "make") + set (MAKE_SYSTEM 1) +endif (CMAKE_BUILD_TOOL MATCHES "make") + +set (CFG_INIT "/${CMAKE_CFG_INTDIR}") +if (MAKE_SYSTEM) + set (CFG_INIT "") +endif (MAKE_SYSTEM) #----------------------------------------------------------------------------- # Add some definitions for Debug Builds #----------------------------------------------------------------------------- -IF (CMAKE_BUILD_TYPE MATCHES Debug) - ADD_DEFINITIONS (-DDEBUG) - ADD_DEFINITIONS ( - -DH5Z_DEBUG -DH5VM_DEBUG -DH5T_DEBUG - -DH5S_DEBUG -DH5P_DEBUG -DH5O_DEBUG -DH5MM_DEBUG -DH5MF_DEBUG - -DH5I_DEBUG -DH5HL_DEBUG -DH5HG_DEBUG -DH5G_DEBUG -DH5F_DEBUG - -DH5E_DEBUG -DH5D_DEBUG -DH5B_DEBUG -DH5AC_DEBUG -UNDEBUG - ) +if (CMAKE_BUILD_TYPE MATCHES Debug) + add_definitions (-DDEBUG) # Enable tracing of the API - OPTION (HDF5_ENABLE_TRACE "Enable API tracing capability" ON) - IF (HDF5_ENABLE_TRACE) - ADD_DEFINITIONS (-DH5_DEBUG_API ) - ENDIF (HDF5_ENABLE_TRACE) + option (HDF5_ENABLE_TRACE "Enable API tracing capability" ON) + if (HDF5_ENABLE_TRACE) + add_definitions (-DH5_DEBUG_API ) + endif (HDF5_ENABLE_TRACE) # Enable instrumenting of the library's internal operations - OPTION (HDF5_ENABLE_INSTRUMENT "Instrument The library" OFF) - IF (HDF5_ENABLE_INSTRUMENT) - SET (H5_HAVE_INSTRUMENTED_LIBRARY 1) - ENDIF (HDF5_ENABLE_INSTRUMENT) + option (HDF5_ENABLE_INSTRUMENT "Instrument The library" OFF) + if (HDF5_ENABLE_INSTRUMENT) + set (H5_HAVE_INSTRUMENTED_LIBRARY 1) + endif (HDF5_ENABLE_INSTRUMENT) MARK_AS_ADVANCED (HDF5_Enable_Instrument) #-- NMake Makefiles will overwhelm the console with warnings if -Wall is used. - IF (NOT WIN32) - ADD_DEFINITIONS (-Wall) - ENDIF (NOT WIN32) -ELSE (CMAKE_BUILD_TYPE MATCHES Debug) - ADD_DEFINITIONS (-DNDEBUG) - OPTION (HDF5_ENABLE_TRACE "Enable API tracing capability" OFF) - IF (HDF5_ENABLE_TRACE) - ADD_DEFINITIONS (-DH5_DEBUG_API ) - ENDIF (HDF5_ENABLE_TRACE) -ENDIF (CMAKE_BUILD_TYPE MATCHES Debug) + if (NOT WIN32) + add_definitions (-Wall) + endif (NOT WIN32) +else (CMAKE_BUILD_TYPE MATCHES Debug) + add_definitions (-DNDEBUG) + option (HDF5_ENABLE_TRACE "Enable API tracing capability" OFF) + if (HDF5_ENABLE_TRACE) + add_definitions (-DH5_DEBUG_API ) + endif (HDF5_ENABLE_TRACE) +endif (CMAKE_BUILD_TYPE MATCHES Debug) #----------------------------------------------------------------------------- # Compiler specific flags : Shouldn't there be compiler tests for these #----------------------------------------------------------------------------- -IF (CMAKE_COMPILER_IS_GNUCC) - IF (CMAKE_BUILD_TYPE MATCHES Debug) - SET (CMAKE_C_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_C_FLAGS} -std=c99 -finline-functions -fno-common") - ELSE (CMAKE_BUILD_TYPE MATCHES Debug) - SET (CMAKE_C_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_C_FLAGS} -std=c99 -fomit-frame-pointer -finline-functions -fno-common") - ENDIF (CMAKE_BUILD_TYPE MATCHES Debug) -ENDIF (CMAKE_COMPILER_IS_GNUCC) -IF (CMAKE_COMPILER_IS_GNUCXX) - IF (CMAKE_BUILD_TYPE MATCHES Debug) - SET (CMAKE_CXX_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_CXX_FLAGS} -finline-functions -fno-common") - ELSE (CMAKE_BUILD_TYPE MATCHES Debug) - SET (CMAKE_CXX_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_CXX_FLAGS} -fomit-frame-pointer -finline-functions -fno-common") - ENDIF (CMAKE_BUILD_TYPE MATCHES Debug) -ENDIF (CMAKE_COMPILER_IS_GNUCXX) +if (CMAKE_COMPILER_IS_GNUCC) + if (CMAKE_BUILD_TYPE MATCHES Debug) + set (CMAKE_C_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_C_FLAGS} -std=c99 -finline-functions -fno-common") + else (CMAKE_BUILD_TYPE MATCHES Debug) + set (CMAKE_C_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_C_FLAGS} -std=c99 -fomit-frame-pointer -finline-functions -fno-common") + endif (CMAKE_BUILD_TYPE MATCHES Debug) +endif (CMAKE_COMPILER_IS_GNUCC) +if (CMAKE_COMPILER_IS_GNUCXX) + if (CMAKE_BUILD_TYPE MATCHES Debug) + set (CMAKE_CXX_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_CXX_FLAGS} -finline-functions -fno-common") + else (CMAKE_BUILD_TYPE MATCHES Debug) + set (CMAKE_CXX_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_CXX_FLAGS} -fomit-frame-pointer -finline-functions -fno-common") + endif (CMAKE_BUILD_TYPE MATCHES Debug) +endif (CMAKE_COMPILER_IS_GNUCXX) #----------------------------------------------------------------------------- # Option to embed library info into executables #----------------------------------------------------------------------------- -OPTION (HDF5_ENABLE_EMBEDDED_LIBINFO "embed library info into executables" ON) -IF (HDF5_ENABLE_EMBEDDED_LIBINFO) - SET (H5_HAVE_EMBEDDED_LIBINFO 1) -ENDIF (HDF5_ENABLE_EMBEDDED_LIBINFO) +option (HDF5_ENABLE_EMBEDDED_LIBINFO "embed library info into executables" ON) +if (HDF5_ENABLE_EMBEDDED_LIBINFO) + set (H5_HAVE_EMBEDDED_LIBINFO 1) +endif (HDF5_ENABLE_EMBEDDED_LIBINFO) #----------------------------------------------------------------------------- # Option to allow the user to disable compiler warnings #----------------------------------------------------------------------------- -OPTION (HDF5_DISABLE_COMPILER_WARNINGS "Disable compiler warnings" OFF) -IF (HDF5_DISABLE_COMPILER_WARNINGS) +option (HDF5_DISABLE_COMPILER_WARNINGS "Disable compiler warnings" OFF) +if (HDF5_DISABLE_COMPILER_WARNINGS) # MSVC uses /w to suppress warnings. It also complains if another # warning level is given, so remove it. - IF (MSVC) - SET (HDF5_WARNINGS_BLOCKED 1) - STRING (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") - SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /w") - STRING (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /w") - ENDIF (MSVC) - IF (WIN32 AND NOT CYGWIN) - ADD_DEFINITIONS (-D_CRT_SECURE_NO_WARNINGS) - ENDIF (WIN32 AND NOT CYGWIN) + if (MSVC) + set (HDF5_WARNINGS_BLOCKED 1) + string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /w") + string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /w") + endif (MSVC) + if (WIN32 AND NOT CYGWIN) + add_definitions (-D_CRT_SECURE_NO_WARNINGS) + endif (WIN32 AND NOT CYGWIN) # Borland uses -w- to suppress warnings. - IF (BORLAND) - SET (HDF5_WARNINGS_BLOCKED 1) - SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -w-") - ENDIF (BORLAND) + if (BORLAND) + set (HDF5_WARNINGS_BLOCKED 1) + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -w-") + endif (BORLAND) # Most compilers use -w to suppress warnings. - IF (NOT HDF5_WARNINGS_BLOCKED) - SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -w") - SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -w") - ENDIF (NOT HDF5_WARNINGS_BLOCKED) -ENDIF (HDF5_DISABLE_COMPILER_WARNINGS) + if (NOT HDF5_WARNINGS_BLOCKED) + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -w") + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -w") + endif (NOT HDF5_WARNINGS_BLOCKED) +endif (HDF5_DISABLE_COMPILER_WARNINGS) #----------------------------------------------------------------------------- # CDash is configured to only allow 3000 warnings, so # break into groups (from the config/gnu-flags file) #----------------------------------------------------------------------------- -IF (NOT MSVC) - IF (NOT ${CMAKE_SYSTEM_NAME} MATCHES "SunOS") - SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wextra -Wundef -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wcast-align -Wwrite-strings -Wconversion -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wnested-externs -Winline") - ELSE (NOT ${CMAKE_SYSTEM_NAME} MATCHES "SunOS") - SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -erroff=%none -DBSD_COMP") - ENDIF (NOT ${CMAKE_SYSTEM_NAME} MATCHES "SunOS") +if (NOT MSVC) + if (NOT ${CMAKE_SYSTEM_NAME} MATCHES "SunOS") + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wextra -Wundef -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wcast-align -Wwrite-strings -Wconversion -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wnested-externs -Winline") + else (NOT ${CMAKE_SYSTEM_NAME} MATCHES "SunOS") + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -erroff=%none -DBSD_COMP") + endif (NOT ${CMAKE_SYSTEM_NAME} MATCHES "SunOS") # Append warning flags # Don't use the '-Wtraditional' flag, we're way past having K&R C code - # SET (H5_CFLAGS "${H5_CFLAGS} -Wtraditional") + # set (H5_CFLAGS "${H5_CFLAGS} -Wtraditional") # Don't use the '-Wtraditional-conversion' flag, there's too many warnings # from GCC's assert macro - # SET (H5_CFLAGS "${H5_CFLAGS} -Wtraditional-conversion") + # set (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) - #SET (H5_CFLAGS "${H5_CFLAGS} -Wfloat-equal -Wmissing-format-attribute -Wpadded") - SET (H5_CFLAGS1 "${H5_CFLAGS1} -Wfloat-equal -Wmissing-format-attribute") + #set (H5_CFLAGS "${H5_CFLAGS} -Wfloat-equal -Wmissing-format-attribute -Wpadded") + set (H5_CFLAGS1 "${H5_CFLAGS1} -Wfloat-equal -Wmissing-format-attribute") # Append warning flags from gcc-3.2* case - SET (H5_CFLAGS1 "${H5_CFLAGS1} -Wmissing-noreturn -Wpacked -Wdisabled-optimization") + set (H5_CFLAGS1 "${H5_CFLAGS1} -Wmissing-noreturn -Wpacked -Wdisabled-optimization") # Enable more format checking flags, beyond the basic -Wformat included # in -Wall - SET (H5_CFLAGS1 "${H5_CFLAGS1} -Wformat=2") + set (H5_CFLAGS1 "${H5_CFLAGS1} -Wformat=2") # The "unreachable code" warning appears to be reliable now... # (this warning was removed in gcc 4.5+) - #SET (H5_CFLAGS "${H5_CFLAGS} -Wunreachable-code") + #set (H5_CFLAGS "${H5_CFLAGS} -Wunreachable-code") # Append warning flags from gcc-3.3* case - SET (H5_CFLAGS1 "${H5_CFLAGS1} -Wendif-labels") + set (H5_CFLAGS1 "${H5_CFLAGS1} -Wendif-labels") # Append warning flags from gcc-3.4* case - SET (H5_CFLAGS2 "${H5_CFLAGS2} -Wdeclaration-after-statement -Wold-style-definition -Winvalid-pch") + set (H5_CFLAGS2 "${H5_CFLAGS2} -Wdeclaration-after-statement -Wold-style-definition -Winvalid-pch") # Append more extra warning flags that only gcc4.0+ know about - SET (H5_CFLAGS2 "${H5_CFLAGS2} -Wvariadic-macros -Winit-self -Wmissing-include-dirs -Wswitch-default -Wswitch-enum -Wunused-macros") + set (H5_CFLAGS2 "${H5_CFLAGS2} -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 - SET (H5_CFLAGS3 "${H5_CFLAGS3} -Wunsafe-loop-optimizations -Wc++-compat") + set (H5_CFLAGS3 "${H5_CFLAGS3} -Wunsafe-loop-optimizations -Wc++-compat") # Append more extra warning flags that only gcc 4.2+ know about - SET (H5_CFLAGS3 "${H5_CFLAGS3} -Wstrict-overflow") + set (H5_CFLAGS3 "${H5_CFLAGS3} -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 - SET (H5_CFLAGS3 "${H5_CFLAGS3} -Wlogical-op -Wlarger-than=2048 -Wvla") + set (H5_CFLAGS3 "${H5_CFLAGS3} -Wlogical-op -Wlarger-than=2048 -Wvla") # Append more extra warning flags that only gcc 4.4+ know about - SET (H5_CFLAGS4 "${H5_CFLAGS4} -Wsync-nand -Wframe-larger-than=16384 -Wpacked-bitfield-compat") + set (H5_CFLAGS4 "${H5_CFLAGS4} -Wsync-nand -Wframe-larger-than=16384 -Wpacked-bitfield-compat") # Append more extra warning flags that only gcc 4.5+ know about - SET (H5_CFLAGS4 "${H5_CFLAGS4} -Wstrict-overflow=5 -Wjump-misses-init -Wunsuffixed-float-constants") + set (H5_CFLAGS4 "${H5_CFLAGS4} -Wstrict-overflow=5 -Wjump-misses-init -Wunsuffixed-float-constants") # Append more extra warning flags that only gcc 4.6+ know about - SET (H5_CFLAGS5 "${H5_CFLAGS5} -Wdouble-promotion -Wsuggest-attribute=const -Wtrampolines") + set (H5_CFLAGS5 "${H5_CFLAGS5} -Wdouble-promotion -Wsuggest-attribute=const -Wtrampolines") # Append more extra warning flags that only gcc 4.7+ know about - SET (H5_CFLAGS5 "${H5_CFLAGS5} -Wstack-usage=8192 -Wvector-operation-performance -Wsuggest-attribute=pure -Wsuggest-attribute=noreturn") -ENDIF (NOT MSVC) + set (H5_CFLAGS5 "${H5_CFLAGS5} -Wstack-usage=8192 -Wvector-operation-performance -Wsuggest-attribute=pure -Wsuggest-attribute=noreturn") +endif (NOT MSVC) #----------------------------------------------------------------------------- # Option to allow the user to enable all warnings #----------------------------------------------------------------------------- -OPTION (HDF5_ENABLE_ALL_WARNINGS "Enable all warnings" OFF) -IF (HDF5_ENABLE_ALL_WARNINGS) - IF (MSVC) - STRING (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") - SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /Wall") - STRING (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Wall") - ELSE (MSVC) - SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -pedantic ${H5_CFLAGS1} ${H5_CFLAGS2} ${H5_CFLAGS3} ${H5_CFLAGS4}") - ENDIF (MSVC) -ENDIF (HDF5_ENABLE_ALL_WARNINGS) +option (HDF5_ENABLE_ALL_WARNINGS "Enable all warnings" OFF) +if (HDF5_ENABLE_ALL_WARNINGS) + if (MSVC) + string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /Wall") + string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Wall") + else (MSVC) + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -pedantic ${H5_CFLAGS1} ${H5_CFLAGS2} ${H5_CFLAGS3} ${H5_CFLAGS4}") + endif (MSVC) +endif (HDF5_ENABLE_ALL_WARNINGS) #----------------------------------------------------------------------------- # Option to allow the user to enable warnings by groups #----------------------------------------------------------------------------- -OPTION (HDF5_ENABLE_GROUPZERO_WARNINGS "Enable group zero warnings" OFF) -IF (HDF5_ENABLE_GROUPZERO_WARNINGS) - IF (MSVC) - STRING (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") - SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W1") - STRING (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W1") - ELSE (MSVC) - SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -pedantic") - ENDIF (MSVC) -ENDIF (HDF5_ENABLE_GROUPZERO_WARNINGS) +option (HDF5_ENABLE_GROUPZERO_WARNINGS "Enable group zero warnings" OFF) +if (HDF5_ENABLE_GROUPZERO_WARNINGS) + if (MSVC) + string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W1") + string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W1") + else (MSVC) + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -pedantic") + endif (MSVC) +endif (HDF5_ENABLE_GROUPZERO_WARNINGS) #----------------------------------------------------------------------------- # Option to allow the user to enable warnings by groups #----------------------------------------------------------------------------- -OPTION (HDF5_ENABLE_GROUPONE_WARNINGS "Enable group one warnings" OFF) -IF (HDF5_ENABLE_GROUPONE_WARNINGS) - IF (MSVC) - STRING (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") - SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W2") - STRING (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W2") - ELSE (MSVC) - SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${H5_CFLAGS1}") - ENDIF (MSVC) -ENDIF (HDF5_ENABLE_GROUPONE_WARNINGS) +option (HDF5_ENABLE_GROUPONE_WARNINGS "Enable group one warnings" OFF) +if (HDF5_ENABLE_GROUPONE_WARNINGS) + if (MSVC) + string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W2") + string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W2") + else (MSVC) + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${H5_CFLAGS1}") + endif (MSVC) +endif (HDF5_ENABLE_GROUPONE_WARNINGS) #----------------------------------------------------------------------------- # Option to allow the user to enable warnings by groups #----------------------------------------------------------------------------- -OPTION (HDF5_ENABLE_GROUPTWO_WARNINGS "Enable group two warnings" OFF) -IF (HDF5_ENABLE_GROUPTWO_WARNINGS) - IF (MSVC) - STRING (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") - SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W3") - STRING (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W3") - ELSE (MSVC) - SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${H5_CFLAGS2}") - ENDIF (MSVC) -ENDIF (HDF5_ENABLE_GROUPTWO_WARNINGS) +option (HDF5_ENABLE_GROUPTWO_WARNINGS "Enable group two warnings" OFF) +if (HDF5_ENABLE_GROUPTWO_WARNINGS) + if (MSVC) + string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W3") + string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W3") + else (MSVC) + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${H5_CFLAGS2}") + endif (MSVC) +endif (HDF5_ENABLE_GROUPTWO_WARNINGS) #----------------------------------------------------------------------------- # Option to allow the user to enable warnings by groups #----------------------------------------------------------------------------- -OPTION (HDF5_ENABLE_GROUPTHREE_WARNINGS "Enable group three warnings" OFF) -IF (HDF5_ENABLE_GROUPTHREE_WARNINGS) - IF (MSVC) - STRING (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") - SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W4") - STRING (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4") - ELSE (MSVC) - SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${H5_CFLAGS3}") - ENDIF (MSVC) -ENDIF (HDF5_ENABLE_GROUPTHREE_WARNINGS) +option (HDF5_ENABLE_GROUPTHREE_WARNINGS "Enable group three warnings" OFF) +if (HDF5_ENABLE_GROUPTHREE_WARNINGS) + if (MSVC) + string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W4") + string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4") + else (MSVC) + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${H5_CFLAGS3}") + endif (MSVC) +endif (HDF5_ENABLE_GROUPTHREE_WARNINGS) #----------------------------------------------------------------------------- # Option to allow the user to enable warnings by groups #----------------------------------------------------------------------------- -OPTION (HDF5_ENABLE_GROUPFOUR_WARNINGS "Enable group four warnings" OFF) -IF (HDF5_ENABLE_GROUPFOUR_WARNINGS) - IF (NOT MSVC) - SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${H5_CFLAGS4}") - ENDIF (NOT MSVC) -ENDIF (HDF5_ENABLE_GROUPFOUR_WARNINGS) +option (HDF5_ENABLE_GROUPFOUR_WARNINGS "Enable group four warnings" OFF) +if (HDF5_ENABLE_GROUPFOUR_WARNINGS) + if (NOT MSVC) + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${H5_CFLAGS4}") + endif (NOT MSVC) +endif (HDF5_ENABLE_GROUPFOUR_WARNINGS) #----------------------------------------------------------------------------- # Option to allow the user to enable warnings by groups #----------------------------------------------------------------------------- -OPTION (HDF5_ENABLE_GROUPFIVE_WARNINGS "Enable group five warnings" OFF) -IF (HDF5_ENABLE_GROUPFIVE_WARNINGS) - IF (NOT MSVC) - SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${H5_CFLAGS5}") - ENDIF (NOT MSVC) -ENDIF (HDF5_ENABLE_GROUPFIVE_WARNINGS) +option (HDF5_ENABLE_GROUPFIVE_WARNINGS "Enable group five warnings" OFF) +if (HDF5_ENABLE_GROUPFIVE_WARNINGS) + if (NOT MSVC) + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${H5_CFLAGS5}") + endif (NOT MSVC) +endif (HDF5_ENABLE_GROUPFIVE_WARNINGS) #----------------------------------------------------------------------------- # This is in here to help some of the GCC based IDES like Eclipse # and code blocks parse the compiler errors and warnings better. #----------------------------------------------------------------------------- -IF (CMAKE_COMPILER_IS_GNUCC) - SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fmessage-length=0") -ENDIF (CMAKE_COMPILER_IS_GNUCC) -IF (CMAKE_COMPILER_IS_GNUCXX) - SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fmessage-length=0") -ENDIF (CMAKE_COMPILER_IS_GNUCXX) +if (CMAKE_COMPILER_IS_GNUCC) + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fmessage-length=0") +endif (CMAKE_COMPILER_IS_GNUCC) +if (CMAKE_COMPILER_IS_GNUCXX) + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fmessage-length=0") +endif (CMAKE_COMPILER_IS_GNUCXX) #----------------------------------------------------------------------------- # All libs/tests/examples need the main include directories @@ -658,159 +648,159 @@ INCLUDE_DIRECTORIES (${HDF5_BINARY_DIR} ${HDF5_SRC_DIR} ${CMAKE_RUNTIME_OUTPUT_D #----------------------------------------------------------------------------- # Option to Enable MPI Parallel #----------------------------------------------------------------------------- -SET (CMAKE_MODULE_PATH ${HDF5_RESOURCES_DIR} ${CMAKE_MODULE_PATH}) -OPTION (HDF5_ENABLE_PARALLEL "Enable parallel build (requires MPI)" OFF) -IF (HDF5_ENABLE_PARALLEL) - INCLUDE (FindMPI) +set (CMAKE_MODULE_PATH ${HDF5_RESOURCES_DIR} ${CMAKE_MODULE_PATH}) +option (HDF5_ENABLE_PARALLEL "Enable parallel build (requires MPI)" OFF) +if (HDF5_ENABLE_PARALLEL) + include (FindMPI) INCLUDE_DIRECTORIES (${MPI_C_INCLUDE_PATH}) - IF (MPI_C_FOUND) - SET (H5_HAVE_PARALLEL 1) + if (MPI_C_FOUND) + set (H5_HAVE_PARALLEL 1) # MPI checks, only do these if MPI_C_FOUND is true, otherwise they always fail # and once set, they are cached as false and not regenerated - SET (CMAKE_REQUIRED_LIBRARIES "${MPI_C_LIBRARIES}" ) + set (CMAKE_REQUIRED_LIBRARIES "${MPI_C_LIBRARIES}" ) CHECK_FUNCTION_EXISTS (MPI_File_get_size H5_HAVE_MPI_GET_SIZE) - SET (H5_MPI_FILE_SET_SIZE_BIG 1) + set (H5_MPI_FILE_SET_SIZE_BIG 1) # 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) + else (MPI_C_FOUND) + message (STATUS "Parallel libraries not found") + endif (MPI_C_FOUND) +endif (HDF5_ENABLE_PARALLEL) # Parallel IO usage requires MPI to be Linked and Included -IF (H5_HAVE_PARALLEL) - SET (LINK_LIBS ${LINK_LIBS} ${MPI_C_LIBRARIES}) - IF (MPI_C_LINK_FLAGS) - SET (CMAKE_EXE_LINKER_FLAGS "${MPI_C_LINK_FLAGS} ${CMAKE_EXE_LINKER_FLAGS}") - ENDIF (MPI_C_LINK_FLAGS) -ENDIF (H5_HAVE_PARALLEL) +if (H5_HAVE_PARALLEL) + set (LINK_LIBS ${LINK_LIBS} ${MPI_C_LIBRARIES}) + if (MPI_C_LINK_FLAGS) + set (CMAKE_EXE_LINKER_FLAGS "${MPI_C_LINK_FLAGS} ${CMAKE_EXE_LINKER_FLAGS}") + endif (MPI_C_LINK_FLAGS) +endif (H5_HAVE_PARALLEL) -SET (DEFAULT_API_VERSION "v110") +set (DEFAULT_API_VERSION "v110") #----------------------------------------------------------------------------- # Option to use 1.6.x API #----------------------------------------------------------------------------- -OPTION (HDF5_USE_16_API_DEFAULT "Use the HDF5 1.6.x API by default" OFF) -SET (H5_USE_16_API_DEFAULT 0) -IF (HDF5_USE_16_API_DEFAULT) - SET (H5_USE_16_API_DEFAULT 1) - SET (DEFAULT_API_VERSION "v16") -ENDIF (HDF5_USE_16_API_DEFAULT) +option (HDF5_USE_16_API_DEFAULT "Use the HDF5 1.6.x API by default" OFF) +set (H5_USE_16_API_DEFAULT 0) +if (HDF5_USE_16_API_DEFAULT) + set (H5_USE_16_API_DEFAULT 1) + set (DEFAULT_API_VERSION "v16") +endif (HDF5_USE_16_API_DEFAULT) #----------------------------------------------------------------------------- # Option to use 1.8.x API #----------------------------------------------------------------------------- -OPTION (HDF5_USE_18_API_DEFAULT "Use the HDF5 1.8.x API by default" OFF) -SET (H5_USE_18_API_DEFAULT 0) -IF (HDF5_USE_18_API_DEFAULT) - SET (H5_USE_18_API_DEFAULT 1) - SET (DEFAULT_API_VERSION "v18") -ENDIF (HDF5_USE_18_API_DEFAULT) +option (HDF5_USE_18_API_DEFAULT "Use the HDF5 1.8.x API by default" OFF) +set (H5_USE_18_API_DEFAULT 0) +if (HDF5_USE_18_API_DEFAULT) + set (H5_USE_18_API_DEFAULT 1) + set (DEFAULT_API_VERSION "v18") +endif (HDF5_USE_18_API_DEFAULT) #----------------------------------------------------------------------------- # Include user macros #----------------------------------------------------------------------------- -INCLUDE (UserMacros.cmake) +include (UserMacros.cmake) -INCLUDE (CMakeFilters.cmake) +include (CMakeFilters.cmake) #----------------------------------------------------------------------------- # Option for external libraries on windows #----------------------------------------------------------------------------- -OPTION (HDF5_PACKAGE_EXTLIBS "CPACK - include external libraries" OFF) -IF (NOT HDF5_EXTERNALLY_CONFIGURED) - IF (HDF5_PACKAGE_EXTLIBS) - SET (HDF5_NO_PACKAGES OFF CACHE BOOL "CPACK - Disable packaging" FORCE) - IF (HDF5_ENABLE_Z_LIB_SUPPORT AND ZLIB_FOUND) +option (HDF5_PACKAGE_EXTLIBS "CPACK - include external libraries" OFF) +if (NOT HDF5_EXTERNALLY_CONFIGURED) + if (HDF5_PACKAGE_EXTLIBS) + set (HDF5_NO_PACKAGES OFF CACHE BOOL "CPACK - Disable packaging" FORCE) + if (HDF5_ENABLE_Z_LIB_SUPPORT AND ZLIB_FOUND) PACKAGE_ZLIB_LIBRARY (${HDF5_ALLOW_EXTERNAL_SUPPORT}) - ENDIF (HDF5_ENABLE_Z_LIB_SUPPORT AND ZLIB_FOUND) + endif (HDF5_ENABLE_Z_LIB_SUPPORT AND ZLIB_FOUND) - IF (HDF5_ENABLE_SZIP_SUPPORT AND SZIP_FOUND) + if (HDF5_ENABLE_SZIP_SUPPORT AND SZIP_FOUND) PACKAGE_SZIP_LIBRARY (${HDF5_ALLOW_EXTERNAL_SUPPORT}) - ENDIF (HDF5_ENABLE_SZIP_SUPPORT AND SZIP_FOUND) - ENDIF (HDF5_PACKAGE_EXTLIBS) -ENDIF (NOT HDF5_EXTERNALLY_CONFIGURED) + endif (HDF5_ENABLE_SZIP_SUPPORT AND SZIP_FOUND) + endif (HDF5_PACKAGE_EXTLIBS) +endif (NOT HDF5_EXTERNALLY_CONFIGURED) #----------------------------------------------------------------------------- # Option to use threadsafe # Note: Currently CMake only allows configuring of threadsafe on WINDOWS. #----------------------------------------------------------------------------- -IF (WIN32 AND NOT CYGWIN) - OPTION (HDF5_ENABLE_THREADSAFE "Enable Threadsafety" OFF) - IF (HDF5_ENABLE_THREADSAFE) +if (WIN32 AND NOT CYGWIN) + option (HDF5_ENABLE_THREADSAFE "Enable Threadsafety" OFF) + if (HDF5_ENABLE_THREADSAFE) # check for unsupported options - IF (HDF5_ENABLE_PARALLEL) - MESSAGE (FATAL_ERROR " **** Parallel and Threadsafe options are mutually exclusive **** ") - ENDIF (HDF5_ENABLE_PARALLEL) - SET (H5_HAVE_THREADSAFE 1) - IF (H5_HAVE_IOEO) - MESSAGE (STATUS " **** Windows Threads only available in WINVER>=0x600 (Vista or Windows 7) **** ") - SET (H5_HAVE_WIN_THREADS 1) - ELSE (H5_HAVE_IOEO) - IF (NOT H5_HAVE_PTHREAD_H) - SET (H5_HAVE_THREADSAFE 0) - MESSAGE (FATAL_ERROR " **** Threadsafe option requires thread library **** ") - ENDIF (NOT H5_HAVE_PTHREAD_H) - ENDIF (H5_HAVE_IOEO) - ENDIF (HDF5_ENABLE_THREADSAFE) -ENDIF (WIN32 AND NOT CYGWIN) + if (HDF5_ENABLE_PARALLEL) + message (FATAL_ERROR " **** Parallel and Threadsafe options are mutually exclusive **** ") + endif (HDF5_ENABLE_PARALLEL) + set (H5_HAVE_THREADSAFE 1) + if (H5_HAVE_IOEO) + message (STATUS " **** Windows Threads only available in WINVER>=0x600 (Vista or Windows 7) **** ") + set (H5_HAVE_WIN_THREADS 1) + else (H5_HAVE_IOEO) + if (NOT H5_HAVE_PTHREAD_H) + set (H5_HAVE_THREADSAFE 0) + message (FATAL_ERROR " **** Threadsafe option requires thread library **** ") + endif (NOT H5_HAVE_PTHREAD_H) + endif (H5_HAVE_IOEO) + endif (HDF5_ENABLE_THREADSAFE) +endif (WIN32 AND NOT CYGWIN) # ----------------------------------------------------------------------- # wrapper script variables # -#SET (CFLAGS "${C_DEFINES}") -#SET (CXXFLAGS "${CXX_DEFINES}") +#set (CFLAGS "${C_DEFINES}") +#set (CXXFLAGS "${CXX_DEFINES}") #----------------------------------------------------------------------------- # Add the HDF5 Library Target to the build #----------------------------------------------------------------------------- ADD_SUBDIRECTORY (${HDF5_SOURCE_DIR}/src ${PROJECT_BINARY_DIR}/src) -IF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") - IF (ZLIB_FOUND AND ZLIB_USE_EXTERNAL) +if (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") + if (ZLIB_FOUND AND ZLIB_USE_EXTERNAL) ADD_DEPENDENCIES (${HDF5_LIB_TARGET} ZLIB) - ENDIF (ZLIB_FOUND AND ZLIB_USE_EXTERNAL) - IF (SZIP_FOUND AND SZIP_USE_EXTERNAL) + endif (ZLIB_FOUND AND ZLIB_USE_EXTERNAL) + if (SZIP_FOUND AND SZIP_USE_EXTERNAL) ADD_DEPENDENCIES (${HDF5_LIB_TARGET} SZIP) - ENDIF (SZIP_FOUND AND SZIP_USE_EXTERNAL) -ENDIF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") + endif (SZIP_FOUND AND SZIP_USE_EXTERNAL) +endif (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") #----------------------------------------------------------------------------- # Dashboard and Testing Settings #----------------------------------------------------------------------------- -OPTION (BUILD_TESTING "Build HDF5 Unit Testing" OFF) -IF (BUILD_TESTING) - SET (DART_TESTING_TIMEOUT 1200 +option (BUILD_TESTING "Build HDF5 Unit Testing" OFF) +if (BUILD_TESTING) + set (DART_TESTING_TIMEOUT 1200 CACHE INTEGER "Timeout in seconds for each test (default 1200=20minutes)" ) ENABLE_TESTING () - INCLUDE (CTest) - IF (NOT HDF5_EXTERNALLY_CONFIGURED) - IF (EXISTS "${HDF5_SOURCE_DIR}/test" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/test") + include (CTest) + if (NOT HDF5_EXTERNALLY_CONFIGURED) + if (EXISTS "${HDF5_SOURCE_DIR}/test" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/test") ADD_SUBDIRECTORY (${HDF5_SOURCE_DIR}/tools/lib ${PROJECT_BINARY_DIR}/tools/lib) ADD_SUBDIRECTORY (${HDF5_SOURCE_DIR}/test ${PROJECT_BINARY_DIR}/test) - ENDIF (EXISTS "${HDF5_SOURCE_DIR}/test" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/test") - IF (EXISTS "${HDF5_SOURCE_DIR}/perform" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/perform") + endif (EXISTS "${HDF5_SOURCE_DIR}/test" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/test") + if (EXISTS "${HDF5_SOURCE_DIR}/perform" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/perform") ADD_SUBDIRECTORY (${HDF5_SOURCE_DIR}/perform ${PROJECT_BINARY_DIR}/perform) ENDIF(EXISTS "${HDF5_SOURCE_DIR}/perform" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/perform") - IF (H5_HAVE_PARALLEL) - IF (EXISTS "${HDF5_SOURCE_DIR}/testpar" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/testpar") + if (H5_HAVE_PARALLEL) + if (EXISTS "${HDF5_SOURCE_DIR}/testpar" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/testpar") ADD_SUBDIRECTORY (${HDF5_SOURCE_DIR}/testpar ${PROJECT_BINARY_DIR}/testpar) - ENDIF (EXISTS "${HDF5_SOURCE_DIR}/testpar" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/testpar") - ENDIF (H5_HAVE_PARALLEL) - ENDIF (NOT HDF5_EXTERNALLY_CONFIGURED) + endif (EXISTS "${HDF5_SOURCE_DIR}/testpar" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/testpar") + endif (H5_HAVE_PARALLEL) + endif (NOT HDF5_EXTERNALLY_CONFIGURED) - OPTION (HDF5_TEST_VFD "Execute tests with different VFDs" OFF) + option (HDF5_TEST_VFD "Execute tests with different VFDs" OFF) MARK_AS_ADVANCED (HDF5_TEST_VFD) - IF (HDF5_TEST_VFD) - OPTION (HDF5_TEST_FHEAP_VFD "Execute tests with different VFDs" ON) + if (HDF5_TEST_VFD) + option (HDF5_TEST_FHEAP_VFD "Execute tests with different VFDs" ON) MARK_AS_ADVANCED (HDF5_TEST_FHEAP_VFD) - ENDIF (HDF5_TEST_VFD) + endif (HDF5_TEST_VFD) - INCLUDE (${HDF5_SOURCE_DIR}/CTestConfig.cmake) + include (${HDF5_SOURCE_DIR}/CTestConfig.cmake) CONFIGURE_FILE (${HDF5_RESOURCES_DIR}/CTestCustom.cmake ${HDF5_BINARY_DIR}/CTestCustom.ctest @ONLY) -ENDIF (BUILD_TESTING) +endif (BUILD_TESTING) #----------------------------------------------------------------------------- # Option to build Fortran bindings/tests/examples @@ -818,88 +808,88 @@ ENDIF (BUILD_TESTING) # so that fortran name mangling is detected before writing H5pubconf.h #----------------------------------------------------------------------------- # Set default name mangling : overridden by Fortran detection in fortran dir -SET (H5_FC_FUNC "H5_FC_FUNC(name,NAME) name ## _") -SET (H5_FC_FUNC_ "H5_FC_FUNC_(name,NAME) name ## _") -IF (EXISTS "${HDF5_SOURCE_DIR}/fortran" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/fortran") - OPTION (HDF5_BUILD_FORTRAN "Build FORTRAN support" OFF) - IF (HDF5_BUILD_FORTRAN) - IF (BUILD_SHARED_LIBS AND APPLE) - MESSAGE (FATAL_ERROR " **** Shared FORTRAN libraries are unsupported **** ") - ENDIF (BUILD_SHARED_LIBS AND APPLE) - OPTION (HDF5_ENABLE_F2003 "Enable FORTRAN 2003 Standard" OFF) - INCLUDE (${HDF5_RESOURCES_DIR}/HDF5UseFortran.cmake) - IF (HDF5_ENABLE_F2003) - IF (NOT FORTRAN_HAVE_ISO_C_BINDING) - SET (HDF5_ENABLE_F2003 OFF) - ENDIF (NOT FORTRAN_HAVE_ISO_C_BINDING) - ENDIF (HDF5_ENABLE_F2003) +set (H5_FC_FUNC "H5_FC_FUNC(name,NAME) name ## _") +set (H5_FC_FUNC_ "H5_FC_FUNC_(name,NAME) name ## _") +if (EXISTS "${HDF5_SOURCE_DIR}/fortran" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/fortran") + option (HDF5_BUILD_FORTRAN "Build FORTRAN support" OFF) + if (HDF5_BUILD_FORTRAN) + if (BUILD_SHARED_LIBS AND APPLE) + message (FATAL_ERROR " **** Shared FORTRAN libraries are unsupported **** ") + endif (BUILD_SHARED_LIBS AND APPLE) + option (HDF5_ENABLE_F2003 "Enable FORTRAN 2003 Standard" OFF) + include (${HDF5_RESOURCES_DIR}/HDF5UseFortran.cmake) + if (HDF5_ENABLE_F2003) + if (NOT FORTRAN_HAVE_ISO_C_BINDING) + set (HDF5_ENABLE_F2003 OFF) + endif (NOT FORTRAN_HAVE_ISO_C_BINDING) + endif (HDF5_ENABLE_F2003) # ----------------------------------------------------------------------- # wrapper script variables # -# SET (FCFLAGS "${Fortran_DEFINES}") +# set (FCFLAGS "${Fortran_DEFINES}") ADD_SUBDIRECTORY (${HDF5_SOURCE_DIR}/fortran ${PROJECT_BINARY_DIR}/fortran) - IF (HDF5_BUILD_HL_LIB) - IF (EXISTS "${HDF5_SOURCE_DIR}/hl/fortran" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/hl/fortran") + if (HDF5_BUILD_HL_LIB) + if (EXISTS "${HDF5_SOURCE_DIR}/hl/fortran" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/hl/fortran") #-- Build the High Level Fortran source codes ADD_SUBDIRECTORY (${HDF5_SOURCE_DIR}/hl/fortran ${PROJECT_BINARY_DIR}/hl/fortran) - ENDIF (EXISTS "${HDF5_SOURCE_DIR}/hl/fortran" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/hl/fortran") - ENDIF (HDF5_BUILD_HL_LIB) - ENDIF (HDF5_BUILD_FORTRAN) -ENDIF (EXISTS "${HDF5_SOURCE_DIR}/fortran" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/fortran") + endif (EXISTS "${HDF5_SOURCE_DIR}/hl/fortran" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/hl/fortran") + endif (HDF5_BUILD_HL_LIB) + endif (HDF5_BUILD_FORTRAN) +endif (EXISTS "${HDF5_SOURCE_DIR}/fortran" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/fortran") #----------------------------------------------------------------------------- # Option to build examples #----------------------------------------------------------------------------- -IF (EXISTS "${HDF5_SOURCE_DIR}/examples" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/examples") - OPTION (HDF5_BUILD_EXAMPLES "Build HDF5 Library Examples" OFF) - IF (HDF5_BUILD_EXAMPLES) +if (EXISTS "${HDF5_SOURCE_DIR}/examples" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/examples") + option (HDF5_BUILD_EXAMPLES "Build HDF5 Library Examples" OFF) + if (HDF5_BUILD_EXAMPLES) ADD_SUBDIRECTORY (${HDF5_SOURCE_DIR}/examples ${PROJECT_BINARY_DIR}/examples) - ENDIF (HDF5_BUILD_EXAMPLES) -ENDIF (EXISTS "${HDF5_SOURCE_DIR}/examples" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/examples") + endif (HDF5_BUILD_EXAMPLES) +endif (EXISTS "${HDF5_SOURCE_DIR}/examples" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/examples") #----------------------------------------------------------------------------- # Option to build HDF5 C++ Library #----------------------------------------------------------------------------- -IF (EXISTS "${HDF5_SOURCE_DIR}/c++" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/c++") - OPTION (HDF5_BUILD_CPP_LIB "Build HDF5 C++ Library" OFF) - IF (HDF5_BUILD_CPP_LIB) +if (EXISTS "${HDF5_SOURCE_DIR}/c++" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/c++") + option (HDF5_BUILD_CPP_LIB "Build HDF5 C++ Library" OFF) + if (HDF5_BUILD_CPP_LIB) # check for unsupported options - IF (HDF5_ENABLE_PARALLEL) - MESSAGE (FATAL_ERROR " **** Parallel and C++ options are mutually exclusive **** ") - ENDIF (HDF5_ENABLE_PARALLEL) - IF (CMAKE_NO_STD_NAMESPACE) - SET (H5_NO_STD 1) - ENDIF (CMAKE_NO_STD_NAMESPACE) + if (HDF5_ENABLE_PARALLEL) + message (FATAL_ERROR " **** Parallel and C++ options are mutually exclusive **** ") + endif (HDF5_ENABLE_PARALLEL) + if (CMAKE_NO_STD_NAMESPACE) + set (H5_NO_STD 1) + endif (CMAKE_NO_STD_NAMESPACE) ADD_SUBDIRECTORY (${HDF5_SOURCE_DIR}/c++ ${PROJECT_BINARY_DIR}/c++) - ENDIF (HDF5_BUILD_CPP_LIB) -ENDIF (EXISTS "${HDF5_SOURCE_DIR}/c++" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/c++") + endif (HDF5_BUILD_CPP_LIB) +endif (EXISTS "${HDF5_SOURCE_DIR}/c++" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/c++") #----------------------------------------------------------------------------- # Option to build HDF5 Tools #----------------------------------------------------------------------------- -IF (EXISTS "${HDF5_SOURCE_DIR}/tools" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/tools") - OPTION (HDF5_BUILD_TOOLS "Build HDF5 Tools" OFF) - IF (HDF5_BUILD_TOOLS) +if (EXISTS "${HDF5_SOURCE_DIR}/tools" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/tools") + option (HDF5_BUILD_TOOLS "Build HDF5 Tools" OFF) + if (HDF5_BUILD_TOOLS) ADD_SUBDIRECTORY (${HDF5_SOURCE_DIR}/tools ${PROJECT_BINARY_DIR}/tools) - ENDIF (HDF5_BUILD_TOOLS) -ENDIF (EXISTS "${HDF5_SOURCE_DIR}/tools" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/tools") + endif (HDF5_BUILD_TOOLS) +endif (EXISTS "${HDF5_SOURCE_DIR}/tools" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/tools") #----------------------------------------------------------------------------- # Option to build High Level API's #----------------------------------------------------------------------------- -IF (EXISTS "${HDF5_SOURCE_DIR}/hl" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/hl") - OPTION (HDF5_BUILD_HL_LIB "Build HIGH Level HDF5 Library" OFF) - IF (HDF5_BUILD_HL_LIB) - SET (H5_INCLUDE_HL 1) +if (EXISTS "${HDF5_SOURCE_DIR}/hl" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/hl") + option (HDF5_BUILD_HL_LIB "Build HIGH Level HDF5 Library" OFF) + if (HDF5_BUILD_HL_LIB) + set (H5_INCLUDE_HL 1) ADD_SUBDIRECTORY (${HDF5_SOURCE_DIR}/hl ${PROJECT_BINARY_DIR}/hl) - ENDIF (HDF5_BUILD_HL_LIB) -ENDIF (EXISTS "${HDF5_SOURCE_DIR}/hl" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/hl") + endif (HDF5_BUILD_HL_LIB) +endif (EXISTS "${HDF5_SOURCE_DIR}/hl" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/hl") #----------------------------------------------------------------------------- # Generate the H5pubconf.h file containing user settings needed by compilation #----------------------------------------------------------------------------- CONFIGURE_FILE (${HDF5_RESOURCES_DIR}/H5pubconf.h.in ${HDF5_BINARY_DIR}/H5pubconf.h @ONLY) -INCLUDE (CMakeInstallation.cmake) +include (CMakeInstallation.cmake) diff --git a/CTestConfig.cmake b/CTestConfig.cmake index 92bd300..0e00427 100644 --- a/CTestConfig.cmake +++ b/CTestConfig.cmake @@ -4,28 +4,28 @@ ## # The following are required to uses Dart and the Cdash dashboard ## ENABLE_TESTING() ## INCLUDE(CTest) -SET (CTEST_PROJECT_NAME "HDF5") -SET (CTEST_NIGHTLY_START_TIME "18:00:00 CST") +set (CTEST_PROJECT_NAME "HDF5") +set (CTEST_NIGHTLY_START_TIME "18:00:00 CST") -SET (CTEST_DROP_METHOD "http") -IF (CDASH_LOCAL) - SET (CTEST_DROP_SITE "72.36.68.252") - SET (CTEST_DROP_LOCATION "/submit.php?project=HDF5Trunk") -ELSE (CDASH_LOCAL) - SET (CTEST_DROP_SITE "cdash.hdfgroup.uiuc.edu") - SET (CTEST_DROP_LOCATION "/submit.php?project=HDF5+Trunk") -ENDIF (CDASH_LOCAL) -SET (CTEST_DROP_SITE_CDASH TRUE) +set (CTEST_DROP_METHOD "http") +if (CDASH_LOCAL) + set (CTEST_DROP_SITE "72.36.68.252") + set (CTEST_DROP_LOCATION "/submit.php?project=HDF5Trunk") +else (CDASH_LOCAL) + set (CTEST_DROP_SITE "cdash.hdfgroup.uiuc.edu") + set (CTEST_DROP_LOCATION "/submit.php?project=HDF5+Trunk") +endif (CDASH_LOCAL) +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 (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 +set (CTEST_TEST_TIMEOUT 3600 CACHE STRING "Maximum time allowed before CTest will kill the test.") -SET (DART_TESTING_TIMEOUT 3600 CACHE STRING +set (DART_TESTING_TIMEOUT 3600 CACHE STRING "Maximum time allowed before CTest will kill the test." FORCE) SET(CTEST_SUBMIT_RETRY_DELAY 20 CACHE STRING diff --git a/UserMacros.cmake b/UserMacros.cmake index 4c680ed..65ea5d4 100644 --- a/UserMacros.cmake +++ b/UserMacros.cmake @@ -8,14 +8,14 @@ # Option to Build with User Defined Values #----------------------------------------------------------------------------- MACRO (MACRO_USER_DEFINED_LIBS) - SET (USER_DEFINED_VALUE "FALSE") + set (USER_DEFINED_VALUE "FALSE") ENDMACRO (MACRO_USER_DEFINED_LIBS) #------------------------------------------------------------------------------- -OPTION (BUILD_USER_DEFINED_LIBS "Build With User Defined Values" OFF) -IF (BUILD_USER_DEFINED_LIBS) +option (BUILD_USER_DEFINED_LIBS "Build With User Defined Values" OFF) +if (BUILD_USER_DEFINED_LIBS) MACRO_USER_DEFINED_LIBS () -ENDIF (BUILD_USER_DEFINED_LIBS) +endif (BUILD_USER_DEFINED_LIBS) #----------------------------------------------------------------------------- #------------------- E X A M P L E E N D ----------------------------------- #----------------------------------------------------------------------------- diff --git a/bin/cmakehdf5 b/bin/cmakehdf5 index e3ad541..1150994 100755 --- a/bin/cmakehdf5 +++ b/bin/cmakehdf5 @@ -286,8 +286,8 @@ set($ENV{LC_MESSAGES} "en_EN") #----------------------------------------------------------------------------- # Initialize the CTEST commands #------------------------------ -SET (CTEST_CMAKE_COMMAND "\"${CMAKE_COMMAND}\"") -SET (CTEST_CONFIGURE_COMMAND +set (CTEST_CMAKE_COMMAND "\"${CMAKE_COMMAND}\"") +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}\"") # Print summary information. diff --git a/c++/CMakeLists.txt b/c++/CMakeLists.txt index 50ea838..9b560a6 100644 --- a/c++/CMakeLists.txt +++ b/c++/CMakeLists.txt @@ -4,16 +4,16 @@ PROJECT (HDF5_CPP) #----------------------------------------------------------------------------- # Apply Definitions to compiler in this directory and below #----------------------------------------------------------------------------- -ADD_DEFINITIONS (${HDF5_EXTRA_C_FLAGS}) +add_definitions (${HDF5_EXTRA_C_FLAGS}) #----------------------------------------------------------------------------- # Shared/Static Libs #----------------------------------------------------------------------------- -IF (BUILD_SHARED_LIBS) - SET (CPP_BUILT_AS_DYNAMIC_LIB 1) -ELSE (BUILD_SHARED_LIBS) - SET (CPP_BUILT_AS_STATIC_LIB 1) -ENDIF (BUILD_SHARED_LIBS) +if (BUILD_SHARED_LIBS) + set (CPP_BUILT_AS_DYNAMIC_LIB 1) +else (BUILD_SHARED_LIBS) + set (CPP_BUILT_AS_STATIC_LIB 1) +endif (BUILD_SHARED_LIBS) #----------------------------------------------------------------------------- # Generate configure file @@ -31,23 +31,23 @@ INCLUDE_DIRECTORIES (${HDF5_BINARY_DIR}) #----------------------------------------------------------------------------- # Parallel/MPI, prevent spurious cpp/cxx warnings #----------------------------------------------------------------------------- -IF (H5_HAVE_PARALLEL) - ADD_DEFINITIONS ("-DMPICH_SKIP_MPICXX") - ADD_DEFINITIONS ("-DMPICH_IGNORE_CXX_SEEK") -ENDIF (H5_HAVE_PARALLEL) +if (H5_HAVE_PARALLEL) + add_definitions ("-DMPICH_SKIP_MPICXX") + add_definitions ("-DMPICH_IGNORE_CXX_SEEK") +endif (H5_HAVE_PARALLEL) ADD_SUBDIRECTORY (${HDF5_CPP_SOURCE_DIR}/src ${HDF5_CPP_BINARY_DIR}/src) #----------------------------------------------------------------------------- # Build the CPP Examples #----------------------------------------------------------------------------- -IF (HDF5_BUILD_EXAMPLES) +if (HDF5_BUILD_EXAMPLES) ADD_SUBDIRECTORY (${HDF5_CPP_SOURCE_DIR}/examples ${HDF5_CPP_BINARY_DIR}/examples) -ENDIF (HDF5_BUILD_EXAMPLES) +endif (HDF5_BUILD_EXAMPLES) #----------------------------------------------------------------------------- # Build the CPP unit tests #----------------------------------------------------------------------------- -IF (BUILD_TESTING) +if (BUILD_TESTING) ADD_SUBDIRECTORY (${HDF5_CPP_SOURCE_DIR}/test ${HDF5_CPP_BINARY_DIR}/test) -ENDIF (BUILD_TESTING) +endif (BUILD_TESTING) diff --git a/c++/examples/CMakeLists.txt b/c++/examples/CMakeLists.txt index c79f6c2..b6b1afa 100644 --- a/c++/examples/CMakeLists.txt +++ b/c++/examples/CMakeLists.txt @@ -10,7 +10,7 @@ PROJECT (HDF5_CPP_EXAMPLES) # Define examples #----------------------------------------------------------------------------- -SET (examples +set (examples create readdata writedata @@ -20,7 +20,7 @@ SET (examples h5group ) -SET (tutr_examples +set (tutr_examples h5tutr_cmprss h5tutr_crtdat h5tutr_crtatt @@ -32,22 +32,22 @@ SET (tutr_examples h5tutr_subset ) -FOREACH (example ${examples}) - ADD_EXECUTABLE (cpp_ex_${example} ${HDF5_CPP_EXAMPLES_SOURCE_DIR}/${example}.cpp) +foreach (example ${examples}) + add_executable (cpp_ex_${example} ${HDF5_CPP_EXAMPLES_SOURCE_DIR}/${example}.cpp) TARGET_NAMING (cpp_ex_${example} ${LIB_TYPE}) TARGET_C_PROPERTIES (cpp_ex_${example} " " " ") - TARGET_LINK_LIBRARIES (cpp_ex_${example} ${HDF5_CPP_LIB_TARGET} ${HDF5_LIB_TARGET}) - SET_TARGET_PROPERTIES (cpp_ex_${example} PROPERTIES FOLDER examples/cpp) -ENDFOREACH (example ${examples}) + target_link_libraries (cpp_ex_${example} ${HDF5_CPP_LIB_TARGET} ${HDF5_LIB_TARGET}) + set_target_properties (cpp_ex_${example} PROPERTIES FOLDER examples/cpp) +endforeach (example ${examples}) -FOREACH (example ${tutr_examples}) - ADD_EXECUTABLE (cpp_ex_${example} ${HDF5_CPP_EXAMPLES_SOURCE_DIR}/${example}.cpp) +foreach (example ${tutr_examples}) + add_executable (cpp_ex_${example} ${HDF5_CPP_EXAMPLES_SOURCE_DIR}/${example}.cpp) TARGET_NAMING (cpp_ex_${example} ${LIB_TYPE}) TARGET_C_PROPERTIES (cpp_ex_${example} " " " ") - TARGET_LINK_LIBRARIES (cpp_ex_${example} ${HDF5_CPP_LIB_TARGET} ${HDF5_LIB_TARGET}) - SET_TARGET_PROPERTIES (cpp_ex_${example} PROPERTIES FOLDER examples/cpp) -ENDFOREACH (example ${tutr_examples}) + target_link_libraries (cpp_ex_${example} ${HDF5_CPP_LIB_TARGET} ${HDF5_LIB_TARGET}) + set_target_properties (cpp_ex_${example} PROPERTIES FOLDER examples/cpp) +endforeach (example ${tutr_examples}) -IF (BUILD_TESTING) - INCLUDE (CMakeTests.cmake) -ENDIF (BUILD_TESTING) +if (BUILD_TESTING) + include (CMakeTests.cmake) +endif (BUILD_TESTING) diff --git a/c++/examples/CMakeTests.cmake b/c++/examples/CMakeTests.cmake index b39dcfe..5725f8e 100644 --- a/c++/examples/CMakeTests.cmake +++ b/c++/examples/CMakeTests.cmake @@ -15,18 +15,18 @@ SDSextendible.h5 Select.h5 ) - IF (NOT "${last_test}" STREQUAL "") + if (NOT "${last_test}" STREQUAL "") SET_TESTS_PROPERTIES (cpp_ex-clear-objects PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "cpp_ex-clear-objects") + endif (NOT "${last_test}" STREQUAL "") + set (last_test "cpp_ex-clear-objects") - FOREACH (example ${examples}) + foreach (example ${examples}) ADD_TEST (NAME cpp_ex_${example} COMMAND $) - IF (NOT "${last_test}" STREQUAL "") + if (NOT "${last_test}" STREQUAL "") SET_TESTS_PROPERTIES (cpp_ex_${example} PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "cpp_ex_${example}") - ENDFOREACH (example ${examples}) + endif (NOT "${last_test}" STREQUAL "") + set (last_test "cpp_ex_${example}") + endforeach (example ${examples}) #the following dependicies are handled by the order of the files # SET_TESTS_PROPERTIES(cpp_ex_readdata PROPERTIES DEPENDS cpp_ex_create) # SET_TESTS_PROPERTIES(cpp_ex_chunks PROPERTIES DEPENDS cpp_ex_extend_ds) @@ -42,18 +42,18 @@ h5tutr_groups.h5 h5tutr_subset.h5 ) - IF (NOT "${last_test}" STREQUAL "") + if (NOT "${last_test}" STREQUAL "") SET_TESTS_PROPERTIES (cpp_ex_tutr-clear-objects PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "cpp_ex_tutr-clear-objects") + endif (NOT "${last_test}" STREQUAL "") + set (last_test "cpp_ex_tutr-clear-objects") - FOREACH (example ${tutr_examples}) + foreach (example ${tutr_examples}) ADD_TEST (NAME cpp_ex_${example} COMMAND $) - IF (NOT "${last_test}" STREQUAL "") + if (NOT "${last_test}" STREQUAL "") SET_TESTS_PROPERTIES (cpp_ex_${example} PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "cpp_ex_${example}") - ENDFOREACH (example ${tutr_examples}) + endif (NOT "${last_test}" STREQUAL "") + set (last_test "cpp_ex_${example}") + endforeach (example ${tutr_examples}) #the following dependicies are handled by the order of the files # SET_TESTS_PROPERTIES(cpp_ex_h5tutr_crtatt PROPERTIES DEPENDS cpp_ex_h5tutr_crtdat) # SET_TESTS_PROPERTIES(cpp_ex_h5tutr_rdwt PROPERTIES DEPENDS cpp_ex_h5tutr_crtdat) diff --git a/c++/src/CMakeLists.txt b/c++/src/CMakeLists.txt index af6283a..15eeacc 100644 --- a/c++/src/CMakeLists.txt +++ b/c++/src/CMakeLists.txt @@ -4,9 +4,9 @@ PROJECT (HDF5_CPP_SRC) #----------------------------------------------------------------------------- # Shared/Static Libs #----------------------------------------------------------------------------- -IF (BUILD_SHARED_LIBS) - SET (CPP_BUILT_AS_DYNAMIC_LIB 1) -ENDIF (BUILD_SHARED_LIBS) +if (BUILD_SHARED_LIBS) + set (CPP_BUILT_AS_DYNAMIC_LIB 1) +endif (BUILD_SHARED_LIBS) #----------------------------------------------------------------------------- # Generate configure file @@ -18,7 +18,7 @@ CONFIGURE_FILE (${HDF5_RESOURCES_DIR}/H5cxx_config.h.in #----------------------------------------------------------------------------- # Define cpp Library #----------------------------------------------------------------------------- -SET (CPP_SRCS +set (CPP_SRCS ${HDF5_CPP_SRC_SOURCE_DIR}/H5AbstractDs.cpp ${HDF5_CPP_SRC_SOURCE_DIR}/H5ArrayType.cpp ${HDF5_CPP_SRC_SOURCE_DIR}/H5AtomType.cpp @@ -48,7 +48,7 @@ SET (CPP_SRCS ${HDF5_CPP_SRC_SOURCE_DIR}/H5VarLenType.cpp ) -SET (CPP_HDRS +set (CPP_HDRS ${HDF5_CPP_SRC_SOURCE_DIR}/H5AbstractDs.h ${HDF5_CPP_SRC_SOURCE_DIR}/H5Alltypes.h ${HDF5_CPP_SRC_SOURCE_DIR}/H5ArrayType.h @@ -83,17 +83,17 @@ SET (CPP_HDRS ${HDF5_CPP_SRC_SOURCE_DIR}/H5VarLenType.h ) -ADD_LIBRARY (${HDF5_CPP_LIB_TARGET} ${LIB_TYPE} ${CPP_SRCS} ${CPP_HDRS}) +add_library (${HDF5_CPP_LIB_TARGET} ${LIB_TYPE} ${CPP_SRCS} ${CPP_HDRS}) TARGET_C_PROPERTIES (${HDF5_CPP_LIB_TARGET} " " " ") -TARGET_LINK_LIBRARIES (${HDF5_CPP_LIB_TARGET} ${HDF5_LIB_TARGET}) -SET_GLOBAL_VARIABLE (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_CPP_LIB_TARGET}") +target_link_libraries (${HDF5_CPP_LIB_TARGET} ${HDF5_LIB_TARGET}) +set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_CPP_LIB_TARGET}") H5_SET_LIB_OPTIONS (${HDF5_CPP_LIB_TARGET} ${HDF5_CPP_LIB_NAME} ${LIB_TYPE}) -SET_TARGET_PROPERTIES (${HDF5_CPP_LIB_TARGET} PROPERTIES FOLDER libraries/cpp) +set_target_properties (${HDF5_CPP_LIB_TARGET} PROPERTIES FOLDER libraries/cpp) #----------------------------------------------------------------------------- # Add file(s) to CMake Install #----------------------------------------------------------------------------- -INSTALL ( +install ( FILES ${CPP_HDRS} DESTINATION @@ -105,12 +105,12 @@ INSTALL ( #----------------------------------------------------------------------------- # Add Target(s) to CMake Install for import into other projects #----------------------------------------------------------------------------- -IF (HDF5_EXPORTED_TARGETS) - IF (BUILD_SHARED_LIBS) +if (HDF5_EXPORTED_TARGETS) + if (BUILD_SHARED_LIBS) INSTALL_TARGET_PDB (${HDF5_CPP_LIB_TARGET} ${HDF5_INSTALL_LIB_DIR} cpplibraries) - ENDIF (BUILD_SHARED_LIBS) + endif (BUILD_SHARED_LIBS) - INSTALL ( + install ( TARGETS ${HDF5_CPP_LIB_TARGET} EXPORT @@ -119,4 +119,4 @@ IF (HDF5_EXPORTED_TARGETS) ARCHIVE DESTINATION ${HDF5_INSTALL_LIB_DIR} COMPONENT cpplibraries RUNTIME DESTINATION ${HDF5_INSTALL_BIN_DIR} COMPONENT cpplibraries ) -ENDIF (HDF5_EXPORTED_TARGETS) +endif (HDF5_EXPORTED_TARGETS) diff --git a/c++/test/CMakeLists.txt b/c++/test/CMakeLists.txt index e498fc5..01a0179 100644 --- a/c++/test/CMakeLists.txt +++ b/c++/test/CMakeLists.txt @@ -11,7 +11,7 @@ PROJECT (HDF5_CPP_TEST) #----------------------------------------------------------------------------- # Define Sources #----------------------------------------------------------------------------- -SET (CPP_TEST_SRCS +set (CPP_TEST_SRCS ${HDF5_CPP_TEST_SOURCE_DIR}/testhdf5.cpp ${HDF5_CPP_TEST_SOURCE_DIR}/tattr.cpp ${HDF5_CPP_TEST_SOURCE_DIR}/tcompound.cpp @@ -29,27 +29,27 @@ SET (CPP_TEST_SRCS #----------------------------------------------------------------------------- # Generate the H5srcdir_str.h file containing user settings needed by compilation #----------------------------------------------------------------------------- -SET (srcdir ${CMAKE_CURRENT_SOURCE_DIR}) +set (srcdir ${CMAKE_CURRENT_SOURCE_DIR}) CONFIGURE_FILE (${HDF5_CPP_TEST_SOURCE_DIR}/H5srcdir_str.h.in H5srcdir_str.h @ONLY) INCLUDE_DIRECTORIES (${CMAKE_CURRENT_BINARY_DIR}) INCLUDE_DIRECTORIES (${HDF5_TEST_SRC_DIR} ) -ADD_EXECUTABLE (cpp_testhdf5 ${CPP_TEST_SRCS} ) +add_executable (cpp_testhdf5 ${CPP_TEST_SRCS} ) TARGET_NAMING (cpp_testhdf5 ${LIB_TYPE}) TARGET_C_PROPERTIES (cpp_testhdf5 " " " ") -TARGET_LINK_LIBRARIES (cpp_testhdf5 +target_link_libraries (cpp_testhdf5 ${HDF5_CPP_LIB_TARGET} ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET} ) -SET_TARGET_PROPERTIES (cpp_testhdf5 PROPERTIES FOLDER test/cpp) +set_target_properties (cpp_testhdf5 PROPERTIES FOLDER test/cpp) -ADD_CUSTOM_COMMAND ( +add_custom_command ( TARGET cpp_testhdf5 POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${HDF5_CPP_TEST_SOURCE_DIR}/th5s.h5 ${PROJECT_BINARY_DIR}/th5s.h5 ) -INCLUDE (CMakeTests.cmake) +include (CMakeTests.cmake) diff --git a/c++/test/CMakeTests.cmake b/c++/test/CMakeTests.cmake index 3e4f6d9..ac1f111 100644 --- a/c++/test/CMakeTests.cmake +++ b/c++/test/CMakeTests.cmake @@ -20,9 +20,9 @@ ADD_TEST ( ADD_TEST (NAME cpp_testhdf5 COMMAND $) SET_TESTS_PROPERTIES (cpp_testhdf5 PROPERTIES DEPENDS cpp_testhdf5-clear-objects) -IF (HDF5_TEST_VFD) +if (HDF5_TEST_VFD) - SET (VFD_LIST + set (VFD_LIST sec2 stdio core @@ -31,12 +31,12 @@ IF (HDF5_TEST_VFD) family ) - IF (DIRECT_VFD) - SET (VFD_LIST ${VFD_LIST} direct) - ENDIF (DIRECT_VFD) + if (DIRECT_VFD) + set (VFD_LIST ${VFD_LIST} direct) + endif (DIRECT_VFD) MACRO (ADD_VFD_TEST vfdname resultcode) - IF (NOT HDF5_ENABLE_USING_MEMCHECKER) + if (NOT HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( NAME VFD-${vfdname}-cpp_testhdf5-clear-objects COMMAND ${CMAKE_COMMAND} @@ -60,12 +60,12 @@ IF (HDF5_TEST_VFD) -P "${HDF5_RESOURCES_DIR}/vfdTest.cmake" ) SET_TESTS_PROPERTIES (VFD-${vfdname}-cpp_testhdf5 PROPERTIES DEPENDS VFD-${vfdname}-cpp_testhdf5-clear-objects) - ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) + endif (NOT HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (ADD_VFD_TEST) # Run test with different Virtual File Driver - FOREACH (vfd ${VFD_LIST}) + foreach (vfd ${VFD_LIST}) ADD_VFD_TEST (${vfd} 0) - ENDFOREACH (vfd ${VFD_LIST}) + endforeach (vfd ${VFD_LIST}) -ENDIF (HDF5_TEST_VFD) +endif (HDF5_TEST_VFD) diff --git a/config/cmake/CTestCustom.cmake b/config/cmake/CTestCustom.cmake index cb32827..6d3f0ee 100644 --- a/config/cmake/CTestCustom.cmake +++ b/config/cmake/CTestCustom.cmake @@ -1,6 +1,6 @@ -SET (CTEST_CUSTOM_MAXIMUM_NUMBER_OF_WARNINGS 3000) +set (CTEST_CUSTOM_MAXIMUM_NUMBER_OF_WARNINGS 3000) -SET (CTEST_CUSTOM_WARNING_EXCEPTION +set (CTEST_CUSTOM_WARNING_EXCEPTION ${CTEST_CUSTOM_WARNING_EXCEPTION} # "H5detect.c.[0-9]+.[ \t]*:[ \t]*warning C4090:" # "H5detect.c.[0-9]+.[ \t]*:[ \t]*warning:[ \t]*passing argument" @@ -17,7 +17,7 @@ SET (CTEST_CUSTOM_WARNING_EXCEPTION # "fpp:[ \t]*warning:[ \t]*cannot remove H5_DEBUG_API - not a predefined macro" ) -SET (CTEST_CUSTOM_MEMCHECK_IGNORE +set (CTEST_CUSTOM_MEMCHECK_IGNORE ${CTEST_CUSTOM_MEMCHECK_IGNORE} flush1 #designed to fail flush2 #designed to need flush1 diff --git a/config/cmake/CheckTypeSize.cmake b/config/cmake/CheckTypeSize.cmake index eca6e76..0fe2cbc 100644 --- a/config/cmake/CheckTypeSize.cmake +++ b/config/cmake/CheckTypeSize.cmake @@ -8,23 +8,23 @@ # MACRO (HDF_CHECK_TYPE_SIZE TYPE VARIABLE) - SET (CMAKE_ALLOW_UNKNOWN_VARIABLE_READ_ACCESS 1) - IF ("HAVE_${VARIABLE}" MATCHES "^HAVE_${VARIABLE}$") - SET (MACRO_CHECK_TYPE_SIZE_FLAGS + set (CMAKE_ALLOW_UNKNOWN_VARIABLE_READ_ACCESS 1) + if ("HAVE_${VARIABLE}" MATCHES "^HAVE_${VARIABLE}$") + set (MACRO_CHECK_TYPE_SIZE_FLAGS "-DCHECK_TYPE_SIZE_TYPE=\"${TYPE}\" ${CMAKE_REQUIRED_FLAGS}" ) - FOREACH (def HAVE_SYS_TYPES_H HAVE_STDINT_H HAVE_STDDEF_H HAVE_INTTYPES_H) - IF ("${def}") - SET (MACRO_CHECK_TYPE_SIZE_FLAGS "${MACRO_CHECK_TYPE_SIZE_FLAGS} -D${def}") + foreach (def HAVE_SYS_TYPES_H HAVE_STDINT_H HAVE_STDDEF_H HAVE_INTTYPES_H) + if ("${def}") + set (MACRO_CHECK_TYPE_SIZE_FLAGS "${MACRO_CHECK_TYPE_SIZE_FLAGS} -D${def}") ENDIF("${def}") - ENDFOREACH (def) + endforeach (def) - MESSAGE (STATUS "Check size of ${TYPE}") - IF (CMAKE_REQUIRED_LIBRARIES) - SET (CHECK_TYPE_SIZE_ADD_LIBRARIES + message (STATUS "Check size of ${TYPE}") + if (CMAKE_REQUIRED_LIBRARIES) + set (CHECK_TYPE_SIZE_ADD_LIBRARIES "-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}" ) - ENDIF (CMAKE_REQUIRED_LIBRARIES) + endif (CMAKE_REQUIRED_LIBRARIES) TRY_RUN (${VARIABLE} HAVE_${VARIABLE} ${CMAKE_BINARY_DIR} ${HDF5_RESOURCES_DIR}/CheckTypeSize.c @@ -32,17 +32,17 @@ MACRO (HDF_CHECK_TYPE_SIZE TYPE VARIABLE) "${CHECK_TYPE_SIZE_ADD_LIBRARIES}" OUTPUT_VARIABLE OUTPUT ) - IF (HAVE_${VARIABLE}) - MESSAGE (STATUS "Check size of ${TYPE} - done") + if (HAVE_${VARIABLE}) + message (STATUS "Check size of ${TYPE} - done") FILE (APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeOutput.log "Determining size of ${TYPE} passed with the following output:\n${OUTPUT}\n\n" ) - ELSE (HAVE_${VARIABLE}) - MESSAGE (STATUS "Check size of ${TYPE} - failed") + else (HAVE_${VARIABLE}) + message (STATUS "Check size of ${TYPE} - failed") FILE (APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log "Determining size of ${TYPE} failed with the following output:\n${OUTPUT}\n\n" ) - ENDIF (HAVE_${VARIABLE}) - ENDIF ("HAVE_${VARIABLE}" MATCHES "^HAVE_${VARIABLE}$") - SET (CMAKE_ALLOW_UNKNOWN_VARIABLE_READ_ACCESS) + endif (HAVE_${VARIABLE}) + endif ("HAVE_${VARIABLE}" MATCHES "^HAVE_${VARIABLE}$") + set (CMAKE_ALLOW_UNKNOWN_VARIABLE_READ_ACCESS) ENDMACRO (HDF_CHECK_TYPE_SIZE) diff --git a/config/cmake/ConfigureChecks.cmake b/config/cmake/ConfigureChecks.cmake index f92bd0d..93c6138 100644 --- a/config/cmake/ConfigureChecks.cmake +++ b/config/cmake/ConfigureChecks.cmake @@ -1,68 +1,68 @@ #----------------------------------------------------------------------------- # Include all the necessary files for macros #----------------------------------------------------------------------------- -INCLUDE (${CMAKE_ROOT}/Modules/CheckFunctionExists.cmake) -INCLUDE (${CMAKE_ROOT}/Modules/CheckIncludeFile.cmake) -INCLUDE (${CMAKE_ROOT}/Modules/CheckIncludeFileCXX.cmake) -INCLUDE (${CMAKE_ROOT}/Modules/CheckIncludeFiles.cmake) -INCLUDE (${CMAKE_ROOT}/Modules/CheckLibraryExists.cmake) -INCLUDE (${CMAKE_ROOT}/Modules/CheckSymbolExists.cmake) -INCLUDE (${CMAKE_ROOT}/Modules/CheckTypeSize.cmake) -INCLUDE (${CMAKE_ROOT}/Modules/CheckVariableExists.cmake) -INCLUDE (${CMAKE_ROOT}/Modules/CheckFortranFunctionExists.cmake) -INCLUDE (${CMAKE_ROOT}/Modules/TestBigEndian.cmake) -INCLUDE (${CMAKE_ROOT}/Modules/TestForSTDNamespace.cmake) +include (${CMAKE_ROOT}/Modules/CheckFunctionExists.cmake) +include (${CMAKE_ROOT}/Modules/CheckIncludeFile.cmake) +include (${CMAKE_ROOT}/Modules/CheckIncludeFileCXX.cmake) +include (${CMAKE_ROOT}/Modules/CheckIncludeFiles.cmake) +include (${CMAKE_ROOT}/Modules/CheckLibraryExists.cmake) +include (${CMAKE_ROOT}/Modules/CheckSymbolExists.cmake) +include (${CMAKE_ROOT}/Modules/CheckTypeSize.cmake) +include (${CMAKE_ROOT}/Modules/CheckVariableExists.cmake) +include (${CMAKE_ROOT}/Modules/CheckFortranFunctionExists.cmake) +include (${CMAKE_ROOT}/Modules/TestBigEndian.cmake) +include (${CMAKE_ROOT}/Modules/TestForSTDNamespace.cmake) #----------------------------------------------------------------------------- # APPLE/Darwin setup #----------------------------------------------------------------------------- -IF (APPLE) - LIST(LENGTH CMAKE_OSX_ARCHITECTURES ARCH_LENGTH) - IF(ARCH_LENGTH GREATER 1) +if (APPLE) + list (LENGTH CMAKE_OSX_ARCHITECTURES ARCH_LENGTH) + if (ARCH_LENGTH GREATER 1) set (CMAKE_OSX_ARCHITECTURES "" CACHE STRING "" FORCE) message(FATAL_ERROR "Building Universal Binaries on OS X is NOT supported by the HDF5 project. This is" "due to technical reasons. The best approach would be build each architecture in separate directories" "and use the 'lipo' tool to combine them into a single executable or library. The 'CMAKE_OSX_ARCHITECTURES'" "variable has been set to a blank value which will build the default architecture for this system.") - ENDIF() - SET (H5_AC_APPLE_UNIVERSAL_BUILD 0) -ENDIF (APPLE) + endif () + set (H5_AC_APPLE_UNIVERSAL_BUILD 0) +endif (APPLE) # Check for Darwin (not just Apple - we also want to catch OpenDarwin) -IF(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") - SET (H5_HAVE_DARWIN 1) -ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") +if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") + set (H5_HAVE_DARWIN 1) +endif (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") # Check for Solaris -IF(${CMAKE_SYSTEM_NAME} MATCHES "SunOS") - SET (H5_HAVE_SOLARIS 1) -ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "SunOS") +if (${CMAKE_SYSTEM_NAME} MATCHES "SunOS") + set (H5_HAVE_SOLARIS 1) +endif (${CMAKE_SYSTEM_NAME} MATCHES "SunOS") #----------------------------------------------------------------------------- # Option to Clear File Buffers before write --enable-clear-file-buffers #----------------------------------------------------------------------------- -OPTION (HDF5_Enable_Clear_File_Buffers "Securely clear file buffers before writing to file" ON) -IF (HDF5_Enable_Clear_File_Buffers) - SET (H5_CLEAR_MEMORY 1) -ENDIF (HDF5_Enable_Clear_File_Buffers) +option (HDF5_Enable_Clear_File_Buffers "Securely clear file buffers before writing to file" ON) +if (HDF5_Enable_Clear_File_Buffers) + set (H5_CLEAR_MEMORY 1) +endif (HDF5_Enable_Clear_File_Buffers) MARK_AS_ADVANCED (HDF5_Enable_Clear_File_Buffers) #----------------------------------------------------------------------------- # Option for --enable-strict-format-checks #----------------------------------------------------------------------------- -OPTION (HDF5_STRICT_FORMAT_CHECKS "Whether to perform strict file format checks" OFF) -IF (HDF5_STRICT_FORMAT_CHECKS) - SET (H5_STRICT_FORMAT_CHECKS 1) -ENDIF (HDF5_STRICT_FORMAT_CHECKS) +option (HDF5_STRICT_FORMAT_CHECKS "Whether to perform strict file format checks" OFF) +if (HDF5_STRICT_FORMAT_CHECKS) + set (H5_STRICT_FORMAT_CHECKS 1) +endif (HDF5_STRICT_FORMAT_CHECKS) MARK_AS_ADVANCED (HDF5_STRICT_FORMAT_CHECKS) #----------------------------------------------------------------------------- # Option for --enable-metadata-trace-file #----------------------------------------------------------------------------- -OPTION (HDF5_METADATA_TRACE_FILE "Enable metadata trace file collection" OFF) -IF (HDF5_METADATA_TRACE_FILE) - SET (H5_METADATA_TRACE_FILE 1) -ENDIF (HDF5_METADATA_TRACE_FILE) +option (HDF5_METADATA_TRACE_FILE "Enable metadata trace file collection" OFF) +if (HDF5_METADATA_TRACE_FILE) + set (H5_METADATA_TRACE_FILE 1) +endif (HDF5_METADATA_TRACE_FILE) MARK_AS_ADVANCED (HDF5_METADATA_TRACE_FILE) # ---------------------------------------------------------------------- @@ -71,10 +71,10 @@ MARK_AS_ADVANCED (HDF5_METADATA_TRACE_FILE) # though the data may be wrong (for example, some compilers don't # support denormalized floating values) to maximize speed. # -OPTION (HDF5_WANT_DATA_ACCURACY "IF data accuracy is guaranteed during data conversions" ON) -IF (HDF5_WANT_DATA_ACCURACY) - SET (H5_WANT_DATA_ACCURACY 1) -ENDIF(HDF5_WANT_DATA_ACCURACY) +option (HDF5_WANT_DATA_ACCURACY "IF data accuracy is guaranteed during data conversions" ON) +if (HDF5_WANT_DATA_ACCURACY) + set (H5_WANT_DATA_ACCURACY 1) +endif (HDF5_WANT_DATA_ACCURACY) MARK_AS_ADVANCED (HDF5_WANT_DATA_ACCURACY) # ---------------------------------------------------------------------- @@ -83,199 +83,199 @@ MARK_AS_ADVANCED (HDF5_WANT_DATA_ACCURACY) # for the speed optimization of hard conversions. Soft conversions can # actually benefit little. # -OPTION (HDF5_WANT_DCONV_EXCEPTION "exception handling functions is checked during data conversions" ON) -IF (HDF5_WANT_DCONV_EXCEPTION) - SET (H5_WANT_DCONV_EXCEPTION 1) -ENDIF (HDF5_WANT_DCONV_EXCEPTION) +option (HDF5_WANT_DCONV_EXCEPTION "exception handling functions is checked during data conversions" ON) +if (HDF5_WANT_DCONV_EXCEPTION) + set (H5_WANT_DCONV_EXCEPTION 1) +endif (HDF5_WANT_DCONV_EXCEPTION) MARK_AS_ADVANCED (HDF5_WANT_DCONV_EXCEPTION) # ---------------------------------------------------------------------- # Check if they would like the function stack support compiled in # -OPTION (HDF5_ENABLE_CODESTACK "Enable the function stack tracing (for developer debugging)." OFF) -IF (HDF5_ENABLE_CODESTACK) - SET (H5_HAVE_CODESTACK 1) -ENDIF (HDF5_ENABLE_CODESTACK) +option (HDF5_ENABLE_CODESTACK "Enable the function stack tracing (for developer debugging)." OFF) +if (HDF5_ENABLE_CODESTACK) + set (H5_HAVE_CODESTACK 1) +endif (HDF5_ENABLE_CODESTACK) MARK_AS_ADVANCED (HDF5_ENABLE_CODESTACK) -OPTION (HDF5_ENABLE_HSIZET "Enable datasets larger than memory" ON) +option (HDF5_ENABLE_HSIZET "Enable datasets larger than memory" ON) # ---------------------------------------------------------------------- # Set the flag to indicate that the machine can handle converting # floating-point to long long values. # (This flag should be _unset_ for all machines) # -# SET (H5_HW_FP_TO_LLONG_NOT_WORKS 0) +# set (H5_HW_FP_TO_LLONG_NOT_WORKS 0) # so far we have no check for this -SET(H5_HAVE_TMPFILE 1) +set (H5_HAVE_TMPFILE 1) #----------------------------------------------------------------------------- # This MACRO checks IF the symbol exists in the library and IF it # does, it appends library to the list. #----------------------------------------------------------------------------- -SET (LINK_LIBS "") +set (LINK_LIBS "") MACRO (CHECK_LIBRARY_EXISTS_CONCAT LIBRARY SYMBOL VARIABLE) CHECK_LIBRARY_EXISTS ("${LIBRARY};${LINK_LIBS}" ${SYMBOL} "" ${VARIABLE}) - IF (${VARIABLE}) - SET (LINK_LIBS ${LINK_LIBS} ${LIBRARY}) - ENDIF (${VARIABLE}) + if (${VARIABLE}) + set (LINK_LIBS ${LINK_LIBS} ${LIBRARY}) + endif (${VARIABLE}) ENDMACRO (CHECK_LIBRARY_EXISTS_CONCAT) # ---------------------------------------------------------------------- # WINDOWS Hard code Values # ---------------------------------------------------------------------- -SET (WINDOWS) -IF (WIN32) - IF (MINGW) - SET (H5_HAVE_MINGW 1) - SET (WINDOWS 1) # MinGW tries to imitate Windows - SET (CMAKE_REQUIRED_FLAGS "-DWIN32_LEAN_AND_MEAN=1 -DNOGDI=1") - ENDIF (MINGW) - SET (H5_HAVE_WIN32_API 1) - SET (CMAKE_REQUIRED_LIBRARIES "ws2_32.lib;wsock32.lib") - IF (NOT UNIX AND NOT CYGWIN AND NOT MINGW) - SET (WINDOWS 1) - SET (CMAKE_REQUIRED_FLAGS "/DWIN32_LEAN_AND_MEAN=1 /DNOGDI=1") - IF (MSVC) - SET (H5_HAVE_VISUAL_STUDIO 1) - ENDIF (MSVC) - ENDIF (NOT UNIX AND NOT CYGWIN AND NOT MINGW) -ENDIF (WIN32) - -#IF (WIN32) -# SET (DEFAULT_STREAM_VFD OFF) -#ELSE (WIN32) -# SET (DEFAULT_STREAM_VFD ON) -#ENDIF (WIN32) -#OPTION (HDF5_STREAM_VFD "Compile Stream Virtual File Driver support" ${DEFAULT_STREAM_VFD}) +set (WINDOWS) +if (WIN32) + if (MINGW) + set (H5_HAVE_MINGW 1) + set (WINDOWS 1) # MinGW tries to imitate Windows + set (CMAKE_REQUIRED_FLAGS "-DWIN32_LEAN_AND_MEAN=1 -DNOGDI=1") + endif (MINGW) + set (H5_HAVE_WIN32_API 1) + set (CMAKE_REQUIRED_LIBRARIES "ws2_32.lib;wsock32.lib") + if (NOT UNIX AND NOT CYGWIN AND NOT MINGW) + set (WINDOWS 1) + set (CMAKE_REQUIRED_FLAGS "/DWIN32_LEAN_AND_MEAN=1 /DNOGDI=1") + if (MSVC) + set (H5_HAVE_VISUAL_STUDIO 1) + endif (MSVC) + endif (NOT UNIX AND NOT CYGWIN AND NOT MINGW) +endif (WIN32) + +#if (WIN32) +# set (DEFAULT_STREAM_VFD OFF) +#else (WIN32) +# set (DEFAULT_STREAM_VFD ON) +#endif (WIN32) +#option (HDF5_STREAM_VFD "Compile Stream Virtual File Driver support" ${DEFAULT_STREAM_VFD}) # TODO -------------------------------------------------------------------------- # Should the Default Virtual File Driver be compiled? # This is hard-coded now but option should added to match configure # -SET (H5_DEFAULT_VFD H5FD_SEC2) - -IF (NOT DEFINED "H5_DEFAULT_PLUGINDIR") - IF (WINDOWS) - SET (H5_DEFAULT_PLUGINDIR "%ALLUSERSPROFILE%/hdf5/lib/plugin") - ELSE (WINDOWS) - SET (H5_DEFAULT_PLUGINDIR "/usr/local/hdf5/lib/plugin") - ENDIF (WINDOWS) -ENDIF (NOT DEFINED "H5_DEFAULT_PLUGINDIR") - -IF (WINDOWS) - SET (H5_HAVE_WINDOWS 1) +set (H5_DEFAULT_VFD H5FD_SEC2) + +if (NOT DEFINED "H5_DEFAULT_PLUGINDIR") + if (WINDOWS) + set (H5_DEFAULT_PLUGINDIR "%ALLUSERSPROFILE%/hdf5/lib/plugin") + else (WINDOWS) + set (H5_DEFAULT_PLUGINDIR "/usr/local/hdf5/lib/plugin") + endif (WINDOWS) +endif (NOT DEFINED "H5_DEFAULT_PLUGINDIR") + +if (WINDOWS) + set (H5_HAVE_WINDOWS 1) # ---------------------------------------------------------------------- # Set the flag to indicate that the machine has window style pathname, # that is, "drive-letter:\" (e.g. "C:") or "drive-letter:/" (e.g. "C:/"). # (This flag should be _unset_ for all machines, except for Windows) - SET (H5_HAVE_WINDOW_PATH 1) -ENDIF (WINDOWS) - -IF (WINDOWS) - SET (H5_HAVE_STDDEF_H 1) - SET (H5_HAVE_SYS_STAT_H 1) - SET (H5_HAVE_SYS_TYPES_H 1) - SET (H5_HAVE_LIBM 1) - SET (H5_HAVE_STRDUP 1) - SET (H5_HAVE_SYSTEM 1) - SET (H5_HAVE_LONGJMP 1) - IF (NOT MINGW) - SET (H5_HAVE_GETHOSTNAME 1) - ENDIF (NOT MINGW) - IF (NOT UNIX AND NOT CYGWIN AND NOT MINGW) - SET (H5_HAVE_GETCONSOLESCREENBUFFERINFO 1) - ENDIF (NOT UNIX AND NOT CYGWIN AND NOT MINGW) - SET (H5_HAVE_FUNCTION 1) - SET (H5_GETTIMEOFDAY_GIVES_TZ 1) - SET (H5_HAVE_TIMEZONE 1) - SET (H5_HAVE_GETTIMEOFDAY 1) - SET (H5_LONE_COLON 0) - IF (MINGW) - SET (H5_HAVE_WINSOCK2_H 1) - ENDIF (MINGW) - SET (H5_HAVE_LIBWS2_32 1) - SET (H5_HAVE_LIBWSOCK32 1) + set (H5_HAVE_WINDOW_PATH 1) +endif (WINDOWS) + +if (WINDOWS) + set (H5_HAVE_STDDEF_H 1) + set (H5_HAVE_SYS_STAT_H 1) + set (H5_HAVE_SYS_TYPES_H 1) + set (H5_HAVE_LIBM 1) + set (H5_HAVE_STRDUP 1) + set (H5_HAVE_SYSTEM 1) + set (H5_HAVE_LONGJMP 1) + if (NOT MINGW) + set (H5_HAVE_GETHOSTNAME 1) + endif (NOT MINGW) + if (NOT UNIX AND NOT CYGWIN AND NOT MINGW) + set (H5_HAVE_GETCONSOLESCREENBUFFERINFO 1) + endif (NOT UNIX AND NOT CYGWIN AND NOT MINGW) + set (H5_HAVE_FUNCTION 1) + set (H5_GETTIMEOFDAY_GIVES_TZ 1) + set (H5_HAVE_TIMEZONE 1) + set (H5_HAVE_GETTIMEOFDAY 1) + set (H5_LONE_COLON 0) + if (MINGW) + set (H5_HAVE_WINSOCK2_H 1) + endif (MINGW) + set (H5_HAVE_LIBWS2_32 1) + set (H5_HAVE_LIBWSOCK32 1) #----------------------------------------------------------------------------- # These tests need to be manually SET for windows since there is currently # something not quite correct with the actual test implementation. This affects # the 'dt_arith' test and most likely lots of other code # ---------------------------------------------------------------------------- - SET (H5_FP_TO_ULLONG_RIGHT_MAXIMUM "" CACHE INTERNAL "") -ENDIF (WINDOWS) + set (H5_FP_TO_ULLONG_RIGHT_MAXIMUM "" CACHE INTERNAL "") +endif (WINDOWS) # ---------------------------------------------------------------------- # END of WINDOWS Hard code Values # ---------------------------------------------------------------------- -IF (CYGWIN) - SET (H5_HAVE_LSEEK64 0) -ENDIF (CYGWIN) +if (CYGWIN) + set (H5_HAVE_LSEEK64 0) +endif (CYGWIN) #----------------------------------------------------------------------------- # Check for the math library "m" #----------------------------------------------------------------------------- -IF (NOT WINDOWS) +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) +endif (NOT WINDOWS) CHECK_LIBRARY_EXISTS_CONCAT ("ucb" gethostname H5_HAVE_LIBUCB) CHECK_LIBRARY_EXISTS_CONCAT ("socket" connect H5_HAVE_LIBSOCKET) CHECK_LIBRARY_EXISTS ("c" gethostbyname "" NOT_NEED_LIBNSL) -IF (NOT NOT_NEED_LIBNSL) +if (NOT NOT_NEED_LIBNSL) CHECK_LIBRARY_EXISTS_CONCAT ("nsl" gethostbyname H5_HAVE_LIBNSL) -ENDIF (NOT NOT_NEED_LIBNSL) +endif (NOT NOT_NEED_LIBNSL) # For other tests to use the same libraries -SET (CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ${LINK_LIBS}) +set (CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ${LINK_LIBS}) -SET (USE_INCLUDES "") -IF (WINDOWS) - SET (USE_INCLUDES ${USE_INCLUDES} "windows.h") -ENDIF (WINDOWS) +set (USE_INCLUDES "") +if (WINDOWS) + set (USE_INCLUDES ${USE_INCLUDES} "windows.h") +endif (WINDOWS) -IF (NOT WINDOWS) - TEST_BIG_ENDIAN(H5_WORDS_BIGENDIAN) -ENDIF (NOT WINDOWS) +if (NOT WINDOWS) + TEST_BIG_ENDIAN (H5_WORDS_BIGENDIAN) +endif (NOT WINDOWS) # For other specific tests, use this MACRO. MACRO (HDF5_FUNCTION_TEST OTHER_TEST) - IF ("H5_${OTHER_TEST}" MATCHES "^H5_${OTHER_TEST}$") - SET (MACRO_CHECK_FUNCTION_DEFINITIONS "-D${OTHER_TEST} ${CMAKE_REQUIRED_FLAGS}") - SET (OTHER_TEST_ADD_LIBRARIES) - IF (CMAKE_REQUIRED_LIBRARIES) - SET (OTHER_TEST_ADD_LIBRARIES "-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}") - ENDIF (CMAKE_REQUIRED_LIBRARIES) - - FOREACH (def ${HDF5_EXTRA_TEST_DEFINITIONS}) - SET (MACRO_CHECK_FUNCTION_DEFINITIONS "${MACRO_CHECK_FUNCTION_DEFINITIONS} -D${def}=${${def}}") - ENDFOREACH (def) - - FOREACH (def + if ("H5_${OTHER_TEST}" MATCHES "^H5_${OTHER_TEST}$") + set (MACRO_CHECK_FUNCTION_DEFINITIONS "-D${OTHER_TEST} ${CMAKE_REQUIRED_FLAGS}") + set (OTHER_TEST_ADD_LIBRARIES) + if (CMAKE_REQUIRED_LIBRARIES) + set (OTHER_TEST_ADD_LIBRARIES "-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}") + endif (CMAKE_REQUIRED_LIBRARIES) + + foreach (def ${HDF5_EXTRA_TEST_DEFINITIONS}) + set (MACRO_CHECK_FUNCTION_DEFINITIONS "${MACRO_CHECK_FUNCTION_DEFINITIONS} -D${def}=${${def}}") + endforeach (def) + + foreach (def HAVE_SYS_TIME_H HAVE_UNISTD_H HAVE_SYS_TYPES_H HAVE_SYS_SOCKET_H ) - IF ("${H5_${def}}") - SET (MACRO_CHECK_FUNCTION_DEFINITIONS "${MACRO_CHECK_FUNCTION_DEFINITIONS} -D${def}") - ENDIF ("${H5_${def}}") - ENDFOREACH (def) + if ("${H5_${def}}") + set (MACRO_CHECK_FUNCTION_DEFINITIONS "${MACRO_CHECK_FUNCTION_DEFINITIONS} -D${def}") + endif ("${H5_${def}}") + endforeach (def) - IF (LARGEFILE) - SET (MACRO_CHECK_FUNCTION_DEFINITIONS + if (LARGEFILE) + set (MACRO_CHECK_FUNCTION_DEFINITIONS "${MACRO_CHECK_FUNCTION_DEFINITIONS} -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE" ) - ENDIF (LARGEFILE) + endif (LARGEFILE) - #MESSAGE (STATUS "Performing ${OTHER_TEST}") + #message (STATUS "Performing ${OTHER_TEST}") TRY_COMPILE (${OTHER_TEST} ${CMAKE_BINARY_DIR} ${HDF5_RESOURCES_DIR}/HDF5Tests.c @@ -283,18 +283,18 @@ MACRO (HDF5_FUNCTION_TEST OTHER_TEST) "${OTHER_TEST_ADD_LIBRARIES}" OUTPUT_VARIABLE OUTPUT ) - IF (${OTHER_TEST}) - SET (H5_${OTHER_TEST} 1 CACHE INTERNAL "Other test ${FUNCTION}") - MESSAGE (STATUS "Performing Other Test ${OTHER_TEST} - Success") - ELSE (${OTHER_TEST}) - MESSAGE (STATUS "Performing Other Test ${OTHER_TEST} - Failed") - SET (H5_${OTHER_TEST} "" CACHE INTERNAL "Other test ${FUNCTION}") + if (${OTHER_TEST}) + set (H5_${OTHER_TEST} 1 CACHE INTERNAL "Other test ${FUNCTION}") + message (STATUS "Performing Other Test ${OTHER_TEST} - Success") + else (${OTHER_TEST}) + message (STATUS "Performing Other Test ${OTHER_TEST} - Failed") + set (H5_${OTHER_TEST} "" CACHE INTERNAL "Other test ${FUNCTION}") FILE (APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log "Performing Other Test ${OTHER_TEST} failed with the following output:\n" "${OUTPUT}\n" ) - ENDIF (${OTHER_TEST}) - ENDIF ("H5_${OTHER_TEST}" MATCHES "^H5_${OTHER_TEST}$") + endif (${OTHER_TEST}) + endif ("H5_${OTHER_TEST}" MATCHES "^H5_${OTHER_TEST}$") ENDMACRO (HDF5_FUNCTION_TEST) #----------------------------------------------------------------------------- @@ -306,58 +306,58 @@ CHECK_FUNCTION_EXISTS (difftime H5_HAVE_DIFFTIME) #CHECK_FUNCTION_EXISTS (gettimeofday H5_HAVE_GETTIMEOFDAY) # Since gettimeofday is not defined any where standard, lets look in all the # usual places. On MSVC we are just going to use ::clock() -IF (NOT MSVC) - IF ("H5_HAVE_TIME_GETTIMEOFDAY" MATCHES "^H5_HAVE_TIME_GETTIMEOFDAY$") +if (NOT MSVC) + if ("H5_HAVE_TIME_GETTIMEOFDAY" MATCHES "^H5_HAVE_TIME_GETTIMEOFDAY$") TRY_COMPILE (HAVE_TIME_GETTIMEOFDAY ${CMAKE_BINARY_DIR} ${HDF5_RESOURCES_DIR}/GetTimeOfDayTest.cpp COMPILE_DEFINITIONS -DTRY_TIME_H OUTPUT_VARIABLE OUTPUT ) - IF (HAVE_TIME_GETTIMEOFDAY STREQUAL "TRUE") - SET (H5_HAVE_TIME_GETTIMEOFDAY "1" CACHE INTERNAL "H5_HAVE_TIME_GETTIMEOFDAY") - SET (H5_HAVE_GETTIMEOFDAY "1" CACHE INTERNAL "H5_HAVE_GETTIMEOFDAY") - ENDIF (HAVE_TIME_GETTIMEOFDAY STREQUAL "TRUE") - ENDIF ("H5_HAVE_TIME_GETTIMEOFDAY" MATCHES "^H5_HAVE_TIME_GETTIMEOFDAY$") + if (HAVE_TIME_GETTIMEOFDAY STREQUAL "TRUE") + set (H5_HAVE_TIME_GETTIMEOFDAY "1" CACHE INTERNAL "H5_HAVE_TIME_GETTIMEOFDAY") + set (H5_HAVE_GETTIMEOFDAY "1" CACHE INTERNAL "H5_HAVE_GETTIMEOFDAY") + endif (HAVE_TIME_GETTIMEOFDAY STREQUAL "TRUE") + endif ("H5_HAVE_TIME_GETTIMEOFDAY" MATCHES "^H5_HAVE_TIME_GETTIMEOFDAY$") - IF ("H5_HAVE_SYS_TIME_GETTIMEOFDAY" MATCHES "^H5_HAVE_SYS_TIME_GETTIMEOFDAY$") + if ("H5_HAVE_SYS_TIME_GETTIMEOFDAY" MATCHES "^H5_HAVE_SYS_TIME_GETTIMEOFDAY$") TRY_COMPILE (HAVE_SYS_TIME_GETTIMEOFDAY ${CMAKE_BINARY_DIR} ${HDF5_RESOURCES_DIR}/GetTimeOfDayTest.cpp COMPILE_DEFINITIONS -DTRY_SYS_TIME_H OUTPUT_VARIABLE OUTPUT ) - IF (HAVE_SYS_TIME_GETTIMEOFDAY STREQUAL "TRUE") - SET (H5_HAVE_SYS_TIME_GETTIMEOFDAY "1" CACHE INTERNAL "H5_HAVE_SYS_TIME_GETTIMEOFDAY") - SET (H5_HAVE_GETTIMEOFDAY "1" CACHE INTERNAL "H5_HAVE_GETTIMEOFDAY") - ENDIF (HAVE_SYS_TIME_GETTIMEOFDAY STREQUAL "TRUE") - ENDIF ("H5_HAVE_SYS_TIME_GETTIMEOFDAY" MATCHES "^H5_HAVE_SYS_TIME_GETTIMEOFDAY$") - - IF (NOT HAVE_SYS_TIME_GETTIMEOFDAY AND NOT H5_HAVE_GETTIMEOFDAY) - MESSAGE (STATUS "---------------------------------------------------------------") - MESSAGE (STATUS "Function 'gettimeofday()' was not found. HDF5 will use its") - MESSAGE (STATUS " own implementation.. This can happen on older versions of") - MESSAGE (STATUS " MinGW on Windows. Consider upgrading your MinGW installation") - MESSAGE (STATUS " to a newer version such as MinGW 3.12") - MESSAGE (STATUS "---------------------------------------------------------------") - ENDIF (NOT HAVE_SYS_TIME_GETTIMEOFDAY AND NOT H5_HAVE_GETTIMEOFDAY) -ENDIF (NOT MSVC) + if (HAVE_SYS_TIME_GETTIMEOFDAY STREQUAL "TRUE") + set (H5_HAVE_SYS_TIME_GETTIMEOFDAY "1" CACHE INTERNAL "H5_HAVE_SYS_TIME_GETTIMEOFDAY") + set (H5_HAVE_GETTIMEOFDAY "1" CACHE INTERNAL "H5_HAVE_GETTIMEOFDAY") + endif (HAVE_SYS_TIME_GETTIMEOFDAY STREQUAL "TRUE") + endif ("H5_HAVE_SYS_TIME_GETTIMEOFDAY" MATCHES "^H5_HAVE_SYS_TIME_GETTIMEOFDAY$") + + if (NOT HAVE_SYS_TIME_GETTIMEOFDAY AND NOT H5_HAVE_GETTIMEOFDAY) + message (STATUS "---------------------------------------------------------------") + message (STATUS "Function 'gettimeofday()' was not found. HDF5 will use its") + message (STATUS " own implementation.. This can happen on older versions of") + message (STATUS " MinGW on Windows. Consider upgrading your MinGW installation") + message (STATUS " to a newer version such as MinGW 3.12") + message (STATUS "---------------------------------------------------------------") + endif (NOT HAVE_SYS_TIME_GETTIMEOFDAY AND NOT H5_HAVE_GETTIMEOFDAY) +endif (NOT MSVC) # Find the library containing clock_gettime() -IF (NOT WINDOWS) +if (NOT WINDOWS) CHECK_FUNCTION_EXISTS(clock_gettime CLOCK_GETTIME_IN_LIBC) CHECK_LIBRARY_EXISTS(rt clock_gettime "" CLOCK_GETTIME_IN_LIBRT) CHECK_LIBRARY_EXISTS(posix4 clock_gettime "" CLOCK_GETTIME_IN_LIBPOSIX4) - IF(CLOCK_GETTIME_IN_LIBC) - SET(H5_HAVE_CLOCK_GETTIME 1) - ELSEIF(CLOCK_GETTIME_IN_LIBRT) - SET(H5_HAVE_CLOCK_GETTIME 1) - LIST(APPEND LINK_LIBS rt) - ELSEIF(CLOCK_GETTIME_IN_LIBPOSIX4) - SET(H5_HAVE_CLOCK_GETTIME 1) - LIST(APPEND LINK_LIBS posix4) - ENDIF(CLOCK_GETTIME_IN_LIBC) -ENDIF (NOT WINDOWS) + if (CLOCK_GETTIME_IN_LIBC) + set (H5_HAVE_CLOCK_GETTIME 1) + elseif (CLOCK_GETTIME_IN_LIBRT) + set (H5_HAVE_CLOCK_GETTIME 1) + list (APPEND LINK_LIBS rt) + elseif (CLOCK_GETTIME_IN_LIBPOSIX4) + set (H5_HAVE_CLOCK_GETTIME 1) + list (APPEND LINK_LIBS posix4) + endif (CLOCK_GETTIME_IN_LIBC) +endif (NOT WINDOWS) #----------------------------------------------------------------------------- #----------------------------------------------------------------------------- @@ -365,9 +365,9 @@ ENDIF (NOT WINDOWS) #----------------------------------------------------------------------------- MACRO (CHECK_INCLUDE_FILE_CONCAT FILE VARIABLE) CHECK_INCLUDE_FILES ("${USE_INCLUDES};${FILE}" ${VARIABLE}) - IF (${VARIABLE}) - SET (USE_INCLUDES ${USE_INCLUDES} ${FILE}) - ENDIF (${VARIABLE}) + if (${VARIABLE}) + set (USE_INCLUDES ${USE_INCLUDES} ${FILE}) + endif (${VARIABLE}) ENDMACRO (CHECK_INCLUDE_FILE_CONCAT) #----------------------------------------------------------------------------- @@ -389,31 +389,31 @@ 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 # file will be found by C but not C++, only do this test IF the C++ compiler # has been initialized (e.g. the project also includes some c++) -IF (H5_HAVE_STDINT_H AND CMAKE_CXX_COMPILER_LOADED) +if (H5_HAVE_STDINT_H AND CMAKE_CXX_COMPILER_LOADED) CHECK_INCLUDE_FILE_CXX ("stdint.h" H5_HAVE_STDINT_H_CXX) - IF (NOT H5_HAVE_STDINT_H_CXX) - SET (H5_HAVE_STDINT_H "" CACHE INTERNAL "Have includes HAVE_STDINT_H") - SET (USE_INCLUDES ${USE_INCLUDES} "stdint.h") - ENDIF (NOT H5_HAVE_STDINT_H_CXX) -ENDIF (H5_HAVE_STDINT_H AND CMAKE_CXX_COMPILER_LOADED) + if (NOT H5_HAVE_STDINT_H_CXX) + set (H5_HAVE_STDINT_H "" CACHE INTERNAL "Have includes HAVE_STDINT_H") + set (USE_INCLUDES ${USE_INCLUDES} "stdint.h") + endif (NOT H5_HAVE_STDINT_H_CXX) +endif (H5_HAVE_STDINT_H AND CMAKE_CXX_COMPILER_LOADED) # Darwin CHECK_INCLUDE_FILE_CONCAT ("mach/mach_time.h" H5_HAVE_MACH_MACH_TIME_H) # Windows CHECK_INCLUDE_FILE_CONCAT ("io.h" H5_HAVE_IO_H) -IF (NOT CYGWIN) +if (NOT CYGWIN) CHECK_INCLUDE_FILE_CONCAT ("winsock2.h" H5_HAVE_WINSOCK2_H) -ENDIF (NOT CYGWIN) +endif (NOT CYGWIN) CHECK_INCLUDE_FILE_CONCAT ("sys/timeb.h" H5_HAVE_SYS_TIMEB_H) -IF (CMAKE_SYSTEM_NAME MATCHES "OSF") +if (CMAKE_SYSTEM_NAME MATCHES "OSF") CHECK_INCLUDE_FILE_CONCAT ("sys/sysinfo.h" H5_HAVE_SYS_SYSINFO_H) CHECK_INCLUDE_FILE_CONCAT ("sys/proc.h" H5_HAVE_SYS_PROC_H) -ELSE (CMAKE_SYSTEM_NAME MATCHES "OSF") - SET (H5_HAVE_SYS_SYSINFO_H "" CACHE INTERNAL "" FORCE) - SET (H5_HAVE_SYS_PROC_H "" CACHE INTERNAL "" FORCE) -ENDIF (CMAKE_SYSTEM_NAME MATCHES "OSF") +else (CMAKE_SYSTEM_NAME MATCHES "OSF") + set (H5_HAVE_SYS_SYSINFO_H "" CACHE INTERNAL "" FORCE) + set (H5_HAVE_SYS_PROC_H "" CACHE INTERNAL "" FORCE) +endif (CMAKE_SYSTEM_NAME MATCHES "OSF") CHECK_INCLUDE_FILE_CONCAT ("globus/common.h" H5_HAVE_GLOBUS_COMMON_H) CHECK_INCLUDE_FILE_CONCAT ("pdb.h" H5_HAVE_PDB_H) @@ -433,12 +433,12 @@ CHECK_INCLUDE_FILE_CONCAT ("netinet/in.h" H5_HAVE_NETINET_IN_H) #----------------------------------------------------------------------------- # The linux-lfs option is deprecated. -SET (LINUX_LFS 0) +set (LINUX_LFS 0) -SET (HDF5_EXTRA_C_FLAGS) -SET (HDF5_EXTRA_FLAGS) -IF (NOT WINDOWS) - IF(NOT H5_HAVE_SOLARIS) +set (HDF5_EXTRA_C_FLAGS) +set (HDF5_EXTRA_FLAGS) +if (NOT WINDOWS) + if (NOT H5_HAVE_SOLARIS) # Linux Specific flags # This was originally defined as _POSIX_SOURCE which was updated to # _POSIX_C_SOURCE=199506L to expose a greater amount of POSIX @@ -446,93 +446,93 @@ IF (NOT WINDOWS) # correctly. # POSIX feature information can be found in the gcc manual at: # http://www.gnu.org/s/libc/manual/html_node/Feature-Test-Macros.html - SET (HDF5_EXTRA_C_FLAGS -D_POSIX_C_SOURCE=199506L) - SET (HDF5_EXTRA_FLAGS -D_BSD_SOURCE) + set (HDF5_EXTRA_C_FLAGS -D_POSIX_C_SOURCE=199506L) + set (HDF5_EXTRA_FLAGS -D_BSD_SOURCE) - OPTION (HDF5_ENABLE_LARGE_FILE "Enable support for large (64-bit) files on Linux." ON) - IF (HDF5_ENABLE_LARGE_FILE) - SET (msg "Performing TEST_LFS_WORKS") + option (HDF5_ENABLE_LARGE_FILE "Enable support for large (64-bit) files on Linux." ON) + if (HDF5_ENABLE_LARGE_FILE) + set (msg "Performing TEST_LFS_WORKS") TRY_RUN (TEST_LFS_WORKS_RUN TEST_LFS_WORKS_COMPILE ${HDF5_BINARY_DIR}/CMake ${HDF5_RESOURCES_DIR}/HDF5Tests.c CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=-DTEST_LFS_WORKS OUTPUT_VARIABLE OUTPUT ) - IF (TEST_LFS_WORKS_COMPILE) - IF (TEST_LFS_WORKS_RUN MATCHES 0) - SET (TEST_LFS_WORKS 1 CACHE INTERNAL ${msg}) - SET (LARGEFILE 1) - SET (HDF5_EXTRA_FLAGS ${HDF5_EXTRA_FLAGS} -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE) - MESSAGE (STATUS "${msg}... yes") - ELSE (TEST_LFS_WORKS_RUN MATCHES 0) - SET (TEST_LFS_WORKS "" CACHE INTERNAL ${msg}) - MESSAGE (STATUS "${msg}... no") + if (TEST_LFS_WORKS_COMPILE) + if (TEST_LFS_WORKS_RUN MATCHES 0) + set (TEST_LFS_WORKS 1 CACHE INTERNAL ${msg}) + set (LARGEFILE 1) + set (HDF5_EXTRA_FLAGS ${HDF5_EXTRA_FLAGS} -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE) + message (STATUS "${msg}... yes") + else (TEST_LFS_WORKS_RUN MATCHES 0) + set (TEST_LFS_WORKS "" CACHE INTERNAL ${msg}) + message (STATUS "${msg}... no") FILE (APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log "Test TEST_LFS_WORKS Run failed with the following output and exit code:\n ${OUTPUT}\n" ) - ENDIF (TEST_LFS_WORKS_RUN MATCHES 0) - ELSE (TEST_LFS_WORKS_COMPILE ) - SET (TEST_LFS_WORKS "" CACHE INTERNAL ${msg}) - MESSAGE (STATUS "${msg}... no") + endif (TEST_LFS_WORKS_RUN MATCHES 0) + else (TEST_LFS_WORKS_COMPILE ) + set (TEST_LFS_WORKS "" CACHE INTERNAL ${msg}) + message (STATUS "${msg}... no") FILE (APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log "Test TEST_LFS_WORKS Compile failed with the following output:\n ${OUTPUT}\n" ) - ENDIF (TEST_LFS_WORKS_COMPILE) - ENDIF (HDF5_ENABLE_LARGE_FILE) - SET (CMAKE_REQUIRED_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS} ${HDF5_EXTRA_FLAGS}) - ENDIF(NOT H5_HAVE_SOLARIS) -ENDIF (NOT WINDOWS) + endif (TEST_LFS_WORKS_COMPILE) + endif (HDF5_ENABLE_LARGE_FILE) + set (CMAKE_REQUIRED_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS} ${HDF5_EXTRA_FLAGS}) + endif (NOT H5_HAVE_SOLARIS) +endif (NOT WINDOWS) -ADD_DEFINITIONS (${HDF5_EXTRA_FLAGS}) +add_definitions (${HDF5_EXTRA_FLAGS}) #----------------------------------------------------------------------------- # Check for HAVE_OFF64_T functionality #----------------------------------------------------------------------------- -IF (NOT WINDOWS OR MINGW) +if (NOT WINDOWS OR MINGW) HDF5_FUNCTION_TEST (HAVE_OFF64_T) - IF (H5_HAVE_OFF64_T) + if (H5_HAVE_OFF64_T) CHECK_FUNCTION_EXISTS (lseek64 H5_HAVE_LSEEK64) CHECK_FUNCTION_EXISTS (fseeko64 H5_HAVE_FSEEKO64) CHECK_FUNCTION_EXISTS (ftello64 H5_HAVE_FTELLO64) CHECK_FUNCTION_EXISTS (ftruncate64 H5_HAVE_FTRUNCATE64) - ENDIF (H5_HAVE_OFF64_T) + endif (H5_HAVE_OFF64_T) CHECK_FUNCTION_EXISTS (fseeko H5_HAVE_FSEEKO) CHECK_FUNCTION_EXISTS (ftello H5_HAVE_FTELLO) HDF5_FUNCTION_TEST (HAVE_STAT64_STRUCT) - IF (HAVE_STAT64_STRUCT) + if (HAVE_STAT64_STRUCT) CHECK_FUNCTION_EXISTS (fstat64 H5_HAVE_FSTAT64) CHECK_FUNCTION_EXISTS (stat64 H5_HAVE_STAT64) - ENDIF (HAVE_STAT64_STRUCT) -ENDIF (NOT WINDOWS OR MINGW) + endif (HAVE_STAT64_STRUCT) +endif (NOT WINDOWS OR MINGW) #----------------------------------------------------------------------------- # Check the size in bytes of all the int and float types #----------------------------------------------------------------------------- MACRO (H5_CHECK_TYPE_SIZE type var) - SET (aType ${type}) - SET (aVar ${var}) -# MESSAGE (STATUS "Checking size of ${aType} and storing into ${aVar}") + set (aType ${type}) + set (aVar ${var}) +# message (STATUS "Checking size of ${aType} and storing into ${aVar}") CHECK_TYPE_SIZE (${aType} ${aVar}) - IF (NOT ${aVar}) - SET (${aVar} 0 CACHE INTERNAL "SizeOf for ${aType}") -# MESSAGE (STATUS "Size of ${aType} was NOT Found") - ENDIF (NOT ${aVar}) + if (NOT ${aVar}) + set (${aVar} 0 CACHE INTERNAL "SizeOf for ${aType}") +# message (STATUS "Size of ${aType} was NOT Found") + endif (NOT ${aVar}) ENDMACRO (H5_CHECK_TYPE_SIZE) H5_CHECK_TYPE_SIZE (char H5_SIZEOF_CHAR) H5_CHECK_TYPE_SIZE (short H5_SIZEOF_SHORT) H5_CHECK_TYPE_SIZE (int H5_SIZEOF_INT) H5_CHECK_TYPE_SIZE (unsigned H5_SIZEOF_UNSIGNED) -IF (NOT APPLE) +if (NOT APPLE) H5_CHECK_TYPE_SIZE (long H5_SIZEOF_LONG) -ENDIF (NOT APPLE) +endif (NOT APPLE) H5_CHECK_TYPE_SIZE ("long long" H5_SIZEOF_LONG_LONG) H5_CHECK_TYPE_SIZE (__int64 H5_SIZEOF___INT64) -IF (NOT H5_SIZEOF___INT64) - SET (H5_SIZEOF___INT64 0) -ENDIF (NOT H5_SIZEOF___INT64) +if (NOT H5_SIZEOF___INT64) + set (H5_SIZEOF___INT64 0) +endif (NOT H5_SIZEOF___INT64) H5_CHECK_TYPE_SIZE (float H5_SIZEOF_FLOAT) H5_CHECK_TYPE_SIZE (double H5_SIZEOF_DOUBLE) @@ -566,24 +566,24 @@ H5_CHECK_TYPE_SIZE (uint_least64_t H5_SIZEOF_UINT_LEAST64_T) H5_CHECK_TYPE_SIZE (int_fast64_t H5_SIZEOF_INT_FAST64_T) H5_CHECK_TYPE_SIZE (uint_fast64_t H5_SIZEOF_UINT_FAST64_T) -IF (NOT APPLE) +if (NOT APPLE) H5_CHECK_TYPE_SIZE (size_t H5_SIZEOF_SIZE_T) H5_CHECK_TYPE_SIZE (ssize_t H5_SIZEOF_SSIZE_T) - IF (NOT H5_SIZEOF_SSIZE_T) - SET (H5_SIZEOF_SSIZE_T 0) - ENDIF (NOT H5_SIZEOF_SSIZE_T) - IF (NOT WINDOWS) + if (NOT H5_SIZEOF_SSIZE_T) + set (H5_SIZEOF_SSIZE_T 0) + endif (NOT H5_SIZEOF_SSIZE_T) + if (NOT WINDOWS) H5_CHECK_TYPE_SIZE (ptrdiff_t H5_SIZEOF_PTRDIFF_T) - ENDIF (NOT WINDOWS) -ENDIF (NOT APPLE) + endif (NOT WINDOWS) +endif (NOT APPLE) H5_CHECK_TYPE_SIZE (off_t H5_SIZEOF_OFF_T) H5_CHECK_TYPE_SIZE (off64_t H5_SIZEOF_OFF64_T) -IF (NOT H5_SIZEOF_OFF64_T) - SET (H5_SIZEOF_OFF64_T 0) -ENDIF (NOT H5_SIZEOF_OFF64_T) +if (NOT H5_SIZEOF_OFF64_T) + set (H5_SIZEOF_OFF64_T 0) +endif (NOT H5_SIZEOF_OFF64_T) -IF (NOT WINDOWS) +if (NOT WINDOWS) #----------------------------------------------------------------------------- # Check if the dev_t type is a scalar type #----------------------------------------------------------------------------- @@ -598,7 +598,7 @@ IF (NOT WINDOWS) #----------------------------------------------------------------------------- # Check a bunch of time functions #----------------------------------------------------------------------------- - FOREACH (test + foreach (test HAVE_TM_GMTOFF HAVE___TM_GMTOFF # HAVE_TIMEZONE @@ -609,11 +609,11 @@ IF (NOT WINDOWS) HAVE_STRUCT_TM_TM_ZONE ) HDF5_FUNCTION_TEST (${test}) - ENDFOREACH (test) - IF (NOT CYGWIN AND NOT MINGW) + endforeach (test) + if (NOT CYGWIN AND NOT MINGW) HDF5_FUNCTION_TEST (HAVE_TIMEZONE) # HDF5_FUNCTION_TEST (HAVE_STAT_ST_BLOCKS) - ENDIF (NOT CYGWIN AND NOT MINGW) + endif (NOT CYGWIN AND NOT MINGW) # ---------------------------------------------------------------------- # Does the struct stat have the st_blocks field? This field is not Posix. @@ -629,12 +629,12 @@ IF (NOT WINDOWS) CHECK_FUNCTION_EXISTS (_getvideoconfig H5_HAVE__GETVIDEOCONFIG) CHECK_FUNCTION_EXISTS (gettextinfo H5_HAVE_GETTEXTINFO) CHECK_FUNCTION_EXISTS (_scrsize H5_HAVE__SCRSIZE) - IF (NOT CYGWIN AND NOT MINGW) + if (NOT CYGWIN AND NOT MINGW) CHECK_FUNCTION_EXISTS (GetConsoleScreenBufferInfo H5_HAVE_GETCONSOLESCREENBUFFERINFO) - ENDIF (NOT CYGWIN AND NOT MINGW) + endif (NOT CYGWIN AND NOT MINGW) CHECK_SYMBOL_EXISTS (TIOCGWINSZ "sys/ioctl.h" H5_HAVE_TIOCGWINSZ) CHECK_SYMBOL_EXISTS (TIOCGETD "sys/ioctl.h" H5_HAVE_TIOCGETD) -ENDIF (NOT WINDOWS) +endif (NOT WINDOWS) #----------------------------------------------------------------------------- # Check for some functions that are used @@ -673,23 +673,23 @@ CHECK_FUNCTION_EXISTS (vasprintf H5_HAVE_VASPRINTF) CHECK_FUNCTION_EXISTS (waitpid H5_HAVE_WAITPID) CHECK_FUNCTION_EXISTS (vsnprintf H5_HAVE_VSNPRINTF) -IF (NOT WINDOWS) - IF (H5_HAVE_VSNPRINTF) +if (NOT WINDOWS) + if (H5_HAVE_VSNPRINTF) HDF5_FUNCTION_TEST (VSNPRINTF_WORKS) - ENDIF (H5_HAVE_VSNPRINTF) -ENDIF (NOT WINDOWS) + endif (H5_HAVE_VSNPRINTF) +endif (NOT WINDOWS) #----------------------------------------------------------------------------- # sigsetjmp is special; may actually be a macro #----------------------------------------------------------------------------- -IF (NOT H5_HAVE_SIGSETJMP) - IF (H5_HAVE_SETJMP_H) +if (NOT H5_HAVE_SIGSETJMP) + if (H5_HAVE_SETJMP_H) CHECK_SYMBOL_EXISTS (sigsetjmp "setjmp.h" H5_HAVE_MACRO_SIGSETJMP) - IF (H5_HAVE_MACRO_SIGSETJMP) - SET (H5_HAVE_SIGSETJMP 1) - ENDIF (H5_HAVE_MACRO_SIGSETJMP) - ENDIF (H5_HAVE_SETJMP_H) -ENDIF (NOT H5_HAVE_SIGSETJMP) + if (H5_HAVE_MACRO_SIGSETJMP) + set (H5_HAVE_SIGSETJMP 1) + endif (H5_HAVE_MACRO_SIGSETJMP) + endif (H5_HAVE_SETJMP_H) +endif (NOT H5_HAVE_SIGSETJMP) #----------------------------------------------------------------------------- # Check for Symbols @@ -698,8 +698,8 @@ CHECK_SYMBOL_EXISTS (tzname "time.h" H5_HAVE_DECL_TZNAME) #----------------------------------------------------------------------------- # Check a bunch of other functions #----------------------------------------------------------------------------- -IF (NOT WINDOWS) - FOREACH (test +if (NOT WINDOWS) + foreach (test LONE_COLON HAVE_ATTRIBUTE HAVE_C99_FUNC @@ -710,40 +710,40 @@ IF (NOT WINDOWS) CXX_HAVE_OFFSETOF ) HDF5_FUNCTION_TEST (${test}) - ENDFOREACH (test) -ENDIF (NOT WINDOWS) + endforeach (test) +endif (NOT WINDOWS) # For other CXX specific tests, use this MACRO. MACRO (HDF5_CXX_FUNCTION_TEST OTHER_TEST) - IF ("${OTHER_TEST}" MATCHES "^${OTHER_TEST}$") - SET (MACRO_CHECK_FUNCTION_DEFINITIONS "-D${OTHER_TEST} ${CMAKE_REQUIRED_FLAGS}") - SET (OTHER_TEST_ADD_LIBRARIES) - IF (CMAKE_REQUIRED_LIBRARIES) - SET (OTHER_TEST_ADD_LIBRARIES "-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}") - ENDIF (CMAKE_REQUIRED_LIBRARIES) - - FOREACH (def ${HDF5_EXTRA_TEST_DEFINITIONS}) - SET (MACRO_CHECK_FUNCTION_DEFINITIONS "${MACRO_CHECK_FUNCTION_DEFINITIONS} -D${def}=${${def}}") - ENDFOREACH (def) - - FOREACH (def + if ("${OTHER_TEST}" MATCHES "^${OTHER_TEST}$") + set (MACRO_CHECK_FUNCTION_DEFINITIONS "-D${OTHER_TEST} ${CMAKE_REQUIRED_FLAGS}") + set (OTHER_TEST_ADD_LIBRARIES) + if (CMAKE_REQUIRED_LIBRARIES) + set (OTHER_TEST_ADD_LIBRARIES "-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}") + endif (CMAKE_REQUIRED_LIBRARIES) + + foreach (def ${HDF5_EXTRA_TEST_DEFINITIONS}) + set (MACRO_CHECK_FUNCTION_DEFINITIONS "${MACRO_CHECK_FUNCTION_DEFINITIONS} -D${def}=${${def}}") + endforeach (def) + + foreach (def HAVE_SYS_TIME_H HAVE_UNISTD_H HAVE_SYS_TYPES_H HAVE_SYS_SOCKET_H ) - IF ("${H5_${def}}") - SET (MACRO_CHECK_FUNCTION_DEFINITIONS "${MACRO_CHECK_FUNCTION_DEFINITIONS} -D${def}") - ENDIF ("${H5_${def}}") - ENDFOREACH (def) + if ("${H5_${def}}") + set (MACRO_CHECK_FUNCTION_DEFINITIONS "${MACRO_CHECK_FUNCTION_DEFINITIONS} -D${def}") + endif ("${H5_${def}}") + endforeach (def) - IF (LARGEFILE) - SET (MACRO_CHECK_FUNCTION_DEFINITIONS + if (LARGEFILE) + set (MACRO_CHECK_FUNCTION_DEFINITIONS "${MACRO_CHECK_FUNCTION_DEFINITIONS} -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE" ) - ENDIF (LARGEFILE) + endif (LARGEFILE) - #MESSAGE (STATUS "Performing ${OTHER_TEST}") + #message (STATUS "Performing ${OTHER_TEST}") TRY_COMPILE (${OTHER_TEST} ${CMAKE_BINARY_DIR} ${HDF5_RESOURCES_DIR}/HDF5CXXTests.cpp @@ -751,25 +751,25 @@ MACRO (HDF5_CXX_FUNCTION_TEST OTHER_TEST) "${OTHER_TEST_ADD_LIBRARIES}" OUTPUT_VARIABLE OUTPUT ) - IF ("${OTHER_TEST}" EQUAL 0) - SET (${OTHER_TEST} 1 CACHE INTERNAL "CXX test ${FUNCTION}") - MESSAGE (STATUS "Performing CXX Test ${OTHER_TEST} - Success") - ELSE ("${OTHER_TEST}" EQUAL 0) - MESSAGE (STATUS "Performing CXX Test ${OTHER_TEST} - Failed") - SET (${OTHER_TEST} "" CACHE INTERNAL "CXX test ${FUNCTION}") + if ("${OTHER_TEST}" EQUAL 0) + set (${OTHER_TEST} 1 CACHE INTERNAL "CXX test ${FUNCTION}") + message (STATUS "Performing CXX Test ${OTHER_TEST} - Success") + else ("${OTHER_TEST}" EQUAL 0) + message (STATUS "Performing CXX Test ${OTHER_TEST} - Failed") + set (${OTHER_TEST} "" CACHE INTERNAL "CXX test ${FUNCTION}") FILE (APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log "Performing CXX Test ${OTHER_TEST} failed with the following output:\n" "${OUTPUT}\n" ) - ENDIF ("${OTHER_TEST}" EQUAL 0) - ENDIF ("${OTHER_TEST}" MATCHES "^${OTHER_TEST}$") + endif ("${OTHER_TEST}" EQUAL 0) + endif ("${OTHER_TEST}" MATCHES "^${OTHER_TEST}$") ENDMACRO (HDF5_CXX_FUNCTION_TEST) #----------------------------------------------------------------------------- # Check a bunch of cxx functions #----------------------------------------------------------------------------- -IF (CMAKE_CXX_COMPILER_LOADED) - FOREACH (test +if (CMAKE_CXX_COMPILER_LOADED) + foreach (test OLD_HEADER_FILENAME H5_NO_NAMESPACE H5_NO_STD @@ -777,81 +777,81 @@ IF (CMAKE_CXX_COMPILER_LOADED) NO_STATIC_CAST ) HDF5_CXX_FUNCTION_TEST (${test}) - ENDFOREACH (test) -ENDIF (CMAKE_CXX_COMPILER_LOADED) + endforeach (test) +endif (CMAKE_CXX_COMPILER_LOADED) #----------------------------------------------------------------------------- # Check if Direct I/O driver works #----------------------------------------------------------------------------- -IF (NOT WINDOWS) - OPTION (HDF5_ENABLE_DIRECT_VFD "Build the Direct I/O Virtual File Driver" ON) - IF (HDF5_ENABLE_DIRECT_VFD) - SET (msg "Performing TEST_DIRECT_VFD_WORKS") - SET (MACRO_CHECK_FUNCTION_DEFINITIONS "-DTEST_DIRECT_VFD_WORKS -D_GNU_SOURCE ${CMAKE_REQUIRED_FLAGS}") +if (NOT WINDOWS) + option (HDF5_ENABLE_DIRECT_VFD "Build the Direct I/O Virtual File Driver" ON) + if (HDF5_ENABLE_DIRECT_VFD) + set (msg "Performing TEST_DIRECT_VFD_WORKS") + set (MACRO_CHECK_FUNCTION_DEFINITIONS "-DTEST_DIRECT_VFD_WORKS -D_GNU_SOURCE ${CMAKE_REQUIRED_FLAGS}") TRY_RUN (TEST_DIRECT_VFD_WORKS_RUN TEST_DIRECT_VFD_WORKS_COMPILE ${HDF5_BINARY_DIR}/CMake ${HDF5_RESOURCES_DIR}/HDF5Tests.c CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_FUNCTION_DEFINITIONS} OUTPUT_VARIABLE OUTPUT ) - IF (TEST_DIRECT_VFD_WORKS_COMPILE) - IF (TEST_DIRECT_VFD_WORKS_RUN MATCHES 0) + if (TEST_DIRECT_VFD_WORKS_COMPILE) + if (TEST_DIRECT_VFD_WORKS_RUN MATCHES 0) HDF5_FUNCTION_TEST (HAVE_DIRECT) - SET (CMAKE_REQUIRED_DEFINITIONS "${CMAKE_REQUIRED_DEFINITIONS} -D_GNU_SOURCE") - ADD_DEFINITIONS ("-D_GNU_SOURCE") - ELSE (TEST_DIRECT_VFD_WORKS_RUN MATCHES 0) - SET (TEST_DIRECT_VFD_WORKS "" CACHE INTERNAL ${msg}) - MESSAGE (STATUS "${msg}... no") + set (CMAKE_REQUIRED_DEFINITIONS "${CMAKE_REQUIRED_DEFINITIONS} -D_GNU_SOURCE") + add_definitions ("-D_GNU_SOURCE") + else (TEST_DIRECT_VFD_WORKS_RUN MATCHES 0) + set (TEST_DIRECT_VFD_WORKS "" CACHE INTERNAL ${msg}) + message (STATUS "${msg}... no") FILE (APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log "Test TEST_DIRECT_VFD_WORKS Run failed with the following output and exit code:\n ${OUTPUT}\n" ) - ENDIF (TEST_DIRECT_VFD_WORKS_RUN MATCHES 0) - ELSE (TEST_DIRECT_VFD_WORKS_COMPILE ) - SET (TEST_DIRECT_VFD_WORKS "" CACHE INTERNAL ${msg}) - MESSAGE (STATUS "${msg}... no") + endif (TEST_DIRECT_VFD_WORKS_RUN MATCHES 0) + else (TEST_DIRECT_VFD_WORKS_COMPILE ) + set (TEST_DIRECT_VFD_WORKS "" CACHE INTERNAL ${msg}) + message (STATUS "${msg}... no") FILE (APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log "Test TEST_DIRECT_VFD_WORKS Compile failed with the following output:\n ${OUTPUT}\n" ) - ENDIF (TEST_DIRECT_VFD_WORKS_COMPILE) - ENDIF (HDF5_ENABLE_DIRECT_VFD) -ENDIF (NOT WINDOWS) + endif (TEST_DIRECT_VFD_WORKS_COMPILE) + endif (HDF5_ENABLE_DIRECT_VFD) +endif (NOT WINDOWS) #----------------------------------------------------------------------------- # Check for the Stream VFD driver #----------------------------------------------------------------------------- -IF (HDF5_STREAM_VFD) +if (HDF5_STREAM_VFD) CHECK_INCLUDE_FILE_CONCAT ("netdb.h" H5_HAVE_NETDB_H) CHECK_INCLUDE_FILE_CONCAT ("netinet/tcp.h" H5_HAVE_NETINET_TCP_H) CHECK_INCLUDE_FILE_CONCAT ("sys/filio.h" H5_HAVE_SYS_FILIO_H) - SET (H5_HAVE_STREAM 1) -ENDIF (HDF5_STREAM_VFD) + set (H5_HAVE_STREAM 1) +endif (HDF5_STREAM_VFD) #----------------------------------------------------------------------------- # Check if InitOnceExecuteOnce is available #----------------------------------------------------------------------------- -IF (WINDOWS) - IF (NOT HDF5_NO_IOEO_TEST) - MESSAGE (STATUS "Checking for InitOnceExecuteOnce:") - IF("${H5_HAVE_IOEO}" MATCHES "^${H5_HAVE_IOEO}$") - IF (LARGEFILE) - SET (CMAKE_REQUIRED_DEFINITIONS +if (WINDOWS) + if (NOT HDF5_NO_IOEO_TEST) + message (STATUS "Checking for InitOnceExecuteOnce:") + if ("${H5_HAVE_IOEO}" MATCHES "^${H5_HAVE_IOEO}$") + if (LARGEFILE) + set (CMAKE_REQUIRED_DEFINITIONS "${CURRENT_TEST_DEFINITIONS} -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE" ) - ENDIF (LARGEFILE) - SET(MACRO_CHECK_FUNCTION_DEFINITIONS + endif (LARGEFILE) + set (MACRO_CHECK_FUNCTION_DEFINITIONS "-DHAVE_IOEO ${CMAKE_REQUIRED_FLAGS}") - IF(CMAKE_REQUIRED_LIBRARIES) - SET(CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES + if (CMAKE_REQUIRED_LIBRARIES) + set (CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES "-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}") - ELSE(CMAKE_REQUIRED_LIBRARIES) - SET(CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES) - ENDIF(CMAKE_REQUIRED_LIBRARIES) - IF(CMAKE_REQUIRED_INCLUDES) - SET(CHECK_C_SOURCE_COMPILES_ADD_INCLUDES + else (CMAKE_REQUIRED_LIBRARIES) + set (CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES) + endif (CMAKE_REQUIRED_LIBRARIES) + if (CMAKE_REQUIRED_INCLUDES) + set (CHECK_C_SOURCE_COMPILES_ADD_INCLUDES "-DINCLUDE_DIRECTORIES:STRING=${CMAKE_REQUIRED_INCLUDES}") - ELSE(CMAKE_REQUIRED_INCLUDES) - SET(CHECK_C_SOURCE_COMPILES_ADD_INCLUDES) - ENDIF(CMAKE_REQUIRED_INCLUDES) + else (CMAKE_REQUIRED_INCLUDES) + set (CHECK_C_SOURCE_COMPILES_ADD_INCLUDES) + endif (CMAKE_REQUIRED_INCLUDES) TRY_RUN(HAVE_IOEO_EXITCODE HAVE_IOEO_COMPILED ${CMAKE_BINARY_DIR} @@ -863,108 +863,108 @@ IF (WINDOWS) "${CHECK_C_SOURCE_COMPILES_ADD_INCLUDES}" COMPILE_OUTPUT_VARIABLE OUTPUT) # if it did not compile make the return value fail code of 1 - IF(NOT HAVE_IOEO_COMPILED) - SET(HAVE_IOEO_EXITCODE 1) - ENDIF(NOT HAVE_IOEO_COMPILED) + if (NOT HAVE_IOEO_COMPILED) + set (HAVE_IOEO_EXITCODE 1) + endif (NOT HAVE_IOEO_COMPILED) # if the return value was 0 then it worked - IF("${HAVE_IOEO_EXITCODE}" EQUAL 0) - SET(H5_HAVE_IOEO 1 CACHE INTERNAL "Test InitOnceExecuteOnce") - MESSAGE(STATUS "Performing Test InitOnceExecuteOnce - Success") - FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log + if ("${HAVE_IOEO_EXITCODE}" EQUAL 0) + set (H5_HAVE_IOEO 1 CACHE INTERNAL "Test InitOnceExecuteOnce") + message (STATUS "Performing Test InitOnceExecuteOnce - Success") + FILE (APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log "Performing C SOURCE FILE Test InitOnceExecuteOnce succeded with the following output:\n" "${OUTPUT}\n" "Return value: ${HAVE_IOEO}\n") - ELSE("${HAVE_IOEO_EXITCODE}" EQUAL 0) - IF(CMAKE_CROSSCOMPILING AND "${HAVE_IOEO_EXITCODE}" MATCHES "FAILED_TO_RUN") - SET(H5_HAVE_IOEO "${HAVE_IOEO_EXITCODE}") - ELSE(CMAKE_CROSSCOMPILING AND "${HAVE_IOEO_EXITCODE}" MATCHES "FAILED_TO_RUN") - SET(H5_HAVE_IOEO "" CACHE INTERNAL "Test InitOnceExecuteOnce") - ENDIF(CMAKE_CROSSCOMPILING AND "${HAVE_IOEO_EXITCODE}" MATCHES "FAILED_TO_RUN") - - MESSAGE(STATUS "Performing Test InitOnceExecuteOnce - Failed") - FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log + else ("${HAVE_IOEO_EXITCODE}" EQUAL 0) + if (CMAKE_CROSSCOMPILING AND "${HAVE_IOEO_EXITCODE}" MATCHES "FAILED_TO_RUN") + set (H5_HAVE_IOEO "${HAVE_IOEO_EXITCODE}") + else (CMAKE_CROSSCOMPILING AND "${HAVE_IOEO_EXITCODE}" MATCHES "FAILED_TO_RUN") + set (H5_HAVE_IOEO "" CACHE INTERNAL "Test InitOnceExecuteOnce") + endif (CMAKE_CROSSCOMPILING AND "${HAVE_IOEO_EXITCODE}" MATCHES "FAILED_TO_RUN") + + message (STATUS "Performing Test InitOnceExecuteOnce - Failed") + FILE (APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log "Performing InitOnceExecuteOnce Test failed with the following output:\n" "${OUTPUT}\n" "Return value: ${HAVE_IOEO_EXITCODE}\n") - ENDIF("${HAVE_IOEO_EXITCODE}" EQUAL 0) - ENDIF("${H5_HAVE_IOEO}" MATCHES "^${H5_HAVE_IOEO}$") - ENDIF (NOT HDF5_NO_IOEO_TEST) -ENDIF (WINDOWS) + endif ("${HAVE_IOEO_EXITCODE}" EQUAL 0) + endif ("${H5_HAVE_IOEO}" MATCHES "^${H5_HAVE_IOEO}$") + endif (NOT HDF5_NO_IOEO_TEST) +endif (WINDOWS) #----------------------------------------------------------------------------- # Option to see if GPFS is available on this filesystem --enable-gpfs #----------------------------------------------------------------------------- -OPTION (HDF5_ENABLE_GPFS "Enable GPFS hints for the MPI/POSIX file driver" OFF) -IF (HDF5_ENABLE_GPFS) +option (HDF5_ENABLE_GPFS "Enable GPFS hints for the MPI/POSIX file driver" OFF) +if (HDF5_ENABLE_GPFS) CHECK_INCLUDE_FILE_CONCAT ("gpfs.h" HAVE_GPFS) - IF (HAVE_GPFS) + if (HAVE_GPFS) HDF5_FUNCTION_TEST (HAVE_GPFS) - ENDIF (HAVE_GPFS) -ENDIF (HDF5_ENABLE_GPFS) + endif (HAVE_GPFS) +endif (HDF5_ENABLE_GPFS) MARK_AS_ADVANCED (HDF5_ENABLE_GPFS) #----------------------------------------------------------------------------- # Determine how 'inline' is used #----------------------------------------------------------------------------- -SET (HDF5_EXTRA_TEST_DEFINITIONS INLINE_TEST_INLINE) -FOREACH (inline_test inline __inline__ __inline) - SET (INLINE_TEST_INLINE ${inline_test}) +set (HDF5_EXTRA_TEST_DEFINITIONS INLINE_TEST_INLINE) +foreach (inline_test inline __inline__ __inline) + set (INLINE_TEST_INLINE ${inline_test}) HDF5_FUNCTION_TEST (INLINE_TEST_${inline_test}) -ENDFOREACH (inline_test) - -SET (HDF5_EXTRA_TEST_DEFINITIONS) -IF (INLINE_TEST___inline__) - SET (H5_inline __inline__) -ELSE (INLINE_TEST___inline__) - IF (INLINE_TEST___inline) - SET (H5_inline __inline) - ELSE (INLINE_TEST___inline) - IF (INLINE_TEST_inline) - SET (H5_inline inline) - ENDIF (INLINE_TEST_inline) - ENDIF (INLINE_TEST___inline) -ENDIF (INLINE_TEST___inline__) +endforeach (inline_test) + +set (HDF5_EXTRA_TEST_DEFINITIONS) +if (INLINE_TEST___inline__) + set (H5_inline __inline__) +else (INLINE_TEST___inline__) + if (INLINE_TEST___inline) + set (H5_inline __inline) + else (INLINE_TEST___inline) + if (INLINE_TEST_inline) + set (H5_inline inline) + endif (INLINE_TEST_inline) + endif (INLINE_TEST___inline) +endif (INLINE_TEST___inline__) #----------------------------------------------------------------------------- # Check how to print a Long Long integer #----------------------------------------------------------------------------- -IF (NOT H5_PRINTF_LL_WIDTH OR H5_PRINTF_LL_WIDTH MATCHES "unknown") - SET (PRINT_LL_FOUND 0) - MESSAGE (STATUS "Checking for appropriate format for 64 bit long:") - FOREACH (HDF5_PRINTF_LL l64 l L q I64 ll) - SET (CURRENT_TEST_DEFINITIONS "-DPRINTF_LL_WIDTH=${HDF5_PRINTF_LL}") - IF (H5_SIZEOF_LONG_LONG) - SET (CURRENT_TEST_DEFINITIONS "${CURRENT_TEST_DEFINITIONS} -DHAVE_LONG_LONG") - ENDIF (H5_SIZEOF_LONG_LONG) +if (NOT H5_PRINTF_LL_WIDTH OR H5_PRINTF_LL_WIDTH MATCHES "unknown") + set (PRINT_LL_FOUND 0) + message (STATUS "Checking for appropriate format for 64 bit long:") + foreach (HDF5_PRINTF_LL l64 l L q I64 ll) + set (CURRENT_TEST_DEFINITIONS "-DPRINTF_LL_WIDTH=${HDF5_PRINTF_LL}") + if (H5_SIZEOF_LONG_LONG) + set (CURRENT_TEST_DEFINITIONS "${CURRENT_TEST_DEFINITIONS} -DHAVE_LONG_LONG") + endif (H5_SIZEOF_LONG_LONG) TRY_RUN (HDF5_PRINTF_LL_TEST_RUN HDF5_PRINTF_LL_TEST_COMPILE ${HDF5_BINARY_DIR}/CMake ${HDF5_RESOURCES_DIR}/HDF5Tests.c CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${CURRENT_TEST_DEFINITIONS} OUTPUT_VARIABLE OUTPUT ) - IF (HDF5_PRINTF_LL_TEST_COMPILE) - IF (HDF5_PRINTF_LL_TEST_RUN MATCHES 0) - SET (H5_PRINTF_LL_WIDTH "\"${HDF5_PRINTF_LL}\"" CACHE INTERNAL "Width for printf for type `long long' or `__int64', us. `ll") - SET (PRINT_LL_FOUND 1) - ELSE (HDF5_PRINTF_LL_TEST_RUN MATCHES 0) - MESSAGE ("Width with ${HDF5_PRINTF_LL} failed with result: ${HDF5_PRINTF_LL_TEST_RUN}") - ENDIF (HDF5_PRINTF_LL_TEST_RUN MATCHES 0) - ELSE (HDF5_PRINTF_LL_TEST_COMPILE) + if (HDF5_PRINTF_LL_TEST_COMPILE) + if (HDF5_PRINTF_LL_TEST_RUN MATCHES 0) + set (H5_PRINTF_LL_WIDTH "\"${HDF5_PRINTF_LL}\"" CACHE INTERNAL "Width for printf for type `long long' or `__int64', us. `ll") + set (PRINT_LL_FOUND 1) + else (HDF5_PRINTF_LL_TEST_RUN MATCHES 0) + message ("Width with ${HDF5_PRINTF_LL} failed with result: ${HDF5_PRINTF_LL_TEST_RUN}") + endif (HDF5_PRINTF_LL_TEST_RUN MATCHES 0) + else (HDF5_PRINTF_LL_TEST_COMPILE) FILE (APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log "Test H5_PRINTF_LL_WIDTH for ${HDF5_PRINTF_LL} failed with the following output:\n ${OUTPUT}\n" ) - ENDIF (HDF5_PRINTF_LL_TEST_COMPILE) - ENDFOREACH (HDF5_PRINTF_LL) - - IF (PRINT_LL_FOUND) - MESSAGE (STATUS "Checking for apropriate format for 64 bit long: found ${H5_PRINTF_LL_WIDTH}") - ELSE (PRINT_LL_FOUND) - MESSAGE (STATUS "Checking for apropriate format for 64 bit long: not found") - SET (H5_PRINTF_LL_WIDTH "\"unknown\"" CACHE INTERNAL + endif (HDF5_PRINTF_LL_TEST_COMPILE) + endforeach (HDF5_PRINTF_LL) + + if (PRINT_LL_FOUND) + message (STATUS "Checking for apropriate format for 64 bit long: found ${H5_PRINTF_LL_WIDTH}") + else (PRINT_LL_FOUND) + message (STATUS "Checking for apropriate format for 64 bit long: not found") + set (H5_PRINTF_LL_WIDTH "\"unknown\"" CACHE INTERNAL "Width for printf for type `long long' or `__int64', us. `ll" ) - ENDIF (PRINT_LL_FOUND) -ENDIF (NOT H5_PRINTF_LL_WIDTH OR H5_PRINTF_LL_WIDTH MATCHES "unknown") + endif (PRINT_LL_FOUND) +endif (NOT H5_PRINTF_LL_WIDTH OR H5_PRINTF_LL_WIDTH MATCHES "unknown") # ---------------------------------------------------------------------- # Set the flag to indicate that the machine can handle converting @@ -972,62 +972,62 @@ ENDIF (NOT H5_PRINTF_LL_WIDTH OR H5_PRINTF_LL_WIDTH MATCHES "unknown") # (This flag should be set for all machines, except for the Crays, where # the cache value is set in it's config file) # -SET (H5_CONVERT_DENORMAL_FLOAT 1) +set (H5_CONVERT_DENORMAL_FLOAT 1) #----------------------------------------------------------------------------- # Are we going to use HSIZE_T #----------------------------------------------------------------------------- -IF (HDF5_ENABLE_HSIZET) - SET (H5_HAVE_LARGE_HSIZET 1) -ENDIF (HDF5_ENABLE_HSIZET) +if (HDF5_ENABLE_HSIZET) + set (H5_HAVE_LARGE_HSIZET 1) +endif (HDF5_ENABLE_HSIZET) #----------------------------------------------------------------------------- # Macro to determine the various conversion capabilities #----------------------------------------------------------------------------- MACRO (H5ConversionTests TEST msg) - IF ("${TEST}" MATCHES "^${TEST}$") - # MESSAGE (STATUS "===> ${TEST}") + if ("${TEST}" MATCHES "^${TEST}$") + # message (STATUS "===> ${TEST}") TRY_RUN (${TEST}_RUN ${TEST}_COMPILE ${HDF5_BINARY_DIR}/CMake ${HDF5_RESOURCES_DIR}/ConversionTests.c CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=-D${TEST}_TEST OUTPUT_VARIABLE OUTPUT ) - IF (${TEST}_COMPILE) - IF (${TEST}_RUN MATCHES 0) - SET (${TEST} 1 CACHE INTERNAL ${msg}) - MESSAGE (STATUS "${msg}... yes") - ELSE (${TEST}_RUN MATCHES 0) - SET (${TEST} "" CACHE INTERNAL ${msg}) - MESSAGE (STATUS "${msg}... no") + if (${TEST}_COMPILE) + if (${TEST}_RUN MATCHES 0) + set (${TEST} 1 CACHE INTERNAL ${msg}) + message (STATUS "${msg}... yes") + else (${TEST}_RUN MATCHES 0) + set (${TEST} "" CACHE INTERNAL ${msg}) + message (STATUS "${msg}... no") FILE (APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log "Test ${TEST} Run failed with the following output and exit code:\n ${OUTPUT}\n" ) - ENDIF (${TEST}_RUN MATCHES 0) - ELSE (${TEST}_COMPILE ) - SET (${TEST} "" CACHE INTERNAL ${msg}) - MESSAGE (STATUS "${msg}... no") + endif (${TEST}_RUN MATCHES 0) + else (${TEST}_COMPILE ) + set (${TEST} "" CACHE INTERNAL ${msg}) + message (STATUS "${msg}... no") FILE (APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log "Test ${TEST} Compile failed with the following output:\n ${OUTPUT}\n" ) - ENDIF (${TEST}_COMPILE) + endif (${TEST}_COMPILE) - ENDIF("${TEST}" MATCHES "^${TEST}$") + endif ("${TEST}" MATCHES "^${TEST}$") ENDMACRO (H5ConversionTests) #----------------------------------------------------------------------------- # Macro to make some of the conversion tests easier to write/read #----------------------------------------------------------------------------- MACRO (H5MiscConversionTest VAR TEST msg) - IF ("${TEST}" MATCHES "^${TEST}$") - IF (${VAR}) - SET (${TEST} 1 CACHE INTERNAL ${msg}) - MESSAGE (STATUS "${msg}... yes") - ELSE (${VAR}) - SET (${TEST} "" CACHE INTERNAL ${msg}) - MESSAGE (STATUS "${msg}... no") - ENDIF (${VAR}) - ENDIF ("${TEST}" MATCHES "^${TEST}$") + if ("${TEST}" MATCHES "^${TEST}$") + if (${VAR}) + set (${TEST} 1 CACHE INTERNAL ${msg}) + message (STATUS "${msg}... yes") + else (${VAR}) + set (${TEST} "" CACHE INTERNAL ${msg}) + message (STATUS "${msg}... no") + endif (${VAR}) + endif ("${TEST}" MATCHES "^${TEST}$") ENDMACRO (H5MiscConversionTest) #----------------------------------------------------------------------------- @@ -1050,9 +1050,9 @@ H5MiscConversionTest (H5_SIZEOF_LONG_DOUBLE H5_LDOUBLE_TO_INTEGER_ACCURATE "chec # integers except 'unsigned long long'. Other HP-UX systems are unknown # yet. (1/8/05 - SLU) # -IF (NOT MSVC) +if (NOT MSVC) H5ConversionTests (H5_LDOUBLE_TO_INTEGER_WORKS "Checking IF converting from long double to integers works") -ENDIF (NOT MSVC) +endif (NOT MSVC) # ----------------------------------------------------------------------- # Set flag to indicate that the machine can handle conversion from # integers to long double. (This flag should be set "yes" for all @@ -1078,11 +1078,11 @@ H5ConversionTests (H5_ULONG_TO_FLOAT_ACCURATE "Checking IF accurately converting # 64-bit machines, where the short program below tests if round-up is # correctly handled. # -IF (CMAKE_SYSTEM MATCHES "solaris2.*") +if (CMAKE_SYSTEM MATCHES "solaris2.*") H5ConversionTests (H5_ULONG_TO_FP_BOTTOM_BIT_ACCURATE "Checking IF accurately converting unsigned long long to floating-point values") -ELSE (CMAKE_SYSTEM MATCHES "solaris2.*") - SET(H5_ULONG_TO_FP_BOTTOM_BIT_ACCURATE 1) -ENDIF (CMAKE_SYSTEM MATCHES "solaris2.*") +else (CMAKE_SYSTEM MATCHES "solaris2.*") + set (H5_ULONG_TO_FP_BOTTOM_BIT_ACCURATE 1) +endif (CMAKE_SYSTEM MATCHES "solaris2.*") # ---------------------------------------------------------------------- # Set the flag to indicate that the machine can accurately convert # 'float' or 'double' to 'unsigned long long' values. @@ -1110,19 +1110,19 @@ H5ConversionTests (H5_LDOUBLE_TO_UINT_ACCURATE "Checking IF correctly converting # 'unsigned long long' to 'float' and 'double' typecasts. # (This flag should be set for all machines.) # -IF (H5_ULLONG_TO_FP_CAST_WORKS MATCHES ^H5_ULLONG_TO_FP_CAST_WORKS$) - SET (H5_ULLONG_TO_FP_CAST_WORKS 1 CACHE INTERNAL "Checking IF compiling unsigned long long to floating-point typecasts work") - MESSAGE (STATUS "Checking IF compiling unsigned long long to floating-point typecasts work... yes") -ENDIF (H5_ULLONG_TO_FP_CAST_WORKS MATCHES ^H5_ULLONG_TO_FP_CAST_WORKS$) +if (H5_ULLONG_TO_FP_CAST_WORKS MATCHES ^H5_ULLONG_TO_FP_CAST_WORKS$) + set (H5_ULLONG_TO_FP_CAST_WORKS 1 CACHE INTERNAL "Checking IF compiling unsigned long long to floating-point typecasts work") + message (STATUS "Checking IF compiling unsigned long long to floating-point typecasts work... yes") +endif (H5_ULLONG_TO_FP_CAST_WORKS MATCHES ^H5_ULLONG_TO_FP_CAST_WORKS$) # ---------------------------------------------------------------------- # Set the flag to indicate that the machine can _compile_ # 'long long' to 'float' and 'double' typecasts. # (This flag should be set for all machines.) # -IF (H5_LLONG_TO_FP_CAST_WORKS MATCHES ^H5_LLONG_TO_FP_CAST_WORKS$) - SET (H5_LLONG_TO_FP_CAST_WORKS 1 CACHE INTERNAL "Checking IF compiling long long to floating-point typecasts work") - MESSAGE (STATUS "Checking IF compiling long long to floating-point typecasts work... yes") -ENDIF (H5_LLONG_TO_FP_CAST_WORKS MATCHES ^H5_LLONG_TO_FP_CAST_WORKS$) +if (H5_LLONG_TO_FP_CAST_WORKS MATCHES ^H5_LLONG_TO_FP_CAST_WORKS$) + set (H5_LLONG_TO_FP_CAST_WORKS 1 CACHE INTERNAL "Checking IF compiling long long to floating-point typecasts work") + message (STATUS "Checking IF compiling long long to floating-point typecasts work... yes") +endif (H5_LLONG_TO_FP_CAST_WORKS MATCHES ^H5_LLONG_TO_FP_CAST_WORKS$) # ---------------------------------------------------------------------- # Set the flag to indicate that the machine can convert from # 'unsigned long long' to 'long double' without precision loss. @@ -1130,9 +1130,9 @@ ENDIF (H5_LLONG_TO_FP_CAST_WORKS MATCHES ^H5_LLONG_TO_FP_CAST_WORKS$) # where the last 2 bytes of mantissa are lost when compiler tries to do # the conversion, and Cygwin where compiler doesn't do rounding correctly.) # -IF (NOT MSVC) +if (NOT MSVC) H5ConversionTests (H5_ULLONG_TO_LDOUBLE_PRECISION "Checking IF converting unsigned long long to long double with precision") -ENDIF (NOT MSVC) +endif (NOT MSVC) # ---------------------------------------------------------------------- # Set the flag to indicate that the machine can handle overflow converting # all floating-point to all integer types. @@ -1150,10 +1150,10 @@ H5ConversionTests (H5_FP_TO_INTEGER_OVERFLOW_WORKS "Checking IF overflows norma # The machine's conversion gets the correct value. We define the macro and disable # this kind of test until we figure out what algorithm they use. # -IF (H5_LDOUBLE_TO_LONG_SPECIAL MATCHES ^H5_LDOUBLE_TO_LONG_SPECIAL$) - SET (H5_LDOUBLE_TO_LONG_SPECIAL 0 CACHE INTERNAL "Define if your system converts long double to (unsigned) long values with special algorithm") - MESSAGE (STATUS "Checking IF your system converts long double to (unsigned) long values with special algorithm... no") -ENDIF (H5_LDOUBLE_TO_LONG_SPECIAL MATCHES ^H5_LDOUBLE_TO_LONG_SPECIAL$) +if (H5_LDOUBLE_TO_LONG_SPECIAL MATCHES ^H5_LDOUBLE_TO_LONG_SPECIAL$) + set (H5_LDOUBLE_TO_LONG_SPECIAL 0 CACHE INTERNAL "Define if your system converts long double to (unsigned) long values with special algorithm") + message (STATUS "Checking IF your system converts long double to (unsigned) long values with special algorithm... no") +endif (H5_LDOUBLE_TO_LONG_SPECIAL MATCHES ^H5_LDOUBLE_TO_LONG_SPECIAL$) # ---------------------------------------------------------------------- # Set the flag to indicate that the machine is using a special algorithm # to convert some values of '(unsigned) long' to 'long double' values. @@ -1162,10 +1162,10 @@ ENDIF (H5_LDOUBLE_TO_LONG_SPECIAL MATCHES ^H5_LDOUBLE_TO_LONG_SPECIAL$) # ..., 7fffff..., the compiler uses a unknown algorithm. We define a # macro and skip the test for now until we know about the algorithm. # -IF (H5_LONG_TO_LDOUBLE_SPECIAL MATCHES ^H5_LONG_TO_LDOUBLE_SPECIAL$) - SET (H5_LONG_TO_LDOUBLE_SPECIAL 0 CACHE INTERNAL "Define if your system can convert (unsigned) long to long double values with special algorithm") - MESSAGE (STATUS "Checking IF your system can convert (unsigned) long to long double values with special algorithm... no") -ENDIF (H5_LONG_TO_LDOUBLE_SPECIAL MATCHES ^H5_LONG_TO_LDOUBLE_SPECIAL$) +if (H5_LONG_TO_LDOUBLE_SPECIAL MATCHES ^H5_LONG_TO_LDOUBLE_SPECIAL$) + set (H5_LONG_TO_LDOUBLE_SPECIAL 0 CACHE INTERNAL "Define if your system can convert (unsigned) long to long double values with special algorithm") + message (STATUS "Checking IF your system can convert (unsigned) long to long double values with special algorithm... no") +endif (H5_LONG_TO_LDOUBLE_SPECIAL MATCHES ^H5_LONG_TO_LDOUBLE_SPECIAL$) # ---------------------------------------------------------------------- # Set the flag to indicate that the machine can accurately convert # 'long double' to '(unsigned) long long' values. (This flag should be set for @@ -1190,10 +1190,10 @@ H5ConversionTests (H5_LLONG_TO_LDOUBLE_CORRECT "Checking IF correctly converting # (This flag should be set to no for all machines, except for SGI IRIX64, # where the cache value is set to yes in it's config file) # -IF (H5_BAD_LOG2_CODE_GENERATED MATCHES ^H5_BAD_LOG2_CODE_GENERATED$) - SET (H5_BAD_LOG2_CODE_GENERATED 0 CACHE INTERNAL "Define if your system generates wrong code for log2 routine") - MESSAGE (STATUS "Checking IF your system generates wrong code for log2 routine... no") -ENDIF (H5_BAD_LOG2_CODE_GENERATED MATCHES ^H5_BAD_LOG2_CODE_GENERATED$) +if (H5_BAD_LOG2_CODE_GENERATED MATCHES ^H5_BAD_LOG2_CODE_GENERATED$) + set (H5_BAD_LOG2_CODE_GENERATED 0 CACHE INTERNAL "Define if your system generates wrong code for log2 routine") + message (STATUS "Checking IF your system generates wrong code for log2 routine... no") +endif (H5_BAD_LOG2_CODE_GENERATED MATCHES ^H5_BAD_LOG2_CODE_GENERATED$) # ---------------------------------------------------------------------- # Check if pointer alignments are enforced # @@ -1201,21 +1201,21 @@ H5ConversionTests (H5_NO_ALIGNMENT_RESTRICTIONS "Checking IF alignment restricti # Define a macro for Cygwin (on XP only) where the compiler has rounding # problem converting from unsigned long long to long double */ -IF (CYGWIN) - SET (H5_CYGWIN_ULLONG_TO_LDOUBLE_ROUND_PROBLEM 1) -ENDIF (CYGWIN) +if (CYGWIN) + set (H5_CYGWIN_ULLONG_TO_LDOUBLE_ROUND_PROBLEM 1) +endif (CYGWIN) # ----------------------------------------------------------------------- # wrapper script variables # -SET (prefix ${CMAKE_INSTALL_PREFIX}) -SET (exec_prefix "\${prefix}") -SET (libdir "${exec_prefix}/lib") -SET (includedir "\${prefix}/include") -SET (host_os ${CMAKE_HOST_SYSTEM_NAME}) -SET (CC ${CMAKE_C_COMPILER}) -SET (CXX ${CMAKE_CXX_COMPILER}) -SET (FC ${CMAKE_Fortran_COMPILER}) -FOREACH (LINK_LIB ${LINK_LIBS}) - SET (LIBS "${LIBS} -l${LINK_LIB}") -ENDFOREACH (LINK_LIB ${LINK_LIBS}) +set (prefix ${CMAKE_INSTALL_PREFIX}) +set (exec_prefix "\${prefix}") +set (libdir "${exec_prefix}/lib") +set (includedir "\${prefix}/include") +set (host_os ${CMAKE_HOST_SYSTEM_NAME}) +set (CC ${CMAKE_C_COMPILER}) +set (CXX ${CMAKE_CXX_COMPILER}) +set (FC ${CMAKE_Fortran_COMPILER}) +foreach (LINK_LIB ${LINK_LIBS}) + set (LIBS "${LIBS} -l${LINK_LIB}") +endforeach (LINK_LIB ${LINK_LIBS}) diff --git a/config/cmake/FindHDF5.cmake.in b/config/cmake/FindHDF5.cmake.in index 1b51ed4..0ac8bc9 100644 --- a/config/cmake/FindHDF5.cmake.in +++ b/config/cmake/FindHDF5.cmake.in @@ -38,18 +38,18 @@ # To aid in finding HDF5 as part of a subproject set # HDF5_ROOT_DIR_HINT to the location where @HDF5_PACKAGE@@HDF_PACKAGE_EXT@-config.cmake lies -INCLUDE (SelectLibraryConfigurations) -INCLUDE (FindPackageHandleStandardArgs) +include (SelectLibraryConfigurations) +include (FindPackageHandleStandardArgs) # The HINTS option should only be used for values computed from the system. -SET (_HDF5_HINTS +set (_HDF5_HINTS $ENV{HOME}/.local $ENV{HDF5_ROOT} $ENV{HDF5_ROOT_DIR_HINT} ) # Hard-coded guesses should still go in PATHS. This ensures that the user # environment can always override hard guesses. -SET (_HDF5_PATHS +set (_HDF5_PATHS $ENV{HOME}/.local $ENV{HDF5_ROOT} $ENV{HDF5_ROOT_DIR_HINT} @@ -78,9 +78,9 @@ FIND_PATH (HDF5_INCLUDE_DIRS "H5public.h" # For backwards compatibility we set HDF5_INCLUDE_DIR to the value of # HDF5_INCLUDE_DIRS -SET ( HDF5_INCLUDE_DIR "${HDF5_INCLUDE_DIRS}" ) +set ( HDF5_INCLUDE_DIR "${HDF5_INCLUDE_DIRS}" ) -IF (HDF5_INCLUDE_DIR) - SET (HDF5_FOUND "YES") - INCLUDE (${HDF5_ROOT_DIR}/@HDF5_PACKAGE@@HDF_PACKAGE_EXT@-config.cmake) -ENDIF (HDF5_INCLUDE_DIR) +if (HDF5_INCLUDE_DIR) + set (HDF5_FOUND "YES") + include (${HDF5_ROOT_DIR}/@HDF5_PACKAGE@@HDF_PACKAGE_EXT@-config.cmake) +endif (HDF5_INCLUDE_DIR) diff --git a/config/cmake/FindSZIP.cmake b/config/cmake/FindSZIP.cmake index b358862..f657cfa 100644 --- a/config/cmake/FindSZIP.cmake +++ b/config/cmake/FindSZIP.cmake @@ -11,7 +11,7 @@ # SZIP_LIBRARY_DEBUG - Debug version of SZIP library # SZIP_LIBRARY_RELEASE - Release Version of SZIP library -# MESSAGE (STATUS "Finding SZIP library and headers..." ) +# message (STATUS "Finding SZIP library and headers..." ) ############################################ # @@ -25,41 +25,41 @@ ######################################################################### MACRO (SZIP_ADJUST_LIB_VARS basename) - IF (${basename}_INCLUDE_DIR) + if (${basename}_INCLUDE_DIR) # if only the release version was found, set the debug variable also to the release version - IF (${basename}_LIBRARY_RELEASE AND NOT ${basename}_LIBRARY_DEBUG) - SET (${basename}_LIBRARY_DEBUG ${${basename}_LIBRARY_RELEASE}) - SET (${basename}_LIBRARY ${${basename}_LIBRARY_RELEASE}) - SET (${basename}_LIBRARIES ${${basename}_LIBRARY_RELEASE}) - ENDIF (${basename}_LIBRARY_RELEASE AND NOT ${basename}_LIBRARY_DEBUG) + if (${basename}_LIBRARY_RELEASE AND NOT ${basename}_LIBRARY_DEBUG) + set (${basename}_LIBRARY_DEBUG ${${basename}_LIBRARY_RELEASE}) + set (${basename}_LIBRARY ${${basename}_LIBRARY_RELEASE}) + set (${basename}_LIBRARIES ${${basename}_LIBRARY_RELEASE}) + endif (${basename}_LIBRARY_RELEASE AND NOT ${basename}_LIBRARY_DEBUG) # if only the debug version was found, set the release variable also to the debug version - IF (${basename}_LIBRARY_DEBUG AND NOT ${basename}_LIBRARY_RELEASE) - SET (${basename}_LIBRARY_RELEASE ${${basename}_LIBRARY_DEBUG}) - SET (${basename}_LIBRARY ${${basename}_LIBRARY_DEBUG}) - SET (${basename}_LIBRARIES ${${basename}_LIBRARY_DEBUG}) - ENDIF (${basename}_LIBRARY_DEBUG AND NOT ${basename}_LIBRARY_RELEASE) - IF (${basename}_LIBRARY_DEBUG AND ${basename}_LIBRARY_RELEASE) + if (${basename}_LIBRARY_DEBUG AND NOT ${basename}_LIBRARY_RELEASE) + set (${basename}_LIBRARY_RELEASE ${${basename}_LIBRARY_DEBUG}) + set (${basename}_LIBRARY ${${basename}_LIBRARY_DEBUG}) + set (${basename}_LIBRARIES ${${basename}_LIBRARY_DEBUG}) + endif (${basename}_LIBRARY_DEBUG AND NOT ${basename}_LIBRARY_RELEASE) + if (${basename}_LIBRARY_DEBUG AND ${basename}_LIBRARY_RELEASE) # if the generator supports configuration types then set # optimized and debug libraries, or if the CMAKE_BUILD_TYPE has a value - IF (CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE) - SET (${basename}_LIBRARY optimized ${${basename}_LIBRARY_RELEASE} debug ${${basename}_LIBRARY_DEBUG}) + if (CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE) + set (${basename}_LIBRARY optimized ${${basename}_LIBRARY_RELEASE} debug ${${basename}_LIBRARY_DEBUG}) ELSE(CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE) # if there are no configuration types and CMAKE_BUILD_TYPE has no value # then just use the release libraries - SET (${basename}_LIBRARY ${${basename}_LIBRARY_RELEASE} ) - ENDIF (CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE) - SET (${basename}_LIBRARIES optimized ${${basename}_LIBRARY_RELEASE} debug ${${basename}_LIBRARY_DEBUG}) - ENDIF (${basename}_LIBRARY_DEBUG AND ${basename}_LIBRARY_RELEASE) + set (${basename}_LIBRARY ${${basename}_LIBRARY_RELEASE} ) + endif (CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE) + set (${basename}_LIBRARIES optimized ${${basename}_LIBRARY_RELEASE} debug ${${basename}_LIBRARY_DEBUG}) + endif (${basename}_LIBRARY_DEBUG AND ${basename}_LIBRARY_RELEASE) - SET (${basename}_LIBRARY ${${basename}_LIBRARY} CACHE FILEPATH "The ${basename} library") + set (${basename}_LIBRARY ${${basename}_LIBRARY} CACHE FILEPATH "The ${basename} library") - IF (${basename}_LIBRARY) - SET (${basename}_FOUND 1) - ENDIF (${basename}_LIBRARY) + if (${basename}_LIBRARY) + set (${basename}_FOUND 1) + endif (${basename}_LIBRARY) - ENDIF (${basename}_INCLUDE_DIR ) + endif (${basename}_INCLUDE_DIR ) # Make variables changeble to the advanced user MARK_AS_ADVANCED (${basename}_LIBRARY ${basename}_LIBRARY_RELEASE ${basename}_LIBRARY_DEBUG ${basename}_INCLUDE_DIR ) @@ -67,19 +67,19 @@ ENDMACRO (SZIP_ADJUST_LIB_VARS) # Look for the header file. -SET (SZIP_INCLUDE_SEARCH_DIRS +set (SZIP_INCLUDE_SEARCH_DIRS $ENV{SZIP_INSTALL}/include $ENV{SZIP_INSTALL}/include/szip /usr/include /usr/include/szip ) -SET (SZIP_LIB_SEARCH_DIRS +set (SZIP_LIB_SEARCH_DIRS $ENV{SZIP_INSTALL}/lib /usr/lib ) -SET (SZIP_BIN_SEARCH_DIRS +set (SZIP_BIN_SEARCH_DIRS $ENV{SZIP_INSTALL}/bin /usr/bin ) @@ -90,13 +90,13 @@ FIND_PATH (SZIP_INCLUDE_DIR NO_DEFAULT_PATH ) -IF (WIN32) - SET (SZIP_SEARCH_DEBUG_NAMES "sz_d;libsz_d") - SET (SZIP_SEARCH_RELEASE_NAMES "sz;libsz;libszip") -ELSE (WIN32) - SET (SZIP_SEARCH_DEBUG_NAMES "sz_d") - SET (SZIP_SEARCH_RELEASE_NAMES "sz;szip") -ENDIF (WIN32) +if (WIN32) + set (SZIP_SEARCH_DEBUG_NAMES "sz_d;libsz_d") + set (SZIP_SEARCH_RELEASE_NAMES "sz;libsz;libszip") +else (WIN32) + set (SZIP_SEARCH_DEBUG_NAMES "sz_d") + set (SZIP_SEARCH_RELEASE_NAMES "sz;szip") +endif (WIN32) # Look for the library. FIND_LIBRARY (SZIP_LIBRARY_DEBUG @@ -113,67 +113,67 @@ FIND_LIBRARY (SZIP_LIBRARY_RELEASE SZIP_ADJUST_LIB_VARS (SZIP) -IF (SZIP_INCLUDE_DIR AND SZIP_LIBRARY) - SET (SZIP_FOUND 1) - SET (SZIP_LIBRARIES ${SZIP_LIBRARY}) - SET (SZIP_INCLUDE_DIRS ${SZIP_INCLUDE_DIR}) - IF (SZIP_LIBRARY_DEBUG) +if (SZIP_INCLUDE_DIR AND SZIP_LIBRARY) + set (SZIP_FOUND 1) + set (SZIP_LIBRARIES ${SZIP_LIBRARY}) + set (SZIP_INCLUDE_DIRS ${SZIP_INCLUDE_DIR}) + if (SZIP_LIBRARY_DEBUG) GET_FILENAME_COMPONENT (SZIP_LIBRARY_PATH ${SZIP_LIBRARY_DEBUG} PATH) - SET (SZIP_LIB_DIR ${SZIP_LIBRARY_PATH}) - ELSEIF (SZIP_LIBRARY_RELEASE) + set (SZIP_LIB_DIR ${SZIP_LIBRARY_PATH}) + elseif (SZIP_LIBRARY_RELEASE) GET_FILENAME_COMPONENT (SZIP_LIBRARY_PATH ${SZIP_LIBRARY_RELEASE} PATH) - SET (SZIP_LIB_DIR ${SZIP_LIBRARY_PATH}) - ENDIF (SZIP_LIBRARY_DEBUG) + set (SZIP_LIB_DIR ${SZIP_LIBRARY_PATH}) + endif (SZIP_LIBRARY_DEBUG) -ELSE (SZIP_INCLUDE_DIR AND SZIP_LIBRARY) - SET (SZIP_FOUND 0) - SET (SZIP_LIBRARIES) - SET (SZIP_INCLUDE_DIRS) -ENDIF (SZIP_INCLUDE_DIR AND SZIP_LIBRARY) +else (SZIP_INCLUDE_DIR AND SZIP_LIBRARY) + set (SZIP_FOUND 0) + set (SZIP_LIBRARIES) + set (SZIP_INCLUDE_DIRS) +endif (SZIP_INCLUDE_DIR AND SZIP_LIBRARY) # Report the results. -IF (NOT SZIP_FOUND) - SET (SZIP_DIR_MESSAGE +if (NOT SZIP_FOUND) + set (SZIP_DIR_MESSAGE "SZip was not found. Make sure SZIP_LIBRARY and SZIP_INCLUDE_DIR are set or set the SZIP_INSTALL environment variable." ) - IF (NOT SZIP_FIND_QUIETLY) - MESSAGE (STATUS "${SZIP_DIR_MESSAGE}") - ELSE (NOT SZIP_FIND_QUIETLY) - IF (SZIP_FIND_REQUIRED) - MESSAGE (FATAL_ERROR "SZip was NOT found and is Required by this project") - ENDIF (SZIP_FIND_REQUIRED) - ENDIF (NOT SZIP_FIND_QUIETLY) -ENDIF (NOT SZIP_FOUND) - -IF (SZIP_FOUND) - INCLUDE (CheckSymbolExists) + if (NOT SZIP_FIND_QUIETLY) + message (STATUS "${SZIP_DIR_MESSAGE}") + else (NOT SZIP_FIND_QUIETLY) + if (SZIP_FIND_REQUIRED) + message (FATAL_ERROR "SZip was NOT found and is Required by this project") + endif (SZIP_FIND_REQUIRED) + endif (NOT SZIP_FIND_QUIETLY) +endif (NOT SZIP_FOUND) + +if (SZIP_FOUND) + include (CheckSymbolExists) ############################################# # Find out if SZIP was build using dll's ############################################# # Save required variable - SET (CMAKE_REQUIRED_INCLUDES_SAVE ${CMAKE_REQUIRED_INCLUDES}) - SET (CMAKE_REQUIRED_FLAGS_SAVE ${CMAKE_REQUIRED_FLAGS}) + set (CMAKE_REQUIRED_INCLUDES_SAVE ${CMAKE_REQUIRED_INCLUDES}) + set (CMAKE_REQUIRED_FLAGS_SAVE ${CMAKE_REQUIRED_FLAGS}) # Add SZIP_INCLUDE_DIR to CMAKE_REQUIRED_INCLUDES - SET (CMAKE_REQUIRED_INCLUDES "${CMAKE_REQUIRED_INCLUDES};${SZIP_INCLUDE_DIRS}") + set (CMAKE_REQUIRED_INCLUDES "${CMAKE_REQUIRED_INCLUDES};${SZIP_INCLUDE_DIRS}") CHECK_SYMBOL_EXISTS (SZIP_BUILT_AS_DYNAMIC_LIB "SZconfig.h" HAVE_SZIP_DLL) - IF (HAVE_SZIP_DLL STREQUAL "TRUE") - SET (HAVE_SZIP_DLL "1") - ENDIF (HAVE_SZIP_DLL STREQUAL "TRUE") + if (HAVE_SZIP_DLL STREQUAL "TRUE") + set (HAVE_SZIP_DLL "1") + endif (HAVE_SZIP_DLL STREQUAL "TRUE") # Restore CMAKE_REQUIRED_INCLUDES and CMAKE_REQUIRED_FLAGS variables - SET (CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES_SAVE}) - SET (CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS_SAVE}) + set (CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES_SAVE}) + set (CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS_SAVE}) # ############################################# -ENDIF (SZIP_FOUND) - -IF (FIND_SZIP_DEBUG) - MESSAGE (STATUS "SZIP_INCLUDE_DIR: ${SZIP_INCLUDE_DIR}") - MESSAGE (STATUS "SZIP_INCLUDE_DIRS: ${SZIP_INCLUDE_DIRS}") - MESSAGE (STATUS "SZIP_LIBRARY_DEBUG: ${SZIP_LIBRARY_DEBUG}") - MESSAGE (STATUS "SZIP_LIBRARY_RELEASE: ${SZIP_LIBRARY_RELEASE}") - MESSAGE (STATUS "HAVE_SZIP_DLL: ${HAVE_SZIP_DLL}") - MESSAGE (STATUS "CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}") -ENDIF (FIND_SZIP_DEBUG) +endif (SZIP_FOUND) + +if (FIND_SZIP_DEBUG) + message (STATUS "SZIP_INCLUDE_DIR: ${SZIP_INCLUDE_DIR}") + message (STATUS "SZIP_INCLUDE_DIRS: ${SZIP_INCLUDE_DIRS}") + message (STATUS "SZIP_LIBRARY_DEBUG: ${SZIP_LIBRARY_DEBUG}") + message (STATUS "SZIP_LIBRARY_RELEASE: ${SZIP_LIBRARY_RELEASE}") + message (STATUS "HAVE_SZIP_DLL: ${HAVE_SZIP_DLL}") + message (STATUS "CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}") +endif (FIND_SZIP_DEBUG) diff --git a/config/cmake/HDF5Macros.cmake b/config/cmake/HDF5Macros.cmake index 3e6ee18..d0379db 100644 --- a/config/cmake/HDF5Macros.cmake +++ b/config/cmake/HDF5Macros.cmake @@ -1,31 +1,31 @@ #------------------------------------------------------------------------------- MACRO (H5_SET_LIB_OPTIONS libtarget libname libtype) - SET (LIB_OUT_NAME "${libname}") - IF (${libtype} MATCHES "SHARED") - IF (WIN32) - SET (LIBHDF_VERSION ${HDF5_PACKAGE_VERSION_MAJOR}) - ELSE (WIN32) - SET (LIBHDF_VERSION ${HDF5_PACKAGE_VERSION}) - ENDIF (WIN32) - SET_TARGET_PROPERTIES (${libtarget} PROPERTIES VERSION ${LIBHDF_VERSION}) - IF (WIN32) - SET (${LIB_OUT_NAME} "${LIB_OUT_NAME}-${HDF5_PACKAGE_SOVERSION}") - ELSE (WIN32) - SET_TARGET_PROPERTIES (${libtarget} PROPERTIES SOVERSION ${HDF5_PACKAGE_SOVERSION}) - ENDIF (WIN32) - ENDIF (${libtype} MATCHES "SHARED") + set (LIB_OUT_NAME "${libname}") + if (${libtype} MATCHES "SHARED") + if (WIN32) + set (LIBHDF_VERSION ${HDF5_PACKAGE_VERSION_MAJOR}) + else (WIN32) + set (LIBHDF_VERSION ${HDF5_PACKAGE_VERSION}) + endif (WIN32) + set_target_properties (${libtarget} PROPERTIES VERSION ${LIBHDF_VERSION}) + if (WIN32) + set (${LIB_OUT_NAME} "${LIB_OUT_NAME}-${HDF5_PACKAGE_SOVERSION}") + else (WIN32) + set_target_properties (${libtarget} PROPERTIES SOVERSION ${HDF5_PACKAGE_SOVERSION}) + endif (WIN32) + endif (${libtype} MATCHES "SHARED") HDF_SET_LIB_OPTIONS (${libtarget} ${LIB_OUT_NAME} ${libtype}) #-- Apple Specific install_name for libraries - IF (APPLE) - OPTION (HDF5_BUILD_WITH_INSTALL_NAME "Build with library install_name set to the installation path" OFF) - IF (HDF5_BUILD_WITH_INSTALL_NAME) + if (APPLE) + option (HDF5_BUILD_WITH_INSTALL_NAME "Build with library install_name set to the installation path" OFF) + if (HDF5_BUILD_WITH_INSTALL_NAME) SET_TARGET_PROPERTIES(${libtarget} PROPERTIES LINK_FLAGS "-current_version ${HDF5_PACKAGE_VERSION} -compatibility_version ${HDF5_PACKAGE_VERSION}" INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/lib" BUILD_WITH_INSTALL_RPATH ${HDF5_BUILD_WITH_INSTALL_NAME} ) - ENDIF (HDF5_BUILD_WITH_INSTALL_NAME) - ENDIF (APPLE) + endif (HDF5_BUILD_WITH_INSTALL_NAME) + endif (APPLE) ENDMACRO (H5_SET_LIB_OPTIONS) diff --git a/config/cmake/HDF5UseFortran.cmake b/config/cmake/HDF5UseFortran.cmake index 8fa76b8..69ff5b3 100644 --- a/config/cmake/HDF5UseFortran.cmake +++ b/config/cmake/HDF5UseFortran.cmake @@ -7,7 +7,7 @@ ENABLE_LANGUAGE (Fortran) #----------------------------------------------------------------------------- # Detect name mangling convention used between Fortran and C #----------------------------------------------------------------------------- -INCLUDE (FortranCInterface) +include (FortranCInterface) FortranCInterface_HEADER ( ${CMAKE_BINARY_DIR}/FCMangle.h MACRO_NAMESPACE "H5_FC_" @@ -16,26 +16,26 @@ FortranCInterface_HEADER ( ) FILE (STRINGS ${CMAKE_BINARY_DIR}/FCMangle.h CONTENTS REGEX "H5_FC_GLOBAL\\(.*,.*\\) +(.*)") -STRING (REGEX MATCH "H5_FC_GLOBAL\\(.*,.*\\) +(.*)" RESULT ${CONTENTS}) -SET (H5_FC_FUNC "H5_FC_FUNC(name,NAME) ${CMAKE_MATCH_1}") +string (REGEX MATCH "H5_FC_GLOBAL\\(.*,.*\\) +(.*)" RESULT ${CONTENTS}) +set (H5_FC_FUNC "H5_FC_FUNC(name,NAME) ${CMAKE_MATCH_1}") FILE (STRINGS ${CMAKE_BINARY_DIR}/FCMangle.h CONTENTS REGEX "H5_FC_GLOBAL_\\(.*,.*\\) +(.*)") -STRING (REGEX MATCH "H5_FC_GLOBAL_\\(.*,.*\\) +(.*)" RESULT ${CONTENTS}) -SET (H5_FC_FUNC_ "H5_FC_FUNC_(name,NAME) ${CMAKE_MATCH_1}") +string (REGEX MATCH "H5_FC_GLOBAL_\\(.*,.*\\) +(.*)" RESULT ${CONTENTS}) +set (H5_FC_FUNC_ "H5_FC_FUNC_(name,NAME) ${CMAKE_MATCH_1}") #----------------------------------------------------------------------------- # The provided CMake Fortran macros don't provide a general check function # so this one is used for a sizeof test. #----------------------------------------------------------------------------- MACRO (CHECK_FORTRAN_FEATURE FUNCTION CODE VARIABLE) - IF (NOT DEFINED ${VARIABLE}) - MESSAGE (STATUS "Testing Fortran ${FUNCTION}") - IF (CMAKE_REQUIRED_LIBRARIES) - SET (CHECK_FUNCTION_EXISTS_ADD_LIBRARIES + if (NOT DEFINED ${VARIABLE}) + message (STATUS "Testing Fortran ${FUNCTION}") + if (CMAKE_REQUIRED_LIBRARIES) + set (CHECK_FUNCTION_EXISTS_ADD_LIBRARIES "-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}") - ELSE (CMAKE_REQUIRED_LIBRARIES) - SET (CHECK_FUNCTION_EXISTS_ADD_LIBRARIES) - ENDIF (CMAKE_REQUIRED_LIBRARIES) + else (CMAKE_REQUIRED_LIBRARIES) + set (CHECK_FUNCTION_EXISTS_ADD_LIBRARIES) + endif (CMAKE_REQUIRED_LIBRARIES) FILE (WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testFortranCompiler.f "${CODE}" @@ -47,25 +47,25 @@ MACRO (CHECK_FORTRAN_FEATURE FUNCTION CODE VARIABLE) OUTPUT_VARIABLE OUTPUT ) -# MESSAGE ( "* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ") -# MESSAGE ( "Test result ${OUTPUT}") -# MESSAGE ( "* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ") +# message ( "* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ") +# message ( "Test result ${OUTPUT}") +# message ( "* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ") - IF (${VARIABLE}) - SET (${VARIABLE} 1 CACHE INTERNAL "Have Fortran function ${FUNCTION}") - MESSAGE (STATUS "Testing Fortran ${FUNCTION} - OK") + if (${VARIABLE}) + set (${VARIABLE} 1 CACHE INTERNAL "Have Fortran function ${FUNCTION}") + message (STATUS "Testing Fortran ${FUNCTION} - OK") FILE (APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log "Determining if the Fortran ${FUNCTION} exists passed with the following output:\n" "${OUTPUT}\n\n" ) - ELSE (${VARIABLE}) - MESSAGE (STATUS "Testing Fortran ${FUNCTION} - Fail") - SET (${VARIABLE} "" CACHE INTERNAL "Have Fortran function ${FUNCTION}") + else (${VARIABLE}) + message (STATUS "Testing Fortran ${FUNCTION} - Fail") + set (${VARIABLE} "" CACHE INTERNAL "Have Fortran function ${FUNCTION}") FILE (APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log "Determining if the Fortran ${FUNCTION} exists failed with the following output:\n" "${OUTPUT}\n\n") - ENDIF (${VARIABLE}) - ENDIF (NOT DEFINED ${VARIABLE}) + endif (${VARIABLE}) + endif (NOT DEFINED ${VARIABLE}) ENDMACRO (CHECK_FORTRAN_FEATURE) #----------------------------------------------------------------------------- @@ -131,9 +131,9 @@ CHECK_FORTRAN_FEATURE(iso_c_binding #----------------------------------------------------------------------------- # Add debug information (intel Fortran : JB) #----------------------------------------------------------------------------- -IF (CMAKE_Fortran_COMPILER MATCHES ifort) - IF (WIN32) - SET (CMAKE_Fortran_FLAGS_DEBUG "/debug:full /dbglibs " CACHE "flags" STRING FORCE) - SET (CMAKE_EXE_LINKER_FLAGS_DEBUG "/DEBUG" CACHE "flags" STRING FORCE) - ENDIF (WIN32) -ENDIF (CMAKE_Fortran_COMPILER MATCHES ifort) +if (CMAKE_Fortran_COMPILER MATCHES ifort) + if (WIN32) + set (CMAKE_Fortran_FLAGS_DEBUG "/debug:full /dbglibs " CACHE "flags" STRING FORCE) + set (CMAKE_EXE_LINKER_FLAGS_DEBUG "/DEBUG" CACHE "flags" STRING FORCE) + endif (WIN32) +endif (CMAKE_Fortran_COMPILER MATCHES ifort) diff --git a/config/cmake/HDFLibMacros.cmake b/config/cmake/HDFLibMacros.cmake index 57e6be7..505a9d5 100644 --- a/config/cmake/HDFLibMacros.cmake +++ b/config/cmake/HDFLibMacros.cmake @@ -3,7 +3,7 @@ MACRO (EXTERNAL_JPEG_LIBRARY compress_type libtype jpeg_pic) # May need to build JPEG with PIC on x64 machines with gcc # Need to use CMAKE_ANSI_CFLAGS define so that compiler test works - IF (${compress_type} MATCHES "SVN") + if (${compress_type} MATCHES "SVN") EXTERNALPROJECT_ADD (JPEG SVN_REPOSITORY ${JPEG_URL} # [SVN_REVISION rev] @@ -19,7 +19,7 @@ MACRO (EXTERNAL_JPEG_LIBRARY compress_type libtype jpeg_pic) -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY:PATH=${CMAKE_ARCHIVE_OUTPUT_DIRECTORY} -DCMAKE_ANSI_CFLAGS:STRING=${jpeg_pic} ) - ELSEIF (${compress_type} MATCHES "TGZ") + elseif (${compress_type} MATCHES "TGZ") EXTERNALPROJECT_ADD (JPEG URL ${JPEG_URL} URL_MD5 "" @@ -35,72 +35,72 @@ MACRO (EXTERNAL_JPEG_LIBRARY compress_type libtype jpeg_pic) -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY:PATH=${CMAKE_ARCHIVE_OUTPUT_DIRECTORY} -DCMAKE_ANSI_CFLAGS:STRING=${jpeg_pic} ) - ENDIF (${compress_type} MATCHES "SVN") + endif (${compress_type} MATCHES "SVN") EXTERNALPROJECT_GET_PROPERTY (JPEG BINARY_DIR SOURCE_DIR) - IF (${CMAKE_BUILD_TYPE} MATCHES "Debug") - IF (WIN32) - SET (JPEG_LIB_NAME "jpeg_D") - ELSE (WIN32) - SET (JPEG_LIB_NAME "jpeg_debug") - ENDIF (WIN32) - ELSE (${CMAKE_BUILD_TYPE} MATCHES "Debug") - SET (JPEG_LIB_NAME "jpeg") - ENDIF (${CMAKE_BUILD_TYPE} MATCHES "Debug") + if (${CMAKE_BUILD_TYPE} MATCHES "Debug") + if (WIN32) + set (JPEG_LIB_NAME "jpeg_D") + else (WIN32) + set (JPEG_LIB_NAME "jpeg_debug") + endif (WIN32) + else (${CMAKE_BUILD_TYPE} MATCHES "Debug") + set (JPEG_LIB_NAME "jpeg") + endif (${CMAKE_BUILD_TYPE} MATCHES "Debug") # Create imported target szip ADD_LIBRARY(jpeg ${libtype} IMPORTED) ADD_DEPENDENCIES (jpeg JPEG) - IF (${libtype} MATCHES "SHARED") - IF (WIN32) - IF (MINGW) + if (${libtype} MATCHES "SHARED") + if (WIN32) + if (MINGW) SET_TARGET_PROPERTIES(jpeg PROPERTIES IMPORTED_IMPLIB "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${JPEG_LIB_NAME}.lib" IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${JPEG_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}" ) - ELSE (MINGW) + else (MINGW) SET_TARGET_PROPERTIES(jpeg PROPERTIES IMPORTED_IMPLIB "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_BUILD_TYPE}/${CMAKE_IMPORT_LIBRARY_PREFIX}${JPEG_LIB_NAME}${CMAKE_IMPORT_LIBRARY_SUFFIX}" IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_BUILD_TYPE}/${CMAKE_IMPORT_LIBRARY_PREFIX}${JPEG_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}" ) - ENDIF (MINGW) - ELSE (WIN32) - IF (CYGWIN) + endif (MINGW) + else (WIN32) + if (CYGWIN) SET_TARGET_PROPERTIES(jpeg PROPERTIES IMPORTED_IMPLIB "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_IMPORT_LIBRARY_PREFIX}${JPEG_LIB_NAME}${CMAKE_IMPORT_LIBRARY_SUFFIX}" IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_IMPORT_LIBRARY_PREFIX}${JPEG_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}" ) - ELSE (CYGWIN) + else (CYGWIN) SET_TARGET_PROPERTIES(jpeg PROPERTIES IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_SHARED_LIBRARY_PREFIX}${JPEG_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}" IMPORTED_SONAME "${CMAKE_SHARED_LIBRARY_PREFIX}${JPEG_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}.${JPEG_VERSION_STRING}" SOVERSION "${JPEG_VERSION_STRING}" ) - ENDIF (CYGWIN) - ENDIF (WIN32) - ELSE (${libtype} MATCHES "SHARED") - IF (WIN32 AND NOT MINGW) + endif (CYGWIN) + endif (WIN32) + else (${libtype} MATCHES "SHARED") + if (WIN32 AND NOT MINGW) SET_TARGET_PROPERTIES(jpeg PROPERTIES IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_BUILD_TYPE}/lib${JPEG_LIB_NAME}${CMAKE_STATIC_LIBRARY_SUFFIX}" IMPORTED_LINK_INTERFACE_LANGUAGES "C" ) - ELSE (WIN32 AND NOT MINGW) + else (WIN32 AND NOT MINGW) SET_TARGET_PROPERTIES(jpeg PROPERTIES IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/lib${JPEG_LIB_NAME}${CMAKE_STATIC_LIBRARY_SUFFIX}" IMPORTED_LINK_INTERFACE_LANGUAGES "C" ) - ENDIF (WIN32 AND NOT MINGW) - ENDIF (${libtype} MATCHES "SHARED") + endif (WIN32 AND NOT MINGW) + endif (${libtype} MATCHES "SHARED") -# INCLUDE (${BINARY_DIR}/JPEG-targets.cmake) - SET (JPEG_LIBRARY "jpeg") +# include (${BINARY_DIR}/JPEG-targets.cmake) + set (JPEG_LIBRARY "jpeg") - SET (JPEG_INCLUDE_DIR_GEN "${BINARY_DIR}") - SET (JPEG_INCLUDE_DIR "${SOURCE_DIR}/src") - SET (JPEG_FOUND 1) - SET (JPEG_LIBRARIES ${JPEG_LIBRARY}) - SET (JPEG_INCLUDE_DIRS ${JPEG_INCLUDE_DIR_GEN} ${JPEG_INCLUDE_DIR}) + set (JPEG_INCLUDE_DIR_GEN "${BINARY_DIR}") + set (JPEG_INCLUDE_DIR "${SOURCE_DIR}/src") + set (JPEG_FOUND 1) + set (JPEG_LIBRARIES ${JPEG_LIBRARY}) + set (JPEG_INCLUDE_DIRS ${JPEG_INCLUDE_DIR_GEN} ${JPEG_INCLUDE_DIR}) ENDMACRO (EXTERNAL_JPEG_LIBRARY) #------------------------------------------------------------------------------- @@ -109,15 +109,15 @@ MACRO (PACKAGE_JPEG_LIBRARY compress_type) COMMAND ${CMAKE_COMMAND} -E copy_if_different ${JPEG_INCLUDE_DIR_GEN}/jconfig.h ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ COMMENT "Copying ${JPEG_INCLUDE_DIR_GEN}/jconfig.h to ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/" ) - SET (EXTERNAL_HEADER_LIST ${EXTERNAL_HEADER_LIST} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/jconfig.h) - IF (${compress_type} MATCHES "SVN" OR ${compress_type} MATCHES "TGZ") + set (EXTERNAL_HEADER_LIST ${EXTERNAL_HEADER_LIST} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/jconfig.h) + if (${compress_type} MATCHES "SVN" OR ${compress_type} MATCHES "TGZ") ADD_DEPENDENCIES (JPEG-GenHeader-Copy JPEG) - ENDIF (${compress_type} MATCHES "SVN" OR ${compress_type} MATCHES "TGZ") + endif (${compress_type} MATCHES "SVN" OR ${compress_type} MATCHES "TGZ") ENDMACRO (PACKAGE_JPEG_LIBRARY) #------------------------------------------------------------------------------- MACRO (EXTERNAL_SZIP_LIBRARY compress_type libtype encoding) - IF (${compress_type} MATCHES "SVN") + if (${compress_type} MATCHES "SVN") EXTERNALPROJECT_ADD (SZIP SVN_REPOSITORY ${SZIP_URL} # [SVN_REVISION rev] @@ -134,7 +134,7 @@ MACRO (EXTERNAL_SZIP_LIBRARY compress_type libtype encoding) -DCMAKE_ANSI_CFLAGS:STRING=${CMAKE_ANSI_CFLAGS} -DSZIP_ENABLE_ENCODING:BOOL=${encoding} ) - ELSEIF (${compress_type} MATCHES "TGZ") + elseif (${compress_type} MATCHES "TGZ") EXTERNALPROJECT_ADD (SZIP URL ${SZIP_URL} URL_MD5 "" @@ -151,72 +151,72 @@ MACRO (EXTERNAL_SZIP_LIBRARY compress_type libtype encoding) -DCMAKE_ANSI_CFLAGS:STRING=${CMAKE_ANSI_CFLAGS} -DSZIP_ENABLE_ENCODING:BOOL=${encoding} ) - ENDIF (${compress_type} MATCHES "SVN") + endif (${compress_type} MATCHES "SVN") EXTERNALPROJECT_GET_PROPERTY (SZIP BINARY_DIR SOURCE_DIR) - IF (${CMAKE_BUILD_TYPE} MATCHES "Debug") - IF (WIN32) - SET (SZIP_LIB_NAME "szip_D") - ELSE (WIN32) - SET (SZIP_LIB_NAME "szip_debug") - ENDIF (WIN32) - ELSE (${CMAKE_BUILD_TYPE} MATCHES "Debug") - SET (SZIP_LIB_NAME "szip") - ENDIF (${CMAKE_BUILD_TYPE} MATCHES "Debug") + if (${CMAKE_BUILD_TYPE} MATCHES "Debug") + if (WIN32) + set (SZIP_LIB_NAME "szip_D") + else (WIN32) + set (SZIP_LIB_NAME "szip_debug") + endif (WIN32) + else (${CMAKE_BUILD_TYPE} MATCHES "Debug") + set (SZIP_LIB_NAME "szip") + endif (${CMAKE_BUILD_TYPE} MATCHES "Debug") # Create imported target szip ADD_LIBRARY(szip ${libtype} IMPORTED) ADD_DEPENDENCIES (szip SZIP) - IF (${libtype} MATCHES "SHARED") - IF (WIN32) - IF (MINGW) + if (${libtype} MATCHES "SHARED") + if (WIN32) + if (MINGW) SET_TARGET_PROPERTIES(szip PROPERTIES IMPORTED_IMPLIB "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${SZIP_LIB_NAME}.lib" IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${SZIP_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}" ) - ELSE (MINGW) + else (MINGW) SET_TARGET_PROPERTIES(szip PROPERTIES IMPORTED_IMPLIB "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_BUILD_TYPE}/${CMAKE_IMPORT_LIBRARY_PREFIX}${SZIP_LIB_NAME}${CMAKE_IMPORT_LIBRARY_SUFFIX}" IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_BUILD_TYPE}/${CMAKE_IMPORT_LIBRARY_PREFIX}${SZIP_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}" ) - ENDIF (MINGW) - ELSE (WIN32) - IF (CYGWIN) + endif (MINGW) + else (WIN32) + if (CYGWIN) SET_TARGET_PROPERTIES(szip PROPERTIES IMPORTED_IMPLIB "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_IMPORT_LIBRARY_PREFIX}${SZIP_LIB_NAME}${CMAKE_IMPORT_LIBRARY_SUFFIX}" IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_IMPORT_LIBRARY_PREFIX}${SZIP_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}" ) - ELSE (CYGWIN) + else (CYGWIN) SET_TARGET_PROPERTIES(szip PROPERTIES IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_SHARED_LIBRARY_PREFIX}${SZIP_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}" IMPORTED_SONAME "${CMAKE_SHARED_LIBRARY_PREFIX}${SZIP_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}.${SZIP_VERSION_STRING}" SOVERSION "${SZIP_VERSION_STRING}" ) - ENDIF (CYGWIN) - ENDIF (WIN32) - ELSE (${libtype} MATCHES "SHARED") - IF (WIN32 AND NOT MINGW) + endif (CYGWIN) + endif (WIN32) + else (${libtype} MATCHES "SHARED") + if (WIN32 AND NOT MINGW) SET_TARGET_PROPERTIES(szip PROPERTIES IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_BUILD_TYPE}/lib${SZIP_LIB_NAME}${CMAKE_STATIC_LIBRARY_SUFFIX}" IMPORTED_LINK_INTERFACE_LANGUAGES "C" ) - ELSE (WIN32 AND NOT MINGW) + else (WIN32 AND NOT MINGW) SET_TARGET_PROPERTIES(szip PROPERTIES IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/lib${SZIP_LIB_NAME}${CMAKE_STATIC_LIBRARY_SUFFIX}" IMPORTED_LINK_INTERFACE_LANGUAGES "C" ) - ENDIF (WIN32 AND NOT MINGW) - ENDIF (${libtype} MATCHES "SHARED") + endif (WIN32 AND NOT MINGW) + endif (${libtype} MATCHES "SHARED") -# INCLUDE (${BINARY_DIR}/SZIP-targets.cmake) - SET (SZIP_LIBRARY "szip") +# include (${BINARY_DIR}/SZIP-targets.cmake) + set (SZIP_LIBRARY "szip") - SET (SZIP_INCLUDE_DIR_GEN "${BINARY_DIR}") - SET (SZIP_INCLUDE_DIR "${SOURCE_DIR}/src") - SET (SZIP_FOUND 1) - SET (SZIP_LIBRARIES ${SZIP_LIBRARY}) - SET (SZIP_INCLUDE_DIRS ${SZIP_INCLUDE_DIR_GEN} ${SZIP_INCLUDE_DIR}) + set (SZIP_INCLUDE_DIR_GEN "${BINARY_DIR}") + set (SZIP_INCLUDE_DIR "${SOURCE_DIR}/src") + set (SZIP_FOUND 1) + set (SZIP_LIBRARIES ${SZIP_LIBRARY}) + set (SZIP_INCLUDE_DIRS ${SZIP_INCLUDE_DIR_GEN} ${SZIP_INCLUDE_DIR}) ENDMACRO (EXTERNAL_SZIP_LIBRARY) #------------------------------------------------------------------------------- @@ -225,15 +225,15 @@ MACRO (PACKAGE_SZIP_LIBRARY compress_type) COMMAND ${CMAKE_COMMAND} -E copy_if_different ${SZIP_INCLUDE_DIR_GEN}/SZconfig.h ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ COMMENT "Copying ${SZIP_INCLUDE_DIR_GEN}/SZconfig.h to ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/" ) - SET (EXTERNAL_HEADER_LIST ${EXTERNAL_HEADER_LIST} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/SZconfig.h) - IF (${compress_type} MATCHES "SVN" OR ${compress_type} MATCHES "TGZ") + set (EXTERNAL_HEADER_LIST ${EXTERNAL_HEADER_LIST} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/SZconfig.h) + if (${compress_type} MATCHES "SVN" OR ${compress_type} MATCHES "TGZ") ADD_DEPENDENCIES (SZIP-GenHeader-Copy SZIP) - ENDIF (${compress_type} MATCHES "SVN" OR ${compress_type} MATCHES "TGZ") + endif (${compress_type} MATCHES "SVN" OR ${compress_type} MATCHES "TGZ") ENDMACRO (PACKAGE_SZIP_LIBRARY) #------------------------------------------------------------------------------- MACRO (EXTERNAL_ZLIB_LIBRARY compress_type libtype) - IF (${compress_type} MATCHES "SVN") + if (${compress_type} MATCHES "SVN") EXTERNALPROJECT_ADD (ZLIB SVN_REPOSITORY ${ZLIB_URL} # [SVN_REVISION rev] @@ -249,7 +249,7 @@ MACRO (EXTERNAL_ZLIB_LIBRARY compress_type libtype) -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY:PATH=${CMAKE_ARCHIVE_OUTPUT_DIRECTORY} -DCMAKE_ANSI_CFLAGS:STRING=${CMAKE_ANSI_CFLAGS} ) - ELSEIF (${compress_type} MATCHES "TGZ") + elseif (${compress_type} MATCHES "TGZ") EXTERNALPROJECT_ADD (ZLIB URL ${ZLIB_URL} URL_MD5 "" @@ -265,76 +265,76 @@ MACRO (EXTERNAL_ZLIB_LIBRARY compress_type libtype) -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY:PATH=${CMAKE_ARCHIVE_OUTPUT_DIRECTORY} -DCMAKE_ANSI_CFLAGS:STRING=${CMAKE_ANSI_CFLAGS} ) - ENDIF (${compress_type} MATCHES "SVN") + endif (${compress_type} MATCHES "SVN") EXTERNALPROJECT_GET_PROPERTY (ZLIB BINARY_DIR SOURCE_DIR) - IF (${CMAKE_BUILD_TYPE} MATCHES "Debug") - IF (WIN32) - SET (ZLIB_LIB_NAME "zlib_D") - ELSE (WIN32) - SET (ZLIB_LIB_NAME "z_debug") - ENDIF (WIN32) - ELSE (${CMAKE_BUILD_TYPE} MATCHES "Debug") - IF (WIN32) - SET (ZLIB_LIB_NAME "zlib") - ELSE (WIN32) - SET (ZLIB_LIB_NAME "z") - ENDIF (WIN32) - ENDIF (${CMAKE_BUILD_TYPE} MATCHES "Debug") + if (${CMAKE_BUILD_TYPE} MATCHES "Debug") + if (WIN32) + set (ZLIB_LIB_NAME "zlib_D") + else (WIN32) + set (ZLIB_LIB_NAME "z_debug") + endif (WIN32) + else (${CMAKE_BUILD_TYPE} MATCHES "Debug") + if (WIN32) + set (ZLIB_LIB_NAME "zlib") + else (WIN32) + set (ZLIB_LIB_NAME "z") + endif (WIN32) + endif (${CMAKE_BUILD_TYPE} MATCHES "Debug") # Create imported target szip ADD_LIBRARY(zlib ${libtype} IMPORTED) ADD_DEPENDENCIES (zlib ZLIB) - IF (${libtype} MATCHES "SHARED") - IF (WIN32) - IF (MINGW) + if (${libtype} MATCHES "SHARED") + if (WIN32) + if (MINGW) SET_TARGET_PROPERTIES(zlib PROPERTIES IMPORTED_IMPLIB "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${ZLIB_LIB_NAME}.lib" IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${ZLIB_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}" ) - ELSE (MINGW) + else (MINGW) SET_TARGET_PROPERTIES(zlib PROPERTIES IMPORTED_IMPLIB "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_BUILD_TYPE}/${CMAKE_IMPORT_LIBRARY_PREFIX}${ZLIB_LIB_NAME}${CMAKE_IMPORT_LIBRARY_SUFFIX}" IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_BUILD_TYPE}/${CMAKE_IMPORT_LIBRARY_PREFIX}${ZLIB_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}" ) - ENDIF (MINGW) - ELSE (WIN32) - IF (CYGWIN) + endif (MINGW) + else (WIN32) + if (CYGWIN) SET_TARGET_PROPERTIES(zlib PROPERTIES IMPORTED_IMPLIB "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_IMPORT_LIBRARY_PREFIX}${ZLIB_LIB_NAME}${CMAKE_IMPORT_LIBRARY_SUFFIX}" IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_IMPORT_LIBRARY_PREFIX}${ZLIB_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}" ) - ELSE (CYGWIN) + else (CYGWIN) SET_TARGET_PROPERTIES(zlib PROPERTIES IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_SHARED_LIBRARY_PREFIX}${ZLIB_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}" IMPORTED_SONAME "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_SHARED_LIBRARY_PREFIX}${ZLIB_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}.${ZLIB_VERSION_STRING}" SOVERSION "${ZLIB_VERSION_STRING}" ) - ENDIF (CYGWIN) - ENDIF (WIN32) - ELSE (${libtype} MATCHES "SHARED") - IF (WIN32 AND NOT MINGW) + endif (CYGWIN) + endif (WIN32) + else (${libtype} MATCHES "SHARED") + if (WIN32 AND NOT MINGW) SET_TARGET_PROPERTIES(zlib PROPERTIES IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_BUILD_TYPE}/lib${ZLIB_LIB_NAME}${CMAKE_STATIC_LIBRARY_SUFFIX}" IMPORTED_LINK_INTERFACE_LANGUAGES "C" ) - ELSE (WIN32 AND NOT MINGW) + else (WIN32 AND NOT MINGW) SET_TARGET_PROPERTIES(zlib PROPERTIES IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/lib${ZLIB_LIB_NAME}${CMAKE_STATIC_LIBRARY_SUFFIX}" IMPORTED_LINK_INTERFACE_LANGUAGES "C" ) - ENDIF (WIN32 AND NOT MINGW) - ENDIF (${libtype} MATCHES "SHARED") + endif (WIN32 AND NOT MINGW) + endif (${libtype} MATCHES "SHARED") -# INCLUDE (${BINARY_DIR}/ZLIB-targets.cmake) - SET (ZLIB_LIBRARY "zlib") +# include (${BINARY_DIR}/ZLIB-targets.cmake) + set (ZLIB_LIBRARY "zlib") - SET (ZLIB_INCLUDE_DIR_GEN "${BINARY_DIR}") - SET (ZLIB_INCLUDE_DIR "${SOURCE_DIR}") - SET (ZLIB_FOUND 1) - SET (ZLIB_LIBRARIES ${ZLIB_LIBRARY}) - SET (ZLIB_INCLUDE_DIRS ${ZLIB_INCLUDE_DIR_GEN} ${ZLIB_INCLUDE_DIR}) + set (ZLIB_INCLUDE_DIR_GEN "${BINARY_DIR}") + set (ZLIB_INCLUDE_DIR "${SOURCE_DIR}") + set (ZLIB_FOUND 1) + set (ZLIB_LIBRARIES ${ZLIB_LIBRARY}) + set (ZLIB_INCLUDE_DIRS ${ZLIB_INCLUDE_DIR_GEN} ${ZLIB_INCLUDE_DIR}) ENDMACRO (EXTERNAL_ZLIB_LIBRARY) #------------------------------------------------------------------------------- @@ -343,8 +343,8 @@ MACRO (PACKAGE_ZLIB_LIBRARY compress_type) COMMAND ${CMAKE_COMMAND} -E copy_if_different ${ZLIB_INCLUDE_DIR_GEN}/zconf.h ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ COMMENT "Copying ${ZLIB_INCLUDE_DIR_GEN}/zconf.h to ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/" ) - SET (EXTERNAL_HEADER_LIST ${EXTERNAL_HEADER_LIST} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/zconf.h) - IF (${compress_type} MATCHES "SVN" OR ${compress_type} MATCHES "TGZ") + set (EXTERNAL_HEADER_LIST ${EXTERNAL_HEADER_LIST} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/zconf.h) + if (${compress_type} MATCHES "SVN" OR ${compress_type} MATCHES "TGZ") ADD_DEPENDENCIES (ZLIB-GenHeader-Copy ZLIB) - ENDIF (${compress_type} MATCHES "SVN" OR ${compress_type} MATCHES "TGZ") + endif (${compress_type} MATCHES "SVN" OR ${compress_type} MATCHES "TGZ") ENDMACRO (PACKAGE_ZLIB_LIBRARY) diff --git a/config/cmake/HDFMacros.cmake b/config/cmake/HDFMacros.cmake index b0788f2..56fdf83 100644 --- a/config/cmake/HDFMacros.cmake +++ b/config/cmake/HDFMacros.cmake @@ -1,52 +1,52 @@ #------------------------------------------------------------------------------- MACRO (SET_GLOBAL_VARIABLE name value) - SET (${name} ${value} CACHE INTERNAL "Used to pass variables between directories" FORCE) + set (${name} ${value} CACHE INTERNAL "Used to pass variables between directories" FORCE) ENDMACRO (SET_GLOBAL_VARIABLE) #------------------------------------------------------------------------------- MACRO (IDE_GENERATED_PROPERTIES SOURCE_PATH HEADERS SOURCES) #set(source_group_path "Source/AIM/${NAME}") - STRING (REPLACE "/" "\\\\" source_group_path ${SOURCE_PATH}) + string (REPLACE "/" "\\\\" source_group_path ${SOURCE_PATH}) source_group (${source_group_path} FILES ${HEADERS} ${SOURCES}) #-- The following is needed if we ever start to use OS X Frameworks but only #-- works on CMake 2.6 and greater - #SET_PROPERTY (SOURCE ${HEADERS} + #set_property (SOURCE ${HEADERS} # PROPERTY MACOSX_PACKAGE_LOCATION Headers/${NAME} #) ENDMACRO (IDE_GENERATED_PROPERTIES) #------------------------------------------------------------------------------- MACRO (IDE_SOURCE_PROPERTIES SOURCE_PATH HEADERS SOURCES) - # INSTALL (FILES ${HEADERS} + # install (FILES ${HEADERS} # DESTINATION include/R3D/${NAME} # COMPONENT Headers # ) - STRING (REPLACE "/" "\\\\" source_group_path ${SOURCE_PATH} ) + string (REPLACE "/" "\\\\" source_group_path ${SOURCE_PATH} ) source_group (${source_group_path} FILES ${HEADERS} ${SOURCES}) #-- The following is needed if we ever start to use OS X Frameworks but only #-- works on CMake 2.6 and greater - #SET_PROPERTY (SOURCE ${HEADERS} + #set_property (SOURCE ${HEADERS} # PROPERTY MACOSX_PACKAGE_LOCATION Headers/${NAME} #) ENDMACRO (IDE_SOURCE_PROPERTIES) #------------------------------------------------------------------------------- MACRO (TARGET_NAMING libtarget libtype) - IF (WIN32) - IF (${libtype} MATCHES "SHARED") - SET_TARGET_PROPERTIES (${libtarget} PROPERTIES OUTPUT_NAME "${libtarget}dll") - ENDIF (${libtype} MATCHES "SHARED") - ENDIF (WIN32) + if (WIN32) + if (${libtype} MATCHES "SHARED") + set_target_properties (${libtarget} PROPERTIES OUTPUT_NAME "${libtarget}dll") + endif (${libtype} MATCHES "SHARED") + endif (WIN32) ENDMACRO (TARGET_NAMING) #------------------------------------------------------------------------------- MACRO (INSTALL_TARGET_PDB libtarget targetdestination targetcomponent) - IF (WIN32 AND MSVC) - GET_TARGET_PROPERTY (target_name ${libtarget} RELWITHDEBINFO_OUTPUT_NAME) - INSTALL ( + if (WIN32 AND MSVC) + get_target_property (target_name ${libtarget} RELWITHDEBINFO_OUTPUT_NAME) + install ( FILES ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_BUILD_TYPE}/${CMAKE_IMPORT_LIBRARY_PREFIX}${target_name}.pdb DESTINATION @@ -54,15 +54,15 @@ MACRO (INSTALL_TARGET_PDB libtarget targetdestination targetcomponent) CONFIGURATIONS RelWithDebInfo COMPONENT ${targetcomponent} ) - ENDIF (WIN32 AND MSVC) + endif (WIN32 AND MSVC) ENDMACRO (INSTALL_TARGET_PDB) #------------------------------------------------------------------------------- MACRO (INSTALL_PROGRAM_PDB progtarget targetdestination targetcomponent) - IF (WIN32 AND MSVC) - GET_TARGET_PROPERTY (target_name ${progtarget} RELWITHDEBINFO_OUTPUT_NAME) - GET_TARGET_PROPERTY (target_prefix ${progtarget} PREFIX) - INSTALL ( + if (WIN32 AND MSVC) + get_target_property (target_name ${progtarget} RELWITHDEBINFO_OUTPUT_NAME) + get_target_property (target_prefix ${progtarget} PREFIX) + install ( FILES ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_BUILD_TYPE}/${target_prefix}${target_name}.pdb DESTINATION @@ -70,37 +70,37 @@ MACRO (INSTALL_PROGRAM_PDB progtarget targetdestination targetcomponent) CONFIGURATIONS RelWithDebInfo COMPONENT ${targetcomponent} ) - ENDIF (WIN32 AND MSVC) + endif (WIN32 AND MSVC) ENDMACRO (INSTALL_PROGRAM_PDB) #------------------------------------------------------------------------------- MACRO (HDF_SET_LIB_OPTIONS libtarget libname libtype) # message (STATUS "${libname} libtype: ${libtype}") - IF (${libtype} MATCHES "SHARED") - IF (WIN32) - SET (LIB_RELEASE_NAME "${libname}") - SET (LIB_DEBUG_NAME "${libname}_D") - ELSE (WIN32) - SET (LIB_RELEASE_NAME "${libname}") - SET (LIB_DEBUG_NAME "${libname}_debug") - ENDIF (WIN32) - ELSE (${libtype} MATCHES "SHARED") - IF (WIN32) - SET (LIB_RELEASE_NAME "lib${libname}") - SET (LIB_DEBUG_NAME "lib${libname}_D") - ELSE (WIN32) + if (${libtype} MATCHES "SHARED") + if (WIN32) + set (LIB_RELEASE_NAME "${libname}") + set (LIB_DEBUG_NAME "${libname}_D") + else (WIN32) + set (LIB_RELEASE_NAME "${libname}") + set (LIB_DEBUG_NAME "${libname}_debug") + endif (WIN32) + else (${libtype} MATCHES "SHARED") + if (WIN32) + set (LIB_RELEASE_NAME "lib${libname}") + set (LIB_DEBUG_NAME "lib${libname}_D") + else (WIN32) # if the generator supports configuration types or if the CMAKE_BUILD_TYPE has a value - IF (CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE) - SET (LIB_RELEASE_NAME "${libname}") - SET (LIB_DEBUG_NAME "${libname}_debug") - ELSE (CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE) - SET (LIB_RELEASE_NAME "lib${libname}") - SET (LIB_DEBUG_NAME "lib${libname}_debug") - ENDIF (CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE) - ENDIF (WIN32) - ENDIF (${libtype} MATCHES "SHARED") + if (CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE) + set (LIB_RELEASE_NAME "${libname}") + set (LIB_DEBUG_NAME "${libname}_debug") + else (CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE) + set (LIB_RELEASE_NAME "lib${libname}") + set (LIB_DEBUG_NAME "lib${libname}_debug") + endif (CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE) + endif (WIN32) + endif (${libtype} MATCHES "SHARED") - SET_TARGET_PROPERTIES (${libtarget} + set_target_properties (${libtarget} PROPERTIES DEBUG_OUTPUT_NAME ${LIB_DEBUG_NAME} RELEASE_OUTPUT_NAME ${LIB_RELEASE_NAME} @@ -109,79 +109,79 @@ MACRO (HDF_SET_LIB_OPTIONS libtarget libname libtype) ) #----- Use MSVC Naming conventions for Shared Libraries - IF (MINGW AND ${libtype} MATCHES "SHARED") - SET_TARGET_PROPERTIES (${libtarget} + if (MINGW AND ${libtype} MATCHES "SHARED") + set_target_properties (${libtarget} PROPERTIES IMPORT_SUFFIX ".lib" IMPORT_PREFIX "" PREFIX "" ) - ENDIF (MINGW AND ${libtype} MATCHES "SHARED") + endif (MINGW AND ${libtype} MATCHES "SHARED") ENDMACRO (HDF_SET_LIB_OPTIONS) #------------------------------------------------------------------------------- MACRO (TARGET_C_PROPERTIES wintarget addcompileflags addlinkflags) - IF (MSVC) + if (MSVC) TARGET_MSVC_PROPERTIES (${wintarget} "${addcompileflags} ${WIN_COMPILE_FLAGS}" "${addlinkflags} ${WIN_LINK_FLAGS}") - ELSE (MSVC) - IF (BUILD_SHARED_LIBS) - SET_TARGET_PROPERTIES (${wintarget} + else (MSVC) + if (BUILD_SHARED_LIBS) + set_target_properties (${wintarget} PROPERTIES COMPILE_FLAGS "${addcompileflags}" LINK_FLAGS "${addlinkflags}" ) - ELSE (BUILD_SHARED_LIBS) - SET_TARGET_PROPERTIES (${wintarget} + else (BUILD_SHARED_LIBS) + set_target_properties (${wintarget} PROPERTIES COMPILE_FLAGS "${addcompileflags}" LINK_FLAGS "${addlinkflags}" ) - ENDIF (BUILD_SHARED_LIBS) - ENDIF (MSVC) + endif (BUILD_SHARED_LIBS) + endif (MSVC) ENDMACRO (TARGET_C_PROPERTIES) #------------------------------------------------------------------------------- MACRO (TARGET_MSVC_PROPERTIES wintarget addcompileflags addlinkflags) - IF (MSVC) - IF (BUILD_SHARED_LIBS) - SET_TARGET_PROPERTIES (${wintarget} + if (MSVC) + if (BUILD_SHARED_LIBS) + set_target_properties (${wintarget} PROPERTIES COMPILE_FLAGS "${addcompileflags}" LINK_FLAGS "${addlinkflags}" ) - ELSE (BUILD_SHARED_LIBS) - SET_TARGET_PROPERTIES (${wintarget} + else (BUILD_SHARED_LIBS) + set_target_properties (${wintarget} PROPERTIES COMPILE_FLAGS "${addcompileflags}" LINK_FLAGS "${addlinkflags}" ) - ENDIF (BUILD_SHARED_LIBS) - ENDIF (MSVC) + endif (BUILD_SHARED_LIBS) + endif (MSVC) ENDMACRO (TARGET_MSVC_PROPERTIES) #------------------------------------------------------------------------------- MACRO (TARGET_FORTRAN_PROPERTIES forttarget addcompileflags addlinkflags) - IF (WIN32) + if (WIN32) TARGET_FORTRAN_WIN_PROPERTIES (${forttarget} "${addcompileflags} ${WIN_COMPILE_FLAGS}" "${addlinkflags} ${WIN_LINK_FLAGS}") - ENDIF (WIN32) + endif (WIN32) ENDMACRO (TARGET_FORTRAN_PROPERTIES) #------------------------------------------------------------------------------- MACRO (TARGET_FORTRAN_WIN_PROPERTIES forttarget addcompileflags addlinkflags) - IF (MSVC) - IF (BUILD_SHARED_LIBS) - SET_TARGET_PROPERTIES (${forttarget} + if (MSVC) + if (BUILD_SHARED_LIBS) + set_target_properties (${forttarget} PROPERTIES COMPILE_FLAGS "/dll ${addcompileflags}" LINK_FLAGS "/SUBSYSTEM:CONSOLE ${addlinkflags}" ) - ELSE (BUILD_SHARED_LIBS) - SET_TARGET_PROPERTIES (${forttarget} + else (BUILD_SHARED_LIBS) + set_target_properties (${forttarget} PROPERTIES COMPILE_FLAGS "${addcompileflags}" LINK_FLAGS "/SUBSYSTEM:CONSOLE ${addlinkflags}" ) - ENDIF (BUILD_SHARED_LIBS) - ENDIF (MSVC) + endif (BUILD_SHARED_LIBS) + endif (MSVC) ENDMACRO (TARGET_FORTRAN_WIN_PROPERTIES) diff --git a/config/cmake/UserMacros/Windows_MT.cmake b/config/cmake/UserMacros/Windows_MT.cmake index 175c420..a54f22c 100644 --- a/config/cmake/UserMacros/Windows_MT.cmake +++ b/config/cmake/UserMacros/Windows_MT.cmake @@ -11,31 +11,31 @@ # Option to Build with Static CRT libraries on Windows #------------------------------------------------------------------------------- MACRO (TARGET_STATIC_CRT_FLAGS) - IF (MSVC AND NOT BUILD_SHARED_LIBS) - FOREACH (flag_var + if (MSVC AND NOT BUILD_SHARED_LIBS) + foreach (flag_var CMAKE_C_FLAGS CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE CMAKE_C_FLAGS_MINSIZEREL CMAKE_C_FLAGS_RELWITHDEBINFO CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO) - IF (${flag_var} MATCHES "/MD") - STRING (REGEX REPLACE "/MD" "/MT" ${flag_var} "${${flag_var}}") - ENDIF (${flag_var} MATCHES "/MD") - ENDFOREACH (flag_var) - FOREACH (flag_var + if (${flag_var} MATCHES "/MD") + string (REGEX REPLACE "/MD" "/MT" ${flag_var} "${${flag_var}}") + endif (${flag_var} MATCHES "/MD") + endforeach (flag_var) + foreach (flag_var CMAKE_Fortran_FLAGS CMAKE_Fortran_FLAGS_DEBUG CMAKE_Fortran_FLAGS_RELEASE CMAKE_Fortran_FLAGS_MINSIZEREL CMAKE_Fortran_FLAGS_RELWITHDEBINFO) - IF (${flag_var} MATCHES "/libs:dll") - STRING (REGEX REPLACE "/libs:dll" "/libs:static" ${flag_var} "${${flag_var}}") - ENDIF (${flag_var} MATCHES "/libs:dll") - ENDFOREACH (flag_var) - SET (WIN_COMPILE_FLAGS "") - SET (WIN_LINK_FLAGS "/NODEFAULTLIB:MSVCRT") - ENDIF (MSVC AND NOT BUILD_SHARED_LIBS) + if (${flag_var} MATCHES "/libs:dll") + string (REGEX REPLACE "/libs:dll" "/libs:static" ${flag_var} "${${flag_var}}") + endif (${flag_var} MATCHES "/libs:dll") + endforeach (flag_var) + set (WIN_COMPILE_FLAGS "") + set (WIN_LINK_FLAGS "/NODEFAULTLIB:MSVCRT") + endif (MSVC AND NOT BUILD_SHARED_LIBS) ENDMACRO (TARGET_STATIC_CRT_FLAGS) #----------------------------------------------------------------------------- -OPTION (BUILD_STATIC_CRT_LIBS "Build With Static CRT Libraries" OFF) -IF (BUILD_STATIC_CRT_LIBS) +option (BUILD_STATIC_CRT_LIBS "Build With Static CRT Libraries" OFF) +if (BUILD_STATIC_CRT_LIBS) TARGET_STATIC_CRT_FLAGS () -ENDIF (BUILD_STATIC_CRT_LIBS) +endif (BUILD_STATIC_CRT_LIBS) \ No newline at end of file diff --git a/config/cmake/cacheinit.cmake b/config/cmake/cacheinit.cmake index 43ba754..f715a3f 100644 --- a/config/cmake/cacheinit.cmake +++ b/config/cmake/cacheinit.cmake @@ -4,75 +4,75 @@ # EXTERNAL cache entries ######################## -SET (BUILD_SHARED_LIBS ON CACHE BOOL "Build Shared Libraries" FORCE) +set (BUILD_SHARED_LIBS ON CACHE BOOL "Build Shared Libraries" FORCE) -SET (BUILD_TESTING ON CACHE BOOL "Build HDF5 Unit Testing" 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 (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_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_EXAMPLES ON CACHE BOOL "Build HDF5 Library Examples" FORCE) -SET (HDF5_BUILD_FORTRAN ON CACHE BOOL "Build FORTRAN support" 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_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_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_TOOLS ON CACHE BOOL "Build HDF5 Tools" FORCE) -SET (HDF5_BUILD_GENERATORS OFF CACHE BOOL "Build Test Generators" 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_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_SUPPORT ON CACHE BOOL "Use SZip Filter" FORCE) -SET (HDF5_ENABLE_SZIP_ENCODING ON CACHE BOOL "Use SZip Encoding" 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_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_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_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_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 (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 (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_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_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_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_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_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_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_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_ENABLE_THREADSAFE OFF CACHE BOOL "(WINDOWS)Enable Threadsafety" FORCE) -SET (HDF5_PACKAGE_EXTLIBS OFF CACHE BOOL "(WINDOWS)CPACK - include external libraries" 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 OFF CACHE BOOL "CPACK - Disable packaging" FORCE) -SET (HDF5_ALLOW_EXTERNAL_SUPPORT "NO" CACHE STRING "Allow External Library Building (NO SVN TGZ)" FORCE) +set (HDF5_ALLOW_EXTERNAL_SUPPORT "NO" CACHE STRING "Allow External Library Building (NO SVN TGZ)" FORCE) SET_PROPERTY(CACHE HDF5_ALLOW_EXTERNAL_SUPPORT PROPERTY STRINGS NO SVN TGZ) -SET (ZLIB_SVN_URL "http://svn.hdfgroup.uiuc.edu/zlib/trunk" CACHE STRING "Use ZLib from HDF repository" 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 (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 (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 (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 (ZLIB_PACKAGE_NAME "zlib" CACHE STRING "Name of ZLIB package" FORCE) -SET (SZIP_PACKAGE_NAME "szip" CACHE STRING "Name of SZIP package" FORCE) +set (SZIP_PACKAGE_NAME "szip" CACHE STRING "Name of SZIP package" FORCE) diff --git a/config/cmake/grepTest.cmake b/config/cmake/grepTest.cmake index 74ac912..7670ad5 100644 --- a/config/cmake/grepTest.cmake +++ b/config/cmake/grepTest.cmake @@ -2,29 +2,29 @@ # against a reference file. Exit status of command can also be compared. # arguments checking -IF (NOT TEST_PROGRAM) - MESSAGE (FATAL_ERROR "Require TEST_PROGRAM to be defined") -ENDIF (NOT TEST_PROGRAM) -#IF (NOT TEST_ARGS) -# MESSAGE (STATUS "Require TEST_ARGS to be defined") -#ENDIF (NOT TEST_ARGS) -IF (NOT TEST_FOLDER) - MESSAGE ( FATAL_ERROR "Require TEST_FOLDER to be defined") -ENDIF (NOT TEST_FOLDER) -IF (NOT TEST_OUTPUT) - MESSAGE (FATAL_ERROR "Require TEST_OUTPUT to be defined") -ENDIF (NOT TEST_OUTPUT) -#IF (NOT TEST_EXPECT) -# MESSAGE (STATUS "Require TEST_EXPECT to be defined") -#ENDIF (NOT TEST_EXPECT) -IF (NOT TEST_FILTER) - MESSAGE (STATUS "Require TEST_FILTER to be defined") -ENDIF (NOT TEST_FILTER) -IF (NOT TEST_REFERENCE) - MESSAGE (FATAL_ERROR "Require TEST_REFERENCE to be defined") -ENDIF (NOT TEST_REFERENCE) +if (NOT TEST_PROGRAM) + message (FATAL_ERROR "Require TEST_PROGRAM to be defined") +endif (NOT TEST_PROGRAM) +#if (NOT TEST_ARGS) +# message (STATUS "Require TEST_ARGS to be defined") +#endif (NOT TEST_ARGS) +if (NOT TEST_FOLDER) + message ( FATAL_ERROR "Require TEST_FOLDER to be defined") +endif (NOT TEST_FOLDER) +if (NOT TEST_OUTPUT) + message (FATAL_ERROR "Require TEST_OUTPUT to be defined") +endif (NOT TEST_OUTPUT) +#if (NOT TEST_EXPECT) +# message (STATUS "Require TEST_EXPECT to be defined") +#endif (NOT TEST_EXPECT) +if (NOT TEST_FILTER) + message (STATUS "Require TEST_FILTER to be defined") +endif (NOT TEST_FILTER) +if (NOT TEST_REFERENCE) + message (FATAL_ERROR "Require TEST_REFERENCE to be defined") +endif (NOT TEST_REFERENCE) -MESSAGE (STATUS "COMMAND: ${TEST_PROGRAM} ${TEST_ARGS}") +message (STATUS "COMMAND: ${TEST_PROGRAM} ${TEST_ARGS}") # run the test program, capture the stdout/stderr and the result var EXECUTE_PROCESS ( @@ -37,8 +37,8 @@ EXECUTE_PROCESS ( ERROR_VARIABLE TEST_ERROR ) -MESSAGE (STATUS "COMMAND Result: ${TEST_RESULT}") -MESSAGE (STATUS "COMMAND Error: ${TEST_ERROR}") +message (STATUS "COMMAND Result: ${TEST_RESULT}") +message (STATUS "COMMAND Error: ${TEST_ERROR}") # now grep the output with the reference FILE (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) @@ -46,19 +46,19 @@ FILE (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) # TEST_REFERENCE should always be matched STRING(REGEX MATCH "${TEST_REFERENCE}" TEST_MATCH ${TEST_STREAM}) STRING(COMPARE EQUAL "${TEST_REFERENCE}" "${TEST_MATCH}" TEST_RESULT) -IF (${TEST_RESULT} STREQUAL "0") - MESSAGE (FATAL_ERROR "Failed: The output of ${TEST_PROGRAM} did not contain ${TEST_REFERENCE}") -ENDIF (${TEST_RESULT} STREQUAL "0") +if (${TEST_RESULT} STREQUAL "0") + message (FATAL_ERROR "Failed: The output of ${TEST_PROGRAM} did not contain ${TEST_REFERENCE}") +endif (${TEST_RESULT} STREQUAL "0") STRING(REGEX MATCH "${TEST_FILTER}" TEST_MATCH ${TEST_STREAM}) -IF (${TEST_EXPECT} STREQUAL "1") +if (${TEST_EXPECT} STREQUAL "1") # TEST_EXPECT (1) interperts TEST_FILTER as NOT to match STRING(LENGTH "${TEST_MATCH}" TEST_RESULT) - 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 "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 "1") # everything went fine... -MESSAGE ("Passed: The output of ${TEST_PROGRAM} matched") +message ("Passed: The output of ${TEST_PROGRAM} matched") diff --git a/config/cmake/hdf5-config-version.cmake.in b/config/cmake/hdf5-config-version.cmake.in index c1201cc..c3d0811 100644 --- a/config/cmake/hdf5-config-version.cmake.in +++ b/config/cmake/hdf5-config-version.cmake.in @@ -2,26 +2,26 @@ # HDF5 Version file for install directory #----------------------------------------------------------------------------- -SET (PACKAGE_VERSION @HDF5_VERSION_STRING@) +set (PACKAGE_VERSION @HDF5_VERSION_STRING@) -IF ("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL @H5_VERS_MAJOR@) +if ("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL @H5_VERS_MAJOR@) # exact match for version @H5_VERS_MAJOR@.@H5_VERS_MINOR@ - IF ("${PACKAGE_FIND_VERSION_MINOR}" EQUAL @H5_VERS_MINOR@) + if ("${PACKAGE_FIND_VERSION_MINOR}" EQUAL @H5_VERS_MINOR@) # compatible with any version @H5_VERS_MAJOR@.@H5_VERS_MINOR@.x - SET (PACKAGE_VERSION_COMPATIBLE 1) + set (PACKAGE_VERSION_COMPATIBLE 1) - IF ("${PACKAGE_FIND_VERSION_PATCH}" EQUAL @H5_VERS_RELEASE@) - SET (PACKAGE_VERSION_EXACT 1) + if ("${PACKAGE_FIND_VERSION_PATCH}" EQUAL @H5_VERS_RELEASE@) + set (PACKAGE_VERSION_EXACT 1) - IF ("${PACKAGE_FIND_VERSION_TWEAK}" EQUAL @H5_VERS_SUBRELEASE@) + if ("${PACKAGE_FIND_VERSION_TWEAK}" EQUAL @H5_VERS_SUBRELEASE@) # not using this yet - ENDIF ("${PACKAGE_FIND_VERSION_TWEAK}" EQUAL @H5_VERS_SUBRELEASE@) + endif ("${PACKAGE_FIND_VERSION_TWEAK}" EQUAL @H5_VERS_SUBRELEASE@) - ENDIF ("${PACKAGE_FIND_VERSION_PATCH}" EQUAL @H5_VERS_RELEASE@) + endif ("${PACKAGE_FIND_VERSION_PATCH}" EQUAL @H5_VERS_RELEASE@) - ENDIF ("${PACKAGE_FIND_VERSION_MINOR}" EQUAL @H5_VERS_MINOR@) -ENDIF ("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL @H5_VERS_MAJOR@) + endif ("${PACKAGE_FIND_VERSION_MINOR}" EQUAL @H5_VERS_MINOR@) +endif ("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL @H5_VERS_MAJOR@) diff --git a/config/cmake/hdf5-config.cmake.build.in b/config/cmake/hdf5-config.cmake.build.in index fbe97ac..60888c8 100644 --- a/config/cmake/hdf5-config.cmake.build.in +++ b/config/cmake/hdf5-config.cmake.build.in @@ -6,16 +6,16 @@ GET_FILENAME_COMPONENT (SELF_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH) #----------------------------------------------------------------------------- # User Options #----------------------------------------------------------------------------- -SET (HDF5_ENABLE_PARALLEL @HDF5_ENABLE_PARALLEL@) -SET (HDF5_BUILD_FORTRAN @HDF5_BUILD_FORTRAN@) -SET (HDF5_ENABLE_F2003 @HDF5_ENABLE_F2003@) -SET (HDF5_BUILD_CPP_LIB @HDF5_BUILD_CPP_LIB@) -SET (HDF5_BUILD_TOOLS @HDF5_BUILD_TOOLS@) -SET (HDF5_BUILD_HL_LIB @HDF5_BUILD_HL_LIB@) -SET (HDF5_ENABLE_Z_LIB_SUPPORT @HDF5_ENABLE_Z_LIB_SUPPORT@) -SET (HDF5_ENABLE_SZIP_SUPPORT @HDF5_ENABLE_SZIP_SUPPORT@) -SET (HDF5_ENABLE_SZIP_ENCODING @HDF5_ENABLE_SZIP_ENCODING@) -SET (HDF5_BUILD_SHARED_LIBS @BUILD_SHARED_LIBS@) +set (HDF5_ENABLE_PARALLEL @HDF5_ENABLE_PARALLEL@) +set (HDF5_BUILD_FORTRAN @HDF5_BUILD_FORTRAN@) +set (HDF5_ENABLE_F2003 @HDF5_ENABLE_F2003@) +set (HDF5_BUILD_CPP_LIB @HDF5_BUILD_CPP_LIB@) +set (HDF5_BUILD_TOOLS @HDF5_BUILD_TOOLS@) +set (HDF5_BUILD_HL_LIB @HDF5_BUILD_HL_LIB@) +set (HDF5_ENABLE_Z_LIB_SUPPORT @HDF5_ENABLE_Z_LIB_SUPPORT@) +set (HDF5_ENABLE_SZIP_SUPPORT @HDF5_ENABLE_SZIP_SUPPORT@) +set (HDF5_ENABLE_SZIP_ENCODING @HDF5_ENABLE_SZIP_ENCODING@) +set (HDF5_BUILD_SHARED_LIBS @BUILD_SHARED_LIBS@) #----------------------------------------------------------------------------- # Dependencies @@ -28,46 +28,46 @@ ENDIF(HDF5_ENABLE_PARALLEL) #----------------------------------------------------------------------------- # Directories #----------------------------------------------------------------------------- -SET (HDF5_INCLUDE_DIR "@HDF5_INCLUDES_BUILD_TIME@" "${HDF5_MPI_C_INCLUDE_PATH}" ) +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@" ) -ENDIF (HDF5_BUILD_FORTRAN) +if (HDF5_BUILD_FORTRAN) + set (HDF5_INCLUDE_DIR_FORTRAN "@CMAKE_Fortran_MODULE_DIRECTORY@" ) +endif (HDF5_BUILD_FORTRAN) -IF (HDF5_BUILD_CPP_LIB) - SET (HDF5_INCLUDE_DIR_CPP ${HDF5_INCLUDE_DIR} ) -ENDIF (HDF5_BUILD_CPP_LIB) +if (HDF5_BUILD_CPP_LIB) + set (HDF5_INCLUDE_DIR_CPP ${HDF5_INCLUDE_DIR} ) +endif (HDF5_BUILD_CPP_LIB) -IF (HDF5_BUILD_HL_LIB) - SET (HDF5_INCLUDE_DIR_HL ${HDF5_INCLUDE_DIR} ) -ENDIF (HDF5_BUILD_HL_LIB) +if (HDF5_BUILD_HL_LIB) + set (HDF5_INCLUDE_DIR_HL ${HDF5_INCLUDE_DIR} ) +endif (HDF5_BUILD_HL_LIB) -IF (HDF5_BUILD_HL_LIB AND HDF5_BUILD_CPP_LIB) - SET (HDF5_INCLUDE_DIR_HL_CPP ${HDF5_INCLUDE_DIR} ) -ENDIF (HDF5_BUILD_HL_LIB AND HDF5_BUILD_CPP_LIB) +if (HDF5_BUILD_HL_LIB AND HDF5_BUILD_CPP_LIB) + set (HDF5_INCLUDE_DIR_HL_CPP ${HDF5_INCLUDE_DIR} ) +endif (HDF5_BUILD_HL_LIB AND HDF5_BUILD_CPP_LIB) -IF (HDF5_BUILD_TOOLS) - SET (HDF5_INCLUDE_DIR_TOOLS ${HDF5_INCLUDE_DIR} ) -ENDIF (HDF5_BUILD_TOOLS) +if (HDF5_BUILD_TOOLS) + set (HDF5_INCLUDE_DIR_TOOLS ${HDF5_INCLUDE_DIR} ) +endif (HDF5_BUILD_TOOLS) -IF (HDF5_BUILD_SHARED_LIBS) - SET (H5_BUILT_AS_DYNAMIC_LIB 1 ) -ELSE (HDF5_BUILD_SHARED_LIBS) - SET (H5_BUILT_AS_STATIC_LIB 1 ) -ENDIF (HDF5_BUILD_SHARED_LIBS) +if (HDF5_BUILD_SHARED_LIBS) + set (H5_BUILT_AS_DYNAMIC_LIB 1 ) +else (HDF5_BUILD_SHARED_LIBS) + set (H5_BUILT_AS_STATIC_LIB 1 ) +endif (HDF5_BUILD_SHARED_LIBS) #----------------------------------------------------------------------------- # Version Strings #----------------------------------------------------------------------------- -SET (HDF5_VERSION_STRING @HDF5_VERSION_STRING@) -SET (HDF5_VERSION_MAJOR @HDF5_VERSION_MAJOR@) -SET (HDF5_VERSION_MINOR @HDF5_VERSION_MINOR@) +set (HDF5_VERSION_STRING @HDF5_VERSION_STRING@) +set (HDF5_VERSION_MAJOR @HDF5_VERSION_MAJOR@) +set (HDF5_VERSION_MINOR @HDF5_VERSION_MINOR@) #----------------------------------------------------------------------------- # Don't include targets if this file is being picked up by another # project which has already build hdf5 as a subproject #----------------------------------------------------------------------------- -IF (NOT TARGET "@HDF5_PACKAGE@") - INCLUDE (${SELF_DIR}/@HDF5_PACKAGE@@HDF_PACKAGE_EXT@-targets.cmake) - SET (HDF5_LIBRARIES "@HDF5_LIBRARIES_TO_EXPORT@") -ENDIF (NOT TARGET "@HDF5_PACKAGE@") +if (NOT TARGET "@HDF5_PACKAGE@") + include (${SELF_DIR}/@HDF5_PACKAGE@@HDF_PACKAGE_EXT@-targets.cmake) + set (HDF5_LIBRARIES "@HDF5_LIBRARIES_TO_EXPORT@") +endif (NOT TARGET "@HDF5_PACKAGE@") diff --git a/config/cmake/hdf5-config.cmake.install.in b/config/cmake/hdf5-config.cmake.install.in index 9c5a5a1..799ff9d 100644 --- a/config/cmake/hdf5-config.cmake.install.in +++ b/config/cmake/hdf5-config.cmake.install.in @@ -4,24 +4,24 @@ GET_FILENAME_COMPONENT (SELF_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH) GET_FILENAME_COMPONENT(_IMPORT_PREFIX "${SELF_DIR}" PATH) GET_FILENAME_COMPONENT(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH) -IF (NOT WIN32) +if (NOT WIN32) GET_FILENAME_COMPONENT(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH) -ENDIF (NOT WIN32) +endif (NOT WIN32) #----------------------------------------------------------------------------- # User Options #----------------------------------------------------------------------------- -SET (HDF5_ENABLE_PARALLEL @HDF5_ENABLE_PARALLEL@) -SET (HDF5_BUILD_FORTRAN @HDF5_BUILD_FORTRAN@) -SET (HDF5_ENABLE_F2003 @HDF5_ENABLE_F2003@) -SET (HDF5_BUILD_CPP_LIB @HDF5_BUILD_CPP_LIB@) -SET (HDF5_BUILD_TOOLS @HDF5_BUILD_TOOLS@) -SET (HDF5_BUILD_HL_LIB @HDF5_BUILD_HL_LIB@) -SET (HDF5_ENABLE_Z_LIB_SUPPORT @HDF5_ENABLE_Z_LIB_SUPPORT@) -SET (HDF5_ENABLE_SZIP_SUPPORT @HDF5_ENABLE_SZIP_SUPPORT@) -SET (HDF5_ENABLE_SZIP_ENCODING @HDF5_ENABLE_SZIP_ENCODING@) -SET (HDF5_BUILD_SHARED_LIBS @BUILD_SHARED_LIBS@) -SET (HDF5_PACKAGE_EXTLIBS @HDF5_PACKAGE_EXTLIBS@) +set (HDF5_ENABLE_PARALLEL @HDF5_ENABLE_PARALLEL@) +set (HDF5_BUILD_FORTRAN @HDF5_BUILD_FORTRAN@) +set (HDF5_ENABLE_F2003 @HDF5_ENABLE_F2003@) +set (HDF5_BUILD_CPP_LIB @HDF5_BUILD_CPP_LIB@) +set (HDF5_BUILD_TOOLS @HDF5_BUILD_TOOLS@) +set (HDF5_BUILD_HL_LIB @HDF5_BUILD_HL_LIB@) +set (HDF5_ENABLE_Z_LIB_SUPPORT @HDF5_ENABLE_Z_LIB_SUPPORT@) +set (HDF5_ENABLE_SZIP_SUPPORT @HDF5_ENABLE_SZIP_SUPPORT@) +set (HDF5_ENABLE_SZIP_ENCODING @HDF5_ENABLE_SZIP_ENCODING@) +set (HDF5_BUILD_SHARED_LIBS @BUILD_SHARED_LIBS@) +set (HDF5_PACKAGE_EXTLIBS @HDF5_PACKAGE_EXTLIBS@) #----------------------------------------------------------------------------- # Dependencies @@ -34,48 +34,48 @@ ENDIF(HDF5_ENABLE_PARALLEL) #----------------------------------------------------------------------------- # Directories #----------------------------------------------------------------------------- -SET (HDF5_INCLUDE_DIR "${_IMPORT_PREFIX}/include" "${HDF5_MPI_C_INCLUDE_PATH}" ) +set (HDF5_INCLUDE_DIR "${_IMPORT_PREFIX}/include" "${HDF5_MPI_C_INCLUDE_PATH}" ) -IF (HDF5_BUILD_FORTRAN) - SET (HDF5_INCLUDE_DIR_FORTRAN "${_IMPORT_PREFIX}/include/fortran" ) -ENDIF (HDF5_BUILD_FORTRAN) +if (HDF5_BUILD_FORTRAN) + 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/cpp" ) -ENDIF (HDF5_BUILD_CPP_LIB) +if (HDF5_BUILD_CPP_LIB) + 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/hl" ) -ENDIF (HDF5_BUILD_HL_LIB) +if (HDF5_BUILD_HL_LIB) + 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/hl/cpp" ) -ENDIF (HDF5_BUILD_HL_LIB AND HDF5_BUILD_CPP_LIB) +if (HDF5_BUILD_HL_LIB AND HDF5_BUILD_CPP_LIB) + 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) - SET (HDF5_INCLUDE_DIR_TOOLS "${_IMPORT_PREFIX}/include" ) - SET (HDF5_TOOLS_DIR "${_IMPORT_PREFIX}/bin" ) -ENDIF (HDF5_BUILD_TOOLS) +if (HDF5_BUILD_TOOLS) + set (HDF5_INCLUDE_DIR_TOOLS "${_IMPORT_PREFIX}/include" ) + set (HDF5_TOOLS_DIR "${_IMPORT_PREFIX}/bin" ) +endif (HDF5_BUILD_TOOLS) #----------------------------------------------------------------------------- # Version Strings #----------------------------------------------------------------------------- -SET (HDF5_VERSION_STRING @HDF5_VERSION_STRING@) -SET (HDF5_VERSION_MAJOR @HDF5_VERSION_MAJOR@) -SET (HDF5_VERSION_MINOR @HDF5_VERSION_MINOR@) +set (HDF5_VERSION_STRING @HDF5_VERSION_STRING@) +set (HDF5_VERSION_MAJOR @HDF5_VERSION_MAJOR@) +set (HDF5_VERSION_MINOR @HDF5_VERSION_MINOR@) #----------------------------------------------------------------------------- # Don't include targets if this file is being picked up by another # project which has already built hdf5 as a subproject #----------------------------------------------------------------------------- -IF (NOT TARGET "@HDF5_PACKAGE@") - IF (HDF5_ENABLE_Z_LIB_SUPPORT AND HDF5_PACKAGE_EXTLIBS AND NOT TARGET "zlib") - INCLUDE (${SELF_DIR}/../ZLIB/@ZLIB_PACKAGE_NAME@@HDF_PACKAGE_EXT@-targets.cmake) - ENDIF (HDF5_ENABLE_Z_LIB_SUPPORT AND HDF5_PACKAGE_EXTLIBS AND NOT TARGET "zlib") - IF (HDF5_ENABLE_SZIP_SUPPORT AND HDF5_PACKAGE_EXTLIBS AND NOT TARGET "szip") - INCLUDE (${SELF_DIR}/../SZIP/@SZIP_PACKAGE_NAME@@HDF_PACKAGE_EXT@-targets.cmake) - ENDIF (HDF5_ENABLE_SZIP_SUPPORT AND HDF5_PACKAGE_EXTLIBS AND NOT TARGET "szip") - INCLUDE (${SELF_DIR}/@HDF5_PACKAGE@@HDF_PACKAGE_EXT@-targets.cmake) - SET (HDF5_LIBRARIES "@HDF5_LIBRARIES_TO_EXPORT@") -ENDIF (NOT TARGET "@HDF5_PACKAGE@") +if (NOT TARGET "@HDF5_PACKAGE@") + if (HDF5_ENABLE_Z_LIB_SUPPORT AND HDF5_PACKAGE_EXTLIBS AND NOT TARGET "zlib") + include (${SELF_DIR}/../ZLIB/@ZLIB_PACKAGE_NAME@@HDF_PACKAGE_EXT@-targets.cmake) + endif (HDF5_ENABLE_Z_LIB_SUPPORT AND HDF5_PACKAGE_EXTLIBS AND NOT TARGET "zlib") + if (HDF5_ENABLE_SZIP_SUPPORT AND HDF5_PACKAGE_EXTLIBS AND NOT TARGET "szip") + include (${SELF_DIR}/../SZIP/@SZIP_PACKAGE_NAME@@HDF_PACKAGE_EXT@-targets.cmake) + endif (HDF5_ENABLE_SZIP_SUPPORT AND HDF5_PACKAGE_EXTLIBS AND NOT TARGET "szip") + include (${SELF_DIR}/@HDF5_PACKAGE@@HDF_PACKAGE_EXT@-targets.cmake) + set (HDF5_LIBRARIES "@HDF5_LIBRARIES_TO_EXPORT@") +endif (NOT TARGET "@HDF5_PACKAGE@") diff --git a/config/cmake/mccacheinit.cmake b/config/cmake/mccacheinit.cmake index 8ca3879..dd1a311 100644 --- a/config/cmake/mccacheinit.cmake +++ b/config/cmake/mccacheinit.cmake @@ -4,78 +4,78 @@ # EXTERNAL cache entries ######################## -SET (BUILD_SHARED_LIBS OFF CACHE BOOL "Build Shared Libraries" FORCE) +set (BUILD_SHARED_LIBS OFF CACHE BOOL "Build Shared Libraries" FORCE) -SET (BUILD_TESTING ON CACHE BOOL "Build HDF5 Unit Testing" 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 (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_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_EXAMPLES ON CACHE BOOL "Build HDF5 Library Examples" FORCE) -SET (HDF5_BUILD_FORTRAN ON CACHE BOOL "Build FORTRAN support" 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_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_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_TOOLS ON CACHE BOOL "Build HDF5 Tools" FORCE) -SET (HDF5_BUILD_GENERATORS OFF CACHE BOOL "Build Test Generators" 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_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_SUPPORT ON CACHE BOOL "Use SZip Filter" FORCE) -SET (HDF5_ENABLE_SZIP_ENCODING ON CACHE BOOL "Use SZip Encoding" 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_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_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_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_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 (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 (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_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_COVERAGE OFF CACHE BOOL "Enable code coverage for Libraries and Programs" FORCE) -SET (HDF5_ENABLE_USING_MEMCHECKER ON CACHE BOOL "Indicate that a memory checker is used" FORCE) +set (HDF5_ENABLE_USING_MEMCHECKER ON CACHE BOOL "Indicate that a memory checker is used" FORCE) -SET (HDF5_DISABLE_COMPILER_WARNINGS OFF CACHE BOOL "Disable compiler warnings" 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_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_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_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_ENABLE_THREADSAFE OFF CACHE BOOL "(WINDOWS)Enable Threadsafety" FORCE) -SET (HDF5_PACKAGE_EXTLIBS OFF CACHE BOOL "(WINDOWS)CPACK - include external libraries" FORCE) +set (HDF5_PACKAGE_EXTLIBS OFF CACHE BOOL "(WINDOWS)CPACK - include external libraries" FORCE) -SET (HDF5_NO_PACKAGES ON 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) +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 (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 (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 (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 (SZIP_TGZ_NAME "SZip.tar.gz" CACHE STRING "Use SZip from compressed file" FORCE) -SET (CMAKE_BUILD_TYPE "Debug" CACHE STRING "Build Debug" FORCE) +set (CMAKE_BUILD_TYPE "Debug" CACHE STRING "Build Debug" FORCE) -SET (CTEST_BUILD_CONFIGURATION "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 (ZLIB_PACKAGE_NAME "zlib" CACHE STRING "Name of ZLIB package" FORCE) -SET (SZIP_PACKAGE_NAME "szip" CACHE STRING "Name of SZIP package" FORCE) +set (SZIP_PACKAGE_NAME "szip" CACHE STRING "Name of SZIP package" FORCE) diff --git a/config/cmake/prunTest.cmake b/config/cmake/prunTest.cmake index b9ead6f..9cf0c55 100644 --- a/config/cmake/prunTest.cmake +++ b/config/cmake/prunTest.cmake @@ -3,35 +3,35 @@ cmake_policy(SET CMP0007 NEW) # arguments checking -IF (NOT TEST_PROGRAM) - MESSAGE (FATAL_ERROR "Require TEST_PROGRAM to be defined") -ENDIF (NOT TEST_PROGRAM) -#IF (NOT TEST_ARGS) -# MESSAGE (STATUS "Require TEST_ARGS to be defined") -#ENDIF (NOT TEST_ARGS) -IF (NOT TEST_FOLDER) - MESSAGE ( FATAL_ERROR "Require TEST_FOLDER to be defined") -ENDIF (NOT TEST_FOLDER) -IF (NOT TEST_OUTPUT) - MESSAGE (FATAL_ERROR "Require TEST_OUTPUT to be defined") -ENDIF (NOT TEST_OUTPUT) -#IF (NOT TEST_EXPECT) -# MESSAGE (STATUS "Require TEST_EXPECT to be defined") -#ENDIF (NOT TEST_EXPECT) -#IF (NOT TEST_FILTER) -# MESSAGE (STATUS "Require TEST_FILTER to be defined") -#ENDIF (NOT TEST_FILTER) -IF (NOT TEST_SKIP_COMPARE AND NOT TEST_REFERENCE) - MESSAGE (FATAL_ERROR "Require TEST_REFERENCE to be defined") -ENDIF (NOT TEST_SKIP_COMPARE AND NOT TEST_REFERENCE) - -SET (ERROR_APPEND 1) - -MESSAGE (STATUS "COMMAND: ${TEST_PROGRAM} ${TEST_ARGS}") - -IF (TEST_ENV_VAR) - SET (ENV{${TEST_ENV_VAR}} "${TEST_ENV_VALUE}") -ENDIF (TEST_ENV_VAR) +if (NOT TEST_PROGRAM) + message (FATAL_ERROR "Require TEST_PROGRAM to be defined") +endif (NOT TEST_PROGRAM) +#if (NOT TEST_ARGS) +# message (STATUS "Require TEST_ARGS to be defined") +#endif (NOT TEST_ARGS) +if (NOT TEST_FOLDER) + message ( FATAL_ERROR "Require TEST_FOLDER to be defined") +endif (NOT TEST_FOLDER) +if (NOT TEST_OUTPUT) + message (FATAL_ERROR "Require TEST_OUTPUT to be defined") +endif (NOT TEST_OUTPUT) +#if (NOT TEST_EXPECT) +# message (STATUS "Require TEST_EXPECT to be defined") +#endif (NOT TEST_EXPECT) +#if (NOT TEST_FILTER) +# message (STATUS "Require TEST_FILTER to be defined") +#endif (NOT TEST_FILTER) +if (NOT TEST_SKIP_COMPARE AND NOT TEST_REFERENCE) + message (FATAL_ERROR "Require TEST_REFERENCE to be defined") +endif (NOT TEST_SKIP_COMPARE AND NOT TEST_REFERENCE) + +set (ERROR_APPEND 1) + +message (STATUS "COMMAND: ${TEST_PROGRAM} ${TEST_ARGS}") + +if (TEST_ENV_VAR) + set (ENV{${TEST_ENV_VAR}} "${TEST_ENV_VALUE}") +endif (TEST_ENV_VAR) # run the test program, capture the stdout/stderr and the result var EXECUTE_PROCESS ( @@ -44,35 +44,35 @@ EXECUTE_PROCESS ( ERROR_VARIABLE TEST_ERROR ) -MESSAGE (STATUS "COMMAND Result: ${TEST_RESULT}") +message (STATUS "COMMAND Result: ${TEST_RESULT}") FILE (READ ${TEST_FOLDER}/${TEST_REFERENCE} TEST_STREAM) FILE (WRITE ${TEST_FOLDER}/P_${TEST_REFERENCE} "${TEST_STREAM}") -IF (ERROR_APPEND) +if (ERROR_APPEND) FILE (READ ${TEST_FOLDER}/${TEST_OUTPUT}.err TEST_STREAM) FILE (APPEND ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}") -ENDIF (ERROR_APPEND) +endif (ERROR_APPEND) -IF (TEST_APPEND) +if (TEST_APPEND) FILE (APPEND ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_APPEND} ${TEST_ERROR}\n") -ENDIF (TEST_APPEND) +endif (TEST_APPEND) -MESSAGE (STATUS "COMMAND Error: ${TEST_ERROR}") +message (STATUS "COMMAND Error: ${TEST_ERROR}") -IF (TEST_MASK) +if (TEST_MASK) FILE (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) STRING(REGEX REPLACE "Storage:[^\n]+\n" "Storage:
\n" TEST_STREAM "${TEST_STREAM}") FILE (WRITE ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}") -ENDIF (TEST_MASK) +endif (TEST_MASK) -IF (TEST_MASK_MOD) +if (TEST_MASK_MOD) FILE (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) STRING(REGEX REPLACE "Modified:[^\n]+\n" "Modified: XXXX-XX-XX XX:XX:XX XXX\n" TEST_STREAM "${TEST_STREAM}") FILE (WRITE ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}") -ENDIF (TEST_MASK_MOD) +endif (TEST_MASK_MOD) -IF (TEST_MASK_ERROR) +if (TEST_MASK_ERROR) FILE (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) STRING(REGEX REPLACE "thread [0-9]*:" "thread (IDs):" TEST_STREAM "${TEST_STREAM}") STRING(REGEX REPLACE ": ([^\n]*)[.]c " ": (file name) " TEST_STREAM "${TEST_STREAM}") @@ -82,64 +82,64 @@ IF (TEST_MASK_ERROR) STRING(REGEX REPLACE "H5Eget_auto[1-2]*" "H5Eget_auto(1 or 2)" TEST_STREAM "${TEST_STREAM}") STRING(REGEX REPLACE "H5Eset_auto[1-2]*" "H5Eset_auto(1 or 2)" TEST_STREAM "${TEST_STREAM}") FILE (WRITE ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}") -ENDIF (TEST_MASK_ERROR) +endif (TEST_MASK_ERROR) -IF (TEST_FILTER) +if (TEST_FILTER) FILE (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) STRING(REGEX REPLACE "${TEST_FILTER}" "" TEST_STREAM "${TEST_STREAM}") FILE (WRITE ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}") -ENDIF (TEST_FILTER) +endif (TEST_FILTER) -#IF (TEST_REF_FILTER) -# MESSAGE (STATUS "TEST_REF_FILTER: ${TEST_APPEND}${TEST_REF_FILTER}") +#if (TEST_REF_FILTER) +# message (STATUS "TEST_REF_FILTER: ${TEST_APPEND}${TEST_REF_FILTER}") # FILE (READ ${TEST_FOLDER}/P_${TEST_REFERENCE} TEST_STREAM) # STRING(REGEX REPLACE "${TEST_APPEND}" "${TEST_REF_FILTER}" TEST_STREAM "${TEST_STREAM}") # FILE (WRITE ${TEST_FOLDER}/P_${TEST_REFERENCE} "${TEST_STREAM}") -#ENDIF (TEST_REF_FILTER) +#endif (TEST_REF_FILTER) -IF (NOT TEST_SKIP_COMPARE) - IF (WIN32 AND NOT MINGW) +if (NOT TEST_SKIP_COMPARE) + if (WIN32 AND NOT MINGW) FILE (READ ${TEST_FOLDER}/P_${TEST_REFERENCE} TEST_STREAM) FILE (WRITE ${TEST_FOLDER}/P_${TEST_REFERENCE} "${TEST_STREAM}") - ENDIF (WIN32 AND NOT MINGW) + endif (WIN32 AND NOT MINGW) # now compare the output with the reference EXECUTE_PROCESS ( COMMAND ${CMAKE_COMMAND} -E compare_files ${TEST_FOLDER}/${TEST_OUTPUT} ${TEST_FOLDER}/P_${TEST_REFERENCE} RESULT_VARIABLE TEST_RESULT ) - IF (NOT ${TEST_RESULT} STREQUAL 0) - SET (TEST_RESULT 0) + if (NOT ${TEST_RESULT} STREQUAL 0) + set (TEST_RESULT 0) FILE (STRINGS ${TEST_FOLDER}/${TEST_OUTPUT} test_act) LIST (LENGTH test_act len_act) FILE (STRINGS ${TEST_FOLDER}/P_${TEST_REFERENCE} test_ref) LIST (LENGTH test_ref len_ref) - IF (NOT ${len_act} STREQUAL "0") + if (NOT ${len_act} STREQUAL "0") MATH (EXPR _FP_LEN "${len_ref} - 1") - FOREACH (line RANGE 0 ${_FP_LEN}) + foreach (line RANGE 0 ${_FP_LEN}) LIST (GET test_act ${line} str_act) LIST (GET test_ref ${line} str_ref) - IF (NOT "${str_act}" STREQUAL "${str_ref}") - IF (NOT "${str_act}" STREQUAL "") - SET (TEST_RESULT 1) - MESSAGE ("line = ${line}\n***ACTUAL: ${str_act}\n****REFER: ${str_ref}\n") - ENDIF (NOT "${str_act}" STREQUAL "") - ENDIF (NOT "${str_act}" STREQUAL "${str_ref}") - ENDFOREACH (line RANGE 0 ${_FP_LEN}) - ENDIF (NOT ${len_act} STREQUAL "0") - IF (NOT ${len_act} STREQUAL ${len_ref}) - SET (TEST_RESULT 1) - ENDIF (NOT ${len_act} STREQUAL ${len_ref}) - ENDIF (NOT ${TEST_RESULT} STREQUAL 0) - - MESSAGE (STATUS "COMPARE Result: ${TEST_RESULT}") + if (NOT "${str_act}" STREQUAL "${str_ref}") + if (NOT "${str_act}" STREQUAL "") + set (TEST_RESULT 1) + message ("line = ${line}\n***ACTUAL: ${str_act}\n****REFER: ${str_ref}\n") + endif (NOT "${str_act}" STREQUAL "") + endif (NOT "${str_act}" STREQUAL "${str_ref}") + endforeach (line RANGE 0 ${_FP_LEN}) + endif (NOT ${len_act} STREQUAL "0") + if (NOT ${len_act} STREQUAL ${len_ref}) + set (TEST_RESULT 1) + endif (NOT ${len_act} STREQUAL ${len_ref}) + endif (NOT ${TEST_RESULT} STREQUAL 0) + + message (STATUS "COMPARE Result: ${TEST_RESULT}") # again, if return value is !=0 scream and shout - IF (NOT ${TEST_RESULT} STREQUAL 0) - MESSAGE (FATAL_ERROR "Failed: The output of ${TEST_OUTPUT} did not match P_${TEST_REFERENCE}") - ENDIF (NOT ${TEST_RESULT} STREQUAL 0) -ENDIF (NOT TEST_SKIP_COMPARE) + if (NOT ${TEST_RESULT} STREQUAL 0) + message (FATAL_ERROR "Failed: The output of ${TEST_OUTPUT} did not match P_${TEST_REFERENCE}") + endif (NOT ${TEST_RESULT} STREQUAL 0) +endif (NOT TEST_SKIP_COMPARE) # everything went fine... -MESSAGE ("Passed: The output of ${TEST_PROGRAM} matches P_${TEST_REFERENCE}") +message ("Passed: The output of ${TEST_PROGRAM} matches P_${TEST_REFERENCE}") diff --git a/config/cmake/runTest.cmake b/config/cmake/runTest.cmake index 0a80873..9a891e6 100644 --- a/config/cmake/runTest.cmake +++ b/config/cmake/runTest.cmake @@ -3,37 +3,37 @@ cmake_policy(SET CMP0007 NEW) # arguments checking -IF (NOT TEST_PROGRAM) - MESSAGE (FATAL_ERROR "Require TEST_PROGRAM to be defined") -ENDIF (NOT TEST_PROGRAM) -#IF (NOT TEST_ARGS) -# MESSAGE (STATUS "Require TEST_ARGS to be defined") -#ENDIF (NOT TEST_ARGS) -IF (NOT TEST_FOLDER) - MESSAGE ( FATAL_ERROR "Require TEST_FOLDER to be defined") -ENDIF (NOT TEST_FOLDER) -IF (NOT TEST_OUTPUT) - MESSAGE (FATAL_ERROR "Require TEST_OUTPUT to be defined") -ENDIF (NOT TEST_OUTPUT) -IF (NOT TEST_EXPECT) - MESSAGE (STATUS "Require TEST_EXPECT to be defined") -ENDIF (NOT TEST_EXPECT) -#IF (NOT TEST_FILTER) -# MESSAGE (STATUS "Require TEST_FILTER to be defined") -#ENDIF (NOT TEST_FILTER) -IF (NOT TEST_SKIP_COMPARE AND NOT TEST_REFERENCE) - MESSAGE (FATAL_ERROR "Require TEST_REFERENCE to be defined") -ENDIF (NOT TEST_SKIP_COMPARE AND NOT TEST_REFERENCE) - -IF (NOT TEST_ERRREF) - SET (ERROR_APPEND 1) -ENDIF (NOT TEST_ERRREF) - -MESSAGE (STATUS "COMMAND: ${TEST_PROGRAM} ${TEST_ARGS}") - -IF (TEST_ENV_VAR) - SET (ENV{${TEST_ENV_VAR}} "${TEST_ENV_VALUE}") -ENDIF (TEST_ENV_VAR) +if (NOT TEST_PROGRAM) + message (FATAL_ERROR "Require TEST_PROGRAM to be defined") +endif (NOT TEST_PROGRAM) +#if (NOT TEST_ARGS) +# message (STATUS "Require TEST_ARGS to be defined") +#endif (NOT TEST_ARGS) +if (NOT TEST_FOLDER) + message ( FATAL_ERROR "Require TEST_FOLDER to be defined") +endif (NOT TEST_FOLDER) +if (NOT TEST_OUTPUT) + message (FATAL_ERROR "Require TEST_OUTPUT to be defined") +endif (NOT TEST_OUTPUT) +if (NOT TEST_EXPECT) + message (STATUS "Require TEST_EXPECT to be defined") +endif (NOT TEST_EXPECT) +#if (NOT TEST_FILTER) +# message (STATUS "Require TEST_FILTER to be defined") +#endif (NOT TEST_FILTER) +if (NOT TEST_SKIP_COMPARE AND NOT TEST_REFERENCE) + message (FATAL_ERROR "Require TEST_REFERENCE to be defined") +endif (NOT TEST_SKIP_COMPARE AND NOT TEST_REFERENCE) + +if (NOT TEST_ERRREF) + set (ERROR_APPEND 1) +endif (NOT TEST_ERRREF) + +message (STATUS "COMMAND: ${TEST_PROGRAM} ${TEST_ARGS}") + +if (TEST_ENV_VAR) + set (ENV{${TEST_ENV_VAR}} "${TEST_ENV_VALUE}") +endif (TEST_ENV_VAR) # run the test program, capture the stdout/stderr and the result var EXECUTE_PROCESS ( @@ -46,42 +46,42 @@ EXECUTE_PROCESS ( ERROR_VARIABLE TEST_ERROR ) -MESSAGE (STATUS "COMMAND Result: ${TEST_RESULT}") +message (STATUS "COMMAND Result: ${TEST_RESULT}") -IF (ERROR_APPEND) +if (ERROR_APPEND) FILE (READ ${TEST_FOLDER}/${TEST_OUTPUT}.err TEST_STREAM) FILE (APPEND ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}") -ENDIF (ERROR_APPEND) +endif (ERROR_APPEND) -IF (TEST_APPEND) +if (TEST_APPEND) FILE (APPEND ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_APPEND} ${TEST_RESULT}\n") -ENDIF (TEST_APPEND) +endif (TEST_APPEND) # if the return value is !=${TEST_EXPECT} bail out -IF (NOT ${TEST_RESULT} STREQUAL ${TEST_EXPECT}) - MESSAGE ( FATAL_ERROR "Failed: Test program ${TEST_PROGRAM} exited != ${TEST_EXPECT}.\n${TEST_ERROR}") -ENDIF (NOT ${TEST_RESULT} STREQUAL ${TEST_EXPECT}) +if (NOT ${TEST_RESULT} STREQUAL ${TEST_EXPECT}) + message ( FATAL_ERROR "Failed: Test program ${TEST_PROGRAM} exited != ${TEST_EXPECT}.\n${TEST_ERROR}") +endif (NOT ${TEST_RESULT} STREQUAL ${TEST_EXPECT}) -MESSAGE (STATUS "COMMAND Error: ${TEST_ERROR}") +message (STATUS "COMMAND Error: ${TEST_ERROR}") -IF (TEST_MASK) +if (TEST_MASK) FILE (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) STRING(REGEX REPLACE "Storage:[^\n]+\n" "Storage:
\n" TEST_STREAM "${TEST_STREAM}") FILE (WRITE ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}") -ENDIF (TEST_MASK) +endif (TEST_MASK) -IF (TEST_MASK_MOD) +if (TEST_MASK_MOD) FILE (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) STRING(REGEX REPLACE "Modified:[^\n]+\n" "Modified: XXXX-XX-XX XX:XX:XX XXX\n" TEST_STREAM "${TEST_STREAM}") FILE (WRITE ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}") -ENDIF (TEST_MASK_MOD) +endif (TEST_MASK_MOD) -IF (TEST_MASK_ERROR) - IF (NOT TEST_ERRREF) +if (TEST_MASK_ERROR) + if (NOT TEST_ERRREF) FILE (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) - ELSE (NOT TEST_ERRREF) + else (NOT TEST_ERRREF) FILE (READ ${TEST_FOLDER}/${TEST_OUTPUT}.err TEST_STREAM) - ENDIF (NOT TEST_ERRREF) + endif (NOT TEST_ERRREF) STRING(REGEX REPLACE "thread [0-9]*:" "thread (IDs):" TEST_STREAM "${TEST_STREAM}") STRING(REGEX REPLACE ": ([^\n]*)[.]c " ": (file name) " TEST_STREAM "${TEST_STREAM}") STRING(REGEX REPLACE " line [0-9]*" " line (number)" TEST_STREAM "${TEST_STREAM}") @@ -89,105 +89,105 @@ IF (TEST_MASK_ERROR) STRING(REGEX REPLACE "[1-9]*[.][0-9]*[.][0-9]*[^)]*" "version (number)" TEST_STREAM "${TEST_STREAM}") STRING(REGEX REPLACE "H5Eget_auto[1-2]*" "H5Eget_auto(1 or 2)" TEST_STREAM "${TEST_STREAM}") STRING(REGEX REPLACE "H5Eset_auto[1-2]*" "H5Eset_auto(1 or 2)" TEST_STREAM "${TEST_STREAM}") - IF (NOT TEST_ERRREF) + if (NOT TEST_ERRREF) FILE (WRITE ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}") - ELSE (NOT TEST_ERRREF) + else (NOT TEST_ERRREF) FILE (WRITE ${TEST_FOLDER}/${TEST_OUTPUT}.err "${TEST_STREAM}") - ENDIF (NOT TEST_ERRREF) -ENDIF (TEST_MASK_ERROR) + endif (NOT TEST_ERRREF) +endif (TEST_MASK_ERROR) -IF (TEST_FILTER) +if (TEST_FILTER) FILE (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) STRING(REGEX REPLACE "${TEST_FILTER}" "" TEST_STREAM "${TEST_STREAM}") FILE (WRITE ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}") -ENDIF (TEST_FILTER) +endif (TEST_FILTER) -IF (NOT TEST_SKIP_COMPARE) - IF (WIN32 AND NOT MINGW) +if (NOT TEST_SKIP_COMPARE) + if (WIN32 AND NOT MINGW) FILE (READ ${TEST_FOLDER}/${TEST_REFERENCE} TEST_STREAM) FILE (WRITE ${TEST_FOLDER}/${TEST_REFERENCE} "${TEST_STREAM}") - ENDIF (WIN32 AND NOT MINGW) + endif (WIN32 AND NOT MINGW) # now compare the output with the reference EXECUTE_PROCESS ( COMMAND ${CMAKE_COMMAND} -E compare_files ${TEST_FOLDER}/${TEST_OUTPUT} ${TEST_FOLDER}/${TEST_REFERENCE} RESULT_VARIABLE TEST_RESULT ) - IF (NOT ${TEST_RESULT} STREQUAL 0) - SET (TEST_RESULT 0) + if (NOT ${TEST_RESULT} STREQUAL 0) + set (TEST_RESULT 0) FILE (STRINGS ${TEST_FOLDER}/${TEST_OUTPUT} test_act) LIST (LENGTH test_act len_act) FILE (STRINGS ${TEST_FOLDER}/${TEST_REFERENCE} test_ref) LIST (LENGTH test_ref len_ref) - IF (NOT ${len_act} STREQUAL "0") + if (NOT ${len_act} STREQUAL "0") MATH (EXPR _FP_LEN "${len_ref} - 1") - FOREACH (line RANGE 0 ${_FP_LEN}) + foreach (line RANGE 0 ${_FP_LEN}) LIST (GET test_act ${line} str_act) LIST (GET test_ref ${line} str_ref) - IF (NOT "${str_act}" STREQUAL "${str_ref}") - IF (NOT "${str_act}" STREQUAL "") - SET (TEST_RESULT 1) - MESSAGE ("line = ${line}\n***ACTUAL: ${str_act}\n****REFER: ${str_ref}\n") - ENDIF (NOT "${str_act}" STREQUAL "") - ENDIF (NOT "${str_act}" STREQUAL "${str_ref}") - ENDFOREACH (line RANGE 0 ${_FP_LEN}) - ENDIF (NOT ${len_act} STREQUAL "0") - IF (NOT ${len_act} STREQUAL ${len_ref}) - SET (TEST_RESULT 1) - ENDIF (NOT ${len_act} STREQUAL ${len_ref}) - ENDIF (NOT ${TEST_RESULT} STREQUAL 0) - - MESSAGE (STATUS "COMPARE Result: ${TEST_RESULT}") + if (NOT "${str_act}" STREQUAL "${str_ref}") + if (NOT "${str_act}" STREQUAL "") + set (TEST_RESULT 1) + message ("line = ${line}\n***ACTUAL: ${str_act}\n****REFER: ${str_ref}\n") + endif (NOT "${str_act}" STREQUAL "") + endif (NOT "${str_act}" STREQUAL "${str_ref}") + endforeach (line RANGE 0 ${_FP_LEN}) + endif (NOT ${len_act} STREQUAL "0") + if (NOT ${len_act} STREQUAL ${len_ref}) + set (TEST_RESULT 1) + endif (NOT ${len_act} STREQUAL ${len_ref}) + endif (NOT ${TEST_RESULT} STREQUAL 0) + + message (STATUS "COMPARE Result: ${TEST_RESULT}") # again, if return value is !=0 scream and shout - IF (NOT ${TEST_RESULT} STREQUAL 0) - MESSAGE (FATAL_ERROR "Failed: The output of ${TEST_OUTPUT} did not match ${TEST_REFERENCE}") - ENDIF (NOT ${TEST_RESULT} STREQUAL 0) + if (NOT ${TEST_RESULT} STREQUAL 0) + message (FATAL_ERROR "Failed: The output of ${TEST_OUTPUT} did not match ${TEST_REFERENCE}") + endif (NOT ${TEST_RESULT} STREQUAL 0) - IF (TEST_ERRREF) - IF (WIN32 AND NOT MINGW) + if (TEST_ERRREF) + if (WIN32 AND NOT MINGW) FILE (READ ${TEST_FOLDER}/${TEST_ERRREF} TEST_STREAM) FILE (WRITE ${TEST_FOLDER}/${TEST_ERRREF} "${TEST_STREAM}") - ENDIF (WIN32 AND NOT MINGW) + endif (WIN32 AND NOT MINGW) # now compare the error output with the error reference EXECUTE_PROCESS ( COMMAND ${CMAKE_COMMAND} -E compare_files ${TEST_FOLDER}/${TEST_OUTPUT}.err ${TEST_FOLDER}/${TEST_ERRREF} RESULT_VARIABLE TEST_RESULT ) - IF (NOT ${TEST_RESULT} STREQUAL 0) - SET (TEST_RESULT 0) + if (NOT ${TEST_RESULT} STREQUAL 0) + set (TEST_RESULT 0) FILE (STRINGS ${TEST_FOLDER}/${TEST_OUTPUT}.err test_act) LIST (LENGTH test_act len_act) FILE (STRINGS ${TEST_FOLDER}/${TEST_ERRREF} test_ref) LIST (LENGTH test_ref len_ref) MATH (EXPR _FP_LEN "${len_ref} - 1") - IF (NOT ${len_act} STREQUAL "0") + if (NOT ${len_act} STREQUAL "0") MATH (EXPR _FP_LEN "${len_ref} - 1") - FOREACH (line RANGE 0 ${_FP_LEN}) + foreach (line RANGE 0 ${_FP_LEN}) LIST (GET test_act ${line} str_act) LIST (GET test_ref ${line} str_ref) - IF (NOT "${str_act}" STREQUAL "${str_ref}") - IF (NOT "${str_act}" STREQUAL "") - SET (TEST_RESULT 1) - MESSAGE ("line = ${line}\n***ACTUAL: ${str_act}\n****REFER: ${str_ref}\n") - ENDIF (NOT "${str_act}" STREQUAL "") - ENDIF (NOT "${str_act}" STREQUAL "${str_ref}") - ENDFOREACH (line RANGE 0 ${_FP_LEN}) - ENDIF (NOT ${len_act} STREQUAL "0") - IF (NOT ${len_act} STREQUAL ${len_ref}) - SET (TEST_RESULT 1) - ENDIF (NOT ${len_act} STREQUAL ${len_ref}) - ENDIF (NOT ${TEST_RESULT} STREQUAL 0) - - MESSAGE (STATUS "COMPARE Result: ${TEST_RESULT}") + if (NOT "${str_act}" STREQUAL "${str_ref}") + if (NOT "${str_act}" STREQUAL "") + set (TEST_RESULT 1) + message ("line = ${line}\n***ACTUAL: ${str_act}\n****REFER: ${str_ref}\n") + endif (NOT "${str_act}" STREQUAL "") + endif (NOT "${str_act}" STREQUAL "${str_ref}") + endforeach (line RANGE 0 ${_FP_LEN}) + endif (NOT ${len_act} STREQUAL "0") + if (NOT ${len_act} STREQUAL ${len_ref}) + set (TEST_RESULT 1) + endif (NOT ${len_act} STREQUAL ${len_ref}) + endif (NOT ${TEST_RESULT} STREQUAL 0) + + message (STATUS "COMPARE Result: ${TEST_RESULT}") # again, if return value is !=0 scream and shout - IF (NOT ${TEST_RESULT} STREQUAL 0) - MESSAGE (FATAL_ERROR "Failed: The error output of ${TEST_OUTPUT}.err did not match ${TEST_ERRREF}") - ENDIF (NOT ${TEST_RESULT} STREQUAL 0) - ENDIF (TEST_ERRREF) -ENDIF (NOT TEST_SKIP_COMPARE) + if (NOT ${TEST_RESULT} STREQUAL 0) + message (FATAL_ERROR "Failed: The error output of ${TEST_OUTPUT}.err did not match ${TEST_ERRREF}") + endif (NOT ${TEST_RESULT} STREQUAL 0) + endif (TEST_ERRREF) +endif (NOT TEST_SKIP_COMPARE) # everything went fine... -MESSAGE ("Passed: The output of ${TEST_PROGRAM} matches ${TEST_REFERENCE}") +message ("Passed: The output of ${TEST_PROGRAM} matches ${TEST_REFERENCE}") diff --git a/config/cmake/userblockTest.cmake b/config/cmake/userblockTest.cmake index 8910bb2..2b6b934 100644 --- a/config/cmake/userblockTest.cmake +++ b/config/cmake/userblockTest.cmake @@ -2,44 +2,44 @@ # against a reference file. Exit status of command can also be compared. # arguments checking -IF (NOT TEST_PROGRAM) - MESSAGE (FATAL_ERROR "Require TEST_PROGRAM tellub to be defined") -ENDIF (NOT TEST_PROGRAM) -IF (NOT TEST_GET_PROGRAM) - MESSAGE (FATAL_ERROR "Require TEST_GET_PROGRAM getub to be defined") -ENDIF (NOT TEST_GET_PROGRAM) -IF (NOT TEST_FOLDER) - MESSAGE ( FATAL_ERROR "Require TEST_FOLDER to be defined") -ENDIF (NOT TEST_FOLDER) -IF (NOT TEST_HFILE) - MESSAGE (FATAL_ERROR "Require TEST_HFILE the hdf file to be defined") -ENDIF (NOT TEST_HFILE) -IF (NOT TEST_UFILE) - MESSAGE (FATAL_ERROR "Require TEST_UFILE the ub file to be defined") -ENDIF (NOT TEST_UFILE) -IF (NOT TEST_CHECKUB) - MESSAGE (STATUS "Require TEST_CHECKUB - YES or NO - to be defined") -ENDIF (NOT TEST_CHECKUB) -#IF (NOT TEST_EXPECT) -# MESSAGE (STATUS "Require TEST_EXPECT to be defined") -#ENDIF (NOT TEST_EXPECT) -#IF (NOT TEST_OFILE) -# MESSAGE (FATAL_ERROR "Require TEST_OFILE the original hdf file to be defined") -#ENDIF (NOT TEST_OFILE) +if (NOT TEST_PROGRAM) + message (FATAL_ERROR "Require TEST_PROGRAM tellub to be defined") +endif (NOT TEST_PROGRAM) +if (NOT TEST_GET_PROGRAM) + message (FATAL_ERROR "Require TEST_GET_PROGRAM getub to be defined") +endif (NOT TEST_GET_PROGRAM) +if (NOT TEST_FOLDER) + message ( FATAL_ERROR "Require TEST_FOLDER to be defined") +endif (NOT TEST_FOLDER) +if (NOT TEST_HFILE) + message (FATAL_ERROR "Require TEST_HFILE the hdf file to be defined") +endif (NOT TEST_HFILE) +if (NOT TEST_UFILE) + message (FATAL_ERROR "Require TEST_UFILE the ub file to be defined") +endif (NOT TEST_UFILE) +if (NOT TEST_CHECKUB) + message (STATUS "Require TEST_CHECKUB - YES or NO - to be defined") +endif (NOT TEST_CHECKUB) +#if (NOT TEST_EXPECT) +# message (STATUS "Require TEST_EXPECT to be defined") +#endif (NOT TEST_EXPECT) +#if (NOT TEST_OFILE) +# message (FATAL_ERROR "Require TEST_OFILE the original hdf file to be defined") +#endif (NOT TEST_OFILE) -SET (TEST_U_STRING_LEN 0) -SET (TEST_O_STRING_LEN 0) -SET (TEST_H_STRING_LEN 0) -SET (TEST_STRING_SIZE 0) +set (TEST_U_STRING_LEN 0) +set (TEST_O_STRING_LEN 0) +set (TEST_H_STRING_LEN 0) +set (TEST_STRING_SIZE 0) -IF (TEST_CHECKUB STREQUAL "YES") +if (TEST_CHECKUB STREQUAL "YES") # find the length of the user block to check #s1=`cat $ufile | wc -c | sed -e 's/ //g'` FILE (STRINGS ${TEST_FOLDER}/${TEST_UFILE} TEST_U_STRING) - STRING (LENGTH ${TEST_U_STRING} TEST_U_STRING_LEN) + string (LENGTH ${TEST_U_STRING} TEST_U_STRING_LEN) # Get the size of the original user block, if any. - IF (TEST_OFILE) + if (TEST_OFILE) # 'tellub' calls H5Fget_user_block to get the size # of the user block #s2=`$JAM_BIN/tellub $origfile` @@ -51,15 +51,15 @@ IF (TEST_CHECKUB STREQUAL "YES") OUTPUT_VARIABLE TEST_ERROR ERROR_VARIABLE TEST_ERROR ) - IF (NOT ${TEST_RESULT} STREQUAL "0") - MESSAGE (FATAL_ERROR "Failed: The output of ${TEST_PROGRAM} ${TEST_OFILE} is: ${TEST_ERROR}") - ENDIF (NOT ${TEST_RESULT} STREQUAL "0") + if (NOT ${TEST_RESULT} STREQUAL "0") + message (FATAL_ERROR "Failed: The output of ${TEST_PROGRAM} ${TEST_OFILE} is: ${TEST_ERROR}") + endif (NOT ${TEST_RESULT} STREQUAL "0") FILE (READ ${TEST_HFILE}.len.txt TEST_O_STRING_LEN) - ENDIF (TEST_OFILE) + endif (TEST_OFILE) MATH( EXPR TEST_STRING_SIZE "${TEST_U_STRING_LEN} + ${TEST_O_STRING_LEN}" ) - IF (NOT TEST_O_STRING_LEN STREQUAL "0") + if (NOT TEST_O_STRING_LEN STREQUAL "0") #$JAM_BIN/getub -c $s2 $origfile > $cmpfile EXECUTE_PROCESS ( COMMAND ${TEST_GET_PROGRAM} -c ${TEST_O_STRING_LEN} ${TEST_OFILE} @@ -73,10 +73,10 @@ IF (TEST_CHECKUB STREQUAL "YES") #cat $ufile >> $cmpfile FILE (STRINGS ${TEST_UFILE} TEST_STREAM NEWLINE_CONSUME) FILE (APPEND ${TEST_HFILE}-ub.cmp "${TEST_STREAM}") - ELSE (NOT TEST_O_STRING_LEN STREQUAL "0") + else (NOT TEST_O_STRING_LEN STREQUAL "0") FILE (STRINGS ${TEST_UFILE} TEST_STREAM NEWLINE_CONSUME) FILE (WRITE ${TEST_HFILE}-ub.cmp ${TEST_STREAM}) - ENDIF (NOT TEST_O_STRING_LEN STREQUAL "0") + endif (NOT TEST_O_STRING_LEN STREQUAL "0") #$JAM_BIN/getub -c $size $hfile > $tfile EXECUTE_PROCESS ( @@ -95,12 +95,12 @@ IF (TEST_CHECKUB STREQUAL "YES") RESULT_VARIABLE TEST_RESULT ) - MESSAGE (STATUS "COMPARE Result: ${TEST_RESULT}: ${TEST_STRING_SIZE}=${TEST_U_STRING_LEN}+${TEST_O_STRING_LEN}") + 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_HFILE}-ub did not match ${TEST_HFILE}.\n${TEST_ERROR}") - ENDIF (NOT ${TEST_RESULT} STREQUAL ${TEST_EXPECT}) -ELSE (TEST_CHECKUB STREQUAL "YES") + if (NOT ${TEST_RESULT} STREQUAL ${TEST_EXPECT}) + 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 #ubsize=`$JAM_BIN/tellub $hfile` EXECUTE_PROCESS ( @@ -110,11 +110,11 @@ ELSE (TEST_CHECKUB STREQUAL "YES") OUTPUT_VARIABLE TEST_ERROR ERROR_VARIABLE TEST_ERROR ) - IF (NOT TEST_H_STRING_LEN STREQUAL "0") - MESSAGE (FATAL_ERROR "Failed: The output of ${TEST_HFILE} was NOT empty") - ENDIF (NOT TEST_H_STRING_LEN STREQUAL "0") -ENDIF (TEST_CHECKUB STREQUAL "YES") + if (NOT TEST_H_STRING_LEN STREQUAL "0") + message (FATAL_ERROR "Failed: The output of ${TEST_HFILE} was NOT empty") + endif (NOT TEST_H_STRING_LEN STREQUAL "0") +endif (TEST_CHECKUB STREQUAL "YES") # everything went fine... -MESSAGE ("Passed: The output of CHECK matched expectation") +message ("Passed: The output of CHECK matched expectation") diff --git a/config/cmake/vfdTest.cmake b/config/cmake/vfdTest.cmake index 2e854fb..f12dee7 100644 --- a/config/cmake/vfdTest.cmake +++ b/config/cmake/vfdTest.cmake @@ -2,27 +2,27 @@ # Exit status of command can also be compared. # arguments checking -IF (NOT TEST_PROGRAM) - MESSAGE (FATAL_ERROR "Require TEST_PROGRAM to be defined") -ENDIF (NOT TEST_PROGRAM) -#IF (NOT TEST_ARGS) -# MESSAGE (STATUS "Require TEST_ARGS to be defined") -#ENDIF (NOT TEST_ARGS) -#IF (NOT TEST_EXPECT) -# MESSAGE (STATUS "Require TEST_EXPECT to be defined") -#ENDIF (NOT TEST_EXPECT) -IF (NOT TEST_FOLDER) - MESSAGE ( FATAL_ERROR "Require TEST_FOLDER to be defined") -ENDIF (NOT TEST_FOLDER) -IF (NOT TEST_VFD) - MESSAGE (FATAL_ERROR "Require TEST_VFD to be defined") -ENDIF (NOT TEST_VFD) - -SET (ERROR_APPEND 1) - -MESSAGE (STATUS "USING ${TEST_VFD} ON COMMAND: ${TEST_PROGRAM} ${TEST_ARGS}") - -SET (ENV{HDF5_DRIVER} "${TEST_VFD}") +if (NOT TEST_PROGRAM) + message (FATAL_ERROR "Require TEST_PROGRAM to be defined") +endif (NOT TEST_PROGRAM) +#if (NOT TEST_ARGS) +# message (STATUS "Require TEST_ARGS to be defined") +#endif (NOT TEST_ARGS) +#if (NOT TEST_EXPECT) +# message (STATUS "Require TEST_EXPECT to be defined") +#endif (NOT TEST_EXPECT) +if (NOT TEST_FOLDER) + message ( FATAL_ERROR "Require TEST_FOLDER to be defined") +endif (NOT TEST_FOLDER) +if (NOT TEST_VFD) + message (FATAL_ERROR "Require TEST_VFD to be defined") +endif (NOT TEST_VFD) + +set (ERROR_APPEND 1) + +message (STATUS "USING ${TEST_VFD} ON COMMAND: ${TEST_PROGRAM} ${TEST_ARGS}") + +set (ENV{HDF5_DRIVER} "${TEST_VFD}") # run the test program, capture the stdout/stderr and the result var EXECUTE_PROCESS ( COMMAND ${TEST_PROGRAM} ${TEST_ARGS} @@ -33,18 +33,18 @@ EXECUTE_PROCESS ( ERROR_VARIABLE TEST_ERROR ) -MESSAGE (STATUS "COMMAND Result: ${TEST_RESULT}") +message (STATUS "COMMAND Result: ${TEST_RESULT}") -IF (ERROR_APPEND) +if (ERROR_APPEND) FILE (READ ${TEST_FOLDER}/${TEST_OUTPUT}_${TEST_VFD}.err TEST_STREAM) FILE (APPEND ${TEST_FOLDER}/${TEST_OUTPUT}_${TEST_VFD}.out "${TEST_STREAM}") -ENDIF (ERROR_APPEND) +endif (ERROR_APPEND) # if the return value is !=${TEST_EXPECT} bail out -IF (NOT ${TEST_RESULT} STREQUAL ${TEST_EXPECT}) - MESSAGE ( FATAL_ERROR "Failed: Test program ${TEST_PROGRAM} exited != ${TEST_EXPECT}.\n${TEST_ERROR}") -ENDIF (NOT ${TEST_RESULT} STREQUAL ${TEST_EXPECT}) +if (NOT ${TEST_RESULT} STREQUAL ${TEST_EXPECT}) + message ( FATAL_ERROR "Failed: Test program ${TEST_PROGRAM} exited != ${TEST_EXPECT}.\n${TEST_ERROR}") +endif (NOT ${TEST_RESULT} STREQUAL ${TEST_EXPECT}) # everything went fine... -MESSAGE ("Passed: The ${TEST_PROGRAM} program used vfd ${TEST_VFD}") +message ("Passed: The ${TEST_PROGRAM} program used vfd ${TEST_VFD}") diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index e7a1326..088a238 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -4,12 +4,12 @@ PROJECT (HDF5_EXAMPLES) #----------------------------------------------------------------------------- # Apply Definitions to compiler in this directory and below #----------------------------------------------------------------------------- -ADD_DEFINITIONS (${HDF5_EXTRA_C_FLAGS}) +add_definitions (${HDF5_EXTRA_C_FLAGS}) #----------------------------------------------------------------------------- # Define Sources #----------------------------------------------------------------------------- -SET (examples +set (examples h5_crtdat h5_rdwt h5_crtatt @@ -36,22 +36,22 @@ SET (examples h5_shared_mesg ) -FOREACH (example ${examples}) - ADD_EXECUTABLE (${example} ${HDF5_EXAMPLES_SOURCE_DIR}/${example}.c) +foreach (example ${examples}) + add_executable (${example} ${HDF5_EXAMPLES_SOURCE_DIR}/${example}.c) TARGET_NAMING (${example} ${LIB_TYPE}) TARGET_C_PROPERTIES (${example} " " " ") - TARGET_LINK_LIBRARIES (${example} ${HDF5_LIB_TARGET}) - SET_TARGET_PROPERTIES (${example} PROPERTIES FOLDER examples) -ENDFOREACH (example ${examples}) + target_link_libraries (${example} ${HDF5_LIB_TARGET}) + set_target_properties (${example} PROPERTIES FOLDER examples) +endforeach (example ${examples}) -IF (H5_HAVE_PARALLEL) - ADD_EXECUTABLE (ph5example ${HDF5_EXAMPLES_SOURCE_DIR}/ph5example.c) +if (H5_HAVE_PARALLEL) + add_executable (ph5example ${HDF5_EXAMPLES_SOURCE_DIR}/ph5example.c) TARGET_NAMING (ph5example ${LIB_TYPE}) TARGET_C_PROPERTIES (ph5example " " " ") - TARGET_LINK_LIBRARIES (ph5example ${HDF5_LIB_TARGET}) - SET_TARGET_PROPERTIES (ph5example PROPERTIES FOLDER examples) -ENDIF (H5_HAVE_PARALLEL) + target_link_libraries (ph5example ${HDF5_LIB_TARGET}) + set_target_properties (ph5example PROPERTIES FOLDER examples) +endif (H5_HAVE_PARALLEL) -IF (BUILD_TESTING) - INCLUDE (CMakeTests.cmake) -ENDIF (BUILD_TESTING) +if (BUILD_TESTING) + include (CMakeTests.cmake) +endif (BUILD_TESTING) diff --git a/examples/CMakeTests.cmake b/examples/CMakeTests.cmake index 58a2858..a8a9829 100644 --- a/examples/CMakeTests.cmake +++ b/examples/CMakeTests.cmake @@ -43,23 +43,23 @@ red/prefix_target.h5 u2w/u2w_target.h5 ) - IF (NOT "${last_test}" STREQUAL "") + if (NOT "${last_test}" STREQUAL "") SET_TESTS_PROPERTIES (EXAMPLES-clear-objects PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "EXAMPLES-clear-objects") + endif (NOT "${last_test}" STREQUAL "") + set (last_test "EXAMPLES-clear-objects") - FOREACH (example ${examples}) + foreach (example ${examples}) ADD_TEST (NAME EXAMPLES-${example} COMMAND $) - IF (NOT "${last_test}" STREQUAL "") + if (NOT "${last_test}" STREQUAL "") SET_TESTS_PROPERTIES (EXAMPLES-${example} PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "EXAMPLES-${example}") - ENDFOREACH (example ${examples}) + endif (NOT "${last_test}" STREQUAL "") + set (last_test "EXAMPLES-${example}") + endforeach (example ${examples}) - IF (H5_HAVE_PARALLEL) + if (H5_HAVE_PARALLEL) ADD_TEST (NAME EXAMPLES-ph5example COMMAND $) - IF (NOT "${last_test}" STREQUAL "") + if (NOT "${last_test}" STREQUAL "") SET_TESTS_PROPERTIES (EXAMPLES-ph5example PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "EXAMPLES-ph5example") - ENDIF (H5_HAVE_PARALLEL) + endif (NOT "${last_test}" STREQUAL "") + set (last_test "EXAMPLES-ph5example") + endif (H5_HAVE_PARALLEL) diff --git a/fortran/CMakeLists.txt b/fortran/CMakeLists.txt index 9dbe8ca..c13f3c6 100644 --- a/fortran/CMakeLists.txt +++ b/fortran/CMakeLists.txt @@ -1,9 +1,9 @@ cmake_minimum_required (VERSION 2.8.10) PROJECT (HDF5_F90 C CXX Fortran) -IF (H5_HAVE_PARALLEL) +if (H5_HAVE_PARALLEL) FIND_PACKAGE (MPI) -ENDIF (H5_HAVE_PARALLEL) +endif (H5_HAVE_PARALLEL) #----------------------------------------------------------------------------- # Traverse source subdirectory @@ -13,16 +13,16 @@ ADD_SUBDIRECTORY (${HDF5_F90_SOURCE_DIR}/src ${HDF5_F90_BINARY_DIR}/src) #----------------------------------------------------------------------------- # Build the Fortran Examples #----------------------------------------------------------------------------- -IF (HDF5_BUILD_EXAMPLES) +if (HDF5_BUILD_EXAMPLES) ADD_SUBDIRECTORY (${HDF5_F90_SOURCE_DIR}/examples ${HDF5_F90_BINARY_DIR}/examples) -ENDIF (HDF5_BUILD_EXAMPLES) +endif (HDF5_BUILD_EXAMPLES) #----------------------------------------------------------------------------- # Testing #----------------------------------------------------------------------------- -IF (BUILD_TESTING) +if (BUILD_TESTING) ADD_SUBDIRECTORY (${HDF5_F90_SOURCE_DIR}/test ${HDF5_F90_BINARY_DIR}/test) - IF (MPI_Fortran_FOUND) + if (MPI_Fortran_FOUND) ADD_SUBDIRECTORY (${HDF5_F90_SOURCE_DIR}/testpar ${HDF5_F90_BINARY_DIR}/testpar) - ENDIF (MPI_Fortran_FOUND) -ENDIF (BUILD_TESTING) + endif (MPI_Fortran_FOUND) +endif (BUILD_TESTING) diff --git a/fortran/examples/CMakeLists.txt b/fortran/examples/CMakeLists.txt index f57df63..80318a4 100644 --- a/fortran/examples/CMakeLists.txt +++ b/fortran/examples/CMakeLists.txt @@ -13,7 +13,7 @@ INCLUDE_DIRECTORIES (${CMAKE_Fortran_MODULE_DIRECTORY} ${HDF5_F90_BINARY_DIR} ${ #----------------------------------------------------------------------------- # Define Sources #----------------------------------------------------------------------------- -SET (examples +set (examples h5_cmprss h5_crtdat h5_rdwt @@ -31,69 +31,69 @@ SET (examples compound ) -SET (F2003_examples +set (F2003_examples rwdset_fortran2003 nested_derived_type compound_fortran2003 compound_complex_fortran2003 ) -FOREACH (example ${examples}) - ADD_EXECUTABLE (f90_ex_${example} ${HDF5_F90_EXAMPLES_SOURCE_DIR}/${example}.f90) +foreach (example ${examples}) + add_executable (f90_ex_${example} ${HDF5_F90_EXAMPLES_SOURCE_DIR}/${example}.f90) TARGET_NAMING (f90_ex_${example} ${LIB_TYPE}) TARGET_FORTRAN_PROPERTIES (f90_ex_${example} " " " ") - IF (WIN32 AND NOT CYGWIN) - SET_PROPERTY (TARGET f90_ex_${example} + if (WIN32 AND NOT CYGWIN) + set_property (TARGET f90_ex_${example} APPEND PROPERTY COMPILE_DEFINITIONS HDF5F90_WINDOWS ) - ENDIF (WIN32 AND NOT CYGWIN) - TARGET_LINK_LIBRARIES (f90_ex_${example} + endif (WIN32 AND NOT CYGWIN) + target_link_libraries (f90_ex_${example} ${HDF5_F90_LIB_TARGET} ${HDF5_LIB_TARGET} ) - SET_TARGET_PROPERTIES (f90_ex_${example} PROPERTIES LINKER_LANGUAGE Fortran) - SET_TARGET_PROPERTIES (f90_ex_${example} PROPERTIES FOLDER examples/fortran) -ENDFOREACH (example ${examples}) + set_target_properties (f90_ex_${example} PROPERTIES LINKER_LANGUAGE Fortran) + set_target_properties (f90_ex_${example} PROPERTIES FOLDER examples/fortran) +endforeach (example ${examples}) -IF (HDF5_ENABLE_F2003) - FOREACH (example ${F2003_examples}) - ADD_EXECUTABLE (f03_ex_${example} ${HDF5_F90_EXAMPLES_SOURCE_DIR}/${example}.f90) +if (HDF5_ENABLE_F2003) + foreach (example ${F2003_examples}) + add_executable (f03_ex_${example} ${HDF5_F90_EXAMPLES_SOURCE_DIR}/${example}.f90) TARGET_NAMING (f03_ex_${example} ${LIB_TYPE}) TARGET_FORTRAN_PROPERTIES (f03_ex_${example} " " " ") - IF (WIN32 AND NOT CYGWIN) - SET_PROPERTY (TARGET f03_ex_${example} + if (WIN32 AND NOT CYGWIN) + set_property (TARGET f03_ex_${example} APPEND PROPERTY COMPILE_DEFINITIONS HDF5F90_WINDOWS ) - ENDIF (WIN32 AND NOT CYGWIN) - TARGET_LINK_LIBRARIES (f03_ex_${example} + endif (WIN32 AND NOT CYGWIN) + target_link_libraries (f03_ex_${example} ${HDF5_F90_LIB_TARGET} ${HDF5_LIB_TARGET} ) - SET_TARGET_PROPERTIES (f03_ex_${example} PROPERTIES LINKER_LANGUAGE Fortran) - SET_TARGET_PROPERTIES (f03_ex_${example} PROPERTIES FOLDER examples/fortran03) - ENDFOREACH (example ${F2003_examples}) -ENDIF (HDF5_ENABLE_F2003) + set_target_properties (f03_ex_${example} PROPERTIES LINKER_LANGUAGE Fortran) + set_target_properties (f03_ex_${example} PROPERTIES FOLDER examples/fortran03) + endforeach (example ${F2003_examples}) +endif (HDF5_ENABLE_F2003) -IF (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) - ADD_EXECUTABLE (f90_ex_ph5example ${HDF5_F90_EXAMPLES_SOURCE_DIR}/ph5example.f90) +if (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) + add_executable (f90_ex_ph5example ${HDF5_F90_EXAMPLES_SOURCE_DIR}/ph5example.f90) TARGET_NAMING (f90_ex_ph5example ${LIB_TYPE}) TARGET_FORTRAN_PROPERTIES (f90_ex_ph5example " " " ") - IF (WIN32 AND NOT CYGWIN) - SET_PROPERTY (TARGET f90_ex_ph5example + if (WIN32 AND NOT CYGWIN) + set_property (TARGET f90_ex_ph5example APPEND PROPERTY COMPILE_DEFINITIONS HDF5F90_WINDOWS ) - ENDIF (WIN32 AND NOT CYGWIN) - TARGET_LINK_LIBRARIES (f90_ex_ph5example + endif (WIN32 AND NOT CYGWIN) + target_link_libraries (f90_ex_ph5example ${HDF5_F90_LIB_TARGET} ${HDF5_LIB_TARGET} ${MPI_Fortran_LIBRARIES} ) - SET_TARGET_PROPERTIES (f90_ex_ph5example PROPERTIES LINKER_LANGUAGE Fortran) - SET_TARGET_PROPERTIES (f90_ex_ph5example PROPERTIES FOLDER examples/fortran) -ENDIF (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) + set_target_properties (f90_ex_ph5example PROPERTIES LINKER_LANGUAGE Fortran) + set_target_properties (f90_ex_ph5example PROPERTIES FOLDER examples/fortran) +endif (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) -IF (BUILD_TESTING) - INCLUDE (CMakeTests.cmake) -ENDIF (BUILD_TESTING) +if (BUILD_TESTING) + include (CMakeTests.cmake) +endif (BUILD_TESTING) diff --git a/fortran/examples/CMakeTests.cmake b/fortran/examples/CMakeTests.cmake index aebd39b..997d7a1 100644 --- a/fortran/examples/CMakeTests.cmake +++ b/fortran/examples/CMakeTests.cmake @@ -24,29 +24,29 @@ sdsf.h5 subset.h5 ) - IF (NOT "${last_test}" STREQUAL "") + if (NOT "${last_test}" STREQUAL "") SET_TESTS_PROPERTIES (f90_ex-clear-objects PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "f90_ex-clear-objects") + endif (NOT "${last_test}" STREQUAL "") + set (last_test "f90_ex-clear-objects") -FOREACH (example ${examples}) +foreach (example ${examples}) ADD_TEST (NAME f90_ex_${example} COMMAND $) - IF (NOT "${last_test}" STREQUAL "") + if (NOT "${last_test}" STREQUAL "") SET_TESTS_PROPERTIES (f90_ex_${example} PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "f90_ex_${example}") -ENDFOREACH (example ${examples}) + endif (NOT "${last_test}" STREQUAL "") + set (last_test "f90_ex_${example}") +endforeach (example ${examples}) -IF (HDF5_ENABLE_F2003) - FOREACH (example ${F2003_examples}) +if (HDF5_ENABLE_F2003) + foreach (example ${F2003_examples}) ADD_TEST (NAME f03_ex_${example} COMMAND $) - IF (NOT "${last_test}" STREQUAL "") + if (NOT "${last_test}" STREQUAL "") SET_TESTS_PROPERTIES (f03_ex_${example} PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "f03_ex_${example}") - ENDFOREACH (example ${F2003_examples}) -ENDIF (HDF5_ENABLE_F2003) + endif (NOT "${last_test}" STREQUAL "") + set (last_test "f03_ex_${example}") + endforeach (example ${F2003_examples}) +endif (HDF5_ENABLE_F2003) -IF (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) +if (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) ADD_TEST (NAME f90_ex_ph5example COMMAND ${MPIEXEC} ${MPIEXEC_PREFLAGS} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_POSTFLAGS} $) -ENDIF (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) +endif (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) diff --git a/fortran/src/CMakeLists.txt b/fortran/src/CMakeLists.txt index b040fd1..bc87906 100644 --- a/fortran/src/CMakeLists.txt +++ b/fortran/src/CMakeLists.txt @@ -3,19 +3,19 @@ PROJECT (HDF5_F90_SRC C CXX Fortran) #----------------------------------------------------------------------------- # configure def file for shared libs on windows -IF (WIN32 AND NOT CYGWIN) - IF (BUILD_SHARED_LIBS) - IF (MSVC) - IF (NOT H5_HAVE_PARALLEL) - SET (H5_NOPAREXP ";") - ENDIF (NOT H5_HAVE_PARALLEL) - IF (NOT HDF5_ENABLE_F2003) - SET (H5_NOF03EXP ";") - ENDIF (NOT HDF5_ENABLE_F2003) +if (WIN32 AND NOT CYGWIN) + if (BUILD_SHARED_LIBS) + if (MSVC) + if (NOT H5_HAVE_PARALLEL) + set (H5_NOPAREXP ";") + endif (NOT H5_HAVE_PARALLEL) + if (NOT HDF5_ENABLE_F2003) + set (H5_NOF03EXP ";") + endif (NOT HDF5_ENABLE_F2003) CONFIGURE_FILE (${HDF5_F90_SRC_SOURCE_DIR}/hdf5_fortrandll.def.in ${HDF5_F90_SRC_BINARY_DIR}/hdf5_fortrandll.def @ONLY) - ENDIF (MSVC) - ENDIF (BUILD_SHARED_LIBS) -ENDIF (WIN32 AND NOT CYGWIN) + endif (MSVC) + endif (BUILD_SHARED_LIBS) +endif (WIN32 AND NOT CYGWIN) #----------------------------------------------------------------------------- # Setup the Fortran auto-detection utilities @@ -23,31 +23,31 @@ ENDIF (WIN32 AND NOT CYGWIN) # H5fortran_detect.f90 used to generate H5fort_type_defines.h # H5fort_type_defines.h used to generate H5f90i_gen.h + H5fortran_types.f90 #----------------------------------------------------------------------------- -IF (FORTRAN_HAVE_SIZEOF) - ADD_EXECUTABLE (H5test_FortranHavekind +if (FORTRAN_HAVE_SIZEOF) + add_executable (H5test_FortranHavekind ${HDF5_F90_SRC_SOURCE_DIR}/H5test_kind_SIZEOF.f90 ) -ELSE (FORTRAN_HAVE_SIZEOF) - ADD_EXECUTABLE (H5test_FortranHavekind +else (FORTRAN_HAVE_SIZEOF) + add_executable (H5test_FortranHavekind ${HDF5_F90_SRC_SOURCE_DIR}/H5test_kind.f90 ) -ENDIF (FORTRAN_HAVE_SIZEOF) -IF (WIN32 AND MSVC) - IF (BUILD_SHARED_LIBS) - SET_TARGET_PROPERTIES (H5test_FortranHavekind +endif (FORTRAN_HAVE_SIZEOF) +if (WIN32 AND MSVC) + if (BUILD_SHARED_LIBS) + set_target_properties (H5test_FortranHavekind PROPERTIES COMPILE_FLAGS "/MT" ) - ENDIF (BUILD_SHARED_LIBS) - SET_TARGET_PROPERTIES (H5test_FortranHavekind + endif (BUILD_SHARED_LIBS) + set_target_properties (H5test_FortranHavekind PROPERTIES LINK_FLAGS "/SUBSYSTEM:CONSOLE" ) -ENDIF (WIN32 AND MSVC) -SET_TARGET_PROPERTIES (H5test_FortranHavekind PROPERTIES LINKER_LANGUAGE Fortran) +endif (WIN32 AND MSVC) +set_target_properties (H5test_FortranHavekind PROPERTIES LINKER_LANGUAGE Fortran) -SET (CMD $) -ADD_CUSTOM_COMMAND ( +set (CMD $) +add_custom_command ( OUTPUT ${HDF5_F90_BINARY_DIR}/H5fortran_detect.f90 COMMAND ${CMD} ARGS > ${HDF5_F90_BINARY_DIR}/H5fortran_detect.f90 @@ -55,25 +55,25 @@ ADD_CUSTOM_COMMAND ( DEPENDS H5test_FortranHavekind ) #----------------------------------------------------------------------------- -ADD_EXECUTABLE (H5fortran_detect +add_executable (H5fortran_detect ${HDF5_F90_BINARY_DIR}/H5fortran_detect.f90 ) -IF (WIN32 AND MSVC) - IF (BUILD_SHARED_LIBS) - SET_TARGET_PROPERTIES (H5fortran_detect +if (WIN32 AND MSVC) + if (BUILD_SHARED_LIBS) + set_target_properties (H5fortran_detect PROPERTIES COMPILE_FLAGS "/MT" ) - ENDIF (BUILD_SHARED_LIBS) - SET_TARGET_PROPERTIES (H5fortran_detect + endif (BUILD_SHARED_LIBS) + set_target_properties (H5fortran_detect PROPERTIES LINK_FLAGS "/SUBSYSTEM:CONSOLE" ) -ENDIF (WIN32 AND MSVC) -SET_TARGET_PROPERTIES (H5fortran_detect PROPERTIES LINKER_LANGUAGE Fortran) +endif (WIN32 AND MSVC) +set_target_properties (H5fortran_detect PROPERTIES LINKER_LANGUAGE Fortran) -SET (CMD $) -ADD_CUSTOM_COMMAND ( +set (CMD $) +add_custom_command ( OUTPUT ${HDF5_F90_BINARY_DIR}/H5fort_type_defines.h COMMAND ${CMD} ARGS > ${HDF5_F90_BINARY_DIR}/H5fort_type_defines.h @@ -83,12 +83,12 @@ ADD_CUSTOM_COMMAND ( INCLUDE_DIRECTORIES (${HDF5_F90_BINARY_DIR} ${CMAKE_Fortran_MODULE_DIRECTORY}) #----------------------------------------------------------------------------- -ADD_EXECUTABLE (H5match_types +add_executable (H5match_types ${HDF5_F90_BINARY_DIR}/H5fort_type_defines.h ${HDF5_F90_SRC_SOURCE_DIR}/H5match_types.c ) -SET (CMD $) -ADD_CUSTOM_COMMAND ( +set (CMD $) +add_custom_command ( OUTPUT ${HDF5_F90_BINARY_DIR}/H5f90i_gen.h ${HDF5_F90_BINARY_DIR}/H5fortran_types.f90 COMMAND ${CMD} @@ -99,7 +99,7 @@ ADD_CUSTOM_COMMAND ( #----------------------------------------------------------------------------- # f90CStub lib #----------------------------------------------------------------------------- -SET (f90CStub_C_SRCS +set (f90CStub_C_SRCS # normal distribution ${HDF5_F90_SRC_SOURCE_DIR}/H5f90kit.c ${HDF5_F90_SRC_SOURCE_DIR}/H5_f.c @@ -118,54 +118,54 @@ SET (f90CStub_C_SRCS ${HDF5_F90_SRC_SOURCE_DIR}/H5Zf.c ) -IF (H5_HAVE_PARALLEL) - SET (f90CStub_C_SRCS +if (H5_HAVE_PARALLEL) + set (f90CStub_C_SRCS ${f90CStub_C_SRCS} ${HDF5_F90_SRC_SOURCE_DIR}/H5FDmpiof.c ) -ENDIF (H5_HAVE_PARALLEL) +endif (H5_HAVE_PARALLEL) -SET_SOURCE_FILES_PROPERTIES (${f90CStub_C_SRCS} PROPERTIES LANGUAGE C) +set_source_files_properties (${f90CStub_C_SRCS} PROPERTIES LANGUAGE C) -SET (f90CStub_C_HDRS +set (f90CStub_C_HDRS # generated files ${HDF5_F90_BINARY_DIR}/H5f90i_gen.h ) -ADD_LIBRARY (${HDF5_F90_C_LIB_TARGET} ${LIB_TYPE} ${f90CStub_C_SRCS} ${f90CStub_C_HDRS}) +add_library (${HDF5_F90_C_LIB_TARGET} ${LIB_TYPE} ${f90CStub_C_SRCS} ${f90CStub_C_HDRS}) TARGET_C_PROPERTIES (${HDF5_F90_C_LIB_TARGET} " " " ") -TARGET_LINK_LIBRARIES (${HDF5_F90_C_LIB_TARGET} ${HDF5_LIB_TARGET} ${LINK_LIBS}) -SET_GLOBAL_VARIABLE (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_F90_C_LIB_TARGET}") +target_link_libraries (${HDF5_F90_C_LIB_TARGET} ${HDF5_LIB_TARGET} ${LINK_LIBS}) +set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_F90_C_LIB_TARGET}") H5_SET_LIB_OPTIONS (${HDF5_F90_C_LIB_TARGET} ${HDF5_F90_C_LIB_NAME} ${LIB_TYPE}) -SET_TARGET_PROPERTIES (${HDF5_F90_C_LIB_TARGET} PROPERTIES FOLDER libraries/fortran) -SET_TARGET_PROPERTIES (${HDF5_F90_C_LIB_TARGET} PROPERTIES LINKER_LANGUAGE C) +set_target_properties (${HDF5_F90_C_LIB_TARGET} PROPERTIES FOLDER libraries/fortran) +set_target_properties (${HDF5_F90_C_LIB_TARGET} PROPERTIES LINKER_LANGUAGE C) #----------------------------------------------------------------------------- # Fortran 2003 standard #----------------------------------------------------------------------------- -IF (HDF5_ENABLE_F2003) +if (HDF5_ENABLE_F2003) # default real is 4 bytes, so include double signatures - SET (F_STATUS "_F03") -ELSE (HDF5_ENABLE_F2003) + set (F_STATUS "_F03") +else (HDF5_ENABLE_F2003) # default real is 8 bytes, so exclude double signatures - SET (F_STATUS "_F90") -ENDIF (HDF5_ENABLE_F2003) + set (F_STATUS "_F90") +endif (HDF5_ENABLE_F2003) #----------------------------------------------------------------------------- # Fortran Real Size #----------------------------------------------------------------------------- -IF (FORTRAN_DEFAULT_REAL_NOT_DOUBLE) +if (FORTRAN_DEFAULT_REAL_NOT_DOUBLE) # default real is 4 bytes, so include double signatures - SET (F_DBLE "Include") -ELSE (FORTRAN_DEFAULT_REAL_NOT_DOUBLE) + set (F_DBLE "Include") +else (FORTRAN_DEFAULT_REAL_NOT_DOUBLE) # default real is 8 bytes, so exclude double signatures - SET (F_DBLE "Exclude") -ENDIF (FORTRAN_DEFAULT_REAL_NOT_DOUBLE) + set (F_DBLE "Exclude") +endif (FORTRAN_DEFAULT_REAL_NOT_DOUBLE) #----------------------------------------------------------------------------- # Fortran Modules #----------------------------------------------------------------------------- -SET (f90_F_SRCS +set (f90_F_SRCS # generated files ${HDF5_F90_BINARY_DIR}/H5fortran_types.f90 @@ -201,53 +201,53 @@ SET (f90_F_SRCS #----------------------------------------------------------------------------- # Add H5FDMPIO if parallel #----------------------------------------------------------------------------- -IF (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) - SET (f90_F_SRCS +if (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) + set (f90_F_SRCS ${f90_F_SRCS} ${HDF5_F90_SRC_SOURCE_DIR}/HDF5mpio.f90 ${HDF5_F90_SRC_SOURCE_DIR}/H5FDmpioff.f90 ) -ELSE (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) - SET (f90_F_SRCS +else (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) + set (f90_F_SRCS ${f90_F_SRCS} ${HDF5_F90_SRC_SOURCE_DIR}/HDF5.f90 ) -ENDIF (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) +endif (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) #----------------------------------------------------------------------------- # Add Main fortran library #----------------------------------------------------------------------------- -ADD_LIBRARY (${HDF5_F90_LIB_TARGET} ${LIB_TYPE} ${f90_F_SRCS}) -SET (SHARED_LINK_FLAGS " ") -IF (WIN32 AND NOT CYGWIN) - IF (BUILD_SHARED_LIBS) - SET_PROPERTY (TARGET ${HDF5_F90_LIB_TARGET} +add_library (${HDF5_F90_LIB_TARGET} ${LIB_TYPE} ${f90_F_SRCS}) +set (SHARED_LINK_FLAGS " ") +if (WIN32 AND NOT CYGWIN) + if (BUILD_SHARED_LIBS) + set_property (TARGET ${HDF5_F90_LIB_TARGET} APPEND PROPERTY COMPILE_DEFINITIONS BUILD_HDF5_DLL ) - IF (MSVC) - SET (SHARED_LINK_FLAGS "/DLL /DEF:${HDF5_F90_SRC_BINARY_DIR}/hdf5_fortrandll.def") - ENDIF (MSVC) - ENDIF (BUILD_SHARED_LIBS) - SET_PROPERTY (TARGET ${HDF5_F90_LIB_TARGET} + if (MSVC) + set (SHARED_LINK_FLAGS "/DLL /DEF:${HDF5_F90_SRC_BINARY_DIR}/hdf5_fortrandll.def") + endif (MSVC) + endif (BUILD_SHARED_LIBS) + set_property (TARGET ${HDF5_F90_LIB_TARGET} APPEND PROPERTY COMPILE_DEFINITIONS HDF5F90_WINDOWS ) -ENDIF (WIN32 AND NOT CYGWIN) +endif (WIN32 AND NOT CYGWIN) TARGET_FORTRAN_PROPERTIES (${HDF5_F90_LIB_TARGET} " " ${SHARED_LINK_FLAGS}) -SET_TARGET_PROPERTIES (${HDF5_F90_LIB_TARGET} PROPERTIES LINKER_LANGUAGE Fortran) -TARGET_LINK_LIBRARIES (${HDF5_F90_LIB_TARGET} ${HDF5_F90_C_LIB_TARGET} ${HDF5_LIB_TARGET}) -IF (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) - TARGET_LINK_LIBRARIES (${HDF5_F90_LIB_TARGET} ${MPI_Fortran_LIBRARIES}) -ENDIF (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) -SET_GLOBAL_VARIABLE (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_F90_LIB_TARGET}") +set_target_properties (${HDF5_F90_LIB_TARGET} PROPERTIES LINKER_LANGUAGE Fortran) +target_link_libraries (${HDF5_F90_LIB_TARGET} ${HDF5_F90_C_LIB_TARGET} ${HDF5_LIB_TARGET}) +if (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) + target_link_libraries (${HDF5_F90_LIB_TARGET} ${MPI_Fortran_LIBRARIES}) +endif (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) +set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_F90_LIB_TARGET}") H5_SET_LIB_OPTIONS (${HDF5_F90_LIB_TARGET} ${HDF5_F90_LIB_NAME} ${LIB_TYPE}) -SET_TARGET_PROPERTIES (${HDF5_F90_LIB_TARGET} PROPERTIES FOLDER libraries/fortran) +set_target_properties (${HDF5_F90_LIB_TARGET} PROPERTIES FOLDER libraries/fortran) #----------------------------------------------------------------------------- # Add file(s) to CMake Install #----------------------------------------------------------------------------- -INSTALL ( +install ( FILES ${HDF5_F90_SRC_SOURCE_DIR}/H5f90.h ${HDF5_F90_SRC_SOURCE_DIR}/H5f90i.h @@ -260,8 +260,8 @@ INSTALL ( fortheaders ) -IF (WIN32 AND NOT CYGWIN) - INSTALL ( +if (WIN32 AND NOT CYGWIN) + install ( DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/\${BUILD_TYPE}/ DESTINATION @@ -269,8 +269,8 @@ IF (WIN32 AND NOT CYGWIN) COMPONENT fortheaders ) -ELSE (WIN32 AND NOT CYGWIN) - INSTALL ( +else (WIN32 AND NOT CYGWIN) + install ( DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/ DESTINATION @@ -278,18 +278,18 @@ ELSE (WIN32 AND NOT CYGWIN) COMPONENT fortheaders ) -ENDIF (WIN32 AND NOT CYGWIN) +endif (WIN32 AND NOT CYGWIN) #----------------------------------------------------------------------------- # Add Target(s) to CMake Install for import into other projects #----------------------------------------------------------------------------- -IF (HDF5_EXPORTED_TARGETS) - IF (BUILD_SHARED_LIBS) +if (HDF5_EXPORTED_TARGETS) + if (BUILD_SHARED_LIBS) INSTALL_TARGET_PDB (${HDF5_F90_C_LIB_TARGET} ${HDF5_INSTALL_LIB_DIR} fortlibraries) #INSTALL_TARGET_PDB (${HDF5_F90_LIB_TARGET} ${HDF5_INSTALL_LIB_DIR} fortlibraries) - ENDIF (BUILD_SHARED_LIBS) + endif (BUILD_SHARED_LIBS) - INSTALL ( + install ( TARGETS ${HDF5_F90_C_LIB_TARGET} ${HDF5_F90_LIB_TARGET} @@ -299,4 +299,4 @@ IF (HDF5_EXPORTED_TARGETS) ARCHIVE DESTINATION ${HDF5_INSTALL_LIB_DIR} COMPONENT fortlibraries RUNTIME DESTINATION ${HDF5_INSTALL_BIN_DIR} COMPONENT fortlibraries ) -ENDIF (HDF5_EXPORTED_TARGETS) +endif (HDF5_EXPORTED_TARGETS) diff --git a/fortran/test/CMakeLists.txt b/fortran/test/CMakeLists.txt index 643ec94..4b8a8e9 100644 --- a/fortran/test/CMakeLists.txt +++ b/fortran/test/CMakeLists.txt @@ -9,42 +9,42 @@ INCLUDE_DIRECTORIES (${CMAKE_Fortran_MODULE_DIRECTORY} ${HDF5_F90_BINARY_DIR} ${ #----------------------------------------------------------------------------- # Add Test Lib #----------------------------------------------------------------------------- -ADD_LIBRARY (${HDF5_F90_C_TEST_LIB_TARGET} ${LIB_TYPE} t.c) +add_library (${HDF5_F90_C_TEST_LIB_TARGET} ${LIB_TYPE} t.c) TARGET_C_PROPERTIES (${HDF5_F90_C_TEST_LIB_TARGET} " " " ") -TARGET_LINK_LIBRARIES (${HDF5_F90_C_TEST_LIB_TARGET} +target_link_libraries (${HDF5_F90_C_TEST_LIB_TARGET} ${HDF5_F90_C_LIB_TARGET} ${HDF5_TEST_LIB_TARGET} ) H5_SET_LIB_OPTIONS (${HDF5_F90_C_TEST_LIB_TARGET} ${HDF5_F90_C_TEST_LIB_NAME} ${LIB_TYPE}) -SET_TARGET_PROPERTIES (${HDF5_F90_C_TEST_LIB_TARGET} PROPERTIES FOLDER libraries/test/fortran) +set_target_properties (${HDF5_F90_C_TEST_LIB_TARGET} PROPERTIES FOLDER libraries/test/fortran) -ADD_LIBRARY (${HDF5_F90_TEST_LIB_TARGET} ${LIB_TYPE} tf.f90) -SET (SHARED_LINK_FLAGS " ") -IF (WIN32 AND NOT CYGWIN) - IF (BUILD_SHARED_LIBS) - SET_PROPERTY (TARGET ${HDF5_F90_TEST_LIB_TARGET} APPEND PROPERTY COMPILE_DEFINITIONS BUILD_HDF5_DLL) - IF (MSVC) - SET (SHARED_LINK_FLAGS "/DLL") - ENDIF (MSVC) - ENDIF (BUILD_SHARED_LIBS) - SET_PROPERTY (TARGET ${HDF5_F90_TEST_LIB_TARGET} APPEND PROPERTY COMPILE_DEFINITIONS HDF5F90_WINDOWS) -ENDIF (WIN32 AND NOT CYGWIN) +add_library (${HDF5_F90_TEST_LIB_TARGET} ${LIB_TYPE} tf.f90) +set (SHARED_LINK_FLAGS " ") +if (WIN32 AND NOT CYGWIN) + if (BUILD_SHARED_LIBS) + set_property (TARGET ${HDF5_F90_TEST_LIB_TARGET} APPEND PROPERTY COMPILE_DEFINITIONS BUILD_HDF5_DLL) + if (MSVC) + set (SHARED_LINK_FLAGS "/DLL") + endif (MSVC) + endif (BUILD_SHARED_LIBS) + set_property (TARGET ${HDF5_F90_TEST_LIB_TARGET} APPEND PROPERTY COMPILE_DEFINITIONS HDF5F90_WINDOWS) +endif (WIN32 AND NOT CYGWIN) TARGET_FORTRAN_PROPERTIES (${HDF5_F90_TEST_LIB_TARGET} " " ${SHARED_LINK_FLAGS}) -SET_TARGET_PROPERTIES (${HDF5_F90_TEST_LIB_TARGET} PROPERTIES LINKER_LANGUAGE Fortran) -TARGET_LINK_LIBRARIES (${HDF5_F90_TEST_LIB_TARGET} +set_target_properties (${HDF5_F90_TEST_LIB_TARGET} PROPERTIES LINKER_LANGUAGE Fortran) +target_link_libraries (${HDF5_F90_TEST_LIB_TARGET} ${HDF5_F90_C_TEST_LIB_TARGET} ${HDF5_F90_LIB_TARGET} ${HDF5_LIB_TARGET} ) H5_SET_LIB_OPTIONS (${HDF5_F90_TEST_LIB_TARGET} ${HDF5_F90_TEST_LIB_NAME} ${LIB_TYPE}) -SET_TARGET_PROPERTIES (${HDF5_F90_TEST_LIB_TARGET} PROPERTIES FOLDER libraries/test/fortran) +set_target_properties (${HDF5_F90_TEST_LIB_TARGET} PROPERTIES FOLDER libraries/test/fortran) #----------------------------------------------------------------------------- # Add Tests #----------------------------------------------------------------------------- #-- Adding test for testhdf5_fortran -ADD_EXECUTABLE (testhdf5_fortran +add_executable (testhdf5_fortran fortranlib_test.f90 tH5A.f90 tH5D.f90 @@ -62,19 +62,19 @@ ADD_EXECUTABLE (testhdf5_fortran ) TARGET_NAMING (testhdf5_fortran ${LIB_TYPE}) TARGET_FORTRAN_PROPERTIES (testhdf5_fortran " " " ") -TARGET_LINK_LIBRARIES (testhdf5_fortran +target_link_libraries (testhdf5_fortran ${HDF5_F90_TEST_LIB_TARGET} ${HDF5_F90_LIB_TARGET} ${HDF5_LIB_TARGET} ) -IF (WIN32 AND MSVC) - TARGET_LINK_LIBRARIES (testhdf5_fortran "ws2_32.lib") -ENDIF (WIN32 AND MSVC) -SET_TARGET_PROPERTIES (testhdf5_fortran PROPERTIES LINKER_LANGUAGE Fortran) -SET_TARGET_PROPERTIES (testhdf5_fortran PROPERTIES FOLDER test/fortran) +if (WIN32 AND MSVC) + target_link_libraries (testhdf5_fortran "ws2_32.lib") +endif (WIN32 AND MSVC) +set_target_properties (testhdf5_fortran PROPERTIES LINKER_LANGUAGE Fortran) +set_target_properties (testhdf5_fortran PROPERTIES FOLDER test/fortran) #-- Adding test for testhdf5_fortran_1_8 -ADD_EXECUTABLE (testhdf5_fortran_1_8 +add_executable (testhdf5_fortran_1_8 fortranlib_test_1_8.f90 tH5F.f90 tH5O.f90 @@ -83,20 +83,20 @@ ADD_EXECUTABLE (testhdf5_fortran_1_8 ) TARGET_NAMING (testhdf5_fortran_1_8 ${LIB_TYPE}) TARGET_FORTRAN_PROPERTIES (testhdf5_fortran_1_8 " " " ") -TARGET_LINK_LIBRARIES (testhdf5_fortran_1_8 +target_link_libraries (testhdf5_fortran_1_8 ${HDF5_F90_TEST_LIB_TARGET} ${HDF5_F90_LIB_TARGET} ${HDF5_LIB_TARGET} ) -IF (WIN32 AND MSVC) - TARGET_LINK_LIBRARIES (testhdf5_fortran_1_8 "ws2_32.lib") -ENDIF (WIN32 AND MSVC) -SET_TARGET_PROPERTIES (testhdf5_fortran_1_8 PROPERTIES LINKER_LANGUAGE Fortran) -SET_TARGET_PROPERTIES (testhdf5_fortran_1_8 PROPERTIES FOLDER test/fortran) +if (WIN32 AND MSVC) + target_link_libraries (testhdf5_fortran_1_8 "ws2_32.lib") +endif (WIN32 AND MSVC) +set_target_properties (testhdf5_fortran_1_8 PROPERTIES LINKER_LANGUAGE Fortran) +set_target_properties (testhdf5_fortran_1_8 PROPERTIES FOLDER test/fortran) #-- Adding test for fortranlib_test_F03 -IF (HDF5_ENABLE_F2003) - ADD_EXECUTABLE (fortranlib_test_F03 +if (HDF5_ENABLE_F2003) + add_executable (fortranlib_test_F03 fortranlib_test_F03.f90 tH5F.f90 tH5E_F03.f90 @@ -108,46 +108,46 @@ IF (HDF5_ENABLE_F2003) ) TARGET_NAMING (fortranlib_test_F03 ${LIB_TYPE}) TARGET_FORTRAN_PROPERTIES (fortranlib_test_F03 " " " ") - TARGET_LINK_LIBRARIES (fortranlib_test_F03 + target_link_libraries (fortranlib_test_F03 ${HDF5_F90_TEST_LIB_TARGET} ${HDF5_F90_LIB_TARGET} ${HDF5_LIB_TARGET} ) - IF (WIN32 AND MSVC) - TARGET_LINK_LIBRARIES (fortranlib_test_F03 "ws2_32.lib") - ENDIF (WIN32 AND MSVC) - SET_TARGET_PROPERTIES (fortranlib_test_F03 PROPERTIES LINKER_LANGUAGE Fortran) - SET_TARGET_PROPERTIES (fortranlib_test_F03 PROPERTIES FOLDER test/fortran) -ENDIF (HDF5_ENABLE_F2003) + if (WIN32 AND MSVC) + target_link_libraries (fortranlib_test_F03 "ws2_32.lib") + endif (WIN32 AND MSVC) + set_target_properties (fortranlib_test_F03 PROPERTIES LINKER_LANGUAGE Fortran) + set_target_properties (fortranlib_test_F03 PROPERTIES FOLDER test/fortran) +endif (HDF5_ENABLE_F2003) #-- Adding test for fflush1 -ADD_EXECUTABLE (fflush1 fflush1.f90) +add_executable (fflush1 fflush1.f90) TARGET_NAMING (fflush1 ${LIB_TYPE}) TARGET_FORTRAN_PROPERTIES (fflush1 " " " ") -TARGET_LINK_LIBRARIES (fflush1 +target_link_libraries (fflush1 ${HDF5_F90_LIB_TARGET} ${HDF5_F90_TEST_LIB_TARGET} ${HDF5_LIB_TARGET} ) -IF (WIN32 AND MSVC) - TARGET_LINK_LIBRARIES (fflush1 "ws2_32.lib") -ENDIF (WIN32 AND MSVC) -SET_TARGET_PROPERTIES (fflush1 PROPERTIES LINKER_LANGUAGE Fortran) -SET_TARGET_PROPERTIES (fflush1 PROPERTIES FOLDER test/fortran) +if (WIN32 AND MSVC) + target_link_libraries (fflush1 "ws2_32.lib") +endif (WIN32 AND MSVC) +set_target_properties (fflush1 PROPERTIES LINKER_LANGUAGE Fortran) +set_target_properties (fflush1 PROPERTIES FOLDER test/fortran) #-- Adding test for fflush2 -ADD_EXECUTABLE (fflush2 fflush2.f90) +add_executable (fflush2 fflush2.f90) TARGET_NAMING (fflush2 ${LIB_TYPE}) TARGET_FORTRAN_PROPERTIES (fflush2 " " " ") -TARGET_LINK_LIBRARIES (fflush2 +target_link_libraries (fflush2 ${HDF5_F90_TEST_LIB_TARGET} ${HDF5_F90_LIB_TARGET} ${HDF5_LIB_TARGET} ) -IF (WIN32 AND MSVC) - TARGET_LINK_LIBRARIES (fflush2 "ws2_32.lib") -ENDIF (WIN32 AND MSVC) -SET_TARGET_PROPERTIES (fflush2 PROPERTIES LINKER_LANGUAGE Fortran) -SET_TARGET_PROPERTIES (fflush2 PROPERTIES FOLDER test/fortran) +if (WIN32 AND MSVC) + target_link_libraries (fflush2 "ws2_32.lib") +endif (WIN32 AND MSVC) +set_target_properties (fflush2 PROPERTIES LINKER_LANGUAGE Fortran) +set_target_properties (fflush2 PROPERTIES FOLDER test/fortran) -INCLUDE (CMakeTests.cmake) +include (CMakeTests.cmake) diff --git a/fortran/test/CMakeTests.cmake b/fortran/test/CMakeTests.cmake index d381b62..87d691f 100644 --- a/fortran/test/CMakeTests.cmake +++ b/fortran/test/CMakeTests.cmake @@ -13,10 +13,10 @@ ADD_TEST (NAME testhdf5_fortran_1_8 COMMAND $) SET_TESTS_PROPERTIES(testhdf5_fortran_1_8 PROPERTIES PASS_REGULAR_EXPRESSION "[ ]*0 error.s") #-- Adding test for fortranlib_test_F03 -IF (HDF5_ENABLE_F2003) +if (HDF5_ENABLE_F2003) ADD_TEST (NAME fortranlib_test_F03 COMMAND $) SET_TESTS_PROPERTIES(fortranlib_test_F03 PROPERTIES PASS_REGULAR_EXPRESSION "[ ]*0 error.s") -ENDIF (HDF5_ENABLE_F2003) +endif (HDF5_ENABLE_F2003) #-- Adding test for fflush1 ADD_TEST (NAME fflush1 COMMAND $) diff --git a/fortran/testpar/CMakeLists.txt b/fortran/testpar/CMakeLists.txt index d1aba51..54da542 100644 --- a/fortran/testpar/CMakeLists.txt +++ b/fortran/testpar/CMakeLists.txt @@ -11,23 +11,23 @@ INCLUDE_DIRECTORIES (${CMAKE_Fortran_MODULE_DIRECTORY} ${HDF5_F90_BINARY_DIR} ${ #----------------------------------------------------------------------------- #-- Adding test for parallel_test -ADD_EXECUTABLE (parallel_test +add_executable (parallel_test ptest.f90 hyper.f90 mdset.f90 ) TARGET_NAMING (parallel_test ${LIB_TYPE}) TARGET_FORTRAN_PROPERTIES (parallel_test " " " ") -TARGET_LINK_LIBRARIES (parallel_test +target_link_libraries (parallel_test ${HDF5_F90_TEST_LIB_TARGET} ${HDF5_F90_LIB_TARGET} ${HDF5_LIB_TARGET} ${MPI_Fortran_LIBRARIES} ) -IF (WIN32 AND MSVC) - TARGET_LINK_LIBRARIES (parallel_test "ws2_32.lib") -ENDIF (WIN32 AND MSVC) -SET_TARGET_PROPERTIES (parallel_test PROPERTIES LINKER_LANGUAGE Fortran) -SET_TARGET_PROPERTIES (parallel_test PROPERTIES FOLDER test/fortran) +if (WIN32 AND MSVC) + target_link_libraries (parallel_test "ws2_32.lib") +endif (WIN32 AND MSVC) +set_target_properties (parallel_test PROPERTIES LINKER_LANGUAGE Fortran) +set_target_properties (parallel_test PROPERTIES FOLDER test/fortran) -INCLUDE (CMakeTests.cmake) +include (CMakeTests.cmake) diff --git a/hl/CMakeLists.txt b/hl/CMakeLists.txt index 5c9403d..c6c0f82 100644 --- a/hl/CMakeLists.txt +++ b/hl/CMakeLists.txt @@ -4,16 +4,16 @@ PROJECT (HDF5_HL C CXX) #----------------------------------------------------------------------------- # Apply Definitions to compiler in this directory and below #----------------------------------------------------------------------------- -ADD_DEFINITIONS (${HDF5_EXTRA_C_FLAGS}) +add_definitions (${HDF5_EXTRA_C_FLAGS}) #----------------------------------------------------------------------------- # Shared Libs #----------------------------------------------------------------------------- -IF (BUILD_SHARED_LIBS) - SET (HL_BUILT_AS_DYNAMIC_LIB 1) -ELSE (BUILD_SHARED_LIBS) - SET (HL_BUILT_AS_STATIC_LIB 1) -ENDIF (BUILD_SHARED_LIBS) +if (BUILD_SHARED_LIBS) + set (HL_BUILT_AS_DYNAMIC_LIB 1) +else (BUILD_SHARED_LIBS) + set (HL_BUILT_AS_STATIC_LIB 1) +endif (BUILD_SHARED_LIBS) #----------------------------------------------------------------------------- # List Source files @@ -23,22 +23,22 @@ INCLUDE_DIRECTORIES (${HDF5_HL_SOURCE_DIR}/src ) ADD_SUBDIRECTORY (${HDF5_HL_SOURCE_DIR}/src ${HDF5_HL_BINARY_DIR}/src) #-- Build the High level Tools -IF (HDF5_BUILD_TOOLS) +if (HDF5_BUILD_TOOLS) ADD_SUBDIRECTORY (${HDF5_HL_SOURCE_DIR}/tools ${HDF5_HL_BINARY_DIR}/tools) -ENDIF (HDF5_BUILD_TOOLS) +endif (HDF5_BUILD_TOOLS) #-- Add High Level Examples -IF (HDF5_BUILD_EXAMPLES) +if (HDF5_BUILD_EXAMPLES) ADD_SUBDIRECTORY (${HDF5_HL_SOURCE_DIR}/examples ${HDF5_HL_BINARY_DIR}/examples) -ENDIF (HDF5_BUILD_EXAMPLES) +endif (HDF5_BUILD_EXAMPLES) #-- Build the Unit testing if requested -IF (NOT HDF5_EXTERNALLY_CONFIGURED) - IF (BUILD_TESTING) +if (NOT HDF5_EXTERNALLY_CONFIGURED) + if (BUILD_TESTING) ADD_SUBDIRECTORY (${HDF5_HL_SOURCE_DIR}/test ${HDF5_HL_BINARY_DIR}/test) - ENDIF (BUILD_TESTING) -ENDIF (NOT HDF5_EXTERNALLY_CONFIGURED) + endif (BUILD_TESTING) +endif (NOT HDF5_EXTERNALLY_CONFIGURED) -IF (HDF5_BUILD_CPP_LIB) +if (HDF5_BUILD_CPP_LIB) ADD_SUBDIRECTORY (${HDF5_HL_SOURCE_DIR}/c++ ${HDF5_HL_BINARY_DIR}/c++) -ENDIF (HDF5_BUILD_CPP_LIB) +endif (HDF5_BUILD_CPP_LIB) diff --git a/hl/c++/CMakeLists.txt b/hl/c++/CMakeLists.txt index 8d68dd0..d641eae 100644 --- a/hl/c++/CMakeLists.txt +++ b/hl/c++/CMakeLists.txt @@ -9,14 +9,14 @@ ADD_SUBDIRECTORY (${HDF5_HL_CPP_SOURCE_DIR}/src ${HDF5_HL_CPP_BINARY_DIR}/src) # -------------------------------------------------------------------- # Add in the examples for the Packet Table codes # -------------------------------------------------------------------- -IF (HDF5_BUILD_EXAMPLES) +if (HDF5_BUILD_EXAMPLES) ADD_SUBDIRECTORY (${HDF5_HL_CPP_SOURCE_DIR}/examples ${HDF5_HL_CPP_BINARY_DIR}/examples) -ENDIF (HDF5_BUILD_EXAMPLES) +endif (HDF5_BUILD_EXAMPLES) # -------------------------------------------------------------------- # Add in the unit tests for the packet table c++ wrapper # -------------------------------------------------------------------- -IF (BUILD_TESTING) +if (BUILD_TESTING) ADD_SUBDIRECTORY (${HDF5_HL_CPP_SOURCE_DIR}/test ${HDF5_HL_CPP_BINARY_DIR}/test) -ENDIF (BUILD_TESTING) +endif (BUILD_TESTING) diff --git a/hl/c++/examples/CMakeLists.txt b/hl/c++/examples/CMakeLists.txt index f762839..ca086db 100644 --- a/hl/c++/examples/CMakeLists.txt +++ b/hl/c++/examples/CMakeLists.txt @@ -10,17 +10,17 @@ INCLUDE_DIRECTORIES (${HDF5_HL_CPP_SRC_DIR}/src) # -------------------------------------------------------------------- # Add in the examples for the Packet Table codes # -------------------------------------------------------------------- -ADD_EXECUTABLE (ptExampleFL ${HDF5_HL_CPP_EXAMPLES_SOURCE_DIR}/ptExampleFL.cpp) +add_executable (ptExampleFL ${HDF5_HL_CPP_EXAMPLES_SOURCE_DIR}/ptExampleFL.cpp) TARGET_NAMING (ptExampleFL ${LIB_TYPE}) TARGET_C_PROPERTIES (ptExampleFL " " " ") -TARGET_LINK_LIBRARIES ( +target_link_libraries ( ptExampleFL ${HDF5_HL_CPP_LIB_TARGET} ${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET} ) -SET_TARGET_PROPERTIES (ptExampleFL PROPERTIES FOLDER examples/hl/cpp) +set_target_properties (ptExampleFL PROPERTIES FOLDER examples/hl/cpp) -IF (BUILD_TESTING) - INCLUDE (CMakeTests.cmake) -ENDIF (BUILD_TESTING) +if (BUILD_TESTING) + include (CMakeTests.cmake) +endif (BUILD_TESTING) diff --git a/hl/c++/src/CMakeLists.txt b/hl/c++/src/CMakeLists.txt index 34e1a7a..9f8d3f8 100644 --- a/hl/c++/src/CMakeLists.txt +++ b/hl/c++/src/CMakeLists.txt @@ -7,24 +7,24 @@ PROJECT (HDF5_HL_CPP_SRC) INCLUDE_DIRECTORIES (${HDF5_HL_SRC_DIR}/src) INCLUDE_DIRECTORIES (${HDF5_HL_CPP_SRC_SOURCE_DIR}) -SET (HDF5_HL_CPP_SRCS ${HDF5_HL_CPP_SRC_SOURCE_DIR}/H5PacketTable.cpp) -SET (HDF5_HL_CPP_HDRS ${HDF5_HL_CPP_SRC_SOURCE_DIR}/H5PacketTable.h) +set (HDF5_HL_CPP_SRCS ${HDF5_HL_CPP_SRC_SOURCE_DIR}/H5PacketTable.cpp) +set (HDF5_HL_CPP_HDRS ${HDF5_HL_CPP_SRC_SOURCE_DIR}/H5PacketTable.h) -ADD_LIBRARY (${HDF5_HL_CPP_LIB_TARGET} ${LIB_TYPE} ${HDF5_HL_CPP_SRCS}) +add_library (${HDF5_HL_CPP_LIB_TARGET} ${LIB_TYPE} ${HDF5_HL_CPP_SRCS}) TARGET_C_PROPERTIES (${HDF5_HL_CPP_LIB_TARGET} " " " ") -TARGET_LINK_LIBRARIES ( +target_link_libraries ( ${HDF5_HL_CPP_LIB_TARGET} ${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET} ) -SET_GLOBAL_VARIABLE (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_HL_CPP_LIB_TARGET}") +set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_HL_CPP_LIB_TARGET}") H5_SET_LIB_OPTIONS (${HDF5_HL_CPP_LIB_TARGET} ${HDF5_HL_CPP_LIB_NAME} ${LIB_TYPE}) -SET_TARGET_PROPERTIES (${HDF5_HL_CPP_LIB_TARGET} PROPERTIES FOLDER libraries/hl) +set_target_properties (${HDF5_HL_CPP_LIB_TARGET} PROPERTIES FOLDER libraries/hl) #----------------------------------------------------------------------------- # Add file(s) to CMake Install #----------------------------------------------------------------------------- -INSTALL ( +install ( FILES ${HDF5_HL_CPP_HDRS} DESTINATION @@ -36,12 +36,12 @@ INSTALL ( #----------------------------------------------------------------------------- # Add Target(s) to CMake Install for import into other projects #----------------------------------------------------------------------------- -IF (HDF5_EXPORTED_TARGETS) - IF (BUILD_SHARED_LIBS) +if (HDF5_EXPORTED_TARGETS) + if (BUILD_SHARED_LIBS) INSTALL_TARGET_PDB (${HDF5_HL_CPP_LIB_TARGET} ${HDF5_INSTALL_LIB_DIR} hlcpplibraries) - ENDIF (BUILD_SHARED_LIBS) + endif (BUILD_SHARED_LIBS) - INSTALL ( + install ( TARGETS ${HDF5_HL_CPP_LIB_TARGET} EXPORT @@ -50,4 +50,4 @@ IF (HDF5_EXPORTED_TARGETS) ARCHIVE DESTINATION ${HDF5_INSTALL_LIB_DIR} COMPONENT hlcpplibraries RUNTIME DESTINATION ${HDF5_INSTALL_BIN_DIR} COMPONENT hlcpplibraries ) -ENDIF (HDF5_EXPORTED_TARGETS) +endif (HDF5_EXPORTED_TARGETS) diff --git a/hl/c++/test/CMakeLists.txt b/hl/c++/test/CMakeLists.txt index 46229ba..82a4df0 100644 --- a/hl/c++/test/CMakeLists.txt +++ b/hl/c++/test/CMakeLists.txt @@ -15,10 +15,10 @@ INCLUDE_DIRECTORIES (${HDF5_TEST_SRC_DIR}) INCLUDE_DIRECTORIES (${HDF5_HL_SRC_DIR}/test) INCLUDE_DIRECTORIES (${HDF5_CPP_SRC_DIR}/src) -ADD_EXECUTABLE (hl_ptableTest ${HDF5_HL_CPP_TEST_SOURCE_DIR}/ptableTest.cpp) +add_executable (hl_ptableTest ${HDF5_HL_CPP_TEST_SOURCE_DIR}/ptableTest.cpp) TARGET_C_PROPERTIES (hl_ptableTest " " " ") TARGET_NAMING (hl_ptableTest ${LIB_TYPE}) -TARGET_LINK_LIBRARIES ( +target_link_libraries ( hl_ptableTest ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET} @@ -26,6 +26,6 @@ TARGET_LINK_LIBRARIES ( ${HDF5_HL_LIB_TARGET} ${HDF5_HL_CPP_LIB_TARGET} ) -SET_TARGET_PROPERTIES (hl_ptableTest PROPERTIES FOLDER test/hl/cpp) +set_target_properties (hl_ptableTest PROPERTIES FOLDER test/hl/cpp) -INCLUDE (CMakeTests.cmake) +include (CMakeTests.cmake) diff --git a/hl/examples/CMakeLists.txt b/hl/examples/CMakeLists.txt index a9c5258..2d621ca 100644 --- a/hl/examples/CMakeLists.txt +++ b/hl/examples/CMakeLists.txt @@ -4,7 +4,7 @@ PROJECT (HDF5_HL_EXAMPLES ) #----------------------------------------------------------------------------- # Define Sources #----------------------------------------------------------------------------- -SET (examples +set (examples ex_lite1 ex_lite2 #ex_lite2 PROPERTIES DEPENDS ex_lite1) ex_lite3 @@ -26,16 +26,16 @@ SET (examples ex_ds1 ) -FOREACH (example ${examples}) - ADD_EXECUTABLE (hl_ex_${example} ${HDF5_HL_EXAMPLES_SOURCE_DIR}/${example}.c) +foreach (example ${examples}) + add_executable (hl_ex_${example} ${HDF5_HL_EXAMPLES_SOURCE_DIR}/${example}.c) TARGET_NAMING (hl_ex_${example} ${LIB_TYPE}) TARGET_C_PROPERTIES (hl_ex_${example} " " " ") - TARGET_LINK_LIBRARIES (hl_ex_${example} ${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET}) - SET_TARGET_PROPERTIES (hl_ex_${example} PROPERTIES FOLDER examples/hl) -ENDFOREACH (example ${examples}) + target_link_libraries (hl_ex_${example} ${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET}) + set_target_properties (hl_ex_${example} PROPERTIES FOLDER examples/hl) +endforeach (example ${examples}) -IF (BUILD_TESTING) +if (BUILD_TESTING) - INCLUDE (CMakeTests.cmake) + include (CMakeTests.cmake) -ENDIF (BUILD_TESTING) +endif (BUILD_TESTING) diff --git a/hl/examples/CMakeTests.cmake b/hl/examples/CMakeTests.cmake index 0f9ca11..380c1ec 100644 --- a/hl/examples/CMakeTests.cmake +++ b/hl/examples/CMakeTests.cmake @@ -5,21 +5,21 @@ ############################################################################## ############################################################################## -SET (HDF5_TEST_FILES +set (HDF5_TEST_FILES image24pixel.txt image8.txt ) -FOREACH (h5_file ${HDF5_TEST_FILES}) - SET (dest "${PROJECT_BINARY_DIR}/${h5_file}") - #MESSAGE (STATUS " Copying ${h5_file}") - ADD_CUSTOM_COMMAND ( +foreach (h5_file ${HDF5_TEST_FILES}) + set (dest "${PROJECT_BINARY_DIR}/${h5_file}") + #message (STATUS " Copying ${h5_file}") + add_custom_command ( TARGET hl_ex_ex_ds1 POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${PROJECT_SOURCE_DIR}/${h5_file} ${dest} ) -ENDFOREACH (h5_file ${HDF5_TEST_FILES}) +endforeach (h5_file ${HDF5_TEST_FILES}) # Remove any output file left over from previous test run ADD_TEST ( @@ -46,15 +46,15 @@ ENDFOREACH (h5_file ${HDF5_TEST_FILES}) ex_table_12.h5 ex_ds1.h5 ) - IF (NOT "${last_test}" STREQUAL "") + if (NOT "${last_test}" STREQUAL "") SET_TESTS_PROPERTIES (hl_ex-clear-objects PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "hl_ex-clear-objects") + endif (NOT "${last_test}" STREQUAL "") + set (last_test "hl_ex-clear-objects") -FOREACH (example ${examples}) +foreach (example ${examples}) ADD_TEST (NAME hl_ex_${example} COMMAND $) - IF (NOT "${last_test}" STREQUAL "") + if (NOT "${last_test}" STREQUAL "") SET_TESTS_PROPERTIES (hl_ex_${example} PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "hl_ex_${example}") -ENDFOREACH (example ${examples}) + endif (NOT "${last_test}" STREQUAL "") + set (last_test "hl_ex_${example}") +endforeach (example ${examples}) diff --git a/hl/fortran/CMakeLists.txt b/hl/fortran/CMakeLists.txt index 0da0825..f0ff22d 100644 --- a/hl/fortran/CMakeLists.txt +++ b/hl/fortran/CMakeLists.txt @@ -9,13 +9,13 @@ ADD_SUBDIRECTORY (${HDF5_HL_F90_SOURCE_DIR}/src ${HDF5_HL_F90_BINARY_DIR}/src) #----------------------------------------------------------------------------- # Build the HL Fortran Examples #----------------------------------------------------------------------------- -IF (HDF5_BUILD_FORTRAN_EXAMPLES) +if (HDF5_BUILD_FORTRAN_EXAMPLES) ADD_SUBDIRECTORY (${HDF5_HL_F90_SOURCE_DIR}/examples ${HDF5_HL_F90_BINARY_DIR}/examples) -ENDIF (HDF5_BUILD_FORTRAN_EXAMPLES) +endif (HDF5_BUILD_FORTRAN_EXAMPLES) #----------------------------------------------------------------------------- # Testing #----------------------------------------------------------------------------- -IF (BUILD_TESTING) +if (BUILD_TESTING) ADD_SUBDIRECTORY (${HDF5_HL_F90_SOURCE_DIR}/test ${HDF5_HL_F90_BINARY_DIR}/test) -ENDIF (BUILD_TESTING) +endif (BUILD_TESTING) diff --git a/hl/fortran/examples/CMakeLists.txt b/hl/fortran/examples/CMakeLists.txt index 0f663c7..189c9cc 100644 --- a/hl/fortran/examples/CMakeLists.txt +++ b/hl/fortran/examples/CMakeLists.txt @@ -10,27 +10,27 @@ INCLUDE_DIRECTORIES ( ${HDF5_F90_SRC_DIR}/src ) -SET (examples +set (examples exlite ex_ds1 ) -FOREACH (example ${examples}) - ADD_EXECUTABLE (hl_f90_ex_${example} ${HDF5_HL_F90_EXAMPLES_SOURCE_DIR}/${example}.f90) +foreach (example ${examples}) + add_executable (hl_f90_ex_${example} ${HDF5_HL_F90_EXAMPLES_SOURCE_DIR}/${example}.f90) TARGET_NAMING (hl_f90_ex_${example} ${LIB_TYPE}) TARGET_FORTRAN_PROPERTIES (hl_f90_ex_${example} " " " ") - TARGET_LINK_LIBRARIES (hl_f90_ex_${example} + target_link_libraries (hl_f90_ex_${example} ${HDF5_HL_F90_LIB_TARGET} ${HDF5_F90_LIB_TARGET} ${HDF5_LIB_TARGET} ) - SET_TARGET_PROPERTIES (hl_f90_ex_${example} PROPERTIES LINKER_LANGUAGE Fortran) - SET_TARGET_PROPERTIES (hl_f90_ex_${example} PROPERTIES FOLDER examples/hl/fortran) + set_target_properties (hl_f90_ex_${example} PROPERTIES LINKER_LANGUAGE Fortran) + set_target_properties (hl_f90_ex_${example} PROPERTIES FOLDER examples/hl/fortran) -ENDFOREACH (example ${examples}) +endforeach (example ${examples}) -IF (BUILD_TESTING) +if (BUILD_TESTING) - INCLUDE (CMakeTests.cmake) + include (CMakeTests.cmake) -ENDIF (BUILD_TESTING) +endif (BUILD_TESTING) diff --git a/hl/fortran/examples/CMakeTests.cmake b/hl/fortran/examples/CMakeTests.cmake index 7e6c348..1eb7b47 100644 --- a/hl/fortran/examples/CMakeTests.cmake +++ b/hl/fortran/examples/CMakeTests.cmake @@ -5,6 +5,6 @@ ############################################################################## ############################################################################## -FOREACH (example ${examples}) +foreach (example ${examples}) ADD_TEST (NAME hl_f90_ex_${example} COMMAND $) -ENDFOREACH (example ${examples}) +endforeach (example ${examples}) diff --git a/hl/fortran/src/CMakeLists.txt b/hl/fortran/src/CMakeLists.txt index 22353f8..9efcbc8 100644 --- a/hl/fortran/src/CMakeLists.txt +++ b/hl/fortran/src/CMakeLists.txt @@ -14,66 +14,66 @@ INCLUDE_DIRECTORIES ( #----------------------------------------------------------------------------- # hl_f90CStub lib #----------------------------------------------------------------------------- -SET (HDF5_HL_F90_C_SRCS +set (HDF5_HL_F90_C_SRCS ${HDF5_HL_F90_SRC_SOURCE_DIR}/H5DSfc.c ${HDF5_HL_F90_SRC_SOURCE_DIR}/H5LTfc.c ${HDF5_HL_F90_SRC_SOURCE_DIR}/H5IMfc.c ${HDF5_HL_F90_SRC_SOURCE_DIR}/H5IMcc.c ${HDF5_HL_F90_SRC_SOURCE_DIR}/H5TBfc.c ) -SET_SOURCE_FILES_PROPERTIES (${HDF5_HL_F90_C_SRCS} PROPERTIES LANGUAGE C) +set_source_files_properties (${HDF5_HL_F90_C_SRCS} PROPERTIES LANGUAGE C) -SET (HDF5_HL_F90_HEADERS ${HDF5_HL_F90_SRC_SOURCE_DIR}/H5LTf90proto.h) +set (HDF5_HL_F90_HEADERS ${HDF5_HL_F90_SRC_SOURCE_DIR}/H5LTf90proto.h) -ADD_LIBRARY (${HDF5_HL_F90_C_LIB_TARGET} ${LIB_TYPE} ${HDF5_HL_F90_C_SRCS} ${HDF5_HL_F90_HEADERS}) +add_library (${HDF5_HL_F90_C_LIB_TARGET} ${LIB_TYPE} ${HDF5_HL_F90_C_SRCS} ${HDF5_HL_F90_HEADERS}) TARGET_C_PROPERTIES (${HDF5_HL_F90_C_LIB_TARGET} " " " ") -TARGET_LINK_LIBRARIES (${HDF5_HL_F90_C_LIB_TARGET} ${HDF5_F90_C_LIB_TARGET} ${HDF5_HL_LIB_TARGET}) -SET_GLOBAL_VARIABLE (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_HL_F90_C_LIB_TARGET}") +target_link_libraries (${HDF5_HL_F90_C_LIB_TARGET} ${HDF5_F90_C_LIB_TARGET} ${HDF5_HL_LIB_TARGET}) +set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_HL_F90_C_LIB_TARGET}") H5_SET_LIB_OPTIONS (${HDF5_HL_F90_C_LIB_TARGET} ${HDF5_HL_F90_C_LIB_NAME} ${LIB_TYPE}) -SET_TARGET_PROPERTIES (${HDF5_HL_F90_C_LIB_TARGET} PROPERTIES FOLDER libraries/hl/fortran) -SET_TARGET_PROPERTIES (${HDF5_HL_F90_C_LIB_TARGET} PROPERTIES LINKER_LANGUAGE C) +set_target_properties (${HDF5_HL_F90_C_LIB_TARGET} PROPERTIES FOLDER libraries/hl/fortran) +set_target_properties (${HDF5_HL_F90_C_LIB_TARGET} PROPERTIES LINKER_LANGUAGE C) #----------------------------------------------------------------------------- # Fortran Modules #----------------------------------------------------------------------------- -SET (HDF5_HL_F90_F_SRCS +set (HDF5_HL_F90_F_SRCS ${HDF5_HL_F90_SRC_SOURCE_DIR}/H5DSff.f90 ${HDF5_HL_F90_SRC_SOURCE_DIR}/H5TBff.f90 ${HDF5_HL_F90_SRC_SOURCE_DIR}/H5LTff.f90 ${HDF5_HL_F90_SRC_SOURCE_DIR}/H5IMff.f90 ) -ADD_LIBRARY (${HDF5_HL_F90_LIB_TARGET} ${LIB_TYPE} ${HDF5_HL_F90_F_SRCS}) -SET (SHARED_LINK_FLAGS " ") -IF (BUILD_SHARED_LIBS) - IF (WIN32 AND NOT CYGWIN) - SET_PROPERTY (TARGET ${HDF5_HL_F90_LIB_TARGET} +add_library (${HDF5_HL_F90_LIB_TARGET} ${LIB_TYPE} ${HDF5_HL_F90_F_SRCS}) +set (SHARED_LINK_FLAGS " ") +if (BUILD_SHARED_LIBS) + if (WIN32 AND NOT CYGWIN) + set_property (TARGET ${HDF5_HL_F90_LIB_TARGET} APPEND PROPERTY COMPILE_DEFINITIONS BUILD_HDF5_DLL ) - IF (MSVC) - SET (SHARED_LINK_FLAGS "/DLL") - ENDIF (MSVC) - ENDIF (WIN32 AND NOT CYGWIN) -ENDIF (BUILD_SHARED_LIBS) -IF (WIN32 AND NOT CYGWIN) - SET_PROPERTY (TARGET ${HDF5_HL_F90_LIB_TARGET} + if (MSVC) + set (SHARED_LINK_FLAGS "/DLL") + endif (MSVC) + endif (WIN32 AND NOT CYGWIN) +endif (BUILD_SHARED_LIBS) +if (WIN32 AND NOT CYGWIN) + set_property (TARGET ${HDF5_HL_F90_LIB_TARGET} APPEND PROPERTY COMPILE_DEFINITIONS HDF5F90_WINDOWS ) -ENDIF (WIN32 AND NOT CYGWIN) +endif (WIN32 AND NOT CYGWIN) TARGET_FORTRAN_PROPERTIES (${HDF5_HL_F90_LIB_TARGET} " " ${SHARED_LINK_FLAGS}) -SET_TARGET_PROPERTIES (${HDF5_HL_F90_LIB_TARGET} PROPERTIES LINKER_LANGUAGE Fortran) -TARGET_LINK_LIBRARIES (${HDF5_HL_F90_LIB_TARGET} ${HDF5_HL_F90_C_LIB_TARGET} ${HDF5_F90_LIB_TARGET}) -SET_GLOBAL_VARIABLE (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_HL_F90_LIB_TARGET}") +set_target_properties (${HDF5_HL_F90_LIB_TARGET} PROPERTIES LINKER_LANGUAGE Fortran) +target_link_libraries (${HDF5_HL_F90_LIB_TARGET} ${HDF5_HL_F90_C_LIB_TARGET} ${HDF5_F90_LIB_TARGET}) +set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_HL_F90_LIB_TARGET}") H5_SET_LIB_OPTIONS (${HDF5_HL_F90_LIB_TARGET} ${HDF5_HL_F90_LIB_NAME} ${LIB_TYPE}) -SET_TARGET_PROPERTIES (${HDF5_HL_F90_LIB_TARGET} PROPERTIES FOLDER libraries/hl/fortran) +set_target_properties (${HDF5_HL_F90_LIB_TARGET} PROPERTIES FOLDER libraries/hl/fortran) #----------------------------------------------------------------------------- # Add file(s) to CMake Install #----------------------------------------------------------------------------- -IF (WIN32 AND NOT CYGWIN) - INSTALL ( +if (WIN32 AND NOT CYGWIN) + install ( DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/\${BUILD_TYPE}/ DESTINATION @@ -81,8 +81,8 @@ IF (WIN32 AND NOT CYGWIN) COMPONENT fortheaders ) -ELSE (WIN32 AND NOT CYGWIN) - INSTALL ( +else (WIN32 AND NOT CYGWIN) + install ( DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/ DESTINATION @@ -90,17 +90,17 @@ ELSE (WIN32 AND NOT CYGWIN) COMPONENT fortheaders ) -ENDIF (WIN32 AND NOT CYGWIN) +endif (WIN32 AND NOT CYGWIN) #----------------------------------------------------------------------------- # Add Target(s) to CMake Install for import into other projects #----------------------------------------------------------------------------- -IF (HDF5_EXPORTED_TARGETS) +if (HDF5_EXPORTED_TARGETS) INSTALL_TARGET_PDB (${HDF5_HL_F90_C_LIB_TARGET} ${HDF5_INSTALL_LIB_DIR} hlfortlibraries) #INSTALL_TARGET_PDB (${HDF5_HL_F90_LIB_TARGET} ${HDF5_INSTALL_LIB_DIR} hlfortlibraries) - INSTALL ( + install ( TARGETS ${HDF5_HL_F90_C_LIB_TARGET} ${HDF5_HL_F90_LIB_TARGET} @@ -110,4 +110,4 @@ IF (HDF5_EXPORTED_TARGETS) ARCHIVE DESTINATION ${HDF5_INSTALL_LIB_DIR} COMPONENT hlfortlibraries RUNTIME DESTINATION ${HDF5_INSTALL_BIN_DIR} COMPONENT hlfortlibraries ) -ENDIF (HDF5_EXPORTED_TARGETS) +endif (HDF5_EXPORTED_TARGETS) diff --git a/hl/fortran/test/CMakeLists.txt b/hl/fortran/test/CMakeLists.txt index 2084162..23c199c 100644 --- a/hl/fortran/test/CMakeLists.txt +++ b/hl/fortran/test/CMakeLists.txt @@ -7,35 +7,35 @@ PROJECT (HDF5_HL_FORTRAN_TESTS C CXX Fortran) INCLUDE_DIRECTORIES (${CMAKE_Fortran_MODULE_DIRECTORY} ${HDF5_F90_BINARY_DIR} ${HDF5_F90_SRC_DIR}/src) #-- Adding test for hl_f90_tstds -ADD_EXECUTABLE (hl_f90_tstds tstds.f90) +add_executable (hl_f90_tstds tstds.f90) TARGET_NAMING (hl_f90_tstds ${LIB_TYPE}) TARGET_FORTRAN_PROPERTIES (hl_f90_tstds " " " ") -TARGET_LINK_LIBRARIES (hl_f90_tstds ${HDF5_HL_F90_LIB_TARGET} ${HDF5_F90_LIB_TARGET}) -SET_TARGET_PROPERTIES (hl_f90_tstds PROPERTIES LINKER_LANGUAGE Fortran) -SET_TARGET_PROPERTIES (hl_f90_tstds PROPERTIES FOLDER test/hl/fortran) +target_link_libraries (hl_f90_tstds ${HDF5_HL_F90_LIB_TARGET} ${HDF5_F90_LIB_TARGET}) +set_target_properties (hl_f90_tstds PROPERTIES LINKER_LANGUAGE Fortran) +set_target_properties (hl_f90_tstds PROPERTIES FOLDER test/hl/fortran) #-- Adding test for hl_f90_tstlite -ADD_EXECUTABLE (hl_f90_tstlite tstlite.f90) +add_executable (hl_f90_tstlite tstlite.f90) TARGET_NAMING (hl_f90_tstlite ${LIB_TYPE}) TARGET_FORTRAN_PROPERTIES (hl_f90_tstlite " " " ") -TARGET_LINK_LIBRARIES (hl_f90_tstlite ${HDF5_HL_F90_LIB_TARGET} ${HDF5_F90_LIB_TARGET}) -SET_TARGET_PROPERTIES (hl_f90_tstlite PROPERTIES LINKER_LANGUAGE Fortran) -SET_TARGET_PROPERTIES (hl_f90_tstlite PROPERTIES FOLDER test/hl/fortran) +target_link_libraries (hl_f90_tstlite ${HDF5_HL_F90_LIB_TARGET} ${HDF5_F90_LIB_TARGET}) +set_target_properties (hl_f90_tstlite PROPERTIES LINKER_LANGUAGE Fortran) +set_target_properties (hl_f90_tstlite PROPERTIES FOLDER test/hl/fortran) #-- Adding test for hl_f90_tstimage -ADD_EXECUTABLE (hl_f90_tstimage tstimage.f90) +add_executable (hl_f90_tstimage tstimage.f90) TARGET_NAMING (hl_f90_tstimage ${LIB_TYPE}) TARGET_FORTRAN_PROPERTIES (hl_f90_tstimage " " " ") -TARGET_LINK_LIBRARIES (hl_f90_tstimage ${HDF5_HL_F90_LIB_TARGET} ${HDF5_F90_LIB_TARGET}) -SET_TARGET_PROPERTIES (hl_f90_tstimage PROPERTIES LINKER_LANGUAGE Fortran) -SET_TARGET_PROPERTIES (hl_f90_tstimage PROPERTIES FOLDER test/hl/fortran) +target_link_libraries (hl_f90_tstimage ${HDF5_HL_F90_LIB_TARGET} ${HDF5_F90_LIB_TARGET}) +set_target_properties (hl_f90_tstimage PROPERTIES LINKER_LANGUAGE Fortran) +set_target_properties (hl_f90_tstimage PROPERTIES FOLDER test/hl/fortran) #-- Adding test for hl_f90_tsttable -ADD_EXECUTABLE (hl_f90_tsttable tsttable.f90) +add_executable (hl_f90_tsttable tsttable.f90) TARGET_NAMING (hl_f90_tsttable ${LIB_TYPE}) TARGET_FORTRAN_PROPERTIES (hl_f90_tsttable " " " ") -TARGET_LINK_LIBRARIES (hl_f90_tsttable ${HDF5_HL_F90_LIB_TARGET} ${HDF5_F90_LIB_TARGET}) -SET_TARGET_PROPERTIES (hl_f90_tsttable PROPERTIES LINKER_LANGUAGE Fortran) -SET_TARGET_PROPERTIES (hl_f90_tsttable PROPERTIES FOLDER test/hl/fortran) +target_link_libraries (hl_f90_tsttable ${HDF5_HL_F90_LIB_TARGET} ${HDF5_F90_LIB_TARGET}) +set_target_properties (hl_f90_tsttable PROPERTIES LINKER_LANGUAGE Fortran) +set_target_properties (hl_f90_tsttable PROPERTIES FOLDER test/hl/fortran) -INCLUDE (CMakeTests.cmake) +include (CMakeTests.cmake) diff --git a/hl/src/CMakeLists.txt b/hl/src/CMakeLists.txt index 5904d05..5bfac2a 100644 --- a/hl/src/CMakeLists.txt +++ b/hl/src/CMakeLists.txt @@ -4,16 +4,16 @@ PROJECT (HDF5_HL_SRC) #----------------------------------------------------------------------------- # Shared Libs #----------------------------------------------------------------------------- -IF (BUILD_SHARED_LIBS) - SET (HL_BUILT_AS_DYNAMIC_LIB 1) -ENDIF (BUILD_SHARED_LIBS) +if (BUILD_SHARED_LIBS) + set (HL_BUILT_AS_DYNAMIC_LIB 1) +endif (BUILD_SHARED_LIBS) #----------------------------------------------------------------------------- # List Source files #----------------------------------------------------------------------------- INCLUDE_DIRECTORIES (${HDF5_HL_SRC_DIR}/src) -SET (HL_SRCS +set (HL_SRCS ${HDF5_HL_SRC_SOURCE_DIR}/H5DO.c ${HDF5_HL_SRC_SOURCE_DIR}/H5DS.c ${HDF5_HL_SRC_SOURCE_DIR}/H5IM.c @@ -24,7 +24,7 @@ SET (HL_SRCS ${HDF5_HL_SRC_SOURCE_DIR}/H5TB.c ) -SET (HL_HEADERS +set (HL_HEADERS ${HDF5_HL_SRC_SOURCE_DIR}/H5DOpublic.h ${HDF5_HL_SRC_SOURCE_DIR}/H5DSpublic.h ${HDF5_HL_SRC_SOURCE_DIR}/H5IMpublic.h @@ -35,17 +35,17 @@ SET (HL_HEADERS ${HDF5_HL_SRC_SOURCE_DIR}/hdf5_hl.h ) -ADD_LIBRARY (${HDF5_HL_LIB_TARGET} ${LIB_TYPE} ${HL_SRCS} ${HL_HEADERS}) +add_library (${HDF5_HL_LIB_TARGET} ${LIB_TYPE} ${HL_SRCS} ${HL_HEADERS}) TARGET_C_PROPERTIES (${HDF5_HL_LIB_TARGET} " " " ") -TARGET_LINK_LIBRARIES (${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET}) -SET_GLOBAL_VARIABLE (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_HL_LIB_TARGET}") +target_link_libraries (${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET}) +set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_HL_LIB_TARGET}") H5_SET_LIB_OPTIONS (${HDF5_HL_LIB_TARGET} ${HDF5_HL_LIB_NAME} ${LIB_TYPE}) -SET_TARGET_PROPERTIES (${HDF5_HL_LIB_TARGET} PROPERTIES FOLDER libraries/hl) +set_target_properties (${HDF5_HL_LIB_TARGET} PROPERTIES FOLDER libraries/hl) #----------------------------------------------------------------------------- # Add file(s) to CMake Install #----------------------------------------------------------------------------- -INSTALL ( +install ( FILES ${HL_HEADERS} DESTINATION @@ -57,11 +57,11 @@ INSTALL ( #----------------------------------------------------------------------------- # Add Target(s) to CMake Install for import into other projects #----------------------------------------------------------------------------- -IF (HDF5_EXPORTED_TARGETS) +if (HDF5_EXPORTED_TARGETS) INSTALL_TARGET_PDB (${HDF5_HL_LIB_TARGET} ${HDF5_INSTALL_LIB_DIR} hllibraries) - INSTALL ( + install ( TARGETS ${HDF5_HL_LIB_TARGET} EXPORT @@ -70,4 +70,4 @@ IF (HDF5_EXPORTED_TARGETS) ARCHIVE DESTINATION ${HDF5_INSTALL_LIB_DIR} COMPONENT hllibraries RUNTIME DESTINATION ${HDF5_INSTALL_BIN_DIR} COMPONENT hllibraries ) -ENDIF (HDF5_EXPORTED_TARGETS) +endif (HDF5_EXPORTED_TARGETS) diff --git a/hl/test/CMakeLists.txt b/hl/test/CMakeLists.txt index f969dbf..2853438 100644 --- a/hl/test/CMakeLists.txt +++ b/hl/test/CMakeLists.txt @@ -11,7 +11,7 @@ PROJECT (HDF5_HL_TEST) #----------------------------------------------------------------------------- # Generate the H5srcdir_str.h file containing user settings needed by compilation #----------------------------------------------------------------------------- -SET (srcdir ${CMAKE_CURRENT_SOURCE_DIR}) +set (srcdir ${CMAKE_CURRENT_SOURCE_DIR}) CONFIGURE_FILE (${HDF5_HL_TEST_SOURCE_DIR}/H5srcdir_str.h.in H5srcdir_str.h @ONLY) INCLUDE_DIRECTORIES (${CMAKE_CURRENT_BINARY_DIR}) @@ -21,15 +21,15 @@ INCLUDE_DIRECTORIES (${HDF5_TEST_SRC_DIR}) # Macro used to add a unit test # -------------------------------------------------------------------- MACRO (HL_ADD_EXE hl_name) - ADD_EXECUTABLE (hl_${hl_name} ${hl_name}.c) + add_executable (hl_${hl_name} ${hl_name}.c) TARGET_NAMING (hl_${hl_name} ${LIB_TYPE}) TARGET_C_PROPERTIES (hl_${hl_name} " " " ") - TARGET_LINK_LIBRARIES (hl_${hl_name} + target_link_libraries (hl_${hl_name} ${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET} ) - SET_TARGET_PROPERTIES (hl_${hl_name} PROPERTIES FOLDER test/hl) + set_target_properties (hl_${hl_name} PROPERTIES FOLDER test/hl) ENDMACRO (HL_ADD_EXE) HL_ADD_EXE (test_ds) @@ -43,16 +43,16 @@ HL_ADD_EXE (test_table) # This executable is used to generate test files for the test_ds test. # It should only be run during development when new test files are needed # -------------------------------------------------------------------- -IF (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) - ADD_EXECUTABLE (hl_gen_test_ds gen_test_ds.c) +if (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) + add_executable (hl_gen_test_ds gen_test_ds.c) TARGET_NAMING (hl_gen_test_ds ${LIB_TYPE}) TARGET_C_PROPERTIES (hl_gen_test_ds " " " ") - TARGET_LINK_LIBRARIES (hl_gen_test_ds + target_link_libraries (hl_gen_test_ds ${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET} ) - SET_TARGET_PROPERTIES (hl_gen_test_ds PROPERTIES FOLDER test/hl/gen) -ENDIF (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) + set_target_properties (hl_gen_test_ds PROPERTIES FOLDER test/hl/gen) +endif (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) -INCLUDE (CMakeTests.cmake) +include (CMakeTests.cmake) diff --git a/hl/test/CMakeTests.cmake b/hl/test/CMakeTests.cmake index 5d42b57..ebbc353 100644 --- a/hl/test/CMakeTests.cmake +++ b/hl/test/CMakeTests.cmake @@ -10,24 +10,24 @@ # -------------------------------------------------------------------- MACRO (HL_ADD_TEST hl_name files) ADD_TEST (NAME hl_${hl_name} COMMAND $) - IF (NOT "${last_test}" STREQUAL "") + if (NOT "${last_test}" STREQUAL "") SET_TESTS_PROPERTIES (hl_${hl_name} PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") + endif (NOT "${last_test}" STREQUAL "") # -------------------------------------------------------------------- #-- Copy the necessary files. # -------------------------------------------------------------------- - FOREACH (h5_file ${files}) - SET (dest "${HDF5_HL_TEST_BINARY_DIR}/${h5_file}") - #MESSAGE (STATUS " Copying HL Test File ${h5_file} to ${dest}") - ADD_CUSTOM_COMMAND ( + foreach (h5_file ${files}) + set (dest "${HDF5_HL_TEST_BINARY_DIR}/${h5_file}") + #message (STATUS " Copying HL Test File ${h5_file} to ${dest}") + add_custom_command ( TARGET hl_${hl_name} PRE_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${HDF5_HL_TEST_SOURCE_DIR}/${h5_file} ${dest} ) - ENDFOREACH (h5_file ${HL_REFERENCE_TEST_FILES}) + endforeach (h5_file ${HL_REFERENCE_TEST_FILES}) ENDMACRO (HL_ADD_TEST) # Remove any output file left over from previous test run @@ -60,10 +60,10 @@ ADD_TEST ( test_packet_table.h5 test_table.h5 ) -IF (NOT "${last_test}" STREQUAL "") +if (NOT "${last_test}" STREQUAL "") SET_TESTS_PROPERTIES (hl_test-clear-objects PROPERTIES DEPENDS ${last_test}) -ENDIF (NOT "${last_test}" STREQUAL "") -SET (last_test "hl_test-clear-objects") +endif (NOT "${last_test}" STREQUAL "") +set (last_test "hl_test-clear-objects") HL_ADD_TEST (test_ds "dsdata.txt;dslat.txt;dslon.txt;test_ds_be.h5;test_ds_le.h5") HL_ADD_TEST (test_dset_opt "") diff --git a/hl/tools/CMakeLists.txt b/hl/tools/CMakeLists.txt index 256ff89..a8674e7 100644 --- a/hl/tools/CMakeLists.txt +++ b/hl/tools/CMakeLists.txt @@ -4,7 +4,7 @@ PROJECT (HDF5_HL_TOOLS) #----------------------------------------------------------------------------- # Define Sources #----------------------------------------------------------------------------- -SET (GIF2H5_SRCS +set (GIF2H5_SRCS ${HDF5_HL_TOOLS_SOURCE_DIR}/gif2h5/gif.h ${HDF5_HL_TOOLS_SOURCE_DIR}/gif2h5/decompress.c ${HDF5_HL_TOOLS_SOURCE_DIR}/gif2h5/gif2hdf.c @@ -17,46 +17,46 @@ SET (GIF2H5_SRCS INCLUDE_DIRECTORIES (${HDF5_TOOLS_SRC_DIR}/lib) INCLUDE_DIRECTORIES (${HDF5_HL_TOOLS_SOURCE_DIR}/gif2h5) -ADD_EXECUTABLE (gif2h5 ${GIF2H5_SRCS}) +add_executable (gif2h5 ${GIF2H5_SRCS}) TARGET_NAMING (gif2h5 ${LIB_TYPE}) TARGET_C_PROPERTIES (gif2h5 " " " ") -TARGET_LINK_LIBRARIES (gif2h5 ${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) -SET_TARGET_PROPERTIES (gif2h5 PROPERTIES FOLDER tools/hl) +target_link_libraries (gif2h5 ${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) +set_target_properties (gif2h5 PROPERTIES FOLDER tools/hl) #-- Add h52gif program -SET (hdf2gif_SRCS +set (hdf2gif_SRCS ${HDF5_HL_TOOLS_SOURCE_DIR}/gif2h5/hdf2gif.c ${HDF5_HL_TOOLS_SOURCE_DIR}/gif2h5/hdfgifwr.c ) -ADD_EXECUTABLE (h52gif ${hdf2gif_SRCS}) +add_executable (h52gif ${hdf2gif_SRCS}) TARGET_NAMING (h52gif ${LIB_TYPE}) TARGET_C_PROPERTIES (h52gif " " " ") -TARGET_LINK_LIBRARIES (h52gif ${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) -SET_TARGET_PROPERTIES (h52gif PROPERTIES FOLDER tools/hl) +target_link_libraries (h52gif ${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) +set_target_properties (h52gif PROPERTIES FOLDER tools/hl) -IF (BUILD_TESTING) +if (BUILD_TESTING) # -------------------------------------------------------------------- # This executable can generate the actual test files - Currently not # used in the CMake Build system as we rely on the test files that are # shipped with HDF5 source archives # -------------------------------------------------------------------- - IF (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) - ADD_EXECUTABLE (hl_h52gifgentest ${HDF5_HL_TOOLS_SOURCE_DIR}/gif2h5/h52gifgentst.c) + if (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) + add_executable (hl_h52gifgentest ${HDF5_HL_TOOLS_SOURCE_DIR}/gif2h5/h52gifgentst.c) TARGET_NAMING (hl_h52gifgentest ${LIB_TYPE}) TARGET_C_PROPERTIES (hl_h52gifgentest " " " ") - TARGET_LINK_LIBRARIES (hl_h52gifgentest ${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET}) - SET_TARGET_PROPERTIES (hl_h52gifgentest PROPERTIES FOLDER generator/tools/hl) + target_link_libraries (hl_h52gifgentest ${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET}) + set_target_properties (hl_h52gifgentest PROPERTIES FOLDER generator/tools/hl) # ADD_TEST (NAME hl_h52gifgentest COMMAND $) - ENDIF (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) + endif (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) - INCLUDE (CMakeTests.cmake) -ENDIF (BUILD_TESTING) + include (CMakeTests.cmake) +endif (BUILD_TESTING) #----------------------------------------------------------------------------- # Add file(s) to CMake Install #----------------------------------------------------------------------------- -INSTALL ( +install ( TARGETS gif2h5 h52gif diff --git a/hl/tools/CMakeTests.cmake b/hl/tools/CMakeTests.cmake index 9f987fd..df419c3 100644 --- a/hl/tools/CMakeTests.cmake +++ b/hl/tools/CMakeTests.cmake @@ -12,14 +12,14 @@ FILE (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") # copy test files from source to build dir # -ADD_CUSTOM_COMMAND ( +add_custom_command ( TARGET gif2h5 POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${HDF5_HL_TOOLS_SOURCE_DIR}/gif2h5/testfiles/image1.gif ${PROJECT_BINARY_DIR}/testfiles/image1.gif ) -ADD_CUSTOM_COMMAND ( +add_custom_command ( TARGET h52gif POST_BUILD COMMAND ${CMAKE_COMMAND} diff --git a/perform/CMakeLists.txt b/perform/CMakeLists.txt index 0a6fa10..2ea0c32 100644 --- a/perform/CMakeLists.txt +++ b/perform/CMakeLists.txt @@ -4,7 +4,7 @@ PROJECT (HDF5_PERFORM ) #----------------------------------------------------------------------------- # Apply Definitions to compiler in this directory and below #----------------------------------------------------------------------------- -ADD_DEFINITIONS (${HDF5_EXTRA_C_FLAGS}) +add_definitions (${HDF5_EXTRA_C_FLAGS}) #----------------------------------------------------------------------------- # Setup include Directories @@ -16,125 +16,125 @@ INCLUDE_DIRECTORIES (${HDF5_TOOLS_SRC_DIR}/lib ) # Add the executables # -------------------------------------------------------------------- #-- Adding test for h5perf_serial -SET (h5perf_serial_SRCS +set (h5perf_serial_SRCS ${HDF5_PERFORM_SOURCE_DIR}/sio_timer.c ${HDF5_PERFORM_SOURCE_DIR}/sio_perf.c ${HDF5_PERFORM_SOURCE_DIR}/sio_engine.c ) -ADD_EXECUTABLE (h5perf_serial ${h5perf_serial_SRCS}) +add_executable (h5perf_serial ${h5perf_serial_SRCS}) TARGET_NAMING (h5perf_serial ${LIB_TYPE}) TARGET_C_PROPERTIES (h5perf_serial " " " ") -TARGET_LINK_LIBRARIES (h5perf_serial ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) -SET_TARGET_PROPERTIES (h5perf_serial PROPERTIES FOLDER perform) +target_link_libraries (h5perf_serial ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) +set_target_properties (h5perf_serial PROPERTIES FOLDER perform) -IF (HDF5_BUILD_PERFORM_STANDALONE) +if (HDF5_BUILD_PERFORM_STANDALONE) #-- Adding test for h5perf_serial_alone - SET (h5perf_serial_alone_SRCS + set (h5perf_serial_alone_SRCS ${HDF5_PERFORM_SOURCE_DIR}/sio_timer.c ${HDF5_PERFORM_SOURCE_DIR}/sio_perf.c ${HDF5_PERFORM_SOURCE_DIR}/sio_engine.c ) - ADD_EXECUTABLE (h5perf_serial_alone ${h5perf_serial_alone_SRCS}) - SET_PROPERTY (TARGET h5perf_serial_alone + add_executable (h5perf_serial_alone ${h5perf_serial_alone_SRCS}) + set_property (TARGET h5perf_serial_alone APPEND PROPERTY COMPILE_DEFINITIONS STANDALONE ) TARGET_NAMING (h5perf_serial_alone ${LIB_TYPE}) TARGET_C_PROPERTIES (h5perf_serial_alone " " " ") - TARGET_LINK_LIBRARIES (h5perf_serial_alone ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) - SET_TARGET_PROPERTIES (h5perf_serial_alone PROPERTIES FOLDER perform) -ENDIF (HDF5_BUILD_PERFORM_STANDALONE) + target_link_libraries (h5perf_serial_alone ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) + set_target_properties (h5perf_serial_alone PROPERTIES FOLDER perform) +endif (HDF5_BUILD_PERFORM_STANDALONE) #-- Adding test for chunk -SET (chunk_SRCS +set (chunk_SRCS ${HDF5_PERFORM_SOURCE_DIR}/chunk.c ) ADD_EXECUTABLE(chunk ${chunk_SRCS}) TARGET_NAMING (chunk ${LIB_TYPE}) TARGET_C_PROPERTIES (chunk " " " ") TARGET_LINK_LIBRARIES(chunk ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) -SET_TARGET_PROPERTIES (chunk PROPERTIES FOLDER perform) +set_target_properties (chunk PROPERTIES FOLDER perform) #-- Adding test for iopipe -SET (iopipe_SRCS +set (iopipe_SRCS ${HDF5_PERFORM_SOURCE_DIR}/iopipe.c ) -ADD_EXECUTABLE (iopipe ${iopipe_SRCS}) +add_executable (iopipe ${iopipe_SRCS}) TARGET_NAMING (iopipe ${LIB_TYPE}) TARGET_C_PROPERTIES (iopipe " " " ") -TARGET_LINK_LIBRARIES (iopipe ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) -SET_TARGET_PROPERTIES (iopipe PROPERTIES FOLDER perform) +target_link_libraries (iopipe ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) +set_target_properties (iopipe PROPERTIES FOLDER perform) #-- Adding test for overhead -SET (overhead_SRCS +set (overhead_SRCS ${HDF5_PERFORM_SOURCE_DIR}/overhead.c ) -ADD_EXECUTABLE (overhead ${overhead_SRCS}) +add_executable (overhead ${overhead_SRCS}) TARGET_NAMING (overhead ${LIB_TYPE}) TARGET_C_PROPERTIES (overhead " " " ") -TARGET_LINK_LIBRARIES (overhead ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) -SET_TARGET_PROPERTIES (overhead PROPERTIES FOLDER perform) +target_link_libraries (overhead ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) +set_target_properties (overhead PROPERTIES FOLDER perform) #-- Adding test for perf_meta -SET (perf_meta_SRCS +set (perf_meta_SRCS ${HDF5_PERFORM_SOURCE_DIR}/perf_meta.c ) -ADD_EXECUTABLE (perf_meta ${perf_meta_SRCS}) +add_executable (perf_meta ${perf_meta_SRCS}) TARGET_NAMING (perf_meta ${LIB_TYPE}) TARGET_C_PROPERTIES (perf_meta " " " ") -TARGET_LINK_LIBRARIES (perf_meta ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) -SET_TARGET_PROPERTIES (perf_meta PROPERTIES FOLDER perform) +target_link_libraries (perf_meta ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) +set_target_properties (perf_meta PROPERTIES FOLDER perform) #-- Adding test for zip_perf -SET (zip_perf_SRCS +set (zip_perf_SRCS ${HDF5_PERFORM_SOURCE_DIR}/zip_perf.c ) -ADD_EXECUTABLE (zip_perf ${zip_perf_SRCS}) +add_executable (zip_perf ${zip_perf_SRCS}) TARGET_NAMING (zip_perf ${LIB_TYPE}) TARGET_C_PROPERTIES (zip_perf " " " ") -TARGET_LINK_LIBRARIES (zip_perf ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) -SET_TARGET_PROPERTIES (zip_perf PROPERTIES FOLDER perform) +target_link_libraries (zip_perf ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) +set_target_properties (zip_perf PROPERTIES FOLDER perform) -IF (H5_HAVE_PARALLEL) +if (H5_HAVE_PARALLEL) #-- Adding test for h5perf - SET (h5perf_SRCS + set (h5perf_SRCS ${HDF5_PERFORM_SOURCE_DIR}/pio_timer.c ${HDF5_PERFORM_SOURCE_DIR}/pio_perf.c ${HDF5_PERFORM_SOURCE_DIR}/pio_engine.c ) - ADD_EXECUTABLE (h5perf ${h5perf_SRCS}) + add_executable (h5perf ${h5perf_SRCS}) TARGET_NAMING (h5perf ${LIB_TYPE}) TARGET_C_PROPERTIES (h5perf " " " ") - TARGET_LINK_LIBRARIES (h5perf ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) - SET_TARGET_PROPERTIES (h5perf PROPERTIES FOLDER perform) + target_link_libraries (h5perf ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) + set_target_properties (h5perf PROPERTIES FOLDER perform) - IF (HDF5_BUILD_PERFORM_STANDALONE) + if (HDF5_BUILD_PERFORM_STANDALONE) #-- Adding test for h5perf - SET (h5perf_alone_SRCS + set (h5perf_alone_SRCS ${HDF5_PERFORM_SOURCE_DIR}/pio_timer.c ${HDF5_PERFORM_SOURCE_DIR}/pio_perf.c ${HDF5_PERFORM_SOURCE_DIR}/pio_engine.c ) - ADD_EXECUTABLE (h5perf_alone ${h5perf_alone_SRCS}) - SET_PROPERTY (TARGET h5perf_alone + add_executable (h5perf_alone ${h5perf_alone_SRCS}) + set_property (TARGET h5perf_alone APPEND PROPERTY COMPILE_DEFINITIONS STANDALONE ) TARGET_NAMING (h5perf_alone ${LIB_TYPE}) TARGET_C_PROPERTIES (h5perf_alone " " " ") - TARGET_LINK_LIBRARIES (h5perf_alone ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) - SET_TARGET_PROPERTIES (h5perf_alone PROPERTIES FOLDER perform) - ENDIF (HDF5_BUILD_PERFORM_STANDALONE) + target_link_libraries (h5perf_alone ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) + set_target_properties (h5perf_alone PROPERTIES FOLDER perform) + endif (HDF5_BUILD_PERFORM_STANDALONE) - IF (HDF5_BUILD_PARALLEL_ALL) + if (HDF5_BUILD_PARALLEL_ALL) #-- Adding test for benchpar - SET (benchpar_SRCS + set (benchpar_SRCS ${HDF5_PERFORM_SOURCE_DIR}/benchpar.c ) - ADD_EXECUTABLE (benchpar ${benchpar_SRCS}) + add_executable (benchpar ${benchpar_SRCS}) TARGET_NAMING (benchpar ${LIB_TYPE}) TARGET_C_PROPERTIES (benchpar " " " ") - TARGET_LINK_LIBRARIES (benchpar ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) - SET_TARGET_PROPERTIES (benchpar PROPERTIES FOLDER perform) - ENDIF (HDF5_BUILD_PARALLEL_ALL) -ENDIF (H5_HAVE_PARALLEL) + target_link_libraries (benchpar ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) + set_target_properties (benchpar PROPERTIES FOLDER perform) + endif (HDF5_BUILD_PARALLEL_ALL) +endif (H5_HAVE_PARALLEL) -INCLUDE (CMakeTests.cmake) +include (CMakeTests.cmake) diff --git a/perform/CMakeTests.cmake b/perform/CMakeTests.cmake index fab6ab2..1b93753 100644 --- a/perform/CMakeTests.cmake +++ b/perform/CMakeTests.cmake @@ -5,7 +5,7 @@ ############################################################################## ############################################################################## -ADD_CUSTOM_COMMAND ( +add_custom_command ( TARGET zip_perf POST_BUILD COMMAND ${CMAKE_COMMAND} @@ -33,9 +33,9 @@ ADD_TEST ( ADD_TEST (NAME PERFORM_h5perf_serial COMMAND $) -IF (HDF5_BUILD_PERFORM_STANDALONE) +if (HDF5_BUILD_PERFORM_STANDALONE) ADD_TEST (NAME PERFORM_h5perf_serial_alone COMMAND $) -ENDIF (HDF5_BUILD_PERFORM_STANDALONE) +endif (HDF5_BUILD_PERFORM_STANDALONE) ADD_TEST (NAME PERFORM_chunk COMMAND $) @@ -48,14 +48,14 @@ ADD_TEST (NAME PERFORM_perf_meta COMMAND $) ADD_TEST (NAME PERFORM_zip_perf_help COMMAND $ "-h") ADD_TEST (NAME PERFORM_zip_perf COMMAND $ tfilters.h5) -IF (H5_HAVE_PARALLEL) +if (H5_HAVE_PARALLEL) ADD_TEST (NAME PERFORM_h5perf COMMAND ${MPIEXEC} ${MPIEXEC_PREFLAGS} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_POSTFLAGS} $) - IF (HDF5_BUILD_PERFORM_STANDALONE) + if (HDF5_BUILD_PERFORM_STANDALONE) ADD_TEST (NAME PERFORM_h5perf_alone COMMAND ${MPIEXEC} ${MPIEXEC_PREFLAGS} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_POSTFLAGS} $) - ENDIF (HDF5_BUILD_PERFORM_STANDALONE) + endif (HDF5_BUILD_PERFORM_STANDALONE) - IF (HDF5_BUILD_PARALLEL_ALL) + if (HDF5_BUILD_PARALLEL_ALL) ADD_TEST (NAME PERFORM_benchpar COMMAND ${MPIEXEC} ${MPIEXEC_PREFLAGS} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_POSTFLAGS} $) - ENDIF (HDF5_BUILD_PARALLEL_ALL) -ENDIF (H5_HAVE_PARALLEL) + endif (HDF5_BUILD_PARALLEL_ALL) +endif (H5_HAVE_PARALLEL) diff --git a/release_docs/INSTALL_CMake.txt b/release_docs/INSTALL_CMake.txt index 438d7e2..dc359f6 100644 --- a/release_docs/INSTALL_CMake.txt +++ b/release_docs/INSTALL_CMake.txt @@ -286,42 +286,42 @@ These five steps are described in detail below. ######################## # 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) + 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 @@ -462,7 +462,7 @@ 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) +if (HDF5_BUILD_FORTRAN) HDF5_ENABLE_F2003 "Enable FORTRAN 2003 Standard" OFF ---------------- HDF5 Advanced Options --------------------- @@ -490,13 +490,13 @@ HDF5_USE_FOLDERS "Enable folder grouping of projects in IDEs." 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) +if (APPLE) HDF5_BUILD_WITH_INSTALL_NAME "Build with library install_name set to the installation path" OFF -IF (CMAKE_BUILD_TYPE MATCHES Debug) +if (CMAKE_BUILD_TYPE MATCHES Debug) HDF5_ENABLE_TRACE "Enable API tracing capability" ON -IF (HDF5_TEST_VFD) +if (HDF5_TEST_VFD) HDF5_TEST_FHEAP_VFD "Execute fheap test with different VFDs" ON -IF (WIN32 AND NOT CYGWIN) +if (WIN32 AND NOT CYGWIN) HDF_LEGACY_NAMING "Use Legacy Names for Libraries and Programs" OFF ---------------- External Library Options --------------------- @@ -509,13 +509,13 @@ 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) +if (HDF5_ENABLE_SZIP_SUPPORT) HDF5_ENABLE_SZIP_ENCODING "Use SZip Encoding" OFF -IF (WINDOWS) +if (WINDOWS) H5_DEFAULT_PLUGINDIR "%ALLUSERSPROFILE%/hdf5/lib/plugin" -ELSE (WINDOWS) +else (WINDOWS) H5_DEFAULT_PLUGINDIR "/usr/local/hdf5/lib/plugin" -ENDIF (WINDOWS) +endif (WINDOWS) diff --git a/release_docs/USING_HDF5_CMake.txt b/release_docs/USING_HDF5_CMake.txt index 313e0f0..227a89c 100644 --- a/release_docs/USING_HDF5_CMake.txt +++ b/release_docs/USING_HDF5_CMake.txt @@ -192,16 +192,16 @@ 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 (LINK_LIBS ${LINK_LIBS} ${HDF5_LIBRARIES}) -SET (example hdf_example) +set (example hdf_example) -ADD_EXECUTABLE (${example} ${PROJECT_SOURCE_DIR}/${example}.c) +add_executable (${example} ${PROJECT_SOURCE_DIR}/${example}.c) TARGET_C_PROPERTIES (${example} " " " ") -TARGET_LINK_LIBRARIES (${example} ${LINK_LIBS}) +target_link_libraries (${example} ${LINK_LIBS}) ENABLE_TESTING () -INCLUDE (CTest) +include (CTest) ADD_TEST (NAME test_example COMMAND ${example}) ########################################################## diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index c626065..db26166 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -4,12 +4,12 @@ PROJECT (HDF5_SRC C CXX) #----------------------------------------------------------------------------- # Apply Definitions to compiler in this directory and below #----------------------------------------------------------------------------- -ADD_DEFINITIONS (${HDF5_EXTRA_C_FLAGS}) +add_definitions (${HDF5_EXTRA_C_FLAGS}) #----------------------------------------------------------------------------- # List Source Files #----------------------------------------------------------------------------- -SET (H5_SRCS +set (H5_SRCS ${HDF5_SRC_DIR}/H5.c ${HDF5_SRC_DIR}/H5checksum.c ${HDF5_SRC_DIR}/H5dbg.c @@ -18,7 +18,7 @@ SET (H5_SRCS ${HDF5_SRC_DIR}/H5trace.c ) -SET (H5_HDRS +set (H5_HDRS ${HDF5_SRC_DIR}/hdf5.h ${HDF5_SRC_DIR}/H5api_adpt.h ${HDF5_SRC_DIR}/H5public.h @@ -27,7 +27,7 @@ SET (H5_HDRS ) IDE_GENERATED_PROPERTIES ("H5" "${H5_HDRS}" "${H5_SRCS}" ) -SET (H5A_SRCS +set (H5A_SRCS ${HDF5_SRC_DIR}/H5A.c ${HDF5_SRC_DIR}/H5Abtree2.c ${HDF5_SRC_DIR}/H5Adense.c @@ -36,35 +36,35 @@ SET (H5A_SRCS ${HDF5_SRC_DIR}/H5Atest.c ) -SET (H5A_HDRS +set (H5A_HDRS ${HDF5_SRC_DIR}/H5Apkg.h ${HDF5_SRC_DIR}/H5Apublic.h ) IDE_GENERATED_PROPERTIES ("H5A" "${H5A_HDRS}" "${H5A_SRCS}" ) -SET (H5AC_SRCS +set (H5AC_SRCS ${HDF5_SRC_DIR}/H5AC.c ) -SET (H5AC_HDRS +set (H5AC_HDRS ${HDF5_SRC_DIR}/H5ACpkg.h ${HDF5_SRC_DIR}/H5ACpublic.h ) IDE_GENERATED_PROPERTIES ("H5AC" "${H5AC_HDRS}" "${H5AC_SRCS}" ) -SET (H5B_SRCS +set (H5B_SRCS ${HDF5_SRC_DIR}/H5B.c ${HDF5_SRC_DIR}/H5Bcache.c ${HDF5_SRC_DIR}/H5Bdbg.c ) -SET (H5B_HDRS +set (H5B_HDRS ${HDF5_SRC_DIR}/H5Bpkg.h ${HDF5_SRC_DIR}/H5Bpublic.h ) IDE_GENERATED_PROPERTIES ("H5B" "${H5B_HDRS}" "${H5B_SRCS}" ) -SET (H5B2_SRCS +set (H5B2_SRCS ${HDF5_SRC_DIR}/H5B2.c ${HDF5_SRC_DIR}/H5B2cache.c ${HDF5_SRC_DIR}/H5B2dbg.c @@ -73,32 +73,32 @@ SET (H5B2_SRCS ${HDF5_SRC_DIR}/H5B2stat.c ${HDF5_SRC_DIR}/H5B2test.c ) -SET (H5B2_HDRS +set (H5B2_HDRS ${HDF5_SRC_DIR}/H5B2pkg.h ${HDF5_SRC_DIR}/H5B2public.h ) IDE_GENERATED_PROPERTIES ("H5B2" "${H5B2_HDRS}" "${H5B2_SRCS}" ) -SET (H5C_SRCS +set (H5C_SRCS ${HDF5_SRC_DIR}/H5C.c ) -SET (H5C_HDRS +set (H5C_HDRS ${HDF5_SRC_DIR}/H5Cpkg.h ${HDF5_SRC_DIR}/H5Cpublic.h ) IDE_GENERATED_PROPERTIES ("H5C" "${H5C_HDRS}" "${H5C_SRCS}" ) -SET (H5CS_SRCS +set (H5CS_SRCS ${HDF5_SRC_DIR}/H5CS.c ) -SET (H5CS_HDRS +set (H5CS_HDRS ) IDE_GENERATED_PROPERTIES ("H5CS" "${H5CS_HDRS}" "${H5CS_SRCS}" ) -SET (H5D_SRCS +set (H5D_SRCS ${HDF5_SRC_DIR}/H5D.c ${HDF5_SRC_DIR}/H5Dbtree.c ${HDF5_SRC_DIR}/H5Dchunk.c @@ -118,19 +118,19 @@ SET (H5D_SRCS ${HDF5_SRC_DIR}/H5Dtest.c ) -SET (H5D_HDRS +set (H5D_HDRS ${HDF5_SRC_DIR}/H5Dpkg.h ${HDF5_SRC_DIR}/H5Dpublic.h ) IDE_GENERATED_PROPERTIES ("H5D" "${H5D_HDRS}" "${H5D_SRCS}" ) -SET (H5E_SRCS +set (H5E_SRCS ${HDF5_SRC_DIR}/H5E.c ${HDF5_SRC_DIR}/H5Edeprec.c ${HDF5_SRC_DIR}/H5Eint.c ) -SET (H5E_HDRS +set (H5E_HDRS ${HDF5_SRC_DIR}/H5Edefin.h ${HDF5_SRC_DIR}/H5Einit.h ${HDF5_SRC_DIR}/H5Epkg.h @@ -141,7 +141,7 @@ SET (H5E_HDRS IDE_GENERATED_PROPERTIES ("H5E" "${H5E_HDRS}" "${H5E_SRCS}" ) -SET (H5EA_SRCS +set (H5EA_SRCS ${HDF5_SRC_DIR}/H5EA.c ${HDF5_SRC_DIR}/H5EAcache.c ${HDF5_SRC_DIR}/H5EAdbg.c @@ -154,13 +154,13 @@ SET (H5EA_SRCS ${HDF5_SRC_DIR}/H5EAstat.c ${HDF5_SRC_DIR}/H5EAtest.c ) -SET (H5EA_HDRS +set (H5EA_HDRS ${HDF5_SRC_DIR}/H5EApkg.h ) IDE_GENERATED_PROPERTIES ("H5EA" "${H5EA_HDRS}" "${H5EA_SRCS}" ) -SET (H5F_SRCS +set (H5F_SRCS ${HDF5_SRC_DIR}/H5F.c ${HDF5_SRC_DIR}/H5Faccum.c ${HDF5_SRC_DIR}/H5Fcwfs.c @@ -178,14 +178,14 @@ SET (H5F_SRCS ${HDF5_SRC_DIR}/H5Ftest.c ) -SET (H5F_HDRS +set (H5F_HDRS ${HDF5_SRC_DIR}/H5Fpkg.h ${HDF5_SRC_DIR}/H5Fpublic.h ) IDE_GENERATED_PROPERTIES ("H5F" "${H5F_HDRS}" "${H5F_SRCS}" ) -SET (H5FA_SRCS +set (H5FA_SRCS ${HDF5_SRC_DIR}/H5FA.c ${HDF5_SRC_DIR}/H5FAcache.c ${HDF5_SRC_DIR}/H5FAdbg.c @@ -195,13 +195,13 @@ SET (H5FA_SRCS ${HDF5_SRC_DIR}/H5FAstat.c ${HDF5_SRC_DIR}/H5FAtest.c ) -SET (H5FA_HDRS +set (H5FA_HDRS ${HDF5_SRC_DIR}/H5FApkg.h ) IDE_GENERATED_PROPERTIES ("H5FA" "${H5FA_HDRS}" "${H5FA_SRCS}" ) -SET (H5FD_SRCS +set (H5FD_SRCS ${HDF5_SRC_DIR}/H5FD.c ${HDF5_SRC_DIR}/H5FDcore.c ${HDF5_SRC_DIR}/H5FDdirect.c @@ -218,7 +218,7 @@ SET (H5FD_SRCS ${HDF5_SRC_DIR}/H5FDwindows.c ) -SET (H5FD_HDRS +set (H5FD_HDRS ${HDF5_SRC_DIR}/H5FDcore.h ${HDF5_SRC_DIR}/H5FDdirect.h ${HDF5_SRC_DIR}/H5FDfamily.h @@ -236,23 +236,23 @@ SET (H5FD_HDRS IDE_GENERATED_PROPERTIES ("H5FD" "${H5FD_HDRS}" "${H5FD_SRCS}" ) -SET (H5FL_SRCS +set (H5FL_SRCS ${HDF5_SRC_DIR}/H5FL.c ) -SET (H5FL_HDRS +set (H5FL_HDRS ) IDE_GENERATED_PROPERTIES ("H5FL" "${H5FL_HDRS}" "${H5FL_SRCS}" ) -SET (H5FO_SRCS +set (H5FO_SRCS ${HDF5_SRC_DIR}/H5FO.c ) -SET (H5FO_HDRS +set (H5FO_HDRS ) IDE_GENERATED_PROPERTIES ("H5FO" "${H5FO_HDRS}" "${H5FO_SRCS}" ) -SET (H5FS_SRCS +set (H5FS_SRCS ${HDF5_SRC_DIR}/H5FS.c ${HDF5_SRC_DIR}/H5FScache.c ${HDF5_SRC_DIR}/H5FSdbg.c @@ -261,13 +261,13 @@ SET (H5FS_SRCS ${HDF5_SRC_DIR}/H5FStest.c ) -SET (H5FS_HDRS +set (H5FS_HDRS ${HDF5_SRC_DIR}/H5FSpkg.h ${HDF5_SRC_DIR}/H5FSpublic.h ) IDE_GENERATED_PROPERTIES ("H5FS" "${H5FS_HDRS}" "${H5FS_SRCS}" ) -SET (H5G_SRCS +set (H5G_SRCS ${HDF5_SRC_DIR}/H5G.c ${HDF5_SRC_DIR}/H5Gbtree2.c ${HDF5_SRC_DIR}/H5Gcache.c @@ -288,13 +288,13 @@ SET (H5G_SRCS ${HDF5_SRC_DIR}/H5Gtraverse.c ) -SET (H5G_HDRS +set (H5G_HDRS ${HDF5_SRC_DIR}/H5Gpkg.h ${HDF5_SRC_DIR}/H5Gpublic.h ) IDE_GENERATED_PROPERTIES ("H5G" "${H5G_HDRS}" "${H5G_SRCS}" ) -SET (H5HF_SRCS +set (H5HF_SRCS ${HDF5_SRC_DIR}/H5HF.c ${HDF5_SRC_DIR}/H5HFbtree2.c ${HDF5_SRC_DIR}/H5HFcache.c @@ -313,101 +313,101 @@ SET (H5HF_SRCS ${HDF5_SRC_DIR}/H5HFtiny.c ) -SET (H5HF_HDRS +set (H5HF_HDRS ${HDF5_SRC_DIR}/H5HFpkg.h ${HDF5_SRC_DIR}/H5HFpublic.h ) IDE_GENERATED_PROPERTIES ("H5HF" "${H5HF_HDRS}" "${H5HF_SRCS}" ) -SET (H5HG_SRCS +set (H5HG_SRCS ${HDF5_SRC_DIR}/H5HG.c ${HDF5_SRC_DIR}/H5HGcache.c ${HDF5_SRC_DIR}/H5HGdbg.c ${HDF5_SRC_DIR}/H5HGquery.c ) -SET (H5HG_HDRS +set (H5HG_HDRS ${HDF5_SRC_DIR}/H5HGpkg.h ${HDF5_SRC_DIR}/H5HGpublic.h ) IDE_GENERATED_PROPERTIES ("H5HG" "${H5HG_HDRS}" "${H5HG_SRCS}" ) -SET (H5HL_SRCS +set (H5HL_SRCS ${HDF5_SRC_DIR}/H5HL.c ${HDF5_SRC_DIR}/H5HLcache.c ${HDF5_SRC_DIR}/H5HLdbg.c ${HDF5_SRC_DIR}/H5HLint.c ) -SET (H5HL_HDRS +set (H5HL_HDRS ${HDF5_SRC_DIR}/H5HLpkg.h ${HDF5_SRC_DIR}/H5HLpublic.h ) IDE_GENERATED_PROPERTIES ("H5HL" "${H5HL_HDRS}" "${H5HL_SRCS}" ) -SET (H5HP_SRCS +set (H5HP_SRCS ${HDF5_SRC_DIR}/H5HP.c ) -SET (H5HP_HDRS +set (H5HP_HDRS ) IDE_GENERATED_PROPERTIES ("H5HP" "${H5HP_HDRS}" "${H5HP_SRCS}" ) -SET (H5I_SRCS +set (H5I_SRCS ${HDF5_SRC_DIR}/H5I.c ${HDF5_SRC_DIR}/H5Itest.c ) -SET (H5I_HDRS +set (H5I_HDRS ${HDF5_SRC_DIR}/H5Ipkg.h ${HDF5_SRC_DIR}/H5Ipublic.h ) IDE_GENERATED_PROPERTIES ("H5I" "${H5I_HDRS}" "${H5I_SRCS}" ) -SET (H5L_SRCS +set (H5L_SRCS ${HDF5_SRC_DIR}/H5L.c ${HDF5_SRC_DIR}/H5Lexternal.c ) -SET (H5L_HDRS +set (H5L_HDRS ${HDF5_SRC_DIR}/H5Lpkg.h ${HDF5_SRC_DIR}/H5Lpublic.h ) IDE_GENERATED_PROPERTIES ("H5L" "${H5L_HDRS}" "${H5L_SRCS}" ) -SET (H5MF_SRCS +set (H5MF_SRCS ${HDF5_SRC_DIR}/H5MF.c ${HDF5_SRC_DIR}/H5MFaggr.c ${HDF5_SRC_DIR}/H5MFdbg.c ${HDF5_SRC_DIR}/H5MFsection.c ) -SET (H5MF_HDRS +set (H5MF_HDRS ) IDE_GENERATED_PROPERTIES ("H5MF" "${H5MF_HDRS}" "${H5MF_SRCS}" ) -SET (H5MM_SRCS +set (H5MM_SRCS ${HDF5_SRC_DIR}/H5MM.c ) -SET (H5MM_HDRS +set (H5MM_HDRS ${HDF5_SRC_DIR}/H5MMpublic.h ) IDE_GENERATED_PROPERTIES ("H5MM" "${H5MM_HDRS}" "${H5MM_SRCS}" ) -SET (H5MP_SRCS +set (H5MP_SRCS ${HDF5_SRC_DIR}/H5MP.c ${HDF5_SRC_DIR}/H5MPtest.c ) -SET (H5MP_HDRS +set (H5MP_HDRS ${HDF5_SRC_DIR}/H5MPpkg.h ) IDE_GENERATED_PROPERTIES ("H5MP" "${H5MP_HDRS}" "${H5MP_SRCS}" ) -SET (H5O_SRCS +set (H5O_SRCS ${HDF5_SRC_DIR}/H5O.c ${HDF5_SRC_DIR}/H5Oainfo.c ${HDF5_SRC_DIR}/H5Oalloc.c @@ -443,14 +443,14 @@ SET (H5O_SRCS ${HDF5_SRC_DIR}/H5Ounknown.c ) -SET (H5O_HDRS +set (H5O_HDRS ${HDF5_SRC_DIR}/H5Opkg.h ${HDF5_SRC_DIR}/H5Opublic.h ${HDF5_SRC_DIR}/H5Oshared.h ) IDE_GENERATED_PROPERTIES ("H5O" "${H5O_HDRS}" "${H5O_SRCS}" ) -SET (H5P_SRCS +set (H5P_SRCS ${HDF5_SRC_DIR}/H5P.c ${HDF5_SRC_DIR}/H5Pacpl.c ${HDF5_SRC_DIR}/H5Pdapl.c @@ -471,50 +471,50 @@ SET (H5P_SRCS ${HDF5_SRC_DIR}/H5Ptest.c ) -SET (H5P_HDRS +set (H5P_HDRS ${HDF5_SRC_DIR}/H5Ppkg.h ${HDF5_SRC_DIR}/H5Ppublic.h ) IDE_GENERATED_PROPERTIES ("H5P" "${H5P_HDRS}" "${H5P_SRCS}" ) -SET (H5PL_SRCS +set (H5PL_SRCS ${HDF5_SRC_DIR}/H5PL.c ) -SET (H5PL_HDRS +set (H5PL_HDRS ${HDF5_SRC_DIR}/H5PLextern.h ) IDE_GENERATED_PROPERTIES ("H5PL" "${H5PL_HDRS}" "${H5PL_SRCS}" ) -SET (H5R_SRCS +set (H5R_SRCS ${HDF5_SRC_DIR}/H5R.c ${HDF5_SRC_DIR}/H5Rdeprec.c ) -SET (H5R_HDRS +set (H5R_HDRS ${HDF5_SRC_DIR}/H5Rpkg.h ${HDF5_SRC_DIR}/H5Rpublic.h ) IDE_GENERATED_PROPERTIES ("H5R" "${H5R_HDRS}" "${H5R_SRCS}" ) -SET (H5UC_SRCS +set (H5UC_SRCS ${HDF5_SRC_DIR}/H5UC.c ) -SET (H5UC_HDRS +set (H5UC_HDRS ) IDE_GENERATED_PROPERTIES ("H5UC" "${H5UC_HDRS}" "${H5UC_SRCS}" ) -SET (H5RS_SRCS +set (H5RS_SRCS ${HDF5_SRC_DIR}/H5RS.c ) -SET (H5RS_HDRS +set (H5RS_HDRS ) IDE_GENERATED_PROPERTIES ("H5RS" "${H5RS_HDRS}" "${H5RS_SRCS}" ) -SET (H5S_SRCS +set (H5S_SRCS ${HDF5_SRC_DIR}/H5S.c ${HDF5_SRC_DIR}/H5Sall.c ${HDF5_SRC_DIR}/H5Sdbg.c @@ -526,22 +526,22 @@ SET (H5S_SRCS ${HDF5_SRC_DIR}/H5Stest.c ) -SET (H5S_HDRS +set (H5S_HDRS ${HDF5_SRC_DIR}/H5Spkg.h ${HDF5_SRC_DIR}/H5Spublic.h ) IDE_GENERATED_PROPERTIES ("H5S" "${H5S_HDRS}" "${H5S_SRCS}" ) -SET (H5SL_SRCS +set (H5SL_SRCS ${HDF5_SRC_DIR}/H5SL.c ) -SET (H5SL_HDRS +set (H5SL_HDRS ) IDE_GENERATED_PROPERTIES ("H5SL" "${H5SL_HDRS}" "${H5SL_SRCS}" ) -SET (H5SM_SRCS +set (H5SM_SRCS ${HDF5_SRC_DIR}/H5SM.c ${HDF5_SRC_DIR}/H5SMbtree2.c ${HDF5_SRC_DIR}/H5SMcache.c @@ -549,21 +549,21 @@ SET (H5SM_SRCS ${HDF5_SRC_DIR}/H5SMtest.c ) -SET (H5SM_HDRS +set (H5SM_HDRS ${HDF5_SRC_DIR}/H5SMpkg.h ) IDE_GENERATED_PROPERTIES ("H5SM" "${H5SM_HDRS}" "${H5SM_SRCS}" ) -SET (H5ST_SRCS +set (H5ST_SRCS ${HDF5_SRC_DIR}/H5ST.c ) -SET (H5ST_HDRS +set (H5ST_HDRS ) IDE_GENERATED_PROPERTIES ("H5ST" "${H5ST_HDRS}" "${H5ST_SRCS}" ) -SET (H5T_SRCS +set (H5T_SRCS ${HDF5_SRC_DIR}/H5T.c ${HDF5_SRC_DIR}/H5Tarray.c ${HDF5_SRC_DIR}/H5Tbit.c @@ -589,38 +589,38 @@ SET (H5T_SRCS ${HDF5_SRC_DIR}/H5Tvlen.c ) -SET (H5T_HDRS +set (H5T_HDRS ${HDF5_SRC_DIR}/H5Tpkg.h ${HDF5_SRC_DIR}/H5Tpublic.h ) IDE_GENERATED_PROPERTIES ("H5T" "${H5T_HDRS}" "${H5T_SRCS}" ) -SET (H5TS_SRCS +set (H5TS_SRCS ${HDF5_SRC_DIR}/H5TS.c ) -SET (H5TS_HDRS +set (H5TS_HDRS ) IDE_GENERATED_PROPERTIES ("H5TS" "${H5TS_HDRS}" "${H5TS_SRCS}" ) -SET (H5VM_SRCS +set (H5VM_SRCS ${HDF5_SRC_DIR}/H5VM.c ) -SET (H5VM_HDRS +set (H5VM_HDRS ) IDE_GENERATED_PROPERTIES ("H5VM" "${H5VM_HDRS}" "${H5VM_SRCS}" ) -SET (H5WB_SRCS +set (H5WB_SRCS ${HDF5_SRC_DIR}/H5WB.c ) -SET (H5WB_HDRS +set (H5WB_HDRS ) IDE_GENERATED_PROPERTIES ("H5WB" "${H5WB_HDRS}" "${H5WB_SRCS}" ) -SET (H5Z_SRCS +set (H5Z_SRCS ${HDF5_SRC_DIR}/H5Z.c ${HDF5_SRC_DIR}/H5Zdeflate.c ${HDF5_SRC_DIR}/H5Zfletcher32.c @@ -630,19 +630,19 @@ SET (H5Z_SRCS ${HDF5_SRC_DIR}/H5Zszip.c ${HDF5_SRC_DIR}/H5Ztrans.c ) -IF (H5_ZLIB_HEADER) +if (H5_ZLIB_HEADER) SET_PROPERTY(SOURCE ${HDF5_SRC_DIR}/H5Zdeflate.c PROPERTY COMPILE_DEFINITIONS H5_ZLIB_HEADER="${H5_ZLIB_HEADER}") -ENDIF (H5_ZLIB_HEADER) +endif (H5_ZLIB_HEADER) -SET (H5Z_HDRS +set (H5Z_HDRS ${HDF5_SRC_DIR}/H5Zpkg.h ${HDF5_SRC_DIR}/H5Zpublic.h ) IDE_GENERATED_PROPERTIES ("H5Z" "${H5Z_HDRS}" "${H5Z_SRCS}" ) -SET (common_SRCS +set (common_SRCS ${H5_SRCS} ${H5A_SRCS} ${H5AC_SRCS} @@ -686,7 +686,7 @@ SET (common_SRCS ${H5Z_SRCS} ) -SET (H5_PUBLIC_HEADERS +set (H5_PUBLIC_HEADERS ${H5_HDRS} ${H5A_HDRS} ${H5AC_HDRS} @@ -720,7 +720,7 @@ SET (H5_PUBLIC_HEADERS ) -SET (H5_PRIVATE_HEADERS +set (H5_PRIVATE_HEADERS ${HDF5_SRC_DIR}/H5private.h ${HDF5_SRC_DIR}/H5Aprivate.h ${HDF5_SRC_DIR}/H5ACprivate.h @@ -766,35 +766,32 @@ SET (H5_PRIVATE_HEADERS ${HDF5_SRC_DIR}/H5win32defs.h ) -INCLUDE_DIRECTORIES (${HDF5_SOURCE_DIR}) -INCLUDE_DIRECTORIES (${CMAKE_BINARY_DIR}) - #----------------------------------------------------------------------------- # Setup the H5Detect utility which generates H5Tinit with platform # specific type checks inside #----------------------------------------------------------------------------- -ADD_EXECUTABLE (H5detect ${HDF5_SRC_DIR}/H5detect.c) +add_executable (H5detect ${HDF5_SRC_DIR}/H5detect.c) TARGET_C_PROPERTIES (H5detect " " " ") -IF (MSVC) - TARGET_LINK_LIBRARIES (H5detect "ws2_32.lib") -ENDIF (MSVC) +if (MSVC) + target_link_libraries (H5detect "ws2_32.lib") +endif (MSVC) -SET (CMD $) -ADD_CUSTOM_COMMAND ( +set (CMD $) +add_custom_command ( OUTPUT ${HDF5_BINARY_DIR}/H5Tinit.c COMMAND ${CMD} ARGS > ${HDF5_BINARY_DIR}/H5Tinit.c DEPENDS H5detect ) -ADD_EXECUTABLE (H5make_libsettings ${HDF5_SRC_DIR}/H5make_libsettings.c) +add_executable (H5make_libsettings ${HDF5_SRC_DIR}/H5make_libsettings.c) TARGET_C_PROPERTIES (H5make_libsettings " " " ") -IF (MSVC) - TARGET_LINK_LIBRARIES (H5make_libsettings "ws2_32.lib") -ENDIF (MSVC) +if (MSVC) + target_link_libraries (H5make_libsettings "ws2_32.lib") +endif (MSVC) -SET (CMD $) -ADD_CUSTOM_COMMAND ( +set (CMD $) +add_custom_command ( OUTPUT ${HDF5_BINARY_DIR}/H5lib_settings.c COMMAND ${CMD} ARGS > ${HDF5_BINARY_DIR}/H5lib_settings.c @@ -802,21 +799,21 @@ ADD_CUSTOM_COMMAND ( WORKING_DIRECTORY ${HDF5_BINARY_DIR} ) -ADD_CUSTOM_COMMAND ( +add_custom_command ( TARGET ${HDF5_BINARY_DIR}/H5Edefin.h PRE_BUILD COMMAND ${CMAKE_COMMAND} -E perl ${HDF5_SOURCE_DIR}/bin/make_err ${HDF5_SOURCE_DIR}/src/H5err.txt COMMENT " Creating err headers" ) -ADD_CUSTOM_COMMAND ( +add_custom_command ( TARGET ${HDF5_BINARY_DIR}/H5version.h PRE_BUILD COMMAND ${CMAKE_COMMAND} -E perl ${HDF5_SOURCE_DIR}/bin/make_vers ${HDF5_SOURCE_DIR}/src/H5vers.txt COMMENT " Creating API version macro" ) -ADD_CUSTOM_COMMAND ( +add_custom_command ( TARGET ${HDF5_BINARY_DIR}/H5overflow.h PRE_BUILD COMMAND ${CMAKE_COMMAND} -E perl ${HDF5_SOURCE_DIR}/bin/make_overflow ${HDF5_SOURCE_DIR}/src/H5overflow.txt @@ -826,51 +823,64 @@ ADD_CUSTOM_COMMAND ( #----------------------------------------------------------------------------- # Add H5Tinit source to build - generated by H5Detect/CMake at configure time #----------------------------------------------------------------------------- -SET (common_SRCS ${common_SRCS} ${HDF5_BINARY_DIR}/H5Tinit.c) -SET_SOURCE_FILES_PROPERTIES (${HDF5_BINARY_DIR}/H5Tinit.c GENERATED) -SET (common_SRCS ${common_SRCS} ${HDF5_BINARY_DIR}/H5lib_settings.c) -SET_SOURCE_FILES_PROPERTIES (${HDF5_BINARY_DIR}/H5lib_settings.c GENERATED) -SET (common_SRCS ${common_SRCS} ${HDF5_BINARY_DIR}/H5Edefin.h) -SET_SOURCE_FILES_PROPERTIES (${HDF5_BINARY_DIR}/H5Edefin.h GENERATED) -SET (common_SRCS ${common_SRCS} ${HDF5_BINARY_DIR}/H5version.h) -SET_SOURCE_FILES_PROPERTIES (${HDF5_BINARY_DIR}/H5version.h GENERATED) -SET (common_SRCS ${common_SRCS} ${HDF5_BINARY_DIR}/H5overflow.h) -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}) +set (common_SRCS ${common_SRCS} ${HDF5_BINARY_DIR}/H5Tinit.c) +set_source_files_properties (${HDF5_BINARY_DIR}/H5Tinit.c GENERATED) +set (common_SRCS ${common_SRCS} ${HDF5_BINARY_DIR}/H5lib_settings.c) +set_source_files_properties (${HDF5_BINARY_DIR}/H5lib_settings.c GENERATED) +set (common_SRCS ${common_SRCS} ${HDF5_BINARY_DIR}/H5Edefin.h) +set_source_files_properties (${HDF5_BINARY_DIR}/H5Edefin.h GENERATED) +set (common_SRCS ${common_SRCS} ${HDF5_BINARY_DIR}/H5version.h) +set_source_files_properties (${HDF5_BINARY_DIR}/H5version.h GENERATED) +set (common_SRCS ${common_SRCS} ${HDF5_BINARY_DIR}/H5overflow.h) +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_C_PROPERTIES (${HDF5_LIB_TARGET} " " " ") -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}) +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) +set_target_properties (${HDF5_LIB_TARGET} PROPERTIES + FOLDER libraries + INTERFACE_INCLUDE_DIRECTORIES "$/include>" +) + +option (HDF5_ENABLE_DEBUG_APIS "Turn on debugging in all packages" OFF) +if (HDF5_ENABLE_DEBUG_APIS) + set_target_properties (${HDF5_LIB_TARGET} PROPERTIES + COMPILE_DEFINITIONS + "-DH5Z_DEBUG -DH5VM_DEBUG -DH5T_DEBUG + -DH5S_DEBUG -DH5P_DEBUG -DH5O_DEBUG -DH5MM_DEBUG -DH5MF_DEBUG + -DH5I_DEBUG -DH5HL_DEBUG -DH5HG_DEBUG -DH5G_DEBUG -DH5F_DEBUG + -DH5E_DEBUG -DH5D_DEBUG -DH5B_DEBUG -DH5AC_DEBUG -UNDEBUG" + ) +endif (HDF5_ENABLE_DEBUG_APIS) #----------------------------------------------------------------------------- # Add file(s) to CMake Install #----------------------------------------------------------------------------- -IF (NOT HDF5_INSTALL_NO_DEVELOPMENT) - INSTALL ( +if (NOT HDF5_INSTALL_NO_DEVELOPMENT) + install ( FILES ${H5_PUBLIC_HEADERS} - ${H5_PRIVATE_HEADERS} DESTINATION ${HDF5_INSTALL_INCLUDE_DIR} COMPONENT headers ) -ENDIF (NOT HDF5_INSTALL_NO_DEVELOPMENT) +endif (NOT HDF5_INSTALL_NO_DEVELOPMENT) #----------------------------------------------------------------------------- # Add Target(s) to CMake Install for import into other projects #----------------------------------------------------------------------------- -IF (HDF5_EXPORTED_TARGETS) - IF (BUILD_SHARED_LIBS) +if (HDF5_EXPORTED_TARGETS) + if (BUILD_SHARED_LIBS) INSTALL_TARGET_PDB (${HDF5_LIB_TARGET} ${HDF5_INSTALL_LIB_DIR} libraries) - ENDIF (BUILD_SHARED_LIBS) + endif (BUILD_SHARED_LIBS) - INSTALL ( + install ( TARGETS ${HDF5_LIB_TARGET} EXPORT @@ -879,4 +889,4 @@ IF (HDF5_EXPORTED_TARGETS) ARCHIVE DESTINATION ${HDF5_INSTALL_LIB_DIR} COMPONENT libraries RUNTIME DESTINATION ${HDF5_INSTALL_BIN_DIR} COMPONENT libraries ) -ENDIF (HDF5_EXPORTED_TARGETS) +endif (HDF5_EXPORTED_TARGETS) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 254797d..ff975f0 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -4,44 +4,44 @@ PROJECT (HDF5_TEST) #----------------------------------------------------------------------------- # Apply Definitions to compiler in this directory and below #----------------------------------------------------------------------------- -ADD_DEFINITIONS (${HDF5_EXTRA_C_FLAGS}) +add_definitions (${HDF5_EXTRA_C_FLAGS}) #----------------------------------------------------------------------------- # Generate the H5srcdir_str.h file containing user settings needed by compilation #----------------------------------------------------------------------------- -SET (srcdir ${CMAKE_CURRENT_SOURCE_DIR}) +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 Test Library Sources #----------------------------------------------------------------------------- -SET (TEST_LIB_SRCS +set (TEST_LIB_SRCS ${HDF5_TEST_SOURCE_DIR}/h5test.c ${HDF5_TEST_SOURCE_DIR}/testframe.c ${HDF5_TEST_SOURCE_DIR}/cache_common.c ) -SET (TEST_LIB_HEADERS +set (TEST_LIB_HEADERS ${HDF5_TEST_SOURCE_DIR}/h5test.h ) -ADD_LIBRARY (${HDF5_TEST_LIB_TARGET} ${LIB_TYPE} ${TEST_LIB_SRCS} ${TEST_LIB_HEADERS}) +add_library (${HDF5_TEST_LIB_TARGET} ${LIB_TYPE} ${TEST_LIB_SRCS} ${TEST_LIB_HEADERS}) TARGET_C_PROPERTIES (${HDF5_TEST_LIB_TARGET} " " " ") -IF (MSVC) - TARGET_LINK_LIBRARIES (${HDF5_TEST_LIB_TARGET} "ws2_32.lib") -ENDIF (MSVC) -IF (MINGW) - TARGET_LINK_LIBRARIES (${HDF5_TEST_LIB_TARGET} "wsock32.lib") -ENDIF (MINGW) -TARGET_LINK_LIBRARIES (${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET}) +if (MSVC) + target_link_libraries (${HDF5_TEST_LIB_TARGET} "ws2_32.lib") +endif (MSVC) +if (MINGW) + target_link_libraries (${HDF5_TEST_LIB_TARGET} "wsock32.lib") +endif (MINGW) +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) +set_target_properties (${HDF5_TEST_LIB_TARGET} PROPERTIES FOLDER libraries/test) #----------------------------------------------------------------------------- # If plugin library tests can be tested #----------------------------------------------------------------------------- -IF (BUILD_SHARED_LIBS) +if (BUILD_SHARED_LIBS) # make plugins dir FILE (MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/testdir1") FILE (MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/testdir2") @@ -49,36 +49,36 @@ IF (BUILD_SHARED_LIBS) #----------------------------------------------------------------------------- # Define Test Library Sources #----------------------------------------------------------------------------- - SET (TEST_PLUGIN_LIBS + set (TEST_PLUGIN_LIBS dynlib1 dynlib3 ) - SET (TEST2_PLUGIN_LIBS + set (TEST2_PLUGIN_LIBS dynlib2 ) - 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}) + 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) + add_library (${HDF5_TEST_PLUGIN_LIB_TARGET} ${LIB_TYPE} ${HDF5_TEST_SOURCE_DIR}/${test_lib}.c) TARGET_C_PROPERTIES (${HDF5_TEST_PLUGIN_LIB_TARGET} " " " ") - TARGET_LINK_LIBRARIES (${HDF5_TEST_PLUGIN_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) + 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) + set_target_properties (${HDF5_TEST_PLUGIN_LIB_TARGET} PROPERTIES FOLDER libraries/TEST_PLUGIN) #----------------------------------------------------------------------------- # Copy plugin library to a plugins folder #----------------------------------------------------------------------------- - ADD_CUSTOM_COMMAND ( + add_custom_command ( TARGET ${HDF5_TEST_PLUGIN_LIB_TARGET} POST_BUILD COMMAND ${CMAKE_COMMAND} @@ -86,30 +86,30 @@ IF (BUILD_SHARED_LIBS) "$" "${CMAKE_BINARY_DIR}/testdir1/$" ) - ENDFOREACH (test_lib ${TEST_PLUGIN_LIBS}) + 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}) + 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) + add_library (${HDF5_TEST_PLUGIN_LIB_TARGET} ${LIB_TYPE} ${HDF5_TEST_SOURCE_DIR}/${test_lib}.c) TARGET_C_PROPERTIES (${HDF5_TEST_PLUGIN_LIB_TARGET} " " " ") - TARGET_LINK_LIBRARIES (${HDF5_TEST_PLUGIN_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) + 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) + set_target_properties (${HDF5_TEST_PLUGIN_LIB_TARGET} PROPERTIES FOLDER libraries/TEST_PLUGIN) #----------------------------------------------------------------------------- # Copy plugin library to a plugins folder #----------------------------------------------------------------------------- - ADD_CUSTOM_COMMAND ( + add_custom_command ( TARGET ${HDF5_TEST_PLUGIN_LIB_TARGET} POST_BUILD COMMAND ${CMAKE_COMMAND} @@ -117,10 +117,10 @@ IF (BUILD_SHARED_LIBS) "$" "${CMAKE_BINARY_DIR}/testdir2/$" ) - ENDFOREACH (test_lib ${TEST2_PLUGIN_LIBS}) -ENDIF (BUILD_SHARED_LIBS) + endforeach (test_lib ${TEST2_PLUGIN_LIBS}) +endif (BUILD_SHARED_LIBS) -SET (testhdf5_SRCS +set (testhdf5_SRCS ${HDF5_TEST_SOURCE_DIR}/testhdf5.c ${HDF5_TEST_SOURCE_DIR}/tarray.c ${HDF5_TEST_SOURCE_DIR}/tattr.c @@ -149,21 +149,21 @@ SET (testhdf5_SRCS ) #-- Adding test for testhdf5 -ADD_EXECUTABLE (testhdf5 ${testhdf5_SRCS}) +add_executable (testhdf5 ${testhdf5_SRCS}) TARGET_NAMING (testhdf5 ${LIB_TYPE}) TARGET_C_PROPERTIES (testhdf5 " " " ") -TARGET_LINK_LIBRARIES (testhdf5 ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET}) -SET_TARGET_PROPERTIES (testhdf5 PROPERTIES FOLDER test) +target_link_libraries (testhdf5 ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET}) +set_target_properties (testhdf5 PROPERTIES FOLDER test) MACRO (ADD_H5_EXE file) - ADD_EXECUTABLE (${file} ${HDF5_TEST_SOURCE_DIR}/${file}.c) + add_executable (${file} ${HDF5_TEST_SOURCE_DIR}/${file}.c) TARGET_NAMING (${file} ${LIB_TYPE}) TARGET_C_PROPERTIES (${file} " " " ") - TARGET_LINK_LIBRARIES (${file} ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET}) - SET_TARGET_PROPERTIES (${file} PROPERTIES FOLDER test) + target_link_libraries (${file} ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET}) + set_target_properties (${file} PROPERTIES FOLDER test) ENDMACRO (ADD_H5_EXE file) -SET (H5_TESTS +set (H5_TESTS accum lheap ohdr @@ -221,9 +221,9 @@ SET (H5_TESTS unregister ) -FOREACH (test ${H5_TESTS}) +foreach (test ${H5_TESTS}) ADD_H5_EXE(${test}) -ENDFOREACH (test ${H5_TESTS}) +endforeach (test ${H5_TESTS}) ############################################################################## ############################################################################## @@ -232,28 +232,28 @@ ENDFOREACH (test ${H5_TESTS}) ############################################################################## #-- Adding test for cache -ADD_EXECUTABLE (cache ${HDF5_TEST_SOURCE_DIR}/cache.c ${HDF5_TEST_SOURCE_DIR}/cache_common.c) +add_executable (cache ${HDF5_TEST_SOURCE_DIR}/cache.c ${HDF5_TEST_SOURCE_DIR}/cache_common.c) TARGET_NAMING (cache ${LIB_TYPE}) TARGET_C_PROPERTIES (cache " " " ") -TARGET_LINK_LIBRARIES (cache ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) -SET_TARGET_PROPERTIES (cache PROPERTIES FOLDER test) +target_link_libraries (cache ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) +set_target_properties (cache PROPERTIES FOLDER test) #-- Adding test for cache_api -ADD_EXECUTABLE (cache_api ${HDF5_TEST_SOURCE_DIR}/cache_api.c ${HDF5_TEST_SOURCE_DIR}/cache_common.c) +add_executable (cache_api ${HDF5_TEST_SOURCE_DIR}/cache_api.c ${HDF5_TEST_SOURCE_DIR}/cache_common.c) TARGET_NAMING (cache_api ${LIB_TYPE}) TARGET_C_PROPERTIES (cache_api " " " ") -TARGET_LINK_LIBRARIES (cache_api ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) -SET_TARGET_PROPERTIES (cache_api PROPERTIES FOLDER test) +target_link_libraries (cache_api ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) +set_target_properties (cache_api PROPERTIES FOLDER test) #-- Adding test for cache_tagging -ADD_EXECUTABLE (cache_tagging ${HDF5_TEST_SOURCE_DIR}/cache_tagging.c ${HDF5_TEST_SOURCE_DIR}/cache_common.c) +add_executable (cache_tagging ${HDF5_TEST_SOURCE_DIR}/cache_tagging.c ${HDF5_TEST_SOURCE_DIR}/cache_common.c) TARGET_NAMING (cache_tagging ${LIB_TYPE}) TARGET_C_PROPERTIES (cache_tagging " " " ") -TARGET_LINK_LIBRARIES (cache_tagging ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) -SET_TARGET_PROPERTIES (cache_tagging PROPERTIES FOLDER test) +target_link_libraries (cache_tagging ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) +set_target_properties (cache_tagging PROPERTIES FOLDER test) #-- Adding test for ttsafe -ADD_EXECUTABLE (ttsafe +add_executable (ttsafe ${HDF5_TEST_SOURCE_DIR}/ttsafe.c ${HDF5_TEST_SOURCE_DIR}/ttsafe_dcreate.c ${HDF5_TEST_SOURCE_DIR}/ttsafe_error.c @@ -262,53 +262,53 @@ ADD_EXECUTABLE (ttsafe ) TARGET_NAMING (ttsafe ${LIB_TYPE}) TARGET_C_PROPERTIES (ttsafe " " " ") -TARGET_LINK_LIBRARIES (ttsafe ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) -SET_TARGET_PROPERTIES (ttsafe PROPERTIES FOLDER test) +target_link_libraries (ttsafe ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) +set_target_properties (ttsafe PROPERTIES FOLDER test) #-- Adding test for err_compat -IF (HDF5_ENABLE_DEPRECATED_SYMBOLS) - ADD_EXECUTABLE (err_compat ${HDF5_TEST_SOURCE_DIR}/err_compat.c) +if (HDF5_ENABLE_DEPRECATED_SYMBOLS) + add_executable (err_compat ${HDF5_TEST_SOURCE_DIR}/err_compat.c) TARGET_NAMING (err_compat ${LIB_TYPE}) TARGET_C_PROPERTIES (err_compat " " " ") - TARGET_LINK_LIBRARIES (err_compat ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) - SET_TARGET_PROPERTIES (err_compat PROPERTIES FOLDER test) -ENDIF (HDF5_ENABLE_DEPRECATED_SYMBOLS) + target_link_libraries (err_compat ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) + set_target_properties (err_compat PROPERTIES FOLDER test) +endif (HDF5_ENABLE_DEPRECATED_SYMBOLS) #-- Adding test for error_test -ADD_EXECUTABLE (error_test ${HDF5_TEST_SOURCE_DIR}/error_test.c) +add_executable (error_test ${HDF5_TEST_SOURCE_DIR}/error_test.c) TARGET_NAMING (error_test ${LIB_TYPE}) TARGET_C_PROPERTIES (error_test " " " ") -TARGET_LINK_LIBRARIES (error_test ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) -SET_TARGET_PROPERTIES (error_test PROPERTIES FOLDER test) +target_link_libraries (error_test ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) +set_target_properties (error_test PROPERTIES FOLDER test) #-- Adding test for links_env -ADD_EXECUTABLE (links_env ${HDF5_TEST_SOURCE_DIR}/links_env.c) +add_executable (links_env ${HDF5_TEST_SOURCE_DIR}/links_env.c) TARGET_NAMING (links_env ${LIB_TYPE}) TARGET_C_PROPERTIES (links_env " " " ") -TARGET_LINK_LIBRARIES (links_env ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) -SET_TARGET_PROPERTIES (links_env PROPERTIES FOLDER test) +target_link_libraries (links_env ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) +set_target_properties (links_env PROPERTIES FOLDER test) #-- Adding test for libinfo -SET (GREP_RUNNER ${PROJECT_BINARY_DIR}/GrepRunner.cmake) +set (GREP_RUNNER ${PROJECT_BINARY_DIR}/GrepRunner.cmake) FILE (WRITE ${GREP_RUNNER} "FILE (STRINGS \${TEST_PROGRAM} TEST_RESULT REGEX \"SUMMARY OF THE HDF5 CONFIGURATION\") -IF (\${TEST_RESULT} STREQUAL \"0\") - MESSAGE (FATAL_ERROR \"Failed: The output: \${TEST_RESULT} of \${TEST_PROGRAM} did not contain SUMMARY OF THE HDF5 CONFIGURATION\") -ELSE (\${TEST_RESULT} STREQUAL \"0\") - MESSAGE (STATUS \"COMMAND Result: \${TEST_RESULT}\") -ENDIF (\${TEST_RESULT} STREQUAL \"0\") +if (\${TEST_RESULT} STREQUAL \"0\") + message (FATAL_ERROR \"Failed: The output: \${TEST_RESULT} of \${TEST_PROGRAM} did not contain SUMMARY OF THE HDF5 CONFIGURATION\") +else (\${TEST_RESULT} STREQUAL \"0\") + message (STATUS \"COMMAND Result: \${TEST_RESULT}\") +endif (\${TEST_RESULT} STREQUAL \"0\") " ) ############################################################################## ### P L U G I N T E S T S ############################################################################## -IF (BUILD_SHARED_LIBS) - ADD_EXECUTABLE (plugin ${HDF5_TEST_SOURCE_DIR}/plugin.c) +if (BUILD_SHARED_LIBS) + add_executable (plugin ${HDF5_TEST_SOURCE_DIR}/plugin.c) TARGET_NAMING (plugin ${LIB_TYPE}) TARGET_C_PROPERTIES (plugin " " " ") - TARGET_LINK_LIBRARIES (plugin ${HDF5_TEST_PLUGIN_LIB_TARGET}) - SET_TARGET_PROPERTIES (plugin PROPERTIES FOLDER test) -ENDIF (BUILD_SHARED_LIBS) + target_link_libraries (plugin ${HDF5_TEST_PLUGIN_LIB_TARGET}) + set_target_properties (plugin PROPERTIES FOLDER test) +endif (BUILD_SHARED_LIBS) -INCLUDE (CMakeTests.cmake) +include (CMakeTests.cmake) diff --git a/test/CMakeTests.cmake b/test/CMakeTests.cmake index 1b80e67..dbfe489 100644 --- a/test/CMakeTests.cmake +++ b/test/CMakeTests.cmake @@ -8,25 +8,25 @@ # -------------------------------------------------------------------- # Copy all the HDF5 files from the test directory into the source directory # -------------------------------------------------------------------- -SET (HDF5_TEST_FILES +set (HDF5_TEST_FILES tnullspace.h5 ) -FOREACH (h5_tfile ${HDF5_TEST_FILES}) - SET (dest "${PROJECT_BINARY_DIR}/${h5_tfile}") - #MESSAGE (STATUS " Copying ${h5_tfile}") - ADD_CUSTOM_COMMAND ( +foreach (h5_tfile ${HDF5_TEST_FILES}) + set (dest "${PROJECT_BINARY_DIR}/${h5_tfile}") + #message (STATUS " Copying ${h5_tfile}") + add_custom_command ( TARGET ${HDF5_TEST_LIB_TARGET} POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${HDF5_TOOLS_SRC_DIR}/testfiles/${h5_tfile} ${dest} ) -ENDFOREACH (h5_tfile ${HDF5_TEST_FILES}) +endforeach (h5_tfile ${HDF5_TEST_FILES}) # -------------------------------------------------------------------- # Copy all the HDF5 files from the test directory into the source directory # -------------------------------------------------------------------- -SET (HDF5_REFERENCE_FILES +set (HDF5_REFERENCE_FILES err_compat_1 err_compat_2 error_test_1 @@ -34,21 +34,21 @@ SET (HDF5_REFERENCE_FILES links_env.out ) -FOREACH (ref_file ${HDF5_REFERENCE_FILES}) - SET (dest "${PROJECT_BINARY_DIR}/${ref_file}") - #MESSAGE (STATUS " Copying ${h5_file}") - ADD_CUSTOM_COMMAND ( +foreach (ref_file ${HDF5_REFERENCE_FILES}) + set (dest "${PROJECT_BINARY_DIR}/${ref_file}") + #message (STATUS " Copying ${h5_file}") + add_custom_command ( TARGET ${HDF5_TEST_LIB_TARGET} POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${HDF5_TEST_SOURCE_DIR}/testfiles/${ref_file} ${dest} ) -ENDFOREACH (ref_file ${HDF5_REFERENCE_FILES}) +endforeach (ref_file ${HDF5_REFERENCE_FILES}) # -------------------------------------------------------------------- # Copy test files from test/testfiles/plist_files dir to test dir # -------------------------------------------------------------------- -SET (HDF5_REFERENCE_PLIST_FILES +set (HDF5_REFERENCE_PLIST_FILES acpl_be acpl_le dapl_be @@ -75,21 +75,21 @@ SET (HDF5_REFERENCE_PLIST_FILES strcpl_le ) -FOREACH (plistfile ${HDF5_REFERENCE_PLIST_FILES}) - SET (dest "${PROJECT_BINARY_DIR}/${plistfile}") - #MESSAGE (STATUS " Copying ${plistfile} to ${dset}") - ADD_CUSTOM_COMMAND ( +foreach (plistfile ${HDF5_REFERENCE_PLIST_FILES}) + set (dest "${PROJECT_BINARY_DIR}/${plistfile}") + #message (STATUS " Copying ${plistfile} to ${dset}") + add_custom_command ( TARGET ${HDF5_TEST_LIB_TARGET} POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${HDF5_TEST_SOURCE_DIR}/testfiles/plist_files/${plistfile} ${dest} ) -ENDFOREACH (plistfile ${HDF5_REFERENCE_PLIST_FILES}) +endforeach (plistfile ${HDF5_REFERENCE_PLIST_FILES}) # -------------------------------------------------------------------- #-- Copy all the HDF5 files from the test directory into the source directory # -------------------------------------------------------------------- -SET (HDF5_REFERENCE_TEST_FILES +set (HDF5_REFERENCE_TEST_FILES be_data.h5 be_extlink1.h5 be_extlink2.h5 @@ -125,16 +125,16 @@ SET (HDF5_REFERENCE_TEST_FILES tsizeslheap.h5 ) -FOREACH (h5_file ${HDF5_REFERENCE_TEST_FILES}) - SET (dest "${HDF5_TEST_BINARY_DIR}/${h5_file}") - #MESSAGE (STATUS " Copying ${h5_file} to ${dest}") - ADD_CUSTOM_COMMAND ( +foreach (h5_file ${HDF5_REFERENCE_TEST_FILES}) + set (dest "${HDF5_TEST_BINARY_DIR}/${h5_file}") + #message (STATUS " Copying ${h5_file} to ${dest}") + add_custom_command ( TARGET ${HDF5_TEST_LIB_TARGET} POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${HDF5_TEST_SOURCE_DIR}/${h5_file} ${dest} ) -ENDFOREACH (h5_file ${HDF5_REFERENCE_TEST_FILES}) +endforeach (h5_file ${HDF5_REFERENCE_TEST_FILES}) # Remove any output file left over from previous test run ADD_TEST ( @@ -160,7 +160,7 @@ ADD_TEST ( tsohm_src.h5 ) -IF (HDF5_ENABLE_USING_MEMCHECKER) +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) @@ -173,10 +173,10 @@ IF (HDF5_ENABLE_USING_MEMCHECKER) 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) +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) +endif (HDF5_ENABLE_USING_MEMCHECKER) ############################################################################## ############################################################################## @@ -248,10 +248,10 @@ ADD_TEST ( unregister_filter_2.h5 ) -FOREACH (test ${H5_TESTS}) +foreach (test ${H5_TESTS}) ADD_TEST (NAME ${test} COMMAND $) SET_TESTS_PROPERTIES(${test} PROPERTIES DEPENDS h5test-clear-objects) -ENDFOREACH (test ${H5_TESTS}) +endforeach (test ${H5_TESTS}) SET_TESTS_PROPERTIES(flush2 PROPERTIES DEPENDS flush1) @@ -306,7 +306,7 @@ ADD_TEST (NAME ttsafe COMMAND $) SET_TESTS_PROPERTIES(ttsafe PROPERTIES DEPENDS h5test-clear-ttsafe-objects) #-- Adding test for err_compat -IF (HDF5_ENABLE_DEPRECATED_SYMBOLS) +if (HDF5_ENABLE_DEPRECATED_SYMBOLS) ADD_TEST ( NAME h5test-clear-err_compat-objects COMMAND ${CMAKE_COMMAND} @@ -325,7 +325,7 @@ IF (HDF5_ENABLE_DEPRECATED_SYMBOLS) -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) SET_TESTS_PROPERTIES(err_compat PROPERTIES DEPENDS h5test-clear-err_compat-objects) -ENDIF (HDF5_ENABLE_DEPRECATED_SYMBOLS) +endif (HDF5_ENABLE_DEPRECATED_SYMBOLS) #-- Adding test for error_test ADD_TEST ( @@ -378,23 +378,23 @@ ADD_TEST (NAME testlibinfo COMMAND ${CMAKE_COMMAND} -D "TEST_PROGRAM=$) 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 **** ") +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) +endif (BUILD_SHARED_LIBS) ############################################################################## ############################################################################## @@ -402,9 +402,9 @@ ENDIF (BUILD_SHARED_LIBS) ############################################################################## ############################################################################## -IF (HDF5_TEST_VFD) +if (HDF5_TEST_VFD) - SET (VFD_LIST + set (VFD_LIST sec2 stdio core @@ -413,7 +413,7 @@ IF (HDF5_TEST_VFD) family ) - SET (H5_VFD_TESTS + set (H5_VFD_TESTS testhdf5 accum lheap @@ -469,12 +469,12 @@ IF (HDF5_TEST_VFD) unregister ) - IF (DIRECT_VFD) - SET (VFD_LIST ${VFD_LIST} direct) - ENDIF (DIRECT_VFD) + if (DIRECT_VFD) + set (VFD_LIST ${VFD_LIST} direct) + endif (DIRECT_VFD) MACRO (ADD_VFD_TEST vfdname resultcode) - FOREACH (test ${H5_VFD_TESTS}) + foreach (test ${H5_VFD_TESTS}) ADD_TEST ( NAME VFD-${vfdname}-${test} COMMAND "${CMAKE_COMMAND}" @@ -486,8 +486,8 @@ IF (HDF5_TEST_VFD) -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" -P "${HDF5_RESOURCES_DIR}/vfdTest.cmake" ) - ENDFOREACH (test ${H5_VFD_TESTS}) - IF (HDF5_TEST_FHEAP_VFD) + endforeach (test ${H5_VFD_TESTS}) + if (HDF5_TEST_FHEAP_VFD) ADD_TEST ( NAME VFD-${vfdname}-fheap COMMAND "${CMAKE_COMMAND}" @@ -499,15 +499,15 @@ IF (HDF5_TEST_VFD) -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" -P "${HDF5_RESOURCES_DIR}/vfdTest.cmake" ) - ENDIF (HDF5_TEST_FHEAP_VFD) + endif (HDF5_TEST_FHEAP_VFD) ENDMACRO (ADD_VFD_TEST) # Run test with different Virtual File Driver - FOREACH (vfd ${VFD_LIST}) + foreach (vfd ${VFD_LIST}) ADD_VFD_TEST (${vfd} 0) - ENDFOREACH (vfd ${VFD_LIST}) + endforeach (vfd ${VFD_LIST}) -ENDIF (HDF5_TEST_VFD) +endif (HDF5_TEST_VFD) ############################################################################## ############################################################################## @@ -515,17 +515,17 @@ ENDIF (HDF5_TEST_VFD) ############################################################################## ############################################################################## -IF (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) +if (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) MACRO (ADD_H5_GENERATOR genfile) - ADD_EXECUTABLE (${genfile} ${HDF5_TEST_SOURCE_DIR}/${genfile}.c) + add_executable (${genfile} ${HDF5_TEST_SOURCE_DIR}/${genfile}.c) TARGET_NAMING (${genfile} ${LIB_TYPE}) TARGET_C_PROPERTIES (${genfile} " " " ") - TARGET_LINK_LIBRARIES (${genfile} ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET}) - SET_TARGET_PROPERTIES (${genfile} PROPERTIES FOLDER generator/test) + target_link_libraries (${genfile} ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET}) + set_target_properties (${genfile} PROPERTIES FOLDER generator/test) ENDMACRO (ADD_H5_GENERATOR genfile) # generator executables - SET (H5_GENERATORS + set (H5_GENERATORS gen_bad_ohdr gen_bogus gen_cross @@ -547,8 +547,8 @@ IF (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) gen_plist ) - FOREACH (gen ${H5_GENERATORS}) + foreach (gen ${H5_GENERATORS}) ADD_H5_GENERATOR (${gen}) - ENDFOREACH (gen ${H5_GENERATORS}) + endforeach (gen ${H5_GENERATORS}) -ENDIF (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) +endif (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) diff --git a/testpar/CMakeLists.txt b/testpar/CMakeLists.txt index 30cdcda..8eaa13a 100644 --- a/testpar/CMakeLists.txt +++ b/testpar/CMakeLists.txt @@ -4,7 +4,7 @@ PROJECT (HDF5_TEST_PAR) #----------------------------------------------------------------------------- # Apply Definitions to compiler in this directory and below #----------------------------------------------------------------------------- -ADD_DEFINITIONS (${HDF5_EXTRA_C_FLAGS}) +add_definitions (${HDF5_EXTRA_C_FLAGS}) INCLUDE_DIRECTORIES (${HDF5_TEST_SRC_DIR}) INCLUDE_DIRECTORIES (${HDF5_TOOLS_SRC_DIR}/lib ) @@ -12,7 +12,7 @@ INCLUDE_DIRECTORIES (${HDF5_TOOLS_SRC_DIR}/lib ) # Define Tests #----------------------------------------------------------------------------- -SET (testphdf5_SRCS +set (testphdf5_SRCS ${HDF5_TEST_PAR_SOURCE_DIR}/testphdf5.c ${HDF5_TEST_PAR_SOURCE_DIR}/t_dset.c ${HDF5_TEST_PAR_SOURCE_DIR}/t_file.c @@ -27,21 +27,21 @@ SET (testphdf5_SRCS ) #-- Adding test for testhdf5 -ADD_EXECUTABLE (testphdf5 ${testphdf5_SRCS}) +add_executable (testphdf5 ${testphdf5_SRCS}) TARGET_NAMING (testphdf5 ${LIB_TYPE}) TARGET_C_PROPERTIES (testphdf5 " " " ") -TARGET_LINK_LIBRARIES (testphdf5 ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET} ${LINK_LIBS}) -SET_TARGET_PROPERTIES (testphdf5 PROPERTIES FOLDER test/par) +target_link_libraries (testphdf5 ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET} ${LINK_LIBS}) +set_target_properties (testphdf5 PROPERTIES FOLDER test/par) MACRO (ADD_H5P_EXE file) - ADD_EXECUTABLE (${file} ${HDF5_TEST_PAR_SOURCE_DIR}/${file}.c) + add_executable (${file} ${HDF5_TEST_PAR_SOURCE_DIR}/${file}.c) TARGET_NAMING (${file} ${LIB_TYPE}) TARGET_C_PROPERTIES (${file} " " " ") - TARGET_LINK_LIBRARIES (${file} ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET} ${LINK_LIBS}) - SET_TARGET_PROPERTIES (${file} PROPERTIES FOLDER test/par) + target_link_libraries (${file} ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET} ${LINK_LIBS}) + set_target_properties (${file} PROPERTIES FOLDER test/par) ENDMACRO (ADD_H5P_EXE file) -SET (H5P_TESTS +set (H5P_TESTS t_mpi # t_posix_compliant t_cache @@ -50,12 +50,12 @@ SET (H5P_TESTS t_shapesame ) -FOREACH (testp ${H5P_TESTS}) +foreach (testp ${H5P_TESTS}) ADD_H5P_EXE(${testp}) -ENDFOREACH (testp ${H5P_TESTS}) +endforeach (testp ${H5P_TESTS}) -IF (NOT WIN32) +if (NOT WIN32) ADD_H5P_EXE(t_posix_compliant) -ENDIF (NOT WIN32) +endif (NOT WIN32) -INCLUDE (CMakeTests.cmake) +include (CMakeTests.cmake) diff --git a/testpar/CMakeTests.cmake b/testpar/CMakeTests.cmake index bc8fc90..6e1f823 100644 --- a/testpar/CMakeTests.cmake +++ b/testpar/CMakeTests.cmake @@ -7,19 +7,19 @@ ADD_TEST (NAME TEST_PAR_testphdf5 COMMAND ${MPIEXEC} ${MPIEXEC_PREFLAGS} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_POSTFLAGS} $) -FOREACH (testp ${H5P_TESTS}) +foreach (testp ${H5P_TESTS}) ADD_TEST (NAME TEST_PAR_${testp} COMMAND ${MPIEXEC} ${MPIEXEC_PREFLAGS} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_POSTFLAGS} $) -ENDFOREACH (testp ${H5P_TESTS}) +endforeach (testp ${H5P_TESTS}) SET_TESTS_PROPERTIES(TEST_PAR_t_pflush2 PROPERTIES DEPENDS TEST_PAR_t_pflush1) -IF (NOT WIN32) +if (NOT WIN32) ADD_TEST (NAME TEST_PAR_t_posix_compliant COMMAND ${MPIEXEC} ${MPIEXEC_PREFLAGS} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_POSTFLAGS} $) -ENDIF (NOT WIN32) +endif (NOT WIN32) -IF (HDF5_TEST_VFD) +if (HDF5_TEST_VFD) - SET (VFD_LIST + set (VFD_LIST sec2 stdio core @@ -28,18 +28,18 @@ IF (HDF5_TEST_VFD) family ) - SET (H5P_VFD_TESTS + set (H5P_VFD_TESTS t_pflush1 t_pflush2 ) - IF (DIRECT_VFD) - SET (VFD_LIST ${VFD_LIST} direct) - ENDIF (DIRECT_VFD) + if (DIRECT_VFD) + set (VFD_LIST ${VFD_LIST} direct) + endif (DIRECT_VFD) MACRO (ADD_VFD_TEST vfdname resultcode) - IF (NOT HDF5_ENABLE_USING_MEMCHECKER) - FOREACH (test ${H5P_VFD_TESTS}) + if (NOT HDF5_ENABLE_USING_MEMCHECKER) + foreach (test ${H5P_VFD_TESTS}) ADD_TEST ( NAME VFD-${vfdname}-${test} COMMAND "${CMAKE_COMMAND}" @@ -51,13 +51,13 @@ IF (HDF5_TEST_VFD) -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" -P "${HDF5_RESOURCES_DIR}/vfdTest.cmake" ) - ENDFOREACH (test ${H5P_VFD_TESTS}) - ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) + endforeach (test ${H5P_VFD_TESTS}) + endif (NOT HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (ADD_VFD_TEST) # Run test with different Virtual File Driver - FOREACH (vfd ${VFD_LIST}) + foreach (vfd ${VFD_LIST}) ADD_VFD_TEST (${vfd} 0) - ENDFOREACH (vfd ${VFD_LIST}) + endforeach (vfd ${VFD_LIST}) -ENDIF (HDF5_TEST_VFD) +endif (HDF5_TEST_VFD) diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt index 3bb4a1f..0dfe7c9 100644 --- a/tools/CMakeLists.txt +++ b/tools/CMakeLists.txt @@ -4,7 +4,7 @@ PROJECT (HDF5_TOOLS) #----------------------------------------------------------------------------- # Apply Definitions to compiler in this directory and below #----------------------------------------------------------------------------- -ADD_DEFINITIONS (${HDF5_EXTRA_C_FLAGS}) +add_definitions (${HDF5_EXTRA_C_FLAGS}) #----------------------------------------------------------------------------- # Setup include Directories @@ -14,9 +14,9 @@ INCLUDE_DIRECTORIES (${HDF5_TOOLS_SOURCE_DIR}/lib) # -------------------------------------------------------------------- # If testing was NOT enabled, then we need to build the tools library # -------------------------------------------------------------------- -IF (NOT BUILD_TESTING) +if (NOT BUILD_TESTING) ADD_SUBDIRECTORY (${HDF5_TOOLS_SOURCE_DIR}/lib) -ENDIF (NOT BUILD_TESTING) +endif (NOT BUILD_TESTING) #-- Add the h5diff and test executables ADD_SUBDIRECTORY (${HDF5_TOOLS_SOURCE_DIR}/h5diff) diff --git a/tools/h5copy/CMakeLists.txt b/tools/h5copy/CMakeLists.txt index 6faf332..79deec9 100644 --- a/tools/h5copy/CMakeLists.txt +++ b/tools/h5copy/CMakeLists.txt @@ -9,27 +9,27 @@ INCLUDE_DIRECTORIES (${HDF5_TOOLS_SRC_DIR}/lib) # -------------------------------------------------------------------- # Add the h5copy and test executables # -------------------------------------------------------------------- -ADD_EXECUTABLE (h5copy ${HDF5_TOOLS_H5COPY_SOURCE_DIR}/h5copy.c) +add_executable (h5copy ${HDF5_TOOLS_H5COPY_SOURCE_DIR}/h5copy.c) TARGET_NAMING (h5copy ${LIB_TYPE}) TARGET_C_PROPERTIES (h5copy " " " ") -TARGET_LINK_LIBRARIES (h5copy ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) -SET_TARGET_PROPERTIES (h5copy PROPERTIES FOLDER tools) +target_link_libraries (h5copy ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) +set_target_properties (h5copy PROPERTIES FOLDER tools) -SET (H5_DEP_EXECUTABLES h5copy) +set (H5_DEP_EXECUTABLES h5copy) -IF (BUILD_TESTING) - IF (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) - ADD_EXECUTABLE (h5copygentest ${HDF5_TOOLS_H5COPY_SOURCE_DIR}/h5copygentest.c) +if (BUILD_TESTING) + if (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) + add_executable (h5copygentest ${HDF5_TOOLS_H5COPY_SOURCE_DIR}/h5copygentest.c) TARGET_NAMING (h5copygentest ${LIB_TYPE}) TARGET_C_PROPERTIES (h5copygentest " " " ") - TARGET_LINK_LIBRARIES (h5copygentest ${HDF5_LIB_TARGET}) - SET_TARGET_PROPERTIES (h5copygentest PROPERTIES FOLDER generator/tools) + target_link_libraries (h5copygentest ${HDF5_LIB_TARGET}) + set_target_properties (h5copygentest PROPERTIES FOLDER generator/tools) #ADD_TEST (NAME h5copygentest COMMAND $) - ENDIF (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) + endif (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) - INCLUDE (CMakeTests.cmake) -ENDIF (BUILD_TESTING) + include (CMakeTests.cmake) +endif (BUILD_TESTING) ############################################################################## ############################################################################## @@ -43,7 +43,7 @@ ENDIF (BUILD_TESTING) #INSTALL_PROGRAM_PDB (h5copy ${HDF5_INSTALL_BIN_DIR} toolsapplications) -INSTALL ( +install ( TARGETS h5copy RUNTIME DESTINATION diff --git a/tools/h5copy/CMakeTests.cmake b/tools/h5copy/CMakeTests.cmake index a4cce03..0d8f121 100644 --- a/tools/h5copy/CMakeTests.cmake +++ b/tools/h5copy/CMakeTests.cmake @@ -8,30 +8,30 @@ # -------------------------------------------------------------------- # Copy all the HDF5 files from the source directory into the test directory # -------------------------------------------------------------------- - SET (LIST_HDF5_TEST_FILES + set (LIST_HDF5_TEST_FILES ${HDF5_TOOLS_H5COPY_SOURCE_DIR}/testfiles/h5copy_extlinks_src.h5 ${HDF5_TOOLS_H5COPY_SOURCE_DIR}/testfiles/h5copy_extlinks_trg.h5 ${HDF5_TOOLS_H5COPY_SOURCE_DIR}/testfiles/h5copy_ref.h5 ${HDF5_TOOLS_H5COPY_SOURCE_DIR}/testfiles/h5copytst.h5 ) - SET (LIST_OTHER_TEST_FILES + set (LIST_OTHER_TEST_FILES ${HDF5_TOOLS_H5COPY_SOURCE_DIR}/testfiles/h5copy_misc1.out ) FILE (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") - FOREACH (listfiles ${LIST_HDF5_TEST_FILES} ${LIST_OTHER_TEST_FILES}) + foreach (listfiles ${LIST_HDF5_TEST_FILES} ${LIST_OTHER_TEST_FILES}) GET_FILENAME_COMPONENT(fname "${listfiles}" NAME) - SET (dest "${PROJECT_BINARY_DIR}/testfiles/${fname}") - #MESSAGE (STATUS " Copying ${listfiles}") - ADD_CUSTOM_COMMAND ( + set (dest "${PROJECT_BINARY_DIR}/testfiles/${fname}") + #message (STATUS " Copying ${listfiles}") + add_custom_command ( TARGET h5copy POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${listfiles} ${dest} ) - ENDFOREACH (listfiles ${LIST_HDF5_TEST_FILES} ${LIST_OTHER_TEST_FILES}) + endforeach (listfiles ${LIST_HDF5_TEST_FILES} ${LIST_OTHER_TEST_FILES}) ############################################################################## ############################################################################## @@ -43,7 +43,7 @@ # Perform h5copy according to passing parmeters # MACRO (ADD_H5_F_TEST testname resultcode infile fparam vparam sparam srcname dparam dstname) - IF (NOT HDF5_ENABLE_USING_MEMCHECKER) + if (NOT HDF5_ENABLE_USING_MEMCHECKER) # Remove any output file left over from previous test run ADD_TEST ( NAME H5COPY_F-${testname}-clear-objects @@ -51,35 +51,35 @@ -E remove ./testfiles/${testname}.out.h5 ) - ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) + endif (NOT HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( NAME H5COPY_F-${testname} COMMAND $ -f ${fparam} -i ./testfiles/${infile} -o ./testfiles/${testname}.out.h5 ${vparam} ${sparam} ${srcname} ${dparam} ${dstname} ${ARGN} ) - IF (HDF5_ENABLE_USING_MEMCHECKER) - IF (NOT "${last_test}" STREQUAL "") + 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) + 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) + endif (HDF5_ENABLE_USING_MEMCHECKER) # resultcode=2 will cause the test to skip the diff test - IF (NOT ${resultcode} STREQUAL "2") + 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") + if (${resultcode} STREQUAL "1") SET_TESTS_PROPERTIES (H5COPY_F-${testname}-DIFF PROPERTIES WILL_FAIL "true") - ENDIF (${resultcode} STREQUAL "1") - ENDIF (NOT ${resultcode} STREQUAL "2") + endif (${resultcode} STREQUAL "1") + endif (NOT ${resultcode} STREQUAL "2") ENDMACRO (ADD_H5_F_TEST) MACRO (ADD_H5_TEST testname resultcode infile vparam sparam srcname dparam dstname) - IF (NOT HDF5_ENABLE_USING_MEMCHECKER) + if (NOT HDF5_ENABLE_USING_MEMCHECKER) # Remove any output file left over from previous test run ADD_TEST ( NAME H5COPY-${testname}-clear-objects @@ -87,35 +87,35 @@ -E remove ./testfiles/${testname}.out.h5 ) - ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) + endif (NOT HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( NAME H5COPY-${testname} COMMAND $ -i ./testfiles/${infile} -o ./testfiles/${testname}.out.h5 ${vparam} ${sparam} ${srcname} ${dparam} ${dstname} ${ARGN} ) - IF (HDF5_ENABLE_USING_MEMCHECKER) - IF (NOT "${last_test}" STREQUAL "") + 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) + 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) + endif (HDF5_ENABLE_USING_MEMCHECKER) # resultcode=2 will cause the test to skip the diff test - IF (NOT ${resultcode} STREQUAL "2") + 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") + if (${resultcode} STREQUAL "1") SET_TESTS_PROPERTIES (H5COPY-${testname}-DIFF PROPERTIES WILL_FAIL "true") - ENDIF (${resultcode} STREQUAL "1") - ENDIF (NOT ${resultcode} STREQUAL "2") + endif (${resultcode} STREQUAL "1") + endif (NOT ${resultcode} STREQUAL "2") ENDMACRO (ADD_H5_TEST) MACRO (ADD_H5_TEST2 testname resultcode infile psparam pdparam vparam sparam srcname dparam dstname) - IF (NOT HDF5_ENABLE_USING_MEMCHECKER) + if (NOT HDF5_ENABLE_USING_MEMCHECKER) # Remove any output file left over from previous test run ADD_TEST ( NAME H5COPY-${testname}-clear-objects @@ -123,19 +123,19 @@ -E remove ./testfiles/${testname}.out.h5 ) - ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) + 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 "") + 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) + 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) + endif (HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( NAME H5COPY-${testname} @@ -143,20 +143,20 @@ ) 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") + 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") + if (${resultcode} STREQUAL "1") SET_TESTS_PROPERTIES (H5COPY-${testname}-DIFF PROPERTIES WILL_FAIL "true") - ENDIF (${resultcode} STREQUAL "1") - ENDIF (NOT ${resultcode} STREQUAL "2") + endif (${resultcode} STREQUAL "1") + endif (NOT ${resultcode} STREQUAL "2") 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) + if (NOT HDF5_ENABLE_USING_MEMCHECKER) # Remove any output file left over from previous test run ADD_TEST ( NAME H5COPY_SAME-${testname}-clear-objects @@ -164,19 +164,19 @@ -E remove ./testfiles/${testname}.out.h5 ) - ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) + endif (NOT HDF5_ENABLE_USING_MEMCHECKER) 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) - IF (NOT "${last_test}" STREQUAL "") + if (HDF5_ENABLE_USING_MEMCHECKER) + 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) + 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) + endif (HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( NAME H5COPY_SAME-${testname} @@ -184,16 +184,16 @@ ) 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") + if (NOT ${resultcode} STREQUAL "2") ADD_TEST ( NAME H5COPY_SAME-${testname}-DIFF COMMAND $ -q ./testfiles/${testname}.out.h5 ./testfiles/${testname}.out.h5 ${srcname} ${dstname} ) SET_TESTS_PROPERTIES(H5COPY_SAME-${testname}-DIFF PROPERTIES DEPENDS H5COPY_SAME-${testname}) - IF (${resultcode} STREQUAL "1") + if (${resultcode} STREQUAL "1") SET_TESTS_PROPERTIES (H5COPY_SAME-${testname}-DIFF PROPERTIES WILL_FAIL "true") - ENDIF (${resultcode} STREQUAL "1") - ENDIF (NOT ${resultcode} STREQUAL "2") + endif (${resultcode} STREQUAL "1") + endif (NOT ${resultcode} STREQUAL "2") ENDMACRO (ADD_H5_TEST_SAME) # @@ -202,15 +202,15 @@ # 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) + if (HDF5_ENABLE_USING_MEMCHECKER) 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") + if (${resultcode} STREQUAL "1") SET_TESTS_PROPERTIES (H5COPY-CMP-${testname} PROPERTIES WILL_FAIL "true") - ENDIF (${resultcode} STREQUAL "1") - IF (NOT "${last_test}" STREQUAL "") + 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) + 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 @@ -233,7 +233,7 @@ -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) SET_TESTS_PROPERTIES (H5COPY-CMP-${testname} PROPERTIES DEPENDS H5COPY-CMP-${testname}-clear-objects) - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) + endif (HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (ADD_H5_CMP_TEST) ############################################################################## @@ -245,12 +245,12 @@ # -------------------------------------------------------------------- # test file names # -------------------------------------------------------------------- - SET (HDF_FILE1 h5copytst) - SET (HDF_FILE2 h5copy_ref) - SET (HDF_EXT_SRC_FILE h5copy_extlinks_src) - SET (HDF_EXT_TRG_FILE h5copy_extlinks_trg) + set (HDF_FILE1 h5copytst) + set (HDF_FILE2 h5copy_ref) + set (HDF_EXT_SRC_FILE h5copy_extlinks_src) + set (HDF_EXT_TRG_FILE h5copy_extlinks_trg) - IF (HDF5_ENABLE_USING_MEMCHECKER) + if (HDF5_ENABLE_USING_MEMCHECKER) # Remove any output file left over from previous test run ADD_TEST ( NAME H5COPY-clearall-objects @@ -292,11 +292,11 @@ h5copy_misc1.out.out.err ) SET_TESTS_PROPERTIES (H5COPY-clearall-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") - IF (NOT "${last_test}" STREQUAL "") + 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) + 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 -v -s simple -d simple) diff --git a/tools/h5diff/CMakeLists.txt b/tools/h5diff/CMakeLists.txt index d79c290..3ef108b 100644 --- a/tools/h5diff/CMakeLists.txt +++ b/tools/h5diff/CMakeLists.txt @@ -9,45 +9,45 @@ INCLUDE_DIRECTORIES (${HDF5_TOOLS_SRC_DIR}/lib) # -------------------------------------------------------------------- # Add the h5diff executables # -------------------------------------------------------------------- -ADD_EXECUTABLE (h5diff +add_executable (h5diff ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/h5diff_common.c ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/h5diff_main.c ) TARGET_NAMING (h5diff ${LIB_TYPE}) TARGET_C_PROPERTIES (h5diff " " " ") -TARGET_LINK_LIBRARIES (h5diff ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) -SET_TARGET_PROPERTIES (h5diff PROPERTIES FOLDER tools) +target_link_libraries (h5diff ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) +set_target_properties (h5diff PROPERTIES FOLDER tools) -SET (H5_DEP_EXECUTABLES h5diff) +set (H5_DEP_EXECUTABLES h5diff) -IF (H5_HAVE_PARALLEL) - ADD_EXECUTABLE (ph5diff +if (H5_HAVE_PARALLEL) + add_executable (ph5diff ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/h5diff_common.c ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/ph5diff_main.c ) TARGET_NAMING (ph5diff ${LIB_TYPE}) TARGET_C_PROPERTIES (ph5diff " " " ") - TARGET_LINK_LIBRARIES (ph5diff ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) - SET_TARGET_PROPERTIES (ph5diff PROPERTIES FOLDER tools) -ENDIF (H5_HAVE_PARALLEL) + target_link_libraries (ph5diff ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) + set_target_properties (ph5diff PROPERTIES FOLDER tools) +endif (H5_HAVE_PARALLEL) -IF (BUILD_TESTING) +if (BUILD_TESTING) # -------------------------------------------------------------------- # Add the h5diff and test executables # -------------------------------------------------------------------- - IF (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) - ADD_EXECUTABLE (h5diffgentest ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/h5diffgentest.c) + if (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) + add_executable (h5diffgentest ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/h5diffgentest.c) TARGET_NAMING (h5diffgentest ${LIB_TYPE}) TARGET_C_PROPERTIES (h5diffgentest " " " ") - TARGET_LINK_LIBRARIES (h5diffgentest ${HDF5_LIB_TARGET}) - SET_TARGET_PROPERTIES (h5diffgentest PROPERTIES FOLDER generator/tools) + target_link_libraries (h5diffgentest ${HDF5_LIB_TARGET}) + set_target_properties (h5diffgentest PROPERTIES FOLDER generator/tools) #ADD_TEST (NAME h5diffgentest COMMAND $) - ENDIF (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) + endif (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) - INCLUDE (CMakeTests.cmake) + include (CMakeTests.cmake) -ENDIF (BUILD_TESTING) +endif (BUILD_TESTING) ############################################################################## ############################################################################## @@ -61,7 +61,7 @@ ENDIF (BUILD_TESTING) #INSTALL_PROGRAM_PDB (h5diff ${HDF5_INSTALL_BIN_DIR} toolsapplications) -INSTALL ( +install ( TARGETS h5diff RUNTIME DESTINATION @@ -70,11 +70,11 @@ INSTALL ( toolsapplications ) -IF (H5_HAVE_PARALLEL) +if (H5_HAVE_PARALLEL) #INSTALL_PROGRAM_PDB (ph5diff ${HDF5_INSTALL_BIN_DIR} toolsapplications) - INSTALL ( + install ( TARGETS ph5diff RUNTIME DESTINATION @@ -82,4 +82,4 @@ IF (H5_HAVE_PARALLEL) COMPONENT toolsapplications ) -ENDIF (H5_HAVE_PARALLEL) +endif (H5_HAVE_PARALLEL) diff --git a/tools/h5diff/CMakeTests.cmake b/tools/h5diff/CMakeTests.cmake index cac4f84..f13f689 100644 --- a/tools/h5diff/CMakeTests.cmake +++ b/tools/h5diff/CMakeTests.cmake @@ -8,7 +8,7 @@ # -------------------------------------------------------------------- # Copy all the HDF5 files from the test directory into the source directory # -------------------------------------------------------------------- - SET (LIST_HDF5_TEST_FILES + set (LIST_HDF5_TEST_FILES ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_basic1.h5 ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_basic2.h5 ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_types.h5 @@ -52,7 +52,7 @@ ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/non_comparables2.h5 ) - SET (LIST_OTHER_TEST_FILES + set (LIST_OTHER_TEST_FILES ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_10.txt ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_100.txt ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_101.txt @@ -239,50 +239,50 @@ # # copy test files from source to build dir # - FOREACH (h5_tstfiles ${LIST_HDF5_TEST_FILES} ${LIST_OTHER_TEST_FILES}) + foreach (h5_tstfiles ${LIST_HDF5_TEST_FILES} ${LIST_OTHER_TEST_FILES}) GET_FILENAME_COMPONENT(fname "${h5_tstfiles}" NAME) - SET (dest "${PROJECT_BINARY_DIR}/testfiles/${fname}") - #MESSAGE (STATUS " Copying ${fname}") - ADD_CUSTOM_COMMAND ( + set (dest "${PROJECT_BINARY_DIR}/testfiles/${fname}") + #message (STATUS " Copying ${fname}") + add_custom_command ( TARGET h5diff POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${h5_tstfiles} ${dest} ) - ENDFOREACH (h5_tstfiles ${LIST_HDF5_TEST_FILES} ${LIST_OTHER_TEST_FILES}) + endforeach (h5_tstfiles ${LIST_HDF5_TEST_FILES} ${LIST_OTHER_TEST_FILES}) # # Overwrite system dependent files (Windows) # - IF (WIN32 AND NOT CYGWIN) - ADD_CUSTOM_COMMAND ( + if (WIN32 AND NOT CYGWIN) + add_custom_command ( TARGET h5diff POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_101w.txt ${PROJECT_BINARY_DIR}/testfiles/h5diff_101.txt ) - ADD_CUSTOM_COMMAND ( + add_custom_command ( TARGET h5diff POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_102w.txt ${PROJECT_BINARY_DIR}/testfiles/h5diff_102.txt ) - ADD_CUSTOM_COMMAND ( + add_custom_command ( TARGET h5diff POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_103w.txt ${PROJECT_BINARY_DIR}/testfiles/h5diff_103.txt ) - ADD_CUSTOM_COMMAND ( + add_custom_command ( TARGET h5diff POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_104w.txt ${PROJECT_BINARY_DIR}/testfiles/h5diff_104.txt ) - ENDIF (WIN32 AND NOT CYGWIN) + endif (WIN32 AND NOT CYGWIN) ############################################################################## ############################################################################## @@ -292,16 +292,16 @@ MACRO (ADD_H5_TEST resultfile resultcode) # If using memchecker add tests without using scripts - IF (HDF5_ENABLE_USING_MEMCHECKER) + if (HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST (NAME H5DIFF-${resultfile} COMMAND $ ${ARGN}) SET_TESTS_PROPERTIES (H5DIFF-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") - IF (NOT ${resultcode} STREQUAL "0") + if (NOT ${resultcode} STREQUAL "0") SET_TESTS_PROPERTIES (H5DIFF-${resultfile} PROPERTIES WILL_FAIL "true") - ENDIF (NOT ${resultcode} STREQUAL "0") - IF (NOT "${last_test}" STREQUAL "") + endif (NOT ${resultcode} STREQUAL "0") + if (NOT "${last_test}" STREQUAL "") SET_TESTS_PROPERTIES (H5DIFF-${resultfile} PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - ELSE (HDF5_ENABLE_USING_MEMCHECKER) + endif (NOT "${last_test}" STREQUAL "") + else (HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( NAME H5DIFF-${resultfile}-clear-objects COMMAND ${CMAKE_COMMAND} @@ -320,24 +320,24 @@ -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) SET_TESTS_PROPERTIES (H5DIFF-${resultfile} PROPERTIES DEPENDS "H5DIFF-${resultfile}-clear-objects") - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) - IF (H5_HAVE_PARALLEL) + endif (HDF5_ENABLE_USING_MEMCHECKER) + if (H5_HAVE_PARALLEL) ADD_PH5_TEST (${resultfile} ${resultcode} ${ARGN}) - ENDIF (H5_HAVE_PARALLEL) + endif (H5_HAVE_PARALLEL) ENDMACRO (ADD_H5_TEST file) MACRO (ADD_PH5_TEST resultfile resultcode) # If using memchecker add tests without using scripts - IF (HDF5_ENABLE_USING_MEMCHECKER) + if (HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST (NAME PH5DIFF-${resultfile} COMMAND $ ${MPIEXEC} ${MPIEXEC_PREFLAGS} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_POSTFLAGS} ${ARGN}) SET_TESTS_PROPERTIES (PH5DIFF-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") - IF (NOT ${resultcode} STREQUAL "0") + if (NOT ${resultcode} STREQUAL "0") SET_TESTS_PROPERTIES (PH5DIFF-${resultfile} PROPERTIES WILL_FAIL "true") - ENDIF (NOT ${resultcode} STREQUAL "0") - IF (NOT "${last_test}" STREQUAL "") + endif (NOT ${resultcode} STREQUAL "0") + if (NOT "${last_test}" STREQUAL "") SET_TESTS_PROPERTIES (PH5DIFF-${resultfile} PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - ELSE (HDF5_ENABLE_USING_MEMCHECKER) + endif (NOT "${last_test}" STREQUAL "") + else (HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( NAME PH5DIFF-${resultfile}-clear-objects COMMAND ${CMAKE_COMMAND} @@ -358,7 +358,7 @@ -P "${HDF5_RESOURCES_DIR}/prunTest.cmake" ) SET_TESTS_PROPERTIES (PH5DIFF-${resultfile} PROPERTIES DEPENDS "PH5DIFF-${resultfile}-clear-objects") - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) + endif (HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (ADD_PH5_TEST file) # ADD_H5_NO_OUTPUT_TEST @@ -366,30 +366,30 @@ # Don't use this if possible; this may be removed. MACRO (ADD_H5_NO_OUTPUT_TEST testname resultcode) # If using memchecker add tests without using scripts - IF (NOT HDF5_ENABLE_USING_MEMCHECKER) + if (NOT HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( 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 "") + if (NOT "${last_test}" STREQUAL "") SET_TESTS_PROPERTIES (H5DIFF-${testname}-clear-objects PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) + endif (NOT "${last_test}" STREQUAL "") + endif (NOT HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST (NAME H5DIFF-${testname} COMMAND $ ${ARGN}) - IF (NOT ${resultcode} STREQUAL "0") + if (NOT ${resultcode} STREQUAL "0") SET_TESTS_PROPERTIES (H5DIFF-${testname} PROPERTIES WILL_FAIL "true") - ENDIF (NOT ${resultcode} STREQUAL "0") + endif (NOT ${resultcode} STREQUAL "0") - IF (HDF5_ENABLE_USING_MEMCHECKER) - IF (NOT "${last_test}" STREQUAL "") + 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) + 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) + endif (HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (ADD_H5_NO_OUTPUT_TEST) ############################################################################## @@ -401,54 +401,54 @@ # -------------------------------------------------------------------- # test file names # -------------------------------------------------------------------- - SET (FILE1 h5diff_basic1.h5) - SET (FILE2 h5diff_basic2.h5) - SET (FILE3 h5diff_types.h5) - SET (FILE4 h5diff_dtypes.h5) - SET (FILE5 h5diff_attr1.h5) - SET (FILE6 h5diff_attr2.h5) - SET (FILE7 h5diff_dset1.h5) - SET (FILE8 h5diff_dset2.h5) - SET (FILE9 h5diff_hyper1.h5) - SET (FILE10 h5diff_hyper2.h5) - SET (FILE11 h5diff_empty.h5) - SET (FILE12 h5diff_links.h5) - SET (FILE13 h5diff_softlinks.h5) - SET (FILE14 h5diff_linked_softlink.h5) - SET (FILE15 h5diff_extlink_src.h5) - SET (FILE16 h5diff_extlink_trg.h5) - SET (FILE17 h5diff_ext2softlink_src.h5) - SET (FILE18 h5diff_ext2softlink_trg.h5) - SET (FILE19 h5diff_dset_zero_dim_size1.h5) - SET (FILE20 h5diff_dset_zero_dim_size2.h5) - SET (DANGLE_LINK_FILE1 h5diff_danglelinks1.h5) - SET (DANGLE_LINK_FILE2 h5diff_danglelinks2.h5) - SET (GRP_RECURSE_FILE1 h5diff_grp_recurse1.h5) - SET (GRP_RECURSE_FILE2 h5diff_grp_recurse2.h5) + set (FILE1 h5diff_basic1.h5) + set (FILE2 h5diff_basic2.h5) + set (FILE3 h5diff_types.h5) + set (FILE4 h5diff_dtypes.h5) + set (FILE5 h5diff_attr1.h5) + set (FILE6 h5diff_attr2.h5) + set (FILE7 h5diff_dset1.h5) + set (FILE8 h5diff_dset2.h5) + set (FILE9 h5diff_hyper1.h5) + set (FILE10 h5diff_hyper2.h5) + set (FILE11 h5diff_empty.h5) + set (FILE12 h5diff_links.h5) + set (FILE13 h5diff_softlinks.h5) + set (FILE14 h5diff_linked_softlink.h5) + set (FILE15 h5diff_extlink_src.h5) + set (FILE16 h5diff_extlink_trg.h5) + set (FILE17 h5diff_ext2softlink_src.h5) + set (FILE18 h5diff_ext2softlink_trg.h5) + set (FILE19 h5diff_dset_zero_dim_size1.h5) + set (FILE20 h5diff_dset_zero_dim_size2.h5) + set (DANGLE_LINK_FILE1 h5diff_danglelinks1.h5) + set (DANGLE_LINK_FILE2 h5diff_danglelinks2.h5) + set (GRP_RECURSE_FILE1 h5diff_grp_recurse1.h5) + set (GRP_RECURSE_FILE2 h5diff_grp_recurse2.h5) # group recursive - same structure via external links through files - SET (GRP_RECURSE1_EXT h5diff_grp_recurse_ext1.h5) - SET (GRP_RECURSE2_EXT1 h5diff_grp_recurse_ext2-1.h5) - SET (GRP_RECURSE2_EXT2 h5diff_grp_recurse_ext2-2.h5) - SET (GRP_RECURSE2_EXT3 h5diff_grp_recurse_ext2-3.h5) + set (GRP_RECURSE1_EXT h5diff_grp_recurse_ext1.h5) + set (GRP_RECURSE2_EXT1 h5diff_grp_recurse_ext2-1.h5) + set (GRP_RECURSE2_EXT2 h5diff_grp_recurse_ext2-2.h5) + set (GRP_RECURSE2_EXT3 h5diff_grp_recurse_ext2-3.h5) # same structure, same obj name with different value - SET (EXCLUDE_FILE1_1 h5diff_exclude1-1.h5) - SET (EXCLUDE_FILE1_2 h5diff_exclude1-2.h5) + set (EXCLUDE_FILE1_1 h5diff_exclude1-1.h5) + set (EXCLUDE_FILE1_2 h5diff_exclude1-2.h5) # different structure and obj names - SET (EXCLUDE_FILE2_1 h5diff_exclude2-1.h5) - SET (EXCLUDE_FILE2_2 h5diff_exclude2-2.h5) + set (EXCLUDE_FILE2_1 h5diff_exclude2-1.h5) + set (EXCLUDE_FILE2_2 h5diff_exclude2-2.h5) # Only one file contains unique objs. Common objs are same. - SET (EXCLUDE_FILE3_1 h5diff_exclude3-1.h5) - SET (EXCLUDE_FILE3_2 h5diff_exclude3-2.h5) + set (EXCLUDE_FILE3_1 h5diff_exclude3-1.h5) + set (EXCLUDE_FILE3_2 h5diff_exclude3-2.h5) # compound type with multiple vlen string types - SET (COMP_VL_STRS_FILE h5diff_comp_vl_strs.h5) + set (COMP_VL_STRS_FILE h5diff_comp_vl_strs.h5) # container types (array,vlen) with multiple nested compound types - SET (COMPS_ARRAY_VLEN_FILE1 compounds_array_vlen1.h5) - SET (COMPS_ARRAY_VLEN_FILE2 compounds_array_vlen2.h5) + set (COMPS_ARRAY_VLEN_FILE1 compounds_array_vlen1.h5) + set (COMPS_ARRAY_VLEN_FILE2 compounds_array_vlen2.h5) # attrs with verbose option level - SET (ATTR_VERBOSE_LEVEL_FILE1 h5diff_attr_v_level1.h5) - SET (ATTR_VERBOSE_LEVEL_FILE2 h5diff_attr_v_level2.h5) + set (ATTR_VERBOSE_LEVEL_FILE1 h5diff_attr_v_level1.h5) + set (ATTR_VERBOSE_LEVEL_FILE2 h5diff_attr_v_level2.h5) - IF (HDF5_ENABLE_USING_MEMCHECKER) + if (HDF5_ENABLE_USING_MEMCHECKER) # Remove any output file left over from previous test run ADD_TEST ( NAME H5DIFF-clearall-objects @@ -802,11 +802,11 @@ h5diff_90.out.err ) SET_TESTS_PROPERTIES (H5DIFF-clearall-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") - IF (NOT "${last_test}" STREQUAL "") + if (NOT "${last_test}" STREQUAL "") SET_TESTS_PROPERTIES (H5DIFF-clearall-objects PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "H5DIFF-clearall-objects") - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) + endif (NOT "${last_test}" STREQUAL "") + set (last_test "H5DIFF-clearall-objects") + endif (HDF5_ENABLE_USING_MEMCHECKER) # ############################################################################ # # Common usage @@ -1074,7 +1074,7 @@ ADD_H5_TEST (h5diff_90 0 -v ${FILE2} ${FILE2}) # 10. read by hyperslab, print indexes #if test -n "$pmode" -a "$mydomainname" = hdfgroup.uiuc.edu; then # # skip this test which sometimes hangs in some THG machines -# MESSAGE (STATUS "SKIP -v ${FILE9} ${FILE10}) +# message (STATUS "SKIP -v ${FILE9} ${FILE10}) #else # ADD_H5_TEST (h5diff_100 1 -v ${FILE9} ${FILE10}) #fi diff --git a/tools/h5dump/CMakeLists.txt b/tools/h5dump/CMakeLists.txt index 30ff215..ce162ad 100644 --- a/tools/h5dump/CMakeLists.txt +++ b/tools/h5dump/CMakeLists.txt @@ -9,38 +9,38 @@ INCLUDE_DIRECTORIES (${HDF5_TOOLS_SRC_DIR}/lib) # -------------------------------------------------------------------- # Add the h5dump executables # -------------------------------------------------------------------- -ADD_EXECUTABLE (h5dump +add_executable (h5dump ${HDF5_TOOLS_H5DUMP_SOURCE_DIR}/h5dump.c ${HDF5_TOOLS_H5DUMP_SOURCE_DIR}/h5dump_ddl.c ${HDF5_TOOLS_H5DUMP_SOURCE_DIR}/h5dump_xml.c ) TARGET_NAMING (h5dump ${LIB_TYPE}) TARGET_C_PROPERTIES (h5dump " " " ") -TARGET_LINK_LIBRARIES (h5dump ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) -SET_TARGET_PROPERTIES (h5dump PROPERTIES FOLDER tools) +target_link_libraries (h5dump ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) +set_target_properties (h5dump PROPERTIES FOLDER tools) -SET (H5_DEP_EXECUTABLES h5dump) +set (H5_DEP_EXECUTABLES h5dump) -IF (BUILD_TESTING) +if (BUILD_TESTING) # -------------------------------------------------------------------- # Add the h5dump test executable # -------------------------------------------------------------------- - IF (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) - ADD_EXECUTABLE (h5dumpgentest ${HDF5_TOOLS_H5DUMP_SOURCE_DIR}/h5dumpgentest.c) + if (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) + add_executable (h5dumpgentest ${HDF5_TOOLS_H5DUMP_SOURCE_DIR}/h5dumpgentest.c) TARGET_NAMING (h5dumpgentest ${LIB_TYPE}) TARGET_C_PROPERTIES (h5dumpgentest " " " ") - TARGET_LINK_LIBRARIES (h5dumpgentest ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) - SET_TARGET_PROPERTIES (h5dumpgentest PROPERTIES FOLDER generator/tools) + target_link_libraries (h5dumpgentest ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) + set_target_properties (h5dumpgentest PROPERTIES FOLDER generator/tools) #ADD_TEST (NAME h5dumpgentest COMMAND $) - ENDIF (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) + endif (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) - INCLUDE (CMakeTests.cmake) + include (CMakeTests.cmake) - INCLUDE (CMakeTestsPBITS.cmake) + include (CMakeTestsPBITS.cmake) - INCLUDE (CMakeTestsXML.cmake) -ENDIF (BUILD_TESTING) + include (CMakeTestsXML.cmake) +endif (BUILD_TESTING) ############################################################################## ############################################################################## @@ -54,7 +54,7 @@ ENDIF (BUILD_TESTING) #INSTALL_PROGRAM_PDB (h5dump ${HDF5_INSTALL_BIN_DIR} toolsapplications) -INSTALL ( +install ( TARGETS h5dump RUNTIME DESTINATION diff --git a/tools/h5dump/CMakeTests.cmake b/tools/h5dump/CMakeTests.cmake index 13c3d41..486b21c 100644 --- a/tools/h5dump/CMakeTests.cmake +++ b/tools/h5dump/CMakeTests.cmake @@ -8,7 +8,7 @@ # -------------------------------------------------------------------- # Copy all the HDF5 files from the test directory into the source directory # -------------------------------------------------------------------- - SET (HDF5_REFERENCE_FILES + set (HDF5_REFERENCE_FILES ${HDF5_TOOLS_SRC_DIR}/testfiles/charsets.ddl ${HDF5_TOOLS_SRC_DIR}/testfiles/file_space.ddl ${HDF5_TOOLS_SRC_DIR}/testfiles/filter_fail.ddl @@ -173,7 +173,7 @@ ${HDF5_TOOLS_SRC_DIR}/testfiles/out3.h5import ${HDF5_TOOLS_SRC_DIR}/testfiles/zerodim.ddl ) - SET (HDF5_REFERENCE_EXP_FILES + set (HDF5_REFERENCE_EXP_FILES tall-6.exp tnoddlfile.exp trawdatafile.exp @@ -183,7 +183,7 @@ twithddl.exp twithddlfile.exp ) - SET (HDF5_REFERENCE_TEST_FILES + set (HDF5_REFERENCE_TEST_FILES ${HDF5_TOOLS_SRC_DIR}/testfiles/charsets.h5 ${HDF5_TOOLS_SRC_DIR}/testfiles/file_space.h5 ${HDF5_TOOLS_SRC_DIR}/testfiles/filter_fail.h5 @@ -280,7 +280,7 @@ ${HDF5_TOOLS_SRC_DIR}/testfiles/tvms.h5 ${HDF5_TOOLS_SRC_DIR}/testfiles/zerodim.h5 ) - SET (HDF5_ERROR_REFERENCE_TEST_FILES + set (HDF5_ERROR_REFERENCE_TEST_FILES ${PROJECT_SOURCE_DIR}/errfiles/filter_fail.err ${PROJECT_SOURCE_DIR}/errfiles/tall-1.err ${PROJECT_SOURCE_DIR}/errfiles/tall-2A.err @@ -312,77 +312,77 @@ # # copy test files from source dir to test dir # - FOREACH (tst_h5_file ${HDF5_REFERENCE_TEST_FILES}) + foreach (tst_h5_file ${HDF5_REFERENCE_TEST_FILES}) GET_FILENAME_COMPONENT(fname "${tst_h5_file}" NAME) - SET (dest "${PROJECT_BINARY_DIR}/testfiles/std/${fname}") - #MESSAGE (STATUS " Copying ${tst_h5_file}") - ADD_CUSTOM_COMMAND ( + set (dest "${PROJECT_BINARY_DIR}/testfiles/std/${fname}") + #message (STATUS " Copying ${tst_h5_file}") + add_custom_command ( TARGET h5dump POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${tst_h5_file} ${dest} ) - ENDFOREACH (tst_h5_file ${HDF5_REFERENCE_TEST_FILES}) + endforeach (tst_h5_file ${HDF5_REFERENCE_TEST_FILES}) - FOREACH (tst_exp_file ${HDF5_REFERENCE_EXP_FILES}) - IF (WIN32 AND NOT CYGWIN) + foreach (tst_exp_file ${HDF5_REFERENCE_EXP_FILES}) + if (WIN32 AND NOT CYGWIN) FILE (READ ${HDF5_TOOLS_SRC_DIR}/testfiles/${tst_exp_file} TEST_STREAM) FILE (WRITE ${PROJECT_BINARY_DIR}/testfiles/std/${tst_exp_file} "${TEST_STREAM}") - ELSE (WIN32 AND NOT CYGWIN) - ADD_CUSTOM_COMMAND ( + else (WIN32 AND NOT CYGWIN) + add_custom_command ( TARGET h5dump POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${HDF5_TOOLS_SRC_DIR}/testfiles/${tst_exp_file} ${PROJECT_BINARY_DIR}/testfiles/std/${tst_exp_file} ) - ENDIF (WIN32 AND NOT CYGWIN) - ENDFOREACH (tst_exp_file ${HDF5_REFERENCE_EXP_FILES}) + endif (WIN32 AND NOT CYGWIN) + endforeach (tst_exp_file ${HDF5_REFERENCE_EXP_FILES}) - FOREACH (tst_other_file ${HDF5_REFERENCE_FILES}) + foreach (tst_other_file ${HDF5_REFERENCE_FILES}) GET_FILENAME_COMPONENT(fname "${tst_other_file}" NAME) - SET (dest "${PROJECT_BINARY_DIR}/testfiles/std/${fname}") - #MESSAGE (STATUS " Copying ${tst_other_file}") - ADD_CUSTOM_COMMAND ( + set (dest "${PROJECT_BINARY_DIR}/testfiles/std/${fname}") + #message (STATUS " Copying ${tst_other_file}") + add_custom_command ( TARGET h5dump POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${tst_other_file} ${dest} ) - ENDFOREACH (tst_other_file ${HDF5_REFERENCE_FILES}) + endforeach (tst_other_file ${HDF5_REFERENCE_FILES}) - FOREACH (tst_error_file ${HDF5_ERROR_REFERENCE_TEST_FILES}) + foreach (tst_error_file ${HDF5_ERROR_REFERENCE_TEST_FILES}) GET_FILENAME_COMPONENT(fname "${tst_error_file}" NAME) - SET (dest "${PROJECT_BINARY_DIR}/testfiles/std/${fname}") - #MESSAGE (STATUS " Copying ${tst_error_file}") - ADD_CUSTOM_COMMAND ( + set (dest "${PROJECT_BINARY_DIR}/testfiles/std/${fname}") + #message (STATUS " Copying ${tst_error_file}") + add_custom_command ( TARGET h5dump POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${tst_error_file} ${dest} ) - ENDFOREACH (tst_error_file ${HDF5_ERROR_REFERENCE_TEST_FILES}) + endforeach (tst_error_file ${HDF5_ERROR_REFERENCE_TEST_FILES}) # -------------------------------------------------------------------- # Special file handling # -------------------------------------------------------------------- - ADD_CUSTOM_COMMAND ( + add_custom_command ( TARGET h5dump POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${HDF5_TOOLS_SOURCE_DIR}/testfiles/tbin1.ddl ${PROJECT_BINARY_DIR}/testfiles/std/tbin1LE.ddl ) - IF (WIN32 AND NOT CYGWIN) + if (WIN32 AND NOT CYGWIN) FILE (READ ${HDF5_TOOLS_SRC_DIR}/testfiles/tbinregR.exp TEST_STREAM) FILE (WRITE ${PROJECT_BINARY_DIR}/testfiles/std/tbinregR.exp "${TEST_STREAM}") - ELSE (WIN32 AND NOT CYGWIN) - ADD_CUSTOM_COMMAND ( + else (WIN32 AND NOT CYGWIN) + add_custom_command ( TARGET h5dump POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${HDF5_TOOLS_SRC_DIR}/testfiles/tbinregR.exp ${PROJECT_BINARY_DIR}/testfiles/std/tbinregR.exp ) - ENDIF (WIN32 AND NOT CYGWIN) + endif (WIN32 AND NOT CYGWIN) ############################################################################## ############################################################################## @@ -392,14 +392,14 @@ MACRO (ADD_HELP_TEST testname resultcode) # If using memchecker add tests without using scripts - IF (HDF5_ENABLE_USING_MEMCHECKER) + if (HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST (NAME H5DUMP-${testname} COMMAND $ ${ARGN}) SET_TESTS_PROPERTIES (H5DUMP-${testname} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") - IF (NOT "${last_test}" STREQUAL "") + if (NOT "${last_test}" STREQUAL "") SET_TESTS_PROPERTIES (H5DUMP-${testname} PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "H5DUMP-${testname}") - ELSE (HDF5_ENABLE_USING_MEMCHECKER) + endif (NOT "${last_test}" STREQUAL "") + set (last_test "H5DUMP-${testname}") + else (HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( NAME H5DUMP-h5dump-${testname}-clear-objects COMMAND ${CMAKE_COMMAND} @@ -418,34 +418,34 @@ -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) SET_TESTS_PROPERTIES (H5DUMP-h5dump-${testname} PROPERTIES DEPENDS "H5DUMP-h5dump-${testname}-clear-objects") - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) + endif (HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (ADD_HELP_TEST) MACRO (ADD_SKIP_H5_TEST skipresultfile skipresultcode testtype) - IF (${testtype} STREQUAL "SKIP") - IF (NOT HDF5_ENABLE_USING_MEMCHECKER) + if (${testtype} STREQUAL "SKIP") + if (NOT HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( NAME H5DUMP-${skipresultfile}-SKIPPED COMMAND ${CMAKE_COMMAND} -E echo "SKIP ${skipresultfile} ${ARGN}" ) - ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) - ELSE (${testtype} STREQUAL "SKIP") + endif (NOT HDF5_ENABLE_USING_MEMCHECKER) + else (${testtype} STREQUAL "SKIP") ADD_H5_TEST (${skipresultfile} ${skipresultcode} ${ARGN}) - ENDIF (${testtype} STREQUAL "SKIP") + endif (${testtype} STREQUAL "SKIP") ENDMACRO (ADD_SKIP_H5_TEST) MACRO (ADD_H5_TEST resultfile resultcode) # If using memchecker add tests without using scripts - IF (HDF5_ENABLE_USING_MEMCHECKER) + if (HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST (NAME H5DUMP-${resultfile} COMMAND $ ${ARGN}) SET_TESTS_PROPERTIES (H5DUMP-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") - IF (NOT ${resultcode} STREQUAL "0") + if (NOT ${resultcode} STREQUAL "0") SET_TESTS_PROPERTIES (H5DUMP-${resultfile} PROPERTIES WILL_FAIL "true") - ENDIF (NOT ${resultcode} STREQUAL "0") - IF (NOT "${last_test}" STREQUAL "") + 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) + endif (NOT "${last_test}" STREQUAL "") + else (HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( NAME H5DUMP-${resultfile}-clear-objects COMMAND ${CMAKE_COMMAND} @@ -464,21 +464,21 @@ -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) SET_TESTS_PROPERTIES (H5DUMP-${resultfile} PROPERTIES DEPENDS "H5DUMP-${resultfile}-clear-objects") - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) + endif (HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (ADD_H5_TEST file) MACRO (ADD_H5_TEST_N resultfile resultcode) # If using memchecker add tests without using scripts - IF (HDF5_ENABLE_USING_MEMCHECKER) + if (HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST (NAME H5DUMP-N-${resultfile} COMMAND $ ${ARGN}) SET_TESTS_PROPERTIES (H5DUMP-N-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") - IF (NOT ${resultcode} STREQUAL "0") + if (NOT ${resultcode} STREQUAL "0") SET_TESTS_PROPERTIES (H5DUMP-N-${resultfile} PROPERTIES WILL_FAIL "true") - ENDIF (NOT ${resultcode} STREQUAL "0") - IF (NOT "${last_test}" STREQUAL "") + endif (NOT ${resultcode} STREQUAL "0") + if (NOT "${last_test}" STREQUAL "") SET_TESTS_PROPERTIES (H5DUMP-N-${resultfile} PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - ELSE (HDF5_ENABLE_USING_MEMCHECKER) + endif (NOT "${last_test}" STREQUAL "") + else (HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( NAME H5DUMP-N-${resultfile}-clear-objects COMMAND ${CMAKE_COMMAND} @@ -497,21 +497,21 @@ -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) SET_TESTS_PROPERTIES (H5DUMP-N-${resultfile} PROPERTIES DEPENDS "H5DUMP-N-${resultfile}-clear-objects") - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) + endif (HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (ADD_H5_TEST_N file) MACRO (ADD_H5_TEST_EXPORT resultfile targetfile resultcode) # If using memchecker add tests without using scripts - IF (HDF5_ENABLE_USING_MEMCHECKER) + if (HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST (NAME H5DUMP-${resultfile} COMMAND $ ${ARGN} ${resultfile}.txt ${targetfile}) SET_TESTS_PROPERTIES (H5DUMP-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") - IF (NOT ${resultcode} STREQUAL "0") + if (NOT ${resultcode} STREQUAL "0") SET_TESTS_PROPERTIES (H5DUMP-${resultfile} PROPERTIES WILL_FAIL "true") - ENDIF (NOT ${resultcode} STREQUAL "0") - IF (NOT "${last_test}" STREQUAL "") + 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) + endif (NOT "${last_test}" STREQUAL "") + else (HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( NAME H5DUMP-${resultfile}-clear-objects COMMAND ${CMAKE_COMMAND} @@ -537,21 +537,21 @@ ) 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) + 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) + 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") + if (NOT ${resultcode} STREQUAL "0") SET_TESTS_PROPERTIES (H5DUMP-${resultfile} PROPERTIES WILL_FAIL "true") - ENDIF (NOT ${resultcode} STREQUAL "0") - IF (NOT "${last_test}" STREQUAL "") + 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) + endif (NOT "${last_test}" STREQUAL "") + else (HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( NAME H5DUMP-${resultfile}-clear-objects COMMAND ${CMAKE_COMMAND} @@ -584,11 +584,11 @@ ) 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) + endif (HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (ADD_H5_TEST_EXPORT_DDL file) MACRO (ADD_H5_EXPORT_TEST resultfile targetfile resultcode) - IF (NOT HDF5_ENABLE_USING_MEMCHECKER) + if (NOT HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( NAME H5DUMP-output-${resultfile}-clear-objects COMMAND ${CMAKE_COMMAND} @@ -608,11 +608,11 @@ ) 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-output-${resultfile}) - ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) + 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) + if (NOT HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( NAME H5DUMP-${resultfile}-clear-objects COMMAND ${CMAKE_COMMAND} @@ -632,11 +632,11 @@ -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) SET_TESTS_PROPERTIES (H5DUMP-${resultfile} PROPERTIES DEPENDS "H5DUMP-${resultfile}-clear-objects") - ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) + 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) + if (NOT HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( NAME H5DUMP-${resultfile}-clear-objects COMMAND ${CMAKE_COMMAND} @@ -657,11 +657,11 @@ -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) SET_TESTS_PROPERTIES (H5DUMP-${resultfile} PROPERTIES DEPENDS "H5DUMP-${resultfile}-clear-objects") - ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) + 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) + if (NOT HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( NAME H5DUMP-${resultfile}-clear-objects COMMAND ${CMAKE_COMMAND} @@ -684,12 +684,12 @@ -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) SET_TESTS_PROPERTIES (H5DUMP-${resultfile} PROPERTIES DEPENDS "H5DUMP-${resultfile}-clear-objects") - ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) + endif (NOT HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (ADD_H5ERR_MASK_ENV_TEST) MACRO (ADD_H5_TEST_IMPORT conffile resultfile testfile resultcode) # If using memchecker add tests without using scripts - IF (NOT HDF5_ENABLE_USING_MEMCHECKER) + if (NOT HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( NAME H5DUMP-IMPORT-${resultfile}-clear-objects COMMAND ${CMAKE_COMMAND} @@ -714,7 +714,7 @@ 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) + endif (NOT HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (ADD_H5_TEST_IMPORT file) ############################################################################## @@ -723,7 +723,7 @@ ############################################################################## ############################################################################## - IF (HDF5_ENABLE_USING_MEMCHECKER) + if (HDF5_ENABLE_USING_MEMCHECKER) # Remove any output file left over from previous test run ADD_TEST ( NAME H5DUMP-clearall-objects @@ -1053,11 +1053,11 @@ zerodim.out.err ) SET_TESTS_PROPERTIES (H5DUMP-clearall-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") - IF (NOT "${last_test}" STREQUAL "") + if (NOT "${last_test}" STREQUAL "") SET_TESTS_PROPERTIES (H5DUMP-clearall-objects PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "H5DUMP-clearall-objects") - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) + endif (NOT "${last_test}" STREQUAL "") + set (last_test "H5DUMP-clearall-objects") + endif (HDF5_ENABLE_USING_MEMCHECKER) ADD_HELP_TEST(help 0 -h) @@ -1326,38 +1326,38 @@ # filters are defined. # detect whether the encoder is present. - IF (H5_HAVE_FILTER_DEFLATE) - SET (USE_FILTER_DEFLATE "true") - ENDIF (H5_HAVE_FILTER_DEFLATE) + if (H5_HAVE_FILTER_DEFLATE) + set (USE_FILTER_DEFLATE "true") + endif (H5_HAVE_FILTER_DEFLATE) - IF (H5_HAVE_FILTER_SZIP) - SET (USE_FILTER_SZIP "true") - ENDIF (H5_HAVE_FILTER_SZIP) + if (H5_HAVE_FILTER_SZIP) + set (USE_FILTER_SZIP "true") + endif (H5_HAVE_FILTER_SZIP) - IF (H5_HAVE_FILTER_SHUFFLE) - SET (USE_FILTER_SHUFFLE "true") - ENDIF (H5_HAVE_FILTER_SHUFFLE) + if (H5_HAVE_FILTER_SHUFFLE) + set (USE_FILTER_SHUFFLE "true") + endif (H5_HAVE_FILTER_SHUFFLE) - IF (H5_HAVE_FILTER_FLETCHER32) - SET (USE_FILTER_FLETCHER32 "true") - ENDIF (H5_HAVE_FILTER_FLETCHER32) + if (H5_HAVE_FILTER_FLETCHER32) + set (USE_FILTER_FLETCHER32 "true") + endif (H5_HAVE_FILTER_FLETCHER32) - IF (H5_HAVE_FILTER_NBIT) - SET (USE_FILTER_NBIT "true") - ENDIF (H5_HAVE_FILTER_NBIT) + if (H5_HAVE_FILTER_NBIT) + set (USE_FILTER_NBIT "true") + endif (H5_HAVE_FILTER_NBIT) - IF (H5_HAVE_FILTER_SCALEOFFSET) - SET (USE_FILTER_SCALEOFFSET "true") - ENDIF (H5_HAVE_FILTER_SCALEOFFSET) + if (H5_HAVE_FILTER_SCALEOFFSET) + set (USE_FILTER_SCALEOFFSET "true") + endif (H5_HAVE_FILTER_SCALEOFFSET) - IF (USE_FILTER_DEFLATE AND USE_FILTER_SHUFFLE AND USE_FILTER_FLETCHER32 AND USE_FILTER_NBIT AND USE_FILTER_SCALEOFFSET) + if (USE_FILTER_DEFLATE AND USE_FILTER_SHUFFLE AND USE_FILTER_FLETCHER32 AND USE_FILTER_NBIT AND USE_FILTER_SCALEOFFSET) # data read internal filters ADD_H5_TEST (treadintfilter 0 --enable-error-stack -d deflate -d shuffle -d fletcher32 -d nbit -d scaleoffset tfilters.h5) - IF (HDF5_ENABLE_SZIP_SUPPORT) + if (HDF5_ENABLE_SZIP_SUPPORT) # data read all filters ADD_H5_TEST (treadfilter 0 --enable-error-stack -d all -d szip tfilters.h5) - ENDIF (HDF5_ENABLE_SZIP_SUPPORT) - ENDIF (USE_FILTER_DEFLATE AND USE_FILTER_SHUFFLE AND USE_FILTER_FLETCHER32 AND USE_FILTER_NBIT AND USE_FILTER_SCALEOFFSET) + endif (HDF5_ENABLE_SZIP_SUPPORT) + endif (USE_FILTER_DEFLATE AND USE_FILTER_SHUFFLE AND USE_FILTER_FLETCHER32 AND USE_FILTER_NBIT AND USE_FILTER_SCALEOFFSET) # test for displaying objects with very long names ADD_H5_TEST (tlonglinks 0 --enable-error-stack tlonglinks.h5) @@ -1390,16 +1390,16 @@ # NATIVE default. the NATIVE test can be validated with h5import/h5diff ADD_H5_TEST_IMPORT (tbin1 out1D tbinary.h5 0 --enable-error-stack -d integer -b) - IF (NOT HDF5_ENABLE_USING_MEMCHECKER) + if (NOT HDF5_ENABLE_USING_MEMCHECKER) ADD_H5_TEST (tbin2 0 --enable-error-stack -b BE -d float -o tbin2.bin tbinary.h5) - ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) + endif (NOT HDF5_ENABLE_USING_MEMCHECKER) # the NATIVE test can be validated with h5import/h5diff ADD_H5_TEST_IMPORT (tbin3 out3D tbinary.h5 0 --enable-error-stack -d integer -b NATIVE) - IF (NOT HDF5_ENABLE_USING_MEMCHECKER) + if (NOT HDF5_ENABLE_USING_MEMCHECKER) ADD_H5_TEST (tbin4 0 --enable-error-stack -d double -b FILE -o tbin4.bin tbinary.h5) - ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) + endif (NOT HDF5_ENABLE_USING_MEMCHECKER) # test for dataset region references ADD_H5_TEST (tdatareg 0 --enable-error-stack tdatareg.h5) diff --git a/tools/h5dump/CMakeTestsPBITS.cmake b/tools/h5dump/CMakeTestsPBITS.cmake index baa1705..3a279b5 100644 --- a/tools/h5dump/CMakeTestsPBITS.cmake +++ b/tools/h5dump/CMakeTestsPBITS.cmake @@ -9,7 +9,7 @@ # Packed Bits # -------------------------------------------------------------------- #-- Copy all the HDF5 files from the test directory into the source directory - SET (HDF5_REFERENCE_PBITS + set (HDF5_REFERENCE_PBITS ${HDF5_TOOLS_SRC_DIR}/testfiles/tnofilename-with-packed-bits.ddl ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsArray.ddl ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsCompound.ddl @@ -64,12 +64,12 @@ ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsSignedLongLong16.ddl ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsUnsignedLongLong16.ddl ) - SET (HDF5_REFERENCE_TEST_PBITS + set (HDF5_REFERENCE_TEST_PBITS ${HDF5_TOOLS_SRC_DIR}/testfiles/packedbits.h5 ${HDF5_TOOLS_SRC_DIR}/testfiles/tarray1.h5 ${HDF5_TOOLS_SRC_DIR}/testfiles/tcompound.h5 ) - SET (HDF5_ERROR_REFERENCE_PBITS + set (HDF5_ERROR_REFERENCE_PBITS ${PROJECT_SOURCE_DIR}/errfiles/tnofilename-with-packed-bits.err ${PROJECT_SOURCE_DIR}/errfiles/tpbitsCharLengthExceeded.err ${PROJECT_SOURCE_DIR}/errfiles/tpbitsCharOffsetExceeded.err @@ -85,42 +85,42 @@ ${PROJECT_SOURCE_DIR}/errfiles/tpbitsOffsetNegative.err ) - FOREACH (pbits_h5_file ${HDF5_REFERENCE_TEST_PBITS}) + foreach (pbits_h5_file ${HDF5_REFERENCE_TEST_PBITS}) GET_FILENAME_COMPONENT(fname "${pbits_h5_file}" NAME) - SET (dest "${PROJECT_BINARY_DIR}/testfiles/pbits/${fname}") - #MESSAGE (STATUS " Copying ${pbits_h5_file}") - ADD_CUSTOM_COMMAND ( + set (dest "${PROJECT_BINARY_DIR}/testfiles/pbits/${fname}") + #message (STATUS " Copying ${pbits_h5_file}") + add_custom_command ( TARGET h5dump POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${pbits_h5_file} ${dest} ) - ENDFOREACH (pbits_h5_file ${HDF5_REFERENCE_TEST_PBITS}) + endforeach (pbits_h5_file ${HDF5_REFERENCE_TEST_PBITS}) - FOREACH (ddl_pbits ${HDF5_REFERENCE_PBITS}) + foreach (ddl_pbits ${HDF5_REFERENCE_PBITS}) GET_FILENAME_COMPONENT(fname "${ddl_pbits}" NAME) - SET (ddldest "${PROJECT_BINARY_DIR}/testfiles/pbits/${fname}") - #MESSAGE (STATUS " Copying ${ddl_pbits}") - ADD_CUSTOM_COMMAND ( + set (ddldest "${PROJECT_BINARY_DIR}/testfiles/pbits/${fname}") + #message (STATUS " Copying ${ddl_pbits}") + add_custom_command ( TARGET h5dump POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${ddl_pbits} ${ddldest} ) - ENDFOREACH (ddl_pbits ${HDF5_REFERENCE_PBITS}) + endforeach (ddl_pbits ${HDF5_REFERENCE_PBITS}) - FOREACH (ddl_pbits ${HDF5_ERROR_REFERENCE_PBITS}) + foreach (ddl_pbits ${HDF5_ERROR_REFERENCE_PBITS}) GET_FILENAME_COMPONENT(fname "${ddl_pbits}" NAME) - SET (ddldest "${PROJECT_BINARY_DIR}/testfiles/pbits/${fname}") - #MESSAGE (STATUS " Copying ${ddl_pbits}") - ADD_CUSTOM_COMMAND ( + set (ddldest "${PROJECT_BINARY_DIR}/testfiles/pbits/${fname}") + #message (STATUS " Copying ${ddl_pbits}") + add_custom_command ( TARGET h5dump POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${ddl_pbits} ${ddldest} ) - ENDFOREACH (ddl_pbits ${HDF5_ERROR_REFERENCE_PBITS}) + endforeach (ddl_pbits ${HDF5_ERROR_REFERENCE_PBITS}) ############################################################################## ############################################################################## @@ -130,16 +130,16 @@ MACRO (ADD_H5_PBITS_TEST resultfile resultcode) # If using memchecker add tests without using scripts - IF (HDF5_ENABLE_USING_MEMCHECKER) + if (HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST (NAME H5DUMP-${resultfile} COMMAND $ ${ARGN}) SET_TESTS_PROPERTIES (H5DUMP-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/pbits") - IF (NOT ${resultcode} STREQUAL "0") + if (NOT ${resultcode} STREQUAL "0") SET_TESTS_PROPERTIES (H5DUMP-${resultfile} PROPERTIES WILL_FAIL "true") - ENDIF (NOT ${resultcode} STREQUAL "0") - IF (NOT "${last_pbits_test}" STREQUAL "") + endif (NOT ${resultcode} STREQUAL "0") + 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) + endif (NOT "${last_pbits_test}" STREQUAL "") + else (HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( NAME H5DUMP-${resultfile}-clear-objects COMMAND ${CMAKE_COMMAND} @@ -158,7 +158,7 @@ -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) SET_TESTS_PROPERTIES (H5DUMP-${resultfile} PROPERTIES DEPENDS "H5DUMP-${resultfile}-clear-objects") - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) + endif (HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (ADD_H5_PBITS_TEST file) ############################################################################## @@ -167,7 +167,7 @@ ############################################################################## ############################################################################## - IF (HDF5_ENABLE_USING_MEMCHECKER) + if (HDF5_ENABLE_USING_MEMCHECKER) # Remove any output file left over from previous test run ADD_TEST ( NAME H5DUMP_PACKED_BITS-clearall-objects @@ -281,11 +281,11 @@ tpbitsUnsignedLongLong16.out.err ) SET_TESTS_PROPERTIES (H5DUMP_PACKED_BITS-clearall-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/pbits") - IF (NOT "${last_pbits_test}" STREQUAL "") + 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) + endif (NOT "${last_pbits_test}" STREQUAL "") + set (last_pbits_test "H5DUMP_PACKED_BITS-clearall-objects") + endif (HDF5_ENABLE_USING_MEMCHECKER) # test failure handling # Missing file name diff --git a/tools/h5dump/CMakeTestsXML.cmake b/tools/h5dump/CMakeTestsXML.cmake index 6c9cae1..ce7fdf7 100644 --- a/tools/h5dump/CMakeTestsXML.cmake +++ b/tools/h5dump/CMakeTestsXML.cmake @@ -8,7 +8,7 @@ # # copy XML test files from source dir to test dir # - SET (HDF5_XML_REFERENCE_TEST_FILES + set (HDF5_XML_REFERENCE_TEST_FILES ${HDF5_TOOLS_SRC_DIR}/testfiles/tall.h5 ${HDF5_TOOLS_SRC_DIR}/testfiles/tarray1.h5 ${HDF5_TOOLS_SRC_DIR}/testfiles/tarray2.h5 @@ -61,7 +61,7 @@ ${HDF5_TOOLS_SRC_DIR}/testfiles/tvldtypes5.h5 ${HDF5_TOOLS_SRC_DIR}/testfiles/tvlstr.h5 ) - SET (HDF5_XML_REFERENCE_FILES + set (HDF5_XML_REFERENCE_FILES ${HDF5_TOOLS_SRC_DIR}/testfiles/tall.h5.xml ${HDF5_TOOLS_SRC_DIR}/testfiles/tall-2A.h5.xml ${HDF5_TOOLS_SRC_DIR}/testfiles/tarray1.h5.xml @@ -127,29 +127,29 @@ ${HDF5_TOOLS_SRC_DIR}/testfiles/tvlstr.h5.xml ) - FOREACH (tst_xml_h5_file ${HDF5_XML_REFERENCE_TEST_FILES}) + foreach (tst_xml_h5_file ${HDF5_XML_REFERENCE_TEST_FILES}) GET_FILENAME_COMPONENT(fname "${tst_xml_h5_file}" NAME) - SET (dest "${PROJECT_BINARY_DIR}/testfiles/xml/${fname}") - #MESSAGE (STATUS " Copying ${tst_xml_h5_file}") - ADD_CUSTOM_COMMAND ( + set (dest "${PROJECT_BINARY_DIR}/testfiles/xml/${fname}") + #message (STATUS " Copying ${tst_xml_h5_file}") + add_custom_command ( TARGET h5dump POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${tst_xml_h5_file} ${dest} ) - ENDFOREACH (tst_xml_h5_file ${HDF5_XML_REFERENCE_TEST_FILES}) + endforeach (tst_xml_h5_file ${HDF5_XML_REFERENCE_TEST_FILES}) - FOREACH (tst_xml_other_file ${HDF5_XML_REFERENCE_FILES}) + foreach (tst_xml_other_file ${HDF5_XML_REFERENCE_FILES}) GET_FILENAME_COMPONENT(fname "${tst_xml_other_file}" NAME) - SET (dest "${PROJECT_BINARY_DIR}/testfiles/xml/${fname}") - #MESSAGE (STATUS " Copying ${tst_xml_other_file}") - ADD_CUSTOM_COMMAND ( + set (dest "${PROJECT_BINARY_DIR}/testfiles/xml/${fname}") + #message (STATUS " Copying ${tst_xml_other_file}") + add_custom_command ( TARGET h5dump POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${tst_xml_other_file} ${dest} ) - ENDFOREACH (tst_xml_other_file ${HDF5_XML_REFERENCE_FILES}) + endforeach (tst_xml_other_file ${HDF5_XML_REFERENCE_FILES}) ############################################################################## ############################################################################## @@ -158,29 +158,29 @@ ############################################################################## MACRO (ADD_XML_SKIP_H5_TEST skipresultfile skipresultcode testtype) - IF (${testtype} STREQUAL "SKIP") - IF (NOT HDF5_ENABLE_USING_MEMCHECKER) + if (${testtype} STREQUAL "SKIP") + if (NOT HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( NAME H5DUMP-XML-${skipresultfile}-SKIPPED COMMAND ${CMAKE_COMMAND} -E echo "SKIP ${skipresultfile}.xml --xml ${ARGN}" ) - ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) - ELSE (${testtype} STREQUAL "SKIP") + endif (NOT HDF5_ENABLE_USING_MEMCHECKER) + else (${testtype} STREQUAL "SKIP") ADD_XML_H5_TEST (${skipresultfile} ${skipresultcode} ${ARGN}) - ENDIF (${testtype} STREQUAL "SKIP") + endif (${testtype} STREQUAL "SKIP") ENDMACRO (ADD_XML_SKIP_H5_TEST) MACRO (ADD_XML_H5_TEST resultfile resultcode) - IF (HDF5_ENABLE_USING_MEMCHECKER) + if (HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST (NAME H5DUMP-XML-${resultfile} COMMAND $ --xml ${ARGN}) SET_TESTS_PROPERTIES (H5DUMP-XML-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/xml") - IF (NOT ${resultcode} STREQUAL "0") + if (NOT ${resultcode} STREQUAL "0") SET_TESTS_PROPERTIES (H5DUMP-XML-${resultfile} PROPERTIES WILL_FAIL "true") - ENDIF (NOT ${resultcode} STREQUAL "0") - IF (NOT "${last_xml_test}" STREQUAL "") + endif (NOT ${resultcode} STREQUAL "0") + 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) + endif (NOT "${last_xml_test}" STREQUAL "") + else (HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( NAME H5DUMP-XML-${resultfile}-clear-objects COMMAND ${CMAKE_COMMAND} @@ -199,7 +199,7 @@ -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) SET_TESTS_PROPERTIES (H5DUMP-XML-${resultfile} PROPERTIES DEPENDS "H5DUMP-XML-${resultfile}-clear-objects") - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) + endif (HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (ADD_XML_H5_TEST file) ############################################################################## @@ -208,7 +208,7 @@ ############################################################################## ############################################################################## - IF (HDF5_ENABLE_USING_MEMCHECKER) + if (HDF5_ENABLE_USING_MEMCHECKER) # Remove any output file left over from previous test run ADD_TEST ( NAME H5DUMP-XML-clearall-objects @@ -344,11 +344,11 @@ tvlstr.h5.out.err ) SET_TESTS_PROPERTIES (H5DUMP-XML-clearall-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/xml") - IF (NOT "${last_xml_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) + endif (NOT "${last_xml_test}" STREQUAL "") + set (last_test "H5DUMP-XML-clearall-objects") + endif (HDF5_ENABLE_USING_MEMCHECKER) ########## test XML ADD_XML_H5_TEST (tall.h5 0 tall.h5) @@ -413,10 +413,10 @@ # The lone colon here confuses some systems (Cray X1). Skip # it if configure detects that this is a problem. - SET (TESTTYPE "TEST") - IF (NOT "H5_LONE_COLON") - SET (TESTTYPE "SKIP") - ENDIF (NOT "H5_LONE_COLON") + set (TESTTYPE "TEST") + if (NOT "H5_LONE_COLON") + set (TESTTYPE "SKIP") + endif (NOT "H5_LONE_COLON") ADD_XML_SKIP_H5_TEST (tempty-nons.h5 0 ${TESTTYPE} -X : tempty.h5) ADD_XML_H5_TEST (tempty-nons-2.h5 0 --xml-ns=: tempty.h5) diff --git a/tools/h5import/CMakeLists.txt b/tools/h5import/CMakeLists.txt index 7caf44a..32dff55 100644 --- a/tools/h5import/CMakeLists.txt +++ b/tools/h5import/CMakeLists.txt @@ -9,28 +9,28 @@ INCLUDE_DIRECTORIES (${HDF5_TOOLS_SRC_DIR}/lib) # -------------------------------------------------------------------- # Add the h5import executables # -------------------------------------------------------------------- -ADD_EXECUTABLE (h5import ${HDF5_TOOLS_H5IMPORT_SOURCE_DIR}/h5import.c) +add_executable (h5import ${HDF5_TOOLS_H5IMPORT_SOURCE_DIR}/h5import.c) TARGET_NAMING (h5import ${LIB_TYPE}) TARGET_C_PROPERTIES (h5import " " " ") -TARGET_LINK_LIBRARIES (h5import ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) -#SET_TARGET_PROPERTIES (h5import PROPERTIES COMPILE_DEFINITIONS H5DEBUGIMPORT) -SET_TARGET_PROPERTIES (h5import PROPERTIES FOLDER tools) +target_link_libraries (h5import ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) +#set_target_properties (h5import PROPERTIES COMPILE_DEFINITIONS H5DEBUGIMPORT) +set_target_properties (h5import PROPERTIES FOLDER tools) -SET (H5_DEP_EXECUTABLES h5import) +set (H5_DEP_EXECUTABLES h5import) -IF (BUILD_TESTING) +if (BUILD_TESTING) # -------------------------------------------------------------------- # Add the h5import executables # -------------------------------------------------------------------- - ADD_EXECUTABLE (h5importtest ${HDF5_TOOLS_H5IMPORT_SOURCE_DIR}/h5importtest.c) + add_executable (h5importtest ${HDF5_TOOLS_H5IMPORT_SOURCE_DIR}/h5importtest.c) TARGET_NAMING (h5importtest ${LIB_TYPE}) TARGET_C_PROPERTIES (h5importtest " " " ") - TARGET_LINK_LIBRARIES (h5importtest ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) - SET_TARGET_PROPERTIES (h5importtest PROPERTIES FOLDER tools) + target_link_libraries (h5importtest ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) + set_target_properties (h5importtest PROPERTIES FOLDER tools) - INCLUDE (CMakeTests.cmake) + include (CMakeTests.cmake) -ENDIF (BUILD_TESTING) +endif (BUILD_TESTING) ############################################################################## ############################################################################## @@ -44,7 +44,7 @@ ENDIF (BUILD_TESTING) #INSTALL_PROGRAM_PDB (h5import ${HDF5_INSTALL_BIN_DIR} toolsapplications) -INSTALL ( +install ( TARGETS h5import RUNTIME DESTINATION diff --git a/tools/h5import/CMakeTests.cmake b/tools/h5import/CMakeTests.cmake index 96cca87..3250910 100644 --- a/tools/h5import/CMakeTests.cmake +++ b/tools/h5import/CMakeTests.cmake @@ -5,7 +5,7 @@ ############################################################################## ############################################################################## - SET (HDF5_REFERENCE_CONF_FILES + set (HDF5_REFERENCE_CONF_FILES binfp64.conf binin8.conf binin8w.conf @@ -23,7 +23,7 @@ textpfe.conf txtstr.conf ) - SET (HDF5_REFERENCE_TXT_FILES + set (HDF5_REFERENCE_TXT_FILES txtfp32.txt txtfp64.txt txtuin16.txt @@ -42,7 +42,7 @@ dbinuin32.h5.txt dtxtstr.h5.txt ) - SET (HDF5_REFERENCE_TEST_FILES + set (HDF5_REFERENCE_TEST_FILES binfp64.h5 binin8.h5 binin8w.h5 @@ -62,38 +62,38 @@ ) FILE (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") - FOREACH (conf_file ${HDF5_REFERENCE_CONF_FILES}) - SET (dest "${PROJECT_BINARY_DIR}/testfiles/${conf_file}") - #MESSAGE (STATUS " Copying ${conf_file}") - ADD_CUSTOM_COMMAND ( + foreach (conf_file ${HDF5_REFERENCE_CONF_FILES}) + set (dest "${PROJECT_BINARY_DIR}/testfiles/${conf_file}") + #message (STATUS " Copying ${conf_file}") + add_custom_command ( TARGET h5import POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${HDF5_TOOLS_H5IMPORT_SOURCE_DIR}/testfiles/${conf_file} ${dest} ) - ENDFOREACH (conf_file ${HDF5_REFERENCE_CONF_FILES}) + endforeach (conf_file ${HDF5_REFERENCE_CONF_FILES}) - FOREACH (txt_file ${HDF5_REFERENCE_TXT_FILES}) - SET (dest "${PROJECT_BINARY_DIR}/testfiles/${txt_file}") - #MESSAGE (STATUS " Copying ${txt_file}") - ADD_CUSTOM_COMMAND ( + foreach (txt_file ${HDF5_REFERENCE_TXT_FILES}) + set (dest "${PROJECT_BINARY_DIR}/testfiles/${txt_file}") + #message (STATUS " Copying ${txt_file}") + add_custom_command ( TARGET h5import POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${HDF5_TOOLS_H5IMPORT_SOURCE_DIR}/testfiles/${txt_file} ${dest} ) - ENDFOREACH (txt_file ${HDF5_REFERENCE_TXT_FILES}) + endforeach (txt_file ${HDF5_REFERENCE_TXT_FILES}) - FOREACH (h5_file ${HDF5_REFERENCE_TEST_FILES}) - SET (dest "${PROJECT_BINARY_DIR}/testfiles/${h5_file}") - #MESSAGE (STATUS " Copying ${h5_file}") - ADD_CUSTOM_COMMAND ( + foreach (h5_file ${HDF5_REFERENCE_TEST_FILES}) + set (dest "${PROJECT_BINARY_DIR}/testfiles/${h5_file}") + #message (STATUS " Copying ${h5_file}") + add_custom_command ( TARGET h5import POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${HDF5_TOOLS_H5IMPORT_SOURCE_DIR}/testfiles/${h5_file} ${dest} ) - ENDFOREACH (h5_file ${HDF5_REFERENCE_TEST_FILES}) + endforeach (h5_file ${HDF5_REFERENCE_TEST_FILES}) ############################################################################## ############################################################################## @@ -102,12 +102,12 @@ ############################################################################## MACRO (ADD_H5_TEST testname importfile conffile testfile) # If using memchecker skip macro based tests - IF (HDF5_ENABLE_USING_MEMCHECKER) + if (HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST (NAME H5IMPORT-${testname} COMMAND $ ${importfile} -c ${conffile} -o ${testfile}) - IF (NOT "${last_test}" STREQUAL "") + if (NOT "${last_test}" STREQUAL "") SET_TESTS_PROPERTIES (H5IMPORT-${testname} PROPERTIES DEPENDS H5IMPORT-h5importtest) - ENDIF (NOT "${last_test}" STREQUAL "") - ELSE (HDF5_ENABLE_USING_MEMCHECKER) + endif (NOT "${last_test}" STREQUAL "") + else (HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( NAME H5IMPORT-${testname}-clear-objects COMMAND ${CMAKE_COMMAND} @@ -149,12 +149,12 @@ -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) SET_TESTS_PROPERTIES (H5IMPORT-${testname}-H5DMP_CMP PROPERTIES DEPENDS H5IMPORT-${testname}-H5DMP) - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) + endif (HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (ADD_H5_TEST testname importfile conffile testfile) MACRO (ADD_H5_DUMPTEST testname datasetname testfile) # If using memchecker skip tests - IF (NOT HDF5_ENABLE_USING_MEMCHECKER) + if (NOT HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( NAME H5IMPORT-DUMP-${testname}-clear-objects COMMAND ${CMAKE_COMMAND} @@ -170,7 +170,7 @@ ) SET_TESTS_PROPERTIES (H5IMPORT-DUMP-${testname}-clear-objects PROPERTIES DEPENDS H5IMPORT-h5importtest) - IF ("${ARGN}" STREQUAL "BINARY") + if ("${ARGN}" STREQUAL "BINARY") ADD_TEST ( NAME H5IMPORT-DUMP-${testname}-H5DMP COMMAND "${CMAKE_COMMAND}" @@ -182,7 +182,7 @@ -D "TEST_SKIP_COMPARE=TRUE" -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) - ELSE ("${ARGN}" STREQUAL "BINARY") + else ("${ARGN}" STREQUAL "BINARY") ADD_TEST ( NAME H5IMPORT-DUMP-${testname}-H5DMP COMMAND "${CMAKE_COMMAND}" @@ -194,7 +194,7 @@ -D "TEST_SKIP_COMPARE=TRUE" -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) - ENDIF ("${ARGN}" STREQUAL "BINARY") + endif ("${ARGN}" STREQUAL "BINARY") SET_TESTS_PROPERTIES (H5IMPORT-DUMP-${testname}-H5DMP PROPERTIES DEPENDS "H5IMPORT-DUMP-${testname}-clear-objects") ADD_TEST ( @@ -223,24 +223,24 @@ -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) SET_TESTS_PROPERTIES (H5IMPORT-DUMP-${testname}-H5DFF PROPERTIES DEPENDS "H5IMPORT-DUMP-${testname}") - ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) + endif (NOT HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (ADD_H5_DUMPTEST testname datasetname testfile) MACRO (ADD_H5_SKIP_DUMPTEST testname datasetname testfile) - IF (NOT HDF5_ENABLE_USING_MEMCHECKER) + 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) + endif (NOT HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (ADD_H5_SKIP_DUMPTEST testname datasetname testfile) # -------------------------------------------------------------------- # Determine if filter is available for h5diff # -------------------------------------------------------------------- - IF (H5_HAVE_FILTER_DEFLATE) - SET (USE_FILTER_DEFLATE "true") - ENDIF (H5_HAVE_FILTER_DEFLATE) + if (H5_HAVE_FILTER_DEFLATE) + set (USE_FILTER_DEFLATE "true") + endif (H5_HAVE_FILTER_DEFLATE) ############################################################################## ############################################################################## @@ -248,7 +248,7 @@ ############################################################################## ############################################################################## - IF (HDF5_ENABLE_USING_MEMCHECKER) + if (HDF5_ENABLE_USING_MEMCHECKER) # Remove any output file left over from previous test run ADD_TEST ( NAME H5IMPORT-clear-objects @@ -406,8 +406,8 @@ dtxtstr.h5.dff dtxtstr.h5.dff.err ) - SET (last_test "H5IMPORT-clear-objects") - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) + set (last_test "H5IMPORT-clear-objects") + endif (HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( NAME H5IMPORT-h5importtest-clear-objects @@ -421,10 +421,10 @@ binuin16.bin binuin32.bin ) - IF (NOT "${last_test}" STREQUAL "") + if (NOT "${last_test}" STREQUAL "") SET_TESTS_PROPERTIES (H5IMPORT-h5importtest-clear-objects PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "H5IMPORT-clear-objects") + endif (NOT "${last_test}" STREQUAL "") + set (last_test "H5IMPORT-clear-objects") ADD_TEST (NAME H5IMPORT-h5importtest COMMAND $) SET_TESTS_PROPERTIES (H5IMPORT-h5importtest PROPERTIES DEPENDS H5IMPORT-h5importtest-clear-objects) @@ -452,19 +452,19 @@ # ----- TESTING "BINARY F64 - rank 3 - Output LE+CHUNKED+Extended+Compressed " ADD_H5_TEST (BINARY_F64 binfp64.bin testfiles/binfp64.conf binfp64.h5) - IF (NOT USE_FILTER_DEFLATE) + if (NOT USE_FILTER_DEFLATE) ADD_H5_SKIP_DUMPTEST (BINARY_F64 "/fp/bin/64-bit" binfp64.h5 BINARY) - ELSE (NOT USE_FILTER_DEFLATE) + else (NOT USE_FILTER_DEFLATE) ADD_H5_DUMPTEST (BINARY_F64 "/fp/bin/64-bit" binfp64.h5 BINARY) - ENDIF (NOT USE_FILTER_DEFLATE) + endif (NOT USE_FILTER_DEFLATE) # ----- TESTING "BINARY I8 - rank 3 - Output I16LE + Chunked+Extended+Compressed " ADD_H5_TEST (BINARY_I8 binin8.bin testfiles/binin8.conf binin8.h5) - IF (NOT USE_FILTER_DEFLATE) + if (NOT USE_FILTER_DEFLATE) ADD_H5_SKIP_DUMPTEST (BINARY_I8 "/int/bin/8-bit" binin8.h5 BINARY) - ELSE (NOT USE_FILTER_DEFLATE) + else (NOT USE_FILTER_DEFLATE) ADD_H5_DUMPTEST (BINARY_I8 "/int/bin/8-bit" binin8.h5 BINARY) - ENDIF (NOT USE_FILTER_DEFLATE) + endif (NOT USE_FILTER_DEFLATE) # ----- TESTING "BINARY I16 - rank 3 - Output order LE + CHUNKED + extended " ADD_H5_TEST (BINARY_I16 binin16.bin testfiles/binin16.conf binin16.h5) diff --git a/tools/h5jam/CMakeLists.txt b/tools/h5jam/CMakeLists.txt index 49d1b0c..a17bf45 100644 --- a/tools/h5jam/CMakeLists.txt +++ b/tools/h5jam/CMakeLists.txt @@ -9,54 +9,54 @@ INCLUDE_DIRECTORIES (${HDF5_TOOLS_SRC_DIR}/lib) # -------------------------------------------------------------------- # Add the h5jam executables # -------------------------------------------------------------------- -ADD_EXECUTABLE (h5jam ${HDF5_TOOLS_H5JAM_SOURCE_DIR}/h5jam.c) +add_executable (h5jam ${HDF5_TOOLS_H5JAM_SOURCE_DIR}/h5jam.c) TARGET_NAMING (h5jam ${LIB_TYPE}) TARGET_C_PROPERTIES (h5jam " " " ") -TARGET_LINK_LIBRARIES (h5jam ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) -SET_TARGET_PROPERTIES (h5jam PROPERTIES FOLDER tools) +target_link_libraries (h5jam ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) +set_target_properties (h5jam PROPERTIES FOLDER tools) -ADD_EXECUTABLE (getub ${HDF5_TOOLS_H5JAM_SOURCE_DIR}/getub.c) +add_executable (getub ${HDF5_TOOLS_H5JAM_SOURCE_DIR}/getub.c) TARGET_NAMING (getub ${LIB_TYPE}) TARGET_C_PROPERTIES (getub " " " ") -TARGET_LINK_LIBRARIES (getub ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) -SET_TARGET_PROPERTIES (getub PROPERTIES FOLDER tools) +target_link_libraries (getub ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) +set_target_properties (getub PROPERTIES FOLDER tools) -ADD_EXECUTABLE (tellub ${HDF5_TOOLS_H5JAM_SOURCE_DIR}/tellub.c) +add_executable (tellub ${HDF5_TOOLS_H5JAM_SOURCE_DIR}/tellub.c) TARGET_NAMING (tellub ${LIB_TYPE}) TARGET_C_PROPERTIES (tellub " " " ") -TARGET_LINK_LIBRARIES (tellub ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) -SET_TARGET_PROPERTIES (tellub PROPERTIES FOLDER tools) +target_link_libraries (tellub ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) +set_target_properties (tellub PROPERTIES FOLDER tools) -ADD_EXECUTABLE (h5unjam ${HDF5_TOOLS_H5JAM_SOURCE_DIR}/h5unjam.c) +add_executable (h5unjam ${HDF5_TOOLS_H5JAM_SOURCE_DIR}/h5unjam.c) TARGET_NAMING (h5unjam ${LIB_TYPE}) TARGET_C_PROPERTIES (h5unjam " " " ") -TARGET_LINK_LIBRARIES (h5unjam ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) -SET_TARGET_PROPERTIES (h5unjam PROPERTIES FOLDER tools) +target_link_libraries (h5unjam ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) +set_target_properties (h5unjam PROPERTIES FOLDER tools) -SET (H5_DEP_EXECUTABLES +set (H5_DEP_EXECUTABLES h5jam getub tellub h5unjam ) -IF (BUILD_TESTING) +if (BUILD_TESTING) # -------------------------------------------------------------------- # Add the h5jam test executables # -------------------------------------------------------------------- - IF (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) - ADD_EXECUTABLE (h5jamgentest ${HDF5_TOOLS_H5JAM_SOURCE_DIR}/h5jamgentest.c) + if (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) + add_executable (h5jamgentest ${HDF5_TOOLS_H5JAM_SOURCE_DIR}/h5jamgentest.c) TARGET_NAMING (h5jamgentest ${LIB_TYPE}) TARGET_C_PROPERTIES (testhdf5 " " " ") - TARGET_LINK_LIBRARIES (h5jamgentest ${HDF5_LIB_TARGET}) - SET_TARGET_PROPERTIES (h5jamgentest PROPERTIES FOLDER generator/tools) + target_link_libraries (h5jamgentest ${HDF5_LIB_TARGET}) + set_target_properties (h5jamgentest PROPERTIES FOLDER generator/tools) #ADD_TEST (NAME h5jamgentest COMMAND $) - ENDIF (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) + endif (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) - INCLUDE (CMakeTests.cmake) + include (CMakeTests.cmake) -ENDIF (BUILD_TESTING) +endif (BUILD_TESTING) ############################################################################## ############################################################################## @@ -70,7 +70,7 @@ ENDIF (BUILD_TESTING) #INSTALL_PROGRAM_PDB (h5jam ${HDF5_INSTALL_BIN_DIR} toolsapplications) -INSTALL ( +install ( TARGETS h5jam h5unjam RUNTIME DESTINATION diff --git a/tools/h5jam/CMakeTests.cmake b/tools/h5jam/CMakeTests.cmake index 3816e85..123c26f 100644 --- a/tools/h5jam/CMakeTests.cmake +++ b/tools/h5jam/CMakeTests.cmake @@ -5,7 +5,7 @@ ############################################################################## ############################################################################## - SET (HDF5_REFERENCE_TXT_FILES + set (HDF5_REFERENCE_TXT_FILES u10.txt u511.txt u512.txt @@ -14,34 +14,34 @@ h5unjam-help.txt h5jam-ub-nohdf5.txt ) - SET (HDF5_REFERENCE_TEST_FILES + set (HDF5_REFERENCE_TEST_FILES tall.h5 twithub.h5 twithub513.h5 ) FILE (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") - FOREACH (h5_file ${HDF5_REFERENCE_TEST_FILES}) - SET (dest "${PROJECT_BINARY_DIR}/testfiles/${h5_file}") - #MESSAGE (STATUS " Copying ${h5_file}") - ADD_CUSTOM_COMMAND ( + foreach (h5_file ${HDF5_REFERENCE_TEST_FILES}) + set (dest "${PROJECT_BINARY_DIR}/testfiles/${h5_file}") + #message (STATUS " Copying ${h5_file}") + add_custom_command ( TARGET h5jam POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${HDF5_TOOLS_H5JAM_SOURCE_DIR}/testfiles/${h5_file} ${dest} ) - ENDFOREACH (h5_file ${HDF5_REFERENCE_TEST_FILES}) + endforeach (h5_file ${HDF5_REFERENCE_TEST_FILES}) - FOREACH (txt_file ${HDF5_REFERENCE_TXT_FILES}) - SET (dest "${PROJECT_BINARY_DIR}/testfiles/${txt_file}") - #MESSAGE (STATUS " Copying ${txt_file}") - ADD_CUSTOM_COMMAND ( + foreach (txt_file ${HDF5_REFERENCE_TXT_FILES}) + set (dest "${PROJECT_BINARY_DIR}/testfiles/${txt_file}") + #message (STATUS " Copying ${txt_file}") + add_custom_command ( TARGET h5jam POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${HDF5_TOOLS_H5JAM_SOURCE_DIR}/testfiles/${txt_file} ${dest} ) - ENDFOREACH (txt_file ${HDF5_REFERENCE_TXT_FILES}) + endforeach (txt_file ${HDF5_REFERENCE_TXT_FILES}) ############################################################################## ############################################################################## @@ -55,12 +55,12 @@ # MACRO (TEST_H5JAM_OUTPUT expectfile resultcode) # If using memchecker add tests without using scripts - IF (HDF5_ENABLE_USING_MEMCHECKER) + if (HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST (NAME H5JAM-${expectfile} COMMAND $ ${ARGN}) - IF (NOT "${resultcode}" STREQUAL "0") + if (NOT "${resultcode}" STREQUAL "0") SET_TESTS_PROPERTIES (H5JAM-${expectfile} PROPERTIES WILL_FAIL "true") - ENDIF (NOT "${resultcode}" STREQUAL "0") - ELSE (HDF5_ENABLE_USING_MEMCHECKER) + endif (NOT "${resultcode}" STREQUAL "0") + else (HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( NAME H5JAM-${expectfile}-clear-objects COMMAND ${CMAKE_COMMAND} @@ -80,7 +80,7 @@ -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) SET_TESTS_PROPERTIES (H5JAM-${expectfile} PROPERTIES DEPENDS H5JAM-${expectfile}-clear-objects) - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) + endif (HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (TEST_H5JAM_OUTPUT) # ============================================================ @@ -89,12 +89,12 @@ # MACRO (TEST_H5UNJAM_OUTPUT expectfile resultcode) # If using memchecker add tests without using scripts - IF (HDF5_ENABLE_USING_MEMCHECKER) + if (HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST (NAME H5JAM-UNJAM-${expectfile} COMMAND $ ${ARGN}) - IF (NOT "${resultcode}" STREQUAL "0") + if (NOT "${resultcode}" STREQUAL "0") SET_TESTS_PROPERTIES (H5JAM-UNJAM-${expectfile} PROPERTIES WILL_FAIL "true") - ENDIF (NOT "${resultcode}" STREQUAL "0") - ELSE (HDF5_ENABLE_USING_MEMCHECKER) + endif (NOT "${resultcode}" STREQUAL "0") + else (HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( NAME H5JAM-UNJAM-${expectfile}-clear-objects COMMAND ${CMAKE_COMMAND} @@ -114,12 +114,12 @@ -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) SET_TESTS_PROPERTIES (H5JAM-UNJAM-${expectfile} PROPERTIES DEPENDS H5JAM-UNJAM-${expectfile}-clear-objects) - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) + endif (HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (TEST_H5UNJAM_OUTPUT) MACRO (CHECKFILE testname testdepends expected actual) # If using memchecker add tests without using scripts - IF (NOT HDF5_ENABLE_USING_MEMCHECKER) + if (NOT HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( NAME H5JAM-${testname}-CHECKFILE-clear-objects COMMAND ${CMAKE_COMMAND} @@ -156,11 +156,11 @@ -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) SET_TESTS_PROPERTIES (H5JAM-${testname}-CHECKFILE-H5DMP_CMP PROPERTIES DEPENDS H5JAM-${testname}-CHECKFILE-H5DMP) - ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) + endif (NOT HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO(CHECKFILE testname testdepends expected actual) MACRO (UNJAMTEST testname setfile infile ufile chkfile outfile) - IF (NOT HDF5_ENABLE_USING_MEMCHECKER) + if (NOT HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( NAME H5JAM-${testname}-UNJAM-SETUP-clear-objects COMMAND ${CMAKE_COMMAND} -E remove ${infile} @@ -175,7 +175,7 @@ COMMAND ${CMAKE_COMMAND} -E remove ${outfile} ) SET_TESTS_PROPERTIES (H5JAM-${testname}-UNJAM-clear-objects PROPERTIES DEPENDS H5JAM-${testname}-UNJAM-SETUP) - IF (NOT "${ufile}" STREQUAL "NONE") + if (NOT "${ufile}" STREQUAL "NONE") ADD_TEST ( NAME H5JAM-${testname}-UNJAM_D-clear-objects COMMAND ${CMAKE_COMMAND} -E remove ${ufile} @@ -183,9 +183,9 @@ 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") + 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 @@ -203,14 +203,14 @@ -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") + 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 "") + 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} @@ -234,7 +234,7 @@ -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 "") + endif (NOT "${compare_test}" STREQUAL "") ADD_TEST ( NAME H5JAM-${testname}-UNJAM-CHECK_NOUB @@ -249,31 +249,31 @@ -D "TEST_OFILE=NULL" -P "${HDF5_RESOURCES_DIR}/userblockTest.cmake" ) - IF (NOT "${compare_test}" STREQUAL "") + 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 "") + else (NOT "${compare_test}" STREQUAL "") SET_TESTS_PROPERTIES (H5JAM-${testname}-UNJAM-CHECK_NOUB PROPERTIES DEPENDS H5JAM-${testname}-UNJAM) - ENDIF (NOT "${compare_test}" STREQUAL "") + endif (NOT "${compare_test}" STREQUAL "") CHECKFILE (${testname} "H5JAM-${testname}-UNJAM-CHECK_NOUB" ${chkfile} ${outfile}) - ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) + endif (NOT HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO(UNJAMTEST testname infile ufile outfile) MACRO (JAMTEST testname jamfile infile chkfile outfile) - IF (NOT HDF5_ENABLE_USING_MEMCHECKER) + if (NOT HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( NAME H5JAM-${testname}-clear-objects COMMAND ${CMAKE_COMMAND} -E remove ${outfile} ${infile}.cpy.h5 ) - ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) + 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) + 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") + 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 @@ -299,11 +299,11 @@ ) 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) + endif (NOT HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (JAMTEST testname jamfile infile outfile) MACRO (JAMTEST_NONE testname jamfile infile setfile chkfile) - IF (NOT HDF5_ENABLE_USING_MEMCHECKER) + if (NOT HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( NAME H5JAM-${testname}_NONE-clear-objects COMMAND ${CMAKE_COMMAND} -E remove @@ -324,11 +324,11 @@ 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") + 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 @@ -354,7 +354,7 @@ ) 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) + endif (NOT HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (JAMTEST_NONE testname jamfile infile setfile chkfile) ############################################################################## diff --git a/tools/h5ls/CMakeLists.txt b/tools/h5ls/CMakeLists.txt index eeaf1ea..b351268 100644 --- a/tools/h5ls/CMakeLists.txt +++ b/tools/h5ls/CMakeLists.txt @@ -9,21 +9,21 @@ INCLUDE_DIRECTORIES (${HDF5_TOOLS_SRC_DIR}/lib) #----------------------------------------------------------------------------- # Add the h5ls executable #----------------------------------------------------------------------------- -ADD_EXECUTABLE (h5ls ${HDF5_TOOLS_H5LS_SOURCE_DIR}/h5ls.c) +add_executable (h5ls ${HDF5_TOOLS_H5LS_SOURCE_DIR}/h5ls.c) TARGET_NAMING (h5ls ${LIB_TYPE}) TARGET_C_PROPERTIES (h5ls " " " ") -TARGET_LINK_LIBRARIES (h5ls ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) -SET_TARGET_PROPERTIES (h5ls PROPERTIES FOLDER tools) +target_link_libraries (h5ls ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) +set_target_properties (h5ls PROPERTIES FOLDER tools) -SET (H5_DEP_EXECUTABLES +set (H5_DEP_EXECUTABLES h5ls ) -IF (BUILD_TESTING) +if (BUILD_TESTING) - INCLUDE (CMakeTests.cmake) + include (CMakeTests.cmake) -ENDIF (BUILD_TESTING) +endif (BUILD_TESTING) ############################################################################## ############################################################################## @@ -37,7 +37,7 @@ ENDIF (BUILD_TESTING) #INSTALL_PROGRAM_PDB (h5ls ${HDF5_INSTALL_BIN_DIR} toolsapplications) -INSTALL ( +install ( TARGETS h5ls RUNTIME DESTINATION diff --git a/tools/h5ls/CMakeTests.cmake b/tools/h5ls/CMakeTests.cmake index 09f375d..b2d039f 100644 --- a/tools/h5ls/CMakeTests.cmake +++ b/tools/h5ls/CMakeTests.cmake @@ -8,7 +8,7 @@ # -------------------------------------------------------------------- # Copy all the test files from source directory to test directory # -------------------------------------------------------------------- - SET (LIST_HDF5_TEST_FILES + set (LIST_HDF5_TEST_FILES ${HDF5_TOOLS_SRC_DIR}/testfiles/tall.h5 ${HDF5_TOOLS_SRC_DIR}/testfiles/tarray1.h5 ${HDF5_TOOLS_SRC_DIR}/testfiles/tattr2.h5 @@ -33,7 +33,7 @@ ${HDF5_TOOLS_SRC_DIR}/testfiles/tvldtypes1.h5 ) - SET (LIST_OTHER_TEST_FILES + set (LIST_OTHER_TEST_FILES ${HDF5_TOOLS_SRC_DIR}/testfiles/help-1.ls ${HDF5_TOOLS_SRC_DIR}/testfiles/help-2.ls ${HDF5_TOOLS_SRC_DIR}/testfiles/help-3.ls @@ -95,17 +95,17 @@ FILE (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") # copy the list of test files - FOREACH (listfiles ${LIST_HDF5_TEST_FILES} ${LIST_OTHER_TEST_FILES}) + foreach (listfiles ${LIST_HDF5_TEST_FILES} ${LIST_OTHER_TEST_FILES}) GET_FILENAME_COMPONENT(fname "${listfiles}" NAME) - SET (dest "${PROJECT_BINARY_DIR}/testfiles/${fname}") - #MESSAGE (STATUS " Copying ${listfiles} to ${dest}") - ADD_CUSTOM_COMMAND ( + set (dest "${PROJECT_BINARY_DIR}/testfiles/${fname}") + #message (STATUS " Copying ${listfiles} to ${dest}") + add_custom_command ( TARGET h5ls POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${listfiles} ${dest} ) - ENDFOREACH (listfiles ${LIST_HDF5_TEST_FILES} ${LIST_OTHER_TEST_FILES}) + endforeach (listfiles ${LIST_HDF5_TEST_FILES} ${LIST_OTHER_TEST_FILES}) ############################################################################## @@ -116,16 +116,16 @@ MACRO (ADD_H5_TEST resultfile resultcode) # If using memchecker add tests without using scripts - IF (HDF5_ENABLE_USING_MEMCHECKER) + if (HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST (NAME H5LS-${resultfile} COMMAND $ ${ARGN}) SET_TESTS_PROPERTIES (H5LS-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") - IF (${resultcode} STREQUAL "1") + if (${resultcode} STREQUAL "1") SET_TESTS_PROPERTIES (H5LS-${resultfile} PROPERTIES WILL_FAIL "true") - ENDIF (${resultcode} STREQUAL "1") - IF (NOT "${last_test}" STREQUAL "") + endif (${resultcode} STREQUAL "1") + if (NOT "${last_test}" STREQUAL "") SET_TESTS_PROPERTIES (H5LS-${resultfile} PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - ELSE (HDF5_ENABLE_USING_MEMCHECKER) + endif (NOT "${last_test}" STREQUAL "") + else (HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( NAME H5LS-${resultfile}-clear-objects COMMAND ${CMAKE_COMMAND} @@ -143,7 +143,7 @@ -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) SET_TESTS_PROPERTIES (H5LS-${resultfile} PROPERTIES DEPENDS "H5LS-${resultfile}-clear-objects") - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) + endif (HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (ADD_H5_TEST file) ############################################################################## @@ -152,7 +152,7 @@ ############################################################################## ############################################################################## - IF (HDF5_ENABLE_USING_MEMCHECKER) + if (HDF5_ENABLE_USING_MEMCHECKER) # Remove any output file left over from previous test run ADD_TEST ( NAME H5LS-clearall-objects @@ -265,11 +265,11 @@ tvldtypes2be.out tvldtypes2be.out.err ) - IF (NOT "${last_test}" STREQUAL "") + if (NOT "${last_test}" STREQUAL "") SET_TESTS_PROPERTIES (H5LS-clearall-objects PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "H5LS-clearall-objects") - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) + endif (NOT "${last_test}" STREQUAL "") + set (last_test "H5LS-clearall-objects") + endif (HDF5_ENABLE_USING_MEMCHECKER) # test the help syntax ADD_H5_TEST (help-1 0 -w80 -h) @@ -378,25 +378,25 @@ # test for attribute with region references wo verbose mode # ( HDFFV-7838, ) - IF (H5_WORDS_BIGENDIAN) + if (H5_WORDS_BIGENDIAN) ADD_H5_TEST (tattrreg_be 0 -w80 -v -d tattrreg.h5) - ELSE (H5_WORDS_BIGENDIAN) + else (H5_WORDS_BIGENDIAN) ADD_H5_TEST (tattrreg_le 0 -w80 -v -d tattrreg.h5) - ENDIF (H5_WORDS_BIGENDIAN) + endif (H5_WORDS_BIGENDIAN) # test for non-existing file ADD_H5_TEST (nosuchfile 1 nosuchfile.h5) # test for variable length data types in verbose mode - IF (H5_WORDS_BIGENDIAN) + if (H5_WORDS_BIGENDIAN) ADD_H5_TEST (tvldtypes2be 0 -v tvldtypes1.h5) - ELSE (H5_WORDS_BIGENDIAN) + else (H5_WORDS_BIGENDIAN) ADD_H5_TEST (tvldtypes2le 0 -v tvldtypes1.h5) - ENDIF (H5_WORDS_BIGENDIAN) + endif (H5_WORDS_BIGENDIAN) # test for dataset region references data types in verbose mode - IF (H5_WORDS_BIGENDIAN) + if (H5_WORDS_BIGENDIAN) ADD_H5_TEST (tdataregbe 0 -v tdatareg.h5) - ELSE (H5_WORDS_BIGENDIAN) + else (H5_WORDS_BIGENDIAN) ADD_H5_TEST (tdataregle 0 -v tdatareg.h5) - ENDIF (H5_WORDS_BIGENDIAN) + endif (H5_WORDS_BIGENDIAN) diff --git a/tools/h5repack/CMakeLists.txt b/tools/h5repack/CMakeLists.txt index 176fc2b..4625607 100644 --- a/tools/h5repack/CMakeLists.txt +++ b/tools/h5repack/CMakeLists.txt @@ -10,7 +10,7 @@ INCLUDE_DIRECTORIES (${HDF5_TEST_SRC_DIR}) # -------------------------------------------------------------------- # Add h5Repack executables # -------------------------------------------------------------------- -SET (REPACK_COMMON_SRCS +set (REPACK_COMMON_SRCS ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/h5repack_copy.c ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/h5repack_filters.c ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/h5repack_opttable.c @@ -20,43 +20,43 @@ SET (REPACK_COMMON_SRCS ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/h5repack.c ) -ADD_EXECUTABLE (h5repack ${REPACK_COMMON_SRCS} ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/h5repack_main.c) +add_executable (h5repack ${REPACK_COMMON_SRCS} ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/h5repack_main.c) TARGET_NAMING (h5repack ${LIB_TYPE}) TARGET_C_PROPERTIES (h5repack " " " ") -TARGET_LINK_LIBRARIES (h5repack ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) -SET_TARGET_PROPERTIES (h5repack PROPERTIES FOLDER tools) +target_link_libraries (h5repack ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) +set_target_properties (h5repack PROPERTIES FOLDER tools) -SET (H5_DEP_EXECUTABLES h5repack) +set (H5_DEP_EXECUTABLES h5repack) -IF (BUILD_TESTING) +if (BUILD_TESTING) # -------------------------------------------------------------------- # Add h5Repack test executables # -------------------------------------------------------------------- - ADD_EXECUTABLE (testh5repack_detect_szip ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testh5repack_detect_szip.c) + add_executable (testh5repack_detect_szip ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testh5repack_detect_szip.c) TARGET_NAMING (testh5repack_detect_szip ${LIB_TYPE}) TARGET_C_PROPERTIES (testh5repack_detect_szip " " " ") - TARGET_LINK_LIBRARIES (testh5repack_detect_szip ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) - SET_TARGET_PROPERTIES (testh5repack_detect_szip PROPERTIES FOLDER tools) + target_link_libraries (testh5repack_detect_szip ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) + set_target_properties (testh5repack_detect_szip PROPERTIES FOLDER tools) - ADD_EXECUTABLE (h5repacktest ${REPACK_COMMON_SRCS} ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/h5repacktst.c) + add_executable (h5repacktest ${REPACK_COMMON_SRCS} ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/h5repacktst.c) TARGET_NAMING (h5repacktest ${LIB_TYPE}) TARGET_C_PROPERTIES (h5repacktest " " " ") - TARGET_LINK_LIBRARIES (h5repacktest ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) - SET_TARGET_PROPERTIES (h5repacktest PROPERTIES FOLDER tools) + target_link_libraries (h5repacktest ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) + set_target_properties (h5repacktest PROPERTIES FOLDER tools) #----------------------------------------------------------------------------- # If plugin library tests can be tested #----------------------------------------------------------------------------- - IF (BUILD_SHARED_LIBS) - SET (HDF5_TOOL_PLUGIN_LIB_CORENAME "dynlibadd") - SET (HDF5_TOOL_PLUGIN_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_TOOL_PLUGIN_LIB_CORENAME}") - SET (HDF5_TOOL_PLUGIN_LIB_TARGET ${HDF5_TOOL_PLUGIN_LIB_CORENAME}) - ADD_DEFINITIONS (${HDF5_EXTRA_C_FLAGS}) + if (BUILD_SHARED_LIBS) + set (HDF5_TOOL_PLUGIN_LIB_CORENAME "dynlibadd") + set (HDF5_TOOL_PLUGIN_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_TOOL_PLUGIN_LIB_CORENAME}") + set (HDF5_TOOL_PLUGIN_LIB_TARGET ${HDF5_TOOL_PLUGIN_LIB_CORENAME}) + add_definitions (${HDF5_EXTRA_C_FLAGS}) INCLUDE_DIRECTORIES (${HDF5_SRC_DIR}) - ADD_LIBRARY (${HDF5_TOOL_PLUGIN_LIB_TARGET} ${LIB_TYPE} ${HDF5_TEST_SRC_DIR}/dynlib1.c) + add_library (${HDF5_TOOL_PLUGIN_LIB_TARGET} ${LIB_TYPE} ${HDF5_TEST_SRC_DIR}/dynlib1.c) TARGET_C_PROPERTIES (${HDF5_TOOL_PLUGIN_LIB_TARGET} " " " ") - TARGET_LINK_LIBRARIES (${HDF5_TOOL_PLUGIN_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) + target_link_libraries (${HDF5_TOOL_PLUGIN_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) H5_SET_LIB_OPTIONS ( ${HDF5_TOOL_PLUGIN_LIB_TARGET} ${HDF5_TOOL_PLUGIN_LIB_NAME} ${LIB_TYPE} @@ -69,7 +69,7 @@ IF (BUILD_TESTING) #----------------------------------------------------------------------------- # Copy plugin library to a plugins folder #----------------------------------------------------------------------------- - ADD_CUSTOM_COMMAND ( + add_custom_command ( TARGET ${HDF5_TOOL_PLUGIN_LIB_TARGET} POST_BUILD COMMAND ${CMAKE_COMMAND} @@ -77,11 +77,11 @@ IF (BUILD_TESTING) "$" "${CMAKE_BINARY_DIR}/plugins/$" ) - ENDIF (BUILD_SHARED_LIBS) + endif (BUILD_SHARED_LIBS) - INCLUDE (CMakeTests.cmake) + include (CMakeTests.cmake) -ENDIF (BUILD_TESTING) +endif (BUILD_TESTING) ############################################################################## ############################################################################## @@ -95,7 +95,7 @@ ENDIF (BUILD_TESTING) #INSTALL_PROGRAM_PDB (h5repack ${HDF5_INSTALL_BIN_DIR} toolsapplications) -INSTALL ( +install ( TARGETS h5repack RUNTIME DESTINATION diff --git a/tools/h5repack/CMakeTests.cmake b/tools/h5repack/CMakeTests.cmake index 3252c30..6483a97 100644 --- a/tools/h5repack/CMakeTests.cmake +++ b/tools/h5repack/CMakeTests.cmake @@ -5,8 +5,8 @@ ############################################################################## ############################################################################## - IF (HDF5_TEST_VFD) - SET (VFD_LIST + if (HDF5_TEST_VFD) + set (VFD_LIST sec2 stdio core @@ -15,9 +15,9 @@ family ) - IF (DIRECT_VFD) - SET (VFD_LIST ${VFD_LIST} direct) - ENDIF (DIRECT_VFD) + if (DIRECT_VFD) + set (VFD_LIST ${VFD_LIST} direct) + endif (DIRECT_VFD) MACRO (ADD_VFD_TEST vfdname resultcode) ADD_TEST ( @@ -31,17 +31,17 @@ -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" -P "${HDF5_RESOURCES_DIR}/vfdTest.cmake" ) - IF (NOT "${last_test}" STREQUAL "") + if (NOT "${last_test}" STREQUAL "") SET_TESTS_PROPERTIES (H5REPACK-VFD-${vfdname}-h5repacktest PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "H5REPACK-VFD-${vfdname}-h5repacktest") + endif (NOT "${last_test}" STREQUAL "") + set (last_test "H5REPACK-VFD-${vfdname}-h5repacktest") ENDMACRO (ADD_VFD_TEST) - ENDIF (HDF5_TEST_VFD) + endif (HDF5_TEST_VFD) # -------------------------------------------------------------------- # Copy all the HDF5 files from the source directory into the test directory # -------------------------------------------------------------------- - SET (LIST_HDF5_TEST_FILES + set (LIST_HDF5_TEST_FILES ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testfiles/h5repack_attr.h5 ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testfiles/h5repack_attr_refs.h5 ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testfiles/h5repack_deflate.h5 @@ -79,7 +79,7 @@ ${HDF5_TOOLS_SRC_DIR}/testfiles/tfamily00010.h5 ) - SET (LIST_OTHER_TEST_FILES + set (LIST_OTHER_TEST_FILES ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testfiles/h5repack-help.txt ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testfiles/h5repack_ext.bin ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testfiles/ublock.bin @@ -93,17 +93,17 @@ ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testfiles/plugin_none.h5repack_layout.UD.h5.tst ) - FOREACH (h5_file ${LIST_HDF5_TEST_FILES} ${LIST_OTHER_TEST_FILES}) + foreach (h5_file ${LIST_HDF5_TEST_FILES} ${LIST_OTHER_TEST_FILES}) GET_FILENAME_COMPONENT(fname "${h5_file}" NAME) - SET (dest "${PROJECT_BINARY_DIR}/testfiles/${fname}") - #MESSAGE (STATUS " Copying ${h5_file}") - ADD_CUSTOM_COMMAND ( + set (dest "${PROJECT_BINARY_DIR}/testfiles/${fname}") + #message (STATUS " Copying ${h5_file}") + add_custom_command ( TARGET h5repack POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${h5_file} ${dest} ) - ENDFOREACH (h5_file ${LIST_HDF5_TEST_FILES} ${LIST_OTHER_TEST_FILES}) + endforeach (h5_file ${LIST_HDF5_TEST_FILES} ${LIST_OTHER_TEST_FILES}) ############################################################################## ############################################################################## @@ -113,14 +113,14 @@ MACRO (ADD_HELP_TEST testname resultcode) # If using memchecker add tests without using scripts - IF (HDF5_ENABLE_USING_MEMCHECKER) + if (HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST (NAME H5REPACK-${testname} COMMAND $ ${ARGN}) SET_TESTS_PROPERTIES (H5REPACK-${testname} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") - IF (NOT "${last_test}" STREQUAL "") + if (NOT "${last_test}" STREQUAL "") SET_TESTS_PROPERTIES (H5REPACK-${testname} PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "H5REPACK-${testname}") - ELSE (HDF5_ENABLE_USING_MEMCHECKER) + endif (NOT "${last_test}" STREQUAL "") + set (last_test "H5REPACK-${testname}") + else (HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( NAME H5REPACK-h5repack-${testname}-clear-objects COMMAND ${CMAKE_COMMAND} @@ -139,72 +139,72 @@ -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) SET_TESTS_PROPERTIES (H5REPACK-h5repack-${testname} PROPERTIES DEPENDS "H5REPACK-h5repack-${testname}-clear-objects") - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) + endif (HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (ADD_HELP_TEST) MACRO (ADD_H5_TEST_OLD testname testtype testfile) - IF (${testtype} STREQUAL "SKIP") - IF (NOT HDF5_ENABLE_USING_MEMCHECKER) + if (${testtype} STREQUAL "SKIP") + if (NOT HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( 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") + endif (NOT HDF5_ENABLE_USING_MEMCHECKER) + else (${testtype} STREQUAL "SKIP") ADD_TEST ( 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 "") + if (NOT "${last_test}" STREQUAL "") SET_TESTS_PROPERTIES (H5REPACK_OLD-${testname} PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") + endif (NOT "${last_test}" STREQUAL "") ADD_TEST ( NAME H5REPACK_OLD-${testname}_DFF COMMAND $ ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} ) SET_TESTS_PROPERTIES (H5REPACK_OLD-${testname}_DFF PROPERTIES DEPENDS H5REPACK_OLD-${testname}) - ENDIF (${testtype} STREQUAL "SKIP") + endif (${testtype} STREQUAL "SKIP") ENDMACRO (ADD_H5_TEST_OLD) MACRO (ADD_H5_TEST testname testtype testfile) - IF (${testtype} STREQUAL "SKIP") - IF (NOT HDF5_ENABLE_USING_MEMCHECKER) + 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/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile}" ) - ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) - ELSE (${testtype} STREQUAL "SKIP") + 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-${testname}.${testfile} ) - IF (NOT "${last_test}" STREQUAL "") + if (NOT "${last_test}" STREQUAL "") SET_TESTS_PROPERTIES (H5REPACK-${testname} PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") + endif (NOT "${last_test}" STREQUAL "") ADD_TEST ( NAME H5REPACK-${testname}_DFF COMMAND $ ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} ) SET_TESTS_PROPERTIES (H5REPACK-${testname}_DFF PROPERTIES DEPENDS H5REPACK-${testname}) - ENDIF (${testtype} STREQUAL "SKIP") + endif (${testtype} STREQUAL "SKIP") ENDMACRO (ADD_H5_TEST) MACRO (ADD_H5_CMP_TEST testname testfilter testtype resultcode resultfile) - IF (${testtype} STREQUAL "SKIP") - IF (NOT HDF5_ENABLE_USING_MEMCHECKER) + if (${testtype} STREQUAL "SKIP") + if (NOT HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( 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") + endif (NOT HDF5_ENABLE_USING_MEMCHECKER) + else (${testtype} STREQUAL "SKIP") # If using memchecker add tests without using scripts - IF (HDF5_ENABLE_USING_MEMCHECKER) + if (HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( NAME H5REPACK_CMP-${testname} COMMAND $ ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${resultfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${resultfile}) - ELSE (HDF5_ENABLE_USING_MEMCHECKER) + else (HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( NAME H5REPACK_CMP-${testname} COMMAND "${CMAKE_COMMAND}" @@ -217,30 +217,30 @@ -D "TEST_REFERENCE=${resultfile}.tst" -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) - IF (NOT "${last_test}" STREQUAL "") + endif (HDF5_ENABLE_USING_MEMCHECKER) + if (NOT "${last_test}" STREQUAL "") SET_TESTS_PROPERTIES (H5REPACK_CMP-${testname} PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - ENDIF (${testtype} STREQUAL "SKIP") + endif (NOT "${last_test}" STREQUAL "") + endif (${testtype} STREQUAL "SKIP") ENDMACRO (ADD_H5_CMP_TEST) MACRO (ADD_H5_DMP_TEST testname testtype resultcode resultfile) - IF (${testtype} STREQUAL "SKIP") - IF (NOT HDF5_ENABLE_USING_MEMCHECKER) + if (${testtype} STREQUAL "SKIP") + if (NOT HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( NAME H5REPACK_DMP-${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") + endif (NOT HDF5_ENABLE_USING_MEMCHECKER) + else (${testtype} STREQUAL "SKIP") # If using memchecker add tests without using scripts ADD_TEST ( NAME H5REPACK_DMP-${testname} COMMAND $ ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${resultfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${resultfile}) - IF (NOT "${last_test}" STREQUAL "") + if (NOT "${last_test}" STREQUAL "") SET_TESTS_PROPERTIES (H5REPACK_DMP-${testname} PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - IF (NOT HDF5_ENABLE_USING_MEMCHECKER) + endif (NOT "${last_test}" STREQUAL "") + if (NOT HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( NAME H5REPACK_DMP-h5dump-${testname} COMMAND "${CMAKE_COMMAND}" @@ -253,33 +253,33 @@ -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) SET_TESTS_PROPERTIES (H5REPACK_DMP-h5dump-${testname} PROPERTIES DEPENDS "H5REPACK_DMP-${testname}") - ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) - ENDIF (${testtype} STREQUAL "SKIP") + endif (NOT HDF5_ENABLE_USING_MEMCHECKER) + endif (${testtype} STREQUAL "SKIP") ENDMACRO (ADD_H5_DMP_TEST) MACRO (ADD_H5_VERIFY_TEST testname testtype resultcode testfile testdset testfilter) - IF (${testtype} STREQUAL "SKIP") - IF (NOT HDF5_ENABLE_USING_MEMCHECKER) + if (${testtype} STREQUAL "SKIP") + 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-${testname}.${resultfile}" ) - ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) - ELSE (${testtype} STREQUAL "SKIP") - IF (NOT HDF5_ENABLE_USING_MEMCHECKER) + 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 "") + if (NOT "${last_test}" STREQUAL "") SET_TESTS_PROPERTIES (H5REPACK_VERIFY_LAYOUT-${testname} PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") + 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") + if (${resultcode} STREQUAL "0") ADD_TEST ( NAME H5REPACK_VERIFY_LAYOUT-${testname}_DMP COMMAND "${CMAKE_COMMAND}" @@ -293,16 +293,16 @@ -P "${HDF5_RESOURCES_DIR}/grepTest.cmake" ) 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)") - ENDIF (${testfilter} STREQUAL "CHUNKED") - IF (${testfilter} STREQUAL "CONTIGUOUS") - SET (nottestfilter "(CHUNK|COMPACT)") - ENDIF (${testfilter} STREQUAL "CONTIGUOUS") - IF (${testfilter} STREQUAL "COMPACT") - SET (nottestfilter "(CONTIGUOUS|CHUNK)") - ENDIF (${testfilter} STREQUAL "COMPACT") + else (${resultcode} STREQUAL "0") + if (${testfilter} STREQUAL "CHUNKED") + set (nottestfilter "(CONTIGUOUS|COMPACT)") + endif (${testfilter} STREQUAL "CHUNKED") + if (${testfilter} STREQUAL "CONTIGUOUS") + set (nottestfilter "(CHUNK|COMPACT)") + endif (${testfilter} STREQUAL "CONTIGUOUS") + if (${testfilter} STREQUAL "COMPACT") + set (nottestfilter "(CONTIGUOUS|CHUNK)") + endif (${testfilter} STREQUAL "COMPACT") ADD_TEST ( NAME H5REPACK_VERIFY_LAYOUT-${testname}_DMP COMMAND "${CMAKE_COMMAND}" @@ -316,9 +316,9 @@ -P "${HDF5_RESOURCES_DIR}/grepTest.cmake" ) 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") + endif (${resultcode} STREQUAL "0") + endif (NOT HDF5_ENABLE_USING_MEMCHECKER) + endif (${testtype} STREQUAL "SKIP") ENDMACRO (ADD_H5_VERIFY_TEST) MACRO (ADD_H5_TEST_META testname testfile) @@ -326,9 +326,9 @@ 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 "") + if (NOT "${last_test}" STREQUAL "") SET_TESTS_PROPERTIES (H5REPACK_META-${testname}_N PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") + endif (NOT "${last_test}" STREQUAL "") ADD_TEST ( NAME H5REPACK_META-${testname}_M COMMAND $ ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}_M.${testname}.h5 @@ -341,7 +341,7 @@ ENDMACRO (ADD_H5_TEST_META) MACRO (ADD_H5_UD_TEST testname resultcode resultfile) - IF (HDF5_BUILD_TOOLS AND NOT HDF5_ENABLE_USING_MEMCHECKER) + if (HDF5_BUILD_TOOLS AND NOT HDF5_ENABLE_USING_MEMCHECKER) # Remove any output file left over from previous test run ADD_TEST ( NAME H5REPACK_UD-${testname}-clearall-objects @@ -382,7 +382,7 @@ -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) SET_TESTS_PROPERTIES (H5REPACK_UD-h5dump-${testname} PROPERTIES DEPENDS "H5REPACK_UD-${testname}") - ENDIF (HDF5_BUILD_TOOLS AND NOT HDF5_ENABLE_USING_MEMCHECKER) + endif (HDF5_BUILD_TOOLS AND NOT HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (ADD_H5_UD_TEST) ############################################################################## @@ -394,27 +394,27 @@ # -------------------------------------------------------------------- # 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) + 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 ( @@ -597,30 +597,30 @@ h5repack_ext.bin ublock.bin ) - IF (NOT "${last_test}" STREQUAL "") + if (NOT "${last_test}" STREQUAL "") SET_TESTS_PROPERTIES (H5REPACK-clearall-objects PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") + endif (NOT "${last_test}" STREQUAL "") ADD_HELP_TEST(help 0 -h) ADD_TEST (NAME H5REPACK-testh5repack_detect_szip COMMAND $) - IF (HDF5_ENABLE_SZIP_SUPPORT) - IF (HDF5_ENABLE_SZIP_ENCODING) - SET (passRegex "yes") + if (HDF5_ENABLE_SZIP_SUPPORT) + if (HDF5_ENABLE_SZIP_ENCODING) + set (passRegex "yes") SET_TESTS_PROPERTIES (H5REPACK-testh5repack_detect_szip PROPERTIES PASS_REGULAR_EXPRESSION "yes") - ELSE (HDF5_ENABLE_SZIP_ENCODING) - SET (passRegex "no") + else (HDF5_ENABLE_SZIP_ENCODING) + set (passRegex "no") SET_TESTS_PROPERTIES (H5REPACK-testh5repack_detect_szip PROPERTIES PASS_REGULAR_EXPRESSION "no") - ENDIF (HDF5_ENABLE_SZIP_ENCODING) - ELSE (HDF5_ENABLE_SZIP_SUPPORT) - SET (passRegex "no") + endif (HDF5_ENABLE_SZIP_ENCODING) + else (HDF5_ENABLE_SZIP_SUPPORT) + set (passRegex "no") SET_TESTS_PROPERTIES (H5REPACK-testh5repack_detect_szip PROPERTIES PASS_REGULAR_EXPRESSION "no") - ENDIF (HDF5_ENABLE_SZIP_SUPPORT) + endif (HDF5_ENABLE_SZIP_SUPPORT) SET_TESTS_PROPERTIES (H5REPACK-testh5repack_detect_szip PROPERTIES DEPENDS H5REPACK-clearall-objects) ADD_TEST (NAME H5REPACK-h5repacktest COMMAND $) SET_TESTS_PROPERTIES (H5REPACK-h5repacktest PROPERTIES DEPENDS H5REPACK-testh5repack_detect_szip) - SET (last_test "H5REPACK-h5repacktest") + set (last_test "H5REPACK-h5repacktest") # # The tests @@ -636,34 +636,34 @@ # filters are defined. # detect whether the encoder is present. - SET (USE_FILTER_SZIP_ENCODER "no") - IF (HDF5_ENABLE_SZIP_ENCODING) - SET (USE_FILTER_SZIP_ENCODER ${testh5repack_detect_szip}) - ENDIF (HDF5_ENABLE_SZIP_ENCODING) - - IF (H5_HAVE_FILTER_DEFLATE) - SET (USE_FILTER_DEFLATE "true") - ENDIF (H5_HAVE_FILTER_DEFLATE) - - IF (H5_HAVE_FILTER_SZIP) - SET (USE_FILTER_SZIP "true") - ENDIF (H5_HAVE_FILTER_SZIP) - - IF (H5_HAVE_FILTER_SHUFFLE) - SET (USE_FILTER_SHUFFLE "true") - ENDIF (H5_HAVE_FILTER_SHUFFLE) - - IF (H5_HAVE_FILTER_FLETCHER32) - SET (USE_FILTER_FLETCHER32 "true") - ENDIF (H5_HAVE_FILTER_FLETCHER32) - - IF (H5_HAVE_FILTER_NBIT) - SET (USE_FILTER_NBIT "true") - ENDIF (H5_HAVE_FILTER_NBIT) - - IF (H5_HAVE_FILTER_SCALEOFFSET) - SET (USE_FILTER_SCALEOFFSET "true") - ENDIF (H5_HAVE_FILTER_SCALEOFFSET) + set (USE_FILTER_SZIP_ENCODER "no") + if (HDF5_ENABLE_SZIP_ENCODING) + set (USE_FILTER_SZIP_ENCODER ${testh5repack_detect_szip}) + endif (HDF5_ENABLE_SZIP_ENCODING) + + if (H5_HAVE_FILTER_DEFLATE) + set (USE_FILTER_DEFLATE "true") + endif (H5_HAVE_FILTER_DEFLATE) + + if (H5_HAVE_FILTER_SZIP) + set (USE_FILTER_SZIP "true") + endif (H5_HAVE_FILTER_SZIP) + + if (H5_HAVE_FILTER_SHUFFLE) + set (USE_FILTER_SHUFFLE "true") + endif (H5_HAVE_FILTER_SHUFFLE) + + if (H5_HAVE_FILTER_FLETCHER32) + set (USE_FILTER_FLETCHER32 "true") + endif (H5_HAVE_FILTER_FLETCHER32) + + if (H5_HAVE_FILTER_NBIT) + set (USE_FILTER_NBIT "true") + endif (H5_HAVE_FILTER_NBIT) + + if (H5_HAVE_FILTER_SCALEOFFSET) + set (USE_FILTER_SCALEOFFSET "true") + endif (H5_HAVE_FILTER_SCALEOFFSET) # copy files (these files have no filters) ADD_H5_TEST (fill "TEST" ${FILE0}) @@ -676,83 +676,83 @@ # use $FILE4 to write some filters (this file has no filters) # gzip with individual object - SET (arg ${FILE4} -f dset1:GZIP=1 -l dset1:CHUNK=20x10) - SET (TESTTYPE "TEST") - IF (NOT USE_FILTER_DEFLATE) - SET (TESTTYPE "SKIP") - ENDIF (NOT USE_FILTER_DEFLATE) + set (arg ${FILE4} -f dset1:GZIP=1 -l dset1:CHUNK=20x10) + set (TESTTYPE "TEST") + if (NOT USE_FILTER_DEFLATE) + set (TESTTYPE "SKIP") + endif (NOT USE_FILTER_DEFLATE) ADD_H5_TEST (gzip_individual ${TESTTYPE} ${arg}) # gzip for all - SET (arg ${FILE4} -f GZIP=1) - SET (TESTTYPE "TEST") - IF (NOT USE_FILTER_DEFLATE) - SET (TESTTYPE "SKIP") - ENDIF (NOT USE_FILTER_DEFLATE) + set (arg ${FILE4} -f GZIP=1) + set (TESTTYPE "TEST") + if (NOT USE_FILTER_DEFLATE) + set (TESTTYPE "SKIP") + endif (NOT USE_FILTER_DEFLATE) ADD_H5_TEST (gzip_all ${TESTTYPE} ${arg}) # szip with individual object - SET (arg ${FILE4} -f dset2:SZIP=8,EC -l dset2:CHUNK=20x10) - SET (TESTTYPE "TEST") - IF (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP) - SET (TESTTYPE "SKIP") - ENDIF (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP) + set (arg ${FILE4} -f dset2:SZIP=8,EC -l dset2:CHUNK=20x10) + set (TESTTYPE "TEST") + if (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP) + set (TESTTYPE "SKIP") + endif (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP) ADD_H5_TEST (szip_individual ${TESTTYPE} ${arg}) # szip for all - SET (arg ${FILE4} -f SZIP=8,NN) - SET (TESTTYPE "TEST") - IF (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP) - SET (TESTTYPE "SKIP") - ENDIF (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP) + set (arg ${FILE4} -f SZIP=8,NN) + set (TESTTYPE "TEST") + if (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP) + set (TESTTYPE "SKIP") + endif (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP) ADD_H5_TEST (szip_all ${TESTTYPE} ${arg}) # shuffle with individual object - SET (arg ${FILE4} -f dset2:SHUF -l dset2:CHUNK=20x10) - SET (TESTTYPE "TEST") - IF (NOT USE_FILTER_SHUFFLE) - SET (TESTTYPE "SKIP") - ENDIF (NOT USE_FILTER_SHUFFLE) + set (arg ${FILE4} -f dset2:SHUF -l dset2:CHUNK=20x10) + set (TESTTYPE "TEST") + if (NOT USE_FILTER_SHUFFLE) + set (TESTTYPE "SKIP") + endif (NOT USE_FILTER_SHUFFLE) ADD_H5_TEST (shuffle_individual ${TESTTYPE} ${arg}) # shuffle for all - SET (arg ${FILE4} -f SHUF) - SET (TESTTYPE "TEST") - IF (NOT USE_FILTER_SHUFFLE) - SET (TESTTYPE "SKIP") - ENDIF (NOT USE_FILTER_SHUFFLE) + set (arg ${FILE4} -f SHUF) + set (TESTTYPE "TEST") + if (NOT USE_FILTER_SHUFFLE) + set (TESTTYPE "SKIP") + endif (NOT USE_FILTER_SHUFFLE) ADD_H5_TEST (shuffle_all ${TESTTYPE} ${arg}) # fletcher32 with individual object - SET (arg ${FILE4} -f dset2:FLET -l dset2:CHUNK=20x10) - SET (TESTTYPE "TEST") - IF (NOT USE_FILTER_FLETCHER32) - SET (TESTTYPE "SKIP") - ENDIF (NOT USE_FILTER_FLETCHER32) + set (arg ${FILE4} -f dset2:FLET -l dset2:CHUNK=20x10) + set (TESTTYPE "TEST") + if (NOT USE_FILTER_FLETCHER32) + set (TESTTYPE "SKIP") + endif (NOT USE_FILTER_FLETCHER32) ADD_H5_TEST (fletcher_individual ${TESTTYPE} ${arg}) # fletcher32 for all - SET (arg ${FILE4} -f FLET) - SET (TESTTYPE "TEST") - IF (NOT USE_FILTER_FLETCHER32) - SET (TESTTYPE "SKIP") - ENDIF (NOT USE_FILTER_FLETCHER32) + set (arg ${FILE4} -f FLET) + set (TESTTYPE "TEST") + if (NOT USE_FILTER_FLETCHER32) + set (TESTTYPE "SKIP") + endif (NOT USE_FILTER_FLETCHER32) ADD_H5_TEST (fletcher_all ${TESTTYPE} ${arg}) # all filters - SET (arg ${FILE4} -f dset2:SHUF -f dset2:FLET -f dset2:SZIP=8,NN -f dset2:GZIP=1 -l dset2:CHUNK=20x10) - SET (TESTTYPE "TEST") - IF (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP OR NOT USE_FILTER_SHUFFLE OR NOT USE_FILTER_FLETCHER32 OR NOT USE_FILTER_DEFLATE) - SET (TESTTYPE "SKIP") - ENDIF (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP OR NOT USE_FILTER_SHUFFLE OR NOT USE_FILTER_FLETCHER32 OR NOT USE_FILTER_DEFLATE) + set (arg ${FILE4} -f dset2:SHUF -f dset2:FLET -f dset2:SZIP=8,NN -f dset2:GZIP=1 -l dset2:CHUNK=20x10) + set (TESTTYPE "TEST") + if (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP OR NOT USE_FILTER_SHUFFLE OR NOT USE_FILTER_FLETCHER32 OR NOT USE_FILTER_DEFLATE) + set (TESTTYPE "SKIP") + endif (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP OR NOT USE_FILTER_SHUFFLE OR NOT USE_FILTER_FLETCHER32 OR NOT USE_FILTER_DEFLATE) ADD_H5_TEST (all_filters ${TESTTYPE} ${arg}) # verbose gzip with individual object - SET (arg ${FILE11} -v -f /dset_deflate:GZIP=9) - SET (TESTTYPE "TEST") - IF (NOT USE_FILTER_DEFLATE) - SET (TESTTYPE "SKIP") - ENDIF (NOT USE_FILTER_DEFLATE) + set (arg ${FILE11} -v -f /dset_deflate:GZIP=9) + set (TESTTYPE "TEST") + if (NOT USE_FILTER_DEFLATE) + set (TESTTYPE "SKIP") + endif (NOT USE_FILTER_DEFLATE) ADD_H5_CMP_TEST (gzip_verbose_filters "O?...ing file[^\n]+\n" ${TESTTYPE} 0 ${arg}) ########################################################### @@ -760,154 +760,154 @@ ########################################################### # szip copy - SET (arg ${FILE7}) - SET (TESTTYPE "TEST") - IF (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP) - SET (TESTTYPE "SKIP") - ENDIF (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP) + set (arg ${FILE7}) + set (TESTTYPE "TEST") + if (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP) + set (TESTTYPE "SKIP") + endif (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP) ADD_H5_TEST (szip_copy ${TESTTYPE} ${arg}) # szip remove - SET (arg ${FILE7} --filter=dset_szip:NONE) - SET (TESTTYPE "TEST") - IF (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP) - SET (TESTTYPE "SKIP") - ENDIF (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP) + set (arg ${FILE7} --filter=dset_szip:NONE) + set (TESTTYPE "TEST") + if (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP) + set (TESTTYPE "SKIP") + endif (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP) ADD_H5_TEST (szip_remove ${TESTTYPE} ${arg}) # deflate copy - SET (arg ${FILE8}) - SET (TESTTYPE "TEST") - IF (NOT USE_FILTER_DEFLATE) - SET (TESTTYPE "SKIP") - ENDIF (NOT USE_FILTER_DEFLATE) + set (arg ${FILE8}) + set (TESTTYPE "TEST") + if (NOT USE_FILTER_DEFLATE) + set (TESTTYPE "SKIP") + endif (NOT USE_FILTER_DEFLATE) ADD_H5_TEST (deflate_copy ${TESTTYPE} ${arg}) # deflate remove - SET (arg ${FILE8} -f dset_deflate:NONE) - SET (TESTTYPE "TEST") - IF (NOT USE_FILTER_DEFLATE) - SET (TESTTYPE "SKIP") - ENDIF (NOT USE_FILTER_DEFLATE) + set (arg ${FILE8} -f dset_deflate:NONE) + set (TESTTYPE "TEST") + if (NOT USE_FILTER_DEFLATE) + set (TESTTYPE "SKIP") + endif (NOT USE_FILTER_DEFLATE) ADD_H5_TEST (deflate_remove ${TESTTYPE} ${arg}) # shuffle copy - SET (arg ${FILE9}) - SET (TESTTYPE "TEST") - IF (NOT USE_FILTER_SHUFFLE) - SET (TESTTYPE "SKIP") - ENDIF (NOT USE_FILTER_SHUFFLE) + set (arg ${FILE9}) + set (TESTTYPE "TEST") + if (NOT USE_FILTER_SHUFFLE) + set (TESTTYPE "SKIP") + endif (NOT USE_FILTER_SHUFFLE) ADD_H5_TEST (shuffle_copy ${TESTTYPE} ${arg}) # shuffle remove - SET (arg ${FILE9} -f dset_shuffle:NONE) - SET (TESTTYPE "TEST") - IF (NOT USE_FILTER_SHUFFLE) - SET (TESTTYPE "SKIP") - ENDIF (NOT USE_FILTER_SHUFFLE) + set (arg ${FILE9} -f dset_shuffle:NONE) + set (TESTTYPE "TEST") + if (NOT USE_FILTER_SHUFFLE) + set (TESTTYPE "SKIP") + endif (NOT USE_FILTER_SHUFFLE) ADD_H5_TEST (shuffle_remove ${TESTTYPE} ${arg}) # fletcher32 copy - SET (arg ${FILE10}) - SET (TESTTYPE "TEST") - IF (NOT USE_FILTER_FLETCHER32) - SET (TESTTYPE "SKIP") - ENDIF (NOT USE_FILTER_FLETCHER32) + set (arg ${FILE10}) + set (TESTTYPE "TEST") + if (NOT USE_FILTER_FLETCHER32) + set (TESTTYPE "SKIP") + endif (NOT USE_FILTER_FLETCHER32) ADD_H5_TEST (fletcher_copy ${TESTTYPE} ${arg}) # fletcher32 remove - SET (arg ${FILE10} -f dset_fletcher32:NONE) - SET (TESTTYPE "TEST") - IF (NOT USE_FILTER_FLETCHER32) - SET (TESTTYPE "SKIP") - ENDIF (NOT USE_FILTER_FLETCHER32) + set (arg ${FILE10} -f dset_fletcher32:NONE) + set (TESTTYPE "TEST") + if (NOT USE_FILTER_FLETCHER32) + set (TESTTYPE "SKIP") + endif (NOT USE_FILTER_FLETCHER32) ADD_H5_TEST (fletcher_remove ${TESTTYPE} ${arg}) # nbit copy - SET (arg ${FILE12}) - SET (TESTTYPE "TEST") - IF (NOT USE_FILTER_NBIT) - SET (TESTTYPE "SKIP") - ENDIF (NOT USE_FILTER_NBIT) + set (arg ${FILE12}) + set (TESTTYPE "TEST") + if (NOT USE_FILTER_NBIT) + set (TESTTYPE "SKIP") + endif (NOT USE_FILTER_NBIT) ADD_H5_TEST (nbit_copy ${TESTTYPE} ${arg}) # nbit remove - SET (arg ${FILE12} -f dset_nbit:NONE) - SET (TESTTYPE "TEST") - IF (NOT USE_FILTER_NBIT) - SET (TESTTYPE "SKIP") - ENDIF (NOT USE_FILTER_NBIT) + set (arg ${FILE12} -f dset_nbit:NONE) + set (TESTTYPE "TEST") + if (NOT USE_FILTER_NBIT) + set (TESTTYPE "SKIP") + endif (NOT USE_FILTER_NBIT) ADD_H5_TEST (nbit_remove ${TESTTYPE} ${arg}) # nbit add - SET (arg ${FILE12} -f dset_int31:NBIT) - SET (TESTTYPE "TEST") - IF (NOT USE_FILTER_NBIT) - SET (TESTTYPE "SKIP") - ENDIF (NOT USE_FILTER_NBIT) + set (arg ${FILE12} -f dset_int31:NBIT) + set (TESTTYPE "TEST") + if (NOT USE_FILTER_NBIT) + set (TESTTYPE "SKIP") + endif (NOT USE_FILTER_NBIT) ADD_H5_TEST (nbit_add ${TESTTYPE} ${arg}) # scaleoffset copy - SET (arg ${FILE13}) - SET (TESTTYPE "TEST") - IF (NOT USE_FILTER_SCALEOFFSET) - SET (TESTTYPE "SKIP") - ENDIF (NOT USE_FILTER_SCALEOFFSET) + set (arg ${FILE13}) + set (TESTTYPE "TEST") + if (NOT USE_FILTER_SCALEOFFSET) + set (TESTTYPE "SKIP") + endif (NOT USE_FILTER_SCALEOFFSET) ADD_H5_TEST (scale_copy ${TESTTYPE} ${arg}) # scaleoffset add - SET (arg ${FILE13} -f dset_none:SOFF=31,IN) - SET (TESTTYPE "TEST") - IF (NOT USE_FILTER_SCALEOFFSET) - SET (TESTTYPE "SKIP") - ENDIF (NOT USE_FILTER_SCALEOFFSET) + set (arg ${FILE13} -f dset_none:SOFF=31,IN) + set (TESTTYPE "TEST") + if (NOT USE_FILTER_SCALEOFFSET) + set (TESTTYPE "SKIP") + endif (NOT USE_FILTER_SCALEOFFSET) ADD_H5_TEST (scale_add ${TESTTYPE} ${arg}) # scaleoffset remove - SET (arg ${FILE13} -f dset_scaleoffset:NONE) - SET (TESTTYPE "TEST") - IF (NOT USE_FILTER_SCALEOFFSET) - SET (TESTTYPE "SKIP") - ENDIF (NOT USE_FILTER_SCALEOFFSET) + set (arg ${FILE13} -f dset_scaleoffset:NONE) + set (TESTTYPE "TEST") + if (NOT USE_FILTER_SCALEOFFSET) + set (TESTTYPE "SKIP") + endif (NOT USE_FILTER_SCALEOFFSET) ADD_H5_TEST (scale_remove ${TESTTYPE} ${arg}) # remove all filters - SET (arg ${FILE11} -f NONE) - SET (TESTTYPE "TEST") - IF (NOT USE_FILTER_FLETCHER32 OR NOT USE_FILTER_DEFLATE OR NOT USE_FILTER_SZIP OR NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SHUFFLE OR NOT USE_FILTER_NBIT OR NOT USE_FILTER_SCALEOFFSET) - SET (TESTTYPE "SKIP") - ENDIF (NOT USE_FILTER_FLETCHER32 OR NOT USE_FILTER_DEFLATE OR NOT USE_FILTER_SZIP OR NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SHUFFLE OR NOT USE_FILTER_NBIT OR NOT USE_FILTER_SCALEOFFSET) + set (arg ${FILE11} -f NONE) + set (TESTTYPE "TEST") + if (NOT USE_FILTER_FLETCHER32 OR NOT USE_FILTER_DEFLATE OR NOT USE_FILTER_SZIP OR NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SHUFFLE OR NOT USE_FILTER_NBIT OR NOT USE_FILTER_SCALEOFFSET) + set (TESTTYPE "SKIP") + endif (NOT USE_FILTER_FLETCHER32 OR NOT USE_FILTER_DEFLATE OR NOT USE_FILTER_SZIP OR NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SHUFFLE OR NOT USE_FILTER_NBIT OR NOT USE_FILTER_SCALEOFFSET) ADD_H5_TEST (remove_all ${TESTTYPE} ${arg}) #filter conversions - SET (arg ${FILE8} -f dset_deflate:SZIP=8,NN) - SET (TESTTYPE "TEST") - IF (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP OR NOT USE_FILTER_DEFLATE) - SET (TESTTYPE "SKIP") - ENDIF (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP OR NOT USE_FILTER_DEFLATE) + set (arg ${FILE8} -f dset_deflate:SZIP=8,NN) + set (TESTTYPE "TEST") + if (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP OR NOT USE_FILTER_DEFLATE) + set (TESTTYPE "SKIP") + endif (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP OR NOT USE_FILTER_DEFLATE) ADD_H5_TEST (deflate_convert ${TESTTYPE} ${arg}) - SET (arg ${FILE7} -f dset_szip:GZIP=1) - SET (TESTTYPE "TEST") - IF (NOT USE_FILTER_SZIP OR NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_DEFLATE) - SET (TESTTYPE "SKIP") - ENDIF (NOT USE_FILTER_SZIP OR NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_DEFLATE) + set (arg ${FILE7} -f dset_szip:GZIP=1) + set (TESTTYPE "TEST") + if (NOT USE_FILTER_SZIP OR NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_DEFLATE) + set (TESTTYPE "SKIP") + endif (NOT USE_FILTER_SZIP OR NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_DEFLATE) ADD_H5_TEST (szip_convert ${TESTTYPE} ${arg}) #limit - SET (arg ${FILE4} -f GZIP=1 -m 1024) - SET (TESTTYPE "TEST") - IF (NOT USE_FILTER_DEFLATE) - SET (TESTTYPE "SKIP") - ENDIF (NOT USE_FILTER_DEFLATE) + set (arg ${FILE4} -f GZIP=1 -m 1024) + set (TESTTYPE "TEST") + if (NOT USE_FILTER_DEFLATE) + set (TESTTYPE "SKIP") + endif (NOT USE_FILTER_DEFLATE) ADD_H5_DMP_TEST (deflate_limit ${TESTTYPE} 0 ${arg}) #file - SET (arg ${FILE4} -e ${INFO_FILE}) - SET (TESTTYPE "TEST") - IF (NOT USE_FILTER_DEFLATE) - SET (TESTTYPE "SKIP") - ENDIF (NOT USE_FILTER_DEFLATE) + set (arg ${FILE4} -e ${INFO_FILE}) + set (TESTTYPE "TEST") + if (NOT USE_FILTER_DEFLATE) + set (TESTTYPE "SKIP") + endif (NOT USE_FILTER_DEFLATE) ADD_H5_TEST (deflate_file ${TESTTYPE} ${arg}) ######################################################### @@ -990,44 +990,44 @@ ADD_H5_VERIFY_TEST (ckdim_smaller "TEST" 0 h5repack_layout3.h5 chunk_unlimit3 CO ADD_H5_TEST (native_attr "TEST" ${FILE2} -n) # latest file format with long switches. use FILE4=h5repack_layout.h5 (no filters) - 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) + 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_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 -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) + 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_VERIFY_TEST (layout_short_switches ${TESTTYPE} 1 ${FILE4} null CHUNKED ${arg}) # several global filters - SET (arg ${FILE4} --filter GZIP=1 --filter SHUF) - SET (TESTTYPE "TEST") - IF (NOT USE_FILTER_DEFLATE OR NOT USE_FILTER_SHUFFLE) - SET (TESTTYPE "SKIP") - ENDIF (NOT USE_FILTER_DEFLATE OR NOT USE_FILTER_SHUFFLE) + set (arg ${FILE4} --filter GZIP=1 --filter SHUF) + set (TESTTYPE "TEST") + if (NOT USE_FILTER_DEFLATE OR NOT USE_FILTER_SHUFFLE) + set (TESTTYPE "SKIP") + endif (NOT USE_FILTER_DEFLATE OR NOT USE_FILTER_SHUFFLE) ADD_H5_TEST (global_filters ${TESTTYPE} ${arg}) # syntax of -i infile -o outfile # 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 (TESTTYPE "LEGACY") - IF (NOT USE_FILTER_DEFLATE) - SET (TESTTYPE "SKIP") - ENDIF (NOT USE_FILTER_DEFLATE) + set (arg ${FILE4} -l CHUNK=20x10 -f GZIP=1 -m 10 -n -L -c 8 -d 6 -s 8[:dtype]) + set (TESTTYPE "LEGACY") + if (NOT USE_FILTER_DEFLATE) + set (TESTTYPE "SKIP") + endif (NOT USE_FILTER_DEFLATE) ADD_H5_TEST_OLD (old_style_layout_short_switches ${TESTTYPE} ${arg}) # add a userblock to file - SET (arg ${FILE1} -u ${PROJECT_BINARY_DIR}/testfiles/ublock.bin -b 2048) + set (arg ${FILE1} -u ${PROJECT_BINARY_DIR}/testfiles/ublock.bin -b 2048) ADD_H5_TEST (add_userblock "TEST" ${arg}) # add alignment - SET (arg ${FILE1} -t 1 -a 1) + set (arg ${FILE1} -t 1 -a 1) ADD_H5_TEST (add_alignment "TEST" ${arg}) # Check repacking file with old version of layout message (should get upgraded @@ -1064,20 +1064,20 @@ ADD_H5_VERIFY_TEST (ckdim_smaller "TEST" 0 h5repack_layout3.h5 chunk_unlimit3 CO ############################################################################## ### P L U G I N T E S T S ############################################################################## -IF (BUILD_SHARED_LIBS) +if (BUILD_SHARED_LIBS) ADD_H5_UD_TEST (plugin_test 0 h5repack_layout.h5 -v -f UD=257,1,9) ADD_H5_UD_TEST (plugin_none 0 h5repack_layout.UD.h5 -v -f NONE) -ELSE (BUILD_SHARED_LIBS) - MESSAGE (STATUS " **** Plugins libraries must be built as shared libraries **** ") +else (BUILD_SHARED_LIBS) + message (STATUS " **** Plugins libraries must be built as shared libraries **** ") ADD_TEST ( NAME H5REPACK-plugin COMMAND ${CMAKE_COMMAND} -E echo "SKIP H5PLUGIN TESTING" ) -ENDIF (BUILD_SHARED_LIBS) +endif (BUILD_SHARED_LIBS) - IF (HDF5_TEST_VFD) + if (HDF5_TEST_VFD) # Run test with different Virtual File Driver - FOREACH (vfd ${VFD_LIST}) + foreach (vfd ${VFD_LIST}) ADD_VFD_TEST (${vfd} 0) - ENDFOREACH (vfd ${VFD_LIST}) - ENDIF (HDF5_TEST_VFD) + endforeach (vfd ${VFD_LIST}) + endif (HDF5_TEST_VFD) diff --git a/tools/h5stat/CMakeLists.txt b/tools/h5stat/CMakeLists.txt index 6086fc2..a97be07 100644 --- a/tools/h5stat/CMakeLists.txt +++ b/tools/h5stat/CMakeLists.txt @@ -9,30 +9,30 @@ INCLUDE_DIRECTORIES (${HDF5_TOOLS_SRC_DIR}/lib) # -------------------------------------------------------------------- # Add the h5stat executables # -------------------------------------------------------------------- -ADD_EXECUTABLE (h5stat ${HDF5_TOOLS_H5STAT_SOURCE_DIR}/h5stat.c) +add_executable (h5stat ${HDF5_TOOLS_H5STAT_SOURCE_DIR}/h5stat.c) TARGET_NAMING (h5stat ${LIB_TYPE}) TARGET_C_PROPERTIES (h5stat " " " ") -TARGET_LINK_LIBRARIES (h5stat ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) -SET_TARGET_PROPERTIES (h5stat PROPERTIES FOLDER tools) +target_link_libraries (h5stat ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) +set_target_properties (h5stat PROPERTIES FOLDER tools) -SET (H5_DEP_EXECUTABLES h5stat) +set (H5_DEP_EXECUTABLES h5stat) -IF (BUILD_TESTING) +if (BUILD_TESTING) # -------------------------------------------------------------------- # Add the h5stat test executables # -------------------------------------------------------------------- - IF (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) - ADD_EXECUTABLE (h5stat_gentest ${HDF5_TOOLS_H5STAT_SOURCE_DIR}/h5stat_gentest.c) + if (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) + add_executable (h5stat_gentest ${HDF5_TOOLS_H5STAT_SOURCE_DIR}/h5stat_gentest.c) TARGET_NAMING (h5stat_gentest ${LIB_TYPE}) TARGET_C_PROPERTIES (h5stat_gentest " " " ") - TARGET_LINK_LIBRARIES (h5stat_gentest ${HDF5_LIB_TARGET}) - SET_TARGET_PROPERTIES (h5stat_gentest PROPERTIES FOLDER generator/tools) + target_link_libraries (h5stat_gentest ${HDF5_LIB_TARGET}) + set_target_properties (h5stat_gentest PROPERTIES FOLDER generator/tools) #ADD_TEST (NAME h5stat_gentest COMMAND $) - ENDIF (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) + endif (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) - INCLUDE (CMakeTests.cmake) -ENDIF (BUILD_TESTING) + include (CMakeTests.cmake) +endif (BUILD_TESTING) ############################################################################## ############################################################################## @@ -46,7 +46,7 @@ ENDIF (BUILD_TESTING) #INSTALL_PROGRAM_PDB (h5stat ${HDF5_INSTALL_BIN_DIR} toolsapplications) -INSTALL ( +install ( TARGETS h5stat RUNTIME DESTINATION diff --git a/tools/h5stat/CMakeTests.cmake b/tools/h5stat/CMakeTests.cmake index 81ddf82..4ae9ff7 100644 --- a/tools/h5stat/CMakeTests.cmake +++ b/tools/h5stat/CMakeTests.cmake @@ -8,7 +8,7 @@ # -------------------------------------------------------------------- # Copy all the HDF5 files from the test directory into the source directory # -------------------------------------------------------------------- - SET (HDF5_REFERENCE_FILES + set (HDF5_REFERENCE_FILES h5stat_help1.ddl h5stat_help2.ddl h5stat_notexist.ddl @@ -41,34 +41,34 @@ h5stat_numattrs3.ddl h5stat_numattrs4.ddl ) - SET (HDF5_REFERENCE_TEST_FILES + set (HDF5_REFERENCE_TEST_FILES h5stat_filters.h5 h5stat_tsohm.h5 h5stat_newgrat.h5 h5stat_threshold.h5 ) - FOREACH (ddl_file ${HDF5_REFERENCE_FILES}) - SET (ddldest "${PROJECT_BINARY_DIR}/${ddl_file}") - #MESSAGE (STATUS " Translating ${ddl_file}") - ADD_CUSTOM_COMMAND ( + foreach (ddl_file ${HDF5_REFERENCE_FILES}) + set (ddldest "${PROJECT_BINARY_DIR}/${ddl_file}") + #message (STATUS " Translating ${ddl_file}") + add_custom_command ( TARGET h5stat POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${HDF5_TOOLS_H5STAT_SOURCE_DIR}/testfiles/${ddl_file} ${ddldest} ) - ENDFOREACH (ddl_file ${HDF5_REFERENCE_FILES}) + endforeach (ddl_file ${HDF5_REFERENCE_FILES}) - FOREACH (h5_file ${HDF5_REFERENCE_TEST_FILES}) - SET (dest "${PROJECT_BINARY_DIR}/${h5_file}") - #MESSAGE (STATUS " Copying ${h5_file}") - ADD_CUSTOM_COMMAND ( + foreach (h5_file ${HDF5_REFERENCE_TEST_FILES}) + set (dest "${PROJECT_BINARY_DIR}/${h5_file}") + #message (STATUS " Copying ${h5_file}") + add_custom_command ( TARGET h5stat POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${HDF5_TOOLS_H5STAT_SOURCE_DIR}/testfiles/${h5_file} ${dest} ) - ENDFOREACH (h5_file ${HDF5_REFERENCE_TEST_FILES}) + endforeach (h5_file ${HDF5_REFERENCE_TEST_FILES}) ############################################################################## ############################################################################## @@ -78,15 +78,15 @@ MACRO (ADD_H5_TEST resultfile resultcode) # If using memchecker add tests without using scripts - IF (HDF5_ENABLE_USING_MEMCHECKER) + if (HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST (NAME H5STAT-${resultfile} COMMAND $ ${ARGN}) - IF (NOT ${resultcode} STREQUAL "0") + if (NOT ${resultcode} STREQUAL "0") SET_TESTS_PROPERTIES (H5STAT-${resultfile} PROPERTIES WILL_FAIL "true") - ENDIF (NOT ${resultcode} STREQUAL "0") - IF (NOT "${last_test}" STREQUAL "") + endif (NOT ${resultcode} STREQUAL "0") + if (NOT "${last_test}" STREQUAL "") SET_TESTS_PROPERTIES (H5STAT-${resultfile} PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - ELSE (HDF5_ENABLE_USING_MEMCHECKER) + endif (NOT "${last_test}" STREQUAL "") + else (HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( NAME H5STAT-${resultfile}-clear-objects COMMAND ${CMAKE_COMMAND} @@ -104,7 +104,7 @@ -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) SET_TESTS_PROPERTIES (H5STAT-${resultfile} PROPERTIES DEPENDS "H5STAT-${resultfile}-clear-objects") - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) + endif (HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (ADD_H5_TEST file) ############################################################################## @@ -113,7 +113,7 @@ ############################################################################## ############################################################################## - IF (HDF5_ENABLE_USING_MEMCHECKER) + if (HDF5_ENABLE_USING_MEMCHECKER) # Remove any output file left over from previous test run ADD_TEST ( NAME H5STAT-clearall-objects @@ -182,11 +182,11 @@ h5stat_numattrs4.out h5stat_numattrs4.out.err ) - IF (NOT "${last_test}" STREQUAL "") + if (NOT "${last_test}" STREQUAL "") SET_TESTS_PROPERTIES (H5STAT-clearall-objects PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "H5STAT-clearall-objects") - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) + endif (NOT "${last_test}" STREQUAL "") + set (last_test "H5STAT-clearall-objects") + endif (HDF5_ENABLE_USING_MEMCHECKER) # Test for help flag ADD_H5_TEST (h5stat_help1 0 -h) diff --git a/tools/lib/CMakeLists.txt b/tools/lib/CMakeLists.txt index 43ef6ba..5569b6f 100644 --- a/tools/lib/CMakeLists.txt +++ b/tools/lib/CMakeLists.txt @@ -4,13 +4,13 @@ PROJECT (HDF5_TOOLS_LIB) #----------------------------------------------------------------------------- # Apply Definitions to compiler in this directory and below #----------------------------------------------------------------------------- -ADD_DEFINITIONS (${HDF5_EXTRA_C_FLAGS}) +add_definitions (${HDF5_EXTRA_C_FLAGS}) #----------------------------------------------------------------------------- # Define Sources #----------------------------------------------------------------------------- -SET (H5_TOOLS_LIB_SRCS +set (H5_TOOLS_LIB_SRCS ${HDF5_TOOLS_LIB_SOURCE_DIR}/h5diff.c ${HDF5_TOOLS_LIB_SOURCE_DIR}/h5diff_array.c ${HDF5_TOOLS_LIB_SOURCE_DIR}/h5diff_attr.c @@ -26,7 +26,7 @@ SET (H5_TOOLS_LIB_SRCS ${HDF5_TOOLS_LIB_SOURCE_DIR}/h5trav.c ) -SET (H5_TOOLS_LIB_HDRS +set (H5_TOOLS_LIB_HDRS ${HDF5_TOOLS_LIB_SOURCE_DIR}/h5trav.h ${HDF5_TOOLS_LIB_SOURCE_DIR}/h5tools.h ${HDF5_TOOLS_LIB_SOURCE_DIR}/h5tools_dump.h @@ -36,18 +36,18 @@ SET (H5_TOOLS_LIB_HDRS ${HDF5_TOOLS_LIB_SOURCE_DIR}/h5diff.h ) -ADD_LIBRARY (${HDF5_TOOLS_LIB_TARGET} ${LIB_TYPE} ${H5_TOOLS_LIB_SRCS} ${H5_TOOLS_LIB_HDRS}) +add_library (${HDF5_TOOLS_LIB_TARGET} ${LIB_TYPE} ${H5_TOOLS_LIB_SRCS} ${H5_TOOLS_LIB_HDRS}) TARGET_C_PROPERTIES (${HDF5_TOOLS_LIB_TARGET} " " " ") -TARGET_LINK_LIBRARIES (${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) -SET_GLOBAL_VARIABLE (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_TOOLS_LIB_TARGET}") +target_link_libraries (${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) +set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_TOOLS_LIB_TARGET}") H5_SET_LIB_OPTIONS ( ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TOOLS_LIB_NAME} ${LIB_TYPE} HDF5_TOOLS_LIB_NAME_RELEASE HDF5_TOOLS_LIB_NAME_DEBUG ) -#SET_TARGET_PROPERTIES (${HDF5_TOOLS_LIB_TARGET} PROPERTIES COMPILE_DEFINITIONS H5DIFF_DEBUG) -SET_TARGET_PROPERTIES (${HDF5_TOOLS_LIB_TARGET} PROPERTIES FOLDER libraries/tools) +#set_target_properties (${HDF5_TOOLS_LIB_TARGET} PROPERTIES COMPILE_DEFINITIONS H5DIFF_DEBUG) +set_target_properties (${HDF5_TOOLS_LIB_TARGET} PROPERTIES FOLDER libraries/tools) ############################################################################## ############################################################################## @@ -58,7 +58,7 @@ SET_TARGET_PROPERTIES (${HDF5_TOOLS_LIB_TARGET} PROPERTIES FOLDER libraries/tool #----------------------------------------------------------------------------- # Add file(s) to CMake Install #----------------------------------------------------------------------------- -INSTALL ( +install ( FILES ${H5_TOOLS_LIB_HDRS} DESTINATION @@ -71,26 +71,26 @@ INSTALL ( # Because tools are installed into bin/tools we need to make sure the hdf5tools # library will be installed into the proper location. #----------------------------------------------------------------------------- -IF (APPLE) - OPTION (HDF5_BUILD_WITH_INSTALL_NAME "Build with library install_name set to the installation path" OFF) - IF (HDF5_BUILD_WITH_INSTALL_NAME) +if (APPLE) + option (HDF5_BUILD_WITH_INSTALL_NAME "Build with library install_name set to the installation path" OFF) + if (HDF5_BUILD_WITH_INSTALL_NAME) SET_TARGET_PROPERTIES(${HDF5_TOOLS_LIB_TARGET} PROPERTIES LINK_FLAGS "-current_version ${HDF5_PACKAGE_VERSION} -compatibility_version ${HDF5_PACKAGE_VERSION}" INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/lib" BUILD_WITH_INSTALL_RPATH ${HDF5_BUILD_WITH_INSTALL_NAME} ) - ENDIF (HDF5_BUILD_WITH_INSTALL_NAME) -ENDIF (APPLE) + endif (HDF5_BUILD_WITH_INSTALL_NAME) +endif (APPLE) #----------------------------------------------------------------------------- # Add Target(s) to CMake Install for import into other projects #----------------------------------------------------------------------------- -IF (HDF5_EXPORTED_TARGETS) - IF (BUILD_SHARED_LIBS) +if (HDF5_EXPORTED_TARGETS) + if (BUILD_SHARED_LIBS) INSTALL_TARGET_PDB (${HDF5_TOOLS_LIB_TARGET} ${HDF5_INSTALL_LIB_DIR} toolslibraries) - ENDIF (BUILD_SHARED_LIBS) + endif (BUILD_SHARED_LIBS) - INSTALL ( + install ( TARGETS ${HDF5_TOOLS_LIB_TARGET} EXPORT @@ -99,4 +99,4 @@ IF (HDF5_EXPORTED_TARGETS) ARCHIVE DESTINATION ${HDF5_INSTALL_LIB_DIR} COMPONENT toolslibraries RUNTIME DESTINATION ${HDF5_INSTALL_BIN_DIR} COMPONENT toolslibraries ) -ENDIF (HDF5_EXPORTED_TARGETS) +endif (HDF5_EXPORTED_TARGETS) diff --git a/tools/misc/CMakeLists.txt b/tools/misc/CMakeLists.txt index 8e1003e..c1f7454 100644 --- a/tools/misc/CMakeLists.txt +++ b/tools/misc/CMakeLists.txt @@ -10,25 +10,25 @@ INCLUDE_DIRECTORIES (${HDF5_TOOLS_SRC_DIR}/lib) # Add the misc executables # -------------------------------------------------------------------- #-- Misc Executables -ADD_EXECUTABLE (h5debug ${HDF5_TOOLS_MISC_SOURCE_DIR}/h5debug.c) +add_executable (h5debug ${HDF5_TOOLS_MISC_SOURCE_DIR}/h5debug.c) TARGET_NAMING (h5debug ${LIB_TYPE}) TARGET_C_PROPERTIES (h5debug " " " ") -TARGET_LINK_LIBRARIES (h5debug ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) -SET_TARGET_PROPERTIES (h5debug PROPERTIES FOLDER tools) +target_link_libraries (h5debug ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) +set_target_properties (h5debug PROPERTIES FOLDER tools) -ADD_EXECUTABLE (h5repart ${HDF5_TOOLS_MISC_SOURCE_DIR}/h5repart.c) +add_executable (h5repart ${HDF5_TOOLS_MISC_SOURCE_DIR}/h5repart.c) TARGET_NAMING (h5repart ${LIB_TYPE}) TARGET_C_PROPERTIES (h5repart " " " ") -TARGET_LINK_LIBRARIES (h5repart ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) -SET_TARGET_PROPERTIES (h5repart PROPERTIES FOLDER tools) +target_link_libraries (h5repart ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) +set_target_properties (h5repart PROPERTIES FOLDER tools) -ADD_EXECUTABLE (h5mkgrp ${HDF5_TOOLS_MISC_SOURCE_DIR}/h5mkgrp.c) +add_executable (h5mkgrp ${HDF5_TOOLS_MISC_SOURCE_DIR}/h5mkgrp.c) TARGET_NAMING (h5mkgrp ${LIB_TYPE}) TARGET_C_PROPERTIES (h5mkgrp " " " ") -TARGET_LINK_LIBRARIES (h5mkgrp ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) -SET_TARGET_PROPERTIES (h5mkgrp PROPERTIES FOLDER tools) +target_link_libraries (h5mkgrp ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) +set_target_properties (h5mkgrp PROPERTIES FOLDER tools) -SET (H5_DEP_EXECUTABLES +set (H5_DEP_EXECUTABLES h5debug h5repart h5mkgrp @@ -37,31 +37,31 @@ SET (H5_DEP_EXECUTABLES #----------------------------------------------------------------------------- # Generate the h5cc file containing settings needed to compile programs #----------------------------------------------------------------------------- -#IF (NOT WIN32) +#if (NOT WIN32) # CONFIGURE_FILE (${HDF5_TOOLS_MISC_SOURCE_DIR}/h5cc.in ${HDF5_BINARY_DIR}/h5cc @ONLY) -#ENDIF (NOT WIN32) +#endif (NOT WIN32) -IF (BUILD_TESTING) +if (BUILD_TESTING) # -------------------------------------------------------------------- # Add the misc test executables # -------------------------------------------------------------------- - IF (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) - ADD_EXECUTABLE (h5repart_gentest ${HDF5_TOOLS_MISC_SOURCE_DIR}/h5repart_gentest.c) + if (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) + add_executable (h5repart_gentest ${HDF5_TOOLS_MISC_SOURCE_DIR}/h5repart_gentest.c) TARGET_NAMING (h5repart_gentest ${LIB_TYPE}) TARGET_C_PROPERTIES (h5repart_gentest " " " ") - TARGET_LINK_LIBRARIES (h5repart_gentest ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) - SET_TARGET_PROPERTIES (h5repart_gentest PROPERTIES FOLDER generator/tools) + target_link_libraries (h5repart_gentest ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) + set_target_properties (h5repart_gentest PROPERTIES FOLDER generator/tools) #ADD_TEST (NAME h5repart_gentest COMMAND $) - ENDIF (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) + endif (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) - ADD_EXECUTABLE (h5repart_test ${HDF5_TOOLS_MISC_SOURCE_DIR}/repart_test.c) + add_executable (h5repart_test ${HDF5_TOOLS_MISC_SOURCE_DIR}/repart_test.c) TARGET_NAMING (h5repart_test ${LIB_TYPE}) TARGET_C_PROPERTIES (h5repart_test " " " ") - TARGET_LINK_LIBRARIES (h5repart_test ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) - SET_TARGET_PROPERTIES (h5repart_test PROPERTIES FOLDER tools) + target_link_libraries (h5repart_test ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) + set_target_properties (h5repart_test PROPERTIES FOLDER tools) - INCLUDE (CMakeTests.cmake) -ENDIF (BUILD_TESTING) + include (CMakeTests.cmake) +endif (BUILD_TESTING) ############################################################################## ############################################################################## @@ -77,7 +77,7 @@ ENDIF (BUILD_TESTING) #INSTALL_PROGRAM_PDB (h5repart ${HDF5_INSTALL_BIN_DIR} toolsapplications) #INSTALL_PROGRAM_PDB (h5mkgrp ${HDF5_INSTALL_BIN_DIR} toolsapplications) -INSTALL ( +install ( TARGETS h5debug h5repart h5mkgrp RUNTIME DESTINATION diff --git a/tools/misc/CMakeTests.cmake b/tools/misc/CMakeTests.cmake index cc9c5e2..d55e9de 100644 --- a/tools/misc/CMakeTests.cmake +++ b/tools/misc/CMakeTests.cmake @@ -8,7 +8,7 @@ # -------------------------------------------------------------------- # Copy all the HDF5 files from the source directory into the test directory # -------------------------------------------------------------------- - SET (HDF5_REFERENCE_TEST_FILES + set (HDF5_REFERENCE_TEST_FILES family_file00000.h5 family_file00001.h5 family_file00002.h5 @@ -29,18 +29,18 @@ family_file00017.h5 ) - FOREACH (h5_file ${HDF5_REFERENCE_TEST_FILES}) - SET (dest "${PROJECT_BINARY_DIR}/${h5_file}") - #MESSAGE (STATUS " Copying ${h5_file}") - ADD_CUSTOM_COMMAND ( + foreach (h5_file ${HDF5_REFERENCE_TEST_FILES}) + set (dest "${PROJECT_BINARY_DIR}/${h5_file}") + #message (STATUS " Copying ${h5_file}") + add_custom_command ( TARGET h5repart POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${HDF5_TOOLS_SRC_DIR}/testfiles/${h5_file} ${dest} ) - ENDFOREACH (h5_file ${HDF5_REFERENCE_TEST_FILES}) + endforeach (h5_file ${HDF5_REFERENCE_TEST_FILES}) - SET (HDF5_MKGRP_TEST_FILES + set (HDF5_MKGRP_TEST_FILES #h5mkgrp_help.txt #h5mkgrp_version h5mkgrp_single.ls @@ -60,18 +60,18 @@ # make test dir FILE (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") - FOREACH (h5_mkgrp_file ${HDF5_MKGRP_TEST_FILES}) - SET (dest "${PROJECT_BINARY_DIR}/testfiles/${h5_mkgrp_file}") - #MESSAGE (STATUS " Copying ${h5_mkgrp_file}") - ADD_CUSTOM_COMMAND ( + foreach (h5_mkgrp_file ${HDF5_MKGRP_TEST_FILES}) + set (dest "${PROJECT_BINARY_DIR}/testfiles/${h5_mkgrp_file}") + #message (STATUS " Copying ${h5_mkgrp_file}") + add_custom_command ( TARGET h5mkgrp POST_BUILD 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}) + endforeach (h5_mkgrp_file ${HDF5_MKGRP_TEST_FILES}) - ADD_CUSTOM_COMMAND ( + add_custom_command ( TARGET h5mkgrp POST_BUILD COMMAND ${CMAKE_COMMAND} @@ -86,7 +86,7 @@ ############################################################################## MACRO (ADD_H5_TEST resultfile resultcode resultoption) - IF (NOT HDF5_ENABLE_USING_MEMCHECKER) + if (NOT HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( NAME H5MKGRP-${resultfile}-clear-objects COMMAND ${CMAKE_COMMAND} @@ -96,18 +96,18 @@ ${resultfile}.out.err ) SET_TESTS_PROPERTIES (H5MKGRP-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") - ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) + 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 "") + if (HDF5_ENABLE_USING_MEMCHECKER) + if (NOT "${last_test}" STREQUAL "") SET_TESTS_PROPERTIES (H5MKGRP-${resultfile} PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - ELSE (HDF5_ENABLE_USING_MEMCHECKER) + 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}-h5ls @@ -122,13 +122,13 @@ -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) SET_TESTS_PROPERTIES (H5MKGRP-${resultfile}-h5ls PROPERTIES DEPENDS H5MKGRP-${resultfile}) - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) + endif (HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (ADD_H5_TEST resultfile resultcode resultoption) MACRO (ADD_H5_CMP resultfile resultcode) - IF (HDF5_ENABLE_USING_MEMCHECKER) + if (HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST (NAME H5MKGRP_CMP-${resultfile} COMMAND $ ${ARGN}) - ELSE (HDF5_ENABLE_USING_MEMCHECKER) + else (HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( NAME H5MKGRP_CMP-${resultfile}-clear-objects COMMAND ${CMAKE_COMMAND} @@ -150,7 +150,7 @@ -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) SET_TESTS_PROPERTIES (H5MKGRP_CMP-${resultfile} PROPERTIES DEPENDS H5MKGRP_CMP-${resultfile}-clear-objects) - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) + endif (HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (ADD_H5_CMP resultfile resultcode) ############################################################################## @@ -171,10 +171,10 @@ scd_family00003.h5 family_to_sec2.h5 ) - IF (NOT "${last_test}" STREQUAL "") + 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") + endif (NOT "${last_test}" STREQUAL "") + set (last_test "H5REPART-clearall-objects") # repartition family member size to 20,000 bytes. ADD_TEST (NAME H5REPART-h5repart_20K COMMAND $ -m 20000 family_file%05d.h5 fst_family%05d.h5) @@ -192,11 +192,11 @@ 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} + set (H5_DEP_EXECUTABLES ${H5_DEP_EXECUTABLES} h5repart_test ) - IF (HDF5_ENABLE_USING_MEMCHECKER) + if (HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( NAME H5MKGRP-clearall-objects COMMAND ${CMAKE_COMMAND} @@ -243,11 +243,11 @@ h5mkgrp_nested_mult_lp.out.err ) SET_TESTS_PROPERTIES (H5MKGRP-clearall-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") - IF (NOT "${last_test}" STREQUAL "") + 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) + 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") -- cgit v0.12 From 6c5e74942d2cbcb7b53bfad0bf31ae797dc35f31 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 11 Mar 2014 17:07:13 -0500 Subject: [svn-r24782] HDFFV-8700 - KitWare recommendations: Change CMake commands to lower case. --- CMakeInstallation.cmake | 22 ++--- CMakeLists.txt | 4 +- c++/CMakeLists.txt | 2 +- c++/examples/CMakeTests.cmake | 16 ++-- c++/src/CMakeLists.txt | 2 +- c++/test/CMakeLists.txt | 10 +-- c++/test/CMakeTests.cmake | 12 +-- examples/CMakeTests.cmake | 12 +-- fortran/examples/CMakeTests.cmake | 14 +-- fortran/src/CMakeLists.txt | 2 +- fortran/test/CMakeTests.cmake | 10 +-- fortran/testpar/CMakeTests.cmake | 2 +- hl/c++/examples/CMakeTests.cmake | 6 +- hl/c++/test/CMakeTests.cmake | 2 +- hl/examples/CMakeTests.cmake | 8 +- hl/fortran/examples/CMakeTests.cmake | 2 +- hl/fortran/test/CMakeTests.cmake | 10 +-- hl/src/CMakeLists.txt | 9 +- hl/test/CMakeLists.txt | 2 +- hl/test/CMakeTests.cmake | 20 ++--- hl/tools/CMakeLists.txt | 2 +- hl/tools/CMakeTests.cmake | 6 +- perform/CMakeTests.cmake | 24 ++--- release_docs/USING_HDF5_CMake.txt | 2 +- test/CMakeLists.txt | 9 +- test/CMakeTests.cmake | 100 ++++++++++----------- testpar/CMakeTests.cmake | 8 +- tools/h5copy/CMakeLists.txt | 2 +- tools/h5copy/CMakeTests.cmake | 74 ++++++++-------- tools/h5diff/CMakeLists.txt | 2 +- tools/h5diff/CMakeTests.cmake | 46 +++++----- tools/h5dump/CMakeLists.txt | 2 +- tools/h5dump/CMakeTests.cmake | 164 +++++++++++++++++------------------ tools/h5dump/CMakeTestsPBITS.cmake | 22 ++--- tools/h5dump/CMakeTestsXML.cmake | 24 ++--- tools/h5import/CMakeTests.cmake | 50 +++++------ tools/h5jam/CMakeLists.txt | 2 +- tools/h5jam/CMakeTests.cmake | 112 ++++++++++++------------ tools/h5ls/CMakeTests.cmake | 18 ++-- tools/h5repack/CMakeTests.cmake | 118 ++++++++++++------------- tools/h5stat/CMakeLists.txt | 2 +- tools/h5stat/CMakeTests.cmake | 16 ++-- tools/misc/CMakeLists.txt | 4 +- tools/misc/CMakeTests.cmake | 54 ++++++------ 44 files changed, 517 insertions(+), 513 deletions(-) diff --git a/CMakeInstallation.cmake b/CMakeInstallation.cmake index 6506e15..0631c61 100644 --- a/CMakeInstallation.cmake +++ b/CMakeInstallation.cmake @@ -43,7 +43,7 @@ set (HDF5_VERSION_STRING @HDF5_PACKAGE_VERSION@) set (HDF5_VERSION_MAJOR @HDF5_PACKAGE_VERSION_MAJOR@) set (HDF5_VERSION_MINOR @HDF5_PACKAGE_VERSION_MINOR@) -CONFIGURE_FILE ( +configure_file ( ${HDF5_RESOURCES_DIR}/hdf5-config.cmake.build.in ${HDF5_BINARY_DIR}/${HDF5_PACKAGE}${HDF_PACKAGE_EXT}-config.cmake @ONLY ) @@ -52,7 +52,7 @@ CONFIGURE_FILE ( # Configure the FindHDF5.cmake file for the install directory #----------------------------------------------------------------------------- if (NOT HDF5_EXTERNALLY_CONFIGURED) - CONFIGURE_FILE ( + configure_file ( ${HDF5_RESOURCES_DIR}/FindHDF5.cmake.in ${HDF5_BINARY_DIR}/CMakeFiles/FindHDF5${HDF_PACKAGE_EXT}.cmake @ONLY ) @@ -67,7 +67,7 @@ endif (NOT HDF5_EXTERNALLY_CONFIGURED) # Configure the hdf5-config.cmake file for the install directory #----------------------------------------------------------------------------- if (NOT HDF5_EXTERNALLY_CONFIGURED) - CONFIGURE_FILE ( + configure_file ( ${HDF5_RESOURCES_DIR}/hdf5-config.cmake.install.in ${HDF5_BINARY_DIR}/CMakeFiles/${HDF5_PACKAGE}${HDF_PACKAGE_EXT}-config.cmake @ONLY ) @@ -82,7 +82,7 @@ endif (NOT HDF5_EXTERNALLY_CONFIGURED) # Configure the hdf5-config-version .cmake file for the install directory #----------------------------------------------------------------------------- if (NOT HDF5_EXTERNALLY_CONFIGURED) - CONFIGURE_FILE ( + configure_file ( ${HDF5_RESOURCES_DIR}/hdf5-config-version.cmake.in ${HDF5_BINARY_DIR}/CMakeFiles/${HDF5_PACKAGE}${HDF_PACKAGE_EXT}-config-version.cmake @ONLY ) @@ -101,7 +101,7 @@ if (H5_WORDS_BIGENDIAN) else (H5_WORDS_BIGENDIAN) set (BYTESEX little-endian) endif (H5_WORDS_BIGENDIAN) -CONFIGURE_FILE ( +configure_file ( ${HDF5_RESOURCES_DIR}/libhdf5.settings.cmake.in ${HDF5_BINARY_DIR}/libhdf5.settings @ONLY ) @@ -116,7 +116,7 @@ install ( #----------------------------------------------------------------------------- option (HDF5_PACK_EXAMPLES "Package the HDF5 Library Examples Compressed File" OFF) if (HDF5_PACK_EXAMPLES) - CONFIGURE_FILE ( + configure_file ( ${HDF5_RESOURCES_DIR}/HDF518_Examples.cmake.in ${HDF5_BINARY_DIR}/HDF518_Examples.cmake @ONLY ) @@ -179,7 +179,7 @@ if (HDF4_BUILD_FORTRAN) set (BINARY_PLATFORM "${BINARY_PLATFORM} / ${CMAKE_Fortran_COMPILER_ID} Fortran") endif (HDF4_BUILD_FORTRAN) -CONFIGURE_FILE ( +configure_file ( ${HDF5_RESOURCES_DIR}/README.txt.cmake.in ${HDF5_BINARY_DIR}/README.txt @ONLY ) @@ -314,15 +314,15 @@ if (NOT HDF5_EXTERNALLY_CONFIGURED AND NOT HDF5_NO_PACKAGES) #----------------------------------------------------------------------------- # Configure the Info.plist file for the install bundle #----------------------------------------------------------------------------- - CONFIGURE_FILE ( + configure_file ( ${HDF5_RESOURCES_DIR}/CPack.Info.plist.in ${HDF5_BINARY_DIR}/CMakeFiles/Info.plist @ONLY ) - CONFIGURE_FILE ( + configure_file ( ${HDF5_RESOURCES_DIR}/PkgInfo.in ${HDF5_BINARY_DIR}/CMakeFiles/PkgInfo @ONLY ) - CONFIGURE_FILE ( + configure_file ( ${HDF5_RESOURCES_DIR}/version.plist.in ${HDF5_BINARY_DIR}/CMakeFiles/version.plist @ONLY ) @@ -368,7 +368,7 @@ The HDF5 data model, file format, API, library, and tools are open and distribut #----------------------------------------------------------------------------- # Configure the spec file for the install RPM #----------------------------------------------------------------------------- -# CONFIGURE_FILE ("${HDF5_RESOURCES_DIR}/hdf5.spec.in" "${CMAKE_CURRENT_BINARY_DIR}/${HDF5_PACKAGE_NAME}.spec" @ONLY IMMEDIATE) +# configure_file ("${HDF5_RESOURCES_DIR}/hdf5.spec.in" "${CMAKE_CURRENT_BINARY_DIR}/${HDF5_PACKAGE_NAME}.spec" @ONLY IMMEDIATE) # set (CPACK_RPM_USER_BINARY_SPECFILE "${CMAKE_CURRENT_BINARY_DIR}/${HDF5_PACKAGE_NAME}.spec") endif (WIN32) diff --git a/CMakeLists.txt b/CMakeLists.txt index e56e76e..1701667 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -799,7 +799,7 @@ if (BUILD_TESTING) endif (HDF5_TEST_VFD) include (${HDF5_SOURCE_DIR}/CTestConfig.cmake) - CONFIGURE_FILE (${HDF5_RESOURCES_DIR}/CTestCustom.cmake ${HDF5_BINARY_DIR}/CTestCustom.ctest @ONLY) + configure_file (${HDF5_RESOURCES_DIR}/CTestCustom.cmake ${HDF5_BINARY_DIR}/CTestCustom.ctest @ONLY) endif (BUILD_TESTING) #----------------------------------------------------------------------------- @@ -890,6 +890,6 @@ endif (EXISTS "${HDF5_SOURCE_DIR}/hl" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/hl") #----------------------------------------------------------------------------- # Generate the H5pubconf.h file containing user settings needed by compilation #----------------------------------------------------------------------------- -CONFIGURE_FILE (${HDF5_RESOURCES_DIR}/H5pubconf.h.in ${HDF5_BINARY_DIR}/H5pubconf.h @ONLY) +configure_file (${HDF5_RESOURCES_DIR}/H5pubconf.h.in ${HDF5_BINARY_DIR}/H5pubconf.h @ONLY) include (CMakeInstallation.cmake) diff --git a/c++/CMakeLists.txt b/c++/CMakeLists.txt index 9b560a6..06d4609 100644 --- a/c++/CMakeLists.txt +++ b/c++/CMakeLists.txt @@ -18,7 +18,7 @@ endif (BUILD_SHARED_LIBS) #----------------------------------------------------------------------------- # Generate configure file #----------------------------------------------------------------------------- -CONFIGURE_FILE (${HDF5_RESOURCES_DIR}/H5cxx_config.h.in +configure_file (${HDF5_RESOURCES_DIR}/H5cxx_config.h.in ${HDF5_BINARY_DIR}/H5cxx_pubconf.h ) diff --git a/c++/examples/CMakeTests.cmake b/c++/examples/CMakeTests.cmake index 5725f8e..352b799 100644 --- a/c++/examples/CMakeTests.cmake +++ b/c++/examples/CMakeTests.cmake @@ -5,7 +5,7 @@ ############################################################################## ############################################################################## # Remove any output file left over from previous test run - ADD_TEST ( + add_test ( NAME cpp_ex-clear-objects COMMAND ${CMAKE_COMMAND} -E remove @@ -16,14 +16,14 @@ Select.h5 ) if (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (cpp_ex-clear-objects PROPERTIES DEPENDS ${last_test}) + set_tests_properties (cpp_ex-clear-objects PROPERTIES DEPENDS ${last_test}) endif (NOT "${last_test}" STREQUAL "") set (last_test "cpp_ex-clear-objects") foreach (example ${examples}) - ADD_TEST (NAME cpp_ex_${example} COMMAND $) + add_test (NAME cpp_ex_${example} COMMAND $) if (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (cpp_ex_${example} PROPERTIES DEPENDS ${last_test}) + set_tests_properties (cpp_ex_${example} PROPERTIES DEPENDS ${last_test}) endif (NOT "${last_test}" STREQUAL "") set (last_test "cpp_ex_${example}") endforeach (example ${examples}) @@ -31,7 +31,7 @@ # SET_TESTS_PROPERTIES(cpp_ex_readdata PROPERTIES DEPENDS cpp_ex_create) # SET_TESTS_PROPERTIES(cpp_ex_chunks PROPERTIES DEPENDS cpp_ex_extend_ds) - ADD_TEST ( + add_test ( NAME cpp_ex_tutr-clear-objects COMMAND ${CMAKE_COMMAND} -E remove @@ -43,14 +43,14 @@ h5tutr_subset.h5 ) if (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (cpp_ex_tutr-clear-objects PROPERTIES DEPENDS ${last_test}) + set_tests_properties (cpp_ex_tutr-clear-objects PROPERTIES DEPENDS ${last_test}) endif (NOT "${last_test}" STREQUAL "") set (last_test "cpp_ex_tutr-clear-objects") foreach (example ${tutr_examples}) - ADD_TEST (NAME cpp_ex_${example} COMMAND $) + add_test (NAME cpp_ex_${example} COMMAND $) if (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (cpp_ex_${example} PROPERTIES DEPENDS ${last_test}) + set_tests_properties (cpp_ex_${example} PROPERTIES DEPENDS ${last_test}) endif (NOT "${last_test}" STREQUAL "") set (last_test "cpp_ex_${example}") endforeach (example ${tutr_examples}) diff --git a/c++/src/CMakeLists.txt b/c++/src/CMakeLists.txt index 15eeacc..502a192 100644 --- a/c++/src/CMakeLists.txt +++ b/c++/src/CMakeLists.txt @@ -11,7 +11,7 @@ endif (BUILD_SHARED_LIBS) #----------------------------------------------------------------------------- # Generate configure file #----------------------------------------------------------------------------- -CONFIGURE_FILE (${HDF5_RESOURCES_DIR}/H5cxx_config.h.in +configure_file (${HDF5_RESOURCES_DIR}/H5cxx_config.h.in ${HDF5_BINARY_DIR}/H5cxx_pubconf.h ) diff --git a/c++/test/CMakeLists.txt b/c++/test/CMakeLists.txt index 01a0179..ec2a32f 100644 --- a/c++/test/CMakeLists.txt +++ b/c++/test/CMakeLists.txt @@ -30,10 +30,7 @@ set (CPP_TEST_SRCS # Generate the H5srcdir_str.h file containing user settings needed by compilation #----------------------------------------------------------------------------- set (srcdir ${CMAKE_CURRENT_SOURCE_DIR}) -CONFIGURE_FILE (${HDF5_CPP_TEST_SOURCE_DIR}/H5srcdir_str.h.in H5srcdir_str.h @ONLY) -INCLUDE_DIRECTORIES (${CMAKE_CURRENT_BINARY_DIR}) - -INCLUDE_DIRECTORIES (${HDF5_TEST_SRC_DIR} ) +configure_file (${HDF5_CPP_TEST_SOURCE_DIR}/H5srcdir_str.h.in H5srcdir_str.h @ONLY) add_executable (cpp_testhdf5 ${CPP_TEST_SRCS} ) TARGET_NAMING (cpp_testhdf5 ${LIB_TYPE}) @@ -43,7 +40,10 @@ target_link_libraries (cpp_testhdf5 ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET} ) -set_target_properties (cpp_testhdf5 PROPERTIES FOLDER test/cpp) +set_target_properties (cpp_testhdf5 PROPERTIES + FOLDER test/cpp + INTERFACE_INCLUDE_DIRECTORIES "$/include>" +) add_custom_command ( TARGET cpp_testhdf5 diff --git a/c++/test/CMakeTests.cmake b/c++/test/CMakeTests.cmake index ac1f111..2b05fea 100644 --- a/c++/test/CMakeTests.cmake +++ b/c++/test/CMakeTests.cmake @@ -5,7 +5,7 @@ ############################################################################## ############################################################################## # Remove any output file left over from previous test run -ADD_TEST ( +add_test ( NAME cpp_testhdf5-clear-objects COMMAND ${CMAKE_COMMAND} -E remove @@ -17,8 +17,8 @@ ADD_TEST ( tfattrs.h5 ) -ADD_TEST (NAME cpp_testhdf5 COMMAND $) -SET_TESTS_PROPERTIES (cpp_testhdf5 PROPERTIES DEPENDS cpp_testhdf5-clear-objects) +add_test (NAME cpp_testhdf5 COMMAND $) +set_tests_properties (cpp_testhdf5 PROPERTIES DEPENDS cpp_testhdf5-clear-objects) if (HDF5_TEST_VFD) @@ -37,7 +37,7 @@ if (HDF5_TEST_VFD) MACRO (ADD_VFD_TEST vfdname resultcode) if (NOT HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( + add_test ( NAME VFD-${vfdname}-cpp_testhdf5-clear-objects COMMAND ${CMAKE_COMMAND} -E remove @@ -48,7 +48,7 @@ if (HDF5_TEST_VFD) tattr_scalar.h5 tfattrs.h5 ) - ADD_TEST ( + add_test ( NAME VFD-${vfdname}-cpp_testhdf5 COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$" @@ -59,7 +59,7 @@ if (HDF5_TEST_VFD) -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" -P "${HDF5_RESOURCES_DIR}/vfdTest.cmake" ) - SET_TESTS_PROPERTIES (VFD-${vfdname}-cpp_testhdf5 PROPERTIES DEPENDS VFD-${vfdname}-cpp_testhdf5-clear-objects) + set_tests_properties (VFD-${vfdname}-cpp_testhdf5 PROPERTIES DEPENDS VFD-${vfdname}-cpp_testhdf5-clear-objects) endif (NOT HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (ADD_VFD_TEST) diff --git a/examples/CMakeTests.cmake b/examples/CMakeTests.cmake index a8a9829..9f51d74 100644 --- a/examples/CMakeTests.cmake +++ b/examples/CMakeTests.cmake @@ -7,7 +7,7 @@ FILE (MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/red ${PROJECT_BINARY_DIR}/blue ${PROJECT_BINARY_DIR}/u2w) # Remove any output file left over from previous test run - ADD_TEST ( + add_test ( NAME EXAMPLES-clear-objects COMMAND ${CMAKE_COMMAND} -E remove @@ -44,22 +44,22 @@ u2w/u2w_target.h5 ) if (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (EXAMPLES-clear-objects PROPERTIES DEPENDS ${last_test}) + set_tests_properties (EXAMPLES-clear-objects PROPERTIES DEPENDS ${last_test}) endif (NOT "${last_test}" STREQUAL "") set (last_test "EXAMPLES-clear-objects") foreach (example ${examples}) - ADD_TEST (NAME EXAMPLES-${example} COMMAND $) + add_test (NAME EXAMPLES-${example} COMMAND $) if (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (EXAMPLES-${example} PROPERTIES DEPENDS ${last_test}) + set_tests_properties (EXAMPLES-${example} PROPERTIES DEPENDS ${last_test}) endif (NOT "${last_test}" STREQUAL "") set (last_test "EXAMPLES-${example}") endforeach (example ${examples}) if (H5_HAVE_PARALLEL) - ADD_TEST (NAME EXAMPLES-ph5example COMMAND $) + add_test (NAME EXAMPLES-ph5example COMMAND $) if (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (EXAMPLES-ph5example PROPERTIES DEPENDS ${last_test}) + set_tests_properties (EXAMPLES-ph5example PROPERTIES DEPENDS ${last_test}) endif (NOT "${last_test}" STREQUAL "") set (last_test "EXAMPLES-ph5example") endif (H5_HAVE_PARALLEL) diff --git a/fortran/examples/CMakeTests.cmake b/fortran/examples/CMakeTests.cmake index 997d7a1..57aec53 100644 --- a/fortran/examples/CMakeTests.cmake +++ b/fortran/examples/CMakeTests.cmake @@ -6,7 +6,7 @@ ############################################################################## # Remove any output file left over from previous test run - ADD_TEST ( + add_test ( NAME f90_ex-clear-objects COMMAND ${CMAKE_COMMAND} -E remove @@ -25,28 +25,28 @@ subset.h5 ) if (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (f90_ex-clear-objects PROPERTIES DEPENDS ${last_test}) + set_tests_properties (f90_ex-clear-objects PROPERTIES DEPENDS ${last_test}) endif (NOT "${last_test}" STREQUAL "") set (last_test "f90_ex-clear-objects") foreach (example ${examples}) - ADD_TEST (NAME f90_ex_${example} COMMAND $) + add_test (NAME f90_ex_${example} COMMAND $) if (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (f90_ex_${example} PROPERTIES DEPENDS ${last_test}) + set_tests_properties (f90_ex_${example} PROPERTIES DEPENDS ${last_test}) endif (NOT "${last_test}" STREQUAL "") set (last_test "f90_ex_${example}") endforeach (example ${examples}) if (HDF5_ENABLE_F2003) foreach (example ${F2003_examples}) - ADD_TEST (NAME f03_ex_${example} COMMAND $) + add_test (NAME f03_ex_${example} COMMAND $) if (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (f03_ex_${example} PROPERTIES DEPENDS ${last_test}) + set_tests_properties (f03_ex_${example} PROPERTIES DEPENDS ${last_test}) endif (NOT "${last_test}" STREQUAL "") set (last_test "f03_ex_${example}") endforeach (example ${F2003_examples}) endif (HDF5_ENABLE_F2003) if (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) - ADD_TEST (NAME f90_ex_ph5example COMMAND ${MPIEXEC} ${MPIEXEC_PREFLAGS} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_POSTFLAGS} $) + add_test (NAME f90_ex_ph5example COMMAND ${MPIEXEC} ${MPIEXEC_PREFLAGS} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_POSTFLAGS} $) endif (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) diff --git a/fortran/src/CMakeLists.txt b/fortran/src/CMakeLists.txt index bc87906..90f5aae 100644 --- a/fortran/src/CMakeLists.txt +++ b/fortran/src/CMakeLists.txt @@ -12,7 +12,7 @@ if (WIN32 AND NOT CYGWIN) if (NOT HDF5_ENABLE_F2003) set (H5_NOF03EXP ";") endif (NOT HDF5_ENABLE_F2003) - CONFIGURE_FILE (${HDF5_F90_SRC_SOURCE_DIR}/hdf5_fortrandll.def.in ${HDF5_F90_SRC_BINARY_DIR}/hdf5_fortrandll.def @ONLY) + configure_file (${HDF5_F90_SRC_SOURCE_DIR}/hdf5_fortrandll.def.in ${HDF5_F90_SRC_BINARY_DIR}/hdf5_fortrandll.def @ONLY) endif (MSVC) endif (BUILD_SHARED_LIBS) endif (WIN32 AND NOT CYGWIN) diff --git a/fortran/test/CMakeTests.cmake b/fortran/test/CMakeTests.cmake index 87d691f..5b674db 100644 --- a/fortran/test/CMakeTests.cmake +++ b/fortran/test/CMakeTests.cmake @@ -5,22 +5,22 @@ ############################################################################## ############################################################################## -ADD_TEST (NAME testhdf5_fortran COMMAND $) +add_test (NAME testhdf5_fortran COMMAND $) SET_TESTS_PROPERTIES(testhdf5_fortran PROPERTIES PASS_REGULAR_EXPRESSION "[ ]*0 error.s") #-- Adding test for testhdf5_fortran_1_8 -ADD_TEST (NAME testhdf5_fortran_1_8 COMMAND $) +add_test (NAME testhdf5_fortran_1_8 COMMAND $) SET_TESTS_PROPERTIES(testhdf5_fortran_1_8 PROPERTIES PASS_REGULAR_EXPRESSION "[ ]*0 error.s") #-- Adding test for fortranlib_test_F03 if (HDF5_ENABLE_F2003) - ADD_TEST (NAME fortranlib_test_F03 COMMAND $) + add_test (NAME fortranlib_test_F03 COMMAND $) SET_TESTS_PROPERTIES(fortranlib_test_F03 PROPERTIES PASS_REGULAR_EXPRESSION "[ ]*0 error.s") endif (HDF5_ENABLE_F2003) #-- Adding test for fflush1 -ADD_TEST (NAME fflush1 COMMAND $) +add_test (NAME fflush1 COMMAND $) #-- Adding test for fflush2 -ADD_TEST (NAME fflush2 COMMAND $) +add_test (NAME fflush2 COMMAND $) SET_TESTS_PROPERTIES(fflush2 PROPERTIES DEPENDS fflush1) diff --git a/fortran/testpar/CMakeTests.cmake b/fortran/testpar/CMakeTests.cmake index 2cd7ed0..f418e1a 100644 --- a/fortran/testpar/CMakeTests.cmake +++ b/fortran/testpar/CMakeTests.cmake @@ -4,4 +4,4 @@ ### T E S T I N G ### ############################################################################## ############################################################################## -ADD_TEST (NAME parallel_test COMMAND ${MPIEXEC} ${MPIEXEC_PREFLAGS} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_POSTFLAGS} $) +add_test (NAME parallel_test COMMAND ${MPIEXEC} ${MPIEXEC_PREFLAGS} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_POSTFLAGS} $) diff --git a/hl/c++/examples/CMakeTests.cmake b/hl/c++/examples/CMakeTests.cmake index c73ceeb..dc279e5 100644 --- a/hl/c++/examples/CMakeTests.cmake +++ b/hl/c++/examples/CMakeTests.cmake @@ -5,12 +5,12 @@ ############################################################################## ############################################################################## # Remove any output file left over from previous test run -ADD_TEST ( +add_test ( NAME cpp_hl_ex_ptExampleFL-clear-objects COMMAND ${CMAKE_COMMAND} -E remove PTcppexampleFL.h5 ) -ADD_TEST (NAME cpp_hl_ex_ptExampleFL COMMAND $) -SET_TESTS_PROPERTIES (cpp_hl_ex_ptExampleFL PROPERTIES DEPENDS cpp_hl_ex_ptExampleFL-clear-objects) +add_test (NAME cpp_hl_ex_ptExampleFL COMMAND $) +set_tests_properties (cpp_hl_ex_ptExampleFL PROPERTIES DEPENDS cpp_hl_ex_ptExampleFL-clear-objects) diff --git a/hl/c++/test/CMakeTests.cmake b/hl/c++/test/CMakeTests.cmake index cb9454b..5386624 100644 --- a/hl/c++/test/CMakeTests.cmake +++ b/hl/c++/test/CMakeTests.cmake @@ -5,4 +5,4 @@ ############################################################################## ############################################################################## - ADD_TEST (NAME hl_ptableTest COMMAND $) + add_test (NAME hl_ptableTest COMMAND $) diff --git a/hl/examples/CMakeTests.cmake b/hl/examples/CMakeTests.cmake index 380c1ec..bc51183 100644 --- a/hl/examples/CMakeTests.cmake +++ b/hl/examples/CMakeTests.cmake @@ -22,7 +22,7 @@ foreach (h5_file ${HDF5_TEST_FILES}) endforeach (h5_file ${HDF5_TEST_FILES}) # Remove any output file left over from previous test run - ADD_TEST ( + add_test ( NAME hl_ex-clear-objects COMMAND ${CMAKE_COMMAND} -E remove @@ -47,14 +47,14 @@ endforeach (h5_file ${HDF5_TEST_FILES}) ex_ds1.h5 ) if (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (hl_ex-clear-objects PROPERTIES DEPENDS ${last_test}) + set_tests_properties (hl_ex-clear-objects PROPERTIES DEPENDS ${last_test}) endif (NOT "${last_test}" STREQUAL "") set (last_test "hl_ex-clear-objects") foreach (example ${examples}) - ADD_TEST (NAME hl_ex_${example} COMMAND $) + add_test (NAME hl_ex_${example} COMMAND $) if (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (hl_ex_${example} PROPERTIES DEPENDS ${last_test}) + set_tests_properties (hl_ex_${example} PROPERTIES DEPENDS ${last_test}) endif (NOT "${last_test}" STREQUAL "") set (last_test "hl_ex_${example}") endforeach (example ${examples}) diff --git a/hl/fortran/examples/CMakeTests.cmake b/hl/fortran/examples/CMakeTests.cmake index 1eb7b47..1784041 100644 --- a/hl/fortran/examples/CMakeTests.cmake +++ b/hl/fortran/examples/CMakeTests.cmake @@ -6,5 +6,5 @@ ############################################################################## foreach (example ${examples}) - ADD_TEST (NAME hl_f90_ex_${example} COMMAND $) + add_test (NAME hl_f90_ex_${example} COMMAND $) endforeach (example ${examples}) diff --git a/hl/fortran/test/CMakeTests.cmake b/hl/fortran/test/CMakeTests.cmake index 81253bd..94bb385 100644 --- a/hl/fortran/test/CMakeTests.cmake +++ b/hl/fortran/test/CMakeTests.cmake @@ -6,7 +6,7 @@ ############################################################################## # Remove any output file left over from previous test run -ADD_TEST ( +add_test ( NAME hl_fortran_test-clear-objects COMMAND ${CMAKE_COMMAND} -E remove @@ -20,10 +20,10 @@ ADD_TEST ( tstds.h5 ) -ADD_TEST (NAME hl_f90_tstds COMMAND $) +add_test (NAME hl_f90_tstds COMMAND $) -ADD_TEST (NAME hl_f90_tstlite COMMAND $) +add_test (NAME hl_f90_tstlite COMMAND $) -ADD_TEST (NAME hl_f90_tstimage COMMAND $) +add_test (NAME hl_f90_tstimage COMMAND $) -ADD_TEST (NAME hl_f90_tsttable COMMAND $) +add_test (NAME hl_f90_tsttable COMMAND $) diff --git a/hl/src/CMakeLists.txt b/hl/src/CMakeLists.txt index 5bfac2a..7a4e411 100644 --- a/hl/src/CMakeLists.txt +++ b/hl/src/CMakeLists.txt @@ -11,8 +11,6 @@ endif (BUILD_SHARED_LIBS) #----------------------------------------------------------------------------- # List Source files #----------------------------------------------------------------------------- -INCLUDE_DIRECTORIES (${HDF5_HL_SRC_DIR}/src) - set (HL_SRCS ${HDF5_HL_SRC_SOURCE_DIR}/H5DO.c ${HDF5_HL_SRC_SOURCE_DIR}/H5DS.c @@ -38,9 +36,12 @@ set (HL_HEADERS add_library (${HDF5_HL_LIB_TARGET} ${LIB_TYPE} ${HL_SRCS} ${HL_HEADERS}) TARGET_C_PROPERTIES (${HDF5_HL_LIB_TARGET} " " " ") target_link_libraries (${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET}) -set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_HL_LIB_TARGET}") H5_SET_LIB_OPTIONS (${HDF5_HL_LIB_TARGET} ${HDF5_HL_LIB_NAME} ${LIB_TYPE}) -set_target_properties (${HDF5_HL_LIB_TARGET} PROPERTIES FOLDER libraries/hl) +set_target_properties (${HDF5_HL_LIB_TARGET} PROPERTIES + FOLDER libraries/hl + INTERFACE_INCLUDE_DIRECTORIES "$/include>" +) +set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_HL_LIB_TARGET}") #----------------------------------------------------------------------------- # Add file(s) to CMake Install diff --git a/hl/test/CMakeLists.txt b/hl/test/CMakeLists.txt index 2853438..32b049a 100644 --- a/hl/test/CMakeLists.txt +++ b/hl/test/CMakeLists.txt @@ -12,7 +12,7 @@ PROJECT (HDF5_HL_TEST) # Generate the H5srcdir_str.h file containing user settings needed by compilation #----------------------------------------------------------------------------- set (srcdir ${CMAKE_CURRENT_SOURCE_DIR}) -CONFIGURE_FILE (${HDF5_HL_TEST_SOURCE_DIR}/H5srcdir_str.h.in H5srcdir_str.h @ONLY) +configure_file (${HDF5_HL_TEST_SOURCE_DIR}/H5srcdir_str.h.in H5srcdir_str.h @ONLY) INCLUDE_DIRECTORIES (${CMAKE_CURRENT_BINARY_DIR}) INCLUDE_DIRECTORIES (${HDF5_TEST_SRC_DIR}) diff --git a/hl/test/CMakeTests.cmake b/hl/test/CMakeTests.cmake index ebbc353..fda388a 100644 --- a/hl/test/CMakeTests.cmake +++ b/hl/test/CMakeTests.cmake @@ -9,9 +9,9 @@ # Macro used to add a unit test # -------------------------------------------------------------------- MACRO (HL_ADD_TEST hl_name files) - ADD_TEST (NAME hl_${hl_name} COMMAND $) + add_test (NAME hl_${hl_name} COMMAND $) if (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (hl_${hl_name} PROPERTIES DEPENDS ${last_test}) + set_tests_properties (hl_${hl_name} PROPERTIES DEPENDS ${last_test}) endif (NOT "${last_test}" STREQUAL "") # -------------------------------------------------------------------- @@ -31,7 +31,7 @@ MACRO (HL_ADD_TEST hl_name files) ENDMACRO (HL_ADD_TEST) # Remove any output file left over from previous test run -ADD_TEST ( +add_test ( NAME hl_test-clear-objects COMMAND ${CMAKE_COMMAND} -E remove @@ -61,13 +61,13 @@ ADD_TEST ( test_table.h5 ) if (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (hl_test-clear-objects PROPERTIES DEPENDS ${last_test}) + set_tests_properties (hl_test-clear-objects PROPERTIES DEPENDS ${last_test}) endif (NOT "${last_test}" STREQUAL "") set (last_test "hl_test-clear-objects") -HL_ADD_TEST (test_ds "dsdata.txt;dslat.txt;dslon.txt;test_ds_be.h5;test_ds_le.h5") -HL_ADD_TEST (test_dset_opt "") -HL_ADD_TEST (test_image "image8.txt;sepia.pal;earth.pal;image24pixel.txt;image24plane.txt;usa.wri") -HL_ADD_TEST (test_lite "dtype_file.txt") -HL_ADD_TEST (test_packet "") -HL_ADD_TEST (test_table "test_table_be.h5;test_table_cray.h5;test_table_le.h5") +HL_add_test (test_ds "dsdata.txt;dslat.txt;dslon.txt;test_ds_be.h5;test_ds_le.h5") +HL_add_test (test_dset_opt "") +HL_add_test (test_image "image8.txt;sepia.pal;earth.pal;image24pixel.txt;image24plane.txt;usa.wri") +HL_add_test (test_lite "dtype_file.txt") +HL_add_test (test_packet "") +HL_add_test (test_table "test_table_be.h5;test_table_cray.h5;test_table_le.h5") diff --git a/hl/tools/CMakeLists.txt b/hl/tools/CMakeLists.txt index a8674e7..a3db367 100644 --- a/hl/tools/CMakeLists.txt +++ b/hl/tools/CMakeLists.txt @@ -47,7 +47,7 @@ if (BUILD_TESTING) target_link_libraries (hl_h52gifgentest ${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET}) set_target_properties (hl_h52gifgentest PROPERTIES FOLDER generator/tools/hl) -# ADD_TEST (NAME hl_h52gifgentest COMMAND $) +# add_test (NAME hl_h52gifgentest COMMAND $) endif (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) include (CMakeTests.cmake) diff --git a/hl/tools/CMakeTests.cmake b/hl/tools/CMakeTests.cmake index df419c3..7c5bd77 100644 --- a/hl/tools/CMakeTests.cmake +++ b/hl/tools/CMakeTests.cmake @@ -27,7 +27,7 @@ add_custom_command ( ) # Remove any output file left over from previous test run -ADD_TEST ( +add_test ( NAME HL_TOOLS-clear-objects COMMAND ${CMAKE_COMMAND} -E remove @@ -35,6 +35,6 @@ ADD_TEST ( image1.h5 ) -ADD_TEST (NAME HL_TOOLS_h52gif COMMAND $ testfiles/h52giftst.h5 image1.gif -i image) +add_test (NAME HL_TOOLS_h52gif COMMAND $ testfiles/h52giftst.h5 image1.gif -i image) -ADD_TEST (NAME HL_TOOLS_gif2h5 COMMAND $ testfiles/image1.gif image1.h5) +add_test (NAME HL_TOOLS_gif2h5 COMMAND $ testfiles/image1.gif image1.h5) diff --git a/perform/CMakeTests.cmake b/perform/CMakeTests.cmake index 1b93753..f8a5846 100644 --- a/perform/CMakeTests.cmake +++ b/perform/CMakeTests.cmake @@ -17,7 +17,7 @@ add_custom_command ( #----------------------------------------------------------------------------- # Remove any output file left over from previous test run -ADD_TEST ( +add_test ( NAME PERFORM_h5perform-clear-objects COMMAND ${CMAKE_COMMAND} -E remove @@ -31,31 +31,31 @@ ADD_TEST ( x-gnuplot ) -ADD_TEST (NAME PERFORM_h5perf_serial COMMAND $) +add_test (NAME PERFORM_h5perf_serial COMMAND $) if (HDF5_BUILD_PERFORM_STANDALONE) - ADD_TEST (NAME PERFORM_h5perf_serial_alone COMMAND $) + add_test (NAME PERFORM_h5perf_serial_alone COMMAND $) endif (HDF5_BUILD_PERFORM_STANDALONE) -ADD_TEST (NAME PERFORM_chunk COMMAND $) +add_test (NAME PERFORM_chunk COMMAND $) -ADD_TEST (NAME PERFORM_iopipe COMMAND $) +add_test (NAME PERFORM_iopipe COMMAND $) -ADD_TEST (NAME PERFORM_overhead COMMAND $) +add_test (NAME PERFORM_overhead COMMAND $) -ADD_TEST (NAME PERFORM_perf_meta COMMAND $) +add_test (NAME PERFORM_perf_meta COMMAND $) -ADD_TEST (NAME PERFORM_zip_perf_help COMMAND $ "-h") -ADD_TEST (NAME PERFORM_zip_perf COMMAND $ tfilters.h5) +add_test (NAME PERFORM_zip_perf_help COMMAND $ "-h") +add_test (NAME PERFORM_zip_perf COMMAND $ tfilters.h5) if (H5_HAVE_PARALLEL) - ADD_TEST (NAME PERFORM_h5perf COMMAND ${MPIEXEC} ${MPIEXEC_PREFLAGS} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_POSTFLAGS} $) + add_test (NAME PERFORM_h5perf COMMAND ${MPIEXEC} ${MPIEXEC_PREFLAGS} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_POSTFLAGS} $) if (HDF5_BUILD_PERFORM_STANDALONE) - ADD_TEST (NAME PERFORM_h5perf_alone COMMAND ${MPIEXEC} ${MPIEXEC_PREFLAGS} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_POSTFLAGS} $) + add_test (NAME PERFORM_h5perf_alone COMMAND ${MPIEXEC} ${MPIEXEC_PREFLAGS} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_POSTFLAGS} $) endif (HDF5_BUILD_PERFORM_STANDALONE) if (HDF5_BUILD_PARALLEL_ALL) - ADD_TEST (NAME PERFORM_benchpar COMMAND ${MPIEXEC} ${MPIEXEC_PREFLAGS} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_POSTFLAGS} $) + add_test (NAME PERFORM_benchpar COMMAND ${MPIEXEC} ${MPIEXEC_PREFLAGS} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_POSTFLAGS} $) endif (HDF5_BUILD_PARALLEL_ALL) endif (H5_HAVE_PARALLEL) diff --git a/release_docs/USING_HDF5_CMake.txt b/release_docs/USING_HDF5_CMake.txt index 227a89c..9a50525 100644 --- a/release_docs/USING_HDF5_CMake.txt +++ b/release_docs/USING_HDF5_CMake.txt @@ -203,7 +203,7 @@ target_link_libraries (${example} ${LINK_LIBS}) ENABLE_TESTING () include (CTest) -ADD_TEST (NAME test_example COMMAND ${example}) +add_test (NAME test_example COMMAND ${example}) ########################################################## diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index ff975f0..7bc9d3b 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -10,7 +10,7 @@ add_definitions (${HDF5_EXTRA_C_FLAGS}) # 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) +configure_file (${HDF5_TEST_SOURCE_DIR}/H5srcdir_str.h.in H5srcdir_str.h @ONLY) INCLUDE_DIRECTORIES (${CMAKE_CURRENT_BINARY_DIR}) #----------------------------------------------------------------------------- @@ -36,7 +36,10 @@ if (MINGW) endif (MINGW) 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) +set_target_properties (${HDF5_TEST_LIB_TARGET} PROPERTIES + FOLDER libraries/test + INTERFACE_INCLUDE_DIRECTORIES "$/include>" +) #----------------------------------------------------------------------------- # If plugin library tests can be tested @@ -290,7 +293,7 @@ set_target_properties (links_env PROPERTIES FOLDER test) #-- Adding test for libinfo set (GREP_RUNNER ${PROJECT_BINARY_DIR}/GrepRunner.cmake) -FILE (WRITE ${GREP_RUNNER} +file (WRITE ${GREP_RUNNER} "FILE (STRINGS \${TEST_PROGRAM} TEST_RESULT REGEX \"SUMMARY OF THE HDF5 CONFIGURATION\") if (\${TEST_RESULT} STREQUAL \"0\") message (FATAL_ERROR \"Failed: The output: \${TEST_RESULT} of \${TEST_PROGRAM} did not contain SUMMARY OF THE HDF5 CONFIGURATION\") diff --git a/test/CMakeTests.cmake b/test/CMakeTests.cmake index dbfe489..33fbff6 100644 --- a/test/CMakeTests.cmake +++ b/test/CMakeTests.cmake @@ -137,7 +137,7 @@ foreach (h5_file ${HDF5_REFERENCE_TEST_FILES}) endforeach (h5_file ${HDF5_REFERENCE_TEST_FILES}) # Remove any output file left over from previous test run -ADD_TEST ( +add_test ( NAME h5test-clear-testhdf5-objects COMMAND ${CMAKE_COMMAND} -E remove @@ -161,21 +161,21 @@ ADD_TEST ( ) 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) + 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) + add_test (NAME testhdf5 COMMAND $) + set_tests_properties (testhdf5 PROPERTIES DEPENDS h5test-clear-testhdf5-objects) endif (HDF5_ENABLE_USING_MEMCHECKER) ############################################################################## @@ -185,7 +185,7 @@ endif (HDF5_ENABLE_USING_MEMCHECKER) ############################################################################## # Remove any output file left over from previous test run -ADD_TEST ( +add_test ( NAME h5test-clear-objects COMMAND ${CMAKE_COMMAND} -E remove @@ -249,11 +249,11 @@ ADD_TEST ( ) foreach (test ${H5_TESTS}) - ADD_TEST (NAME ${test} COMMAND $) - SET_TESTS_PROPERTIES(${test} PROPERTIES DEPENDS h5test-clear-objects) + add_test (NAME ${test} COMMAND $) + set_tests_properties (${test} PROPERTIES DEPENDS h5test-clear-objects) endforeach (test ${H5_TESTS}) -SET_TESTS_PROPERTIES(flush2 PROPERTIES DEPENDS flush1) +set_tests_properties (flush2 PROPERTIES DEPENDS flush1) ############################################################################## ############################################################################## @@ -262,38 +262,38 @@ SET_TESTS_PROPERTIES(flush2 PROPERTIES DEPENDS flush1) ############################################################################## #-- Adding test for cache -ADD_TEST ( +add_test ( NAME h5test-clear-cache-objects COMMAND ${CMAKE_COMMAND} -E remove cache_test.h5 ) -ADD_TEST (NAME cache COMMAND $) -SET_TESTS_PROPERTIES(cache PROPERTIES DEPENDS h5test-clear-cache-objects) +add_test (NAME cache COMMAND $) +set_tests_properties (cache PROPERTIES DEPENDS h5test-clear-cache-objects) #-- Adding test for cache_api -ADD_TEST ( +add_test ( NAME h5test-clear-cache_api-objects COMMAND ${CMAKE_COMMAND} -E remove cache_api_test.h5 ) -ADD_TEST (NAME cache_api COMMAND $) -SET_TESTS_PROPERTIES(cache_api PROPERTIES DEPENDS h5test-clear-cache_api-objects) +add_test (NAME cache_api COMMAND $) +set_tests_properties (cache_api PROPERTIES DEPENDS h5test-clear-cache_api-objects) #-- Adding test for cache_tagging -ADD_TEST ( +add_test ( NAME h5test-clear-cache_tagging-objects COMMAND ${CMAKE_COMMAND} -E remove tagging_test.h5 tagging_ext_test.h5 ) -ADD_TEST (NAME cache_tagging COMMAND $) -SET_TESTS_PROPERTIES(cache_tagging PROPERTIES DEPENDS h5test-clear-cache_tagging-objects) +add_test (NAME cache_tagging COMMAND $) +set_tests_properties (cache_tagging PROPERTIES DEPENDS h5test-clear-cache_tagging-objects) #-- Adding test for ttsafe -ADD_TEST ( +add_test ( NAME h5test-clear-ttsafe-objects COMMAND ${CMAKE_COMMAND} -E remove @@ -302,19 +302,19 @@ ADD_TEST ( ttsafe_cancel.h5 ttsafe_acreate.h5 ) -ADD_TEST (NAME ttsafe COMMAND $) -SET_TESTS_PROPERTIES(ttsafe PROPERTIES DEPENDS h5test-clear-ttsafe-objects) +add_test (NAME ttsafe COMMAND $) +set_tests_properties (ttsafe PROPERTIES DEPENDS h5test-clear-ttsafe-objects) #-- Adding test for err_compat if (HDF5_ENABLE_DEPRECATED_SYMBOLS) - ADD_TEST ( + add_test ( NAME h5test-clear-err_compat-objects COMMAND ${CMAKE_COMMAND} -E remove err_compat.txt err_compat.txt.err ) - ADD_TEST (NAME err_compat COMMAND "${CMAKE_COMMAND}" + add_test (NAME err_compat COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$" -D "TEST_ARGS:STRING=" -D "TEST_EXPECT=0" @@ -324,18 +324,18 @@ if (HDF5_ENABLE_DEPRECATED_SYMBOLS) -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) - SET_TESTS_PROPERTIES(err_compat PROPERTIES DEPENDS h5test-clear-err_compat-objects) + set_tests_properties (err_compat PROPERTIES DEPENDS h5test-clear-err_compat-objects) endif (HDF5_ENABLE_DEPRECATED_SYMBOLS) #-- Adding test for error_test -ADD_TEST ( +add_test ( NAME h5test-clear-error_test-objects COMMAND ${CMAKE_COMMAND} -E remove error_test.txt error_test.txt.err ) -ADD_TEST (NAME error_test COMMAND "${CMAKE_COMMAND}" +add_test (NAME error_test COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$" -D "TEST_ARGS:STRING=" -D "TEST_EXPECT=0" @@ -345,11 +345,11 @@ ADD_TEST (NAME error_test COMMAND "${CMAKE_COMMAND}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" -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=::") +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_TEST ( +add_test ( NAME h5test-clear-links_env-objects COMMAND ${CMAKE_COMMAND} -E remove @@ -359,7 +359,7 @@ ADD_TEST ( extlinks_env1.h5 tmp/extlinks_env1.h5 ) -ADD_TEST (NAME links_env COMMAND "${CMAKE_COMMAND}" +add_test (NAME links_env COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$" -D "TEST_ARGS:STRING=" -D "TEST_ENV_VAR:STRING=HDF5_EXT_PREFIX" @@ -370,10 +370,10 @@ ADD_TEST (NAME links_env COMMAND "${CMAKE_COMMAND}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) -SET_TESTS_PROPERTIES(links_env PROPERTIES DEPENDS h5test-clear-links_env-objects) +set_tests_properties (links_env PROPERTIES DEPENDS h5test-clear-links_env-objects) #-- Adding test for libinfo -ADD_TEST (NAME testlibinfo COMMAND ${CMAKE_COMMAND} -D "TEST_PROGRAM=$" -P "${GREP_RUNNER}") +add_test (NAME testlibinfo COMMAND ${CMAKE_COMMAND} -D "TEST_PROGRAM=$" -P "${GREP_RUNNER}") ############################################################################## ### P L U G I N T E S T S @@ -381,16 +381,16 @@ ADD_TEST (NAME testlibinfo COMMAND ${CMAKE_COMMAND} -D "TEST_PROGRAM=$) - SET_TESTS_PROPERTIES (H5PLUGIN-plugin PROPERTIES ENVIRONMENT "HDF5_PLUGIN_PATH=${CMAKE_BINARY_DIR}/testdir1${CMAKE_SEP}${CMAKE_BINARY_DIR}/testdir2") + add_test (NAME H5PLUGIN-plugin COMMAND $) + 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 ( + add_test ( NAME H5PLUGIN-SKIPPED COMMAND ${CMAKE_COMMAND} -E echo "SKIP H5PLUGIN TESTING" ) @@ -475,7 +475,7 @@ if (HDF5_TEST_VFD) MACRO (ADD_VFD_TEST vfdname resultcode) foreach (test ${H5_VFD_TESTS}) - ADD_TEST ( + add_test ( NAME VFD-${vfdname}-${test} COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$" @@ -488,7 +488,7 @@ if (HDF5_TEST_VFD) ) endforeach (test ${H5_VFD_TESTS}) if (HDF5_TEST_FHEAP_VFD) - ADD_TEST ( + add_test ( NAME VFD-${vfdname}-fheap COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$" diff --git a/testpar/CMakeTests.cmake b/testpar/CMakeTests.cmake index 6e1f823..9e4f97b 100644 --- a/testpar/CMakeTests.cmake +++ b/testpar/CMakeTests.cmake @@ -5,16 +5,16 @@ ############################################################################## ############################################################################## -ADD_TEST (NAME TEST_PAR_testphdf5 COMMAND ${MPIEXEC} ${MPIEXEC_PREFLAGS} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_POSTFLAGS} $) +add_test (NAME TEST_PAR_testphdf5 COMMAND ${MPIEXEC} ${MPIEXEC_PREFLAGS} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_POSTFLAGS} $) foreach (testp ${H5P_TESTS}) - ADD_TEST (NAME TEST_PAR_${testp} COMMAND ${MPIEXEC} ${MPIEXEC_PREFLAGS} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_POSTFLAGS} $) + add_test (NAME TEST_PAR_${testp} COMMAND ${MPIEXEC} ${MPIEXEC_PREFLAGS} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_POSTFLAGS} $) endforeach (testp ${H5P_TESTS}) SET_TESTS_PROPERTIES(TEST_PAR_t_pflush2 PROPERTIES DEPENDS TEST_PAR_t_pflush1) if (NOT WIN32) - ADD_TEST (NAME TEST_PAR_t_posix_compliant COMMAND ${MPIEXEC} ${MPIEXEC_PREFLAGS} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_POSTFLAGS} $) + add_test (NAME TEST_PAR_t_posix_compliant COMMAND ${MPIEXEC} ${MPIEXEC_PREFLAGS} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_POSTFLAGS} $) endif (NOT WIN32) if (HDF5_TEST_VFD) @@ -40,7 +40,7 @@ if (HDF5_TEST_VFD) MACRO (ADD_VFD_TEST vfdname resultcode) if (NOT HDF5_ENABLE_USING_MEMCHECKER) foreach (test ${H5P_VFD_TESTS}) - ADD_TEST ( + add_test ( NAME VFD-${vfdname}-${test} COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$" diff --git a/tools/h5copy/CMakeLists.txt b/tools/h5copy/CMakeLists.txt index 79deec9..66cbae6 100644 --- a/tools/h5copy/CMakeLists.txt +++ b/tools/h5copy/CMakeLists.txt @@ -25,7 +25,7 @@ if (BUILD_TESTING) target_link_libraries (h5copygentest ${HDF5_LIB_TARGET}) set_target_properties (h5copygentest PROPERTIES FOLDER generator/tools) - #ADD_TEST (NAME h5copygentest COMMAND $) + #add_test (NAME h5copygentest COMMAND $) endif (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) include (CMakeTests.cmake) diff --git a/tools/h5copy/CMakeTests.cmake b/tools/h5copy/CMakeTests.cmake index 0d8f121..34976fe 100644 --- a/tools/h5copy/CMakeTests.cmake +++ b/tools/h5copy/CMakeTests.cmake @@ -45,7 +45,7 @@ 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 ( + add_test ( NAME H5COPY_F-${testname}-clear-objects COMMAND ${CMAKE_COMMAND} -E remove @@ -53,27 +53,27 @@ ) endif (NOT HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( + add_test ( NAME H5COPY_F-${testname} COMMAND $ -f ${fparam} -i ./testfiles/${infile} -o ./testfiles/${testname}.out.h5 ${vparam} ${sparam} ${srcname} ${dparam} ${dstname} ${ARGN} ) if (HDF5_ENABLE_USING_MEMCHECKER) if (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5COPY_F-${testname} PROPERTIES DEPENDS ${last_test}) + 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) + 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 ( + 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") + 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) @@ -81,7 +81,7 @@ 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 ( + add_test ( NAME H5COPY-${testname}-clear-objects COMMAND ${CMAKE_COMMAND} -E remove @@ -89,27 +89,27 @@ ) endif (NOT HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( + add_test ( NAME H5COPY-${testname} COMMAND $ -i ./testfiles/${infile} -o ./testfiles/${testname}.out.h5 ${vparam} ${sparam} ${srcname} ${dparam} ${dstname} ${ARGN} ) if (HDF5_ENABLE_USING_MEMCHECKER) if (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5COPY-${testname} PROPERTIES DEPENDS ${last_test}) + 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) + 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 ( + 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") + set_tests_properties (H5COPY-${testname}-DIFF PROPERTIES WILL_FAIL "true") endif (${resultcode} STREQUAL "1") endif (NOT ${resultcode} STREQUAL "2") ENDMACRO (ADD_H5_TEST) @@ -117,7 +117,7 @@ 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 ( + add_test ( NAME H5COPY-${testname}-clear-objects COMMAND ${CMAKE_COMMAND} -E remove @@ -125,32 +125,32 @@ ) endif (NOT HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( + 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}) + 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) + set_tests_properties (H5COPY-${testname}-prefill PROPERTIES DEPENDS H5COPY-${testname}-clear-objects) endif (HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( + 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) + 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 ( + 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") + set_tests_properties (H5COPY-${testname}-DIFF PROPERTIES WILL_FAIL "true") endif (${resultcode} STREQUAL "1") endif (NOT ${resultcode} STREQUAL "2") ENDMACRO (ADD_H5_TEST2) @@ -158,7 +158,7 @@ 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 ( + add_test ( NAME H5COPY_SAME-${testname}-clear-objects COMMAND ${CMAKE_COMMAND} -E remove @@ -166,32 +166,32 @@ ) endif (NOT HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( + 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) if (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5COPY_SAME-${testname}-prefill PROPERTIES DEPENDS ${last_test}) + 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) + set_tests_properties (H5COPY_SAME-${testname}-prefill PROPERTIES DEPENDS H5COPY_SAME-${testname}-clear-objects) endif (HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( + 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) + 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 ( + add_test ( NAME H5COPY_SAME-${testname}-DIFF COMMAND $ -q ./testfiles/${testname}.out.h5 ./testfiles/${testname}.out.h5 ${srcname} ${dstname} ) 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") + 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) @@ -203,16 +203,16 @@ 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/${testname}.out.h5 ${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") + 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}) + 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 ( + add_test ( NAME H5COPY-CMP-${testname}-clear-objects COMMAND ${CMAKE_COMMAND} -E remove @@ -220,7 +220,7 @@ ./testfiles/${testname}.out.out ./testfiles/${testname}.out.out.err ) - ADD_TEST ( + add_test ( NAME H5COPY-CMP-${testname} COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$" @@ -232,7 +232,7 @@ -D "TEST_MASK=true" -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) - SET_TESTS_PROPERTIES (H5COPY-CMP-${testname} PROPERTIES DEPENDS H5COPY-CMP-${testname}-clear-objects) + set_tests_properties (H5COPY-CMP-${testname} PROPERTIES DEPENDS H5COPY-CMP-${testname}-clear-objects) endif (HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (ADD_H5_CMP_TEST) @@ -252,7 +252,7 @@ if (HDF5_ENABLE_USING_MEMCHECKER) # Remove any output file left over from previous test run - ADD_TEST ( + add_test ( NAME H5COPY-clearall-objects COMMAND ${CMAKE_COMMAND} -E remove @@ -291,9 +291,9 @@ h5copy_misc1.out.out h5copy_misc1.out.out.err ) - SET_TESTS_PROPERTIES (H5COPY-clearall-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") + 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}) + 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) diff --git a/tools/h5diff/CMakeLists.txt b/tools/h5diff/CMakeLists.txt index 3ef108b..f660c12 100644 --- a/tools/h5diff/CMakeLists.txt +++ b/tools/h5diff/CMakeLists.txt @@ -42,7 +42,7 @@ if (BUILD_TESTING) target_link_libraries (h5diffgentest ${HDF5_LIB_TARGET}) set_target_properties (h5diffgentest PROPERTIES FOLDER generator/tools) - #ADD_TEST (NAME h5diffgentest COMMAND $) + #add_test (NAME h5diffgentest COMMAND $) endif (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) include (CMakeTests.cmake) diff --git a/tools/h5diff/CMakeTests.cmake b/tools/h5diff/CMakeTests.cmake index f13f689..8bae2ca 100644 --- a/tools/h5diff/CMakeTests.cmake +++ b/tools/h5diff/CMakeTests.cmake @@ -293,21 +293,21 @@ MACRO (ADD_H5_TEST resultfile resultcode) # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST (NAME H5DIFF-${resultfile} COMMAND $ ${ARGN}) - SET_TESTS_PROPERTIES (H5DIFF-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") + add_test (NAME H5DIFF-${resultfile} COMMAND $ ${ARGN}) + set_tests_properties (H5DIFF-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") if (NOT ${resultcode} STREQUAL "0") - SET_TESTS_PROPERTIES (H5DIFF-${resultfile} PROPERTIES WILL_FAIL "true") + set_tests_properties (H5DIFF-${resultfile} PROPERTIES WILL_FAIL "true") endif (NOT ${resultcode} STREQUAL "0") if (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5DIFF-${resultfile} PROPERTIES DEPENDS ${last_test}) + set_tests_properties (H5DIFF-${resultfile} PROPERTIES DEPENDS ${last_test}) endif (NOT "${last_test}" STREQUAL "") else (HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( + add_test ( NAME H5DIFF-${resultfile}-clear-objects COMMAND ${CMAKE_COMMAND} -E remove ./testfiles/${resultfile}.out ./testfiles/${resultfile}.out.err ) - ADD_TEST ( + add_test ( NAME H5DIFF-${resultfile} COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$" @@ -319,7 +319,7 @@ -D "TEST_APPEND=EXIT CODE:" -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) - SET_TESTS_PROPERTIES (H5DIFF-${resultfile} PROPERTIES DEPENDS "H5DIFF-${resultfile}-clear-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}) @@ -329,21 +329,21 @@ MACRO (ADD_PH5_TEST resultfile resultcode) # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST (NAME PH5DIFF-${resultfile} COMMAND $ ${MPIEXEC} ${MPIEXEC_PREFLAGS} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_POSTFLAGS} ${ARGN}) - SET_TESTS_PROPERTIES (PH5DIFF-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") + add_test (NAME PH5DIFF-${resultfile} COMMAND $ ${MPIEXEC} ${MPIEXEC_PREFLAGS} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_POSTFLAGS} ${ARGN}) + set_tests_properties (PH5DIFF-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") if (NOT ${resultcode} STREQUAL "0") - SET_TESTS_PROPERTIES (PH5DIFF-${resultfile} PROPERTIES WILL_FAIL "true") + set_tests_properties (PH5DIFF-${resultfile} PROPERTIES WILL_FAIL "true") endif (NOT ${resultcode} STREQUAL "0") if (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (PH5DIFF-${resultfile} PROPERTIES DEPENDS ${last_test}) + set_tests_properties (PH5DIFF-${resultfile} PROPERTIES DEPENDS ${last_test}) endif (NOT "${last_test}" STREQUAL "") else (HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( + add_test ( NAME PH5DIFF-${resultfile}-clear-objects COMMAND ${CMAKE_COMMAND} -E remove ./testfiles/${resultfile}_p.out ./testfiles/${resultfile}_p.out.err ) - ADD_TEST ( + add_test ( NAME PH5DIFF-${resultfile} COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=${MPIEXEC};${MPIEXEC_PREFLAGS};${MPIEXEC_NUMPROC_FLAG};${MPIEXEC_MAX_NUMPROCS};${MPIEXEC_POSTFLAGS};$" @@ -357,7 +357,7 @@ -D "TEST_SKIP_COMPARE=TRUE" -P "${HDF5_RESOURCES_DIR}/prunTest.cmake" ) - SET_TESTS_PROPERTIES (PH5DIFF-${resultfile} PROPERTIES DEPENDS "PH5DIFF-${resultfile}-clear-objects") + set_tests_properties (PH5DIFF-${resultfile} PROPERTIES DEPENDS "PH5DIFF-${resultfile}-clear-objects") endif (HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (ADD_PH5_TEST file) @@ -367,28 +367,28 @@ MACRO (ADD_H5_NO_OUTPUT_TEST testname resultcode) # If using memchecker add tests without using scripts if (NOT HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( + add_test ( 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-${testname}-clear-objects PROPERTIES DEPENDS ${last_test}) + set_tests_properties (H5DIFF-${testname}-clear-objects PROPERTIES DEPENDS ${last_test}) endif (NOT "${last_test}" STREQUAL "") endif (NOT HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST (NAME H5DIFF-${testname} COMMAND $ ${ARGN}) + add_test (NAME H5DIFF-${testname} COMMAND $ ${ARGN}) if (NOT ${resultcode} STREQUAL "0") - SET_TESTS_PROPERTIES (H5DIFF-${testname} PROPERTIES WILL_FAIL "true") + set_tests_properties (H5DIFF-${testname} PROPERTIES WILL_FAIL "true") endif (NOT ${resultcode} STREQUAL "0") if (HDF5_ENABLE_USING_MEMCHECKER) if (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5DIFF-${testname} PROPERTIES DEPENDS ${last_test}) + 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) + set_tests_properties (H5DIFF-${testname} PROPERTIES DEPENDS H5DIFF-${testname}-clear-objects) endif (HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (ADD_H5_NO_OUTPUT_TEST) @@ -450,7 +450,7 @@ if (HDF5_ENABLE_USING_MEMCHECKER) # Remove any output file left over from previous test run - ADD_TEST ( + add_test ( NAME H5DIFF-clearall-objects COMMAND ${CMAKE_COMMAND} -E remove @@ -801,9 +801,9 @@ h5diff_90.out h5diff_90.out.err ) - SET_TESTS_PROPERTIES (H5DIFF-clearall-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") + set_tests_properties (H5DIFF-clearall-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") if (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5DIFF-clearall-objects PROPERTIES DEPENDS ${last_test}) + set_tests_properties (H5DIFF-clearall-objects PROPERTIES DEPENDS ${last_test}) endif (NOT "${last_test}" STREQUAL "") set (last_test "H5DIFF-clearall-objects") endif (HDF5_ENABLE_USING_MEMCHECKER) diff --git a/tools/h5dump/CMakeLists.txt b/tools/h5dump/CMakeLists.txt index ce162ad..387c4bf 100644 --- a/tools/h5dump/CMakeLists.txt +++ b/tools/h5dump/CMakeLists.txt @@ -32,7 +32,7 @@ if (BUILD_TESTING) target_link_libraries (h5dumpgentest ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) set_target_properties (h5dumpgentest PROPERTIES FOLDER generator/tools) - #ADD_TEST (NAME h5dumpgentest COMMAND $) + #add_test (NAME h5dumpgentest COMMAND $) endif (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) include (CMakeTests.cmake) diff --git a/tools/h5dump/CMakeTests.cmake b/tools/h5dump/CMakeTests.cmake index 486b21c..433faa3 100644 --- a/tools/h5dump/CMakeTests.cmake +++ b/tools/h5dump/CMakeTests.cmake @@ -393,20 +393,20 @@ MACRO (ADD_HELP_TEST testname resultcode) # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST (NAME H5DUMP-${testname} COMMAND $ ${ARGN}) - SET_TESTS_PROPERTIES (H5DUMP-${testname} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") + add_test (NAME H5DUMP-${testname} COMMAND $ ${ARGN}) + set_tests_properties (H5DUMP-${testname} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") if (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5DUMP-${testname} PROPERTIES DEPENDS ${last_test}) + set_tests_properties (H5DUMP-${testname} PROPERTIES DEPENDS ${last_test}) endif (NOT "${last_test}" STREQUAL "") set (last_test "H5DUMP-${testname}") else (HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( + add_test ( NAME H5DUMP-h5dump-${testname}-clear-objects COMMAND ${CMAKE_COMMAND} -E remove h5dump-${testname}.out h5dump-${testname}.out.err ) - SET_TESTS_PROPERTIES (H5DUMP-h5dump-${testname}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") - ADD_TEST ( + 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}" -D "TEST_PROGRAM=$" @@ -417,14 +417,14 @@ -D "TEST_REFERENCE=h5dump-${testname}.txt" -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) - SET_TESTS_PROPERTIES (H5DUMP-h5dump-${testname} PROPERTIES DEPENDS "H5DUMP-h5dump-${testname}-clear-objects") + set_tests_properties (H5DUMP-h5dump-${testname} PROPERTIES DEPENDS "H5DUMP-h5dump-${testname}-clear-objects") endif (HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (ADD_HELP_TEST) MACRO (ADD_SKIP_H5_TEST skipresultfile skipresultcode testtype) if (${testtype} STREQUAL "SKIP") if (NOT HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( + add_test ( NAME H5DUMP-${skipresultfile}-SKIPPED COMMAND ${CMAKE_COMMAND} -E echo "SKIP ${skipresultfile} ${ARGN}" ) @@ -437,22 +437,22 @@ MACRO (ADD_H5_TEST resultfile resultcode) # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST (NAME H5DUMP-${resultfile} COMMAND $ ${ARGN}) - SET_TESTS_PROPERTIES (H5DUMP-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") + add_test (NAME H5DUMP-${resultfile} COMMAND $ ${ARGN}) + 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") + 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}) + set_tests_properties (H5DUMP-${resultfile} PROPERTIES DEPENDS ${last_test}) endif (NOT "${last_test}" STREQUAL "") else (HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( + add_test ( NAME H5DUMP-${resultfile}-clear-objects COMMAND ${CMAKE_COMMAND} -E remove ${resultfile}.bin ${resultfile}.out ${resultfile}.out.err ) - SET_TESTS_PROPERTIES (H5DUMP-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") - ADD_TEST ( + 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=$" @@ -463,29 +463,29 @@ -D "TEST_REFERENCE=${resultfile}.ddl" -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) - SET_TESTS_PROPERTIES (H5DUMP-${resultfile} PROPERTIES DEPENDS "H5DUMP-${resultfile}-clear-objects") + set_tests_properties (H5DUMP-${resultfile} PROPERTIES DEPENDS "H5DUMP-${resultfile}-clear-objects") endif (HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (ADD_H5_TEST file) MACRO (ADD_H5_TEST_N resultfile resultcode) # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST (NAME H5DUMP-N-${resultfile} COMMAND $ ${ARGN}) - SET_TESTS_PROPERTIES (H5DUMP-N-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") + add_test (NAME H5DUMP-N-${resultfile} COMMAND $ ${ARGN}) + set_tests_properties (H5DUMP-N-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") if (NOT ${resultcode} STREQUAL "0") - SET_TESTS_PROPERTIES (H5DUMP-N-${resultfile} PROPERTIES WILL_FAIL "true") + set_tests_properties (H5DUMP-N-${resultfile} PROPERTIES WILL_FAIL "true") endif (NOT ${resultcode} STREQUAL "0") if (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5DUMP-N-${resultfile} PROPERTIES DEPENDS ${last_test}) + set_tests_properties (H5DUMP-N-${resultfile} PROPERTIES DEPENDS ${last_test}) endif (NOT "${last_test}" STREQUAL "") else (HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( + add_test ( NAME H5DUMP-N-${resultfile}-clear-objects COMMAND ${CMAKE_COMMAND} -E remove ${resultfile}-N.bin ${resultfile}-N.out ${resultfile}-N.out.err ) - SET_TESTS_PROPERTIES (H5DUMP-N-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") - ADD_TEST ( + set_tests_properties (H5DUMP-N-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") + add_test ( NAME H5DUMP-N-${resultfile} COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$" @@ -496,29 +496,29 @@ -D "TEST_REFERENCE=${resultfile}.ddl" -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) - SET_TESTS_PROPERTIES (H5DUMP-N-${resultfile} PROPERTIES DEPENDS "H5DUMP-N-${resultfile}-clear-objects") + set_tests_properties (H5DUMP-N-${resultfile} PROPERTIES DEPENDS "H5DUMP-N-${resultfile}-clear-objects") endif (HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (ADD_H5_TEST_N file) MACRO (ADD_H5_TEST_EXPORT resultfile targetfile resultcode) # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST (NAME H5DUMP-${resultfile} COMMAND $ ${ARGN} ${resultfile}.txt ${targetfile}) - SET_TESTS_PROPERTIES (H5DUMP-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") + add_test (NAME H5DUMP-${resultfile} COMMAND $ ${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") + 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}) + set_tests_properties (H5DUMP-${resultfile} PROPERTIES DEPENDS ${last_test}) endif (NOT "${last_test}" STREQUAL "") else (HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( + add_test ( NAME H5DUMP-${resultfile}-clear-objects COMMAND ${CMAKE_COMMAND} -E remove ${resultfile}.txt ${resultfile}.out ${resultfile}.out.err ) - SET_TESTS_PROPERTIES (H5DUMP-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") - ADD_TEST ( + 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=$" @@ -529,36 +529,36 @@ -D "TEST_REFERENCE=${resultfile}.ddl" -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) - SET_TESTS_PROPERTIES (H5DUMP-${resultfile} PROPERTIES DEPENDS "H5DUMP-${resultfile}-clear-objects") - ADD_TEST ( + 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}) + 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") + 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") + 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}) + set_tests_properties (H5DUMP-${resultfile} PROPERTIES DEPENDS ${last_test}) endif (NOT "${last_test}" STREQUAL "") else (HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( + 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 ( + 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=$" @@ -569,57 +569,57 @@ -D "TEST_REFERENCE=${resultfile}.ddl" -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) - SET_TESTS_PROPERTIES (H5DUMP-${resultfile} PROPERTIES DEPENDS "H5DUMP-${resultfile}-clear-objects") - ADD_TEST ( + 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 ( + 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) + 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) if (NOT HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( + 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 ( + 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 ( + 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") - SET_TESTS_PROPERTIES (H5DUMP-output-cmp-${resultfile} PROPERTIES DEPENDS H5DUMP-output-${resultfile}) + 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-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 ( + 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 ( + 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=$" @@ -631,19 +631,19 @@ -D "TEST_MASK_ERROR=true" -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) - SET_TESTS_PROPERTIES (H5DUMP-${resultfile} PROPERTIES DEPENDS "H5DUMP-${resultfile}-clear-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 ( + 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 ( + 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=$" @@ -656,19 +656,19 @@ -D "TEST_MASK_ERROR=true" -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) - SET_TESTS_PROPERTIES (H5DUMP-${resultfile} PROPERTIES DEPENDS "H5DUMP-${resultfile}-clear-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_H5ERR_MASK_ENV_TEST resultfile resultcode envvar envval) if (NOT HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( + 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 ( + 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=$" @@ -683,20 +683,20 @@ -D "TEST_ENV_VALUE:STRING=${envval}" -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) - SET_TESTS_PROPERTIES (H5DUMP-${resultfile} PROPERTIES DEPENDS "H5DUMP-${resultfile}-clear-objects") + set_tests_properties (H5DUMP-${resultfile} PROPERTIES DEPENDS "H5DUMP-${resultfile}-clear-objects") endif (NOT HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (ADD_H5ERR_MASK_ENV_TEST) 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 ( + 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 ( + 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=$" @@ -707,13 +707,13 @@ -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}) + 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) @@ -725,7 +725,7 @@ if (HDF5_ENABLE_USING_MEMCHECKER) # Remove any output file left over from previous test run - ADD_TEST ( + add_test ( NAME H5DUMP-clearall-objects COMMAND ${CMAKE_COMMAND} -E remove @@ -1052,9 +1052,9 @@ zerodim.out zerodim.out.err ) - SET_TESTS_PROPERTIES (H5DUMP-clearall-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") + set_tests_properties (H5DUMP-clearall-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") if (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5DUMP-clearall-objects PROPERTIES DEPENDS ${last_test}) + set_tests_properties (H5DUMP-clearall-objects PROPERTIES DEPENDS ${last_test}) endif (NOT "${last_test}" STREQUAL "") set (last_test "H5DUMP-clearall-objects") endif (HDF5_ENABLE_USING_MEMCHECKER) diff --git a/tools/h5dump/CMakeTestsPBITS.cmake b/tools/h5dump/CMakeTestsPBITS.cmake index 3a279b5..a920198 100644 --- a/tools/h5dump/CMakeTestsPBITS.cmake +++ b/tools/h5dump/CMakeTestsPBITS.cmake @@ -131,22 +131,22 @@ MACRO (ADD_H5_PBITS_TEST resultfile resultcode) # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST (NAME H5DUMP-${resultfile} COMMAND $ ${ARGN}) - SET_TESTS_PROPERTIES (H5DUMP-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/pbits") + add_test (NAME H5DUMP-${resultfile} COMMAND $ ${ARGN}) + set_tests_properties (H5DUMP-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/pbits") if (NOT ${resultcode} STREQUAL "0") - SET_TESTS_PROPERTIES (H5DUMP-${resultfile} PROPERTIES WILL_FAIL "true") + set_tests_properties (H5DUMP-${resultfile} PROPERTIES WILL_FAIL "true") endif (NOT ${resultcode} STREQUAL "0") if (NOT "${last_pbits_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5DUMP-${resultfile} PROPERTIES DEPENDS ${last_pbits_test}) + set_tests_properties (H5DUMP-${resultfile} PROPERTIES DEPENDS ${last_pbits_test}) endif (NOT "${last_pbits_test}" STREQUAL "") else (HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( + 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/pbits") - ADD_TEST ( + set_tests_properties (H5DUMP-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/pbits") + add_test ( NAME H5DUMP-${resultfile} COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$" @@ -157,7 +157,7 @@ -D "TEST_REFERENCE=${resultfile}.ddl" -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) - SET_TESTS_PROPERTIES (H5DUMP-${resultfile} PROPERTIES DEPENDS "H5DUMP-${resultfile}-clear-objects") + set_tests_properties (H5DUMP-${resultfile} PROPERTIES DEPENDS "H5DUMP-${resultfile}-clear-objects") endif (HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (ADD_H5_PBITS_TEST file) @@ -169,7 +169,7 @@ if (HDF5_ENABLE_USING_MEMCHECKER) # Remove any output file left over from previous test run - ADD_TEST ( + add_test ( NAME H5DUMP_PACKED_BITS-clearall-objects COMMAND ${CMAKE_COMMAND} -E remove @@ -280,9 +280,9 @@ tpbitsUnsignedLongLong16.out tpbitsUnsignedLongLong16.out.err ) - SET_TESTS_PROPERTIES (H5DUMP_PACKED_BITS-clearall-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/pbits") + set_tests_properties (H5DUMP_PACKED_BITS-clearall-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/pbits") if (NOT "${last_pbits_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5DUMP_PACKED_BITS-clearall-objects PROPERTIES DEPENDS ${last_pbits_test}) + 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) diff --git a/tools/h5dump/CMakeTestsXML.cmake b/tools/h5dump/CMakeTestsXML.cmake index ce7fdf7..ffc1cae 100644 --- a/tools/h5dump/CMakeTestsXML.cmake +++ b/tools/h5dump/CMakeTestsXML.cmake @@ -160,7 +160,7 @@ MACRO (ADD_XML_SKIP_H5_TEST skipresultfile skipresultcode testtype) if (${testtype} STREQUAL "SKIP") if (NOT HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( + add_test ( NAME H5DUMP-XML-${skipresultfile}-SKIPPED COMMAND ${CMAKE_COMMAND} -E echo "SKIP ${skipresultfile}.xml --xml ${ARGN}" ) @@ -172,22 +172,22 @@ MACRO (ADD_XML_H5_TEST resultfile resultcode) if (HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST (NAME H5DUMP-XML-${resultfile} COMMAND $ --xml ${ARGN}) - SET_TESTS_PROPERTIES (H5DUMP-XML-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/xml") + add_test (NAME H5DUMP-XML-${resultfile} COMMAND $ --xml ${ARGN}) + set_tests_properties (H5DUMP-XML-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/xml") if (NOT ${resultcode} STREQUAL "0") - SET_TESTS_PROPERTIES (H5DUMP-XML-${resultfile} PROPERTIES WILL_FAIL "true") + set_tests_properties (H5DUMP-XML-${resultfile} PROPERTIES WILL_FAIL "true") endif (NOT ${resultcode} STREQUAL "0") if (NOT "${last_xml_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5DUMP-XML-${resultfile} PROPERTIES DEPENDS ${last_xml_test}) + set_tests_properties (H5DUMP-XML-${resultfile} PROPERTIES DEPENDS ${last_xml_test}) endif (NOT "${last_xml_test}" STREQUAL "") else (HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( + add_test ( NAME H5DUMP-XML-${resultfile}-clear-objects COMMAND ${CMAKE_COMMAND} -E remove ${resultfile}.out ${resultfile}.out.err ) - SET_TESTS_PROPERTIES (H5DUMP-XML-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/xml") - ADD_TEST ( + 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}" -D "TEST_PROGRAM=$" @@ -198,7 +198,7 @@ -D "TEST_REFERENCE=${resultfile}.xml" -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) - SET_TESTS_PROPERTIES (H5DUMP-XML-${resultfile} PROPERTIES DEPENDS "H5DUMP-XML-${resultfile}-clear-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) @@ -210,7 +210,7 @@ if (HDF5_ENABLE_USING_MEMCHECKER) # Remove any output file left over from previous test run - ADD_TEST ( + add_test ( NAME H5DUMP-XML-clearall-objects COMMAND ${CMAKE_COMMAND} -E remove @@ -343,9 +343,9 @@ tvlstr.h5.out tvlstr.h5.out.err ) - SET_TESTS_PROPERTIES (H5DUMP-XML-clearall-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/xml") + set_tests_properties (H5DUMP-XML-clearall-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/xml") if (NOT "${last_xml_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5DUMP-XML-clearall-objects PROPERTIES DEPENDS ${last_xml_test}) + 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/h5import/CMakeTests.cmake b/tools/h5import/CMakeTests.cmake index 3250910..2adbdde 100644 --- a/tools/h5import/CMakeTests.cmake +++ b/tools/h5import/CMakeTests.cmake @@ -103,12 +103,12 @@ MACRO (ADD_H5_TEST testname importfile conffile testfile) # If using memchecker skip macro based tests if (HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST (NAME H5IMPORT-${testname} COMMAND $ ${importfile} -c ${conffile} -o ${testfile}) + add_test (NAME H5IMPORT-${testname} COMMAND $ ${importfile} -c ${conffile} -o ${testfile}) if (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5IMPORT-${testname} PROPERTIES DEPENDS H5IMPORT-h5importtest) + set_tests_properties (H5IMPORT-${testname} PROPERTIES DEPENDS H5IMPORT-h5importtest) endif (NOT "${last_test}" STREQUAL "") else (HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( + add_test ( NAME H5IMPORT-${testname}-clear-objects COMMAND ${CMAKE_COMMAND} -E remove @@ -118,12 +118,12 @@ ${testfile}.out ${testfile}.out.err ) - SET_TESTS_PROPERTIES (H5IMPORT-${testname}-clear-objects PROPERTIES DEPENDS H5IMPORT-h5importtest) + set_tests_properties (H5IMPORT-${testname}-clear-objects PROPERTIES DEPENDS H5IMPORT-h5importtest) - 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} COMMAND $ ${importfile} -c ${conffile} -o ${testfile}) + set_tests_properties (H5IMPORT-${testname} PROPERTIES DEPENDS H5IMPORT-${testname}-clear-objects) - ADD_TEST ( + add_test ( NAME H5IMPORT-${testname}-H5DMP COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$" @@ -135,8 +135,8 @@ -D "TEST_SKIP_COMPARE=TRUE" -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) - SET_TESTS_PROPERTIES (H5IMPORT-${testname}-H5DMP PROPERTIES DEPENDS H5IMPORT-${testname}) - ADD_TEST ( + set_tests_properties (H5IMPORT-${testname}-H5DMP PROPERTIES DEPENDS H5IMPORT-${testname}) + add_test ( NAME H5IMPORT-${testname}-H5DMP_CMP COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$" @@ -148,14 +148,14 @@ -D "TEST_REFERENCE=${testfile}.new" -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) - SET_TESTS_PROPERTIES (H5IMPORT-${testname}-H5DMP_CMP PROPERTIES DEPENDS H5IMPORT-${testname}-H5DMP) + 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 skip tests if (NOT HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( + add_test ( NAME H5IMPORT-DUMP-${testname}-clear-objects COMMAND ${CMAKE_COMMAND} -E remove @@ -168,10 +168,10 @@ d${testfile}.dff d${testfile}.dff.err ) - SET_TESTS_PROPERTIES (H5IMPORT-DUMP-${testname}-clear-objects PROPERTIES DEPENDS H5IMPORT-h5importtest) + set_tests_properties (H5IMPORT-DUMP-${testname}-clear-objects PROPERTIES DEPENDS H5IMPORT-h5importtest) if ("${ARGN}" STREQUAL "BINARY") - ADD_TEST ( + add_test ( NAME H5IMPORT-DUMP-${testname}-H5DMP COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$" @@ -183,7 +183,7 @@ -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) else ("${ARGN}" STREQUAL "BINARY") - ADD_TEST ( + add_test ( NAME H5IMPORT-DUMP-${testname}-H5DMP COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$" @@ -195,9 +195,9 @@ -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) endif ("${ARGN}" STREQUAL "BINARY") - SET_TESTS_PROPERTIES (H5IMPORT-DUMP-${testname}-H5DMP PROPERTIES DEPENDS "H5IMPORT-DUMP-${testname}-clear-objects") + set_tests_properties (H5IMPORT-DUMP-${testname}-H5DMP PROPERTIES DEPENDS "H5IMPORT-DUMP-${testname}-clear-objects") - ADD_TEST ( + add_test ( NAME H5IMPORT-DUMP-${testname} COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$" @@ -208,9 +208,9 @@ -D "TEST_SKIP_COMPARE=TRUE" -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) - SET_TESTS_PROPERTIES (H5IMPORT-DUMP-${testname} PROPERTIES DEPENDS "H5IMPORT-DUMP-${testname}-H5DMP") + set_tests_properties (H5IMPORT-DUMP-${testname} PROPERTIES DEPENDS "H5IMPORT-DUMP-${testname}-H5DMP") - ADD_TEST ( + add_test ( NAME H5IMPORT-DUMP-${testname}-H5DFF COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$" @@ -222,13 +222,13 @@ -D "TEST_REFERENCE=testfiles/d${testfile}.txt" -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) - SET_TESTS_PROPERTIES (H5IMPORT-DUMP-${testname}-H5DFF PROPERTIES DEPENDS "H5IMPORT-DUMP-${testname}") + 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) if (NOT HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( + add_test ( NAME H5IMPORT-DUMP-${testname}-SKIPPED COMMAND ${CMAKE_COMMAND} -E echo "SKIP ${testname} ${datasetname} ${testfile} --- DEFLATE filter not available" ) @@ -250,7 +250,7 @@ if (HDF5_ENABLE_USING_MEMCHECKER) # Remove any output file left over from previous test run - ADD_TEST ( + add_test ( NAME H5IMPORT-clear-objects COMMAND ${CMAKE_COMMAND} -E remove @@ -409,7 +409,7 @@ set (last_test "H5IMPORT-clear-objects") endif (HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( + add_test ( NAME H5IMPORT-h5importtest-clear-objects COMMAND ${CMAKE_COMMAND} -E remove @@ -422,12 +422,12 @@ binuin32.bin ) if (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5IMPORT-h5importtest-clear-objects PROPERTIES DEPENDS ${last_test}) + set_tests_properties (H5IMPORT-h5importtest-clear-objects PROPERTIES DEPENDS ${last_test}) endif (NOT "${last_test}" STREQUAL "") set (last_test "H5IMPORT-clear-objects") - ADD_TEST (NAME H5IMPORT-h5importtest COMMAND $) - SET_TESTS_PROPERTIES (H5IMPORT-h5importtest PROPERTIES DEPENDS H5IMPORT-h5importtest-clear-objects) + add_test (NAME H5IMPORT-h5importtest COMMAND $) + set_tests_properties (H5IMPORT-h5importtest PROPERTIES DEPENDS H5IMPORT-h5importtest-clear-objects) # ----- TESTING "ASCII I32 rank 3 - Output BE " ; ADD_H5_TEST (ASCII_I32 testfiles/txtin32.txt testfiles/txtin32.conf txtin32.h5) diff --git a/tools/h5jam/CMakeLists.txt b/tools/h5jam/CMakeLists.txt index a17bf45..b12544f 100644 --- a/tools/h5jam/CMakeLists.txt +++ b/tools/h5jam/CMakeLists.txt @@ -51,7 +51,7 @@ if (BUILD_TESTING) target_link_libraries (h5jamgentest ${HDF5_LIB_TARGET}) set_target_properties (h5jamgentest PROPERTIES FOLDER generator/tools) - #ADD_TEST (NAME h5jamgentest COMMAND $) + #add_test (NAME h5jamgentest COMMAND $) endif (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) include (CMakeTests.cmake) diff --git a/tools/h5jam/CMakeTests.cmake b/tools/h5jam/CMakeTests.cmake index 123c26f..4b71d7f 100644 --- a/tools/h5jam/CMakeTests.cmake +++ b/tools/h5jam/CMakeTests.cmake @@ -56,19 +56,19 @@ MACRO (TEST_H5JAM_OUTPUT expectfile resultcode) # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST (NAME H5JAM-${expectfile} COMMAND $ ${ARGN}) + add_test (NAME H5JAM-${expectfile} COMMAND $ ${ARGN}) if (NOT "${resultcode}" STREQUAL "0") - SET_TESTS_PROPERTIES (H5JAM-${expectfile} PROPERTIES WILL_FAIL "true") + set_tests_properties (H5JAM-${expectfile} PROPERTIES WILL_FAIL "true") endif (NOT "${resultcode}" STREQUAL "0") else (HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( + add_test ( NAME H5JAM-${expectfile}-clear-objects COMMAND ${CMAKE_COMMAND} -E remove ${expectfile}.out ${expectfile}.out.err ) - ADD_TEST ( + add_test ( NAME H5JAM-${expectfile} COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$" @@ -79,7 +79,7 @@ -D "TEST_REFERENCE=testfiles/${expectfile}.txt" -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) - SET_TESTS_PROPERTIES (H5JAM-${expectfile} PROPERTIES DEPENDS H5JAM-${expectfile}-clear-objects) + set_tests_properties (H5JAM-${expectfile} PROPERTIES DEPENDS H5JAM-${expectfile}-clear-objects) endif (HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (TEST_H5JAM_OUTPUT) @@ -90,19 +90,19 @@ MACRO (TEST_H5UNJAM_OUTPUT expectfile resultcode) # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST (NAME H5JAM-UNJAM-${expectfile} COMMAND $ ${ARGN}) + add_test (NAME H5JAM-UNJAM-${expectfile} COMMAND $ ${ARGN}) if (NOT "${resultcode}" STREQUAL "0") - SET_TESTS_PROPERTIES (H5JAM-UNJAM-${expectfile} PROPERTIES WILL_FAIL "true") + set_tests_properties (H5JAM-UNJAM-${expectfile} PROPERTIES WILL_FAIL "true") endif (NOT "${resultcode}" STREQUAL "0") else (HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( + add_test ( NAME H5JAM-UNJAM-${expectfile}-clear-objects COMMAND ${CMAKE_COMMAND} -E remove ${expectfile}.out ${expectfile}.out.err ) - ADD_TEST ( + add_test ( NAME H5JAM-UNJAM-${expectfile} COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$" @@ -113,14 +113,14 @@ -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) + set_tests_properties (H5JAM-UNJAM-${expectfile} PROPERTIES DEPENDS H5JAM-UNJAM-${expectfile}-clear-objects) endif (HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (TEST_H5UNJAM_OUTPUT) MACRO (CHECKFILE testname testdepends expected actual) # If using memchecker add tests without using scripts if (NOT HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( + add_test ( NAME H5JAM-${testname}-CHECKFILE-clear-objects COMMAND ${CMAKE_COMMAND} -E remove @@ -129,8 +129,8 @@ ${actual}.out ${actual}.out.err ) - SET_TESTS_PROPERTIES (H5JAM-${testname}-CHECKFILE-clear-objects PROPERTIES DEPENDS ${testdepends}) - ADD_TEST ( + set_tests_properties (H5JAM-${testname}-CHECKFILE-clear-objects PROPERTIES DEPENDS ${testdepends}) + add_test ( NAME H5JAM-${testname}-CHECKFILE-H5DMP COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$" @@ -142,8 +142,8 @@ -D "TEST_SKIP_COMPARE=TRUE" -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) - SET_TESTS_PROPERTIES (H5JAM-${testname}-CHECKFILE-H5DMP PROPERTIES DEPENDS H5JAM-${testname}-CHECKFILE-clear-objects) - ADD_TEST ( + set_tests_properties (H5JAM-${testname}-CHECKFILE-H5DMP PROPERTIES DEPENDS H5JAM-${testname}-CHECKFILE-clear-objects) + add_test ( NAME H5JAM-${testname}-CHECKFILE-H5DMP_CMP COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$" @@ -155,43 +155,43 @@ -D "TEST_REFERENCE=${actual}.new" -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) - SET_TESTS_PROPERTIES (H5JAM-${testname}-CHECKFILE-H5DMP_CMP PROPERTIES DEPENDS H5JAM-${testname}-CHECKFILE-H5DMP) + set_tests_properties (H5JAM-${testname}-CHECKFILE-H5DMP_CMP PROPERTIES DEPENDS H5JAM-${testname}-CHECKFILE-H5DMP) endif (NOT HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO(CHECKFILE testname testdepends expected actual) MACRO (UNJAMTEST testname setfile infile ufile chkfile outfile) if (NOT HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( + add_test ( NAME H5JAM-${testname}-UNJAM-SETUP-clear-objects COMMAND ${CMAKE_COMMAND} -E remove ${infile} ) - ADD_TEST ( + 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 ( + 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} ) - SET_TESTS_PROPERTIES (H5JAM-${testname}-UNJAM-clear-objects PROPERTIES DEPENDS H5JAM-${testname}-UNJAM-SETUP) + set_tests_properties (H5JAM-${testname}-UNJAM-clear-objects PROPERTIES DEPENDS H5JAM-${testname}-UNJAM-SETUP) if (NOT "${ufile}" STREQUAL "NONE") - ADD_TEST ( + 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_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 ( + 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 ( + 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=$" @@ -202,16 +202,16 @@ -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_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) + 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 ( + add_test ( NAME H5JAM-${testname}-UNJAM-CHECK_UB_1-clear-objects COMMAND ${CMAKE_COMMAND} -E remove @@ -219,8 +219,8 @@ ${infile}.cmp ${infile}-ub.cmp ) - SET_TESTS_PROPERTIES (H5JAM-${testname}-UNJAM-CHECK_UB_1-clear-objects PROPERTIES DEPENDS "H5JAM-${testname}-UNJAM") - ADD_TEST ( + 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=$" @@ -233,10 +233,10 @@ -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) + 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 ( + add_test ( NAME H5JAM-${testname}-UNJAM-CHECK_NOUB COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$" @@ -250,9 +250,9 @@ -P "${HDF5_RESOURCES_DIR}/userblockTest.cmake" ) if (NOT "${compare_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5JAM-${testname}-UNJAM-CHECK_NOUB PROPERTIES DEPENDS H5JAM-${testname}-UNJAM-CHECK_UB_1) + 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) + 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}) @@ -261,21 +261,21 @@ MACRO (JAMTEST testname jamfile infile chkfile outfile) if (NOT HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( + add_test ( 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}) + 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_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 ( + add_test ( NAME H5JAM-${testname}-CHECK_UB_1-clear-objects COMMAND ${CMAKE_COMMAND} -E remove @@ -283,8 +283,8 @@ ${compare_test}.cmp ${compare_test}-ub.cmp ) - SET_TESTS_PROPERTIES (H5JAM-${testname}-CHECK_UB_1-clear-objects PROPERTIES DEPENDS "H5JAM-${testname}") - ADD_TEST ( + 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=$" @@ -297,32 +297,32 @@ -D "TEST_OFILE=${compare_orig}" -P "${HDF5_RESOURCES_DIR}/userblockTest.cmake" ) - SET_TESTS_PROPERTIES (H5JAM-${testname}-CHECK_UB_1 PROPERTIES DEPENDS H5JAM-${testname}-CHECK_UB_1-clear-objects) + 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 (JAMTEST testname jamfile infile outfile) MACRO (JAMTEST_NONE testname jamfile infile setfile chkfile) if (NOT HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( + add_test ( NAME H5JAM-${testname}_NONE-clear-objects COMMAND ${CMAKE_COMMAND} -E remove ${chkfile} ${chkfile}.cpy.h5 ) - ADD_TEST ( + 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) + set_tests_properties (H5JAM-${testname}_NONE-SETUP PROPERTIES DEPENDS H5JAM-${testname}_NONE-clear-objects) - ADD_TEST ( + add_test ( NAME H5JAM-${testname}_NONE_COPY COMMAND ${CMAKE_COMMAND} -E copy_if_different ${chkfile} ${chkfile}.cpy.h5 ) - SET_TESTS_PROPERTIES (H5JAM-${testname}_NONE_COPY PROPERTIES DEPENDS H5JAM-${testname}_NONE-SETUP) + 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) + 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) @@ -330,7 +330,7 @@ set (compare_orig "") endif ("${ARGN}" STREQUAL "--clobber") - ADD_TEST ( + add_test ( NAME H5JAM-${testname}_NONE-CHECK_UB_1-clear-objects COMMAND ${CMAKE_COMMAND} -E remove @@ -338,8 +338,8 @@ ${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 ( + 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=$" @@ -352,7 +352,7 @@ -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) + 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) diff --git a/tools/h5ls/CMakeTests.cmake b/tools/h5ls/CMakeTests.cmake index b2d039f..eb68d79 100644 --- a/tools/h5ls/CMakeTests.cmake +++ b/tools/h5ls/CMakeTests.cmake @@ -117,21 +117,21 @@ MACRO (ADD_H5_TEST resultfile resultcode) # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST (NAME H5LS-${resultfile} COMMAND $ ${ARGN}) - SET_TESTS_PROPERTIES (H5LS-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") + add_test (NAME H5LS-${resultfile} COMMAND $ ${ARGN}) + set_tests_properties (H5LS-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") if (${resultcode} STREQUAL "1") - SET_TESTS_PROPERTIES (H5LS-${resultfile} PROPERTIES WILL_FAIL "true") + set_tests_properties (H5LS-${resultfile} PROPERTIES WILL_FAIL "true") endif (${resultcode} STREQUAL "1") if (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5LS-${resultfile} PROPERTIES DEPENDS ${last_test}) + set_tests_properties (H5LS-${resultfile} PROPERTIES DEPENDS ${last_test}) endif (NOT "${last_test}" STREQUAL "") else (HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( + add_test ( NAME H5LS-${resultfile}-clear-objects COMMAND ${CMAKE_COMMAND} -E remove ./testfiles/${resultfile}.out ./testfiles/${resultfile}.out.err ) - ADD_TEST ( + add_test ( NAME H5LS-${resultfile} COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$" @@ -142,7 +142,7 @@ -D "TEST_REFERENCE=${resultfile}.ls" -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) - SET_TESTS_PROPERTIES (H5LS-${resultfile} PROPERTIES DEPENDS "H5LS-${resultfile}-clear-objects") + set_tests_properties (H5LS-${resultfile} PROPERTIES DEPENDS "H5LS-${resultfile}-clear-objects") endif (HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (ADD_H5_TEST file) @@ -154,7 +154,7 @@ if (HDF5_ENABLE_USING_MEMCHECKER) # Remove any output file left over from previous test run - ADD_TEST ( + add_test ( NAME H5LS-clearall-objects COMMAND ${CMAKE_COMMAND} -E remove @@ -266,7 +266,7 @@ tvldtypes2be.out.err ) if (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5LS-clearall-objects PROPERTIES DEPENDS ${last_test}) + set_tests_properties (H5LS-clearall-objects PROPERTIES DEPENDS ${last_test}) endif (NOT "${last_test}" STREQUAL "") set (last_test "H5LS-clearall-objects") endif (HDF5_ENABLE_USING_MEMCHECKER) diff --git a/tools/h5repack/CMakeTests.cmake b/tools/h5repack/CMakeTests.cmake index 6483a97..430defc 100644 --- a/tools/h5repack/CMakeTests.cmake +++ b/tools/h5repack/CMakeTests.cmake @@ -20,7 +20,7 @@ endif (DIRECT_VFD) MACRO (ADD_VFD_TEST vfdname resultcode) - ADD_TEST ( + add_test ( NAME H5REPACK-VFD-${vfdname}-h5repacktest COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$" @@ -32,7 +32,7 @@ -P "${HDF5_RESOURCES_DIR}/vfdTest.cmake" ) if (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5REPACK-VFD-${vfdname}-h5repacktest PROPERTIES DEPENDS ${last_test}) + set_tests_properties (H5REPACK-VFD-${vfdname}-h5repacktest PROPERTIES DEPENDS ${last_test}) endif (NOT "${last_test}" STREQUAL "") set (last_test "H5REPACK-VFD-${vfdname}-h5repacktest") ENDMACRO (ADD_VFD_TEST) @@ -114,20 +114,20 @@ MACRO (ADD_HELP_TEST testname resultcode) # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST (NAME H5REPACK-${testname} COMMAND $ ${ARGN}) - SET_TESTS_PROPERTIES (H5REPACK-${testname} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") + add_test (NAME H5REPACK-${testname} COMMAND $ ${ARGN}) + set_tests_properties (H5REPACK-${testname} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") if (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5REPACK-${testname} PROPERTIES DEPENDS ${last_test}) + set_tests_properties (H5REPACK-${testname} PROPERTIES DEPENDS ${last_test}) endif (NOT "${last_test}" STREQUAL "") set (last_test "H5REPACK-${testname}") else (HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( + add_test ( NAME H5REPACK-h5repack-${testname}-clear-objects COMMAND ${CMAKE_COMMAND} -E remove h5repack-${testname}.out h5repack-${testname}.out.err ) - SET_TESTS_PROPERTIES (H5REPACK-h5repack-${testname}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") - ADD_TEST ( + set_tests_properties (H5REPACK-h5repack-${testname}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") + add_test ( NAME H5REPACK-h5repack-${testname} COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$" @@ -138,62 +138,62 @@ -D "TEST_REFERENCE=h5repack-${testname}.txt" -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) - SET_TESTS_PROPERTIES (H5REPACK-h5repack-${testname} PROPERTIES DEPENDS "H5REPACK-h5repack-${testname}-clear-objects") + set_tests_properties (H5REPACK-h5repack-${testname} PROPERTIES DEPENDS "H5REPACK-h5repack-${testname}-clear-objects") endif (HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (ADD_HELP_TEST) MACRO (ADD_H5_TEST_OLD testname testtype testfile) if (${testtype} STREQUAL "SKIP") if (NOT HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( + add_test ( 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 ( + add_test ( 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_OLD-${testname} PROPERTIES DEPENDS ${last_test}) + set_tests_properties (H5REPACK_OLD-${testname} PROPERTIES DEPENDS ${last_test}) endif (NOT "${last_test}" STREQUAL "") - ADD_TEST ( + add_test ( NAME H5REPACK_OLD-${testname}_DFF COMMAND $ ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} ) - SET_TESTS_PROPERTIES (H5REPACK_OLD-${testname}_DFF PROPERTIES DEPENDS H5REPACK_OLD-${testname}) + set_tests_properties (H5REPACK_OLD-${testname}_DFF PROPERTIES DEPENDS H5REPACK_OLD-${testname}) endif (${testtype} STREQUAL "SKIP") ENDMACRO (ADD_H5_TEST_OLD) MACRO (ADD_H5_TEST testname testtype testfile) if (${testtype} STREQUAL "SKIP") if (NOT HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( + add_test ( NAME H5REPACK-${testname}-SKIPPED 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 ( + add_test ( NAME H5REPACK-${testname} 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}) + set_tests_properties (H5REPACK-${testname} PROPERTIES DEPENDS ${last_test}) endif (NOT "${last_test}" STREQUAL "") - ADD_TEST ( + add_test ( NAME H5REPACK-${testname}_DFF COMMAND $ ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} ) - SET_TESTS_PROPERTIES (H5REPACK-${testname}_DFF PROPERTIES DEPENDS H5REPACK-${testname}) + set_tests_properties (H5REPACK-${testname}_DFF PROPERTIES DEPENDS H5REPACK-${testname}) endif (${testtype} STREQUAL "SKIP") ENDMACRO (ADD_H5_TEST) MACRO (ADD_H5_CMP_TEST testname testfilter testtype resultcode resultfile) if (${testtype} STREQUAL "SKIP") if (NOT HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( + add_test ( NAME H5REPACK_CMP-${testname}-SKIPPED COMMAND ${CMAKE_COMMAND} -E echo "SKIP ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${resultfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${resultfile}" ) @@ -201,11 +201,11 @@ else (${testtype} STREQUAL "SKIP") # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( + add_test ( NAME H5REPACK_CMP-${testname} COMMAND $ ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${resultfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${resultfile}) else (HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( + add_test ( NAME H5REPACK_CMP-${testname} COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$" @@ -219,7 +219,7 @@ ) endif (HDF5_ENABLE_USING_MEMCHECKER) if (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5REPACK_CMP-${testname} PROPERTIES DEPENDS ${last_test}) + set_tests_properties (H5REPACK_CMP-${testname} PROPERTIES DEPENDS ${last_test}) endif (NOT "${last_test}" STREQUAL "") endif (${testtype} STREQUAL "SKIP") ENDMACRO (ADD_H5_CMP_TEST) @@ -227,21 +227,21 @@ MACRO (ADD_H5_DMP_TEST testname testtype resultcode resultfile) if (${testtype} STREQUAL "SKIP") if (NOT HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( + add_test ( NAME H5REPACK_DMP-${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 - ADD_TEST ( + add_test ( NAME H5REPACK_DMP-${testname} COMMAND $ ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${resultfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${resultfile}) if (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5REPACK_DMP-${testname} PROPERTIES DEPENDS ${last_test}) + set_tests_properties (H5REPACK_DMP-${testname} PROPERTIES DEPENDS ${last_test}) endif (NOT "${last_test}" STREQUAL "") if (NOT HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( + add_test ( NAME H5REPACK_DMP-h5dump-${testname} COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$" @@ -252,7 +252,7 @@ -D "TEST_REFERENCE=${testname}.${resultfile}.ddl" -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) - SET_TESTS_PROPERTIES (H5REPACK_DMP-h5dump-${testname} PROPERTIES DEPENDS "H5REPACK_DMP-${testname}") + set_tests_properties (H5REPACK_DMP-h5dump-${testname} PROPERTIES DEPENDS "H5REPACK_DMP-${testname}") endif (NOT HDF5_ENABLE_USING_MEMCHECKER) endif (${testtype} STREQUAL "SKIP") ENDMACRO (ADD_H5_DMP_TEST) @@ -260,27 +260,27 @@ MACRO (ADD_H5_VERIFY_TEST testname testtype resultcode testfile testdset testfilter) if (${testtype} STREQUAL "SKIP") if (NOT HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( + add_test ( NAME H5REPACK_VERIFY_LAYOUT-${testname}-SKIPPED 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 ( + 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}) + set_tests_properties (H5REPACK_VERIFY_LAYOUT-${testname} PROPERTIES DEPENDS ${last_test}) endif (NOT "${last_test}" STREQUAL "") - ADD_TEST ( + 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}) + set_tests_properties (H5REPACK_VERIFY_LAYOUT-${testname}_DFF PROPERTIES DEPENDS H5REPACK_VERIFY_LAYOUT-${testname}) if (${resultcode} STREQUAL "0") - ADD_TEST ( + add_test ( NAME H5REPACK_VERIFY_LAYOUT-${testname}_DMP COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$" @@ -292,7 +292,7 @@ -D "TEST_REFERENCE=${testfilter}" -P "${HDF5_RESOURCES_DIR}/grepTest.cmake" ) - SET_TESTS_PROPERTIES (H5REPACK_VERIFY_LAYOUT-${testname}_DMP PROPERTIES DEPENDS H5REPACK_VERIFY_LAYOUT-${testname}_DFF) + 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)") @@ -303,7 +303,7 @@ if (${testfilter} STREQUAL "COMPACT") set (nottestfilter "(CONTIGUOUS|CHUNK)") endif (${testfilter} STREQUAL "COMPACT") - ADD_TEST ( + add_test ( NAME H5REPACK_VERIFY_LAYOUT-${testname}_DMP COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$" @@ -315,35 +315,35 @@ -D "TEST_REFERENCE=${testfilter}" -P "${HDF5_RESOURCES_DIR}/grepTest.cmake" ) - SET_TESTS_PROPERTIES (H5REPACK_VERIFY_LAYOUT-${testname}_DMP PROPERTIES DEPENDS H5REPACK_VERIFY_LAYOUT-${testname}_DFF) + 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") ENDMACRO (ADD_H5_VERIFY_TEST) MACRO (ADD_H5_TEST_META testname testfile) - ADD_TEST ( + add_test ( 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_META-${testname}_N PROPERTIES DEPENDS ${last_test}) + set_tests_properties (H5REPACK_META-${testname}_N PROPERTIES DEPENDS ${last_test}) endif (NOT "${last_test}" STREQUAL "") - ADD_TEST ( + add_test ( NAME H5REPACK_META-${testname}_M COMMAND $ ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}_M.${testname}.h5 ) - SET_TESTS_PROPERTIES (H5REPACK_META-${testname}_M PROPERTIES DEPENDS H5REPACK_META-${testname}_N) + 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) + 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) MACRO (ADD_H5_UD_TEST testname resultcode resultfile) if (HDF5_BUILD_TOOLS AND NOT HDF5_ENABLE_USING_MEMCHECKER) # Remove any output file left over from previous test run - ADD_TEST ( + add_test ( NAME H5REPACK_UD-${testname}-clearall-objects COMMAND ${CMAKE_COMMAND} -E remove @@ -353,7 +353,7 @@ testfiles/${resultfile}-${testname}.out testfiles/${resultfile}-${testname}.out.err ) - ADD_TEST ( + add_test ( NAME H5REPACK_UD-${testname} COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$" @@ -367,8 +367,8 @@ -D "TEST_ENV_VALUE=${CMAKE_BINARY_DIR}/plugins" -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) - SET_TESTS_PROPERTIES (H5REPACK_UD-${testname} PROPERTIES DEPENDS H5REPACK_UD-${testname}-clearall-objects) - ADD_TEST ( + set_tests_properties (H5REPACK_UD-${testname} PROPERTIES DEPENDS H5REPACK_UD-${testname}-clearall-objects) + add_test ( NAME H5REPACK_UD-h5dump-${testname} COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$" @@ -381,7 +381,7 @@ -D "TEST_ENV_VALUE=${CMAKE_BINARY_DIR}/plugins" -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) - SET_TESTS_PROPERTIES (H5REPACK_UD-h5dump-${testname} PROPERTIES DEPENDS "H5REPACK_UD-${testname}") + set_tests_properties (H5REPACK_UD-h5dump-${testname} PROPERTIES DEPENDS "H5REPACK_UD-${testname}") endif (HDF5_BUILD_TOOLS AND NOT HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (ADD_H5_UD_TEST) @@ -417,7 +417,7 @@ set (FILE_ATTR_REF h5repack_attr_refs.h5) # Remove any output file left over from previous test run - ADD_TEST ( + add_test ( NAME H5REPACK-clearall-objects COMMAND ${CMAKE_COMMAND} -E remove @@ -598,28 +598,28 @@ ublock.bin ) if (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5REPACK-clearall-objects PROPERTIES DEPENDS ${last_test}) + set_tests_properties (H5REPACK-clearall-objects PROPERTIES DEPENDS ${last_test}) endif (NOT "${last_test}" STREQUAL "") ADD_HELP_TEST(help 0 -h) - ADD_TEST (NAME H5REPACK-testh5repack_detect_szip COMMAND $) + add_test (NAME H5REPACK-testh5repack_detect_szip COMMAND $) if (HDF5_ENABLE_SZIP_SUPPORT) if (HDF5_ENABLE_SZIP_ENCODING) set (passRegex "yes") - SET_TESTS_PROPERTIES (H5REPACK-testh5repack_detect_szip PROPERTIES PASS_REGULAR_EXPRESSION "yes") + set_tests_properties (H5REPACK-testh5repack_detect_szip PROPERTIES PASS_REGULAR_EXPRESSION "yes") else (HDF5_ENABLE_SZIP_ENCODING) set (passRegex "no") - SET_TESTS_PROPERTIES (H5REPACK-testh5repack_detect_szip PROPERTIES PASS_REGULAR_EXPRESSION "no") + set_tests_properties (H5REPACK-testh5repack_detect_szip PROPERTIES PASS_REGULAR_EXPRESSION "no") endif (HDF5_ENABLE_SZIP_ENCODING) else (HDF5_ENABLE_SZIP_SUPPORT) set (passRegex "no") - SET_TESTS_PROPERTIES (H5REPACK-testh5repack_detect_szip PROPERTIES PASS_REGULAR_EXPRESSION "no") + set_tests_properties (H5REPACK-testh5repack_detect_szip PROPERTIES PASS_REGULAR_EXPRESSION "no") endif (HDF5_ENABLE_SZIP_SUPPORT) - SET_TESTS_PROPERTIES (H5REPACK-testh5repack_detect_szip PROPERTIES DEPENDS H5REPACK-clearall-objects) + set_tests_properties (H5REPACK-testh5repack_detect_szip PROPERTIES DEPENDS H5REPACK-clearall-objects) - ADD_TEST (NAME H5REPACK-h5repacktest COMMAND $) - SET_TESTS_PROPERTIES (H5REPACK-h5repacktest PROPERTIES DEPENDS H5REPACK-testh5repack_detect_szip) + add_test (NAME H5REPACK-h5repacktest COMMAND $) + set_tests_properties (H5REPACK-h5repacktest PROPERTIES DEPENDS H5REPACK-testh5repack_detect_szip) set (last_test "H5REPACK-h5repacktest") # @@ -1069,7 +1069,7 @@ if (BUILD_SHARED_LIBS) ADD_H5_UD_TEST (plugin_none 0 h5repack_layout.UD.h5 -v -f NONE) else (BUILD_SHARED_LIBS) message (STATUS " **** Plugins libraries must be built as shared libraries **** ") - ADD_TEST ( + add_test ( NAME H5REPACK-plugin COMMAND ${CMAKE_COMMAND} -E echo "SKIP H5PLUGIN TESTING" ) diff --git a/tools/h5stat/CMakeLists.txt b/tools/h5stat/CMakeLists.txt index a97be07..d182a45 100644 --- a/tools/h5stat/CMakeLists.txt +++ b/tools/h5stat/CMakeLists.txt @@ -28,7 +28,7 @@ if (BUILD_TESTING) target_link_libraries (h5stat_gentest ${HDF5_LIB_TARGET}) set_target_properties (h5stat_gentest PROPERTIES FOLDER generator/tools) - #ADD_TEST (NAME h5stat_gentest COMMAND $) + #add_test (NAME h5stat_gentest COMMAND $) endif (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) include (CMakeTests.cmake) diff --git a/tools/h5stat/CMakeTests.cmake b/tools/h5stat/CMakeTests.cmake index 4ae9ff7..b803dff 100644 --- a/tools/h5stat/CMakeTests.cmake +++ b/tools/h5stat/CMakeTests.cmake @@ -79,20 +79,20 @@ MACRO (ADD_H5_TEST resultfile resultcode) # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST (NAME H5STAT-${resultfile} COMMAND $ ${ARGN}) + add_test (NAME H5STAT-${resultfile} COMMAND $ ${ARGN}) if (NOT ${resultcode} STREQUAL "0") - SET_TESTS_PROPERTIES (H5STAT-${resultfile} PROPERTIES WILL_FAIL "true") + set_tests_properties (H5STAT-${resultfile} PROPERTIES WILL_FAIL "true") endif (NOT ${resultcode} STREQUAL "0") if (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5STAT-${resultfile} PROPERTIES DEPENDS ${last_test}) + set_tests_properties (H5STAT-${resultfile} PROPERTIES DEPENDS ${last_test}) endif (NOT "${last_test}" STREQUAL "") else (HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( + add_test ( NAME H5STAT-${resultfile}-clear-objects COMMAND ${CMAKE_COMMAND} -E remove ${resultfile}.out ${resultfile}.out.err ) - ADD_TEST ( + add_test ( NAME H5STAT-${resultfile} COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$" @@ -103,7 +103,7 @@ -D "TEST_REFERENCE=${resultfile}.ddl" -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) - SET_TESTS_PROPERTIES (H5STAT-${resultfile} PROPERTIES DEPENDS "H5STAT-${resultfile}-clear-objects") + set_tests_properties (H5STAT-${resultfile} PROPERTIES DEPENDS "H5STAT-${resultfile}-clear-objects") endif (HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (ADD_H5_TEST file) @@ -115,7 +115,7 @@ if (HDF5_ENABLE_USING_MEMCHECKER) # Remove any output file left over from previous test run - ADD_TEST ( + add_test ( NAME H5STAT-clearall-objects COMMAND ${CMAKE_COMMAND} -E remove @@ -183,7 +183,7 @@ h5stat_numattrs4.out.err ) if (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5STAT-clearall-objects PROPERTIES DEPENDS ${last_test}) + set_tests_properties (H5STAT-clearall-objects PROPERTIES DEPENDS ${last_test}) endif (NOT "${last_test}" STREQUAL "") set (last_test "H5STAT-clearall-objects") endif (HDF5_ENABLE_USING_MEMCHECKER) diff --git a/tools/misc/CMakeLists.txt b/tools/misc/CMakeLists.txt index c1f7454..833e7e5 100644 --- a/tools/misc/CMakeLists.txt +++ b/tools/misc/CMakeLists.txt @@ -38,7 +38,7 @@ set (H5_DEP_EXECUTABLES # Generate the h5cc file containing settings needed to compile programs #----------------------------------------------------------------------------- #if (NOT WIN32) -# CONFIGURE_FILE (${HDF5_TOOLS_MISC_SOURCE_DIR}/h5cc.in ${HDF5_BINARY_DIR}/h5cc @ONLY) +# configure_file (${HDF5_TOOLS_MISC_SOURCE_DIR}/h5cc.in ${HDF5_BINARY_DIR}/h5cc @ONLY) #endif (NOT WIN32) if (BUILD_TESTING) @@ -51,7 +51,7 @@ if (BUILD_TESTING) TARGET_C_PROPERTIES (h5repart_gentest " " " ") target_link_libraries (h5repart_gentest ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) set_target_properties (h5repart_gentest PROPERTIES FOLDER generator/tools) - #ADD_TEST (NAME h5repart_gentest COMMAND $) + #add_test (NAME h5repart_gentest COMMAND $) endif (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) add_executable (h5repart_test ${HDF5_TOOLS_MISC_SOURCE_DIR}/repart_test.c) diff --git a/tools/misc/CMakeTests.cmake b/tools/misc/CMakeTests.cmake index d55e9de..a935c2b 100644 --- a/tools/misc/CMakeTests.cmake +++ b/tools/misc/CMakeTests.cmake @@ -77,7 +77,7 @@ 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}/testfiles/h5mkgrp_version.txt @ONLY) + configure_file (${PROJECT_SOURCE_DIR}/testfiles/h5mkgrp_version.txt.in ${PROJECT_BINARY_DIR}/testfiles/h5mkgrp_version.txt @ONLY) ############################################################################## ############################################################################## @@ -87,7 +87,7 @@ MACRO (ADD_H5_TEST resultfile resultcode resultoption) if (NOT HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( + add_test ( NAME H5MKGRP-${resultfile}-clear-objects COMMAND ${CMAKE_COMMAND} -E remove @@ -95,21 +95,21 @@ ${resultfile}.out ${resultfile}.out.err ) - SET_TESTS_PROPERTIES (H5MKGRP-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") + set_tests_properties (H5MKGRP-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") endif (NOT HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( + add_test ( NAME H5MKGRP-${resultfile} COMMAND $ ${resultoption} ${resultfile}.h5 ${ARGN} ) - SET_TESTS_PROPERTIES (H5MKGRP-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") + 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-${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 ( + set_tests_properties (H5MKGRP-${resultfile} PROPERTIES DEPENDS H5MKGRP-${resultfile}-clear-objects) + add_test ( NAME H5MKGRP-${resultfile}-h5ls COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$" @@ -121,15 +121,15 @@ -D "TEST_REFERENCE=${resultfile}.ls" -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) - SET_TESTS_PROPERTIES (H5MKGRP-${resultfile}-h5ls PROPERTIES DEPENDS H5MKGRP-${resultfile}) + 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) if (HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST (NAME H5MKGRP_CMP-${resultfile} COMMAND $ ${ARGN}) + add_test (NAME H5MKGRP_CMP-${resultfile} COMMAND $ ${ARGN}) else (HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( + add_test ( NAME H5MKGRP_CMP-${resultfile}-clear-objects COMMAND ${CMAKE_COMMAND} -E remove @@ -137,8 +137,8 @@ ${resultfile}.out ${resultfile}.out.err ) - SET_TESTS_PROPERTIES (H5MKGRP_CMP-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") - ADD_TEST ( + 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=$" @@ -149,7 +149,7 @@ -D "TEST_REFERENCE=${resultfile}.txt" -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) - SET_TESTS_PROPERTIES (H5MKGRP_CMP-${resultfile} PROPERTIES DEPENDS H5MKGRP_CMP-${resultfile}-clear-objects) + set_tests_properties (H5MKGRP_CMP-${resultfile} PROPERTIES DEPENDS H5MKGRP_CMP-${resultfile}-clear-objects) endif (HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (ADD_H5_CMP resultfile resultcode) @@ -160,7 +160,7 @@ ############################################################################## # Remove any output file left over from previous test run - ADD_TEST ( + add_test ( NAME H5REPART-clearall-objects COMMAND ${CMAKE_COMMAND} -E remove @@ -172,32 +172,32 @@ family_to_sec2.h5 ) if (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5REPART-clearall-objects PROPERTIES DEPENDS ${last_test}) + 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-h5repart_20K COMMAND $ -m 20000 family_file%05d.h5 fst_family%05d.h5) - SET_TESTS_PROPERTIES (H5REPART-h5repart_20K PROPERTIES DEPENDS H5REPART-clearall-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) # repartition family member size to 5 KB. - 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) + 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) # convert family file to sec2 file of 20,000 bytes - 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) + 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-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) + 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 ( + add_test ( NAME H5MKGRP-clearall-objects COMMAND ${CMAKE_COMMAND} -E remove @@ -242,9 +242,9 @@ h5mkgrp_nested_mult_lp.out h5mkgrp_nested_mult_lp.out.err ) - SET_TESTS_PROPERTIES (H5MKGRP-clearall-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") + 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}) + 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) -- cgit v0.12 From b17f3e418335b0468f3f6d6956b2d6adeb9b5cf7 Mon Sep 17 00:00:00 2001 From: Scot Breitenfeld Date: Wed, 12 Mar 2014 09:20:47 -0500 Subject: [svn-r24783] fixed typo --- fortran/test/t.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fortran/test/t.c b/fortran/test/t.c index 01d4cdd..fe69143 100644 --- a/fortran/test/t.c +++ b/fortran/test/t.c @@ -146,7 +146,7 @@ nh5_exit_c(int_f *status) * 0 - HDF5_NOCLEANUP is not set * Returns: none * Programmer: M.S. Breitenfeld - * September 30, 3008 + * September 30, 2008 * Modifications: *---------------------------------------------------------------------------*/ void -- cgit v0.12 From f5689224b5faaf01c02a1a4ae2a0a71b9f46e1d0 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 13 Mar 2014 10:05:09 -0500 Subject: [svn-r24789] Bump up the minimum cmake version --- CMakeLists.txt | 2 +- c++/CMakeLists.txt | 2 +- c++/examples/CMakeLists.txt | 2 +- c++/src/CMakeLists.txt | 2 +- c++/test/CMakeLists.txt | 2 +- examples/CMakeLists.txt | 2 +- fortran/CMakeLists.txt | 2 +- fortran/examples/CMakeLists.txt | 2 +- fortran/src/CMakeLists.txt | 2 +- fortran/test/CMakeLists.txt | 2 +- fortran/testpar/CMakeLists.txt | 2 +- hl/CMakeLists.txt | 2 +- hl/c++/CMakeLists.txt | 2 +- hl/c++/examples/CMakeLists.txt | 2 +- hl/c++/src/CMakeLists.txt | 2 +- hl/c++/src/Makefile.am | 2 +- hl/c++/src/Makefile.in | 8 ++++---- hl/c++/test/CMakeLists.txt | 2 +- hl/examples/CMakeLists.txt | 2 +- hl/fortran/CMakeLists.txt | 2 +- hl/fortran/examples/CMakeLists.txt | 2 +- hl/fortran/src/CMakeLists.txt | 2 +- hl/fortran/test/CMakeLists.txt | 2 +- hl/src/CMakeLists.txt | 2 +- hl/test/CMakeLists.txt | 2 +- hl/tools/CMakeLists.txt | 2 +- perform/CMakeLists.txt | 2 +- release_docs/USING_HDF5_CMake.txt | 2 +- src/CMakeLists.txt | 2 +- test/CMakeLists.txt | 2 +- testpar/CMakeLists.txt | 2 +- tools/CMakeLists.txt | 2 +- tools/h5copy/CMakeLists.txt | 2 +- tools/h5diff/CMakeLists.txt | 2 +- tools/h5dump/CMakeLists.txt | 2 +- tools/h5import/CMakeLists.txt | 2 +- tools/h5jam/CMakeLists.txt | 2 +- tools/h5ls/CMakeLists.txt | 2 +- tools/h5stat/CMakeLists.txt | 2 +- tools/lib/CMakeLists.txt | 2 +- tools/misc/CMakeLists.txt | 2 +- 41 files changed, 44 insertions(+), 44 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1701667..80aa594 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 2.8.10) +cmake_minimum_required (VERSION 2.8.11) PROJECT (HDF5 C CXX) #----------------------------------------------------------------------------- diff --git a/c++/CMakeLists.txt b/c++/CMakeLists.txt index 06d4609..c1de616 100644 --- a/c++/CMakeLists.txt +++ b/c++/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 2.8.10) +cmake_minimum_required (VERSION 2.8.11) PROJECT (HDF5_CPP) #----------------------------------------------------------------------------- diff --git a/c++/examples/CMakeLists.txt b/c++/examples/CMakeLists.txt index b6b1afa..e3e1077 100644 --- a/c++/examples/CMakeLists.txt +++ b/c++/examples/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 2.8.10) +cmake_minimum_required (VERSION 2.8.11) # -------------------------------------------------------------------- # Notes: When creating examples they should be prefixed # with "cpp_ex_". This allows for easier filtering of the examples. diff --git a/c++/src/CMakeLists.txt b/c++/src/CMakeLists.txt index 502a192..7054b04 100644 --- a/c++/src/CMakeLists.txt +++ b/c++/src/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 2.8.10) +cmake_minimum_required (VERSION 2.8.11) PROJECT (HDF5_CPP_SRC) #----------------------------------------------------------------------------- diff --git a/c++/test/CMakeLists.txt b/c++/test/CMakeLists.txt index ec2a32f..9966163 100644 --- a/c++/test/CMakeLists.txt +++ b/c++/test/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 2.8.10) +cmake_minimum_required (VERSION 2.8.11) PROJECT (HDF5_CPP_TEST) # -------------------------------------------------------------------- # Notes: When creating unit test executables they should be prefixed diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 088a238..fe8216d 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 2.8.10) +cmake_minimum_required (VERSION 2.8.11) PROJECT (HDF5_EXAMPLES) #----------------------------------------------------------------------------- diff --git a/fortran/CMakeLists.txt b/fortran/CMakeLists.txt index c13f3c6..c0f5a03 100644 --- a/fortran/CMakeLists.txt +++ b/fortran/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 2.8.10) +cmake_minimum_required (VERSION 2.8.11) PROJECT (HDF5_F90 C CXX Fortran) if (H5_HAVE_PARALLEL) diff --git a/fortran/examples/CMakeLists.txt b/fortran/examples/CMakeLists.txt index 80318a4..6f11895 100644 --- a/fortran/examples/CMakeLists.txt +++ b/fortran/examples/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 2.8.10) +cmake_minimum_required (VERSION 2.8.11) PROJECT (HDF5_F90_EXAMPLES C CXX Fortran) # -------------------------------------------------------------------- # Notes: When creating examples they should be prefixed diff --git a/fortran/src/CMakeLists.txt b/fortran/src/CMakeLists.txt index 90f5aae..60057a3 100644 --- a/fortran/src/CMakeLists.txt +++ b/fortran/src/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 2.8.10) +cmake_minimum_required (VERSION 2.8.11) PROJECT (HDF5_F90_SRC C CXX Fortran) #----------------------------------------------------------------------------- diff --git a/fortran/test/CMakeLists.txt b/fortran/test/CMakeLists.txt index 4b8a8e9..ff88919 100644 --- a/fortran/test/CMakeLists.txt +++ b/fortran/test/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 2.8.10) +cmake_minimum_required (VERSION 2.8.11) PROJECT (HDF5_FORTRAN_TESTS C CXX Fortran) #----------------------------------------------------------------------------- diff --git a/fortran/testpar/CMakeLists.txt b/fortran/testpar/CMakeLists.txt index 54da542..3361220 100644 --- a/fortran/testpar/CMakeLists.txt +++ b/fortran/testpar/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 2.8.10) +cmake_minimum_required (VERSION 2.8.11) PROJECT (HDF5_FORTRAN_TESTPAR C CXX Fortran) #----------------------------------------------------------------------------- diff --git a/hl/CMakeLists.txt b/hl/CMakeLists.txt index c6c0f82..d50c62d 100644 --- a/hl/CMakeLists.txt +++ b/hl/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 2.8.10) +cmake_minimum_required (VERSION 2.8.11) PROJECT (HDF5_HL C CXX) #----------------------------------------------------------------------------- diff --git a/hl/c++/CMakeLists.txt b/hl/c++/CMakeLists.txt index d641eae..386f5a6 100644 --- a/hl/c++/CMakeLists.txt +++ b/hl/c++/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 2.8.10) +cmake_minimum_required (VERSION 2.8.11) PROJECT (HDF5_HL_CPP) #----------------------------------------------------------------------------- diff --git a/hl/c++/examples/CMakeLists.txt b/hl/c++/examples/CMakeLists.txt index ca086db..8f9b43f 100644 --- a/hl/c++/examples/CMakeLists.txt +++ b/hl/c++/examples/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 2.8.10) +cmake_minimum_required (VERSION 2.8.11) PROJECT (HDF5_HL_CPP_EXAMPLES) #----------------------------------------------------------------------------- diff --git a/hl/c++/src/CMakeLists.txt b/hl/c++/src/CMakeLists.txt index 9f8d3f8..39c6737 100644 --- a/hl/c++/src/CMakeLists.txt +++ b/hl/c++/src/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 2.8.10) +cmake_minimum_required (VERSION 2.8.11) PROJECT (HDF5_HL_CPP_SRC) #----------------------------------------------------------------------------- diff --git a/hl/c++/src/Makefile.am b/hl/c++/src/Makefile.am index 7961747..03289c0 100644 --- a/hl/c++/src/Makefile.am +++ b/hl/c++/src/Makefile.am @@ -22,7 +22,7 @@ include $(top_srcdir)/config/commence.am include $(top_srcdir)/config/lt_vers.am # Include src directory -INCLUDES=-I$(top_srcdir)/src -I$(top_srcdir)/hl/src +AM_CPPFLAGS+=-I$(top_srcdir)/src -I$(top_srcdir)/hl/src # This is our main target lib_LTLIBRARIES=libhdf5_hl_cpp.la diff --git a/hl/c++/src/Makefile.in b/hl/c++/src/Makefile.in index 235cb81..c13f26a 100644 --- a/hl/c++/src/Makefile.in +++ b/hl/c++/src/Makefile.in @@ -187,7 +187,10 @@ AMTAR = @AMTAR@ # instead of CFLAGS, as CFLAGS is reserved solely for the user to define. # This applies to FCFLAGS, CXXFLAGS, CPPFLAGS, and LDFLAGS as well. AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ -AM_CPPFLAGS = @AM_CPPFLAGS@ @H5_CPPFLAGS@ + +# Include src directory +AM_CPPFLAGS = @AM_CPPFLAGS@ @H5_CPPFLAGS@ -I$(top_srcdir)/src \ + -I$(top_srcdir)/hl/src AM_CXXFLAGS = @AM_CXXFLAGS@ @H5_CXXFLAGS@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AM_FCFLAGS = @AM_FCFLAGS@ @H5_FCFLAGS@ @@ -463,9 +466,6 @@ LT_VERS_INTERFACE = 6 LT_VERS_REVISION = 165 LT_VERS_AGE = 0 -# Include src directory -INCLUDES = -I$(top_srcdir)/src -I$(top_srcdir)/hl/src - # This is our main target lib_LTLIBRARIES = libhdf5_hl_cpp.la diff --git a/hl/c++/test/CMakeLists.txt b/hl/c++/test/CMakeLists.txt index 82a4df0..4a7523c 100644 --- a/hl/c++/test/CMakeLists.txt +++ b/hl/c++/test/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 2.8.10) +cmake_minimum_required (VERSION 2.8.11) PROJECT (HDF5_HL_CPP_TEST) #----------------------------------------------------------------------------- diff --git a/hl/examples/CMakeLists.txt b/hl/examples/CMakeLists.txt index 2d621ca..7847dbe 100644 --- a/hl/examples/CMakeLists.txt +++ b/hl/examples/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 2.8.10) +cmake_minimum_required (VERSION 2.8.11) PROJECT (HDF5_HL_EXAMPLES ) #----------------------------------------------------------------------------- diff --git a/hl/fortran/CMakeLists.txt b/hl/fortran/CMakeLists.txt index f0ff22d..72fc7a8 100644 --- a/hl/fortran/CMakeLists.txt +++ b/hl/fortran/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 2.8.10) +cmake_minimum_required (VERSION 2.8.11) PROJECT (HDF5_HL_F90 C CXX Fortran) #----------------------------------------------------------------------------- diff --git a/hl/fortran/examples/CMakeLists.txt b/hl/fortran/examples/CMakeLists.txt index 189c9cc..12467b8 100644 --- a/hl/fortran/examples/CMakeLists.txt +++ b/hl/fortran/examples/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 2.8.10) +cmake_minimum_required (VERSION 2.8.11) PROJECT (HDF5_HL_F90_EXAMPLES C CXX Fortran) #----------------------------------------------------------------------------- diff --git a/hl/fortran/src/CMakeLists.txt b/hl/fortran/src/CMakeLists.txt index 9efcbc8..6377211 100644 --- a/hl/fortran/src/CMakeLists.txt +++ b/hl/fortran/src/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 2.8.10) +cmake_minimum_required (VERSION 2.8.11) PROJECT(HDF5_HL_F90_SRC C CXX Fortran) #----------------------------------------------------------------------------- diff --git a/hl/fortran/test/CMakeLists.txt b/hl/fortran/test/CMakeLists.txt index 23c199c..120d6a5 100644 --- a/hl/fortran/test/CMakeLists.txt +++ b/hl/fortran/test/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 2.8.10) +cmake_minimum_required (VERSION 2.8.11) PROJECT (HDF5_HL_FORTRAN_TESTS C CXX Fortran) #----------------------------------------------------------------------------- diff --git a/hl/src/CMakeLists.txt b/hl/src/CMakeLists.txt index 7a4e411..e93a23a 100644 --- a/hl/src/CMakeLists.txt +++ b/hl/src/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 2.8.10) +cmake_minimum_required (VERSION 2.8.11) PROJECT (HDF5_HL_SRC) #----------------------------------------------------------------------------- diff --git a/hl/test/CMakeLists.txt b/hl/test/CMakeLists.txt index 32b049a..545210b 100644 --- a/hl/test/CMakeLists.txt +++ b/hl/test/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 2.8.10) +cmake_minimum_required (VERSION 2.8.11) PROJECT (HDF5_HL_TEST) # -------------------------------------------------------------------- # Notes: When creating unit test executables they should be prefixed diff --git a/hl/tools/CMakeLists.txt b/hl/tools/CMakeLists.txt index a3db367..a41aecc 100644 --- a/hl/tools/CMakeLists.txt +++ b/hl/tools/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 2.8.10) +cmake_minimum_required (VERSION 2.8.11) PROJECT (HDF5_HL_TOOLS) #----------------------------------------------------------------------------- diff --git a/perform/CMakeLists.txt b/perform/CMakeLists.txt index 2ea0c32..df7526e 100644 --- a/perform/CMakeLists.txt +++ b/perform/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 2.8.10) +cmake_minimum_required (VERSION 2.8.11) PROJECT (HDF5_PERFORM ) #----------------------------------------------------------------------------- diff --git a/release_docs/USING_HDF5_CMake.txt b/release_docs/USING_HDF5_CMake.txt index 9a50525..84a44c1 100644 --- a/release_docs/USING_HDF5_CMake.txt +++ b/release_docs/USING_HDF5_CMake.txt @@ -186,7 +186,7 @@ III. Minimum C Project Files for CMake following text in the file: ########################################################## -cmake_minimum_required (VERSION 2.8.10) +cmake_minimum_required (VERSION 2.8.11) PROJECT (HDF5MyApp C CXX) FIND_PACKAGE (HDF5 NAMES hdf5) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index db26166..63f59d5 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 2.8.10) +cmake_minimum_required (VERSION 2.8.11) PROJECT (HDF5_SRC C CXX) #----------------------------------------------------------------------------- diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 7bc9d3b..b7f87b4 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 2.8.10) +cmake_minimum_required (VERSION 2.8.11) PROJECT (HDF5_TEST) #----------------------------------------------------------------------------- diff --git a/testpar/CMakeLists.txt b/testpar/CMakeLists.txt index 8eaa13a..6d4f4d4 100644 --- a/testpar/CMakeLists.txt +++ b/testpar/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 2.8.10) +cmake_minimum_required (VERSION 2.8.11) PROJECT (HDF5_TEST_PAR) #----------------------------------------------------------------------------- diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt index 0dfe7c9..a9a7232 100644 --- a/tools/CMakeLists.txt +++ b/tools/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 2.8.10) +cmake_minimum_required (VERSION 2.8.11) PROJECT (HDF5_TOOLS) #----------------------------------------------------------------------------- diff --git a/tools/h5copy/CMakeLists.txt b/tools/h5copy/CMakeLists.txt index 66cbae6..e5a1a9f 100644 --- a/tools/h5copy/CMakeLists.txt +++ b/tools/h5copy/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 2.8.10) +cmake_minimum_required (VERSION 2.8.11) PROJECT (HDF5_TOOLS_H5COPY) #----------------------------------------------------------------------------- diff --git a/tools/h5diff/CMakeLists.txt b/tools/h5diff/CMakeLists.txt index f660c12..5620968 100644 --- a/tools/h5diff/CMakeLists.txt +++ b/tools/h5diff/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 2.8.10) +cmake_minimum_required (VERSION 2.8.11) PROJECT (HDF5_TOOLS_H5DIFF) #----------------------------------------------------------------------------- diff --git a/tools/h5dump/CMakeLists.txt b/tools/h5dump/CMakeLists.txt index 387c4bf..1a46586 100644 --- a/tools/h5dump/CMakeLists.txt +++ b/tools/h5dump/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 2.8.10) +cmake_minimum_required (VERSION 2.8.11) PROJECT (HDF5_TOOLS_H5DUMP) #----------------------------------------------------------------------------- diff --git a/tools/h5import/CMakeLists.txt b/tools/h5import/CMakeLists.txt index 32dff55..36a3a9e 100644 --- a/tools/h5import/CMakeLists.txt +++ b/tools/h5import/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 2.8.10) +cmake_minimum_required (VERSION 2.8.11) PROJECT (HDF5_TOOLS_H5IMPORT) #----------------------------------------------------------------------------- diff --git a/tools/h5jam/CMakeLists.txt b/tools/h5jam/CMakeLists.txt index b12544f..b0d5ac8 100644 --- a/tools/h5jam/CMakeLists.txt +++ b/tools/h5jam/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 2.8.10) +cmake_minimum_required (VERSION 2.8.11) PROJECT (HDF5_TOOLS_H5JAM) #----------------------------------------------------------------------------- diff --git a/tools/h5ls/CMakeLists.txt b/tools/h5ls/CMakeLists.txt index b351268..5220087 100644 --- a/tools/h5ls/CMakeLists.txt +++ b/tools/h5ls/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 2.8.10) +cmake_minimum_required (VERSION 2.8.11) PROJECT (HDF5_TOOLS_H5LS) #----------------------------------------------------------------------------- diff --git a/tools/h5stat/CMakeLists.txt b/tools/h5stat/CMakeLists.txt index d182a45..82f0ffb 100644 --- a/tools/h5stat/CMakeLists.txt +++ b/tools/h5stat/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 2.8.10) +cmake_minimum_required (VERSION 2.8.11) PROJECT (HDF5_TOOLS_H5STAT) #----------------------------------------------------------------------------- diff --git a/tools/lib/CMakeLists.txt b/tools/lib/CMakeLists.txt index 5569b6f..83df182 100644 --- a/tools/lib/CMakeLists.txt +++ b/tools/lib/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 2.8.10) +cmake_minimum_required (VERSION 2.8.11) PROJECT (HDF5_TOOLS_LIB) #----------------------------------------------------------------------------- diff --git a/tools/misc/CMakeLists.txt b/tools/misc/CMakeLists.txt index 833e7e5..ed8c315 100644 --- a/tools/misc/CMakeLists.txt +++ b/tools/misc/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 2.8.10) +cmake_minimum_required (VERSION 2.8.11) PROJECT (HDF5_TOOLS_MISC) #----------------------------------------------------------------------------- -- cgit v0.12 From 288c7760a4a55d56df7a9019a8522625e305b9b7 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Sat, 15 Mar 2014 22:13:52 -0500 Subject: [svn-r24803] Description: Rename GCC_DIAG_OFF/ON macros to H5_GCC_DIAG_OFF/ON and move from src/H5private.h to src/H5public.h. Wrap typedef of hsize_t and hssize_t in DIAG_OFF(long-long) macros. Clean up a bunch of "macro '-' is unused" warnings. Tested on: Mac OSX/64 10.9.2 (amazon) w/gcc 4.8.2, C++, FORTRAN, parallel (too minor to require h5committest) --- hl/tools/gif2h5/decompress.c | 6 --- hl/tools/gif2h5/gif2mem.c | 2 - hl/tools/gif2h5/hdfgifwr.c | 65 ------------------------- perform/sio_engine.c | 12 ----- perform/zip_perf.c | 6 --- src/H5Tconv.c | 108 +++++++++++++++++++++--------------------- src/H5private.h | 19 -------- src/H5public.h | 21 ++++++++ test/cross_read.c | 2 + test/gen_cross.c | 2 + test/gen_new_group.c | 7 --- test/h5test.c | 1 - test/testmeta.c | 2 - test/titerate.c | 1 - test/ttime.c | 2 + test/ttsafe_dcreate.c | 1 - test/tunicode.c | 3 -- test/tvltypes.c | 5 -- tools/h5jam/getub.c | 23 ++++----- tools/h5jam/h5jamgentest.c | 31 +----------- tools/h5jam/tellub.c | 23 ++++----- tools/misc/h5repart_gentest.c | 1 - 22 files changed, 103 insertions(+), 240 deletions(-) diff --git a/hl/tools/gif2h5/decompress.c b/hl/tools/gif2h5/decompress.c index 2e44f1c..d4e4cdc 100644 --- a/hl/tools/gif2h5/decompress.c +++ b/hl/tools/gif2h5/decompress.c @@ -17,12 +17,6 @@ #include "gif.h" -#define NEXTBYTE (*ptr++) - -#define IMAGESEP 0x2c -#define INTERLACEMASK 0x40 -#define COLORMAPMASK 0x80 - WORD iWIDE, iHIGH, eWIDE, eHIGH, expand, numcols, strip, nostrip; unsigned long cols[256]; char *cmd; diff --git a/hl/tools/gif2h5/gif2mem.c b/hl/tools/gif2h5/gif2mem.c index 7995bb4..ac4b0ec 100644 --- a/hl/tools/gif2h5/gif2mem.c +++ b/hl/tools/gif2h5/gif2mem.c @@ -37,8 +37,6 @@ #include "gif.h" -#define GIF2VERSION "1.00" - GIFTOMEM Gif2Mem(BYTE *MemGif) { diff --git a/hl/tools/gif2h5/hdfgifwr.c b/hl/tools/gif2h5/hdfgifwr.c index 1771d06..d828226 100644 --- a/hl/tools/gif2h5/hdfgifwr.c +++ b/hl/tools/gif2h5/hdfgifwr.c @@ -56,31 +56,6 @@ typedef BYTE byte; typedef long int count_int; -/* indicies into conv24MB */ -#define CONV24_8BIT 0 -#define CONV24_24BIT 1 -#define CONV24_SEP1 2 -#define CONV24_LOCK 3 -#define CONV24_SEP2 4 -#define CONV24_FAST 5 -#define CONV24_SLOW 6 -#define CONV24_BEST 7 -#define CONV24_MAX 8 - -/* values 'picType' can take */ -#define PIC8 CONV24_8BIT -#define PIC24 CONV24_24BIT - -/* MONO returns total intensity of r,g,b components */ -#define MONO(rd,gn,bl) (((rd)*11 + (gn)*16 + (bl)*5) >> 5) /*.33R+ .5G+ .17B*/ - -#ifdef UNUSED -static int Width, Height; -static int curx, cury; -static long CountDown; -static int Interlace; -#endif /* UNUSED */ - #ifdef __STDC__ static void compress(int, FILE *, byte *, int); static void output(int); @@ -95,20 +70,12 @@ static void char_init(), char_out(), flush_char(); #endif /* __STDC__ */ static byte pc2nc[256]; -#ifdef UNUSED -static byte r1[256],g1[256],b1[256]; -#endif /* UNUSED */ /*************************************************************/ int hdfWriteGIF(FILE *fp, byte *pic, int ptype, int w, int h, byte *rmap, byte *gmap, byte *bmap, byte *pc2ncmap, int numcols, int colorstyle, int BitsPerPixel) { -#ifdef UNUSED - int RWidth, RHeight; - int LeftOfs, TopOfs; - int ColorMapSize, Background; -#endif /* UNUSED */ int InitCodeSize; int i; byte *pic8 = pic; @@ -121,39 +88,15 @@ int hdfWriteGIF(FILE *fp, byte *pic, int ptype, int w, int h, byte *rmap, numcols=numcols; colorstyle=colorstyle; -#ifdef UNUSED - Interlace = 0; - Background = 0; -#endif /* UNUSED */ - for (i = 0; i < 256; i++) { pc2nc[i] = pc2ncmap[i]; -#ifdef UNUSED - r1[i] = rmap[i]; - g1[i] = gmap[i]; - b1[i] = bmap[i]; -#endif /* UNUSED */ } -#ifdef UNUSED - ColorMapSize = 1 << BitsPerPixel; - - RWidth = Width = w; - RHeight = Height = h; - LeftOfs = TopOfs = 0; - - CountDown = w * h; /* # of pixels we'll be doing */ -#endif /* UNUSED */ - if (BitsPerPixel <= 1) InitCodeSize = 2; else InitCodeSize = BitsPerPixel; -#ifdef UNUSED - curx = cury = 0; -#endif /* UNUSED */ - if (!fp) { fprintf(stderr, "WriteGIF: file not open for writing\n" ); return (1); @@ -172,11 +115,7 @@ static unsigned long cur_accum = 0; static int cur_bits = 0; #define MAXCODE(n_bits) ( (1 << (n_bits)) - 1) -#ifndef min -#define min(a,b) ((a>b) ? b : a) -#endif /* min */ #define XV_BITS 12 /* BITS was already defined on some systems */ -#define MSDOS 1 #define HSIZE 5003 /* 80% occupancy */ typedef unsigned char char_type; @@ -203,10 +142,6 @@ static int hsize = HSIZE; /* for dynamic table sizing */ * used to be 8000 characters). */ -#define tab_prefixof(i) CodeTabOf(i) -#define tab_suffixof(i) ((char_type *)(htab))[i] -#define de_stack ((char_type *)&tab_suffixof(1<__file #endif /* RISCOS */ -#ifndef GZ_SUFFIX -# define GZ_SUFFIX ".gz" -#endif /* GZ_SUFFIX */ - #define ONE_KB 1024 #define ONE_MB (ONE_KB * ONE_KB) #define ONE_GB (ONE_MB * ONE_KB) diff --git a/src/H5Tconv.c b/src/H5Tconv.c index bf686b8..58b0b46 100644 --- a/src/H5Tconv.c +++ b/src/H5Tconv.c @@ -8039,9 +8039,9 @@ H5T__conv_float_schar (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { -GCC_DIAG_OFF(float-equal) +H5_GCC_DIAG_OFF(float-equal) H5T_CONV_Fx(FLOAT, SCHAR, float, signed char, SCHAR_MIN, SCHAR_MAX); -GCC_DIAG_ON(float-equal) +H5_GCC_DIAG_ON(float-equal) } @@ -8066,9 +8066,9 @@ H5T__conv_float_uchar (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { -GCC_DIAG_OFF(float-equal) +H5_GCC_DIAG_OFF(float-equal) H5T_CONV_Fx(FLOAT, UCHAR, float, unsigned char, 0, UCHAR_MAX); -GCC_DIAG_ON(float-equal) +H5_GCC_DIAG_ON(float-equal) } @@ -8093,9 +8093,9 @@ H5T__conv_double_schar (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { -GCC_DIAG_OFF(float-equal) +H5_GCC_DIAG_OFF(float-equal) H5T_CONV_Fx(DOUBLE, SCHAR, double, signed char, SCHAR_MIN, SCHAR_MAX); -GCC_DIAG_ON(float-equal) +H5_GCC_DIAG_ON(float-equal) } @@ -8120,9 +8120,9 @@ H5T__conv_double_uchar (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { -GCC_DIAG_OFF(float-equal) +H5_GCC_DIAG_OFF(float-equal) H5T_CONV_Fx(DOUBLE, UCHAR, double, unsigned char, 0, UCHAR_MAX); -GCC_DIAG_ON(float-equal) +H5_GCC_DIAG_ON(float-equal) } @@ -8148,9 +8148,9 @@ H5T__conv_ldouble_schar (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { -GCC_DIAG_OFF(float-equal) +H5_GCC_DIAG_OFF(float-equal) H5T_CONV_Fx(LDOUBLE, SCHAR, long double, signed char, SCHAR_MIN, SCHAR_MAX); -GCC_DIAG_ON(float-equal) +H5_GCC_DIAG_ON(float-equal) } #endif /* H5T_CONV_INTERNAL_LDOUBLE_INTEGER */ @@ -8177,9 +8177,9 @@ H5T__conv_ldouble_uchar (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { -GCC_DIAG_OFF(float-equal) +H5_GCC_DIAG_OFF(float-equal) H5T_CONV_Fx(LDOUBLE, UCHAR, long double, unsigned char, 0, UCHAR_MAX); -GCC_DIAG_ON(float-equal) +H5_GCC_DIAG_ON(float-equal) } #endif /* H5T_CONV_INTERNAL_LDOUBLE_INTEGER */ @@ -8205,9 +8205,9 @@ H5T__conv_float_short (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { -GCC_DIAG_OFF(float-equal) +H5_GCC_DIAG_OFF(float-equal) H5T_CONV_Fx(FLOAT, SHORT, float, short, SHRT_MIN, SHRT_MAX); -GCC_DIAG_ON(float-equal) +H5_GCC_DIAG_ON(float-equal) } @@ -8232,9 +8232,9 @@ H5T__conv_float_ushort (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { -GCC_DIAG_OFF(float-equal) +H5_GCC_DIAG_OFF(float-equal) H5T_CONV_Fx(FLOAT, USHORT, float, unsigned short, 0, USHRT_MAX); -GCC_DIAG_ON(float-equal) +H5_GCC_DIAG_ON(float-equal) } @@ -8259,9 +8259,9 @@ H5T__conv_double_short (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { -GCC_DIAG_OFF(float-equal) +H5_GCC_DIAG_OFF(float-equal) H5T_CONV_Fx(DOUBLE, SHORT, double, short, SHRT_MIN, SHRT_MAX); -GCC_DIAG_ON(float-equal) +H5_GCC_DIAG_ON(float-equal) } @@ -8286,9 +8286,9 @@ H5T__conv_double_ushort (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { -GCC_DIAG_OFF(float-equal) +H5_GCC_DIAG_OFF(float-equal) H5T_CONV_Fx(DOUBLE, USHORT, double, unsigned short, 0, USHRT_MAX); -GCC_DIAG_ON(float-equal) +H5_GCC_DIAG_ON(float-equal) } @@ -8314,9 +8314,9 @@ H5T__conv_ldouble_short (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { -GCC_DIAG_OFF(float-equal) +H5_GCC_DIAG_OFF(float-equal) H5T_CONV_Fx(LDOUBLE, SHORT, long double, short, SHRT_MIN, SHRT_MAX); -GCC_DIAG_ON(float-equal) +H5_GCC_DIAG_ON(float-equal) } #endif /*H5T_CONV_INTERNAL_LDOUBLE_INTEGER*/ @@ -8343,9 +8343,9 @@ H5T__conv_ldouble_ushort (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { -GCC_DIAG_OFF(float-equal) +H5_GCC_DIAG_OFF(float-equal) H5T_CONV_Fx(LDOUBLE, USHORT, long double, unsigned short, 0, USHRT_MAX); -GCC_DIAG_ON(float-equal) +H5_GCC_DIAG_ON(float-equal) } #endif /* H5T_CONV_INTERNAL_LDOUBLE_INTEGER */ @@ -8371,9 +8371,9 @@ H5T__conv_float_int (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { -GCC_DIAG_OFF(float-equal) +H5_GCC_DIAG_OFF(float-equal) H5T_CONV_Fx(FLOAT, INT, float, int, INT_MIN, INT_MAX); -GCC_DIAG_ON(float-equal) +H5_GCC_DIAG_ON(float-equal) } @@ -8398,9 +8398,9 @@ H5T__conv_float_uint (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { -GCC_DIAG_OFF(float-equal) +H5_GCC_DIAG_OFF(float-equal) H5T_CONV_Fx(FLOAT, UINT, float, unsigned int, 0, UINT_MAX); -GCC_DIAG_ON(float-equal) +H5_GCC_DIAG_ON(float-equal) } @@ -8425,9 +8425,9 @@ H5T__conv_double_int (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { -GCC_DIAG_OFF(float-equal) +H5_GCC_DIAG_OFF(float-equal) H5T_CONV_Fx(DOUBLE, INT, double, int, INT_MIN, INT_MAX); -GCC_DIAG_ON(float-equal) +H5_GCC_DIAG_ON(float-equal) } @@ -8452,9 +8452,9 @@ H5T__conv_double_uint (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { -GCC_DIAG_OFF(float-equal) +H5_GCC_DIAG_OFF(float-equal) H5T_CONV_Fx(DOUBLE, UINT, double, unsigned int, 0, UINT_MAX); -GCC_DIAG_ON(float-equal) +H5_GCC_DIAG_ON(float-equal) } @@ -8480,9 +8480,9 @@ H5T__conv_ldouble_int (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { -GCC_DIAG_OFF(float-equal) +H5_GCC_DIAG_OFF(float-equal) H5T_CONV_Fx(LDOUBLE, INT, long double, int, INT_MIN, INT_MAX); -GCC_DIAG_ON(float-equal) +H5_GCC_DIAG_ON(float-equal) } #endif /* H5T_CONV_INTERNAL_LDOUBLE_INTEGER */ @@ -8509,9 +8509,9 @@ H5T__conv_ldouble_uint (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { -GCC_DIAG_OFF(float-equal) +H5_GCC_DIAG_OFF(float-equal) H5T_CONV_Fx(LDOUBLE, UINT, long double, unsigned int, 0, UINT_MAX); -GCC_DIAG_ON(float-equal) +H5_GCC_DIAG_ON(float-equal) } #endif /* H5T_CONV_INTERNAL_LDOUBLE_UINT */ @@ -8537,9 +8537,9 @@ H5T__conv_float_long (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { -GCC_DIAG_OFF(float-equal) +H5_GCC_DIAG_OFF(float-equal) H5T_CONV_Fx(FLOAT, LONG, float, long, LONG_MIN, LONG_MAX); -GCC_DIAG_ON(float-equal) +H5_GCC_DIAG_ON(float-equal) } @@ -8564,9 +8564,9 @@ H5T__conv_float_ulong (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { -GCC_DIAG_OFF(float-equal) +H5_GCC_DIAG_OFF(float-equal) H5T_CONV_Fx(FLOAT, ULONG, float, unsigned long, 0, ULONG_MAX); -GCC_DIAG_ON(float-equal) +H5_GCC_DIAG_ON(float-equal) } @@ -8591,9 +8591,9 @@ H5T__conv_double_long (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { -GCC_DIAG_OFF(float-equal) +H5_GCC_DIAG_OFF(float-equal) H5T_CONV_Fx(DOUBLE, LONG, double, long, LONG_MIN, LONG_MAX); -GCC_DIAG_ON(float-equal) +H5_GCC_DIAG_ON(float-equal) } @@ -8618,9 +8618,9 @@ H5T__conv_double_ulong (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { -GCC_DIAG_OFF(float-equal) +H5_GCC_DIAG_OFF(float-equal) H5T_CONV_Fx(DOUBLE, ULONG, double, unsigned long, 0, ULONG_MAX); -GCC_DIAG_ON(float-equal) +H5_GCC_DIAG_ON(float-equal) } @@ -8646,9 +8646,9 @@ H5T__conv_ldouble_long (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { -GCC_DIAG_OFF(float-equal) +H5_GCC_DIAG_OFF(float-equal) H5T_CONV_Fx(LDOUBLE, LONG, long double, long, LONG_MIN, LONG_MAX); -GCC_DIAG_ON(float-equal) +H5_GCC_DIAG_ON(float-equal) } #endif /*H5T_CONV_INTERNAL_LDOUBLE_INTEGER*/ @@ -8675,9 +8675,9 @@ H5T__conv_ldouble_ulong (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { -GCC_DIAG_OFF(float-equal) +H5_GCC_DIAG_OFF(float-equal) H5T_CONV_Fx(LDOUBLE, ULONG, long double, unsigned long, 0, ULONG_MAX); -GCC_DIAG_ON(float-equal) +H5_GCC_DIAG_ON(float-equal) } #endif /* H5T_CONV_INTERNAL_LDOUBLE_INTEGER */ @@ -8704,9 +8704,9 @@ H5T__conv_float_llong (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { -GCC_DIAG_OFF(float-equal) +H5_GCC_DIAG_OFF(float-equal) H5T_CONV_Fx(FLOAT, LLONG, float, long long, LLONG_MIN, LLONG_MAX); -GCC_DIAG_ON(float-equal) +H5_GCC_DIAG_ON(float-equal) } #endif /* H5T_CONV_INTERNAL_FP_LLONG */ @@ -8760,9 +8760,9 @@ H5T__conv_double_llong (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { -GCC_DIAG_OFF(float-equal) +H5_GCC_DIAG_OFF(float-equal) H5T_CONV_Fx(DOUBLE, LLONG, double, long long, LLONG_MIN, LLONG_MAX); -GCC_DIAG_ON(float-equal) +H5_GCC_DIAG_ON(float-equal) } #endif /*H5T_CONV_INTERNAL_FP_LLONG*/ @@ -8816,9 +8816,9 @@ H5T__conv_ldouble_llong (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { -GCC_DIAG_OFF(float-equal) +H5_GCC_DIAG_OFF(float-equal) H5T_CONV_Fx(LDOUBLE, LLONG, long double, long long, LLONG_MIN, LLONG_MAX); -GCC_DIAG_ON(float-equal) +H5_GCC_DIAG_ON(float-equal) } #endif /*H5T_CONV_INTERNAL_LDOUBLE_LLONG*/ diff --git a/src/H5private.h b/src/H5private.h index 26ccf57..d1dcd84 100644 --- a/src/H5private.h +++ b/src/H5private.h @@ -2357,25 +2357,6 @@ func_init_failed: \ #define HDcompile_assert(e) do { typedef struct { unsigned int b: (e); } x; } while(0) */ -/* Macros for enabling/disabling particular GCC warnings */ -/* (see the following web-sites for more info: - * http://www.dbp-consulting.com/tutorials/SuppressingGCCWarnings.html - * http://gcc.gnu.org/onlinedocs/gcc/Diagnostic-Pragmas.html#Diagnostic-Pragmas - */ -/* These pragmas are only implemented usefully in gcc 4.6+ */ -#if ((__GNUC__ * 100) + __GNUC_MINOR__) >= 406 - #define GCC_DIAG_STR(s) #s - #define GCC_DIAG_JOINSTR(x,y) GCC_DIAG_STR(x ## y) - #define GCC_DIAG_DO_PRAGMA(x) _Pragma (#x) - #define GCC_DIAG_PRAGMA(x) GCC_DIAG_DO_PRAGMA(GCC diagnostic x) - - #define GCC_DIAG_OFF(x) GCC_DIAG_PRAGMA(push) GCC_DIAG_PRAGMA(ignored GCC_DIAG_JOINSTR(-W,x)) - #define GCC_DIAG_ON(x) GCC_DIAG_PRAGMA(pop) -#else - #define GCC_DIAG_OFF(x) - #define GCC_DIAG_ON(x) -#endif - /* Private functions, not part of the publicly documented API */ H5_DLL herr_t H5_init_library(void); H5_DLL void H5_term_library(void); diff --git a/src/H5public.h b/src/H5public.h index 544f7be..35207df 100644 --- a/src/H5public.h +++ b/src/H5public.h @@ -72,6 +72,25 @@ extern "C" { #endif +/* Macros for enabling/disabling particular GCC warnings */ +/* (see the following web-sites for more info: + * http://www.dbp-consulting.com/tutorials/SuppressingGCCWarnings.html + * http://gcc.gnu.org/onlinedocs/gcc/Diagnostic-Pragmas.html#Diagnostic-Pragmas + */ +/* These pragmas are only implemented usefully in gcc 4.6+ */ +#if ((__GNUC__ * 100) + __GNUC_MINOR__) >= 406 + #define H5_GCC_DIAG_STR(s) #s + #define H5_GCC_DIAG_JOINSTR(x,y) H5_GCC_DIAG_STR(x ## y) + #define H5_GCC_DIAG_DO_PRAGMA(x) _Pragma (#x) + #define H5_GCC_DIAG_PRAGMA(x) H5_GCC_DIAG_DO_PRAGMA(GCC diagnostic x) + + #define H5_GCC_DIAG_OFF(x) H5_GCC_DIAG_PRAGMA(push) H5_GCC_DIAG_PRAGMA(ignored H5_GCC_DIAG_JOINSTR(-W,x)) + #define H5_GCC_DIAG_ON(x) H5_GCC_DIAG_PRAGMA(pop) +#else + #define H5_GCC_DIAG_OFF(x) + #define H5_GCC_DIAG_ON(x) +#endif + /* Version numbers */ #define H5_VERS_MAJOR 1 /* For major interface/format changes */ #define H5_VERS_MINOR 9 /* For minor interface/format changes */ @@ -148,8 +167,10 @@ typedef long long ssize_t; * type. */ #if H5_SIZEOF_LONG_LONG >= 8 +H5_GCC_DIAG_OFF(long-long) typedef unsigned long long hsize_t; typedef signed long long hssize_t; +H5_GCC_DIAG_ON(long-long) # define H5_SIZEOF_HSIZE_T H5_SIZEOF_LONG_LONG # define H5_SIZEOF_HSSIZE_T H5_SIZEOF_LONG_LONG #else diff --git a/test/cross_read.c b/test/cross_read.c index 308a0c1..ba99c9e 100644 --- a/test/cross_read.c +++ b/test/cross_read.c @@ -50,8 +50,10 @@ const char *FILENAME[] = { #define DATASETNAME15 "Fletcher_float_data_be" #define DATASETNAME16 "Deflate_float_data_le" #define DATASETNAME17 "Deflate_float_data_be" +#ifdef H5_HAVE_FILTER_SZIP #define DATASETNAME18 "Szip_float_data_le" #define DATASETNAME19 "Szip_float_data_be" +#endif /* H5_HAVE_FILTER_SZIP */ #define DATASETNAME20 "Shuffle_float_data_le" #define DATASETNAME21 "Shuffle_float_data_be" #define DATASETNAME22 "Nbit_float_data_le" diff --git a/test/gen_cross.c b/test/gen_cross.c index 8cbb2f5..bdc2835 100644 --- a/test/gen_cross.c +++ b/test/gen_cross.c @@ -46,8 +46,10 @@ #define DATASETNAME15 "Fletcher_float_data_be" #define DATASETNAME16 "Deflate_float_data_le" #define DATASETNAME17 "Deflate_float_data_be" +#ifdef H5_HAVE_FILTER_SZIP #define DATASETNAME18 "Szip_float_data_le" #define DATASETNAME19 "Szip_float_data_be" +#endif /* H5_HAVE_FILTER_SZIP */ #define DATASETNAME20 "Shuffle_float_data_le" #define DATASETNAME21 "Shuffle_float_data_be" #define DATASETNAME22 "Nbit_float_data_le" diff --git a/test/gen_new_group.c b/test/gen_new_group.c index 6d16031..b998913 100644 --- a/test/gen_new_group.c +++ b/test/gen_new_group.c @@ -31,13 +31,6 @@ #define FILENAME "group_new.h5" -#ifndef TRUE -#define TRUE 1 -#endif /* TRUE */ -#ifndef FALSE -#define FALSE 0 -#endif /* FALSE */ - int main(void) { hid_t fid = -1; /* File ID */ diff --git a/test/h5test.c b/test/h5test.c index f361c49..a5f81ef 100644 --- a/test/h5test.c +++ b/test/h5test.c @@ -75,7 +75,6 @@ char *paraprefix = NULL; /* for command line option para-prefix */ MPI_Info h5_io_info_g=MPI_INFO_NULL;/* MPI INFO object for IO */ #endif -#define FILENAME_BUF_SIZE 1024 #define READ_BUF_SIZE 4096 /* diff --git a/test/testmeta.c b/test/testmeta.c index 9aa4972..a008cc7 100644 --- a/test/testmeta.c +++ b/test/testmeta.c @@ -29,14 +29,12 @@ #define FILEN "testmeta.h5" -#define MEMB_SIZE 100000000 #define CHUNK_SIZE 512 #define NDATAARRAYS 3 /*#define NPOINTS 2048*/ #define NPOINTS 20 #define NEXTARRAYS 10 -#define NWATTRS 2 #define NDATAOBJECTS 100000 int main(void) diff --git a/test/titerate.c b/test/titerate.c index d41df84..049e258 100644 --- a/test/titerate.c +++ b/test/titerate.c @@ -40,7 +40,6 @@ #define NAMELEN 80 /* 1-D dataset with fixed dimensions */ -#define SPACE1_NAME "Space1" #define SPACE1_RANK 1 #define SPACE1_DIM1 4 diff --git a/test/ttime.c b/test/ttime.c index 4762656..16acd3e 100644 --- a/test/ttime.c +++ b/test/ttime.c @@ -26,7 +26,9 @@ #include "hdf5.h" #define DATAFILE "ttime.h5" +#ifdef NOT_YET #define DATASETNAME "Dataset" +#endif /* NOT_YET */ /**************************************************************** ** diff --git a/test/ttsafe_dcreate.c b/test/ttsafe_dcreate.c index f83332d..df51f72 100644 --- a/test/ttsafe_dcreate.c +++ b/test/ttsafe_dcreate.c @@ -45,7 +45,6 @@ #ifdef H5_HAVE_THREADSAFE #define FILENAME "ttsafe_dcreate.h5" -#define DATASETNAME_LENGTH 10 #define NUM_THREAD 16 void *tts_dcreate_creator(void *); diff --git a/test/tunicode.c b/test/tunicode.c index 7dfda16..7793ea3 100644 --- a/test/tunicode.c +++ b/test/tunicode.c @@ -29,16 +29,13 @@ #define LONG_BUF_SIZE (2 * MAX_STRING_LENGTH + 4) #define DSET1_NAME "fl_string_dataset" -#define DSET2_NAME "dataset2" #define DSET3_NAME "dataset3" #define DSET4_NAME "dataset4" #define VL_DSET1_NAME "vl_dset_1" -#define VL_DSET2_NAME "vl_dset_2" #define GROUP1_NAME "group1" #define GROUP2_NAME "group2" #define GROUP3_NAME "group3" #define GROUP4_NAME "group4" -#define SLINK_NAME "soft_link" #define RANK 1 #define COMP_INT_VAL 7 diff --git a/test/tvltypes.c b/test/tvltypes.c index ab4d880..516974e 100644 --- a/test/tvltypes.c +++ b/test/tvltypes.c @@ -32,11 +32,6 @@ #define SPACE1_RANK 1 #define SPACE1_DIM1 4 -/* 2-D dataset with fixed dimensions */ -#define SPACE2_RANK 2 -#define SPACE2_DIM1 10 -#define SPACE2_DIM2 10 - /* 1-D dataset with fixed dimensions */ #define SPACE3_RANK 1 #define SPACE3_DIM1 128 diff --git a/tools/h5jam/getub.c b/tools/h5jam/getub.c index 3aff2b4..776eaeb 100644 --- a/tools/h5jam/getub.c +++ b/tools/h5jam/getub.c @@ -26,9 +26,6 @@ void parse_command_line (int argc, const char *argv[]); -#define TRUE 1 -#define FALSE 0 - /* Name of tool */ #define PROGRAMNAME "getub" char *nbytes = NULL; @@ -79,21 +76,21 @@ usage (const char *prog) void parse_command_line (int argc, const char *argv[]) { - int opt = FALSE; + int opt; /* parse command line options */ while ((opt = get_option (argc, argv, s_opts, l_opts)) != EOF) { switch ((char) opt) - { - case 'c': - nbytes = HDstrdup (opt_arg); - break; - case '?': - default: - usage (h5tools_getprogname()); - exit (EXIT_FAILURE); - } + { + case 'c': + nbytes = HDstrdup (opt_arg); + break; + case '?': + default: + usage (h5tools_getprogname()); + exit (EXIT_FAILURE); + } } if (argc <= opt_ind) diff --git a/tools/h5jam/h5jamgentest.c b/tools/h5jam/h5jamgentest.c index ca3d86c..9636597 100644 --- a/tools/h5jam/h5jamgentest.c +++ b/tools/h5jam/h5jamgentest.c @@ -28,7 +28,9 @@ #include "hdf5.h" #include "H5private.h" +/* not used yet #define UBTXT1 "u0.txt" +*/ #define UBTXT2 "u10.txt" #define UBTXT3 "u511.txt" #define UBTXT4 "u512.txt" @@ -69,24 +71,7 @@ char pattern[11] = "abcdefghij"; #define BUF_SIZE 1024 -#define LENSTR 50 -#define LENSTR2 11 - -#define SPACE2_RANK 2 -#define SPACE2_DIM1 10 -#define SPACE2_DIM2 10 - -#define SPACE1_RANK 1 -#define SPACE1_DIM1 4 - -#define DIM1 20 -#define DIM2 10 -#define CDIM1 DIM1/2 -#define CDIM2 DIM2/2 -#define RANK 2 - /* Element selection information */ -#define POINT1_NPOINTS 10 typedef enum{ RED, @@ -106,22 +91,10 @@ typedef struct s1_t { /* 1-D array datatype */ #define ARRAY1_RANK 1 -#define ARRAY1_DIM1 4 - -/* 3-D array datatype */ -#define ARRAY2_RANK 3 -#define ARRAY2_DIM1 3 -#define ARRAY2_DIM2 4 -#define ARRAY2_DIM3 5 /* 2-D array datatype */ -#define ARRAY3_RANK 2 -#define ARRAY3_DIM1 6 #define ARRAY3_DIM2 3 -/* VL string datatype name */ -#define VLSTR_TYPE "vl_string_type" - /* A UD link traversal function. Shouldn't actually be called. */ static hid_t UD_traverse(const char UNUSED * link_name, hid_t UNUSED cur_group, const void UNUSED * udata, size_t UNUSED udata_size, hid_t UNUSED lapl_id) diff --git a/tools/h5jam/tellub.c b/tools/h5jam/tellub.c index 0169d71..b4f87af 100644 --- a/tools/h5jam/tellub.c +++ b/tools/h5jam/tellub.c @@ -24,9 +24,6 @@ #include "h5tools.h" #include "h5tools_utils.h" -#define TRUE 1 -#define FALSE 0 - /* Name of tool */ #define PROGRAMNAME "tellub" @@ -85,21 +82,21 @@ usage (const char *prog) static void parse_command_line (int argc, const char *argv[]) { - int opt = FALSE; + int opt; /* parse command line options */ while ((opt = get_option (argc, argv, s_opts, l_opts)) != EOF) { switch ((char) opt) - { - case 'h': - usage (h5tools_getprogname()); - exit (EXIT_SUCCESS); - case '?': - default: - usage (h5tools_getprogname()); - exit (EXIT_FAILURE); - } + { + case 'h': + usage (h5tools_getprogname()); + exit (EXIT_SUCCESS); + case '?': + default: + usage (h5tools_getprogname()); + exit (EXIT_FAILURE); + } } /* check for file name to be processed */ diff --git a/tools/misc/h5repart_gentest.c b/tools/misc/h5repart_gentest.c index 8420da5..f7d9a73 100644 --- a/tools/misc/h5repart_gentest.c +++ b/tools/misc/h5repart_gentest.c @@ -23,7 +23,6 @@ #include "hdf5.h" #include "H5private.h" -#define KB 1024 #define FAMILY_NUMBER 4 #define FAMILY_SIZE 1024 #define FILENAME "family_file%05d.h5" -- cgit v0.12 From 164b4c75341ee4aa31dcd47c189e415a36ae35e2 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Sat, 15 Mar 2014 23:44:13 -0500 Subject: [svn-r24804] Description: Brought changes from Coverity branch back to trunk, and cleaned up misc. other warnings & formatting issues: r20833: Fixed Coverity 667 and 668 with real integer overflow tests this time. r20834: Use HDstrncpy and HDstrncat. --gh r20835: Change to use strncpy - use base_len + 1 for line 156, use HDstrlen(path) + 1 for line 159 r20836: Fixed coverity 585 by casting output of fgetc() to a char. r20837: Changed sprintf calls to snprintf with size 1 less than the allocated buffer to address coverity issue #967. Tested on: Mac OSX/64 10.9.2 (amazon) w/C++, FORTRAN & parallel (too minor to require h5committest) --- hl/test/test_image.c | 24 ++++--- test/H5srcdir.h | 8 +-- test/dt_arith.c | 174 ++++++++++++++++++++++++---------------------- test/h5test.c | 151 ++++++++++++++++++---------------------- tools/h5import/h5import.c | 17 +++-- tools/lib/h5diff.c | 2 - tools/lib/h5trav.c | 102 +++++++++++---------------- tools/lib/h5trav.h | 12 ++-- 8 files changed, 229 insertions(+), 261 deletions(-) diff --git a/hl/test/test_image.c b/hl/test/test_image.c index 38f1830..36dc734 100644 --- a/hl/test/test_image.c +++ b/hl/test/test_image.c @@ -13,8 +13,10 @@ * access to either file, you may request a copy from help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +#include #include #include + #include "h5hltest.h" #include "H5srcdir.h" #include "H5LTpublic.h" @@ -622,10 +624,12 @@ static int test_generate(void) if(n_elements > INT_MAX / (int)sizeof(float)) goto out; - data = (float *)HDmalloc((size_t)n_elements * sizeof( float )); - HDassert(data); - image_data = (unsigned char *)HDmalloc((size_t)n_elements * sizeof( unsigned char )); - HDassert(image_data); + data = (float *)HDmalloc((size_t)n_elements * sizeof(float)); + if(NULL == data) + goto out; + image_data = (unsigned char *)HDmalloc((size_t)n_elements * sizeof(unsigned char)); + if(NULL == image_data) + goto out; for ( i = 0; i < n_elements; i++ ) { @@ -794,9 +798,6 @@ static int read_data( const char* fname, /*IN*/ fscanf(f, "%s", str); fscanf(f, "%d", &w); - *width = (hsize_t)w; - *height = (hsize_t)h; - /* Check product for overflow */ if(w < 1 || h < 1 || color_planes < 1) goto out; @@ -813,13 +814,16 @@ static int read_data( const char* fname, /*IN*/ goto out; /* Release the buffer, if it was previously allocated */ - if(image_data) { + if(image_data) HDfree(image_data); - image_data = NULL; - } /* end if */ /* Allocate the image data buffer */ image_data = (unsigned char *)HDmalloc((size_t)n_elements * sizeof(unsigned char)); + if(NULL == image_data) + goto out; + + *width = (hsize_t)w; + *height = (hsize_t)h; /* Read data elements */ for(i = 0; i < n_elements; i++) { diff --git a/test/H5srcdir.h b/test/H5srcdir.h index 202d050..4f0f439 100644 --- a/test/H5srcdir.h +++ b/test/H5srcdir.h @@ -46,8 +46,8 @@ static const char *H5_get_srcdir_filename(const char *filename) /* Build path to test file */ if((HDstrlen(srcdir) + HDstrlen(filename) + 2) < sizeof(srcdir_testpath)) { - HDstrcpy(srcdir_testpath, srcdir); #ifdef H5_VMS + HDstrcpy(srcdir_testpath, srcdir); if(filename[0] == '[') { char *tmp = filename; @@ -57,8 +57,7 @@ static const char *H5_get_srcdir_filename(const char *filename) else HDstrcat(srcdir_testpath, filename); #else - HDstrcat(srcdir_testpath, "/"); - HDstrcat(srcdir_testpath, filename); + HDsnprintf(srcdir_testpath, sizeof(srcdir_testpath), "%s/%s", srcdir, filename); #endif return(srcdir_testpath); } /* end if */ @@ -77,8 +76,7 @@ static const char *H5_get_srcdir(void) /* Build path to all test files */ if((HDstrlen(srcdir) + 2) < sizeof(srcdir_path)) { - HDstrcpy(srcdir_path, srcdir); - HDstrcat(srcdir_path, "/"); + HDsnprintf(srcdir_path, sizeof(srcdir_path), "%s/", srcdir); return(srcdir_path); } /* end if */ else diff --git a/test/dt_arith.c b/test/dt_arith.c index c3692d0..1922f72 100644 --- a/test/dt_arith.c +++ b/test/dt_arith.c @@ -531,15 +531,14 @@ except_func(H5T_conv_except_t except_type, hid_t UNUSED src_id, hid_t UNUSED dst * Programmer: Robb Matzke * Tuesday, July 21, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ void some_dummy_func(float x) { char s[128]; - sprintf(s, "%g", x); + + HDsnprintf(s, sizeof(s), "%g", x); } @@ -576,7 +575,8 @@ generates_sigfpe(void) HDexit(1); } else if (0==pid) { for (i=0; i<2000; i++) { - for (j=0; j derived floating-point conversions"); + HDsnprintf(str, sizeof(str), "\nTesting random sw derived floating-point -> derived floating-point conversions"); printf("%-70s", str); HDfflush(stdout); H5_FAILED(); @@ -1204,13 +1204,13 @@ test_derived_flt(void) src_size = H5Tget_size(tid2); dst_size = H5Tget_size(tid1); endian = H5Tget_order(tid2); - buf = (unsigned char*)HDmalloc(nelmts*(MAX(src_size, dst_size))); - saved_buf = (unsigned char*)HDmalloc(nelmts*src_size); - HDmemset(buf, 0, nelmts*MAX(src_size, dst_size)); + buf = (unsigned char *)HDmalloc(nelmts*(MAX(src_size, dst_size))); + saved_buf = (unsigned char *)HDmalloc(nelmts*src_size); + HDmemset(buf, 0, nelmts * MAX(src_size, dst_size)); HDmemset(saved_buf, 0, nelmts*src_size); for(i=0; i derived floating-point conversions"); + HDsnprintf(str, sizeof(str), "\nTesting random sw derived floating-point -> derived floating-point conversions"); printf("%-70s", str); HDfflush(stdout); H5_FAILED(); @@ -1514,13 +1514,13 @@ test_derived_integer(void) src_size = H5Tget_size(tid1); dst_size = H5Tget_size(tid2); endian = H5Tget_order(tid1); - buf = (unsigned char*)HDmalloc(nelmts*(MAX(src_size, dst_size))); - saved_buf = (unsigned char*)HDmalloc(nelmts*src_size); - HDmemset(buf, 0, nelmts*MAX(src_size, dst_size)); + buf = (unsigned char *)HDmalloc(nelmts*(MAX(src_size, dst_size))); + saved_buf = (unsigned char *)HDmalloc(nelmts*src_size); + HDmemset(buf, 0, nelmts * MAX(src_size, dst_size)); HDmemset(saved_buf, 0, nelmts*src_size); - for(i=0; i derived integer conversions"); + HDsnprintf(str, sizeof(str), "\nTesting random sw derived integer -> derived integer conversions"); printf("%-70s", str); HDfflush(stdout); H5_FAILED(); @@ -1748,14 +1748,14 @@ test_conv_int_1(const char *name, hid_t src, hid_t dst) /* Sanity checks */ if (OTHER==src_type || OTHER==dst_type) { - sprintf(str, "Testing %s %s -> %s conversions", + HDsnprintf(str, sizeof(str), "Testing %s %s -> %s conversions", name, src_type_name, dst_type_name); printf("%-70s", str); H5_FAILED(); HDputs(" Unknown data type."); goto error; } else { - sprintf(str, "Testing %s %s -> %s conversions", + HDsnprintf(str, sizeof(str), "Testing %s %s -> %s conversions", name, src_type_name, dst_type_name); printf("%-70s", str); HDfflush(stdout); @@ -2718,17 +2718,20 @@ my_isnan(dtype_t type, void *val) if (!retval) { if (FLT_FLOAT==type) { float x; + HDmemcpy(&x, val, sizeof(float)); - sprintf(s, "%g", x); + HDsnprintf(s, sizeof(s), "%g", x); } else if (FLT_DOUBLE==type) { double x; + HDmemcpy(&x, val, sizeof(double)); - sprintf(s, "%g", x); + HDsnprintf(s, sizeof(s), "%g", x); #if H5_SIZEOF_LONG_DOUBLE!=H5_SIZEOF_DOUBLE && H5_SIZEOF_LONG_DOUBLE!=0 } else if (FLT_LDOUBLE==type) { long double x; + HDmemcpy(&x, val, sizeof(long double)); - sprintf(s, "%Lg", x); + HDsnprintf(s, sizeof(s), "%Lg", x); #endif } else { return 0; @@ -2896,7 +2899,7 @@ test_conv_flt_1 (const char *name, int run_test, hid_t src, hid_t dst) } else if (WIFEXITED(status)) { return WEXITSTATUS(status); } else if (WIFSIGNALED(status)) { - sprintf(str, " Child caught signal %d.", WTERMSIG(status)); + HDsnprintf(str, sizeof(str), " Child caught signal %d.", WTERMSIG(status)); HDputs(str); return 1; /*child exit after catching non-SIGFPE signal */ } else { @@ -2952,16 +2955,16 @@ test_conv_flt_1 (const char *name, int run_test, hid_t src, hid_t dst) HDputs("Sizeof(float)==sizeof(double) - some tests may not be sensible."); if (OTHER==src_type || OTHER==dst_type) { if(!strcmp(name, "noop")) - sprintf(str, "Testing %s %s -> %s conversions", + HDsnprintf(str, sizeof(str), "Testing %s %s -> %s conversions", name, src_type_name, dst_type_name); else if(run_test==TEST_SPECIAL) - sprintf(str, "Testing %s special %s -> %s conversions", + HDsnprintf(str, sizeof(str), "Testing %s special %s -> %s conversions", name, src_type_name, dst_type_name); else if(run_test==TEST_NORMAL) - sprintf(str, "Testing %s normalized %s -> %s conversions", + HDsnprintf(str, sizeof(str), "Testing %s normalized %s -> %s conversions", name, src_type_name, dst_type_name); else if(run_test==TEST_DENORM) - sprintf(str, "Testing %s denormalized %s -> %s conversions", + HDsnprintf(str, sizeof(str), "Testing %s denormalized %s -> %s conversions", name, src_type_name, dst_type_name); printf("%-70s", str); @@ -2970,16 +2973,16 @@ test_conv_flt_1 (const char *name, int run_test, hid_t src, hid_t dst) goto error; } else { if(!strcmp(name, "noop")) - sprintf(str, "Testing %s %s -> %s conversions", + HDsnprintf(str, sizeof(str), "Testing %s %s -> %s conversions", name, src_type_name, dst_type_name); else if(run_test==TEST_SPECIAL) - sprintf(str, "Testing %s special %s -> %s conversions", + HDsnprintf(str, sizeof(str), "Testing %s special %s -> %s conversions", name, src_type_name, dst_type_name); else if(run_test==TEST_NORMAL) - sprintf(str, "Testing %s normalized %s -> %s conversions", + HDsnprintf(str, sizeof(str), "Testing %s normalized %s -> %s conversions", name, src_type_name, dst_type_name); else if(run_test==TEST_DENORM) - sprintf(str, "Testing %s denormalized %s -> %s conversions", + HDsnprintf(str, sizeof(str), "Testing %s denormalized %s -> %s conversions", name, src_type_name, dst_type_name); printf("%-70s", str); @@ -3097,10 +3100,10 @@ test_conv_flt_1 (const char *name, int run_test, hid_t src, hid_t dst) /* Check the software results against the hardware */ for (j=0; j %s conversions", + HDsnprintf(str, sizeof(str), "Testing %s %s -> %s conversions", name, src_type_name, dst_type_name); printf("%-70s", str); H5_FAILED(); @@ -3661,15 +3665,15 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst) } if ((INT_SCHAR==src_type || INT_UCHAR==src_type || INT_SHORT==src_type || - INT_USHORT==src_type || INT_INT==src_type || INT_UINT==src_type || - INT_LONG==src_type || INT_ULONG==src_type || INT_LLONG==src_type || - INT_ULLONG==src_type) && - (FLT_FLOAT!=dst_type && FLT_DOUBLE!=dst_type + INT_USHORT==src_type || INT_INT==src_type || INT_UINT==src_type || + INT_LONG==src_type || INT_ULONG==src_type || INT_LLONG==src_type || + INT_ULLONG==src_type) && + (FLT_FLOAT!=dst_type && FLT_DOUBLE!=dst_type #if H5_SIZEOF_LONG_DOUBLE !=0 - && FLT_LDOUBLE!=dst_type + && FLT_LDOUBLE!=dst_type #endif - )) { - sprintf(str, "Testing %s %s -> %s conversions", + )) { + HDsnprintf(str, sizeof(str), "Testing %s %s -> %s conversions", name, src_type_name, dst_type_name); printf("%-70s", str); H5_FAILED(); @@ -3679,14 +3683,14 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst) if ((FLT_FLOAT==src_type || FLT_DOUBLE==src_type #if H5_SIZEOF_LONG_DOUBLE !=0 - || FLT_LDOUBLE==src_type + || FLT_LDOUBLE==src_type #endif - ) - && (INT_SCHAR!=dst_type && INT_UCHAR!=dst_type && INT_SHORT!=dst_type - && INT_USHORT!=dst_type && INT_INT!=dst_type && INT_UINT!=dst_type - && INT_LONG!=dst_type && INT_ULONG!=dst_type && INT_LLONG!=dst_type - && INT_ULLONG!=dst_type)) { - sprintf(str, "Testing %s %s -> %s conversions", + ) + && (INT_SCHAR!=dst_type && INT_UCHAR!=dst_type && INT_SHORT!=dst_type + && INT_USHORT!=dst_type && INT_INT!=dst_type && INT_UINT!=dst_type + && INT_LONG!=dst_type && INT_ULONG!=dst_type && INT_LLONG!=dst_type + && INT_ULLONG!=dst_type)) { + HDsnprintf(str, sizeof(str), "Testing %s %s -> %s conversions", name, src_type_name, dst_type_name); printf("%-70s", str); H5_FAILED(); @@ -3695,23 +3699,23 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst) } if (INT_SCHAR==src_type || INT_UCHAR==src_type || INT_SHORT==src_type || - INT_USHORT==src_type || INT_INT==src_type || INT_UINT==src_type || - INT_LONG==src_type || INT_ULONG==src_type || INT_LLONG==src_type || - INT_ULLONG==src_type) { - sprintf(str, "Testing %s %s -> %s conversions", + INT_USHORT==src_type || INT_INT==src_type || INT_UINT==src_type || + INT_LONG==src_type || INT_ULONG==src_type || INT_LLONG==src_type || + INT_ULLONG==src_type) { + HDsnprintf(str, sizeof(str), "Testing %s %s -> %s conversions", name, src_type_name, dst_type_name); printf("%-70s", str); HDfflush(stdout); fails_this_test=0; } else { if(run_test==TEST_NORMAL) - sprintf(str, "Testing %s normalized %s -> %s conversions", + HDsnprintf(str, sizeof(str), "Testing %s normalized %s -> %s conversions", name, src_type_name, dst_type_name); else if(run_test==TEST_DENORM) - sprintf(str, "Testing %s denormalized %s -> %s conversions", + HDsnprintf(str, sizeof(str), "Testing %s denormalized %s -> %s conversions", name, src_type_name, dst_type_name); else - sprintf(str, "Testing %s special %s -> %s conversions", + HDsnprintf(str, sizeof(str), "Testing %s special %s -> %s conversions", name, src_type_name, dst_type_name); printf("%-70s", str); HDfflush(stdout); @@ -5125,13 +5129,13 @@ run_int_fp_conv(const char *name) { char str[256]; /*hello string */ - sprintf(str, "Testing %s %s -> %s conversions", + HDsnprintf(str, sizeof(str), "Testing %s %s -> %s conversions", name, "unsigned long long", "float"); printf("%-70s", str); SKIPPED(); HDputs(" Test skipped due to compiler not handling conversion."); - sprintf(str, "Testing %s %s -> %s conversions", + HDsnprintf(str, sizeof(str), "Testing %s %s -> %s conversions", name, "unsigned long long", "double"); printf("%-70s", str); SKIPPED(); @@ -5153,19 +5157,19 @@ run_int_fp_conv(const char *name) nerrors += test_conv_int_fp(name, TEST_NORMAL, H5T_NATIVE_LONG, H5T_NATIVE_LDOUBLE); nerrors += test_conv_int_fp(name, TEST_NORMAL, H5T_NATIVE_ULONG, H5T_NATIVE_LDOUBLE); #else - { - char str[256]; /*string */ + { + char str[256]; /*string */ - sprintf(str, "Testing %s %s -> %s conversions", - name, "(unsigned) long", "long double"); - printf("%-70s", str); - SKIPPED(); + HDsnprintf(str, sizeof(str), "Testing %s %s -> %s conversions", + name, "(unsigned) long", "long double"); + printf("%-70s", str); + SKIPPED(); #if H5_SIZEOF_LONG_DOUBLE!=0 - HDputs(" Test skipped due to the special algorithm of hardware conversion."); + HDputs(" Test skipped due to the special algorithm of hardware conversion."); #else - HDputs(" Test skipped due to disabled long double."); + HDputs(" Test skipped due to disabled long double."); #endif - } + } #endif #endif /* H5_SIZEOF_LONG!=H5_SIZEOF_INT */ #if H5_SIZEOF_LONG_LONG!=H5_SIZEOF_LONG @@ -5175,7 +5179,7 @@ run_int_fp_conv(const char *name) { char str[256]; /*hello string */ - sprintf(str, "Testing %s %s -> %s conversions", + HDsnprintf(str, sizeof(str), "Testing %s %s -> %s conversions", name, "long long", "long double"); printf("%-70s", str); SKIPPED(); @@ -5188,7 +5192,7 @@ run_int_fp_conv(const char *name) { char str[256]; /*hello string */ - sprintf(str, "Testing %s %s -> %s conversions", + HDsnprintf(str, sizeof(str), "Testing %s %s -> %s conversions", name, "unsigned long long", "long double"); printf("%-70s", str); SKIPPED(); @@ -5201,7 +5205,7 @@ run_int_fp_conv(const char *name) { char str[256]; /*string */ - sprintf(str, "Testing %s %s -> %s conversions", + HDsnprintf(str, sizeof(str), "Testing %s %s -> %s conversions", name, "all integers", "long double"); printf("%-70s", str); SKIPPED(); @@ -5290,13 +5294,13 @@ run_fp_int_conv(const char *name) { char str[256]; /*hello string */ - sprintf(str, "Testing %s %s -> %s conversions", + HDsnprintf(str, sizeof(str), "Testing %s %s -> %s conversions", name, "float", "unsigned long long"); printf("%-70s", str); SKIPPED(); HDputs(" Test skipped due to hardware conversion error."); - sprintf(str, "Testing %s %s -> %s conversions", + HDsnprintf(str, sizeof(str), "Testing %s %s -> %s conversions", name, "double", "unsigned long long"); printf("%-70s", str); SKIPPED(); @@ -5318,7 +5322,7 @@ run_fp_int_conv(const char *name) { char str[256]; /*string */ - sprintf(str, "Testing %s %s -> %s conversions", + HDsnprintf(str, sizeof(str), "Testing %s %s -> %s conversions", name, "long double", "unsigned int"); printf("%-70s", str); SKIPPED(); @@ -5337,7 +5341,7 @@ run_fp_int_conv(const char *name) { char str[256]; /*string */ - sprintf(str, "Testing %s %s -> %s conversions", + HDsnprintf(str, sizeof(str), "Testing %s %s -> %s conversions", name, "long double", "(unsigned) long"); printf("%-70s", str); SKIPPED(); @@ -5357,7 +5361,7 @@ run_fp_int_conv(const char *name) { char str[256]; /*string */ - sprintf(str, "Testing %s %s -> %s conversions", + HDsnprintf(str, sizeof(str), "Testing %s %s -> %s conversions", name, "long double", "long long"); printf("%-70s", str); SKIPPED(); @@ -5374,7 +5378,7 @@ run_fp_int_conv(const char *name) { char str[256]; /*string */ - sprintf(str, "Testing %s %s -> %s conversions", + HDsnprintf(str, sizeof(str), "Testing %s %s -> %s conversions", name, "long double", "unsigned long long"); printf("%-70s", str); SKIPPED(); @@ -5391,7 +5395,7 @@ run_fp_int_conv(const char *name) { char str[256]; /*hello string */ - sprintf(str, "Testing %s %s -> %s conversions", + HDsnprintf(str, sizeof(str), "Testing %s %s -> %s conversions", name, "long double", "all integers"); printf("%-70s", str); SKIPPED(); @@ -5412,7 +5416,7 @@ run_fp_int_conv(const char *name) */ char str[256]; /*string */ - sprintf(str, "Testing %s %s -> %s conversions", + HDsnprintf(str, sizeof(str), "Testing %s %s -> %s conversions", name, "all floating-point numbers", "all integers"); printf("%-70s", str); SKIPPED(); diff --git a/test/h5test.c b/test/h5test.c index a5f81ef..3b7bfbe 100644 --- a/test/h5test.c +++ b/test/h5test.c @@ -131,63 +131,61 @@ h5_errors(hid_t estack, void UNUSED *client_data) * Programmer: Albert Cheng * May 28, 1998 * - * Modifications: - * Albert Cheng, 2000-09-09 - * Added the explicite base_name argument to replace the - * global variable FILENAME. - * *------------------------------------------------------------------------- */ int h5_cleanup(const char *base_name[], hid_t fapl) { - char filename[1024]; - char temp[2048]; - int i, j; - int retval=0; - hid_t driver; + int retval = 0; + + if(GetTestCleanup()) { + int i; - if (GetTestCleanup()){ - for (i = 0; base_name[i]; i++) { - if (h5_fixname(base_name[i], fapl, filename, sizeof(filename)) == NULL) - continue; + for(i = 0; base_name[i]; i++) { + char filename[1024]; + char temp[2048]; + hid_t driver; + + if(NULL == h5_fixname(base_name[i], fapl, filename, sizeof(filename))) + continue; driver = H5Pget_driver(fapl); - if (driver == H5FD_FAMILY) { - for (j = 0; /*void*/; j++) { - HDsnprintf(temp, sizeof temp, filename, j); + if(driver == H5FD_FAMILY) { + int j; + + for(j = 0; /*void*/; j++) { + HDsnprintf(temp, sizeof temp, filename, j); - if (HDaccess(temp, F_OK) < 0) + if(HDaccess(temp, F_OK) < 0) break; - HDremove(temp); - } - } else if (driver == H5FD_CORE) { + HDremove(temp); + } /* end for */ + } else if(driver == H5FD_CORE) { hbool_t backing; /* Whether the core file has backing store */ - H5Pget_fapl_core(fapl,NULL,&backing); + H5Pget_fapl_core(fapl, NULL, &backing); /* If the file was stored to disk with bacing store, remove it */ if(backing) HDremove(filename); + } else if (driver == H5FD_MULTI) { + H5FD_mem_t mt; - } else if (driver == H5FD_MULTI) { - H5FD_mem_t mt; - assert(HDstrlen(multi_letters)==H5FD_MEM_NTYPES); + HDassert(HDstrlen(multi_letters)==H5FD_MEM_NTYPES); - for (mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; H5_INC_ENUM(H5FD_mem_t,mt)) { - HDsnprintf(temp, sizeof temp, "%s-%c.h5", - filename, multi_letters[mt]); - HDremove(temp); /*don't care if it fails*/ - } - } else { - HDremove(filename); - } - } + for(mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; H5_INC_ENUM(H5FD_mem_t,mt)) { + HDsnprintf(temp, sizeof temp, "%s-%c.h5", filename, multi_letters[mt]); + HDremove(temp); /*don't care if it fails*/ + } /* end for */ + } else { + HDremove(filename); + } + } /* end for */ - retval = 1; - } + retval = 1; + } /* end if */ H5Pclose(fapl); return retval; @@ -204,8 +202,6 @@ h5_cleanup(const char *base_name[], hid_t fapl) * Programmer: Robb Matzke * Friday, November 20, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ void @@ -267,16 +263,6 @@ h5_reset(void) * Programmer: Robb Matzke * Thursday, November 19, 1998 * - * Modifications: - * Robb Matzke, 1999-08-03 - * Modified to use the virtual file layer. - * - * Albert Cheng, 2000-01-25 - * Added prefix for parallel test files. - * - * Albert Cheng, 2003-05-08 - * Changed the default parallel prefix back to NULL but added - * an explanation remark of $HDF5_PARAPREFIX. *------------------------------------------------------------------------- */ char * @@ -292,37 +278,36 @@ h5_fixname(const char *base_name, hid_t fapl, char *fullname, size_t size) if (!base_name || !fullname || size < 1) return NULL; - memset(fullname, 0, size); + HDmemset(fullname, 0, size); /* figure out the suffix */ - if (H5P_DEFAULT != fapl) { - if ((driver = H5Pget_driver(fapl)) < 0) + if(H5P_DEFAULT != fapl) { + if((driver = H5Pget_driver(fapl)) < 0) return NULL; - if (H5FD_FAMILY == driver) - suffix = "%05d.h5"; - else if (H5FD_MULTI == driver) - suffix = NULL; + if(H5FD_FAMILY == driver) + suffix = "%05d.h5"; + else if (H5FD_MULTI == driver) + suffix = NULL; } /* Must first check fapl is not H5P_DEFAULT (-1) because H5FD_XXX * could be of value -1 if it is not defined. */ - isppdriver = H5P_DEFAULT != fapl && - (H5FD_MPIO==driver || H5FD_MPIPOSIX==driver); + isppdriver = H5P_DEFAULT != fapl && (H5FD_MPIO==driver || H5FD_MPIPOSIX==driver); /* Check HDF5_NOCLEANUP environment setting. * (The #ifdef is needed to prevent compile failure in case MPI is not * configured.) */ - if (isppdriver){ + if(isppdriver) { #ifdef H5_HAVE_PARALLEL - if (getenv_all(MPI_COMM_WORLD, 0, "HDF5_NOCLEANUP")) - SetTestNoCleanup(); + if(getenv_all(MPI_COMM_WORLD, 0, "HDF5_NOCLEANUP")) + SetTestNoCleanup(); #endif /* H5_HAVE_PARALLEL */ - }else{ - if (HDgetenv("HDF5_NOCLEANUP")) - SetTestNoCleanup(); + } else { + if(HDgetenv("HDF5_NOCLEANUP")) + SetTestNoCleanup(); } /* Check what prefix to use for test files. Process HDF5_PARAPREFIX and @@ -331,7 +316,7 @@ h5_fixname(const char *base_name, hid_t fapl, char *fullname, size_t size) * (The #ifdef is needed to prevent compile failure in case MPI is not * configured.) */ - if (isppdriver){ + if(isppdriver) { #ifdef H5_HAVE_PARALLEL /* * For parallel: @@ -340,38 +325,38 @@ h5_fixname(const char *base_name, hid_t fapl, char *fullname, size_t size) */ static int explained = 0; - prefix = (paraprefix ? paraprefix : getenv_all(MPI_COMM_WORLD, 0, "HDF5_PARAPREFIX")); + prefix = (paraprefix ? paraprefix : getenv_all(MPI_COMM_WORLD, 0, "HDF5_PARAPREFIX")); - if (!prefix && !explained) { - /* print hint by process 0 once. */ - int mpi_rank; + if (!prefix && !explained) { + /* print hint by process 0 once. */ + int mpi_rank; - MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank); + MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank); - if (mpi_rank == 0) - printf("*** Hint ***\n" - "You can use environment variable HDF5_PARAPREFIX to " - "run parallel test files in a\n" - "different directory or to add file type prefix. E.g.,\n" - " HDF5_PARAPREFIX=pfs:/PFS/user/me\n" - " export HDF5_PARAPREFIX\n" - "*** End of Hint ***\n"); + if (mpi_rank == 0) + printf("*** Hint ***\n" + "You can use environment variable HDF5_PARAPREFIX to " + "run parallel test files in a\n" + "different directory or to add file type prefix. E.g.,\n" + " HDF5_PARAPREFIX=pfs:/PFS/user/me\n" + " export HDF5_PARAPREFIX\n" + "*** End of Hint ***\n"); - explained = TRUE; + explained = TRUE; #ifdef HDF5_PARAPREFIX prefix = HDF5_PARAPREFIX; #endif /* HDF5_PARAPREFIX */ - } + } #endif /* H5_HAVE_PARALLEL */ } else { - /* + /* * For serial: * First use the environment variable, then try the constant - */ - prefix = HDgetenv("HDF5_PREFIX"); + */ + prefix = HDgetenv("HDF5_PREFIX"); #ifdef HDF5_PREFIX - if (!prefix) + if (!prefix) prefix = HDF5_PREFIX; #endif /* HDF5_PREFIX */ } diff --git a/tools/h5import/h5import.c b/tools/h5import/h5import.c index a10ef24..74c67b9 100644 --- a/tools/h5import/h5import.c +++ b/tools/h5import/h5import.c @@ -863,11 +863,11 @@ static int processStrData(FILE *strm, struct Input *in, hid_t file_id) hid_t handle; hsize_t dims[1]; char str[1024]; - char c; + int c; int i = 0; int j; - int nlines = 0; - int line; + hsize_t nlines = 0; + hsize_t line; /*------------------------------------------------------------------------- * get number of lines in the input file @@ -877,9 +877,8 @@ static int processStrData(FILE *strm, struct Input *in, hid_t file_id) while (!HDfeof(strm)) { c = HDfgetc(strm); - if (c == 10) { /* eol */ + if (c == 10) /* eol */ nlines++; - } } if (!nlines) @@ -944,7 +943,7 @@ static int processStrData(FILE *strm, struct Input *in, hid_t file_id) while (!HDfeof(strm)) { c = HDfgetc(strm); - str[i] = c; + str[i] = (char)c; i++; @@ -1012,7 +1011,7 @@ static int processStrHDFData(FILE *strm, struct Input *in, hid_t file_id) char *str3 = NULL; char str[1024] = ""; int j; - int line; + hsize_t line; /*------------------------------------------------------------------------- * read file and generate an HDF5 dataset @@ -1079,7 +1078,7 @@ static int processStrHDFData(FILE *strm, struct Input *in, hid_t file_id) str2 = NULL; str3 = NULL; #ifdef H5DEBUGIMPORT - printf("processStrHDFData DATATYPE STRING[%d]={%s}\n", line, str1); + printf("processStrHDFData DATATYPE STRING[%llu]={%s}\n", (unsigned long long)line, str1); #endif /* process string to remove the first and last quote char */ str2 = strchr(str1, '"'); @@ -1108,7 +1107,7 @@ static int processStrHDFData(FILE *strm, struct Input *in, hid_t file_id) hsize_t count[1] = { 1 }; #ifdef H5DEBUGIMPORT - printf("processStrHDFData DATATYPE STRING[%d] store %s\n", line, str2); + printf("processStrHDFData DATATYPE STRING[%llu] store %s\n", (unsigned long long)line, str2); #endif if ((fspace_id = H5Dget_space(dset_id)) < 0) goto out; diff --git a/tools/lib/h5diff.c b/tools/lib/h5diff.c index ab21bfd..884a85d 100644 --- a/tools/lib/h5diff.c +++ b/tools/lib/h5diff.c @@ -1096,7 +1096,6 @@ hsize_t diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1, char * grp2_path = ""; char * obj1_fullpath = NULL; char * obj2_fullpath = NULL; - h5trav_type_t objtype; diff_args_t argdata; size_t idx1 = 0; size_t idx2 = 0; @@ -1163,7 +1162,6 @@ hsize_t diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1, { if( table->objs[i].flags[0] && table->objs[i].flags[1]) { - objtype = table->objs[i].type; /* make full path for obj1 */ obj1_fullpath = (char*)HDcalloc (HDstrlen(grp1_path) + strlen (table->objs[i].name) + 1, sizeof (char)); HDstrcpy(obj1_fullpath, grp1_path); diff --git a/tools/lib/h5trav.c b/tools/lib/h5trav.c index fca3096..d0a4a76 100644 --- a/tools/lib/h5trav.c +++ b/tools/lib/h5trav.c @@ -21,13 +21,15 @@ * local typedefs *------------------------------------------------------------------------- */ +typedef struct trav_addr_path_t { + haddr_t addr; + char *path; +} trav_addr_path_t; + typedef struct trav_addr_t { size_t nalloc; size_t nused; - struct { - haddr_t addr; - char *path; - } *objs; + trav_addr_path_t *objs; } trav_addr_t; typedef struct { @@ -132,7 +134,7 @@ trav_addr_add(trav_addr_t *visited, haddr_t addr, const char *path) /* Allocate space if necessary */ if(visited->nused == visited->nalloc) { visited->nalloc = MAX(1, visited->nalloc * 2);; - visited->objs = HDrealloc(visited->objs, visited->nalloc * sizeof(visited->objs[0])); + visited->objs = (trav_addr_path_t *)HDrealloc(visited->objs, visited->nalloc * sizeof(trav_addr_path_t)); } /* end if */ /* Append it */ @@ -194,14 +196,15 @@ traverse_cb(hid_t loc_id, const char *path, const H5L_info_t *linfo, /* Create the full path name for the link */ if(udata->is_absolute) { size_t base_len = HDstrlen(udata->base_grp_name); - size_t add_slash = base_len ? ((udata->base_grp_name)[base_len-1] != '/') : 1; + size_t add_slash = base_len ? ((udata->base_grp_name)[base_len - 1] != '/') : 1; + size_t new_name_len = base_len + add_slash + HDstrlen(path) + 1; - if(NULL == (new_name = (char*)HDmalloc(base_len + add_slash + HDstrlen(path) + 1))) + if(NULL == (new_name = (char*)HDmalloc(new_name_len))) return(H5_ITER_ERROR); - HDstrcpy(new_name, udata->base_grp_name); - if (add_slash) - new_name[base_len] = '/'; - HDstrcpy(new_name + base_len + add_slash, path); + if(add_slash) + HDsnprintf(new_name, new_name_len, "%s/%s", udata->base_grp_name, path); + else + HDsnprintf(new_name, new_name_len, "%s%s", udata->base_grp_name, path); full_name = new_name; } /* end if */ else @@ -216,7 +219,7 @@ traverse_cb(hid_t loc_id, const char *path, const H5L_info_t *linfo, if(new_name) HDfree(new_name); return(H5_ITER_ERROR); - } + } /* end if */ /* If the object has multiple links, add it to the list of addresses * already visited, if it isn't there already @@ -231,7 +234,7 @@ traverse_cb(hid_t loc_id, const char *path, const H5L_info_t *linfo, if(new_name) HDfree(new_name); return(H5_ITER_ERROR); - } + } /* end if */ } /* end if */ else { /* Make 'visit link' callback */ @@ -240,7 +243,7 @@ traverse_cb(hid_t loc_id, const char *path, const H5L_info_t *linfo, if(new_name) HDfree(new_name); return(H5_ITER_ERROR); - } + } /* end if */ } /* end else */ if(new_name) @@ -730,7 +733,7 @@ trav_table_add(trav_table_t *table, if(table->nobjs == table->size) { table->size = MAX(1, table->size * 2); - table->objs = (trav_obj_t*)HDrealloc(table->objs, table->size * sizeof(trav_obj_t)); + table->objs = (trav_obj_t *)HDrealloc(table->objs, table->size * sizeof(trav_obj_t)); } /* end if */ new_obj = table->nobjs++; @@ -774,7 +777,7 @@ trav_table_addlink(trav_table_t *table, haddr_t objno, const char *path) /* allocate space if necessary */ if(table->objs[i].nlinks == (unsigned)table->objs[i].sizelinks) { table->objs[i].sizelinks = MAX(1, table->objs[i].sizelinks * 2); - table->objs[i].links = (trav_link_t*)HDrealloc(table->objs[i].links, table->objs[i].sizelinks * sizeof(trav_link_t)); + table->objs[i].links = (trav_link_t *)HDrealloc(table->objs[i].links, table->objs[i].sizelinks * sizeof(trav_link_t)); } /* end if */ /* insert it */ @@ -1168,31 +1171,21 @@ h5trav_visit(hid_t fid, const char *grp_name, hbool_t visit_start, * * Date: September 5, 2008 * - * Modified: - * Jonathan Kim - * - Moved from h5ls.c to share among tools. (Sep 16, 2010) - * - Renamed from elink_trav_add to symlink_visit_add for both soft and - * external links. (May 25, 2010) - * - Add type parameter to distingush between soft and external link for - * sure, which prevent from mixing up visited link when the target names - * are same between the soft and external link, as code marks with the - * target name. (May 25,2010) - * *------------------------------------------------------------------------- */ herr_t symlink_visit_add(symlink_trav_t *visited, H5L_type_t type, const char *file, const char *path) { size_t idx; /* Index of address to use */ - void *tmp_ptr; /* Allocate space if necessary */ - if(visited->nused == visited->nalloc) - { + if(visited->nused == visited->nalloc) { + void *tmp_ptr; + visited->nalloc = MAX(1, visited->nalloc * 2); - if(NULL == (tmp_ptr = HDrealloc(visited->objs, visited->nalloc * sizeof(visited->objs[0])))) + if(NULL == (tmp_ptr = HDrealloc(visited->objs, visited->nalloc * sizeof(symlink_trav_path_t)))) return -1; - visited->objs = tmp_ptr; + visited->objs = (symlink_trav_path_t *)tmp_ptr; } /* end if */ /* Append it */ @@ -1202,22 +1195,19 @@ symlink_visit_add(symlink_trav_t *visited, H5L_type_t type, const char *file, co visited->objs[idx].file = NULL; visited->objs[idx].path = NULL; - if (type == H5L_TYPE_EXTERNAL) - { - if(NULL == (visited->objs[idx].file = HDstrdup(file))) - { + if(type == H5L_TYPE_EXTERNAL) { + if(NULL == (visited->objs[idx].file = HDstrdup(file))) { visited->nused--; return -1; - } - } + } /* end if */ + } /* end if */ - if(NULL == (visited->objs[idx].path = HDstrdup(path))) - { + if(NULL == (visited->objs[idx].path = HDstrdup(path))) { visited->nused--; - if (visited->objs[idx].file) + if(visited->objs[idx].file) HDfree (visited->objs[idx].file); return -1; - } + } /* end if */ return 0; } /* end symlink_visit_add() */ @@ -1235,16 +1225,6 @@ symlink_visit_add(symlink_trav_t *visited, H5L_type_t type, const char *file, co * * Date: September 5, 2008 * - * Modified: - * Jonathan Kim - * - Moved from h5ls.c to share among tools. (Sep 16, 2010) - * - Renamed from elink_trav_visited to symlink_is_visited for both soft and - * external links. (May 25, 2010) - * - Add type parameter to distingush between soft and external link for - * sure, which prevent from mixing up visited link when the target names - * are same between the soft and external link, as code marks with the - * target name. (May 25,2010) - * *------------------------------------------------------------------------- */ hbool_t @@ -1253,21 +1233,19 @@ symlink_is_visited(symlink_trav_t *visited, H5L_type_t type, const char *file, c size_t u; /* Local index variable */ /* Look for symlink */ - for(u = 0; u < visited->nused; u++) - { + for(u = 0; u < visited->nused; u++) { /* Check for symlink values already in array */ /* check type and path pair to distingush between symbolic links */ - if ((visited->objs[u].type == type) && !HDstrcmp(visited->objs[u].path, path)) - { + if((visited->objs[u].type == type) && !HDstrcmp(visited->objs[u].path, path)) { /* if external link, file need to be matched as well */ - if (visited->objs[u].type == H5L_TYPE_EXTERNAL) - { - if (!HDstrcmp(visited->objs[u].file, file)) - return (TRUE); - } + if(visited->objs[u].type == H5L_TYPE_EXTERNAL) + if(!HDstrcmp(visited->objs[u].file, file)) + return(TRUE); + return (TRUE); - } - } + } /* end if */ + } /* end for */ + /* Didn't find symlink */ return(FALSE); } /* end symlink_is_visited() */ diff --git a/tools/lib/h5trav.h b/tools/lib/h5trav.h index 3548c6b..352a9e5 100644 --- a/tools/lib/h5trav.h +++ b/tools/lib/h5trav.h @@ -51,14 +51,16 @@ typedef enum { /* Struct to keep track of symbolic link targets visited. * Functions: symlink_visit_add() and symlink_is_visited() */ +typedef struct symlink_trav_path_t { + H5L_type_t type; + char *file; + char *path; +} symlink_trav_path_t; + typedef struct symlink_trav_t { size_t nalloc; size_t nused; - struct { - H5L_type_t type; - char *file; - char *path; - } *objs; + symlink_trav_path_t *objs; hbool_t dangle_link; } symlink_trav_t; -- cgit v0.12 From 185b3c5deed81d562a9bd1ec18a0eed339607522 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 17 Mar 2014 17:12:46 -0500 Subject: [svn-r24816] HDFFV-8695: Add notes about defining -DCMAKE_BUILD_TYPE:STRING=Release --- release_docs/INSTALL_CMake.txt | 32 ++++++++++++++++++++------------ release_docs/RELEASE.txt | 26 +++++++++++++++----------- release_docs/USING_HDF5_CMake.txt | 6 +++--- 3 files changed, 38 insertions(+), 26 deletions(-) diff --git a/release_docs/INSTALL_CMake.txt b/release_docs/INSTALL_CMake.txt index dc359f6..ce2d98e 100644 --- a/release_docs/INSTALL_CMake.txt +++ b/release_docs/INSTALL_CMake.txt @@ -89,8 +89,9 @@ Notes: This short set of instructions is written for users who want to 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 .. - The two dots on the end of the command is the location of the source. + cmake -G "Visual Studio 10" -DCMAKE_BUILD_TYPE:STRING=Release -DBUILD_TESTING:BOOL=ON -DHDF5_BUILD_TOOLS:BOOL=ON .. + The two dots on the end of the command is the location of the source. + The CMAKE_BUILD_TYPE must match the configuration type. 5. Build the C library, tools and tests with this command: cmake --build . --config Release @@ -118,8 +119,9 @@ Notes: This short set of instructions is written for users who want to ~/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 .. + cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE:STRING=Release -DBUILD_TESTING:BOOL=ON -DHDF5_BUILD_TOOLS:BOOL=ON .. The two dots on the end of the command is the location of the source. + The CMAKE_BUILD_TYPE must match the configuration type. 5. Build the C library, tools and tests with this command: cmake --build . --config Release @@ -141,7 +143,7 @@ III. 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. + web site. The HDF5 1.8.x product requires a minimum CMake version 2.8.12. 2. If you plan to use Zlib or Szip: A. Download the binary packages and install them in a central location. @@ -152,7 +154,8 @@ III. Preconditions 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. + where "some_location" is the URL to the SVN repository. Also set + CMAKE_BUILD_TYPE to the configuration type. C. Use source packages from a compressed file by adding the following CMake options: HDF5_ALLOW_EXTERNAL_SUPPORT:STRING="TGZ" @@ -160,7 +163,8 @@ III. Preconditions SZIP_TGZ_NAME:STRING="szip_src.ext" TGZPATH:STRING="some_location" where "some_location" is the URL or full path to the compressed - file and ext is the type of compression file. + file and ext is the type of compression file. Also set CMAKE_BUILD_TYPE + to the configuration type during configuration 3. If you are building on Apple Darwin platforms, you should add the following options: @@ -181,7 +185,8 @@ III. Preconditions on the command line are those options that are different. Example using HDF default cache file: cmake -C ../config/cmake/cacheinit.cmake -G "Visual Studio 10" \ - -DHDF5_ENABLE_SZIP_SUPPORT:BOOL=OFF -DHDF5_ENABLE_Z_LIB_SUPPORT:BOOL=OFF .. + -DHDF5_ENABLE_SZIP_SUPPORT:BOOL=OFF -DHDF5_ENABLE_Z_LIB_SUPPORT:BOOL=OFF \ + -DCMAKE_BUILD_TYPE:STRING=Release .. Notes: CMake and HDF5 @@ -346,7 +351,8 @@ These five steps are described in detail below. 2.2 Preferred command line example on Windows in c:\MyHDFstuff\hdf5\build directory: cmake -C ../config/cmake/cacheinit.cmake -G "Visual Studio 10" \ - -DHDF5_ENABLE_SZIP_SUPPORT:BOOL=OFF -DHDF5_ENABLE_Z_LIB_SUPPORT:BOOL=OFF .. + -DHDF5_ENABLE_SZIP_SUPPORT:BOOL=OFF -DHDF5_ENABLE_Z_LIB_SUPPORT:BOOL=OFF \ + -DCMAKE_BUILD_TYPE:STRING=Release .. 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: @@ -381,7 +387,8 @@ These five steps are described in detail below. 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. + These should be changed to your location. Also define CMAKE_BUILD_TYPE + to be the configuration type. 3.2.2 Or the external libraries (zlib and szip) can be configured to allow building the libraries by using a compressed file. @@ -396,7 +403,8 @@ These five steps are described in detail below. TGZPATH: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. + file such as .bz2, .tar, .tar.gz, .tgz, or .zip. Also define + CMAKE_BUILD_TYPE to be the configuration type. 4. Test HDF5 @@ -563,7 +571,7 @@ is used to build, test, and package HDF5 Library files. -cmake_minimum_required(VERSION 2.8.10 FATAL_ERROR) +cmake_minimum_required(VERSION 2.8.12 FATAL_ERROR) ######################################################## # This dashboard is maintained by The HDF Group # For any comments please contact cdashhelp@hdfgroup.org @@ -859,7 +867,7 @@ and the build folder is created as a sub-folder. # "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) +cmake_minimum_required(VERSION 2.8.12 FATAL_ERROR) set(CTEST_SOURCE_NAME ${CTEST_SCRIPT_ARG}) set(CTEST_BINARY_NAME ${CTEST_SOURCE_NAME}/build) set(CTEST_DASHBOARD_ROOT "${CTEST_SCRIPT_DIRECTORY}") diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 48ff4e0..4c5e35b 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -678,6 +678,11 @@ Bug Fixes since HDF5-1.8.0 release Configuration ------------- + - When CMake commands are executed individually on the command line and the + external filters are being built, the CMAKE_BUILD_TYPE define must be set + to the same value as the configuration + (-DCMAKE_BUILD_TYPE:STRING=Release if using -C Release). This is needed + by the the szip and zlib filter build commands. (ADB - HDFFV-8695) - Modified H5detect.c to scan floating point types for padding bits before analyzing the type further. This should fix problems with gcc 4.8 (NAF - 2013/09/19 - HDFFV-8523/HDFFV-8500) @@ -1172,20 +1177,19 @@ Supported Platforms (emu) Sun Fortran 95 8.6 SunOS_sparc Sun C++ 5.12 SunOS_sparc - Windows 7 Visual Studio 2008 w/ Intel Fortran 11 (cmake) - Visual Studio 2010 w/ Intel Fortran 12 (cmake) - Visual Studio 2012 w/ Intel Fortran 13 (cmake) - Cygwin(CYGWIN_NT-6.1 1.7.25(0.270/5/3) gcc(4.7.3) compiler and gfortran) + Windows 7 Visual Studio 2008 w/ Intel Fortran 14 (cmake) + Visual Studio 2010 w/ Intel Fortran 14 (cmake) + Visual Studio 2012 w/ Intel Fortran 14 (cmake) + Cygwin(CYGWIN_NT-6.1 1.7.25(0.270/5/3) gcc(4.8.2) compiler and gfortran) (cmake and autotools) - Windows 7 x64 Visual Studio 2008 w/ Intel Fortran 11 (cmake) - Visual Studio 2010 w/ Intel Fortran 12 (cmake) - Visual Studio 2012 w/ Intel Fortran 13 (cmake) - Cygwin(CYGWIN_NT-6.1 1.7.25(0.270/5/3) gcc(4.8.1) compiler and gfortran) - (cmake and autotools) - Windows 8.1 Visual Studio 2012 w/ Intel Fortran 13 (cmake) + Windows 7 x64 Visual Studio 2008 w/ Intel Fortran 14 (cmake) + Visual Studio 2010 w/ Intel Fortran 14 (cmake) + Visual Studio 2012 w/ Intel Fortran 14 (cmake) + + Windows 8.1 Visual Studio 2012 w/ Intel Fortran 14 (cmake) - Windows 8.1 x64 Visual Studio 2012 w/ Intel Fortran 13 (cmake) + Windows 8.1 x64 Visual Studio 2012 w/ Intel Fortran 14 (cmake) 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 diff --git a/release_docs/USING_HDF5_CMake.txt b/release_docs/USING_HDF5_CMake.txt index 84a44c1..a0aca41 100644 --- a/release_docs/USING_HDF5_CMake.txt +++ b/release_docs/USING_HDF5_CMake.txt @@ -37,7 +37,7 @@ 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. + of 2.8.12. 2. You have installed the HDF5 library built with CMake, by executing the HDF Install Utility (the *.exe file in the binary package for @@ -186,7 +186,7 @@ III. Minimum C Project Files for CMake following text in the file: ########################################################## -cmake_minimum_required (VERSION 2.8.11) +cmake_minimum_required (VERSION 2.8.12) PROJECT (HDF5MyApp C CXX) FIND_PACKAGE (HDF5 NAMES hdf5) @@ -239,7 +239,7 @@ ctest # where hdf518Examples is the source folder relative to the location of these scripts ############################################################################ -cmake_minimum_required(VERSION 2.8.10 FATAL_ERROR) +cmake_minimum_required(VERSION 2.8.12 FATAL_ERROR) set(CTEST_DASHBOARD_ROOT ${CTEST_SCRIPT_DIRECTORY}) set(CTEST_SOURCE_NAME ${CTEST_SCRIPT_ARG}) -- cgit v0.12 From 73a72c59b8cd243de54993f1fb0991afede4ba4d Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 18 Mar 2014 10:03:21 -0500 Subject: [svn-r24822] Update GYGWIN version --- release_docs/RELEASE.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 4c5e35b..2705e7c 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -1180,7 +1180,7 @@ Supported Platforms Windows 7 Visual Studio 2008 w/ Intel Fortran 14 (cmake) Visual Studio 2010 w/ Intel Fortran 14 (cmake) Visual Studio 2012 w/ Intel Fortran 14 (cmake) - Cygwin(CYGWIN_NT-6.1 1.7.25(0.270/5/3) gcc(4.8.2) compiler and gfortran) + Cygwin(CYGWIN_NT-6.1 1.7.28(0.271/5/3) gcc(4.8.2) compiler and gfortran) (cmake and autotools) Windows 7 x64 Visual Studio 2008 w/ Intel Fortran 14 (cmake) -- cgit v0.12 From 03d10edd23ce76e9389b54be138ef1bbb8791cef Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 18 Mar 2014 11:21:46 -0500 Subject: [svn-r24824] HDFFV-8700 - KitWare recommendations: Change CMake commands to lower case. Bump up CMake minimum versions. Split test file into separate file for h5repack test. Tested: local linux --- CMakeLists.txt | 62 ++++++++++++------------ MANIFEST | 1 + c++/CMakeLists.txt | 6 +-- config/cmake/CheckTypeSize.cmake | 4 +- config/cmake/ConfigureChecks.cmake | 22 ++++----- config/cmake/HDF5UseFortran.cmake | 10 ++-- config/cmake/grepTest.cmake | 2 +- config/cmake/prunTest.cmake | 38 +++++++-------- config/cmake/runTest.cmake | 42 ++++++++--------- config/cmake/userblockTest.cmake | 12 ++--- config/cmake/vfdTest.cmake | 4 +- examples/CMakeTests.cmake | 2 +- fortran/CMakeLists.txt | 8 ++-- hl/CMakeLists.txt | 10 ++-- hl/c++/CMakeLists.txt | 6 +-- hl/fortran/CMakeLists.txt | 6 +-- hl/tools/CMakeTests.cmake | 2 +- test/CMakeLists.txt | 6 +-- tools/CMakeLists.txt | 20 ++++---- tools/h5copy/CMakeTests.cmake | 2 +- tools/h5diff/CMakeTests.cmake | 2 +- tools/h5dump/CMakeTests.cmake | 10 ++-- tools/h5import/CMakeTests.cmake | 2 +- tools/h5jam/CMakeTests.cmake | 8 ++-- tools/h5ls/CMakeTests.cmake | 2 +- tools/h5repack/CMakeLists.txt | 6 +-- tools/h5repack/dynlib_rpk.c | 97 ++++++++++++++++++++++++++++++++++++++ tools/misc/CMakeTests.cmake | 2 +- 28 files changed, 246 insertions(+), 148 deletions(-) create mode 100644 tools/h5repack/dynlib_rpk.c diff --git a/CMakeLists.txt b/CMakeLists.txt index 80aa594..8d7cec2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -52,22 +52,22 @@ PROJECT (HDF5 C CXX) # # # Setup all necessary overrides for zlib so that HDF5 uses our # # internally compiled zlib rather than any other version -# IF(HDF5_ENABLE_Z_LIB_SUPPORT) +# if (HDF5_ENABLE_Z_LIB_SUPPORT) # # We must tell the main HDF5 library that it depends on our zlib # set (HDF5_LIB_DEPENDENCIES vtkzlib) # # Override the zlib header file -# IF(VTK_USE_SYSTEM_ZLIB) +# if (VTK_USE_SYSTEM_ZLIB) # set (H5_ZLIB_HEADER "zlib.h") -# ELSE(VTK_USE_SYSTEM_ZLIB) +# else (VTK_USE_SYSTEM_ZLIB) # set (H5_ZLIB_HEADER "vtk_zlib.h") # # Set vars that FindZlib would have set if used in sub project # set (ZLIB_INCLUDE_DIRS "${VTK_ZLIB_INCLUDE_DIRS}") # set (ZLIB_LIBRARIES vtkzlib) -# ENDIF(VTK_USE_SYSTEM_ZLIB) -# ENDIF(HDF5_ENABLE_Z_LIB_SUPPORT) +# endif (VTK_USE_SYSTEM_ZLIB) +# endif (HDF5_ENABLE_Z_LIB_SUPPORT) # # # Add the sub project -# ADD_SUBDIRECTORY(Utilities/hdf5-1.8) +# add_subdirectory (Utilities/hdf5-1.8) #----------------------------------------------------------------------------- #----------------------------------------------------------------------------- @@ -78,12 +78,12 @@ PROJECT (HDF5 C CXX) # explicitly turn off this option to build HDF5 in the Express IDE... # option (HDF5_USE_FOLDERS "Enable folder grouping of projects in IDEs." ON) -MARK_AS_ADVANCED (HDF5_USE_FOLDERS) +mark_as_advanced (HDF5_USE_FOLDERS) if (HDF5_USE_FOLDERS) set_property (GLOBAL PROPERTY USE_FOLDERS ON) endif (HDF5_USE_FOLDERS) option (HDF5_NO_PACKAGES "CPACK - Disable packaging" OFF) -MARK_AS_ADVANCED (HDF5_NO_PACKAGES) +mark_as_advanced (HDF5_NO_PACKAGES) #----------------------------------------------------------------------------- # Set the core names of all the libraries @@ -169,7 +169,7 @@ endif (NOT HDF5_INSTALL_DATA_DIR) #----------------------------------------------------------------------------- # parse the full version number from H5public.h and include in H5_VERS_INFO #----------------------------------------------------------------------------- -FILE (READ ${HDF5_SRC_DIR}/H5public.h _h5public_h_contents) +file (READ ${HDF5_SRC_DIR}/H5public.h _h5public_h_contents) string (REGEX REPLACE ".*#define[ \t]+H5_VERS_MAJOR[ \t]+([0-9]*).*$" "\\1" H5_VERS_MAJOR ${_h5public_h_contents}) string (REGEX REPLACE ".*#define[ \t]+H5_VERS_MINOR[ \t]+([0-9]*).*$" @@ -183,14 +183,14 @@ string (REGEX REPLACE ".*#define[ \t]+H5_VERS_SUBRELEASE[ \t]+\"([0-9A-Za-z._]*) #----------------------------------------------------------------------------- # parse the full soversion number from config/lt_vers.am and include in H5_SOVERS_INFO #----------------------------------------------------------------------------- -FILE (READ ${HDF5_SOURCE_DIR}/config/lt_vers.am _lt_vers_am_contents) +file (READ ${HDF5_SOURCE_DIR}/config/lt_vers.am _lt_vers_am_contents) string (REGEX REPLACE ".*LT_VERS_INTERFACE[ \t]+=[ \t]+([0-9]*).*$" "\\1" H5_SOVERS_INTERFACE ${_lt_vers_am_contents}) string (REGEX REPLACE ".*LT_VERS_REVISION[ \t]+=[ \t]+([0-9]*).*$" "\\1" H5_SOVERS_MINOR ${_lt_vers_am_contents}) string (REGEX REPLACE ".*LT_VERS_AGE[ \t]+=[ \t]+([0-9]*).*$" "\\1" H5_SOVERS_RELEASE ${_lt_vers_am_contents}) -MATH(EXPR H5_SOVERS_MAJOR ${H5_SOVERS_INTERFACE}-${H5_SOVERS_RELEASE}) +MATH (EXPR H5_SOVERS_MAJOR ${H5_SOVERS_INTERFACE}-${H5_SOVERS_RELEASE}) message (STATUS "SOVERSION: ${H5_SOVERS_MAJOR}.${H5_SOVERS_RELEASE}.${H5_SOVERS_MINOR}") #----------------------------------------------------------------------------- @@ -216,16 +216,16 @@ set (HDF5_PACKAGE_BUGREPORT "help@hdfgroup.org") # Set Install folder value #----------------------------------------------------------------------------- if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) - IF(CMAKE_HOST_UNIX) + if (CMAKE_HOST_UNIX) set (CMAKE_INSTALL_PREFIX "/HDF_Group/${HDF5_PACKAGE_NAME}/${HDF5_PACKAGE_VERSION}" CACHE PATH "Install path prefix, prepended onto install directories." FORCE) - ELSE(CMAKE_HOST_UNIX) + else (CMAKE_HOST_UNIX) GetDefaultWindowsPrefixBase(CMAKE_GENERIC_PROGRAM_FILES) set (CMAKE_INSTALL_PREFIX "${CMAKE_GENERIC_PROGRAM_FILES}/HDF_Group/${HDF5_PACKAGE_NAME}/${HDF5_PACKAGE_VERSION}" CACHE PATH "Install path prefix, prepended onto install directories." FORCE) set (CMAKE_GENERIC_PROGRAM_FILES) - ENDIF(CMAKE_HOST_UNIX) + endif (CMAKE_HOST_UNIX) endif (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) #----------------------------------------------------------------------------- @@ -327,7 +327,7 @@ endif (HDF5_ENABLE_COVERAGE) #----------------------------------------------------------------------------- # option (HDF5_ENABLE_USING_DMALLOC "Indicate that dmalloc is used" OFF) # if (HDF5_ENABLE_USING_DMALLOC) -# FIND_PACKAGE (DMALLOC) +# find_package (DMALLOC) # set (H5_HAVE_DMALLOC DMALLOC_FOUND) # endif (HDF5_ENABLE_USING_DMALLOC) @@ -396,7 +396,7 @@ if (CMAKE_BUILD_TYPE MATCHES Debug) if (HDF5_ENABLE_INSTRUMENT) set (H5_HAVE_INSTRUMENTED_LIBRARY 1) endif (HDF5_ENABLE_INSTRUMENT) - MARK_AS_ADVANCED (HDF5_Enable_Instrument) + mark_as_advanced (HDF5_Enable_Instrument) #-- NMake Makefiles will overwhelm the console with warnings if -Wall is used. if (NOT WIN32) add_definitions (-Wall) @@ -754,7 +754,7 @@ endif (WIN32 AND NOT CYGWIN) #----------------------------------------------------------------------------- # Add the HDF5 Library Target to the build #----------------------------------------------------------------------------- -ADD_SUBDIRECTORY (${HDF5_SOURCE_DIR}/src ${PROJECT_BINARY_DIR}/src) +add_subdirectory (${HDF5_SOURCE_DIR}/src ${PROJECT_BINARY_DIR}/src) if (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") if (ZLIB_FOUND AND ZLIB_USE_EXTERNAL) @@ -774,28 +774,28 @@ if (BUILD_TESTING) CACHE INTEGER "Timeout in seconds for each test (default 1200=20minutes)" ) - ENABLE_TESTING () + enable_testing () include (CTest) if (NOT HDF5_EXTERNALLY_CONFIGURED) if (EXISTS "${HDF5_SOURCE_DIR}/test" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/test") - ADD_SUBDIRECTORY (${HDF5_SOURCE_DIR}/tools/lib ${PROJECT_BINARY_DIR}/tools/lib) - ADD_SUBDIRECTORY (${HDF5_SOURCE_DIR}/test ${PROJECT_BINARY_DIR}/test) + add_subdirectory (${HDF5_SOURCE_DIR}/tools/lib ${PROJECT_BINARY_DIR}/tools/lib) + add_subdirectory (${HDF5_SOURCE_DIR}/test ${PROJECT_BINARY_DIR}/test) endif (EXISTS "${HDF5_SOURCE_DIR}/test" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/test") if (EXISTS "${HDF5_SOURCE_DIR}/perform" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/perform") - ADD_SUBDIRECTORY (${HDF5_SOURCE_DIR}/perform ${PROJECT_BINARY_DIR}/perform) - ENDIF(EXISTS "${HDF5_SOURCE_DIR}/perform" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/perform") + add_subdirectory (${HDF5_SOURCE_DIR}/perform ${PROJECT_BINARY_DIR}/perform) + endif (EXISTS "${HDF5_SOURCE_DIR}/perform" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/perform") if (H5_HAVE_PARALLEL) if (EXISTS "${HDF5_SOURCE_DIR}/testpar" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/testpar") - ADD_SUBDIRECTORY (${HDF5_SOURCE_DIR}/testpar ${PROJECT_BINARY_DIR}/testpar) + add_subdirectory (${HDF5_SOURCE_DIR}/testpar ${PROJECT_BINARY_DIR}/testpar) endif (EXISTS "${HDF5_SOURCE_DIR}/testpar" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/testpar") endif (H5_HAVE_PARALLEL) endif (NOT HDF5_EXTERNALLY_CONFIGURED) option (HDF5_TEST_VFD "Execute tests with different VFDs" OFF) - MARK_AS_ADVANCED (HDF5_TEST_VFD) + mark_as_advanced (HDF5_TEST_VFD) if (HDF5_TEST_VFD) option (HDF5_TEST_FHEAP_VFD "Execute tests with different VFDs" ON) - MARK_AS_ADVANCED (HDF5_TEST_FHEAP_VFD) + mark_as_advanced (HDF5_TEST_FHEAP_VFD) endif (HDF5_TEST_VFD) include (${HDF5_SOURCE_DIR}/CTestConfig.cmake) @@ -829,11 +829,11 @@ if (EXISTS "${HDF5_SOURCE_DIR}/fortran" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/for # # set (FCFLAGS "${Fortran_DEFINES}") - ADD_SUBDIRECTORY (${HDF5_SOURCE_DIR}/fortran ${PROJECT_BINARY_DIR}/fortran) + add_subdirectory (${HDF5_SOURCE_DIR}/fortran ${PROJECT_BINARY_DIR}/fortran) if (HDF5_BUILD_HL_LIB) if (EXISTS "${HDF5_SOURCE_DIR}/hl/fortran" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/hl/fortran") #-- Build the High Level Fortran source codes - ADD_SUBDIRECTORY (${HDF5_SOURCE_DIR}/hl/fortran ${PROJECT_BINARY_DIR}/hl/fortran) + add_subdirectory (${HDF5_SOURCE_DIR}/hl/fortran ${PROJECT_BINARY_DIR}/hl/fortran) endif (EXISTS "${HDF5_SOURCE_DIR}/hl/fortran" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/hl/fortran") endif (HDF5_BUILD_HL_LIB) endif (HDF5_BUILD_FORTRAN) @@ -845,7 +845,7 @@ endif (EXISTS "${HDF5_SOURCE_DIR}/fortran" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/ if (EXISTS "${HDF5_SOURCE_DIR}/examples" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/examples") option (HDF5_BUILD_EXAMPLES "Build HDF5 Library Examples" OFF) if (HDF5_BUILD_EXAMPLES) - ADD_SUBDIRECTORY (${HDF5_SOURCE_DIR}/examples ${PROJECT_BINARY_DIR}/examples) + add_subdirectory (${HDF5_SOURCE_DIR}/examples ${PROJECT_BINARY_DIR}/examples) endif (HDF5_BUILD_EXAMPLES) endif (EXISTS "${HDF5_SOURCE_DIR}/examples" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/examples") @@ -862,7 +862,7 @@ if (EXISTS "${HDF5_SOURCE_DIR}/c++" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/c++") if (CMAKE_NO_STD_NAMESPACE) set (H5_NO_STD 1) endif (CMAKE_NO_STD_NAMESPACE) - ADD_SUBDIRECTORY (${HDF5_SOURCE_DIR}/c++ ${PROJECT_BINARY_DIR}/c++) + add_subdirectory (${HDF5_SOURCE_DIR}/c++ ${PROJECT_BINARY_DIR}/c++) endif (HDF5_BUILD_CPP_LIB) endif (EXISTS "${HDF5_SOURCE_DIR}/c++" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/c++") @@ -872,7 +872,7 @@ endif (EXISTS "${HDF5_SOURCE_DIR}/c++" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/c++" if (EXISTS "${HDF5_SOURCE_DIR}/tools" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/tools") option (HDF5_BUILD_TOOLS "Build HDF5 Tools" OFF) if (HDF5_BUILD_TOOLS) - ADD_SUBDIRECTORY (${HDF5_SOURCE_DIR}/tools ${PROJECT_BINARY_DIR}/tools) + add_subdirectory (${HDF5_SOURCE_DIR}/tools ${PROJECT_BINARY_DIR}/tools) endif (HDF5_BUILD_TOOLS) endif (EXISTS "${HDF5_SOURCE_DIR}/tools" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/tools") @@ -883,7 +883,7 @@ if (EXISTS "${HDF5_SOURCE_DIR}/hl" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/hl") option (HDF5_BUILD_HL_LIB "Build HIGH Level HDF5 Library" OFF) if (HDF5_BUILD_HL_LIB) set (H5_INCLUDE_HL 1) - ADD_SUBDIRECTORY (${HDF5_SOURCE_DIR}/hl ${PROJECT_BINARY_DIR}/hl) + add_subdirectory (${HDF5_SOURCE_DIR}/hl ${PROJECT_BINARY_DIR}/hl) endif (HDF5_BUILD_HL_LIB) endif (EXISTS "${HDF5_SOURCE_DIR}/hl" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/hl") diff --git a/MANIFEST b/MANIFEST index 768a559..c25f5cf 100644 --- a/MANIFEST +++ b/MANIFEST @@ -1259,6 +1259,7 @@ # h5repack sources ./tools/h5repack/Makefile.am ./tools/h5repack/Makefile.in +./tools/h5repack/dynlib_rpk.c ./tools/h5repack/h5repack.sh.in ./tools/h5repack/h5repack_plugin.sh.in ./tools/h5repack/h5repack.c diff --git a/c++/CMakeLists.txt b/c++/CMakeLists.txt index c1de616..89426c5 100644 --- a/c++/CMakeLists.txt +++ b/c++/CMakeLists.txt @@ -36,18 +36,18 @@ if (H5_HAVE_PARALLEL) add_definitions ("-DMPICH_IGNORE_CXX_SEEK") endif (H5_HAVE_PARALLEL) -ADD_SUBDIRECTORY (${HDF5_CPP_SOURCE_DIR}/src ${HDF5_CPP_BINARY_DIR}/src) +add_subdirectory (${HDF5_CPP_SOURCE_DIR}/src ${HDF5_CPP_BINARY_DIR}/src) #----------------------------------------------------------------------------- # Build the CPP Examples #----------------------------------------------------------------------------- if (HDF5_BUILD_EXAMPLES) - ADD_SUBDIRECTORY (${HDF5_CPP_SOURCE_DIR}/examples ${HDF5_CPP_BINARY_DIR}/examples) + add_subdirectory (${HDF5_CPP_SOURCE_DIR}/examples ${HDF5_CPP_BINARY_DIR}/examples) endif (HDF5_BUILD_EXAMPLES) #----------------------------------------------------------------------------- # Build the CPP unit tests #----------------------------------------------------------------------------- if (BUILD_TESTING) - ADD_SUBDIRECTORY (${HDF5_CPP_SOURCE_DIR}/test ${HDF5_CPP_BINARY_DIR}/test) + add_subdirectory (${HDF5_CPP_SOURCE_DIR}/test ${HDF5_CPP_BINARY_DIR}/test) endif (BUILD_TESTING) diff --git a/config/cmake/CheckTypeSize.cmake b/config/cmake/CheckTypeSize.cmake index 0fe2cbc..4af5741 100644 --- a/config/cmake/CheckTypeSize.cmake +++ b/config/cmake/CheckTypeSize.cmake @@ -34,12 +34,12 @@ MACRO (HDF_CHECK_TYPE_SIZE TYPE VARIABLE) ) if (HAVE_${VARIABLE}) message (STATUS "Check size of ${TYPE} - done") - FILE (APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeOutput.log + file (APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeOutput.log "Determining size of ${TYPE} passed with the following output:\n${OUTPUT}\n\n" ) else (HAVE_${VARIABLE}) message (STATUS "Check size of ${TYPE} - failed") - FILE (APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log + file (APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log "Determining size of ${TYPE} failed with the following output:\n${OUTPUT}\n\n" ) endif (HAVE_${VARIABLE}) diff --git a/config/cmake/ConfigureChecks.cmake b/config/cmake/ConfigureChecks.cmake index 93c6138..03a7975 100644 --- a/config/cmake/ConfigureChecks.cmake +++ b/config/cmake/ConfigureChecks.cmake @@ -289,7 +289,7 @@ MACRO (HDF5_FUNCTION_TEST OTHER_TEST) else (${OTHER_TEST}) message (STATUS "Performing Other Test ${OTHER_TEST} - Failed") set (H5_${OTHER_TEST} "" CACHE INTERNAL "Other test ${FUNCTION}") - FILE (APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log + file (APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log "Performing Other Test ${OTHER_TEST} failed with the following output:\n" "${OUTPUT}\n" ) @@ -467,14 +467,14 @@ if (NOT WINDOWS) else (TEST_LFS_WORKS_RUN MATCHES 0) set (TEST_LFS_WORKS "" CACHE INTERNAL ${msg}) message (STATUS "${msg}... no") - FILE (APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log + file (APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log "Test TEST_LFS_WORKS Run failed with the following output and exit code:\n ${OUTPUT}\n" ) endif (TEST_LFS_WORKS_RUN MATCHES 0) else (TEST_LFS_WORKS_COMPILE ) set (TEST_LFS_WORKS "" CACHE INTERNAL ${msg}) message (STATUS "${msg}... no") - FILE (APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log + file (APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log "Test TEST_LFS_WORKS Compile failed with the following output:\n ${OUTPUT}\n" ) endif (TEST_LFS_WORKS_COMPILE) @@ -757,7 +757,7 @@ MACRO (HDF5_CXX_FUNCTION_TEST OTHER_TEST) else ("${OTHER_TEST}" EQUAL 0) message (STATUS "Performing CXX Test ${OTHER_TEST} - Failed") set (${OTHER_TEST} "" CACHE INTERNAL "CXX test ${FUNCTION}") - FILE (APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log + file (APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log "Performing CXX Test ${OTHER_TEST} failed with the following output:\n" "${OUTPUT}\n" ) @@ -802,14 +802,14 @@ if (NOT WINDOWS) else (TEST_DIRECT_VFD_WORKS_RUN MATCHES 0) set (TEST_DIRECT_VFD_WORKS "" CACHE INTERNAL ${msg}) message (STATUS "${msg}... no") - FILE (APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log + file (APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log "Test TEST_DIRECT_VFD_WORKS Run failed with the following output and exit code:\n ${OUTPUT}\n" ) endif (TEST_DIRECT_VFD_WORKS_RUN MATCHES 0) else (TEST_DIRECT_VFD_WORKS_COMPILE ) set (TEST_DIRECT_VFD_WORKS "" CACHE INTERNAL ${msg}) message (STATUS "${msg}... no") - FILE (APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log + file (APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log "Test TEST_DIRECT_VFD_WORKS Compile failed with the following output:\n ${OUTPUT}\n" ) endif (TEST_DIRECT_VFD_WORKS_COMPILE) @@ -870,7 +870,7 @@ if (WINDOWS) if ("${HAVE_IOEO_EXITCODE}" EQUAL 0) set (H5_HAVE_IOEO 1 CACHE INTERNAL "Test InitOnceExecuteOnce") message (STATUS "Performing Test InitOnceExecuteOnce - Success") - FILE (APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log + file (APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log "Performing C SOURCE FILE Test InitOnceExecuteOnce succeded with the following output:\n" "${OUTPUT}\n" "Return value: ${HAVE_IOEO}\n") @@ -882,7 +882,7 @@ if (WINDOWS) endif (CMAKE_CROSSCOMPILING AND "${HAVE_IOEO_EXITCODE}" MATCHES "FAILED_TO_RUN") message (STATUS "Performing Test InitOnceExecuteOnce - Failed") - FILE (APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log + file (APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log "Performing InitOnceExecuteOnce Test failed with the following output:\n" "${OUTPUT}\n" "Return value: ${HAVE_IOEO_EXITCODE}\n") @@ -950,7 +950,7 @@ if (NOT H5_PRINTF_LL_WIDTH OR H5_PRINTF_LL_WIDTH MATCHES "unknown") message ("Width with ${HDF5_PRINTF_LL} failed with result: ${HDF5_PRINTF_LL_TEST_RUN}") endif (HDF5_PRINTF_LL_TEST_RUN MATCHES 0) else (HDF5_PRINTF_LL_TEST_COMPILE) - FILE (APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log + file (APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log "Test H5_PRINTF_LL_WIDTH for ${HDF5_PRINTF_LL} failed with the following output:\n ${OUTPUT}\n" ) endif (HDF5_PRINTF_LL_TEST_COMPILE) @@ -1000,14 +1000,14 @@ MACRO (H5ConversionTests TEST msg) else (${TEST}_RUN MATCHES 0) set (${TEST} "" CACHE INTERNAL ${msg}) message (STATUS "${msg}... no") - FILE (APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log + file (APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log "Test ${TEST} Run failed with the following output and exit code:\n ${OUTPUT}\n" ) endif (${TEST}_RUN MATCHES 0) else (${TEST}_COMPILE ) set (${TEST} "" CACHE INTERNAL ${msg}) message (STATUS "${msg}... no") - FILE (APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log + file (APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log "Test ${TEST} Compile failed with the following output:\n ${OUTPUT}\n" ) endif (${TEST}_COMPILE) diff --git a/config/cmake/HDF5UseFortran.cmake b/config/cmake/HDF5UseFortran.cmake index 69ff5b3..e65ea21 100644 --- a/config/cmake/HDF5UseFortran.cmake +++ b/config/cmake/HDF5UseFortran.cmake @@ -15,11 +15,11 @@ FortranCInterface_HEADER ( SYMBOLS mysub mymod:my_sub ) -FILE (STRINGS ${CMAKE_BINARY_DIR}/FCMangle.h CONTENTS REGEX "H5_FC_GLOBAL\\(.*,.*\\) +(.*)") +file (STRINGS ${CMAKE_BINARY_DIR}/FCMangle.h CONTENTS REGEX "H5_FC_GLOBAL\\(.*,.*\\) +(.*)") string (REGEX MATCH "H5_FC_GLOBAL\\(.*,.*\\) +(.*)" RESULT ${CONTENTS}) set (H5_FC_FUNC "H5_FC_FUNC(name,NAME) ${CMAKE_MATCH_1}") -FILE (STRINGS ${CMAKE_BINARY_DIR}/FCMangle.h CONTENTS REGEX "H5_FC_GLOBAL_\\(.*,.*\\) +(.*)") +file (STRINGS ${CMAKE_BINARY_DIR}/FCMangle.h CONTENTS REGEX "H5_FC_GLOBAL_\\(.*,.*\\) +(.*)") string (REGEX MATCH "H5_FC_GLOBAL_\\(.*,.*\\) +(.*)" RESULT ${CONTENTS}) set (H5_FC_FUNC_ "H5_FC_FUNC_(name,NAME) ${CMAKE_MATCH_1}") @@ -36,7 +36,7 @@ MACRO (CHECK_FORTRAN_FEATURE FUNCTION CODE VARIABLE) else (CMAKE_REQUIRED_LIBRARIES) set (CHECK_FUNCTION_EXISTS_ADD_LIBRARIES) endif (CMAKE_REQUIRED_LIBRARIES) - FILE (WRITE + file (WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testFortranCompiler.f "${CODE}" ) @@ -54,14 +54,14 @@ MACRO (CHECK_FORTRAN_FEATURE FUNCTION CODE VARIABLE) if (${VARIABLE}) set (${VARIABLE} 1 CACHE INTERNAL "Have Fortran function ${FUNCTION}") message (STATUS "Testing Fortran ${FUNCTION} - OK") - FILE (APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log + file (APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log "Determining if the Fortran ${FUNCTION} exists passed with the following output:\n" "${OUTPUT}\n\n" ) else (${VARIABLE}) message (STATUS "Testing Fortran ${FUNCTION} - Fail") set (${VARIABLE} "" CACHE INTERNAL "Have Fortran function ${FUNCTION}") - FILE (APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log + file (APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log "Determining if the Fortran ${FUNCTION} exists failed with the following output:\n" "${OUTPUT}\n\n") endif (${VARIABLE}) diff --git a/config/cmake/grepTest.cmake b/config/cmake/grepTest.cmake index 7670ad5..579d855 100644 --- a/config/cmake/grepTest.cmake +++ b/config/cmake/grepTest.cmake @@ -41,7 +41,7 @@ message (STATUS "COMMAND Result: ${TEST_RESULT}") message (STATUS "COMMAND Error: ${TEST_ERROR}") # now grep the output with the reference -FILE (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) +file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) # TEST_REFERENCE should always be matched STRING(REGEX MATCH "${TEST_REFERENCE}" TEST_MATCH ${TEST_STREAM}) diff --git a/config/cmake/prunTest.cmake b/config/cmake/prunTest.cmake index 9cf0c55..3d5ec31 100644 --- a/config/cmake/prunTest.cmake +++ b/config/cmake/prunTest.cmake @@ -46,34 +46,34 @@ EXECUTE_PROCESS ( message (STATUS "COMMAND Result: ${TEST_RESULT}") -FILE (READ ${TEST_FOLDER}/${TEST_REFERENCE} TEST_STREAM) -FILE (WRITE ${TEST_FOLDER}/P_${TEST_REFERENCE} "${TEST_STREAM}") +file (READ ${TEST_FOLDER}/${TEST_REFERENCE} TEST_STREAM) +file (WRITE ${TEST_FOLDER}/P_${TEST_REFERENCE} "${TEST_STREAM}") if (ERROR_APPEND) - FILE (READ ${TEST_FOLDER}/${TEST_OUTPUT}.err TEST_STREAM) - FILE (APPEND ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}") + file (READ ${TEST_FOLDER}/${TEST_OUTPUT}.err TEST_STREAM) + file (APPEND ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}") endif (ERROR_APPEND) if (TEST_APPEND) - FILE (APPEND ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_APPEND} ${TEST_ERROR}\n") + file (APPEND ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_APPEND} ${TEST_ERROR}\n") endif (TEST_APPEND) message (STATUS "COMMAND Error: ${TEST_ERROR}") if (TEST_MASK) - FILE (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) + file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) STRING(REGEX REPLACE "Storage:[^\n]+\n" "Storage:
\n" TEST_STREAM "${TEST_STREAM}") - FILE (WRITE ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}") + file (WRITE ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}") endif (TEST_MASK) if (TEST_MASK_MOD) - FILE (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) + file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) STRING(REGEX REPLACE "Modified:[^\n]+\n" "Modified: XXXX-XX-XX XX:XX:XX XXX\n" TEST_STREAM "${TEST_STREAM}") - FILE (WRITE ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}") + file (WRITE ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}") endif (TEST_MASK_MOD) if (TEST_MASK_ERROR) - FILE (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) + file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) STRING(REGEX REPLACE "thread [0-9]*:" "thread (IDs):" TEST_STREAM "${TEST_STREAM}") STRING(REGEX REPLACE ": ([^\n]*)[.]c " ": (file name) " TEST_STREAM "${TEST_STREAM}") STRING(REGEX REPLACE " line [0-9]*" " line (number)" TEST_STREAM "${TEST_STREAM}") @@ -81,26 +81,26 @@ if (TEST_MASK_ERROR) STRING(REGEX REPLACE "[1-9]*[.][0-9]*[.][0-9]*[^)]*" "version (number)" TEST_STREAM "${TEST_STREAM}") STRING(REGEX REPLACE "H5Eget_auto[1-2]*" "H5Eget_auto(1 or 2)" TEST_STREAM "${TEST_STREAM}") STRING(REGEX REPLACE "H5Eset_auto[1-2]*" "H5Eset_auto(1 or 2)" TEST_STREAM "${TEST_STREAM}") - FILE (WRITE ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}") + file (WRITE ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}") endif (TEST_MASK_ERROR) if (TEST_FILTER) - FILE (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) + file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) STRING(REGEX REPLACE "${TEST_FILTER}" "" TEST_STREAM "${TEST_STREAM}") - FILE (WRITE ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}") + file (WRITE ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}") endif (TEST_FILTER) #if (TEST_REF_FILTER) # message (STATUS "TEST_REF_FILTER: ${TEST_APPEND}${TEST_REF_FILTER}") -# FILE (READ ${TEST_FOLDER}/P_${TEST_REFERENCE} TEST_STREAM) +# file (READ ${TEST_FOLDER}/P_${TEST_REFERENCE} TEST_STREAM) # STRING(REGEX REPLACE "${TEST_APPEND}" "${TEST_REF_FILTER}" TEST_STREAM "${TEST_STREAM}") -# FILE (WRITE ${TEST_FOLDER}/P_${TEST_REFERENCE} "${TEST_STREAM}") +# file (WRITE ${TEST_FOLDER}/P_${TEST_REFERENCE} "${TEST_STREAM}") #endif (TEST_REF_FILTER) if (NOT TEST_SKIP_COMPARE) if (WIN32 AND NOT MINGW) - FILE (READ ${TEST_FOLDER}/P_${TEST_REFERENCE} TEST_STREAM) - FILE (WRITE ${TEST_FOLDER}/P_${TEST_REFERENCE} "${TEST_STREAM}") + file (READ ${TEST_FOLDER}/P_${TEST_REFERENCE} TEST_STREAM) + file (WRITE ${TEST_FOLDER}/P_${TEST_REFERENCE} "${TEST_STREAM}") endif (WIN32 AND NOT MINGW) # now compare the output with the reference @@ -110,9 +110,9 @@ if (NOT TEST_SKIP_COMPARE) ) if (NOT ${TEST_RESULT} STREQUAL 0) set (TEST_RESULT 0) - FILE (STRINGS ${TEST_FOLDER}/${TEST_OUTPUT} test_act) + file (STRINGS ${TEST_FOLDER}/${TEST_OUTPUT} test_act) LIST (LENGTH test_act len_act) - FILE (STRINGS ${TEST_FOLDER}/P_${TEST_REFERENCE} test_ref) + file (STRINGS ${TEST_FOLDER}/P_${TEST_REFERENCE} test_ref) LIST (LENGTH test_ref len_ref) if (NOT ${len_act} STREQUAL "0") MATH (EXPR _FP_LEN "${len_ref} - 1") diff --git a/config/cmake/runTest.cmake b/config/cmake/runTest.cmake index 9a891e6..879426c 100644 --- a/config/cmake/runTest.cmake +++ b/config/cmake/runTest.cmake @@ -49,12 +49,12 @@ EXECUTE_PROCESS ( message (STATUS "COMMAND Result: ${TEST_RESULT}") if (ERROR_APPEND) - FILE (READ ${TEST_FOLDER}/${TEST_OUTPUT}.err TEST_STREAM) - FILE (APPEND ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}") + file (READ ${TEST_FOLDER}/${TEST_OUTPUT}.err TEST_STREAM) + file (APPEND ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}") endif (ERROR_APPEND) if (TEST_APPEND) - FILE (APPEND ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_APPEND} ${TEST_RESULT}\n") + file (APPEND ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_APPEND} ${TEST_RESULT}\n") endif (TEST_APPEND) # if the return value is !=${TEST_EXPECT} bail out @@ -65,22 +65,22 @@ endif (NOT ${TEST_RESULT} STREQUAL ${TEST_EXPECT}) message (STATUS "COMMAND Error: ${TEST_ERROR}") if (TEST_MASK) - FILE (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) + file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) STRING(REGEX REPLACE "Storage:[^\n]+\n" "Storage:
\n" TEST_STREAM "${TEST_STREAM}") - FILE (WRITE ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}") + file (WRITE ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}") endif (TEST_MASK) if (TEST_MASK_MOD) - FILE (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) + file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) STRING(REGEX REPLACE "Modified:[^\n]+\n" "Modified: XXXX-XX-XX XX:XX:XX XXX\n" TEST_STREAM "${TEST_STREAM}") - FILE (WRITE ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}") + file (WRITE ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}") endif (TEST_MASK_MOD) if (TEST_MASK_ERROR) if (NOT TEST_ERRREF) - FILE (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) + file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) else (NOT TEST_ERRREF) - FILE (READ ${TEST_FOLDER}/${TEST_OUTPUT}.err TEST_STREAM) + file (READ ${TEST_FOLDER}/${TEST_OUTPUT}.err TEST_STREAM) endif (NOT TEST_ERRREF) STRING(REGEX REPLACE "thread [0-9]*:" "thread (IDs):" TEST_STREAM "${TEST_STREAM}") STRING(REGEX REPLACE ": ([^\n]*)[.]c " ": (file name) " TEST_STREAM "${TEST_STREAM}") @@ -90,22 +90,22 @@ if (TEST_MASK_ERROR) STRING(REGEX REPLACE "H5Eget_auto[1-2]*" "H5Eget_auto(1 or 2)" TEST_STREAM "${TEST_STREAM}") STRING(REGEX REPLACE "H5Eset_auto[1-2]*" "H5Eset_auto(1 or 2)" TEST_STREAM "${TEST_STREAM}") if (NOT TEST_ERRREF) - FILE (WRITE ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}") + file (WRITE ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}") else (NOT TEST_ERRREF) - FILE (WRITE ${TEST_FOLDER}/${TEST_OUTPUT}.err "${TEST_STREAM}") + file (WRITE ${TEST_FOLDER}/${TEST_OUTPUT}.err "${TEST_STREAM}") endif (NOT TEST_ERRREF) endif (TEST_MASK_ERROR) if (TEST_FILTER) - FILE (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) + file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) STRING(REGEX REPLACE "${TEST_FILTER}" "" TEST_STREAM "${TEST_STREAM}") - FILE (WRITE ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}") + file (WRITE ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}") endif (TEST_FILTER) if (NOT TEST_SKIP_COMPARE) if (WIN32 AND NOT MINGW) - FILE (READ ${TEST_FOLDER}/${TEST_REFERENCE} TEST_STREAM) - FILE (WRITE ${TEST_FOLDER}/${TEST_REFERENCE} "${TEST_STREAM}") + file (READ ${TEST_FOLDER}/${TEST_REFERENCE} TEST_STREAM) + file (WRITE ${TEST_FOLDER}/${TEST_REFERENCE} "${TEST_STREAM}") endif (WIN32 AND NOT MINGW) # now compare the output with the reference @@ -115,9 +115,9 @@ if (NOT TEST_SKIP_COMPARE) ) if (NOT ${TEST_RESULT} STREQUAL 0) set (TEST_RESULT 0) - FILE (STRINGS ${TEST_FOLDER}/${TEST_OUTPUT} test_act) + file (STRINGS ${TEST_FOLDER}/${TEST_OUTPUT} test_act) LIST (LENGTH test_act len_act) - FILE (STRINGS ${TEST_FOLDER}/${TEST_REFERENCE} test_ref) + file (STRINGS ${TEST_FOLDER}/${TEST_REFERENCE} test_ref) LIST (LENGTH test_ref len_ref) if (NOT ${len_act} STREQUAL "0") MATH (EXPR _FP_LEN "${len_ref} - 1") @@ -146,8 +146,8 @@ if (NOT TEST_SKIP_COMPARE) if (TEST_ERRREF) if (WIN32 AND NOT MINGW) - FILE (READ ${TEST_FOLDER}/${TEST_ERRREF} TEST_STREAM) - FILE (WRITE ${TEST_FOLDER}/${TEST_ERRREF} "${TEST_STREAM}") + file (READ ${TEST_FOLDER}/${TEST_ERRREF} TEST_STREAM) + file (WRITE ${TEST_FOLDER}/${TEST_ERRREF} "${TEST_STREAM}") endif (WIN32 AND NOT MINGW) # now compare the error output with the error reference @@ -157,9 +157,9 @@ if (NOT TEST_SKIP_COMPARE) ) if (NOT ${TEST_RESULT} STREQUAL 0) set (TEST_RESULT 0) - FILE (STRINGS ${TEST_FOLDER}/${TEST_OUTPUT}.err test_act) + file (STRINGS ${TEST_FOLDER}/${TEST_OUTPUT}.err test_act) LIST (LENGTH test_act len_act) - FILE (STRINGS ${TEST_FOLDER}/${TEST_ERRREF} test_ref) + file (STRINGS ${TEST_FOLDER}/${TEST_ERRREF} test_ref) LIST (LENGTH test_ref len_ref) MATH (EXPR _FP_LEN "${len_ref} - 1") if (NOT ${len_act} STREQUAL "0") diff --git a/config/cmake/userblockTest.cmake b/config/cmake/userblockTest.cmake index 2b6b934..2e0740b 100644 --- a/config/cmake/userblockTest.cmake +++ b/config/cmake/userblockTest.cmake @@ -35,7 +35,7 @@ set (TEST_STRING_SIZE 0) if (TEST_CHECKUB STREQUAL "YES") # find the length of the user block to check #s1=`cat $ufile | wc -c | sed -e 's/ //g'` - FILE (STRINGS ${TEST_FOLDER}/${TEST_UFILE} TEST_U_STRING) + file (STRINGS ${TEST_FOLDER}/${TEST_UFILE} TEST_U_STRING) string (LENGTH ${TEST_U_STRING} TEST_U_STRING_LEN) # Get the size of the original user block, if any. @@ -54,7 +54,7 @@ if (TEST_CHECKUB STREQUAL "YES") if (NOT ${TEST_RESULT} STREQUAL "0") message (FATAL_ERROR "Failed: The output of ${TEST_PROGRAM} ${TEST_OFILE} is: ${TEST_ERROR}") endif (NOT ${TEST_RESULT} STREQUAL "0") - FILE (READ ${TEST_HFILE}.len.txt TEST_O_STRING_LEN) + file (READ ${TEST_HFILE}.len.txt TEST_O_STRING_LEN) endif (TEST_OFILE) MATH( EXPR TEST_STRING_SIZE "${TEST_U_STRING_LEN} + ${TEST_O_STRING_LEN}" ) @@ -71,11 +71,11 @@ if (TEST_CHECKUB STREQUAL "YES") OUTPUT_STRIP_TRAILING_WHITESPACE ) #cat $ufile >> $cmpfile - FILE (STRINGS ${TEST_UFILE} TEST_STREAM NEWLINE_CONSUME) - FILE (APPEND ${TEST_HFILE}-ub.cmp "${TEST_STREAM}") + file (STRINGS ${TEST_UFILE} TEST_STREAM NEWLINE_CONSUME) + 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_HFILE}-ub.cmp ${TEST_STREAM}) + file (STRINGS ${TEST_UFILE} TEST_STREAM NEWLINE_CONSUME) + file (WRITE ${TEST_HFILE}-ub.cmp ${TEST_STREAM}) endif (NOT TEST_O_STRING_LEN STREQUAL "0") #$JAM_BIN/getub -c $size $hfile > $tfile diff --git a/config/cmake/vfdTest.cmake b/config/cmake/vfdTest.cmake index f12dee7..d3cb87e 100644 --- a/config/cmake/vfdTest.cmake +++ b/config/cmake/vfdTest.cmake @@ -36,8 +36,8 @@ EXECUTE_PROCESS ( message (STATUS "COMMAND Result: ${TEST_RESULT}") if (ERROR_APPEND) - FILE (READ ${TEST_FOLDER}/${TEST_OUTPUT}_${TEST_VFD}.err TEST_STREAM) - FILE (APPEND ${TEST_FOLDER}/${TEST_OUTPUT}_${TEST_VFD}.out "${TEST_STREAM}") + file (READ ${TEST_FOLDER}/${TEST_OUTPUT}_${TEST_VFD}.err TEST_STREAM) + file (APPEND ${TEST_FOLDER}/${TEST_OUTPUT}_${TEST_VFD}.out "${TEST_STREAM}") endif (ERROR_APPEND) # if the return value is !=${TEST_EXPECT} bail out diff --git a/examples/CMakeTests.cmake b/examples/CMakeTests.cmake index 9f51d74..2a20fd8 100644 --- a/examples/CMakeTests.cmake +++ b/examples/CMakeTests.cmake @@ -4,7 +4,7 @@ ### T E S T I N G ### ############################################################################## ############################################################################## - FILE (MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/red ${PROJECT_BINARY_DIR}/blue ${PROJECT_BINARY_DIR}/u2w) + file (MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/red ${PROJECT_BINARY_DIR}/blue ${PROJECT_BINARY_DIR}/u2w) # Remove any output file left over from previous test run add_test ( diff --git a/fortran/CMakeLists.txt b/fortran/CMakeLists.txt index c0f5a03..4d8c9dd 100644 --- a/fortran/CMakeLists.txt +++ b/fortran/CMakeLists.txt @@ -8,21 +8,21 @@ endif (H5_HAVE_PARALLEL) #----------------------------------------------------------------------------- # Traverse source subdirectory #----------------------------------------------------------------------------- -ADD_SUBDIRECTORY (${HDF5_F90_SOURCE_DIR}/src ${HDF5_F90_BINARY_DIR}/src) +add_subdirectory (${HDF5_F90_SOURCE_DIR}/src ${HDF5_F90_BINARY_DIR}/src) #----------------------------------------------------------------------------- # Build the Fortran Examples #----------------------------------------------------------------------------- if (HDF5_BUILD_EXAMPLES) - ADD_SUBDIRECTORY (${HDF5_F90_SOURCE_DIR}/examples ${HDF5_F90_BINARY_DIR}/examples) + add_subdirectory (${HDF5_F90_SOURCE_DIR}/examples ${HDF5_F90_BINARY_DIR}/examples) endif (HDF5_BUILD_EXAMPLES) #----------------------------------------------------------------------------- # Testing #----------------------------------------------------------------------------- if (BUILD_TESTING) - ADD_SUBDIRECTORY (${HDF5_F90_SOURCE_DIR}/test ${HDF5_F90_BINARY_DIR}/test) + add_subdirectory (${HDF5_F90_SOURCE_DIR}/test ${HDF5_F90_BINARY_DIR}/test) if (MPI_Fortran_FOUND) - ADD_SUBDIRECTORY (${HDF5_F90_SOURCE_DIR}/testpar ${HDF5_F90_BINARY_DIR}/testpar) + add_subdirectory (${HDF5_F90_SOURCE_DIR}/testpar ${HDF5_F90_BINARY_DIR}/testpar) endif (MPI_Fortran_FOUND) endif (BUILD_TESTING) diff --git a/hl/CMakeLists.txt b/hl/CMakeLists.txt index d50c62d..22c0770 100644 --- a/hl/CMakeLists.txt +++ b/hl/CMakeLists.txt @@ -20,25 +20,25 @@ endif (BUILD_SHARED_LIBS) #----------------------------------------------------------------------------- INCLUDE_DIRECTORIES (${HDF5_HL_SOURCE_DIR}/src ) -ADD_SUBDIRECTORY (${HDF5_HL_SOURCE_DIR}/src ${HDF5_HL_BINARY_DIR}/src) +add_subdirectory (${HDF5_HL_SOURCE_DIR}/src ${HDF5_HL_BINARY_DIR}/src) #-- Build the High level Tools if (HDF5_BUILD_TOOLS) - ADD_SUBDIRECTORY (${HDF5_HL_SOURCE_DIR}/tools ${HDF5_HL_BINARY_DIR}/tools) + add_subdirectory (${HDF5_HL_SOURCE_DIR}/tools ${HDF5_HL_BINARY_DIR}/tools) endif (HDF5_BUILD_TOOLS) #-- Add High Level Examples if (HDF5_BUILD_EXAMPLES) - ADD_SUBDIRECTORY (${HDF5_HL_SOURCE_DIR}/examples ${HDF5_HL_BINARY_DIR}/examples) + add_subdirectory (${HDF5_HL_SOURCE_DIR}/examples ${HDF5_HL_BINARY_DIR}/examples) endif (HDF5_BUILD_EXAMPLES) #-- Build the Unit testing if requested if (NOT HDF5_EXTERNALLY_CONFIGURED) if (BUILD_TESTING) - ADD_SUBDIRECTORY (${HDF5_HL_SOURCE_DIR}/test ${HDF5_HL_BINARY_DIR}/test) + add_subdirectory (${HDF5_HL_SOURCE_DIR}/test ${HDF5_HL_BINARY_DIR}/test) endif (BUILD_TESTING) endif (NOT HDF5_EXTERNALLY_CONFIGURED) if (HDF5_BUILD_CPP_LIB) - ADD_SUBDIRECTORY (${HDF5_HL_SOURCE_DIR}/c++ ${HDF5_HL_BINARY_DIR}/c++) + add_subdirectory (${HDF5_HL_SOURCE_DIR}/c++ ${HDF5_HL_BINARY_DIR}/c++) endif (HDF5_BUILD_CPP_LIB) diff --git a/hl/c++/CMakeLists.txt b/hl/c++/CMakeLists.txt index 386f5a6..9f0aa7e 100644 --- a/hl/c++/CMakeLists.txt +++ b/hl/c++/CMakeLists.txt @@ -4,13 +4,13 @@ PROJECT (HDF5_HL_CPP) #----------------------------------------------------------------------------- # Main HL lib is in /src #----------------------------------------------------------------------------- -ADD_SUBDIRECTORY (${HDF5_HL_CPP_SOURCE_DIR}/src ${HDF5_HL_CPP_BINARY_DIR}/src) +add_subdirectory (${HDF5_HL_CPP_SOURCE_DIR}/src ${HDF5_HL_CPP_BINARY_DIR}/src) # -------------------------------------------------------------------- # Add in the examples for the Packet Table codes # -------------------------------------------------------------------- if (HDF5_BUILD_EXAMPLES) - ADD_SUBDIRECTORY (${HDF5_HL_CPP_SOURCE_DIR}/examples ${HDF5_HL_CPP_BINARY_DIR}/examples) + add_subdirectory (${HDF5_HL_CPP_SOURCE_DIR}/examples ${HDF5_HL_CPP_BINARY_DIR}/examples) endif (HDF5_BUILD_EXAMPLES) # -------------------------------------------------------------------- @@ -18,5 +18,5 @@ endif (HDF5_BUILD_EXAMPLES) # -------------------------------------------------------------------- if (BUILD_TESTING) - ADD_SUBDIRECTORY (${HDF5_HL_CPP_SOURCE_DIR}/test ${HDF5_HL_CPP_BINARY_DIR}/test) + add_subdirectory (${HDF5_HL_CPP_SOURCE_DIR}/test ${HDF5_HL_CPP_BINARY_DIR}/test) endif (BUILD_TESTING) diff --git a/hl/fortran/CMakeLists.txt b/hl/fortran/CMakeLists.txt index 72fc7a8..c26d94c 100644 --- a/hl/fortran/CMakeLists.txt +++ b/hl/fortran/CMakeLists.txt @@ -4,18 +4,18 @@ PROJECT (HDF5_HL_F90 C CXX Fortran) #----------------------------------------------------------------------------- # List Source files #----------------------------------------------------------------------------- -ADD_SUBDIRECTORY (${HDF5_HL_F90_SOURCE_DIR}/src ${HDF5_HL_F90_BINARY_DIR}/src) +add_subdirectory (${HDF5_HL_F90_SOURCE_DIR}/src ${HDF5_HL_F90_BINARY_DIR}/src) #----------------------------------------------------------------------------- # Build the HL Fortran Examples #----------------------------------------------------------------------------- if (HDF5_BUILD_FORTRAN_EXAMPLES) - ADD_SUBDIRECTORY (${HDF5_HL_F90_SOURCE_DIR}/examples ${HDF5_HL_F90_BINARY_DIR}/examples) + add_subdirectory (${HDF5_HL_F90_SOURCE_DIR}/examples ${HDF5_HL_F90_BINARY_DIR}/examples) endif (HDF5_BUILD_FORTRAN_EXAMPLES) #----------------------------------------------------------------------------- # Testing #----------------------------------------------------------------------------- if (BUILD_TESTING) - ADD_SUBDIRECTORY (${HDF5_HL_F90_SOURCE_DIR}/test ${HDF5_HL_F90_BINARY_DIR}/test) + add_subdirectory (${HDF5_HL_F90_SOURCE_DIR}/test ${HDF5_HL_F90_BINARY_DIR}/test) endif (BUILD_TESTING) diff --git a/hl/tools/CMakeTests.cmake b/hl/tools/CMakeTests.cmake index 7c5bd77..a340c2d 100644 --- a/hl/tools/CMakeTests.cmake +++ b/hl/tools/CMakeTests.cmake @@ -6,7 +6,7 @@ ############################################################################## # Make testfiles dir under build dir -FILE (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") +file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") # # copy test files from source to build dir diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index b7f87b4..dcbe9d4 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -46,8 +46,8 @@ set_target_properties (${HDF5_TEST_LIB_TARGET} PROPERTIES #----------------------------------------------------------------------------- if (BUILD_SHARED_LIBS) # make plugins dir - FILE (MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/testdir1") - FILE (MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/testdir2") + file (MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/testdir1") + file (MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/testdir2") #----------------------------------------------------------------------------- # Define Test Library Sources @@ -294,7 +294,7 @@ set_target_properties (links_env PROPERTIES FOLDER test) #-- Adding test for libinfo set (GREP_RUNNER ${PROJECT_BINARY_DIR}/GrepRunner.cmake) file (WRITE ${GREP_RUNNER} - "FILE (STRINGS \${TEST_PROGRAM} TEST_RESULT REGEX \"SUMMARY OF THE HDF5 CONFIGURATION\") + "file (STRINGS \${TEST_PROGRAM} TEST_RESULT REGEX \"SUMMARY OF THE HDF5 CONFIGURATION\") if (\${TEST_RESULT} STREQUAL \"0\") message (FATAL_ERROR \"Failed: The output: \${TEST_RESULT} of \${TEST_PROGRAM} did not contain SUMMARY OF THE HDF5 CONFIGURATION\") else (\${TEST_RESULT} STREQUAL \"0\") diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt index a9a7232..27820ae 100644 --- a/tools/CMakeLists.txt +++ b/tools/CMakeLists.txt @@ -15,32 +15,32 @@ INCLUDE_DIRECTORIES (${HDF5_TOOLS_SOURCE_DIR}/lib) # If testing was NOT enabled, then we need to build the tools library # -------------------------------------------------------------------- if (NOT BUILD_TESTING) - ADD_SUBDIRECTORY (${HDF5_TOOLS_SOURCE_DIR}/lib) + add_subdirectory (${HDF5_TOOLS_SOURCE_DIR}/lib) endif (NOT BUILD_TESTING) #-- Add the h5diff and test executables -ADD_SUBDIRECTORY (${HDF5_TOOLS_SOURCE_DIR}/h5diff) +add_subdirectory (${HDF5_TOOLS_SOURCE_DIR}/h5diff) #-- Add the h5ls executable -ADD_SUBDIRECTORY (${HDF5_TOOLS_SOURCE_DIR}/h5ls) +add_subdirectory (${HDF5_TOOLS_SOURCE_DIR}/h5ls) #-- Misc Executables -ADD_SUBDIRECTORY (${HDF5_TOOLS_SOURCE_DIR}/misc) +add_subdirectory (${HDF5_TOOLS_SOURCE_DIR}/misc) #-- Add the h5import and test executables -ADD_SUBDIRECTORY (${HDF5_TOOLS_SOURCE_DIR}/h5import) +add_subdirectory (${HDF5_TOOLS_SOURCE_DIR}/h5import) #-- h5Repack executables -ADD_SUBDIRECTORY (${HDF5_TOOLS_SOURCE_DIR}/h5repack) +add_subdirectory (${HDF5_TOOLS_SOURCE_DIR}/h5repack) #-- Add the h5dump and test executables -ADD_SUBDIRECTORY (${HDF5_TOOLS_SOURCE_DIR}/h5jam) +add_subdirectory (${HDF5_TOOLS_SOURCE_DIR}/h5jam) #-- Add the h5copy and test executables -ADD_SUBDIRECTORY (${HDF5_TOOLS_SOURCE_DIR}/h5copy) +add_subdirectory (${HDF5_TOOLS_SOURCE_DIR}/h5copy) #-- Add the h5stat and test executables -ADD_SUBDIRECTORY (${HDF5_TOOLS_SOURCE_DIR}/h5stat) +add_subdirectory (${HDF5_TOOLS_SOURCE_DIR}/h5stat) #-- Add the h5dump and test executables -ADD_SUBDIRECTORY (${HDF5_TOOLS_SOURCE_DIR}/h5dump) +add_subdirectory (${HDF5_TOOLS_SOURCE_DIR}/h5dump) diff --git a/tools/h5copy/CMakeTests.cmake b/tools/h5copy/CMakeTests.cmake index 34976fe..77399a8 100644 --- a/tools/h5copy/CMakeTests.cmake +++ b/tools/h5copy/CMakeTests.cmake @@ -19,7 +19,7 @@ ${HDF5_TOOLS_H5COPY_SOURCE_DIR}/testfiles/h5copy_misc1.out ) - FILE (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") + file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") foreach (listfiles ${LIST_HDF5_TEST_FILES} ${LIST_OTHER_TEST_FILES}) GET_FILENAME_COMPONENT(fname "${listfiles}" NAME) diff --git a/tools/h5diff/CMakeTests.cmake b/tools/h5diff/CMakeTests.cmake index 8bae2ca..19a5fe4 100644 --- a/tools/h5diff/CMakeTests.cmake +++ b/tools/h5diff/CMakeTests.cmake @@ -234,7 +234,7 @@ ) # Make testfiles dir under build dir - FILE (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") + file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") # # copy test files from source to build dir diff --git a/tools/h5dump/CMakeTests.cmake b/tools/h5dump/CMakeTests.cmake index 433faa3..bb2a37e 100644 --- a/tools/h5dump/CMakeTests.cmake +++ b/tools/h5dump/CMakeTests.cmake @@ -307,7 +307,7 @@ ) # make test dir - FILE (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") + file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") # # copy test files from source dir to test dir @@ -326,8 +326,8 @@ foreach (tst_exp_file ${HDF5_REFERENCE_EXP_FILES}) if (WIN32 AND NOT CYGWIN) - FILE (READ ${HDF5_TOOLS_SRC_DIR}/testfiles/${tst_exp_file} TEST_STREAM) - FILE (WRITE ${PROJECT_BINARY_DIR}/testfiles/std/${tst_exp_file} "${TEST_STREAM}") + file (READ ${HDF5_TOOLS_SRC_DIR}/testfiles/${tst_exp_file} TEST_STREAM) + file (WRITE ${PROJECT_BINARY_DIR}/testfiles/std/${tst_exp_file} "${TEST_STREAM}") else (WIN32 AND NOT CYGWIN) add_custom_command ( TARGET h5dump @@ -373,8 +373,8 @@ ) if (WIN32 AND NOT CYGWIN) - FILE (READ ${HDF5_TOOLS_SRC_DIR}/testfiles/tbinregR.exp TEST_STREAM) - FILE (WRITE ${PROJECT_BINARY_DIR}/testfiles/std/tbinregR.exp "${TEST_STREAM}") + file (READ ${HDF5_TOOLS_SRC_DIR}/testfiles/tbinregR.exp TEST_STREAM) + file (WRITE ${PROJECT_BINARY_DIR}/testfiles/std/tbinregR.exp "${TEST_STREAM}") else (WIN32 AND NOT CYGWIN) add_custom_command ( TARGET h5dump diff --git a/tools/h5import/CMakeTests.cmake b/tools/h5import/CMakeTests.cmake index 2adbdde..5c5b4de 100644 --- a/tools/h5import/CMakeTests.cmake +++ b/tools/h5import/CMakeTests.cmake @@ -61,7 +61,7 @@ textpfe.h5 ) - FILE (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") + file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") foreach (conf_file ${HDF5_REFERENCE_CONF_FILES}) set (dest "${PROJECT_BINARY_DIR}/testfiles/${conf_file}") #message (STATUS " Copying ${conf_file}") diff --git a/tools/h5jam/CMakeTests.cmake b/tools/h5jam/CMakeTests.cmake index 4b71d7f..7be6934 100644 --- a/tools/h5jam/CMakeTests.cmake +++ b/tools/h5jam/CMakeTests.cmake @@ -20,7 +20,7 @@ twithub513.h5 ) - FILE (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") + file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") foreach (h5_file ${HDF5_REFERENCE_TEST_FILES}) set (dest "${PROJECT_BINARY_DIR}/testfiles/${h5_file}") #message (STATUS " Copying ${h5_file}") @@ -255,7 +255,7 @@ 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}) + CHECKfile (${testname} "H5JAM-${testname}-UNJAM-CHECK_NOUB" ${chkfile} ${outfile}) endif (NOT HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO(UNJAMTEST testname infile ufile outfile) @@ -298,7 +298,7 @@ -P "${HDF5_RESOURCES_DIR}/userblockTest.cmake" ) 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}) + CHECKfile (${testname} "H5JAM-${testname}-CHECK_UB_1" ${chkfile} ${outfile}) endif (NOT HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (JAMTEST testname jamfile infile outfile) @@ -353,7 +353,7 @@ -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}) + CHECKfile (${testname} "H5JAM-${testname}_NONE-CHECK_UB_1" ${infile} ${chkfile}) endif (NOT HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (JAMTEST_NONE testname jamfile infile setfile chkfile) diff --git a/tools/h5ls/CMakeTests.cmake b/tools/h5ls/CMakeTests.cmake index eb68d79..b739130 100644 --- a/tools/h5ls/CMakeTests.cmake +++ b/tools/h5ls/CMakeTests.cmake @@ -92,7 +92,7 @@ ${HDF5_TOOLS_SRC_DIR}/testfiles/tvldtypes2be.ls ) - FILE (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") + file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") # copy the list of test files foreach (listfiles ${LIST_HDF5_TEST_FILES} ${LIST_OTHER_TEST_FILES}) diff --git a/tools/h5repack/CMakeLists.txt b/tools/h5repack/CMakeLists.txt index 4625607..4d26c0c 100644 --- a/tools/h5repack/CMakeLists.txt +++ b/tools/h5repack/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 2.8.10) +cmake_minimum_required (VERSION 2.8.11) PROJECT (HDF5_TOOLS_H5REPACK) #----------------------------------------------------------------------------- @@ -54,7 +54,7 @@ if (BUILD_TESTING) add_definitions (${HDF5_EXTRA_C_FLAGS}) INCLUDE_DIRECTORIES (${HDF5_SRC_DIR}) - add_library (${HDF5_TOOL_PLUGIN_LIB_TARGET} ${LIB_TYPE} ${HDF5_TEST_SRC_DIR}/dynlib1.c) + add_library (${HDF5_TOOL_PLUGIN_LIB_TARGET} ${LIB_TYPE} dynlib_rpk.c) TARGET_C_PROPERTIES (${HDF5_TOOL_PLUGIN_LIB_TARGET} " " " ") target_link_libraries (${HDF5_TOOL_PLUGIN_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) H5_SET_LIB_OPTIONS ( @@ -65,7 +65,7 @@ if (BUILD_TESTING) ) # make plugins dir - FILE (MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/plugins") + file (MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/plugins") #----------------------------------------------------------------------------- # Copy plugin library to a plugins folder #----------------------------------------------------------------------------- diff --git a/tools/h5repack/dynlib_rpk.c b/tools/h5repack/dynlib_rpk.c new file mode 100644 index 0000000..1ccc33a --- /dev/null +++ b/tools/h5repack/dynlib_rpk.c @@ -0,0 +1,97 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * 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 + * + * Purpose: Tests the plugin module (H5PL) + */ + +#include +#include +#include "H5PLextern.h" + +#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); + +/* 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 */ +}}; + +H5PL_type_t H5PLget_plugin_type(void) {return H5PL_TYPE_FILTER;} +const void *H5PLget_plugin_info(void) {return H5Z_DYNLIB1;} + +/*------------------------------------------------------------------------- + * Function: H5Z_filter_dynlib1 + * + * 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: Raymond Lu + * 29 March 2013 + * + *------------------------------------------------------------------------- + */ +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] > 9) + return(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) { + *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; +} /* end H5Z_filter_dynlib1() */ + diff --git a/tools/misc/CMakeTests.cmake b/tools/misc/CMakeTests.cmake index a935c2b..468ff3a 100644 --- a/tools/misc/CMakeTests.cmake +++ b/tools/misc/CMakeTests.cmake @@ -58,7 +58,7 @@ ) # make test dir - FILE (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") + file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") foreach (h5_mkgrp_file ${HDF5_MKGRP_TEST_FILES}) set (dest "${PROJECT_BINARY_DIR}/testfiles/${h5_mkgrp_file}") -- cgit v0.12 From 44fe3cc19b4e40672f1d7ab4fcd9cd58ded234e8 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 18 Mar 2014 11:55:05 -0500 Subject: [svn-r24826] HDFFV-8700 - KitWare recommendations: Change CMake commands to lower case. Bump up CMake minimum versions. Split test file into separate file for h5repack test. Tested: local linux --- hl/fortran/src/CMakeLists.txt | 7 ++++--- hl/src/CMakeLists.txt | 5 +++-- tools/h5jam/CMakeTests.cmake | 6 +++--- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/hl/fortran/src/CMakeLists.txt b/hl/fortran/src/CMakeLists.txt index 6377211..f0b5d3d 100644 --- a/hl/fortran/src/CMakeLists.txt +++ b/hl/fortran/src/CMakeLists.txt @@ -96,9 +96,10 @@ endif (WIN32 AND NOT CYGWIN) # Add Target(s) to CMake Install for import into other projects #----------------------------------------------------------------------------- if (HDF5_EXPORTED_TARGETS) - - INSTALL_TARGET_PDB (${HDF5_HL_F90_C_LIB_TARGET} ${HDF5_INSTALL_LIB_DIR} hlfortlibraries) - #INSTALL_TARGET_PDB (${HDF5_HL_F90_LIB_TARGET} ${HDF5_INSTALL_LIB_DIR} hlfortlibraries) + if (BUILD_SHARED_LIBS) + INSTALL_TARGET_PDB (${HDF5_HL_F90_C_LIB_TARGET} ${HDF5_INSTALL_LIB_DIR} hlfortlibraries) + #INSTALL_TARGET_PDB (${HDF5_HL_F90_LIB_TARGET} ${HDF5_INSTALL_LIB_DIR} hlfortlibraries) + endif (BUILD_SHARED_LIBS) install ( TARGETS diff --git a/hl/src/CMakeLists.txt b/hl/src/CMakeLists.txt index e93a23a..e3a72e4 100644 --- a/hl/src/CMakeLists.txt +++ b/hl/src/CMakeLists.txt @@ -59,8 +59,9 @@ install ( # Add Target(s) to CMake Install for import into other projects #----------------------------------------------------------------------------- if (HDF5_EXPORTED_TARGETS) - - INSTALL_TARGET_PDB (${HDF5_HL_LIB_TARGET} ${HDF5_INSTALL_LIB_DIR} hllibraries) + if (BUILD_SHARED_LIBS) + INSTALL_TARGET_PDB (${HDF5_HL_LIB_TARGET} ${HDF5_INSTALL_LIB_DIR} hllibraries) + endif (BUILD_SHARED_LIBS) install ( TARGETS diff --git a/tools/h5jam/CMakeTests.cmake b/tools/h5jam/CMakeTests.cmake index 7be6934..fb64313 100644 --- a/tools/h5jam/CMakeTests.cmake +++ b/tools/h5jam/CMakeTests.cmake @@ -255,7 +255,7 @@ 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}) + CHECKFILE (${testname} "H5JAM-${testname}-UNJAM-CHECK_NOUB" ${chkfile} ${outfile}) endif (NOT HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO(UNJAMTEST testname infile ufile outfile) @@ -298,7 +298,7 @@ -P "${HDF5_RESOURCES_DIR}/userblockTest.cmake" ) 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}) + CHECKFILE (${testname} "H5JAM-${testname}-CHECK_UB_1" ${chkfile} ${outfile}) endif (NOT HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (JAMTEST testname jamfile infile outfile) @@ -353,7 +353,7 @@ -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}) + CHECKFILE (${testname} "H5JAM-${testname}_NONE-CHECK_UB_1" ${infile} ${chkfile}) endif (NOT HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (JAMTEST_NONE testname jamfile infile setfile chkfile) -- cgit v0.12 From ff565cd175fa5c4c1563496572aa27b0e9484acd Mon Sep 17 00:00:00 2001 From: Binh-Minh Ribler Date: Tue, 18 Mar 2014 14:31:18 -0500 Subject: [svn-r24830] Purpose: HDFFV-8623 Description: Applied patch from user Jason Newton. JIRA issue HDFFV-8623, patch 9, improve c++ compatibility with exceptions. All additions of "throw()" are included. Exception::what() is not added because it is not necessary. It was suggested for the name, which follows stdlib. Platforms tested: Linux/ppc64 (ostrich) Linux/32 2.6 (jam) Linux/64 2.6 (koala)/PGI compilers --- c++/src/H5Exception.cpp | 22 +++++++++++----------- c++/src/H5Exception.h | 22 +++++++++++----------- c++/test/h5cpputil.cpp | 4 ++-- c++/test/h5cpputil.h | 4 ++-- 4 files changed, 26 insertions(+), 26 deletions(-) diff --git a/c++/src/H5Exception.cpp b/c++/src/H5Exception.cpp index 8513372..ddc1d00 100644 --- a/c++/src/H5Exception.cpp +++ b/c++/src/H5Exception.cpp @@ -312,7 +312,7 @@ void Exception::printError( FILE* stream ) const ///\brief Noop destructor // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -Exception::~Exception() {} +Exception::~Exception() throw() {} //-------------------------------------------------------------------------- // Subclass: FileIException @@ -335,7 +335,7 @@ FileIException::FileIException(const H5std_string& func_name, const H5std_string // Function: FileIException destructor ///\brief Noop destructor. //-------------------------------------------------------------------------- -FileIException::~FileIException() {} +FileIException::~FileIException() throw() {} //-------------------------------------------------------------------------- // Subclass: GroupIException @@ -358,7 +358,7 @@ GroupIException::GroupIException(const H5std_string& func_name, const H5std_stri // Function: GroupIException destructor ///\brief Noop destructor. //-------------------------------------------------------------------------- -GroupIException::~GroupIException() {} +GroupIException::~GroupIException() throw() {} //-------------------------------------------------------------------------- // Subclass: DataSpaceIException @@ -381,7 +381,7 @@ DataSpaceIException::DataSpaceIException(const H5std_string& func_name, const H5 // Function: DataSpaceIException destructor ///\brief Noop destructor. //-------------------------------------------------------------------------- -DataSpaceIException::~DataSpaceIException() {} +DataSpaceIException::~DataSpaceIException() throw() {} //-------------------------------------------------------------------------- // Subclass: DataTypeIException @@ -404,7 +404,7 @@ DataTypeIException::DataTypeIException(const H5std_string& func_name, const H5st // Function: DataTypeIException destructor ///\brief Noop destructor. //-------------------------------------------------------------------------- -DataTypeIException::~DataTypeIException() {} +DataTypeIException::~DataTypeIException() throw() {} //-------------------------------------------------------------------------- // Subclass: PropListIException @@ -427,7 +427,7 @@ PropListIException::PropListIException(const H5std_string& func_name, const H5st // Function: PropListIException destructor ///\brief Noop destructor. //-------------------------------------------------------------------------- -PropListIException::~PropListIException() {} +PropListIException::~PropListIException() throw() {} //-------------------------------------------------------------------------- // Subclass: DataSetIException @@ -450,7 +450,7 @@ DataSetIException::DataSetIException(const H5std_string& func_name, const H5std_ // Function: DataSetIException destructor ///\brief Noop destructor. //-------------------------------------------------------------------------- -DataSetIException::~DataSetIException() {} +DataSetIException::~DataSetIException() throw() {} //-------------------------------------------------------------------------- // Subclass: AttributeIException @@ -473,7 +473,7 @@ AttributeIException::AttributeIException(const H5std_string& func_name, const H5 // Function: AttributeIException destructor ///\brief Noop destructor. //-------------------------------------------------------------------------- -AttributeIException::~AttributeIException() {} +AttributeIException::~AttributeIException() throw() {} //-------------------------------------------------------------------------- // Subclass: ReferenceException @@ -496,7 +496,7 @@ ReferenceException::ReferenceException(const H5std_string& func_name, const H5st // Function: ReferenceException destructor ///\brief Noop destructor. //-------------------------------------------------------------------------- -ReferenceException::~ReferenceException() {} +ReferenceException::~ReferenceException() throw() {} //-------------------------------------------------------------------------- // Subclass: LibraryIException @@ -519,7 +519,7 @@ LibraryIException::LibraryIException(const H5std_string& func_name, const H5std_ // Function: LibraryIException destructor ///\brief Noop destructor. //-------------------------------------------------------------------------- -LibraryIException::~LibraryIException() {} +LibraryIException::~LibraryIException() throw() {} //-------------------------------------------------------------------------- // Subclass: IdComponentException @@ -542,7 +542,7 @@ IdComponentException::IdComponentException(const H5std_string& func_name, const // Function: IdComponentException destructor ///\brief Noop destructor. //-------------------------------------------------------------------------- -IdComponentException::~IdComponentException() {} +IdComponentException::~IdComponentException() throw() {} #ifndef H5_NO_NAMESPACE } // end namespace #endif diff --git a/c++/src/H5Exception.h b/c++/src/H5Exception.h index 30fe537..d747af3 100644 --- a/c++/src/H5Exception.h +++ b/c++/src/H5Exception.h @@ -81,7 +81,7 @@ class H5_DLLCPP Exception { Exception( const Exception& orig); // virtual Destructor - virtual ~Exception(); + virtual ~Exception() throw(); protected: // Default value for detail_message @@ -96,70 +96,70 @@ class H5_DLLCPP FileIException : public Exception { public: FileIException( const H5std_string& func_name, const H5std_string& message = DEFAULT_MSG); FileIException(); - virtual ~FileIException(); + virtual ~FileIException() throw(); }; class H5_DLLCPP GroupIException : public Exception { public: GroupIException( const H5std_string& func_name, const H5std_string& message = DEFAULT_MSG); GroupIException(); - virtual ~GroupIException(); + virtual ~GroupIException() throw(); }; class H5_DLLCPP DataSpaceIException : public Exception { public: DataSpaceIException(const H5std_string& func_name, const H5std_string& message = DEFAULT_MSG); DataSpaceIException(); - virtual ~DataSpaceIException(); + virtual ~DataSpaceIException() throw(); }; class H5_DLLCPP DataTypeIException : public Exception { public: DataTypeIException(const H5std_string& func_name, const H5std_string& message = DEFAULT_MSG); DataTypeIException(); - virtual ~DataTypeIException(); + virtual ~DataTypeIException() throw(); }; class H5_DLLCPP PropListIException : public Exception { public: PropListIException(const H5std_string& func_name, const H5std_string& message = DEFAULT_MSG); PropListIException(); - virtual ~PropListIException(); + virtual ~PropListIException() throw(); }; class H5_DLLCPP DataSetIException : public Exception { public: DataSetIException(const H5std_string& func_name, const H5std_string& message = DEFAULT_MSG); DataSetIException(); - virtual ~DataSetIException(); + virtual ~DataSetIException() throw(); }; class H5_DLLCPP AttributeIException : public Exception { public: AttributeIException(const H5std_string& func_name, const H5std_string& message = DEFAULT_MSG); AttributeIException(); - virtual ~AttributeIException(); + virtual ~AttributeIException() throw(); }; class H5_DLLCPP ReferenceException : public Exception { public: ReferenceException(const H5std_string& func_name, const H5std_string& message = DEFAULT_MSG); ReferenceException(); - virtual ~ReferenceException(); + virtual ~ReferenceException() throw(); }; class H5_DLLCPP LibraryIException : public Exception { public: LibraryIException(const H5std_string& func_name, const H5std_string& message = DEFAULT_MSG); LibraryIException(); - virtual ~LibraryIException(); + virtual ~LibraryIException() throw(); }; class H5_DLLCPP IdComponentException : public Exception { public: IdComponentException(const H5std_string& func_name, const H5std_string& message = DEFAULT_MSG); IdComponentException(); - virtual ~IdComponentException(); + virtual ~IdComponentException() throw(); }; #ifndef H5_NO_NAMESPACE diff --git a/c++/test/h5cpputil.cpp b/c++/test/h5cpputil.cpp index cd85b6e..40e81cc 100644 --- a/c++/test/h5cpputil.cpp +++ b/c++/test/h5cpputil.cpp @@ -220,7 +220,7 @@ InvalidActionException::InvalidActionException(const H5std_string func_name, con //-------------------------------------------------------------------------- // Function: InvalidActionException destructor //-------------------------------------------------------------------------- -InvalidActionException::~InvalidActionException() {} +InvalidActionException::~InvalidActionException() throw() {} //-------------------------------------------------------------------------- // Function: TestFailedException default constructor @@ -242,5 +242,5 @@ TestFailedException::TestFailedException(const H5std_string func_name, const H5s //-------------------------------------------------------------------------- // Function: TestFailedException destructor //-------------------------------------------------------------------------- -TestFailedException::~TestFailedException() {} +TestFailedException::~TestFailedException() throw() {} diff --git a/c++/test/h5cpputil.h b/c++/test/h5cpputil.h index e6aba79..b107045 100644 --- a/c++/test/h5cpputil.h +++ b/c++/test/h5cpputil.h @@ -49,14 +49,14 @@ class InvalidActionException : public Exception { public: InvalidActionException(const H5std_string func_name, const H5std_string message = DEFAULT_MSG); InvalidActionException(); - virtual ~InvalidActionException(); + virtual ~InvalidActionException() throw(); }; class TestFailedException : public Exception { public: TestFailedException(const H5std_string func_name, const H5std_string message = DEFAULT_MSG); TestFailedException(); - virtual ~TestFailedException(); + virtual ~TestFailedException() throw(); }; // Overloaded/Template functions to verify values and display proper info -- cgit v0.12 From 34bfba14d5cd30f8ce7c524bc6a729f6cc08cf1c Mon Sep 17 00:00:00 2001 From: Scot Breitenfeld Date: Thu, 20 Mar 2014 09:06:42 -0500 Subject: [svn-r24846] Bug fix for HDFFV-8689 : Mix-match of type in H5D_CHUNK_CACHE_NBYTES_DEFAULT, Review HDF5-184 Tested with -i8 flag with intel compilers and --enable-production --- fortran/src/H5_f.c | 33 +++++++++++++++---------- fortran/src/H5_ff.f90 | 3 +++ fortran/src/H5f90global.f90 | 59 ++++++++++++++++++++++++--------------------- fortran/src/H5f90proto.h | 6 ++--- 4 files changed, 57 insertions(+), 44 deletions(-) diff --git a/fortran/src/H5_f.c b/fortran/src/H5_f.c index 4c85df2..dcfcfc4 100644 --- a/fortran/src/H5_f.c +++ b/fortran/src/H5_f.c @@ -330,9 +330,10 @@ nh5close_types_c( hid_t_f * types, int_f *lentypes, * PURPOSE * Initialize Fortran flags * INPUTS - * h5d_flags - H5D inteface flags - * h5e_flags - H5E inteface flags - * h5e_hid_flags - H5E inteface flags of type hid_t + * h5d_flags - H5D interface flags + * h5d_size_flags - H5D interface flags of type size_t + * h5e_flags - H5E interface flags + * h5e_hid_flags - H5E interface flags of type hid_t * h5f_flags - H5F interface flags * h5fd_flags - H5FD interface flags * h5fd_hid_flags - H5FD interface flags of type hid_t @@ -360,12 +361,15 @@ nh5close_types_c( hid_t_f * types, int_f *lentypes, * Added Generic flags introduced in version 1.8 * MSB, January, 2008 * Added types in lines h5*_flags = ( )variable to match input - * Added E flags. + * Added E flags * MSB, July 9, 2009 + * Added type h5d_flags of type size_t + * MSB, Feb. 28, 2014 * SOURCE */ int_f -nh5init_flags_c( int_f *h5d_flags, int_f *h5e_flags, hid_t_f *h5e_hid_flags, int_f *h5f_flags, +nh5init_flags_c( int_f *h5d_flags, size_t_f *h5d_size_flags, + int_f *h5e_flags, hid_t_f *h5e_hid_flags, int_f *h5f_flags, int_f *h5fd_flags, hid_t_f *h5fd_hid_flags, int_f *h5g_flags, int_f *h5i_flags, int_f *h5l_flags, int_f *h5o_flags, hid_t_f *h5p_flags, int_f *h5p_flags_int, int_f *h5r_flags, int_f *h5s_flags, @@ -376,6 +380,9 @@ nh5init_flags_c( int_f *h5d_flags, int_f *h5e_flags, hid_t_f *h5e_hid_flags, int /* * H5D flags */ + h5d_size_flags[0] = (size_t_f)H5D_CHUNK_CACHE_NSLOTS_DEFAULT; + h5d_size_flags[1] = (size_t_f)H5D_CHUNK_CACHE_NBYTES_DEFAULT; + h5d_flags[0] = (int_f)H5D_COMPACT; h5d_flags[1] = (int_f)H5D_CONTIGUOUS; h5d_flags[2] = (int_f)H5D_CHUNKED; @@ -395,18 +402,18 @@ nh5init_flags_c( int_f *h5d_flags, int_f *h5e_flags, hid_t_f *h5e_hid_flags, int h5d_flags[16] = (int_f)H5D_FILL_VALUE_UNDEFINED; h5d_flags[17] = (int_f)H5D_FILL_VALUE_DEFAULT; h5d_flags[18] = (int_f)H5D_FILL_VALUE_USER_DEFINED; - h5d_flags[19] = (int_f)H5D_CHUNK_CACHE_NSLOTS_DEFAULT; - h5d_flags[20] = (int_f)H5D_CHUNK_CACHE_NBYTES_DEFAULT; - h5d_flags[21] = (int_f)H5D_CHUNK_CACHE_W0_DEFAULT; - h5d_flags[22] = (int_f)H5D_MPIO_NO_COLLECTIVE; - h5d_flags[23] = (int_f)H5D_MPIO_CHUNK_INDEPENDENT; - h5d_flags[24] = (int_f)H5D_MPIO_CHUNK_COLLECTIVE; - h5d_flags[25] = (int_f)H5D_MPIO_CHUNK_MIXED; - h5d_flags[26] = (int_f)H5D_MPIO_CONTIGUOUS_COLLECTIVE; + h5d_flags[19] = (int_f)H5D_CHUNK_CACHE_W0_DEFAULT; + h5d_flags[20] = (int_f)H5D_MPIO_NO_COLLECTIVE; + h5d_flags[21] = (int_f)H5D_MPIO_CHUNK_INDEPENDENT; + h5d_flags[22] = (int_f)H5D_MPIO_CHUNK_COLLECTIVE; + h5d_flags[23] = (int_f)H5D_MPIO_CHUNK_MIXED; + h5d_flags[24] = (int_f)H5D_MPIO_CONTIGUOUS_COLLECTIVE; + /* * H5E flags */ h5e_hid_flags[0] = (hid_t_f)H5E_DEFAULT; + h5e_flags[0] = (int_f)H5E_MAJOR; h5e_flags[1] = (int_f)H5E_MINOR; h5e_flags[2] = (int_f)H5E_WALK_UPWARD; diff --git a/fortran/src/H5_ff.f90 b/fortran/src/H5_ff.f90 index f9c20ac..49e64a3 100644 --- a/fortran/src/H5_ff.f90 +++ b/fortran/src/H5_ff.f90 @@ -87,6 +87,7 @@ CONTAINS END INTERFACE INTERFACE INTEGER FUNCTION h5init_flags_c(i_H5D_flags, & + i_H5D_size_flags,& i_H5E_flags, & i_H5E_hid_flags, & i_H5F_flags, & @@ -106,6 +107,7 @@ CONTAINS i_H5generic_flags) USE H5GLOBAL INTEGER i_H5D_flags(H5D_FLAGS_LEN) + INTEGER(SIZE_T) i_H5D_size_flags(H5D_SIZE_FLAGS_LEN) INTEGER i_H5E_flags(H5E_FLAGS_LEN) INTEGER(HID_T) i_H5E_hid_flags(H5E_HID_FLAGS_LEN) INTEGER i_H5F_flags(H5F_FLAGS_LEN) @@ -139,6 +141,7 @@ CONTAINS END INTERFACE error_1 = h5init_types_c(predef_types, floating_types, integer_types) error_2 = h5init_flags_c(H5D_flags, & + H5D_size_flags, & H5E_flags, & H5E_hid_flags, & H5F_flags, & diff --git a/fortran/src/H5f90global.f90 b/fortran/src/H5f90global.f90 index a6168d52..f2bb3de 100644 --- a/fortran/src/H5f90global.f90 +++ b/fortran/src/H5f90global.f90 @@ -76,7 +76,7 @@ MODULE H5GLOBAL ! integer data types are added INTEGER, PARAMETER :: INTEGER_TYPES_LEN = 27 - INTEGER(HID_T) H5T_NATIVE_INTEGER_1, & + INTEGER(HID_T) :: H5T_NATIVE_INTEGER_1, & H5T_NATIVE_INTEGER_2, & H5T_NATIVE_INTEGER_4, & H5T_NATIVE_INTEGER_8, & @@ -111,7 +111,7 @@ MODULE H5GLOBAL ! continuation lines to 39; the F03/F08 standard limits the number ! to 255 lines. - INTEGER(HID_T) H5T_STD_U32LE, & + INTEGER(HID_T) :: H5T_STD_U32LE, & H5T_STD_U64BE, & H5T_STD_U64LE, & H5T_STRING, & @@ -235,7 +235,7 @@ MODULE H5GLOBAL ! H5F flags declaration ! INTEGER, PARAMETER :: H5F_FLAGS_LEN = 19 - INTEGER H5F_flags(H5F_FLAGS_LEN) + INTEGER :: H5F_flags(H5F_FLAGS_LEN) !DEC$if defined(BUILD_HDF5_DLL) !DEC$ATTRIBUTES DLLEXPORT :: /H5F_FLAGS/ !DEC$endif @@ -284,7 +284,7 @@ MODULE H5GLOBAL ! H5generic flags declaration ! INTEGER, PARAMETER :: H5generic_FLAGS_LEN = 9 - INTEGER H5generic_flags(H5generic_FLAGS_LEN) + INTEGER :: H5generic_flags(H5generic_FLAGS_LEN) !DEC$if defined(BUILD_HDF5_DLL) !DEC$ATTRIBUTES DLLEXPORT :: /H5generic_FLAGS/ !DEC$endif @@ -315,7 +315,7 @@ MODULE H5GLOBAL ! H5G flags declaration ! INTEGER, PARAMETER :: H5G_FLAGS_LEN = 12 - INTEGER H5G_flags(H5G_FLAGS_LEN) + INTEGER :: H5G_flags(H5G_FLAGS_LEN) !DEC$if defined(BUILD_HDF5_DLL) !DEC$ATTRIBUTES DLLEXPORT :: /H5G_FLAGS/ !DEC$endif @@ -354,8 +354,10 @@ MODULE H5GLOBAL ! H5D flags declaration ! - INTEGER, PARAMETER :: H5D_FLAGS_LEN = 27 - INTEGER H5D_flags(H5D_FLAGS_LEN) + INTEGER, PARAMETER :: H5D_FLAGS_LEN = 25 + INTEGER :: H5D_flags(H5D_FLAGS_LEN) + INTEGER, PARAMETER :: H5D_SIZE_FLAGS_LEN = 2 + INTEGER(SIZE_T) :: H5D_size_flags(H5D_SIZE_FLAGS_LEN) !DEC$if defined(BUILD_HDF5_DLL) !DEC$ATTRIBUTES DLLEXPORT :: /H5D_FLAGS/ !DEC$endif @@ -390,8 +392,8 @@ MODULE H5GLOBAL ! shortened "_CONTIGUOUS" to "_CONTIG" to satisfy the limit of 31 ! characters for variable names in Fortran. - INTEGER :: H5D_CHUNK_CACHE_NSLOTS_DFLT_F - INTEGER :: H5D_CHUNK_CACHE_NBYTES_DFLT_F + INTEGER(SIZE_T) :: H5D_CHUNK_CACHE_NSLOTS_DFLT_F + INTEGER(SIZE_T) :: H5D_CHUNK_CACHE_NBYTES_DFLT_F INTEGER :: H5D_CHUNK_CACHE_W0_DFLT_F INTEGER :: H5D_MPIO_NO_COLLECTIVE_F INTEGER :: H5D_MPIO_CHUNK_INDEPENDENT_F @@ -423,22 +425,23 @@ MODULE H5GLOBAL EQUIVALENCE(H5D_flags(18), H5D_FILL_VALUE_DEFAULT_F) EQUIVALENCE(H5D_flags(19), H5D_FILL_VALUE_USER_DEFINED_F) - EQUIVALENCE(H5D_flags(20), H5D_CHUNK_CACHE_NSLOTS_DFLT_F) - EQUIVALENCE(H5D_flags(21), H5D_CHUNK_CACHE_NBYTES_DFLT_F) - EQUIVALENCE(H5D_flags(22), H5D_CHUNK_CACHE_W0_DFLT_F) - EQUIVALENCE(H5D_flags(23), H5D_MPIO_NO_COLLECTIVE_F) - EQUIVALENCE(H5D_flags(24), H5D_MPIO_CHUNK_INDEPENDENT_F) - EQUIVALENCE(H5D_flags(25), H5D_MPIO_CHUNK_COLLECTIVE_F) - EQUIVALENCE(H5D_flags(26), H5D_MPIO_CHUNK_MIXED_F) - EQUIVALENCE(H5D_flags(27), H5D_MPIO_CONTIG_COLLECTIVE_F) + EQUIVALENCE(H5D_flags(20), H5D_CHUNK_CACHE_W0_DFLT_F) + EQUIVALENCE(H5D_flags(21), H5D_MPIO_NO_COLLECTIVE_F) + EQUIVALENCE(H5D_flags(22), H5D_MPIO_CHUNK_INDEPENDENT_F) + EQUIVALENCE(H5D_flags(23), H5D_MPIO_CHUNK_COLLECTIVE_F) + EQUIVALENCE(H5D_flags(24), H5D_MPIO_CHUNK_MIXED_F) + EQUIVALENCE(H5D_flags(25), H5D_MPIO_CONTIG_COLLECTIVE_F) + + EQUIVALENCE(H5D_size_flags(1), H5D_CHUNK_CACHE_NSLOTS_DFLT_F) + EQUIVALENCE(H5D_size_flags(2), H5D_CHUNK_CACHE_NBYTES_DFLT_F) ! ! H5E flags declaration ! INTEGER, PARAMETER :: H5E_FLAGS_LEN = 4 - INTEGER H5E_flags(H5E_FLAGS_LEN) + INTEGER :: H5E_flags(H5E_FLAGS_LEN) INTEGER, PARAMETER :: H5E_HID_FLAGS_LEN = 1 - INTEGER(HID_T) H5E_hid_flags(H5E_HID_FLAGS_LEN) + INTEGER(HID_T) :: H5E_hid_flags(H5E_HID_FLAGS_LEN) !DEC$if defined(BUILD_HDF5_DLL) !DEC$ATTRIBUTES DLLEXPORT :: /H5E_FLAGS/ !DEC$ATTRIBUTES DLLEXPORT :: /H5E_HID_FLAGS/ @@ -462,7 +465,7 @@ MODULE H5GLOBAL ! H5FD flags declaration ! INTEGER, PARAMETER :: H5FD_FLAGS_LEN = 11 - INTEGER H5FD_flags(H5FD_FLAGS_LEN) + INTEGER :: H5FD_flags(H5FD_FLAGS_LEN) !DEC$if defined(BUILD_HDF5_DLL) !DEC$ATTRIBUTES DLLEXPORT :: /H5FD_FLAGS/ !DEC$endif @@ -495,7 +498,7 @@ MODULE H5GLOBAL ! H5FD file drivers flags declaration ! INTEGER, PARAMETER :: H5FD_HID_FLAGS_LEN = 7 - INTEGER(HID_T) H5FD_hid_flags(H5FD_HID_FLAGS_LEN) + INTEGER(HID_T) :: H5FD_hid_flags(H5FD_HID_FLAGS_LEN) !DEC$if defined(BUILD_HDF5_DLL) !DEC$ATTRIBUTES DLLEXPORT :: /H5FD_HID_FLAGS/ !DEC$endif @@ -521,7 +524,7 @@ MODULE H5GLOBAL ! H5I flags declaration ! INTEGER, PARAMETER :: H5I_FLAGS_LEN = 7 - INTEGER H5I_flags(H5I_FLAGS_LEN) + INTEGER :: H5I_flags(H5I_FLAGS_LEN) !DEC$if defined(BUILD_HDF5_DLL) !DEC$ATTRIBUTES DLLEXPORT :: /H5I_FLAGS/ !DEC$endif @@ -671,10 +674,10 @@ MODULE H5GLOBAL EQUIVALENCE(H5P_flags(18), H5P_LINK_ACCESS_F) ! - ! H5P intgere flags declaration + ! H5P integers flags declaration ! INTEGER, PARAMETER :: H5P_FLAGS_INT_LEN = 2 - INTEGER H5P_flags_int(H5P_FLAGS_INT_LEN) + INTEGER :: H5P_flags_int(H5P_FLAGS_INT_LEN) !DEC$if defined(BUILD_HDF5_DLL) !DEC$ATTRIBUTES DLLEXPORT :: /H5P_FLAGS_INT/ !DEC$endif @@ -687,7 +690,7 @@ MODULE H5GLOBAL ! H5R flags declaration ! INTEGER, PARAMETER :: H5R_FLAGS_LEN = 2 - INTEGER H5R_flags(H5R_FLAGS_LEN) + INTEGER :: H5R_flags(H5R_FLAGS_LEN) !DEC$if defined(BUILD_HDF5_DLL) !DEC$ATTRIBUTES DLLEXPORT :: /H5R_FLAGS/ !DEC$endif @@ -703,7 +706,7 @@ MODULE H5GLOBAL ! H5S flags declaration ! INTEGER, PARAMETER :: H5S_FLAGS_LEN = 19 - INTEGER H5S_flags(H5S_FLAGS_LEN) + INTEGER :: H5S_flags(H5S_FLAGS_LEN) INTEGER, PARAMETER :: H5S_HSIZE_FLAGS_LEN = 1 INTEGER(HSIZE_T) H5S_hsize_flags(H5S_HSIZE_FLAGS_LEN) !DEC$if defined(BUILD_HDF5_DLL) @@ -766,7 +769,7 @@ MODULE H5GLOBAL ! H5T flags declaration ! INTEGER, PARAMETER :: H5T_FLAGS_LEN = 35 - INTEGER H5T_flags(H5T_FLAGS_LEN) + INTEGER :: H5T_flags(H5T_FLAGS_LEN) !DEC$if defined(BUILD_HDF5_DLL) !DEC$ATTRIBUTES DLLEXPORT :: /H5T_FLAGS/ !DEC$endif @@ -847,7 +850,7 @@ MODULE H5GLOBAL ! H5Z flags declaration ! INTEGER, PARAMETER :: H5Z_FLAGS_LEN = 20 - INTEGER H5Z_flags(H5Z_FLAGS_LEN) + INTEGER :: H5Z_flags(H5Z_FLAGS_LEN) !DEC$if defined(BUILD_HDF5_DLL) !DEC$ATTRIBUTES DLLEXPORT :: /H5Z_FLAGS/ !DEC$endif diff --git a/fortran/src/H5f90proto.h b/fortran/src/H5f90proto.h index 4b02b6c..2c5e9a1 100644 --- a/fortran/src/H5f90proto.h +++ b/fortran/src/H5f90proto.h @@ -1260,9 +1260,9 @@ H5_FCDLL int_f nprocess_buffer(hid_t_f *estack_id,void **buffer); H5_FCDLL int_f nh5open_c(void); H5_FCDLL int_f nh5close_c(void); -H5_FCDLL int_f nh5init_types_c(hid_t_f *types, hid_t_f * floatingtypes, hid_t_f * integertypes); -H5_FCDLL int_f nh5close_types_c(hid_t_f *types, int_f *lentypes, hid_t_f * floatingtypes, int_f * floatinglen, hid_t_f * integertypes, int_f * integerlen); -H5_FCDLL int_f nh5init_flags_c(int_f *h5d_flags, int_f *h5e_flags, hid_t_f *h5e_hid_flags, int_f *h5f_flags, +H5_FCDLL int_f nh5init_types_c(hid_t_f *types, hid_t_f *floatingtypes, hid_t_f *integertypes); +H5_FCDLL int_f nh5close_types_c(hid_t_f *types, int_f *lentypes, hid_t_f *floatingtypes, int_f *floatinglen, hid_t_f *integertypes, int_f *integerlen); +H5_FCDLL int_f nh5init_flags_c(int_f *h5d_flags, size_t_f *h5d_size_flags, int_f *h5e_flags, hid_t_f *h5e_hid_flags, int_f *h5f_flags, int_f *h5fd_flags, hid_t_f *h5fd_hid_flags, int_f *h5g_flags, int_f *h5i_flags, int_f *h5l_flags, int_f *h5o_flags, hid_t_f *h5p_flags, int_f *h5p_flags_int, int_f *h5r_flags, int_f *h5s_flags, -- cgit v0.12 From 0be0491ee4d7fd793cc3d4426aa94268d186a47a Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 20 Mar 2014 14:05:30 -0500 Subject: [svn-r24849] Update to synch with latest cmake --- config/cmake/FindMPI.cmake | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/config/cmake/FindMPI.cmake b/config/cmake/FindMPI.cmake index b16c9c3..6d12276 100644 --- a/config/cmake/FindMPI.cmake +++ b/config/cmake/FindMPI.cmake @@ -86,7 +86,7 @@ include(GetPrerequisites) # # The compilers are detected in this order: # -# 1. Try to find the most generic availble MPI compiler, as this is usually set up by +# 1. Try to find the most generic available MPI compiler, as this is usually set up by # cluster admins. e.g., if plain old mpicc is available, we'll use it and assume it's # the right compiler. # @@ -354,6 +354,20 @@ function (interrogate_mpi_compiler lang try_libs) # Extract the set of libraries to link against from the link command # line string(REGEX MATCHALL "(^| )-l([^\" ]+|\"[^\"]+\")" MPI_LIBNAMES "${MPI_LINK_CMDLINE}") + # add the compiler implicit directories because some compilers + # such as the intel compiler have libraries that show up + # in the showme list that can only be found in the implicit + # link directories of the compiler. Do this for C++ and C + # compilers if the implicit link directories are defined. + if (DEFINED CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES) + set(MPI_LINK_PATH + "${MPI_LINK_PATH};${CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES}") + endif () + + if (DEFINED CMAKE_C_IMPLICIT_LINK_DIRECTORIES) + set(MPI_LINK_PATH + "${MPI_LINK_PATH};${CMAKE_C_IMPLICIT_LINK_DIRECTORIES}") + endif () # Determine full path names for all of the libraries that one needs # to link against in an MPI program @@ -573,6 +587,11 @@ foreach (lang C CXX Fortran) try_regular_compiler(${lang} regular_compiler_worked) endif() + set(MPI_${lang}_FIND_QUIETLY ${MPI_FIND_QUIETLY}) + set(MPI_${lang}_FIND_REQUIRED ${MPI_FIND_REQUIRED}) + set(MPI_${lang}_FIND_VERSION ${MPI_FIND_VERSION}) + set(MPI_${lang}_FIND_VERSION_EXACT ${MPI_FIND_VERSION_EXACT}) + if (regular_compiler_worked) find_package_handle_standard_args(MPI_${lang} DEFAULT_MSG MPI_${lang}_COMPILER) else() -- cgit v0.12 From ba2c98d42aded8887e27f4621afbdb63eb8cedf6 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 20 Mar 2014 16:17:24 -0500 Subject: [svn-r24850] example causes modal permission dialog to popup on windows. Do not build. --- examples/CMakeLists.txt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index fe8216d..38aa241 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -44,13 +44,14 @@ foreach (example ${examples}) set_target_properties (${example} PROPERTIES FOLDER examples) endforeach (example ${examples}) -if (H5_HAVE_PARALLEL) +### Windows pops up a modal permission dialog on this test +if (H5_HAVE_PARALLEL AND NOT WIN32) add_executable (ph5example ${HDF5_EXAMPLES_SOURCE_DIR}/ph5example.c) TARGET_NAMING (ph5example ${LIB_TYPE}) TARGET_C_PROPERTIES (ph5example " " " ") target_link_libraries (ph5example ${HDF5_LIB_TARGET}) set_target_properties (ph5example PROPERTIES FOLDER examples) -endif (H5_HAVE_PARALLEL) +endif (H5_HAVE_PARALLEL AND NOT WIN32) if (BUILD_TESTING) include (CMakeTests.cmake) -- cgit v0.12 From da23edd24eba6433baeafec5ef8f4fa1c59a8307 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 20 Mar 2014 16:18:30 -0500 Subject: [svn-r24851] example causes modal permission dialog to popup on windows. build but do not execute. --- examples/CMakeLists.txt | 5 ++--- examples/CMakeTests.cmake | 5 +++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 38aa241..fe8216d 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -44,14 +44,13 @@ foreach (example ${examples}) set_target_properties (${example} PROPERTIES FOLDER examples) endforeach (example ${examples}) -### Windows pops up a modal permission dialog on this test -if (H5_HAVE_PARALLEL AND NOT WIN32) +if (H5_HAVE_PARALLEL) add_executable (ph5example ${HDF5_EXAMPLES_SOURCE_DIR}/ph5example.c) TARGET_NAMING (ph5example ${LIB_TYPE}) TARGET_C_PROPERTIES (ph5example " " " ") target_link_libraries (ph5example ${HDF5_LIB_TARGET}) set_target_properties (ph5example PROPERTIES FOLDER examples) -endif (H5_HAVE_PARALLEL AND NOT WIN32) +endif (H5_HAVE_PARALLEL) if (BUILD_TESTING) include (CMakeTests.cmake) diff --git a/examples/CMakeTests.cmake b/examples/CMakeTests.cmake index 2a20fd8..5a756c8 100644 --- a/examples/CMakeTests.cmake +++ b/examples/CMakeTests.cmake @@ -56,10 +56,11 @@ set (last_test "EXAMPLES-${example}") endforeach (example ${examples}) - if (H5_HAVE_PARALLEL) +### Windows pops up a modal permission dialog on this test + if (H5_HAVE_PARALLEL AND NOT WIN32) add_test (NAME EXAMPLES-ph5example COMMAND $) if (NOT "${last_test}" STREQUAL "") set_tests_properties (EXAMPLES-ph5example PROPERTIES DEPENDS ${last_test}) endif (NOT "${last_test}" STREQUAL "") set (last_test "EXAMPLES-ph5example") - endif (H5_HAVE_PARALLEL) + endif (H5_HAVE_PARALLEL AND NOT WIN32) -- cgit v0.12 From 6c13c99ce91038ac2759cd701522fc7016b113cc Mon Sep 17 00:00:00 2001 From: Scot Breitenfeld Date: Fri, 21 Mar 2014 09:28:03 -0500 Subject: [svn-r24855] added missing dllexport --- fortran/src/H5f90global.f90 | 1 + 1 file changed, 1 insertion(+) diff --git a/fortran/src/H5f90global.f90 b/fortran/src/H5f90global.f90 index f2bb3de..938a47c 100644 --- a/fortran/src/H5f90global.f90 +++ b/fortran/src/H5f90global.f90 @@ -360,6 +360,7 @@ MODULE H5GLOBAL INTEGER(SIZE_T) :: H5D_size_flags(H5D_SIZE_FLAGS_LEN) !DEC$if defined(BUILD_HDF5_DLL) !DEC$ATTRIBUTES DLLEXPORT :: /H5D_FLAGS/ + !DEC$ATTRIBUTES DLLEXPORT :: /H5D_SIZE_FLAGS/ !DEC$endif COMMON /H5D_FLAGS/ H5D_flags -- cgit v0.12 From 6515a1f8acce70f1ad8c9b3073d9669cf139b7fe Mon Sep 17 00:00:00 2001 From: Scot Breitenfeld Date: Fri, 21 Mar 2014 09:34:05 -0500 Subject: [svn-r24856] added missing common statement --- fortran/src/H5f90global.f90 | 1 + 1 file changed, 1 insertion(+) diff --git a/fortran/src/H5f90global.f90 b/fortran/src/H5f90global.f90 index 938a47c..da1837a 100644 --- a/fortran/src/H5f90global.f90 +++ b/fortran/src/H5f90global.f90 @@ -363,6 +363,7 @@ MODULE H5GLOBAL !DEC$ATTRIBUTES DLLEXPORT :: /H5D_SIZE_FLAGS/ !DEC$endif COMMON /H5D_FLAGS/ H5D_flags + COMMON /H5D_SIZE_FLAGS/ H5D_size_flags INTEGER :: H5D_COMPACT_F INTEGER :: H5D_CONTIGUOUS_F -- cgit v0.12 From 7a4727d80c8b4f160105cb0dea174256fee9bd1e Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Fri, 21 Mar 2014 10:19:07 -0500 Subject: [svn-r24857] --enable-threadsafe no longer requires --with-pthreads if Pthreads can be found in the standard include and library paths. Tested on: 32-bit LE linux (jam) SunOS 5.11 (emu) 64-bit Darwin 12.5 (kite) 64-bit FreeBSD 8.2 (freedom) Testing focused on making sure that Pthreads could be found on different platforms and investigating the interaction of Fortran/C++/thread-safe options. --- configure | 256 +++++++++++++++++++++++++++-------------------------------- configure.ac | 162 ++++++++++++++++++------------------- 2 files changed, 200 insertions(+), 218 deletions(-) diff --git a/configure b/configure index 6d0c172..4db05b1 100755 --- a/configure +++ b/configure @@ -911,8 +911,8 @@ with_fnord with_dmalloc with_zlib with_szlib -with_pthread enable_threadsafe +with_pthread enable_gpfs enable_debug enable_codestack @@ -1595,7 +1595,7 @@ Optional Features: Disable use of the '=Wl,-rpath' linker option --enable-production Determines how to run the compiler. --disable-largefile omit support for large files - --enable-threadsafe Enable thread safe capability + --enable-threadsafe Enable thread-safe capability --enable-gpfs Enable GPFS hints for the MPI/POSIX file driver. [default=no] --enable-debug=all Turn on debugging in all packages. One may also @@ -1669,7 +1669,8 @@ Optional Packages: [default=yes] --with-szlib=DIR Use szlib library for external szlib I/O filter [default=no] - --with-pthread=DIR Use the Pthreads library [default=no] + --with-pthread=DIR Specify alternative path to Pthreads library when + thread-safe capability is built --with-mpe=DIR Use MPE instrumentation [default=no] --with-default-vfd=driver Specify default file driver [default=sec2] @@ -26205,25 +26206,79 @@ fi rm -f confcache ## ---------------------------------------------------------------------- -## Is the Pthreads library present? It has a header file `pthread.h' and -## a library `-lpthread' and their locations might be specified with the -## `--with-pthread' command-line switch. The value is an include path -## and/or a library path. If the library path is specified then it must -## be preceded by a comma. +## Enable thread-safe version of library. It requires Pthreads support +## on POSIX systems. ## - HAVE_PTHREAD=yes +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for thread safe support" >&5 +$as_echo_n "checking for thread safe support... " >&6; } +# Check whether --enable-threadsafe was given. +if test "${enable_threadsafe+set}" = set; then : + enableval=$enable_threadsafe; THREADSAFE=$enableval +fi + + +## The --enable-threadsafe flag is not compatible with --enable-cxx. +## If the user tried to specify both flags, throw an error, unless +## they also provided the --enable-unsupported flag. +if test "X${ALLOW_UNSUPPORTED}" != "Xyes"; then + if test "X${HDF_CXX}" = "Xyes" -a "X${enable_threadsafe}" = "Xyes"; then + as_fn_error $? "--enable-cxx and --enable-threadsafe flags are incompatible. Use --enable-unsupported to override this error." "$LINENO" 5 + fi +fi + +## --enable-threadsafe is also incompatible with --enable-fortran, unless +## --enable-unsupported has been specified on the configure line. +if test "X${ALLOW_UNSUPPORTED}" != "Xyes"; then + if test "X${HDF_FORTRAN}" = "Xyes" -a "X${enable_threadsafe}" = "Xyes"; then + as_fn_error $? "--enable-fortran and --enable-threadsafe flags are incompatible. Use --enable-unsupported to override this error." "$LINENO" 5 + fi +fi + +case "X-$THREADSAFE" in + X-|X-no) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + ;; + X-yes) + THREADSAFE=yes + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + ;; + *) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: error" >&5 +$as_echo "error" >&6; } + as_fn_error $? "\'$enableval\' is not a valid threadsafe type" "$LINENO" 5 + ;; +esac + +if test "X$THREADSAFE" = "Xyes"; then + +$as_echo "#define HAVE_THREADSAFE 1" >>confdefs.h + + + ## ---------------------------------------------------------------------- + ## Is the pthreads library present? It has a header file `pthread.h' and + ## a library `-lpthread' and their locations might be specified with the + ## `--with-pthread' command-line switch. The value is an include path + ## and/or a library path. If the library path is specified then it must + ## be preceded by a comma. + ## + ## Thread-safety in HDF5 only uses Pthreads via configure, so the + ## default is "yes", though this only has an effect when + ## --enable-threadsafe is specified. + HAVE_PTHREAD=yes # Check whether --with-pthread was given. if test "${with_pthread+set}" = set; then : withval=$with_pthread; else - withval=no + withval=yes fi -case "$withval" in - yes) - for ac_header in pthread.h + case "$withval" in + yes) + for ac_header in pthread.h do : ac_fn_c_check_header_mongrel "$LINENO" "pthread.h" "ac_cv_header_pthread_h" "$ac_includes_default" if test "x$ac_cv_header_pthread_h" = xyes; then : @@ -26237,8 +26292,8 @@ fi done - if test "x$HAVE_PTHREAD" = "xyes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_self in -lpthread" >&5 + 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 : $as_echo_n "(cached) " >&6 @@ -26293,44 +26348,44 @@ else unset HAVE_PTHREAD fi - fi - ;; - no) - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread" >&5 + 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 "$as_me:${as_lineno-$LINENO}: result: suppressed" >&5 $as_echo "suppressed" >&6; } - unset HAVE_PTHREAD - ;; - *) - case "$withval" in - *,*) - pthread_inc="`echo $withval | cut -f1 -d,`" - pthread_lib="`echo $withval | cut -f2 -d, -s`" + unset HAVE_PTHREAD ;; *) - if test -n "$withval"; then - pthread_inc="$withval/include" - pthread_lib="$withval/lib" - fi - ;; - esac + case "$withval" in + *,*) + pthread_inc="`echo $withval | cut -f1 -d,`" + pthread_lib="`echo $withval | cut -f2 -d, -s`" + ;; + *) + if test -n "$withval"; then + pthread_inc="$withval/include" + pthread_lib="$withval/lib" + fi + ;; + esac - ## Trying to include -I/usr/include and -L/usr/lib is redundant and - ## can mess some compilers up. - if test "X$pthread_inc" = "X/usr/include"; then - pthread_inc="" - fi - if test "X$pthread_lib" = "X/usr/lib"; then - pthread_lib="" - fi + ## Trying to include -I/usr/include and -L/usr/lib is redundant and + ## can mess some compilers up. + if test "X$pthread_inc" = "X/usr/include"; then + pthread_inc="" + fi + if test "X$pthread_lib" = "X/usr/lib"; then + pthread_lib="" + fi - if test -n "$pthread_inc"; then - saved_CPPFLAGS="$CPPFLAGS" - saved_AM_CPPFLAGS="$AM_CPPFLAGS" - CPPFLAGS="$CPPFLAGS -I$pthread_inc" - AM_CPPFLAGS="$AM_CPPFLAGS -I$pthread_inc" - for ac_header in pthread.h + if test -n "$pthread_inc"; then + saved_CPPFLAGS="$CPPFLAGS" + saved_AM_CPPFLAGS="$AM_CPPFLAGS" + CPPFLAGS="$CPPFLAGS -I$pthread_inc" + AM_CPPFLAGS="$AM_CPPFLAGS -I$pthread_inc" + for ac_header in pthread.h do : ac_fn_c_check_header_mongrel "$LINENO" "pthread.h" "ac_cv_header_pthread_h" "$ac_includes_default" if test "x$ac_cv_header_pthread_h" = xyes; then : @@ -26344,8 +26399,8 @@ fi done - else - for ac_header in pthread.h + else + for ac_header in pthread.h do : ac_fn_c_check_header_mongrel "$LINENO" "pthread.h" "ac_cv_header_pthread_h" "$ac_includes_default" if test "x$ac_cv_header_pthread_h" = xyes; then : @@ -26359,15 +26414,15 @@ fi done - fi + fi - if test "x$HAVE_PTHREAD" = "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 + if test "x$HAVE_PTHREAD" = "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 @@ -26422,8 +26477,8 @@ else 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 @@ -26478,85 +26533,10 @@ else unset HAVE_PTHREAD fi - fi - fi - ;; -esac - -## ---------------------------------------------------------------------- -## Enable thread-safe version of library. It requires Pthreads support. -## -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for thread safe support" >&5 -$as_echo_n "checking for thread safe support... " >&6; } -# Check whether --enable-threadsafe was given. -if test "${enable_threadsafe+set}" = set; then : - enableval=$enable_threadsafe; THREADSAFE=$enableval -fi - - -## The --enable-threadsafe flag is not compatible with --enable-cxx. -## If the user tried to specify both flags, throw an error, unless -## they also provided the --enable-unsupported flag. -if test "X${ALLOW_UNSUPPORTED}" != "Xyes"; then - if test "X${HDF_CXX}" = "Xyes" -a "X${enable_threadsafe}" = "Xyes"; then - as_fn_error $? "--enable-cxx and --enable-threadsafe flags are incompatible. Use --enable-unsupported to override this error." "$LINENO" 5 - fi -fi - -## --enable-threadsafe is also incompatible with --enable-fortran, unless -## --enable-unsupported has been specified on the configure line. -if test "X${ALLOW_UNSUPPORTED}" != "Xyes"; then - if test "X${HDF_FORTRAN}" = "Xyes" -a "X${enable_threadsafe}" = "Xyes"; then - as_fn_error $? "--enable-fortran and --enable-threadsafe flags are incompatible. Use --enable-unsupported to override this error." "$LINENO" 5 - fi -fi - -case "X-$THREADSAFE" in - X-|X-no) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - ;; - X-yes) - ## Check that we can link a simple Pthread program. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#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 () -{ -pthread_self() - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; }; THREADSAFE=yes -else - as_fn_error $? "needed pthread library not available" "$LINENO" 5 -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - ;; - *) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: error" >&5 -$as_echo "error" >&6; } - as_fn_error $? "\'$enableval\' is not a valid threadsafe type" "$LINENO" 5 - ;; -esac - -if test "X$THREADSAFE" = "Xyes"; then - -$as_echo "#define HAVE_THREADSAFE 1" >>confdefs.h - + fi + fi + ;; + esac fi ## ---------------------------------------------------------------------- diff --git a/configure.ac b/configure.ac index 8121326..31381ab 100644 --- a/configure.ac +++ b/configure.ac @@ -1932,85 +1932,13 @@ AM_CONDITIONAL([BUILD_SHARED_SZIP_CONDITIONAL], [test "X$USE_FILTER_SZIP" = "Xye AC_CACHE_SAVE ## ---------------------------------------------------------------------- -## Is the Pthreads library present? It has a header file `pthread.h' and -## a library `-lpthread' and their locations might be specified with the -## `--with-pthread' command-line switch. The value is an include path -## and/or a library path. If the library path is specified then it must -## be preceded by a comma. -## -AC_SUBST([HAVE_PTHREAD]) HAVE_PTHREAD=yes -AC_ARG_WITH([pthread], - [AS_HELP_STRING([--with-pthread=DIR], - [Use the Pthreads library [default=no]])],, - [withval=no]) - -case "$withval" in - yes) - AC_CHECK_HEADERS([pthread.h],, [unset HAVE_PTHREAD]) - if test "x$HAVE_PTHREAD" = "xyes"; then - AC_CHECK_LIB([pthread], [pthread_self],, [unset HAVE_PTHREAD]) - fi - ;; - no) - AC_MSG_CHECKING([for pthread]) - AC_MSG_RESULT([suppressed]) - unset HAVE_PTHREAD - ;; - *) - case "$withval" in - *,*) - pthread_inc="`echo $withval | cut -f1 -d,`" - pthread_lib="`echo $withval | cut -f2 -d, -s`" - ;; - *) - if test -n "$withval"; then - pthread_inc="$withval/include" - pthread_lib="$withval/lib" - fi - ;; - esac - - ## Trying to include -I/usr/include and -L/usr/lib is redundant and - ## can mess some compilers up. - if test "X$pthread_inc" = "X/usr/include"; then - pthread_inc="" - fi - if test "X$pthread_lib" = "X/usr/lib"; then - pthread_lib="" - fi - - if test -n "$pthread_inc"; then - saved_CPPFLAGS="$CPPFLAGS" - 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 HAVE_PTHREAD]) - else - AC_CHECK_HEADERS([pthread.h],, [unset HAVE_PTHREAD]) - fi - - if test "x$HAVE_PTHREAD" = "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 - -## ---------------------------------------------------------------------- -## Enable thread-safe version of library. It requires Pthreads support. +## Enable thread-safe version of library. It requires Pthreads support +## on POSIX systems. ## AC_MSG_CHECKING([for thread safe support]) AC_ARG_ENABLE([threadsafe], [AS_HELP_STRING([--enable-threadsafe], - [Enable thread safe capability])], + [Enable thread-safe capability])], [THREADSAFE=$enableval]) ## The --enable-threadsafe flag is not compatible with --enable-cxx. @@ -2035,10 +1963,8 @@ case "X-$THREADSAFE" in AC_MSG_RESULT([no]) ;; X-yes) - ## Check that we can link a simple Pthread program. - AC_TRY_LINK(, [pthread_self()], - [AC_MSG_RESULT([yes]); THREADSAFE=yes], - [AC_MSG_ERROR([needed pthread library not available])]) + THREADSAFE=yes + AC_MSG_RESULT([yes]) ;; *) AC_MSG_RESULT([error]) @@ -2047,7 +1973,83 @@ case "X-$THREADSAFE" in esac if test "X$THREADSAFE" = "Xyes"; then - AC_DEFINE([HAVE_THREADSAFE], [1], [Define if we have thread safe support]) + AC_DEFINE([HAVE_THREADSAFE], [1], [Define if we have thread safe support]) + + ## ---------------------------------------------------------------------- + ## Is the pthreads library present? It has a header file `pthread.h' and + ## a library `-lpthread' and their locations might be specified with the + ## `--with-pthread' command-line switch. The value is an include path + ## and/or a library path. If the library path is specified then it must + ## be preceded by a comma. + ## + ## Thread-safety in HDF5 only uses Pthreads via configure, so the + ## default is "yes", though this only has an effect when + ## --enable-threadsafe is specified. + AC_SUBST([HAVE_PTHREAD]) HAVE_PTHREAD=yes + AC_ARG_WITH([pthread], + [AS_HELP_STRING([--with-pthread=DIR], + [Specify alternative path to Pthreads library when thread-safe capability is built])],, + [withval=yes]) + + case "$withval" in + yes) + AC_CHECK_HEADERS([pthread.h],, [unset HAVE_PTHREAD]) + if test "x$HAVE_PTHREAD" = "xyes"; then + AC_CHECK_LIB([pthread], [pthread_self],, [unset HAVE_PTHREAD]) + fi + ;; + no) + AC_MSG_CHECKING([for pthread]) + AC_MSG_RESULT([suppressed]) + unset HAVE_PTHREAD + ;; + *) + case "$withval" in + *,*) + pthread_inc="`echo $withval | cut -f1 -d,`" + pthread_lib="`echo $withval | cut -f2 -d, -s`" + ;; + *) + if test -n "$withval"; then + pthread_inc="$withval/include" + pthread_lib="$withval/lib" + fi + ;; + esac + + ## Trying to include -I/usr/include and -L/usr/lib is redundant and + ## can mess some compilers up. + if test "X$pthread_inc" = "X/usr/include"; then + pthread_inc="" + fi + if test "X$pthread_lib" = "X/usr/lib"; then + pthread_lib="" + fi + + if test -n "$pthread_inc"; then + saved_CPPFLAGS="$CPPFLAGS" + 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 HAVE_PTHREAD]) + else + AC_CHECK_HEADERS([pthread.h],, [unset HAVE_PTHREAD]) + fi + + if test "x$HAVE_PTHREAD" = "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 fi ## ---------------------------------------------------------------------- -- cgit v0.12 From c4f982abf147f1050251ddd6ec4fe9515d01f67c Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Fri, 21 Mar 2014 13:50:30 -0500 Subject: [svn-r24859] Remove unnecessary use of $(srcdir). Tested: local linux, h5committest --- fortran/src/Makefile.am | 4 ++-- fortran/src/Makefile.in | 19 +++---------------- tools/h5repack/Makefile.am | 2 +- tools/h5repack/Makefile.in | 16 +++++----------- 4 files changed, 11 insertions(+), 30 deletions(-) diff --git a/fortran/src/Makefile.am b/fortran/src/Makefile.am index 2d597c6..d56df0d 100644 --- a/fortran/src/Makefile.am +++ b/fortran/src/Makefile.am @@ -180,9 +180,9 @@ H5fortran_detect.f90: H5test_kind$(EXEEXT) # how to compile a fortran program given its sources. if FORTRAN_HAVE_SIZEOF - H5test_kind_SOURCES = $(srcdir)/H5test_kind_SIZEOF.f90 + H5test_kind_SOURCES = H5test_kind_SIZEOF.f90 else - H5test_kind_SOURCES = $(srcdir)/H5test_kind.f90 + H5test_kind_SOURCES = H5test_kind.f90 endif # Mark this directory as part of the Fortran API diff --git a/fortran/src/Makefile.in b/fortran/src/Makefile.in index 9c3ab8c..7845bb8 100644 --- a/fortran/src/Makefile.in +++ b/fortran/src/Makefile.in @@ -162,8 +162,7 @@ H5fortran_detect_LDADD = $(LDADD) H5match_types_SOURCES = H5match_types.c H5match_types_OBJECTS = H5match_types.$(OBJEXT) H5match_types_LDADD = $(LDADD) -am__H5test_kind_SOURCES_DIST = $(srcdir)/H5test_kind.f90 \ - $(srcdir)/H5test_kind_SIZEOF.f90 +am__H5test_kind_SOURCES_DIST = H5test_kind.f90 H5test_kind_SIZEOF.f90 @FORTRAN_HAVE_SIZEOF_FALSE@am_H5test_kind_OBJECTS = \ @FORTRAN_HAVE_SIZEOF_FALSE@ H5test_kind.$(OBJEXT) @FORTRAN_HAVE_SIZEOF_TRUE@am_H5test_kind_OBJECTS = \ @@ -591,11 +590,11 @@ BUILT_SOURCES = H5f90i_gen.h # Automake knows how to build fortran programs if we tell it the source # files. H5fortran_detect_SOURCES = H5fortran_detect.f90 -@FORTRAN_HAVE_SIZEOF_FALSE@H5test_kind_SOURCES = $(srcdir)/H5test_kind.f90 +@FORTRAN_HAVE_SIZEOF_FALSE@H5test_kind_SOURCES = H5test_kind.f90 # H5test_kind.f90 is included in the distribution, and Automake knows # how to compile a fortran program given its sources. -@FORTRAN_HAVE_SIZEOF_TRUE@H5test_kind_SOURCES = $(srcdir)/H5test_kind_SIZEOF.f90 +@FORTRAN_HAVE_SIZEOF_TRUE@H5test_kind_SOURCES = H5test_kind_SIZEOF.f90 # Mark this directory as part of the Fortran API FORTRAN_API = yes @@ -766,18 +765,6 @@ distclean-compile: .f90.lo: $(AM_V_FC)$(LTFCCOMPILE) -c -o $@ $(FCFLAGS_f90) $< -H5test_kind.o: $(srcdir)/H5test_kind.f90 - $(AM_V_FC)$(FC) $(AM_FCFLAGS) $(FCFLAGS) -c -o H5test_kind.o $(FCFLAGS_f90) `test -f '$(srcdir)/H5test_kind.f90' || echo '$(srcdir)/'`$(srcdir)/H5test_kind.f90 - -H5test_kind.obj: $(srcdir)/H5test_kind.f90 - $(AM_V_FC)$(FC) $(AM_FCFLAGS) $(FCFLAGS) -c -o H5test_kind.obj $(FCFLAGS_f90) `if test -f '$(srcdir)/H5test_kind.f90'; then $(CYGPATH_W) '$(srcdir)/H5test_kind.f90'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/H5test_kind.f90'; fi` - -H5test_kind_SIZEOF.o: $(srcdir)/H5test_kind_SIZEOF.f90 - $(AM_V_FC)$(FC) $(AM_FCFLAGS) $(FCFLAGS) -c -o H5test_kind_SIZEOF.o $(FCFLAGS_f90) `test -f '$(srcdir)/H5test_kind_SIZEOF.f90' || echo '$(srcdir)/'`$(srcdir)/H5test_kind_SIZEOF.f90 - -H5test_kind_SIZEOF.obj: $(srcdir)/H5test_kind_SIZEOF.f90 - $(AM_V_FC)$(FC) $(AM_FCFLAGS) $(FCFLAGS) -c -o H5test_kind_SIZEOF.obj $(FCFLAGS_f90) `if test -f '$(srcdir)/H5test_kind_SIZEOF.f90'; then $(CYGPATH_W) '$(srcdir)/H5test_kind_SIZEOF.f90'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/H5test_kind_SIZEOF.f90'; fi` - mostlyclean-libtool: -rm -f *.lo diff --git a/tools/h5repack/Makefile.am b/tools/h5repack/Makefile.am index eae296d..f02bb45 100644 --- a/tools/h5repack/Makefile.am +++ b/tools/h5repack/Makefile.am @@ -64,7 +64,7 @@ h5repack.sh.chkexe_: h5repacktst.chkexe_ if HAVE_SHARED_CONDITIONAL # Build it as shared library if configure is enabled for shared library. lib_LTLIBRARIES=libdynlibadd.la - libdynlibadd_la_SOURCES=$(top_srcdir)/test/dynlib1.c + libdynlibadd_la_SOURCES=dynlib_rpk.c install-exec-hook: $(RM) $(DESTDIR)$(libdir)/*dynlib* diff --git a/tools/h5repack/Makefile.in b/tools/h5repack/Makefile.in index 9f0e6f1..f9b3018 100644 --- a/tools/h5repack/Makefile.in +++ b/tools/h5repack/Makefile.in @@ -117,8 +117,9 @@ am__uninstall_files_from_dir = { \ am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" LTLIBRARIES = $(lib_LTLIBRARIES) libdynlibadd_la_LIBADD = -am__libdynlibadd_la_SOURCES_DIST = $(top_srcdir)/test/dynlib1.c -@HAVE_SHARED_CONDITIONAL_TRUE@am_libdynlibadd_la_OBJECTS = dynlib1.lo +am__libdynlibadd_la_SOURCES_DIST = dynlib_rpk.c +@HAVE_SHARED_CONDITIONAL_TRUE@am_libdynlibadd_la_OBJECTS = \ +@HAVE_SHARED_CONDITIONAL_TRUE@ dynlib_rpk.lo libdynlibadd_la_OBJECTS = $(am_libdynlibadd_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) @@ -508,7 +509,7 @@ h5repack_SOURCES = $(COMMON_SOURCES) h5repack_main.c h5repacktst_SOURCES = $(COMMON_SOURCES) h5repacktst.c testh5repack_detect_szip_SOURCES = testh5repack_detect_szip.c @HAVE_SHARED_CONDITIONAL_TRUE@lib_LTLIBRARIES = libdynlibadd.la -@HAVE_SHARED_CONDITIONAL_TRUE@libdynlibadd_la_SOURCES = $(top_srcdir)/test/dynlib1.c +@HAVE_SHARED_CONDITIONAL_TRUE@libdynlibadd_la_SOURCES = dynlib_rpk.c DISTCLEANFILES = h5repack.sh h5repack_plugin.sh # Automake needs to be taught how to build lib, progs, and tests targets. @@ -685,7 +686,7 @@ mostlyclean-compile: distclean-compile: -rm -f *.tab.c -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dynlib1.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dynlib_rpk.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/h5repack.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/h5repack_copy.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/h5repack_filters.Po@am__quote@ @@ -718,13 +719,6 @@ distclean-compile: @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< -dynlib1.lo: $(top_srcdir)/test/dynlib1.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT dynlib1.lo -MD -MP -MF $(DEPDIR)/dynlib1.Tpo -c -o dynlib1.lo `test -f '$(top_srcdir)/test/dynlib1.c' || echo '$(srcdir)/'`$(top_srcdir)/test/dynlib1.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/dynlib1.Tpo $(DEPDIR)/dynlib1.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(top_srcdir)/test/dynlib1.c' object='dynlib1.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o dynlib1.lo `test -f '$(top_srcdir)/test/dynlib1.c' || echo '$(srcdir)/'`$(top_srcdir)/test/dynlib1.c - mostlyclean-libtool: -rm -f *.lo -- cgit v0.12 From 2e4302818ab260604ffa26e90dab159cf28079d4 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Fri, 21 Mar 2014 18:02:24 -0500 Subject: [svn-r24864] Description: Remove all traces of MPI-POSIX VFD and GPFS detection/code. Remove remaining traces of stream VFD. Remove testpar/t_posix_compliant test (it's not actually verifying anything). Clean up H5D__mpio_opt_possible() further. Moved environment variable that disables MPI collective operations into MPI-IO VFD (instead of it being in src/H5S.c). A few other small code cleanups. Tested on: Mac OSX/64 10.9.2 (amazon) w/parallel & serial --- MANIFEST | 4 - Makefile.in | 1 - bin/checkposix | 5 +- c++/Makefile.in | 1 - c++/examples/Makefile.in | 1 - c++/src/H5FaccProp.h | 8 - c++/src/Makefile.in | 1 - c++/test/Makefile.in | 1 - config/cmake/ConfigureChecks.cmake | 29 - config/cmake/H5pubconf.h.in | 6 - config/cmake/HDF5Tests.c | 11 - config/cmake/libhdf5.settings.cmake.in | 1 - configure | 79 +- configure.ac | 34 +- examples/Makefile.in | 1 - fortran/Makefile.in | 1 - fortran/examples/Makefile.in | 1 - fortran/src/H5FDmpiof.c | 81 -- fortran/src/H5FDmpioff.f90 | 71 +- fortran/src/H5f90proto.h | 4 - fortran/src/Makefile.in | 1 - fortran/src/hdf5_fortrandll.def.in | 2 - fortran/test/Makefile.in | 1 - fortran/testpar/Makefile.in | 1 - hl/Makefile.in | 1 - hl/c++/Makefile.in | 1 - hl/c++/examples/Makefile.in | 1 - hl/c++/src/Makefile.in | 1 - hl/c++/test/Makefile.in | 1 - hl/examples/Makefile.in | 1 - hl/fortran/Makefile.in | 1 - hl/fortran/examples/Makefile.in | 1 - hl/fortran/src/Makefile.in | 1 - hl/fortran/test/Makefile.in | 1 - hl/src/Makefile.in | 1 - hl/test/Makefile.in | 1 - hl/tools/Makefile.in | 1 - hl/tools/gif2h5/Makefile.in | 1 - perform/Makefile.in | 1 - perform/benchpar.c | 20 +- perform/perf_meta.c | 59 +- perform/pio_engine.c | 800 ++++------------- perform/pio_perf.c | 44 +- perform/pio_perf.h | 1 - perform/sio_engine.c | 461 ---------- perform/sio_perf.c | 15 - perform/sio_perf.h | 1 - release_docs/INSTALL_CMake.txt | 1 - src/CMakeLists.txt | 2 - src/H5Dmpio.c | 49 +- src/H5FDmpi.h | 1 - src/H5FDmpio.c | 43 +- src/H5FDmpio.h | 8 +- src/H5FDmpiposix.c | 1488 -------------------------------- src/H5FDmpiposix.h | 51 -- src/H5FDprivate.h | 3 - src/H5Ppublic.h | 7 +- src/H5S.c | 13 - src/H5Sprivate.h | 4 - src/H5config.h.in | 6 - src/H5trace.c | 77 +- src/Makefile.am | 7 +- src/Makefile.in | 80 +- src/hdf5.lnt | 1 - src/libhdf5.settings.in | 1 - test/Makefile.in | 1 - test/h5test.c | 6 +- test/links.c | 3 +- testpar/CMakeTests.cmake | 4 - testpar/Makefile.am | 7 +- testpar/Makefile.in | 39 +- testpar/t_coll_chunk.c | 5 +- testpar/t_dset.c | 123 +-- testpar/t_file.c | 3 +- testpar/t_mdset.c | 34 +- testpar/t_ph5basic.c | 114 --- testpar/t_posix_compliant.c | 927 -------------------- testpar/t_shapesame.c | 23 +- testpar/t_span_tree.c | 14 +- testpar/testph5.sh.in | 77 -- testpar/testphdf5.c | 22 +- testpar/testphdf5.h | 16 +- tools/Makefile.in | 1 - tools/h5copy/Makefile.in | 1 - tools/h5diff/Makefile.in | 1 - tools/h5dump/Makefile.in | 1 - tools/h5dump/h5dump_ddl.c | 33 +- tools/h5import/Makefile.in | 1 - tools/h5jam/Makefile.in | 1 - tools/h5ls/Makefile.in | 1 - tools/h5repack/Makefile.in | 1 - tools/h5stat/Makefile.in | 1 - tools/lib/Makefile.in | 1 - tools/lib/h5tools.c | 64 +- tools/misc/Makefile.in | 1 - vms/src/h5pubconf.h | 6 - vms/src/make.com | 2 +- 97 files changed, 444 insertions(+), 4694 deletions(-) delete mode 100644 src/H5FDmpiposix.c delete mode 100644 src/H5FDmpiposix.h delete mode 100644 testpar/t_posix_compliant.c delete mode 100644 testpar/testph5.sh.in diff --git a/MANIFEST b/MANIFEST index c25f5cf..355d72b 100644 --- a/MANIFEST +++ b/MANIFEST @@ -694,8 +694,6 @@ ./src/H5FDmpi.h ./src/H5FDmpio.c ./src/H5FDmpio.h -./src/H5FDmpiposix.c -./src/H5FDmpiposix.h ./src/H5FDmulti.c ./src/H5FDmulti.h ./src/H5FDpkg.h @@ -1157,14 +1155,12 @@ ./testpar/t_ph5basic.c ./testpar/t_pflush1.c ./testpar/t_pflush2.c -./testpar/t_posix_compliant.c ./testpar/t_prop.c ./testpar/t_shapesame.c ./testpar/t_span_tree.c ./testpar/testpar.h ./testpar/testphdf5.c ./testpar/testphdf5.h -./testpar/testph5.sh.in ./tools/COPYING ./tools/Makefile.am diff --git a/Makefile.in b/Makefile.in index 0c6890b..0378c52 100644 --- a/Makefile.in +++ b/Makefile.in @@ -248,7 +248,6 @@ FC_VERSION = @FC_VERSION@ FGREP = @FGREP@ FILTERS = @FILTERS@ FSEARCH_DIRS = @FSEARCH_DIRS@ -GPFS = @GPFS@ GREP = @GREP@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ diff --git a/bin/checkposix b/bin/checkposix index e3617e5..69d43b4 100755 --- a/bin/checkposix +++ b/bin/checkposix @@ -83,7 +83,7 @@ if(<>) { next if $name =~ /^(ABS|ADDR_OVERFLOW|ALL_MEMBERS|BOUND|CONSTR|DETECT_[I|F|M]|DOWN)$/; next if $name =~ /^(MIN3?|MAX3?|NELMTS|POWER_OF_TWO|REGION_OVERFLOW)$/; next if $name =~ /^(UNIQUE_MEMBERS)$/; - next if $name =~ /^(IS_H5FD_MPIO|IS_H5FD_MPIPOSIX)$/; + next if $name =~ /^(IS_H5FD_MPIO)$/; next if $name =~ /^addr_defined$/; # These functions/macros are exempt. @@ -93,9 +93,6 @@ if(<>) { next if $name =~ /^(_get_osfhandle|GetFileInformationByHandle|SetFilePointer|GetLastError|SetEndOfFile)$/; next if $name =~ /^(FindNextFile|FindClose|_tzset|Wgettimeofday|GetSystemTimeAsFileTime|Wgetlogin|GetUserName)$/; - # These are GPFS function calls. Ignore them. - next if $name =~ /^gpfs_fcntl$/; - # These are MPI function calls. Ignore them. next if $name =~ /^(MPI_|MPE_)/; diff --git a/c++/Makefile.in b/c++/Makefile.in index 492970b..80bffc2 100644 --- a/c++/Makefile.in +++ b/c++/Makefile.in @@ -213,7 +213,6 @@ FC_VERSION = @FC_VERSION@ FGREP = @FGREP@ FILTERS = @FILTERS@ FSEARCH_DIRS = @FSEARCH_DIRS@ -GPFS = @GPFS@ GREP = @GREP@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ diff --git a/c++/examples/Makefile.in b/c++/examples/Makefile.in index dee7c11..72e333a 100644 --- a/c++/examples/Makefile.in +++ b/c++/examples/Makefile.in @@ -180,7 +180,6 @@ FC_VERSION = @FC_VERSION@ FGREP = @FGREP@ FILTERS = @FILTERS@ FSEARCH_DIRS = @FSEARCH_DIRS@ -GPFS = @GPFS@ GREP = @GREP@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ diff --git a/c++/src/H5FaccProp.h b/c++/src/H5FaccProp.h index 5b56f6e..5dd108f 100644 --- a/c++/src/H5FaccProp.h +++ b/c++/src/H5FaccProp.h @@ -67,14 +67,6 @@ class H5_DLLCPP FileAccPropList : public PropList { void setSplit( FileAccPropList& meta_plist, FileAccPropList& raw_plist, const H5std_string& meta_ext, const H5std_string& raw_ext ) const; -#ifdef H5_HAVE_STREAM // for Stream Virtual File Driver - // Modifies this file access property list to use the Stream driver. - void setStream(H5FD_stream_fapl_t &fapl) const; - - // Retrieves the streaming I/O driver settings - H5FD_stream_fapl_t getStream() const; -#endif - // Sets the maximum size of the data sieve buffer. void setSieveBufSize(size_t bufsize) const; diff --git a/c++/src/Makefile.in b/c++/src/Makefile.in index dfc3167..6399253 100644 --- a/c++/src/Makefile.in +++ b/c++/src/Makefile.in @@ -256,7 +256,6 @@ FC_VERSION = @FC_VERSION@ FGREP = @FGREP@ FILTERS = @FILTERS@ FSEARCH_DIRS = @FSEARCH_DIRS@ -GPFS = @GPFS@ GREP = @GREP@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ diff --git a/c++/test/Makefile.in b/c++/test/Makefile.in index 0aad590..5e88a09 100644 --- a/c++/test/Makefile.in +++ b/c++/test/Makefile.in @@ -216,7 +216,6 @@ FC_VERSION = @FC_VERSION@ FGREP = @FGREP@ FILTERS = @FILTERS@ FSEARCH_DIRS = @FSEARCH_DIRS@ -GPFS = @GPFS@ GREP = @GREP@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ diff --git a/config/cmake/ConfigureChecks.cmake b/config/cmake/ConfigureChecks.cmake index 03a7975..9816755 100644 --- a/config/cmake/ConfigureChecks.cmake +++ b/config/cmake/ConfigureChecks.cmake @@ -144,13 +144,6 @@ if (WIN32) endif (NOT UNIX AND NOT CYGWIN AND NOT MINGW) endif (WIN32) -#if (WIN32) -# set (DEFAULT_STREAM_VFD OFF) -#else (WIN32) -# set (DEFAULT_STREAM_VFD ON) -#endif (WIN32) -#option (HDF5_STREAM_VFD "Compile Stream Virtual File Driver support" ${DEFAULT_STREAM_VFD}) - # TODO -------------------------------------------------------------------------- # Should the Default Virtual File Driver be compiled? # This is hard-coded now but option should added to match configure @@ -817,16 +810,6 @@ if (NOT WINDOWS) endif (NOT WINDOWS) #----------------------------------------------------------------------------- -# Check for the Stream VFD driver -#----------------------------------------------------------------------------- -if (HDF5_STREAM_VFD) - CHECK_INCLUDE_FILE_CONCAT ("netdb.h" H5_HAVE_NETDB_H) - CHECK_INCLUDE_FILE_CONCAT ("netinet/tcp.h" H5_HAVE_NETINET_TCP_H) - CHECK_INCLUDE_FILE_CONCAT ("sys/filio.h" H5_HAVE_SYS_FILIO_H) - set (H5_HAVE_STREAM 1) -endif (HDF5_STREAM_VFD) - -#----------------------------------------------------------------------------- # Check if InitOnceExecuteOnce is available #----------------------------------------------------------------------------- if (WINDOWS) @@ -892,18 +875,6 @@ if (WINDOWS) endif (WINDOWS) #----------------------------------------------------------------------------- -# Option to see if GPFS is available on this filesystem --enable-gpfs -#----------------------------------------------------------------------------- -option (HDF5_ENABLE_GPFS "Enable GPFS hints for the MPI/POSIX file driver" OFF) -if (HDF5_ENABLE_GPFS) - CHECK_INCLUDE_FILE_CONCAT ("gpfs.h" HAVE_GPFS) - if (HAVE_GPFS) - HDF5_FUNCTION_TEST (HAVE_GPFS) - endif (HAVE_GPFS) -endif (HDF5_ENABLE_GPFS) -MARK_AS_ADVANCED (HDF5_ENABLE_GPFS) - -#----------------------------------------------------------------------------- # Determine how 'inline' is used #----------------------------------------------------------------------------- set (HDF5_EXTRA_TEST_DEFINITIONS INLINE_TEST_INLINE) diff --git a/config/cmake/H5pubconf.h.in b/config/cmake/H5pubconf.h.in index f3e1d75..25a0e37 100644 --- a/config/cmake/H5pubconf.h.in +++ b/config/cmake/H5pubconf.h.in @@ -217,12 +217,6 @@ /* Define to 1 if you have the `get_fpc_csr' function. */ #cmakedefine H5_HAVE_GET_FPC_CSR @H5_HAVE_GET_FPC_CSR@ -/* Define if we have GPFS support */ -#cmakedefine H5_HAVE_GPFS @H5_HAVE_GPFS@ - -/* Define to 1 if you have the header file. */ -#cmakedefine H5_HAVE_GPFS_H @H5_HAVE_GPFS_H@ - /* Define if library will contain instrumentation to detect correct optimization operation */ #cmakedefine H5_HAVE_INSTRUMENTED_LIBRARY @H5_HAVE_INSTRUMENTED_LIBRARY@ diff --git a/config/cmake/HDF5Tests.c b/config/cmake/HDF5Tests.c index 21206e0..355c06f 100644 --- a/config/cmake/HDF5Tests.c +++ b/config/cmake/HDF5Tests.c @@ -437,17 +437,6 @@ main () #endif -#ifdef HAVE_GPFS - -#include -int main () -{ - int fd = 0; - gpfs_fcntl(fd, (void *)0); -} - -#endif /* HAVE_GPFS */ - #ifdef HAVE_IOEO #include diff --git a/config/cmake/libhdf5.settings.cmake.in b/config/cmake/libhdf5.settings.cmake.in index 3970a9f..418a6cf 100644 --- a/config/cmake/libhdf5.settings.cmake.in +++ b/config/cmake/libhdf5.settings.cmake.in @@ -63,7 +63,6 @@ Features: Clear file buffers before write: @HDF5_Enable_Clear_File_Buffers@ Using memory checker: @HDF5_ENABLE_USING_MEMCHECKER@ Function Stack Tracing: @HDF5_ENABLE_CODESTACK@ - GPFS: @HDF5_ENABLE_GPFS@ Strict File Format Checks: @HDF5_STRICT_FORMAT_CHECKS@ Optimization Instrumentation: @HDF5_Enable_Instrument@ Large File Support (LFS): @HDF5_ENABLE_LARGE_FILE@ diff --git a/configure b/configure index 4db05b1..3d751d0 100755 --- a/configure +++ b/configure @@ -788,7 +788,6 @@ HAVE_DMALLOC CODESTACK INSTRUMENT LARGEFILE -GPFS HDF5_HL CXX HDF_CXX @@ -913,7 +912,6 @@ with_zlib with_szlib enable_threadsafe with_pthread -enable_gpfs enable_debug enable_codestack enable_metadata_trace_file @@ -1596,8 +1594,6 @@ Optional Features: --enable-production Determines how to run the compiler. --disable-largefile omit support for large files --enable-threadsafe Enable thread-safe capability - --enable-gpfs Enable GPFS hints for the MPI/POSIX file driver. - [default=no] --enable-debug=all Turn on debugging in all packages. One may also specify a comma-separated list of package names without the leading H5 or the word no. The default @@ -3975,7 +3971,6 @@ $as_echo "done" >&6; } ## HDF_CXX: whether C++ is enabled. Default no. ## CXX: C++ compiler. ## HDF5_HL: whether high-level library is enabled. Default is yes. -## GPFS: whether gpfs is enabled. Default no. ## LARGEFILE: whether largefile support is enabled. Default yes. ## INSTRUMENT: whether INSTRUMENT is enabled. No default set here. ## CODESTACK: whether CODESTACK is enabled. Default no. @@ -3997,7 +3992,6 @@ $as_echo "done" >&6; } HDF_CXX=no HDF_CXX=no HDF5_HL=yes - GPFS=no LARGEFILE=yes CODESTACK=no @@ -27683,74 +27677,6 @@ $as_echo "no" >&6; } fi ## ---------------------------------------------------------------------- -## Checking to see if GPFS is available on this filesystem -## -# Check whether --enable-gpfs was given. -if test "${enable_gpfs+set}" = set; then : - enableval=$enable_gpfs; -else - enableval=no -fi - - -case "X-$enableval" in - X-yes) - for ac_header in gpfs.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "gpfs.h" "ac_cv_header_gpfs_h" "$ac_includes_default" -if test "x$ac_cv_header_gpfs_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_GPFS_H 1 -_ACEOF - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GPFS support" >&5 -$as_echo_n "checking for GPFS support... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#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 () -{ -int fd = 0; gpfs_fcntl(fd, (void *)0); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - -$as_echo "#define HAVE_GPFS 1" >>confdefs.h - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - LIBS="$LIBS -lgpfs" - GPFS="yes" -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - GPFS="no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi - -done - - ;; - X-no|*) - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gpfs" >&5 -$as_echo_n "checking for gpfs... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: suppressed" >&5 -$as_echo "suppressed" >&6; } - ;; -esac - -## ---------------------------------------------------------------------- ## Turn on debugging by setting compiler flags ## This must come after the enable-production since it depends on production. ## @@ -31244,7 +31170,7 @@ PARALLEL_MAKE="" FORTRAN_PARALLEL_MAKE="" if test -n "$TESTPARALLEL"; then - PARALLEL_MAKE="$TESTPARALLEL/Makefile $TESTPARALLEL/testph5.sh" + PARALLEL_MAKE="$TESTPARALLEL/Makefile" if test "X$HDF_FORTRAN" = "Xyes"; then FORTRAN_PARALLEL_MAKE=fortran/$TESTPARALLEL/Makefile @@ -33192,7 +33118,7 @@ else 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/h5repack/h5repack_plugin.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 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/h5repack/h5repack_plugin.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 @@ -34468,7 +34394,6 @@ do "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" ;; diff --git a/configure.ac b/configure.ac index 31381ab..87baba5 100644 --- a/configure.ac +++ b/configure.ac @@ -160,7 +160,6 @@ AC_MSG_RESULT([done]) ## HDF_CXX: whether C++ is enabled. Default no. ## CXX: C++ compiler. ## HDF5_HL: whether high-level library is enabled. Default is yes. -## GPFS: whether gpfs is enabled. Default no. ## LARGEFILE: whether largefile support is enabled. Default yes. ## INSTRUMENT: whether INSTRUMENT is enabled. No default set here. ## CODESTACK: whether CODESTACK is enabled. Default no. @@ -182,7 +181,6 @@ AC_SUBST([FC2003]) HDF_FORTRAN2003=no AC_SUBST([HDF_CXX]) HDF_CXX=no AC_SUBST([CXX]) HDF_CXX=no AC_SUBST([HDF5_HL]) HDF5_HL=yes -AC_SUBST([GPFS]) GPFS=no AC_SUBST([LARGEFILE]) LARGEFILE=yes AC_SUBST([INSTRUMENT]) AC_SUBST([CODESTACK]) CODESTACK=no @@ -2392,35 +2390,6 @@ else fi ## ---------------------------------------------------------------------- -## Checking to see if GPFS is available on this filesystem -## -AC_ARG_ENABLE([gpfs], - [AS_HELP_STRING([--enable-gpfs], - [Enable GPFS hints for the MPI/POSIX file - driver. [default=no]])],, - [enableval=no]) - -case "X-$enableval" in - X-yes) - AC_CHECK_HEADERS([gpfs.h], - [AC_MSG_CHECKING([for GPFS support]) - AC_TRY_COMPILE([#include ], - [int fd = 0; gpfs_fcntl(fd, (void *)0);], - [AC_DEFINE([HAVE_GPFS], [1], - [Define if we have GPFS support]) - AC_MSG_RESULT([yes]) - LIBS="$LIBS -lgpfs" - GPFS="yes"], - [AC_MSG_RESULT([no]) - GPFS="no"])]) - ;; - X-no|*) - AC_MSG_CHECKING([for gpfs]) - AC_MSG_RESULT([suppressed]) - ;; -esac - -## ---------------------------------------------------------------------- ## Turn on debugging by setting compiler flags ## This must come after the enable-production since it depends on production. ## @@ -4456,7 +4425,7 @@ PARALLEL_MAKE="" FORTRAN_PARALLEL_MAKE="" if test -n "$TESTPARALLEL"; then - PARALLEL_MAKE="$TESTPARALLEL/Makefile $TESTPARALLEL/testph5.sh" + PARALLEL_MAKE="$TESTPARALLEL/Makefile" if test "X$HDF_FORTRAN" = "Xyes"; then FORTRAN_PARALLEL_MAKE=fortran/$TESTPARALLEL/Makefile @@ -4532,7 +4501,6 @@ AC_CONFIG_FILES([src/libhdf5.settings test/testlinks_env.sh test/test_plugin.sh testpar/Makefile - testpar/testph5.sh perform/Makefile tools/Makefile tools/h5dump/Makefile diff --git a/examples/Makefile.in b/examples/Makefile.in index a564dd4..394b996 100644 --- a/examples/Makefile.in +++ b/examples/Makefile.in @@ -180,7 +180,6 @@ FC_VERSION = @FC_VERSION@ FGREP = @FGREP@ FILTERS = @FILTERS@ FSEARCH_DIRS = @FSEARCH_DIRS@ -GPFS = @GPFS@ GREP = @GREP@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ diff --git a/fortran/Makefile.in b/fortran/Makefile.in index 4196fe2..ca646ce 100644 --- a/fortran/Makefile.in +++ b/fortran/Makefile.in @@ -217,7 +217,6 @@ FC_VERSION = @FC_VERSION@ FGREP = @FGREP@ FILTERS = @FILTERS@ FSEARCH_DIRS = @FSEARCH_DIRS@ -GPFS = @GPFS@ GREP = @GREP@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ diff --git a/fortran/examples/Makefile.in b/fortran/examples/Makefile.in index 1cc0825..53dc2b6 100644 --- a/fortran/examples/Makefile.in +++ b/fortran/examples/Makefile.in @@ -188,7 +188,6 @@ FC_VERSION = @FC_VERSION@ FGREP = @FGREP@ FILTERS = @FILTERS@ FSEARCH_DIRS = @FSEARCH_DIRS@ -GPFS = @GPFS@ GREP = @GREP@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ diff --git a/fortran/src/H5FDmpiof.c b/fortran/src/H5FDmpiof.c index 993b5ac..bbdb170 100644 --- a/fortran/src/H5FDmpiof.c +++ b/fortran/src/H5FDmpiof.c @@ -220,87 +220,6 @@ nh5pget_dxpl_mpio_c(hid_t_f *prp_id, int_f* data_xfer_mode) return ret_value; } -/****if* H5FDmpiof/h5pset_fapl_mpiposix_c - * NAME - * h5pset_fapl_mpiposix_c - * PURPOSE - * Call H5Pset_fapl_mpiposix to set mode for parallel I/O and the user - * supplied communicator - * INPUTS - * prp_id - property list identifier - * comm - MPI communicator - * flag - flag to use GPFS hints - * RETURNS - * 0 on success, -1 on failure - * AUTHOR - * Elena Pourmal - * Tuesday, May 6, 2003 - * HISTORY - * - * SOURCE -*/ -int_f -nh5pset_fapl_mpiposix_c(hid_t_f *prp_id, int_f* comm, int_f* flag) -/******/ -{ - int ret_value = -1; - hid_t c_prp_id; - herr_t ret; - hbool_t c_flag; - MPI_Comm c_comm; - c_comm = MPI_Comm_f2c(*comm); - c_flag = (hbool_t)*flag; - /* - * Call H5Pset_fapl_mpiposix function. - */ - c_prp_id = (hid_t) *prp_id; - ret = H5Pset_fapl_mpiposix(c_prp_id, c_comm, c_flag); - if (ret < 0) return ret_value; - ret_value = 0; - return ret_value; -} - -/****if* H5FDmpiof/h5pget_fapl_mpiposix_c - * NAME - * h5pget_fapl_mpiposix_c - * PURPOSE - * Call H5Pget_fapl_mpiposix to retrieve communicator and info object - * INPUTS - * prp_id - property list identifier - * OUTPUTS - * comm - buffer to return MPI communicator - * flag - flag to use GPFS hints - * RETURNS - * 0 on success, -1 on failure - * AUTHOR - * Elena Pourmal - * Tuesday, May 6, 2003 - * HISTORY - * - * SOURCE -*/ -int_f -nh5pget_fapl_mpiposix_c(hid_t_f *prp_id, int_f* comm, int_f* flag) -/******/ -{ - int ret_value = -1; - hid_t c_prp_id; - herr_t ret; - hbool_t c_flag; - MPI_Comm c_comm; - - /* - * Call H5Pget_fapl_mpiposix function. - */ - c_prp_id = (hid_t) *prp_id; - ret = H5Pget_fapl_mpiposix(c_prp_id, &c_comm, &c_flag); - if (ret < 0) return ret_value; - *comm = (int_f) MPI_Comm_c2f(c_comm); - *flag = (int_f) c_flag; - ret_value = 0; - return ret_value; -} - /****if* H5Pf/h5pget_mpio_actual_io_mode_c * NAME * h5pget_mpio_actual_io_mode_c diff --git a/fortran/src/H5FDmpioff.f90 b/fortran/src/H5FDmpioff.f90 index 5c81bc8..50a77d9 100644 --- a/fortran/src/H5FDmpioff.f90 +++ b/fortran/src/H5FDmpioff.f90 @@ -131,6 +131,7 @@ CONTAINS INTEGER, EXTERNAL :: h5pset_dxpl_mpio_c hdferr = h5pset_dxpl_mpio_c(prp_id, data_xfer_mode) END SUBROUTINE h5pset_dxpl_mpio_f + !****s* H5FDMPIO/h5pget_dxpl_mpio_f ! ! NAME @@ -164,76 +165,6 @@ CONTAINS hdferr = h5pget_dxpl_mpio_c(prp_id, data_xfer_mode) END SUBROUTINE h5pget_dxpl_mpio_f -!****s* H5FDMPIO/h5pset_fapl_mpiposix_f -! -! NAME -! h5pset_fapl_mpiposix_f -! -! PURPOSE -! Stores MPI IO communicator information to the file -! access property list. -! -! INPUTS -! prp_id - File access property list identifier. -! comm - MPI-2 communicator. -! use_gpfs - Logical flag to use the GPFS hints. -! OUTPUTS -! hdferr - Returns 0 if successful and -1 if fails. -! -! AUTHOR -! Elena Pourmal -! May 6, 2003 -! -! Fortran90 Interface: - SUBROUTINE h5pset_fapl_mpiposix_f(prp_id, comm, use_gpfs, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id - INTEGER, INTENT(IN) :: comm - LOGICAL, INTENT(IN) :: use_gpfs - INTEGER, INTENT(OUT) :: hdferr -!***** - INTEGER :: flag - INTEGER, EXTERNAL :: h5pset_fapl_mpiposix_c - flag = 0 - IF(use_gpfs) flag = 1 - hdferr = h5pset_fapl_mpiposix_c(prp_id, comm, flag) - END SUBROUTINE h5pset_fapl_mpiposix_f - -!****s* H5FDMPIO/h5pget_fapl_mpiposix_f -! -! NAME -! h5pget_fapl_mpiposix_f -! -! PURPOSE -! Returns MPI communicator information. -! -! INPUTS -! prp_id - File access property list identifier. -! OUTPUTS -! comm - MPI-2 communicator. -! use_gpfs - Flag to use GPFS hints. -! hdferr - Returns 0 if successful and -1 if fails. -! AUTHOR -! Elena Pourmal -! May 6, 2003 -! -! Fortran90 Interface: - SUBROUTINE h5pget_fapl_mpiposix_f(prp_id, comm, use_gpfs, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id - INTEGER, INTENT(OUT) :: comm - LOGICAL, INTENT(OUT) :: use_gpfs - INTEGER, INTENT(OUT) :: hdferr -!***** - INTEGER :: flag - - INTEGER, EXTERNAL :: h5pget_fapl_mpiposix_c - hdferr = h5pget_fapl_mpiposix_c(prp_id, comm, flag) - use_gpfs = .FALSE. - IF (flag .EQ. 1) use_gpfs = .TRUE. - END SUBROUTINE h5pget_fapl_mpiposix_f - - !****s* H5P/h5pget_mpio_actual_io_mode_f ! NAME ! h5pget_mpio_actual_io_mode_f diff --git a/fortran/src/H5f90proto.h b/fortran/src/H5f90proto.h index 2c5e9a1..ae848bf 100644 --- a/fortran/src/H5f90proto.h +++ b/fortran/src/H5f90proto.h @@ -914,8 +914,6 @@ H5_FCDLL int_f nh5oget_comment_by_name_c (hid_t_f *loc_id, _fcd name, size_t_f * #define nh5pset_btree_ratios_c H5_FC_FUNC_(h5pset_btree_ratios_c, H5PSET_BTREE_RATIOS_C) #define nh5pset_fapl_mpio_c H5_FC_FUNC_(h5pset_fapl_mpio_c, H5PSET_FAPL_MPIO_C) #define nh5pget_fapl_mpio_c H5_FC_FUNC_(h5pget_fapl_mpio_c, H5PGET_FAPL_MPIO_C) -#define nh5pset_fapl_mpiposix_c H5_FC_FUNC_(h5pset_fapl_mpiposix_c, H5PSET_FAPL_MPIPOSIX_C) -#define nh5pget_fapl_mpiposix_c H5_FC_FUNC_(h5pget_fapl_mpiposix_c, H5PGET_FAPL_MPIPOSIX_C) #define nh5pset_dxpl_mpio_c H5_FC_FUNC_(h5pset_dxpl_mpio_c, H5PSET_DXPL_MPIO_C) #define nh5pget_dxpl_mpio_c H5_FC_FUNC_(h5pget_dxpl_mpio_c, H5PGET_DXPL_MPIO_C) #define nh5pget_fclose_degree_c H5_FC_FUNC_(h5pget_fclose_degree_c, H5PGET_FCLOSE_DEGREE_C) @@ -1072,8 +1070,6 @@ H5_FCDLL int_f nh5pget_btree_ratios_c(hid_t_f *prp_id, real_f* left, real_f* mid 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); H5_FCDLL int_f nh5pset_fapl_mpio_c(hid_t_f *prp_id, int_f* comm, int_f* info); -H5_FCDLL int_f nh5pget_fapl_mpiposix_c(hid_t_f *prp_id, int_f* comm, int_f* flag); -H5_FCDLL int_f nh5pset_fapl_mpiposix_c(hid_t_f *prp_id, int_f* comm, int_f* flag); H5_FCDLL int_f nh5pget_dxpl_mpio_c(hid_t_f *prp_id, int_f* data_xfer_mode); H5_FCDLL int_f nh5pset_dxpl_mpio_c(hid_t_f *prp_id, int_f* data_xfer_mode); H5_FCDLL int_f nh5pset_fclose_degree_c(hid_t_f *fapl, int_f *degree); diff --git a/fortran/src/Makefile.in b/fortran/src/Makefile.in index 7845bb8..c566ee2 100644 --- a/fortran/src/Makefile.in +++ b/fortran/src/Makefile.in @@ -306,7 +306,6 @@ FC_VERSION = @FC_VERSION@ FGREP = @FGREP@ FILTERS = @FILTERS@ FSEARCH_DIRS = @FSEARCH_DIRS@ -GPFS = @GPFS@ GREP = @GREP@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ diff --git a/fortran/src/hdf5_fortrandll.def.in b/fortran/src/hdf5_fortrandll.def.in index 62030f0..c549d34 100644 --- a/fortran/src/hdf5_fortrandll.def.in +++ b/fortran/src/hdf5_fortrandll.def.in @@ -567,6 +567,4 @@ H5Z_mp_H5ZGET_FILTER_INFO_F @H5_NOPAREXP@H5FDMPIO_mp_H5PGET_FAPL_MPIO_F @H5_NOPAREXP@H5FDMPIO_mp_H5PSET_DXPL_MPIO_F @H5_NOPAREXP@H5FDMPIO_mp_H5PGET_DXPL_MPIO_F -@H5_NOPAREXP@H5FDMPIO_mp_H5PSET_FAPL_MPIPOSIX_F -@H5_NOPAREXP@H5FDMPIO_mp_H5PGET_FAPL_MPIPOSIX_F @H5_NOPAREXP@H5FDMPIO_mp_H5PGET_MPIO_ACTUAL_IO_MODE_F diff --git a/fortran/test/Makefile.in b/fortran/test/Makefile.in index 9f8b6d0..9db74e8 100644 --- a/fortran/test/Makefile.in +++ b/fortran/test/Makefile.in @@ -291,7 +291,6 @@ FC_VERSION = @FC_VERSION@ FGREP = @FGREP@ FILTERS = @FILTERS@ FSEARCH_DIRS = @FSEARCH_DIRS@ -GPFS = @GPFS@ GREP = @GREP@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ diff --git a/fortran/testpar/Makefile.in b/fortran/testpar/Makefile.in index 1903529..60f24b9 100644 --- a/fortran/testpar/Makefile.in +++ b/fortran/testpar/Makefile.in @@ -215,7 +215,6 @@ FC_VERSION = @FC_VERSION@ FGREP = @FGREP@ FILTERS = @FILTERS@ FSEARCH_DIRS = @FSEARCH_DIRS@ -GPFS = @GPFS@ GREP = @GREP@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ diff --git a/hl/Makefile.in b/hl/Makefile.in index 6ca962b..8b00085 100644 --- a/hl/Makefile.in +++ b/hl/Makefile.in @@ -217,7 +217,6 @@ FC_VERSION = @FC_VERSION@ FGREP = @FGREP@ FILTERS = @FILTERS@ FSEARCH_DIRS = @FSEARCH_DIRS@ -GPFS = @GPFS@ GREP = @GREP@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ diff --git a/hl/c++/Makefile.in b/hl/c++/Makefile.in index 210fcc5..a63388c 100644 --- a/hl/c++/Makefile.in +++ b/hl/c++/Makefile.in @@ -213,7 +213,6 @@ FC_VERSION = @FC_VERSION@ FGREP = @FGREP@ FILTERS = @FILTERS@ FSEARCH_DIRS = @FSEARCH_DIRS@ -GPFS = @GPFS@ GREP = @GREP@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ diff --git a/hl/c++/examples/Makefile.in b/hl/c++/examples/Makefile.in index 1e66687..a3be41c 100644 --- a/hl/c++/examples/Makefile.in +++ b/hl/c++/examples/Makefile.in @@ -179,7 +179,6 @@ FC_VERSION = @FC_VERSION@ FGREP = @FGREP@ FILTERS = @FILTERS@ FSEARCH_DIRS = @FSEARCH_DIRS@ -GPFS = @GPFS@ GREP = @GREP@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ diff --git a/hl/c++/src/Makefile.in b/hl/c++/src/Makefile.in index c13f26a..06e6dea 100644 --- a/hl/c++/src/Makefile.in +++ b/hl/c++/src/Makefile.in @@ -250,7 +250,6 @@ FC_VERSION = @FC_VERSION@ FGREP = @FGREP@ FILTERS = @FILTERS@ FSEARCH_DIRS = @FSEARCH_DIRS@ -GPFS = @GPFS@ GREP = @GREP@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ diff --git a/hl/c++/test/Makefile.in b/hl/c++/test/Makefile.in index c873d32..de668da 100644 --- a/hl/c++/test/Makefile.in +++ b/hl/c++/test/Makefile.in @@ -212,7 +212,6 @@ FC_VERSION = @FC_VERSION@ FGREP = @FGREP@ FILTERS = @FILTERS@ FSEARCH_DIRS = @FSEARCH_DIRS@ -GPFS = @GPFS@ GREP = @GREP@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ diff --git a/hl/examples/Makefile.in b/hl/examples/Makefile.in index ee4d885..8ff7579 100644 --- a/hl/examples/Makefile.in +++ b/hl/examples/Makefile.in @@ -179,7 +179,6 @@ FC_VERSION = @FC_VERSION@ FGREP = @FGREP@ FILTERS = @FILTERS@ FSEARCH_DIRS = @FSEARCH_DIRS@ -GPFS = @GPFS@ GREP = @GREP@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ diff --git a/hl/fortran/Makefile.in b/hl/fortran/Makefile.in index 8cb74cd..be754a2 100644 --- a/hl/fortran/Makefile.in +++ b/hl/fortran/Makefile.in @@ -217,7 +217,6 @@ FC_VERSION = @FC_VERSION@ FGREP = @FGREP@ FILTERS = @FILTERS@ FSEARCH_DIRS = @FSEARCH_DIRS@ -GPFS = @GPFS@ GREP = @GREP@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ diff --git a/hl/fortran/examples/Makefile.in b/hl/fortran/examples/Makefile.in index 8413c2d..ea66cab 100644 --- a/hl/fortran/examples/Makefile.in +++ b/hl/fortran/examples/Makefile.in @@ -180,7 +180,6 @@ FC_VERSION = @FC_VERSION@ FGREP = @FGREP@ FILTERS = @FILTERS@ FSEARCH_DIRS = @FSEARCH_DIRS@ -GPFS = @GPFS@ GREP = @GREP@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ diff --git a/hl/fortran/src/Makefile.in b/hl/fortran/src/Makefile.in index 37aac6b..3a9d569 100644 --- a/hl/fortran/src/Makefile.in +++ b/hl/fortran/src/Makefile.in @@ -263,7 +263,6 @@ FC_VERSION = @FC_VERSION@ FGREP = @FGREP@ FILTERS = @FILTERS@ FSEARCH_DIRS = @FSEARCH_DIRS@ -GPFS = @GPFS@ GREP = @GREP@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ diff --git a/hl/fortran/test/Makefile.in b/hl/fortran/test/Makefile.in index 024cb0f..899ec62 100644 --- a/hl/fortran/test/Makefile.in +++ b/hl/fortran/test/Makefile.in @@ -226,7 +226,6 @@ FC_VERSION = @FC_VERSION@ FGREP = @FGREP@ FILTERS = @FILTERS@ FSEARCH_DIRS = @FSEARCH_DIRS@ -GPFS = @GPFS@ GREP = @GREP@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ diff --git a/hl/src/Makefile.in b/hl/src/Makefile.in index f9f73c8..733049c 100644 --- a/hl/src/Makefile.in +++ b/hl/src/Makefile.in @@ -246,7 +246,6 @@ FC_VERSION = @FC_VERSION@ FGREP = @FGREP@ FILTERS = @FILTERS@ FSEARCH_DIRS = @FSEARCH_DIRS@ -GPFS = @GPFS@ GREP = @GREP@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ diff --git a/hl/test/Makefile.in b/hl/test/Makefile.in index 5639844..588d867 100644 --- a/hl/test/Makefile.in +++ b/hl/test/Makefile.in @@ -253,7 +253,6 @@ FC_VERSION = @FC_VERSION@ FGREP = @FGREP@ FILTERS = @FILTERS@ FSEARCH_DIRS = @FSEARCH_DIRS@ -GPFS = @GPFS@ GREP = @GREP@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ diff --git a/hl/tools/Makefile.in b/hl/tools/Makefile.in index 7d887f5..98095bb 100644 --- a/hl/tools/Makefile.in +++ b/hl/tools/Makefile.in @@ -214,7 +214,6 @@ FC_VERSION = @FC_VERSION@ FGREP = @FGREP@ FILTERS = @FILTERS@ FSEARCH_DIRS = @FSEARCH_DIRS@ -GPFS = @GPFS@ GREP = @GREP@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ diff --git a/hl/tools/gif2h5/Makefile.in b/hl/tools/gif2h5/Makefile.in index e587f5f..54754ba 100644 --- a/hl/tools/gif2h5/Makefile.in +++ b/hl/tools/gif2h5/Makefile.in @@ -228,7 +228,6 @@ FC_VERSION = @FC_VERSION@ FGREP = @FGREP@ FILTERS = @FILTERS@ FSEARCH_DIRS = @FSEARCH_DIRS@ -GPFS = @GPFS@ GREP = @GREP@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ diff --git a/perform/Makefile.in b/perform/Makefile.in index 091f4f1..fe9d184 100644 --- a/perform/Makefile.in +++ b/perform/Makefile.in @@ -254,7 +254,6 @@ FC_VERSION = @FC_VERSION@ FGREP = @FGREP@ FILTERS = @FILTERS@ FSEARCH_DIRS = @FSEARCH_DIRS@ -GPFS = @GPFS@ GREP = @GREP@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ diff --git a/perform/benchpar.c b/perform/benchpar.c index 24146e4..b75006a 100644 --- a/perform/benchpar.c +++ b/perform/benchpar.c @@ -44,7 +44,6 @@ /* defines for type of VFL driver to use */ #define FACC_DEFAULT 0 #define FACC_MPIO 1 -#define FACC_MPIPOSIX 2 /* Defines for computing performance information */ #define ONE_KB 1024 @@ -78,7 +77,7 @@ char mpi_name[MPI_MAX_PROCESSOR_NAME]; static void usage(void) { printf("usage: benchpar [-d <# of dims>] [-s ] [-f ] [-h]\n"); - printf(" [-S ] [-p] [-I] [-c] [-i <# of iterations>\n"); + printf(" [-S ] [-I] [-c] [-i <# of iterations>\n"); printf(" -c - Use chunked storage for dataset with 1-1 exact\n"); printf(" mapping of chunks to hyperslabs\n"); printf(" Default: off (i.e. contiguous storage)\n"); @@ -91,8 +90,6 @@ static void usage(void) printf(" Default: 3\n"); printf(" -I - Use independent parallel I/O\n"); printf(" Default: use collective parallel I/O\n"); - printf(" -p - Use MPI-posix VFL driver\n"); - printf(" Default: use MPI-I/O VFL driver\n"); printf(" -s - Set the size of each of the dataset's dimensions\n"); printf(" Default: 1024\n"); printf(" -S - Set the dimension to slice the dataset along\n"); @@ -114,7 +111,6 @@ static hid_t create_fcpl(void) static hid_t create_fapl(MPI_Comm comm, MPI_Info info, int acc_type ) { hid_t fapl; /* File access property list */ - hbool_t use_gpfs = FALSE; /* Use GPFS hints */ herr_t ret; /* Generic return value */ fapl = H5Pcreate (H5P_FILE_ACCESS); @@ -122,13 +118,7 @@ static hid_t create_fapl(MPI_Comm comm, MPI_Info info, int acc_type ) /* set parallel access with communicator, using MPI-I/O driver */ if (acc_type == FACC_MPIO) { - ret = H5Pset_fapl_mpio(fapl, comm, info); - assert(ret>=0); - } /* end if */ - - /* set parallel access with communicator, using MPI-posix driver */ - if (acc_type == FACC_MPIPOSIX) { - ret = H5Pset_fapl_mpiposix(fapl, comm, use_gpfs); + ret = H5Pset_fapl_mpio(fapl, comm, info); assert(ret>=0); } /* end if */ @@ -279,10 +269,6 @@ int main(int argc, char *argv[]) par_mode=H5FD_MPIO_INDEPENDENT; break; - case 'p': /* Use MPI-posix VFL driver */ - vfl_type=FACC_MPIPOSIX; - break; - case 's': /* Change dimension size */ /* Get new dimension size */ dim_size=atoi(argv[curr_arg]); @@ -469,7 +455,7 @@ int main(int argc, char *argv[]) /* Only print information from one node */ if(mpi_rank==0) { /* Print information about test */ - printf("File driver used: %s\n",vfl_type==FACC_MPIO ? "MPI-I/O" : "MPI-posix"); + printf("File driver used: %s\n",vfl_type==FACC_MPIO ? "MPI-I/O" : "Unknown"); printf("Type of parallel access: %s\n",par_mode==H5FD_MPIO_COLLECTIVE ? "Collective" : "Independent"); printf("Type of dataset storage: %s\n",use_chunks ? "Chunked" : "Contiguous"); printf("Number of processes: %d\n",mpi_size); diff --git a/perform/perf_meta.c b/perform/perf_meta.c index 8c3b06f..b52871e 100644 --- a/perform/perf_meta.c +++ b/perform/perf_meta.c @@ -29,7 +29,6 @@ /* File_Access_type bits */ #define FACC_DEFAULT 0x0 /* serial as default */ #define FACC_MPIO 0x1 /* MPIO */ -#define FACC_MPIPOSIX 0x8 /* MPIPOSIX */ /* Which test to run */ int RUN_TEST = 0x0; /* all tests as default */ @@ -129,11 +128,7 @@ parse_options(int argc, char **argv) } break; - case 'p': /* Use the MPI-POSIX driver access */ - facc_type = FACC_MPIPOSIX; - break; - - case 'm': /* Use the MPI-POSIX driver access */ + case 'm': /* Use the MPI-IO driver */ facc_type = FACC_MPIO; break; @@ -171,7 +166,7 @@ parse_options(int argc, char **argv) /* Check valid values */ #ifndef H5_HAVE_PARALLEL - if(facc_type == FACC_MPIO || facc_type == FACC_MPIPOSIX) + if(facc_type == FACC_MPIO) { nerrors++; return(1); @@ -215,19 +210,15 @@ parse_options(int argc, char **argv) static void usage(void) { - printf("Usage: perf_meta [-h] [-m] [-p] [-d]" + printf("Usage: perf_meta [-h] [-m] [-d]" "[-a]\n" "\t[-n] [-f