summaryrefslogtreecommitdiffstats
path: root/Modules/FindMPI.cmake
diff options
context:
space:
mode:
authorAlin Marin Elena <alinm.elena@gmail.com>2014-12-04 18:54:00 (GMT)
committerBrad King <brad.king@kitware.com>2014-12-04 19:15:46 (GMT)
commit7626c8dcf632a4589c2a9008f083f7777cee946a (patch)
treeb1697fa4b0610f9a126a8d11d51004af19d1f31c /Modules/FindMPI.cmake
parentf5ede30006f61ef5bb78d6602ebd9083cd7f9869 (diff)
downloadCMake-7626c8dcf632a4589c2a9008f083f7777cee946a.zip
CMake-7626c8dcf632a4589c2a9008f083f7777cee946a.tar.gz
CMake-7626c8dcf632a4589c2a9008f083f7777cee946a.tar.bz2
FindMPI: Workaround Intel MPI 5.0.1 exit code problem (#15182)
This MPI compiler may return zero even in some error cases. Check the output to catch such cases. Suggested-by: Kelly Thompson <kgt@lanl.gov>
Diffstat (limited to 'Modules/FindMPI.cmake')
-rw-r--r--Modules/FindMPI.cmake6
1 files changed, 6 insertions, 0 deletions
diff --git a/Modules/FindMPI.cmake b/Modules/FindMPI.cmake
index e135edb..6f6dcf3 100644
--- a/Modules/FindMPI.cmake
+++ b/Modules/FindMPI.cmake
@@ -194,6 +194,12 @@ function (_mpi_check_compiler compiler options cmdvar resvar)
OUTPUT_VARIABLE cmdline OUTPUT_STRIP_TRAILING_WHITESPACE
ERROR_VARIABLE cmdline ERROR_STRIP_TRAILING_WHITESPACE
RESULT_VARIABLE success)
+ # Intel MPI 5.0.1 will return a zero return code even when the
+ # argument to the MPI compiler wrapper is unknown. Attempt to
+ # catch this case.
+ if("${cmdline}" MATCHES "undefined reference")
+ set(success 255 )
+ endif()
set(${cmdvar} "${cmdline}" PARENT_SCOPE)
set(${resvar} "${success}" PARENT_SCOPE)
endfunction()