Commit 76260f71 authored by Andrew J. Burns (Cont's avatar Andrew J. Burns (Cont

fixing version check as newer versions of OpenMPI output to stdout instead of stderr

parent 6fe7f5d0
......@@ -24,27 +24,31 @@ if(XDMF_BUILD_FORTRAN)
OUTPUT_VARIABLE MPI_TYPE_OUTPUT
ERROR_VARIABLE MPI_TYPE_ERROR
)
STRING(REGEX MATCH "[0-9]+[.][0-9]+[.][0-9]+" MPI_VERSION"${MPI_TYPE_ERROR}")
if (NOT "${MPI_TYPE_ERROR}" STREQUAL "")
STRING(REGEX MATCH "[0-9]+[.][0-9]+[.][0-9]+" MPI_VERSION "${MPI_TYPE_ERROR}")
elseif (NOT "${MPI_TYPE_OUTPUT}" STREQUAL "")
STRING(REGEX MATCH "[0-9]+[.][0-9]+[.][0-9]+" MPI_VERSION "${MPI_TYPE_OUTPUT}")
endif ()
STRING(REGEX MATCH "^[0-9]+" MPI_VERSION_MAJOR "${MPI_VERSION}")
STRING(REGEX MATCH "[0-9]+[.][0-9]+$" MPI_VERSION_CUT "${MPI_VERSION}")
STRING(REGEX MATCH "^[0-9]+" MPI_VERSION_MINOR "${MPI_VERSION_CUT}")
if ((${MPI_VERSION_MAJOR} EQUAL 1) OR (${MPI_VERSION_MAJOR} LESS 1))
if (${MPI_VERSION_MAJOR} EQUAL 1)
if (${MPI_VERSION_MINOR} LESS 8)
if (("${MPI_VERSION_MAJOR}" EQUAL 1) OR ("${MPI_VERSION_MAJOR}" LESS 1))
if ("${MPI_VERSION_MAJOR}" EQUAL 1)
if ("${MPI_VERSION_MINOR}" LESS 8)
# Minor version is less than 1.8
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -lmpi_f90")
else (${MPI_VERSION_MINOR} LESS 8)
else ("${MPI_VERSION_MINOR}" LESS 8)
# Version is 1.8.0 or greater
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -lmpi_mpifh")
endif (${MPI_VERSION_MINOR} LESS 8)
else (${MPI_VERSION_MAJOR} EQUAL 1)
endif ("${MPI_VERSION_MINOR}" LESS 8)
else ("${MPI_VERSION_MAJOR}" EQUAL 1)
# Major version is less than 1
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -lmpi_f90")
endif (${MPI_VERSION_MAJOR} EQUAL 1)
else ((${MPI_VERSION_MAJOR} EQUAL 1) OR (${MPI_VERSION_MAJOR} LESS 1))
endif ("${MPI_VERSION_MAJOR}" EQUAL 1)
else (("${MPI_VERSION_MAJOR}" EQUAL 1) OR ("${MPI_VERSION_MAJOR}" LESS 1))
# Major version is greater than 1
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -lmpi_mpifh")
endif ((${MPI_VERSION_MAJOR} EQUAL 1) OR (${MPI_VERSION_MAJOR} LESS 1))
endif (("${MPI_VERSION_MAJOR}" EQUAL 1) OR ("${MPI_VERSION_MAJOR}" LESS 1))
endif (NOT "${IS_GFORTRAN}" STREQUAL "")
endif (XDMF_BUILD_DSM)
endif(XDMF_BUILD_FORTRAN)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment