[CMake] FindMPI.cmake and MS-MPI
Andrew Maclean
andrew.amaclean at gmail.com
Sun Mar 1 17:58:16 EST 2015
Some further information, ignore the CMP0054 warning it is not triggered
when the CMake Minimum Version is 3.1
When running FindMPI.cmake, I discovered that I had a spurious registry
entry for an older version of MPI so mpiexec.exe was not being found. When
I deleted this it found mpiexec.exe in C:/Program Files/Microsoft
MPI/Bin/mpiexec.exe OK. I think the key
for HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\MPI should still be there
before the other registry keys.
You definitely need the new lib and include paths.
I was able to use FindMPI.cmake and just add in these paths manually.
Hope this helps.
Regards
Andrew
On Sun, Mar 1, 2015 at 3:54 PM, Andrew Maclean <andrew.amaclean at gmail.com>
wrote:
> Re-sending because David in no longer at Kitware.
>
> I downloaded and installed MS-MPI from
> http://www.microsoft.com/en-us/download/details.aspx?id=44990
>
> This implementation does not work with FindMPI.cmake.
>
> The includes and libs are found in:
> C:/Program Files (x86)/Microsoft SDKs/MPI/
> and mpiexec.exe is in: C:/Program Files/Microsoft MPI/Bin/
>
> I had to do the following changes to get it working. Perhaps you would
> like to edit FIndMPI.cmake to incorporate these changes:
> ----------
> # Require MPI for this project:
> if(WIN32)
> #This is for finding MS-MPI.
> #set(_MPI_PREFIX_PATH)
> #list(APPEND _MPI_PREFIX_PATH
> "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\MPI;Path]/..")
> set(MPIEXEC "C:/Program Files/Microsoft MPI/Bin/mpiexec.exe")
> # For building MPI programs the selected Visual Studio compiler is used,
> namely cl.exe.
> # So there is no need to set a specific MPI compiler.
> #set(MPI_CXX_COMPILER "${CMAKE_CXX_COMPILER}")
> set(MPI_CXX_INCLUDE_PATH "C:/Program Files (x86)/Microsoft
> SDKs/MPI/Include")
> # Make sure the correct libraries (64-bit or 32-bit) are selected.
> # Decide between 32-bit and 64-bit libraries for Microsoft's MPI
> if("${CMAKE_SIZEOF_VOID_P}" EQUAL 8)
> set(MS_MPI_ARCH_DIR x64)
> else()
> set(MS_MPI_ARCH_DIR x86)
> endif()
> set(MPI_CXX_LIBRARIES "C:/Program Files (x86)/Microsoft
> SDKs/MPI/Lib/${MS_MPI_ARCH_DIR}/msmpi.lib")
> set(MPI_C_INCLUDE_PATH "${MPI_CXX_INCLUDE_PATH}")
> set(MPI_C_LIBRARIES "{${MPI_CXX_LIBRARIES}")
> 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.")
> else()
> find_package(MPI REQUIRED)
> endif()
> --------
> Some of this is taken from FindMPI.cmake.
>
> Attached is a zipped up file of the working CMakeLists.txt file and a test
> file for you.
>
> I looked at FindMPI.cmake but I think you guys are better placed to make
> the changes.
>
> Also in the case of FindMPI.cmake, you will need to fix the following
> warning message:
>
> CMake Warning (dev) at C:/Program Files
> (x86)/CMake/share/cmake-3.1/Modules/FindMPI.cmake:163 (if):
> Policy CMP0054 is not set: Only interpret if() arguments as variables or
> keywords when unquoted. Run "cmake --help-policy CMP0054" for policy
> details. Use the cmake_policy command to set the policy and suppress this
> warning.
>
> Quoted variables like "MSVC" will no longer be dereferenced when the policy
> is set to NEW. Since the policy is not set the OLD behavior will be used.
> Call Stack (most recent call first):
> CMakeLists.txt:5 (find_package)
> This warning is for project developers. Use -Wno-dev to suppress it.CMake
> Warning (dev) at C:/Program Files
> (x86)/CMake/share/cmake-3.1/Modules/FindMPI.cmake:163 (if):
> Policy CMP0054 is not set: Only interpret if() arguments as variables or
> keywords when unquoted. Run "cmake --help-policy CMP0054" for policy
> details. Use the cmake_policy command to set the policy and suppress this
> warning.
>
> Quoted variables like "MSVC" will no longer be dereferenced when the policy
> is set to NEW. Since the policy is not set the OLD behavior will be used.
> Call Stack (most recent call first):
> CMakeLists.txt:5 (find_package)
> This warning is for project developers. Use -Wno-dev to suppress it.
>
>
> Regards
>
> Andrew
>
>
> --
> ___________________________________________
> Andrew J. P. Maclean
>
> ___________________________________________
>
--
___________________________________________
Andrew J. P. Maclean
___________________________________________
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20150302/3e8d2658/attachment.html>
More information about the CMake
mailing list