summaryrefslogtreecommitdiffstats
path: root/config
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2016-10-14 17:35:40 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2016-10-14 17:35:40 (GMT)
commit06b2da91654ec879064dfd1205a4452b402a948d (patch)
tree1aaca1227a04bdde1c620ab9e7acf98f36274d07 /config
parentb00920b338a35147556591ced6e4a44b81ce7187 (diff)
downloadhdf5-06b2da91654ec879064dfd1205a4452b402a948d.zip
hdf5-06b2da91654ec879064dfd1205a4452b402a948d.tar.gz
hdf5-06b2da91654ec879064dfd1205a4452b402a948d.tar.bz2
Add namespace and export utils
Diffstat (limited to 'config')
-rw-r--r--config/cmake/README.txt.cmake.in2
-rw-r--r--config/cmake/hdf5-config.cmake.in4
-rw-r--r--config/cmake/mccacheinit.cmake2
-rwxr-xr-xconfig/cmake/scripts/CTestScript.cmake16
-rw-r--r--config/cmake_ext_mod/FindMPI.cmake76
5 files changed, 53 insertions, 47 deletions
diff --git a/config/cmake/README.txt.cmake.in b/config/cmake/README.txt.cmake.in
index b03f6d0..9bd9eb2 100644
--- a/config/cmake/README.txt.cmake.in
+++ b/config/cmake/README.txt.cmake.in
@@ -39,7 +39,7 @@ To test the installation with the examples;
The default installation folder is defined as "@CMAKE_INSTALL_PREFIX@".
It can be changed with the INSTALLDIR script option.
The default ctest configuration is defined as "Release". It can be changed
- with the CTEST_BUILD_CONFIGURATION script option. Note that this must
+ with the CTEST_CONFIGURATION_TYPE script option. Note that this must
be the same as the value used with the -C command line option.
The default build configuration is defined to build and use static libraries.
Shared libraries can be used with the STATICLIBRARIES script option set to "NO".
diff --git a/config/cmake/hdf5-config.cmake.in b/config/cmake/hdf5-config.cmake.in
index 52d6baf..3584315 100644
--- a/config/cmake/hdf5-config.cmake.in
+++ b/config/cmake/hdf5-config.cmake.in
@@ -144,12 +144,12 @@ foreach (libtype IN LISTS ${HDF5_PACKAGE_NAME}_LIB_TYPE)
else ()
set (${HDF5_PACKAGE_NAME}_${libtype}_${comp}_FOUND 1)
string(TOUPPER ${HDF5_PACKAGE_NAME}_${comp}_${libtype}_LIBRARY COMP_LIBRARY)
- set (${COMP_LIBRARY} ${${COMP_LIBRARY}} ${hdf5_comp2}-${libtype} ${hdf5_comp}-${libtype})
+ set (${COMP_LIBRARY} ${${COMP_LIBRARY}} @HDF5_PACKAGE@::${hdf5_comp2}-${libtype} @HDF5_PACKAGE@::${hdf5_comp}-${libtype})
endif ()
else ()
set (${HDF5_PACKAGE_NAME}_${libtype}_${comp}_FOUND 1)
string(TOUPPER ${HDF5_PACKAGE_NAME}_${comp}_${libtype}_LIBRARY COMP_LIBRARY)
- set (${COMP_LIBRARY} ${${COMP_LIBRARY}} ${hdf5_comp}-${libtype})
+ set (${COMP_LIBRARY} ${${COMP_LIBRARY}} @HDF5_PACKAGE@::${hdf5_comp}-${libtype})
endif ()
endif ()
endforeach ()
diff --git a/config/cmake/mccacheinit.cmake b/config/cmake/mccacheinit.cmake
index 3b665f2..991614a 100644
--- a/config/cmake/mccacheinit.cmake
+++ b/config/cmake/mccacheinit.cmake
@@ -69,7 +69,7 @@ set (SZIP_TGZ_NAME "SZip.tar.gz" CACHE STRING "Use SZip from compressed file" FO
set (CMAKE_BUILD_TYPE "Debug" CACHE STRING "Build Debug" FORCE)
-set (CTEST_BUILD_CONFIGURATION "Debug" CACHE STRING "Build Debug" FORCE)
+set (CTEST_CONFIGURATION_TYPE "Debug" CACHE STRING "Build Debug" FORCE)
set (ZLIB_PACKAGE_NAME "zlib" CACHE STRING "Name of ZLIB package" FORCE)
diff --git a/config/cmake/scripts/CTestScript.cmake b/config/cmake/scripts/CTestScript.cmake
index abe252e..a056cfb 100755
--- a/config/cmake/scripts/CTestScript.cmake
+++ b/config/cmake/scripts/CTestScript.cmake
@@ -213,7 +213,7 @@ foreach(v
CTEST_SOURCE_DIRECTORY
CTEST_BINARY_DIRECTORY
CTEST_CMAKE_GENERATOR
- CTEST_BUILD_CONFIGURATION
+ CTEST_CONFIGURATION_TYPE
CTEST_GIT_COMMAND
CTEST_CHECKOUT_COMMAND
CTEST_CONFIGURE_COMMAND
@@ -239,12 +239,18 @@ message(STATUS "Dashboard script configuration:\n${vars}\n")
endif()
configure_file(${CTEST_SOURCE_DIRECTORY}/config/cmake/CTestCustom.cmake ${CTEST_BINARY_DIRECTORY}/CTestCustom.cmake)
ctest_read_custom_files ("${CTEST_BINARY_DIRECTORY}")
- ctest_configure (BUILD "${CTEST_BINARY_DIRECTORY}")
+ ctest_configure (BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res)
+ if(${res} LESS 0 OR ${res} GREATER 0)
+ message(FATAL_ERROR "Failed configure: ${res}\n")
+ endif()
if(LOCAL_SUBMIT)
ctest_submit (PARTS Update Configure Notes)
endif()
- ctest_build (BUILD "${CTEST_BINARY_DIRECTORY}" APPEND)
+ ctest_build (BUILD "${CTEST_BINARY_DIRECTORY}" APPEND RETURN_VALUE res NUMBER_ERRORS errval)
+ if(${res} LESS 0 OR ${res} GREATER 0 OR ${errval} GREATER 0)
+ message(FATAL_ERROR "Failed build: ${res} with Errors=${errval}\n")
+ endif()
if(LOCAL_SUBMIT)
ctest_submit (PARTS Build)
endif()
@@ -255,7 +261,7 @@ message(STATUS "Dashboard script configuration:\n${vars}\n")
if(LOCAL_SUBMIT)
ctest_submit (PARTS Test)
endif()
- if(res GREATER 0)
+ if(${res} LESS 0 OR ${res} GREATER 0)
message(FATAL_ERROR "Failed tests: ${res}\n")
endif()
else()
@@ -276,7 +282,7 @@ message(STATUS "Dashboard script configuration:\n${vars}\n")
##-----------------------------------------------
## Package the product
##-----------------------------------------------
- execute_process(COMMAND cpack -C ${CTEST_BUILD_CONFIGURATION} -V
+ execute_process(COMMAND cpack -C ${CTEST_CONFIGURATION_TYPE} -V
WORKING_DIRECTORY ${CTEST_BINARY_DIRECTORY}
RESULT_VARIABLE cpackResult
OUTPUT_VARIABLE cpackLog
diff --git a/config/cmake_ext_mod/FindMPI.cmake b/config/cmake_ext_mod/FindMPI.cmake
index 1c9a2e3..1a02f82 100644
--- a/config/cmake_ext_mod/FindMPI.cmake
+++ b/config/cmake_ext_mod/FindMPI.cmake
@@ -1,3 +1,5 @@
+# Distributed under the OSI-approved BSD 3-Clause License. See https://cmake.org/licensing for details.
+
#.rst:
# FindMPI
# -------
@@ -11,7 +13,8 @@
# of them have somewhat different include paths, libraries to link
# against, etc., and this module tries to smooth out those differences.
#
-# === Variables ===
+# Variables
+# ^^^^^^^^^
#
# This module will set the following variables per language in your
# project, where <lang> is one of C, CXX, or Fortran:
@@ -37,11 +40,12 @@
# before the executable to run.
# MPIEXEC_POSTFLAGS Flags to pass to MPIEXEC after other flags
#
-# === Usage ===
+# Usage
+# ^^^^^
#
# To use this module, simply call FindMPI from a CMakeLists.txt file, or
-# run find_package(MPI), then run CMake. If you are happy with the
-# auto- detected configuration for your language, then you're done. If
+# run ``find_package(MPI)``, then run CMake. If you are happy with the
+# auto-detected configuration for your language, then you're done. If
# not, you have two options:
#
# ::
@@ -55,24 +59,25 @@
# listed above, but these two are required. This will circumvent
# autodetection entirely.
#
-# When configuration is successful, MPI_<lang>_COMPILER will be set to
-# the compiler wrapper for <lang>, if it was found. MPI_<lang>_FOUND
+# When configuration is successful, ``MPI_<lang>_COMPILER`` will be set to
+# the compiler wrapper for <lang>, if it was found. ``MPI_<lang>_FOUND``
# and other variables above will be set if any MPI implementation was
# found for <lang>, regardless of whether a compiler was found.
#
-# When using MPIEXEC to execute MPI applications, you should typically
-# use all of the MPIEXEC flags as follows:
+# When using ``MPIEXEC`` to execute MPI applications, you should typically
+# use all of the ``MPIEXEC`` flags as follows:
#
# ::
#
# ${MPIEXEC} ${MPIEXEC_NUMPROC_FLAG} PROCS
# ${MPIEXEC_PREFLAGS} EXECUTABLE ${MPIEXEC_POSTFLAGS} ARGS
#
-# where PROCS is the number of processors on which to execute the
-# program, EXECUTABLE is the MPI program, and ARGS are the arguments to
+# where ``PROCS`` is the number of processors on which to execute the
+# program, ``EXECUTABLE`` is the MPI program, and ``ARGS`` are the arguments to
# pass to the MPI program.
#
-# === Backward Compatibility ===
+# Backward Compatibility
+# ^^^^^^^^^^^^^^^^^^^^^^
#
# For backward compatibility with older versions of FindMPI, these
# variables are set, but deprecated:
@@ -83,22 +88,7 @@
# MPI_COMPILE_FLAGS MPI_INCLUDE_PATH MPI_EXTRA_LIBRARY
# MPI_LINK_FLAGS MPI_LIBRARIES
#
-# In new projects, please use the MPI_<lang>_XXX equivalents.
-
-#=============================================================================
-# Copyright 2001-2011 Kitware, Inc.
-# Copyright 2010-2011 Todd Gamblin tgamblin@llnl.gov
-# Copyright 2001-2009 Dave Partyka
-#
-# Distributed under the OSI-approved BSD License (the "License");
-# see accompanying file Copyright.txt for details.
-#
-# This software is distributed WITHOUT ANY WARRANTY; without even the
-# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-# See the License for more information.
-#=============================================================================
-# (To distribute this file outside of CMake, substitute the full
-# License text for the above reference.)
+# In new projects, please use the ``MPI_<lang>_XXX`` equivalents.
# include this to handle the QUIETLY and REQUIRED arguments
include(${CMAKE_ROOT}/Modules/FindPackageHandleStandardArgs.cmake)
@@ -204,7 +194,7 @@ function (_mpi_check_compiler compiler options cmdvar resvar)
# Intel MPI 5.0.1 will return a zero return code even when the
# argument to the MPI compiler wrapper is unknown. Attempt to
# catch this case.
- if("${cmdline}" MATCHES "undefined reference")
+ if(cmdline MATCHES "undefined reference" OR cmdline MATCHES "unrecognized")
set(success 255 )
endif()
set(${cmdvar} "${cmdline}" PARENT_SCOPE)
@@ -325,7 +315,7 @@ function (interrogate_mpi_compiler lang try_libs)
foreach(FLAG ${MPI_ALL_COMPILE_FLAGS})
if (MPI_COMPILE_FLAGS_WORK)
- set(MPI_COMPILE_FLAGS_WORK "${MPI_COMPILE_FLAGS_WORK} ${FLAG}")
+ string(APPEND MPI_COMPILE_FLAGS_WORK " ${FLAG}")
else()
set(MPI_COMPILE_FLAGS_WORK ${FLAG})
endif()
@@ -355,10 +345,10 @@ function (interrogate_mpi_compiler lang try_libs)
endif()
# Extract linker paths from the link command line
- string(REGEX MATCHALL "(^| |-Wl,)-L([^\" ]+|\"[^\"]+\")" MPI_ALL_LINK_PATHS "${MPI_LINK_CMDLINE}")
+ string(REGEX MATCHALL "(^| |-Wl,)(-L|/LIBPATH:)([^\" ]+|\"[^\"]+\")" MPI_ALL_LINK_PATHS "${MPI_LINK_CMDLINE}")
set(MPI_LINK_PATH)
foreach(LPATH ${MPI_ALL_LINK_PATHS})
- string(REGEX REPLACE "^(| |-Wl,)-L" "" LPATH ${LPATH})
+ string(REGEX REPLACE "^(| |-Wl,)(-L|/LIBPATH:)" "" LPATH ${LPATH})
string(REPLACE "//" "/" LPATH ${LPATH})
list(APPEND MPI_LINK_PATH ${LPATH})
endforeach()
@@ -374,7 +364,7 @@ function (interrogate_mpi_compiler lang try_libs)
set(MPI_LINK_FLAGS_WORK)
foreach(FLAG ${MPI_ALL_LINK_FLAGS})
if (MPI_LINK_FLAGS_WORK)
- set(MPI_LINK_FLAGS_WORK "${MPI_LINK_FLAGS_WORK} ${FLAG}")
+ string(APPEND MPI_LINK_FLAGS_WORK " ${FLAG}")
else()
set(MPI_LINK_FLAGS_WORK ${FLAG})
endif()
@@ -383,20 +373,31 @@ function (interrogate_mpi_compiler lang try_libs)
# Extract the set of libraries to link against from the link command
# line
string(REGEX MATCHALL "(^| )-l([^\" ]+|\"[^\"]+\")" MPI_LIBNAMES "${MPI_LINK_CMDLINE}")
+ if(WIN32)
+ # The intel wrappers on windows link against static versions of the MPI libraries.
+ # The static libraries are simply listed on the command line without -l.
+ # For instance: " icl ... impi.lib "
+ string(REGEX MATCHALL "(^| )([^\" ]+)\\.lib" tmp "${MPI_LINK_CMDLINE}")
+ list(APPEND MPI_LIBNAMES ${tmp})
+ endif()
# add the compiler implicit directories because some compilers
# such as the intel compiler have libraries that show up
# in the showme list that can only be found in the implicit
# link directories of the compiler.
if (DEFINED CMAKE_${lang}_IMPLICIT_LINK_DIRECTORIES)
- set(MPI_LINK_PATH
- "${MPI_LINK_PATH};${CMAKE_${lang}_IMPLICIT_LINK_DIRECTORIES}")
+ string(APPEND MPI_LINK_PATH
+ ";${CMAKE_${lang}_IMPLICIT_LINK_DIRECTORIES}")
endif ()
# Determine full path names for all of the libraries that one needs
# to link against in an MPI program
foreach(LIB ${MPI_LIBNAMES})
string(REGEX REPLACE "^ ?-l" "" LIB ${LIB})
+ if(WIN32)
+ string(REGEX REPLACE "\\.lib$" "" LIB ${LIB})
+ endif()
+ string(STRIP ${LIB} LIB)
# MPI_LIB is cached by find_library, but we don't want that. Clear it first.
set(MPI_LIB "MPI_LIB-NOTFOUND" CACHE FILEPATH "Cleared" FORCE)
find_library(MPI_LIB NAMES ${LIB} HINTS ${MPI_LINK_PATH})
@@ -597,14 +598,13 @@ foreach (lang C CXX Fortran)
if (CMAKE_${lang}_COMPILER_WORKS)
# If the user supplies a compiler *name* instead of an absolute path, assume that we need to find THAT compiler.
if (MPI_${lang}_COMPILER)
- is_file_executable(MPI_${lang}_COMPILER MPI_COMPILER_IS_EXECUTABLE)
- if (NOT MPI_COMPILER_IS_EXECUTABLE)
+ if (NOT IS_ABSOLUTE "${MPI_${lang}_COMPILER}")
# Get rid of our default list of names and just search for the name the user wants.
set(_MPI_${lang}_COMPILER_NAMES ${MPI_${lang}_COMPILER})
set(MPI_${lang}_COMPILER "MPI_${lang}_COMPILER-NOTFOUND" CACHE FILEPATH "Cleared" FORCE)
- # If the user specifies a compiler, we don't want to try to search libraries either.
- set(try_libs FALSE)
endif()
+ # If the user specifies a compiler, we don't want to try to search libraries either.
+ set(try_libs FALSE)
else()
set(try_libs TRUE)
endif()