Hi Nico,

On Fri, Sep 11, 2015 at 4:53 PM, Nico Schlömer <nico.schloe...@gmail.com> wrote:
> I see from the CMake docs [1] that the recommended way for using MPI is to
> call `find_package(MPI)` and set the linker and include flags appropriately.
> On the other hand, I see from the OpenMPI specs [2] that
>
>>
>
> The Open MPI team strongly recommends that you simply use Open MPI's
>
>> "wrapper" compilers to compile your MPI applications.
>
>
> Is there a way to reconcile these two approaches?


I'm not sure what is the "right" way to do things, but FindMPI and the
Open MPI's doc doesn't really contradict with each other.

If you look at the source for FindMPI.cmake, the variable for
MPI_<lang>_COMPILER gets set to the path of the wrapper.  So, the
wrapper is found.  Honestly, I've never tried replacing the compiler
in my CMake with this wrapper, without setting any libraries...it
might work?

CMake is suppose to be for cross-platform development.  Some other
system might have MPI but no wrapper compiler.  So, perhaps for this
reason, it's a good idea not to rely on the wrapper?

Maybe you could use the wrapper and if MPI_<lang>_COMPILER is not set,
then set the library, etc. the CMake way?

As for the Open MPI's suggestion, I don't think that paragraph means
that they suggest it over CMake's method.  I think what it is
suggesting is to use the wrapper over trying to worry about the
libraries and options "manually" -- which is a pain.

Ray
-- 

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