[svn-r24899] Add msmpi fortran libs to FindMPI

This commit is contained in:
Allen Byrne 2014-03-25 16:57:30 -05:00
parent 425408b5a1
commit 9db0c02b96
3 changed files with 10 additions and 6 deletions

View File

@ -651,7 +651,7 @@ INCLUDE_DIRECTORIES (${HDF5_BINARY_DIR} ${HDF5_SRC_DIR} ${CMAKE_RUNTIME_OUTPUT_D
set (CMAKE_MODULE_PATH ${HDF5_RESOURCES_DIR} ${CMAKE_MODULE_PATH})
option (HDF5_ENABLE_PARALLEL "Enable parallel build (requires MPI)" OFF)
if (HDF5_ENABLE_PARALLEL)
find_package (MPI)
INCLUDE (FindMPI)
INCLUDE_DIRECTORIES (${MPI_C_INCLUDE_PATH})
if (MPI_C_FOUND)
set (H5_HAVE_PARALLEL 1)

View File

@ -427,18 +427,18 @@ function (interrogate_mpi_compiler lang try_libs)
HINTS ${_MPI_BASE_DIR} ${_MPI_PREFIX_PATH}
PATH_SUFFIXES lib)
if (MPI_LIBRARIES_WORK AND MPI_LIB)
set(MPI_LIBRARIES_WORK ${MPI_LIBRARIES_WORK} ${MPI_LIB})
list(APPEND MPI_LIBRARIES_WORK ${MPI_LIB})
endif()
endif()
if (${lang} STREQUAL Fortran)
set(MPI_LIB "MPI_LIB-NOTFOUND" CACHE FILEPATH "Cleared" FORCE)
find_library(MPI_LIB
NAMES fmpi fmpich fmpich2 fmpich2g
NAMES fmpi fmpich fmpich2 fmpich2g msmpifec msmpifmc
HINTS ${_MPI_BASE_DIR} ${_MPI_PREFIX_PATH}
PATH_SUFFIXES lib)
PATH_SUFFIXES lib lib/${MS_MPI_ARCH_DIR} Lib Lib/${MS_MPI_ARCH_DIR})
if (MPI_LIBRARIES_WORK AND MPI_LIB)
set(MPI_LIBRARIES_WORK ${MPI_LIBRARIES_WORK} ${MPI_LIB})
list(APPEND MPI_LIBRARIES_WORK ${MPI_LIB})
endif()
endif()

View File

@ -2,7 +2,11 @@ cmake_minimum_required (VERSION 2.8.11)
PROJECT (HDF5_F90 C CXX Fortran)
if (H5_HAVE_PARALLEL)
FIND_PACKAGE (MPI)
INCLUDE (FindMPI)
set (LINK_LIBS ${LINK_LIBS} ${MPI_Fortran_LIBRARIES})
if (MPI_Fortran_LINK_FLAGS)
set (CMAKE_EXE_LINKER_FLAGS "${MPI_Fortran_LINK_FLAGS} ${CMAKE_EXE_LINKER_FLAGS}")
endif (MPI_Fortran_LINK_FLAGS)
endif (H5_HAVE_PARALLEL)
#-----------------------------------------------------------------------------