Note that there are some explanatory texts on larger screens.

plurals
  1. POcmake: linking software to boost::mpi (with mpich2)
    text
    copied!<p>For this simple code (taken from the boost-mpi documentation):</p> <pre><code>#include &lt;boost/serialization/string.hpp&gt; #include &lt;iostream&gt; #include &lt;string&gt; #include &lt;boost/mpi.hpp&gt; namespace mpi = boost::mpi; int main(int argc, char *argv[]) { mpi::environment env(argc, argv); mpi::communicator world; if (world.rank() == 0) { world.send(1, 0, std::string("Hello")); std::string msg; world.recv(1, 1, msg); std::cout &lt;&lt; msg &lt;&lt; "!" &lt;&lt; std::endl; } else if (world.rank() == 1) { std::string msg; world.recv(0, 0, msg); std::cout &lt;&lt; msg &lt;&lt; ", "; std::cout.flush(); world.send(0, 1, std::string("world")); }; return 0; }; </code></pre> <p>And for such CMakeLists.txt:</p> <pre><code>CMAKE_MINIMUM_REQUIRED(VERSION 2.6) PROJECT(mpi-tests CXX) FIND_PACKAGE(Boost 1.4 COMPONENTS mpi serialization REQUIRED) INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS}) TARGET_LINK_LIBRARIES(test ${Boost_LIBRARIES}) </code></pre> <p>It cannot find boost_mpi:</p> <pre><code>CMake Error at /usr/share/cmake/Modules/FindBoost.cmake:1135 (message): Unable to find the requested Boost libraries. Boost version: 1.47.0 Boost include path: /usr/include The following Boost libraries could not be found: boost_mpi </code></pre> <p>But! I have installed next packages:</p> <pre><code>boost-graph-mpich2 boost-mpich2 boost-mpich2-devel boost-mpich2-python mpich2 mpich2-devel </code></pre> <p>Why it can't find? There are a plenty examples over Internet where people use <strong>FIND_PACKAGE(Boost 1.4 COMPONENTS mpi REQUIRED)</strong>.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload