diff options
author | Bill Hoffman <bill.hoffman@kitware.com> | 2012-03-20 19:18:53 (GMT) |
---|---|---|
committer | Bill Hoffman <bill.hoffman@kitware.com> | 2012-03-20 19:18:53 (GMT) |
commit | 2f9ad7c6e6067b162d58d8a8628ba2c38106a6e9 (patch) | |
tree | 5bc6bd9b01a0261db95177cdb2b0c3b26917415f /Modules/FindMPI.cmake | |
parent | d69c2c582584efaa34aa6e2ffc5eb80bacef1324 (diff) | |
download | CMake-2f9ad7c6e6067b162d58d8a8628ba2c38106a6e9.zip CMake-2f9ad7c6e6067b162d58d8a8628ba2c38106a6e9.tar.gz CMake-2f9ad7c6e6067b162d58d8a8628ba2c38106a6e9.tar.bz2 |
Fix FindMPI for the intel compiler on linux by looking in implict directories.
Use the CMAKE_<LANG>_IMPLICIT_LINK_DIRECTORIES to look for libraries
that are in the -showme output from mpi<lang> programs. This is because
some libraries reported by -showme are found there, and FindMPI will
fail if they are not found.
Diffstat (limited to 'Modules/FindMPI.cmake')
-rw-r--r-- | Modules/FindMPI.cmake | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/Modules/FindMPI.cmake b/Modules/FindMPI.cmake index 1be4ccf..ae50ca7 100644 --- a/Modules/FindMPI.cmake +++ b/Modules/FindMPI.cmake @@ -354,6 +354,20 @@ function (interrogate_mpi_compiler lang try_libs) # Extract the set of libraries to link against from the link command # line string(REGEX MATCHALL "(^| )-l([^\" ]+|\"[^\"]+\")" MPI_LIBNAMES "${MPI_LINK_CMDLINE}") + # add the compiler implicit directories because some compilers + # such as the intel compiler have libraries that show up + # in the showme list that can only be found in the implicit + # link directories of the compiler. Do this for C++ and C + # compilers if the implicit link directories are defined. + if (DEFINED CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES) + set(MPI_LINK_PATH + "${MPI_LINK_PATH};${CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES}") + endif () + + if (DEFINED CMAKE_C_IMPLICIT_LINK_DIRECTORIES) + set(MPI_LINK_PATH + "${MPI_LINK_PATH};${CMAKE_C_IMPLICIT_LINK_DIRECTORIES}") + endif () # Determine full path names for all of the libraries that one needs # to link against in an MPI program |