Trying new compiler flags for MPI

This commit is contained in:
Jeffrey Stewart Garretson
2021-09-30 17:09:23 -07:00
parent a6121e18a1
commit c396d5eb48

View File

@@ -130,10 +130,14 @@ if(ENABLE_MPI)
add_definitions(${MPI_Fortran_COMPILE_DEFINITIONS})
include_directories(${MPI_Fortran_INCLUDE_DIRS})
link_directories(${MPI_Fortran_LIBRARIES})
string(APPEND CMAKE_Fortran_FLAGS ${MPI_Fortran_LINK_FLAGS})
if(CMAKE_Fortran_COMPILER_ID MATCHES Intel)
#Using Intel Compiler, use thread safe mpi compiler flag
if(CMAKE_Fortran_COMPILER_ID MATCHES Intel AND MPI_Fortran_COMPILER MATCHES mpiifort)
#Using Intel Compiler and Intel MPI, use thread safe mpi compiler flag
string(APPEND CMAKE_Fortran_FLAGS " -mt_mpi")
else()
#use different MPI link command
string(APPEND CMAKE_Fortran_FLAGS " -lmpi")
endif()
set(CMAKE_Fortran_COMPILER ${MPI_Fortran_COMPILER})