View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0014347CMakeModulespublic2013-08-09 10:372015-01-05 08:39
ReporterMarcel Loose 
Assigned ToBrad King 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionfixed 
PlatformLinuxOSUbuntuOS Version13.04
Product VersionCMake 2.8.11.2 
Target VersionCMake 3.1Fixed in VersionCMake 3.1 
Summary0014347: FindMPI sets MPIEXEC to wrong executable
DescriptionWhen MPI is installed in a non-standard location (which is the rule, rather than the exception on cluster systems), FindMPI will not find the correct mpiexec.

Though you can help FindMPI to find the correct compilers, by setting MPI_<lang>_COMPILER variables, there's no way to do this for MPIEXEC.

Steps To Reproduce1. Have MPI installed in a non-standard directory, e.g., /opt/openmpi
2. Create a CMakeLists.txt file that contains a line "find_package(MPI)"
3. Check the cache for the value of the different MPI variables
Additional InformationI think that the CMake|environment variable MPI_HOME should be used as HINTS in the call of find_program for mpiexec. Subsequently, _MPI_BASE_DIR (as derived from the path to mpiexec) can be used as HINTS in the call of find_program of the MPI compiler(s).

I've attached a patch that solves this problem.
TagsNo tags attached.
Attached Filespatch file icon FindMPI.patch [^] (829 bytes) 2013-08-09 10:37 [Show Content]

 Relationships

  Notes
(0036558)
Ryo IGARASHI (reporter)
2014-08-05 17:27

I have been suffering from this issue, too.

On Fujitsu K computer or FX10 system, we cross-compile our application on the
front end(x86_64) for the SPARC(s64fx) back end.
MPI environment (mpirun/mpiexec) only works on the back end, therefore,
executing mpiexec on the front end (where we execute cmake command) always fails
and MPIEXEC is set to MPIEXEC-NOTFOUND.

As a workaround, I am forced to create a symlink of working mpiexec to
~/bin/MPIEXEC-NOTFOUND where I always add ~/bin to my PATH, which I believe
is very ugly.

I want MPIEXEC to be able to set manually such as CMAKE_COMMAND or CMAKE_CTEST_COMMAND variable.
(0036593)
Brad King (manager)
2014-08-11 11:11

The CMAKE_PREFIX_PATH variable may be set to a ;-separated list containing any local custom installation prefixes. They will be used by all find modules including FindMPI. This avoids the need for a per-package _HOME or _ROOT variable, which is why so few find modules provide them.
(0036594)
Marcel Loose (developer)
2014-08-11 11:40

Ryo, have you tried the patch I uploaded? If that works for you, then maybe it can be applied to FindMPI.cmake in the repo.
(0036595)
Brad King (manager)
2014-08-11 11:52

I just noticed that the attached FindMPI.patch simply extends existing use of MPI_HOME to work for MPIEXEC too rather than adding a new one. My advice in 0014347:0036593 can serve as a workaround but the patch is still worth testing too.
(0036598)
Brad King (manager)
2014-08-11 13:08

I've applied the patch (with minor tweaks) for testing:

 FindMPI: Honor MPI_HOME for MPIEXEC
 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=150c2125 [^]

Please try it out.
(0036600)
Marcel Loose (developer)
2014-08-12 04:04

Brad, I saw you removed the quotes around the variable names in the applied patch. Out of curiosity, shouldn't I use quotes? I thought you need them to properly handle file paths containing spaces.
(0036602)
Brad King (manager)
2014-08-12 09:33

Re 0014347:0036600: I wanted to match the style in the rest of the module. Also if the values are empty then leaving out the quotes causes the argument to be removed rather than an empty string used.
(0036605)
Brad King (manager)
2014-08-12 14:06

Re 0014347:0036600: Oops, I left the last part of your question unanswered. Quotes in the CMake language are needed to prevent expansion of arguments by dividing on semicolons. Spaces make no difference.

See the cmake-language(7) manual for more information:

 http://www.cmake.org/cmake/help/v3.0/manual/cmake-language.7.html#command-arguments [^]

Meanwhile, please let me know if the patch linked in 0014347:0036598 works for you.
(0037614)
Robert Maynard (manager)
2015-01-05 08:39

Closing resolved issues that have not been updated in more than 4 months

 Issue History
Date Modified Username Field Change
2013-08-09 10:37 Marcel Loose New Issue
2013-08-09 10:37 Marcel Loose File Added: FindMPI.patch
2013-08-09 10:38 Marcel Loose Steps to Reproduce Updated
2014-08-05 17:27 Ryo IGARASHI Note Added: 0036558
2014-08-11 11:11 Brad King Note Added: 0036593
2014-08-11 11:40 Marcel Loose Note Added: 0036594
2014-08-11 11:52 Brad King Note Added: 0036595
2014-08-11 11:52 Brad King Target Version => CMake 3.1
2014-08-11 13:08 Brad King Note Added: 0036598
2014-08-11 13:08 Brad King Assigned To => Brad King
2014-08-11 13:08 Brad King Status new => assigned
2014-08-12 04:04 Marcel Loose Note Added: 0036600
2014-08-12 09:33 Brad King Note Added: 0036602
2014-08-12 14:06 Brad King Note Added: 0036605
2014-08-18 11:13 Brad King Status assigned => resolved
2014-08-18 11:13 Brad King Resolution open => fixed
2014-08-18 11:13 Brad King Fixed in Version => CMake 3.1
2015-01-05 08:39 Robert Maynard Note Added: 0037614
2015-01-05 08:39 Robert Maynard Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team