[CMake] Fortran version of FindMPI

Michael Wild themiwi at gmail.com
Tue Jan 12 02:55:30 EST 2010


On 11. Jan, 2010, at 22:26 , Moreland, Kenneth wrote:

> I have a simple Fortran program that uses MPI that I am trying to configure with CMake.  The problem is that although the FindMPI module finds the C libraries for MPI, it does not find the Fortran libraries.  To get around this I copied the FindMPI.cmake from the CMake distribution and did some edits and a few search-and-replaces to find the Fortran version of the library.  It seems to work well enough on my system (using OpenMPI) with the exception of finding some system 64-bit libraries (which is actually caused by a CMake bug that I just submitted a report for http://www.paraview.org/Bug/view.php?id=10119).  The module is attached.  Is there any interest in placing this with the CMake distribution or integrating into the existing FindMPI module?
> 
> -Ken
> 

Hi Ken

Wouldn't this be a good case to use COMPONENTS? E.g. find_package(MPI COMPONENTS C) or find_package(MPI COMPONENTS Fortran). If nothing is specified, the default could be to look at global ENABLED_LANGUAGES property and go on from there and discover all components that are listed in there (i.e. C, CXX or Fortran).


Michael



More information about the CMake mailing list