diff options
Diffstat (limited to 'config')
40 files changed, 1292 insertions, 1758 deletions
diff --git a/config/cmake/CTestCustom.cmake b/config/cmake/CTestCustom.cmake index 27eaa56..6db0f6f 100644 --- a/config/cmake/CTestCustom.cmake +++ b/config/cmake/CTestCustom.cmake @@ -39,7 +39,6 @@ set (CTEST_CUSTOM_MEMCHECK_IGNORE H5TEST-flush2 #designed to need flush1 H5TEST-error_test #uses runTest.cmake H5TEST-err_compat #uses runTest.cmake - H5TEST-links_env #uses runTest.cmake H5TEST-testlibinfo #uses grepTest.cmake ######### H5TEST-clear-objects @@ -64,11 +63,19 @@ set (CTEST_CUSTOM_MEMCHECK_IGNORE CPP_testhdf5-clear-objects ######### tools/h5clear ######### H5CLEAR-clearall-objects + H5CLEAR-copy_h5clear_fsm_persist_equal.h5 + H5CLEAR-copy_h5clear_fsm_persist_greater.h5 + H5CLEAR-copy_h5clear_fsm_persist_less.h5 + H5CLEAR-copy_h5clear_fsm_persist_noclose.h5 + H5CLEAR-copy_h5clear_fsm_persist_user_equal.h5 + H5CLEAR-copy_h5clear_fsm_persist_user_greater.h5 + H5CLEAR-copy_h5clear_fsm_persist_user_less.h5 H5CLEAR-copy_h5clear_log_v3.h5 H5CLEAR-copy_h5clear_mdc_image.h5 H5CLEAR-copy_h5clear_sec2_v0.h5 H5CLEAR-copy_h5clear_sec2_v2.h5 H5CLEAR-copy_h5clear_sec2_v3.h5 + H5CLEAR-copy_h5clear_status_noclear.h5 H5CLEAR-copy_latest_h5clear_log_v3.h5 H5CLEAR-copy_latest_h5clear_sec2_v3.h5 H5CLEAR-copy_mod_h5clear_mdc_image.h5 @@ -86,6 +93,7 @@ set (CTEST_CUSTOM_MEMCHECK_IGNORE H5DUMP_PACKED_BITS-clearall-objects H5DUMP-XML-clearall-objects H5DUMP_VDS-clearall-objects + H5DUMP-t128bit_float #uses grepTest.cmake ######### tools/h5format_convert ######### H5FC-clearall-objects ######### tools/h5import ######### diff --git a/config/cmake/FindHDFJAVA.cmake.in b/config/cmake/FindHDFJAVA.cmake.in deleted file mode 100644 index ed2b8c2..0000000 --- a/config/cmake/FindHDFJAVA.cmake.in +++ /dev/null @@ -1,79 +0,0 @@ -# -# Copyright by The HDF Group. -# All rights reserved. -# -# This file is part of HDF5. The full HDF5 copyright notice, including -# terms governing use, modification, and redistribution, is contained in -# the COPYING file, which can be found at the root of the source code -# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. -# If you do not have access to either file, you may request a copy from -# help@hdfgroup.org. -# -# -# To be used by projects that make use of CMakeified hdf-java -# - -# -# Find the HDFJAVA includes and get all installed hdf-java library settings from -# HDFJAVA-config.cmake file : Requires a CMake compatible hdf-java-@HDFJAVA_PACKAGE_VERSION@ or later -# for this feature to work. The following vars are set if hdf-java is found. -# -# HDFJAVA_FOUND - True if found, otherwise all other vars are undefined -# HDFJAVA_VERSION_STRING - full version (e.g. @HDFJAVA_PACKAGE_VERSION@) -# HDFJAVA_VERSION_MAJOR - major part of version (e.g. @HDFJAVA_PACKAGE_VERSION_MAJOR@) -# HDFJAVA_VERSION_MINOR - minor part (e.g. @HDFJAVA_PACKAGE_VERSION_MINOR@) -# -# Target names that are valid (depending on enabled options) -# will be the following -# -# -# To aid in finding HDFJAVA as part of a subproject set -# HDFJAVA_ROOT_DIR_HINT to the location where @HDFJAVA_PACKAGE@@HDF_PACKAGE_EXT@-config.cmake lies - -INCLUDE (SelectLibraryConfigurations) -INCLUDE (FindPackageHandleStandardArgs) - -# The HINTS option should only be used for values computed from the system. -set (_HDFJAVA_HINTS - $ENV{HOME}/.local - $ENV{HDFJAVA_ROOT} - $ENV{HDFJAVA_ROOT_DIR_HINT} -) -# Hard-coded guesses should still go in PATHS. This ensures that the user -# environment can always override hard guesses. -set (_HDFJAVA_PATHS - $ENV{HOME}/.local - $ENV{HDFJAVA_ROOT} - $ENV{HDFJAVA_ROOT_DIR_HINT} - /usr/lib/@HDFJAVA_PACKAGE@ - /usr/share/@HDFJAVA_PACKAGE@ - /usr/local/@HDFJAVA_PACKAGE@ - /usr/local/@HDFJAVA_PACKAGE@/share -) - -FIND_PATH (HDFJAVA_ROOT_DIR "@HDFJAVA_PACKAGE@@HDF_PACKAGE_EXT@-config.cmake" - HINTS ${_HDFJAVA_HINTS} - PATHS ${_HDFJAVA_PATHS} - PATH_SUFFIXES - cmake/@HDFJAVA_PACKAGE@ - lib/cmake/@HDFJAVA_PACKAGE@ - share/cmake/@HDFJAVA_PACKAGE@ -) - -FIND_PATH (HDFJAVA_LIBRARY "jarhdf5-@HDFJAVA_PACKAGE_VERSION@.jar" - HINTS ${_HDFJAVA_HINTS} - PATHS ${_HDFJAVA_PATHS} - PATH_SUFFIXES - lib -) - -if (HDFJAVA_ROOT_DIR) - set (HDFJAVA_FOUND "YES") - INCLUDE (${HDFJAVA_ROOT_DIR}/@HDFJAVA_PACKAGE@@HDF_PACKAGE_EXT@-config.cmake) - set (HDFJAVA_LIBRARIES "${HDFJAVA_LIBRARY}") - set (HDFJAVA_INCLUDE_DIRS - ${HDFJAVA_LIBRARY}/jarhdf-@HDFJAVA_PACKAGE_VERSION@.jar - ${HDFJAVA_LIBRARY}/jarhdf5-@HDFJAVA_PACKAGE_VERSION@.jar - ) - -endif () diff --git a/config/cmake/FindJNI.cmake b/config/cmake/FindJNI.cmake deleted file mode 100644 index 1e6daf6..0000000 --- a/config/cmake/FindJNI.cmake +++ /dev/null @@ -1,347 +0,0 @@ -# Distributed under the OSI-approved BSD 3-Clause License. See https://cmake.org/licensing for details. - -#.rst: -# FindJNI -# ------- -# -# Find JNI java libraries. -# -# This module finds if Java is installed and determines where the -# include files and libraries are. It also determines what the name of -# the library is. The caller may set variable JAVA_HOME to specify a -# Java installation prefix explicitly. -# -# This module sets the following result variables: -# -# :: -# -# JNI_INCLUDE_DIRS = the include dirs to use -# JNI_LIBRARIES = the libraries to use -# JNI_FOUND = TRUE if JNI headers and libraries were found. -# JAVA_AWT_LIBRARY = the path to the jawt library -# JAVA_JVM_LIBRARY = the path to the jvm library -# JAVA_INCLUDE_PATH = the include path to jni.h -# JAVA_INCLUDE_PATH2 = the include path to jni_md.h -# JAVA_AWT_INCLUDE_PATH = the include path to jawt.h - -# Expand {libarch} occurences to java_libarch subdirectory(-ies) and set ${_var} -macro(java_append_library_directories _var) - # Determine java arch-specific library subdir - # Mostly based on openjdk/jdk/make/common/shared/Platform.gmk as of openjdk - # 1.6.0_18 + icedtea patches. However, it would be much better to base the - # guess on the first part of the GNU config.guess platform triplet. - if(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64") - if(CMAKE_LIBRARY_ARCHITECTURE STREQUAL "x86_64-linux-gnux32") - set(_java_libarch "x32" "amd64" "i386") - else() - set(_java_libarch "amd64" "i386") - endif() - elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^i.86$") - set(_java_libarch "i386") - elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^alpha") - set(_java_libarch "alpha") - elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^arm") - # Subdir is "arm" for both big-endian (arm) and little-endian (armel). - set(_java_libarch "arm" "aarch32") - elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^mips") - # mips* machines are bi-endian mostly so processor does not tell - # endianess of the underlying system. - set(_java_libarch "${CMAKE_SYSTEM_PROCESSOR}" "mips" "mipsel" "mipseb" "mips64" "mips64el" "mipsn32" "mipsn32el") - elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^(powerpc|ppc)64le") - set(_java_libarch "ppc64" "ppc64le") - elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^(powerpc|ppc)64") - set(_java_libarch "ppc64" "ppc") - elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^(powerpc|ppc)") - set(_java_libarch "ppc" "ppc64") - elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^sparc") - # Both flavours can run on the same processor - set(_java_libarch "${CMAKE_SYSTEM_PROCESSOR}" "sparc" "sparcv9") - elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^(parisc|hppa)") - set(_java_libarch "parisc" "parisc64") - elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^s390") - # s390 binaries can run on s390x machines - set(_java_libarch "${CMAKE_SYSTEM_PROCESSOR}" "s390" "s390x") - elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^sh") - set(_java_libarch "sh") - else() - set(_java_libarch "${CMAKE_SYSTEM_PROCESSOR}") - endif() - - # Append default list architectures if CMAKE_SYSTEM_PROCESSOR was empty or - # system is non-Linux (where the code above has not been well tested) - if(NOT _java_libarch OR NOT (CMAKE_SYSTEM_NAME MATCHES "Linux")) - list(APPEND _java_libarch "i386" "amd64" "ppc") - endif() - - # Sometimes ${CMAKE_SYSTEM_PROCESSOR} is added to the list to prefer - # current value to a hardcoded list. Remove possible duplicates. - list(REMOVE_DUPLICATES _java_libarch) - - foreach(_path ${ARGN}) - if(_path MATCHES "{libarch}") - foreach(_libarch ${_java_libarch}) - string(REPLACE "{libarch}" "${_libarch}" _newpath "${_path}") - if(EXISTS ${_newpath}) - list(APPEND ${_var} "${_newpath}") - endif() - endforeach() - else() - if(EXISTS ${_path}) - list(APPEND ${_var} "${_path}") - endif() - endif() - endforeach() -endmacro() - -#include(${CMAKE_CURRENT_LIST_DIR}/CMakeFindJavaCommon.cmake) -INCLUDE (CMakeFindJavaCommon) - -# Save CMAKE_FIND_FRAMEWORK -if(DEFINED CMAKE_FIND_FRAMEWORK) - set(_JNI_CMAKE_FIND_FRAMEWORK ${CMAKE_FIND_FRAMEWORK}) -else() - unset(_JNI_CMAKE_FIND_FRAMEWORK) -endif() - -if(_JAVA_HOME_EXPLICIT) - set(CMAKE_FIND_FRAMEWORK NEVER) -endif() - -set(JAVA_AWT_LIBRARY_DIRECTORIES) -if(_JAVA_HOME) - JAVA_APPEND_LIBRARY_DIRECTORIES(JAVA_AWT_LIBRARY_DIRECTORIES - ${_JAVA_HOME}/jre/lib/{libarch} - ${_JAVA_HOME}/jre/lib - ${_JAVA_HOME}/lib/{libarch} - ${_JAVA_HOME}/lib - ${_JAVA_HOME} - ) -endif() -get_filename_component(java_install_version - "[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit;CurrentVersion]" NAME) - -list(APPEND JAVA_AWT_LIBRARY_DIRECTORIES - "[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\1.4;JavaHome]/lib" - "[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\1.3;JavaHome]/lib" - "[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\${java_install_version};JavaHome]/lib" - ) -JAVA_APPEND_LIBRARY_DIRECTORIES(JAVA_AWT_LIBRARY_DIRECTORIES - /usr/java/lib - /usr/java/jre/lib - /usr/lib - /usr/lib64 - /usr/local/lib - /usr/local/lib64 - /usr/lib/jvm/java/lib - /usr/lib64/jvm/java/lib - /usr/lib/java/jre/lib/{libarch} - /usr/lib64/java/jre/lib/{libarch} - /usr/lib/jvm/jre/lib/{libarch} - /usr/local/lib/java/jre/lib/{libarch} - /usr/local/share/java/jre/lib/{libarch} - /usr/lib/j2sdk1.4-sun/jre/lib/{libarch} - /usr/lib/j2sdk1.5-sun/jre/lib/{libarch} - /opt/sun-jdk-1.5.0.04/jre/lib/{libarch} - /usr/lib/jvm/java-6-sun/jre/lib/{libarch} - /usr/lib/jvm/java-1.5.0-sun/jre/lib/{libarch} - /usr/lib/jvm/java-6-sun-1.6.0.00/jre/lib/{libarch} # can this one be removed according to #8821 ? Alex - /usr/lib/jvm/java-6-openjdk/jre/lib/{libarch} - /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0/jre/lib/{libarch} # fedora - # Debian specific paths for default JVM - /usr/lib/jvm/default-java/jre/lib/{libarch} - /usr/lib/jvm/default-java/jre/lib - /usr/lib/jvm/default-java/lib - # Arch Linux specific paths for default JVM - /usr/lib/jvm/default/jre/lib/{libarch} - /usr/lib/jvm/default/lib/{libarch} - # Ubuntu specific paths for default JVM - /usr/lib/jvm/java-8-openjdk-{libarch}/jre/lib/{libarch} # Ubuntu 15.10 - /usr/lib/jvm/java-7-openjdk-{libarch}/jre/lib/{libarch} # Ubuntu 15.10 - /usr/lib/jvm/java-6-openjdk-{libarch}/jre/lib/{libarch} # Ubuntu 15.10 - # OpenBSD specific paths for default JVM - /usr/local/jdk-1.7.0/jre/lib/{libarch} - /usr/local/jre-1.7.0/lib/{libarch} - /usr/local/jdk-1.6.0/jre/lib/{libarch} - /usr/local/jre-1.6.0/lib/{libarch} - # SuSE specific paths for default JVM - /usr/lib64/jvm/java/jre/lib/{libarch} - /usr/lib64/jvm/jre/lib/{libarch} - ) - -set(JAVA_JVM_LIBRARY_DIRECTORIES) -foreach(dir ${JAVA_AWT_LIBRARY_DIRECTORIES}) - list(APPEND JAVA_JVM_LIBRARY_DIRECTORIES - "${dir}" - "${dir}/client" - "${dir}/server" - # IBM SDK, Java Technology Edition, specific paths - "${dir}/j9vm" - "${dir}/default" - ) -endforeach() - -set(JAVA_AWT_INCLUDE_DIRECTORIES) -if(_JAVA_HOME) - list(APPEND JAVA_AWT_INCLUDE_DIRECTORIES ${_JAVA_HOME}/include) -endif() -list(APPEND JAVA_AWT_INCLUDE_DIRECTORIES - "[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\1.4;JavaHome]/include" - "[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\1.3;JavaHome]/include" - "[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\${java_install_version};JavaHome]/include" -) - -JAVA_APPEND_LIBRARY_DIRECTORIES(JAVA_AWT_INCLUDE_DIRECTORIES - ${_JAVA_HOME}/include - /usr/include - /usr/java/include - /usr/local/include - /usr/lib/java/include - /usr/lib64/java/include - /usr/local/lib/java/include - /usr/lib/jvm/java/include - /usr/lib/jvm/java-6-sun/include - /usr/lib/jvm/java-1.5.0-sun/include - /usr/lib/jvm/java-6-sun-1.6.0.00/include # can this one be removed according to #8821 ? Alex - /usr/lib/jvm/java-6-openjdk/include - /usr/lib/jvm/java-7-openjdk/include - /usr/lib64/jvm/java-7-openjdk/include - /usr/lib64/jvm/java-7-openjdk-amd64/include - /usr/lib/jvm/java-8-openjdk-{libarch}/include # ubuntu 15.10 - /usr/lib/jvm/java-7-openjdk-{libarch}/include # ubuntu 15.10 - /usr/lib/jvm/java-6-openjdk-{libarch}/include # ubuntu 15.10 - /usr/local/share/java/include - /usr/lib/j2sdk1.4-sun/include - /usr/lib/j2sdk1.5-sun/include - /opt/sun-jdk-1.5.0.04/include - # Debian specific path for default JVM - /usr/lib/jvm/default-java/include - # Arch specific path for default JVM - /usr/lib/jvm/default/include - # OpenBSD specific path for default JVM - /usr/local/jdk-1.7.0/include - /usr/local/jdk-1.6.0/include - # SuSE specific paths for default JVM - /usr/lib64/jvm/java/include - ) - -foreach(JAVA_PROG "${JAVA_RUNTIME}" "${JAVA_COMPILE}" "${JAVA_ARCHIVE}") - get_filename_component(jpath "${JAVA_PROG}" PATH) - foreach(JAVA_INC_PATH ../include ../java/include ../share/java/include) - if(EXISTS ${jpath}/${JAVA_INC_PATH}) - list(APPEND JAVA_AWT_INCLUDE_DIRECTORIES "${jpath}/${JAVA_INC_PATH}") - endif() - endforeach() - foreach(JAVA_LIB_PATH - ../lib ../jre/lib ../jre/lib/i386 - ../java/lib ../java/jre/lib ../java/jre/lib/i386 - ../share/java/lib ../share/java/jre/lib ../share/java/jre/lib/i386) - if(EXISTS ${jpath}/${JAVA_LIB_PATH}) - list(APPEND JAVA_AWT_LIBRARY_DIRECTORIES "${jpath}/${JAVA_LIB_PATH}") - endif() - endforeach() -endforeach() - -if(APPLE) - if(CMAKE_FIND_FRAMEWORK STREQUAL "ONLY") - set(_JNI_SEARCHES FRAMEWORK) - elseif(CMAKE_FIND_FRAMEWORK STREQUAL "NEVER") - set(_JNI_SEARCHES NORMAL) - elseif(CMAKE_FIND_FRAMEWORK STREQUAL "LAST") - set(_JNI_SEARCHES NORMAL FRAMEWORK) - else() - set(_JNI_SEARCHES FRAMEWORK NORMAL) - endif() - set(_JNI_FRAMEWORK_JVM NAMES JavaVM) - set(_JNI_FRAMEWORK_JAWT "${_JNI_FRAMEWORK_JVM}") -else() - set(_JNI_SEARCHES NORMAL) -endif() - -set(_JNI_NORMAL_JVM - NAMES jvm - PATHS ${JAVA_JVM_LIBRARY_DIRECTORIES} - ) - -set(_JNI_NORMAL_JAWT - NAMES jawt - PATHS ${JAVA_AWT_LIBRARY_DIRECTORIES} - ) - -foreach(search ${_JNI_SEARCHES}) - find_library(JAVA_JVM_LIBRARY ${_JNI_${search}_JVM}) - find_library(JAVA_AWT_LIBRARY ${_JNI_${search}_JAWT}) - if(JAVA_JVM_LIBRARY) - break() - endif() -endforeach() -unset(_JNI_SEARCHES) -unset(_JNI_FRAMEWORK_JVM) -unset(_JNI_FRAMEWORK_JAWT) -unset(_JNI_NORMAL_JVM) -unset(_JNI_NORMAL_JAWT) - -# Find headers matching the library. -if("${JAVA_JVM_LIBRARY};${JAVA_AWT_LIBRARY};" MATCHES "(/JavaVM.framework|-framework JavaVM);") - set(CMAKE_FIND_FRAMEWORK ONLY) -else() - set(CMAKE_FIND_FRAMEWORK NEVER) -endif() - -# add in the include path -find_path(JAVA_INCLUDE_PATH jni.h - ${JAVA_AWT_INCLUDE_DIRECTORIES} -) - -find_path(JAVA_INCLUDE_PATH2 NAMES jni_md.h jniport.h - PATHS - ${JAVA_INCLUDE_PATH} - ${JAVA_INCLUDE_PATH}/darwin - ${JAVA_INCLUDE_PATH}/win32 - ${JAVA_INCLUDE_PATH}/linux - ${JAVA_INCLUDE_PATH}/freebsd - ${JAVA_INCLUDE_PATH}/openbsd - ${JAVA_INCLUDE_PATH}/solaris - ${JAVA_INCLUDE_PATH}/hp-ux - ${JAVA_INCLUDE_PATH}/alpha - ${JAVA_INCLUDE_PATH}/aix -) - -find_path(JAVA_AWT_INCLUDE_PATH jawt.h - ${JAVA_INCLUDE_PATH} -) - -# Restore CMAKE_FIND_FRAMEWORK -if(DEFINED _JNI_CMAKE_FIND_FRAMEWORK) - set(CMAKE_FIND_FRAMEWORK ${_JNI_CMAKE_FIND_FRAMEWORK}) - unset(_JNI_CMAKE_FIND_FRAMEWORK) -else() - unset(CMAKE_FIND_FRAMEWORK) -endif() - -#include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) -INCLUDE (FindPackageHandleStandardArgs) -FIND_PACKAGE_HANDLE_STANDARD_ARGS(JNI DEFAULT_MSG JAVA_AWT_LIBRARY - JAVA_JVM_LIBRARY - JAVA_INCLUDE_PATH - JAVA_INCLUDE_PATH2 - JAVA_AWT_INCLUDE_PATH) - -mark_as_advanced( - JAVA_AWT_LIBRARY - JAVA_JVM_LIBRARY - JAVA_AWT_INCLUDE_PATH - JAVA_INCLUDE_PATH - JAVA_INCLUDE_PATH2 -) - -set(JNI_LIBRARIES - ${JAVA_AWT_LIBRARY} - ${JAVA_JVM_LIBRARY} -) - -set(JNI_INCLUDE_DIRS - ${JAVA_INCLUDE_PATH} - ${JAVA_INCLUDE_PATH2} - ${JAVA_AWT_INCLUDE_PATH} -) - diff --git a/config/cmake/H5pubconf.h.in b/config/cmake/H5pubconf.h.in index 273adb5..9e7b8b7 100644 --- a/config/cmake/H5pubconf.h.in +++ b/config/cmake/H5pubconf.h.in @@ -390,8 +390,13 @@ /* Define to 1 if you have the <szlib.h> header file. */ #cmakedefine H5_HAVE_SZLIB_H @H5_HAVE_SZLIB_H@ +#if defined(_WIN32) && !defined(H5_BUILT_AS_DYNAMIC_LIB) +/* Not supported on WIN32 platforms with static linking */ +/* #undef H5_HAVE_THREADSAFE */ +#else /* Define if we have thread safe support */ -#cmakedefine H5_HAVE_THREADSAFE @H5_HAVE_THREADSAFE@ +# cmakedefine H5_HAVE_THREADSAFE @H5_HAVE_THREADSAFE@ +#endif /* Define if timezone is a global variable */ #cmakedefine H5_HAVE_TIMEZONE @H5_HAVE_TIMEZONE@ diff --git a/config/cmake/HDF5UseFortran.cmake b/config/cmake/HDF5UseFortran.cmake index 6b77ca4..279e077 100644 --- a/config/cmake/HDF5UseFortran.cmake +++ b/config/cmake/HDF5UseFortran.cmake @@ -234,7 +234,7 @@ foreach (KIND ${VAR} ) set (pack_real_sizeof "${pack_real_sizeof} ${PROG_OUTPUT1},") endforeach () -if (pack_int_sizeof STREQUAL "") +if (pack_real_sizeof STREQUAL "") message (FATAL_ERROR "Failed to find available REAL KINDs for Fortran") endif () @@ -376,11 +376,11 @@ macro (C_RUN FUNCTION_NAME SOURCE_CODE RETURN_VAR) set (${RETURN_VAR} ${OUTPUT_VAR}) - #message ( "* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ") - #message ( "Test COMPILE_RESULT_VAR ${COMPILE_RESULT_VAR} ") - #message ( "* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ") - #message ( "Test RUN_RESULT_VAR ${RUN_RESULT_VAR} ") - #message ( "* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ") + #message (STATUS "* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ") + #message (STATUS "Test COMPILE_RESULT_VAR ${COMPILE_RESULT_VAR} ") + #message (STATUS "* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ") + #message (STATUS "Test RUN_RESULT_VAR ${RUN_RESULT_VAR} ") + #message (STATUS "* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ") if (${COMPILE_RESULT_VAR}) if (${RUN_RESULT_VAR} MATCHES 1) diff --git a/config/cmake/HDFCompilerFlags.cmake b/config/cmake/HDFCompilerFlags.cmake index 0a39568..4712f50 100644 --- a/config/cmake/HDFCompilerFlags.cmake +++ b/config/cmake/HDFCompilerFlags.cmake @@ -195,7 +195,12 @@ if (NOT MSVC AND CMAKE_COMPILER_IS_GNUCC) # Append more extra warning flags that only gcc 6.x+ know about if (CMAKE_C_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 6.0) - set (H5_CFLAGS4 "${H5_CFLAGS4} -Wnull-dereference -Wunused-const-variable -Wduplicated-cond -Whsa") + set (H5_CFLAGS4 "${H5_CFLAGS4} -Wnull-dereference -Wunused-const-variable -Wduplicated-cond -Whsa -Wnormalized") + endif () + + # Append more extra warning flags that only gcc 7.x+ know about + if (CMAKE_C_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 7.0) + set (H5_CFLAGS4 "${H5_CFLAGS4} -Walloc-zero -Walloca -Wduplicated-branches -Wformat-overflow=2 -Wformat-truncation=2 -Wimplicit-fallthrough=5 -Wrestrict") endif () endif () diff --git a/config/cmake/README.txt.cmake.in b/config/cmake/README.txt.cmake.in index be6ddc1..b29d50b 100644 --- a/config/cmake/README.txt.cmake.in +++ b/config/cmake/README.txt.cmake.in @@ -34,9 +34,9 @@ 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 CTestScript.cmake to this directory. Copy HDF5_Examples.cmake to this directory. Copy HDF5_Examples_options.cmake to this directory. - Copy CTestScript.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@". diff --git a/config/cmake/UseJava.cmake b/config/cmake/UseJava.cmake index 754d742..1f6b04c 100644 --- a/config/cmake/UseJava.cmake +++ b/config/cmake/UseJava.cmake @@ -1,437 +1,373 @@ # Distributed under the OSI-approved BSD 3-Clause License. See https://cmake.org/licensing for details. -#.rst: -# UseJava -# ------- -# -# Use Module for Java -# -# This file provides functions for Java. It is assumed that -# FindJava.cmake has already been loaded. See FindJava.cmake for -# information on how to load Java into your CMake project. -# -# :: -# -# add_jar(target_name -# [SOURCES] source1 [source2 ...] [resource1 ...] -# [INCLUDE_JARS jar1 [jar2 ...]] -# [ENTRY_POINT entry] -# [VERSION version] -# [OUTPUT_NAME name] -# [OUTPUT_DIR dir] -# [GENERATE_NATIVE_HEADERS target [DESTINATION dir]] -# ) -# -# This command creates a <target_name>.jar. It compiles the given -# source files (source) and adds the given resource files (resource) to -# the jar file. Source files can be java files or listing files -# (prefixed by '@'). If only resource files are given then just a jar file -# is created. The list of include jars are added to the classpath when -# compiling the java sources and also to the dependencies of the target. -# INCLUDE_JARS also accepts other target names created by add_jar. For -# backwards compatibility, jar files listed as sources are ignored (as -# they have been since the first version of this module). -# -# The default OUTPUT_DIR can also be changed by setting the variable -# CMAKE_JAVA_TARGET_OUTPUT_DIR. -# -# Optionally, using option GENERATE_NATIVE_HEADERS, native header files can be generated -# for methods declared as native. These files provide the connective glue that allow your -# Java and C code to interact. An INTERFACE target will be created for an easy usage -# of generated files. Sub-option DESTINATION can be used to specify output directory for -# generated header files. -# -# GENERATE_NATIVE_HEADERS option requires, at least, version 1.8 of the JDK. -# -# Additional instructions: -# -# :: -# -# To add compile flags to the target you can set these flags with -# the following variable: -# -# -# -# :: -# -# set(CMAKE_JAVA_COMPILE_FLAGS -nowarn) -# -# -# -# :: -# -# To add a path or a jar file to the class path you can do this -# with the CMAKE_JAVA_INCLUDE_PATH variable. -# -# -# -# :: -# -# set(CMAKE_JAVA_INCLUDE_PATH /usr/share/java/shibboleet.jar) -# -# -# -# :: -# -# To use a different output name for the target you can set it with: -# -# -# -# :: -# -# add_jar(foobar foobar.java OUTPUT_NAME shibboleet.jar) -# -# -# -# :: -# -# To use a different output directory than CMAKE_CURRENT_BINARY_DIR -# you can set it with: -# -# -# -# :: -# -# add_jar(foobar foobar.java OUTPUT_DIR ${PROJECT_BINARY_DIR}/bin) -# -# -# -# :: -# -# To define an entry point in your jar you can set it with the ENTRY_POINT -# named argument: -# -# -# -# :: -# -# add_jar(example ENTRY_POINT com/examples/MyProject/Main) -# -# -# -# :: -# -# To define a custom manifest for the jar, you can set it with the manifest -# named argument: -# -# -# -# :: -# -# add_jar(example MANIFEST /path/to/manifest) -# -# -# -# :: -# -# To add a VERSION to the target output name you can set it using -# the VERSION named argument to add_jar. This will create a jar file with the -# name shibboleet-1.0.0.jar and will create a symlink shibboleet.jar -# pointing to the jar with the version information. -# -# -# -# :: -# -# add_jar(shibboleet shibbotleet.java VERSION 1.2.0) -# -# -# -# :: -# -# If the target is a JNI library, utilize the following commands to -# create a JNI symbolic link: -# -# -# -# :: -# -# set(CMAKE_JNI_TARGET TRUE) -# add_jar(shibboleet shibbotleet.java VERSION 1.2.0) -# install_jar(shibboleet ${LIB_INSTALL_DIR}/shibboleet) -# install_jni_symlink(shibboleet ${JAVA_LIB_INSTALL_DIR}) -# -# -# -# :: -# -# If a single target needs to produce more than one jar from its -# java source code, to prevent the accumulation of duplicate class -# files in subsequent jars, set/reset CMAKE_JAR_CLASSES_PREFIX prior -# to calling the add_jar() function: -# -# -# -# :: -# -# set(CMAKE_JAR_CLASSES_PREFIX com/redhat/foo) -# add_jar(foo foo.java) -# -# -# -# :: -# -# set(CMAKE_JAR_CLASSES_PREFIX com/redhat/bar) -# add_jar(bar bar.java) -# -# -# -# :: -# -# For an optimum usage of option GENERATE_NATIVE_HEADERS, it is recommended to -# include module JNI before any call to add_jar. The produced target for native -# headers can then be used to compile C/C++ sources with command -# target_link_libraries. -# -# -# :: -# -# find_package(JNI) -# add_jar(foo foo.java GENERATE_NATIVE_HEADERS foo-native) -# add_library(bar bar.cpp) -# target_link_libraries(bar PRIVATE foo-native) -# -# -# Target Properties: -# -# :: -# -# The add_jar() function sets some target properties. You can get these -# properties with the -# get_property(TARGET <target_name> PROPERTY <propery_name>) -# command. -# -# -# -# :: -# -# INSTALL_FILES The files which should be installed. This is used by -# install_jar(). -# JNI_SYMLINK The JNI symlink which should be installed. -# This is used by install_jni_symlink(). -# JAR_FILE The location of the jar file so that you can include -# it. -# CLASSDIR The directory where the class files can be found. For -# example to use them with javah. -# -# :: -# -# find_jar(<VAR> -# name | NAMES name1 [name2 ...] -# [PATHS path1 [path2 ... ENV var]] -# [VERSIONS version1 [version2]] -# [DOC "cache documentation string"] -# ) -# -# This command is used to find a full path to the named jar. A cache -# entry named by <VAR> is created to stor the result of this command. -# If the full path to a jar is found the result is stored in the -# variable and the search will not repeated unless the variable is -# cleared. If nothing is found, the result will be <VAR>-NOTFOUND, and -# the search will be attempted again next time find_jar is invoked with -# the same variable. The name of the full path to a file that is -# searched for is specified by the names listed after NAMES argument. -# Additional search locations can be specified after the PATHS argument. -# If you require special a version of a jar file you can specify it with -# the VERSIONS argument. The argument after DOC will be used for the -# documentation string in the cache. -# -# :: -# -# install_jar(target_name destination) -# install_jar(target_name DESTINATION destination [COMPONENT component]) -# -# This command installs the TARGET_NAME files to the given DESTINATION. -# It should be called in the same scope as add_jar() or it will fail. -# -# Target Properties: -# -# :: -# -# The install_jar() function sets the INSTALL_DESTINATION target property -# on jars so installed. This property holds the DESTINATION as described -# above, and is used by install_jar_exports(). You can get this property -# with the -# get_property(TARGET <target_name> PROPERTY INSTALL_DESTINATION) -# command. -# -# -# -# :: -# -# install_jni_symlink(target_name destination) -# install_jni_symlink(target_name DESTINATION destination [COMPONENT component]) -# -# This command installs the TARGET_NAME JNI symlinks to the given -# DESTINATION. It should be called in the same scope as add_jar() or it -# will fail. -# -# :: -# -# install_jar_exports(TARGETS jars... -# [NAMESPACE <namespace>] -# FILE <filename> -# DESTINATION <dir> [COMPONENT <component>]) -# -# This command installs a target export file ``<filename>`` for the named jar -# targets to the given ``DESTINATION``. Its function is similar to that of -# :command:`install(EXPORTS ...)`. -# -# :: -# -# export_jars(TARGETS jars... -# [NAMESPACE <namespace>] -# FILE <filename>) -# -# This command writes a target export file ``<filename>`` for the named jar -# targets. Its function is similar to that of :command:`export(...)`. -# -# :: -# -# create_javadoc(<VAR> -# PACKAGES pkg1 [pkg2 ...] -# [SOURCEPATH <sourcepath>] -# [CLASSPATH <classpath>] -# [INSTALLPATH <install path>] -# [DOCTITLE "the documentation title"] -# [WINDOWTITLE "the title of the document"] -# [AUTHOR TRUE|FALSE] -# [USE TRUE|FALSE] -# [VERSION TRUE|FALSE] -# ) -# -# Create java documentation based on files or packages. For more -# details please read the javadoc manpage. -# -# There are two main signatures for create_javadoc. The first signature -# works with package names on a path with source files: -# -# :: -# -# Example: -# create_javadoc(my_example_doc -# PACKAGES com.example.foo com.example.bar -# SOURCEPATH "${CMAKE_CURRENT_SOURCE_DIR}" -# CLASSPATH ${CMAKE_JAVA_INCLUDE_PATH} -# WINDOWTITLE "My example" -# DOCTITLE "<h1>My example</h1>" -# AUTHOR TRUE -# USE TRUE -# VERSION TRUE -# ) -# -# -# -# The second signature for create_javadoc works on a given list of -# files. -# -# :: -# -# create_javadoc(<VAR> -# FILES file1 [file2 ...] -# [CLASSPATH <classpath>] -# [INSTALLPATH <install path>] -# [DOCTITLE "the documentation title"] -# [WINDOWTITLE "the title of the document"] -# [AUTHOR TRUE|FALSE] -# [USE TRUE|FALSE] -# [VERSION TRUE|FALSE] -# ) -# -# -# -# Example: -# -# :: -# -# create_javadoc(my_example_doc -# FILES ${example_SRCS} -# CLASSPATH ${CMAKE_JAVA_INCLUDE_PATH} -# WINDOWTITLE "My example" -# DOCTITLE "<h1>My example</h1>" -# AUTHOR TRUE -# USE TRUE -# VERSION TRUE -# ) -# -# -# -# Both signatures share most of the options. These options are the same -# as what you can find in the javadoc manpage. Please look at the -# manpage for CLASSPATH, DOCTITLE, WINDOWTITLE, AUTHOR, USE and VERSION. -# -# The documentation will be by default installed to -# -# :: -# -# ${CMAKE_INSTALL_PREFIX}/share/javadoc/<VAR> -# -# -# -# if you don't set the INSTALLPATH. -# -# :: -# -# create_javah(TARGET <target> -# GENERATED_FILES <VAR> -# CLASSES <class>... -# [CLASSPATH <classpath>...] -# [DEPENDS <depend>...] -# [OUTPUT_NAME <path>|OUTPUT_DIR <path>] -# ) -# -# Create C header files from java classes. These files provide the connective glue -# that allow your Java and C code to interact. -# -# This command will no longer be supported starting with version 10 of the JDK due -# to the `suppression of javah tool <http://openjdk.java.net/jeps/313>`_. -# Command ``add_jar(GENERATE_NATIVE_HEADERS)`` must be used instead. -# -# There are two main signatures for create_javah. The first signature -# returns generated files through variable specified by GENERATED_FILES option: -# -# :: -# -# Example: -# Create_javah(GENERATED_FILES files_headers -# CLASSES org.cmake.HelloWorld -# CLASSPATH hello.jar -# ) -# -# -# -# The second signature for create_javah creates a target which encapsulates -# header files generation. -# -# :: -# -# Example: -# Create_javah(TARGET target_headers -# CLASSES org.cmake.HelloWorld -# CLASSPATH hello.jar -# ) -# -# -# -# Both signatures share same options. -# -# ``CLASSES <class>...`` -# Specifies Java classes used to generate headers. -# -# ``CLASSPATH <classpath>...`` -# Specifies various paths to look up classes. Here .class files, jar files or targets -# created by command add_jar can be used. -# -# ``DEPENDS <depend>...`` -# Targets on which the javah target depends -# -# ``OUTPUT_NAME <path>`` -# Concatenates the resulting header files for all the classes listed by option CLASSES -# into <path>. Same behavior as option '-o' of javah tool. -# -# ``OUTPUT_DIR <path>`` -# Sets the directory where the header files will be generated. Same behavior as option -# '-d' of javah tool. If not specified, ${CMAKE_CURRENT_BINARY_DIR} is used as output directory. +#[=======================================================================[.rst: +UseJava +------- + +Use Module for Java + +This file provides functions for Java. It is assumed that +:module:`FindJava` has already been loaded. See :module:`FindJava` for +information on how to load Java into your CMake project. + +Creating And Installing JARs +^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +.. code-block:: cmake + + add_jar(<target_name> + [SOURCES] <source1> [<source2>...] [<resource1>...] + [INCLUDE_JARS <jar1> [<jar2>...]] + [ENTRY_POINT <entry>] + [VERSION <version>] + [OUTPUT_NAME <name>] + [OUTPUT_DIR <dir>] + [GENERATE_NATIVE_HEADERS <target> [DESTINATION <dir>]] + ) + +This command creates a ``<target_name>.jar``. It compiles the given +``<source>`` files and adds the given ``<resource>`` files to +the jar file. Source files can be java files or listing files +(prefixed by ``@``). If only resource files are given then just a jar file +is created. The list of ``INCLUDE_JARS`` are added to the classpath when +compiling the java sources and also to the dependencies of the target. +``INCLUDE_JARS`` also accepts other target names created by ``add_jar()``. +For backwards compatibility, jar files listed as sources are ignored (as +they have been since the first version of this module). + +The default ``OUTPUT_DIR`` can also be changed by setting the variable +``CMAKE_JAVA_TARGET_OUTPUT_DIR``. + +Optionally, using option ``GENERATE_NATIVE_HEADERS``, native header files can +be generated for methods declared as native. These files provide the +connective glue that allow your Java and C code to interact. An INTERFACE +target will be created for an easy usage of generated files. Sub-option +``DESTINATION`` can be used to specify the output directory for generated +header files. + +``GENERATE_NATIVE_HEADERS`` option requires, at least, version 1.8 of the JDK. + +The ``add_jar()`` function sets the following target properties on +``<target_name>``: + +``INSTALL_FILES`` + The files which should be installed. This is used by ``install_jar()``. +``JNI_SYMLINK`` + The JNI symlink which should be installed. This is used by + ``install_jni_symlink()``. +``JAR_FILE`` + The location of the jar file so that you can include it. +``CLASSDIR`` + The directory where the class files can be found. For example to use them + with ``javah``. + +.. code-block:: cmake + + install_jar(<target_name> <destination>) + install_jar(<target_name> DESTINATION <destination> [COMPONENT <component>]) + +This command installs the ``<target_name>`` files to the given +``<destination>``. It should be called in the same scope as ``add_jar()`` or +it will fail. + +The ``install_jar()`` function sets the ``INSTALL_DESTINATION`` target +property on jars so installed. This property holds the ``<destination>`` as +described above, and is used by ``install_jar_exports()``. You can get this +information with :command:`get_property` and the ``INSTALL_DESTINATION`` +property key. + +.. code-block:: cmake + + install_jni_symlink(<target_name> <destination>) + install_jni_symlink(<target_name> DESTINATION <destination> [COMPONENT <component>]) + +This command installs the ``<target_name>`` JNI symlinks to the given +``<destination>``. It should be called in the same scope as ``add_jar()`` or +it will fail. + +.. code-block:: cmake + + install_jar_exports(TARGETS <jars>... + [NAMESPACE <namespace>] + FILE <filename> + DESTINATION <destination> [COMPONENT <component>]) + +This command installs a target export file ``<filename>`` for the named jar +targets to the given ``<destination>`` directory. Its function is similar to +that of :command:`install(EXPORTS)`. + +.. code-block:: cmake + + export_jars(TARGETS <jars>... + [NAMESPACE <namespace>] + FILE <filename>) + +This command writes a target export file ``<filename>`` for the named ``<jars>`` +targets. Its function is similar to that of :command:`export`. + + +Examples +"""""""" + +To add compile flags to the target you can set these flags with the following +variable: + +.. code-block:: cmake + + set(CMAKE_JAVA_COMPILE_FLAGS -nowarn) + + +To add a path or a jar file to the class path you can do this with the +``CMAKE_JAVA_INCLUDE_PATH`` variable. + +.. code-block:: cmake + + set(CMAKE_JAVA_INCLUDE_PATH /usr/share/java/shibboleet.jar) + +To use a different output name for the target you can set it with: + +.. code-block:: cmake + + add_jar(foobar foobar.java OUTPUT_NAME shibboleet.jar) + +To use a different output directory than ``CMAKE_CURRENT_BINARY_DIR`` you can +set it with: + +.. code-block:: cmake + + add_jar(foobar foobar.java OUTPUT_DIR ${PROJECT_BINARY_DIR}/bin) + +To define an entry point in your jar you can set it with the ``ENTRY_POINT`` +named argument: + +.. code-block:: cmake + + add_jar(example ENTRY_POINT com/examples/MyProject/Main) + +To define a custom manifest for the jar, you can set it with the ``MANIFEST`` +named argument: + +.. code-block:: cmake + + add_jar(example MANIFEST /path/to/manifest) + +To add a version to the target output name you can set it using the ``VERSION`` +named argument to ``add_jar()``. The following example will create a jar file +with the name ``shibboleet-1.0.0.jar`` and will create a symlink +``shibboleet.jar`` pointing to the jar with the version information. + +.. code-block:: cmake + + add_jar(shibboleet shibbotleet.java VERSION 1.2.0) + +If the target is a JNI library, utilize the following commands to +create a JNI symbolic link: + +.. code-block:: cmake + + set(CMAKE_JNI_TARGET TRUE) + add_jar(shibboleet shibbotleet.java VERSION 1.2.0) + install_jar(shibboleet ${LIB_INSTALL_DIR}/shibboleet) + install_jni_symlink(shibboleet ${JAVA_LIB_INSTALL_DIR}) + +If a single target needs to produce more than one jar from its +java source code, to prevent the accumulation of duplicate class +files in subsequent jars, set/reset ``CMAKE_JAR_CLASSES_PREFIX`` prior +to calling the ``add_jar()`` function: + +.. code-block:: cmake + + set(CMAKE_JAR_CLASSES_PREFIX com/redhat/foo) + add_jar(foo foo.java) + + set(CMAKE_JAR_CLASSES_PREFIX com/redhat/bar) + add_jar(bar bar.java) + +For an optimum usage of option ``GENERATE_NATIVE_HEADERS``, it is recommended to +include module JNI before any call to ``add_jar()``. The produced target for +native headers can then be used to compile C/C++ sources with the +:command:`target_link_libraries` command. + +.. code-block:: cmake + + find_package(JNI) + add_jar(foo foo.java GENERATE_NATIVE_HEADERS foo-native) + add_library(bar bar.cpp) + target_link_libraries(bar PRIVATE foo-native) + + +Finding JARs +^^^^^^^^^^^^ + +.. code-block:: cmake + + find_jar(<VAR> + <name> | NAMES <name1> [<name2>...] + [PATHS <path1> [<path2>... ENV <var>]] + [VERSIONS <version1> [<version2>]] + [DOC "cache documentation string"] + ) + +This command is used to find a full path to the named jar. A cache +entry named by ``<VAR>`` is created to store the result of this command. +If the full path to a jar is found the result is stored in the +variable and the search will not repeated unless the variable is +cleared. If nothing is found, the result will be ``<VAR>-NOTFOUND``, and +the search will be attempted again next time ``find_jar()`` is invoked with +the same variable. The name of the full path to a file that is +searched for is specified by the names listed after ``NAMES`` argument. +Additional search locations can be specified after the ``PATHS`` argument. +If you require special a version of a jar file you can specify it with +the ``VERSIONS`` argument. The argument after ``DOC`` will be used for the +documentation string in the cache. + + +Javadoc +^^^^^^^ + +The ``create_javadoc()`` command can be used to create java documentation +based on files or packages. For more details please read the javadoc manpage. + +There are two main signatures for ``create_javadoc()``. The first signature +works with package names on a path with source files. + +.. code-block:: cmake + + create_javadoc(<VAR> + PACKAGES <pkg1> [<pkg2>...] + [SOURCEPATH <sourcepath>] + [CLASSPATH <classpath>] + [INSTALLPATH <install path>] + [DOCTITLE "the documentation title"] + [WINDOWTITLE "the title of the document"] + [AUTHOR TRUE|FALSE] + [USE TRUE|FALSE] + [VERSION TRUE|FALSE] + ) + +For example: + +.. code-block:: cmake + + create_javadoc(my_example_doc + PACKAGES com.example.foo com.example.bar + SOURCEPATH "${CMAKE_CURRENT_SOURCE_DIR}" + CLASSPATH ${CMAKE_JAVA_INCLUDE_PATH} + WINDOWTITLE "My example" + DOCTITLE "<h1>My example</h1>" + AUTHOR TRUE + USE TRUE + VERSION TRUE + ) + +The second signature for ``create_javadoc()`` works on a given list of +files. + +.. code-block:: cmake + + create_javadoc(<VAR> + FILES <file1> [<file2>...] + [CLASSPATH <classpath>] + [INSTALLPATH <install path>] + [DOCTITLE "the documentation title"] + [WINDOWTITLE "the title of the document"] + [AUTHOR TRUE|FALSE] + [USE TRUE|FALSE] + [VERSION TRUE|FALSE] + ) + +For example: + +.. code-block:: cmake + + create_javadoc(my_example_doc + FILES ${example_SRCS} + CLASSPATH ${CMAKE_JAVA_INCLUDE_PATH} + WINDOWTITLE "My example" + DOCTITLE "<h1>My example</h1>" + AUTHOR TRUE + USE TRUE + VERSION TRUE + ) + +Both signatures share most of the options. These options are the same +as what you can find in the javadoc manpage. Please look at the +manpage for ``CLASSPATH``, ``DOCTITLE``, ``WINDOWTITLE``, ``AUTHOR``, ``USE`` +and ``VERSION``. + +If you don't set the ``INSTALLPATH``, then by default the documentation will +be installed to : + +:: + + ${CMAKE_INSTALL_PREFIX}/share/javadoc/<VAR> + + +Header Generation +^^^^^^^^^^^^^^^^^ + +.. code-block:: cmake + + create_javah(TARGET <target> | GENERATED_FILES <VAR> + CLASSES <class>... + [CLASSPATH <classpath>...] + [DEPENDS <depend>...] + [OUTPUT_NAME <path>|OUTPUT_DIR <path>] + ) + +Create C header files from java classes. These files provide the connective glue +that allow your Java and C code to interact. + +.. deprecated:: 3.11 + +.. note:: + + This command will no longer be supported starting with version 10 of the JDK + due to the `suppression of javah tool <http://openjdk.java.net/jeps/313>`_. + The ``add_jar(GENERATE_NATIVE_HEADERS)`` command should be used instead. + +There are two main signatures for ``create_javah()``. The first signature +returns generated files through variable specified by the ``GENERATED_FILES`` +option. For example: + +.. code-block:: cmake + + create_javah(GENERATED_FILES files_headers + CLASSES org.cmake.HelloWorld + CLASSPATH hello.jar + ) + +The second signature for ``create_javah()`` creates a target which encapsulates +header files generation. E.g. + +.. code-block:: cmake + + create_javah(TARGET target_headers + CLASSES org.cmake.HelloWorld + CLASSPATH hello.jar + ) + +Both signatures share same options. + +``CLASSES <class>...`` + Specifies Java classes used to generate headers. + +``CLASSPATH <classpath>...`` + Specifies various paths to look up classes. Here .class files, jar files or + targets created by command add_jar can be used. + +``DEPENDS <depend>...`` + Targets on which the javah target depends. + +``OUTPUT_NAME <path>`` + Concatenates the resulting header files for all the classes listed by option + ``CLASSES`` into ``<path>``. Same behavior as option ``-o`` of javah tool. + +``OUTPUT_DIR <path>`` + Sets the directory where the header files will be generated. Same behavior + as option ``-d`` of javah tool. If not specified, + :variable:`CMAKE_CURRENT_BINARY_DIR` is used as the output directory. +#]=======================================================================] include(CMakeParseArguments) @@ -446,7 +382,7 @@ function (__java_copy_file src dest comment) endfunction () function(__java_lcat VAR) - foreach(_line ${ARGN}) + foreach(_line IN LISTS ARGN) string(APPEND ${VAR} "${_line}\n") endforeach() @@ -568,7 +504,7 @@ function(add_jar _TARGET_NAME) set(CMAKE_JAVA_INCLUDE_FLAG_SEP ":") endif() - foreach (JAVA_INCLUDE_DIR ${CMAKE_JAVA_INCLUDE_PATH}) + foreach (JAVA_INCLUDE_DIR IN LISTS CMAKE_JAVA_INCLUDE_PATH) string(APPEND CMAKE_JAVA_INCLUDE_PATH_FINAL "${CMAKE_JAVA_INCLUDE_FLAG_SEP}${JAVA_INCLUDE_DIR}") endforeach() @@ -592,7 +528,7 @@ function(add_jar _TARGET_NAME) set(_JAVA_COMPILE_DEPENDS) set(_JAVA_RESOURCE_FILES) set(_JAVA_RESOURCE_FILES_RELATIVE) - foreach(_JAVA_SOURCE_FILE ${_JAVA_SOURCE_FILES}) + foreach(_JAVA_SOURCE_FILE IN LISTS _JAVA_SOURCE_FILES) get_filename_component(_JAVA_EXT ${_JAVA_SOURCE_FILE} EXT) get_filename_component(_JAVA_FILE ${_JAVA_SOURCE_FILE} NAME_WE) get_filename_component(_JAVA_PATH ${_JAVA_SOURCE_FILE} PATH) @@ -607,7 +543,7 @@ function(add_jar _TARGET_NAME) file(RELATIVE_PATH _JAVA_REL_SOURCE_PATH ${CMAKE_CURRENT_SOURCE_DIR} ${_JAVA_FULL}) string(LENGTH ${_JAVA_REL_BINARY_PATH} _BIN_LEN) string(LENGTH ${_JAVA_REL_SOURCE_PATH} _SRC_LEN) - if (${_BIN_LEN} LESS ${_SRC_LEN}) + if (_BIN_LEN LESS _SRC_LEN) set(_JAVA_REL_PATH ${_JAVA_REL_BINARY_PATH}) else () set(_JAVA_REL_PATH ${_JAVA_REL_SOURCE_PATH}) @@ -637,14 +573,14 @@ function(add_jar _TARGET_NAME) endif () endforeach() - foreach(_JAVA_INCLUDE_JAR ${_add_jar_INCLUDE_JARS}) + foreach(_JAVA_INCLUDE_JAR IN LISTS _add_jar_INCLUDE_JARS) if (TARGET ${_JAVA_INCLUDE_JAR}) get_target_property(_JAVA_JAR_PATH ${_JAVA_INCLUDE_JAR} JAR_FILE) if (_JAVA_JAR_PATH) string(APPEND CMAKE_JAVA_INCLUDE_PATH_FINAL "${CMAKE_JAVA_INCLUDE_FLAG_SEP}${_JAVA_JAR_PATH}") list(APPEND CMAKE_JAVA_INCLUDE_PATH ${_JAVA_JAR_PATH}) list(APPEND _JAVA_DEPENDS ${_JAVA_INCLUDE_JAR}) - list(APPEND _JAVA_COMPILE_DEPENDS ${_JAVA_INCLUDE_JAR}) + list(APPEND _JAVA_COMPILE_DEPENDS ${_JAVA_JAR_PATH}) else () message(SEND_ERROR "add_jar: INCLUDE_JARS target ${_JAVA_INCLUDE_JAR} is not a jar") endif () @@ -705,7 +641,7 @@ function(add_jar _TARGET_NAME) # create the jar file set(_JAVA_JAR_OUTPUT_PATH - ${_add_jar_OUTPUT_DIR}/${_JAVA_TARGET_OUTPUT_NAME}) + "${_add_jar_OUTPUT_DIR}/${_JAVA_TARGET_OUTPUT_NAME}") if (CMAKE_JNI_TARGET) add_custom_command( OUTPUT ${_JAVA_JAR_OUTPUT_PATH} @@ -800,7 +736,8 @@ function(add_jar _TARGET_NAME) # this INTERFACE library depends on jar generation add_dependencies (${_GENERATE_NATIVE_HEADERS_TARGET} ${_TARGET_NAME}) - set_property (DIRECTORY PROPERTY ADDITIONAL_MAKE_CLEAN_FILES "${_GENERATE_NATIVE_HEADERS_OUTPUT_DIR}") + set_property (DIRECTORY APPEND PROPERTY ADDITIONAL_CLEAN_FILES + "${_GENERATE_NATIVE_HEADERS_OUTPUT_DIR}") endif() endfunction() @@ -903,15 +840,15 @@ function (find_jar VARIABLE) set(_state "name") - foreach (arg ${ARGN}) - if (${_state} STREQUAL "name") - if (${arg} STREQUAL "VERSIONS") + foreach (arg IN LISTS ARGN) + if (_state STREQUAL "name") + if (arg STREQUAL "VERSIONS") set(_state "versions") - elseif (${arg} STREQUAL "NAMES") + elseif (arg STREQUAL "NAMES") set(_state "names") - elseif (${arg} STREQUAL "PATHS") + elseif (arg STREQUAL "PATHS") set(_state "paths") - elseif (${arg} STREQUAL "DOC") + elseif (arg STREQUAL "DOC") set(_state "doc") else () set(_jar_names ${arg}) @@ -919,22 +856,22 @@ function (find_jar VARIABLE) set(_jar_doc "Finding ${arg} jar") endif () endif () - elseif (${_state} STREQUAL "versions") - if (${arg} STREQUAL "NAMES") + elseif (_state STREQUAL "versions") + if (arg STREQUAL "NAMES") set(_state "names") - elseif (${arg} STREQUAL "PATHS") + elseif (arg STREQUAL "PATHS") set(_state "paths") - elseif (${arg} STREQUAL "DOC") + elseif (arg STREQUAL "DOC") set(_state "doc") else () set(_jar_versions ${_jar_versions} ${arg}) endif () - elseif (${_state} STREQUAL "names") - if (${arg} STREQUAL "VERSIONS") + elseif (_state STREQUAL "names") + if (arg STREQUAL "VERSIONS") set(_state "versions") - elseif (${arg} STREQUAL "PATHS") + elseif (arg STREQUAL "PATHS") set(_state "paths") - elseif (${arg} STREQUAL "DOC") + elseif (arg STREQUAL "DOC") set(_state "doc") else () set(_jar_names ${_jar_names} ${arg}) @@ -942,22 +879,22 @@ function (find_jar VARIABLE) set(_jar_doc "Finding ${arg} jar") endif () endif () - elseif (${_state} STREQUAL "paths") - if (${arg} STREQUAL "VERSIONS") + elseif (_state STREQUAL "paths") + if (arg STREQUAL "VERSIONS") set(_state "versions") - elseif (${arg} STREQUAL "NAMES") + elseif (arg STREQUAL "NAMES") set(_state "names") - elseif (${arg} STREQUAL "DOC") + elseif (arg STREQUAL "DOC") set(_state "doc") else () set(_jar_paths ${_jar_paths} ${arg}) endif () - elseif (${_state} STREQUAL "doc") - if (${arg} STREQUAL "VERSIONS") + elseif (_state STREQUAL "doc") + if (arg STREQUAL "VERSIONS") set(_state "versions") - elseif (${arg} STREQUAL "NAMES") + elseif (arg STREQUAL "NAMES") set(_state "names") - elseif (${arg} STREQUAL "PATHS") + elseif (arg STREQUAL "PATHS") set(_state "paths") else () set(_jar_doc ${arg}) @@ -969,8 +906,8 @@ function (find_jar VARIABLE) message(FATAL_ERROR "find_jar: No name to search for given") endif () - foreach (jar_name ${_jar_names}) - foreach (version ${_jar_versions}) + foreach (jar_name IN LISTS _jar_names) + foreach (version IN LISTS _jar_versions) set(_jar_files ${_jar_files} ${jar_name}-${version}.jar) endforeach () set(_jar_files ${_jar_files} ${jar_name}.jar) @@ -998,301 +935,301 @@ function(create_javadoc _target) set(_state "package") - foreach (arg ${ARGN}) - if (${_state} STREQUAL "package") - if (${arg} STREQUAL "PACKAGES") + foreach (arg IN LISTS ARGN) + if (_state STREQUAL "package") + if (arg STREQUAL "PACKAGES") set(_state "packages") - elseif (${arg} STREQUAL "FILES") + elseif (arg STREQUAL "FILES") set(_state "files") - elseif (${arg} STREQUAL "SOURCEPATH") + elseif (arg STREQUAL "SOURCEPATH") set(_state "sourcepath") - elseif (${arg} STREQUAL "OVERVIEW") + elseif (arg STREQUAL "OVERVIEW") set(_state "overview") - elseif (${arg} STREQUAL "CLASSPATH") + elseif (arg STREQUAL "CLASSPATH") set(_state "classpath") - elseif (${arg} STREQUAL "INSTALLPATH") + elseif (arg STREQUAL "INSTALLPATH") set(_state "installpath") - elseif (${arg} STREQUAL "DOCTITLE") + elseif (arg STREQUAL "DOCTITLE") set(_state "doctitle") - elseif (${arg} STREQUAL "WINDOWTITLE") + elseif (arg STREQUAL "WINDOWTITLE") set(_state "windowtitle") - elseif (${arg} STREQUAL "AUTHOR") + elseif (arg STREQUAL "AUTHOR") set(_state "author") - elseif (${arg} STREQUAL "USE") + elseif (arg STREQUAL "USE") set(_state "use") - elseif (${arg} STREQUAL "VERSION") + elseif (arg STREQUAL "VERSION") set(_state "version") else () set(_javadoc_packages ${arg}) set(_state "packages") endif () - elseif (${_state} STREQUAL "packages") - if (${arg} STREQUAL "FILES") + elseif (_state STREQUAL "packages") + if (arg STREQUAL "FILES") set(_state "files") - elseif (${arg} STREQUAL "SOURCEPATH") + elseif (arg STREQUAL "SOURCEPATH") set(_state "sourcepath") - elseif (${arg} STREQUAL "OVERVIEW") + elseif (arg STREQUAL "OVERVIEW") set(_state "overview") - elseif (${arg} STREQUAL "CLASSPATH") + elseif (arg STREQUAL "CLASSPATH") set(_state "classpath") - elseif (${arg} STREQUAL "INSTALLPATH") + elseif (arg STREQUAL "INSTALLPATH") set(_state "installpath") - elseif (${arg} STREQUAL "DOCTITLE") + elseif (arg STREQUAL "DOCTITLE") set(_state "doctitle") - elseif (${arg} STREQUAL "WINDOWTITLE") + elseif (arg STREQUAL "WINDOWTITLE") set(_state "windowtitle") - elseif (${arg} STREQUAL "AUTHOR") + elseif (arg STREQUAL "AUTHOR") set(_state "author") - elseif (${arg} STREQUAL "USE") + elseif (arg STREQUAL "USE") set(_state "use") - elseif (${arg} STREQUAL "VERSION") + elseif (arg STREQUAL "VERSION") set(_state "version") else () list(APPEND _javadoc_packages ${arg}) endif () - elseif (${_state} STREQUAL "files") - if (${arg} STREQUAL "PACKAGES") + elseif (_state STREQUAL "files") + if (arg STREQUAL "PACKAGES") set(_state "packages") - elseif (${arg} STREQUAL "SOURCEPATH") + elseif (arg STREQUAL "SOURCEPATH") set(_state "sourcepath") - elseif (${arg} STREQUAL "OVERVIEW") + elseif (arg STREQUAL "OVERVIEW") set(_state "overview") - elseif (${arg} STREQUAL "CLASSPATH") + elseif (arg STREQUAL "CLASSPATH") set(_state "classpath") - elseif (${arg} STREQUAL "INSTALLPATH") + elseif (arg STREQUAL "INSTALLPATH") set(_state "installpath") - elseif (${arg} STREQUAL "DOCTITLE") + elseif (arg STREQUAL "DOCTITLE") set(_state "doctitle") - elseif (${arg} STREQUAL "WINDOWTITLE") + elseif (arg STREQUAL "WINDOWTITLE") set(_state "windowtitle") - elseif (${arg} STREQUAL "AUTHOR") + elseif (arg STREQUAL "AUTHOR") set(_state "author") - elseif (${arg} STREQUAL "USE") + elseif (arg STREQUAL "USE") set(_state "use") - elseif (${arg} STREQUAL "VERSION") + elseif (arg STREQUAL "VERSION") set(_state "version") else () list(APPEND _javadoc_files ${arg}) endif () - elseif (${_state} STREQUAL "sourcepath") - if (${arg} STREQUAL "PACKAGES") + elseif (_state STREQUAL "sourcepath") + if (arg STREQUAL "PACKAGES") set(_state "packages") - elseif (${arg} STREQUAL "FILES") + elseif (arg STREQUAL "FILES") set(_state "files") - elseif (${arg} STREQUAL "OVERVIEW") + elseif (arg STREQUAL "OVERVIEW") set(_state "overview") - elseif (${arg} STREQUAL "CLASSPATH") + elseif (arg STREQUAL "CLASSPATH") set(_state "classpath") - elseif (${arg} STREQUAL "INSTALLPATH") + elseif (arg STREQUAL "INSTALLPATH") set(_state "installpath") - elseif (${arg} STREQUAL "DOCTITLE") + elseif (arg STREQUAL "DOCTITLE") set(_state "doctitle") - elseif (${arg} STREQUAL "WINDOWTITLE") + elseif (arg STREQUAL "WINDOWTITLE") set(_state "windowtitle") - elseif (${arg} STREQUAL "AUTHOR") + elseif (arg STREQUAL "AUTHOR") set(_state "author") - elseif (${arg} STREQUAL "USE") + elseif (arg STREQUAL "USE") set(_state "use") - elseif (${arg} STREQUAL "VERSION") + elseif (arg STREQUAL "VERSION") set(_state "version") else () list(APPEND _javadoc_sourcepath ${arg}) endif () - elseif (${_state} STREQUAL "classpath") - if (${arg} STREQUAL "PACKAGES") + elseif (_state STREQUAL "classpath") + if (arg STREQUAL "PACKAGES") set(_state "packages") - elseif (${arg} STREQUAL "FILES") + elseif (arg STREQUAL "FILES") set(_state "files") - elseif (${arg} STREQUAL "SOURCEPATH") - set(_state "sourcepath") - elseif (${arg} STREQUAL "OVERVIEW") + elseif (arg STREQUAL "OVERVIEW") set(_state "overview") - elseif (${arg} STREQUAL "INSTALLPATH") + elseif (arg STREQUAL "SOURCEPATH") + set(_state "sourcepath") + elseif (arg STREQUAL "INSTALLPATH") set(_state "installpath") - elseif (${arg} STREQUAL "DOCTITLE") + elseif (arg STREQUAL "DOCTITLE") set(_state "doctitle") - elseif (${arg} STREQUAL "WINDOWTITLE") + elseif (arg STREQUAL "WINDOWTITLE") set(_state "windowtitle") - elseif (${arg} STREQUAL "AUTHOR") + elseif (arg STREQUAL "AUTHOR") set(_state "author") - elseif (${arg} STREQUAL "USE") + elseif (arg STREQUAL "USE") set(_state "use") - elseif (${arg} STREQUAL "VERSION") + elseif (arg STREQUAL "VERSION") set(_state "version") else () list(APPEND _javadoc_classpath ${arg}) endif () - elseif (${_state} STREQUAL "installpath") - if (${arg} STREQUAL "PACKAGES") + elseif (_state STREQUAL "installpath") + if (arg STREQUAL "PACKAGES") set(_state "packages") - elseif (${arg} STREQUAL "FILES") + elseif (arg STREQUAL "FILES") set(_state "files") - elseif (${arg} STREQUAL "SOURCEPATH") + elseif (arg STREQUAL "SOURCEPATH") set(_state "sourcepath") - elseif (${arg} STREQUAL "OVERVIEW") + elseif (arg STREQUAL "OVERVIEW") set(_state "overview") - elseif (${arg} STREQUAL "DOCTITLE") + elseif (arg STREQUAL "DOCTITLE") set(_state "doctitle") - elseif (${arg} STREQUAL "WINDOWTITLE") + elseif (arg STREQUAL "WINDOWTITLE") set(_state "windowtitle") - elseif (${arg} STREQUAL "AUTHOR") + elseif (arg STREQUAL "AUTHOR") set(_state "author") - elseif (${arg} STREQUAL "USE") + elseif (arg STREQUAL "USE") set(_state "use") - elseif (${arg} STREQUAL "VERSION") + elseif (arg STREQUAL "VERSION") set(_state "version") else () set(_javadoc_installpath ${arg}) endif () - elseif (${_state} STREQUAL "doctitle") + elseif (_state STREQUAL "doctitle") if (${arg} STREQUAL "PACKAGES") set(_state "packages") - elseif (${arg} STREQUAL "FILES") + elseif (arg STREQUAL "FILES") set(_state "files") - elseif (${arg} STREQUAL "SOURCEPATH") + elseif (arg STREQUAL "SOURCEPATH") set(_state "sourcepath") - elseif (${arg} STREQUAL "OVERVIEW") + elseif (arg STREQUAL "OVERVIEW") set(_state "overview") - elseif (${arg} STREQUAL "INSTALLPATH") + elseif (arg STREQUAL "INSTALLPATH") set(_state "installpath") - elseif (${arg} STREQUAL "CLASSPATH") + elseif (arg STREQUAL "CLASSPATH") set(_state "classpath") - elseif (${arg} STREQUAL "WINDOWTITLE") + elseif (arg STREQUAL "WINDOWTITLE") set(_state "windowtitle") - elseif (${arg} STREQUAL "AUTHOR") + elseif (arg STREQUAL "AUTHOR") set(_state "author") - elseif (${arg} STREQUAL "USE") + elseif (arg STREQUAL "USE") set(_state "use") - elseif (${arg} STREQUAL "VERSION") + elseif (arg STREQUAL "VERSION") set(_state "version") else () set(_javadoc_doctitle ${arg}) endif () - elseif (${_state} STREQUAL "windowtitle") + elseif (_state STREQUAL "windowtitle") if (${arg} STREQUAL "PACKAGES") set(_state "packages") - elseif (${arg} STREQUAL "FILES") + elseif (arg STREQUAL "FILES") set(_state "files") - elseif (${arg} STREQUAL "SOURCEPATH") + elseif (arg STREQUAL "SOURCEPATH") set(_state "sourcepath") - elseif (${arg} STREQUAL "OVERVIEW") + elseif (arg STREQUAL "OVERVIEW") set(_state "overview") - elseif (${arg} STREQUAL "CLASSPATH") + elseif (arg STREQUAL "CLASSPATH") set(_state "classpath") - elseif (${arg} STREQUAL "INSTALLPATH") + elseif (arg STREQUAL "INSTALLPATH") set(_state "installpath") - elseif (${arg} STREQUAL "DOCTITLE") + elseif (arg STREQUAL "DOCTITLE") set(_state "doctitle") - elseif (${arg} STREQUAL "AUTHOR") + elseif (arg STREQUAL "AUTHOR") set(_state "author") - elseif (${arg} STREQUAL "USE") + elseif (arg STREQUAL "USE") set(_state "use") - elseif (${arg} STREQUAL "VERSION") + elseif (arg STREQUAL "VERSION") set(_state "version") else () set(_javadoc_windowtitle ${arg}) endif () - elseif (${_state} STREQUAL "author") - if (${arg} STREQUAL "PACKAGES") + elseif (_state STREQUAL "author") + if (arg STREQUAL "PACKAGES") set(_state "packages") - elseif (${arg} STREQUAL "FILES") + elseif (arg STREQUAL "FILES") set(_state "files") - elseif (${arg} STREQUAL "SOURCEPATH") + elseif (arg STREQUAL "SOURCEPATH") set(_state "sourcepath") - elseif (${arg} STREQUAL "OVERVIEW") + elseif (arg STREQUAL "OVERVIEW") set(_state "overview") - elseif (${arg} STREQUAL "CLASSPATH") + elseif (arg STREQUAL "CLASSPATH") set(_state "classpath") - elseif (${arg} STREQUAL "INSTALLPATH") + elseif (arg STREQUAL "INSTALLPATH") set(_state "installpath") - elseif (${arg} STREQUAL "DOCTITLE") + elseif (arg STREQUAL "DOCTITLE") set(_state "doctitle") - elseif (${arg} STREQUAL "WINDOWTITLE") + elseif (arg STREQUAL "WINDOWTITLE") set(_state "windowtitle") - elseif (${arg} STREQUAL "AUTHOR") + elseif (arg STREQUAL "AUTHOR") set(_state "author") - elseif (${arg} STREQUAL "USE") + elseif (arg STREQUAL "USE") set(_state "use") - elseif (${arg} STREQUAL "VERSION") + elseif (arg STREQUAL "VERSION") set(_state "version") else () set(_javadoc_author ${arg}) endif () - elseif (${_state} STREQUAL "use") - if (${arg} STREQUAL "PACKAGES") + elseif (_state STREQUAL "use") + if (arg STREQUAL "PACKAGES") set(_state "packages") - elseif (${arg} STREQUAL "FILES") + elseif (arg STREQUAL "FILES") set(_state "files") - elseif (${arg} STREQUAL "SOURCEPATH") + elseif (arg STREQUAL "SOURCEPATH") set(_state "sourcepath") - elseif (${arg} STREQUAL "OVERVIEW") + elseif (arg STREQUAL "OVERVIEW") set(_state "overview") - elseif (${arg} STREQUAL "CLASSPATH") + elseif (arg STREQUAL "CLASSPATH") set(_state "classpath") - elseif (${arg} STREQUAL "INSTALLPATH") + elseif (arg STREQUAL "INSTALLPATH") set(_state "installpath") - elseif (${arg} STREQUAL "DOCTITLE") + elseif (arg STREQUAL "DOCTITLE") set(_state "doctitle") - elseif (${arg} STREQUAL "WINDOWTITLE") + elseif (arg STREQUAL "WINDOWTITLE") set(_state "windowtitle") - elseif (${arg} STREQUAL "AUTHOR") + elseif (arg STREQUAL "AUTHOR") set(_state "author") - elseif (${arg} STREQUAL "USE") + elseif (arg STREQUAL "USE") set(_state "use") - elseif (${arg} STREQUAL "VERSION") + elseif (arg STREQUAL "VERSION") set(_state "version") else () set(_javadoc_use ${arg}) endif () - elseif (${_state} STREQUAL "version") - if (${arg} STREQUAL "PACKAGES") + elseif (_state STREQUAL "version") + if (arg STREQUAL "PACKAGES") set(_state "packages") - elseif (${arg} STREQUAL "FILES") + elseif (arg STREQUAL "FILES") set(_state "files") - elseif (${arg} STREQUAL "SOURCEPATH") + elseif (arg STREQUAL "SOURCEPATH") set(_state "sourcepath") - elseif (${arg} STREQUAL "OVERVIEW") + elseif (arg STREQUAL "OVERVIEW") set(_state "overview") - elseif (${arg} STREQUAL "CLASSPATH") + elseif (arg STREQUAL "CLASSPATH") set(_state "classpath") - elseif (${arg} STREQUAL "INSTALLPATH") + elseif (arg STREQUAL "INSTALLPATH") set(_state "installpath") - elseif (${arg} STREQUAL "DOCTITLE") + elseif (arg STREQUAL "DOCTITLE") set(_state "doctitle") - elseif (${arg} STREQUAL "WINDOWTITLE") + elseif (arg STREQUAL "WINDOWTITLE") set(_state "windowtitle") - elseif (${arg} STREQUAL "AUTHOR") + elseif (arg STREQUAL "AUTHOR") set(_state "author") - elseif (${arg} STREQUAL "USE") + elseif (arg STREQUAL "USE") set(_state "use") - elseif (${arg} STREQUAL "VERSION") + elseif (arg STREQUAL "VERSION") set(_state "version") else () set(_javadoc_version ${arg}) endif () - elseif (${_state} STREQUAL "overview") - if (${arg} STREQUAL "PACKAGES") + elseif (_state STREQUAL "overview") + if (arg STREQUAL "PACKAGES") set(_state "packages") - elseif (${arg} STREQUAL "FILES") + elseif (arg STREQUAL "FILES") set(_state "files") - elseif (${arg} STREQUAL "SOURCEPATH") + elseif (arg STREQUAL "SOURCEPATH") set(_state "sourcepath") - elseif (${arg} STREQUAL "CLASSPATH") + elseif (arg STREQUAL "CLASSPATH") set(_state "classpath") - elseif (${arg} STREQUAL "INSTALLPATH") + elseif (arg STREQUAL "INSTALLPATH") set(_state "installpath") - elseif (${arg} STREQUAL "DOCTITLE") + elseif (arg STREQUAL "DOCTITLE") set(_state "doctitle") - elseif (${arg} STREQUAL "WINDOWTITLE") + elseif (arg STREQUAL "WINDOWTITLE") set(_state "windowtitle") - elseif (${arg} STREQUAL "AUTHOR") + elseif (arg STREQUAL "AUTHOR") set(_state "author") - elseif (${arg} STREQUAL "USE") + elseif (arg STREQUAL "USE") set(_state "use") - elseif (${arg} STREQUAL "VERSION") + elseif (arg STREQUAL "VERSION") set(_state "version") else () - list(APPEND _javadoc_overview ${arg}) + set(_javadoc_overview ${arg}) endif () endif () endforeach () @@ -1302,7 +1239,7 @@ function(create_javadoc _target) if (_javadoc_sourcepath) set(_start TRUE) - foreach(_path ${_javadoc_sourcepath}) + foreach(_path IN LISTS _javadoc_sourcepath) if (_start) set(_sourcepath ${_path}) set(_start FALSE) @@ -1315,7 +1252,7 @@ function(create_javadoc _target) if (_javadoc_overview) set(_start TRUE) - foreach(_path ${_javadoc_overview}) + foreach(_path IN LISTS _javadoc_overview) if (_start) set(_overview ${_path}) set(_start FALSE) @@ -1328,7 +1265,7 @@ function(create_javadoc _target) if (_javadoc_classpath) set(_start TRUE) - foreach(_path ${_javadoc_classpath}) + foreach(_path IN LISTS _javadoc_classpath) if (_start) set(_classpath ${_path}) set(_start FALSE) @@ -1495,7 +1432,7 @@ function(export_jars) # Set content of generated exports file string(REPLACE ";" " " __targets__ "${_export_jars_TARGETS}") set(__targetdefs__ "") - foreach(_target ${_export_jars_TARGETS}) + foreach(_target IN LISTS _export_jars_TARGETS) get_target_property(_jarpath ${_target} JAR_FILE) get_filename_component(_jarpath ${_jarpath} PATH) __java_export_jar(__targetdefs__ ${_target} "${_jarpath}") @@ -1533,7 +1470,7 @@ function(install_jar_exports) endif() # Determine relative path from installed export file to install prefix - if(IS_ABSOLUTE ${_install_jar_exports_DESTINATION}) + if(IS_ABSOLUTE "${_install_jar_exports_DESTINATION}") file(RELATIVE_PATH _relpath ${_install_jar_exports_DESTINATION} ${CMAKE_INSTALL_PREFIX} @@ -1552,7 +1489,7 @@ function(install_jar_exports) # Set content of generated exports file string(REPLACE ";" " " __targets__ "${_install_jar_exports_TARGETS}") set(__targetdefs__ "set(_prefix \${CMAKE_CURRENT_LIST_DIR}/${_relpath})\n\n") - foreach(_target ${_install_jar_exports_TARGETS}) + foreach(_target IN LISTS _install_jar_exports_TARGETS) get_target_property(_dir ${_target} INSTALL_DESTINATION) __java_export_jar(__targetdefs__ ${_target} "\${_prefix}/${_dir}") endforeach() diff --git a/config/cmake/UseJavaClassFilelist.cmake b/config/cmake/UseJavaClassFilelist.cmake index 4420550..b98276f 100644 --- a/config/cmake/UseJavaClassFilelist.cmake +++ b/config/cmake/UseJavaClassFilelist.cmake @@ -1,16 +1,17 @@ # Distributed under the OSI-approved BSD 3-Clause License. See https://cmake.org/licensing for details. -#.rst: -# UseJavaClassFilelist -# -------------------- -# -# -# -# -# -# This script create a list of compiled Java class files to be added to -# a jar file. This avoids including cmake files which get created in -# the binary directory. +#[=======================================================================[.rst: +UseJavaClassFilelist +-------------------- + + + + + +This script create a list of compiled Java class files to be added to +a jar file. This avoids including cmake files which get created in +the binary directory. +#]=======================================================================] if (CMAKE_JAVA_CLASS_OUTPUT_PATH) if (EXISTS "${CMAKE_JAVA_CLASS_OUTPUT_PATH}") diff --git a/config/cmake/UseJavaSymlinks.cmake b/config/cmake/UseJavaSymlinks.cmake index cd73348..a4db5c1 100644 --- a/config/cmake/UseJavaSymlinks.cmake +++ b/config/cmake/UseJavaSymlinks.cmake @@ -1,14 +1,15 @@ # Distributed under the OSI-approved BSD 3-Clause License. See https://cmake.org/licensing for details. -#.rst: -# UseJavaSymlinks -# --------------- -# -# -# -# -# -# Helper script for UseJava.cmake +#[=======================================================================[.rst: +UseJavaSymlinks +--------------- + + + + + +Helper script for UseJava.cmake +#]=======================================================================] if (UNIX AND _JAVA_TARGET_OUTPUT_LINK) if (_JAVA_TARGET_OUTPUT_NAME) diff --git a/config/cmake/cacheinit.cmake b/config/cmake/cacheinit.cmake index d5c5e52..5254115 100644 --- a/config/cmake/cacheinit.cmake +++ b/config/cmake/cacheinit.cmake @@ -19,6 +19,8 @@ set (CMAKE_INSTALL_FRAMEWORK_PREFIX "Library/Frameworks" CACHE STRING "Framework set (HDF_PACKAGE_EXT "" CACHE STRING "Name of HDF package extension" FORCE) +set (HDF_PACKAGE_NAMESPACE "hdf5::" CACHE STRING "Name for HDF package namespace (can be empty)" FORCE) + set (HDF5_BUILD_FORTRAN ON CACHE BOOL "Build FORTRAN support" FORCE) set (HDF5_BUILD_GENERATORS ON CACHE BOOL "Build Test Generators" FORCE) diff --git a/config/cmake/hdf5-config-version.cmake.in b/config/cmake/hdf5-config-version.cmake.in index 8e16725..575c1ab 100644 --- a/config/cmake/hdf5-config-version.cmake.in +++ b/config/cmake/hdf5-config-version.cmake.in @@ -21,38 +21,38 @@ set (PACKAGE_VERSION "@HDF5_VERSION_STRING@") -if("${PACKAGE_VERSION}" VERSION_LESS "${PACKAGE_FIND_VERSION}" ) +if(PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION) set(PACKAGE_VERSION_COMPATIBLE FALSE) -else () - if ("${PACKAGE_FIND_VERSION_MAJOR}" STREQUAL "@H5_VERS_MAJOR@") +else() + if("@H5_VERS_MAJOR@.@H5_VERS_MINOR@" MATCHES "^([0-9]+)\\.([0-9]+)") + set(CVF_VERSION_MAJOR "${CMAKE_MATCH_1}") + set(CVF_VERSION_MINOR "${CMAKE_MATCH_2}") + else() + set(CVF_VERSION_MAJOR "@HDF5_VERSION_STRING@") + set(CVF_VERSION_MINOR "") + endif() + + if((PACKAGE_FIND_VERSION_MAJOR STREQUAL CVF_VERSION_MAJOR) AND + (PACKAGE_FIND_VERSION_MINOR STREQUAL CVF_VERSION_MINOR)) + set(PACKAGE_VERSION_COMPATIBLE TRUE) + else() + set(PACKAGE_VERSION_COMPATIBLE FALSE) + endif() + + if(PACKAGE_FIND_VERSION STREQUAL PACKAGE_VERSION) + set(PACKAGE_VERSION_EXACT TRUE) + endif() +endif() - # exact match for version @H5_VERS_MAJOR@.@H5_VERS_MINOR@ - if ("${PACKAGE_FIND_VERSION_MINOR}" STREQUAL "@H5_VERS_MINOR@") - - # compatible with any version @H5_VERS_MAJOR@.@H5_VERS_MINOR@.x - set (PACKAGE_VERSION_COMPATIBLE TRUE) - - if ("${PACKAGE_FIND_VERSION_PATCH}" STREQUAL "@H5_VERS_RELEASE@") - set (PACKAGE_VERSION_EXACT TRUE) - - if ("${PACKAGE_FIND_VERSION_TWEAK}" STREQUAL "@H5_VERS_SUBRELEASE@") - # not using this yet - endif () - endif () - else () - set (PACKAGE_VERSION_COMPATIBLE FALSE) - endif () - endif () -endif () # if the installed or the using project don't have CMAKE_SIZEOF_VOID_P set, ignore it: -if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "" OR "@CMAKE_SIZEOF_VOID_P@" STREQUAL "") +if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "" OR "@CMAKE_SIZEOF_VOID_P@" STREQUAL "") return() -endif () +endif() # check that the installed version has the same 32/64bit-ness as the one which is currently searching: -if(NOT "${CMAKE_SIZEOF_VOID_P}" STREQUAL "@CMAKE_SIZEOF_VOID_P@") +if(NOT CMAKE_SIZEOF_VOID_P STREQUAL "@CMAKE_SIZEOF_VOID_P@") math(EXPR installedBits "@CMAKE_SIZEOF_VOID_P@ * 8") set(PACKAGE_VERSION "${PACKAGE_VERSION} (${installedBits}bit)") set(PACKAGE_VERSION_UNSUITABLE TRUE) -endif () +endif() diff --git a/config/cmake/hdf5-config.cmake.in b/config/cmake/hdf5-config.cmake.in index e687a58..1803117 100644 --- a/config/cmake/hdf5-config.cmake.in +++ b/config/cmake/hdf5-config.cmake.in @@ -38,13 +38,17 @@ set (${HDF5_PACKAGE_NAME}_BUILD_CPP_LIB @HDF5_BUILD_CPP_LIB@) set (${HDF5_PACKAGE_NAME}_BUILD_JAVA @HDF5_BUILD_JAVA@) set (${HDF5_PACKAGE_NAME}_BUILD_TOOLS @HDF5_BUILD_TOOLS@) set (${HDF5_PACKAGE_NAME}_BUILD_HL_LIB @HDF5_BUILD_HL_LIB@) +set (${HDF5_PACKAGE_NAME}_ENABLE_THREADSAFE @HDF5_ENABLE_THREADSAFE@) set (${HDF5_PACKAGE_NAME}_ENABLE_Z_LIB_SUPPORT @HDF5_ENABLE_Z_LIB_SUPPORT@) set (${HDF5_PACKAGE_NAME}_ENABLE_SZIP_SUPPORT @HDF5_ENABLE_SZIP_SUPPORT@) set (${HDF5_PACKAGE_NAME}_ENABLE_SZIP_ENCODING @HDF5_ENABLE_SZIP_ENCODING@) -set (${HDF5_PACKAGE_NAME}_BUILD_SHARED_LIBS @BUILD_SHARED_LIBS@) +set (${HDF5_PACKAGE_NAME}_BUILD_SHARED_LIBS @H5_ENABLE_SHARED_LIB@) +set (${HDF5_PACKAGE_NAME}_BUILD_STATIC_LIBS @H5_ENABLE_STATIC_LIB@) set (${HDF5_PACKAGE_NAME}_PACKAGE_EXTLIBS @HDF5_PACKAGE_EXTLIBS@) set (${HDF5_PACKAGE_NAME}_EXPORT_LIBRARIES @HDF5_LIBRARIES_TO_EXPORT@) set (${HDF5_PACKAGE_NAME}_TOOLSET "@CMAKE_GENERATOR_TOOLSET@") +set (${HDF5_PACKAGE_NAME}_DEFAULT_API_VERSION "@DEFAULT_API_VERSION@") +set (${HDF5_PACKAGE_NAME}_PARALLEL_FILTERED_WRITES "@PARALLEL_FILTERED_WRITES@") #----------------------------------------------------------------------------- # Dependencies @@ -105,10 +109,10 @@ set (HDF5_VERSION_MINOR @HDF5_VERSION_MINOR@) # project which has already built hdf5 as a subproject #----------------------------------------------------------------------------- if (NOT TARGET "@HDF5_PACKAGE@") - if (${HDF5_PACKAGE_NAME}_ENABLE_Z_LIB_SUPPORT AND ${HDF5_PACKAGE_NAME}_PACKAGE_EXTLIBS AND NOT TARGET "zlib") + if (${HDF5_PACKAGE_NAME}_ENABLE_Z_LIB_SUPPORT AND ${HDF5_PACKAGE_NAME}_PACKAGE_EXTLIBS) include (@PACKAGE_SHARE_INSTALL_DIR@/@ZLIB_PACKAGE_NAME@/@ZLIB_PACKAGE_NAME@@HDF_PACKAGE_EXT@-targets.cmake) endif () - if (${HDF5_PACKAGE_NAME}_ENABLE_SZIP_SUPPORT AND ${HDF5_PACKAGE_NAME}_PACKAGE_EXTLIBS AND NOT TARGET "szip") + if (${HDF5_PACKAGE_NAME}_ENABLE_SZIP_SUPPORT AND ${HDF5_PACKAGE_NAME}_PACKAGE_EXTLIBS) include (@PACKAGE_SHARE_INSTALL_DIR@/@SZIP_PACKAGE_NAME@/@SZIP_PACKAGE_NAME@@HDF_PACKAGE_EXT@-targets.cmake) endif () include (@PACKAGE_SHARE_INSTALL_DIR@/@HDF5_PACKAGE@/@HDF5_PACKAGE@@HDF_PACKAGE_EXT@-targets.cmake) @@ -116,22 +120,28 @@ endif () # Handle default component(static) : if (NOT ${HDF5_PACKAGE_NAME}_FIND_COMPONENTS) + if (${HDF5_PACKAGE_NAME}_BUILD_STATIC_LIBS) set (${HDF5_PACKAGE_NAME}_LIB_TYPE) set (${HDF5_PACKAGE_NAME}_FIND_COMPONENTS C HL static) set (${HDF5_PACKAGE_NAME}_FIND_REQUIRED_static_C true) + else () + set (${HDF5_PACKAGE_NAME}_LIB_TYPE) + set (${HDF5_PACKAGE_NAME}_FIND_COMPONENTS C HL shared) + set (${HDF5_PACKAGE_NAME}_FIND_REQUIRED_shared_C true) + endif () endif () # Handle requested components: list (REMOVE_DUPLICATES ${HDF5_PACKAGE_NAME}_FIND_COMPONENTS) foreach (comp IN LISTS ${HDF5_PACKAGE_NAME}_FIND_COMPONENTS) - if (${comp} STREQUAL "shared") + if (comp STREQUAL "shared") list (REMOVE_ITEM ${HDF5_PACKAGE_NAME}_FIND_COMPONENTS ${comp}) set (${HDF5_PACKAGE_NAME}_LIB_TYPE ${${HDF5_PACKAGE_NAME}_LIB_TYPE} ${comp}) if (${HDF5_PACKAGE_NAME}_BUILD_FORTRAN) set (${HDF5_PACKAGE_NAME}_INCLUDE_DIR_FORTRAN "@PACKAGE_INCLUDE_INSTALL_DIR@/shared") endif () - elseif (${comp} STREQUAL "static") + elseif (comp STREQUAL "static") list (REMOVE_ITEM ${HDF5_PACKAGE_NAME}_FIND_COMPONENTS ${comp}) set (${HDF5_PACKAGE_NAME}_LIB_TYPE ${${HDF5_PACKAGE_NAME}_LIB_TYPE} ${comp}) @@ -143,32 +153,32 @@ endforeach () foreach (libtype IN LISTS ${HDF5_PACKAGE_NAME}_LIB_TYPE) foreach (comp IN LISTS ${HDF5_PACKAGE_NAME}_FIND_COMPONENTS) set (hdf5_comp2) - if (${comp} STREQUAL "C") + if (comp STREQUAL "C") set (hdf5_comp "hdf5") - elseif (${comp} STREQUAL "CXX") + elseif (comp STREQUAL "CXX") set (hdf5_comp "hdf5_cpp") - elseif (${comp} STREQUAL "HL") + elseif (comp STREQUAL "HL") set (hdf5_comp "hdf5_hl") - elseif (${comp} STREQUAL "CXX_HL") + elseif (comp STREQUAL "CXX_HL") set (hdf5_comp "hdf5_hl_cpp") - elseif (${comp} STREQUAL "Java") + elseif (comp STREQUAL "Java") set (hdf5_comp "hdf5_java") - elseif (${comp} STREQUAL "Tools") + elseif (comp STREQUAL "Tools") set (hdf5_comp "hdf5_tools") - elseif (${comp} STREQUAL "Fortran") + elseif (comp STREQUAL "Fortran") set (hdf5_comp2 "hdf5_f90cstub") set (hdf5_comp "hdf5_fortran") - elseif (${comp} STREQUAL "Fortran_HL") + elseif (comp STREQUAL "Fortran_HL") set (hdf5_comp2 "hdf5_hl_f90cstub") set (hdf5_comp "hdf5_hl_fortran") endif () - if (${comp} STREQUAL "Java") + if (comp STREQUAL "Java") list (FIND ${HDF5_PACKAGE_NAME}_EXPORT_LIBRARIES "${hdf5_comp}" HAVE_COMP) else () list (FIND ${HDF5_PACKAGE_NAME}_EXPORT_LIBRARIES "${hdf5_comp}-${libtype}" HAVE_COMP) endif () if (${HAVE_COMP} LESS 0) - if (${comp} STREQUAL "Java") + if (comp STREQUAL "Java") set (${HDF5_PACKAGE_NAME}_${comp}_FOUND 0) else () set (${HDF5_PACKAGE_NAME}_${libtype}_${comp}_FOUND 0) @@ -183,7 +193,7 @@ foreach (libtype IN LISTS ${HDF5_PACKAGE_NAME}_LIB_TYPE) string(TOUPPER ${HDF5_PACKAGE_NAME}_${comp}_${libtype}_LIBRARY COMP_LIBRARY) set (${COMP_LIBRARY} ${${COMP_LIBRARY}} @HDF5_PACKAGE@::${hdf5_comp2}-${libtype} @HDF5_PACKAGE@::${hdf5_comp}-${libtype}) endif () - elseif (${comp} STREQUAL "Java") + elseif (comp STREQUAL "Java") set (${HDF5_PACKAGE_NAME}_${comp}_FOUND 1) string(TOUPPER ${HDF5_PACKAGE_NAME}_${comp}_LIBRARY COMP_LIBRARY) set (${COMP_LIBRARY} ${${COMP_LIBRARY}} hdf5::${hdf5_comp}) diff --git a/config/cmake/jrunTest.cmake b/config/cmake/jrunTest.cmake index 23f297c..44ac15b 100644 --- a/config/cmake/jrunTest.cmake +++ b/config/cmake/jrunTest.cmake @@ -9,7 +9,7 @@ # If you do not have access to either file, you may request a copy from # help@hdfgroup.org. # -# runTest.cmake executes a command and captures the output in a file. File is then compared +# jrunTest.cmake executes a command and captures the output in a file. File is then compared # against a reference file. Exit status of command can also be compared. cmake_policy(SET CMP0007 NEW) @@ -24,7 +24,7 @@ if (NOT TEST_LIBRARY_DIRECTORY) message (STATUS "Require TEST_LIBRARY_DIRECTORY to be defined") endif () if (NOT TEST_FOLDER) - message ( FATAL_ERROR "Require TEST_FOLDER to be defined") + message (FATAL_ERROR "Require TEST_FOLDER to be defined") endif () if (NOT TEST_OUTPUT) message (FATAL_ERROR "Require TEST_OUTPUT to be defined") @@ -51,6 +51,8 @@ message (STATUS "COMMAND: ${TEST_TESTER} -Xmx1024M -Dorg.slf4j.simpleLogger.defa if (WIN32 AND NOT MINGW) set (ENV{PATH} "$ENV{PATH}\\;${TEST_LIBRARY_DIRECTORY}") +else () + set (ENV{LD_LIBRARY_PATH} "$ENV{LD_LIBRARY_PATH}:${TEST_LIBRARY_DIRECTORY}") endif () # run the test program, capture the stdout/stderr and the result var @@ -64,6 +66,7 @@ execute_process ( RESULT_VARIABLE TEST_RESULT OUTPUT_FILE ${TEST_OUTPUT} ERROR_FILE ${TEST_OUTPUT}.err + OUTPUT_VARIABLE TEST_OUT ERROR_VARIABLE TEST_ERROR ) @@ -126,11 +129,22 @@ if (NOT TEST_SKIP_COMPARE) file (WRITE ${TEST_FOLDER}/${TEST_REFERENCE} "${TEST_STREAM}") endif () - # now compare the output with the reference - execute_process ( - COMMAND ${CMAKE_COMMAND} -E compare_files ${TEST_FOLDER}/${TEST_OUTPUT} ${TEST_FOLDER}/${TEST_REFERENCE} - RESULT_VARIABLE TEST_RESULT - ) + if (NOT TEST_SORT_COMPARE) + # now compare the output with the reference + execute_process ( + COMMAND ${CMAKE_COMMAND} -E compare_files ${TEST_FOLDER}/${TEST_OUTPUT} ${TEST_FOLDER}/${TEST_REFERENCE} + RESULT_VARIABLE TEST_RESULT + ) + else () + file (STRINGS ${TEST_FOLDER}/${TEST_OUTPUT} v1) + file (STRINGS ${TEST_FOLDER}/${TEST_REFERENCE} v2) + list (SORT v1) + list (SORT v2) + if (NOT v1 STREQUAL v2) + set(TEST_RESULT 1) + endif () + endif () + if (TEST_RESULT) set (TEST_RESULT 0) file (STRINGS ${TEST_FOLDER}/${TEST_OUTPUT} test_act) @@ -142,10 +156,10 @@ if (NOT TEST_SKIP_COMPARE) foreach (line RANGE 0 ${_FP_LEN}) list (GET test_act ${line} str_act) list (GET test_ref ${line} str_ref) - if (NOT ${str_act} STREQUAL ${str_ref}) - if (NOT str_act STREQUAL "") + if (NOT str_act STREQUAL str_ref) + if (str_act) set (TEST_RESULT 1) - message ("line = ${line}\n***ACTUAL: ${str_act}\n****REFER: ${str_ref}\n") + message (STATUS "line = ${line}\n***ACTUAL: ${str_act}\n****REFER: ${str_ref}\n") endif () endif () endforeach () @@ -194,10 +208,10 @@ if (NOT TEST_SKIP_COMPARE) foreach (line RANGE 0 ${_FP_LEN}) list (GET test_act ${line} str_act) list (GET test_ref ${line} str_ref) - if (NOT ${str_act} STREQUAL ${str_ref}) - if (NOT ${str_act} STREQUAL "") + if (NOT str_act STREQUAL str_ref) + if (str_act) set (TEST_RESULT 1) - message ("line = ${line}\n***ACTUAL: ${str_act}\n****REFER: ${str_ref}\n") + message (STATUS "line = ${line}\n***ACTUAL: ${str_act}\n****REFER: ${str_ref}\n") endif () endif () endforeach () @@ -245,5 +259,5 @@ if (TEST_GREP_COMPARE) endif () # everything went fine... -message ("${TEST_PROGRAM} Passed") +message (STATUS "${TEST_PROGRAM} Passed") diff --git a/config/cmake/libhdf5.settings.cmake.in b/config/cmake/libhdf5.settings.cmake.in index 9a534df..9e91ac0 100644 --- a/config/cmake/libhdf5.settings.cmake.in +++ b/config/cmake/libhdf5.settings.cmake.in @@ -32,7 +32,7 @@ Linking Options: Languages: ---------- - C: yes + C: YES C Compiler: @CMAKE_C_COMPILER@ @CMAKE_C_COMPILER_VERSION@ CPPFLAGS: @CPPFLAGS@ H5_CPPFLAGS: @H5_CPPFLAGS@ @@ -41,7 +41,7 @@ Languages: H5_CFLAGS: @H5_CFLAGS@ AM_CFLAGS: @AM_CFLAGS@ Shared C Library: @H5_ENABLE_SHARED_LIB@ - Static C Library: YES + Static C Library: @H5_ENABLE_STATIC_LIB@ Fortran: @HDF5_BUILD_FORTRAN@ @BUILD_FORTRAN_CONDITIONAL_TRUE@ Fortran Compiler: @CMAKE_Fortran_COMPILER@ @CMAKE_Fortran_COMPILER_VERSION@ @@ -49,7 +49,7 @@ Languages: @BUILD_FORTRAN_CONDITIONAL_TRUE@ H5 Fortran Flags: @H5_FCFLAGS@ @BUILD_FORTRAN_CONDITIONAL_TRUE@ AM Fortran Flags: @AM_FCFLAGS@ @BUILD_FORTRAN_CONDITIONAL_TRUE@ Shared Fortran Library: @H5_ENABLE_SHARED_LIB@ -@BUILD_FORTRAN_CONDITIONAL_TRUE@ Static Fortran Library: YES +@BUILD_FORTRAN_CONDITIONAL_TRUE@ Static Fortran Library: @H5_ENABLE_STATIC_LIB@ C++: @HDF5_BUILD_CPP_LIB@ @BUILD_CXX_CONDITIONAL_TRUE@ C++ Compiler: @CMAKE_CXX_COMPILER@ @CMAKE_CXX_COMPILER_VERSION@ @@ -57,10 +57,10 @@ Languages: @BUILD_CXX_CONDITIONAL_TRUE@ H5 C++ Flags: @H5_CXXFLAGS@ @BUILD_CXX_CONDITIONAL_TRUE@ AM C++ Flags: @AM_CXXFLAGS@ @BUILD_CXX_CONDITIONAL_TRUE@ Shared C++ Library: @H5_ENABLE_SHARED_LIB@ -@BUILD_CXX_CONDITIONAL_TRUE@ Static C++ Library: YES +@BUILD_CXX_CONDITIONAL_TRUE@ Static C++ Library: @H5_ENABLE_STATIC_LIB@ JAVA: @HDF5_BUILD_JAVA@ -@BUILD_JAVA_CONDITIONAL_TRUE@ JAVA Compiler: @CMAKE_Java_COMPILER@ @Java_VERSION@ +@BUILD_JAVA_CONDITIONAL_TRUE@ JAVA Compiler: @CMAKE_Java_COMPILER@ @Java_VERSION@ Features: --------- diff --git a/config/cmake/mccacheinit.cmake b/config/cmake/mccacheinit.cmake index 577144b..c35f51f 100644 --- a/config/cmake/mccacheinit.cmake +++ b/config/cmake/mccacheinit.cmake @@ -23,6 +23,8 @@ set (BUILD_TESTING ON CACHE BOOL "Build HDF5 Unit Testing" FORCE) set (HDF_PACKAGE_EXT "" CACHE STRING "Name of HDF package extension" FORCE) +set (HDF_PACKAGE_NAMESPACE "hdf5::" CACHE STRING "Name for HDF package namespace" FORCE) + set (HDF5_BUILD_CPP_LIB ON CACHE BOOL "Build HDF5 C++ Library" FORCE) set (HDF5_BUILD_EXAMPLES ON CACHE BOOL "Build HDF5 Library Examples" FORCE) diff --git a/config/cmake/scripts/CTestScript.cmake b/config/cmake/scripts/CTestScript.cmake index 0e2afc7..e1fe85a 100644 --- a/config/cmake/scripts/CTestScript.cmake +++ b/config/cmake/scripts/CTestScript.cmake @@ -257,7 +257,7 @@ message (STATUS "Dashboard script configuration:\n${vars}\n") # On Cray XC40, configuring fails in the Fortran section when using the craype-mic-knl module. # When the configure phase is done with the craype-haswell module and the build phase is done # with the craype-mic-knl module, configure succeeds and tests pass on the knl compute nodes - # for Intel, Cray, GCC and Clang compilers. If the variables aren't set or if not + # for Intel, Cray, GCC and Clang compilers. If the variables aren't set or if not # cross compiling, the module switch will not occur. if (CMAKE_CROSSCOMPILING AND COMPILENODE_HWCOMPILE_MODULE AND COMPUTENODE_HWCOMPILE_MODULE) execute_process (COMMAND module switch ${COMPILENODE_HWCOMPILE_MODULE} ${COMPUTENODE_HWCOMPILE_MODULE}) @@ -277,11 +277,15 @@ message (STATUS "Dashboard script configuration:\n${vars}\n") ctest_test (BUILD "${CTEST_BINARY_DIRECTORY}" APPEND ${ctest_test_args} RETURN_VALUE res) else () file(STRINGS ${CTEST_BINARY_DIRECTORY}/Testing/TAG TAG_CONTENTS REGEX "^2([0-9]+)[-]([0-9]+)$") - if ("${LOCAL_BATCH_SCRIPT_COMMAND}" STREQUAL "raybsub") + if (LOCAL_BATCH_SCRIPT_COMMAND STREQUAL "raybsub") execute_process (COMMAND ${CTEST_BINARY_DIRECTORY}/${LOCAL_BATCH_SCRIPT_COMMAND} ${LOCAL_BATCH_SCRIPT_ARGS} ${CTEST_BINARY_DIRECTORY}/${LOCAL_BATCH_SCRIPT_NAME}) else () - execute_process (COMMAND ${LOCAL_BATCH_SCRIPT_COMMAND} ${LOCAL_BATCH_SCRIPT_ARGS} ${CTEST_BINARY_DIRECTORY}/${LOCAL_BATCH_SCRIPT_NAME}) - endif () + if (LOCAL_BATCH_SCRIPT_COMMAND STREQUAL "qsub") + execute_process (COMMAND ${CTEST_BINARY_DIRECTORY}/${LOCAL_BATCH_SCRIPT_NAME} ctestS.out) + else () + execute_process (COMMAND ${LOCAL_BATCH_SCRIPT_COMMAND} ${LOCAL_BATCH_SCRIPT_ARGS} ${CTEST_BINARY_DIRECTORY}/${LOCAL_BATCH_SCRIPT_NAME}) + endif() + endif () message(STATUS "Check for existence of ${CTEST_BINARY_DIRECTORY}/Testing/${TAG_CONTENTS}/Test.xml") execute_process(COMMAND ls ${CTEST_BINARY_DIRECTORY}/Testing/${TAG_CONTENTS}/Test.xml RESULT_VARIABLE result OUTPUT_QUIET ERROR_QUIET) while(result) @@ -296,10 +300,14 @@ message (STATUS "Dashboard script configuration:\n${vars}\n") file (RENAME ${CTEST_BINARY_DIRECTORY}/Testing/${TAG_CONTENTS}/Test.xml ${CTEST_BINARY_DIRECTORY}/Testing/${TAG_CONTENTS}/SerialTest.xml) file (RENAME ${CTEST_BINARY_DIRECTORY}/Testing/Temporary/LastTest_${TAG_CONTENTS}.log ${CTEST_BINARY_DIRECTORY}/Testing/Temporary/LastTest_${TAG_CONTENTS}_Serial.log) unset(result CACHE) - if ("${LOCAL_BATCH_SCRIPT_COMMAND}" STREQUAL "raybsub") + if (LOCAL_BATCH_SCRIPT_COMMAND STREQUAL "raybsub") execute_process (COMMAND ${CTEST_BINARY_DIRECTORY}/${LOCAL_BATCH_SCRIPT_COMMAND} ${LOCAL_BATCH_SCRIPT_ARGS} ${CTEST_BINARY_DIRECTORY}/${LOCAL_BATCH_SCRIPT_PARALLEL_NAME}) else () - execute_process (COMMAND ${LOCAL_BATCH_SCRIPT_COMMAND} ${LOCAL_BATCH_SCRIPT_ARGS} ${CTEST_BINARY_DIRECTORY}/${LOCAL_BATCH_SCRIPT_PARALLEL_NAME}) + if (LOCAL_BATCH_SCRIPT_COMMAND STREQUAL "qsub") + execute_process (COMMAND ${CTEST_BINARY_DIRECTORY}/${LOCAL_BATCH_SCRIPT_NAME} ctestP.out) + else () + execute_process (COMMAND ${LOCAL_BATCH_SCRIPT_COMMAND} ${LOCAL_BATCH_SCRIPT_ARGS} ${CTEST_BINARY_DIRECTORY}/${LOCAL_BATCH_SCRIPT_PARALLEL_NAME}) + endif () endif () message(STATUS "Check for existence of ${CTEST_BINARY_DIRECTORY}/Testing/${TAG_CONTENTS}/Test.xml") execute_process(COMMAND ls ${CTEST_BINARY_DIRECTORY}/Testing/${TAG_CONTENTS}/Test.xml RESULT_VARIABLE result OUTPUT_QUIET ERROR_QUIET) diff --git a/config/cmake/scripts/HDF5config.cmake b/config/cmake/scripts/HDF5config.cmake index 1d8d501..44ed531 100644 --- a/config/cmake/scripts/HDF5config.cmake +++ b/config/cmake/scripts/HDF5config.cmake @@ -34,7 +34,7 @@ cmake_minimum_required (VERSION 3.10) # CTEST_SOURCE_NAME - source folder ############################################################################## -set (CTEST_SOURCE_VERSION "1.11.4") +set (CTEST_SOURCE_VERSION "1.11.6") set (CTEST_SOURCE_VERSEXT "") ############################################################################## @@ -44,6 +44,8 @@ set (CTEST_SOURCE_VERSEXT "") #CTEST_CONFIGURATION_TYPE - Release, Debug, RelWithDebInfo #CTEST_SOURCE_NAME - name of source folder; HDF5-1.10.0 #MODEL - CDash group name +#HPC - run alternate configurations for HPC machines; sbatch, bsub, raybsub, qsub +#MPI - enable MPI; if (DEFINED CTEST_SCRIPT_ARG) # transform ctest script arguments of the form # script.ctest,var1=value1,var2=value2 @@ -56,6 +58,11 @@ if (DEFINED CTEST_SCRIPT_ARG) endforeach () endif () +#HPC - run alternate configurations for HPC machines +if (DEFINED HPC) + set (BUILD_GENERATOR "Unix") +endif () + # build generator must be defined if (NOT DEFINED BUILD_GENERATOR) message (FATAL_ERROR "BUILD_GENERATOR must be defined - Unix, VS2017, or VS201764, VS2015, VS201564, VS2013, VS201364") @@ -93,77 +100,85 @@ endif () ################################################################### ######### Following describes compiler ############ -if (WIN32) - set (SITE_OS_NAME "Windows") - set (SITE_OS_VERSION "WIN7") - if (${BUILD_GENERATOR} STREQUAL "VS201764") - set (CTEST_CMAKE_GENERATOR "Visual Studio 15 2017 Win64") - set (SITE_OS_BITS "64") - set (SITE_COMPILER_NAME "vs2017") - set (SITE_COMPILER_VERSION "15") - elseif (${BUILD_GENERATOR} STREQUAL "VS2017") - set (CTEST_CMAKE_GENERATOR "Visual Studio 15 2017") - set (SITE_OS_BITS "32") - set (SITE_COMPILER_NAME "vs2017") - set (SITE_COMPILER_VERSION "15") - elseif (${BUILD_GENERATOR} STREQUAL "VS201564") - set (CTEST_CMAKE_GENERATOR "Visual Studio 14 2015 Win64") - set (SITE_OS_BITS "64") - set (SITE_COMPILER_NAME "vs2015") - set (SITE_COMPILER_VERSION "14") - elseif (${BUILD_GENERATOR} STREQUAL "VS2015") - set (CTEST_CMAKE_GENERATOR "Visual Studio 14 2015") - set (SITE_OS_BITS "32") - set (SITE_COMPILER_NAME "vs2015") - set (SITE_COMPILER_VERSION "14") - elseif (${BUILD_GENERATOR} STREQUAL "VS201364") - set (CTEST_CMAKE_GENERATOR "Visual Studio 12 2013 Win64") - set (SITE_OS_BITS "64") - set (SITE_COMPILER_NAME "vs2013") - set (SITE_COMPILER_VERSION "12") - elseif (${BUILD_GENERATOR} STREQUAL "VS2013") - set (CTEST_CMAKE_GENERATOR "Visual Studio 12 2013") - set (SITE_OS_BITS "32") - set (SITE_COMPILER_NAME "vs2013") - set (SITE_COMPILER_VERSION "12") - elseif (${BUILD_GENERATOR} STREQUAL "VS201264") - set (CTEST_CMAKE_GENERATOR "Visual Studio 11 2012 Win64") - set (SITE_OS_BITS "64") - set (SITE_COMPILER_NAME "vs2012") - set (SITE_COMPILER_VERSION "11") - elseif (${BUILD_GENERATOR} STREQUAL "VS2012") - set (CTEST_CMAKE_GENERATOR "Visual Studio 11 2012") - set (SITE_OS_BITS "32") - set (SITE_COMPILER_NAME "vs2012") - set (SITE_COMPILER_VERSION "11") +if (NOT DEFINED HPC) + if (NOT DEFINED BUILD_GENERATOR) + message (FATAL_ERROR "BUILD_GENERATOR must be defined - Unix, VS2017, or VS201764, VS2015, VS201564, VS2013, VS201364") + endif () + if (WIN32) + set (SITE_OS_NAME "Windows") + set (SITE_OS_VERSION "WIN7") + if (BUILD_GENERATOR STREQUAL "VS201764") + set (CTEST_CMAKE_GENERATOR "Visual Studio 15 2017 Win64") + set (SITE_OS_BITS "64") + set (SITE_COMPILER_NAME "vs2017") + set (SITE_COMPILER_VERSION "15") + elseif (BUILD_GENERATOR STREQUAL "VS2017") + set (CTEST_CMAKE_GENERATOR "Visual Studio 15 2017") + set (SITE_OS_BITS "32") + set (SITE_COMPILER_NAME "vs2017") + set (SITE_COMPILER_VERSION "15") + elseif (BUILD_GENERATOR STREQUAL "VS201564") + set (CTEST_CMAKE_GENERATOR "Visual Studio 14 2015 Win64") + set (SITE_OS_BITS "64") + set (SITE_COMPILER_NAME "vs2015") + set (SITE_COMPILER_VERSION "14") + elseif (BUILD_GENERATOR STREQUAL "VS2015") + set (CTEST_CMAKE_GENERATOR "Visual Studio 14 2015") + set (SITE_OS_BITS "32") + set (SITE_COMPILER_NAME "vs2015") + set (SITE_COMPILER_VERSION "14") + elseif (BUILD_GENERATOR STREQUAL "VS201364") + set (CTEST_CMAKE_GENERATOR "Visual Studio 12 2013 Win64") + set (SITE_OS_BITS "64") + set (SITE_COMPILER_NAME "vs2013") + set (SITE_COMPILER_VERSION "12") + elseif (BUILD_GENERATOR STREQUAL "VS2013") + set (CTEST_CMAKE_GENERATOR "Visual Studio 12 2013") + set (SITE_OS_BITS "32") + set (SITE_COMPILER_NAME "vs2013") + set (SITE_COMPILER_VERSION "12") + elseif (BUILD_GENERATOR STREQUAL "VS201264") + set (CTEST_CMAKE_GENERATOR "Visual Studio 11 2012 Win64") + set (SITE_OS_BITS "64") + set (SITE_COMPILER_NAME "vs2012") + set (SITE_COMPILER_VERSION "11") + elseif (BUILD_GENERATOR STREQUAL "VS2012") + set (CTEST_CMAKE_GENERATOR "Visual Studio 11 2012") + set (SITE_OS_BITS "32") + set (SITE_COMPILER_NAME "vs2012") + set (SITE_COMPILER_VERSION "11") + else () + message (FATAL_ERROR "Invalid BUILD_GENERATOR must be - Unix, VS2017, or VS201764, VS2015, VS201564, VS2013, VS201364") + endif () + ## Set the following to unique id your computer ## + set (CTEST_SITE "WIN7${BUILD_GENERATOR}.XXXX") else () - message (FATAL_ERROR "Invalid BUILD_GENERATOR must be - Unix, VS2017, or VS201764, VS2015, VS201564, VS2013, VS201364") + set (CTEST_CMAKE_GENERATOR "Unix Makefiles") + ## Set the following to unique id your computer ## + if (APPLE) + set (CTEST_SITE "MAC.XXXX") + else () + set (CTEST_SITE "LINUX.XXXX") + endif () + if (APPLE) + execute_process (COMMAND xcrun --find cc OUTPUT_VARIABLE XCODE_CC OUTPUT_STRIP_TRAILING_WHITESPACE) + execute_process (COMMAND xcrun --find c++ OUTPUT_VARIABLE XCODE_CXX OUTPUT_STRIP_TRAILING_WHITESPACE) + set (ENV{CC} "${XCODE_CC}") + set (ENV{CXX} "${XCODE_CXX}") + set (CTEST_USE_LAUNCHERS 1) + set (RR_WARNINGS_COMMON "-Wno-format-nonliteral -Wno-cast-align -Wno-unused -Wno-unused-variable -Wno-unused-function -Wno-self-assign -Wno-unused-parameter -Wno-sign-compare") + set (RR_WARNINGS_C "${RR_WARNINGS_COMMON} -Wno-deprecated-declarations -Wno-uninitialized") + set (RR_WARNINGS_CXX "${RR_WARNINGS_COMMON} -Woverloaded-virtual -Wshadow -Wwrite-strings -Wc++11-compat") + set (RR_FLAGS_COMMON "-g -O0 -fstack-protector-all -D_FORTIFY_SOURCE=2") + set (RR_FLAGS_C "${RR_FLAGS_COMMON}") + set (RR_FLAGS_CXX "${RR_FLAGS_COMMON}") + set (ENV{CFLAGS} "${RR_WARNINGS_C} ${RR_FLAGS_C}") + set (ENV{CXXFLAGS} "${RR_WARNINGS_CXX} ${RR_FLAGS_CXX}") + endif () endif () -## Set the following to unique id your computer ## - set (CTEST_SITE "WIN7${BUILD_GENERATOR}.XXXX") else () + set (CTEST_SITE "${SITE_OS_NAME}") set (CTEST_CMAKE_GENERATOR "Unix Makefiles") -## Set the following to unique id your computer ## - if (APPLE) - set (CTEST_SITE "MAC.XXXX") - else () - set (CTEST_SITE "LINUX.XXXX") - endif () - if (APPLE) - execute_process (COMMAND xcrun --find cc OUTPUT_VARIABLE XCODE_CC OUTPUT_STRIP_TRAILING_WHITESPACE) - execute_process (COMMAND xcrun --find c++ OUTPUT_VARIABLE XCODE_CXX OUTPUT_STRIP_TRAILING_WHITESPACE) - set (ENV{CC} "${XCODE_CC}") - set (ENV{CXX} "${XCODE_CXX}") - set (CTEST_USE_LAUNCHERS 1) - set (RR_WARNINGS_COMMON "-Wno-format-nonliteral -Wno-cast-align -Wno-unused -Wno-unused-variable -Wno-unused-function -Wno-self-assign -Wno-unused-parameter -Wno-sign-compare") - set (RR_WARNINGS_C "${RR_WARNINGS_COMMON} -Wno-deprecated-declarations -Wno-uninitialized") - set (RR_WARNINGS_CXX "${RR_WARNINGS_COMMON} -Woverloaded-virtual -Wshadow -Wwrite-strings -Wc++11-compat") - set (RR_FLAGS_COMMON "-g -O0 -fstack-protector-all -D_FORTIFY_SOURCE=2") - set (RR_FLAGS_C "${RR_FLAGS_COMMON}") - set (RR_FLAGS_CXX "${RR_FLAGS_COMMON}") - set (ENV{CFLAGS} "${RR_WARNINGS_C} ${RR_FLAGS_C}") - set (ENV{CXXFLAGS} "${RR_WARNINGS_CXX} ${RR_FLAGS_CXX}") - endif () endif () ################################################################### @@ -213,6 +228,9 @@ if (WIN32) else () set (BINFILEBASE "HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}") include (${CTEST_SCRIPT_DIRECTORY}/HDF5options.cmake) + if (DEFINED HPC) + include (${CTEST_SOURCE_DIRECTORY}/config/cmake/scripts/HPC/${HPC}-HDF5options.cmake) + endif () include (${CTEST_SCRIPT_DIRECTORY}/CTestScript.cmake) if (APPLE) if (EXISTS "${CTEST_BINARY_DIRECTORY}/${BINFILEBASE}-Darwin.dmg") diff --git a/config/cmake/scripts/HDF5options.cmake b/config/cmake/scripts/HDF5options.cmake index 45877d7..738c6c4 100644 --- a/config/cmake/scripts/HDF5options.cmake +++ b/config/cmake/scripts/HDF5options.cmake @@ -27,7 +27,9 @@ ############################################################################################# #### Only build static libraries #### #set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=OFF") -#### Add PICC option on linux/mac #### +#### Only build shared libraries #### +#set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DONLY_SHARED_LIBS:BOOL=OFF") +#### Add PIC option on linux/mac #### #set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DCMAKE_ANSI_CFLAGS:STRING=-fPIC") ############################################################################################# @@ -69,12 +71,12 @@ set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ALLOW_EXTERNAL_SUPPORT:STRIN ############################################################################################# ### enable parallel builds - -#set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_PARALLEL:BOOL=ON") -#set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_CPP_LIB:BOOL=OFF") -#set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_JAVA:BOOL=OFF") -#set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_THREADSAFE:BOOL=OFF") - +if (DEFINED MPI) + set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_PARALLEL:BOOL=ON") + set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_CPP_LIB:BOOL=OFF") + set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_JAVA:BOOL=OFF") + set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_THREADSAFE:BOOL=OFF") +endif() ############################################################################################# ### enable thread-safety builds diff --git a/config/cmake/scripts/HPC/bsub-HDF5options.cmake b/config/cmake/scripts/HPC/bsub-HDF5options.cmake new file mode 100644 index 0000000..7473e8a --- /dev/null +++ b/config/cmake/scripts/HPC/bsub-HDF5options.cmake @@ -0,0 +1,31 @@ +# +# Copyright by The HDF Group. +# All rights reserved. +# +# This file is part of HDF5. The full HDF5 copyright notice, including +# terms governing use, modification, and redistribution, is contained in +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. +# +############################################################################################# +#### Change default configuration of options in config/cmake/cacheinit.cmake file ### +#### format: set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DXXX:YY=ZZZZ") ### +############################################################################################# +if (DEFINED MPI) + # maximum parallel processor count for build and test #### + set (MAX_PROC_COUNT 8) +endif() +############################################################################################# +### options to run test scripts in batch commands +set (LOCAL_BATCH_SCRIPT_COMMAND "bsub") +set (LOCAL_BATCH_TEST "TRUE") +set (LOCAL_BATCH_SCRIPT_NAME "ctestS.lsf") +set (LOCAL_BATCH_SCRIPT_PARALLEL_NAME "ctestP.lsf") +set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DLOCAL_BATCH_TEST:BOOL=ON") +set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DLOCAL_BATCH_SCRIPT_NAME:STRING=${LOCAL_BATCH_SCRIPT_NAME}") +set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DLOCAL_BATCH_SCRIPT_PARALLEL_NAME:STRING=${LOCAL_BATCH_SCRIPT_PARALLEL_NAME}") +set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DMPIEXEC_EXECUTABLE:STRING=srun") +set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DMPIEXEC_NUMPROC_FLAG:STRING=-n") +set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DMPIEXEC_MAX_NUMPROCS:STRING=6") diff --git a/config/cmake/scripts/HPC/par-HDF5options.cmake b/config/cmake/scripts/HPC/par-HDF5options.cmake deleted file mode 100644 index c7b22b9..0000000 --- a/config/cmake/scripts/HPC/par-HDF5options.cmake +++ /dev/null @@ -1,126 +0,0 @@ -# -# Copyright by The HDF Group. -# All rights reserved. -# -# This file is part of HDF5. The full HDF5 copyright notice, including -# terms governing use, modification, and redistribution, is contained in -# the COPYING file, which can be found at the root of the source code -# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. -# If you do not have access to either file, you may request a copy from -# help@hdfgroup.org. -# -############################################################################################# -#### 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 other configuration options - -############################################################################################# -#### maximum parallel processor count for build and test #### -set (MAX_PROC_COUNT 8) - -############################################################################################# -#### alternate toolsets #### -#set (CMAKE_GENERATOR_TOOLSET "Intel C++ Compiler 17.0") - -############################################################################################# -#### Only build static libraries #### -#set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=OFF") -#### Add PICC option on linux/mac #### -#set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DCMAKE_ANSI_CFLAGS:STRING=-fPIC") - -############################################################################################# -#### fortran enabled #### -set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_FORTRAN:BOOL=ON") -#### fortran disabled #### -#set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_FORTRAN:BOOL=OFF") - -############################################################################################# -#### java enabled #### -#set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_JAVA:BOOL=ON") -#### java disabled #### -set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_JAVA:BOOL=OFF") - -############################################################################################# -### change install prefix (default use INSTALLDIR value) -set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DCMAKE_INSTALL_PREFIX:PATH=${INSTALLDIR}") - -############################################################################################# -#### 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 git -#set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ALLOW_EXTERNAL_SUPPORT:STRING=GIT") -### ext libs on system -#set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ALLOW_EXTERNAL_SUPPORT:STRING=NO") -#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 using ext zlib -set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_Z_LIB_SUPPORT:BOOL=OFF") -### disable using ext szip -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") - -#### package examples #### -#set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_PACK_EXAMPLES:BOOL=ON -DHDF5_EXAMPLES_COMPRESSED:STRING=HDF5Examples-1.12.4-Source.tar.gz -DHDF5_EXAMPLES_COMPRESSED_DIR:PATH=${CTEST_SCRIPT_DIRECTORY}") - -############################################################################################# -### enable parallel builds - -set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_PARALLEL:BOOL=ON") -set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_CPP_LIB:BOOL=OFF") -set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_JAVA:BOOL=OFF") -set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_THREADSAFE:BOOL=OFF") - -############################################################################################# -### enable thread-safety builds - -#set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_THREADSAFE:BOOL=ON") -#set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_PARALLEL:BOOL=OFF") -#set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_CPP_LIB:BOOL=OFF") -#set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_FORTRAN:BOOL=OFF") -#set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_HL_LIB:BOOL=OFF") - -############################################################################################# -### 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) -set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_PACKAGE_EXTLIBS:BOOL=ON") - - -#options to run test scripts in batch commands -set (LOCAL_BATCH_SCRIPT_COMMAND "sbatch") -set (LOCAL_BATCH_TEST "TRUE") -set (LOCAL_BATCH_SCRIPT_NAME "ctestS.sl") -set (LOCAL_BATCH_SCRIPT_PARALLEL_NAME "ctestP.sl") -set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DLOCAL_BATCH_TEST:BOOL=ON") -set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DLOCAL_BATCH_SCRIPT_NAME:STRING=ctestS.sl") -set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DLOCAL_BATCH_SCRIPT_PARALLEL_NAME:STRING=ctestP.sl") -set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DMPIEXEC_EXECUTABLE:STRING=srun") -set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DMPIEXEC_NUMPROC_FLAG:STRING=-n") -set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DMPIEXEC_MAX_NUMPROCS:STRING=6") - - -############################################################################################# -### use a toolchain file - -#set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DCMAKE_TOOLCHAIN_FILE:STRING=config/toolchain/crayle.cmake") -#set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DCMAKE_TOOLCHAIN_FILE:STRING=config/toolchain/intel.cmake") -#set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DCMAKE_TOOLCHAIN_FILE:STRING=config/toolchain/GCC.cmake") - -#some additions and alternatives to cross compile on haswell for knl -#set (COMPILENODE_HWCOMPILE_MODULE "craype-haswell") -#set (COMPUTENODE_HWCOMPILE_MODULE "craype-mic-knl") -#set (SITE_BUILDNAME_SUFFIX "knl-intel17-SHARED" -#set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DLOCAL_BATCH_SCRIPT_NAME:STRING=knl_ctestS.sl") -#set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DLOCAL_BATCH_SCRIPT_PARALLEL_NAME:STRING=knl_ctestP.sl") -############################################################################################# diff --git a/config/cmake/scripts/HPC/qsub-HDF5options.cmake b/config/cmake/scripts/HPC/qsub-HDF5options.cmake new file mode 100644 index 0000000..34eba1b --- /dev/null +++ b/config/cmake/scripts/HPC/qsub-HDF5options.cmake @@ -0,0 +1,42 @@ +# +# Copyright by The HDF Group. +# All rights reserved. +# +# This file is part of HDF5. The full HDF5 copyright notice, including +# terms governing use, modification, and redistribution, is contained in +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. +# +############################################################################################# +#### Change default configuration of options in config/cmake/cacheinit.cmake file ### +#### format: set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DXXX:YY=ZZZZ") ### +############################################################################################# +if (DEFINED MPI) + # maximum parallel processor count for build and test #### + set (MAX_PROC_COUNT 8) +endif() +############################################################################################# +### options to run test scripts in batch commands +set (LOCAL_BATCH_SCRIPT_NAME "ctest.qsub") +set (LOCAL_BATCH_SCRIPT_PARALLEL_NAME "ctest.qsub") +if (DEFINED KNL) + ### some additions and alternatives to cross compile on haswell for knl + set (COMPUTENODE_HWCOMPILE_MODULE "craype-mic-knl") + set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DCMAKE_TOOLCHAIN_FILE:STRING=config/toolchain/crayle.cmake") +endif () +set (LOCAL_BATCH_SCRIPT_COMMAND "qsub") +set (LOCAL_BATCH_TEST "TRUE") +set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DLOCAL_BATCH_TEST:BOOL=ON") +set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DLOCAL_BATCH_SCRIPT_NAME:STRING=${LOCAL_BATCH_SCRIPT_NAME}") +set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DLOCAL_BATCH_SCRIPT_PARALLEL_NAME:STRING=${LOCAL_BATCH_SCRIPT_PARALLEL_NAME}") +set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DMPIEXEC_EXECUTABLE:STRING=aprun") +# Option to suppress writing job statistics; to avoid issues with h5diff comparisons. +set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DMPIEXEC_PREFLAGS:STRING=-q") +set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DMPIEXEC_NUMPROC_FLAG:STRING=-n") +set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DMPIEXEC_MAX_NUMPROCS:STRING=6") +set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DACCOUNT_ID:STRING=${LOCAL_BATCH_SCRIPT_ARGS}") + +############################################################################################# +############################################################################################# diff --git a/config/cmake/scripts/HPC/raybsub-HDF5options.cmake b/config/cmake/scripts/HPC/raybsub-HDF5options.cmake new file mode 100644 index 0000000..fa1ec4a --- /dev/null +++ b/config/cmake/scripts/HPC/raybsub-HDF5options.cmake @@ -0,0 +1,32 @@ +# +# Copyright by The HDF Group. +# All rights reserved. +# +# This file is part of HDF5. The full HDF5 copyright notice, including +# terms governing use, modification, and redistribution, is contained in +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. +# +############################################################################################# +#### Change default configuration of options in config/cmake/cacheinit.cmake file ### +#### format: set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DXXX:YY=ZZZZ") ### +############################################################################################# +if (DEFINED MPI) + # maximum parallel processor count for build and test #### + set (MAX_PROC_COUNT 8) +endif() +############################################################################################# +### options to run test scripts in batch commands +set (LOCAL_BATCH_SCRIPT_COMMAND "raybsub") +set (LOCAL_BATCH_TEST "TRUE") +set (LOCAL_BATCH_SCRIPT_NAME "ray_ctestS.lsf") +set (LOCAL_BATCH_SCRIPT_PARALLEL_NAME "ray_ctestP.lsf") +set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DLOCAL_BATCH_TEST:BOOL=ON") +set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DLOCAL_BATCH_SCRIPT_COMMAND:STRING=${LOCAL_BATCH_SCRIPT_COMMAND}") +set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DLOCAL_BATCH_SCRIPT_NAME:STRING=${LOCAL_BATCH_SCRIPT_NAME}") +set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DLOCAL_BATCH_SCRIPT_PARALLEL_NAME:STRING=${LOCAL_BATCH_SCRIPT_PARALLEL_NAME}") +set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DMPIEXEC_EXECUTABLE:STRING=mpirun") +set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DMPIEXEC_NUMPROC_FLAG:STRING=-np") +set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DMPIEXEC_MAX_NUMPROCS:STRING=6") diff --git a/config/cmake/scripts/HPC/sbatch-HDF5options.cmake b/config/cmake/scripts/HPC/sbatch-HDF5options.cmake new file mode 100644 index 0000000..3205a1c --- /dev/null +++ b/config/cmake/scripts/HPC/sbatch-HDF5options.cmake @@ -0,0 +1,43 @@ +# +# Copyright by The HDF Group. +# All rights reserved. +# +# This file is part of HDF5. The full HDF5 copyright notice, including +# terms governing use, modification, and redistribution, is contained in +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. +# +############################################################################################# +#### Change default configuration of options in config/cmake/cacheinit.cmake file ### +#### format: set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DXXX:YY=ZZZZ") ### +############################################################################################# +if (DEFINED MPI) + # maximum parallel processor count for build and test #### + set (MAX_PROC_COUNT 8) +endif() +############################################################################################# +### options to run test scripts in batch commands +if (DEFINED KNL) + ### some additions and alternatives to cross compile on haswell for knl + set (COMPILENODE_HWCOMPILE_MODULE "craype-haswell") + set (COMPUTENODE_HWCOMPILE_MODULE "craype-mic-knl") + set (LOCAL_BATCH_SCRIPT_NAME "knl_ctestS.sl") + set (LOCAL_BATCH_SCRIPT_PARALLEL_NAME "knl_ctestP.sl") + set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DCMAKE_TOOLCHAIN_FILE:STRING=config/toolchain/crayle.cmake") +else () + set (LOCAL_BATCH_SCRIPT_NAME "ctestS.sl") + set (LOCAL_BATCH_SCRIPT_PARALLEL_NAME "ctestP.sl") +endif () +set (LOCAL_BATCH_SCRIPT_COMMAND "sbatch") +set (LOCAL_BATCH_TEST "TRUE") +set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DLOCAL_BATCH_TEST:BOOL=ON") +set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DLOCAL_BATCH_SCRIPT_NAME:STRING=${LOCAL_BATCH_SCRIPT_NAME}") +set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DLOCAL_BATCH_SCRIPT_PARALLEL_NAME:STRING=${LOCAL_BATCH_SCRIPT_PARALLEL_NAME}") +set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DMPIEXEC_EXECUTABLE:STRING=srun") +set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DMPIEXEC_NUMPROC_FLAG:STRING=-n") +set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DMPIEXEC_MAX_NUMPROCS:STRING=6") + +############################################################################################# +############################################################################################# diff --git a/config/cmake/scripts/HPC/ser-HDF5options.cmake b/config/cmake/scripts/HPC/ser-HDF5options.cmake deleted file mode 100644 index 7f2e96f..0000000 --- a/config/cmake/scripts/HPC/ser-HDF5options.cmake +++ /dev/null @@ -1,119 +0,0 @@ -# -# Copyright by The HDF Group. -# All rights reserved. -# -# This file is part of HDF5. The full HDF5 copyright notice, including -# terms governing use, modification, and redistribution, is contained in -# the COPYING file, which can be found at the root of the source code -# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. -# If you do not have access to either file, you may request a copy from -# help@hdfgroup.org. -# -############################################################################################# -#### 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 other configuration options - -############################################################################################# -#### maximum parallel processor count for build and test #### -#set (MAX_PROC_COUNT 8) - -############################################################################################# -#### alternate toolsets #### -#set (CMAKE_GENERATOR_TOOLSET "Intel C++ Compiler 17.0") - -############################################################################################# -#### Only build static libraries #### -#set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=OFF") -#### Add PICC option on linux/mac #### -#set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DCMAKE_ANSI_CFLAGS:STRING=-fPIC") - -############################################################################################# -#### fortran enabled #### -#set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_FORTRAN:BOOL=ON") -#### fortran disabled #### -set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_FORTRAN:BOOL=OFF") - -############################################################################################# -#### java enabled #### -#set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_JAVA:BOOL=ON") -#### java disabled #### -set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_JAVA:BOOL=OFF") - -############################################################################################# -### change install prefix (default use INSTALLDIR value) -set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DCMAKE_INSTALL_PREFIX:PATH=${INSTALLDIR}") - -############################################################################################# -#### 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 git -#set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ALLOW_EXTERNAL_SUPPORT:STRING=GIT") -### ext libs on system -#set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ALLOW_EXTERNAL_SUPPORT:STRING=NO") -#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 using ext zlib -#set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_Z_LIB_SUPPORT:BOOL=OFF") -### disable using ext szip -#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") - -#### package examples #### -#set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_PACK_EXAMPLES:BOOL=ON -DHDF5_EXAMPLES_COMPRESSED:STRING=HDF5Examples-1.12.4-Source.tar.gz -DHDF5_EXAMPLES_COMPRESSED_DIR:PATH=${CTEST_SCRIPT_DIRECTORY}") - -############################################################################################# -### enable parallel builds - -#set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_PARALLEL:BOOL=ON") -#set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_CPP_LIB:BOOL=OFF") -#set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_JAVA:BOOL=OFF") -#set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_THREADSAFE:BOOL=OFF") - -############################################################################################# -### enable thread-safety builds - -#set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_THREADSAFE:BOOL=ON") -#set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_PARALLEL:BOOL=OFF") -#set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_CPP_LIB:BOOL=OFF") -#set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_FORTRAN:BOOL=OFF") -#set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_HL_LIB:BOOL=OFF") - -############################################################################################# -### 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) -set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_PACKAGE_EXTLIBS:BOOL=ON") - -#options to run test scripts in batch commands -set (LOCAL_BATCH_SCRIPT_COMMAND "sbatch") -set (LOCAL_BATCH_TEST "TRUE") -set (LOCAL_BATCH_SCRIPT_NAME "ctestS.sl") -set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DLOCAL_BATCH_TEST:BOOL=ON") -set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DLOCAL_BATCH_SCRIPT_NAME:STRING=ctestS.sl") - -############################################################################################# -### use a toolchain file - -#set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DCMAKE_TOOLCHAIN_FILE:STRING=config/toolchain/intel.cmake") -#set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DCMAKE_TOOLCHAIN_FILE:STRING=config/toolchain/crayle.cmake") -#set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DCMAKE_TOOLCHAIN_FILE:STRING=config/toolchain/GCC.cmake") - -#some additions and alternatives to cross compile on haswell for knl -#set (COMPILENODE_HWCOMPILE_MODULE "craype-haswell") -#set (COMPUTENODE_HWCOMPILE_MODULE "craype-mic-knl") -#set (SITE_BUILDNAME_SUFFIX "knl-intel17-SHARED" -#set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DLOCAL_BATCH_SCRIPT_NAME:STRING=knl_ctestS.sl") - -############################################################################################# diff --git a/config/cmake/userblockTest.cmake b/config/cmake/userblockTest.cmake index 9af7e5b..0e9d01b 100644 --- a/config/cmake/userblockTest.cmake +++ b/config/cmake/userblockTest.cmake @@ -20,7 +20,7 @@ if (NOT TEST_GET_PROGRAM) message (FATAL_ERROR "Require TEST_GET_PROGRAM getub to be defined") endif () if (NOT TEST_FOLDER) - message ( FATAL_ERROR "Require TEST_FOLDER to be defined") + message (FATAL_ERROR "Require TEST_FOLDER to be defined") endif () if (NOT TEST_HFILE) message (FATAL_ERROR "Require TEST_HFILE the hdf file to be defined") @@ -62,7 +62,7 @@ if (TEST_CHECKUB STREQUAL "YES") OUTPUT_VARIABLE TEST_OUT ERROR_VARIABLE TEST_ERROR ) - if (NOT ${TEST_RESULT} STREQUAL "0") + if (TEST_RESULT) message (FATAL_ERROR "Failed: The output of ${TEST_PROGRAM} ${TEST_OFILE} is: ${TEST_ERROR}") endif () file (READ ${TEST_HFILE}.len.txt TEST_O_STRING_LEN) @@ -70,7 +70,7 @@ if (TEST_CHECKUB STREQUAL "YES") math( EXPR TEST_STRING_SIZE "${TEST_U_STRING_LEN} + ${TEST_O_STRING_LEN}" ) - if (NOT TEST_O_STRING_LEN STREQUAL "0") + if (TEST_O_STRING_LEN) #$JAM_BIN/getub -c $s2 $origfile > $cmpfile EXECUTE_PROCESS ( COMMAND ${TEST_GET_PROGRAM} -c ${TEST_O_STRING_LEN} ${TEST_OFILE} @@ -108,7 +108,7 @@ if (TEST_CHECKUB STREQUAL "YES") message (STATUS "COMPARE Result: ${TEST_RESULT}: ${TEST_STRING_SIZE}=${TEST_U_STRING_LEN}+${TEST_O_STRING_LEN}") # if the return value is !=${TEST_EXPECT} bail out - if (NOT ${TEST_RESULT} STREQUAL ${TEST_EXPECT}) + if (NOT TEST_RESULT EQUAL TEST_EXPECT) message (FATAL_ERROR "Failed: The output of ${TEST_HFILE}-ub did not match ${TEST_HFILE}.\n${TEST_ERROR}") endif () else () @@ -121,11 +121,11 @@ else () OUTPUT_VARIABLE TEST_OUT ERROR_VARIABLE TEST_ERROR ) - if (NOT TEST_H_STRING_LEN STREQUAL "0") + if (TEST_H_STRING_LEN) message (FATAL_ERROR "Failed: The output of ${TEST_HFILE} was NOT empty") endif () endif () # everything went fine... -message ("Passed: The output of CHECK matched expectation") +message (STATUS "Passed: The output of CHECK matched expectation") diff --git a/config/cmake/vfdTest.cmake b/config/cmake/vfdTest.cmake index b616958..8e186e9 100644 --- a/config/cmake/vfdTest.cmake +++ b/config/cmake/vfdTest.cmake @@ -17,7 +17,7 @@ if (NOT TEST_PROGRAM) message (FATAL_ERROR "Require TEST_PROGRAM to be defined") endif () if (NOT TEST_FOLDER) - message ( FATAL_ERROR "Require TEST_FOLDER to be defined") + message (FATAL_ERROR "Require TEST_FOLDER to be defined") endif () if (NOT TEST_VFD) message (FATAL_ERROR "Require TEST_VFD to be defined") @@ -73,4 +73,4 @@ endif () message (STATUS "COMMAND Error: ${TEST_ERROR}") # everything went fine... -message ("Passed: The ${TEST_PROGRAM} program used vfd ${TEST_VFD}") +message (STATUS "Passed: The ${TEST_PROGRAM} program used vfd ${TEST_VFD}") diff --git a/config/cmake/volTest.cmake b/config/cmake/volTest.cmake index d8c82a4..a9dd756 100644 --- a/config/cmake/volTest.cmake +++ b/config/cmake/volTest.cmake @@ -17,7 +17,7 @@ if (NOT TEST_PROGRAM) message (FATAL_ERROR "Require TEST_PROGRAM to be defined") endif () if (NOT TEST_FOLDER) - message ( FATAL_ERROR "Require TEST_FOLDER to be defined") + message (FATAL_ERROR "Require TEST_FOLDER to be defined") endif () if (NOT TEST_VOL) message (FATAL_ERROR "Require TEST_VOL to be defined") @@ -73,4 +73,4 @@ endif () message (STATUS "COMMAND Error: ${TEST_ERROR}") # everything went fine... -message ("Passed: The ${TEST_PROGRAM} program used vol ${TEST_VOL}") +message (STATUS "Passed: The ${TEST_PROGRAM} program used vol ${TEST_VOL}") diff --git a/config/cmake_ext_mod/ConfigureChecks.cmake b/config/cmake_ext_mod/ConfigureChecks.cmake index 986280f..63d9ee9 100644 --- a/config/cmake_ext_mod/ConfigureChecks.cmake +++ b/config/cmake_ext_mod/ConfigureChecks.cmake @@ -28,7 +28,7 @@ if (APPLE) list (LENGTH CMAKE_OSX_ARCHITECTURES ARCH_LENGTH) if (ARCH_LENGTH GREATER 1) set (CMAKE_OSX_ARCHITECTURES "" CACHE STRING "" FORCE) - message(FATAL_ERROR "Building Universal Binaries on OS X is NOT supported by the HDF5 project. This is" + message (FATAL_ERROR "Building Universal Binaries on OS X is NOT supported by the HDF5 project. This is" "due to technical reasons. The best approach would be build each architecture in separate directories" "and use the 'lipo' tool to combine them into a single executable or library. The 'CMAKE_OSX_ARCHITECTURES'" "variable has been set to a blank value which will build the default architecture for this system.") @@ -229,7 +229,7 @@ macro (HDF_FUNCTION_TEST OTHER_TEST) endif () #message (STATUS "Performing ${OTHER_TEST}") - TRY_COMPILE (${OTHER_TEST} + try_compile (${OTHER_TEST} ${CMAKE_BINARY_DIR} ${HDF_RESOURCES_EXT_DIR}/HDFTests.c COMPILE_DEFINITIONS "${MACRO_CHECK_FUNCTION_DEFINITIONS}" @@ -274,12 +274,10 @@ if (NOT WINDOWS) # functionality so clock_gettime and CLOCK_MONOTONIC are defined # correctly. This was later updated to 200112L so that # posix_memalign() is visible for the direct VFD code on Linux - # systems. Even later, this was changed to 200809L to support - # pread/pwrite in VFDs. - # + # systems. # POSIX feature information can be found in the gcc manual at: # http://www.gnu.org/s/libc/manual/html_node/Feature-Test-Macros.html - set (HDF_EXTRA_C_FLAGS -D_POSIX_C_SOURCE=200809L) + set (HDF_EXTRA_C_FLAGS -D_POSIX_C_SOURCE=200112L) # Need to add this so that O_DIRECT is visible for the direct # VFD on Linux systems. @@ -288,7 +286,7 @@ if (NOT WINDOWS) option (HDF_ENABLE_LARGE_FILE "Enable support for large (64-bit) files on Linux." ON) if (HDF_ENABLE_LARGE_FILE AND NOT DEFINED TEST_LFS_WORKS_RUN) set (msg "Performing TEST_LFS_WORKS") - TRY_RUN (TEST_LFS_WORKS_RUN TEST_LFS_WORKS_COMPILE + try_run (TEST_LFS_WORKS_RUN TEST_LFS_WORKS_COMPILE ${CMAKE_BINARY_DIR} ${HDF_RESOURCES_EXT_DIR}/HDFTests.c COMPILE_DEFINITIONS "-DTEST_LFS_WORKS" @@ -445,7 +443,7 @@ if (NOT WINDOWS) # Check a bunch of time functions #----------------------------------------------------------------------------- CHECK_FUNCTION_EXISTS (gettimeofday ${HDF_PREFIX}_HAVE_GETTIMEOFDAY) - foreach (test + foreach (time_test HAVE_TM_GMTOFF HAVE___TM_GMTOFF # HAVE_TIMEZONE @@ -455,7 +453,7 @@ if (NOT WINDOWS) HAVE_TM_ZONE HAVE_STRUCT_TM_TM_ZONE ) - HDF_FUNCTION_TEST (${test}) + HDF_FUNCTION_TEST (${time_test}) endforeach () if (NOT CYGWIN AND NOT MINGW) HDF_FUNCTION_TEST (HAVE_TIMEZONE) @@ -559,7 +557,7 @@ endif () # Check a bunch of other functions #----------------------------------------------------------------------------- if (NOT WINDOWS) - foreach (test + foreach (other_test HAVE_ATTRIBUTE HAVE_C99_FUNC # STDC_HEADERS @@ -568,7 +566,7 @@ if (NOT WINDOWS) SYSTEM_SCOPE_THREADS HAVE_SOCKLEN_T ) - HDF_FUNCTION_TEST (${test}) + HDF_FUNCTION_TEST (${other_test}) endforeach () endif () @@ -658,7 +656,7 @@ if (NOT ${HDF_PREFIX}_PRINTF_LL_WIDTH OR ${HDF_PREFIX}_PRINTF_LL_WIDTH MATCHES " 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 () - message ("Width test failed with result: ${${HDF_PREFIX}_PRINTF_LL_TEST_RUN}") + message (STATUS "Width test failed with result: ${${HDF_PREFIX}_PRINTF_LL_TEST_RUN}") endif () else () file (APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log diff --git a/config/cmake_ext_mod/FindSZIP.cmake b/config/cmake_ext_mod/FindSZIP.cmake index 699be85..152f8ac 100644 --- a/config/cmake_ext_mod/FindSZIP.cmake +++ b/config/cmake_ext_mod/FindSZIP.cmake @@ -9,136 +9,108 @@ # If you do not have access to either file, you may request a copy from # help@hdfgroup.org. # +######################################################################### + +# - Derived from the FindTiff.cmake and FindJPEG.cmake that is included with cmake +# FindSZIP -# - Find SZIP library -# - Derived from the FindTiff.cmake that is included with cmake # Find the native SZIP includes and library -# This module defines -# SZIP_INCLUDE_DIRS, where to find tiff.h, etc. -# SZIP_LIBRARIES, libraries to link against to use SZIP. -# SZIP_FOUND, If false, do not try to use SZIP. -# also defined, but not for general use are -# SZIP_LIBRARY, where to find the SZIP library. -# SZIP_LIBRARY_DEBUG - Debug version of SZIP library -# SZIP_LIBRARY_RELEASE - Release Version of SZIP library -# message (STATUS "Finding SZIP library and headers..." ) +# Imported targets +################## -############################################ +# This module defines the following :prop_tgt:`IMPORTED` targets: # -# Check the existence of the libraries. +# SZIP::SZIP +# The SZIP library, if found. # -############################################ -# This macro was taken directly from the FindQt4.cmake file that is included -# with the CMake distribution. This is NOT my work. All work was done by the -# original authors of the FindQt4.cmake file. Only minor modifications were -# made to remove references to Qt and make this file more generally applicable -######################################################################### +# Result variables +################### -macro (SZIP_ADJUST_LIB_VARS basename) - if (${basename}_INCLUDE_DIR) +# This module will set the following variables in your project: - # if only the release version was found, set the debug variable also to the release version - if (${basename}_LIBRARY_RELEASE AND NOT ${basename}_LIBRARY_DEBUG) - set (${basename}_LIBRARY_DEBUG ${${basename}_LIBRARY_RELEASE}) - set (${basename}_LIBRARY ${${basename}_LIBRARY_RELEASE}) - set (${basename}_LIBRARIES ${${basename}_LIBRARY_RELEASE}) - endif () +# SZIP_FOUND, true if the SZIP headers and libraries were found. +# SZIP_INCLUDE_DIR, the directory containing the SZIP headers. +# SZIP_INCLUDE_DIRS, the directory containing the SZIP headers. +# SZIP_LIBRARIES, libraries to link against to use SZIP. - # if only the debug version was found, set the release variable also to the debug version - if (${basename}_LIBRARY_DEBUG AND NOT ${basename}_LIBRARY_RELEASE) - set (${basename}_LIBRARY_RELEASE ${${basename}_LIBRARY_DEBUG}) - set (${basename}_LIBRARY ${${basename}_LIBRARY_DEBUG}) - set (${basename}_LIBRARIES ${${basename}_LIBRARY_DEBUG}) - endif () - if (${basename}_LIBRARY_DEBUG AND ${basename}_LIBRARY_RELEASE) - # if the generator supports configuration types then set - # optimized and debug libraries, or if the CMAKE_BUILD_TYPE has a value - if (CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE) - set (${basename}_LIBRARY optimized ${${basename}_LIBRARY_RELEASE} debug ${${basename}_LIBRARY_DEBUG}) - else () - # if there are no configuration types and CMAKE_BUILD_TYPE has no value - # then just use the release libraries - set (${basename}_LIBRARY ${${basename}_LIBRARY_RELEASE} ) - endif () - set (${basename}_LIBRARIES optimized ${${basename}_LIBRARY_RELEASE} debug ${${basename}_LIBRARY_DEBUG}) - endif () +# Cache variables +################# - set (${basename}_LIBRARY ${${basename}_LIBRARY} CACHE FILEPATH "The ${basename} library") +# The following variables may also be set: - if (${basename}_LIBRARY) - set (${basename}_FOUND 1) - endif () - endif () +# SZIP_LIBRARY, where to find the SZIP library. +# SZIP_LIBRARY_DEBUG - Debug version of SZIP library +# SZIP_LIBRARY_RELEASE - Release Version of SZIP library - # Make variables changeble to the advanced user - MARK_AS_ADVANCED (${basename}_LIBRARY ${basename}_LIBRARY_RELEASE ${basename}_LIBRARY_DEBUG ${basename}_INCLUDE_DIR ) -endmacro () - - -# Look for the header file. -set (SZIP_INCLUDE_SEARCH_DIRS - $ENV{SZIP_INSTALL}/include - $ENV{SZIP_INSTALL}/include/szip - /usr/include - /usr/include/szip -) - -set (SZIP_LIB_SEARCH_DIRS - $ENV{SZIP_INSTALL}/lib - /usr/lib -) - -set (SZIP_BIN_SEARCH_DIRS - $ENV{SZIP_INSTALL}/bin - /usr/bin -) - -FIND_PATH (SZIP_INCLUDE_DIR - NAMES szlib.h - PATHS ${SZIP_INCLUDE_SEARCH_DIRS} - NO_DEFAULT_PATH -) - -if (WIN32) - set (SZIP_SEARCH_DEBUG_NAMES "sz_d;libsz_d") - set (SZIP_SEARCH_RELEASE_NAMES "sz;libsz;libszip") -else () - set (SZIP_SEARCH_DEBUG_NAMES "sz_d") - set (SZIP_SEARCH_RELEASE_NAMES "sz;szip") -endif () +# message (STATUS "Finding SZIP library and headers..." ) +######################################################################### -# Look for the library. -FIND_LIBRARY (SZIP_LIBRARY_DEBUG - NAMES ${SZIP_SEARCH_DEBUG_NAMES} - PATHS ${SZIP_LIB_SEARCH_DIRS} - NO_DEFAULT_PATH -) - -FIND_LIBRARY (SZIP_LIBRARY_RELEASE - NAMES ${SZIP_SEARCH_RELEASE_NAMES} - PATHS ${SZIP_LIB_SEARCH_DIRS} - NO_DEFAULT_PATH -) - -SZIP_ADJUST_LIB_VARS (SZIP) - -if (SZIP_INCLUDE_DIR AND SZIP_LIBRARY) - set (SZIP_FOUND 1) - set (SZIP_LIBRARIES ${SZIP_LIBRARY}) - set (SZIP_INCLUDE_DIRS ${SZIP_INCLUDE_DIR}) - if (SZIP_LIBRARY_DEBUG) - get_filename_component (SZIP_LIBRARY_PATH ${SZIP_LIBRARY_DEBUG} PATH) - set (SZIP_LIB_DIR ${SZIP_LIBRARY_PATH}) - elseif () - get_filename_component (SZIP_LIBRARY_PATH ${SZIP_LIBRARY_RELEASE} PATH) - set (SZIP_LIB_DIR ${SZIP_LIBRARY_PATH}) - endif () -else () - set (SZIP_FOUND 0) - set (SZIP_LIBRARIES) - set (SZIP_INCLUDE_DIRS) -endif () + +find_path(SZIP_INCLUDE_DIR szlib.h) + +set(szip_names ${SZIP_NAMES} sz szip szip-static libsz libszip libszip-static) +foreach(name ${szip_names}) + list(APPEND szip_names_debug "${name}d") +endforeach() + +if(NOT SZIP_LIBRARY) + find_library(SZIP_LIBRARY_RELEASE NAMES ${szip_names}) + find_library(SZIP_LIBRARY_DEBUG NAMES ${szip_names_debug}) + include(${CMAKE_CURRENT_LIST_DIR}/SelectLibraryConfigurations.cmake) + select_library_configurations(SZIP) + mark_as_advanced(SZIP_LIBRARY_RELEASE SZIP_LIBRARY_DEBUG) +endif() +unset(szip_names) +unset(szip_names_debug) + +if(SZIP_INCLUDE_DIR AND EXISTS "${SZIP_INCLUDE_DIR}/SZconfig.h") + file(STRINGS "${SZIP_INCLUDE_DIR}/SZconfig.h" szip_version_str + REGEX "^#define[\t ]+SZIP_PACKAGE_VERSION[\t ]+.*") + + string(REGEX REPLACE "^#define[\t ]+SZIP_PACKAGE_VERSION[\t ]+([0-9]+).*" + "\\1" SZIP_VERSION "${szip_version_str}") + unset(szip_version_str) +endif() + +include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) +find_package_handle_standard_args(SZIP + REQUIRED_VARS SZIP_LIBRARY SZIP_INCLUDE_DIR + VERSION_VAR SZIP_VERSION) + +if(SZIP_FOUND) + set(SZIP_LIBRARIES ${SZIP_LIBRARY}) + set(SZIP_INCLUDE_DIRS "${SZIP_INCLUDE_DIR}") + + if(NOT TARGET SZIP::SZIP) + add_library(SZIP::SZIP UNKNOWN IMPORTED) + if(SZIP_INCLUDE_DIRS) + set_target_properties(SZIP::SZIP PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES "${SZIP_INCLUDE_DIRS}") + endif() + if(EXISTS "${SZIP_LIBRARY}") + set_target_properties(SZIP::SZIP PROPERTIES + IMPORTED_LINK_INTERFACE_LANGUAGES "C" + IMPORTED_LOCATION "${SZIP_LIBRARY}") + endif() + if(EXISTS "${SZIP_LIBRARY_RELEASE}") + set_property(TARGET SZIP::SZIP APPEND PROPERTY + IMPORTED_CONFIGURATIONS RELEASE) + set_target_properties(SZIP::SZIP PROPERTIES + IMPORTED_LINK_INTERFACE_LANGUAGES_RELEASE "C" + IMPORTED_LOCATION_RELEASE "${SZIP_LIBRARY_RELEASE}") + endif() + if(EXISTS "${SZIP_LIBRARY_DEBUG}") + set_property(TARGET SZIP::SZIP APPEND PROPERTY + IMPORTED_CONFIGURATIONS DEBUG) + set_target_properties(SZIP::SZIP PROPERTIES + IMPORTED_LINK_INTERFACE_LANGUAGES_DEBUG "C" + IMPORTED_LOCATION_DEBUG "${SZIP_LIBRARY_DEBUG}") + endif() + endif() +endif() + +mark_as_advanced(SZIP_LIBRARY SZIP_INCLUDE_DIR) # Report the results. if (NOT SZIP_FOUND) @@ -153,29 +125,3 @@ if (NOT SZIP_FOUND) endif () endif () endif () - -if (SZIP_FOUND) - include (CheckSymbolExists) - ############################################# - # Find out if SZIP was build using dll's - ############################################# - # Save required variable - set (CMAKE_REQUIRED_INCLUDES_SAVE ${CMAKE_REQUIRED_INCLUDES}) - set (CMAKE_REQUIRED_FLAGS_SAVE ${CMAKE_REQUIRED_FLAGS}) - # Add SZIP_INCLUDE_DIR to CMAKE_REQUIRED_INCLUDES - set (CMAKE_REQUIRED_INCLUDES "${CMAKE_REQUIRED_INCLUDES};${SZIP_INCLUDE_DIRS}") - - # Restore CMAKE_REQUIRED_INCLUDES and CMAKE_REQUIRED_FLAGS variables - set (CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES_SAVE}) - set (CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS_SAVE}) - # - ############################################# -endif () - -if (FIND_SZIP_DEBUG) - message (STATUS "SZIP_INCLUDE_DIR: ${SZIP_INCLUDE_DIR}") - message (STATUS "SZIP_INCLUDE_DIRS: ${SZIP_INCLUDE_DIRS}") - message (STATUS "SZIP_LIBRARY_DEBUG: ${SZIP_LIBRARY_DEBUG}") - message (STATUS "SZIP_LIBRARY_RELEASE: ${SZIP_LIBRARY_RELEASE}") - message (STATUS "CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}") -endif () diff --git a/config/cmake_ext_mod/HDFLibMacros.cmake b/config/cmake_ext_mod/HDFLibMacros.cmake index 2eda66c..9df2b4b 100644 --- a/config/cmake_ext_mod/HDFLibMacros.cmake +++ b/config/cmake_ext_mod/HDFLibMacros.cmake @@ -14,25 +14,7 @@ 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] - INSTALL_COMMAND "" - CMAKE_ARGS - -DBUILD_SHARED_LIBS:BOOL=${BUILD_SHARED_LIBS} - -DJPEG_PACKAGE_EXT:STRING=${HDF_PACKAGE_EXT} - -DJPEG_EXTERNALLY_CONFIGURED:BOOL=OFF - -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE} - -DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_INSTALL_PREFIX} - -DCMAKE_RUNTIME_OUTPUT_DIRECTORY:PATH=${CMAKE_RUNTIME_OUTPUT_DIRECTORY} - -DCMAKE_LIBRARY_OUTPUT_DIRECTORY:PATH=${CMAKE_LIBRARY_OUTPUT_DIRECTORY} - -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY:PATH=${CMAKE_ARCHIVE_OUTPUT_DIRECTORY} - -DCMAKE_PDB_OUTPUT_DIRECTORY:PATH=${CMAKE_PDB_OUTPUT_DIRECTORY} - -DCMAKE_ANSI_CFLAGS:STRING=${jpeg_pic} - -DCMAKE_TOOLCHAIN_FILE:STRING=${CMAKE_TOOLCHAIN_FILE} - ) - elseif (${compress_type} MATCHES "GIT") + if (${compress_type} MATCHES "GIT") EXTERNALPROJECT_ADD (JPEG GIT_REPOSITORY ${JPEG_URL} GIT_TAG ${JPEG_BRANCH} @@ -49,6 +31,7 @@ macro (EXTERNAL_JPEG_LIBRARY compress_type jpeg_pic) -DCMAKE_PDB_OUTPUT_DIRECTORY:PATH=${CMAKE_PDB_OUTPUT_DIRECTORY} -DCMAKE_ANSI_CFLAGS:STRING=${jpeg_pic} -DCMAKE_TOOLCHAIN_FILE:STRING=${CMAKE_TOOLCHAIN_FILE} + -DPACKAGE_NAMESPACE=${HDF_PACKAGE_NAMESPACE} ) elseif (${compress_type} MATCHES "TGZ") EXTERNALPROJECT_ADD (JPEG @@ -67,23 +50,24 @@ macro (EXTERNAL_JPEG_LIBRARY compress_type jpeg_pic) -DCMAKE_PDB_OUTPUT_DIRECTORY:PATH=${CMAKE_PDB_OUTPUT_DIRECTORY} -DCMAKE_ANSI_CFLAGS:STRING=${jpeg_pic} -DCMAKE_TOOLCHAIN_FILE:STRING=${CMAKE_TOOLCHAIN_FILE} + -DPACKAGE_NAMESPACE=${HDF_PACKAGE_NAMESPACE} ) endif () externalproject_get_property (JPEG BINARY_DIR SOURCE_DIR) ##include (${BINARY_DIR}/${JPEG_PACKAGE_NAME}${HDF_PACKAGE_EXT}-targets.cmake) # Create imported target jpeg-static - add_library(jpeg-static STATIC IMPORTED) - HDF_IMPORT_SET_LIB_OPTIONS (jpeg-static "jpeg" STATIC "") - add_dependencies (jpeg-static JPEG) - set (JPEG_STATIC_LIBRARY "jpeg-static") + add_library(${HDF_PACKAGE_NAMESPACE}jpeg-static STATIC IMPORTED) + HDF_IMPORT_SET_LIB_OPTIONS (${HDF_PACKAGE_NAMESPACE}jpeg-static "jpeg" STATIC "") + add_dependencies (${HDF_PACKAGE_NAMESPACE}jpeg-static JPEG) + set (JPEG_STATIC_LIBRARY "${HDF_PACKAGE_NAMESPACE}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-shared JPEG) - set (JPEG_SHARED_LIBRARY "jpeg-shared") + add_library(${HDF_PACKAGE_NAMESPACE}jpeg-shared SHARED IMPORTED) + HDF_IMPORT_SET_LIB_OPTIONS (${HDF_PACKAGE_NAMESPACE}jpeg-shared "jpeg" SHARED "") + add_dependencies (${HDF_PACKAGE_NAMESPACE}jpeg-shared JPEG) + set (JPEG_SHARED_LIBRARY "${HDF_PACKAGE_NAMESPACE}jpeg-shared") set (JPEG_LIBRARIES ${JPEG_LIBRARIES} ${JPEG_SHARED_LIBRARY}) endif () @@ -100,33 +84,14 @@ macro (PACKAGE_JPEG_LIBRARY compress_type) COMMENT "Copying ${JPEG_INCLUDE_DIR_GEN}/jconfig.h to ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/" ) set (EXTERNAL_HEADER_LIST ${EXTERNAL_HEADER_LIST} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/jconfig.h) - if (${compress_type} MATCHES "GIT" OR ${compress_type} MATCHES "SVN" OR ${compress_type} MATCHES "TGZ") + if (${compress_type} MATCHES "GIT" OR ${compress_type} MATCHES "TGZ") add_dependencies (JPEG-GenHeader-Copy JPEG) endif () endmacro () #------------------------------------------------------------------------------- macro (EXTERNAL_SZIP_LIBRARY compress_type encoding) - if (${compress_type} MATCHES "SVN") - EXTERNALPROJECT_ADD (SZIP - SVN_REPOSITORY ${SZIP_URL} - # [SVN_REVISION rev] - INSTALL_COMMAND "" - CMAKE_ARGS - -DBUILD_SHARED_LIBS:BOOL=${BUILD_SHARED_LIBS} - -DSZIP_PACKAGE_EXT:STRING=${HDF_PACKAGE_EXT} - -DSZIP_EXTERNALLY_CONFIGURED:BOOL=OFF - -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE} - -DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_INSTALL_PREFIX} - -DCMAKE_RUNTIME_OUTPUT_DIRECTORY:PATH=${CMAKE_RUNTIME_OUTPUT_DIRECTORY} - -DCMAKE_LIBRARY_OUTPUT_DIRECTORY:PATH=${CMAKE_LIBRARY_OUTPUT_DIRECTORY} - -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY:PATH=${CMAKE_ARCHIVE_OUTPUT_DIRECTORY} - -DCMAKE_PDB_OUTPUT_DIRECTORY:PATH=${CMAKE_PDB_OUTPUT_DIRECTORY} - -DCMAKE_ANSI_CFLAGS:STRING=${CMAKE_ANSI_CFLAGS} - -DSZIP_ENABLE_ENCODING:BOOL=${encoding} - -DCMAKE_TOOLCHAIN_FILE:STRING=${CMAKE_TOOLCHAIN_FILE} - ) - elseif (${compress_type} MATCHES "GIT") + if (${compress_type} MATCHES "GIT") EXTERNALPROJECT_ADD (SZIP GIT_REPOSITORY ${SZIP_URL} GIT_TAG ${SZIP_BRANCH} @@ -144,6 +109,7 @@ macro (EXTERNAL_SZIP_LIBRARY compress_type encoding) -DCMAKE_ANSI_CFLAGS:STRING=${CMAKE_ANSI_CFLAGS} -DSZIP_ENABLE_ENCODING:BOOL=${encoding} -DCMAKE_TOOLCHAIN_FILE:STRING=${CMAKE_TOOLCHAIN_FILE} + -DPACKAGE_NAMESPACE=${HDF_PACKAGE_NAMESPACE} ) elseif (${compress_type} MATCHES "TGZ") EXTERNALPROJECT_ADD (SZIP @@ -163,23 +129,24 @@ macro (EXTERNAL_SZIP_LIBRARY compress_type encoding) -DCMAKE_ANSI_CFLAGS:STRING=${CMAKE_ANSI_CFLAGS} -DSZIP_ENABLE_ENCODING:BOOL=${encoding} -DCMAKE_TOOLCHAIN_FILE:STRING=${CMAKE_TOOLCHAIN_FILE} + -DPACKAGE_NAMESPACE=${HDF_PACKAGE_NAMESPACE} ) endif () externalproject_get_property (SZIP BINARY_DIR SOURCE_DIR) ##include (${BINARY_DIR}/${SZIP_PACKAGE_NAME}${HDF_PACKAGE_EXT}-targets.cmake) # Create imported target szip-static - add_library(szip-static STATIC IMPORTED) - HDF_IMPORT_SET_LIB_OPTIONS (szip-static "szip" STATIC "") - add_dependencies (szip-static SZIP) - set (SZIP_STATIC_LIBRARY "szip-static") + add_library(${HDF_PACKAGE_NAMESPACE}szip-static STATIC IMPORTED) + HDF_IMPORT_SET_LIB_OPTIONS (${HDF_PACKAGE_NAMESPACE}szip-static "szip" STATIC "") + add_dependencies (${HDF_PACKAGE_NAMESPACE}szip-static SZIP) + set (SZIP_STATIC_LIBRARY "${HDF_PACKAGE_NAMESPACE}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-shared SZIP) - set (SZIP_SHARED_LIBRARY "szip-shared") + add_library(${HDF_PACKAGE_NAMESPACE}szip-shared SHARED IMPORTED) + HDF_IMPORT_SET_LIB_OPTIONS (${HDF_PACKAGE_NAMESPACE}szip-shared "szip" SHARED "") + add_dependencies (${HDF_PACKAGE_NAMESPACE}szip-shared SZIP) + set (SZIP_SHARED_LIBRARY "${HDF_PACKAGE_NAMESPACE}szip-shared") set (SZIP_LIBRARIES ${SZIP_LIBRARIES} ${SZIP_SHARED_LIBRARY}) endif () @@ -196,32 +163,14 @@ macro (PACKAGE_SZIP_LIBRARY compress_type) COMMENT "Copying ${SZIP_INCLUDE_DIR_GEN}/SZconfig.h to ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/" ) set (EXTERNAL_HEADER_LIST ${EXTERNAL_HEADER_LIST} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/SZconfig.h) - if (${compress_type} MATCHES "GIT" OR ${compress_type} MATCHES "SVN" OR ${compress_type} MATCHES "TGZ") + if (${compress_type} MATCHES "GIT" OR ${compress_type} MATCHES "TGZ") add_dependencies (SZIP-GenHeader-Copy SZIP) endif () endmacro () #------------------------------------------------------------------------------- macro (EXTERNAL_ZLIB_LIBRARY compress_type) - if (${compress_type} MATCHES "SVN") - EXTERNALPROJECT_ADD (ZLIB - SVN_REPOSITORY ${ZLIB_URL} - # [SVN_REVISION rev] - INSTALL_COMMAND "" - CMAKE_ARGS - -DBUILD_SHARED_LIBS:BOOL=${BUILD_SHARED_LIBS} - -DZLIB_PACKAGE_EXT:STRING=${HDF_PACKAGE_EXT} - -DZLIB_EXTERNALLY_CONFIGURED:BOOL=OFF - -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE} - -DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_INSTALL_PREFIX} - -DCMAKE_RUNTIME_OUTPUT_DIRECTORY:PATH=${CMAKE_RUNTIME_OUTPUT_DIRECTORY} - -DCMAKE_LIBRARY_OUTPUT_DIRECTORY:PATH=${CMAKE_LIBRARY_OUTPUT_DIRECTORY} - -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY:PATH=${CMAKE_ARCHIVE_OUTPUT_DIRECTORY} - -DCMAKE_PDB_OUTPUT_DIRECTORY:PATH=${CMAKE_PDB_OUTPUT_DIRECTORY} - -DCMAKE_ANSI_CFLAGS:STRING=${CMAKE_ANSI_CFLAGS} - -DCMAKE_TOOLCHAIN_FILE:STRING=${CMAKE_TOOLCHAIN_FILE} - ) - elseif (${compress_type} MATCHES "GIT") + if (${compress_type} MATCHES "GIT") EXTERNALPROJECT_ADD (ZLIB GIT_REPOSITORY ${ZLIB_URL} GIT_TAG ${ZLIB_BRANCH} @@ -238,6 +187,7 @@ macro (EXTERNAL_ZLIB_LIBRARY compress_type) -DCMAKE_PDB_OUTPUT_DIRECTORY:PATH=${CMAKE_PDB_OUTPUT_DIRECTORY} -DCMAKE_ANSI_CFLAGS:STRING=${CMAKE_ANSI_CFLAGS} -DCMAKE_TOOLCHAIN_FILE:STRING=${CMAKE_TOOLCHAIN_FILE} + -DPACKAGE_NAMESPACE=${HDF_PACKAGE_NAMESPACE} ) elseif (${compress_type} MATCHES "TGZ") EXTERNALPROJECT_ADD (ZLIB @@ -256,6 +206,7 @@ macro (EXTERNAL_ZLIB_LIBRARY compress_type) -DCMAKE_PDB_OUTPUT_DIRECTORY:PATH=${CMAKE_PDB_OUTPUT_DIRECTORY} -DCMAKE_ANSI_CFLAGS:STRING=${CMAKE_ANSI_CFLAGS} -DCMAKE_TOOLCHAIN_FILE:STRING=${CMAKE_TOOLCHAIN_FILE} + -DPACKAGE_NAMESPACE=${HDF_PACKAGE_NAMESPACE} ) endif () externalproject_get_property (ZLIB BINARY_DIR SOURCE_DIR) @@ -267,17 +218,18 @@ macro (EXTERNAL_ZLIB_LIBRARY compress_type) endif () ##include (${BINARY_DIR}/${ZLIB_PACKAGE_NAME}${HDF_PACKAGE_EXT}-targets.cmake) # Create imported target zlib-static - add_library(zlib-static STATIC IMPORTED) - HDF_IMPORT_SET_LIB_OPTIONS (zlib-static ${ZLIB_LIB_NAME} STATIC "") - add_dependencies (zlib-static ZLIB) - set (ZLIB_STATIC_LIBRARY "zlib-static") + add_library(${HDF_PACKAGE_NAMESPACE}zlib-static STATIC IMPORTED) +# add_library(${HDF_PACKAGE_NAMESPACE}zlib-static ALIAS zlib-static) + HDF_IMPORT_SET_LIB_OPTIONS (${HDF_PACKAGE_NAMESPACE}zlib-static ${ZLIB_LIB_NAME} STATIC "") + add_dependencies (${HDF_PACKAGE_NAMESPACE}zlib-static ZLIB) + set (ZLIB_STATIC_LIBRARY "${HDF_PACKAGE_NAMESPACE}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-shared ZLIB) - set (ZLIB_SHARED_LIBRARY "zlib-shared") + add_library(${HDF_PACKAGE_NAMESPACE}zlib-shared SHARED IMPORTED) + HDF_IMPORT_SET_LIB_OPTIONS (${HDF_PACKAGE_NAMESPACE}zlib-shared ${ZLIB_LIB_NAME} SHARED "") + add_dependencies (${HDF_PACKAGE_NAMESPACE}zlib-shared ZLIB) + set (ZLIB_SHARED_LIBRARY "${HDF_PACKAGE_NAMESPACE}zlib-shared") set (ZLIB_LIBRARIES ${ZLIB_LIBRARIES} ${ZLIB_SHARED_LIBRARY}) endif () @@ -294,7 +246,7 @@ macro (PACKAGE_ZLIB_LIBRARY compress_type) COMMENT "Copying ${ZLIB_INCLUDE_DIR_GEN}/zconf.h to ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/" ) set (EXTERNAL_HEADER_LIST ${EXTERNAL_HEADER_LIST} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/zconf.h) - if (${compress_type} MATCHES "GIT" OR ${compress_type} MATCHES "SVN" OR ${compress_type} MATCHES "TGZ") + if (${compress_type} MATCHES "GIT" OR ${compress_type} MATCHES "TGZ") add_dependencies (ZLIB-GenHeader-Copy ZLIB) endif () endmacro () diff --git a/config/cmake_ext_mod/HDFMacros.cmake b/config/cmake_ext_mod/HDFMacros.cmake index 2f4ce52..9da5006 100644 --- a/config/cmake_ext_mod/HDFMacros.cmake +++ b/config/cmake_ext_mod/HDFMacros.cmake @@ -28,7 +28,7 @@ macro (SET_HDF_BUILD_TYPE) endif() endif() if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) - message(STATUS "Setting build type to 'RelWithDebInfo' as none was specified.") + message (STATUS "Setting build type to 'RelWithDebInfo' as none was specified.") set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "Choose the type of build." FORCE) # Set the possible values of build type for cmake-gui set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" @@ -224,10 +224,9 @@ macro (TARGET_C_PROPERTIES wintarget libtype) $<$<C_COMPILER_ID:MSVC>:${WIN_COMPILE_FLAGS}> $<$<CXX_COMPILER_ID:MSVC>:${WIN_COMPILE_FLAGS}> ) - target_link_libraries(${wintarget} INTERFACE - $<$<C_COMPILER_ID:MSVC>:${WIN_LINK_FLAGS}> - $<$<CXX_COMPILER_ID:MSVC>:${WIN_LINK_FLAGS}> - ) + if(MSVC) + set_property(TARGET ${wintarget} APPEND PROPERTY LINK_FLAGS "${WIN_LINK_FLAGS}") + endif() endmacro () #----------------------------------------------------------------------------- @@ -294,7 +293,9 @@ macro (HDF_README_PROPERTIES target_fortran) set (BINARY_PLATFORM "${BINARY_PLATFORM} / ${CMAKE_Fortran_COMPILER_ID} Fortran") endif () - if (BUILD_SHARED_LIBS) + if (ONLY_SHARED_LIBS) + set (LIB_TYPE "Shared") + elseif (BUILD_SHARED_LIBS) set (LIB_TYPE "Static and Shared") else () set (LIB_TYPE "Static") diff --git a/config/cmake_ext_mod/HDFUseCXX.cmake b/config/cmake_ext_mod/HDFUseCXX.cmake index efaa556..8d98147 100644 --- a/config/cmake_ext_mod/HDFUseCXX.cmake +++ b/config/cmake_ext_mod/HDFUseCXX.cmake @@ -96,7 +96,7 @@ endmacro () # Check a bunch of cxx functions #----------------------------------------------------------------------------- if (CMAKE_CXX_COMPILER_LOADED) - foreach (test + foreach (cxx_test OLD_HEADER_FILENAME HDF_NO_NAMESPACE HDF_NO_STD @@ -104,6 +104,6 @@ if (CMAKE_CXX_COMPILER_LOADED) NO_STATIC_CAST CXX_HAVE_OFFSETOF ) - HDF_CXX_FUNCTION_TEST (${test}) + HDF_CXX_FUNCTION_TEST (${cxx_test}) endforeach () endif () diff --git a/config/cmake_ext_mod/HDFUseFortran.cmake b/config/cmake_ext_mod/HDFUseFortran.cmake index c68c921..bed1fc1 100644 --- a/config/cmake_ext_mod/HDFUseFortran.cmake +++ b/config/cmake_ext_mod/HDFUseFortran.cmake @@ -13,7 +13,7 @@ # This file provides functions for Fortran support. # #------------------------------------------------------------------------------- -ENABLE_LANGUAGE (Fortran) +enable_language (Fortran) set (HDF_PREFIX "H5") #------------------------------------------------------------------------------- @@ -65,9 +65,9 @@ macro (CHECK_FORTRAN_FEATURE FUNCTION CODE VARIABLE) OUTPUT_VARIABLE OUTPUT ) -# message ( "* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ") -# message ( "Test result ${OUTPUT}") -# message ( "* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ") +# message (STATUS "* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ") +# message (STATUS "Test result ${OUTPUT}") +# message (STATUS "* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ") if (${RESULT_VAR}) set (${VARIABLE} 1 CACHE INTERNAL "Have Fortran function ${FUNCTION}") diff --git a/config/cmake_ext_mod/grepTest.cmake b/config/cmake_ext_mod/grepTest.cmake index 1417204..4b58639 100644 --- a/config/cmake_ext_mod/grepTest.cmake +++ b/config/cmake_ext_mod/grepTest.cmake @@ -20,7 +20,7 @@ endif () # message (STATUS "Require TEST_ARGS to be defined") #endif () if (NOT TEST_FOLDER) - message ( FATAL_ERROR "Require TEST_FOLDER to be defined") + message (FATAL_ERROR "Require TEST_FOLDER to be defined") endif () if (NOT TEST_OUTPUT) message (FATAL_ERROR "Require TEST_OUTPUT to be defined") @@ -29,14 +29,35 @@ endif () # message (STATUS "Require TEST_EXPECT to be defined") #endif () if (NOT TEST_FILTER) - message (STATUS "Require TEST_FILTER to be defined") + message (STATUS "Optional TEST_FILTER to be defined") endif () if (NOT TEST_REFERENCE) message (FATAL_ERROR "Require TEST_REFERENCE to be defined") endif () +if (EXISTS ${TEST_FOLDER}/${TEST_OUTPUT}) + file (REMOVE ${TEST_FOLDER}/${TEST_OUTPUT}) +endif () + +if (EXISTS ${TEST_FOLDER}/${TEST_OUTPUT}.err) + file (REMOVE ${TEST_FOLDER}/${TEST_OUTPUT}.err) +endif () + message (STATUS "COMMAND: ${TEST_PROGRAM} ${TEST_ARGS}") +if (TEST_LIBRARY_DIRECTORY) + if (WIN32 AND NOT MINGW) + set (ENV{PATH} "$ENV{PATH};${TEST_LIBRARY_DIRECTORY}") + else () + set (ENV{LD_LIBRARY_PATH} "$ENV{LD_LIBRARY_PATH}:${TEST_LIBRARY_DIRECTORY}") + endif () +endif () + +if (TEST_ENV_VAR) + set (ENV{${TEST_ENV_VAR}} "${TEST_ENV_VALUE}") + #message (STATUS "ENV:${TEST_ENV_VAR}=$ENV{${TEST_ENV_VAR}}") +endif () + # run the test program, capture the stdout/stderr and the result var execute_process ( COMMAND ${TEST_PROGRAM} ${TEST_ARGS} @@ -49,27 +70,117 @@ execute_process ( ) message (STATUS "COMMAND Result: ${TEST_RESULT}") + message (STATUS "COMMAND Error: ${TEST_ERROR}") -# now grep the output with the reference +# remove special output file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) +string (FIND TEST_STREAM "_pmi_alps" "${TEST_FIND_RESULT}") +if (TEST_FIND_RESULT GREATER 0) + string (REGEX REPLACE "^.*_pmi_alps[^\n]+\n" "" TEST_STREAM "${TEST_STREAM}") + file (WRITE ${TEST_FOLDER}/${TEST_OUTPUT} ${TEST_STREAM}) +endif () -# TEST_REFERENCE should always be matched -string (REGEX MATCH "${TEST_REFERENCE}" TEST_MATCH ${TEST_STREAM}) -string (COMPARE EQUAL "${TEST_REFERENCE}" "${TEST_MATCH}" TEST_RESULT) -if (NOT TEST_RESULT) - message (FATAL_ERROR "Failed: The output of ${TEST_PROGRAM} did not contain ${TEST_REFERENCE}") +# if the TEST_ERRREF exists grep the error output with the error reference +if (TEST_ERRREF) + # if the .err file exists grep the error output with the error reference before comparing stdout + if (EXISTS ${TEST_FOLDER}/${TEST_OUTPUT}.err) + file (READ ${TEST_FOLDER}/${TEST_OUTPUT}.err TEST_ERR_STREAM) + + # TEST_ERRREF should always be matched + string (REGEX MATCH "${TEST_ERRREF}" TEST_MATCH ${TEST_ERR_STREAM}) + string (COMPARE EQUAL "${TEST_ERRREF}" "${TEST_MATCH}" TEST_RESULT) + if (NOT TEST_RESULT) + message (FATAL_ERROR "Failed: The error output of ${TEST_PROGRAM} did not contain ${TEST_ERRREF}") + endif () + endif () + + #always compare output file to reference unless this must be skipped + if (NOT TEST_SKIP_COMPARE) + if (EXISTS ${TEST_FOLDER}/${TEST_REFERENCE}) + if (WIN32 AND NOT MINGW) + file (READ ${TEST_FOLDER}/${TEST_REFERENCE} TEST_STREAM) + file (WRITE ${TEST_FOLDER}/${TEST_REFERENCE} "${TEST_STREAM}") + endif () + if (NOT TEST_SORT_COMPARE) + # now compare the output with the reference + execute_process ( + COMMAND ${CMAKE_COMMAND} -E compare_files ${TEST_FOLDER}/${TEST_OUTPUT} ${TEST_FOLDER}/${TEST_REFERENCE} + RESULT_VARIABLE TEST_RESULT + ) + else () + file (STRINGS ${TEST_FOLDER}/${TEST_OUTPUT} v1) + file (STRINGS ${TEST_FOLDER}/${TEST_REFERENCE} v2) + list (SORT v1) + list (SORT v2) + if (NOT v1 STREQUAL v2) + set(TEST_RESULT 1) + endif () + endif () + + if (TEST_RESULT) + set (TEST_RESULT 0) + file (STRINGS ${TEST_FOLDER}/${TEST_OUTPUT} test_act) + list (LENGTH test_act len_act) + file (STRINGS ${TEST_FOLDER}/${TEST_REFERENCE} test_ref) + list (LENGTH test_ref len_ref) + if (len_act GREATER 0 AND len_ref GREATER 0) + math (EXPR _FP_LEN "${len_ref} - 1") + foreach (line RANGE 0 ${_FP_LEN}) + list (GET test_act ${line} str_act) + list (GET test_ref ${line} str_ref) + if (NOT str_act STREQUAL str_ref) + if (str_act) + set (TEST_RESULT 1) + message (STATUS "line = ${line}\n***ACTUAL: ${str_act}\n****REFER: ${str_ref}\n") + endif () + endif () + endforeach () + else () + if (len_act EQUAL 0) + message (STATUS "COMPARE Failed: ${TEST_FOLDER}/${TEST_OUTPUT} is empty") + endif () + if (len_ref EQUAL 0) + message (STATUS "COMPARE Failed: ${TEST_FOLDER}/${TEST_REFERENCE} is empty") + endif () + endif () + if (NOT len_act EQUAL len_ref) + set (TEST_RESULT 1) + endif () + endif () + + message (STATUS "COMPARE Result: ${TEST_RESULT}") + + # again, if return value is !=0 scream and shout + if (TEST_RESULT) + message (FATAL_ERROR "Failed: The output of ${TEST_OUTPUT} did not match ${TEST_REFERENCE}") + endif () + endif () + endif () +else () + # else grep the output with the reference + file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) + + # TEST_REFERENCE should always be matched + string (REGEX MATCH "${TEST_REFERENCE}" TEST_MATCH ${TEST_STREAM}) + string (COMPARE EQUAL "${TEST_REFERENCE}" "${TEST_MATCH}" TEST_RESULT) + if (NOT TEST_RESULT) + message (FATAL_ERROR "Failed: The output of ${TEST_PROGRAM} did not contain ${TEST_REFERENCE}") + endif () endif () -string (REGEX MATCH "${TEST_FILTER}" TEST_MATCH ${TEST_STREAM}) -if (TEST_EXPECT) - # TEST_EXPECT (1) interprets TEST_FILTER as; NOT to match - string (LENGTH "${TEST_MATCH}" TEST_RESULT) - if (TEST_RESULT) - message (FATAL_ERROR "Failed: The output of ${TEST_PROGRAM} did contain ${TEST_FILTER}") + +if (TEST_FILTER) + string (REGEX MATCH "${TEST_FILTER}" TEST_MATCH ${TEST_STREAM}) + if (TEST_EXPECT) + # TEST_EXPECT (1) interprets TEST_FILTER as; NOT to match + string (LENGTH "${TEST_MATCH}" TEST_RESULT) + if (TEST_RESULT) + message (FATAL_ERROR "Failed: The output of ${TEST_PROGRAM} did contain ${TEST_FILTER}") + endif () endif () endif () # everything went fine... -message ("Passed: The output of ${TEST_PROGRAM} matched") +message (STATUS "Passed: The output of ${TEST_PROGRAM} matched") diff --git a/config/cmake_ext_mod/runTest.cmake b/config/cmake_ext_mod/runTest.cmake index 48402a2..c9508f3 100644 --- a/config/cmake_ext_mod/runTest.cmake +++ b/config/cmake_ext_mod/runTest.cmake @@ -18,7 +18,7 @@ if (NOT TEST_PROGRAM) message (FATAL_ERROR "Require TEST_PROGRAM to be defined") endif () if (NOT TEST_FOLDER) - message ( FATAL_ERROR "Require TEST_FOLDER to be defined") + message (FATAL_ERROR "Require TEST_FOLDER to be defined") endif () if (NOT TEST_OUTPUT) message (FATAL_ERROR "Require TEST_OUTPUT to be defined") @@ -218,10 +218,10 @@ if (NOT TEST_SKIP_COMPARE) foreach (line RANGE 0 ${_FP_LEN}) list (GET test_act ${line} str_act) list (GET test_ref ${line} str_ref) - if (NOT ${str_act} STREQUAL ${str_ref}) - if (NOT str_act STREQUAL "") + if (NOT str_act STREQUAL str_ref) + if (str_act) set (TEST_RESULT 1) - message ("line = ${line}\n***ACTUAL: ${str_act}\n****REFER: ${str_ref}\n") + message (STATUS "line = ${line}\n***ACTUAL: ${str_act}\n****REFER: ${str_ref}\n") endif () endif () endforeach () @@ -270,10 +270,10 @@ if (NOT TEST_SKIP_COMPARE) foreach (line RANGE 0 ${_FP_LEN}) list (GET test_act ${line} str_act) list (GET test_ref ${line} str_ref) - if (NOT ${str_act} STREQUAL ${str_ref}) - if (NOT ${str_act} STREQUAL "") + if (NOT str_act STREQUAL str_ref) + if (str_act) set (TEST_RESULT 1) - message ("line = ${line}\n***ACTUAL: ${str_act}\n****REFER: ${str_ref}\n") + message (STATUS "line = ${line}\n***ACTUAL: ${str_act}\n****REFER: ${str_ref}\n") endif () endif () endforeach () @@ -321,5 +321,5 @@ if (TEST_GREP_COMPARE) endif () # everything went fine... -message ("${TEST_PROGRAM} Passed") +message (STATUS "${TEST_PROGRAM} Passed") diff --git a/config/commence.am b/config/commence.am index 5d88a88..a16eee5 100644 --- a/config/commence.am +++ b/config/commence.am @@ -97,8 +97,8 @@ CHECK_CLEANFILES=*.chkexe *.chklog *.clog *.clog2 # exists. .PHONY: build-check-clean build-check-p build-check-s build-lib build-progs \ build-tests check-clean check-install check-p check-s check-vfd \ - check-vol install-doc lib progs tests uninstall-doc _exec_check-s \ - _test help + check-passthrough-vol install-doc lib progs tests uninstall-doc \ + _exec_check-s _test help help: @$(top_srcdir)/bin/makehelp diff --git a/config/conclude.am b/config/conclude.am index 9da1da5..2eec03a 100644 --- a/config/conclude.am +++ b/config/conclude.am @@ -282,8 +282,10 @@ check-vfd: $(LIB) $(PROGS) $(chk_TESTS) fi; \ done -# Run test with different Virtual Object Layer Connector -check-vol: $(LIB) $(PROGS) $(chk_TESTS) +# Run test with different passthrough Virtual Object Layer Connector +# NOTE: Will only succeed with passthrough VOL connectors that use +# the native VOL connector as the terminal connector. +check-passthrough-vol: $(LIB) $(PROGS) $(chk_TESTS) @for vol in $(VOL_LIST) dummy; do \ if test "$$vol" != dummy; then \ echo "============================"; \ diff --git a/config/gnu-flags b/config/gnu-flags index 225f072..c55391d 100644 --- a/config/gnu-flags +++ b/config/gnu-flags @@ -1,4 +1,4 @@ -# -*- shell-script -*- +# -*- shell-script -*- # # Copyright by The HDF Group. # Copyright by the Board of Trustees of the University of Illinois. @@ -37,10 +37,10 @@ if test X = "X$cc_flags_set"; then cc_vendor=`echo $cc_version |sed 's/\([a-z]*\).*/\1/'` cc_version=`echo $cc_version |sed 's/[-a-z]//g'` if test X = "X$cc_vendor" -a X != "X$cc_version"; then - cc_vendor=gcc + cc_vendor=gcc fi if test "-" != "$cc_vendor-$cc_version"; then - echo "compiler '$CC' is GNU $cc_vendor-$cc_version" + echo "compiler '$CC' is GNU $cc_vendor-$cc_version" fi # Some version numbers @@ -87,7 +87,7 @@ case "$cc_vendor-$cc_version" in case "$host_os-$host_cpu" in # cygwin needs the "-std=c99" flag removed, so make # a specific case for Cygwin without the flag and a default - # case to add the flag everywhere else + # case to add the flag everywhere else cygwin-*) ;; @@ -111,13 +111,13 @@ case "$cc_vendor-$cc_version" in # know if they do start showing up. # # NOTE: Don't add -Wpadded here since we can't/won't fix the (many) - # warnings that are emitted. If you need it, add it from the + # warnings that are emitted. If you need it, add it from the # environment variable at configure time. H5_CFLAGS="$H5_CFLAGS $arch -pedantic -Wall -Wextra -Wbad-function-cast -Wc++-compat -Wcast-align" H5_CFLAGS="$H5_CFLAGS -Wcast-qual -Wconversion -Wdeclaration-after-statement -Wdisabled-optimization -Wfloat-equal" H5_CFLAGS="$H5_CFLAGS -Wformat=2 -Winit-self -Winvalid-pch -Wmissing-declarations -Wmissing-include-dirs" H5_CFLAGS="$H5_CFLAGS -Wmissing-prototypes -Wnested-externs -Wold-style-definition -Wpacked -Wpointer-arith" - H5_CFLAGS="$H5_CFLAGS -Wredundant-decls -Wshadow -Wstrict-prototypes -Wswitch-default -Wswitch-enum" + H5_CFLAGS="$H5_CFLAGS -Wredundant-decls -Wshadow -Wstrict-prototypes -Wswitch-enum -Wswitch-default" H5_CFLAGS="$H5_CFLAGS -Wundef -Wunused-macros -Wunsafe-loop-optimizations -Wwrite-strings" # Production @@ -126,7 +126,7 @@ case "$cc_vendor-$cc_version" in gcc-4.*) PROD_CFLAGS= ;; - gcc-[56].*) + gcc-[56789].*) PROD_CFLAGS="-fstdarg-opt" ;; *) @@ -140,7 +140,7 @@ case "$cc_vendor-$cc_version" in # NDEBUG is handled explicitly by the configure script # -g is handled by the symbols flags case "$cc_vendor-$cc_version" in - gcc-[56].*) + gcc-[56789].*) DEBUG_CFLAGS="-ftrapv -fno-common" ;; *) @@ -165,7 +165,7 @@ case "$cc_vendor-$cc_version" in HIGH_OPT_CFLAGS="-O3" DEBUG_OPT_CFLAGS= ;; - gcc-[56].*) + gcc-[56789].*) HIGH_OPT_CFLAGS="-O3" DEBUG_OPT_CFLAGS="-Og" ;; @@ -187,9 +187,53 @@ esac # the information from the previous version and adding modifications to that. case "$cc_vendor-$cc_version" in -# When the gcc 7.x release is out, we should check for additional flags to +# When the gcc 8.x release is out, we should check for additional flags to # include and break it out into it's own section, like the other versions # below. -QAK + gcc-[789].*) + # Append warning flags that only gcc 4.2+ knows about + # (none, or incorporated in -Wall / -Wextra now) + + # Append warning flags that only gcc 4.3+ knows about + # + # Technically, variable-length arrays are part of the C99 standard, but + # we should approach them a bit cautiously... -QAK + H5_CFLAGS="$H5_CFLAGS -Wlogical-op -Wlarger-than=2048 -Wvla" + + # Append warning flags that only gcc 4.4+ knows about + H5_CFLAGS="$H5_CFLAGS -Wsync-nand -Wframe-larger-than=16384 -Wpacked-bitfield-compat" + + # Append warning flags that only gcc 4.5+ knows about + H5_CFLAGS="$H5_CFLAGS -Wstrict-overflow=5 -Wjump-misses-init -Wunsuffixed-float-constants" + + # Append warning flags that only gcc 4.6+ knows about + H5_CFLAGS="$H5_CFLAGS -Wdouble-promotion -Wtrampolines" + DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS -Wsuggest-attribute=const" + NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS -Wno-suggest-attribute=const" + + # Append warning flags that only gcc 4.7+ knows about + H5_CFLAGS="$H5_CFLAGS -Wstack-usage=8192 -Wvector-operation-performance" + DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS -Wsuggest-attribute=pure -Wsuggest-attribute=noreturn" + NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS -Wno-suggest-attribute=pure -Wno-suggest-attribute=noreturn" + + # Append warning flags that only gcc 4.8+ knows about + DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS -Wsuggest-attribute=format" + NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS -Wno-suggest-attribute=format" + + # Append warning flags that only gcc 4.9+ knows about + H5_CFLAGS="$H5_CFLAGS -Wdate-time" + + # Append warning flags that only gcc 5.x+ knows about + H5_CFLAGS="$H5_CFLAGS -Warray-bounds=2 -Wc99-c11-compat" + + # Append warning flags that only gcc 6.x+ knows about + H5_CFLAGS="$H5_CFLAGS -Wnull-dereference -Wunused-const-variable -Wduplicated-cond -Whsa -Wnormalized" + + # Append warning flags that only gcc 7.x+ knows about + DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS -Wstringop-overflow=2" + H5_CFLAGS="$H5_CFLAGS -Walloc-zero -Walloca -Wduplicated-branches -Wformat-overflow=2 -Wformat-truncation=2 -Wimplicit-fallthrough=5 -Wrestrict" + ;; + gcc-6*) # Append warning flags that only gcc 4.2+ knows about # (none, or incorporated in -Wall / -Wextra now) @@ -227,7 +271,7 @@ case "$cc_vendor-$cc_version" in H5_CFLAGS="$H5_CFLAGS -Warray-bounds=2 -Wc99-c11-compat" # Append warning flags that only gcc 6.x+ knows about - H5_CFLAGS="$H5_CFLAGS -Wnull-dereference -Wunused-const-variable -Wduplicated-cond -Whsa" + H5_CFLAGS="$H5_CFLAGS -Wnull-dereference -Wunused-const-variable -Wduplicated-cond -Whsa -Wnormalized" ;; gcc-5*) diff --git a/config/toolchain/crayle.cmake b/config/toolchain/crayle.cmake index 159f43a..bf7cf69 100644 --- a/config/toolchain/crayle.cmake +++ b/config/toolchain/crayle.cmake @@ -8,13 +8,3 @@ set(CMAKE_Fortran_COMPILER ftn) # the following is used if cross-compiling set(CMAKE_CROSSCOMPILING_EMULATOR "") - -# option to use pre-generated H5Tinit.c file -set(HDF5_USE_PREGEN OFF) -# directory where H5Tinit.c file will be found -#set(HDF5_USE_PREGEN_DIR "/lscratch1/lknox/HDF5_1_10_4/CMake-hdf5-1.10.4") - -# option to generate H5Tinit.c by running H5detect on knl compute node during build -#set(HDF5_BATCH_H5DETECT ON) -#set(HDF5_BATCH_CMD "sbatch") -#set(HDF5_BATCH_H5DETECT_SCRIPT "knl_H5detect.sl") |