summaryrefslogtreecommitdiffstats
path: root/Modules/FindMPI.cmake
diff options
context:
space:
mode:
authorDavid Cole <david.cole@kitware.com>2009-09-04 22:02:05 (GMT)
committerDavid Cole <david.cole@kitware.com>2009-09-04 22:02:05 (GMT)
commit5655ac46f00a3348e8b84c3832f34eac494be877 (patch)
tree516a54a73531e612eae14cb92656fbd6c60c0972 /Modules/FindMPI.cmake
parentcdb966532b8578a7389f91dc8e805f1040692f2f (diff)
downloadCMake-5655ac46f00a3348e8b84c3832f34eac494be877.zip
CMake-5655ac46f00a3348e8b84c3832f34eac494be877.tar.gz
CMake-5655ac46f00a3348e8b84c3832f34eac494be877.tar.bz2
Add MPICH2 and Microsoft HPC paths, add paths to find mpiexec. Now it works better automatically on Windows. Thanks to Dave Partyka for developing the patch.
Diffstat (limited to 'Modules/FindMPI.cmake')
-rw-r--r--Modules/FindMPI.cmake24
1 files changed, 16 insertions, 8 deletions
diff --git a/Modules/FindMPI.cmake b/Modules/FindMPI.cmake
index 03e95ef..f0e1cfd 100644
--- a/Modules/FindMPI.cmake
+++ b/Modules/FindMPI.cmake
@@ -58,8 +58,14 @@ find_program(MPI_COMPILER
DOC "MPI compiler. Used only to detect MPI compilation flags.")
mark_as_advanced(MPI_COMPILER)
+file(TO_CMAKE_PATH "$ENV{ProgramFiles}" ProgramFiles)
find_program(MPIEXEC
NAMES mpiexec mpirun lamexec
+ PATHS /usr/bin /usr/local/bin /usr/local/mpi/bin
+ "$ENV{SystemDrive}/Program Files/MPICH/SDK/Bin"
+ "${ProgramFiles}/MPICH2/Bin
+ "$ENV{SystemDrive}/Program Files/Microsoft Compute Cluster Pack/Bin"
+ "$ENV{SystemDrive}/Program Files/Microsoft HPC Pack 2008 SDK/Bin"
DOC "Executable for running MPI programs.")
set(MPIEXEC_NUMPROC_FLAG "-np" CACHE STRING "Flag used by MPI to specify the number of processes for MPIEXEC; the next option will be the number of processes.")
@@ -247,34 +253,36 @@ else (MPI_COMPILE_CMDLINE)
/usr/include
/usr/include/mpi
/usr/local/mpi/include
- "C:/Program Files/MPICH/SDK/Include"
- "$ENV{SystemDrive}/Program Files/MPICH2/include"
+ "$ENV{SystemDrive}/Program Files/MPICH/SDK/Include"
+ "${ProgramFiles}/MPICH2/include"
"$ENV{SystemDrive}/Program Files/Microsoft Compute Cluster Pack/Include"
+ "$ENV{SystemDrive}/Program Files/Microsoft HPC Pack 2008 SDK/Include"
)
-
+
# Decide between 32-bit and 64-bit libraries for Microsoft's MPI
if (CMAKE_CL_64)
set(MS_MPI_ARCH_DIR amd64)
else (CMAKE_CL_64)
set(MS_MPI_ARCH_DIR i386)
endif (CMAKE_CL_64)
-
+
find_library(MPI_LIBRARY
NAMES mpi mpich msmpi
PATHS /usr/lib /usr/local/lib /usr/local/mpi/lib
- "C:/Program Files/MPICH/SDK/Lib"
"$ENV{SystemDrive}/Program Files/MPICH/SDK/Lib"
+ "${ProgramFiles}/MPICH2/Lib
"$ENV{SystemDrive}/Program Files/Microsoft Compute Cluster Pack/Lib/${MS_MPI_ARCH_DIR}"
+ "$ENV{SystemDrive}/Program Files/Microsoft HPC Pack 2008 SDK/Lib/${MS_MPI_ARCH_DIR}"
)
- find_library(MPI_LIBRARY
+ find_library(MPI_LIBRARY
NAMES mpich2
PATHS
- "$ENV{SystemDrive}/Program Files/MPICH2/Lib")
+ "${ProgramFiles}/MPICH2/Lib")
find_library(MPI_EXTRA_LIBRARY
NAMES mpi++
PATHS /usr/lib /usr/local/lib /usr/local/mpi/lib
- "C:/Program Files/MPICH/SDK/Lib"
+ "$ENV{SystemDrive}/Program Files/MPICH/SDK/Lib"
DOC "Extra MPI libraries to link against.")
set(MPI_COMPILE_FLAGS "" CACHE STRING "MPI compilation flags")