Boost logo

Boost Interest :

Subject: Re: [Boost-cmake] How to have Boost.MPI use OpenMPI (rather than MPICH2)
From: Denis Arnaud (denis.arnaud_boost_at_[hidden])
Date: 2009-12-27 07:51:15


2009/12/15 troy <troy_at_[hidden]>

> alt.boost.cmake uses cmake's standard detection of MPI... our docs are
> very terse:
>
> http://sodium.resophonic.com/boost-cmake/current-docs/externals/mpi.html
>
> See the cmake docs for FindMPI. I assume the best way is to tweak some
> cache variables post-installation.
>

I have not found any FindMPI.cmake file (even in MPICH2 or OpenMPI project
directories), but only a MPI.cmake file, in
<boost-source-root-dir>/tools/build/CMake/externals. There, by adding the
following lines, I was successful in building Boost.MPI with OpenMPI rather
than with MPICH2:
---------------------------------------------------------------------------------
set(MPI_INCLUDE_PATH /usr/include/openmpi-x86_64)
set(MPI_COMPILE_FLAGS -I/usr/include/openmpi-x86_64)
set(MPI_LINK_FLAGS -L/usr/lib64/openmpi/lib -L/usr/lib64/openmpi/lib/openmpi
-lmpi_cxx -lmpi)
set(MPI_LIBRARIES /usr/lib64/openmpi/lib/libmpi.so
/usr/lib64/openmpi/lib/libmpi_cxx.so)
set(MPI_FOUND 1)
---------------------------------------------------------------------------------
[Note: the file attached is the corresponding patch]

However, you may see that I am not a CMake specialist, and that I have
hard-coded the pathes of OpenMPI. So, if some of you know better CMake than
I do, do not hesitate to improve OpenMPI detection.

D.





Boost-cmake list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk