Boost C++ Libraries: Ticket #10998: Error: Boost_MPI send(): explicit specialization must precede its first use https://svn.boost.org/trac10/ticket/10998 <p> Dear Boost-Support, </p> <p> when compiling a file with NVCC 6.5.14 containing calls to isend() etc. of boost:mpi, the following error occ </p> <p> nvcc -std=c++11 -arch=sm_20 -c file.cu boost/1.55.0-gnu4.8/include/boost/mpi/communicator.hpp(1612): error: explicit specialization of function "boost::mpi::communicator::send(int, int, const T &amp;) const [with T=boost::mpi::packed_oarchive]" must precede its first use ( (1127): here) </p> <p> boost/1.55.0-gnu4.8/include/boost/mpi/communicator.hpp(1635): error: explicit specialization of function "boost::mpi::communicator::recv(int, int, T &amp;) const [with T=boost::mpi::packed_iarchive]" must precede its first use ( (1191): here) </p> <p> boost/1.55.0-gnu4.8/include/boost/mpi/communicator.hpp(1670): error: explicit specialization of function "boost::mpi::communicator::isend(int, int, const T &amp;) const [with T=boost::mpi::packed_oarchive]" must precede its first use ( (1276): here) </p> <p> Could you please help me regarding the error above? </p> <p> Best regards, Peter </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/10998 Trac 1.4.3 tferguson Thu, 15 Dec 2016 16:18:44 GMT <link>https://svn.boost.org/trac10/ticket/10998#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/10998#comment:1</guid> <description> <p> I have experienced the same issue in Boost 1.61.0 using the Intel 16 compiler. This error is not encountered when using GCC 5.3.0. I have found that I can remove the error if I move the function declarations for: </p> <p> communicator::send_impl </p> <p> communicator::recv_impl </p> <p> communicator::isend_impl </p> <p> communicator::irecv_impl </p> <p> communicator::array_send_impl </p> <p> communicator::array_recv_impl </p> <p> communicator::array_isend_impl </p> <p> in communicator.hpp to <strong>after</strong> the specialization lines (marked as INTERNAL ONLY, around lines 1600-1700), then the error is no longer experienced and the code compiles. </p> <p> The source of the error appears to be that the above functions instantiate send/recv objects using packed_oarchive and packed_iarchive types, then the specialization becomes redundant according to the compiler and an error is encountered when reading the communicator.hpp header. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>gnthibault</dc:creator> <pubDate>Tue, 21 Feb 2017 12:53:29 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/10998#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/10998#comment:2</guid> <description> <p> Awesome, thank you very much tferguson for sharing your solution. I do experienced the same problem with cuda 8.0 and gcc 5.4. Would someone consider pushing that modification for the next release of boost ? </p> </description> <category>Ticket</category> </item> <item> <author>gnthibault@…</author> <pubDate>Tue, 21 Feb 2017 14:57:09 GMT</pubDate> <title>version changed; keywords set https://svn.boost.org/trac10/ticket/10998#comment:3 https://svn.boost.org/trac10/ticket/10998#comment:3 <ul> <li><strong>keywords</strong> explicit specialization added </li> <li><strong>version</strong> <span class="trac-field-old">Boost 1.55.0</span> → <span class="trac-field-new">Boost 1.63.0</span> </li> </ul> Ticket gnthibault@… Tue, 21 Feb 2017 14:57:24 GMT version changed; keywords set https://svn.boost.org/trac10/ticket/10998#comment:3 https://svn.boost.org/trac10/ticket/10998#comment:3 <ul> <li><strong>keywords</strong> explicit specialization added </li> <li><strong>version</strong> <span class="trac-field-old">Boost 1.55.0</span> → <span class="trac-field-new">Boost 1.63.0</span> </li> </ul> Ticket