diff options
author | Allen Byrne <byrn@hdfgroup.org> | 2017-02-28 22:54:56 (GMT) |
---|---|---|
committer | Allen Byrne <byrn@hdfgroup.org> | 2017-02-28 22:54:56 (GMT) |
commit | a87a2cf81571a1e0ed466942c389e574d6d9bab5 (patch) | |
tree | 1b4576d7a12eedbd1ee3c7b593a7d7630be8e4f0 /config | |
parent | feed94ede2e23f14fd747d0e1d224047ec4bb532 (diff) | |
download | hdf5-a87a2cf81571a1e0ed466942c389e574d6d9bab5.zip hdf5-a87a2cf81571a1e0ed466942c389e574d6d9bab5.tar.gz hdf5-a87a2cf81571a1e0ed466942c389e574d6d9bab5.tar.bz2 |
Merge CMake FindMPI changes and CMake documentation from develop
Diffstat (limited to 'config')
-rw-r--r-- | config/cmake/HDF518_Examples.cmake.in | 14 | ||||
-rw-r--r-- | config/cmake/README.txt.cmake.in | 2 | ||||
-rwxr-xr-x | config/cmake/scripts/CTestScript.cmake | 33 | ||||
-rw-r--r-- | config/cmake_ext_mod/FindMPI.cmake | 31 | ||||
-rw-r--r-- | config/cmake_ext_mod/runTest.cmake | 28 |
5 files changed, 66 insertions, 42 deletions
diff --git a/config/cmake/HDF518_Examples.cmake.in b/config/cmake/HDF518_Examples.cmake.in index cc78c2b..4d86cf9 100644 --- a/config/cmake/HDF518_Examples.cmake.in +++ b/config/cmake/HDF518_Examples.cmake.in @@ -12,7 +12,7 @@ set(CTEST_DASHBOARD_ROOT ${CTEST_SCRIPT_DIRECTORY}) #INSTALLDIR - HDF5-1.8 root folder #CTEST_CONFIGURATION_TYPE - Release, Debug, RelWithDebInfo #CTEST_SOURCE_NAME - name of source folder; HDF4Examples -#STATIC_LIBRARIES - Default is YES +#STATIC_ONLY - Default is YES #FORTRAN_LIBRARIES - Default is NO ##NO_MAC_FORTRAN - set to TRUE to allow shared libs on a Mac) if(DEFINED CTEST_SCRIPT_ARG) @@ -35,10 +35,10 @@ endif() if(NOT DEFINED CTEST_SOURCE_NAME) set(CTEST_SOURCE_NAME "HDF5Examples") endif() -if(NOT DEFINED STATIC_LIBRARIES) - set(STATICLIBRARIES "YES") -else(NOT DEFINED STATIC_LIBRARIES) - set(STATICLIBRARIES "NO") +if(NOT DEFINED STATIC_ONLY) + set(STATICONLYLIBRARIES "YES") +else(NOT DEFINED STATIC_ONLY) + set(STATICONLYLIBRARIES "NO") endif() if(NOT DEFINED FORTRAN_LIBRARIES) set(FORTRANLIBRARIES "NO") @@ -67,7 +67,7 @@ set(BUILD_OPTIONS "${BUILD_OPTIONS} -DSITE:STRING=${CTEST_SITE} -DBUILDNAME:STRI # Adjust the following SET Commands as needed ############################################################################################################### if(WIN32) - if(${STATICLIBRARIES}) + if(${STATICONLYLIBRARIES}) set(BUILD_OPTIONS "${BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=OFF") endif() set(ENV{HDF5_DIR} "${INSTALLDIR}/cmake") @@ -75,7 +75,7 @@ if(WIN32) set(CTEST_SOURCE_DIRECTORY "${CTEST_DASHBOARD_ROOT}\\${CTEST_SOURCE_NAME}") set(CTEST_BINARY_DIRECTORY "${CTEST_DASHBOARD_ROOT}\\${CTEST_BINARY_NAME}") else(WIN32) - if(${STATICLIBRARIES}) + if(${STATICONLYLIBRARIES}) set(BUILD_OPTIONS "${BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=OFF -DCMAKE_ANSI_CFLAGS:STRING=-fPIC") endif() set(ENV{HDF5_DIR} "${INSTALLDIR}/share/cmake") diff --git a/config/cmake/README.txt.cmake.in b/config/cmake/README.txt.cmake.in index 9bd9eb2..c3e3165 100644 --- a/config/cmake/README.txt.cmake.in +++ b/config/cmake/README.txt.cmake.in @@ -42,7 +42,7 @@ To test the installation with the examples; 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". + Shared libraries can be used with the STATICONLYLIBRARIES script option set to "NO". Other options can be changed by editing the HDF518_Examples.cmake file. If the defaults are okay, execute from this directory: diff --git a/config/cmake/scripts/CTestScript.cmake b/config/cmake/scripts/CTestScript.cmake index 3937cfc..e525078 100755 --- a/config/cmake/scripts/CTestScript.cmake +++ b/config/cmake/scripts/CTestScript.cmake @@ -25,14 +25,11 @@ if(NOT SITE_OS_NAME) message(STATUS "Dashboard script uname output: ${osname}-${osrel}-${cpu}\n")
set(CTEST_BUILD_NAME "${osname}-${osrel}-${cpu}")
- if(USE_AUTOTOOLS)
- set(CTEST_BUILD_NAME "AT-${CTEST_BUILD_NAME}")
- endif()
if(SITE_BUILDNAME_SUFFIX)
- set(CTEST_BUILD_NAME "${CTEST_BUILD_NAME}-${SITE_BUILDNAME_SUFFIX}")
+ set(CTEST_BUILD_NAME "${SITE_BUILDNAME_SUFFIX}-${CTEST_BUILD_NAME}")
endif()
set(BUILD_OPTIONS "${ADD_BUILD_OPTIONS}")
-else(NOT SITE_OS_NAME)
+else()
## machine name provided
## --------------------------
if(CMAKE_HOST_UNIX)
@@ -44,7 +41,7 @@ else(NOT SITE_OS_NAME) set(CTEST_BUILD_NAME "${CTEST_BUILD_NAME}-${SITE_BUILDNAME_SUFFIX}")
endif()
set(BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DSITE:STRING=${CTEST_SITE} -DBUILDNAME:STRING=${CTEST_BUILD_NAME}")
-endif(NOT SITE_OS_NAME)
+endif()
#-----------------------------------------------------------------------------
# MAC machines need special option
@@ -59,12 +56,12 @@ if(APPLE) if(NOT NO_MAC_FORTRAN)
# Shared fortran is not supported, build static
set(BUILD_OPTIONS "${BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=OFF -DCMAKE_ANSI_CFLAGS:STRING=-fPIC")
- else(NOT NO_MAC_FORTRAN)
+ else()
set(BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF5_BUILD_FORTRAN:BOOL=OFF")
- endif(NOT NO_MAC_FORTRAN)
+ endif()
set(BUILD_OPTIONS "${BUILD_OPTIONS} -DCTEST_USE_LAUNCHERS:BOOL=ON -DCMAKE_BUILD_WITH_INSTALL_RPATH:BOOL=OFF")
-endif(APPLE)
+endif()
#-----------------------------------------------------------------------------
set(NEED_REPOSITORY_CHECKOUT 0)
@@ -73,10 +70,10 @@ if(CTEST_USE_TAR_SOURCE) ## Uncompress source if tar file provided
## --------------------------
if(WIN32)
- message(STATUS "extracting... [${CMAKE_EXECUTABLE_NAME} x ${CTEST_USE_TAR_SOURCE}.zip]")
+ message(STATUS "extracting... [${CMAKE_EXECUTABLE_NAME} x ${CTEST_DASHBOARD_ROOT}\\${CTEST_USE_TAR_SOURCE}.zip]")
execute_process(COMMAND ${CMAKE_EXECUTABLE_NAME} -E tar -xvf ${CTEST_DASHBOARD_ROOT}\\${CTEST_USE_TAR_SOURCE}.zip RESULT_VARIABLE rv)
else()
- message(STATUS "extracting... [${CMAKE_EXECUTABLE_NAME} -E tar -xvf ${CTEST_USE_TAR_SOURCE}.tar]")
+ message(STATUS "extracting... [${CMAKE_EXECUTABLE_NAME} -E tar -xvf ${CTEST_DASHBOARD_ROOT}/${CTEST_USE_TAR_SOURCE}.tar]")
execute_process(COMMAND ${CMAKE_EXECUTABLE_NAME} -E tar -xvf ${CTEST_DASHBOARD_ROOT}/${CTEST_USE_TAR_SOURCE}.tar RESULT_VARIABLE rv)
endif()
@@ -88,7 +85,7 @@ if(CTEST_USE_TAR_SOURCE) file(RENAME ${CTEST_DASHBOARD_ROOT}/${CTEST_USE_TAR_SOURCE} ${CTEST_SOURCE_DIRECTORY})
set(LOCAL_SKIP_UPDATE "TRUE")
-else(CTEST_USE_TAR_SOURCE)
+else()
if(LOCAL_UPDATE)
if(CTEST_USE_GIT_SOURCE)
find_program(CTEST_GIT_COMMAND NAMES git git.cmd)
@@ -109,7 +106,7 @@ else(CTEST_USE_TAR_SOURCE) set(CTEST_GIT_options "pull")
endif()
set(CTEST_UPDATE_COMMAND "${CTEST_GIT_COMMAND}")
- else(CTEST_USE_GIT_SOURCE)
+ else()
## --------------------------
## use subversion to get source
#-----------------------------------------------------------------------------
@@ -140,9 +137,9 @@ else(CTEST_USE_TAR_SOURCE) set(CTEST_SVN_UPDATE_OPTIONS "-r ${CTEST_REPO_VERSION}")
endif()
endif()
- endif(CTEST_USE_GIT_SOURCE)
- endif(LOCAL_UPDATE)
-endif(CTEST_USE_TAR_SOURCE)
+ endif()
+ endif()
+endif()
#-----------------------------------------------------------------------------
## Clear the build directory
@@ -183,7 +180,7 @@ foreach(req if(NOT DEFINED ${req})
message(FATAL_ERROR "The containing script must set ${req}")
endif()
-endforeach(req)
+endforeach()
#-----------------------------------------------------------------------------
# Initialize the CTEST commands
@@ -201,7 +198,7 @@ else() "${CTEST_CMAKE_COMMAND} -C \"${CTEST_SOURCE_DIRECTORY}/config/cmake/cacheinit.cmake\" -DCMAKE_BUILD_TYPE:STRING=${CTEST_CONFIGURATION_TYPE} ${BUILD_OPTIONS} \"-G${CTEST_CMAKE_GENERATOR}\" \"${CTEST_SOURCE_DIRECTORY}\""
)
endif()
-
+
#-----------------------------------------------------------------------------
## -- set output to english
set($ENV{LC_MESSAGES} "en_EN")
diff --git a/config/cmake_ext_mod/FindMPI.cmake b/config/cmake_ext_mod/FindMPI.cmake index 1a02f82..1fb07d4 100644 --- a/config/cmake_ext_mod/FindMPI.cmake +++ b/config/cmake_ext_mod/FindMPI.cmake @@ -114,9 +114,10 @@ include(GetPrerequisites) # # Start out with the generic MPI compiler names, as these are most commonly used. -set(_MPI_C_COMPILER_NAMES mpicc mpcc mpicc_r mpcc_r) +set(_MPI_C_COMPILER_NAMES mpicc mpcc mpicc_r mpcc_r mpicc.bat) set(_MPI_CXX_COMPILER_NAMES mpicxx mpiCC mpcxx mpCC mpic++ mpc++ - mpicxx_r mpiCC_r mpcxx_r mpCC_r mpic++_r mpc++_r) + mpicxx_r mpiCC_r mpcxx_r mpCC_r mpic++_r mpc++_r + mpicxx.bat) set(_MPI_Fortran_COMPILER_NAMES mpif95 mpif95_r mpf95 mpf95_r mpif90 mpif90_r mpf90 mpf90_r mpif77 mpif77_r mpf77 mpf77_r) @@ -128,9 +129,9 @@ set(_MPI_GNU_Fortran_COMPILER_NAMES mpigfortran mpgfortran mpigfortran_r mpig77 mpig77_r mpg77 mpg77_r) # Intel MPI compiler names -set(_MPI_Intel_C_COMPILER_NAMES mpiicc) -set(_MPI_Intel_CXX_COMPILER_NAMES mpiicpc mpiicxx mpiic++ mpiiCC) -set(_MPI_Intel_Fortran_COMPILER_NAMES mpiifort mpiif95 mpiif90 mpiif77) +set(_MPI_Intel_C_COMPILER_NAMES mpiicc mpiicc.bat) +set(_MPI_Intel_CXX_COMPILER_NAMES mpiicpc mpiicxx mpiic++ mpiiCC mpiicpc.bat) +set(_MPI_Intel_Fortran_COMPILER_NAMES mpiifort mpiif95 mpiif90 mpiif77 mpiifort.bat) # PGI compiler names set(_MPI_PGI_C_COMPILER_NAMES mpipgcc mppgcc) @@ -314,8 +315,9 @@ function (interrogate_mpi_compiler lang try_libs) set(MPI_COMPILE_FLAGS_WORK) foreach(FLAG ${MPI_ALL_COMPILE_FLAGS}) + string(REGEX REPLACE "^ " "" FLAG ${FLAG}) if (MPI_COMPILE_FLAGS_WORK) - string(APPEND MPI_COMPILE_FLAGS_WORK " ${FLAG}") + set(MPI_COMPILE_FLAGS_WORK "${MPI_COMPILE_FLAGS_WORK} ${FLAG}") else() set(MPI_COMPILE_FLAGS_WORK ${FLAG}) endif() @@ -323,9 +325,13 @@ function (interrogate_mpi_compiler lang try_libs) # Extract include paths from compile command line string(REGEX MATCHALL "(^| )-I([^\" ]+|\"[^\"]+\")" MPI_ALL_INCLUDE_PATHS "${MPI_COMPILE_CMDLINE}") + set(MPI_INCLUDE_PATH_WORK) + foreach(IPATH ${MPI_ALL_INCLUDE_PATHS}) string(REGEX REPLACE "^ ?-I" "" IPATH ${IPATH}) string(REPLACE "//" "/" IPATH ${IPATH}) + string(REPLACE "\"" "" IPATH ${IPATH}) + file(TO_CMAKE_PATH "${IPATH}" IPATH) list(APPEND MPI_INCLUDE_PATH_WORK ${IPATH}) endforeach() @@ -363,8 +369,9 @@ function (interrogate_mpi_compiler lang try_libs) string(REGEX MATCHALL "(^| )(-Wl,|-Xlinker )([^\" ]+|\"[^\"]+\")" MPI_ALL_LINK_FLAGS "${MPI_LINK_CMDLINE}") set(MPI_LINK_FLAGS_WORK) foreach(FLAG ${MPI_ALL_LINK_FLAGS}) + string(REGEX REPLACE "^ " "" FLAG ${FLAG}) if (MPI_LINK_FLAGS_WORK) - string(APPEND MPI_LINK_FLAGS_WORK " ${FLAG}") + set(MPI_LINK_FLAGS_WORK "${MPI_LINK_FLAGS_WORK} ${FLAG}") else() set(MPI_LINK_FLAGS_WORK ${FLAG}) endif() @@ -386,8 +393,7 @@ function (interrogate_mpi_compiler lang try_libs) # in the showme list that can only be found in the implicit # link directories of the compiler. if (DEFINED CMAKE_${lang}_IMPLICIT_LINK_DIRECTORIES) - string(APPEND MPI_LINK_PATH - ";${CMAKE_${lang}_IMPLICIT_LINK_DIRECTORIES}") + set(MPI_LINK_PATH "${MPI_LINK_PATH};${CMAKE_${lang}_IMPLICIT_LINK_DIRECTORIES}") endif () # Determine full path names for all of the libraries that one needs @@ -462,11 +468,11 @@ function (interrogate_mpi_compiler lang try_libs) set(MPI_HEADER_PATH "MPI_HEADER_PATH-NOTFOUND" CACHE FILEPATH "Cleared" FORCE) find_path(MPI_HEADER_PATH mpifptr.h HINTS ${_MPI_BASE_DIR} ${_MPI_PREFIX_PATH} - PATH_SUFFIXES include include/${MS_MPI_ARCH_DIR} include/${MS_MPI_ARCH_DIR2} Inc Inc/${MS_MPI_ARCH_DIR} Inc/${MS_MPI_ARCH_DIR2}) + PATH_SUFFIXES include Include include/${MS_MPI_ARCH_DIR} Include/${MS_MPI_ARCH_DIR2} Include/${MS_MPI_ARCH_DIR} include/${MS_MPI_ARCH_DIR2} Inc Inc/${MS_MPI_ARCH_DIR} Inc/${MS_MPI_ARCH_DIR2}) if (MPI_INCLUDE_PATH_WORK AND MPI_HEADER_PATH) list(APPEND MPI_INCLUDE_PATH_WORK ${MPI_HEADER_PATH}) endif() - + set(MPI_LIB "MPI_LIB-NOTFOUND" CACHE FILEPATH "Cleared" FORCE) find_library(MPI_LIB NAMES fmpi fmpich fmpich2 fmpich2g msmpifec msmpifmc @@ -624,6 +630,9 @@ foreach (lang C CXX Fortran) try_regular_compiler(${lang} regular_compiler_worked) endif() + # add fortran mpi module path if ENV VAR exists + set (MPI_${lang}_INCLUDE_PATH "${MPI_${lang}_INCLUDE_PATH};$ENV{MPI_FORTRAN_MOD_DIR}") + set(MPI_${lang}_FIND_QUIETLY ${MPI_FIND_QUIETLY}) set(MPI_${lang}_FIND_REQUIRED ${MPI_FIND_REQUIRED}) set(MPI_${lang}_FIND_VERSION ${MPI_FIND_VERSION}) diff --git a/config/cmake_ext_mod/runTest.cmake b/config/cmake_ext_mod/runTest.cmake index 804c80f..0a77dae 100644 --- a/config/cmake_ext_mod/runTest.cmake +++ b/config/cmake_ext_mod/runTest.cmake @@ -144,6 +144,13 @@ if (TEST_FILTER) file (WRITE ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}") endif () +if (TEST_REF_FILTER) + #message (STATUS "TEST_REF_FILTER: ${TEST_APPEND}${TEST_REF_FILTER}") + file (READ ${TEST_FOLDER}/${TEST_REFERENCE} TEST_STREAM) + STRING(REGEX REPLACE "${TEST_REF_APPEND}" "${TEST_REF_FILTER}" TEST_STREAM "${TEST_STREAM}") + file (WRITE ${TEST_FOLDER}/${TEST_REFERENCE} "${TEST_STREAM}") +endif (TEST_REF_FILTER) + # compare output files to references unless this must be skipped if (NOT TEST_SKIP_COMPARE) if (WIN32 AND NOT MINGW) @@ -151,11 +158,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 (NOT ${TEST_RESULT} STREQUAL 0) set (TEST_RESULT 0) file (STRINGS ${TEST_FOLDER}/${TEST_OUTPUT} test_act) |