From d0babe88dab4306e3c9101c3c6282ee9082b8082 Mon Sep 17 00:00:00 2001 From: Elena Pourmal Date: Tue, 6 Oct 2015 12:03:41 -0500 Subject: [svn-r27968] Modified version number to 1.9.233 before creating a tar ball for DLS. --- README.txt | 2 +- c++/src/cpp_doc_config | 2 +- config/lt_vers.am | 2 +- release_docs/RELEASE.txt | 2 +- src/H5public.h | 4 ++-- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.txt b/README.txt index 7333a85..291e8a6 100644 --- a/README.txt +++ b/README.txt @@ -1,4 +1,4 @@ -HDF5 version 1.9.232 currently under development +HDF5 version 1.9.233 released on 2015-10-06 Please refer to the release_docs/INSTALL file for installation instructions. ------------------------------------------------------------------------------ diff --git a/c++/src/cpp_doc_config b/c++/src/cpp_doc_config index c020531..7060fd2 100644 --- a/c++/src/cpp_doc_config +++ b/c++/src/cpp_doc_config @@ -38,7 +38,7 @@ PROJECT_NAME = "HDF5 C++ API" # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = "1.9.232 currently under development" +PROJECT_NUMBER = "1.9.233 currently under development" # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a diff --git a/config/lt_vers.am b/config/lt_vers.am index 36de8fe..401bcb9 100644 --- a/config/lt_vers.am +++ b/config/lt_vers.am @@ -19,7 +19,7 @@ # After making changes, run bin/reconfigure to update other configure related # files like Makefile.in. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 222 +LT_VERS_REVISION = 223 LT_VERS_AGE = 0 ## If the API changes *at all*, increment LT_VERS_INTERFACE and diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 9be3053..cc0fe84 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -1,4 +1,4 @@ -HDF5 version 1.9.232 currently under development +HDF5 version 1.9.233 released on 2015-10-06 ================================================================================ diff --git a/src/H5public.h b/src/H5public.h index 1c617d1..f7f70cf 100644 --- a/src/H5public.h +++ b/src/H5public.h @@ -94,10 +94,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 232 /* For tweaks, bug-fixes, or development */ +#define H5_VERS_RELEASE 233 /* 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.232" /* Full version string */ +#define H5_VERS_INFO "HDF5 library version: 1.9.233" /* Full version string */ #define H5check() H5check_version(H5_VERS_MAJOR,H5_VERS_MINOR, \ H5_VERS_RELEASE) -- cgit v0.12 From 086904a50da1dc5f71f73eda1d17a65b4df34bb8 Mon Sep 17 00:00:00 2001 From: Elena Pourmal Date: Tue, 6 Oct 2015 12:15:59 -0500 Subject: [svn-r27969] Added autogen.sh to the list of the distributed files. --- MANIFEST | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MANIFEST b/MANIFEST index 60c6359..78c0857 100644 --- a/MANIFEST +++ b/MANIFEST @@ -32,7 +32,7 @@ ./README.txt ./BRANCH.txt ./acsite.m4 -./autogen.sh _DO_NOT_DISTRIBUTE_ +./autogen.sh ./configure.ac ./bin/COPYING -- cgit v0.12 From 6f04c0f89da2c1f9824ef0b6b6d861b3cb4093d8 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 6 Oct 2015 12:36:38 -0500 Subject: [svn-r27970] eliminate duplicate option --- CMakeLists.txt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1035142..d25c5d7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -196,7 +196,7 @@ endif (NOT HDF5_INSTALL_INCLUDE_DIR) if (NOT HDF5_INSTALL_DATA_DIR) if (NOT WIN32) if (APPLE) - option (HDF5_BUILD_FRAMEWORKS "Create a Mac OSX Framework" OFF) + option (HDF5_BUILD_FRAMEWORKS "TRUE to build as frameworks libraries, FALSE to build according to BUILD_SHARED_LIBS" TRUE) if (HDF5_BUILD_FRAMEWORKS) set (HDF5_INSTALL_EXTRA_DIR ../SharedSupport) else (HDF5_BUILD_FRAMEWORKS) @@ -321,7 +321,6 @@ set (CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE ON) #----------------------------------------------------------------------------- # Mac OS X Options #----------------------------------------------------------------------------- -option (HDF5_BUILD_FRAMEWORKS "TRUE to build as frameworks libraries, FALSE to build according to BUILD_SHARED_LIBS" TRUE) if (HDF5_BUILD_FRAMEWORKS AND NOT BUILD_SHARED_LIBS) set (BUILD_SHARED_LIBS ON CACHE BOOL "Build Shared Libraries") endif (HDF5_BUILD_FRAMEWORKS AND NOT BUILD_SHARED_LIBS) -- cgit v0.12 From 16e7b241d0f3fb9ffe2b143eadca4e47a8919d92 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 6 Oct 2015 12:38:04 -0500 Subject: [svn-r27971] eliminate duplicate option --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d25c5d7..ef91cfb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -193,10 +193,10 @@ endif (NOT HDF5_INSTALL_LIB_DIR) if (NOT HDF5_INSTALL_INCLUDE_DIR) set (HDF5_INSTALL_INCLUDE_DIR include) endif (NOT HDF5_INSTALL_INCLUDE_DIR) +option (HDF5_BUILD_FRAMEWORKS "TRUE to build as frameworks libraries, FALSE to build according to BUILD_SHARED_LIBS" TRUE) if (NOT HDF5_INSTALL_DATA_DIR) if (NOT WIN32) if (APPLE) - option (HDF5_BUILD_FRAMEWORKS "TRUE to build as frameworks libraries, FALSE to build according to BUILD_SHARED_LIBS" TRUE) if (HDF5_BUILD_FRAMEWORKS) set (HDF5_INSTALL_EXTRA_DIR ../SharedSupport) else (HDF5_BUILD_FRAMEWORKS) -- cgit v0.12 From 58db7babe40a10916a1c3b7667eaaeb5d48c2fb8 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 6 Oct 2015 13:48:50 -0500 Subject: [svn-r27973] Update to new style usage --- config/cmake/scripts/CTestScript.cmake | 35 +++---- config/cmake/scripts/HDF518config.cmake | 145 +++++++++++++++++++-------- release_docs/INSTALL_CMake.txt | 168 +++++++++++++++++++++++--------- release_docs/USING_HDF5_CMake.txt | 82 +++++++++++----- 4 files changed, 301 insertions(+), 129 deletions(-) diff --git a/config/cmake/scripts/CTestScript.cmake b/config/cmake/scripts/CTestScript.cmake index 0cd686a..9d0953e 100755 --- a/config/cmake/scripts/CTestScript.cmake +++ b/config/cmake/scripts/CTestScript.cmake @@ -4,9 +4,9 @@ cmake_minimum_required(VERSION 3.1.0 FATAL_ERROR) # For any comments please contact cdashhelp@hdfgroup.org # ######################################################## -# ----------------------------------------------------------- +# ----------------------------------------------------------- # -- Get environment -# ----------------------------------------------------------- +# ----------------------------------------------------------- if(NOT SITE_OS_NAME) ## machine name not provided - attempt to discover with uname ## -- set hostname @@ -18,7 +18,7 @@ if(NOT SITE_OS_NAME) macro(getuname name flag) exec_program("${UNAME}" ARGS "${flag}" OUTPUT_VARIABLE "${name}") endmacro(getuname) - + getuname(osname -s) getuname(osrel -r) getuname(cpu -m) @@ -45,7 +45,7 @@ else(NOT SITE_OS_NAME) endif() set(BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DSITE:STRING=${CTEST_SITE} -DBUILDNAME:STRING=${CTEST_BUILD_NAME}") endif(NOT SITE_OS_NAME) - + #----------------------------------------------------------------------------- # MAC machines need special option #----------------------------------------------------------------------------- @@ -72,14 +72,15 @@ if(CTEST_USE_TAR_SOURCE) message(STATUS "extracting... [${CMAKE_EXECUTABLE_NAME} -E tar -xvf ${CTEST_USE_TAR_SOURCE}.tar]") execute_process(COMMAND ${CMAKE_EXECUTABLE_NAME} -E tar -xvf ${CTEST_DASHBOARD_ROOT}/${CTEST_USE_TAR_SOURCE}.tar RESULT_VARIABLE rv) endif() - + if(NOT rv EQUAL 0) message(STATUS "extracting... [error-(${rv}) clean up]") file(REMOVE_RECURSE "${CTEST_SOURCE_DIRECTORY}") message(FATAL_ERROR "error: extract of ${CTEST_USE_TAR_SOURCE} failed") endif() - + file(RENAME ${CTEST_DASHBOARD_ROOT}/${CTEST_USE_TAR_SOURCE} ${CTEST_SOURCE_DIRECTORY}) + set(LOCAL_SKIP_UPDATE "TRUE") else(CTEST_USE_TAR_SOURCE) if(LOCAL_UPDATE) if(CTEST_USE_GIT_SOURCE) @@ -120,7 +121,7 @@ else(CTEST_USE_TAR_SOURCE) if(NOT EXISTS "${CTEST_SOURCE_DIRECTORY}") set(NEED_REPOSITORY_CHECKOUT 1) endif() - + if(NOT CTEST_REPO_VERSION) set(CTEST_REPO_VERSION "HEAD") endif() @@ -135,7 +136,7 @@ else(CTEST_USE_TAR_SOURCE) endif(CTEST_USE_GIT_SOURCE) endif(LOCAL_UPDATE) endif(CTEST_USE_TAR_SOURCE) - + #----------------------------------------------------------------------------- ## Clear the build directory ## -------------------------- @@ -155,7 +156,7 @@ if(NOT N EQUAL 0) endif() set(ctest_test_args ${ctest_test_args} PARALLEL_LEVEL ${N}) endif() - + #----------------------------------------------------------------------------- # Send the main script as a note. list(APPEND CTEST_NOTES_FILES @@ -163,7 +164,7 @@ list(APPEND CTEST_NOTES_FILES "${CMAKE_CURRENT_LIST_FILE}" "${CTEST_SOURCE_DIRECTORY}/config/cmake/cacheinit.cmake" ) - + #----------------------------------------------------------------------------- # Check for required variables. # -------------------------- @@ -176,7 +177,7 @@ foreach(req message(FATAL_ERROR "The containing script must set ${req}") endif() endforeach(req) - + #----------------------------------------------------------------------------- # Initialize the CTEST commands #------------------------------ @@ -193,11 +194,11 @@ else() "${CTEST_CMAKE_COMMAND} -C \"${CTEST_SOURCE_DIRECTORY}/config/cmake/cacheinit.cmake\" -DCMAKE_BUILD_TYPE:STRING=${CTEST_BUILD_CONFIGURATION} ${BUILD_OPTIONS} \"-G${CTEST_CMAKE_GENERATOR}\" \"${CTEST_SOURCE_DIRECTORY}\"" ) endif() - + #----------------------------------------------------------------------------- ## -- set output to english set($ENV{LC_MESSAGES} "en_EN") - + # Print summary information. foreach(v CTEST_SITE @@ -215,7 +216,7 @@ foreach(v set(vars "${vars} ${v}=[${${v}}]\n") endforeach(v) message(STATUS "Dashboard script configuration:\n${vars}\n") - + #----------------------------------------------------------------------------- #----------------------------------------------------------------------------- ## NORMAL process @@ -235,12 +236,12 @@ message(STATUS "Dashboard script configuration:\n${vars}\n") if(LOCAL_SUBMIT) ctest_submit (PARTS Update Configure Notes) endif() - + ctest_build (BUILD "${CTEST_BINARY_DIRECTORY}" APPEND) if(LOCAL_SUBMIT) ctest_submit (PARTS Build) endif() - + if(NOT LOCAL_SKIP_TEST) if(NOT LOCAL_MEMCHECK_TEST) ctest_test (BUILD "${CTEST_BINARY_DIRECTORY}" APPEND ${ctest_test_args} RETURN_VALUE res) @@ -263,7 +264,7 @@ message(STATUS "Dashboard script configuration:\n${vars}\n") endif() endif() endif(NOT LOCAL_SKIP_TEST) - + if(NOT LOCAL_MEMCHECK_TEST AND NOT LOCAL_NO_PACKAGE) ##----------------------------------------------- ## Package the product diff --git a/config/cmake/scripts/HDF518config.cmake b/config/cmake/scripts/HDF518config.cmake index aee5389..897bcbe 100755 --- a/config/cmake/scripts/HDF518config.cmake +++ b/config/cmake/scripts/HDF518config.cmake @@ -1,16 +1,89 @@ -########################################################################## -### For Windows ${CTEST_SCRIPT_ARG} is one of ### -### [64-VS2013, 32-VS2013, 64-VS2012, 32-VS2012] ### -### ctest -S HDF518config.cmake,32-VS2012 -C Release -VV -O hdf518.log ### -### ### -### Other platforms do not use ${CTEST_SCRIPT_ARG} ### -### ctest -S HDF518config.cmake -C Release -VV -O hdf518.log ### -########################################################################## +########################################################################################## +### ${CTEST_SCRIPT_ARG} is of the form OPTION=VALUE ### +### BUILD_GENERATOR required [Unix, VS2013, VS201364, VS2012, VS201264] ### +### ctest -S HDF518config.cmake,BUILD_GENERATOR=VS201264 -C Release -V -O hdf518.log ### +########################################################################################## cmake_minimum_required(VERSION 3.1.0 FATAL_ERROR) -set(CTEST_SOURCE_VERSION 1.8.15) -set(CTEST_SOURCE_VERSEXT "") -set(CTEST_SOURCE_NAME hdf5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}) +############################################################################ +# Usage: +# ctest -S HDF518config.cmake,OPTION=VALUE -C Release -VV -O test.log +# where valid options for OPTION are: +# BUILD_GENERATOR - The cmake build generator: +# Unix * Unix Makefiles +# VS2013 * Visual Studio 12 2013 +# VS201364 * Visual Studio 12 2013 Win64 +# VS2012 * Visual Studio 11 2012 +# VS201264 * Visual Studio 11 2012 Win64 +# +# INSTALLDIR - root folder where hdf5 is installed +# CTEST_BUILD_CONFIGURATION - Release, Debug, etc +# CTEST_SOURCE_NAME - source folder +# STATICLIBRARIES - Build/use static libraries +# NO_MAC_FORTRAN - Yes to be SHARED on a Mac +############################################################################## + +set(CTEST_SOURCE_VERSION 1.9) + +############################################################################## +# handle input parameters to script. +#BUILD_GENERATOR - which CMake generator to use, required +#INSTALLDIR - HDF5-1.9 root folder +#CTEST_BUILD_CONFIGURATION - Release, Debug, RelWithDebInfo +#CTEST_SOURCE_NAME - name of source folder; HDF5-1.9 +#STATICLIBRARIES - Default is YES +#NO_MAC_FORTRAN - set to TRUE to allow shared libs on a Mac +if(DEFINED CTEST_SCRIPT_ARG) + # transform ctest script arguments of the form + # script.ctest,var1=value1,var2=value2 + # to variables with the respective names set to the respective values + string(REPLACE "," ";" script_args "${CTEST_SCRIPT_ARG}") + foreach(current_var ${script_args}) + if ("${current_var}" MATCHES "^([^=]+)=(.+)$") + set("${CMAKE_MATCH_1}" "${CMAKE_MATCH_2}") + endif() + endforeach() +endif() + +# build generator must be defined +if(NOT DEFINED BUILD_GENERATOR) + message(FATAL_ERROR "BUILD_GENERATOR must be defined - Unix, VS2013, VS201364, VS2012, or VS201264") +else() + if(${BUILD_GENERATOR} STREQUAL "Unix") + set(CMAKE_GENERATOR "Unix Makefiles") + elseif(${BUILD_GENERATOR} STREQUAL "VS2013") + set(CMAKE_GENERATOR "Visual Studio 12 2013") + elseif(${BUILD_GENERATOR} STREQUAL "VS201364") + set(CMAKE_GENERATOR "Visual Studio 12 2013 Win64") + elseif(${BUILD_GENERATOR} STREQUAL "VS2012") + set(CMAKE_GENERATOR "Visual Studio 11 2012") + elseif(${BUILD_GENERATOR} STREQUAL "VS201264") + set(CMAKE_GENERATOR "Visual Studio 11 2012 Win64") + else() + message(FATAL_ERROR "Invalid BUILD_GENERATOR must be - Unix, VS2013, VS201364, VS2012, or VS201264") + endif() +endif() + +if(NOT DEFINED INSTALLDIR) + if(WIN32) + set(INSTALLDIR "/usr/local/myhdf5") + else() + set(INSTALLDIR "C:\\Program\ Files\\myhdf5") + endif() +endif() +if(NOT DEFINED CTEST_BUILD_CONFIGURATION) + set(CTEST_BUILD_CONFIGURATION "Release") +endif() +if(NOT DEFINED CTEST_SOURCE_NAME) + set(CTEST_SOURCE_NAME "hdf5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}") +endif() +if(NOT DEFINED STATICLIBRARIES) + set(STATICLIBRARIES "YES") +endif() +if(NOT DEFINED FORTRANLIBRARIES) + set(FORTRANLIBRARIES "NO") +endif() + set(CTEST_BINARY_NAME "build") set(CTEST_DASHBOARD_ROOT "${CTEST_SCRIPT_DIRECTORY}") if(WIN32) @@ -22,40 +95,30 @@ else() endif() ################################################################### -### Following Line is one of [Release, RelWithDebInfo, Debug] ##### -set(CTEST_BUILD_CONFIGURATION "Release") -################################################################### - -################################################################### ######### Following describes compiler ############ if(WIN32) set(SITE_OS_NAME "Windows") set(SITE_OS_VERSION "WIN7") - if(${CTEST_SCRIPT_ARG} STREQUAL "64-VS2013") - set(CTEST_CMAKE_GENERATOR "Visual Studio 12 2013 Win64") + if(${BUILD_GENERATOR} STREQUAL "VS201364") set(SITE_OS_BITS "64") set(SITE_COMPILER_NAME "vs2013") set(SITE_COMPILER_VERSION "12") - elseif(${CTEST_SCRIPT_ARG} STREQUAL "32-VS2013") - set(CTEST_CMAKE_GENERATOR "Visual Studio 12 2013") + elseif(${BUILD_GENERATOR} STREQUAL "VS2013") set(SITE_OS_BITS "32") set(SITE_COMPILER_NAME "vs2013") set(SITE_COMPILER_VERSION "12") - elseif(${CTEST_SCRIPT_ARG} STREQUAL "64-VS2012") - set(CTEST_CMAKE_GENERATOR "Visual Studio 11 2012 Win64") + elseif(${BUILD_GENERATOR} STREQUAL "VS201264") set(SITE_OS_BITS "64") set(SITE_COMPILER_NAME "vs2012") set(SITE_COMPILER_VERSION "11") - elseif(${CTEST_SCRIPT_ARG} STREQUAL "32-VS2012") - set(CTEST_CMAKE_GENERATOR "Visual Studio 11 2012") + elseif(${BUILD_GENERATOR} STREQUAL "VS2012") set(SITE_OS_BITS "32") set(SITE_COMPILER_NAME "vs2012") set(SITE_COMPILER_VERSION "11") endif() ## Set the following to unique id your computer ## - set(CTEST_SITE "WIN7${CTEST_SCRIPT_ARG}.XXXX") + set(CTEST_SITE "WIN7${BUILD_GENERATOR}.XXXX") else() - set(CTEST_CMAKE_GENERATOR "Unix Makefiles") ## Set the following to unique id your computer ## if(APPLE) set(CTEST_SITE "MAC.XXXX") @@ -69,9 +132,6 @@ endif() ######### Following is for submission to CDash ############ ################################################################### set(MODEL "Experimental") -######### Following describes computer ############ -## following is optional to describe build ## -set(SITE_BUILDNAME_SUFFIX "STATIC") ################################################################### ################################################################### @@ -85,19 +145,25 @@ set(SITE_BUILDNAME_SUFFIX "STATIC") #set(LOCAL_NO_PACKAGE "TRUE") ##### Following controls source update ##### #set(LOCAL_UPDATE "TRUE") -set(REPOSITORY_URL "http://svn.hdfgroup.uiuc.edu/hdf5/branches/hdf5_1_8") +set(REPOSITORY_URL "http://svn.hdfgroup.uiuc.edu/hdf5/trunk") #uncomment to use a compressed source file: *.tar on linux or mac *.zip on windows -#set(CTEST_USE_TAR_SOURCE "${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}") +#set(CTEST_USE_TAR_SOURCE "${CTEST_SOURCE_VERSION}") ################################################################### ################################################################### #### Change default configuration of options in config/cmake/cacheinit.cmake file ### #### format: set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DXXX:YY=ZZZZ") -### uncomment/comment or change the following lines for configuration options +################################################################### +if(STATICLIBRARIES) + set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=OFF") + ######### Following describes computer ############ + ## following is optional to describe build ## + set(SITE_BUILDNAME_SUFFIX "STATIC") +endif(STATICLIBRARIES) +################################################################### -### comment the following line or change OFF to ON in order to build shared libraries -set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=OFF") +### uncomment/comment and change the following lines for other configuration options #### ext libraries #### ### ext libs from tgz @@ -112,10 +178,11 @@ set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ALLOW_EXTERNAL_SUPPORT:STRING #set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_SZIP_SUPPORT:BOOL=OFF") #set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_SZIP_ENCODING:BOOL=OFF") #### fortran #### -### enable Fortran 2003 depends on HDF5_BUILD_FORTRAN -set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_F2003:BOOL=ON") -### disable Fortran; change OFF to ON in order to build FORTRAN libraries -set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_FORTRAN:BOOL=OFF") +if(FORTRANLIBRARIES) + set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF_BUILD_FORTRAN:BOOL=ON") + ### enable Fortran 2003 depends on HDF5_BUILD_FORTRAN + set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_F2003:BOOL=ON") +endif(FORTRANLIBRARIES) ### disable test program builds #set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DBUILD_TESTING:BOOL=OFF") @@ -126,7 +193,7 @@ set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_FORTRAN:BOOL=OFF") set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_PACKAGE_EXTLIBS:BOOL=ON") ### change install prefix -#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DCMAKE_INSTALL_PREFIX:PATH=install") +set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DCMAKE_INSTALL_PREFIX:PATH=${INSTALLDIR}") ################################################################### diff --git a/release_docs/INSTALL_CMake.txt b/release_docs/INSTALL_CMake.txt index 5cc9baf..783c30d 100644 --- a/release_docs/INSTALL_CMake.txt +++ b/release_docs/INSTALL_CMake.txt @@ -51,7 +51,7 @@ The following files referenced below are available at the HDF web site: http://www.hdfgroup.org/HDF5/release/cmakebuild.html Single compressed file with all the files needed, including source: - hdf5-1.8.15-CMake.zip or hdf5-1.8.15-CMake.tar.gz + hdf5-1.8.16-CMake.zip or hdf5-1.8.16-CMake.tar.gz Individual files ----------------------------------------------- @@ -84,15 +84,15 @@ To build HDF5 with the SZIP and ZLIB external libraries you will need to: following options: On 32-bit Windows with Visual Studio 2012, execute: - ctest -S HDF518config.cmake,32-VS2012 -C Release -VV -O hdf5.log + ctest -S HDF518config.cmake,BUILD_GENERATOR=VS2012 -C Release -VV -O hdf5.log On 64-bit Windows with Visual Studio 2012, execute: - ctest -S HDF518config.cmake,64-VS2012 -C Release -VV -O hdf5.log + ctest -S HDF518config.cmake,BUILD_GENERATOR=VS201264 -C Release -VV -O hdf5.log On 32-bit Windows with Visual Studio 2013, execute: - ctest -S HDF518config.cmake,32-VS2013 -C Release -VV -O hdf5.log + ctest -S HDF518config.cmake,BUILD_GENERATOR=VS2013 -C Release -VV -O hdf5.log On 64-bit Windows with Visual Studio 2013, execute: - ctest -S HDF518config.cmake,64-VS2013 -C Release -VV -O hdf5.log + ctest -S HDF518config.cmake,BUILD_GENERATOR=VS201364 -C Release -VV -O hdf5.log On Linux and Mac, execute: - ctest -S HDF518config.cmake -C Release -VV -O hdf5.log + ctest -S HDF518config.cmake,BUILD_GENERATOR=Unix -C Release -VV -O hdf5.log The command above will configure, build, test, and create an install package in the myhdfstuff folder. It will have the format: @@ -181,10 +181,10 @@ Notes: This short set of instructions is written for users who want to 5. Configure the C library, tools and tests with one of the following commands: On Windows 32 bit - cmake -G "Visual Studio 11 2012" -DCMAKE_BUILD_TYPE:STRING=Release -DBUILD_SHARED_LIBS:BOOL=OFF -DBUILD_TESTING:BOOL=ON -DHDF5_BUILD_TOOLS:BOOL=ON ..\hdf5-1.8."X" + cmake -G "Visual Studio 12 2013" -DCMAKE_BUILD_TYPE:STRING=Release -DBUILD_SHARED_LIBS:BOOL=OFF -DBUILD_TESTING:BOOL=ON -DHDF5_BUILD_TOOLS:BOOL=ON ..\hdf5-1.8."X" On Windows 64 bit - cmake -G "Visual Studio 11 2012 Win64" -DCMAKE_BUILD_TYPE:STRING=Release -DBUILD_SHARED_LIBS:BOOL=OFF -DBUILD_TESTING:BOOL=ON -DHDF5_BUILD_TOOLS:BOOL=ON ..\hdf5-1.8."X" + cmake -G "Visual Studio 12 2013 Win64" -DCMAKE_BUILD_TYPE:STRING=Release -DBUILD_SHARED_LIBS:BOOL=OFF -DBUILD_TESTING:BOOL=ON -DHDF5_BUILD_TOOLS:BOOL=ON ..\hdf5-1.8."X" On Linux and Mac cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE:STRING=Release -DBUILD_SHARED_LIBS:BOOL=OFF -DBUILD_TESTING:BOOL=ON -DHDF5_BUILD_TOOLS:BOOL=ON ../hdf5-1.8."X" @@ -297,7 +297,7 @@ IV. Further considerations the settings for the developers' environment. Then the only options needed 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 11 2012" \ + cmake -C ../config/cmake/cacheinit.cmake -G "Visual Studio 12 2013" \ -DHDF5_ENABLE_SZIP_SUPPORT:BOOL=OFF -DHDF5_ENABLE_Z_LIB_SUPPORT:BOOL=OFF \ -DCMAKE_BUILD_TYPE:STRING=Release .. @@ -395,11 +395,9 @@ 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 (CMAKE_INSTALL_FRAMEWORK_PREFIX "Library/Frameworks" CACHE STRING "Frameworks installation directory" FORCE) set (HDF_PACKAGE_EXT "" CACHE STRING "Name of HDF package extension" FORCE) set (HDF5_BUILD_FORTRAN ON CACHE BOOL "Build FORTRAN support" FORCE) - set (HDF5_ENABLE_F2003 ON CACHE BOOL "Enable FORTRAN 2003 Standard" 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) @@ -417,6 +415,7 @@ These five steps are described in detail below. 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_ENABLE_THREADSAFE OFF CACHE BOOL "(WINDOWS)Enable Threadsafety" FORCE) + set (HDF_TEST_EXPRESS "2" CACHE STRING "Control testing framework (0-3)" 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 (NO SVN TGZ)" FORCE) @@ -448,7 +447,7 @@ 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 11 2012" \ + cmake -C ../config/cmake/cacheinit.cmake -G "Visual Studio 12 2013" \ -DHDF5_ENABLE_SZIP_SUPPORT:BOOL=OFF -DHDF5_ENABLE_Z_LIB_SUPPORT:BOOL=OFF \ -DCMAKE_BUILD_TYPE:STRING=Release .. @@ -595,6 +594,7 @@ HDF5_STRICT_FORMAT_CHECKS "Whether to perform strict file format checks" HDF5_TEST_VFD "Execute tests with different VFDs" OFF HDF5_USE_16_API_DEFAULT "Use the HDF5 1.6.x API by default" OFF HDF5_USE_FOLDERS "Enable folder grouping of projects in IDEs." OFF +HDF5_WANT_DATA_ACCURACY "IF data accuracy is guaranteed during data conversions" ON HDF5_WANT_DCONV_EXCEPTION "exception handling functions is checked during data conversions" ON HDF5_ENABLE_THREADSAFE "Enable Threadsafety" OFF if (APPLE) @@ -639,20 +639,98 @@ VIII. Options for Platform Configuration Files Below is the HDF518config.cmake ctest script with extra comments. Execute: - ctest -S HDF518config.cmake -C Release -V -O hdf518.log + ctest -S HDF518config.cmake,BUILD_GENERATOR=xxx -C Release -V -O hdf518.log The same scripts can be used on Linux, Mac OSX or a Windows machine by adding an option (${CTEST_SCRIPT_ARG}) to the platform configuration script. -######################################################################### -### For Windows ${CTEST_SCRIPT_ARG} is one of ### -### [64-VS2013, 32-VS2013, 64-VS2012, 32-VS2012] ### -### ctest -S HDF518config.cmake,32-VS2012 -C Release -V -O hdf518.log ### -######################################################################### +########################################################################################## +### ${CTEST_SCRIPT_ARG} is of the form OPTION=VALUE ### +### BUILD_GENERATOR required [Unix, VS2013, VS201364, VS2012, VS201264] ### +### ctest -S HDF518config.cmake,BUILD_GENERATOR=VS201264 -C Release -V -O hdf518.log ### +########################################################################################## cmake_minimum_required(VERSION 3.1.0 FATAL_ERROR) -set(CTEST_SOURCE_VERSION 1.8.16) -set(CTEST_SOURCE_NAME hdf5-${CTEST_SOURCE_VERSION}) +############################################################################ +# Usage: +# ctest -S HDF518config.cmake,OPTION=VALUE -C Release -VV -O test.log +# where valid options for OPTION are: +# BUILD_GENERATOR - The cmake build generator: +# Unix * Unix Makefiles +# VS2013 * Visual Studio 12 2013 +# VS201364 * Visual Studio 12 2013 Win64 +# VS2012 * Visual Studio 11 2012 +# VS201264 * Visual Studio 11 2012 Win64 +# +# INSTALLDIR - root folder where hdf5 is installed +# CTEST_BUILD_CONFIGURATION - Release, Debug, etc +# CTEST_SOURCE_NAME - source folder +# STATICLIBRARIES - Build/use static libraries +# NO_MAC_FORTRAN - Yes to be SHARED on a Mac +############################################################################## + +set(CTEST_SOURCE_VERSION 1.9) +set(CTEST_SOURCE_VERSEXT "") + +############################################################################## +# handle input parameters to script. +#BUILD_GENERATOR - which CMake generator to use, required +#INSTALLDIR - HDF5-1.9 root folder +#CTEST_BUILD_CONFIGURATION - Release, Debug, RelWithDebInfo +#CTEST_SOURCE_NAME - name of source folder; HDF5-1.9 +#STATICLIBRARIES - Default is YES +#NO_MAC_FORTRAN - set to TRUE to allow shared libs on a Mac +if(DEFINED CTEST_SCRIPT_ARG) + # transform ctest script arguments of the form + # script.ctest,var1=value1,var2=value2 + # to variables with the respective names set to the respective values + string(REPLACE "," ";" script_args "${CTEST_SCRIPT_ARG}") + foreach(current_var ${script_args}) + if ("${current_var}" MATCHES "^([^=]+)=(.+)$") + set("${CMAKE_MATCH_1}" "${CMAKE_MATCH_2}") + endif() + endforeach() +endif() + +# build generator must be defined +if(NOT DEFINED BUILD_GENERATOR) + message(FATAL_ERROR "BUILD_GENERATOR must be defined - Unix, VS2013, VS201364, VS2012, or VS201264") +else() + if(${BUILD_GENERATOR} STREQUAL "Unix") + set(CMAKE_GENERATOR "Unix Makefiles") + elseif(${BUILD_GENERATOR} STREQUAL "VS2013") + set(CMAKE_GENERATOR "Visual Studio 12 2013") + elseif(${BUILD_GENERATOR} STREQUAL "VS201364") + set(CMAKE_GENERATOR "Visual Studio 12 2013 Win64") + elseif(${BUILD_GENERATOR} STREQUAL "VS2012") + set(CMAKE_GENERATOR "Visual Studio 11 2012") + elseif(${BUILD_GENERATOR} STREQUAL "VS201264") + set(CMAKE_GENERATOR "Visual Studio 11 2012 Win64") + else() + message(FATAL_ERROR "Invalid BUILD_GENERATOR must be - Unix, VS2013, VS201364, VS2012, or VS201264") + endif() +endif() + +if(NOT DEFINED INSTALLDIR) + if(WIN32) + set(INSTALLDIR "/usr/local/myhdf5") + else() + set(INSTALLDIR "C:\\Program\ Files\\myhdf5") + endif() +endif() +if(NOT DEFINED CTEST_BUILD_CONFIGURATION) + set(CTEST_BUILD_CONFIGURATION "Release") +endif() +if(NOT DEFINED CTEST_SOURCE_NAME) + set(CTEST_SOURCE_NAME "hdf5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}") +endif() +if(NOT DEFINED STATICLIBRARIES) + set(STATICLIBRARIES "YES") +endif() +if(NOT DEFINED FORTRANLIBRARIES) + set(FORTRANLIBRARIES "NO") +endif() + set(CTEST_BINARY_NAME "build") set(CTEST_DASHBOARD_ROOT "${CTEST_SCRIPT_DIRECTORY}") if(WIN32) @@ -664,40 +742,30 @@ else() endif() ################################################################### -### Following Line is one of [Release, RelWithDebInfo, Debug] ##### -set(CTEST_BUILD_CONFIGURATION "Release") -################################################################### - -################################################################### ######### Following describes compiler ############ if(WIN32) set(SITE_OS_NAME "Windows") set(SITE_OS_VERSION "WIN7") - if(${CTEST_SCRIPT_ARG} STREQUAL "64-VS2013") - set(CTEST_CMAKE_GENERATOR "Visual Studio 12 2013 Win64") + if(${BUILD_GENERATOR} STREQUAL "VS201364") set(SITE_OS_BITS "64") set(SITE_COMPILER_NAME "vs2013") set(SITE_COMPILER_VERSION "12") - elseif(${CTEST_SCRIPT_ARG} STREQUAL "32-VS2013") - set(CTEST_CMAKE_GENERATOR "Visual Studio 12 2013") + elseif(${BUILD_GENERATOR} STREQUAL "VS2013") set(SITE_OS_BITS "32") set(SITE_COMPILER_NAME "vs2013") set(SITE_COMPILER_VERSION "12") - elseif(${CTEST_SCRIPT_ARG} STREQUAL "64-VS2012") - set(CTEST_CMAKE_GENERATOR "Visual Studio 11 2012 Win64") + elseif(${BUILD_GENERATOR} STREQUAL "VS201264") set(SITE_OS_BITS "64") set(SITE_COMPILER_NAME "vs2012") set(SITE_COMPILER_VERSION "11") - elseif(${CTEST_SCRIPT_ARG} STREQUAL "32-VS2012") - set(CTEST_CMAKE_GENERATOR "Visual Studio 11 2012") + elseif(${BUILD_GENERATOR} STREQUAL "VS2012") set(SITE_OS_BITS "32") set(SITE_COMPILER_NAME "vs2012") set(SITE_COMPILER_VERSION "11") endif() ## Set the following to unique id your computer ## - set(CTEST_SITE "WIN7${CTEST_SCRIPT_ARG}.XXXX") + set(CTEST_SITE "WIN7${BUILD_GENERATOR}.XXXX") else() - set(CTEST_CMAKE_GENERATOR "Unix Makefiles") ## Set the following to unique id your computer ## if(APPLE) set(CTEST_SITE "MAC.XXXX") @@ -711,9 +779,6 @@ endif() ######### Following is for submission to CDash ############ ################################################################### set(MODEL "Experimental") -######### Following describes computer ############ -## following is optional to describe build ## -set(SITE_BUILDNAME_SUFFIX "STATIC") ################################################################### ################################################################### @@ -727,7 +792,7 @@ set(SITE_BUILDNAME_SUFFIX "STATIC") #set(LOCAL_NO_PACKAGE "TRUE") ##### Following controls source update ##### #set(LOCAL_UPDATE "TRUE") -set(REPOSITORY_URL "http://svn.hdfgroup.uiuc.edu/hdf5/branches/hdf5_1_8") +set(REPOSITORY_URL "http://svn.hdfgroup.uiuc.edu/hdf5/trunk") #uncomment to use a compressed source file: *.tar on linux or mac *.zip on windows #set(CTEST_USE_TAR_SOURCE "${CTEST_SOURCE_VERSION}") ################################################################### @@ -736,10 +801,16 @@ set(REPOSITORY_URL "http://svn.hdfgroup.uiuc.edu/hdf5/branches/hdf5_1_8") #### Change default configuration of options in config/cmake/cacheinit.cmake file ### #### format: set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DXXX:YY=ZZZZ") -### uncomment/comment and change the following lines for configuration options +################################################################### +if(STATICLIBRARIES) + set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=OFF") + ######### Following describes computer ############ + ## following is optional to describe build ## + set(SITE_BUILDNAME_SUFFIX "STATIC") +endif(STATICLIBRARIES) +################################################################### -### comment the following line or change OFF to ON in order to build shared libraries -set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=OFF") +### uncomment/comment and change the following lines for other configuration options #### ext libraries #### ### ext libs from tgz @@ -754,10 +825,11 @@ set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ALLOW_EXTERNAL_SUPPORT:STRING #set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_SZIP_SUPPORT:BOOL=OFF") #set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_SZIP_ENCODING:BOOL=OFF") #### fortran #### -### enable Fortran 2003 depends on HDF5_BUILD_FORTRAN -set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_F2003:BOOL=ON") -### disable Fortran; change OFF to ON in order to build FORTRAN libraries -set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_FORTRAN:BOOL=OFF") +if(FORTRANLIBRARIES) + set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF_BUILD_FORTRAN:BOOL=ON") + ### enable Fortran 2003 depends on HDF5_BUILD_FORTRAN + set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_F2003:BOOL=ON") +endif(FORTRANLIBRARIES) ### disable test program builds #set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DBUILD_TESTING:BOOL=OFF") @@ -768,7 +840,7 @@ set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_FORTRAN:BOOL=OFF") set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_PACKAGE_EXTLIBS:BOOL=ON") ### change install prefix -#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DCMAKE_INSTALL_PREFIX:PATH=install") +set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DCMAKE_INSTALL_PREFIX:PATH=${INSTALLDIR}") ################################################################### diff --git a/release_docs/USING_HDF5_CMake.txt b/release_docs/USING_HDF5_CMake.txt index 578f957..c48bca5 100644 --- a/release_docs/USING_HDF5_CMake.txt +++ b/release_docs/USING_HDF5_CMake.txt @@ -99,12 +99,12 @@ These steps are described in more detail below. * MinGW Makefiles * NMake Makefiles * Unix Makefiles - * Visual Studio 12 - * Visual Studio 12 Win64 - * Visual Studio 11 - * Visual Studio 11 Win64 - * Visual Studio 10 - * Visual Studio 10 Win64 + * Visual Studio 12 2013 + * Visual Studio 12 2013 Win64 + * Visual Studio 11 2012 + * Visual Studio 11 2012 Win64 + * Visual Studio 10 2010 + * Visual Studio 10 2010 Win64 is: * BUILD_TESTING:BOOL=ON @@ -114,7 +114,7 @@ These steps are described in more detail below. 2.1 Visual CMake users, click the Configure button. If this is the first time you are running cmake-gui in this directory, you will be prompted for the - generator you wish to use (for example on Windows, Visual Studio 10). + generator you wish to use (for example on Windows, Visual Studio 12 2013). CMake will read in the CMakeLists.txt files from the source directory and display options for the HDF5 project. After the first configure you can adjust the cache settings and/or specify locations of other programs. @@ -176,8 +176,8 @@ These steps are described in more detail below. III. Minimum C Project Files for CMake ======================================================================== -Create a CMakeLists.txt file at the source root. Include the -following text in the file: +Given the preconditions in section I, create a CMakeLists.txt file at the +source root. Include the following text in the file: ########################################################## cmake_minimum_required (VERSION 3.1.0) @@ -206,18 +206,15 @@ add_test (NAME test_example COMMAND ${example}) IV. APPENDIX ======================================================================== -Below is an example of the ctest script used by The HDF Group. See the -Appendix in the INSTALL_CMake.txt file for the CTestScript.cmake file used -by this script. Adjust the values as necessary. Note that the source folder -is entered on the command line and the build folder is created as a sub-folder. -Windows should adjust the forward slash to double backslashes, except for -the HDF_DIR environment variable. +Below is an example of a ctest script that can be used to build the examples. +Adjust the values as necessary. Note that the source folder is entered on the +command line and the build folder is created as a sub-folder. Windows should +adjust the forward slash to double backslashes, except for the HDF_DIR +environment variable. -NOTE: these files are available at the HDF web site: +NOTE: this file is available at the HDF web site: http://www.hdfgroup.org/HDF5/release/cmakebuild.html - CTestScript.cmake - HDF518_Examples.cmake @@ -228,22 +225,24 @@ ctest cmake_minimum_required(VERSION 3.1.0 FATAL_ERROR) ############################################################################ -# Product specific script, HDF518_Examples.cmake, that uses the -# CTestScript.cmake file (see Appendix in the CMake.txt). Usage: +# Product specific script, HDF518_Examples.cmake. Usage: # ctest -S HDF518_Examples.cmake,OPTION=VALUE -C Release -VV -O test.log # where valid options for OPTION are: +# BUILD_GENERATOR - The cmake build generator: +# Unix * Unix Makefiles +# VS2013 * Visual Studio 12 2013 +# VS201364 * Visual Studio 12 2013 Win64 +# VS2012 * Visual Studio 11 2012 +# VS201264 * Visual Studio 11 2012 Win64 +# # INSTALLDIR - root folder where hdf5 is installed # CTEST_BUILD_CONFIGURATION - Release, Debug, etc # CTEST_SOURCE_NAME - source folder # STATICLIBRARIES - Build/use static libraries # NO_MAC_FORTRAN - Yes to be SHARED on a Mac ############################################################################################################### - -set(CTEST_CMAKE_GENERATOR "@CMAKE_GENERATOR@") -set(CTEST_DASHBOARD_ROOT ${CTEST_SCRIPT_DIRECTORY}) -#set(BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF_BUILD_FORTRAN:BOOL=ON") - # handle input parameters to script. +#BUILD_GENERATOR - which CMake generator to use, required #INSTALLDIR - HDF5-1.8 root folder #CTEST_BUILD_CONFIGURATION - Release, Debug, RelWithDebInfo #CTEST_SOURCE_NAME - name of source folder; HDF4Examples @@ -260,8 +259,34 @@ if(DEFINED CTEST_SCRIPT_ARG) endif() endforeach() endif() + +# build generator must be defined +if(NOT DEFINED BUILD_GENERATOR) + message(FATAL_ERROR "BUILD_GENERATOR must be defined - Unix, VS2013, VS201364, VS2012, or VS201264") +else() + if(${BUILD_GENERATOR} STREQUAL "Unix") + set(CMAKE_GENERATOR "Unix Makefiles") + elseif(${BUILD_GENERATOR} STREQUAL "VS2013") + set(CMAKE_GENERATOR "Visual Studio 12 2013") + elseif(${BUILD_GENERATOR} STREQUAL "VS201364") + set(CMAKE_GENERATOR "Visual Studio 12 2013 Win64") + elseif(${BUILD_GENERATOR} STREQUAL "VS2012") + set(CMAKE_GENERATOR "Visual Studio 11 2012") + elseif(${BUILD_GENERATOR} STREQUAL "VS201264") + set(CMAKE_GENERATOR "Visual Studio 11 2012 Win64") + else() + message(FATAL_ERROR "Invalid BUILD_GENERATOR must be - Unix, VS2013, VS201364, VS2012, or VS201264") + endif() +endif() +set(CTEST_CMAKE_GENERATOR "${CMAKE_GENERATOR}") +set(CTEST_DASHBOARD_ROOT ${CTEST_SCRIPT_DIRECTORY}) + if(NOT DEFINED INSTALLDIR) + if(WIN32) set(INSTALLDIR "/usr/local/myhdf5") + else() + set(INSTALLDIR "C:\\Program\ Files\\myhdf5") + endif() endif() if(NOT DEFINED CTEST_BUILD_CONFIGURATION) set(CTEST_BUILD_CONFIGURATION "Release") @@ -272,6 +297,9 @@ endif() if(NOT DEFINED STATICLIBRARIES) set(STATICLIBRARIES "YES") endif() +if(NOT DEFINED FORTRANLIBRARIES) + set(FORTRANLIBRARIES "NO") +endif() #TAR_SOURCE - name of tarfile #if(NOT DEFINED TAR_SOURCE) @@ -281,6 +309,10 @@ endif() ############################################################################################################### # Adjust the following SET Commands as needed ############################################################################################################### +if(FORTRANLIBRARIES) + set(BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF_BUILD_FORTRAN:BOOL=ON") +endif(FORTRANLIBRARIES) + if(WIN32) if(STATICLIBRARIES) set(BUILD_OPTIONS "${BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=OFF") -- cgit v0.12 From 22f78e766c9aaa5ecfd3d13f482109a38e1da2e3 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 6 Oct 2015 13:52:48 -0500 Subject: [svn-r27974] Change distribution of scripts --- MANIFEST | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/MANIFEST b/MANIFEST index 78c0857..74439a0 100644 --- a/MANIFEST +++ b/MANIFEST @@ -2520,5 +2520,5 @@ ./tools/perform/CMakeTests.cmake # CMake-specific User Scripts -./config/cmake/scripts/CTestScript.cmake _DO_NOT_DISTRIBUTE_ -./config/cmake/scripts/HDF518config.cmake _DO_NOT_DISTRIBUTE_ +./config/cmake/scripts/CTestScript.cmake +./config/cmake/scripts/HDF518config.cmake -- cgit v0.12 From ad29dac64a6e20dde8ceb92382c9261c6f68ff61 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 7 Oct 2015 10:22:57 -0500 Subject: [svn-r27986] OPTION should default to FALSE --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ef91cfb..f7da488 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -193,7 +193,7 @@ endif (NOT HDF5_INSTALL_LIB_DIR) if (NOT HDF5_INSTALL_INCLUDE_DIR) set (HDF5_INSTALL_INCLUDE_DIR include) endif (NOT HDF5_INSTALL_INCLUDE_DIR) -option (HDF5_BUILD_FRAMEWORKS "TRUE to build as frameworks libraries, FALSE to build according to BUILD_SHARED_LIBS" TRUE) +option (HDF5_BUILD_FRAMEWORKS "TRUE to build as frameworks libraries, FALSE to build according to BUILD_SHARED_LIBS" FALSE) if (NOT HDF5_INSTALL_DATA_DIR) if (NOT WIN32) if (APPLE) -- cgit v0.12 From 8edfabd297c10579eac941f31a26d5727889fa88 Mon Sep 17 00:00:00 2001 From: Larry Knox Date: Wed, 7 Oct 2015 14:18:43 -0500 Subject: [svn-r27997] Autogen.sh is no longer marked _DO_NOT_DISTRIBUTE_ in the MANIFEST file. Therefore bbrelease does not need to expressly add it to the source tar file. --- bin/bbrelease | 1 - 1 file changed, 1 deletion(-) diff --git a/bin/bbrelease b/bin/bbrelease index 119dc7a..cb79528 100755 --- a/bin/bbrelease +++ b/bin/bbrelease @@ -304,7 +304,6 @@ fi # Create a manifest that contains only files for distribution. MANIFEST=$tmpdir/H5_MANIFEST grep '^\.' MANIFEST | grep -v _DO_NOT_DISTRIBUTE_ >$MANIFEST -echo "./autogen.sh" >>$MANIFEST # Prepare the source tree for a release. #ln -s `pwd` $tmpdir/$HDF5_VERS || exit 1 -- cgit v0.12 From 0facbc77c3c86b51c628a8464c650ff51400d949 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Fri, 9 Oct 2015 14:38:13 -0500 Subject: [svn-r28015] Decription: Clean up memory leak when generating group creation property list for user. Tested on: MacOSX/64 10.10.5 (amazon) w/serial & valgrind Linux/64 4.1.8 (Jerome's laptop) w/serial & valgrind --- src/H5G.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/H5G.c b/src/H5G.c index 089dc50..779a2ad 100644 --- a/src/H5G.c +++ b/src/H5G.c @@ -607,7 +607,7 @@ H5G_get_create_plist(H5G_t *grp) HGOTO_ERROR(H5E_SYM, H5E_BADMESG, FAIL, "can't get link pipeline") /* Set the pipeline for the property list */ - if(H5P_set(new_plist, H5O_CRT_PIPELINE_NAME, &pline) < 0) + if(H5P_poke(new_plist, H5O_CRT_PIPELINE_NAME, &pline) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set link pipeline") } /* end if */ -- cgit v0.12 From 3444e46ea08a415a08b1005167c77a44896d4591 Mon Sep 17 00:00:00 2001 From: Mohamad Chaarawi Date: Fri, 9 Oct 2015 15:25:50 -0500 Subject: [svn-r28017] mem leak fix. --- hl/test/test_lite.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hl/test/test_lite.c b/hl/test/test_lite.c index 9d625e9..f3258d6 100644 --- a/hl/test/test_lite.c +++ b/hl/test/test_lite.c @@ -1282,6 +1282,7 @@ static int test_strings(void) HDfree(dt_str); goto out; } + HDfree(dt_str); /* Length of the character buffer is smaller then needed */ str_len = 21; -- cgit v0.12 From cfe6d9a8da37bd7af03d976fce6ac77994bb79b3 Mon Sep 17 00:00:00 2001 From: Mohamad Chaarawi Date: Fri, 9 Oct 2015 16:35:30 -0500 Subject: [svn-r28019] fix mem leaks. --- hl/src/H5LTparse.y | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/hl/src/H5LTparse.y b/hl/src/H5LTparse.y index 4c07533..9f08254 100644 --- a/hl/src/H5LTparse.y +++ b/hl/src/H5LTparse.y @@ -190,7 +190,10 @@ memb_def : ddl_type { cmpd_stack[csindex].is_field = 1; /*notify le H5Tinsert(dtype_id, $4, $6, $1); } } - + if($4) { + free($4); + $4 = NULL; + } cmpd_stack[csindex].is_field = 0; H5Tclose($1); @@ -199,7 +202,9 @@ memb_def : ddl_type { cmpd_stack[csindex].is_field = 1; /*notify le ; field_name : STRING { - $$ = yylval.sval; + $$ = strdup(yylval.sval); + free(yylval.sval); + yylval.sval = NULL; } ; field_offset : /*empty*/ @@ -247,6 +252,8 @@ opaque_type : H5T_OPAQUE_TOKEN OPQ_TAG_TOKEN { is_opq_tag = 1; } '"' opaque_tag '"' ';' { H5Tset_tag($7, yylval.sval); + free(yylval.sval); + yylval.sval = NULL; is_opq_tag = 0; } '}' { $$ = $7; } @@ -335,6 +342,8 @@ enum_def : '"' enum_symbol '"' { #else /* H5_HAVE_WIN32_API */ enum_memb_symbol = strdup(yylval.sval); #endif /* H5_HAVE_WIN32_API */ + free(yylval.sval); + yylval.sval = NULL; } enum_val ';' { -- cgit v0.12 From 59c79aec2caa0fd590e6410cfa8bb55850f558c1 Mon Sep 17 00:00:00 2001 From: Scot Breitenfeld Date: Fri, 9 Oct 2015 16:45:46 -0500 Subject: [svn-r28020] Freed allocated memory in h5tenum_insert_ptr_c, valgrind fix. --- fortran/src/H5Tf.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fortran/src/H5Tf.c b/fortran/src/H5Tf.c index b6389258..9928d0a 100644 --- a/fortran/src/H5Tf.c +++ b/fortran/src/H5Tf.c @@ -2421,7 +2421,10 @@ h5tenum_insert_ptr_c(hid_t_f *type_id, _fcd name, int_f* namelen, void *value) if (c_name == NULL) return ret_value; status = H5Tenum_insert( (hid_t)*type_id, c_name, value); + + HDfree(c_name); if ( status < 0 ) return ret_value; + ret_value = 0; return ret_value; } -- cgit v0.12 From 877dfaaad78242cc7aa7fdb1beb60a5e05800928 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Fri, 9 Oct 2015 23:55:35 -0500 Subject: [svn-r28024] Description: Clear buffer for driver info block before writing it to the file. (Avoids 'uninitialized memory read' warning from valgrind) Tested on: MacOSX/64 10.10.5 (amazon) w/serial & valgrind (too minor for h5committest) --- src/H5Fsuper.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/H5Fsuper.c b/src/H5Fsuper.c index 50f6b06..c6b1c83 100644 --- a/src/H5Fsuper.c +++ b/src/H5Fsuper.c @@ -934,6 +934,7 @@ H5F__super_init(H5F_t *f, hid_t dxpl_id) HDassert(driver_size <= H5F_MAX_DRVINFOBLOCK_SIZE); /* Encode driver-specific data */ + HDmemset(dbuf, 0, sizeof(dbuf)); if(H5FD_sb_encode(f->shared->lf, info.name, dbuf) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "unable to encode driver information") -- cgit v0.12 From cd49e8a2abcd1a6fd1a4ac578cc208e2bbad1914 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Sat, 10 Oct 2015 21:42:20 -0500 Subject: [svn-r28025] Description: Switch 'int' flag variables to booleans. Tested on: MacOSX/64 10.10.5 (amazon) w/serial & paralel (too minor for h5committest) --- tools/lib/h5diff_attr.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/lib/h5diff_attr.c b/tools/lib/h5diff_attr.c index 6474082..190343b 100644 --- a/tools/lib/h5diff_attr.c +++ b/tools/lib/h5diff_attr.c @@ -334,8 +334,8 @@ hsize_t diff_attr(hid_t loc1_id, size_t msize2; /* memory size of memory type */ void *buf1=NULL; /* data buffer */ void *buf2=NULL; /* data buffer */ - int buf1hasdata=0; /* buffer has data */ - int buf2hasdata=0; /* buffer has data */ + hbool_t buf1hasdata=FALSE; /* buffer has data */ + hbool_t buf2hasdata=FALSE; /* buffer has data */ hsize_t nelmts1; /* number of elements in dataset */ int rank1; /* rank of dataset */ int rank2; /* rank of dataset */ @@ -472,12 +472,12 @@ hsize_t diff_attr(hid_t loc1_id, parallel_print("Failed reading attribute1 %s/%s\n", path1, name1); goto error; }else - buf1hasdata = 1; + buf1hasdata = TRUE; if(H5Aread(attr2_id,mtype2_id,buf2) < 0){ parallel_print("Failed reading attribute2 %s/%s\n", path2, name2); goto error; }else - buf2hasdata = 1; + buf2hasdata = TRUE; /* format output string */ HDsnprintf(np1, sizeof(np1), "%s of <%s>", name1, path1); -- cgit v0.12 From fc84edb7e3514556e1b5cbd5268d35fcf21054b6 Mon Sep 17 00:00:00 2001 From: Binh-Minh Ribler Date: Sat, 10 Oct 2015 23:05:21 -0500 Subject: [svn-r28027] Purpose: Fix memory leaks Description: - Removed H5Library::instance because it is unnecessary. All H5Library's methods are static. This, in turn, removed the memory leaks by H5Library::instance not being deleted. - Added ObjCreatPropList::deleteConstants to atexist() list - Cleaned up comments and format inconsistencies with 1.8 Platforms tested: Linux/32 2.6 (jam) Linux/64 (platypus) Darwin (osx1010test) --- c++/src/H5AbstractDs.h | 4 +-- c++/src/H5Attribute.h | 2 +- c++/src/H5DataType.cpp | 4 +-- c++/src/H5DataType.h | 3 ++ c++/src/H5DcreatProp.h | 3 ++ c++/src/H5DxferProp.h | 4 ++- c++/src/H5Exception.cpp | 6 ++-- c++/src/H5Exception.h | 4 +-- c++/src/H5FaccProp.h | 3 ++ c++/src/H5File.cpp | 84 +++++++++++++++++++++++------------------------ c++/src/H5FloatType.h | 8 ++--- c++/src/H5IdComponent.cpp | 16 +++++---- c++/src/H5IdComponent.h | 36 +++++++++++--------- c++/src/H5Library.cpp | 72 +++++++++++++++++----------------------- c++/src/H5Library.h | 10 +++--- 15 files changed, 134 insertions(+), 125 deletions(-) diff --git a/c++/src/H5AbstractDs.h b/c++/src/H5AbstractDs.h index 810dc8b..ee2e45e 100644 --- a/c++/src/H5AbstractDs.h +++ b/c++/src/H5AbstractDs.h @@ -68,7 +68,7 @@ class H5_DLLCPP AbstractDs { ///\brief Returns the amount of storage size required - pure virtual. virtual hsize_t getStorageSize() const = 0; - ///\brief Returns this class name. + // Returns this class name - pure virtual. virtual H5std_string fromClass() const = 0; // Destructor @@ -91,7 +91,7 @@ class H5_DLLCPP AbstractDs { // AbstractDs( const AbstractDs& original ); private: - // This member function is implemented by DataSet and Attribute. + // This member function is implemented by DataSet and Attribute - pure virtual. virtual hid_t p_get_type() const = 0; }; #ifndef H5_NO_NAMESPACE diff --git a/c++/src/H5Attribute.h b/c++/src/H5Attribute.h index eced64e..f5ee4a9 100644 --- a/c++/src/H5Attribute.h +++ b/c++/src/H5Attribute.h @@ -86,8 +86,8 @@ class H5_DLLCPP Attribute : public AbstractDs, public IdComponent { // Destructor: properly terminates access to this attribute. virtual ~Attribute(); - protected: #ifndef DOXYGEN_SHOULD_SKIP_THIS + protected: // Sets the attribute id. virtual void p_setId(const hid_t new_id); #endif // DOXYGEN_SHOULD_SKIP_THIS diff --git a/c++/src/H5DataType.cpp b/c++/src/H5DataType.cpp index 88dff89..b352f2d 100644 --- a/c++/src/H5DataType.cpp +++ b/c++/src/H5DataType.cpp @@ -144,10 +144,10 @@ DataType::DataType(const DataType& original) : H5Object() //-------------------------------------------------------------------------- // Function: DataType overloaded constructor -///\brief Creates a integer type using a predefined type +///\brief Creates a DataType instance using a predefined type ///\param pred_type - IN: Predefined datatype ///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - 2000 +// Programmer Binh-Minh Ribler - 2015 // Description // Copying the type so that when a predefined type is passed in, // a copy of it is made, not just a duplicate of the HDF5 id. diff --git a/c++/src/H5DataType.h b/c++/src/H5DataType.h index 6c8a312..5705b83 100644 --- a/c++/src/H5DataType.h +++ b/c++/src/H5DataType.h @@ -14,6 +14,9 @@ * access to either file, you may request a copy from help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +// Class DataType inherits from H5Object and has several subclasses for +// specific HDF5 data types. + #ifndef __H5DataType_H #define __H5DataType_H diff --git a/c++/src/H5DcreatProp.h b/c++/src/H5DcreatProp.h index ebdadc4..792956a 100644 --- a/c++/src/H5DcreatProp.h +++ b/c++/src/H5DcreatProp.h @@ -14,6 +14,9 @@ * access to either file, you may request a copy from help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +// Class DSetCreatPropList represents the HDF5 dataset creation property list +// and inherits from PropList. + #ifndef __H5DSCreatPropList_H #define __H5DSCreatPropList_H diff --git a/c++/src/H5DxferProp.h b/c++/src/H5DxferProp.h index 85d2ec2..52a9a48 100644 --- a/c++/src/H5DxferProp.h +++ b/c++/src/H5DxferProp.h @@ -14,6 +14,9 @@ * access to either file, you may request a copy from help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +// Class DSetMemXferPropList represents the HDF5 dataset transfer property list +// and inherits from PropList. + #ifndef __H5DSetMemXferPropList_H #define __H5DSetMemXferPropList_H @@ -132,4 +135,3 @@ class H5_DLLCPP DSetMemXferPropList : public PropList { } #endif #endif // __H5DSetMemXferPropList_H - diff --git a/c++/src/H5Exception.cpp b/c++/src/H5Exception.cpp index fb1e42e..1ca059b 100644 --- a/c++/src/H5Exception.cpp +++ b/c++/src/H5Exception.cpp @@ -309,9 +309,9 @@ const char* Exception::getCFuncName() const //-------------------------------------------------------------------------- void Exception::printErrorStack(FILE* stream, hid_t err_stack) { - herr_t ret_value = H5Eprint2(err_stack, stream); - if( ret_value < 0 ) - throw Exception( "Printing error stack", "H5Eprint2 failed" ); + herr_t ret_value = H5Eprint2(err_stack, stream); + if( ret_value < 0 ) + throw Exception( "Printing error stack", "H5Eprint2 failed" ); } //-------------------------------------------------------------------------- diff --git a/c++/src/H5Exception.h b/c++/src/H5Exception.h index 639b633..d49c19a 100644 --- a/c++/src/H5Exception.h +++ b/c++/src/H5Exception.h @@ -86,8 +86,8 @@ class H5_DLLCPP Exception { virtual ~Exception() throw(); protected: - // Default value for detail_message - static const char DEFAULT_MSG[]; + // Default value for detail_message + static const char DEFAULT_MSG[]; private: H5std_string detail_message; diff --git a/c++/src/H5FaccProp.h b/c++/src/H5FaccProp.h index 7d6529e..b214447 100644 --- a/c++/src/H5FaccProp.h +++ b/c++/src/H5FaccProp.h @@ -14,6 +14,9 @@ * access to either file, you may request a copy from help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +// Class FileAccPropList represents the HDF5 file access property list and +// inherits from DataType. + #ifndef __H5FileAccPropList_H #define __H5FileAccPropList_H diff --git a/c++/src/H5File.cpp b/c++/src/H5File.cpp index 44fc53c..b169472 100644 --- a/c++/src/H5File.cpp +++ b/c++/src/H5File.cpp @@ -133,28 +133,26 @@ void H5File::p_get_file(const char* name, unsigned int flags, const FileCreatPro // create the file. if( flags & (H5F_ACC_EXCL|H5F_ACC_TRUNC)) { - hid_t create_plist_id = create_plist.getId(); - hid_t access_plist_id = access_plist.getId(); - id = H5Fcreate( name, flags, create_plist_id, access_plist_id ); - if( id < 0 ) // throw an exception when open/create fail - { - throw FileIException("H5File constructor", "H5Fcreate failed"); - } + hid_t create_plist_id = create_plist.getId(); + hid_t access_plist_id = access_plist.getId(); + id = H5Fcreate( name, flags, create_plist_id, access_plist_id ); + if( id < 0 ) // throw an exception when open/create fail + { + throw FileIException("H5File constructor", "H5Fcreate failed"); + } } // Open the file if none of the bits above are set. else { - hid_t access_plist_id = access_plist.getId(); - id = H5Fopen( name, flags, access_plist_id ); - if( id < 0 ) // throw an exception when open/create fail - { - throw FileIException("H5File constructor", "H5Fopen failed"); - } + hid_t access_plist_id = access_plist.getId(); + id = H5Fopen( name, flags, access_plist_id ); + if( id < 0 ) // throw an exception when open/create fail + { + throw FileIException("H5File constructor", "H5Fopen failed"); + } } } -#endif // DOXYGEN_SHOULD_SKIP_THIS - //-------------------------------------------------------------------------- // Function: H5File overloaded constructor ///\brief Creates an H5File object using an existing file id. @@ -174,6 +172,8 @@ H5File::H5File(hid_t existing_id) : H5Location(), CommonFG() incRefCount(); // increment number of references to this id } +#endif // DOXYGEN_SHOULD_SKIP_THIS + //-------------------------------------------------------------------------- // Function: H5File copy constructor ///\brief Copy constructor: makes a copy of the original @@ -523,16 +523,16 @@ hsize_t H5File::getFileSize() const } //-------------------------------------------------------------------------- -// Function: H5File::getId +// Function: H5File::getId ///\brief Get the id of this file ///\return File identifier // Modification: -// May 2008 - BMR -// Class hierarchy is revised to address bugzilla 1068. Class -// AbstractDS and Attribute are moved out of H5Object. In -// addition, member IdComponent::id is moved into subclasses, and -// IdComponent::getId now becomes pure virtual function. -// Programmer Binh-Minh Ribler - May, 2008 +// May 2008 - BMR +// Class hierarchy is revised to address bugzilla 1068. Class +// AbstractDS and Attribute are moved out of H5Object. In +// addition, member IdComponent::id is moved into subclasses, and +// IdComponent::getId now becomes pure virtual function. +// Programmer Binh-Minh Ribler - May, 2008 //-------------------------------------------------------------------------- hid_t H5File::getId() const { @@ -541,42 +541,42 @@ hid_t H5File::getId() const #ifndef DOXYGEN_SHOULD_SKIP_THIS //-------------------------------------------------------------------------- -// Function: H5File::getLocId -// Purpose: Get the id of this file +// Function: H5File::reopen +// Purpose: Reopens this file. +// Exception H5::FileIException // Description -// This function is a redefinition of CommonFG::getLocId. It -// is used by CommonFG member functions to get the file id. +// This function is replaced by the above function reOpen. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -hid_t H5File::getLocId() const +void H5File::reopen() { - return( getId() ); + H5File::reOpen(); } //-------------------------------------------------------------------------- -// Function: H5File::reopen -// Purpose: Reopens this file. -// Exception H5::FileIException +// Function: H5File::getLocId +// Purpose: Get the id of this file // Description -// This function is replaced by the above function reOpen. +// This function is a redefinition of CommonFG::getLocId. It +// is used by CommonFG member functions to get the file id. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void H5File::reopen() +hid_t H5File::getLocId() const { - H5File::reOpen(); + return( getId() ); } //-------------------------------------------------------------------------- -// Function: H5File::p_setId (protected) -///\brief Sets the identifier of this object to a new value. +// Function: H5File::p_setId (protected) +///\brief Sets the identifier of this object to a new value. /// -///\exception H5::IdComponentException when the attempt to close the HDF5 -/// object fails +///\exception H5::IdComponentException when the attempt to close the HDF5 +/// object fails // Description: -// The underlaying reference counting in the C library ensures -// that the current valid id of this object is properly closed. -// Then the object's id is reset to the new id. -// Programmer Binh-Minh Ribler - 2000 +// The underlaying reference counting in the C library ensures +// that the current valid id of this object is properly closed. +// Then the object's id is reset to the new id. +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void H5File::p_setId(const hid_t new_id) { diff --git a/c++/src/H5FloatType.h b/c++/src/H5FloatType.h index 06a5450..e88093e 100644 --- a/c++/src/H5FloatType.h +++ b/c++/src/H5FloatType.h @@ -24,10 +24,10 @@ namespace H5 { //! Class FloatType operates on HDF5 floating point datatype. class H5_DLLCPP FloatType : public AtomType { public: - // Creates a floating-point type using a predefined type - FloatType( const PredType& pred_type ); + // Creates a floating-point type using a predefined type. + FloatType( const PredType& pred_type ); - // Gets the floating-point datatype of the specified dataset + // Gets the floating-point datatype of the specified dataset. FloatType( const DataSet& dataset ); // Retrieves the exponent bias of a floating-point type. @@ -60,7 +60,7 @@ class H5_DLLCPP FloatType : public AtomType { // Default constructor FloatType(); - // Creates a floating-point datatype using an existing id + // Creates a floating-point datatype using an existing id. FloatType( const hid_t existing_id ); // Copy constructor: makes a copy of the original FloatType object. diff --git a/c++/src/H5IdComponent.cpp b/c++/src/H5IdComponent.cpp index 93ee4fd..19d68cf 100644 --- a/c++/src/H5IdComponent.cpp +++ b/c++/src/H5IdComponent.cpp @@ -26,14 +26,19 @@ namespace H5 { #endif -// This flag controls whether H5Library::initH5cpp has been called to register -// terminating functions with atexit() +// This flag indicates whether H5Library::initH5cpp has been called to register +// the terminating functions with atexit() bool IdComponent::H5cppinit = false; + +// This flag is used to decide whether H5dont_atexit should be called. +// Subclasses that have global constants use it. This is a temporary +// work-around in 1.8.16. It will be removed after HDFFV-9540 is fixed. bool IdComponent::H5dontAtexit_called = false; //-------------------------------------------------------------------------- // Function: IdComponent overloaded constructor -// Purpose Creates an IdComponent object using the id of an existing object. +///\brief Creates an IdComponent object using the id of an existing +/// object. - Obsolete, will be removed in 1.8.17 // Param h5_id - IN: Id of an existing object // Exception H5::DataTypeIException // Programmer Binh-Minh Ribler - 2000 @@ -43,7 +48,6 @@ bool IdComponent::H5dontAtexit_called = false; // been moved to the sub-classes. It will be removed in 1.10 release. If its // removal does not raise any problems in 1.10, it will be removed from 1.8 in // subsequent releases. -// - Removed from documentation in 1.8.16 -BMR (October 2015) //-------------------------------------------------------------------------- IdComponent::IdComponent(const hid_t h5_id) {} @@ -295,10 +299,10 @@ H5std_string IdComponent::inMemFunc(const char* func_name) const IdComponent::IdComponent() { // initH5cpp will register the terminating functions with atexit(). - // We only do this once. + // This should only be done once. if (!H5cppinit) { - H5Library::getInstance()->initH5cpp(); + H5Library::initH5cpp(); H5cppinit = true; } } diff --git a/c++/src/H5IdComponent.h b/c++/src/H5IdComponent.h index 1c29f09..61c8bd6 100644 --- a/c++/src/H5IdComponent.h +++ b/c++/src/H5IdComponent.h @@ -17,6 +17,8 @@ #ifndef __IdComponent_H #define __IdComponent_H +// IdComponent represents an HDF5 object that has an identifier. + #ifndef H5_NO_NAMESPACE namespace H5 { #endif @@ -30,12 +32,7 @@ class DataSpace; rarely needs them. */ class H5_DLLCPP IdComponent { - public: - -#ifndef DOXYGEN_SHOULD_SKIP_THIS - static bool H5cppinit; - static bool H5dontAtexit_called; -#endif // DOXYGEN_SHOULD_SKIP_THIS + public: // Increment reference counter. void incRefCount(const hid_t obj_id) const; @@ -58,11 +55,6 @@ class H5_DLLCPP IdComponent { // Assignment operator. IdComponent& operator=( const IdComponent& rhs ); -#ifndef DOXYGEN_SHOULD_SKIP_THIS - // Gets the identifier of this object. - virtual hid_t getId () const = 0; -#endif // DOXYGEN_SHOULD_SKIP_THIS - // Sets the identifier of this object to a new value. void setId(const hid_t new_id); @@ -76,10 +68,14 @@ class H5_DLLCPP IdComponent { // Creates an object to hold an HDF5 identifier. IdComponent( const hid_t h5_id ); +#ifndef DOXYGEN_SHOULD_SKIP_THIS + // Copy constructor: makes copy of the original IdComponent object. - // IdComponent( const IdComponent& original ); + // IdComponent( const IdComponent& original ); - removed from 1.8.15 + + // Gets the identifier of this object. + virtual hid_t getId () const = 0; -#ifndef DOXYGEN_SHOULD_SKIP_THIS // Pure virtual function for there are various H5*close for the // subclasses. virtual void close() = 0; @@ -96,11 +92,12 @@ class H5_DLLCPP IdComponent { // Destructor virtual ~IdComponent(); - protected: +#ifndef DOXYGEN_SHOULD_SKIP_THIS + + protected: // Default constructor. IdComponent(); -#ifndef DOXYGEN_SHOULD_SKIP_THIS // Gets the name of the file, in which an HDF5 object belongs. H5std_string p_get_file_name() const; @@ -110,7 +107,14 @@ class H5_DLLCPP IdComponent { // Sets the identifier of this object to a new value. - this one // doesn't increment reference count virtual void p_setId(const hid_t new_id) = 0; - //virtual void p_setId(const hid_t new_id); + + // This flag is used to decide whether H5dont_atexit should be called + static bool H5dontAtexit_called; + + private: + // This flag indicates whether H5Library::initH5cpp has been called + // to register various terminating functions with atexit() + static bool H5cppinit; #endif // DOXYGEN_SHOULD_SKIP_THIS diff --git a/c++/src/H5Library.cpp b/c++/src/H5Library.cpp index e7e9fb6..40c766a 100644 --- a/c++/src/H5Library.cpp +++ b/c++/src/H5Library.cpp @@ -38,11 +38,14 @@ namespace H5 { #endif #ifndef DOXYGEN_SHOULD_SKIP_THIS -H5Library* H5Library::instance = 0; + +// This static variable is unused, will be removed in future releases. +bool H5Library::need_cleanup = false; + #endif // DOXYGEN_SHOULD_SKIP_THIS //-------------------------------------------------------------------------- -// Function: H5Library::open +// Function: H5Library::open (static) ///\brief Initializes the HDF5 library. /// ///\exception H5::LibraryIException @@ -58,7 +61,7 @@ void H5Library::open() } //-------------------------------------------------------------------------- -// Function: H5Library::close +// Function: H5Library::close (static) ///\brief Flushes all data to disk, closes files, and cleans up memory. /// ///\exception H5::LibraryIException @@ -74,7 +77,7 @@ void H5Library::close() } //-------------------------------------------------------------------------- -// Function: H5Library::dontAtExit +// Function: H5Library::dontAtExit (static) ///\brief Instructs library not to install the C \c atexit cleanup routine /// ///\exception H5::LibraryIException @@ -89,7 +92,7 @@ void H5Library::dontAtExit() } //-------------------------------------------------------------------------- -// Function: H5Library::getLibVersion +// Function: H5Library::getLibVersion (static) ///\brief Returns the HDF library release number. ///\param majnum - OUT: Major version of the library ///\param minnum - OUT: Minor version of the library @@ -107,7 +110,7 @@ void H5Library::getLibVersion( unsigned& majnum, unsigned& minnum, unsigned& rel } //-------------------------------------------------------------------------- -// Function: H5Library::checkVersion +// Function: H5Library::checkVersion (static) ///\brief Verifies that the arguments match the version numbers /// compiled into the library ///\param majnum - IN: Major version of the library @@ -130,7 +133,7 @@ void H5Library::checkVersion(unsigned majnum, unsigned minnum, unsigned relnum) } //-------------------------------------------------------------------------- -// Function: H5Library::garbageCollect +// Function: H5Library::garbageCollect (static) ///\brief Walks through all the garbage collection routines for the /// library, which are supposed to free any unused memory they /// have allocated. @@ -159,7 +162,7 @@ void H5Library::garbageCollect() } //-------------------------------------------------------------------------- -// Function: H5Library::initH5cpp +// Function: H5Library::initH5cpp (static) ///\brief Initializes C++ library and registers terminating functions at /// exit. Only for the library functions, not for user-defined /// functions. @@ -167,52 +170,56 @@ void H5Library::garbageCollect() // initH5cpp registers the following functions with std::atexit(): // termH5cpp() - calls H5close() after all cleanup in // the C++ library is done -// ::deleteConstants - deletes all references for -// global constants +// ::deleteConstants - deletes all references +// for global constants ///\exception H5::LibraryIException // // Programmer Binh-Minh Ribler - September, 2015 //-------------------------------------------------------------------------- void H5Library::initH5cpp() { - // Register terminating functions with atexit(); they will be invoked in the - // reversed order + // Register terminating functions with atexit(); they will be invoked in + // the reversed order int ret_value = 0; ret_value = std::atexit(termH5cpp); if (ret_value != 0) - throw LibraryIException("H5Library::initH5cpp", "Registration of termH5cpp failed"); + throw LibraryIException("H5Library::initH5cpp", "Registrating termH5cpp failed"); ret_value = std::atexit(PredType::deleteConstants); if (ret_value != 0) - throw LibraryIException("H5Library::initH5cpp", "Registration of PredType::deleteConstants failed"); + throw LibraryIException("H5Library::initH5cpp", "Registrating PredType::deleteConstants failed"); ret_value = std::atexit(PropList::deleteConstants); if (ret_value != 0) - throw LibraryIException("H5Library::initH5cpp", "Registration of PropList::deleteConstants failed"); + throw LibraryIException("H5Library::initH5cpp", "Registrating PropList::deleteConstants failed"); ret_value = std::atexit(FileAccPropList::deleteConstants); if (ret_value != 0) - throw LibraryIException("H5Library::initH5cpp", "Registration of FileAccPropList::deleteConstants failed"); + throw LibraryIException("H5Library::initH5cpp", "Registrating FileAccPropList::deleteConstants failed"); ret_value = std::atexit(FileCreatPropList::deleteConstants); if (ret_value != 0) - throw LibraryIException("H5Library::initH5cpp", "Registration of FileCreatPropList::deleteConstants failed"); + throw LibraryIException("H5Library::initH5cpp", "Registrating FileCreatPropList::deleteConstants failed"); ret_value = std::atexit(DSetMemXferPropList::deleteConstants); if (ret_value != 0) - throw LibraryIException("H5Library::initH5cpp", "Registration of DSetMemXferPropList::deleteConstants failed"); + throw LibraryIException("H5Library::initH5cpp", "Registrating DSetMemXferPropList::deleteConstants failed"); ret_value = std::atexit(DSetCreatPropList::deleteConstants); if (ret_value != 0) - throw LibraryIException("H5Library::initH5cpp", "Registration of DSetCreatPropList::deleteConstants failed"); + throw LibraryIException("H5Library::initH5cpp", "Registrating DSetCreatPropList::deleteConstants failed"); + + ret_value = std::atexit(ObjCreatPropList::deleteConstants); + if (ret_value != 0) + throw LibraryIException("H5Library::initH5cpp", "Registrating ObjCreatPropList::deleteConstants failed"); ret_value = std::atexit(DataSpace::deleteConstants); if (ret_value != 0) - throw LibraryIException("H5Library::initH5cpp", "Registration of DataSpace::deleteConstants failed"); + throw LibraryIException("H5Library::initH5cpp", "Registrating DataSpace::deleteConstants failed"); } //-------------------------------------------------------------------------- -// Function: H5Library::termH5cpp +// Function: H5Library::termH5cpp (static) ///\brief Sends request for the C layer to terminate. ///\par Description /// If the C library fails to terminate, exit with a failure. @@ -227,24 +234,7 @@ void H5Library::termH5cpp() } //-------------------------------------------------------------------------- -// Function: H5Library::getInstance -///\brief Provides a way to instantiate the class. -///\par Description -/// getInstance ensures that only one instance of the H5Library -/// is created. -// Programmer Binh-Minh Ribler - September, 2015 -//-------------------------------------------------------------------------- -H5Library* H5Library::getInstance() -{ - if (H5Library::instance == 0) - { - instance = new H5Library(); - } - return(instance); -} - -//-------------------------------------------------------------------------- -// Function: H5Library::setFreeListLimits +// Function: H5Library::setFreeListLimits (static) ///\brief Sets limits on the different kinds of free lists. ///\param reg_global_lim - IN: Limit on all "regular" free list memory used ///\param reg_list_lim - IN: Limit on memory used in each "regular" free list @@ -271,10 +261,10 @@ void H5Library::setFreeListLimits(int reg_global_lim, int reg_list_lim, } } -// Default constructor - no instance ever created by outsiders +// Default constructor - private H5Library::H5Library(){}; -// Destructor +// Destructor - private H5Library::~H5Library(){}; #ifndef H5_NO_NAMESPACE diff --git a/c++/src/H5Library.h b/c++/src/H5Library.h index 68ab039..336f9c8 100644 --- a/c++/src/H5Library.h +++ b/c++/src/H5Library.h @@ -29,6 +29,11 @@ namespace H5 { */ class H5_DLLCPP H5Library { public: +#ifndef DOXYGEN_SHOULD_SKIP_THIS + static bool need_cleanup; // indicates if H5close should be called + // - unused, will be removed in future releases. +#endif // DOXYGEN_SHOULD_SKIP_THIS + // Initializes the HDF5 library. static void open(); @@ -60,15 +65,10 @@ class H5_DLLCPP H5Library { // Sends request for terminating the HDF5 library. static void termH5cpp(void); - static H5Library* getInstance(); - #ifndef DOXYGEN_SHOULD_SKIP_THIS private: - // private instance to be created by H5Library only - static H5Library* instance; - // Default constructor - no instance ever created from outsiders H5Library(); -- cgit v0.12 From 8c789704da055918bf1294c5d80f5a4add8572bc Mon Sep 17 00:00:00 2001 From: Scot Breitenfeld Date: Mon, 12 Oct 2015 11:28:18 -0500 Subject: [svn-r28039] Fixed valgrind mem leak. Tested: h5committest (partial). --- fortran/src/H5Of.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/fortran/src/H5Of.c b/fortran/src/H5Of.c index 4801f7d..9e3ddc4 100644 --- a/fortran/src/H5Of.c +++ b/fortran/src/H5Of.c @@ -901,13 +901,19 @@ h5oget_comment_by_name_c (hid_t_f *loc_id, _fcd name, size_t_f *name_size, if((c_bufsize = H5Oget_comment_by_name((hid_t)*loc_id, c_name, c_comment, (size_t)*commentsize,(hid_t)*lapl_id )) < 0) HGOTO_DONE(FAIL); + if(c_name) + HDfree(c_name); + *bufsize = (size_t_f)c_bufsize; /* * Convert C name to FORTRAN and place it in the given buffer */ - if(c_comment) + if(c_comment) { HD5packFstring(c_comment, _fcdtocp(comment), c_commentsize - 1); + HDfree(c_comment); + } + return ret_value; done: -- cgit v0.12 From 3aee46a9569285c0aab6b3e1ddfef85075bb85dc Mon Sep 17 00:00:00 2001 From: Mohamad Chaarawi Date: Mon, 12 Oct 2015 11:53:51 -0500 Subject: [svn-r28040] avoid use of MPI deprecated routines. --- testpar/t_mpi.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/testpar/t_mpi.c b/testpar/t_mpi.c index feea137..c234257 100644 --- a/testpar/t_mpi.c +++ b/testpar/t_mpi.c @@ -626,7 +626,7 @@ Test Whether the Displacement of MPI derived datatype and this platform. 1. Details for the test: -1) Create two derived datatypes with MPI_Type_hindexed: +1) Create two derived datatypes with MPI_Type_create_hindexed: datatype1: count = 1, blocklens = 1, offsets = 0, base type = MPI_BYTE(essentially a char) @@ -635,7 +635,7 @@ and this platform. base type = MPI_BYTE 2) Using these two derived datatypes, - Build another derived datatype with MPI_Type_struct: + Build another derived datatype with MPI_Type_create_struct: advtype: derived from datatype1 and datatype2 advtype: count = 2, blocklens[0] = 1, blocklens[1]=1, @@ -716,7 +716,7 @@ static int test_mpio_derived_dtype(char *filename) { blocklens[0] = 1; offsets[0] = 0; - if((mpi_err= MPI_Type_hindexed(count,blocklens,offsets,MPI_BYTE,&filetype)) + if((mpi_err= MPI_Type_create_hindexed(count,blocklens,offsets,MPI_BYTE,&filetype)) != MPI_SUCCESS){ MPI_Error_string(mpi_err, mpi_err_str, &mpi_err_strlen); printf("MPI_Type_contiguous failed (%s)\n", mpi_err_str); @@ -732,7 +732,7 @@ static int test_mpio_derived_dtype(char *filename) { count = 1; blocklens[0]=1; offsets[0] = 1; - if((mpi_err= MPI_Type_hindexed(count,blocklens,offsets,MPI_BYTE,&filetypenew)) + if((mpi_err= MPI_Type_create_hindexed(count,blocklens,offsets,MPI_BYTE,&filetypenew)) != MPI_SUCCESS){ MPI_Error_string(mpi_err, mpi_err_str, &mpi_err_strlen); printf("MPI_Type_contiguous failed (%s)\n", mpi_err_str); @@ -753,10 +753,10 @@ static int test_mpio_derived_dtype(char *filename) { bas_filetype[0] = filetype; bas_filetype[1] = filetypenew; - if((mpi_err= MPI_Type_struct(outcount,adv_blocklens,adv_disp,bas_filetype,&adv_filetype)) + if((mpi_err= MPI_Type_create_struct(outcount,adv_blocklens,adv_disp,bas_filetype,&adv_filetype)) != MPI_SUCCESS){ MPI_Error_string(mpi_err, mpi_err_str, &mpi_err_strlen); - printf("MPI_Type_struct failed (%s)\n", mpi_err_str); + printf("MPI_Type_create_struct failed (%s)\n", mpi_err_str); return 1; } if((mpi_err=MPI_Type_commit(&adv_filetype))!=MPI_SUCCESS){ @@ -843,7 +843,7 @@ has no contribution to IO. To properly test this case, at least FOUR processes are needed. 1. Details for the test: -1) Create one derived datatype with MPI_Type_hindexed: +1) Create one derived datatype with MPI_Type_create_hindexed: 2) Choosing at least two processes to contribute none for IO with the buf size inside MPI_Write_at_all to 0. @@ -899,7 +899,7 @@ test_mpio_special_collective(char *filename) offsets[1] = (mpi_size+mpi_rank)*count; if(count !=0) { - if((mpi_err = MPI_Type_hindexed(2, + if((mpi_err = MPI_Type_create_hindexed(2, blocklens, offsets, etype, @@ -915,7 +915,7 @@ test_mpio_special_collective(char *filename) return 1; } /* end if */ - if((mpi_err = MPI_Type_hindexed(2, + if((mpi_err = MPI_Type_create_hindexed(2, blocklens, offsets, etype, -- cgit v0.12 From bd995868ee2b1206f77f9c9fe03b6936473a82c8 Mon Sep 17 00:00:00 2001 From: Binh-Minh Ribler Date: Mon, 12 Oct 2015 23:57:28 -0500 Subject: [svn-r28047] Purpose: Fix memory leaks Description: - Implemented the friend function void f_PropList_setId(PropList* plist, hid_t new_id) to work around the same problem described in trunk r26655, for the API DataSet::getCreatePlist() - Cleaned up some comments and obsolete functions Platforms tested: Linux/32 2.6 (jam) Linux/64 (platypus) Darwin (osx1010test) --- c++/src/H5AbstractDs.cpp | 12 ------------ c++/src/H5CppDoc.h | 8 ++++---- c++/src/H5DataSet.cpp | 26 +++++++++++++++++++++++++- c++/src/H5DataType.cpp | 3 +-- c++/src/H5IdComponent.cpp | 20 +++----------------- c++/src/H5Location.h | 3 --- c++/src/H5PropList.h | 3 +++ 7 files changed, 36 insertions(+), 39 deletions(-) diff --git a/c++/src/H5AbstractDs.cpp b/c++/src/H5AbstractDs.cpp index 5929444..06b3e22 100644 --- a/c++/src/H5AbstractDs.cpp +++ b/c++/src/H5AbstractDs.cpp @@ -52,18 +52,6 @@ AbstractDs::AbstractDs(){} AbstractDs::AbstractDs(const hid_t ds_id){} //-------------------------------------------------------------------------- -// Function: AbstractDs copy constructor -///\brief Copy constructor: makes a copy of the original AbstractDs object. -// Programmer Binh-Minh Ribler - 2000 -// *** Deprecation warning *** -// This constructor is no longer appropriate because the data member "id" had -// been moved to the sub-classes. It is removed from 1.8.15 because it is -// a noop and it can be generated by the compiler if needed. -//-------------------------------------------------------------------------- -//-------------------------------------------------------------------------- -// AbstractDs::AbstractDs(const AbstractDs& original){} - -//-------------------------------------------------------------------------- // Function: AbstractDs::getTypeClass ///\brief Returns the class of the datatype that is used by this /// object, which can be a dataset or an attribute. diff --git a/c++/src/H5CppDoc.h b/c++/src/H5CppDoc.h index 388fc25..2420586 100644 --- a/c++/src/H5CppDoc.h +++ b/c++/src/H5CppDoc.h @@ -29,10 +29,10 @@ * The C++ API provides C++ wrappers for the HDF5 C Library. * * It is assumed that the user has knowledge of the - * + * * HDF5 file format and its components. * For more information on the HDF5 C Library, see the - * + * * HDF5 Software Documentation page. * * Because the HDF5 C Library maps very well to @@ -57,8 +57,8 @@ * * The HDF5 C++ API is included with the HDF5 source code and can * be obtained from - * - * http://www.hdfgroup.org/HDF5/release/obtainsrc.html. + * + * https://www.hdfgroup.org/HDF5/release/obtainsrc.html. * * Please refer to the release_docs/INSTALL file under the top directory * of the HDF5 source code for information about installing, building, diff --git a/c++/src/H5DataSet.cpp b/c++/src/H5DataSet.cpp index 0fc9105..059da85 100644 --- a/c++/src/H5DataSet.cpp +++ b/c++/src/H5DataSet.cpp @@ -60,6 +60,12 @@ DataSet::DataSet() : H5Object(), AbstractDs(), id(H5I_INVALID_HID) {} ///\brief Creates an DataSet object using the id of an existing dataset. ///\param existing_id - IN: Id of an existing dataset // Programmer Binh-Minh Ribler - 2000 +// Description +// incRefCount() is needed here to prevent the id from being closed +// prematurely. That is, when application uses the id of an +// existing DataSet object to create another DataSet object. So, +// when one of those objects is deleted, the id will be closed if +// the reference counter is only 1. //-------------------------------------------------------------------------- DataSet::DataSet(const hid_t existing_id) : H5Object(), AbstractDs() { @@ -172,8 +178,10 @@ DSetCreatPropList DataSet::getCreatePlist() const { throw DataSetIException("DataSet::getCreatePlist", "H5Dget_create_plist failed"); } + // create and return the DSetCreatPropList object - DSetCreatPropList create_plist(create_plist_id); // ok to use existing id const + DSetCreatPropList create_plist; + f_PropList_setId(&create_plist, create_plist_id); return(create_plist); } @@ -772,6 +780,22 @@ void DataSet::p_setId(const hid_t new_id) // reset object's id to the given id id = new_id; } + +//-------------------------------------------------------------------------- +// Function: f_PropList_setId - friend +// Purpose: This function is friend to class H5::PropList so that it +// can set PropList::id in order to work around a problem +// described in the JIRA issue HDFFV-7947. +// Applications shouldn't need to use it. +// param dset - IN/OUT: DataSet object to be changed +// param new_id - IN: New id to set +// Programmer Binh-Minh Ribler - 2015 +//-------------------------------------------------------------------------- +void f_PropList_setId(PropList* plist, hid_t new_id) +{ + plist->p_setId(new_id); +} + #endif // DOXYGEN_SHOULD_SKIP_THIS //-------------------------------------------------------------------------- diff --git a/c++/src/H5DataType.cpp b/c++/src/H5DataType.cpp index b352f2d..1bbabe3 100644 --- a/c++/src/H5DataType.cpp +++ b/c++/src/H5DataType.cpp @@ -239,8 +239,7 @@ DataType& DataType::operator=( const DataType& rhs ) { if (this != &rhs) { - id = rhs.id; - incRefCount(); // increment number of references to this id + setId(rhs.id); } return(*this); } diff --git a/c++/src/H5IdComponent.cpp b/c++/src/H5IdComponent.cpp index 19d68cf..60735f0 100644 --- a/c++/src/H5IdComponent.cpp +++ b/c++/src/H5IdComponent.cpp @@ -52,20 +52,6 @@ bool IdComponent::H5dontAtexit_called = false; IdComponent::IdComponent(const hid_t h5_id) {} //-------------------------------------------------------------------------- -// Function: IdComponent copy constructor -// Purpose: This noop copy constructor is removed as a result of the data -// member "id" being moved down to sub-classes. (Mar 2015) -// Parameters: original - IN: IdComponent instance to copy -// Programmer Binh-Minh Ribler - 2000 -// -// *** Deprecation warning *** -// This constructor is no longer appropriate because the data member "id" had -// been moved to the sub-classes. It is removed from 1.8.15 because it is -// a noop and it can be generated by the compiler if needed. -//-------------------------------------------------------------------------- -// IdComponent::IdComponent(const IdComponent& original) {} - -//-------------------------------------------------------------------------- // Function: IdComponent::incRefCount ///\brief Increment reference counter for a given id. // Programmer Binh-Minh Ribler - May 2005 @@ -231,7 +217,7 @@ IdComponent& IdComponent::operator=( const IdComponent& rhs ) //-------------------------------------------------------------------------- // Function: IdComponent::setId ///\brief Sets the identifier of this object to a new value. -/// +///\param new_id - IN: New identifier to be set to ///\exception H5::IdComponentException when the attempt to close the HDF5 /// object fails // Description: @@ -246,8 +232,8 @@ IdComponent& IdComponent::operator=( const IdComponent& rhs ) // C++ API object, which will be destroyed properly, and so // p_setId does not call incRefCount. On the other hand, the // public version setId is used by other applications, in which -// the id passed to setId already has a reference count, so setId -// must call incRefCount. +// the id passed to setId is that of another C++ API object, so +// setId must call incRefCount. //-------------------------------------------------------------------------- void IdComponent::setId(const hid_t new_id) { diff --git a/c++/src/H5Location.h b/c++/src/H5Location.h index 79a8d5c..9e4ec05 100644 --- a/c++/src/H5Location.h +++ b/c++/src/H5Location.h @@ -150,9 +150,6 @@ class H5_DLLCPP H5Location : public IdComponent { // Creates a copy of an existing object giving the location id. H5Location(const hid_t loc_id); - // Copy constructor. - // H5Location(const H5Location& original); - // Creates a reference to an HDF5 object or a dataset region. void p_reference(void* ref, const char* name, hid_t space_id, H5R_type_t ref_type) const; diff --git a/c++/src/H5PropList.h b/c++/src/H5PropList.h index be04451..7f6ee31 100644 --- a/c++/src/H5PropList.h +++ b/c++/src/H5PropList.h @@ -127,6 +127,9 @@ class H5_DLLCPP PropList : public IdComponent { // Dynamically allocates the PropList global constant static PropList* getConstant(); + // Friend function to set PropList id. For library use only. + friend void f_PropList_setId(PropList* plist, hid_t new_id); + #endif // DOXYGEN_SHOULD_SKIP_THIS }; -- cgit v0.12 From 7c4e5533fb95574034de860105059996b5372013 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 13 Oct 2015 10:16:22 -0500 Subject: [svn-r28053] Change file generation from build time to cmake time. --- src/CMakeLists.txt | 54 +++++++----------------------------------------------- 1 file changed, 7 insertions(+), 47 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index ef3e760..4ebcb5e 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -780,37 +780,17 @@ set (H5_GENERATED_HEADERS option (HDF5_GENERATE_HEADERS "Rebuild Generated Files" ON) mark_as_advanced (HDF5_GENERATE_HEADERS) if (HDF5_GENERATE_HEADERS) + set_source_files_properties(${H5_GENERATED_HEADERS} PROPERTIES GENERATED TRUE) find_package (Perl) if (PERL_FOUND) - add_custom_command ( - OUTPUT ${HDF5_SRC_DIR}/H5Edefin.h ${HDF5_SRC_DIR}/H5Einit.h ${HDF5_SRC_DIR}/H5Epubgen.h ${HDF5_SRC_DIR}/H5Eterm.h - PRE_BUILD - COMMAND ${PERL_EXECUTABLE} - ARGS ${HDF5_SOURCE_DIR}/bin/make_err ${HDF5_SRC_DIR}/H5err.txt - DEPENDS ${HDF5_SRC_DIR}/H5err.txt - COMMENT " Creating err header" + execute_process ( + COMMAND ${PERL_EXECUTABLE} ${HDF5_SOURCE_DIR}/bin/make_err ${HDF5_SRC_DIR}/H5err.txt ) - - add_custom_command ( - OUTPUT ${HDF5_SRC_DIR}/H5version.h - PRE_BUILD - COMMAND ${PERL_EXECUTABLE} - ARGS ${HDF5_SOURCE_DIR}/bin/make_vers ${HDF5_SRC_DIR}/H5vers.txt - DEPENDS ${HDF5_SRC_DIR}/H5vers.txt - COMMENT " Creating API version macro" + execute_process ( + COMMAND ${PERL_EXECUTABLE} ${HDF5_SOURCE_DIR}/bin/make_vers ${HDF5_SRC_DIR}/H5vers.txt ) - - add_custom_command ( - OUTPUT ${HDF5_SRC_DIR}/H5overflow.h - PRE_BUILD - COMMAND ${PERL_EXECUTABLE} - ARGS ${HDF5_SOURCE_DIR}/bin/make_overflow ${HDF5_SRC_DIR}/H5overflow.txt - DEPENDS ${HDF5_SRC_DIR}/H5overflow.txt - COMMENT " Creating Assignment overflow macro" - ) - - add_custom_target(run_perl_scripts ALL - DEPENDS ${HDF5_SRC_DIR}/H5Edefin.h ${HDF5_SRC_DIR}/H5Einit.h ${HDF5_SRC_DIR}/H5Epubgen.h ${HDF5_SRC_DIR}/H5Eterm.h ${HDF5_SRC_DIR}/H5version.h ${HDF5_SRC_DIR}/H5overflow.h + execute_process ( + COMMAND ${PERL_EXECUTABLE} ${HDF5_SOURCE_DIR}/bin/make_overflow ${HDF5_SRC_DIR}/H5overflow.txt ) else (PERL_FOUND) message (STATUS "Cannot generate headers - perl not found") @@ -826,11 +806,6 @@ TARGET_C_PROPERTIES (H5detect STATIC " " " ") if (MSVC OR MINGW) target_link_libraries (H5detect "ws2_32.lib") endif (MSVC OR MINGW) -if (HDF5_GENERATE_HEADERS) - add_dependencies(H5detect run_perl_scripts) -else (HDF5_GENERATE_HEADERS) - add_dependencies(H5detect "${H5_GENERATED_HEADERS}") -endif (HDF5_GENERATE_HEADERS) set (CMD $) add_custom_command ( @@ -845,11 +820,6 @@ TARGET_C_PROPERTIES (H5make_libsettings STATIC " " " ") if (MSVC OR MINGW) target_link_libraries (H5make_libsettings "ws2_32.lib") endif (MSVC OR MINGW) -if (HDF5_GENERATE_HEADERS) - add_dependencies(H5make_libsettings run_perl_scripts) -else (HDF5_GENERATE_HEADERS) - add_dependencies(H5make_libsettings "${H5_GENERATED_HEADERS}") -endif (HDF5_GENERATE_HEADERS) set (CMD $) add_custom_command ( @@ -881,11 +851,6 @@ set_target_properties (${HDF5_LIB_TARGET} PROPERTIES FOLDER libraries INTERFACE_INCLUDE_DIRECTORIES "$/include>" ) -if (HDF5_GENERATE_HEADERS) - add_dependencies(${HDF5_LIB_TARGET} run_perl_scripts) -else (HDF5_GENERATE_HEADERS) - add_dependencies(${HDF5_LIB_TARGET} "${HDF5_SRC_DIR}/H5Edefin.h;${HDF5_SRC_DIR}/H5Einit.h;${HDF5_SRC_DIR}/H5Epubgen.h;${HDF5_SRC_DIR}/H5Eterm.h") -endif (HDF5_GENERATE_HEADERS) option (HDF5_ENABLE_DEBUG_APIS "Turn on debugging in all packages" OFF) if (HDF5_ENABLE_DEBUG_APIS) @@ -914,11 +879,6 @@ if (BUILD_SHARED_LIBS) INTERFACE_INCLUDE_DIRECTORIES "$/include>" INTERFACE_COMPILE_DEFINITIONS H5_BUILT_AS_DYNAMIC_LIB=1 ) - if (HDF5_GENERATE_HEADERS) - add_dependencies(${HDF5_LIBSH_TARGET} run_perl_scripts) - else (HDF5_GENERATE_HEADERS) - add_dependencies(${HDF5_LIBSH_TARGET} "${HDF5_SRC_DIR}/H5Edefin.h;${HDF5_SRC_DIR}/H5Einit.h;${HDF5_SRC_DIR}/H5Epubgen.h;${HDF5_SRC_DIR}/H5Eterm.h") - endif (HDF5_GENERATE_HEADERS) if (HDF5_ENABLE_THREADSAFE) set_property (TARGET ${HDF5_LIBSH_TARGET} APPEND PROPERTY COMPILE_DEFINITIONS -- cgit v0.12 From 2c9b575d389760de5c09ab0acf43c4e990ef3fe4 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 13 Oct 2015 15:57:47 -0500 Subject: [svn-r28056] Add HL and Threadsafe notice --- CMakeLists.txt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index f7da488..0eaba05 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -571,6 +571,14 @@ if (WIN32) message (STATUS " **** Allowing unsupported C++ and thread-safety options **** ") endif (NOT ALLOW_UNSUPPORTED) endif (HDF5_BUILD_CPP_LIB) + if (HDF5_BUILD_HL_LIB) + if (NOT ALLOW_UNSUPPORTED) + message (STATUS " **** HL and thread-safety options are not supported **** ") + message (STATUS " **** thread-safety option will not be used building HL library **** ") + else (NOT ALLOW_UNSUPPORTED) + message (STATUS " **** Allowing unsupported HL and thread-safety options **** ") + endif (NOT ALLOW_UNSUPPORTED) + endif (HDF5_BUILD_HL_LIB) if (H5_HAVE_IOEO) message (STATUS " **** Win32 threads requires WINVER>=0x600 (Windows Vista/7/8) **** ") set (H5_HAVE_WIN_THREADS 1) -- cgit v0.12 From 2abe5da201ec47cc95f9d666cd32ff4efb5aafb6 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 13 Oct 2015 16:15:31 -0500 Subject: [svn-r28059] Make UNSUPPORTED option combinations fail configure - matches autotools behaviour. --- CMakeLists.txt | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0eaba05..88e58e0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -557,24 +557,21 @@ if (WIN32) endif (HDF5_ENABLE_PARALLEL) if (HDF5_BUILD_FORTRAN) if (NOT ALLOW_UNSUPPORTED) - message (STATUS " **** Fortran and thread-safety options are not supported **** ") - message (STATUS " **** thread-safety option will not be used building Fortran library **** ") + message (FATAL_ERROR " **** Fortran and thread-safety options are not supported **** ") else (NOT ALLOW_UNSUPPORTED) message (STATUS " **** Allowing unsupported Fortran and thread-safety options **** ") endif (NOT ALLOW_UNSUPPORTED) endif (HDF5_BUILD_FORTRAN) if (HDF5_BUILD_CPP_LIB) if (NOT ALLOW_UNSUPPORTED) - message (STATUS " **** C++ and thread-safety options are not supported **** ") - message (STATUS " **** thread-safety option will not be used building C++ library **** ") + message (FATAL_ERROR " **** C++ and thread-safety options are not supported **** ") else (NOT ALLOW_UNSUPPORTED) message (STATUS " **** Allowing unsupported C++ and thread-safety options **** ") endif (NOT ALLOW_UNSUPPORTED) endif (HDF5_BUILD_CPP_LIB) if (HDF5_BUILD_HL_LIB) if (NOT ALLOW_UNSUPPORTED) - message (STATUS " **** HL and thread-safety options are not supported **** ") - message (STATUS " **** thread-safety option will not be used building HL library **** ") + message (FATAL_ERROR " **** HL and thread-safety options are not supported **** ") else (NOT ALLOW_UNSUPPORTED) message (STATUS " **** Allowing unsupported HL and thread-safety options **** ") endif (NOT ALLOW_UNSUPPORTED) -- cgit v0.12 From 05233bfc73f4dd060b983e79aabd5150cf6b7fb2 Mon Sep 17 00:00:00 2001 From: Albert Cheng Date: Wed, 14 Oct 2015 16:54:56 -0500 Subject: [svn-r28075] HDF5 passed basic tests in Mac El Capitan VM and is added to the more tested platform section. --- release_docs/RELEASE.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index cc0fe84..1cfe382 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -277,6 +277,10 @@ The following platforms are not supported but have been tested for this release. g++ 4.6.1 20110422 gfortran 4.6.1 20110422 + Mac OS X El Capitan 10.11 Apple clang/clang++ version 7.0.0 from Xcode 7.0.1 + 64-bit gfortran GNU Fortran (GCC) 5.2.0 + (VM) + Debian7.5.0 3.2.0-4-686 #1 SMP Debian 3.2.51-1 i686 GNU/Linux gcc (Debian 4.7.2-5) 4.7.2 GNU Fortran (Debian 4.7.2-5) 4.7.2 -- cgit v0.12 From 3d8b36f6d16b680043f0f49c863ce5c6f0c525e2 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 15 Oct 2015 13:01:21 -0500 Subject: [svn-r28085] Add option to change cpack install location version (1.9 instead of 1.9.xxx) useful on windows. --- CMakeInstallation.cmake | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/CMakeInstallation.cmake b/CMakeInstallation.cmake index f87119e..bb5f046 100644 --- a/CMakeInstallation.cmake +++ b/CMakeInstallation.cmake @@ -295,7 +295,11 @@ if (NOT HDF5_EXTERNALLY_CONFIGURED AND NOT HDF5_NO_PACKAGES) 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}") + if (OVERRIDE_INSTALL_VERSION) + set (CPACK_PACKAGE_INSTALL_DIRECTORY "${CPACK_PACKAGE_VENDOR}/${CPACK_PACKAGE_NAME}/${OVERRIDE_INSTALL_VERSION}") + else (OVERRIDE_INSTALL_VERSION) + set (CPACK_PACKAGE_INSTALL_DIRECTORY "${CPACK_PACKAGE_VENDOR}/${CPACK_PACKAGE_NAME}/${CPACK_PACKAGE_VERSION}") + endif (OVERRIDE_INSTALL_VERSION) set (CPACK_PACKAGE_ICON "${HDF_RESOURCES_EXT_DIR}/hdf.bmp") set (CPACK_GENERATOR "TGZ") @@ -324,7 +328,11 @@ if (NOT HDF5_EXTERNALLY_CONFIGURED AND NOT HDF5_NO_PACKAGES) # set the package header icon for MUI set (CPACK_PACKAGE_ICON "${HDF_RESOURCES_EXT_DIR}\\\\hdf.bmp") set (CPACK_NSIS_DISPLAY_NAME "${CPACK_NSIS_PACKAGE_NAME}") - set (CPACK_PACKAGE_INSTALL_DIRECTORY "${CPACK_PACKAGE_VENDOR}\\\\${CPACK_PACKAGE_NAME}\\\\${CPACK_PACKAGE_VERSION}") + if (OVERRIDE_INSTALL_VERSION) + set (CPACK_PACKAGE_INSTALL_DIRECTORY "${CPACK_PACKAGE_VENDOR}\\\\${CPACK_PACKAGE_NAME}\\\\${OVERRIDE_INSTALL_VERSION}") + else (OVERRIDE_INSTALL_VERSION) + set (CPACK_PACKAGE_INSTALL_DIRECTORY "${CPACK_PACKAGE_VENDOR}\\\\${CPACK_PACKAGE_NAME}\\\\${CPACK_PACKAGE_VERSION}") + endif (OVERRIDE_INSTALL_VERSION) set (CPACK_NSIS_CONTACT "${HDF5_PACKAGE_BUGREPORT}") set (CPACK_NSIS_MODIFY_PATH ON) -- cgit v0.12 From 5464277d0ceb45208d8fc990d1c2b2fd6c0ebe02 Mon Sep 17 00:00:00 2001 From: Scot Breitenfeld Date: Thu, 15 Oct 2015 13:01:27 -0500 Subject: [svn-r28086] fixed spelling --- examples/h5_vds-simpleIO.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/h5_vds-simpleIO.c b/examples/h5_vds-simpleIO.c index b707ae4..6b12dc2 100644 --- a/examples/h5_vds-simpleIO.c +++ b/examples/h5_vds-simpleIO.c @@ -3,7 +3,7 @@ This example illustrates the concept of virtual dataset I/O The program creates 2-dim source dataset and writes data to it. Then it creates 2-dim virtual dataset that has - the same dimesnion sizes and maps the all elements of the + the same dimension sizes and maps the all elements of the virtual dataset to all elements of the source dataset. Then VDS is read back. -- cgit v0.12 From 86f450c240ced73d9da1ad9ec68786481d26a5f2 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 15 Oct 2015 14:58:41 -0500 Subject: [svn-r28089] Need to set a variable for matching install config names. --- config/cmake/HDF5_Examples.cmake.in | 1 + 1 file changed, 1 insertion(+) diff --git a/config/cmake/HDF5_Examples.cmake.in b/config/cmake/HDF5_Examples.cmake.in index 65e2e9e..e730625 100644 --- a/config/cmake/HDF5_Examples.cmake.in +++ b/config/cmake/HDF5_Examples.cmake.in @@ -65,6 +65,7 @@ else(WIN32) set(CTEST_SOURCE_DIRECTORY "${CTEST_DASHBOARD_ROOT}/${CTEST_SOURCE_NAME}") set(CTEST_BINARY_DIRECTORY "${CTEST_DASHBOARD_ROOT}/${CTEST_BINARY_NAME}") endif(WIN32) +set(BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF5_PACKAGE_NAME:STRING=@HDF5_PACKAGE@@HDF_PACKAGE_EXT@") ############################################################################################################### # For any comments please contact cdashhelp@hdfgroup.org -- cgit v0.12 From 60cdc22cd3f484dde11bfdf31833b351a616f138 Mon Sep 17 00:00:00 2001 From: Jerome Soumagne Date: Fri, 16 Oct 2015 17:01:24 -0500 Subject: [svn-r28112] CMake check for gettimeofday if not on windows --- config/cmake_ext_mod/ConfigureChecks.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/config/cmake_ext_mod/ConfigureChecks.cmake b/config/cmake_ext_mod/ConfigureChecks.cmake index 6885187..e441c4a 100644 --- a/config/cmake_ext_mod/ConfigureChecks.cmake +++ b/config/cmake_ext_mod/ConfigureChecks.cmake @@ -437,6 +437,7 @@ if (NOT WINDOWS) #----------------------------------------------------------------------------- # Check a bunch of time functions #----------------------------------------------------------------------------- + CHECK_FUNCTION_EXISTS (gettimeofday ${HDF_PREFIX}_HAVE_GETTIMEOFDAY) foreach (test HAVE_TM_GMTOFF HAVE___TM_GMTOFF -- cgit v0.12 From 0be7b0d5240d401398aafa0aa18f83faa635f286 Mon Sep 17 00:00:00 2001 From: Jerome Soumagne Date: Fri, 16 Oct 2015 17:01:51 -0500 Subject: [svn-r28113] A few warning fixes in cmake conversion tests --- config/cmake/ConversionTests.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/config/cmake/ConversionTests.c b/config/cmake/ConversionTests.c index d964bf8..b8946a8 100644 --- a/config/cmake/ConversionTests.c +++ b/config/cmake/ConversionTests.c @@ -1,5 +1,8 @@ #ifdef H5_LDOUBLE_TO_LONG_SPECIAL_TEST +#include +#include + int main(void) { long double ld = 20041683600089727.779961L; @@ -58,6 +61,9 @@ done: #ifdef H5_LONG_TO_LDOUBLE_SPECIAL_TEST +#include +#include + int main(void) { long double ld; @@ -117,6 +123,10 @@ done: #endif #ifdef H5_LDOUBLE_TO_LLONG_ACCURATE_TEST + +#include +#include + int main(void) { long double ld = 20041683600089727.779961L; @@ -156,6 +166,10 @@ done: #endif #ifdef H5_LLONG_TO_LDOUBLE_CORRECT_TEST + +#include +#include + int main(void) { long double ld; -- cgit v0.12 From d72281dff45bfdbcb37881390beb58e1b13c1853 Mon Sep 17 00:00:00 2001 From: Larry Knox Date: Fri, 16 Oct 2015 17:11:26 -0500 Subject: [svn-r28115] Replace unreadable, unused test file with newly generated file that can be read by h5dump from HDF5 1.6.10, 1.8.6, 1.8.16 and trunk. --- tools/testfiles/tldouble.h5 | Bin 2096 -> 2192 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/tools/testfiles/tldouble.h5 b/tools/testfiles/tldouble.h5 index 56f673f..eb031e7 100644 Binary files a/tools/testfiles/tldouble.h5 and b/tools/testfiles/tldouble.h5 differ -- cgit v0.12 From d1139d78d6f1fad592efb935a15556c87a0c3fc0 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 19 Oct 2015 12:13:50 -0500 Subject: [svn-r28126] Correct CMake var name --- release_docs/INSTALL_CMake.txt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/release_docs/INSTALL_CMake.txt b/release_docs/INSTALL_CMake.txt index 783c30d..302ed92 100644 --- a/release_docs/INSTALL_CMake.txt +++ b/release_docs/INSTALL_CMake.txt @@ -697,22 +697,22 @@ if(NOT DEFINED BUILD_GENERATOR) message(FATAL_ERROR "BUILD_GENERATOR must be defined - Unix, VS2013, VS201364, VS2012, or VS201264") else() if(${BUILD_GENERATOR} STREQUAL "Unix") - set(CMAKE_GENERATOR "Unix Makefiles") + set(CTEST_CMAKE_GENERATOR "Unix Makefiles") elseif(${BUILD_GENERATOR} STREQUAL "VS2013") - set(CMAKE_GENERATOR "Visual Studio 12 2013") + set(CTEST_CMAKE_GENERATOR "Visual Studio 12 2013") elseif(${BUILD_GENERATOR} STREQUAL "VS201364") - set(CMAKE_GENERATOR "Visual Studio 12 2013 Win64") + set(CTEST_CMAKE_GENERATOR "Visual Studio 12 2013 Win64") elseif(${BUILD_GENERATOR} STREQUAL "VS2012") - set(CMAKE_GENERATOR "Visual Studio 11 2012") + set(CTEST_CMAKE_GENERATOR "Visual Studio 11 2012") elseif(${BUILD_GENERATOR} STREQUAL "VS201264") - set(CMAKE_GENERATOR "Visual Studio 11 2012 Win64") + set(CTEST_CMAKE_GENERATOR "Visual Studio 11 2012 Win64") else() message(FATAL_ERROR "Invalid BUILD_GENERATOR must be - Unix, VS2013, VS201364, VS2012, or VS201264") endif() endif() if(NOT DEFINED INSTALLDIR) - if(WIN32) + if(NOT WIN32) set(INSTALLDIR "/usr/local/myhdf5") else() set(INSTALLDIR "C:\\Program\ Files\\myhdf5") -- cgit v0.12 From cd4b8356149fbd184428dc438fd3dd87248a50cb Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 19 Oct 2015 13:24:20 -0500 Subject: [svn-r28128] Add version extension to all uses of source name --- release_docs/INSTALL_CMake.txt | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/release_docs/INSTALL_CMake.txt b/release_docs/INSTALL_CMake.txt index 302ed92..cd4dc1f 100644 --- a/release_docs/INSTALL_CMake.txt +++ b/release_docs/INSTALL_CMake.txt @@ -794,7 +794,7 @@ set(MODEL "Experimental") #set(LOCAL_UPDATE "TRUE") set(REPOSITORY_URL "http://svn.hdfgroup.uiuc.edu/hdf5/trunk") #uncomment to use a compressed source file: *.tar on linux or mac *.zip on windows -#set(CTEST_USE_TAR_SOURCE "${CTEST_SOURCE_VERSION}") +#set(CTEST_USE_TAR_SOURCE "${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}") ################################################################### ################################################################### @@ -846,41 +846,41 @@ set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DCMAKE_INSTALL_PREFIX:PATH=${INSTAL if(WIN32) include(${CTEST_SCRIPT_DIRECTORY}\\CTestScript.cmake) - if(EXISTS "${CTEST_BINARY_DIRECTORY}\\HDF5-${CTEST_SOURCE_VERSION}-win${SITE_OS_BITS}.exe") - file(COPY "${CTEST_BINARY_DIRECTORY}\\HDF5-${CTEST_SOURCE_VERSION}-win${SITE_OS_BITS}.exe" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) + if(EXISTS "${CTEST_BINARY_DIRECTORY}\\HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-win${SITE_OS_BITS}.exe") + file(COPY "${CTEST_BINARY_DIRECTORY}\\HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-win${SITE_OS_BITS}.exe" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) endif() - if(EXISTS "${CTEST_BINARY_DIRECTORY}\\HDF5-${CTEST_SOURCE_VERSION}-win${SITE_OS_BITS}.msi") - file(COPY "${CTEST_BINARY_DIRECTORY}\\HDF5-${CTEST_SOURCE_VERSION}-win${SITE_OS_BITS}.msi" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) + if(EXISTS "${CTEST_BINARY_DIRECTORY}\\HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-win${SITE_OS_BITS}.msi") + file(COPY "${CTEST_BINARY_DIRECTORY}\\HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-win${SITE_OS_BITS}.msi" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) endif() - if(EXISTS "${CTEST_BINARY_DIRECTORY}\\HDF5-${CTEST_SOURCE_VERSION}-win${SITE_OS_BITS}.zip") - file(COPY "${CTEST_BINARY_DIRECTORY}\\HDF5-${CTEST_SOURCE_VERSION}-win${SITE_OS_BITS}.zip" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) + if(EXISTS "${CTEST_BINARY_DIRECTORY}\\HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-win${SITE_OS_BITS}.zip") + file(COPY "${CTEST_BINARY_DIRECTORY}\\HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-win${SITE_OS_BITS}.zip" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) endif() else() include(${CTEST_SCRIPT_DIRECTORY}/CTestScript.cmake) if(APPLE) - if(EXISTS "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}-Darwin.dmg") - file(COPY "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}-Darwin.dmg" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) + if(EXISTS "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-Darwin.dmg") + file(COPY "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-Darwin.dmg" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) endif() - if(EXISTS "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}-Darwin.tar.gz") - file(COPY "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}-Darwin.tar.gz" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) + if(EXISTS "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-Darwin.tar.gz") + file(COPY "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-Darwin.tar.gz" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) endif() - if(EXISTS "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}-Darwin.sh") - file(COPY "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}-Darwin.sh" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) + if(EXISTS "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-Darwin.sh") + file(COPY "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-Darwin.sh" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) endif() else() if(CYGWIN) - if(EXISTS "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}-CYGWIN.sh") - file(COPY "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}-CYGWIN.sh" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) + if(EXISTS "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-CYGWIN.sh") + file(COPY "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-CYGWIN.sh" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) endif() - if(EXISTS "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}-CYGWIN.tar.gz") - file(COPY "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}-CYGWIN.tar.gz" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) + if(EXISTS "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-CYGWIN.tar.gz") + file(COPY "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-CYGWIN.tar.gz" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) endif() else() - if(EXISTS "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}-Linux.sh") - file(COPY "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}-Linux.sh" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) + if(EXISTS "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-Linux.sh") + file(COPY "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-Linux.sh" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) endif() - if(EXISTS "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}-Linux.tar.gz") - file(COPY "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}-Linux.tar.gz" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) + if(EXISTS "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-Linux.tar.gz") + file(COPY "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-Linux.tar.gz" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) endif() endif() endif() -- cgit v0.12 From eca1bd1d8b6801afd1706dddfa42ed98b5265a4a Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 19 Oct 2015 14:20:04 -0500 Subject: [svn-r28130] Updated scripts --- config/cmake/scripts/CTestScript.cmake | 69 ++++++++++++++++++++++----------- config/cmake/scripts/HDF518config.cmake | 25 ++++++------ 2 files changed, 59 insertions(+), 35 deletions(-) diff --git a/config/cmake/scripts/CTestScript.cmake b/config/cmake/scripts/CTestScript.cmake index 9d0953e..d7c777d 100755 --- a/config/cmake/scripts/CTestScript.cmake +++ b/config/cmake/scripts/CTestScript.cmake @@ -56,6 +56,13 @@ if(APPLE) set(ENV{CC} "${XCODE_CC}") set(ENV{CXX} "${XCODE_CXX}") + if(NOT NO_MAC_FORTRAN) + # Shared fortran is not supported, build static + set(BUILD_OPTIONS "${BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=OFF -DCMAKE_ANSI_CFLAGS:STRING=-fPIC") + else(NOT NO_MAC_FORTRAN) + set(BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF5_BUILD_FORTRAN:BOOL=OFF") + endif(NOT NO_MAC_FORTRAN) + set(BUILD_OPTIONS "${BUILD_OPTIONS} -DCTEST_USE_LAUNCHERS:BOOL=ON -DCMAKE_BUILD_WITH_INSTALL_RPATH:BOOL=OFF") endif(APPLE) @@ -66,13 +73,13 @@ if(CTEST_USE_TAR_SOURCE) ## Uncompress source if tar file provided ## -------------------------- if(WIN32) - message(STATUS "extracting... [${CMAKE_EXECUTABLE_NAME} x ${CTEST_USE_TAR_SOURCE}.zip]") + message(STATUS "extracting... [${CMAKE_EXECUTABLE_NAME} x ${CTEST_DASHBOARD_ROOT}\\${CTEST_USE_TAR_SOURCE}.zip]") execute_process(COMMAND ${CMAKE_EXECUTABLE_NAME} -E tar -xvf ${CTEST_DASHBOARD_ROOT}\\${CTEST_USE_TAR_SOURCE}.zip RESULT_VARIABLE rv) else() - message(STATUS "extracting... [${CMAKE_EXECUTABLE_NAME} -E tar -xvf ${CTEST_USE_TAR_SOURCE}.tar]") + message(STATUS "extracting... [${CMAKE_EXECUTABLE_NAME} -E tar -xvf ${CTEST_DASHBOARD_ROOT}/${CTEST_USE_TAR_SOURCE}.tar]") execute_process(COMMAND ${CMAKE_EXECUTABLE_NAME} -E tar -xvf ${CTEST_DASHBOARD_ROOT}/${CTEST_USE_TAR_SOURCE}.tar RESULT_VARIABLE rv) endif() - + if(NOT rv EQUAL 0) message(STATUS "extracting... [error-(${rv}) clean up]") file(REMOVE_RECURSE "${CTEST_SOURCE_DIRECTORY}") @@ -159,12 +166,23 @@ endif() #----------------------------------------------------------------------------- # Send the main script as a note. -list(APPEND CTEST_NOTES_FILES - "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}" - "${CMAKE_CURRENT_LIST_FILE}" - "${CTEST_SOURCE_DIRECTORY}/config/cmake/cacheinit.cmake" -) - +if(USE_AUTOTOOLS) + ## autotools builds need to use make and does not use the cacheinit.cmake file + ## -- make command + ## ----------------- + find_program(MAKE NAMES make) + list(APPEND CTEST_NOTES_FILES + "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}" + "${CMAKE_CURRENT_LIST_FILE}" + ) +else() + list(APPEND CTEST_NOTES_FILES + "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}" + "${CMAKE_CURRENT_LIST_FILE}" + "${CTEST_SOURCE_DIRECTORY}/config/cmake/cacheinit.cmake" + ) +endif() + #----------------------------------------------------------------------------- # Check for required variables. # -------------------------- @@ -181,20 +199,27 @@ endforeach(req) #----------------------------------------------------------------------------- # Initialize the CTEST commands #------------------------------ -if(LOCAL_MEMCHECK_TEST) - find_program(CTEST_MEMORYCHECK_COMMAND NAMES valgrind) - set (CTEST_CONFIGURE_COMMAND - "${CTEST_CMAKE_COMMAND} -C \"${CTEST_SOURCE_DIRECTORY}/config/cmake/mccacheinit.cmake\" -DCMAKE_BUILD_TYPE:STRING=${CTEST_BUILD_CONFIGURATION} ${BUILD_OPTIONS} \"-G${CTEST_CMAKE_GENERATOR}\" \"${CTEST_SOURCE_DIRECTORY}\"" - ) -else() - if(LOCAL_COVERAGE_TEST) - find_program(CTEST_COVERAGE_COMMAND NAMES gcov) +if(USE_AUTOTOOLS) + set(CTEST_CONFIGURE_COMMAND "${CTEST_SOURCE_DIRECTORY}/configure ${ADD_BUILD_OPTIONS}") + set(CTEST_BUILD_COMMAND "${MAKE} ${CTEST_BUILD_FLAGS}") + configure_file(${CTEST_SOURCE_DIRECTORY}/config/cmake/CTestCustom.cmake ${CTEST_BINARY_DIRECTORY}/CTestCustom.cmake) + file(WRITE ${CTEST_BINARY_DIRECTORY}/CTestTestfile.cmake "ADD_TEST(makecheck \"${MAKE}\" \"${CTEST_BUILD_FLAGS}\" \"-i\" \"check\")") +else(USE_AUTOTOOLS) + if(LOCAL_MEMCHECK_TEST) + find_program(CTEST_MEMORYCHECK_COMMAND NAMES valgrind) + set (CTEST_CONFIGURE_COMMAND + "${CTEST_CMAKE_COMMAND} -C \"${CTEST_SOURCE_DIRECTORY}/config/cmake/mccacheinit.cmake\" -DCMAKE_BUILD_TYPE:STRING=${CTEST_BUILD_CONFIGURATION} ${BUILD_OPTIONS} \"-G${CTEST_CMAKE_GENERATOR}\" \"${CTEST_SOURCE_DIRECTORY}\"" + ) + else() + if(LOCAL_COVERAGE_TEST) + find_program(CTEST_COVERAGE_COMMAND NAMES gcov) + endif() + set (CTEST_CONFIGURE_COMMAND + "${CTEST_CMAKE_COMMAND} -C \"${CTEST_SOURCE_DIRECTORY}/config/cmake/cacheinit.cmake\" -DCMAKE_BUILD_TYPE:STRING=${CTEST_BUILD_CONFIGURATION} ${BUILD_OPTIONS} \"-G${CTEST_CMAKE_GENERATOR}\" \"${CTEST_SOURCE_DIRECTORY}\"" + ) endif() - set (CTEST_CONFIGURE_COMMAND - "${CTEST_CMAKE_COMMAND} -C \"${CTEST_SOURCE_DIRECTORY}/config/cmake/cacheinit.cmake\" -DCMAKE_BUILD_TYPE:STRING=${CTEST_BUILD_CONFIGURATION} ${BUILD_OPTIONS} \"-G${CTEST_CMAKE_GENERATOR}\" \"${CTEST_SOURCE_DIRECTORY}\"" - ) endif() - + #----------------------------------------------------------------------------- ## -- set output to english set($ENV{LC_MESSAGES} "en_EN") @@ -230,8 +255,6 @@ message(STATUS "Dashboard script configuration:\n${vars}\n") if(LOCAL_UPDATE) ctest_update (SOURCE "${CTEST_SOURCE_DIRECTORY}") endif() - configure_file(${CTEST_SOURCE_DIRECTORY}/config/cmake/CTestCustom.cmake ${CTEST_BINARY_DIRECTORY}/CTestCustom.cmake) - ctest_read_custom_files ("${CTEST_BINARY_DIRECTORY}") ctest_configure (BUILD "${CTEST_BINARY_DIRECTORY}") if(LOCAL_SUBMIT) ctest_submit (PARTS Update Configure Notes) diff --git a/config/cmake/scripts/HDF518config.cmake b/config/cmake/scripts/HDF518config.cmake index 897bcbe..1c92e1e 100755 --- a/config/cmake/scripts/HDF518config.cmake +++ b/config/cmake/scripts/HDF518config.cmake @@ -23,14 +23,15 @@ cmake_minimum_required(VERSION 3.1.0 FATAL_ERROR) # NO_MAC_FORTRAN - Yes to be SHARED on a Mac ############################################################################## -set(CTEST_SOURCE_VERSION 1.9) +set(CTEST_SOURCE_VERSION 1.8.16) +set(CTEST_SOURCE_VERSEXT "-pre1") ############################################################################## # handle input parameters to script. #BUILD_GENERATOR - which CMake generator to use, required -#INSTALLDIR - HDF5-1.9 root folder +#INSTALLDIR - HDF5-1.8 root folder #CTEST_BUILD_CONFIGURATION - Release, Debug, RelWithDebInfo -#CTEST_SOURCE_NAME - name of source folder; HDF5-1.9 +#CTEST_SOURCE_NAME - name of source folder; HDF5-1.8 #STATICLIBRARIES - Default is YES #NO_MAC_FORTRAN - set to TRUE to allow shared libs on a Mac if(DEFINED CTEST_SCRIPT_ARG) @@ -50,15 +51,15 @@ if(NOT DEFINED BUILD_GENERATOR) message(FATAL_ERROR "BUILD_GENERATOR must be defined - Unix, VS2013, VS201364, VS2012, or VS201264") else() if(${BUILD_GENERATOR} STREQUAL "Unix") - set(CMAKE_GENERATOR "Unix Makefiles") + set(CTEST_CMAKE_GENERATOR "Unix Makefiles") elseif(${BUILD_GENERATOR} STREQUAL "VS2013") - set(CMAKE_GENERATOR "Visual Studio 12 2013") + set(CTEST_CMAKE_GENERATOR "Visual Studio 12 2013") elseif(${BUILD_GENERATOR} STREQUAL "VS201364") - set(CMAKE_GENERATOR "Visual Studio 12 2013 Win64") + set(CTEST_CMAKE_GENERATOR "Visual Studio 12 2013 Win64") elseif(${BUILD_GENERATOR} STREQUAL "VS2012") - set(CMAKE_GENERATOR "Visual Studio 11 2012") + set(CTEST_CMAKE_GENERATOR "Visual Studio 11 2012") elseif(${BUILD_GENERATOR} STREQUAL "VS201264") - set(CMAKE_GENERATOR "Visual Studio 11 2012 Win64") + set(CTEST_CMAKE_GENERATOR "Visual Studio 11 2012 Win64") else() message(FATAL_ERROR "Invalid BUILD_GENERATOR must be - Unix, VS2013, VS201364, VS2012, or VS201264") endif() @@ -66,9 +67,9 @@ endif() if(NOT DEFINED INSTALLDIR) if(WIN32) - set(INSTALLDIR "/usr/local/myhdf5") - else() set(INSTALLDIR "C:\\Program\ Files\\myhdf5") + else() + set(INSTALLDIR "/usr/local/myhdf5") endif() endif() if(NOT DEFINED CTEST_BUILD_CONFIGURATION) @@ -145,9 +146,9 @@ set(MODEL "Experimental") #set(LOCAL_NO_PACKAGE "TRUE") ##### Following controls source update ##### #set(LOCAL_UPDATE "TRUE") -set(REPOSITORY_URL "http://svn.hdfgroup.uiuc.edu/hdf5/trunk") +set(REPOSITORY_URL "http://svn.hdfgroup.uiuc.edu/hdf5/branches/hdf5_1_8_16") #uncomment to use a compressed source file: *.tar on linux or mac *.zip on windows -#set(CTEST_USE_TAR_SOURCE "${CTEST_SOURCE_VERSION}") +#set(CTEST_USE_TAR_SOURCE "${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}") ################################################################### ################################################################### -- cgit v0.12 From a9da5b8cc5e952bfa2162de3cae7dae4b31b0996 Mon Sep 17 00:00:00 2001 From: Jerome Soumagne Date: Mon, 19 Oct 2015 15:32:49 -0500 Subject: [svn-r28131] Cleanup cmake output of HDF5UseFortran --- config/cmake/HDF5UseFortran.cmake | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/config/cmake/HDF5UseFortran.cmake b/config/cmake/HDF5UseFortran.cmake index 8ca10a7..c3e5a24 100644 --- a/config/cmake/HDF5UseFortran.cmake +++ b/config/cmake/HDF5UseFortran.cmake @@ -217,9 +217,9 @@ list(GET PROG_OUTPUT 4 NUM_RKIND) set(H5CONFIG_F_NUM_IKIND "INTEGER, PARAMETER :: num_ikinds = ${NUM_IKIND}") set(H5CONFIG_F_IKIND "INTEGER, DIMENSION(1:num_ikinds) :: ikind = (/${pac_validIntKinds}/)") -message ( " ........REAL KINDS FOUND ${PAC_FC_ALL_REAL_KINDS}") -message ( " ........INTEGER KINDS FOUND ${PAC_FC_ALL_REAL_KINDS}") -message ( " ........MAX DECIMAL PRECISION ${H5_PAC_FC_MAX_REAL_PRECISION}") +message (STATUS "....REAL KINDS FOUND ${PAC_FC_ALL_REAL_KINDS}") +message (STATUS "....INTEGER KINDS FOUND ${PAC_FC_ALL_REAL_KINDS}") +message (STATUS "....MAX DECIMAL PRECISION ${H5_PAC_FC_MAX_REAL_PRECISION}") #----------------------------------------------------------------------------- # Determine the available KINDs for REALs and INTEGERs @@ -258,7 +258,7 @@ string(REGEX REPLACE " " "" pack_int_sizeof "${pack_int_sizeof}") set(PAC_FC_ALL_INTEGER_KINDS_SIZEOF "\{${pack_int_sizeof}\}") -message("...FOUND SIZEOF for INTEGER KINDs ${PAC_FC_ALL_INTEGER_KINDS_SIZEOF}") +message(STATUS "....FOUND SIZEOF for INTEGER KINDs ${PAC_FC_ALL_INTEGER_KINDS_SIZEOF}") # ********** # REALS # ********** @@ -297,7 +297,7 @@ string(REGEX REPLACE " " "" pack_real_sizeof "${pack_real_sizeof}") set(H5CONFIG_F_RKIND_SIZEOF "INTEGER, DIMENSION(1:num_rkinds) :: rkind_sizeof = (/${pack_real_sizeof}/)") -message("...FOUND SIZEOF for REAL KINDs \{${pack_real_sizeof}\}") +message(STATUS "....FOUND SIZEOF for REAL KINDs \{${pack_real_sizeof}\}") set(PAC_FC_ALL_REAL_KINDS_SIZEOF "\{${pack_real_sizeof}\}") -- cgit v0.12 From 2af0d74216f1cdb0608a535a74c2a318a60b6e26 Mon Sep 17 00:00:00 2001 From: Jerome Soumagne Date: Mon, 19 Oct 2015 15:33:27 -0500 Subject: [svn-r28132] Cleanup cmake output of HDF5_GENERATE_HEADERS perl script --- src/CMakeLists.txt | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 4ebcb5e..cf218d7 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -784,14 +784,17 @@ if (HDF5_GENERATE_HEADERS) find_package (Perl) if (PERL_FOUND) execute_process ( - COMMAND ${PERL_EXECUTABLE} ${HDF5_SOURCE_DIR}/bin/make_err ${HDF5_SRC_DIR}/H5err.txt + COMMAND ${PERL_EXECUTABLE} ${HDF5_SOURCE_DIR}/bin/make_err ${HDF5_SRC_DIR}/H5err.txt OUTPUT_VARIABLE SCRIPT_OUTPUT ) + message(STATUS ${SCRIPT_OUTPUT}) execute_process ( - COMMAND ${PERL_EXECUTABLE} ${HDF5_SOURCE_DIR}/bin/make_vers ${HDF5_SRC_DIR}/H5vers.txt + COMMAND ${PERL_EXECUTABLE} ${HDF5_SOURCE_DIR}/bin/make_vers ${HDF5_SRC_DIR}/H5vers.txt OUTPUT_VARIABLE SCRIPT_OUTPUT ) + message(STATUS ${SCRIPT_OUTPUT}) execute_process ( - COMMAND ${PERL_EXECUTABLE} ${HDF5_SOURCE_DIR}/bin/make_overflow ${HDF5_SRC_DIR}/H5overflow.txt + COMMAND ${PERL_EXECUTABLE} ${HDF5_SOURCE_DIR}/bin/make_overflow ${HDF5_SRC_DIR}/H5overflow.txt OUTPUT_VARIABLE SCRIPT_OUTPUT ) + message(STATUS ${SCRIPT_OUTPUT}) else (PERL_FOUND) message (STATUS "Cannot generate headers - perl not found") endif (PERL_FOUND) -- cgit v0.12 From 2094d8646199996f655bb5f56f142216bc2abfcf Mon Sep 17 00:00:00 2001 From: Jerome Soumagne Date: Tue, 20 Oct 2015 01:28:17 -0500 Subject: [svn-r28138] Add first support for _Bool and make hbool_t a "real" _Bool if available Fix tests accordingly and fix misuse of hbool_t in various places Fix initialization of H5Pgcpl/ocpl structs in property decoding routines Tested on: Linux/32 (jam) Linux/64 (platypus) Linux/PPC64 (ostrich) MacOSX/64 10.11 --- c++/test/tattr.cpp | 2 +- c++/test/tlinks.cpp | 2 +- config/cmake/H5pubconf.h.in | 6 ++ config/cmake_ext_mod/ConfigureChecks.cmake | 13 +++ configure.ac | 12 +++ src/H5Odtype.c | 2 +- src/H5Pgcpl.c | 2 + src/H5Pocpl.c | 1 + src/H5T.c | 2 +- src/H5private.h | 4 +- src/H5public.h | 15 +++- test/btree2.c | 2 +- test/cache_api.c | 140 ++++++++--------------------- test/dsets.c | 2 +- test/dtypes.c | 4 +- test/fillval.c | 2 +- test/links.c | 22 ++--- test/mf.c | 4 +- test/objcopy.c | 2 +- test/ohdr.c | 2 +- test/plugin.c | 2 +- test/set_extent.c | 4 +- test/stab.c | 2 +- test/tattr.c | 18 ++-- test/tfile.c | 6 +- test/th5o.c | 2 +- test/titerate.c | 2 +- test/tmisc.c | 2 +- test/unlink.c | 2 +- tools/perform/pio_standalone.h | 4 +- tools/perform/sio_standalone.h | 4 +- 31 files changed, 133 insertions(+), 156 deletions(-) diff --git a/c++/test/tattr.cpp b/c++/test/tattr.cpp index 5b32554..936ee63 100644 --- a/c++/test/tattr.cpp +++ b/c++/test/tattr.cpp @@ -1794,7 +1794,7 @@ void test_attr() // use_shared test // Loop over using new group format - hbool_t new_format; + unsigned new_format; for (new_format = FALSE; new_format <= TRUE; new_format++) { FileAccPropList curr_fapl; diff --git a/c++/test/tlinks.cpp b/c++/test/tlinks.cpp index 572f649..57738d7 100644 --- a/c++/test/tlinks.cpp +++ b/c++/test/tlinks.cpp @@ -466,7 +466,7 @@ extern "C" void test_links() { hid_t fapl_id, fapl2_id; /* File access property lists */ - hbool_t new_format; /* Whether to use the new format or not */ + unsigned new_format; /* Whether to use the new format or not */ const char *envval; envval = HDgetenv("HDF5_DRIVER"); diff --git a/config/cmake/H5pubconf.h.in b/config/cmake/H5pubconf.h.in index fd3a1d6..f01a9ff 100644 --- a/config/cmake/H5pubconf.h.in +++ b/config/cmake/H5pubconf.h.in @@ -563,6 +563,12 @@ /* The size of `__int64', as computed by sizeof. */ #define H5_SIZEOF___INT64 @H5_SIZEOF___INT64@ +/* Define to 1 if you have the header file. */ +#cmakedefine H5_HAVE_STDBOOL_H @H5_HAVE_STDBOOL_H@ + +/* The size of `bool', as computed by sizeof. */ +#cmakedefine H5_SIZEOF_BOOL @H5_SIZEOF_BOOL@ + /* Define to 1 if you have the ANSI C header files. */ #cmakedefine H5_STDC_HEADERS @H5_STDC_HEADERS@ diff --git a/config/cmake_ext_mod/ConfigureChecks.cmake b/config/cmake_ext_mod/ConfigureChecks.cmake index e441c4a..c76129a 100644 --- a/config/cmake_ext_mod/ConfigureChecks.cmake +++ b/config/cmake_ext_mod/ConfigureChecks.cmake @@ -422,6 +422,19 @@ if (NOT ${HDF_PREFIX}_SIZEOF_OFF64_T) set (${HDF_PREFIX}_SIZEOF_OFF64_T 0) endif (NOT ${HDF_PREFIX}_SIZEOF_OFF64_T) +#----------------------------------------------------------------------------- +# Extra C99 types +#----------------------------------------------------------------------------- + +# _Bool type support +CHECK_INCLUDE_FILE_CONCAT (stdbool.h ${HDF_PREFIX}_HAVE_STDBOOL_H) +if (HAVE_STDBOOL_H) + set (CMAKE_EXTRA_INCLUDE_FILES stdbool.h) + HDF_CHECK_TYPE_SIZE (bool ${HDF_PREFIX}_SIZEOF_BOOL) +else (HAVE_STDBOOL_H) + HDF_CHECK_TYPE_SIZE (_Bool ${HDF_PREFIX}_SIZEOF_BOOL) +endif (HAVE_STDBOOL_H) + if (NOT WINDOWS) #----------------------------------------------------------------------------- # Check if the dev_t type is a scalar type diff --git a/configure.ac b/configure.ac index 18601f1..6ab2eb0 100644 --- a/configure.ac +++ b/configure.ac @@ -951,6 +951,7 @@ AC_CHECK_HEADERS([sys/socket.h sys/types.h]) AC_CHECK_HEADERS([stddef.h setjmp.h features.h]) AC_CHECK_HEADERS([dirent.h]) AC_CHECK_HEADERS([stdint.h], [C9x=yes]) +AC_CHECK_HEADERS([stdbool.h]) ## Darwin AC_CHECK_HEADERS([mach/mach_time.h]) @@ -1130,6 +1131,17 @@ EOF AC_CHECK_SIZEOF([off_t], [4]) AC_CHECK_SIZEOF([off64_t], [8]) +if test "X$C9x" = "Xyes"; then + cat >>confdefs.h <<\EOF +#ifdef HAVE_STDBOOL_H +#include /* for bool definition */ +#else +#define bool _Bool +#endif +EOF +AC_CHECK_SIZEOF([bool], [1]) +fi + ## Checkpoint the cache AC_CACHE_SAVE diff --git a/src/H5Odtype.c b/src/H5Odtype.c index cee6e1e..e51d319 100644 --- a/src/H5Odtype.c +++ b/src/H5Odtype.c @@ -263,7 +263,7 @@ H5O_dtype_decode_helper(H5F_t *f, unsigned *ioflags/*in,out*/, const uint8_t **p unsigned offset_nbytes; /* Size needed to encode member offsets */ size_t max_memb_pos = 0; /* Maximum member covered, so far */ unsigned max_version = 0; /* Maximum member version */ - hbool_t upgrade_to = 0; /* Version number we can "soft" upgrade to */ + unsigned upgrade_to = 0; /* Version number we can "soft" upgrade to */ unsigned j; /* Compute the # of bytes required to store a member offset */ diff --git a/src/H5Pgcpl.c b/src/H5Pgcpl.c index f84fa7b..f028f7a 100644 --- a/src/H5Pgcpl.c +++ b/src/H5Pgcpl.c @@ -594,6 +594,7 @@ H5P__gcrt_group_info_dec(const void **_pp, void *_value) FUNC_ENTER_STATIC_NOERR /* Set property to default value */ + HDmemset(ginfo, 0, sizeof(H5O_ginfo_t)); *ginfo = H5G_def_ginfo_g; UINT32DECODE(*pp, ginfo->lheap_size_hint) @@ -692,6 +693,7 @@ H5P__gcrt_link_info_dec(const void **_pp, void *_value) HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "unsigned value can't be decoded") /* Set property to default value */ + HDmemset(linfo, 0, sizeof(H5O_linfo_t)); *linfo = H5G_def_linfo_g; H5_DECODE_UNSIGNED(*pp, crt_order_flags) diff --git a/src/H5Pocpl.c b/src/H5Pocpl.c index 7ae5a6e..27044d5 100644 --- a/src/H5Pocpl.c +++ b/src/H5Pocpl.c @@ -1590,6 +1590,7 @@ H5P__ocrt_pipeline_dec(const void **_pp, void *_value) nused = (size_t)enc_value; /* Set property default value */ + HDmemset(pline, 0, sizeof(H5O_pline_t)); *pline = H5O_def_pline_g; for(u = 0; u < nused; u++) { diff --git a/src/H5T.c b/src/H5T.c index 1213bf7..21d6fcf 100644 --- a/src/H5T.c +++ b/src/H5T.c @@ -801,7 +801,7 @@ H5T__init_package(void) H5T_INIT_TYPE(OFFSET,H5T_NATIVE_HERR_g,COPY,native_int,SET,sizeof(herr_t)) /* hbool_t */ - H5T_INIT_TYPE(OFFSET,H5T_NATIVE_HBOOL_g,COPY,native_int,SET,sizeof(hbool_t)) + H5T_INIT_TYPE(OFFSET,H5T_NATIVE_HBOOL_g,COPY,native_uint,SET,sizeof(hbool_t)) /*------------------------------------------------------------ * IEEE Types diff --git a/src/H5private.h b/src/H5private.h index 56061bf..26111ff 100644 --- a/src/H5private.h +++ b/src/H5private.h @@ -364,10 +364,10 @@ * HDF Boolean type. */ #ifndef FALSE -# define FALSE 0 + #define FALSE false #endif #ifndef TRUE -# define TRUE 1 + #define TRUE true #endif /* diff --git a/src/H5public.h b/src/H5public.h index f7f70cf..5b95fb7 100644 --- a/src/H5public.h +++ b/src/H5public.h @@ -141,7 +141,20 @@ typedef int herr_t; * printf("error determining whether data type is committed\n"); * } */ -typedef unsigned int hbool_t; +#ifdef H5_HAVE_STDBOOL_H + #include +#else /* H5_HAVE_STDBOOL_H */ + #ifndef __cplusplus + #if defined(H5_SIZEOF_BOOL) && (H5_SIZEOF_BOOL != 0) + #define bool _Bool + #else + #define bool unsigned int + #endif + #define true 1 + #define false 0 + #endif /* __cplusplus */ +#endif /* H5_HAVE_STDBOOL_H */ +typedef bool hbool_t; typedef int htri_t; /* Define the ssize_t type if it not is defined */ diff --git a/test/btree2.c b/test/btree2.c index caad849..8f84135 100644 --- a/test/btree2.c +++ b/test/btree2.c @@ -7625,7 +7625,7 @@ main(void) bt2_test_param_t tparam; /* Test parameters for v2 B-tree */ hid_t fapl = -1; /* File access property list for data files */ unsigned nerrors = 0; /* Cumulative error count */ - hbool_t reopen; /* Whether to reopen B-tree during tests */ + unsigned reopen; /* Whether to reopen B-tree during tests */ int ExpressMode; const char *envval = NULL; diff --git a/test/cache_api.c b/test/cache_api.c index 1697884..bebb828 100644 --- a/test/cache_api.c +++ b/test/cache_api.c @@ -1530,7 +1530,7 @@ mdc_api_call_smoke_check(int express_test) * Note: It is assumed that boolean parameters are only set to TRUE/FALSE. */ -#define NUM_INVALID_CONFIGS 42 +#define NUM_INVALID_CONFIGS 36 H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] = { @@ -1605,42 +1605,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] = H5AC__DEFAULT_METADATA_WRITE_STRATEGY }, { - /* 2 -- bad set_initial_size */ - /* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER, - /* hbool_t rpt_fcn_enabled = */ FALSE, - /* hbool_t open_trace_file = */ FALSE, - /* hbool_t close_trace_file = */ FALSE, - /* char trace_file_name[] = */ "", - /* hbool_t evictions_enabled = */ TRUE, - /* hbool_t set_initial_size = */ 2, - /* size_t initial_size = */ (1 * 1024 * 1024), - /* double min_clean_fraction = */ 0.25f, - /* size_t max_size = */ (16 * 1024 * 1024), - /* size_t min_size = */ ( 1 * 1024 * 1024), - /* long int epoch_length = */ 50000, - /* enum H5C_cache_incr_mode incr_mode = */ H5C_incr__threshold, - /* double lower_hr_threshold = */ 0.9f, - /* double increment = */ 2.0f, - /* hbool_t apply_max_increment = */ TRUE, - /* size_t max_increment = */ (4 * 1024 * 1024), - /* enum H5C_cache_flash_incr_mode */ - /* flash_incr_mode = */ H5C_flash_incr__off, - /* double flash_multiple = */ 2.0f, - /* double flash_threshold = */ 0.5f, - /* enum H5C_cache_decr_mode decr_mode = */ H5C_decr__age_out_with_threshold, - /* double upper_hr_threshold = */ 0.999f, - /* double decrement = */ 0.9f, - /* hbool_t apply_max_decrement = */ TRUE, - /* size_t max_decrement = */ (1 * 1024 * 1024), - /* int epochs_before_eviction = */ 3, - /* hbool_t apply_empty_reserve = */ TRUE, - /* double empty_reserve = */ 0.1f, - /* int dirty_bytes_threshold = */ (256 * 1024), - /* int metadata_write_strategy = */ - H5AC__DEFAULT_METADATA_WRITE_STRATEGY - }, - { - /* 3 -- max_size too big */ + /* 2 -- max_size too big */ /* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER, /* hbool_t rpt_fcn_enabled = */ FALSE, /* hbool_t open_trace_file = */ FALSE, @@ -1675,7 +1640,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] = H5AC__DEFAULT_METADATA_WRITE_STRATEGY }, { - /* 4 -- min_size too small */ + /* 3 -- min_size too small */ /* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER, /* hbool_t rpt_fcn_enabled = */ FALSE, /* hbool_t open_trace_file = */ FALSE, @@ -1710,7 +1675,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] = H5AC__DEFAULT_METADATA_WRITE_STRATEGY }, { - /* 5 -- min_size > max_size */ + /* 4 -- min_size > max_size */ /* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER, /* hbool_t rpt_fcn_enabled = */ FALSE, /* hbool_t open_trace_file = */ FALSE, @@ -1745,7 +1710,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] = H5AC__DEFAULT_METADATA_WRITE_STRATEGY }, { - /* 6 -- initial size out of range (too big) */ + /* 5 -- initial size out of range (too big) */ /* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER, /* hbool_t rpt_fcn_enabled = */ FALSE, /* hbool_t open_trace_file = */ FALSE, @@ -1780,7 +1745,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] = H5AC__DEFAULT_METADATA_WRITE_STRATEGY }, { - /* 7 -- initial_size out of range (too small) */ + /* 6 -- initial_size out of range (too small) */ /* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER, /* hbool_t rpt_fcn_enabled = */ FALSE, /* hbool_t open_trace_file = */ FALSE, @@ -1815,7 +1780,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] = H5AC__DEFAULT_METADATA_WRITE_STRATEGY }, { - /* 8 -- min_clean_fraction too big */ + /* 7 -- min_clean_fraction too big */ /* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER, /* hbool_t rpt_fcn_enabled = */ FALSE, /* hbool_t open_trace_file = */ FALSE, @@ -1850,7 +1815,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] = H5AC__DEFAULT_METADATA_WRITE_STRATEGY }, { - /* 9 -- min_clean_fraction too small */ + /* 8 -- min_clean_fraction too small */ /* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER, /* hbool_t rpt_fcn_enabled = */ FALSE, /* hbool_t open_trace_file = */ FALSE, @@ -1885,7 +1850,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] = H5AC__DEFAULT_METADATA_WRITE_STRATEGY }, { - /* 10 -- epoch_length too small */ + /* 9 -- epoch_length too small */ /* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER, /* hbool_t rpt_fcn_enabled = */ FALSE, /* hbool_t open_trace_file = */ FALSE, @@ -1920,7 +1885,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] = H5AC__DEFAULT_METADATA_WRITE_STRATEGY }, { - /* 11 -- epoch_length too big */ + /* 10 -- epoch_length too big */ /* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER, /* hbool_t rpt_fcn_enabled = */ FALSE, /* hbool_t open_trace_file = */ FALSE, @@ -1955,7 +1920,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] = H5AC__DEFAULT_METADATA_WRITE_STRATEGY }, { - /* 12 -- invalid incr_mode */ + /* 11 -- invalid incr_mode */ /* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER, /* hbool_t rpt_fcn_enabled = */ FALSE, /* hbool_t open_trace_file = */ FALSE, @@ -1990,7 +1955,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] = H5AC__DEFAULT_METADATA_WRITE_STRATEGY }, { - /* 13 -- lower_hr_threshold too small */ + /* 12 -- lower_hr_threshold too small */ /* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER, /* hbool_t rpt_fcn_enabled = */ FALSE, /* hbool_t open_trace_file = */ FALSE, @@ -2025,7 +1990,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] = H5AC__DEFAULT_METADATA_WRITE_STRATEGY }, { - /* 14 -- lower_hr_threshold too big */ + /* 13 -- lower_hr_threshold too big */ /* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER, /* hbool_t rpt_fcn_enabled = */ FALSE, /* hbool_t open_trace_file = */ FALSE, @@ -2060,7 +2025,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] = H5AC__DEFAULT_METADATA_WRITE_STRATEGY }, { - /* 15 -- increment too small */ + /* 14 -- increment too small */ /* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER, /* hbool_t rpt_fcn_enabled = */ FALSE, /* hbool_t open_trace_file = */ FALSE, @@ -2095,7 +2060,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] = H5AC__DEFAULT_METADATA_WRITE_STRATEGY }, { - /* 16 -- invalid flash_incr_mode */ + /* 15 -- invalid flash_incr_mode */ /* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER, /* hbool_t rpt_fcn_enabled = */ FALSE, /* hbool_t open_trace_file = */ FALSE, @@ -2130,7 +2095,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] = H5AC__DEFAULT_METADATA_WRITE_STRATEGY }, { - /* 17 -- flash_multiple too small */ + /* 16 -- flash_multiple too small */ /* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER, /* hbool_t rpt_fcn_enabled = */ FALSE, /* hbool_t open_trace_file = */ FALSE, @@ -2165,7 +2130,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] = H5AC__DEFAULT_METADATA_WRITE_STRATEGY }, { - /* 18 -- flash_multiple too big */ + /* 17 -- flash_multiple too big */ /* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER, /* hbool_t rpt_fcn_enabled = */ FALSE, /* hbool_t open_trace_file = */ FALSE, @@ -2200,7 +2165,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] = H5AC__DEFAULT_METADATA_WRITE_STRATEGY }, { - /* 19 -- flash_threshold too small */ + /* 18 -- flash_threshold too small */ /* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER, /* hbool_t rpt_fcn_enabled = */ FALSE, /* hbool_t open_trace_file = */ FALSE, @@ -2235,7 +2200,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] = H5AC__DEFAULT_METADATA_WRITE_STRATEGY }, { - /* 20 -- flash_threshold too big */ + /* 19 -- flash_threshold too big */ /* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER, /* hbool_t rpt_fcn_enabled = */ FALSE, /* hbool_t open_trace_file = */ FALSE, @@ -2270,7 +2235,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] = H5AC__DEFAULT_METADATA_WRITE_STRATEGY }, { - /* 21 -- bad decr_mode */ + /* 20 -- bad decr_mode */ /* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER, /* hbool_t rpt_fcn_enabled = */ FALSE, /* hbool_t open_trace_file = */ FALSE, @@ -2305,7 +2270,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] = H5AC__DEFAULT_METADATA_WRITE_STRATEGY }, { - /* 22 -- upper_hr_threshold too big */ + /* 21 -- upper_hr_threshold too big */ /* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER, /* hbool_t rpt_fcn_enabled = */ FALSE, /* hbool_t open_trace_file = */ FALSE, @@ -2340,7 +2305,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] = H5AC__DEFAULT_METADATA_WRITE_STRATEGY }, { - /* 23 -- decrement too small */ + /* 22 -- decrement too small */ /* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER, /* hbool_t rpt_fcn_enabled = */ FALSE, /* hbool_t open_trace_file = */ FALSE, @@ -2375,7 +2340,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] = H5AC__DEFAULT_METADATA_WRITE_STRATEGY }, { - /* 24 -- decrement too big */ + /* 23 -- decrement too big */ /* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER, /* hbool_t rpt_fcn_enabled = */ FALSE, /* hbool_t open_trace_file = */ FALSE, @@ -2410,7 +2375,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] = H5AC__DEFAULT_METADATA_WRITE_STRATEGY }, { - /* 25 -- epochs_before_eviction too small */ + /* 24 -- epochs_before_eviction too small */ /* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER, /* hbool_t rpt_fcn_enabled = */ FALSE, /* hbool_t open_trace_file = */ FALSE, @@ -2445,7 +2410,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] = H5AC__DEFAULT_METADATA_WRITE_STRATEGY }, { - /* 26 -- epochs_before_eviction too big */ + /* 25 -- epochs_before_eviction too big */ /* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER, /* hbool_t rpt_fcn_enabled = */ FALSE, /* hbool_t open_trace_file = */ FALSE, @@ -2480,42 +2445,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] = H5AC__DEFAULT_METADATA_WRITE_STRATEGY }, { - /* 27 -- invalid apply_empty_reserve */ - /* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER, - /* hbool_t rpt_fcn_enabled = */ FALSE, - /* hbool_t open_trace_file = */ FALSE, - /* hbool_t close_trace_file = */ FALSE, - /* char trace_file_name[] = */ "", - /* hbool_t evictions_enabled = */ TRUE, - /* hbool_t set_initial_size = */ TRUE, - /* size_t initial_size = */ (1 * 1024 * 1024), - /* double min_clean_fraction = */ 0.25f, - /* size_t max_size = */ (16 * 1024 * 1024), - /* size_t min_size = */ ( 1 * 1024 * 1024), - /* long int epoch_length = */ 50000, - /* enum H5C_cache_incr_mode incr_mode = */ H5C_incr__threshold, - /* double lower_hr_threshold = */ 0.9f, - /* double increment = */ 2.0f, - /* hbool_t apply_max_increment = */ TRUE, - /* size_t max_increment = */ (4 * 1024 * 1024), - /* enum H5C_cache_flash_incr_mode */ - /* flash_incr_mode = */ H5C_flash_incr__off, - /* double flash_multiple = */ 2.0f, - /* double flash_threshold = */ 0.5f, - /* enum H5C_cache_decr_mode decr_mode = */ H5C_decr__age_out_with_threshold, - /* double upper_hr_threshold = */ 0.999f, - /* double decrement = */ 0.9f, - /* hbool_t apply_max_decrement = */ TRUE, - /* size_t max_decrement = */ (1 * 1024 * 1024), - /* int epochs_before_eviction = */ 3, - /* hbool_t apply_empty_reserve = */ 2, - /* double empty_reserve = */ 0.1f, - /* int dirty_bytes_threshold = */ (256 * 1024), - /* int metadata_write_strategy = */ - H5AC__DEFAULT_METADATA_WRITE_STRATEGY - }, - { - /* 28 -- empty_reserve too small */ + /* 26 -- empty_reserve too small */ /* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER, /* hbool_t rpt_fcn_enabled = */ FALSE, /* hbool_t open_trace_file = */ FALSE, @@ -2550,7 +2480,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] = H5AC__DEFAULT_METADATA_WRITE_STRATEGY }, { - /* 29 -- empty_reserve too big */ + /* 27 -- empty_reserve too big */ /* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER, /* hbool_t rpt_fcn_enabled = */ FALSE, /* hbool_t open_trace_file = */ FALSE, @@ -2585,7 +2515,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] = H5AC__DEFAULT_METADATA_WRITE_STRATEGY }, { - /* 30 -- upper_hr_threshold too small */ + /* 28 -- upper_hr_threshold too small */ /* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER, /* hbool_t rpt_fcn_enabled = */ FALSE, /* hbool_t open_trace_file = */ FALSE, @@ -2620,7 +2550,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] = H5AC__DEFAULT_METADATA_WRITE_STRATEGY }, { - /* 31 -- upper_hr_threshold too big */ + /* 29 -- upper_hr_threshold too big */ /* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER, /* hbool_t rpt_fcn_enabled = */ FALSE, /* hbool_t open_trace_file = */ FALSE, @@ -2655,7 +2585,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] = H5AC__DEFAULT_METADATA_WRITE_STRATEGY }, { - /* 32 -- upper_hr_threshold <= lower_hr_threshold */ + /* 30 -- upper_hr_threshold <= lower_hr_threshold */ /* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER, /* hbool_t rpt_fcn_enabled = */ FALSE, /* hbool_t open_trace_file = */ FALSE, @@ -2690,7 +2620,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] = H5AC__DEFAULT_METADATA_WRITE_STRATEGY }, { - /* 33 -- dirty_bytes_threshold too small */ + /* 31 -- dirty_bytes_threshold too small */ /* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER, /* hbool_t rpt_fcn_enabled = */ FALSE, /* hbool_t open_trace_file = */ FALSE, @@ -2725,7 +2655,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] = H5AC__DEFAULT_METADATA_WRITE_STRATEGY }, { - /* 34 -- dirty_bytes_threshold too big */ + /* 32 -- dirty_bytes_threshold too big */ /* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER, /* hbool_t rpt_fcn_enabled = */ FALSE, /* hbool_t open_trace_file = */ FALSE, @@ -2760,7 +2690,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] = H5AC__DEFAULT_METADATA_WRITE_STRATEGY }, { - /* 35 -- attempt to disable evictions when auto incr enabled */ + /* 33 -- attempt to disable evictions when auto incr enabled */ /* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER, /* hbool_t rpt_fcn_enabled = */ FALSE, /* hbool_t open_trace_file = */ FALSE, @@ -2795,7 +2725,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] = H5AC__DEFAULT_METADATA_WRITE_STRATEGY }, { - /* 36 -- attempt to disable evictions when auto decr enabled */ + /* 34 -- attempt to disable evictions when auto decr enabled */ /* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER, /* hbool_t rpt_fcn_enabled = */ FALSE, /* hbool_t open_trace_file = */ FALSE, @@ -2830,7 +2760,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] = H5AC__DEFAULT_METADATA_WRITE_STRATEGY }, { - /* 37 -- unknown metadata write strategy */ + /* 35 -- unknown metadata write strategy */ /* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER, /* hbool_t rpt_fcn_enabled = */ FALSE, /* hbool_t open_trace_file = */ FALSE, diff --git a/test/dsets.c b/test/dsets.c index a233b4e..c0e8702 100644 --- a/test/dsets.c +++ b/test/dsets.c @@ -9080,7 +9080,7 @@ main(void) { char filename[FILENAME_BUF_SIZE]; hid_t file, grp, fapl, fapl2; - hbool_t new_format; + unsigned new_format; int mdc_nelmts; size_t rdcc_nelmts; size_t rdcc_nbytes; diff --git a/test/dtypes.c b/test/dtypes.c index 6fe455d..326294f 100644 --- a/test/dtypes.c +++ b/test/dtypes.c @@ -6728,7 +6728,7 @@ test_delete_obj_named(hid_t fapl) hid_t attr = -1; /* Attribute ID */ hid_t dset = -1; /* Dataset ID */ hid_t fapl2 = -1; /* File access property list ID */ - hbool_t new_format; /* Whether to use old or new format */ + unsigned new_format; /* Whether to use old or new format */ char filename[1024], filename2[1024]; TESTING("deleting objects that use named datatypes"); @@ -6823,7 +6823,7 @@ test_delete_obj_named_fileid(hid_t fapl) hid_t attr = -1; /* Attribute ID */ hid_t dset = -1; /* Dataset ID */ hid_t fapl2 = -1; /* File access property list ID */ - hbool_t new_format; /* Whether to use old or new format */ + unsigned new_format; /* Whether to use old or new format */ char filename[1024], filename2[1024]; TESTING("deleting objects that use named datatypes"); diff --git a/test/fillval.c b/test/fillval.c index b7b2ff5..1ea2ae6 100644 --- a/test/fillval.c +++ b/test/fillval.c @@ -2368,7 +2368,7 @@ main(int argc, char *argv[]) { int nerrors=0, argno, test_contig=1, test_chunk=1, test_compact=1; hid_t fapl = (-1), fapl2 = (-1); /* File access property lists */ - hbool_t new_format; /* Whether to use the new format or not */ + unsigned new_format; /* Whether to use the new format or not */ if(argc >= 2) { test_contig = test_chunk = test_compact = 0; diff --git a/test/links.c b/test/links.c index 577834d..db5922b 100644 --- a/test/links.c +++ b/test/links.c @@ -10695,7 +10695,7 @@ corder_delete(hid_t fapl) unsigned min_dense; /* Minimum # of links to store in group "densely" */ hsize_t name_count; /* # of records in name index */ hsize_t corder_count; /* # of records in creation order index */ - hbool_t reopen_file; /* Whether to re-open the file before deleting group */ + unsigned reopen_file; /* Whether to re-open the file before deleting group */ h5_stat_size_t empty_size; /* Size of empty file */ h5_stat_size_t file_size; /* Size of file after operating on it */ char objname[NAME_BUF_SIZE]; /* Object name */ @@ -10976,8 +10976,8 @@ link_info_by_idx(hid_t fapl) hid_t file_id = (-1); /* File ID */ hid_t group_id = (-1); /* Group ID */ hid_t gcpl_id = (-1); /* Group creation property list ID */ - hbool_t hard_link; /* Create hard or soft link? */ - hbool_t use_index; /* Use index on creation order values */ + unsigned hard_link; /* Create hard or soft link? */ + unsigned use_index; /* Use index on creation order values */ unsigned max_compact; /* Maximum # of links to store in group compactly */ unsigned min_dense; /* Minimum # of links to store in group "densely" */ H5L_info_t linfo; /* Link info struct */ @@ -11159,7 +11159,7 @@ link_info_by_idx_old(hid_t fapl) { hid_t file_id = (-1); /* File ID */ hid_t group_id = (-1), group_id2 = (-1); /* Group IDs */ - hbool_t hard_link; /* Create hard or soft link? */ + unsigned hard_link; /* Create hard or soft link? */ H5L_info_t linfo; /* Link info struct */ char objname[NAME_BUF_SIZE]; /* Object name */ char valname[NAME_BUF_SIZE]; /* Link value name */ @@ -11328,7 +11328,7 @@ delete_by_idx(hid_t fapl) hid_t gcpl_id = (-1); /* Group creation property list ID */ H5_index_t idx_type; /* Type of index to operate on */ H5_iter_order_t order; /* Order within in the index */ - hbool_t use_index; /* Use index on creation order values */ + unsigned use_index; /* Use index on creation order values */ unsigned max_compact; /* Maximum # of links to store in group compactly */ unsigned min_dense; /* Minimum # of links to store in group "densely" */ H5L_info_t linfo; /* Link info struct */ @@ -12161,7 +12161,7 @@ link_iterate(hid_t fapl) hid_t gcpl_id = (-1); /* Group creation property list ID */ H5_index_t idx_type; /* Type of index to operate on */ H5_iter_order_t order; /* Order within in the index */ - hbool_t use_index; /* Use index on creation order values */ + unsigned use_index; /* Use index on creation order values */ unsigned max_compact; /* Maximum # of links to store in group compactly */ unsigned min_dense; /* Minimum # of links to store in group "densely" */ char objname[NAME_BUF_SIZE]; /* Object name */ @@ -12847,7 +12847,7 @@ open_by_idx(hid_t fapl) hid_t gcpl_id = (-1); /* Group creation property list ID */ H5_index_t idx_type; /* Type of index to operate on */ H5_iter_order_t order; /* Order within in the index */ - hbool_t use_index; /* Use index on creation order values */ + unsigned use_index; /* Use index on creation order values */ unsigned max_compact; /* Maximum # of links to store in group compactly */ unsigned min_dense; /* Minimum # of links to store in group "densely" */ H5O_info_t oi; /* Buffer for querying object's info */ @@ -13283,7 +13283,7 @@ object_info(hid_t fapl) hid_t space_id = (-1); /* Dataspace ID (for attributes) */ H5_index_t idx_type; /* Type of index to operate on */ H5_iter_order_t order; /* Order within in the index */ - hbool_t use_index; /* Use index on creation order values */ + unsigned use_index; /* Use index on creation order values */ unsigned max_compact; /* Maximum # of links to store in group compactly */ unsigned min_dense; /* Minimum # of links to store in group "densely" */ H5O_info_t oinfo; /* Buffer for querying object's info */ @@ -13679,7 +13679,7 @@ group_info(hid_t fapl) hid_t gcpl_id = (-1); /* Group creation property list ID */ H5_index_t idx_type; /* Type of index to operate on */ H5_iter_order_t order; /* Order within in the index */ - hbool_t use_index; /* Use index on creation order values */ + unsigned use_index; /* Use index on creation order values */ unsigned max_compact; /* Maximum # of links to store in group compactly */ unsigned min_dense; /* Minimum # of links to store in group "densely" */ H5G_info_t grp_info; /* Buffer for querying object's info */ @@ -14490,8 +14490,8 @@ main(void) { hid_t fapl, fapl2; /* File access property lists */ int nerrors = 0; - hbool_t new_format; /* Whether to use the new format or not */ - hbool_t efc; /* Whether to use the external file cache */ + unsigned new_format; /* Whether to use the new format or not */ + unsigned efc; /* Whether to use the external file cache */ const char *env_h5_drvr; /* File Driver value from environment */ env_h5_drvr = HDgetenv("HDF5_DRIVER"); diff --git a/test/mf.c b/test/mf.c index d0c3149..6b5cfac 100644 --- a/test/mf.c +++ b/test/mf.c @@ -6802,7 +6802,7 @@ test_mf_fs_drivers(hid_t fapl) hid_t fcpl = -1; /* file creation property list */ hid_t fapl_new = -1; /* copy of file access property list */ hid_t fapl2 = -1; /* copy of file access property list */ - hbool_t new_format; /* To use new library format or not */ + unsigned new_format; /* To use new library format or not */ unsigned ret = 0; /* return value */ H5FD_mem_t memb_map[H5FD_MEM_NTYPES]; /* Memory usage map */ @@ -7227,7 +7227,7 @@ test_filespace_drivers(hid_t fapl) { hid_t fapl_new = -1; /* copy of file access property list */ hid_t fapl2 = -1; /* copy of file access property list */ - hbool_t new_format; /* Using library new format or not */ + unsigned new_format; /* Using library new format or not */ unsigned ret = 0; /* return value */ H5FD_mem_t memb_map[H5FD_MEM_NTYPES]; /* Memory usage map */ diff --git a/test/objcopy.c b/test/objcopy.c index ecc3ba5..82be446 100644 --- a/test/objcopy.c +++ b/test/objcopy.c @@ -12312,7 +12312,7 @@ main(void) /* Tests that do not use attributes and do not need to be tested * multiple times for different attribute configurations */ if(configuration < CONFIG_DENSE) { - hbool_t reopen; + unsigned reopen; nerrors += test_copy_named_datatype(fcpl_src, fcpl_dst, src_fapl, dst_fapl); nerrors += test_copy_named_datatype_vl(fcpl_src, fcpl_dst, src_fapl, dst_fapl); diff --git a/test/ohdr.c b/test/ohdr.c index e178729..53aa18f 100644 --- a/test/ohdr.c +++ b/test/ohdr.c @@ -321,7 +321,7 @@ main(void) time_t time_new, ro; int chunkno; /* Chunk index for message */ int i; /* Local index variable */ - hbool_t b; /* Index for "new format" loop */ + unsigned b; /* Index for "new format" loop */ herr_t ret; /* Generic return value */ /* Reset library */ diff --git a/test/plugin.c b/test/plugin.c index e34c691..a3082d2 100644 --- a/test/plugin.c +++ b/test/plugin.c @@ -710,7 +710,7 @@ main(void) { char filename[FILENAME_BUF_SIZE]; hid_t file, fapl, fapl2; - hbool_t new_format; + unsigned new_format; int mdc_nelmts; size_t rdcc_nelmts; size_t rdcc_nbytes; diff --git a/test/set_extent.c b/test/set_extent.c index f6c3766..ae83ba2 100644 --- a/test/set_extent.c +++ b/test/set_extent.c @@ -116,8 +116,8 @@ int main( void ) { hid_t fapl; /* file access property list */ hid_t fapl2; /* file access property list w/latest format set */ - hbool_t new_format; /* Whether to use the latest file format */ - hbool_t chunk_cache; /* Whether to enable chunk caching */ + unsigned new_format; /* Whether to use the latest file format */ + unsigned chunk_cache; /* Whether to enable chunk caching */ int nerrors = 0; /* Initialize random number seed */ diff --git a/test/stab.c b/test/stab.c index 7db1feb..f81bb5f 100644 --- a/test/stab.c +++ b/test/stab.c @@ -1166,7 +1166,7 @@ int main(void) { hid_t fapl, fapl2; /* File access property list IDs */ - hbool_t new_format; /* Whether to use the new format or not */ + unsigned new_format; /* Whether to use the new format or not */ int nerrors = 0; /* Reset library */ diff --git a/test/tattr.c b/test/tattr.c index d96ca59..585246a 100644 --- a/test/tattr.c +++ b/test/tattr.c @@ -5338,7 +5338,7 @@ test_attr_corder_delete(hid_t fcpl, hid_t fapl) hsize_t nattrs; /* Number of attributes on object */ hsize_t name_count; /* # of records in name index */ hsize_t corder_count; /* # of records in creation order index */ - hbool_t reopen_file; /* Whether to re-open the file before deleting group */ + unsigned reopen_file; /* Whether to re-open the file before deleting group */ char attrname[NAME_BUF_SIZE]; /* Name of attribute */ #ifdef LATER h5_stat_size_t empty_size; /* Size of empty file */ @@ -5687,7 +5687,7 @@ test_attr_info_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl) hsize_t nattrs; /* Number of attributes on object */ hsize_t name_count; /* # of records in name index */ hsize_t corder_count; /* # of records in creation order index */ - hbool_t use_index; /* Use index on creation order values */ + unsigned use_index; /* Use index on creation order values */ char attrname[NAME_BUF_SIZE]; /* Name of attribute */ char tmpname[NAME_BUF_SIZE]; /* Temporary attribute name */ unsigned curr_dset; /* Current dataset to work on */ @@ -5899,7 +5899,7 @@ test_attr_delete_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl) hsize_t corder_count; /* # of records in creation order index */ H5_index_t idx_type; /* Type of index to operate on */ H5_iter_order_t order; /* Order within in the index */ - hbool_t use_index; /* Use index on creation order values */ + unsigned use_index; /* Use index on creation order values */ char attrname[NAME_BUF_SIZE]; /* Name of attribute */ char tmpname[NAME_BUF_SIZE]; /* Temporary attribute name */ unsigned curr_dset; /* Current dataset to work on */ @@ -6842,7 +6842,7 @@ test_attr_iterate2(hbool_t new_format, hid_t fcpl, hid_t fapl) attr_iter_info_t iter_info; /* Iterator info */ hbool_t *visited = NULL; /* Array of flags for visiting links */ hsize_t idx; /* Start index for iteration */ - hbool_t use_index; /* Use index on creation order values */ + unsigned use_index; /* Use index on creation order values */ const char *dsetname; /* Name of dataset for attributes */ char attrname[NAME_BUF_SIZE]; /* Name of attribute */ unsigned curr_dset; /* Current dataset to work on */ @@ -7203,7 +7203,7 @@ test_attr_open_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl) hsize_t corder_count; /* # of records in creation order index */ H5_index_t idx_type; /* Type of index to operate on */ H5_iter_order_t order; /* Order within in the index */ - hbool_t use_index; /* Use index on creation order values */ + unsigned use_index; /* Use index on creation order values */ char attrname[NAME_BUF_SIZE]; /* Name of attribute */ unsigned curr_dset; /* Current dataset to work on */ unsigned u; /* Local index variable */ @@ -7549,7 +7549,7 @@ test_attr_open_by_name(hbool_t new_format, hid_t fcpl, hid_t fapl) hsize_t nattrs; /* Number of attributes on object */ hsize_t name_count; /* # of records in name index */ hsize_t corder_count; /* # of records in creation order index */ - hbool_t use_index; /* Use index on creation order values */ + unsigned use_index; /* Use index on creation order values */ const char *dsetname; /* Name of dataset for attributes */ char attrname[NAME_BUF_SIZE]; /* Name of attribute */ unsigned curr_dset; /* Current dataset to work on */ @@ -7804,7 +7804,7 @@ test_attr_create_by_name(hbool_t new_format, hid_t fcpl, hid_t fapl) hsize_t nattrs; /* Number of attributes on object */ hsize_t name_count; /* # of records in name index */ hsize_t corder_count; /* # of records in creation order index */ - hbool_t use_index; /* Use index on creation order values */ + unsigned use_index; /* Use index on creation order values */ const char *dsetname; /* Name of dataset for attributes */ char attrname[NAME_BUF_SIZE]; /* Name of attribute */ unsigned curr_dset; /* Current dataset to work on */ @@ -10568,8 +10568,8 @@ test_attr(void) { hid_t fapl = (-1), fapl2 = (-1); /* File access property lists */ hid_t fcpl = (-1), fcpl2 = (-1); /* File creation property lists */ - hbool_t new_format; /* Whether to use the new format or not */ - hbool_t use_shared; /* Whether to use shared attributes or not */ + unsigned new_format; /* Whether to use the new format or not */ + unsigned use_shared; /* Whether to use shared attributes or not */ herr_t ret; /* Generic return value */ /* Output message about test being performed */ diff --git a/test/tfile.c b/test/tfile.c index 5fc528e..c36045b 100644 --- a/test/tfile.c +++ b/test/tfile.c @@ -3058,7 +3058,7 @@ test_filespace_info(void) char filename[FILENAME_LEN]; /* Filename to use */ H5F_file_space_type_t strategy, fs_type, def_type; /* File space handling strategy */ hsize_t threshold, fs_size, def_size; /* Free space section threshold */ - hbool_t new_format; /* new format or old format */ + unsigned new_format; /* new format or old format */ herr_t ret; /* return value */ /* Output message about test being performed */ @@ -3121,7 +3121,7 @@ test_filespace_info(void) /* Create the file with the specified file space info */ fid1 = H5Fcreate(filename, H5F_ACC_TRUNC, fcpl1, my_fapl); - CHECK(ret, FAIL, "H5Fcreate"); + CHECK(fid1, FAIL, "H5Fcreate"); /* Close the file */ ret = H5Fclose(fid1); @@ -3129,7 +3129,7 @@ test_filespace_info(void) /* Re-open the file */ fid2 = H5Fopen(filename, H5F_ACC_RDWR, my_fapl); - CHECK(ret, FAIL, "H5Fopen"); + CHECK(fid2, FAIL, "H5Fopen"); /* Get the file's creation property */ fcpl2 = H5Fget_create_plist(fid2); diff --git a/test/th5o.c b/test/th5o.c index 90f3c9b..497ccc8 100644 --- a/test/th5o.c +++ b/test/th5o.c @@ -776,7 +776,7 @@ test_h5o_link(void) hid_t lcpl_id=-1; hsize_t dims[2] = {TEST6_DIM1, TEST6_DIM2}; htri_t committed; /* Whether the named datatype is committed */ - hbool_t new_format; /* Whether to use the new format or not */ + unsigned new_format; /* Whether to use the new format or not */ int wdata[TEST6_DIM1][TEST6_DIM2]; int rdata[TEST6_DIM1][TEST6_DIM2]; int i, n, j; diff --git a/test/titerate.c b/test/titerate.c index 98428ea..20a3940 100644 --- a/test/titerate.c +++ b/test/titerate.c @@ -919,7 +919,7 @@ void test_iterate(void) { hid_t fapl, fapl2; /* File access property lists */ - hbool_t new_format; /* Whether to use the new format or not */ + unsigned new_format; /* Whether to use the new format or not */ herr_t ret; /* Generic return value */ /* Output message about test being performed */ diff --git a/test/tmisc.c b/test/tmisc.c index fa0f150..1298f6b 100644 --- a/test/tmisc.c +++ b/test/tmisc.c @@ -5176,7 +5176,7 @@ static void test_misc30(void) { hsize_t file_size[] = {0, 0}; /* Sizes of file created */ - hbool_t get_info; /* Whether to perform the get info call */ + unsigned get_info; /* Whether to perform the get info call */ /* Output message about test being performed */ MESSAGE(5, ("Local heap dropping free block info\n")); diff --git a/test/unlink.c b/test/unlink.c index c091281..7169365 100644 --- a/test/unlink.c +++ b/test/unlink.c @@ -2443,7 +2443,7 @@ main(void) hid_t fapl, fapl2, file; int nerrors = 0; char filename[1024]; - hbool_t new_format; + unsigned new_format; /* Metadata cache parameters */ int mdc_nelmts; diff --git a/tools/perform/pio_standalone.h b/tools/perform/pio_standalone.h index 584a057..762a564 100644 --- a/tools/perform/pio_standalone.h +++ b/tools/perform/pio_standalone.h @@ -105,10 +105,10 @@ typedef off_t h5_stat_size_t; * HDF Boolean type. */ #ifndef FALSE -# define FALSE 0 +# define FALSE false #endif #ifndef TRUE -# define TRUE 1 +# define TRUE true #endif diff --git a/tools/perform/sio_standalone.h b/tools/perform/sio_standalone.h index 8f52eba..547a9ee 100644 --- a/tools/perform/sio_standalone.h +++ b/tools/perform/sio_standalone.h @@ -471,10 +471,10 @@ extern char *strdup(const char *s); * HDF Boolean type. */ #ifndef FALSE -# define FALSE 0 +# define FALSE false #endif #ifndef TRUE -# define TRUE 1 +# define TRUE true #endif /** From h5test.h **/ -- cgit v0.12 From 1bf086b0808593fa07e8cd9d18ad3d96a8da9439 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 20 Oct 2015 16:01:07 -0500 Subject: [svn-r28145] Correct define vs variable usage --- config/cmake/scripts/HDF518config.cmake | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/config/cmake/scripts/HDF518config.cmake b/config/cmake/scripts/HDF518config.cmake index 1c92e1e..2e16831 100755 --- a/config/cmake/scripts/HDF518config.cmake +++ b/config/cmake/scripts/HDF518config.cmake @@ -156,12 +156,12 @@ set(REPOSITORY_URL "http://svn.hdfgroup.uiuc.edu/hdf5/branches/hdf5_1_8_16") #### format: set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DXXX:YY=ZZZZ") ################################################################### -if(STATICLIBRARIES) +if(${STATICLIBRARIES}) set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=OFF") ######### Following describes computer ############ ## following is optional to describe build ## set(SITE_BUILDNAME_SUFFIX "STATIC") -endif(STATICLIBRARIES) +endif() ################################################################### ### uncomment/comment and change the following lines for other configuration options @@ -179,11 +179,11 @@ set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ALLOW_EXTERNAL_SUPPORT:STRING #set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_SZIP_SUPPORT:BOOL=OFF") #set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_SZIP_ENCODING:BOOL=OFF") #### fortran #### -if(FORTRANLIBRARIES) +if(${FORTRANLIBRARIES}) set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF_BUILD_FORTRAN:BOOL=ON") ### enable Fortran 2003 depends on HDF5_BUILD_FORTRAN set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_F2003:BOOL=ON") -endif(FORTRANLIBRARIES) +endif() ### disable test program builds #set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DBUILD_TESTING:BOOL=OFF") -- cgit v0.12 From 84c4dc0039642804ab7f130a3e0f2d756b670a86 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 20 Oct 2015 16:09:27 -0500 Subject: [svn-r28147] Correct define vs variable usage --- config/cmake/scripts/CTestScript.cmake | 2 ++ config/cmake/scripts/HDF518config.cmake | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/config/cmake/scripts/CTestScript.cmake b/config/cmake/scripts/CTestScript.cmake index d7c777d..403eedd 100755 --- a/config/cmake/scripts/CTestScript.cmake +++ b/config/cmake/scripts/CTestScript.cmake @@ -255,6 +255,8 @@ message(STATUS "Dashboard script configuration:\n${vars}\n") if(LOCAL_UPDATE) ctest_update (SOURCE "${CTEST_SOURCE_DIRECTORY}") endif() + configure_file(${CTEST_SOURCE_DIRECTORY}/config/cmake/CTestCustom.cmake ${CTEST_BINARY_DIRECTORY}/CTestCustom.cmake) + ctest_read_custom_files ("${CTEST_BINARY_DIRECTORY}") ctest_configure (BUILD "${CTEST_BINARY_DIRECTORY}") if(LOCAL_SUBMIT) ctest_submit (PARTS Update Configure Notes) diff --git a/config/cmake/scripts/HDF518config.cmake b/config/cmake/scripts/HDF518config.cmake index 2e16831..7c18e86 100755 --- a/config/cmake/scripts/HDF518config.cmake +++ b/config/cmake/scripts/HDF518config.cmake @@ -19,7 +19,7 @@ cmake_minimum_required(VERSION 3.1.0 FATAL_ERROR) # INSTALLDIR - root folder where hdf5 is installed # CTEST_BUILD_CONFIGURATION - Release, Debug, etc # CTEST_SOURCE_NAME - source folder -# STATICLIBRARIES - Build/use static libraries +# STATIC_LIBRARIES - Build/use static libraries # NO_MAC_FORTRAN - Yes to be SHARED on a Mac ############################################################################## -- cgit v0.12 From 01a198ac1b16453fd7f09025bb5cf678af5e7939 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 20 Oct 2015 16:13:45 -0500 Subject: [svn-r28148] Correct define vs variable usage --- config/cmake/HDF518_Examples.cmake.in | 96 +++++++++++++++++++++++------------ config/cmake/HDF5_Examples.cmake.in | 26 +++++----- 2 files changed, 76 insertions(+), 46 deletions(-) diff --git a/config/cmake/HDF518_Examples.cmake.in b/config/cmake/HDF518_Examples.cmake.in index c82fcf2..275730a 100644 --- a/config/cmake/HDF518_Examples.cmake.in +++ b/config/cmake/HDF518_Examples.cmake.in @@ -1,47 +1,77 @@ cmake_minimum_required(VERSION 3.1.0 FATAL_ERROR) ############################################################################################################### -# This script will build and run the examples from a compressed file +# This script will build and run the examples from a folder # Execute from a command line: -# ctest -S HDF518_Examples.cmake,HDF5Examples-0.1.1-Source -C Release -VV -O test.log +# ctest -S HDF5_Examples.cmake,OPTION=VALUE -C Release -V -O test.log ############################################################################################################### -set(INSTALLDIR "@CMAKE_INSTALL_PREFIX@") set(CTEST_CMAKE_GENERATOR "@CMAKE_GENERATOR@") -set(STATICLIBRARIES "@H5_ENABLE_STATIC_LIB@") -set(CTEST_SOURCE_NAME ${CTEST_SCRIPT_ARG}) set(CTEST_DASHBOARD_ROOT ${CTEST_SCRIPT_DIRECTORY}) -set(CTEST_BUILD_CONFIGURATION "Release") -#set(NO_MAC_FORTRAN "true") #set(BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF_BUILD_FORTRAN:BOOL=ON") -#set(CTEST_USE_TAR_SOURCE "${CTEST_SCRIPT_ARG}") + +# handle input parameters to script. +#INSTALLDIR - HDF5 root folder +#CTEST_BUILD_CONFIGURATION - Release, Debug, RelWithDebInfo +#CTEST_SOURCE_NAME - name of source folder; HDF4Examples +#STATICLIBRARIES - Default is YES +#NO_MAC_FORTRAN - set to TRUE to allow shared libs on a Mac) +if(DEFINED CTEST_SCRIPT_ARG) + # transform ctest script arguments of the form + # script.ctest,var1=value1,var2=value2 + # to variables with the respective names set to the respective values + string(REPLACE "," ";" script_args "${CTEST_SCRIPT_ARG}") + foreach(current_var ${script_args}) + if ("${current_var}" MATCHES "^([^=]+)=(.+)$") + set("${CMAKE_MATCH_1}" "${CMAKE_MATCH_2}") + endif() + endforeach() +endif() +if(NOT DEFINED INSTALLDIR) + set(INSTALLDIR "@CMAKE_INSTALL_PREFIX@") +endif() +if(NOT DEFINED CTEST_BUILD_CONFIGURATION) + set(CTEST_BUILD_CONFIGURATION "Release") +endif() +if(NOT DEFINED CTEST_SOURCE_NAME) + set(CTEST_SOURCE_NAME "HDF5Examples") +endif() +if(NOT DEFINED STATIC_LIBRARIES) + set(STATICLIBRARIES "YES") +endif() + +#TAR_SOURCE - name of tarfile +#if(NOT DEFINED TAR_SOURCE) +# set(CTEST_USE_TAR_SOURCE "HDF5Examples-1.10.1-Source") +#endif() ############################################################################################################### # Adjust the following SET Commands as needed ############################################################################################################### if(WIN32) - if(STATICLIBRARIES) + if(${STATICLIBRARIES}) set(BUILD_OPTIONS "${BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=OFF") - endif(STATICLIBRARIES) + endif() set(ENV{HDF5_DIR} "${INSTALLDIR}/cmake") set(CTEST_BINARY_NAME ${CTEST_SOURCE_NAME}\\build) set(CTEST_SOURCE_DIRECTORY "${CTEST_DASHBOARD_ROOT}\\${CTEST_SOURCE_NAME}") set(CTEST_BINARY_DIRECTORY "${CTEST_DASHBOARD_ROOT}\\${CTEST_BINARY_NAME}") else(WIN32) - if(STATICLIBRARIES) + if(${STATICLIBRARIES}) set(BUILD_OPTIONS "${BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=OFF -DCMAKE_ANSI_CFLAGS:STRING=-fPIC") - endif(STATICLIBRARIES) + endif() set(ENV{HDF5_DIR} "${INSTALLDIR}/share/cmake") set(ENV{LD_LIBRARY_PATH} "${INSTALLDIR}/lib") set(CTEST_BINARY_NAME ${CTEST_SOURCE_NAME}/build) set(CTEST_SOURCE_DIRECTORY "${CTEST_DASHBOARD_ROOT}/${CTEST_SOURCE_NAME}") set(CTEST_BINARY_DIRECTORY "${CTEST_DASHBOARD_ROOT}/${CTEST_BINARY_NAME}") endif(WIN32) +set(BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF5_PACKAGE_NAME:STRING=@HDF5_PACKAGE@@HDF_PACKAGE_EXT@") ############################################################################################################### # For any comments please contact cdashhelp@hdfgroup.org # ############################################################################################################### - + #----------------------------------------------------------------------------- # MAC machines need special option #----------------------------------------------------------------------------- @@ -52,14 +82,14 @@ if(APPLE) set(ENV{CC} "${XCODE_CC}") set(ENV{CXX} "${XCODE_CXX}") if(NOT NO_MAC_FORTRAN) - # Shared fortran is not supported, build static + # Shared fortran is not supported, build static set(BUILD_OPTIONS "${BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=OFF -DCMAKE_ANSI_CFLAGS:STRING=-fPIC") - else(NOT NO_MAC_FORTRAN) + else() set(BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF_BUILD_FORTRAN:BOOL=OFF") - endif(NOT NO_MAC_FORTRAN) + endif() set(BUILD_OPTIONS "${BUILD_OPTIONS} -DCTEST_USE_LAUNCHERS:BOOL=ON -DCMAKE_BUILD_WITH_INSTALL_RPATH:BOOL=OFF") -endif(APPLE) - +endif() + #----------------------------------------------------------------------------- set(CTEST_CMAKE_COMMAND "\"${CMAKE_COMMAND}\"") ## -------------------------- @@ -68,28 +98,28 @@ if(CTEST_USE_TAR_SOURCE) ## -------------------------- if(WIN32) message(STATUS "extracting... [${CMAKE_EXECUTABLE_NAME} -E tar -xvf ${CTEST_USE_TAR_SOURCE}.zip]") - execute_process(COMMAND ${CMAKE_EXECUTABLE_NAME} -E tar -xvf ${CTEST_USE_TAR_SOURCE}.zip RESULT_VARIABLE rv) - else(WIN32) + execute_process(COMMAND ${CMAKE_EXECUTABLE_NAME} -E tar -xvf ${CTEST_DASHBOARD_ROOT}\\${CTEST_USE_TAR_SOURCE}.zip RESULT_VARIABLE rv) + else() message(STATUS "extracting... [${CMAKE_EXECUTABLE_NAME} -E tar -xvf ${CTEST_USE_TAR_SOURCE}.tar]") - execute_process(COMMAND ${CMAKE_EXECUTABLE_NAME} -E tar -xvf ${CTEST_USE_TAR_SOURCE}.tar RESULT_VARIABLE rv) - endif(WIN32) - + execute_process(COMMAND ${CMAKE_EXECUTABLE_NAME} -E tar -xvf ${CTEST_DASHBOARD_ROOT}/${CTEST_USE_TAR_SOURCE}.tar RESULT_VARIABLE rv) + endif() + if(NOT rv EQUAL 0) message(STATUS "extracting... [error-(${rv}) clean up]") file(REMOVE_RECURSE "${CTEST_SOURCE_DIRECTORY}") message(FATAL_ERROR "error: extract of ${CTEST_SOURCE_NAME} failed") - endif(NOT rv EQUAL 0) + endif() endif(CTEST_USE_TAR_SOURCE) - + #----------------------------------------------------------------------------- ## Clear the build directory ## -------------------------- set(CTEST_START_WITH_EMPTY_BINARY_DIRECTORY TRUE) if (EXISTS "${CTEST_BINARY_DIRECTORY}" AND IS_DIRECTORY "${CTEST_BINARY_DIRECTORY}") ctest_empty_binary_directory(${CTEST_BINARY_DIRECTORY}) -else (EXISTS "${CTEST_BINARY_DIRECTORY}" AND IS_DIRECTORY "${CTEST_BINARY_DIRECTORY}") +else () file(MAKE_DIRECTORY "${CTEST_BINARY_DIRECTORY}") -endif (EXISTS "${CTEST_BINARY_DIRECTORY}" AND IS_DIRECTORY "${CTEST_BINARY_DIRECTORY}") +endif () # Use multiple CPU cores to build include(ProcessorCount) @@ -97,17 +127,17 @@ ProcessorCount(N) if(NOT N EQUAL 0) if(NOT WIN32) set(CTEST_BUILD_FLAGS -j${N}) - endif(NOT WIN32) + endif() set(ctest_test_args ${ctest_test_args} PARALLEL_LEVEL ${N}) endif() 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}\"" ) - + #----------------------------------------------------------------------------- ## -- set output to english set($ENV{LC_MESSAGES} "en_EN") - + #----------------------------------------------------------------------------- configure_file(${CTEST_SOURCE_DIRECTORY}/config/cmake/CTestCustom.cmake ${CTEST_BINARY_DIRECTORY}/CTestCustom.cmake) ctest_read_custom_files ("${CTEST_BINARY_DIRECTORY}") @@ -119,7 +149,7 @@ ctest_build (BUILD "${CTEST_BINARY_DIRECTORY}" APPEND) ctest_test (BUILD "${CTEST_BINARY_DIRECTORY}" APPEND ${ctest_test_args} RETURN_VALUE res) if(res GREATER 0) message (FATAL_ERROR "tests FAILED") -endif(res GREATER 0) +endif() #----------------------------------------------------------------------------- -############################################################################################################## -message(STATUS "DONE") +############################################################################################################## +message(STATUS "DONE") \ No newline at end of file diff --git a/config/cmake/HDF5_Examples.cmake.in b/config/cmake/HDF5_Examples.cmake.in index e730625..275730a 100644 --- a/config/cmake/HDF5_Examples.cmake.in +++ b/config/cmake/HDF5_Examples.cmake.in @@ -35,7 +35,7 @@ endif() if(NOT DEFINED CTEST_SOURCE_NAME) set(CTEST_SOURCE_NAME "HDF5Examples") endif() -if(NOT DEFINED STATICLIBRARIES) +if(NOT DEFINED STATIC_LIBRARIES) set(STATICLIBRARIES "YES") endif() @@ -48,17 +48,17 @@ endif() # Adjust the following SET Commands as needed ############################################################################################################### if(WIN32) - if(STATICLIBRARIES) + if(${STATICLIBRARIES}) set(BUILD_OPTIONS "${BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=OFF") - endif(STATICLIBRARIES) + endif() set(ENV{HDF5_DIR} "${INSTALLDIR}/cmake") set(CTEST_BINARY_NAME ${CTEST_SOURCE_NAME}\\build) set(CTEST_SOURCE_DIRECTORY "${CTEST_DASHBOARD_ROOT}\\${CTEST_SOURCE_NAME}") set(CTEST_BINARY_DIRECTORY "${CTEST_DASHBOARD_ROOT}\\${CTEST_BINARY_NAME}") else(WIN32) - if(STATICLIBRARIES) + if(${STATICLIBRARIES}) set(BUILD_OPTIONS "${BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=OFF -DCMAKE_ANSI_CFLAGS:STRING=-fPIC") - endif(STATICLIBRARIES) + endif() set(ENV{HDF5_DIR} "${INSTALLDIR}/share/cmake") set(ENV{LD_LIBRARY_PATH} "${INSTALLDIR}/lib") set(CTEST_BINARY_NAME ${CTEST_SOURCE_NAME}/build) @@ -84,11 +84,11 @@ if(APPLE) if(NOT NO_MAC_FORTRAN) # Shared fortran is not supported, build static set(BUILD_OPTIONS "${BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=OFF -DCMAKE_ANSI_CFLAGS:STRING=-fPIC") - else(NOT NO_MAC_FORTRAN) + else() set(BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF_BUILD_FORTRAN:BOOL=OFF") - endif(NOT NO_MAC_FORTRAN) + endif() set(BUILD_OPTIONS "${BUILD_OPTIONS} -DCTEST_USE_LAUNCHERS:BOOL=ON -DCMAKE_BUILD_WITH_INSTALL_RPATH:BOOL=OFF") -endif(APPLE) +endif() #----------------------------------------------------------------------------- set(CTEST_CMAKE_COMMAND "\"${CMAKE_COMMAND}\"") @@ -108,7 +108,7 @@ if(CTEST_USE_TAR_SOURCE) message(STATUS "extracting... [error-(${rv}) clean up]") file(REMOVE_RECURSE "${CTEST_SOURCE_DIRECTORY}") message(FATAL_ERROR "error: extract of ${CTEST_SOURCE_NAME} failed") - endif(NOT rv EQUAL 0) + endif() endif(CTEST_USE_TAR_SOURCE) #----------------------------------------------------------------------------- @@ -117,9 +117,9 @@ endif(CTEST_USE_TAR_SOURCE) set(CTEST_START_WITH_EMPTY_BINARY_DIRECTORY TRUE) if (EXISTS "${CTEST_BINARY_DIRECTORY}" AND IS_DIRECTORY "${CTEST_BINARY_DIRECTORY}") ctest_empty_binary_directory(${CTEST_BINARY_DIRECTORY}) -else (EXISTS "${CTEST_BINARY_DIRECTORY}" AND IS_DIRECTORY "${CTEST_BINARY_DIRECTORY}") +else () file(MAKE_DIRECTORY "${CTEST_BINARY_DIRECTORY}") -endif (EXISTS "${CTEST_BINARY_DIRECTORY}" AND IS_DIRECTORY "${CTEST_BINARY_DIRECTORY}") +endif () # Use multiple CPU cores to build include(ProcessorCount) @@ -127,7 +127,7 @@ ProcessorCount(N) if(NOT N EQUAL 0) if(NOT WIN32) set(CTEST_BUILD_FLAGS -j${N}) - endif(NOT WIN32) + endif() set(ctest_test_args ${ctest_test_args} PARALLEL_LEVEL ${N}) endif() set (CTEST_CONFIGURE_COMMAND @@ -149,7 +149,7 @@ ctest_build (BUILD "${CTEST_BINARY_DIRECTORY}" APPEND) ctest_test (BUILD "${CTEST_BINARY_DIRECTORY}" APPEND ${ctest_test_args} RETURN_VALUE res) if(res GREATER 0) message (FATAL_ERROR "tests FAILED") -endif(res GREATER 0) +endif() #----------------------------------------------------------------------------- ############################################################################################################## message(STATUS "DONE") \ No newline at end of file -- cgit v0.12 From 7ad885febcb3034fceab36d63514c8ea3fb70b61 Mon Sep 17 00:00:00 2001 From: Neil Fortner Date: Tue, 20 Oct 2015 17:05:28 -0500 Subject: [svn-r28151] Fix memory leak in dtransform test (encountered when parsing an invalid transform). Tested: koala, ostrich (h5committest) --- src/H5Ztrans.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/H5Ztrans.c b/src/H5Ztrans.c index 42d6ceb..0a9a4da 100644 --- a/src/H5Ztrans.c +++ b/src/H5Ztrans.c @@ -748,6 +748,7 @@ H5Z_parse_term(H5Z_token *current, H5Z_datval_ptrs* dat_val_pointers) case H5Z_XFORM_ERROR: default: + H5Z_xform_destroy_parse_tree(term); HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "bad transform type passed to data transform expression") } /* end switch */ } /* end for */ -- cgit v0.12 From 6a6e921d2f719304a2aacf921cd67117c8f3dfa7 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 20 Oct 2015 17:11:10 -0500 Subject: [svn-r28152] Correct define vs variable usage Add VS2015 --- MANIFEST | 4 +- config/cmake/scripts/HDF518config.cmake | 241 ----------------------------- config/cmake/scripts/HDF5config.cmake | 260 ++++++++++++++++++++++++++++++++ 3 files changed, 262 insertions(+), 243 deletions(-) delete mode 100755 config/cmake/scripts/HDF518config.cmake create mode 100755 config/cmake/scripts/HDF5config.cmake diff --git a/MANIFEST b/MANIFEST index 74439a0..8d0a082 100644 --- a/MANIFEST +++ b/MANIFEST @@ -32,7 +32,7 @@ ./README.txt ./BRANCH.txt ./acsite.m4 -./autogen.sh +./autogen.sh ./configure.ac ./bin/COPYING @@ -2521,4 +2521,4 @@ # CMake-specific User Scripts ./config/cmake/scripts/CTestScript.cmake -./config/cmake/scripts/HDF518config.cmake +./config/cmake/scripts/HDF5config.cmake diff --git a/config/cmake/scripts/HDF518config.cmake b/config/cmake/scripts/HDF518config.cmake deleted file mode 100755 index 7c18e86..0000000 --- a/config/cmake/scripts/HDF518config.cmake +++ /dev/null @@ -1,241 +0,0 @@ -########################################################################################## -### ${CTEST_SCRIPT_ARG} is of the form OPTION=VALUE ### -### BUILD_GENERATOR required [Unix, VS2013, VS201364, VS2012, VS201264] ### -### ctest -S HDF518config.cmake,BUILD_GENERATOR=VS201264 -C Release -V -O hdf518.log ### -########################################################################################## - -cmake_minimum_required(VERSION 3.1.0 FATAL_ERROR) -############################################################################ -# Usage: -# ctest -S HDF518config.cmake,OPTION=VALUE -C Release -VV -O test.log -# where valid options for OPTION are: -# BUILD_GENERATOR - The cmake build generator: -# Unix * Unix Makefiles -# VS2013 * Visual Studio 12 2013 -# VS201364 * Visual Studio 12 2013 Win64 -# VS2012 * Visual Studio 11 2012 -# VS201264 * Visual Studio 11 2012 Win64 -# -# INSTALLDIR - root folder where hdf5 is installed -# CTEST_BUILD_CONFIGURATION - Release, Debug, etc -# CTEST_SOURCE_NAME - source folder -# STATIC_LIBRARIES - Build/use static libraries -# NO_MAC_FORTRAN - Yes to be SHARED on a Mac -############################################################################## - -set(CTEST_SOURCE_VERSION 1.8.16) -set(CTEST_SOURCE_VERSEXT "-pre1") - -############################################################################## -# handle input parameters to script. -#BUILD_GENERATOR - which CMake generator to use, required -#INSTALLDIR - HDF5-1.8 root folder -#CTEST_BUILD_CONFIGURATION - Release, Debug, RelWithDebInfo -#CTEST_SOURCE_NAME - name of source folder; HDF5-1.8 -#STATICLIBRARIES - Default is YES -#NO_MAC_FORTRAN - set to TRUE to allow shared libs on a Mac -if(DEFINED CTEST_SCRIPT_ARG) - # transform ctest script arguments of the form - # script.ctest,var1=value1,var2=value2 - # to variables with the respective names set to the respective values - string(REPLACE "," ";" script_args "${CTEST_SCRIPT_ARG}") - foreach(current_var ${script_args}) - if ("${current_var}" MATCHES "^([^=]+)=(.+)$") - set("${CMAKE_MATCH_1}" "${CMAKE_MATCH_2}") - endif() - endforeach() -endif() - -# build generator must be defined -if(NOT DEFINED BUILD_GENERATOR) - message(FATAL_ERROR "BUILD_GENERATOR must be defined - Unix, VS2013, VS201364, VS2012, or VS201264") -else() - if(${BUILD_GENERATOR} STREQUAL "Unix") - set(CTEST_CMAKE_GENERATOR "Unix Makefiles") - elseif(${BUILD_GENERATOR} STREQUAL "VS2013") - set(CTEST_CMAKE_GENERATOR "Visual Studio 12 2013") - elseif(${BUILD_GENERATOR} STREQUAL "VS201364") - set(CTEST_CMAKE_GENERATOR "Visual Studio 12 2013 Win64") - elseif(${BUILD_GENERATOR} STREQUAL "VS2012") - set(CTEST_CMAKE_GENERATOR "Visual Studio 11 2012") - elseif(${BUILD_GENERATOR} STREQUAL "VS201264") - set(CTEST_CMAKE_GENERATOR "Visual Studio 11 2012 Win64") - else() - message(FATAL_ERROR "Invalid BUILD_GENERATOR must be - Unix, VS2013, VS201364, VS2012, or VS201264") - endif() -endif() - -if(NOT DEFINED INSTALLDIR) - if(WIN32) - set(INSTALLDIR "C:\\Program\ Files\\myhdf5") - else() - set(INSTALLDIR "/usr/local/myhdf5") - endif() -endif() -if(NOT DEFINED CTEST_BUILD_CONFIGURATION) - set(CTEST_BUILD_CONFIGURATION "Release") -endif() -if(NOT DEFINED CTEST_SOURCE_NAME) - set(CTEST_SOURCE_NAME "hdf5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}") -endif() -if(NOT DEFINED STATICLIBRARIES) - set(STATICLIBRARIES "YES") -endif() -if(NOT DEFINED FORTRANLIBRARIES) - set(FORTRANLIBRARIES "NO") -endif() - -set(CTEST_BINARY_NAME "build") -set(CTEST_DASHBOARD_ROOT "${CTEST_SCRIPT_DIRECTORY}") -if(WIN32) - set(CTEST_SOURCE_DIRECTORY "${CTEST_DASHBOARD_ROOT}\\${CTEST_SOURCE_NAME}") - set(CTEST_BINARY_DIRECTORY "${CTEST_DASHBOARD_ROOT}\\${CTEST_BINARY_NAME}") -else() - set(CTEST_SOURCE_DIRECTORY "${CTEST_DASHBOARD_ROOT}/${CTEST_SOURCE_NAME}") - set(CTEST_BINARY_DIRECTORY "${CTEST_DASHBOARD_ROOT}/${CTEST_BINARY_NAME}") -endif() - -################################################################### -######### Following describes compiler ############ -if(WIN32) - set(SITE_OS_NAME "Windows") - set(SITE_OS_VERSION "WIN7") - if(${BUILD_GENERATOR} STREQUAL "VS201364") - set(SITE_OS_BITS "64") - set(SITE_COMPILER_NAME "vs2013") - set(SITE_COMPILER_VERSION "12") - elseif(${BUILD_GENERATOR} STREQUAL "VS2013") - set(SITE_OS_BITS "32") - set(SITE_COMPILER_NAME "vs2013") - set(SITE_COMPILER_VERSION "12") - elseif(${BUILD_GENERATOR} STREQUAL "VS201264") - set(SITE_OS_BITS "64") - set(SITE_COMPILER_NAME "vs2012") - set(SITE_COMPILER_VERSION "11") - elseif(${BUILD_GENERATOR} STREQUAL "VS2012") - set(SITE_OS_BITS "32") - set(SITE_COMPILER_NAME "vs2012") - set(SITE_COMPILER_VERSION "11") - endif() -## Set the following to unique id your computer ## - set(CTEST_SITE "WIN7${BUILD_GENERATOR}.XXXX") -else() -## Set the following to unique id your computer ## - if(APPLE) - set(CTEST_SITE "MAC.XXXX") - else() - set(CTEST_SITE "LINUX.XXXX") - endif() -endif() -################################################################### - -################################################################### -######### Following is for submission to CDash ############ -################################################################### -set(MODEL "Experimental") -################################################################### - -################################################################### -##### Following controls CDash submission ##### -#set(LOCAL_SUBMIT "TRUE") -##### Following controls test process ##### -#set(LOCAL_SKIP_TEST "TRUE") -#set(LOCAL_MEMCHECK_TEST "TRUE") -#set(LOCAL_COVERAGE_TEST "TRUE") -##### Following controls cpack command ##### -#set(LOCAL_NO_PACKAGE "TRUE") -##### Following controls source update ##### -#set(LOCAL_UPDATE "TRUE") -set(REPOSITORY_URL "http://svn.hdfgroup.uiuc.edu/hdf5/branches/hdf5_1_8_16") -#uncomment to use a compressed source file: *.tar on linux or mac *.zip on windows -#set(CTEST_USE_TAR_SOURCE "${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}") -################################################################### - -################################################################### -#### Change default configuration of options in config/cmake/cacheinit.cmake file ### -#### format: set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DXXX:YY=ZZZZ") - -################################################################### -if(${STATICLIBRARIES}) - set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=OFF") - ######### Following describes computer ############ - ## following is optional to describe build ## - set(SITE_BUILDNAME_SUFFIX "STATIC") -endif() -################################################################### - -### uncomment/comment and change the following lines for other configuration options - -#### ext libraries #### -### ext libs from tgz -set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ALLOW_EXTERNAL_SUPPORT:STRING=TGZ -DTGZPATH:PATH=${CTEST_SCRIPT_DIRECTORY}") -### ext libs from svn -#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ALLOW_EXTERNAL_SUPPORT:STRING=SVN") -### ext libs on system -#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DZLIB_LIBRARY:FILEPATH=some_location/lib/zlib.lib -DZLIB_INCLUDE_DIR:PATH=some_location/include") -#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DSZIP_LIBRARY:FILEPATH=some_location/lib/szlib.lib -DSZIP_INCLUDE_DIR:PATH=some_location/include") -### disable ext libs building -#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_Z_LIB_SUPPORT:BOOL=OFF") -#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_SZIP_SUPPORT:BOOL=OFF") -#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_SZIP_ENCODING:BOOL=OFF") -#### fortran #### -if(${FORTRANLIBRARIES}) - set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF_BUILD_FORTRAN:BOOL=ON") - ### enable Fortran 2003 depends on HDF5_BUILD_FORTRAN - set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_F2003:BOOL=ON") -endif() - -### disable test program builds -#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DBUILD_TESTING:BOOL=OFF") - -### disable packaging -#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_NO_PACKAGES:BOOL=ON") -### Create install package with external libraries (szip, zlib, jpeg) -set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_PACKAGE_EXTLIBS:BOOL=ON") - -### change install prefix -set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DCMAKE_INSTALL_PREFIX:PATH=${INSTALLDIR}") - -################################################################### - -if(WIN32) - include(${CTEST_SCRIPT_DIRECTORY}\\CTestScript.cmake) - if(EXISTS "${CTEST_BINARY_DIRECTORY}\\HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-win${SITE_OS_BITS}.exe") - file(COPY "${CTEST_BINARY_DIRECTORY}\\HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-win${SITE_OS_BITS}.exe" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) - endif() - if(EXISTS "${CTEST_BINARY_DIRECTORY}\\HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-win${SITE_OS_BITS}.msi") - file(COPY "${CTEST_BINARY_DIRECTORY}\\HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-win${SITE_OS_BITS}.msi" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) - endif() - if(EXISTS "${CTEST_BINARY_DIRECTORY}\\HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-win${SITE_OS_BITS}.zip") - file(COPY "${CTEST_BINARY_DIRECTORY}\\HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-win${SITE_OS_BITS}.zip" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) - endif() -else() - include(${CTEST_SCRIPT_DIRECTORY}/CTestScript.cmake) - if(APPLE) - if(EXISTS "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-Darwin.dmg") - file(COPY "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-Darwin.dmg" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) - endif() - if(EXISTS "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-Darwin.tar.gz") - file(COPY "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-Darwin.tar.gz" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) - endif() - if(EXISTS "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-Darwin.sh") - file(COPY "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-Darwin.sh" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) - endif() - else() - if(CYGWIN) - if(EXISTS "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-CYGWIN.sh") - file(COPY "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-CYGWIN.sh" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) - endif() - if(EXISTS "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-CYGWIN.tar.gz") - file(COPY "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-CYGWIN.tar.gz" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) - endif() - else() - if(EXISTS "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-Linux.sh") - file(COPY "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-Linux.sh" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) - endif() - if(EXISTS "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-Linux.tar.gz") - file(COPY "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-Linux.tar.gz" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) - endif() - endif() - endif() -endif() diff --git a/config/cmake/scripts/HDF5config.cmake b/config/cmake/scripts/HDF5config.cmake new file mode 100755 index 0000000..8790297 --- /dev/null +++ b/config/cmake/scripts/HDF5config.cmake @@ -0,0 +1,260 @@ +########################################################################################## +### ${CTEST_SCRIPT_ARG} is of the form OPTION=VALUE ### +### BUILD_GENERATOR required [Unix, VS2013, VS201364, VS2012, VS201264] ### +### ctest -S HDF518config.cmake,BUILD_GENERATOR=VS201264 -C Release -V -O hdf518.log ### +########################################################################################## + +cmake_minimum_required(VERSION 3.1.0 FATAL_ERROR) +############################################################################ +# Usage: +# ctest -S HDF518config.cmake,OPTION=VALUE -C Release -VV -O test.log +# where valid options for OPTION are: +# BUILD_GENERATOR - The cmake build generator: +# Unix * Unix Makefiles +# VS2015 * Visual Studio 14 2015 +# VS201564 * Visual Studio 14 2015 Win64 +# VS2013 * Visual Studio 12 2013 +# VS201364 * Visual Studio 12 2013 Win64 +# VS2012 * Visual Studio 11 2012 +# VS201264 * Visual Studio 11 2012 Win64 +# +# INSTALLDIR - root folder where hdf5 is installed +# CTEST_BUILD_CONFIGURATION - Release, Debug, etc +# CTEST_SOURCE_NAME - source folder +# STATIC_LIBRARIES - Build/use static libraries +# NO_MAC_FORTRAN - Yes to be SHARED on a Mac +############################################################################## + +set(CTEST_SOURCE_VERSION 1.9) +set(CTEST_SOURCE_VERSEXT "") + +############################################################################## +# handle input parameters to script. +#BUILD_GENERATOR - which CMake generator to use, required +#INSTALLDIR - HDF5-1.8 root folder +#CTEST_BUILD_CONFIGURATION - Release, Debug, RelWithDebInfo +#CTEST_SOURCE_NAME - name of source folder; HDF5-1.9 +#STATIC_LIBRARIES - Default is YES +#FORTRAN_LIBRARIES - Default is NO +#NO_MAC_FORTRAN - set to TRUE to allow shared libs on a Mac +if(DEFINED CTEST_SCRIPT_ARG) + # transform ctest script arguments of the form + # script.ctest,var1=value1,var2=value2 + # to variables with the respective names set to the respective values + string(REPLACE "," ";" script_args "${CTEST_SCRIPT_ARG}") + foreach(current_var ${script_args}) + if ("${current_var}" MATCHES "^([^=]+)=(.+)$") + set("${CMAKE_MATCH_1}" "${CMAKE_MATCH_2}") + endif() + endforeach() +endif() + +# build generator must be defined +if(NOT DEFINED BUILD_GENERATOR) + message(FATAL_ERROR "BUILD_GENERATOR must be defined - Unix, VS2013, VS201364, VS2012, or VS201264") +else() + if(${BUILD_GENERATOR} STREQUAL "Unix") + set(CTEST_CMAKE_GENERATOR "Unix Makefiles") + elseif(${BUILD_GENERATOR} STREQUAL "VS2015") + set(CTEST_CMAKE_GENERATOR "Visual Studio 14 2015") + elseif(${BUILD_GENERATOR} STREQUAL "VS201564") + set(CTEST_CMAKE_GENERATOR "Visual Studio 14 2015 Win64") + elseif(${BUILD_GENERATOR} STREQUAL "VS2013") + set(CTEST_CMAKE_GENERATOR "Visual Studio 12 2013") + elseif(${BUILD_GENERATOR} STREQUAL "VS201364") + set(CTEST_CMAKE_GENERATOR "Visual Studio 12 2013 Win64") + elseif(${BUILD_GENERATOR} STREQUAL "VS2012") + set(CTEST_CMAKE_GENERATOR "Visual Studio 11 2012") + elseif(${BUILD_GENERATOR} STREQUAL "VS201264") + set(CTEST_CMAKE_GENERATOR "Visual Studio 11 2012 Win64") + else() + message(FATAL_ERROR "Invalid BUILD_GENERATOR must be - Unix, VS2013, VS201364, VS2012, or VS201264") + endif() +endif() + +if(NOT DEFINED INSTALLDIR) + if(WIN32) + set(INSTALLDIR "C:\\Program\ Files\\myhdf5") + else() + set(INSTALLDIR "/usr/local/myhdf5") + endif() +endif() +if(NOT DEFINED CTEST_BUILD_CONFIGURATION) + set(CTEST_BUILD_CONFIGURATION "Release") +endif() +if(NOT DEFINED CTEST_SOURCE_NAME) + set(CTEST_SOURCE_NAME "hdf5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}") +endif() +if(NOT DEFINED STATIC_LIBRARIES) + set(STATICLIBRARIES "YES") +endif() +if(NOT DEFINED FORTRAN_LIBRARIES) + set(FORTRANLIBRARIES "NO") +endif() + +set(CTEST_BINARY_NAME "build") +set(CTEST_DASHBOARD_ROOT "${CTEST_SCRIPT_DIRECTORY}") +if(WIN32) + set(CTEST_SOURCE_DIRECTORY "${CTEST_DASHBOARD_ROOT}\\${CTEST_SOURCE_NAME}") + set(CTEST_BINARY_DIRECTORY "${CTEST_DASHBOARD_ROOT}\\${CTEST_BINARY_NAME}") +else() + set(CTEST_SOURCE_DIRECTORY "${CTEST_DASHBOARD_ROOT}/${CTEST_SOURCE_NAME}") + set(CTEST_BINARY_DIRECTORY "${CTEST_DASHBOARD_ROOT}/${CTEST_BINARY_NAME}") +endif() + +################################################################### +######### Following describes compiler ############ +if(WIN32) + set(SITE_OS_NAME "Windows") + set(SITE_OS_VERSION "WIN7") + if(${BUILD_GENERATOR} STREQUAL "VS201564") + set(SITE_OS_BITS "64") + set(SITE_COMPILER_NAME "vs2015") + set(SITE_COMPILER_VERSION "14") + elseif(${BUILD_GENERATOR} STREQUAL "VS2015") + set(SITE_OS_BITS "32") + set(SITE_COMPILER_NAME "vs2015") + set(SITE_COMPILER_VERSION "14") + elseif(${BUILD_GENERATOR} STREQUAL "VS201364") + set(SITE_OS_BITS "64") + set(SITE_COMPILER_NAME "vs2013") + set(SITE_COMPILER_VERSION "12") + elseif(${BUILD_GENERATOR} STREQUAL "VS2013") + set(SITE_OS_BITS "32") + set(SITE_COMPILER_NAME "vs2013") + set(SITE_COMPILER_VERSION "12") + elseif(${BUILD_GENERATOR} STREQUAL "VS201264") + set(SITE_OS_BITS "64") + set(SITE_COMPILER_NAME "vs2012") + set(SITE_COMPILER_VERSION "11") + elseif(${BUILD_GENERATOR} STREQUAL "VS2012") + set(SITE_OS_BITS "32") + set(SITE_COMPILER_NAME "vs2012") + set(SITE_COMPILER_VERSION "11") + endif() +## Set the following to unique id your computer ## + set(CTEST_SITE "WIN7${BUILD_GENERATOR}.XXXX") +else() +## Set the following to unique id your computer ## + if(APPLE) + set(CTEST_SITE "MAC.XXXX") + else() + set(CTEST_SITE "LINUX.XXXX") + endif() +endif() +################################################################### + +################################################################### +######### Following is for submission to CDash ############ +################################################################### +set(MODEL "Experimental") +################################################################### + +################################################################### +##### Following controls CDash submission ##### +#set(LOCAL_SUBMIT "TRUE") +##### Following controls test process ##### +#set(LOCAL_SKIP_TEST "TRUE") +#set(LOCAL_MEMCHECK_TEST "TRUE") +#set(LOCAL_COVERAGE_TEST "TRUE") +##### Following controls cpack command ##### +#set(LOCAL_NO_PACKAGE "TRUE") +##### Following controls source update ##### +#set(LOCAL_UPDATE "TRUE") +set(REPOSITORY_URL "http://svn.hdfgroup.uiuc.edu/hdf5/trunk") +#uncomment to use a compressed source file: *.tar on linux or mac *.zip on windows +#set(CTEST_USE_TAR_SOURCE "${CTEST_SOURCE_VERSION}") +################################################################### + +################################################################### +#### Change default configuration of options in config/cmake/cacheinit.cmake file ### +#### format: set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DXXX:YY=ZZZZ") + +################################################################### +if(${STATICLIBRARIES}) + set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=OFF") + ######### Following describes computer ############ + ## following is optional to describe build ## + set(SITE_BUILDNAME_SUFFIX "STATIC") +endif() +################################################################### + +### uncomment/comment and change the following lines for other configuration options + +#### ext libraries #### +### ext libs from tgz +set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ALLOW_EXTERNAL_SUPPORT:STRING=TGZ -DTGZPATH:PATH=${CTEST_SCRIPT_DIRECTORY}") +### ext libs from svn +#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ALLOW_EXTERNAL_SUPPORT:STRING=SVN") +### ext libs on system +#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DZLIB_LIBRARY:FILEPATH=some_location/lib/zlib.lib -DZLIB_INCLUDE_DIR:PATH=some_location/include") +#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DSZIP_LIBRARY:FILEPATH=some_location/lib/szlib.lib -DSZIP_INCLUDE_DIR:PATH=some_location/include") +### disable ext libs building +#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_Z_LIB_SUPPORT:BOOL=OFF") +#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_SZIP_SUPPORT:BOOL=OFF") +#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_SZIP_ENCODING:BOOL=OFF") +#### fortran #### +if(${FORTRANLIBRARIES}) + set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_FORTRAN:BOOL=ON") + ### enable Fortran 2003 depends on HDF5_BUILD_FORTRAN + set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_F2003:BOOL=ON") +else() + set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_FORTRAN:BOOL=OFF") + ### enable Fortran 2003 depends on HDF5_BUILD_FORTRAN + set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_F2003:BOOL=OFF") +endif() + +### disable test program builds +#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DBUILD_TESTING:BOOL=OFF") + +### disable packaging +#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_NO_PACKAGES:BOOL=ON") +### Create install package with external libraries (szip, zlib, jpeg) +set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_PACKAGE_EXTLIBS:BOOL=ON") + +### change install prefix +set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DCMAKE_INSTALL_PREFIX:PATH=${INSTALLDIR}") + +################################################################### + +if(WIN32) + include(${CTEST_SCRIPT_DIRECTORY}\\CTestScript.cmake) + if(EXISTS "${CTEST_BINARY_DIRECTORY}\\HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-win${SITE_OS_BITS}.exe") + file(COPY "${CTEST_BINARY_DIRECTORY}\\HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-win${SITE_OS_BITS}.exe" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) + endif() + if(EXISTS "${CTEST_BINARY_DIRECTORY}\\HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-win${SITE_OS_BITS}.msi") + file(COPY "${CTEST_BINARY_DIRECTORY}\\HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-win${SITE_OS_BITS}.msi" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) + endif() + if(EXISTS "${CTEST_BINARY_DIRECTORY}\\HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-win${SITE_OS_BITS}.zip") + file(COPY "${CTEST_BINARY_DIRECTORY}\\HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-win${SITE_OS_BITS}.zip" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) + endif() +else() + include(${CTEST_SCRIPT_DIRECTORY}/CTestScript.cmake) + if(APPLE) + if(EXISTS "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-Darwin.dmg") + file(COPY "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-Darwin.dmg" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) + endif() + if(EXISTS "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-Darwin.tar.gz") + file(COPY "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-Darwin.tar.gz" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) + endif() + if(EXISTS "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-Darwin.sh") + file(COPY "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-Darwin.sh" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) + endif() + else() + if(CYGWIN) + if(EXISTS "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-CYGWIN.sh") + file(COPY "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-CYGWIN.sh" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) + endif() + if(EXISTS "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-CYGWIN.tar.gz") + file(COPY "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-CYGWIN.tar.gz" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) + endif() + else() + if(EXISTS "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-Linux.sh") + file(COPY "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-Linux.sh" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) + endif() + if(EXISTS "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-Linux.tar.gz") + file(COPY "${CTEST_BINARY_DIRECTORY}/HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-Linux.tar.gz" DESTINATION ${CTEST_SCRIPT_DIRECTORY}) + endif() + endif() + endif() +endif() -- cgit v0.12 From 83d7feb63c0d38387bfb7814ccfdaa70bc1b77cd Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 20 Oct 2015 17:13:26 -0500 Subject: [svn-r28154] Correct define vs variable usage --- config/cmake/HDF518_Examples.cmake.in | 20 ++++++++++++++------ config/cmake/HDF5_Examples.cmake.in | 14 +++++++++++--- 2 files changed, 25 insertions(+), 9 deletions(-) diff --git a/config/cmake/HDF518_Examples.cmake.in b/config/cmake/HDF518_Examples.cmake.in index 275730a..0e3b26d 100644 --- a/config/cmake/HDF518_Examples.cmake.in +++ b/config/cmake/HDF518_Examples.cmake.in @@ -2,19 +2,19 @@ cmake_minimum_required(VERSION 3.1.0 FATAL_ERROR) ############################################################################################################### # This script will build and run the examples from a folder # Execute from a command line: -# ctest -S HDF5_Examples.cmake,OPTION=VALUE -C Release -V -O test.log +# ctest -S HDF518_Examples.cmake,OPTION=VALUE -C Release -VV -O test.log ############################################################################################################### set(CTEST_CMAKE_GENERATOR "@CMAKE_GENERATOR@") set(CTEST_DASHBOARD_ROOT ${CTEST_SCRIPT_DIRECTORY}) -#set(BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF_BUILD_FORTRAN:BOOL=ON") # handle input parameters to script. -#INSTALLDIR - HDF5 root folder +#INSTALLDIR - HDF5-1.8 root folder #CTEST_BUILD_CONFIGURATION - Release, Debug, RelWithDebInfo #CTEST_SOURCE_NAME - name of source folder; HDF4Examples -#STATICLIBRARIES - Default is YES -#NO_MAC_FORTRAN - set to TRUE to allow shared libs on a Mac) +#STATIC_LIBRARIES - Default is YES +#FORTRAN_LIBRARIES - Default is NO +##NO_MAC_FORTRAN - set to TRUE to allow shared libs on a Mac) if(DEFINED CTEST_SCRIPT_ARG) # transform ctest script arguments of the form # script.ctest,var1=value1,var2=value2 @@ -38,10 +38,13 @@ endif() if(NOT DEFINED STATIC_LIBRARIES) set(STATICLIBRARIES "YES") endif() +if(NOT DEFINED FORTRAN_LIBRARIES) + set(FORTRANLIBRARIES "NO") +endif() #TAR_SOURCE - name of tarfile #if(NOT DEFINED TAR_SOURCE) -# set(CTEST_USE_TAR_SOURCE "HDF5Examples-1.10.1-Source") +# set(CTEST_USE_TAR_SOURCE "HDF5Examples-1.2.1-Source") #endif() ############################################################################################################### @@ -65,6 +68,11 @@ else(WIN32) set(CTEST_SOURCE_DIRECTORY "${CTEST_DASHBOARD_ROOT}/${CTEST_SOURCE_NAME}") set(CTEST_BINARY_DIRECTORY "${CTEST_DASHBOARD_ROOT}/${CTEST_BINARY_NAME}") endif(WIN32) +if(${FORTRANLIBRARIES}) + set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF_BUILD_FORTRAN:BOOL=ON") +else() + set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF_BUILD_FORTRAN:BOOL=OFF") +endif() set(BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF5_PACKAGE_NAME:STRING=@HDF5_PACKAGE@@HDF_PACKAGE_EXT@") ############################################################################################################### diff --git a/config/cmake/HDF5_Examples.cmake.in b/config/cmake/HDF5_Examples.cmake.in index 275730a..a25eef5 100644 --- a/config/cmake/HDF5_Examples.cmake.in +++ b/config/cmake/HDF5_Examples.cmake.in @@ -7,14 +7,14 @@ cmake_minimum_required(VERSION 3.1.0 FATAL_ERROR) set(CTEST_CMAKE_GENERATOR "@CMAKE_GENERATOR@") set(CTEST_DASHBOARD_ROOT ${CTEST_SCRIPT_DIRECTORY}) -#set(BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF_BUILD_FORTRAN:BOOL=ON") # handle input parameters to script. #INSTALLDIR - HDF5 root folder #CTEST_BUILD_CONFIGURATION - Release, Debug, RelWithDebInfo #CTEST_SOURCE_NAME - name of source folder; HDF4Examples -#STATICLIBRARIES - Default is YES -#NO_MAC_FORTRAN - set to TRUE to allow shared libs on a Mac) +#STATIC_LIBRARIES - Default is YES +#FORTRAN_LIBRARIES - Default is NO +##NO_MAC_FORTRAN - set to TRUE to allow shared libs on a Mac) if(DEFINED CTEST_SCRIPT_ARG) # transform ctest script arguments of the form # script.ctest,var1=value1,var2=value2 @@ -38,6 +38,9 @@ endif() if(NOT DEFINED STATIC_LIBRARIES) set(STATICLIBRARIES "YES") endif() +if(NOT DEFINED FORTRAN_LIBRARIES) + set(FORTRANLIBRARIES "NO") +endif() #TAR_SOURCE - name of tarfile #if(NOT DEFINED TAR_SOURCE) @@ -65,6 +68,11 @@ else(WIN32) set(CTEST_SOURCE_DIRECTORY "${CTEST_DASHBOARD_ROOT}/${CTEST_SOURCE_NAME}") set(CTEST_BINARY_DIRECTORY "${CTEST_DASHBOARD_ROOT}/${CTEST_BINARY_NAME}") endif(WIN32) +if(${FORTRANLIBRARIES}) + set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF_BUILD_FORTRAN:BOOL=ON") +else() + set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF_BUILD_FORTRAN:BOOL=OFF") +endif() set(BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF5_PACKAGE_NAME:STRING=@HDF5_PACKAGE@@HDF_PACKAGE_EXT@") ############################################################################################################### -- cgit v0.12 From 78c820b1ee3ba31297f9de1df3ffa88fb137f588 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 21 Oct 2015 10:44:41 -0500 Subject: [svn-r28158] Merge from CMAMKE_EXT_MOD repo. Add VS2015 support. --- config/cmake/scripts/HDF5config.cmake | 17 ++--- config/cmake_ext_mod/ConfigureChecks.cmake | 67 +++++++++--------- config/cmake_ext_mod/HDFTests.c | 2 +- release_docs/INSTALL_CMake.txt | 44 +++++++----- release_docs/USING_CMake_Examples.txt | 10 ++- release_docs/USING_HDF5_CMake.txt | 108 ++++++++++------------------- 6 files changed, 110 insertions(+), 138 deletions(-) diff --git a/config/cmake/scripts/HDF5config.cmake b/config/cmake/scripts/HDF5config.cmake index 8790297..f01c980 100755 --- a/config/cmake/scripts/HDF5config.cmake +++ b/config/cmake/scripts/HDF5config.cmake @@ -1,8 +1,8 @@ -########################################################################################## -### ${CTEST_SCRIPT_ARG} is of the form OPTION=VALUE ### -### BUILD_GENERATOR required [Unix, VS2013, VS201364, VS2012, VS201264] ### -### ctest -S HDF518config.cmake,BUILD_GENERATOR=VS201264 -C Release -V -O hdf518.log ### -########################################################################################## +############################################################################################# +### ${CTEST_SCRIPT_ARG} is of the form OPTION=VALUE ### +### BUILD_GENERATOR required [Unix, VS2015, VS201564, VS2013, VS201364, VS2012, VS201264] ### +### ctest -S HDF5config.cmake,BUILD_GENERATOR=VS201264 -C Release -V -O hdf519.log ### +############################################################################################# cmake_minimum_required(VERSION 3.1.0 FATAL_ERROR) ############################################################################ @@ -22,6 +22,7 @@ cmake_minimum_required(VERSION 3.1.0 FATAL_ERROR) # CTEST_BUILD_CONFIGURATION - Release, Debug, etc # CTEST_SOURCE_NAME - source folder # STATIC_LIBRARIES - Build/use static libraries +# FORTRAN_LIBRARIES - Build/use fortran libraries # NO_MAC_FORTRAN - Yes to be SHARED on a Mac ############################################################################## @@ -31,7 +32,7 @@ set(CTEST_SOURCE_VERSEXT "") ############################################################################## # handle input parameters to script. #BUILD_GENERATOR - which CMake generator to use, required -#INSTALLDIR - HDF5-1.8 root folder +#INSTALLDIR - HDF5-1.9 root folder #CTEST_BUILD_CONFIGURATION - Release, Debug, RelWithDebInfo #CTEST_SOURCE_NAME - name of source folder; HDF5-1.9 #STATIC_LIBRARIES - Default is YES @@ -196,12 +197,8 @@ set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ALLOW_EXTERNAL_SUPPORT:STRING #### fortran #### if(${FORTRANLIBRARIES}) set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_FORTRAN:BOOL=ON") - ### enable Fortran 2003 depends on HDF5_BUILD_FORTRAN - set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_F2003:BOOL=ON") else() set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_FORTRAN:BOOL=OFF") - ### enable Fortran 2003 depends on HDF5_BUILD_FORTRAN - set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_F2003:BOOL=OFF") endif() ### disable test program builds diff --git a/config/cmake_ext_mod/ConfigureChecks.cmake b/config/cmake_ext_mod/ConfigureChecks.cmake index c76129a..94e5be1 100644 --- a/config/cmake_ext_mod/ConfigureChecks.cmake +++ b/config/cmake_ext_mod/ConfigureChecks.cmake @@ -31,13 +31,13 @@ if (APPLE) endif (APPLE) # Check for Darwin (not just Apple - we also want to catch OpenDarwin) -if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") - set (${HDF_PREFIX}_HAVE_DARWIN 1) +if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") + set (${HDF_PREFIX}_HAVE_DARWIN 1) endif (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") # Check for Solaris -if (${CMAKE_SYSTEM_NAME} MATCHES "SunOS") - set (${HDF_PREFIX}_HAVE_SOLARIS 1) +if (${CMAKE_SYSTEM_NAME} MATCHES "SunOS") + set (${HDF_PREFIX}_HAVE_SOLARIS 1) endif (${CMAKE_SYSTEM_NAME} MATCHES "SunOS") #----------------------------------------------------------------------------- @@ -90,7 +90,9 @@ if (WINDOWS) endif (NOT UNIX AND NOT CYGWIN AND NOT MINGW) set (${HDF_PREFIX}_HAVE_FUNCTION 1) set (${HDF_PREFIX}_GETTIMEOFDAY_GIVES_TZ 1) - set (${HDF_PREFIX}_HAVE_TIMEZONE 1) + if (MSVC_VERSION LESS 1900) + set (${HDF_PREFIX}_HAVE_TIMEZONE 1) + endif (MSVC_VERSION LESS 1900) set (${HDF_PREFIX}_HAVE_GETTIMEOFDAY 1) if (MINGW) set (${HDF_PREFIX}_HAVE_WINSOCK2_H 1) @@ -640,7 +642,7 @@ if (WINDOWS) "${CURRENT_TEST_DEFINITIONS} -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE" ) endif (LARGEFILE) - set (MACRO_CHECK_FUNCTION_DEFINITIONS + set (MACRO_CHECK_FUNCTION_DEFINITIONS "-DHAVE_IOEO ${CMAKE_REQUIRED_FLAGS}") if (CMAKE_REQUIRED_LIBRARIES) set (CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES @@ -672,7 +674,7 @@ if (WINDOWS) if ("${HAVE_IOEO_EXITCODE}" EQUAL 0) set (${HDF_PREFIX}_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") @@ -684,7 +686,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") @@ -721,35 +723,34 @@ endif (INLINE_TEST___inline__) if (NOT ${HDF_PREFIX}_PRINTF_LL_WIDTH OR ${HDF_PREFIX}_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 (${HDF_PREFIX}_SIZEOF_LONG_LONG) - set (CURRENT_TEST_DEFINITIONS "${CURRENT_TEST_DEFINITIONS} -DHAVE_LONG_LONG") - endif (${HDF_PREFIX}_SIZEOF_LONG_LONG) - TRY_RUN (HDF5_PRINTF_LL_TEST_RUN HDF5_PRINTF_LL_TEST_COMPILE - ${CMAKE_BINARY_DIR} - ${HDF_RESOURCES_EXT_DIR}/HDFTests.c - CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${CURRENT_TEST_DEFINITIONS} - OUTPUT_VARIABLE OUTPUT + set (CURRENT_TEST_DEFINITIONS "-DPRINTF_LL_WIDTH") + if (${HDF_PREFIX}_SIZEOF_LONG_LONG) + set (CURRENT_TEST_DEFINITIONS "${CURRENT_TEST_DEFINITIONS} -DHAVE_LONG_LONG") + endif (${HDF_PREFIX}_SIZEOF_LONG_LONG) + TRY_RUN (${HDF_PREFIX}_PRINTF_LL_TEST_RUN ${HDF_PREFIX}_PRINTF_LL_TEST_COMPILE + ${CMAKE_BINARY_DIR} + ${HDF_RESOURCES_EXT_DIR}/HDFTests.c + CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${CURRENT_TEST_DEFINITIONS} + OUTPUT_VARIABLE OUTPUT + ) + if (${HDF_PREFIX}_PRINTF_LL_TEST_COMPILE) + if (${HDF_PREFIX}_PRINTF_LL_TEST_RUN MATCHES 0) + string(REGEX REPLACE ".*PRINTF_LL_WIDTH=\\[(.*)\\].*" "\\1" ${HDF_PREFIX}_PRINTF_LL "${OUTPUT}") + set (${HDF_PREFIX}_PRINTF_LL_WIDTH "\"${${HDF_PREFIX}_PRINTF_LL}\"" CACHE INTERNAL "Width for printf for type `long long' or `__int64', us. `ll") + set (PRINT_LL_FOUND 1) + else (${HDF_PREFIX}_PRINTF_LL_TEST_RUN MATCHES 0) + message ("Width test failed with result: ${${HDF_PREFIX}_PRINTF_LL_TEST_RUN}") + endif (${HDF_PREFIX}_PRINTF_LL_TEST_RUN MATCHES 0) + else (${HDF_PREFIX}_PRINTF_LL_TEST_COMPILE) + file (APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log + "Test ${HDF_PREFIX}_PRINTF_LL_WIDTH failed with the following output:\n ${OUTPUT}\n" ) - if (HDF5_PRINTF_LL_TEST_COMPILE) - if (HDF5_PRINTF_LL_TEST_RUN MATCHES 0) - set (${HDF_PREFIX}_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 ${HDF_PREFIX}_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) + endif (${HDF_PREFIX}_PRINTF_LL_TEST_COMPILE) if (PRINT_LL_FOUND) - message (STATUS "Checking for apropriate format for 64 bit long: found ${${HDF_PREFIX}_PRINTF_LL_WIDTH}") + message (STATUS "Checking for appropriate format for 64 bit long: found ${${HDF_PREFIX}_PRINTF_LL_WIDTH}") else (PRINT_LL_FOUND) - message (STATUS "Checking for apropriate format for 64 bit long: not found") + message (STATUS "Checking for appropriate format for 64 bit long: not found") set (${HDF_PREFIX}_PRINTF_LL_WIDTH "\"unknown\"" CACHE INTERNAL "Width for printf for type `long long' or `__int64', us. `ll" ) diff --git a/config/cmake_ext_mod/HDFTests.c b/config/cmake_ext_mod/HDFTests.c index 1c23ac3..5c4d360 100644 --- a/config/cmake_ext_mod/HDFTests.c +++ b/config/cmake_ext_mod/HDFTests.c @@ -213,7 +213,7 @@ SIMPLE_TEST(struct stat sb; sb.st_blocks=0); int main(void) { - char *llwidthArgs[] = { "l64", "l", "L", "q", "ll", NULL }; + char *llwidthArgs[] = { "I64", "l64", "l", "L", "q", "ll", NULL }; char *s = malloc(128); char **currentArg = NULL; LL_TYPE x = (LL_TYPE)1048576 * (LL_TYPE)1048576; diff --git a/release_docs/INSTALL_CMake.txt b/release_docs/INSTALL_CMake.txt index cd4dc1f..e0b25b6 100644 --- a/release_docs/INSTALL_CMake.txt +++ b/release_docs/INSTALL_CMake.txt @@ -637,18 +637,18 @@ build and test process. VIII. Options for Platform Configuration Files ======================================================================== -Below is the HDF518config.cmake ctest script with extra comments. +Below is the HDF5config.cmake ctest script with extra comments. Execute: - ctest -S HDF518config.cmake,BUILD_GENERATOR=xxx -C Release -V -O hdf518.log + ctest -S HDF5config.cmake,BUILD_GENERATOR=xxx -C Release -V -O hdf5.log The same scripts can be used on Linux, Mac OSX or a Windows machine by adding an option (${CTEST_SCRIPT_ARG}) to the platform configuration script. -########################################################################################## -### ${CTEST_SCRIPT_ARG} is of the form OPTION=VALUE ### -### BUILD_GENERATOR required [Unix, VS2013, VS201364, VS2012, VS201264] ### -### ctest -S HDF518config.cmake,BUILD_GENERATOR=VS201264 -C Release -V -O hdf518.log ### -########################################################################################## +############################################################################################# +### ${CTEST_SCRIPT_ARG} is of the form OPTION=VALUE ### +### BUILD_GENERATOR required [Unix, VS2015, VS201564, VS2013, VS201364, VS2012, VS201264] ### +### ctest -S HDF5config.cmake,BUILD_GENERATOR=VS201264 -C Release -V -O hdf519.log ### +############################################################################################# cmake_minimum_required(VERSION 3.1.0 FATAL_ERROR) ############################################################################ @@ -657,6 +657,8 @@ cmake_minimum_required(VERSION 3.1.0 FATAL_ERROR) # where valid options for OPTION are: # BUILD_GENERATOR - The cmake build generator: # Unix * Unix Makefiles +# VS2015 * Visual Studio 14 2015 +# VS201564 * Visual Studio 14 2015 Win64 # VS2013 * Visual Studio 12 2013 # VS201364 * Visual Studio 12 2013 Win64 # VS2012 * Visual Studio 11 2012 @@ -665,7 +667,8 @@ cmake_minimum_required(VERSION 3.1.0 FATAL_ERROR) # INSTALLDIR - root folder where hdf5 is installed # CTEST_BUILD_CONFIGURATION - Release, Debug, etc # CTEST_SOURCE_NAME - source folder -# STATICLIBRARIES - Build/use static libraries +# STATIC_LIBRARIES - Build/use static libraries +# FORTRAN_LIBRARIES - Build/use fortran libraries # NO_MAC_FORTRAN - Yes to be SHARED on a Mac ############################################################################## @@ -678,7 +681,8 @@ set(CTEST_SOURCE_VERSEXT "") #INSTALLDIR - HDF5-1.9 root folder #CTEST_BUILD_CONFIGURATION - Release, Debug, RelWithDebInfo #CTEST_SOURCE_NAME - name of source folder; HDF5-1.9 -#STATICLIBRARIES - Default is YES +#STATIC_LIBRARIES - Default is YES +#FORTRAN_LIBRARIES - Default is NO #NO_MAC_FORTRAN - set to TRUE to allow shared libs on a Mac if(DEFINED CTEST_SCRIPT_ARG) # transform ctest script arguments of the form @@ -698,6 +702,10 @@ if(NOT DEFINED BUILD_GENERATOR) else() if(${BUILD_GENERATOR} STREQUAL "Unix") set(CTEST_CMAKE_GENERATOR "Unix Makefiles") + elseif(${BUILD_GENERATOR} STREQUAL "VS2015") + set(CTEST_CMAKE_GENERATOR "Visual Studio 14 2015") + elseif(${BUILD_GENERATOR} STREQUAL "VS201564") + set(CTEST_CMAKE_GENERATOR "Visual Studio 14 2015 Win64") elseif(${BUILD_GENERATOR} STREQUAL "VS2013") set(CTEST_CMAKE_GENERATOR "Visual Studio 12 2013") elseif(${BUILD_GENERATOR} STREQUAL "VS201364") @@ -724,10 +732,10 @@ endif() if(NOT DEFINED CTEST_SOURCE_NAME) set(CTEST_SOURCE_NAME "hdf5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}") endif() -if(NOT DEFINED STATICLIBRARIES) +if(NOT DEFINED STATIC_LIBRARIES) set(STATICLIBRARIES "YES") endif() -if(NOT DEFINED FORTRANLIBRARIES) +if(NOT DEFINED FORTRAN_LIBRARIES) set(FORTRANLIBRARIES "NO") endif() @@ -802,12 +810,12 @@ set(REPOSITORY_URL "http://svn.hdfgroup.uiuc.edu/hdf5/trunk") #### format: set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DXXX:YY=ZZZZ") ################################################################### -if(STATICLIBRARIES) +if(${STATICLIBRARIES}) set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=OFF") ######### Following describes computer ############ ## following is optional to describe build ## set(SITE_BUILDNAME_SUFFIX "STATIC") -endif(STATICLIBRARIES) +endif() ################################################################### ### uncomment/comment and change the following lines for other configuration options @@ -825,11 +833,11 @@ set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ALLOW_EXTERNAL_SUPPORT:STRING #set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_SZIP_SUPPORT:BOOL=OFF") #set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_SZIP_ENCODING:BOOL=OFF") #### fortran #### -if(FORTRANLIBRARIES) - set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF_BUILD_FORTRAN:BOOL=ON") - ### enable Fortran 2003 depends on HDF5_BUILD_FORTRAN - set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_F2003:BOOL=ON") -endif(FORTRANLIBRARIES) +if(${FORTRANLIBRARIES}) + set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_FORTRAN:BOOL=ON") +else() + set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_FORTRAN:BOOL=OFF") +endif() ### disable test program builds #set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DBUILD_TESTING:BOOL=OFF") diff --git a/release_docs/USING_CMake_Examples.txt b/release_docs/USING_CMake_Examples.txt index a6854ae..12c499e 100644 --- a/release_docs/USING_CMake_Examples.txt +++ b/release_docs/USING_CMake_Examples.txt @@ -38,7 +38,7 @@ II. Building HDF5 Examples with CMake Files in the HDF5 install directory: HDF5Examples folder - HDF518_Examples.cmake + HDF5_Examples.cmake Default installation process: Create a directory to run the examples, i.e. \test_hdf5. @@ -52,7 +52,7 @@ Default installation process: with the CTEST_BUILD_CONFIGURATION script option. Note that this must be the same as the value used with the -C command line option. The default build configuration is defined to build and use static libraries. - Shared libraries can be used with the STATICLIBRARIES script option set to "NO". + Shared libraries can be used with the STATIC_LIBRARIES script option set to "NO". Other options can be changed by editing the HDF5_Examples.cmake file. If the defaults are okay, execute from this directory: @@ -67,11 +67,9 @@ Default installation process: ======================================================================== -III. Other changes to the HDF518_Examples.cmake file +III. Other changes to the HDF5_Examples.cmake file ======================================================================== -Line 10: uncomment to build and test Fortran examples. - -Line 43-45: uncomment to use a source tarball or zipfile; +Line 45-48: uncomment to use a source tarball or zipfile; Add script option "TAR_SOURCE=MySource.tar". diff --git a/release_docs/USING_HDF5_CMake.txt b/release_docs/USING_HDF5_CMake.txt index c48bca5..ac94a58 100644 --- a/release_docs/USING_HDF5_CMake.txt +++ b/release_docs/USING_HDF5_CMake.txt @@ -207,7 +207,7 @@ IV. APPENDIX ======================================================================== Below is an example of a ctest script that can be used to build the examples. -Adjust the values as necessary. Note that the source folder is entered on the +Adjust the values as necessary. Note that the defaults can be entered on the command line and the build folder is created as a sub-folder. Windows should adjust the forward slash to double backslashes, except for the HDF_DIR environment variable. @@ -215,39 +215,31 @@ environment variable. NOTE: this file is available at the HDF web site: http://www.hdfgroup.org/HDF5/release/cmakebuild.html - HDF518_Examples.cmake + HDF5_Examples.cmake ======================================================================== ctest ======================================================================== -cmake_minimum_required(VERSION 3.1.0 FATAL_ERROR) -############################################################################ -# Product specific script, HDF518_Examples.cmake. Usage: -# ctest -S HDF518_Examples.cmake,OPTION=VALUE -C Release -VV -O test.log -# where valid options for OPTION are: -# BUILD_GENERATOR - The cmake build generator: -# Unix * Unix Makefiles -# VS2013 * Visual Studio 12 2013 -# VS201364 * Visual Studio 12 2013 Win64 -# VS2012 * Visual Studio 11 2012 -# VS201264 * Visual Studio 11 2012 Win64 -# -# INSTALLDIR - root folder where hdf5 is installed -# CTEST_BUILD_CONFIGURATION - Release, Debug, etc -# CTEST_SOURCE_NAME - source folder -# STATICLIBRARIES - Build/use static libraries -# NO_MAC_FORTRAN - Yes to be SHARED on a Mac +cmake_minimum_required(VERSION 3.1.0 FATAL_ERROR) +############################################################################################################### +# This script will build and run the examples from a folder +# Execute from a command line: +# ctest -S HDF5_Examples.cmake,OPTION=VALUE -C Release -V -O test.log ############################################################################################################### + +set(CTEST_CMAKE_GENERATOR "@CMAKE_GENERATOR@") +set(CTEST_DASHBOARD_ROOT ${CTEST_SCRIPT_DIRECTORY}) + # handle input parameters to script. -#BUILD_GENERATOR - which CMake generator to use, required -#INSTALLDIR - HDF5-1.8 root folder +#INSTALLDIR - HDF5 root folder #CTEST_BUILD_CONFIGURATION - Release, Debug, RelWithDebInfo #CTEST_SOURCE_NAME - name of source folder; HDF4Examples -#STATICLIBRARIES - Default is YES -#NO_MAC_FORTRAN - set to TRUE to allow shared libs on a Mac +#STATIC_LIBRARIES - Default is YES +#FORTRAN_LIBRARIES - Default is NO +##NO_MAC_FORTRAN - set to TRUE to allow shared libs on a Mac) if(DEFINED CTEST_SCRIPT_ARG) # transform ctest script arguments of the form # script.ctest,var1=value1,var2=value2 @@ -259,34 +251,8 @@ if(DEFINED CTEST_SCRIPT_ARG) endif() endforeach() endif() - -# build generator must be defined -if(NOT DEFINED BUILD_GENERATOR) - message(FATAL_ERROR "BUILD_GENERATOR must be defined - Unix, VS2013, VS201364, VS2012, or VS201264") -else() - if(${BUILD_GENERATOR} STREQUAL "Unix") - set(CMAKE_GENERATOR "Unix Makefiles") - elseif(${BUILD_GENERATOR} STREQUAL "VS2013") - set(CMAKE_GENERATOR "Visual Studio 12 2013") - elseif(${BUILD_GENERATOR} STREQUAL "VS201364") - set(CMAKE_GENERATOR "Visual Studio 12 2013 Win64") - elseif(${BUILD_GENERATOR} STREQUAL "VS2012") - set(CMAKE_GENERATOR "Visual Studio 11 2012") - elseif(${BUILD_GENERATOR} STREQUAL "VS201264") - set(CMAKE_GENERATOR "Visual Studio 11 2012 Win64") - else() - message(FATAL_ERROR "Invalid BUILD_GENERATOR must be - Unix, VS2013, VS201364, VS2012, or VS201264") - endif() -endif() -set(CTEST_CMAKE_GENERATOR "${CMAKE_GENERATOR}") -set(CTEST_DASHBOARD_ROOT ${CTEST_SCRIPT_DIRECTORY}) - if(NOT DEFINED INSTALLDIR) - if(WIN32) - set(INSTALLDIR "/usr/local/myhdf5") - else() - set(INSTALLDIR "C:\\Program\ Files\\myhdf5") - endif() + set(INSTALLDIR "@CMAKE_INSTALL_PREFIX@") endif() if(NOT DEFINED CTEST_BUILD_CONFIGURATION) set(CTEST_BUILD_CONFIGURATION "Release") @@ -294,43 +260,45 @@ endif() if(NOT DEFINED CTEST_SOURCE_NAME) set(CTEST_SOURCE_NAME "HDF5Examples") endif() -if(NOT DEFINED STATICLIBRARIES) +if(NOT DEFINED STATIC_LIBRARIES) set(STATICLIBRARIES "YES") endif() -if(NOT DEFINED FORTRANLIBRARIES) +if(NOT DEFINED FORTRAN_LIBRARIES) set(FORTRANLIBRARIES "NO") endif() #TAR_SOURCE - name of tarfile #if(NOT DEFINED TAR_SOURCE) -# set(CTEST_USE_TAR_SOURCE "HDF5Examples-1.2.1-Source") +# set(CTEST_USE_TAR_SOURCE "HDF5Examples-1.10.1-Source") #endif() ############################################################################################################### # Adjust the following SET Commands as needed ############################################################################################################### -if(FORTRANLIBRARIES) - set(BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF_BUILD_FORTRAN:BOOL=ON") -endif(FORTRANLIBRARIES) - if(WIN32) - if(STATICLIBRARIES) + if(${STATICLIBRARIES}) set(BUILD_OPTIONS "${BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=OFF") - endif(STATICLIBRARIES) + endif() set(ENV{HDF5_DIR} "${INSTALLDIR}/cmake") set(CTEST_BINARY_NAME ${CTEST_SOURCE_NAME}\\build) set(CTEST_SOURCE_DIRECTORY "${CTEST_DASHBOARD_ROOT}\\${CTEST_SOURCE_NAME}") set(CTEST_BINARY_DIRECTORY "${CTEST_DASHBOARD_ROOT}\\${CTEST_BINARY_NAME}") else(WIN32) - if(STATICLIBRARIES) + if(${STATICLIBRARIES}) set(BUILD_OPTIONS "${BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=OFF -DCMAKE_ANSI_CFLAGS:STRING=-fPIC") - endif(STATICLIBRARIES) + endif() set(ENV{HDF5_DIR} "${INSTALLDIR}/share/cmake") set(ENV{LD_LIBRARY_PATH} "${INSTALLDIR}/lib") set(CTEST_BINARY_NAME ${CTEST_SOURCE_NAME}/build) set(CTEST_SOURCE_DIRECTORY "${CTEST_DASHBOARD_ROOT}/${CTEST_SOURCE_NAME}") set(CTEST_BINARY_DIRECTORY "${CTEST_DASHBOARD_ROOT}/${CTEST_BINARY_NAME}") endif(WIN32) +if(${FORTRANLIBRARIES}) + set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF_BUILD_FORTRAN:BOOL=ON") +else() + set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF_BUILD_FORTRAN:BOOL=OFF") +endif() +set(BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF5_PACKAGE_NAME:STRING=@HDF5_PACKAGE@@HDF_PACKAGE_EXT@") ############################################################################################################### # For any comments please contact cdashhelp@hdfgroup.org @@ -349,11 +317,11 @@ if(APPLE) if(NOT NO_MAC_FORTRAN) # Shared fortran is not supported, build static set(BUILD_OPTIONS "${BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=OFF -DCMAKE_ANSI_CFLAGS:STRING=-fPIC") - else(NOT NO_MAC_FORTRAN) + else() set(BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF_BUILD_FORTRAN:BOOL=OFF") - endif(NOT NO_MAC_FORTRAN) + endif() set(BUILD_OPTIONS "${BUILD_OPTIONS} -DCTEST_USE_LAUNCHERS:BOOL=ON -DCMAKE_BUILD_WITH_INSTALL_RPATH:BOOL=OFF") -endif(APPLE) +endif() #----------------------------------------------------------------------------- set(CTEST_CMAKE_COMMAND "\"${CMAKE_COMMAND}\"") @@ -373,7 +341,7 @@ if(CTEST_USE_TAR_SOURCE) message(STATUS "extracting... [error-(${rv}) clean up]") file(REMOVE_RECURSE "${CTEST_SOURCE_DIRECTORY}") message(FATAL_ERROR "error: extract of ${CTEST_SOURCE_NAME} failed") - endif(NOT rv EQUAL 0) + endif() endif(CTEST_USE_TAR_SOURCE) #----------------------------------------------------------------------------- @@ -382,9 +350,9 @@ endif(CTEST_USE_TAR_SOURCE) set(CTEST_START_WITH_EMPTY_BINARY_DIRECTORY TRUE) if (EXISTS "${CTEST_BINARY_DIRECTORY}" AND IS_DIRECTORY "${CTEST_BINARY_DIRECTORY}") ctest_empty_binary_directory(${CTEST_BINARY_DIRECTORY}) -else (EXISTS "${CTEST_BINARY_DIRECTORY}" AND IS_DIRECTORY "${CTEST_BINARY_DIRECTORY}") +else () file(MAKE_DIRECTORY "${CTEST_BINARY_DIRECTORY}") -endif (EXISTS "${CTEST_BINARY_DIRECTORY}" AND IS_DIRECTORY "${CTEST_BINARY_DIRECTORY}") +endif () # Use multiple CPU cores to build include(ProcessorCount) @@ -392,7 +360,7 @@ ProcessorCount(N) if(NOT N EQUAL 0) if(NOT WIN32) set(CTEST_BUILD_FLAGS -j${N}) - endif(NOT WIN32) + endif() set(ctest_test_args ${ctest_test_args} PARALLEL_LEVEL ${N}) endif() set (CTEST_CONFIGURE_COMMAND @@ -414,9 +382,9 @@ ctest_build (BUILD "${CTEST_BINARY_DIRECTORY}" APPEND) ctest_test (BUILD "${CTEST_BINARY_DIRECTORY}" APPEND ${ctest_test_args} RETURN_VALUE res) if(res GREATER 0) message (FATAL_ERROR "tests FAILED") -endif(res GREATER 0) +endif() #----------------------------------------------------------------------------- -################################################################################# +############################################################################################################## -- cgit v0.12 From 7d34c32445a99f6b10a142978fe347788072fd13 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 21 Oct 2015 11:28:17 -0500 Subject: [svn-r28160] Update comment about VS versions --- config/cmake/scripts/HDF5config.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/cmake/scripts/HDF5config.cmake b/config/cmake/scripts/HDF5config.cmake index f01c980..8bcc56b 100755 --- a/config/cmake/scripts/HDF5config.cmake +++ b/config/cmake/scripts/HDF5config.cmake @@ -52,7 +52,7 @@ endif() # build generator must be defined if(NOT DEFINED BUILD_GENERATOR) - message(FATAL_ERROR "BUILD_GENERATOR must be defined - Unix, VS2013, VS201364, VS2012, or VS201264") + message(FATAL_ERROR "BUILD_GENERATOR must be defined - Unix, VS2015, VS201564, VS2013, VS201364, VS2012, or VS201264") else() if(${BUILD_GENERATOR} STREQUAL "Unix") set(CTEST_CMAKE_GENERATOR "Unix Makefiles") @@ -69,7 +69,7 @@ else() elseif(${BUILD_GENERATOR} STREQUAL "VS201264") set(CTEST_CMAKE_GENERATOR "Visual Studio 11 2012 Win64") else() - message(FATAL_ERROR "Invalid BUILD_GENERATOR must be - Unix, VS2013, VS201364, VS2012, or VS201264") + message(FATAL_ERROR "Invalid BUILD_GENERATOR must be - Unix, VS2015, VS201564, VS2013, VS201364, VS2012, or VS201264") endif() endif() -- cgit v0.12 From dec18189f4451783d17068639d39944e706c4da7 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 21 Oct 2015 11:29:33 -0500 Subject: [svn-r28161] Update comment about VS versions --- release_docs/INSTALL_CMake.txt | 4 +-- release_docs/USING_HDF5_CMake.txt | 55 ++++++++++++++++++++++++++++++++++----- 2 files changed, 51 insertions(+), 8 deletions(-) diff --git a/release_docs/INSTALL_CMake.txt b/release_docs/INSTALL_CMake.txt index e0b25b6..e745084 100644 --- a/release_docs/INSTALL_CMake.txt +++ b/release_docs/INSTALL_CMake.txt @@ -698,7 +698,7 @@ endif() # build generator must be defined if(NOT DEFINED BUILD_GENERATOR) - message(FATAL_ERROR "BUILD_GENERATOR must be defined - Unix, VS2013, VS201364, VS2012, or VS201264") + message(FATAL_ERROR "BUILD_GENERATOR must be defined - Unix, VS2015, VS201564, VS2013, VS201364, VS2012, or VS201264") else() if(${BUILD_GENERATOR} STREQUAL "Unix") set(CTEST_CMAKE_GENERATOR "Unix Makefiles") @@ -715,7 +715,7 @@ else() elseif(${BUILD_GENERATOR} STREQUAL "VS201264") set(CTEST_CMAKE_GENERATOR "Visual Studio 11 2012 Win64") else() - message(FATAL_ERROR "Invalid BUILD_GENERATOR must be - Unix, VS2013, VS201364, VS2012, or VS201264") + message(FATAL_ERROR "Invalid BUILD_GENERATOR must be - Unix, VS2015, VS201564, VS2013, VS201364, VS2012, or VS201264") endif() endif() diff --git a/release_docs/USING_HDF5_CMake.txt b/release_docs/USING_HDF5_CMake.txt index ac94a58..2cdf798 100644 --- a/release_docs/USING_HDF5_CMake.txt +++ b/release_docs/USING_HDF5_CMake.txt @@ -228,12 +228,25 @@ cmake_minimum_required(VERSION 3.1.0 FATAL_ERROR) # This script will build and run the examples from a folder # Execute from a command line: # ctest -S HDF5_Examples.cmake,OPTION=VALUE -C Release -V -O test.log -############################################################################################################### - -set(CTEST_CMAKE_GENERATOR "@CMAKE_GENERATOR@") -set(CTEST_DASHBOARD_ROOT ${CTEST_SCRIPT_DIRECTORY}) - +# where valid options for OPTION are: +# BUILD_GENERATOR - The cmake build generator: +# Unix * Unix Makefiles +# VS2015 * Visual Studio 14 2015 +# VS201564 * Visual Studio 14 2015 Win64 +# VS2013 * Visual Studio 12 2013 +# VS201364 * Visual Studio 12 2013 Win64 +# VS2012 * Visual Studio 11 2012 +# VS201264 * Visual Studio 11 2012 Win64 +# +# INSTALLDIR - root folder where hdf5 is installed +# CTEST_BUILD_CONFIGURATION - Release, Debug, etc +# CTEST_SOURCE_NAME - source folder +# STATIC_LIBRARIES - Build/use static libraries +# FORTRAN_LIBRARIES - Build/use fortran libraries +# NO_MAC_FORTRAN - Yes to be SHARED on a Mac +############################################################################## # handle input parameters to script. +#BUILD_GENERATOR - which CMake generator to use, required #INSTALLDIR - HDF5 root folder #CTEST_BUILD_CONFIGURATION - Release, Debug, RelWithDebInfo #CTEST_SOURCE_NAME - name of source folder; HDF4Examples @@ -251,8 +264,38 @@ if(DEFINED CTEST_SCRIPT_ARG) endif() endforeach() endif() + +# build generator must be defined +if(NOT DEFINED BUILD_GENERATOR) + message(FATAL_ERROR "BUILD_GENERATOR must be defined - Unix, VS2015, VS201564, VS2013, VS201364, VS2012, or VS201264") +else() + if(${BUILD_GENERATOR} STREQUAL "Unix") + set(CMAKE_GENERATOR "Unix Makefiles") + elseif(${BUILD_GENERATOR} STREQUAL "VS2015") + set(CTEST_CMAKE_GENERATOR "Visual Studio 14 2015") + elseif(${BUILD_GENERATOR} STREQUAL "VS201564") + set(CTEST_CMAKE_GENERATOR "Visual Studio 14 2015 Win64") + elseif(${BUILD_GENERATOR} STREQUAL "VS2013") + set(CMAKE_GENERATOR "Visual Studio 12 2013") + elseif(${BUILD_GENERATOR} STREQUAL "VS201364") + set(CMAKE_GENERATOR "Visual Studio 12 2013 Win64") + elseif(${BUILD_GENERATOR} STREQUAL "VS2012") + set(CMAKE_GENERATOR "Visual Studio 11 2012") + elseif(${BUILD_GENERATOR} STREQUAL "VS201264") + set(CMAKE_GENERATOR "Visual Studio 11 2012 Win64") + else() + message(FATAL_ERROR "Invalid BUILD_GENERATOR must be - Unix, VS2015, VS201564, VS2013, VS201364, VS2012, or VS201264") + endif() +endif() +set(CTEST_CMAKE_GENERATOR "${CMAKE_GENERATOR}") +set(CTEST_DASHBOARD_ROOT ${CTEST_SCRIPT_DIRECTORY}) + if(NOT DEFINED INSTALLDIR) - set(INSTALLDIR "@CMAKE_INSTALL_PREFIX@") + if(WIN32) + set(INSTALLDIR "C:\\Program\ Files\\myhdf5") + else() + set(INSTALLDIR "/usr/local/myhdf5") + endif() endif() if(NOT DEFINED CTEST_BUILD_CONFIGURATION) set(CTEST_BUILD_CONFIGURATION "Release") -- cgit v0.12 From 9f702766f84887c04cfcaf0a41f748636ff1062d Mon Sep 17 00:00:00 2001 From: Jerome Soumagne Date: Wed, 21 Oct 2015 15:26:56 -0500 Subject: [svn-r28168] Remove Wall option passed by default on non-windows systems (not necessary anymore since there is now --- CMakeLists.txt | 4 ---- 1 file changed, 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 88e58e0..33c8ddf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -434,10 +434,6 @@ if (CMAKE_BUILD_TYPE MATCHES Debug) 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) if (HDF5_ENABLE_TRACE) -- cgit v0.12 From aa4284b2a3ce1908f339bd07da0370c493d71b89 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 21 Oct 2015 16:22:06 -0500 Subject: [svn-r28174] HDFFV-9550: Add VS2015 fix for timezone. --- config/cmake_ext_mod/ConfigureChecks.cmake | 4 +--- src/H5Omtime.c | 7 +++++++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/config/cmake_ext_mod/ConfigureChecks.cmake b/config/cmake_ext_mod/ConfigureChecks.cmake index 94e5be1..d41923e 100644 --- a/config/cmake_ext_mod/ConfigureChecks.cmake +++ b/config/cmake_ext_mod/ConfigureChecks.cmake @@ -90,9 +90,7 @@ if (WINDOWS) endif (NOT UNIX AND NOT CYGWIN AND NOT MINGW) set (${HDF_PREFIX}_HAVE_FUNCTION 1) set (${HDF_PREFIX}_GETTIMEOFDAY_GIVES_TZ 1) - if (MSVC_VERSION LESS 1900) - set (${HDF_PREFIX}_HAVE_TIMEZONE 1) - endif (MSVC_VERSION LESS 1900) + set (${HDF_PREFIX}_HAVE_TIMEZONE 1) set (${HDF_PREFIX}_HAVE_GETTIMEOFDAY 1) if (MINGW) set (${HDF_PREFIX}_HAVE_WINSOCK2_H 1) diff --git a/src/H5Omtime.c b/src/H5Omtime.c index 622d57d..cac5aca 100644 --- a/src/H5Omtime.c +++ b/src/H5Omtime.c @@ -226,6 +226,13 @@ H5O_mtime_decode(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5 /* BSD-like systems */ the_time += tm.tm_gmtoff; #elif defined(H5_HAVE_TIMEZONE) + #if _MSC_VER >= 1900 // VS 2015 + // In gcc and in Visual Studio prior to VS 2015 'timezone' is a global + // variable declared in time.h. That variable was deprecated and in VS 2015 + // is removed, with _get_timezone replacing it. + long timezone = 0; + _get_timezone(&timezone); + #endif /* GNU/Linux systems */ the_time -= timezone - (tm.tm_isdst ? 3600 : 0); #else -- cgit v0.12 From 3edabec156a2d87329e1bced861197b09e92f113 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 21 Oct 2015 16:36:36 -0500 Subject: [svn-r28176] HDFFV-9550: Add VS2015 fix for change of standard format. --- tools/h5diff/CMakeTests.cmake | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/h5diff/CMakeTests.cmake b/tools/h5diff/CMakeTests.cmake index 33d0971..0595edd 100644 --- a/tools/h5diff/CMakeTests.cmake +++ b/tools/h5diff/CMakeTests.cmake @@ -280,9 +280,9 @@ # - # Overwrite system dependent files (Windows) + # Overwrite system dependent files (Windows) and not VS2015 # - if (WIN32) + if (WIN32 AND MSVC_VERSION LESS 1900) add_custom_command ( TARGET h5diff POST_BUILD @@ -309,7 +309,7 @@ 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) + endif (WIN32 AND MSVC_VERSION LESS 1900) ############################################################################## ############################################################################## -- cgit v0.12 From 37ed7e8b5f3fc60a9816c84d1ed71c9ba50ade08 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 22 Oct 2015 10:47:29 -0500 Subject: [svn-r28184] correct import targets --- config/cmake_ext_mod/HDFLibMacros.cmake | 114 ++++++++++++++++---------------- 1 file changed, 57 insertions(+), 57 deletions(-) diff --git a/config/cmake_ext_mod/HDFLibMacros.cmake b/config/cmake_ext_mod/HDFLibMacros.cmake index 7660a8a..3f91405 100644 --- a/config/cmake_ext_mod/HDFLibMacros.cmake +++ b/config/cmake_ext_mod/HDFLibMacros.cmake @@ -1,12 +1,12 @@ #------------------------------------------------------------------------------- -MACRO (EXTERNAL_JPEG_LIBRARY compress_type jpeg_pic) +macro (EXTERNAL_JPEG_LIBRARY compress_type 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") EXTERNALPROJECT_ADD (JPEG SVN_REPOSITORY ${JPEG_URL} - # [SVN_REVISION rev] + # [SVN_REVISION rev] INSTALL_COMMAND "" CMAKE_ARGS -DBUILD_SHARED_LIBS:BOOL=${BUILD_SHARED_LIBS} @@ -18,7 +18,7 @@ MACRO (EXTERNAL_JPEG_LIBRARY compress_type jpeg_pic) -DCMAKE_LIBRARY_OUTPUT_DIRECTORY:PATH=${CMAKE_LIBRARY_OUTPUT_DIRECTORY} -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY:PATH=${CMAKE_ARCHIVE_OUTPUT_DIRECTORY} -DCMAKE_ANSI_CFLAGS:STRING=${jpeg_pic} - ) + ) elseif (${compress_type} MATCHES "GIT") EXTERNALPROJECT_ADD (JPEG GIT_REPOSITORY ${JPEG_URL} @@ -33,7 +33,7 @@ MACRO (EXTERNAL_JPEG_LIBRARY compress_type jpeg_pic) -DCMAKE_LIBRARY_OUTPUT_DIRECTORY:PATH=${CMAKE_LIBRARY_OUTPUT_DIRECTORY} -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY:PATH=${CMAKE_ARCHIVE_OUTPUT_DIRECTORY} -DCMAKE_ANSI_CFLAGS:STRING=${jpeg_pic} - ) + ) elseif (${compress_type} MATCHES "TGZ") EXTERNALPROJECT_ADD (JPEG URL ${JPEG_URL} @@ -49,34 +49,34 @@ MACRO (EXTERNAL_JPEG_LIBRARY compress_type jpeg_pic) -DCMAKE_LIBRARY_OUTPUT_DIRECTORY:PATH=${CMAKE_LIBRARY_OUTPUT_DIRECTORY} -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY:PATH=${CMAKE_ARCHIVE_OUTPUT_DIRECTORY} -DCMAKE_ANSI_CFLAGS:STRING=${jpeg_pic} - ) + ) endif (${compress_type} MATCHES "SVN") - externalproject_get_property (JPEG BINARY_DIR SOURCE_DIR) + externalproject_get_property (JPEG BINARY_DIR SOURCE_DIR) -##include (${BINARY_DIR}/${JPEG_PACKAGE_NAME}${HDF_PACKAGE_EXT}-targets.cmake) +##include (${BINARY_DIR}/${JPEG_PACKAGE_NAME}${HDF_PACKAGE_EXT}-targets.cmake) # Create imported target jpeg-static add_library(jpeg-static STATIC IMPORTED) -# Create imported target jpeg-shared - add_library(jpeg-shared SHARED IMPORTED) - if (BUILD_SHARED_LIBS) - HDF_IMPORT_SET_LIB_OPTIONS (jpeg-shared "jpeg" SHARED "") - add_dependencies (JPEG jpeg-shared) - set (JPEG_SHARED_LIBRARY "jpeg-shared") - set (JPEG_LIBRARIES ${JPEG_shared_LIBRARY}) - endif (BUILD_SHARED_LIBS) HDF_IMPORT_SET_LIB_OPTIONS (jpeg-static "jpeg" STATIC "") add_dependencies (JPEG jpeg-static) set (JPEG_STATIC_LIBRARY "jpeg-static") set (JPEG_LIBRARIES ${JPEG_static_LIBRARY}) - + if (BUILD_SHARED_LIBS) + # Create imported target jpeg-shared + add_library(jpeg-shared SHARED IMPORTED) + HDF_IMPORT_SET_LIB_OPTIONS (jpeg-shared "jpeg" SHARED "") + add_dependencies (JPEG jpeg-shared) + set (JPEG_SHARED_LIBRARY "jpeg-shared") + set (JPEG_LIBRARIES ${JPEG_LIBRARIES} ${JPEG_shared_LIBRARY}) + endif (BUILD_SHARED_LIBS) + set (JPEG_INCLUDE_DIR_GEN "${BINARY_DIR}") set (JPEG_INCLUDE_DIR "${SOURCE_DIR}/src") set (JPEG_FOUND 1) set (JPEG_INCLUDE_DIRS ${JPEG_INCLUDE_DIR_GEN} ${JPEG_INCLUDE_DIR}) -ENDMACRO (EXTERNAL_JPEG_LIBRARY) +endmacro (EXTERNAL_JPEG_LIBRARY) #------------------------------------------------------------------------------- -MACRO (PACKAGE_JPEG_LIBRARY compress_type) +macro (PACKAGE_JPEG_LIBRARY compress_type) add_custom_target (JPEG-GenHeader-Copy ALL 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}/" @@ -85,14 +85,14 @@ MACRO (PACKAGE_JPEG_LIBRARY compress_type) 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") -ENDMACRO (PACKAGE_JPEG_LIBRARY) +endmacro (PACKAGE_JPEG_LIBRARY) #------------------------------------------------------------------------------- -MACRO (EXTERNAL_SZIP_LIBRARY compress_type encoding) +macro (EXTERNAL_SZIP_LIBRARY compress_type encoding) if (${compress_type} MATCHES "SVN") EXTERNALPROJECT_ADD (SZIP SVN_REPOSITORY ${SZIP_URL} - # [SVN_REVISION rev] + # [SVN_REVISION rev] INSTALL_COMMAND "" CMAKE_ARGS -DBUILD_SHARED_LIBS:BOOL=${BUILD_SHARED_LIBS} @@ -105,11 +105,11 @@ MACRO (EXTERNAL_SZIP_LIBRARY compress_type encoding) -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY:PATH=${CMAKE_ARCHIVE_OUTPUT_DIRECTORY} -DCMAKE_ANSI_CFLAGS:STRING=${CMAKE_ANSI_CFLAGS} -DSZIP_ENABLE_ENCODING:BOOL=${encoding} - ) + ) elseif (${compress_type} MATCHES "GIT") EXTERNALPROJECT_ADD (SZIP GIT_REPOSITORY ${SZIP_URL} - # [SVN_REVISION rev] + # [SVN_REVISION rev] INSTALL_COMMAND "" CMAKE_ARGS -DBUILD_SHARED_LIBS:BOOL=${BUILD_SHARED_LIBS} @@ -122,7 +122,7 @@ MACRO (EXTERNAL_SZIP_LIBRARY compress_type encoding) -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY:PATH=${CMAKE_ARCHIVE_OUTPUT_DIRECTORY} -DCMAKE_ANSI_CFLAGS:STRING=${CMAKE_ANSI_CFLAGS} -DSZIP_ENABLE_ENCODING:BOOL=${encoding} - ) + ) elseif (${compress_type} MATCHES "TGZ") EXTERNALPROJECT_ADD (SZIP URL ${SZIP_URL} @@ -139,34 +139,34 @@ MACRO (EXTERNAL_SZIP_LIBRARY compress_type encoding) -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY:PATH=${CMAKE_ARCHIVE_OUTPUT_DIRECTORY} -DCMAKE_ANSI_CFLAGS:STRING=${CMAKE_ANSI_CFLAGS} -DSZIP_ENABLE_ENCODING:BOOL=${encoding} - ) + ) endif (${compress_type} MATCHES "SVN") - externalproject_get_property (SZIP BINARY_DIR SOURCE_DIR) + externalproject_get_property (SZIP BINARY_DIR SOURCE_DIR) -##include (${BINARY_DIR}/${SZIP_PACKAGE_NAME}${HDF_PACKAGE_EXT}-targets.cmake) +##include (${BINARY_DIR}/${SZIP_PACKAGE_NAME}${HDF_PACKAGE_EXT}-targets.cmake) # Create imported target szip-static add_library(szip-static STATIC IMPORTED) -# Create imported target szip-shared - add_library(szip-shared SHARED IMPORTED) - if (BUILD_SHARED_LIBS) - HDF_IMPORT_SET_LIB_OPTIONS (szip-shared "szip" SHARED "") - add_dependencies (SZIP szip-shared) - set (SZIP_SHARED_LIBRARY "szip-shared") - set (SZIP_LIBRARIES ${SZIP_shared_LIBRARY}) - endif (BUILD_SHARED_LIBS) HDF_IMPORT_SET_LIB_OPTIONS (szip-static "szip" STATIC "") add_dependencies (SZIP szip-static) set (SZIP_STATIC_LIBRARY "szip-static") set (SZIP_LIBRARIES ${SZIP_static_LIBRARY}) + if (BUILD_SHARED_LIBS) + # Create imported target szip-shared + add_library(szip-shared SHARED IMPORTED) + HDF_IMPORT_SET_LIB_OPTIONS (szip-shared "szip" SHARED "") + add_dependencies (SZIP szip-shared) + set (SZIP_SHARED_LIBRARY "szip-shared") + set (SZIP_LIBRARIES ${SZIP_LIBRARIES} ${SZIP_shared_LIBRARY}) + endif (BUILD_SHARED_LIBS) set (SZIP_INCLUDE_DIR_GEN "${BINARY_DIR}") set (SZIP_INCLUDE_DIR "${SOURCE_DIR}/src") set (SZIP_FOUND 1) set (SZIP_INCLUDE_DIRS ${SZIP_INCLUDE_DIR_GEN} ${SZIP_INCLUDE_DIR}) -ENDMACRO (EXTERNAL_SZIP_LIBRARY) +endmacro (EXTERNAL_SZIP_LIBRARY) #------------------------------------------------------------------------------- -MACRO (PACKAGE_SZIP_LIBRARY compress_type) +macro (PACKAGE_SZIP_LIBRARY compress_type) add_custom_target (SZIP-GenHeader-Copy ALL 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}/" @@ -175,14 +175,14 @@ MACRO (PACKAGE_SZIP_LIBRARY compress_type) 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") -ENDMACRO (PACKAGE_SZIP_LIBRARY) +endmacro (PACKAGE_SZIP_LIBRARY) #------------------------------------------------------------------------------- -MACRO (EXTERNAL_ZLIB_LIBRARY compress_type) +macro (EXTERNAL_ZLIB_LIBRARY compress_type) if (${compress_type} MATCHES "SVN") EXTERNALPROJECT_ADD (ZLIB SVN_REPOSITORY ${ZLIB_URL} - # [SVN_REVISION rev] + # [SVN_REVISION rev] INSTALL_COMMAND "" CMAKE_ARGS -DBUILD_SHARED_LIBS:BOOL=${BUILD_SHARED_LIBS} @@ -194,11 +194,11 @@ MACRO (EXTERNAL_ZLIB_LIBRARY compress_type) -DCMAKE_LIBRARY_OUTPUT_DIRECTORY:PATH=${CMAKE_LIBRARY_OUTPUT_DIRECTORY} -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY:PATH=${CMAKE_ARCHIVE_OUTPUT_DIRECTORY} -DCMAKE_ANSI_CFLAGS:STRING=${CMAKE_ANSI_CFLAGS} - ) + ) elseif (${compress_type} MATCHES "GIT") EXTERNALPROJECT_ADD (ZLIB GIT_REPOSITORY ${ZLIB_URL} - # [SVN_REVISION rev] + # [SVN_REVISION rev] INSTALL_COMMAND "" CMAKE_ARGS -DBUILD_SHARED_LIBS:BOOL=${BUILD_SHARED_LIBS} @@ -210,7 +210,7 @@ MACRO (EXTERNAL_ZLIB_LIBRARY compress_type) -DCMAKE_LIBRARY_OUTPUT_DIRECTORY:PATH=${CMAKE_LIBRARY_OUTPUT_DIRECTORY} -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY:PATH=${CMAKE_ARCHIVE_OUTPUT_DIRECTORY} -DCMAKE_ANSI_CFLAGS:STRING=${CMAKE_ANSI_CFLAGS} - ) + ) elseif (${compress_type} MATCHES "TGZ") EXTERNALPROJECT_ADD (ZLIB URL ${ZLIB_URL} @@ -226,39 +226,39 @@ MACRO (EXTERNAL_ZLIB_LIBRARY compress_type) -DCMAKE_LIBRARY_OUTPUT_DIRECTORY:PATH=${CMAKE_LIBRARY_OUTPUT_DIRECTORY} -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY:PATH=${CMAKE_ARCHIVE_OUTPUT_DIRECTORY} -DCMAKE_ANSI_CFLAGS:STRING=${CMAKE_ANSI_CFLAGS} - ) + ) endif (${compress_type} MATCHES "SVN") - externalproject_get_property (ZLIB BINARY_DIR SOURCE_DIR) + externalproject_get_property (ZLIB BINARY_DIR SOURCE_DIR) if (WIN32) set (ZLIB_LIB_NAME "zlib") else (WIN32) set (ZLIB_LIB_NAME "z") endif (WIN32) -##include (${BINARY_DIR}/${ZLIB_PACKAGE_NAME}${HDF_PACKAGE_EXT}-targets.cmake) +##include (${BINARY_DIR}/${ZLIB_PACKAGE_NAME}${HDF_PACKAGE_EXT}-targets.cmake) # Create imported target zlib-static add_library(zlib-static STATIC IMPORTED) -# Create imported target zlib-shared - add_library(zlib-shared SHARED IMPORTED) - if (BUILD_SHARED_LIBS) - HDF_IMPORT_SET_LIB_OPTIONS (zlib-shared ${ZLIB_LIB_NAME} SHARED "") - add_dependencies (ZLIB zlib-shared) - set (ZLIB_SHARED_LIBRARY "zlib-shared") - set (ZLIB_LIBRARIES ${ZLIB_SHARED_LIBRARY}) - endif (BUILD_SHARED_LIBS) HDF_IMPORT_SET_LIB_OPTIONS (zlib-static ${ZLIB_LIB_NAME} STATIC "") add_dependencies (ZLIB zlib-static) set (ZLIB_STATIC_LIBRARY "zlib-static") set (ZLIB_LIBRARIES ${ZLIB_static_LIBRARY}) + if (BUILD_SHARED_LIBS) + # Create imported target zlib-shared + add_library(zlib-shared SHARED IMPORTED) + HDF_IMPORT_SET_LIB_OPTIONS (zlib-shared ${ZLIB_LIB_NAME} SHARED "") + add_dependencies (ZLIB zlib-shared) + set (ZLIB_SHARED_LIBRARY "zlib-shared") + set (ZLIB_LIBRARIES ${ZLIB_LIBRARIES} ${ZLIB_SHARED_LIBRARY}) + endif (BUILD_SHARED_LIBS) set (ZLIB_INCLUDE_DIR_GEN "${BINARY_DIR}") set (ZLIB_INCLUDE_DIR "${SOURCE_DIR}") set (ZLIB_FOUND 1) set (ZLIB_INCLUDE_DIRS ${ZLIB_INCLUDE_DIR_GEN} ${ZLIB_INCLUDE_DIR}) -ENDMACRO (EXTERNAL_ZLIB_LIBRARY) +endmacro (EXTERNAL_ZLIB_LIBRARY) #------------------------------------------------------------------------------- -MACRO (PACKAGE_ZLIB_LIBRARY compress_type) +macro (PACKAGE_ZLIB_LIBRARY compress_type) add_custom_target (ZLIB-GenHeader-Copy ALL 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}/" @@ -267,4 +267,4 @@ MACRO (PACKAGE_ZLIB_LIBRARY compress_type) 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") -ENDMACRO (PACKAGE_ZLIB_LIBRARY) +endmacro (PACKAGE_ZLIB_LIBRARY) -- cgit v0.12 From 779154925282f5240e792f9b2e5b242a91005abb Mon Sep 17 00:00:00 2001 From: Jerome Soumagne Date: Thu, 22 Oct 2015 11:23:01 -0500 Subject: [svn-r28188] Fix inline/__inline__/__inline detection with CMake after autotools changes --- config/cmake/H5pubconf.h.in | 15 +++++++++------ config/cmake_ext_mod/ConfigureChecks.cmake | 26 ++------------------------ config/cmake_ext_mod/HDFTests.c | 20 +++++++++++++------- 3 files changed, 24 insertions(+), 37 deletions(-) diff --git a/config/cmake/H5pubconf.h.in b/config/cmake/H5pubconf.h.in index f01a9ff..5011b03 100644 --- a/config/cmake/H5pubconf.h.in +++ b/config/cmake/H5pubconf.h.in @@ -157,6 +157,9 @@ /* Define to 1 if you have the `gettimeofday' function. */ #cmakedefine H5_HAVE_GETTIMEOFDAY @H5_HAVE_GETTIMEOFDAY@ +/* Define if the compiler understands inline */ +#cmakedefine H5_HAVE_INLINE @H5_HAVE_INLINE@ + /* Define if library will contain instrumentation to detect correct optimization operation */ #cmakedefine H5_HAVE_INSTRUMENTED_LIBRARY @H5_HAVE_INSTRUMENTED_LIBRARY@ @@ -371,6 +374,12 @@ /* Define to 1 if you have the `_scrsize' function. */ #cmakedefine H5_HAVE__SCRSIZE @H5_HAVE__SCRSIZE@ +/* Define if the compiler understands __inline */ +#cmakedefine H5_HAVE___INLINE @H5_HAVE___INLINE@ + +/* Define if the compiler understands __inline__ */ +#cmakedefine H5_HAVE___INLINE__ @H5_HAVE___INLINE__@ + /* Define if HDF5's high-level library headers should be included in hdf5.h */ #cmakedefine H5_INCLUDE_HL @H5_INCLUDE_HL@ @@ -625,12 +634,6 @@ /* Define to empty if `const' does not conform to ANSI C. */ #cmakedefine H5_const -/* Define to `__inline__' or `__inline' if that's what the C compiler - calls it, or to nothing if 'inline' is not supported under any name. */ -#ifndef __cplusplus -#cmakedefine H5_inline @H5_inline@ -#endif - /* Define to `long int' if does not define. */ #cmakedefine H5_off_t diff --git a/config/cmake_ext_mod/ConfigureChecks.cmake b/config/cmake_ext_mod/ConfigureChecks.cmake index d41923e..fd502e5 100644 --- a/config/cmake_ext_mod/ConfigureChecks.cmake +++ b/config/cmake_ext_mod/ConfigureChecks.cmake @@ -141,10 +141,6 @@ MACRO (HDF_FUNCTION_TEST OTHER_TEST) set (OTHER_TEST_ADD_LIBRARIES "-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}") endif (CMAKE_REQUIRED_LIBRARIES) - foreach (def ${HDF_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 @@ -570,10 +566,6 @@ MACRO (HDF_CXX_FUNCTION_TEST OTHER_TEST) set (OTHER_TEST_ADD_LIBRARIES "-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}") endif (CMAKE_REQUIRED_LIBRARIES) - foreach (def ${HDF_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 @@ -696,25 +688,11 @@ endif (WINDOWS) #----------------------------------------------------------------------------- # Determine how 'inline' is used #----------------------------------------------------------------------------- -set (HDF_EXTRA_TEST_DEFINITIONS INLINE_TEST_INLINE) foreach (inline_test inline __inline__ __inline) - set (INLINE_TEST_INLINE ${inline_test}) - HDF_FUNCTION_TEST (INLINE_TEST_${inline_test}) + string (TOUPPER ${inline_test} INLINE_TEST_MACRO) + HDF_FUNCTION_TEST (HAVE_${INLINE_TEST_MACRO}) endforeach (inline_test) -set (HDF_EXTRA_TEST_DEFINITIONS) -if (INLINE_TEST___inline__) - set (${HDF_PREFIX}_inline __inline__) -else (INLINE_TEST___inline__) - if (INLINE_TEST___inline) - set (${HDF_PREFIX}_inline __inline) - else (INLINE_TEST___inline) - if (INLINE_TEST_inline) - set (${HDF_PREFIX}_inline inline) - endif (INLINE_TEST_inline) - endif (INLINE_TEST___inline) -endif (INLINE_TEST___inline__) - #----------------------------------------------------------------------------- # Check how to print a Long Long integer #----------------------------------------------------------------------------- diff --git a/config/cmake_ext_mod/HDFTests.c b/config/cmake_ext_mod/HDFTests.c index 5c4d360..8478d1b 100644 --- a/config/cmake_ext_mod/HDFTests.c +++ b/config/cmake_ext_mod/HDFTests.c @@ -454,13 +454,19 @@ SIMPLE_TEST(struct text_info w; w.screenwidth=0); #endif /* HAVE_TM_GMTOFF */ - -#if defined( INLINE_TEST_inline ) || defined( INLINE_TEST___inline__ ) || defined( INLINE_TEST___inline ) +#if defined( HAVE_INLINE ) || defined( HAVE___INLINE__ ) || defined( HAVE___INLINE ) #ifndef __cplusplus +#if defined( HAVE_INLINE ) +# define INLINE_KW inline +#elif defined ( HAVE___INLINE__ ) +# define INLINE_KW __inline__ +#elif defined ( HAVE___INLINE ) +# define INLINE_KW __inline +#endif /* HAVE_INLINE */ typedef int foo_t; -static INLINE_TEST_INLINE foo_t static_foo () { return 0; } -INLINE_TEST_INLINE foo_t foo () {return 0; } -int main() { return 0; } -#endif +static INLINE_KW foo_t static_foo () { return 0; } +INLINE_KW foo_t foo () {return 0; } +int main(void) { return 0; } +#endif /* __cplusplus */ +#endif /* defined( HAVE_INLINE ) || defined( HAVE___INLINE__ ) || defined( HAVE___INLINE ) */ -#endif /* INLINE_TEST */ -- cgit v0.12 From 543ec79118fa8f91fba4bff43d355d71c83b98f6 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 22 Oct 2015 15:01:32 -0500 Subject: [svn-r28193] Rework VS2015 timezone patch for better fit to standards. Tested: VS2015 VMs --- src/H5Omtime.c | 26 ++++++++++++++------------ src/H5win32defs.h | 8 +++++++- 2 files changed, 21 insertions(+), 13 deletions(-) diff --git a/src/H5Omtime.c b/src/H5Omtime.c index cac5aca..32248fa 100644 --- a/src/H5Omtime.c +++ b/src/H5Omtime.c @@ -42,7 +42,7 @@ static size_t H5O_mtime_size(const H5F_t *f, hbool_t disable_shared, const void static herr_t H5O_mtime_reset(void *_mesg); static herr_t H5O_mtime_free(void *_mesg); static herr_t H5O_mtime_debug(H5F_t *f, hid_t dxpl_id, const void *_mesg, FILE *stream, - int indent, int fwidth); + int indent, int fwidth); /* This message derives from H5O message class */ const H5O_msg_class_t H5O_MSG_MTIME[1] = {{ @@ -148,7 +148,7 @@ H5O_mtime_new_decode(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_ /* The return value */ if (NULL==(mesg = H5FL_MALLOC(time_t))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed"); + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed"); *mesg = (time_t)tmp_time; /* Set return value */ @@ -186,6 +186,12 @@ H5O_mtime_decode(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5 int i; struct tm tm; void *ret_value = NULL; /* Return value */ +#if _MSC_VER >= 1900 // VS 2015 +// In gcc and in Visual Studio prior to VS 2015 'timezone' is a global +// variable declared in time.h. That variable was deprecated and in VS 2015 +// is removed, with _get_timezone replacing it. + long timezone = 0; +#endif FUNC_ENTER_NOAPI_NOINIT @@ -212,7 +218,7 @@ H5O_mtime_decode(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5 */ HDmemset(&tm, 0, sizeof tm); tm.tm_year = (p[0]-'0')*1000 + (p[1]-'0')*100 + - (p[2]-'0')*10 + (p[3]-'0') - 1900; + (p[2]-'0')*10 + (p[3]-'0') - 1900; tm.tm_mon = (p[4]-'0')*10 + (p[5]-'0') - 1; tm.tm_mday = (p[6]-'0')*10 + (p[7]-'0'); tm.tm_hour = (p[8]-'0')*10 + (p[9]-'0'); @@ -227,11 +233,7 @@ H5O_mtime_decode(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5 the_time += tm.tm_gmtoff; #elif defined(H5_HAVE_TIMEZONE) #if _MSC_VER >= 1900 // VS 2015 - // In gcc and in Visual Studio prior to VS 2015 'timezone' is a global - // variable declared in time.h. That variable was deprecated and in VS 2015 - // is removed, with _get_timezone replacing it. - long timezone = 0; - _get_timezone(&timezone); + HDget_timezone(&timezone); #endif /* GNU/Linux systems */ the_time -= timezone - (tm.tm_isdst ? 3600 : 0); @@ -330,8 +332,8 @@ H5O_mtime_encode(H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared, /* encode */ tm = HDgmtime(mesg); sprintf((char*)p, "%04d%02d%02d%02d%02d%02d", - 1900+tm->tm_year, 1+tm->tm_mon, tm->tm_mday, - tm->tm_hour, tm->tm_min, tm->tm_sec); + 1900+tm->tm_year, 1+tm->tm_mon, tm->tm_mday, + tm->tm_hour, tm->tm_min, tm->tm_sec); FUNC_LEAVE_NOAPI(SUCCEED) } @@ -514,7 +516,7 @@ H5O_mtime_free(void *mesg) */ static herr_t H5O_mtime_debug(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, const void *_mesg, FILE *stream, - int indent, int fwidth) + int indent, int fwidth) { const time_t *mesg = (const time_t *)_mesg; struct tm *tm; @@ -534,7 +536,7 @@ H5O_mtime_debug(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, const voi HDstrftime(buf, sizeof(buf), "%Y-%m-%d %H:%M:%S %Z", tm); HDfprintf(stream, "%*s%-*s %s\n", indent, "", fwidth, - "Time:", buf); + "Time:", buf); FUNC_LEAVE_NOAPI(SUCCEED) } diff --git a/src/H5win32defs.h b/src/H5win32defs.h index 185e9b4..58e1412 100644 --- a/src/H5win32defs.h +++ b/src/H5win32defs.h @@ -84,7 +84,13 @@ struct timezone { #define HDgetlogin() Wgetlogin() #define HDsnprintf c99_snprintf /*varargs*/ #define HDvsnprintf c99_vsnprintf - +#if _MSC_VER >= 1900 // VS 2015 + // In gcc and in Visual Studio prior to VS 2015 'timezone' is a global + // variable declared in time.h. That variable was deprecated and in VS 2015 + // is removed, with _get_timezone replacing it. + #define HDget_timezone(V) _get_timezone(V); +#endif + #endif /* H5_HAVE_VISUAL_STUDIO */ /* Non-POSIX functions */ -- cgit v0.12 From 62563badd88b9c308e992d39d0929fd8c771ee87 Mon Sep 17 00:00:00 2001 From: Jerome Soumagne Date: Thu, 22 Oct 2015 23:52:32 -0500 Subject: [svn-r28196] Fix use of hbool_t in H5FDmulti Tested on: Sun OS 5.11/64 (emu) --- src/H5FDmulti.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/H5FDmulti.c b/src/H5FDmulti.c index bc61374..b53b9bf 100644 --- a/src/H5FDmulti.c +++ b/src/H5FDmulti.c @@ -48,12 +48,12 @@ H5FD_mem_t _unmapped, LOOPVAR; \ hbool_t _seen[H5FD_MEM_NTYPES]; \ \ - memset(_seen, 0, sizeof _seen); \ + memset(_seen, 0, H5FD_MEM_NTYPES * sizeof(hbool_t)); \ for (_unmapped=H5FD_MEM_SUPER; _unmapped0 && LOOPVAR Date: Fri, 23 Oct 2015 17:16:08 -0500 Subject: [svn-r28204] Fix use of hbool_t in H5FDmulti (revert previous fix and use unsigned instead) Tested on: Sun OS 5.11/64 (emu) --- src/H5FDmulti.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/H5FDmulti.c b/src/H5FDmulti.c index b53b9bf..92df2ad 100644 --- a/src/H5FDmulti.c +++ b/src/H5FDmulti.c @@ -46,14 +46,14 @@ /* Loop through all mapped files */ #define UNIQUE_MEMBERS(MAP,LOOPVAR) { \ H5FD_mem_t _unmapped, LOOPVAR; \ - hbool_t _seen[H5FD_MEM_NTYPES]; \ + unsigned _seen[H5FD_MEM_NTYPES]; \ \ - memset(_seen, 0, H5FD_MEM_NTYPES * sizeof(hbool_t)); \ + memset(_seen, 0, sizeof _seen); \ for (_unmapped=H5FD_MEM_SUPER; _unmapped0 && LOOPVAR Date: Mon, 26 Oct 2015 15:09:22 -0500 Subject: [svn-r28228] Remove WIN32 only config of threadsafe --- CMakeLists.txt | 93 +++++++++++++++++++++++++++--------------------------- src/CMakeLists.txt | 1 + 2 files changed, 48 insertions(+), 46 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 33c8ddf..65124ab 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -535,53 +535,54 @@ if (NOT HDF5_EXTERNALLY_CONFIGURED) endif (NOT HDF5_EXTERNALLY_CONFIGURED) #----------------------------------------------------------------------------- # Option to use threadsafe -# Note: Currently CMake only allows configuring of threadsafe on -# non-Cygwin WINDOWS. #----------------------------------------------------------------------------- -if (WIN32) - option (HDF5_ENABLE_THREADSAFE "Enable thread-safety" OFF) - if (HDF5_ENABLE_THREADSAFE) - # check for unsupported options - message (STATUS " **** thread-safety option not supported with static library **** ") - message (STATUS " **** thread-safety option will not be used building static library **** ") - if (HDF5_ENABLE_PARALLEL) - if (NOT ALLOW_UNSUPPORTED) - message (FATAL_ERROR " **** parallel and thread-safety options are not supported **** ") - else (NOT ALLOW_UNSUPPORTED) - message (STATUS " **** Allowing unsupported parallel and thread-safety options **** ") - endif (NOT ALLOW_UNSUPPORTED) - endif (HDF5_ENABLE_PARALLEL) - if (HDF5_BUILD_FORTRAN) - if (NOT ALLOW_UNSUPPORTED) - message (FATAL_ERROR " **** Fortran and thread-safety options are not supported **** ") - else (NOT ALLOW_UNSUPPORTED) - message (STATUS " **** Allowing unsupported Fortran and thread-safety options **** ") - endif (NOT ALLOW_UNSUPPORTED) - endif (HDF5_BUILD_FORTRAN) - if (HDF5_BUILD_CPP_LIB) - if (NOT ALLOW_UNSUPPORTED) - message (FATAL_ERROR " **** C++ and thread-safety options are not supported **** ") - else (NOT ALLOW_UNSUPPORTED) - message (STATUS " **** Allowing unsupported C++ and thread-safety options **** ") - endif (NOT ALLOW_UNSUPPORTED) - endif (HDF5_BUILD_CPP_LIB) - if (HDF5_BUILD_HL_LIB) - if (NOT ALLOW_UNSUPPORTED) - message (FATAL_ERROR " **** HL and thread-safety options are not supported **** ") - else (NOT ALLOW_UNSUPPORTED) - message (STATUS " **** Allowing unsupported HL and thread-safety options **** ") - endif (NOT ALLOW_UNSUPPORTED) - endif (HDF5_BUILD_HL_LIB) - if (H5_HAVE_IOEO) - message (STATUS " **** Win32 threads requires WINVER>=0x600 (Windows Vista/7/8) **** ") - set (H5_HAVE_WIN_THREADS 1) - else (H5_HAVE_IOEO) - if (NOT H5_HAVE_PTHREAD_H) - message (FATAL_ERROR " **** thread-safe option requires Win32 threads or Pthreads **** ") - endif (NOT H5_HAVE_PTHREAD_H) - endif (H5_HAVE_IOEO) - endif (HDF5_ENABLE_THREADSAFE) -endif (WIN32) +option (HDF5_ENABLE_THREADSAFE "Enable thread-safety" OFF) +if (HDF5_ENABLE_THREADSAFE) + # check for unsupported options + message (STATUS " **** thread-safety option not supported with static library **** ") + message (STATUS " **** thread-safety option will not be used building static library **** ") + if (HDF5_ENABLE_PARALLEL) + if (NOT ALLOW_UNSUPPORTED) + message (FATAL_ERROR " **** parallel and thread-safety options are not supported **** ") + else (NOT ALLOW_UNSUPPORTED) + message (STATUS " **** Allowing unsupported parallel and thread-safety options **** ") + endif (NOT ALLOW_UNSUPPORTED) + endif (HDF5_ENABLE_PARALLEL) + if (HDF5_BUILD_FORTRAN) + if (NOT ALLOW_UNSUPPORTED) + message (FATAL_ERROR " **** Fortran and thread-safety options are not supported **** ") + else (NOT ALLOW_UNSUPPORTED) + message (STATUS " **** Allowing unsupported Fortran and thread-safety options **** ") + endif (NOT ALLOW_UNSUPPORTED) + endif (HDF5_BUILD_FORTRAN) + if (HDF5_BUILD_CPP_LIB) + if (NOT ALLOW_UNSUPPORTED) + message (FATAL_ERROR " **** C++ and thread-safety options are not supported **** ") + else (NOT ALLOW_UNSUPPORTED) + message (STATUS " **** Allowing unsupported C++ and thread-safety options **** ") + endif (NOT ALLOW_UNSUPPORTED) + endif (HDF5_BUILD_CPP_LIB) + if (HDF5_BUILD_HL_LIB) + if (NOT ALLOW_UNSUPPORTED) + message (FATAL_ERROR " **** HL and thread-safety options are not supported **** ") + else (NOT ALLOW_UNSUPPORTED) + message (STATUS " **** Allowing unsupported HL and thread-safety options **** ") + endif (NOT ALLOW_UNSUPPORTED) + endif (HDF5_BUILD_HL_LIB) + if (H5_HAVE_IOEO) + message (STATUS " **** Win32 threads requires WINVER>=0x600 (Windows Vista/7/8) **** ") + set (H5_HAVE_WIN_THREADS 1) + else (H5_HAVE_IOEO) + if (NOT H5_HAVE_PTHREAD_H) + message (FATAL_ERROR " **** thread-safe option requires Win32 threads or Pthreads **** ") + endif (NOT H5_HAVE_PTHREAD_H) + endif (H5_HAVE_IOEO) + set(THREADS_PREFER_PTHREAD_FLAG ON) + find_package(Threads) + if (NOT Threads_FOUND) + message (STATUS " **** thread-safe package not found - threads still might work **** ") + endif (NOT Threads_FOUND) +endif (HDF5_ENABLE_THREADSAFE) # ----------------------------------------------------------------------- # wrapper script variables diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index cf218d7..b7656a1 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -887,6 +887,7 @@ if (BUILD_SHARED_LIBS) APPEND PROPERTY COMPILE_DEFINITIONS "H5_HAVE_THREADSAFE" ) + target_link_libraries (${HDF5_LIBSH_TARGET} Threads::Threads) endif (HDF5_ENABLE_THREADSAFE) if (HDF5_ENABLE_DEBUG_APIS) -- cgit v0.12 From b7310b0d1f1042ed14928b378852e034231f6747 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 26 Oct 2015 15:40:30 -0500 Subject: [svn-r28229] HDFFV-9550: Rework timezone usage to localize the #ifdef blocks to a HDget_timezone function. --- src/H5Omtime.c | 12 +----------- src/H5system.c | 31 +++++++++++++++++++++++++++++++ src/H5win32defs.h | 6 ------ 3 files changed, 32 insertions(+), 17 deletions(-) diff --git a/src/H5Omtime.c b/src/H5Omtime.c index 32248fa..d8c5305 100644 --- a/src/H5Omtime.c +++ b/src/H5Omtime.c @@ -186,12 +186,6 @@ H5O_mtime_decode(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5 int i; struct tm tm; void *ret_value = NULL; /* Return value */ -#if _MSC_VER >= 1900 // VS 2015 -// In gcc and in Visual Studio prior to VS 2015 'timezone' is a global -// variable declared in time.h. That variable was deprecated and in VS 2015 -// is removed, with _get_timezone replacing it. - long timezone = 0; -#endif FUNC_ENTER_NOAPI_NOINIT @@ -232,11 +226,7 @@ H5O_mtime_decode(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5 /* BSD-like systems */ the_time += tm.tm_gmtoff; #elif defined(H5_HAVE_TIMEZONE) - #if _MSC_VER >= 1900 // VS 2015 - HDget_timezone(&timezone); - #endif - /* GNU/Linux systems */ - the_time -= timezone - (tm.tm_isdst ? 3600 : 0); + the_time -= HDget_timezone() - (tm.tm_isdst ? 3600 : 0); #else /* * The catch-all. If we can't convert a character string universal diff --git a/src/H5system.c b/src/H5system.c index e00e5a5..098c109 100644 --- a/src/H5system.c +++ b/src/H5system.c @@ -586,6 +586,37 @@ void HDsrand(unsigned int seed) /*------------------------------------------------------------------------- + * Function: HDget_timezone + * + * Purpose: Wrapper function for global variable timezone, if it exists + * on this system, or use the function if VS2015 + * + * VS2015 removed the deprecated global variable timezone. + * + * Return: Success: The value of timezone + * + * Failure: Cannot fail. + * + *------------------------------------------------------------------------- + */ +#ifdef H5_HAVE_TIMEZONE + +long HDget_timezone(void) +{ +#if _MSC_VER >= 1900 // VS 2015 +// In gcc and in Visual Studio prior to VS 2015 'timezone' is a global +// variable declared in time.h. That variable was deprecated and in VS 2015 +// is removed, with _get_timezone replacing it. + long timezone = 0; + + #define HDget_timezone(V) _get_timezone(V); + HDget_timezone(&timezone); +#endif + return timezone; +} +#endif /* H5_HAVE_TIMEZONE */ + +/*------------------------------------------------------------------------- * Function: Wgettimeofday * * Purpose: Wrapper function for gettimeofday on Windows systems diff --git a/src/H5win32defs.h b/src/H5win32defs.h index 58e1412..73d8417 100644 --- a/src/H5win32defs.h +++ b/src/H5win32defs.h @@ -84,12 +84,6 @@ struct timezone { #define HDgetlogin() Wgetlogin() #define HDsnprintf c99_snprintf /*varargs*/ #define HDvsnprintf c99_vsnprintf -#if _MSC_VER >= 1900 // VS 2015 - // In gcc and in Visual Studio prior to VS 2015 'timezone' is a global - // variable declared in time.h. That variable was deprecated and in VS 2015 - // is removed, with _get_timezone replacing it. - #define HDget_timezone(V) _get_timezone(V); -#endif #endif /* H5_HAVE_VISUAL_STUDIO */ -- cgit v0.12 From 8e179b17aadbf8e011e59224270920878499dfa1 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Tue, 27 Oct 2015 08:46:50 -0500 Subject: [svn-r28234] Changed a C++-style comment to C-style. --- src/H5system.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/H5system.c b/src/H5system.c index 098c109..fc01366 100644 --- a/src/H5system.c +++ b/src/H5system.c @@ -603,10 +603,12 @@ void HDsrand(unsigned int seed) long HDget_timezone(void) { -#if _MSC_VER >= 1900 // VS 2015 -// In gcc and in Visual Studio prior to VS 2015 'timezone' is a global -// variable declared in time.h. That variable was deprecated and in VS 2015 -// is removed, with _get_timezone replacing it. +#if _MSC_VER >= 1900 /* VS 2015 */ + + /* In gcc and in Visual Studio prior to VS 2015 'timezone' is a global + * variable declared in time.h. That variable was deprecated and in + * VS 2015 is removed, with _get_timezone replacing it. + */ long timezone = 0; #define HDget_timezone(V) _get_timezone(V); -- cgit v0.12 From 3537b69b5b57ac476bec26dd84be88a7c14123b3 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 27 Oct 2015 10:22:09 -0500 Subject: [svn-r28236] Rework get timezone function to add another exclusion define (H5_HAVA_TM_GMTOFF). Also needed to add prototype - followed lead of HDrand. Tested linux and windows --- src/H5Omtime.c | 2 +- src/H5private.h | 12 ++++++++++-- src/H5system.c | 8 ++++++-- 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/src/H5Omtime.c b/src/H5Omtime.c index d8c5305..272e54a 100644 --- a/src/H5Omtime.c +++ b/src/H5Omtime.c @@ -226,7 +226,7 @@ H5O_mtime_decode(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5 /* BSD-like systems */ the_time += tm.tm_gmtoff; #elif defined(H5_HAVE_TIMEZONE) - the_time -= HDget_timezone() - (tm.tm_isdst ? 3600 : 0); + the_time -= HDgettimezone() - (tm.tm_isdst ? 3600 : 0); #else /* * The catch-all. If we can't convert a character string universal diff --git a/src/H5private.h b/src/H5private.h index 26111ff..6016295 100644 --- a/src/H5private.h +++ b/src/H5private.h @@ -495,7 +495,7 @@ #endif /* Double constant wrapper - * + * * Quiets gcc warnings from -Wunsuffixed-float-constants. * * This is a really annoying warning since the standard specifies that @@ -935,6 +935,14 @@ H5_DLL int HDfprintf (FILE *stream, const char *fmt, ...); #ifndef HDgets #define HDgets(S) gets(S) #endif /* HDgets */ +#ifndef H5_HAVE_TM_GMTOFF +#ifdef H5_HAVE_TIMEZONE + #ifndef HDgettimezone + #define HDgettimezone() HDget_timezone() + #endif /* HDgettimezone */ + H5_DLL int HDget_timezone(void); +#endif /* H5_HAVE_TIMEZONE */ +#endif /* H5_HAVE_TM_GMTOFF */ #ifndef HDgettimeofday #define HDgettimeofday(S,P) gettimeofday(S,P) #endif /* HDgettimeofday */ @@ -2065,7 +2073,7 @@ extern hbool_t H5_MPEinit_g; /* Has the MPE Library been initialized? */ FUNC_ENTER_COMMON_NOERR(!H5_IS_API(FUNC)); \ if(H5_PKG_INIT_VAR || !H5_TERM_GLOBAL) { -/* Use the following two macros as replacements for the FUNC_ENTER_NOAPI +/* Use the following two macros as replacements for the FUNC_ENTER_NOAPI * and FUNC_ENTER_NOAPI_NOINIT macros when the function needs to set * up a metadata tag. */ #define FUNC_ENTER_NOAPI_TAG(dxpl_id, tag, err) { \ diff --git a/src/H5system.c b/src/H5system.c index fc01366..0de920c 100644 --- a/src/H5system.c +++ b/src/H5system.c @@ -599,24 +599,28 @@ void HDsrand(unsigned int seed) * *------------------------------------------------------------------------- */ +#ifndef H5_HAVE_TM_GMTOFF #ifdef H5_HAVE_TIMEZONE -long HDget_timezone(void) +long int HDget_timezone(void) { +#ifdef H5_HAVE_VISUAL_STUDIO #if _MSC_VER >= 1900 /* VS 2015 */ /* In gcc and in Visual Studio prior to VS 2015 'timezone' is a global * variable declared in time.h. That variable was deprecated and in * VS 2015 is removed, with _get_timezone replacing it. */ - long timezone = 0; + long int timezone = 0; #define HDget_timezone(V) _get_timezone(V); HDget_timezone(&timezone); #endif +#endif return timezone; } #endif /* H5_HAVE_TIMEZONE */ +#endif /* H5_HAVE_TM_GMTOFF */ /*------------------------------------------------------------------------- * Function: Wgettimeofday -- cgit v0.12 From 45aa5c30c3720a2778918c309d9ff9fa92178179 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 28 Oct 2015 09:02:28 -0500 Subject: [svn-r28241] Correct prototype return signature. --- src/H5private.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/H5private.h b/src/H5private.h index 6016295..b678512 100644 --- a/src/H5private.h +++ b/src/H5private.h @@ -940,7 +940,7 @@ H5_DLL int HDfprintf (FILE *stream, const char *fmt, ...); #ifndef HDgettimezone #define HDgettimezone() HDget_timezone() #endif /* HDgettimezone */ - H5_DLL int HDget_timezone(void); + H5_DLL long int HDget_timezone(void); #endif /* H5_HAVE_TIMEZONE */ #endif /* H5_HAVE_TM_GMTOFF */ #ifndef HDgettimeofday -- cgit v0.12 From 401f0c181ea8e9f486203a6b70710f0631a4a640 Mon Sep 17 00:00:00 2001 From: Mohamad Chaarawi Date: Thu, 5 Nov 2015 11:48:09 -0500 Subject: [svn-r28285] move private H5G_get_create_plist from public source file to internal one. --- src/H5G.c | 95 ------------------------------------------------------------ src/H5Gint.c | 94 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 94 insertions(+), 95 deletions(-) diff --git a/src/H5G.c b/src/H5G.c index 779a2ad..03fe50a 100644 --- a/src/H5G.c +++ b/src/H5G.c @@ -531,101 +531,6 @@ done: /*------------------------------------------------------------------------- - * Function: H5G_get_create_plist - * - * Purpose: Private function for H5Gget_create_plist - * - * Return: Success: ID for a copy of the group creation - * property list. The property list ID should be - * released by calling H5Pclose(). - * - * Failure: FAIL - * - * Programmer: Quincey Koziol - * Tuesday, October 25, 2005 - * - *------------------------------------------------------------------------- - */ -hid_t -H5G_get_create_plist(H5G_t *grp) -{ - H5O_linfo_t linfo; /* Link info message */ - htri_t ginfo_exists; - htri_t linfo_exists; - htri_t pline_exists; - H5P_genplist_t *gcpl_plist; - H5P_genplist_t *new_plist; - hid_t new_gcpl_id = FAIL; - hid_t ret_value = FAIL; - - FUNC_ENTER_NOAPI(FAIL) - - /* Copy the default group creation property list */ - if(NULL == (gcpl_plist = (H5P_genplist_t *)H5I_object(H5P_LST_GROUP_CREATE_ID_g))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "can't get default group creation property list") - if((new_gcpl_id = H5P_copy_plist(gcpl_plist, TRUE)) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "unable to copy the creation property list") - if(NULL == (new_plist = (H5P_genplist_t *)H5I_object(new_gcpl_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "can't get property list") - - /* Retrieve any object creation properties */ - if(H5O_get_create_plist(&grp->oloc, H5AC_ind_dxpl_id, new_plist) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't get object creation info") - - /* Check for the group having a group info message */ - if((ginfo_exists = H5O_msg_exists(&(grp->oloc), H5O_GINFO_ID, H5AC_ind_dxpl_id)) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to read object header") - if(ginfo_exists) { - H5O_ginfo_t ginfo; /* Group info message */ - - /* Read the group info */ - if(NULL == H5O_msg_read(&(grp->oloc), H5O_GINFO_ID, &ginfo, H5AC_ind_dxpl_id)) - HGOTO_ERROR(H5E_SYM, H5E_BADMESG, FAIL, "can't get group info") - - /* Set the group info for the property list */ - if(H5P_set(new_plist, H5G_CRT_GROUP_INFO_NAME, &ginfo) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set group info") - } /* end if */ - - /* Check for the group having a link info message */ - if((linfo_exists = H5G__obj_get_linfo(&(grp->oloc), &linfo, H5AC_ind_dxpl_id)) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to read object header") - if(linfo_exists) { - /* Set the link info for the property list */ - if(H5P_set(new_plist, H5G_CRT_LINK_INFO_NAME, &linfo) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set link info") - } /* end if */ - - /* Check for the group having a pipeline message */ - if((pline_exists = H5O_msg_exists(&(grp->oloc), H5O_PLINE_ID, H5AC_ind_dxpl_id)) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "unable to read object header") - if(pline_exists) { - H5O_pline_t pline; /* Pipeline message */ - - /* Read the pipeline */ - if(NULL == H5O_msg_read(&(grp->oloc), H5O_PLINE_ID, &pline, H5AC_ind_dxpl_id)) - HGOTO_ERROR(H5E_SYM, H5E_BADMESG, FAIL, "can't get link pipeline") - - /* Set the pipeline for the property list */ - if(H5P_poke(new_plist, H5O_CRT_PIPELINE_NAME, &pline) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set link pipeline") - } /* end if */ - - /* Set the return value */ - ret_value = new_gcpl_id; - -done: - if(ret_value < 0) { - if(new_gcpl_id > 0) - if(H5I_dec_app_ref(new_gcpl_id) < 0) - HDONE_ERROR(H5E_SYM, H5E_CANTDEC, FAIL, "can't free") - } /* end if */ - - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_get_create_plist() */ - - -/*------------------------------------------------------------------------- * Function: H5Gget_info * * Purpose: Retrieve information about a group. diff --git a/src/H5Gint.c b/src/H5Gint.c index ea8288c..cba4806 100644 --- a/src/H5Gint.c +++ b/src/H5Gint.c @@ -1160,3 +1160,97 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5G_visit() */ + +/*------------------------------------------------------------------------- + * Function: H5G_get_create_plist + * + * Purpose: Private function for H5Gget_create_plist + * + * Return: Success: ID for a copy of the group creation + * property list. The property list ID should be + * released by calling H5Pclose(). + * + * Failure: FAIL + * + * Programmer: Quincey Koziol + * Tuesday, October 25, 2005 + * + *------------------------------------------------------------------------- + */ +hid_t +H5G_get_create_plist(H5G_t *grp) +{ + H5O_linfo_t linfo; /* Link info message */ + htri_t ginfo_exists; + htri_t linfo_exists; + htri_t pline_exists; + H5P_genplist_t *gcpl_plist; + H5P_genplist_t *new_plist; + hid_t new_gcpl_id = FAIL; + hid_t ret_value = FAIL; + + FUNC_ENTER_NOAPI(FAIL) + + /* Copy the default group creation property list */ + if(NULL == (gcpl_plist = (H5P_genplist_t *)H5I_object(H5P_LST_GROUP_CREATE_ID_g))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "can't get default group creation property list") + if((new_gcpl_id = H5P_copy_plist(gcpl_plist, TRUE)) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "unable to copy the creation property list") + if(NULL == (new_plist = (H5P_genplist_t *)H5I_object(new_gcpl_id))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "can't get property list") + + /* Retrieve any object creation properties */ + if(H5O_get_create_plist(&grp->oloc, H5AC_ind_dxpl_id, new_plist) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't get object creation info") + + /* Check for the group having a group info message */ + if((ginfo_exists = H5O_msg_exists(&(grp->oloc), H5O_GINFO_ID, H5AC_ind_dxpl_id)) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to read object header") + if(ginfo_exists) { + H5O_ginfo_t ginfo; /* Group info message */ + + /* Read the group info */ + if(NULL == H5O_msg_read(&(grp->oloc), H5O_GINFO_ID, &ginfo, H5AC_ind_dxpl_id)) + HGOTO_ERROR(H5E_SYM, H5E_BADMESG, FAIL, "can't get group info") + + /* Set the group info for the property list */ + if(H5P_set(new_plist, H5G_CRT_GROUP_INFO_NAME, &ginfo) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set group info") + } /* end if */ + + /* Check for the group having a link info message */ + if((linfo_exists = H5G__obj_get_linfo(&(grp->oloc), &linfo, H5AC_ind_dxpl_id)) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to read object header") + if(linfo_exists) { + /* Set the link info for the property list */ + if(H5P_set(new_plist, H5G_CRT_LINK_INFO_NAME, &linfo) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set link info") + } /* end if */ + + /* Check for the group having a pipeline message */ + if((pline_exists = H5O_msg_exists(&(grp->oloc), H5O_PLINE_ID, H5AC_ind_dxpl_id)) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "unable to read object header") + if(pline_exists) { + H5O_pline_t pline; /* Pipeline message */ + + /* Read the pipeline */ + if(NULL == H5O_msg_read(&(grp->oloc), H5O_PLINE_ID, &pline, H5AC_ind_dxpl_id)) + HGOTO_ERROR(H5E_SYM, H5E_BADMESG, FAIL, "can't get link pipeline") + + /* Set the pipeline for the property list */ + if(H5P_poke(new_plist, H5O_CRT_PIPELINE_NAME, &pline) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set link pipeline") + } /* end if */ + + /* Set the return value */ + ret_value = new_gcpl_id; + +done: + if(ret_value < 0) { + if(new_gcpl_id > 0) + if(H5I_dec_app_ref(new_gcpl_id) < 0) + HDONE_ERROR(H5E_SYM, H5E_CANTDEC, FAIL, "can't free") + } /* end if */ + + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5G_get_create_plist() */ -- cgit v0.12