summaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2017-11-02 21:24:32 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2017-11-02 21:24:32 (GMT)
commit1077afd5c419b144093ad2ef6288674d1be995fa (patch)
treeac440dca0073e82add1a12fabfa34b35680bbd66 /CMakeLists.txt
parent54fd43fe1641687319f06b54affc9ae05f277a6a (diff)
parentc4b899a9ed617078e9a8f9a11a03e09d9eb02491 (diff)
downloadhdf5-1077afd5c419b144093ad2ef6288674d1be995fa.zip
hdf5-1077afd5c419b144093ad2ef6288674d1be995fa.tar.gz
hdf5-1077afd5c419b144093ad2ef6288674d1be995fa.tar.bz2
Merge pull request #748 in HDFFV/hdf5 from ~BYRN/hdf5_adb:hdf5_1_8_20 to hdf5_1_8_20
* commit 'c4b899a9ed617078e9a8f9a11a03e09d9eb02491': HDFFV-10321 Merge from 1.8
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt30
1 files changed, 21 insertions, 9 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index eeae1b5..d45c0b6 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -534,16 +534,15 @@ INCLUDE_DIRECTORIES (${HDF5_BINARY_DIR} ${HDF5_SRC_DIR} ${CMAKE_RUNTIME_OUTPUT_D
set (CMAKE_MODULE_PATH ${HDF_RESOURCES_DIR} ${HDF_RESOURCES_EXT_DIR} ${CMAKE_MODULE_PATH})
option (HDF5_ENABLE_PARALLEL "Enable parallel build (requires MPI)" OFF)
if (HDF5_ENABLE_PARALLEL)
- include (FindMPI)
- INCLUDE_DIRECTORIES (${MPI_C_INCLUDE_PATH})
+ find_package(MPI REQUIRED)
if (MPI_C_FOUND)
set (H5_HAVE_PARALLEL 1)
# MPI checks, only do these if MPI_C_FOUND is true, otherwise they always fail
# and once set, they are cached as false and not regenerated
set (CMAKE_REQUIRED_LIBRARIES "${MPI_C_LIBRARIES}" )
# Used by Fortran + MPI
- CHECK_SYMBOL_EXISTS (MPI_Comm_c2f "${MPI_C_INCLUDE_PATH}/mpi.h" H5_HAVE_MPI_MULTI_LANG_Comm)
- CHECK_SYMBOL_EXISTS (MPI_Info_c2f "${MPI_C_INCLUDE_PATH}/mpi.h" H5_HAVE_MPI_MULTI_LANG_Info)
+ 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)
else ()
message (STATUS "Parallel libraries not found")
endif ()
@@ -762,12 +761,25 @@ if (EXISTS "${HDF5_SOURCE_DIR}/fortran" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/for
option (HDF5_ENABLE_F2003 "Enable FORTRAN 2003 Standard" ON)
include (${HDF_RESOURCES_EXT_DIR}/HDFUseFortran.cmake)
+
+ set (LINK_Fortran_LIBS ${LINK_LIBS})
+ set (LINK_Fortran_SHARED_LIBS ${LINK_SHARED_LIBS})
+
if (HDF5_ENABLE_F2003)
if (NOT FORTRAN_HAVE_ISO_C_BINDING)
set (HDF5_ENABLE_F2003 OFF)
endif ()
endif ()
+ # Parallel IO usage requires MPI to be Linked and Included
+ if (H5_HAVE_PARALLEL)
+ set (LINK_Fortran_LIBS ${LINK_Fortran_LIBS} ${MPI_Fortran_LIBRARIES})
+ set (LINK_Fortran_SHARED_LIBS ${LINK_Fortran_SHARED_LIBS} ${MPI_Fortran_LIBRARIES})
+ if (MPI_Fortran_LINK_FLAGS)
+ set (CMAKE_Fortran_EXE_LINKER_FLAGS "${MPI_Fortran_LINK_FLAGS} ${CMAKE_EXE_LINKER_FLAGS}")
+ endif ()
+ endif ()
+
add_subdirectory (${HDF5_SOURCE_DIR}/fortran ${PROJECT_BINARY_DIR}/fortran)
if (HDF5_BUILD_HL_LIB)
if (EXISTS "${HDF5_SOURCE_DIR}/hl/fortran" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/hl/fortran")
@@ -809,11 +821,11 @@ endif ()
# Check if Fortran's default real is double precision. If it is and HL is
# being built then configure should fail due to bug HDFFV-889.
#-----------------------------------------------------------------------------
- if (HDF5_BUILD_FORTRAN AND HDF5_BUILD_HL_LIB )
- if (NOT FORTRAN_DEFAULT_REAL_NOT_DOUBLE)
- message (FATAL_ERROR " **** Fortran high-level routines are not supported when the default REAL is DOUBLE PRECISION, use HDF5_BUILD_HL_LIB:BOOL=OFF **** ")
- endif ()
- endif ()
+if (HDF5_BUILD_FORTRAN AND HDF5_BUILD_HL_LIB)
+ if (NOT FORTRAN_DEFAULT_REAL_NOT_DOUBLE)
+ message (FATAL_ERROR " **** Fortran high-level routines are not supported when the default REAL is DOUBLE PRECISION, use HDF5_BUILD_HL_LIB:BOOL=OFF **** ")
+ endif ()
+endif ()
#-----------------------------------------------------------------------------
# Generate the H5pubconf.h file containing user settings needed by compilation