Boost C++ Libraries: Ticket #6629: NVCC chokes on boost/mpl/map https://svn.boost.org/trac10/ticket/6629 <p> We're now receiving a bug report from our customers that they are hitting a problem compiling a code including boost with NVCC. </p> <p> The bug report from our customer: </p> <hr /> <p> Unfortunately I’m now hitting a real problem with NVCC elsewhere in boost too. Once again, merely including the header is enough to trip up NVCC (but only on Windows): </p> <p> boost_mpl_map.cu: #include &lt;boost/mpl/map.hpp&gt; int main( int argc, char <strong> argv ) { } </strong></p> <p> C:\&gt;nvcc boost_mpl_map.cu -o boost_mpl_map.exe -Iboost/include/boost-1_44 boost_mpl_map.cu tmpxft_00000764_00000000-3_boost_mpl_map.cudafe1.gpu tmpxft_00000764_00000000-8_boost_mpl_map.cudafe2.gpu boost_mpl_map.cu tmpxft_00000764_00000000-3_boost_mpl_map.cudafe1.cpp tmpxft_00000764_00000000-14_boost_mpl_map.ii stuff/boost/include/boost-1_44\boost/mpl/aux_/order_impl.hpp(35) : error C2064: term does not evaluate to a function taking 2 arguments stuff/boost/include/boost-1_44\boost/mpl/aux_/order_impl.hpp(57) : see reference to class template instantiation 'boost::mpl::x_order_impl&lt;Seq,Key&gt;' being compiled </p> <p> As with the previous issues, compiling as a .cpp (still using NVCC) is fine. This affects both CUDA 4.0 and CUDA 4.1, and I’m using VS2010 for CL. A workaround would be greatly appreciated if you can find one as I haven’t managed to come up with one yet! </p> <hr /> <p> This issue has been investigated by our developers and finally it was root caused as a boost issue. He downloaded boost 1.44.0, and found that boost is doing something special when <span class="underline">CUDACC</span> is defined. </p> <p> boost_1_44_0$ grep -IR CUDACC * boost/config/select_compiler_config.hpp:#elif defined <span class="underline">CUDACC</span> </span></p> <table class="wiki"> <tr>boost/concept/detail/has_constraints.hpp:#if BOOST_WORKAROUND(<span class="underline">SUNPRO_CC, &lt;= 0x580) <td> defined(<span class="underline">CUDACC</span>) </td></tr></table> <p> boost/type_traits.hpp:#if !defined(<span class="underline">BORLANDC</span>) &amp;&amp; !defined(<span class="underline">CUDACC</span>) </p> <p> Unfortunately, this special workaround in boost does not work properly. </p> <p> If he just compile the example code supplied in the description with the Microsoft compiler, after renaming it to .cpp, with <span class="underline">CUDACC</span> defined, the compilation fails. </p> <p> U:\&gt; type main.cpp #include &lt;boost/mpl/map.hpp&gt; int main(int argc, char *argv[]) { return 0; } </p> <p> U:\&gt; cl -D<span class="underline">CUDACC</span> -Iboost_1_44_0 main.cpp Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 15.00.30729.01 for 80x86 Copyright (C) Microsoft Corporation. All rights reserved. </p> <p> main.cpp boost_1_44_0\boost/mpl/aux_/order_impl.hpp(50) : error C2064: term does not evaluate to a function taking 2 arguments boost_1_44_0\boost/mpl/aux_/order_impl.hpp(57) : see reference to class template instantiation 'boost::mpl::x_order_impl&lt;Seq,Key&gt;' being compiled </p> <p> So, this might be a bug in boost. If the boost implementers put this special treatment for nvcc due to a bug in nvcc, we are willing to work on the real bug, but this one is a bug in the special treatment code. </p> <p> Best regards, Andrew Shao </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/6629 Trac 1.4.3 Andrew Shao <gshao@…> Wed, 07 Mar 2012 08:53:47 GMT <link>https://svn.boost.org/trac10/ticket/6629#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6629#comment:1</guid> <description> <p> Hello, </p> <p> Has this problem been investigated? Is there any update? </p> <p> Regards, Andrew Shao </p> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Tue, 27 Mar 2012 08:29:55 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/6629#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6629#comment:2</guid> <description> <p> Hello there, </p> <p> Is there any update about this issue? Thanks. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>viboes</dc:creator> <pubDate>Mon, 28 May 2012 17:28:47 GMT</pubDate> <title>component changed; owner set https://svn.boost.org/trac10/ticket/6629#comment:3 https://svn.boost.org/trac10/ticket/6629#comment:3 <ul> <li><strong>owner</strong> set to <span class="trac-author">Aleksey Gurtovoy</span> </li> <li><strong>component</strong> <span class="trac-field-old">None</span> → <span class="trac-field-new">mpl</span> </li> </ul> <p> Please set the component in the future if you want it to be analyzed. </p> Ticket