MPIEXEC not found with arguments specifying MPI compiler locations
Issue demonstration
To demonstrate the issue, execute the following at the command line in a bash shell:
$ tar xf cmake-issue.tar.bz2
$ cd cmake-issue
$ ./cmake-issue.sh
which builds MPI and then builds a short one-file CMake project, which takes at to total of roughly 3 minutes (because of the MPI build) inside a Lubuntu Linux virtual machine given access to all four cores on a 2017 MacBook Pro laptop. Near the bottom of the output is the message that represents the issue:
-- MPIEXEC=MPIEXEC-NOTFOUND
Sample output
Included in this archive is the output file cmake-issue.log from executing the following in a bash shell inside a nearly bare Lubuntu Linux virtual machine with GCC 6.2 and CMake 3.5.2 installed:
$ time ./cmake-issue.sh >& cmake-issue.log
$ tail cmake-issue.log
-- Checking whether /usr/bin/gfortran supports Fortran 90
-- Checking whether /usr/bin/gfortran supports Fortran 90 -- yes
-- Found MPI_C: /home/rouson/Desktop/cmake-issue/prerequisites/installations/mpich/3.1.4/lib/libmpi.so
-- Found MPI_Fortran: /home/rouson/Desktop/cmake-issue/prerequisites/installations/mpich/3.1.4/lib/libmpifort.so;/home/rouson/Desktop/cmake-issue/prerequisites/installations/mpich/3.1.4/lib/libmpi.so
-- MPIEXEC=MPIEXEC-NOTFOUND
-- Configuring done
-- Generating done
-- Build files have been written to: /home/rouson/Desktop/cmake-issue/demonstrate-issue
~/Desktop/cmake-issue
Done
Previous tests indicate that the same behavior is obtained with CMake 3.4.0 and 3.7.1 and the same behavior is observed on macOS Sierra.