[CMake] FindMPI

Chuck Atkins chuck.atkins at kitware.com
Mon Nov 28 09:58:17 EST 2016


Pass the following CMake options at configure time:

-DMPI_C_COMPILER=/path/to/mpicc
-DMPI_CXX_COMPILER=/path/to/mpiCC
-DMPI_Fortran_COMPILER=/path/to/mpif90

----------
Chuck Atkins
Staff R&D Engineer, Scientific Computing
Kitware, Inc.


On Wed, Nov 23, 2016 at 6:05 PM, Zaak Beekman <zbeekman at gmail.com> wrote:

> Hi,
>
> I want to be able to pass FC=mpif90 (or FC=$(which mpif90)) and CC=mpicc
> etc. OR also be able to pass a compiler and use FindMPI to add link,
> compile and include flags. I'm encountering an issue when my MPI
> implementation is not on my PATH, I want CMake to be able to look in an
> additional location (our build script can download and build MPICH and by
> default installs it in user space) and also resolve where mpif90 is coming
> from and look there too.
>
> Whats the correct way to pass HINTS or PATHS to FindMPI? i.e., how do I
> specify additional locations to search?
>
> Using `find_package` with HINTS and PATHS means that it doesn't use
> FindMPI. I also tried setting CMAKE_SYSTEM PREFIX_PATH, but I think that's
> a cache variable set early, so it's not having an effect.
>
> It would be great if FindMPI used the realpath of mpif90 etc when passed
> as $FC.
>
> TIA
>
> --
>
> 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20161128/369a41e6/attachment.html>


More information about the CMake mailing list