]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Update the usage of MPIEXEC_EXECUTABLE/MPIEXEC 17883/head
authorPeter Muench <muench@mandelbrot.math.tu-berlin.de>
Sat, 23 Nov 2024 13:51:14 +0000 (14:51 +0100)
committerPeter Munch <peterrmuench@gmail.com>
Sat, 23 Nov 2024 13:52:13 +0000 (14:52 +0100)
cmake/modules/FindDEAL_II_MPI.cmake

index 8ad96111af8385c430539e294bef631a0cdd3705..4e4bc249bd50a76efb65e7ed88f21703c4800eb8 100644 (file)
@@ -41,11 +41,20 @@ endif()
 # Call the system FindMPI.cmake module:
 #
 
-# in case MPIEXEC is specified first call find_program() so that in case of
-# success its subsequent runs inside find_package(MPI) do not alter the
-# desired result.
-if(DEFINED ENV{MPIEXEC})
-  find_program(MPIEXEC $ENV{MPIEXEC})
+#
+# Make sure we pick up the correct MPI implementation for the case that
+# environment variables MPIEXEC_EXECUTABLE, or MPIEXEC are set. If
+# MPIEXEC_EXECUTABLE is already set as a CMake variable simply ignore the
+# environment variables.
+#
+if(NOT MPIEXEC_EXECUTABLE)
+  if(DEFINED ENV{MPIEXEC_EXECUTABLE})
+    find_program(MPIEXEC_EXECUTABLE $ENV{MPIEXEC_EXECUTABLE})
+  elseif(DEFINED ENV{MPIEXEC})
+    find_program(MPIEXEC_EXECUTABLE $ENV{MPIEXEC})
+  endif()
+  # For backwards compatbility with old cmake versions:
+  set(MPIEXEC "${MPIEXEC_EXECUTABLE}")
 endif()
 
 find_package(MPI)

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.