From 7626c8dcf632a4589c2a9008f083f7777cee946a Mon Sep 17 00:00:00 2001 From: Alin Marin Elena Date: Thu, 4 Dec 2014 13:54:00 -0500 Subject: 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 --- Modules/FindMPI.cmake | 6 ++++++ 1 file changed, 6 insertions(+) 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() -- cgit v0.12