mirror of
https://github.com/HDFGroup/hdf5.git
synced 2025-02-23 16:20:57 +08:00
Reworked MPI includes to be used as default with parallel
This commit is contained in:
parent
bbcf9f31c6
commit
a17349a872
@ -631,6 +631,7 @@ if (HDF5_ENABLE_PARALLEL)
|
||||
# Used by Fortran + MPI
|
||||
CHECK_SYMBOL_EXISTS (MPI_Comm_c2f "${MPI_C_INCLUDE_DIRS}/mpi.h" H5_HAVE_MPI_MULTI_LANG_Comm)
|
||||
CHECK_SYMBOL_EXISTS (MPI_Info_c2f "${MPI_C_INCLUDE_DIRS}/mpi.h" H5_HAVE_MPI_MULTI_LANG_Info)
|
||||
INCLUDE_DIRECTORIES (${MPI_C_INCLUDE_DIRS})
|
||||
else ()
|
||||
message (STATUS "Parallel libraries not found")
|
||||
endif ()
|
||||
|
@ -63,13 +63,13 @@ if (H5_HAVE_PARALLEL)
|
||||
add_executable (ph5example ${HDF5_EXAMPLES_SOURCE_DIR}/ph5example.c)
|
||||
TARGET_NAMING (ph5example STATIC)
|
||||
TARGET_C_PROPERTIES (ph5example STATIC " " " ")
|
||||
target_link_libraries (ph5example ${HDF5_LIB_TARGET})
|
||||
target_link_libraries (ph5example ${HDF5_LIB_TARGET} ${MPI_C_LIBRARIES})
|
||||
set_target_properties (ph5example PROPERTIES FOLDER examples)
|
||||
if (BUILD_SHARED_LIBS)
|
||||
add_executable (ph5example-shared ${HDF5_EXAMPLES_SOURCE_DIR}/ph5example.c)
|
||||
TARGET_NAMING (ph5example-shared SHARED)
|
||||
TARGET_C_PROPERTIES (ph5example-shared SHARED " " " ")
|
||||
target_link_libraries (ph5example-shared ${HDF5_LIBSH_TARGET})
|
||||
target_link_libraries (ph5example-shared ${HDF5_LIBSH_TARGET} ${MPI_C_LIBRARIES})
|
||||
set_target_properties (ph5example-shared PROPERTIES FOLDER examples)
|
||||
endif ()
|
||||
endif ()
|
||||
|
@ -85,9 +85,6 @@ add_executable (H5match_types
|
||||
${HDF5_F90_BINARY_DIR}/H5fort_type_defines.h
|
||||
${HDF5_F90_SRC_SOURCE_DIR}/H5match_types.c
|
||||
)
|
||||
if (H5_HAVE_PARALLEL AND MPI_C_FOUND)
|
||||
target_include_directories (H5match_types PUBLIC ${MPI_C_INCLUDE_DIRS})
|
||||
endif ()
|
||||
set (CMD $<TARGET_FILE:H5match_types>)
|
||||
add_custom_command (
|
||||
OUTPUT ${HDF5_F90_BINARY_DIR}/H5f90i_gen.h
|
||||
|
@ -350,15 +350,6 @@ Bug Fixes since HDF5-1.10.1 release
|
||||
|
||||
Configuration
|
||||
-------------
|
||||
- cmake
|
||||
|
||||
The hdf5 fortran utility H5match_types needs to include mpi.h when
|
||||
parallel is enabled..
|
||||
|
||||
Added target_include_directories command to H5match_types executable..
|
||||
|
||||
(ADB - 2017/12/20)
|
||||
|
||||
- cmake
|
||||
|
||||
The hdf5 library used shared szip and zlib, which needlessly required
|
||||
|
@ -849,9 +849,6 @@ endif ()
|
||||
#-----------------------------------------------------------------------------
|
||||
add_executable (H5detect ${HDF5_SRC_DIR}/H5detect.c)
|
||||
TARGET_C_PROPERTIES (H5detect STATIC " " " ")
|
||||
if (H5_HAVE_PARALLEL AND MPI_C_FOUND)
|
||||
target_include_directories (H5detect PUBLIC ${MPI_C_INCLUDE_DIRS})
|
||||
endif ()
|
||||
if (MSVC OR MINGW)
|
||||
target_link_libraries (H5detect "ws2_32.lib")
|
||||
endif ()
|
||||
@ -866,9 +863,6 @@ add_custom_command (
|
||||
|
||||
add_executable (H5make_libsettings ${HDF5_SRC_DIR}/H5make_libsettings.c)
|
||||
TARGET_C_PROPERTIES (H5make_libsettings STATIC " " " ")
|
||||
if (H5_HAVE_PARALLEL AND MPI_C_FOUND)
|
||||
target_include_directories (H5make_libsettings PUBLIC ${MPI_C_INCLUDE_DIRS})
|
||||
endif ()
|
||||
if (MSVC OR MINGW)
|
||||
target_link_libraries (H5make_libsettings "ws2_32.lib")
|
||||
endif ()
|
||||
@ -893,9 +887,6 @@ target_link_libraries (${HDF5_LIB_TARGET} PRIVATE ${LINK_LIBS} ${LINK_COMP_LIBS}
|
||||
if (NOT WIN32)
|
||||
target_link_libraries (${HDF5_LIB_TARGET} PUBLIC ${CMAKE_DL_LIBS})
|
||||
endif ()
|
||||
if (H5_HAVE_PARALLEL AND MPI_C_FOUND)
|
||||
target_include_directories (${HDF5_LIB_TARGET} PUBLIC ${MPI_C_INCLUDE_DIRS})
|
||||
endif ()
|
||||
set_global_variable (HDF5_LIBRARIES_TO_EXPORT ${HDF5_LIB_TARGET})
|
||||
H5_SET_LIB_OPTIONS (${HDF5_LIB_TARGET} ${HDF5_LIB_NAME} STATIC)
|
||||
set_target_properties (${HDF5_LIB_TARGET} PROPERTIES
|
||||
@ -937,9 +928,6 @@ if (BUILD_SHARED_LIBS)
|
||||
if (NOT WIN32)
|
||||
target_link_libraries (${HDF5_LIBSH_TARGET} PUBLIC ${CMAKE_DL_LIBS})
|
||||
endif ()
|
||||
if (H5_HAVE_PARALLEL AND MPI_C_FOUND)
|
||||
target_include_directories (${HDF5_LIBSH_TARGET} PUBLIC ${MPI_C_INCLUDE_DIRS})
|
||||
endif ()
|
||||
set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_LIBSH_TARGET}")
|
||||
H5_SET_LIB_OPTIONS (${HDF5_LIBSH_TARGET} ${HDF5_LIB_NAME} SHARED ${HDF5_PACKAGE_SOVERSION})
|
||||
set_target_properties (${HDF5_LIBSH_TARGET} PROPERTIES
|
||||
|
@ -452,7 +452,6 @@ set (test_CLEANFILES
|
||||
extlinks19B00026.h5
|
||||
extlinks19B00027.h5
|
||||
extlinks19B00028.h5
|
||||
tmp
|
||||
big.data
|
||||
big*.h5
|
||||
stdio.h5
|
||||
@ -839,21 +838,28 @@ add_test (NAME H5TEST-clear-error_test-objects
|
||||
WORKING_DIRECTORY
|
||||
${HDF5_TEST_BINARY_DIR}/H5TEST
|
||||
)
|
||||
add_test (NAME H5TEST-error_test COMMAND "${CMAKE_COMMAND}"
|
||||
-D "TEST_PROGRAM=$<TARGET_FILE:error_test>"
|
||||
-D "TEST_ARGS:STRING="
|
||||
-D "TEST_EXPECT=0"
|
||||
-D "TEST_MASK_ERROR=true"
|
||||
-D "TEST_OUTPUT=error_test.txt"
|
||||
-D "TEST_REFERENCE=error_test_1"
|
||||
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/H5TEST"
|
||||
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
|
||||
)
|
||||
set_tests_properties (H5TEST-error_test PROPERTIES
|
||||
DEPENDS H5TEST-clear-error_test-objects
|
||||
ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST;HDF5_PLUGIN_PRELOAD=::"
|
||||
WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST
|
||||
)
|
||||
if (HDF5_USE_16_API_DEFAULT)
|
||||
add_test (
|
||||
NAME H5TEST-error_test-SKIPPED
|
||||
COMMAND ${CMAKE_COMMAND} -E echo "SKIP $<TARGET_FILE:error_test>"
|
||||
)
|
||||
else ()
|
||||
add_test (NAME H5TEST-error_test COMMAND "${CMAKE_COMMAND}"
|
||||
-D "TEST_PROGRAM=$<TARGET_FILE:error_test>"
|
||||
-D "TEST_ARGS:STRING="
|
||||
-D "TEST_EXPECT=0"
|
||||
-D "TEST_MASK_ERROR=true"
|
||||
-D "TEST_OUTPUT=error_test.txt"
|
||||
-D "TEST_REFERENCE=error_test_1"
|
||||
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/H5TEST"
|
||||
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
|
||||
)
|
||||
set_tests_properties (H5TEST-error_test PROPERTIES
|
||||
DEPENDS H5TEST-clear-error_test-objects
|
||||
ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST;HDF5_PLUGIN_PRELOAD=::"
|
||||
WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST
|
||||
)
|
||||
endif ()
|
||||
|
||||
#-- Adding test for links_env
|
||||
add_test (NAME H5TEST-clear-links_env-objects
|
||||
@ -959,21 +965,28 @@ if (BUILD_SHARED_LIBS)
|
||||
WORKING_DIRECTORY
|
||||
${HDF5_TEST_BINARY_DIR}/H5TEST-shared
|
||||
)
|
||||
add_test (NAME H5TEST-shared-error_test COMMAND "${CMAKE_COMMAND}"
|
||||
-D "TEST_PROGRAM=$<TARGET_FILE:error_test-shared>"
|
||||
-D "TEST_ARGS:STRING="
|
||||
-D "TEST_EXPECT=0"
|
||||
-D "TEST_MASK_ERROR=true"
|
||||
-D "TEST_OUTPUT=error_test.txt"
|
||||
-D "TEST_REFERENCE=error_test_1"
|
||||
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/H5TEST-shared"
|
||||
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
|
||||
)
|
||||
set_tests_properties (H5TEST-shared-error_test PROPERTIES
|
||||
DEPENDS H5TEST-shared-clear-error_test-objects
|
||||
ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST-shared;HDF5_PLUGIN_PRELOAD=::"
|
||||
WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST-shared
|
||||
)
|
||||
if (HDF5_USE_16_API_DEFAULT)
|
||||
add_test (
|
||||
NAME H5TEST-shared-error_test-SKIPPED
|
||||
COMMAND ${CMAKE_COMMAND} -E echo "SKIP $<TARGET_FILE:error_test-shared>"
|
||||
)
|
||||
else ()
|
||||
add_test (NAME H5TEST-shared-error_test COMMAND "${CMAKE_COMMAND}"
|
||||
-D "TEST_PROGRAM=$<TARGET_FILE:error_test-shared>"
|
||||
-D "TEST_ARGS:STRING="
|
||||
-D "TEST_EXPECT=0"
|
||||
-D "TEST_MASK_ERROR=true"
|
||||
-D "TEST_OUTPUT=error_test.txt"
|
||||
-D "TEST_REFERENCE=error_test_1"
|
||||
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/H5TEST-shared"
|
||||
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
|
||||
)
|
||||
set_tests_properties (H5TEST-shared-error_test PROPERTIES
|
||||
DEPENDS H5TEST-shared-clear-error_test-objects
|
||||
ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST-shared;HDF5_PLUGIN_PRELOAD=::"
|
||||
WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST-shared
|
||||
)
|
||||
endif ()
|
||||
|
||||
#-- Adding test for links_env
|
||||
add_test (NAME H5TEST-shared-clear-links_env-objects
|
||||
|
Loading…
Reference in New Issue
Block a user