Boost C++ Libraries: Ticket #3565: MPL-related Compilation Error in MPI and Graph Parallel libraries https://svn.boost.org/trac10/ticket/3565 <p> When compiling Boost, prepared with CMake of the <a class="ext-link" href="http://sodium.resophonic.com/boost-cmake/1.40.0.cmake2/"><span class="icon">​</span>1.40.0-cmake2</a> version, with a GCC 4.4.1 compiler on a 64bit Linux platform, there are two MPL-related errors: </p> <hr /> <p> Building CXX object libs/mpi/src/CMakeFiles/boost_mpi-mt-shared.dir/broadcast.cpp.o In file included from /home/build/dev/fedorasvn/reviews/boost_529563/boost-1.40.0.cmake2/boost/mpi/detail/mpi_datatype_cache.hpp:14, </p> <blockquote> <p> from /home/build/dev/fedorasvn/reviews/boost_529563/boost-1.40.0.cmake2/boost/mpi/datatype.hpp:28, from /home/build/dev/fedorasvn/reviews/boost_529563/boost-1.40.0.cmake2/boost/mpi/communicator.hpp:21, from /home/build/dev/fedorasvn/reviews/boost_529563/boost-1.40.0.cmake2/boost/mpi/collectives.hpp:22, from /home/build/dev/fedorasvn/reviews/boost_529563/boost-1.40.0.cmake2/boost/mpi/collectives_fwd.hpp:20, from /home/build/dev/fedorasvn/reviews/boost_529563/boost-1.40.0.cmake2/boost/mpi/collectives/broadcast.hpp:12, from /home/build/dev/fedorasvn/reviews/boost_529563/boost-1.40.0.cmake2/libs/mpi/src/broadcast.cpp:10: </p> </blockquote> <p> /home/build/dev/fedorasvn/reviews/boost_529563/boost-1.40.0.cmake2/boost/mpi/detail/mpi_datatype_oarchive.hpp: In member function âvoid boost::mpi::detail::mpi_datatype_oarchive::save_enum(const T&amp;, mpl_::true_)â: /home/build/dev/fedorasvn/reviews/boost_529563/boost-1.40.0.cmake2/boost/mpi/detail/mpi_datatype_oarchive.hpp:64: error: expected primary-expression before âenumâ /home/build/dev/fedorasvn/reviews/boost_529563/boost-1.40.0.cmake2/boost/mpi/detail/mpi_datatype_oarchive.hpp:64: error: expected â;â before âenumâ make<a class="changeset" href="https://svn.boost.org/trac10/changeset/2" title="Add Boost Disclaimer">[2]</a>: <strong>* [libs/mpi/src/CMakeFiles/boost_mpi-mt-shared.dir/broadcast.cpp.o] Error 1 make<a class="changeset" href="https://svn.boost.org/trac10/changeset/1" title="Import core sources for SVNmanger 0.38 ">[1]</a>: </strong>* [libs/mpi/src/CMakeFiles/boost_mpi-mt-shared.dir/all] Error 2 make: <strong>* [all] Error 2 </strong></p> <hr /> <p> For that error, the line 64 of $BOOST/boost/mpi/detail/mpi_datatype_oarchive.hpp must be changed, so that: BOOST_MPL_ASSERT((sizeof(T)==sizeof(int_type))); </p> <p> be replaced by: BOOST_MPL_ASSERT_RELATION( sizeof(T), ==, sizeof(int_type) ); </p> <p> And: </p> <hr /> <p> Building CXX object libs/graph_parallel/src/CMakeFiles/boost_graph_parallel-mt-shared.dir/mpi_process_group.cpp.o In file included from /home/build/dev/fedorasvn/reviews/boost_529563/boost-1.40.0.cmake2/boost/graph/distributed/mpi_process_group.hpp:808, </p> <blockquote> <p> from /home/build/dev/fedorasvn/reviews/boost_529563/boost-1.40.0.cmake2/libs/graph_parallel/src/mpi_process_group.cpp:14: </p> </blockquote> <p> /home/build/dev/fedorasvn/reviews/boost_529563/boost-1.40.0.cmake2/boost/graph/distributed/detail/mpi_process_group.ipp: In function âint boost::graph::distributed::receive(const boost::graph::distributed::mpi_process_group&amp;, int, int, T&amp;)â: /home/build/dev/fedorasvn/reviews/boost_529563/boost-1.40.0.cmake2/boost/graph/distributed/detail/mpi_process_group.ipp:722: error: âstderrâ was not declared in this scope /home/build/dev/fedorasvn/reviews/boost_529563/boost-1.40.0.cmake2/boost/graph/distributed/detail/mpi_process_group.ipp:724: error: there are no arguments to âfprintfâ that depend on a template parameter, so a declaration of âfprintfâ must be available /home/build/dev/fedorasvn/reviews/boost_529563/boost-1.40.0.cmake2/boost/graph/distributed/detail/mpi_process_group.ipp:724: note: (if you use â-fpermissiveâ, G++ will accept your code, but allowing the use of an undeclared name is deprecated) /home/build/dev/fedorasvn/reviews/boost_529563/boost-1.40.0.cmake2/boost/graph/distributed/detail/mpi_process_group.ipp: In function âtypename boost::enable_if&lt;boost::mpi::is_mpi_datatype&lt;T&gt;, std::pair&lt;int, unsigned int&gt; &gt;::type boost::graph::distributed::receive(const boost::graph::distributed::mpi_process_group&amp;, int, int, T*, size_t)â: /home/build/dev/fedorasvn/reviews/boost_529563/boost-1.40.0.cmake2/boost/graph/distributed/detail/mpi_process_group.ipp:743: error: âstderrâ was not declared in this scope /home/build/dev/fedorasvn/reviews/boost_529563/boost-1.40.0.cmake2/boost/graph/distributed/detail/mpi_process_group.ipp:745: error: there are no arguments to âfprintfâ that depend on a template parameter, so a declaration of âfprintfâ must be available /home/build/dev/fedorasvn/reviews/boost_529563/boost-1.40.0.cmake2/boost/graph/distributed/detail/mpi_process_group.ipp: In function âint boost::graph::distributed::receive(const boost::graph::distributed::mpi_process_group&amp;, int, int, T&amp;) [with T = int]â: /home/build/dev/fedorasvn/reviews/boost_529563/boost-1.40.0.cmake2/boost/graph/distributed/detail/mpi_process_group.ipp:609: instantiated from âvoid boost::graph::distributed::mpi_process_group::global_trigger_launcher&lt;Type, Handler&gt;::receive(const boost::graph::distributed::mpi_process_group&amp;, int, int, boost::graph::parallel::trigger_receive_context, int) const [with Type = int, Handler = void (*)(const boost::graph::distributed::mpi_process_group&amp;, int, int, int, bool)]â /home/build/dev/fedorasvn/reviews/boost_529563/boost-1.40.0.cmake2/libs/graph_parallel/src/mpi_process_group.cpp:1111: instantiated from here /home/build/dev/fedorasvn/reviews/boost_529563/boost-1.40.0.cmake2/boost/graph/distributed/detail/mpi_process_group.ipp:722: error: âfprintfâ was not declared in this scope /home/build/dev/fedorasvn/reviews/boost_529563/boost-1.40.0.cmake2/boost/graph/distributed/detail/mpi_process_group.ipp: In function âint boost::graph::distributed::receive(const boost::graph::distributed::mpi_process_group&amp;, int, int, T&amp;) [with T = boost::graph::distributed::mpi_process_group::outgoing_messages]â: /home/build/dev/fedorasvn/reviews/boost_529563/boost-1.40.0.cmake2/boost/graph/distributed/detail/mpi_process_group.ipp:609: instantiated from âvoid boost::graph::distributed::mpi_process_group::global_trigger_launcher&lt;Type, Handler&gt;::receive(const boost::graph::distributed::mpi_process_group&amp;, int, int, boost::graph::parallel::trigger_receive_context, int) const [with Type = boost::graph::distributed::mpi_process_group::outgoing_messages, Handler = void (*)(const boost::graph::distributed::mpi_process_group&amp;, int, int, boost::graph::distributed::mpi_process_group::outgoing_messages&amp;, bool)]â /home/build/dev/fedorasvn/reviews/boost_529563/boost-1.40.0.cmake2/libs/graph_parallel/src/mpi_process_group.cpp:1111: instantiated from here /home/build/dev/fedorasvn/reviews/boost_529563/boost-1.40.0.cmake2/boost/graph/distributed/detail/mpi_process_group.ipp:722: error: âfprintfâ was not declared in this scope make<a class="changeset" href="https://svn.boost.org/trac10/changeset/2" title="Add Boost Disclaimer">[2]</a>: <strong>* [libs/graph_parallel/src/CMakeFiles/boost_graph_parallel-mt-shared.dir/mpi_process_group.cpp.o] Error 1 make<a class="changeset" href="https://svn.boost.org/trac10/changeset/1" title="Import core sources for SVNmanger 0.38 ">[1]</a>: </strong>* [libs/graph_parallel/src/CMakeFiles/boost_graph_parallel-mt-shared.dir/all] Error 2 make: <strong>* [all] Error 2 </strong></p> <hr /> <p> For that error, a header file inclusion is missing around the line 22 of $BOOST/boost/graph/distributed/detail/mpi_process_group.ipp: #include &lt;cstdio&gt; </p> <p> I attach the corresponding patch. To apply it, just go to the $BOOST directory, copy the patch (boost-mpl-compilation-fix.patch file) into there, and type something like: patch -p1 --dry-run &lt; boost-mpl-compilation-fix.patch and, if everything seems fine: patch -p1 &lt; boost-mpl-compilation-fix.patch </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/3565 Trac 1.4.3 Denis Arnaud <denis.arnaud_boost@…> Mon, 26 Oct 2009 18:04:55 GMT attachment set https://svn.boost.org/trac10/ticket/3565 https://svn.boost.org/trac10/ticket/3565 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">boost-mpl-compilation-fix.patch</span> </li> </ul> Ticket Jeremiah Willcock Sat, 28 Nov 2009 17:08:15 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/3565#comment:1 https://svn.boost.org/trac10/ticket/3565#comment:1 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> This appears to have already been fixed in <a class="changeset" href="https://svn.boost.org/trac10/changeset/57782" title="Fix compilation error due to undefined fprintf/stderr. ">r57782</a> (for the cstdio issue) and <a class="changeset" href="https://svn.boost.org/trac10/changeset/56978" title="replaced MPL_ASSERT by STATIS_ASSERT because of gcc-4.4 bug">r56978</a> (for the BOOST_MPL_ASSERT issue). </p> Ticket