[Cmake-commits] CMake branch, next, updated. v2.8.4-1469-g54cacb2
Todd Gamblin
tgamblin at llnl.gov
Sun Apr 24 21:43:38 EDT 2011
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".
The branch, next has been updated
via 54cacb2ee4213d02550503416335c81e7b6ca2ac (commit)
via a55da069480394bf0e6d50d7e8cb8ea130c4667c (commit)
from b019f5f58c0e14039facaf8ce391ca2354984024 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=54cacb2ee4213d02550503416335c81e7b6ca2ac
commit 54cacb2ee4213d02550503416335c81e7b6ca2ac
Merge: b019f5f a55da06
Author: Todd Gamblin <tgamblin at llnl.gov>
AuthorDate: Sun Apr 24 21:43:36 2011 -0400
Commit: CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Sun Apr 24 21:43:36 2011 -0400
Merge topic 'multilingual-FindMPI' into next
a55da06 Added backward compatibility for input as well as output vars.
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a55da069480394bf0e6d50d7e8cb8ea130c4667c
commit a55da069480394bf0e6d50d7e8cb8ea130c4667c
Author: Todd Gamblin <tgamblin at llnl.gov>
AuthorDate: Sun Apr 24 18:55:23 2011 +0900
Commit: Todd Gamblin <tgamblin at llnl.gov>
CommitDate: Sun Apr 24 18:55:23 2011 +0900
Added backward compatibility for input as well as output vars.
Users can now supply MPI_COMPILER, MPI_INCLUDE_PATH, MPI_LIBRARY,
and others as with the old FindMPI. These are mapped to their
respective equivalents for C and CXX. Fortran is not touched, as
there was no Fortran support in the old FindMPI.
diff --git a/Modules/FindMPI.cmake b/Modules/FindMPI.cmake
index a764d17..1d42a91 100644
--- a/Modules/FindMPI.cmake
+++ b/Modules/FindMPI.cmake
@@ -185,7 +185,7 @@ endforeach()
#
function (interrogate_mpi_compiler lang try_libs)
# if it's already in the cache, don't bother with any of this stuff
- if ((NOT MPI_INCLUDE_PATH) OR (NOT MPI_${lang}_LIBRARIES))
+ if ((NOT MPI_${lang}_INCLUDE_PATH) OR (NOT MPI_${lang}_LIBRARIES))
if (MPI_${lang}_COMPILER)
# Check whether the -showme:compile option works. This indicates that we have either OpenMPI
# or a newer version of LAM-MPI, and implies that -showme:link will also work.
@@ -456,6 +456,34 @@ set(MPIEXEC_POSTFLAGS "" CACHE STRING "These flags will come after all fla
set(MPIEXEC_MAX_NUMPROCS "2" CACHE STRING "Maximum number of processors available to run MPI applications.")
mark_as_advanced(MPIEXEC MPIEXEC_NUMPROC_FLAG MPIEXEC_PREFLAGS MPIEXEC_POSTFLAGS MPIEXEC_MAX_NUMPROCS)
+
+#=============================================================================
+# Backward compatibility input hacks. Propagate the FindMPI hints to C and
+# CXX if the respective new versions are not defined. Translate the old
+# MPI_LIBRARY and MPI_EXTRA_LIBRARY to respective MPI_${lang}_LIBRARIES.
+#
+# Once we find the new variables, we translate them back into their old
+# equivalents below.
+foreach (lang C CXX)
+ # Old input variables.
+ set(_MPI_OLD_INPUT_VARS COMPILER COMPILE_FLAGS INCLUDE_PATH LINK_FLAGS)
+
+ # Set new vars based on their old equivalents, if the new versions are not already set.
+ foreach (var ${_MPI_OLD_INPUT_VARS})
+ if (NOT MPI_${lang}_${var} AND MPI_${var})
+ set(MPI_${lang}_${var} "${MPI_${var}}")
+ endif()
+ endforeach()
+
+ # Special handling for MPI_LIBRARY and MPI_EXTRA_LIBRARY, which we nixed in the
+ # new FindMPI. These need to be merged into MPI_<lang>_LIBRARIES
+ if (NOT MPI_${lang}_LIBRARIES AND (MPI_LIBRARY OR MPI_EXTRA_LIBRARY))
+ set(MPI_${lang}_LIBRARIES ${MPI_LIBRARY} ${MPI_EXTRA_LIBRARY})
+ endif()
+endforeach()
+#=============================================================================
+
+
# This loop finds the compilers and sends them off for interrogation.
foreach (lang C CXX Fortran)
if (CMAKE_${lang}_COMPILER_WORKS)
@@ -486,7 +514,7 @@ endforeach()
#=============================================================================
-# Backward compatibility stuff
+# More backward compatibility stuff
#
# Bare MPI sans ${lang} vars are set to CXX then C, depending on what was found.
# This mimics the behavior of the old language-oblivious FindMPI.
@@ -520,8 +548,6 @@ if (MPI_NUMLIBS GREATER 1)
else()
set(MPI_EXTRA_LIBRARY "MPI_EXTRA_LIBRARY-NOTFOUND" CACHE STRING "Extra MPI libraries to link against" FORCE)
endif()
-
-# End backward compatibility contortions.
#=============================================================================
# unset these vars to cleanup namespace
-----------------------------------------------------------------------
Summary of changes:
Modules/FindMPI.cmake | 34 ++++++++++++++++++++++++++++++----
1 files changed, 30 insertions(+), 4 deletions(-)
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list