[CMake] History and ideas behind FindMPI.cmake?
Brad King
brad.king at kitware.com
Tue Jan 13 13:21:48 EST 2009
Alin M Elena wrote:
> Do you really need an module for MPI?
>
> All you need is to set the normal shell variables for compilers to the MPI
> wrappers.
> You need both mpi and non-mpi binaries just use different build folders.
Alin is correct. If the project works with an all-MPI build you can
just specify mpicc as the compiler (and similarly for C++). If anything
in CMake prevents this from working we can address the specific issue.
The FindMPI module is useful for mixed projects that want some MPI and
some non-MPI binaries in the same tree.
AFAIK the MPI compiler wrappers are provided to help non-software people
(who may not understand ABIs, library search paths, etc.) use MPI. If
every library took this approach it would be impossible to use more than
one library. Imagine if zlib required one to use zlibcc to link to it.
There is nothing wrong with using MPI libraries directly so long as the
proper compiler flags are found. Teaching FindMPI how to do this for
all MPI distributions may take some work but is not a wrong approach.
The current FindMPI module is one of the oldest find-modules in CMake.
It has mostly been updated minimally as necessary for the needs of folks
willing to contribute their changes back to us. No one has taken the
time to contribute a thorough treatment.
-Brad
More information about the CMake
mailing list