Thanks for the insight Brad.

Another advantage may be that the FindMPI module knows about what `mpirun`
or `mpiexec` is called, as well as some common flags, like number of ranks
to execute. Since OpenCoarrays writes an MPI compiler wrapper script and a
script to run the executable, `caf` and `cafrun`, using FindMPI could also
help reduce the overhead of knowing about different MPI implementations and
their peculiarities; this task would effectively be delighted to FindMPI...

Damian,
I'll poke around in the CMake code and we can discuss this on Friday.

Thanks again,
-Zaak

On Mon, Dec 7, 2015 at 8:56 AM Brad King <brad.k...@kitware.com> wrote:

> On 12/04/2015 05:51 PM, Zaak Beekman wrote:
> > What are the pros and cons of using FindMPI over passing FC=mpif90 and
> CC=mpicc?
>
> It shouldn't matter much if all the code in the project is meant
> to be build for MPI.  Using plain FindMPI with the CC/CXX/FC set
> to the system compilers is cleaner for building only a subset of
> targets for MPI.  FindMPI will look for the MPI compilers separately
> in order to ask them for the proper flags to tell the system compiler
> how to use MPI, and then project CMake code can take responsibility
> for applying that information to the desired subset of its targets.
> Using CC=mpicc, FindMPI will recognize that the C compiler is already
> a MPI compiler and not bother to look for a separate one to query
> the settings (and similarly for C++ and Fortran).
>
> -Brad
>
>
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake

Reply via email to