From 0d752fc354e376f15d038225b908e1899d5833b7 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 23 Sep 2015 15:31:50 -0500 Subject: [svn-r27862] Make the system vars configurable through the CTEST_SCRIPT_ARG --- config/cmake/HDF5_Examples.cmake.in | 43 ++++++++++++++++++++++++++++++------- 1 file changed, 35 insertions(+), 8 deletions(-) diff --git a/config/cmake/HDF5_Examples.cmake.in b/config/cmake/HDF5_Examples.cmake.in index d0c0509..9a89132 100644 --- a/config/cmake/HDF5_Examples.cmake.in +++ b/config/cmake/HDF5_Examples.cmake.in @@ -2,19 +2,46 @@ cmake_minimum_required(VERSION 3.1.0 FATAL_ERROR) ############################################################################################################### # This script will build and run the examples from a compressed file # Execute from a command line: -# ctest -S HDF5_Examples.cmake,HDF5Examples -C Release -V -O test.log +# ctest -S HDF5_Examples.cmake,CTEST_SOURCE_NAME=HDF5Examples -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(BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF_ENABLE_F2003:BOOL=ON") -#set(CTEST_USE_TAR_SOURCE "${CTEST_SCRIPT_ARG}") + +# handle input parameters to script. +#INSTALLDIR - HDF4 root folder +#CTEST_BUILD_CONFIGURATION - Release, Debug, RelWithDebInfo +#CTEST_SOURCE_NAME - name of source folder; HDF4Examples +#STATICLIBRARIES - Default is YES +#TAR_SOURCE - name of tarfile +#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 STATICLIBRARIES) + set(STATICLIBRARIES "YES") +endif() +#if(NOT DEFINED TAR_SOURCE) +# set(CTEST_USE_TAR_SOURCE "HDF5Examples-1.10.1-Source") +#endif() ############################################################################################################### # Adjust the following SET Commands as needed -- cgit v0.12 From 6a2195507da2fc7b6302d00b2e1a25dda96b11cd Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 23 Sep 2015 15:34:23 -0500 Subject: [svn-r27863] Correct comment --- config/cmake/HDF5_Examples.cmake.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/cmake/HDF5_Examples.cmake.in b/config/cmake/HDF5_Examples.cmake.in index 9a89132..81f9702 100644 --- a/config/cmake/HDF5_Examples.cmake.in +++ b/config/cmake/HDF5_Examples.cmake.in @@ -10,7 +10,7 @@ set(CTEST_DASHBOARD_ROOT ${CTEST_SCRIPT_DIRECTORY}) #set(BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF_BUILD_FORTRAN:BOOL=ON") # handle input parameters to script. -#INSTALLDIR - HDF4 root folder +#INSTALLDIR - HDF5 root folder #CTEST_BUILD_CONFIGURATION - Release, Debug, RelWithDebInfo #CTEST_SOURCE_NAME - name of source folder; HDF4Examples #STATICLIBRARIES - Default is YES -- cgit v0.12 From d99143e25bf3e2aaeed0f89a867035292336026f Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 24 Sep 2015 12:14:01 -0500 Subject: [svn-r27868] Add missing exported headers due to generation changes. --- src/CMakeLists.txt | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 634b71c..e16a873 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -819,6 +819,11 @@ if (HDF5_GENERATE_HEADERS) endif (PERL_FOUND) endif (HDF5_GENERATE_HEADERS) +set (H5_PUBLIC_GENERATED_HEADERS + ${HDF5_SRC_DIR}/H5version.h + ${HDF5_SRC_DIR}/H5overflow.h +) + #----------------------------------------------------------------------------- # Setup the H5Detect utility which generates H5Tinit with platform # specific type checks inside @@ -831,7 +836,7 @@ endif (MSVC OR MINGW) if (HDF5_GENERATE_HEADERS) add_dependencies(H5detect generate_precompiled) else (HDF5_GENERATE_HEADERS) - add_dependencies(H5detect "${HDF5_SRC_DIR}/H5version.h;${HDF5_SRC_DIR}/H5overflow.h") + add_dependencies(H5detect "${H5_PUBLIC_GENERATED_HEADERS}") endif (HDF5_GENERATE_HEADERS) set (CMD $) @@ -850,7 +855,7 @@ endif (MSVC OR MINGW) if (HDF5_GENERATE_HEADERS) add_dependencies(H5detect generate_precompiled) else (HDF5_GENERATE_HEADERS) - add_dependencies(H5make_libsettings "${HDF5_SRC_DIR}/H5version.h;${HDF5_SRC_DIR}/H5overflow.h") + add_dependencies(H5make_libsettings "${H5_PUBLIC_GENERATED_HEADERS}") endif (HDF5_GENERATE_HEADERS) set (CMD $) @@ -899,7 +904,7 @@ endif (HDF5_ENABLE_DEBUG_APIS) set (install_targets ${HDF5_LIB_TARGET}) if (BUILD_SHARED_LIBS) - add_library (${HDF5_LIBSH_TARGET} SHARED ${common_SRCS} ${H5_PUBLIC_HEADERS} ${H5_PRIVATE_HEADERS}) + add_library (${HDF5_LIBSH_TARGET} SHARED ${common_SRCS} ${H5_PUBLIC_HEADERS} ${H5_PRIVATE_HEADERS} ${H5_GENERATED_HEADERS}) TARGET_C_PROPERTIES (${HDF5_LIBSH_TARGET} SHARED " " " ") target_link_libraries (${HDF5_LIBSH_TARGET} ${LINK_SHARED_LIBS}) if (NOT WIN32) @@ -944,6 +949,7 @@ if (NOT HDF5_INSTALL_NO_DEVELOPMENT) install ( FILES ${H5_PUBLIC_HEADERS} + ${H5_PUBLIC_GENERATED_HEADERS} DESTINATION ${HDF5_INSTALL_INCLUDE_DIR} COMPONENT -- cgit v0.12 From e732b8073bf0f552af6ba3ed91a54b8be0c46031 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 24 Sep 2015 12:36:48 -0500 Subject: [svn-r27869] Update with changes to script file --- config/cmake/README.txt.cmake.in | 33 ++++++++++++++++++++++----------- 1 file changed, 22 insertions(+), 11 deletions(-) diff --git a/config/cmake/README.txt.cmake.in b/config/cmake/README.txt.cmake.in index a12c5aa..ec40abe 100644 --- a/config/cmake/README.txt.cmake.in +++ b/config/cmake/README.txt.cmake.in @@ -1,11 +1,11 @@ @HDF5_PACKAGE_NAME@ version @HDF5_PACKAGE_VERSION_STRING@ ------------------------------------------------------------------------------ -This directory contains the binary (release) distribution of +This directory contains the binary (release) distribution of @HDF5_PACKAGE_NAME@ @HDF5_PACKAGE_VERSION_MAJOR@ that was compiled on; - @BINARY_PLATFORM@. + @BINARY_PLATFORM@. -It was built with the following options: +It was built with the following options: -- @LIB_TYPE@ C/C++/Fortran libraries -- SZIP (encoder enabled) and ZLIB -- @LIB_TYPE@ HDF5 tools @@ -24,27 +24,38 @@ Installation After Installation =========================================================================== -The examples folder, HDF5Examples, located in the +The examples folder, HDF5Examples, located in the HDF5 install folder, can be built and tested with CMake and the supplied HDF5_Examples.cmake file. The HDF5_Examples.cmake expects HDF5 to have -been installed in the default location with above compilers. Also, the CMake +been installed in the default location with above compilers. Also, the CMake utility should be installed. To test the installation with the examples; Create a directory to run the examples. Copy HDF5Examples folder to this directory. Copy HDF5_Examples.cmake to this directory. - Edit HDF5_Examples.cmake line 8 to set INSTALLDIR to where HDF5 is installed. - (The default should be correct unless you installed into a different folder.) - Execute from this directory: - ctest -S HDF5_Examples.cmake,HDF5Examples -C Release -V -O test.log + The default source folder is defined as "HDF5Examples". It can be changed + with the CTEST_SOURCE_NAME script option. + The default installation folder is defined as "@CMAKE_INSTALL_PREFIX@". + It can be changed with the INSTALLDIR script option. + The default ctest configuration is defined as "Release". It can be changed + 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". + Other options can be changed by editing the HDF5_Examples.cmake file. + + If the defaults are okay, execute from this directory: + ctest -S HDF5_Examples.cmake -C Release -V -O test.log + If the defaults need change, execute from this directory: + ctest -S HDF5_Examples.cmake,CTEST_SOURCE_NAME=MyExamples,INSTALLDIR=MyLocation -C Release -V -O test.log When executed, the ctest script will save the results to the log file, test.log, as -indicated by the ctest command. If you wish the to see more build and test information, +indicated by the ctest command. If you wish the to see more build and test information, add "-VV" to the ctest command. The output should show; 100% tests passed, 0 tests failed out of 156. -For more information see USING_CMake_Examples.txt in the install folder. +For more information see USING_CMake_Examples.txt in the install folder. =========================================================================== Documentation for this release can be found at the following URL: -- cgit v0.12 From a1df19353d6673c66ca2fc957bd1b6a8b0d3407e Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 24 Sep 2015 13:54:00 -0500 Subject: [svn-r27871] Update with changes to script file --- config/cmake/HDF5_Examples.cmake.in | 23 +++++++------- release_docs/USING_CMake_Examples.txt | 57 ++++++++++++++++++----------------- 2 files changed, 41 insertions(+), 39 deletions(-) diff --git a/config/cmake/HDF5_Examples.cmake.in b/config/cmake/HDF5_Examples.cmake.in index 81f9702..feccb1a 100644 --- a/config/cmake/HDF5_Examples.cmake.in +++ b/config/cmake/HDF5_Examples.cmake.in @@ -14,7 +14,6 @@ set(CTEST_DASHBOARD_ROOT ${CTEST_SCRIPT_DIRECTORY}) #CTEST_BUILD_CONFIGURATION - Release, Debug, RelWithDebInfo #CTEST_SOURCE_NAME - name of source folder; HDF4Examples #STATICLIBRARIES - Default is YES -#TAR_SOURCE - name of tarfile #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 @@ -39,6 +38,8 @@ endif() if(NOT DEFINED STATICLIBRARIES) 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() @@ -87,7 +88,7 @@ if(APPLE) endif(NOT NO_MAC_FORTRAN) set(BUILD_OPTIONS "${BUILD_OPTIONS} -DCTEST_USE_LAUNCHERS:BOOL=ON -DCMAKE_BUILD_WITH_INSTALL_RPATH:BOOL=OFF") endif(APPLE) - + #----------------------------------------------------------------------------- set(CTEST_CMAKE_COMMAND "\"${CMAKE_COMMAND}\"") ## -------------------------- @@ -96,19 +97,19 @@ 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(CTEST_USE_TAR_SOURCE) - + #----------------------------------------------------------------------------- ## Clear the build directory ## -------------------------- @@ -131,11 +132,11 @@ 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}") @@ -149,5 +150,5 @@ if(res GREATER 0) message (FATAL_ERROR "tests FAILED") endif(res GREATER 0) #----------------------------------------------------------------------------- -############################################################################################################## +############################################################################################################## message(STATUS "DONE") \ No newline at end of file diff --git a/release_docs/USING_CMake_Examples.txt b/release_docs/USING_CMake_Examples.txt index d52a719..a6854ae 100644 --- a/release_docs/USING_CMake_Examples.txt +++ b/release_docs/USING_CMake_Examples.txt @@ -28,8 +28,8 @@ I. Preconditions the HDF Install Utility (the *.msi file in the binary package for Windows or the *.sh on Linux). If you are using a Windows platform, you can obtain a pre-built Windows binary from The HDF Group's website - at www.hdfgroup.org. See Section "III. Common changes to the - HDF518_Examples.cmake file", for the line to change the location. + at www.hdfgroup.org. + ======================================================================== @@ -37,40 +37,41 @@ II. Building HDF5 Examples with CMake ======================================================================== Files in the HDF5 install directory: - HDF5Examples-0.1.1-Source folder + HDF5Examples folder HDF518_Examples.cmake Default installation process: Create a directory to run the examples, i.e. \test_hdf5. - Copy HDF5Examples-0.1.1-Source folder to this directory. - Copy HDF518_Examples.cmake to this directory. - Edit line 8 of the HDF518_Examples.cmake file and change the INSTALLDIR - to the HDF5 install location. - - Execute from this directory: - ctest -S HDF518_Examples.cmake,HDF5Examples-0.1.1-Source -C Release -O test.log - -The script will use the examples folder HDF5Examples-0.1.1-Source, - and create a build directory inside the HDF5Examples-0.1.1-Source directory. - It will then configure, build, and execute the examples. All the log files - will be found under the build\Testing\Temporary directory, check these for - errors. - -The amount of script information can be increased by adding -V to the ctest - command. Even more information can be shown by adding -VV instead of -V. + Copy HDF5Examples folder to this directory. + Copy HDF5_Examples.cmake to this directory. + The default source folder is defined as "HDF5Examples". It can be changed + with the CTEST_SOURCE_NAME script option. + The default installation folder is defined as "@CMAKE_INSTALL_PREFIX@". + It can be changed with the INSTALLDIR script option. + The default ctest configuration is defined as "Release". It can be changed + 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". + Other options can be changed by editing the HDF5_Examples.cmake file. + + If the defaults are okay, execute from this directory: + ctest -S HDF5_Examples.cmake -C Release -V -O test.log + If the defaults need change, execute from this directory: + ctest -S HDF5_Examples.cmake,CTEST_SOURCE_NAME=MyExamples,INSTALLDIR=MyLocation -C Release -V -O test.log + + When executed, the ctest script will save the results to the log file, test.log, as + indicated by the ctest command. If you wish the to see more build and test information, + add "-VV" to the ctest command. The output should show; + 100% tests passed, 0 tests failed out of 156. ======================================================================== -III. Common changes to the HDF518_Examples.cmake file +III. Other changes to the HDF518_Examples.cmake file ======================================================================== -Line 8: change the INSTALLDIR to a different HDF5 install location. - -Line 14: uncomment to allow Mac machines to build shared examples. - -Line 15: uncomment to build and test Fortran examples. - -Line 16: comment to NOT build and test Fortran examples with F2003 option. +Line 10: uncomment to build and test Fortran examples. -Line 17: uncomment to use a compressed source file. +Line 43-45: uncomment to use a source tarball or zipfile; + Add script option "TAR_SOURCE=MySource.tar". -- cgit v0.12 From 5430c32938f9c40df63254940ef18758c94defe1 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 24 Sep 2015 14:01:39 -0500 Subject: [svn-r27873] Update with changes to script file --- config/cmake/HDF5_Examples.cmake.in | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/config/cmake/HDF5_Examples.cmake.in b/config/cmake/HDF5_Examples.cmake.in index feccb1a..65e2e9e 100644 --- a/config/cmake/HDF5_Examples.cmake.in +++ b/config/cmake/HDF5_Examples.cmake.in @@ -1,8 +1,8 @@ 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 HDF5_Examples.cmake,CTEST_SOURCE_NAME=HDF5Examples -C Release -V -O test.log +# ctest -S HDF5_Examples.cmake,OPTION=VALUE -C Release -V -O test.log ############################################################################################################### set(CTEST_CMAKE_GENERATOR "@CMAKE_GENERATOR@") @@ -70,7 +70,7 @@ endif(WIN32) # For any comments please contact cdashhelp@hdfgroup.org # ############################################################################################################### - + #----------------------------------------------------------------------------- # MAC machines need special option #----------------------------------------------------------------------------- @@ -81,7 +81,7 @@ 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) set(BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF_BUILD_FORTRAN:BOOL=OFF") -- cgit v0.12 From 2c99d728f05b6f32c6299a40e88cfe351a06c639 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 24 Sep 2015 14:14:44 -0500 Subject: [svn-r27874] Add ability to extend the cmake path for searching for libraries/programs. --- CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 96d5772..1035142 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -212,6 +212,10 @@ if (NOT HDF5_INSTALL_DATA_DIR) endif (NOT WIN32) endif (NOT HDF5_INSTALL_DATA_DIR) +if(DEFINED ADDITIONAL_CMAKE_PREFIX_PATH AND EXISTS "${ADDITIONAL_CMAKE_PREFIX_PATH}") + set (CMAKE_PREFIX_PATH ${ADDITIONAL_CMAKE_PREFIX_PATH} ${CMAKE_PREFIX_PATH}) +endif(DEFINED ADDITIONAL_CMAKE_PREFIX_PATH AND EXISTS "${ADDITIONAL_CMAKE_PREFIX_PATH}") + #----------------------------------------------------------------------------- # parse the full version number from H5public.h and include in H5_VERS_INFO #----------------------------------------------------------------------------- -- cgit v0.12 From 04289b3e2ad9e6ff6593b6df991f28c704fd8039 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Fri, 25 Sep 2015 15:49:24 -0500 Subject: [svn-r27878] Updated autogen.sh script to be more informative about missing flex/bison. Tested on: local linux --- autogen.sh | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/autogen.sh b/autogen.sh index 237e1b1..fa2e2d2 100755 --- a/autogen.sh +++ b/autogen.sh @@ -396,15 +396,37 @@ bin/make_overflow src/H5overflow.txt || exit 1 # to install a later version of bison. See the OS X note at the top # of this script. echo -echo "Running flex/bison:" -cd hl/src +echo "Generating H5LT parser code (requires yacc/bison):" echo "Generate hl/src/H5LTparse.c from hl/src/H5LTparse.y" +# HDF5_BISON is set via the environment or 'which bison', above +if test -z ${HDF5_BISON}; then + echo + echo "*************************" + echo " ERROR - bison not found" + echo "*************************" + echo "bison is required to generate parser code in H5LT" + echo + exit 127 +fi +cd hl/src if [ "$verbose" = true ] ; then ${HDF5_BISON} --version fi ${HDF5_BISON} -pH5LTyy -o H5LTparse.c -d H5LTparse.y +echo +echo "Generating H5LT lexer code (requires lex/flex):" echo "Generate hl/src/H5LTanalyze.c from hl/src/H5LTanalyze.l" +# HDF5_FLEX is set via the environment or 'which flex', above +if test -z ${HDF5_FLEX}; then + echo + echo "************************" + echo " ERROR - flex not found" + echo "************************" + echo "flex is required to generate lexer code in H5LT" + echo + exit 127 +fi if [ "$verbose" = true ] ; then ${HDF5_FLEX} --version fi -- cgit v0.12 From aec3e1242d0d0f5c0fcbe796f2c2801c828e7efb Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Fri, 25 Sep 2015 18:32:57 -0500 Subject: [svn-r27880] Changes to autogen.sh - Removed the long options, which are not supported under the getopts builtin. - Correctly labeled the autogen.sh script as requiring bash (via the #!). We may need to remove the bash constructs before the 1.10 release and revert to sh. - The help output is now correct. Tested on: local linux --- autogen.sh | 32 +++++++++----------------------- 1 file changed, 9 insertions(+), 23 deletions(-) diff --git a/autogen.sh b/autogen.sh index fa2e2d2..d76c016 100755 --- a/autogen.sh +++ b/autogen.sh @@ -1,4 +1,4 @@ -#! /bin/sh +#! /bin/bash # # Copyright by The HDF Group. # All rights reserved. @@ -60,7 +60,7 @@ # # This script takes two potential options: # -# -p, --production +# -p # # When this is selected, the autotools versions are set to the paths # and versions used by The HDF Group to produce the released versions @@ -70,7 +70,7 @@ # to have recent versions of the autotools this option will probably # be removed. # -# -v, --verbose +# -v # # This emits some extra information, mainly tool versions. @@ -89,33 +89,19 @@ verbose=false optspec=":hpv-" while getopts "$optspec" optchar; do case "${optchar}" in - -) - case "${OPTARG}" in - production) - echo "Setting production mode..." - echo - production=true - ;; - verbose) - echo "Setting verbosity: high" - echo - verbose=true - ;; - *) - if [ "$OPTERR" = 1 ] && [ "${optspec:0:1}" != ":" ]; then - echo "Unknown option --${OPTARG}" >&2 - fi - ;; - esac;; h) - echo "usage: $0 [-p|--production]" + echo "usage: $0 [OPTIONS]" + echo + echo " -h Print this help message." echo echo " -p Used by THG to ensure that particular versions" echo " of the autotools are used and hard-codes" echo " autotools paths to THG machines. Not for" echo " non-HDF-Group users!" echo - echo " NOTE: Each autotool can be set via an environment variable." + echo " -v Show more verbose output." + echo + echo " NOTE: Each tool can be set via an environment variable." echo " These are documented inside this autogen.sh script." echo exit 0 -- cgit v0.12 From 8186a5cee10c41e97ba24b6fe1de9f6ce0c3902d Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Sat, 26 Sep 2015 18:52:42 -0500 Subject: [svn-r27884] Description: Update dataspace selection encode/decode routines to avoid type aliasing errors. Tested on: Linux/64 2.6.x (platypus) w/production (h5committest forthcoming) --- src/H5S.c | 40 +++++++++++++++-------------- src/H5Sall.c | 18 +++++++++----- src/H5Shyper.c | 76 +++++++++++++++++++++++++++++++++----------------------- src/H5Snone.c | 16 +++++++++--- src/H5Spoint.c | 51 ++++++++++++++++++++++--------------- src/H5Sprivate.h | 1 + 6 files changed, 123 insertions(+), 79 deletions(-) diff --git a/src/H5S.c b/src/H5S.c index 2c8288c..9585a31 100644 --- a/src/H5S.c +++ b/src/H5S.c @@ -1578,11 +1578,12 @@ done: static herr_t H5S_encode(H5S_t *obj, unsigned char **p, size_t *nalloc) { + H5F_t *f = NULL; /* Fake file structure*/ + unsigned char *pp = (*p); /* Local pointer for decoding */ size_t extent_size; /* Size of serialized dataspace extent */ hssize_t sselect_size; /* Signed size of serialized dataspace selection */ size_t select_size; /* Size of serialized dataspace selection */ - H5F_t *f = NULL; /* Fake file structure*/ - herr_t ret_value = SUCCEED; + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -1601,27 +1602,28 @@ H5S_encode(H5S_t *obj, unsigned char **p, size_t *nalloc) /* Verify the size of buffer. If it's not big enough, simply return the * right size without filling the buffer. */ - if(!*p || *nalloc < (extent_size + select_size + 1 + 1 + 1 + 4)) + if(!pp || *nalloc < (extent_size + select_size + 1 + 1 + 1 + 4)) *nalloc = extent_size + select_size + 1 + 1 + 1 + 4; else { /* Encode the type of the information */ - *(*p)++ = H5O_SDSPACE_ID; + *pp++ = H5O_SDSPACE_ID; /* Encode the version of the dataspace information */ - *(*p)++ = H5S_ENCODE_VERSION; + *pp++ = H5S_ENCODE_VERSION; /* Encode the "size of size" information */ - *(*p)++ = (unsigned char)H5F_SIZEOF_SIZE(f); + *pp++ = (unsigned char)H5F_SIZEOF_SIZE(f); /* Encode size of extent information. Pointer is actually moved in this macro. */ - UINT32ENCODE(*p, extent_size); + UINT32ENCODE(pp, extent_size); /* Encode the extent part of dataspace */ - if(H5O_msg_encode(f, H5O_SDSPACE_ID, TRUE, *p, obj) < 0) + if(H5O_msg_encode(f, H5O_SDSPACE_ID, TRUE, pp, obj) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTENCODE, FAIL, "can't encode extent space") - *p += extent_size; + pp += extent_size; /* Encode the selection part of dataspace. */ + *p = pp; if(H5S_SELECT_SERIALIZE(obj, p) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTENCODE, FAIL, "can't encode select space") } /* end else */ @@ -1694,38 +1696,39 @@ done: static H5S_t* H5S_decode(const unsigned char **p) { - H5S_t *ds; - H5S_extent_t *extent; - size_t extent_size; /* size of the extent message*/ H5F_t *f = NULL; /* Fake file structure*/ + H5S_t *ds; /* Decoded dataspace */ + H5S_extent_t *extent; /* Entent of decoded dataspace */ + const unsigned char *pp = (*p); /* Local pointer for decoding */ + size_t extent_size; /* size of the extent message*/ uint8_t sizeof_size; /* 'Size of sizes' for file */ H5S_t *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT /* Decode the type of the information */ - if(*(*p)++ != H5O_SDSPACE_ID) + if(*pp++ != H5O_SDSPACE_ID) HGOTO_ERROR(H5E_DATASPACE, H5E_BADMESG, NULL, "not an encoded dataspace") /* Decode the version of the dataspace information */ - if(*(*p)++ != H5S_ENCODE_VERSION) + if(*pp++ != H5S_ENCODE_VERSION) HGOTO_ERROR(H5E_DATASPACE, H5E_VERSION, NULL, "unknown version of encoded dataspace") /* Decode the "size of size" information */ - sizeof_size = *(*p)++; + sizeof_size = *pp++; /* Allocate "fake" file structure */ if(NULL == (f = H5F_fake_alloc(sizeof_size))) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTALLOC, NULL, "can't allocate fake file struct") /* Decode size of extent information */ - UINT32DECODE(*p, extent_size); + UINT32DECODE(pp, extent_size); /* Decode the extent part of dataspace */ /* (pass mostly bogus file pointer and bogus DXPL) */ - if((extent = (H5S_extent_t *)H5O_msg_decode(f, H5P_DEFAULT, NULL, H5O_SDSPACE_ID, *p))==NULL) + if((extent = (H5S_extent_t *)H5O_msg_decode(f, H5P_DEFAULT, NULL, H5O_SDSPACE_ID, pp))==NULL) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTDECODE, NULL, "can't decode object") - *p += extent_size; + pp += extent_size; /* Copy the extent into dataspace structure */ if((ds = H5FL_CALLOC(H5S_t))==NULL) @@ -1741,6 +1744,7 @@ H5S_decode(const unsigned char **p) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTSET, NULL, "unable to set all selection") /* Decode the select part of dataspace. I believe this part always exists. */ + *p = pp; if(H5S_SELECT_DESERIALIZE(&ds, p) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTDECODE, NULL, "can't decode space selection") diff --git a/src/H5Sall.c b/src/H5Sall.c index c373fd1..b8a39cc 100644 --- a/src/H5Sall.c +++ b/src/H5Sall.c @@ -512,19 +512,25 @@ H5S_all_serial_size (const H5S_t H5_ATTR_UNUSED *space) REVISION LOG --------------------------------------------------------------------------*/ static herr_t -H5S_all_serialize (const H5S_t *space, uint8_t **p) +H5S_all_serialize(const H5S_t *space, uint8_t **p) { + uint8_t *pp = (*p); /* Local pointer for decoding */ + FUNC_ENTER_NOAPI_NOINIT_NOERR + /* Check args */ HDassert(space); HDassert(p); - HDassert(*p); + HDassert(pp); /* Store the preamble information */ - UINT32ENCODE(*p, (uint32_t)H5S_GET_SELECT_TYPE(space)); /* Store the type of selection */ - UINT32ENCODE(*p, (uint32_t)1); /* Store the version number */ - UINT32ENCODE(*p, (uint32_t)0); /* Store the un-used padding */ - UINT32ENCODE(*p, (uint32_t)0); /* Store the additional information length */ + UINT32ENCODE(pp, (uint32_t)H5S_GET_SELECT_TYPE(space)); /* Store the type of selection */ + UINT32ENCODE(pp, (uint32_t)1); /* Store the version number */ + UINT32ENCODE(pp, (uint32_t)0); /* Store the un-used padding */ + UINT32ENCODE(pp, (uint32_t)0); /* Store the additional information length */ + + /* Update encoding pointer */ + *p = pp; FUNC_LEAVE_NOAPI(SUCCEED) } /* H5S_all_serialize() */ diff --git a/src/H5Shyper.c b/src/H5Shyper.c index 6b943d3..5ed1722 100644 --- a/src/H5Shyper.c +++ b/src/H5Shyper.c @@ -1977,14 +1977,14 @@ H5S_hyper_serial_size(const H5S_t *space) PURPOSE Serialize the current selection into a user-provided buffer. USAGE - herr_t H5S_hyper_serialize_helper(spans, start, end, rank, buf) + void H5S_hyper_serialize_helper(spans, start, end, rank, buf) H5S_hyper_span_info_t *spans; IN: Hyperslab span tree to serialize hssize_t start[]; IN/OUT: Accumulated start points hssize_t end[]; IN/OUT: Accumulated end points hsize_t rank; IN: Current rank looking at uint8 *buf; OUT: Buffer to put serialized selection into RETURNS - Non-negative on success/Negative on failure + DESCRIPTION Serializes the current element selection into a buffer. (Primarily for storing on disk). @@ -1993,13 +1993,13 @@ H5S_hyper_serial_size(const H5S_t *space) EXAMPLES REVISION LOG --------------------------------------------------------------------------*/ -static herr_t -H5S_hyper_serialize_helper (const H5S_hyper_span_info_t *spans, +static void +H5S_hyper_serialize_helper(const H5S_hyper_span_info_t *spans, hsize_t *start, hsize_t *end, hsize_t rank, uint8_t **p) { H5S_hyper_span_t *curr; /* Pointer to current hyperslab span */ + uint8_t *pp = (*p); /* Local pointer for decoding */ hsize_t u; /* Index variable */ - herr_t ret_value=SUCCEED; /* return value */ FUNC_ENTER_NOAPI_NOINIT @@ -2008,7 +2008,7 @@ H5S_hyper_serialize_helper (const H5S_hyper_span_info_t *spans, HDassert(start); HDassert(end); HDassert(rank < H5O_LAYOUT_NDIMS); - HDassert(p && *p); + HDassert(p && pp); /* Walk through the list of spans, recursing or outputing them */ curr=spans->head; @@ -2020,33 +2020,35 @@ H5S_hyper_serialize_helper (const H5S_hyper_span_info_t *spans, end[rank]=curr->high; /* Recurse down to the next dimension */ - if(H5S_hyper_serialize_helper(curr->down,start,end,rank+1,p)<0) - HGOTO_ERROR(H5E_INTERNAL, H5E_CANTFREE, FAIL, "failed to release hyperslab spans") + *p = pp; + H5S_hyper_serialize_helper(curr->down, start, end, rank = 1, p); } /* end if */ else { /* Encode all the previous dimensions starting & ending points */ /* Encode previous starting points */ for(u=0; ulow); + UINT32ENCODE(pp, (uint32_t)curr->low); /* Encode previous ending points */ for(u=0; uhigh); + UINT32ENCODE(pp, (uint32_t)curr->high); } /* end else */ /* Advance to next node */ curr=curr->next; } /* end while */ -done: - FUNC_LEAVE_NOAPI(ret_value) + /* Update encoding pointer */ + *p = pp; + + FUNC_LEAVE_NOAPI_VOID } /* H5S_hyper_serialize_helper() */ @@ -2072,14 +2074,15 @@ done: REVISION LOG --------------------------------------------------------------------------*/ static herr_t -H5S_hyper_serialize (const H5S_t *space, uint8_t **p) +H5S_hyper_serialize(const H5S_t *space, uint8_t **p) { const H5S_hyper_dim_t *diminfo; /* Alias for dataspace's diminfo information */ + uint8_t *pp = (*p); /* Local pointer for decoding */ hsize_t tmp_count[H5O_LAYOUT_NDIMS]; /* Temporary hyperslab counts */ - hsize_t offset[H5O_LAYOUT_NDIMS]; /* Offset of element in dataspace */ + hsize_t offset[H5O_LAYOUT_NDIMS]; /* Offset of element in dataspace */ hsize_t start[H5O_LAYOUT_NDIMS]; /* Location of start of hyperslab */ hsize_t end[H5O_LAYOUT_NDIMS]; /* Location of end of hyperslab */ - hsize_t temp_off; /* Offset in a given dimension */ + hsize_t temp_off; /* Offset in a given dimension */ uint8_t *lenp; /* pointer to length location for later storage */ uint32_t len = 0; /* number of bytes used */ hsize_t block_count; /* block counter for regular hyperslabs */ @@ -2089,17 +2092,20 @@ H5S_hyper_serialize (const H5S_t *space, uint8_t **p) FUNC_ENTER_NOAPI_NOINIT_NOERR + /* Check args */ HDassert(space); + HDassert(p); + HDassert(pp); /* Store the preamble information */ - UINT32ENCODE(*p, (uint32_t)H5S_GET_SELECT_TYPE(space)); /* Store the type of selection */ - UINT32ENCODE(*p, (uint32_t)1); /* Store the version number */ - UINT32ENCODE(*p, (uint32_t)0); /* Store the un-used padding */ - lenp = *p; /* keep the pointer to the length location for later */ - *p += 4; /* skip over space for length */ + UINT32ENCODE(pp, (uint32_t)H5S_GET_SELECT_TYPE(space)); /* Store the type of selection */ + UINT32ENCODE(pp, (uint32_t)1); /* Store the version number */ + UINT32ENCODE(pp, (uint32_t)0); /* Store the un-used padding */ + lenp = pp; /* keep the pointer to the length location for later */ + pp += 4; /* skip over space for length */ /* Encode number of dimensions */ - UINT32ENCODE(*p, (uint32_t)space->extent.rank); + UINT32ENCODE(pp, (uint32_t)space->extent.rank); len += 4; /* Check for a "regular" hyperslab selection */ @@ -2117,7 +2123,7 @@ H5S_hyper_serialize (const H5S_t *space, uint8_t **p) /* Encode number of hyperslabs */ H5_CHECK_OVERFLOW(block_count, hsize_t, uint32_t); - UINT32ENCODE(*p, (uint32_t)block_count); + UINT32ENCODE(pp, (uint32_t)block_count); len+=4; /* Now serialize the information for the regular hyperslab */ @@ -2140,11 +2146,11 @@ H5S_hyper_serialize (const H5S_t *space, uint8_t **p) /* Encode hyperslab starting location */ for(u = 0; u < ndims; u++) - UINT32ENCODE(*p, (uint32_t)offset[u]); + UINT32ENCODE(pp, (uint32_t)offset[u]); /* Encode hyperslab ending location */ for(u = 0; u < ndims; u++) - UINT32ENCODE(*p, (uint32_t)(offset[u] + (diminfo[u].block - 1))); + UINT32ENCODE(pp, (uint32_t)(offset[u] + (diminfo[u].block - 1))); /* Move the offset to the next sequence to start */ offset[fast_dim]+=diminfo[fast_dim].stride; @@ -2195,7 +2201,7 @@ H5S_hyper_serialize (const H5S_t *space, uint8_t **p) /* Encode number of hyperslabs */ block_count = H5S_hyper_span_nblocks(space->select.sel_info.hslab->span_lst); H5_CHECK_OVERFLOW(block_count, hsize_t, uint32_t); - UINT32ENCODE(*p, (uint32_t)block_count); + UINT32ENCODE(pp, (uint32_t)block_count); len+=4; /* Add 8 bytes times the rank for each hyperslab selected */ @@ -2203,12 +2209,16 @@ H5S_hyper_serialize (const H5S_t *space, uint8_t **p) len += (uint32_t)(8 * space->extent.rank * block_count); /* Encode each hyperslab in selection */ + *p = pp; H5S_hyper_serialize_helper(space->select.sel_info.hslab->span_lst, start, end, (hsize_t)0, p); } /* end else */ /* Encode length */ UINT32ENCODE(lenp, (uint32_t)len); /* Store the length of the extra information */ + /* Update encoding pointer */ + *p = pp; + FUNC_LEAVE_NOAPI(SUCCEED) } /* H5S_hyper_serialize() */ @@ -2238,6 +2248,7 @@ H5S_hyper_serialize (const H5S_t *space, uint8_t **p) static herr_t H5S_hyper_deserialize(H5S_t *space, const uint8_t **p) { + const uint8_t *pp = (*p); /* Local pointer for decoding */ unsigned rank; /* rank of points */ size_t num_elem=0; /* number of elements in selection */ hsize_t start[H5O_LAYOUT_NDIMS]; /* hyperslab start information */ @@ -2258,12 +2269,12 @@ H5S_hyper_deserialize(H5S_t *space, const uint8_t **p) /* Check args */ HDassert(space); HDassert(p); - HDassert(*p); + HDassert(pp); /* Deserialize slabs to select */ /* (The header and rank have already beed decoded) */ rank = space->extent.rank; /* Retrieve rank from space */ - UINT32DECODE(*p,num_elem); /* decode the number of points */ + UINT32DECODE(pp,num_elem); /* decode the number of points */ /* Set the count & stride for all blocks */ for(tcount=count,tstride=stride,j=0; jextent.rank); + UINT32ENCODE(pp, (uint32_t)space->extent.rank); len+=4; /* Encode number of elements */ - UINT32ENCODE(*p, (uint32_t)space->select.num_elem); + UINT32ENCODE(pp, (uint32_t)space->select.num_elem); len+=4; /* Encode each point in selection */ @@ -854,7 +858,7 @@ H5S_point_serialize (const H5S_t *space, uint8_t **p) /* Encode each point */ for(u=0; uextent.rank; u++) - UINT32ENCODE(*p, (uint32_t)curr->pnt[u]); + UINT32ENCODE(pp, (uint32_t)curr->pnt[u]); curr=curr->next; } /* end while */ @@ -862,6 +866,9 @@ H5S_point_serialize (const H5S_t *space, uint8_t **p) /* Encode length */ UINT32ENCODE(lenp, (uint32_t)len); /* Store the length of the extra information */ + /* Update encoding pointer */ + *p = pp; + FUNC_LEAVE_NOAPI(SUCCEED) } /* H5S_point_serialize() */ @@ -891,24 +898,25 @@ H5S_point_serialize (const H5S_t *space, uint8_t **p) static herr_t H5S_point_deserialize (H5S_t *space, const uint8_t **p) { - H5S_seloper_t op=H5S_SELECT_SET; /* Selection operation */ - unsigned rank; /* Rank of points */ - size_t num_elem=0; /* Number of elements in selection */ - hsize_t *coord=NULL, *tcoord; /* Pointer to array of elements */ + H5S_seloper_t op = H5S_SELECT_SET; /* Selection operation */ + hsize_t *coord = NULL, *tcoord; /* Pointer to array of elements */ + const uint8_t *pp = (*p); /* Local pointer for decoding */ + size_t num_elem = 0; /* Number of elements in selection */ + unsigned rank; /* Rank of points */ unsigned i, j; /* local counting variables */ - herr_t ret_value = SUCCEED; /* return value */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI_NOINIT /* Check args */ HDassert(space); HDassert(p); - HDassert(*p); + HDassert(pp); /* Deserialize points to select */ /* (The header and rank have already beed decoded) */ rank = space->extent.rank; /* Retrieve rank from space */ - UINT32DECODE(*p, num_elem); /* decode the number of points */ + UINT32DECODE(pp, num_elem); /* decode the number of points */ /* Allocate space for the coordinates */ if(NULL == (coord = (hsize_t *)H5MM_malloc(num_elem * rank * sizeof(hsize_t)))) @@ -917,12 +925,15 @@ H5S_point_deserialize (H5S_t *space, const uint8_t **p) /* Retrieve the coordinates from the buffer */ for(tcoord = coord, i = 0; i < num_elem; i++) for(j = 0; j < (unsigned)rank; j++, tcoord++) - UINT32DECODE(*p, *tcoord); + UINT32DECODE(pp, *tcoord); /* Select points */ if(H5S_select_elements(space, op, num_elem, (const hsize_t *)coord) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTDELETE, FAIL, "can't change selection") + /* Update decoding pointer */ + *p = pp; + done: /* Free the coordinate array if necessary */ if(coord != NULL) diff --git a/src/H5Sprivate.h b/src/H5Sprivate.h index cccfd6d..b6b974d 100644 --- a/src/H5Sprivate.h +++ b/src/H5Sprivate.h @@ -206,6 +206,7 @@ H5_DLL int H5S_extend(H5S_t *space, const hsize_t *size); H5_DLL hsize_t H5S_extent_nelem(const H5S_extent_t *ext); H5_DLL int H5S_extent_get_dims(const H5S_extent_t *ext, hsize_t dims[], hsize_t max_dims[]); H5_DLL htri_t H5S_extent_equal(const H5S_t *ds1, const H5S_t *ds2); +H5_DLL herr_t H5S_extent_copy(H5S_t *dst, const H5S_t *src); /* Operations on selections */ H5_DLL herr_t H5S_select_deserialize(H5S_t **space, const uint8_t **p); -- cgit v0.12