
* Switch hdf5 package from autotools to cmake. * Add variant for building with zlib, default to ON. * Update for format requirements. * Format change. * Fix breakage from last merge from develop. Switch szip to use libaec (unrestricted encryption). Remove 'static' variant: static libs will only be installed when ~shared. * Improve args based on suggestions from pull request. * Update code URL to github.com Add/modify 4 depends_on lines to fix running "spack graph --deptype=link hdf5". * Remove trailing whitespace. * Remove dependencies added solely to make "spack greph --type=link" work. * Add new version HDF5 1.8.22. * Remove unnecessary java_check. * Fix whitespace for style checks. * Reverted zlib version dependency to 1.1.2:. zlib variant removed. api version default renamed "default". * Remove blank line. * Whitespace corrections. * iRemoved unnecessary 'debug' variant. * Fix typo in version number in conflict for '+szip'. * Set default for tools variant to True. Remove patch functions dependent on 'libtool' file that cmake doesn't produce. * Remove line to set ONLY_SHARED_LIBS to true. Add post_install code to install only one version of tools with shared linkage and original tool names. * Remove trailing white space and import of glob package not used. * Leave BUILD_TESTING set to default which is ON. * Remove post_install code to install only one version of tools because some dependent packages running tests in e4s testing are using h5diff-shared. Keep both tools versions for now. * No longer need to import os.
363 lines
13 KiB
Diff
363 lines
13 KiB
Diff
diff --git a/c++/src/CMakeLists.txt b/c++/src/CMakeLists.txt
|
|
index 9b9b745..3f05fa0 100644
|
|
--- a/c++/src/CMakeLists.txt
|
|
+++ b/c++/src/CMakeLists.txt
|
|
@@ -178,7 +178,11 @@ install (
|
|
)
|
|
|
|
if (NOT WIN32)
|
|
- set (_PKG_CONFIG_COMPILER ${CMAKE_CXX_COMPILER})
|
|
+ if (HDF5_ENABLE_PARALLEL AND MPI_CXX_FOUND)
|
|
+ set (_PKG_CONFIG_COMPILER ${MPI_CXX_COMPILER})
|
|
+ else ()
|
|
+ set (_PKG_CONFIG_COMPILER ${CMAKE_CXX_COMPILER})
|
|
+ endif ()
|
|
configure_file (
|
|
${HDF_RESOURCES_DIR}/libh5cc.in
|
|
${HDF5_BINARY_DIR}/CMakeFiles/h5c++
|
|
diff --git a/config/cmake_ext_mod/FindSZIP.cmake b/config/cmake_ext_mod/FindSZIP.cmake
|
|
index 699be85..846a3d1 100644
|
|
--- a/config/cmake_ext_mod/FindSZIP.cmake
|
|
+++ b/config/cmake_ext_mod/FindSZIP.cmake
|
|
@@ -5,140 +5,112 @@
|
|
# 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.
|
|
+# distribution tree, or in https://www.hdfgroup.org/licenses.
|
|
# 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(SelectLibraryConfigurations)
|
|
+ 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(FindPackageHandleStandardArgs)
|
|
+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)
|
|
@@ -146,36 +118,12 @@ if (NOT SZIP_FOUND)
|
|
"SZip was not found. Make sure SZIP_LIBRARY and SZIP_INCLUDE_DIR are set or set the SZIP_INSTALL environment variable."
|
|
)
|
|
if (NOT SZIP_FIND_QUIETLY)
|
|
- message (STATUS "${SZIP_DIR_MESSAGE}")
|
|
+ if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0")
|
|
+ message (VERBOSE "${SZIP_DIR_MESSAGE}")
|
|
+ endif ()
|
|
else ()
|
|
if (SZIP_FIND_REQUIRED)
|
|
message (FATAL_ERROR "SZip was NOT found and is Required by this project")
|
|
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/hl/c++/src/CMakeLists.txt b/hl/c++/src/CMakeLists.txt
|
|
index 7949b73..a633bdd 100644
|
|
--- a/hl/c++/src/CMakeLists.txt
|
|
+++ b/hl/c++/src/CMakeLists.txt
|
|
@@ -102,7 +102,11 @@ install (
|
|
)
|
|
|
|
if (NOT WIN32)
|
|
- set (_PKG_CONFIG_COMPILER ${CMAKE_CXX_COMPILER})
|
|
+ if (HDF5_ENABLE_PARALLEL AND MPI_CXX_FOUND)
|
|
+ set (_PKG_CONFIG_COMPILER ${MPI_CXX_COMPILER})
|
|
+ else ()
|
|
+ set (_PKG_CONFIG_COMPILER ${CMAKE_CXX_COMPILER})
|
|
+ endif ()
|
|
configure_file (
|
|
${HDF_RESOURCES_DIR}/libh5cc.in
|
|
${HDF5_BINARY_DIR}/CMakeFiles/h5hlc++
|
|
diff --git a/hl/src/CMakeLists.txt b/hl/src/CMakeLists.txt
|
|
index d570265..e652ed3 100644
|
|
--- a/hl/src/CMakeLists.txt
|
|
+++ b/hl/src/CMakeLists.txt
|
|
@@ -118,7 +118,11 @@ install (
|
|
)
|
|
|
|
if (NOT WIN32)
|
|
- set (_PKG_CONFIG_COMPILER ${CMAKE_C_COMPILER})
|
|
+ if (HDF5_ENABLE_PARALLEL AND MPI_C_FOUND)
|
|
+ set (_PKG_CONFIG_COMPILER ${MPI_C_COMPILER})
|
|
+ else ()
|
|
+ set (_PKG_CONFIG_COMPILER ${CMAKE_C_COMPILER})
|
|
+ endif ()
|
|
configure_file (
|
|
${HDF_RESOURCES_DIR}/libh5cc.in
|
|
${HDF5_BINARY_DIR}/CMakeFiles/h5hlcc
|
|
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
|
|
index 4d2f1bc..39cfbca 100644
|
|
--- a/src/CMakeLists.txt
|
|
+++ b/src/CMakeLists.txt
|
|
@@ -820,7 +820,11 @@ install (
|
|
)
|
|
|
|
if (NOT WIN32)
|
|
- set (_PKG_CONFIG_COMPILER ${CMAKE_C_COMPILER})
|
|
+ if (HDF5_ENABLE_PARALLEL AND MPI_C_FOUND)
|
|
+ set (_PKG_CONFIG_COMPILER ${MPI_C_COMPILER})
|
|
+ else ()
|
|
+ set (_PKG_CONFIG_COMPILER ${CMAKE_C_COMPILER})
|
|
+ endif ()
|
|
configure_file (
|
|
${HDF_RESOURCES_DIR}/libh5cc.in
|
|
${HDF5_BINARY_DIR}/CMakeFiles/h5cc
|
|
@@ -832,4 +836,18 @@ if (NOT WIN32)
|
|
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
|
|
COMPONENT libraries
|
|
)
|
|
+ if (HDF5_ENABLE_PARALLEL AND MPI_C_FOUND)
|
|
+ #legacy requires a different name
|
|
+ configure_file (
|
|
+ ${HDF_RESOURCES_DIR}/libh5cc.in
|
|
+ ${HDF5_BINARY_DIR}/CMakeFiles/h5pcc
|
|
+ @ONLY
|
|
+ )
|
|
+ install (
|
|
+ FILES ${HDF5_BINARY_DIR}/CMakeFiles/h5pcc
|
|
+ DESTINATION ${HDF5_INSTALL_BIN_DIR}
|
|
+ PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
|
|
+ COMPONENT libraries
|
|
+ )
|
|
+ endif ()
|
|
endif ()
|