Boost C++ Libraries: Ticket #11822: nvcc can not compile BOOST_AUTO_TEST_CASE_TEMPLATE https://svn.boost.org/trac10/ticket/11822 <p> Compiling a test suite for testing CUDA code with nvcc with CUDA 7.5 and gcc 4.9. and leads to the following error: </p> <pre class="wiki">/usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/c++/bits/basic_string.h(444): error: identifier "std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt;::_Rep::_S_empty_rep_storage" is undefined in device code /usr/include/boost/test/tree/test_case_template.hpp(84): error: identifier "std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt;::_Rep::_S_terminal" is undefined in device code /usr/include/boost/test/tree/test_case_template.hpp(86): error: identifier "_ZTIi" is undefined /usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/c++/bits/basic_string.h(444): error: identifier "std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt;::_Rep::_S_empty_rep_storage" is undefined in device code /usr/include/boost/test/tree/test_case_template.hpp(84): error: identifier "std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt;::_Rep::_S_terminal" is undefined in device code /usr/include/boost/test/tree/test_case_template.hpp(86): error: identifier "_ZTIl" is undefined /usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/c++/bits/basic_string.h(444): error: identifier "std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt;::_Rep::_S_empty_rep_storage" is undefined in device code /usr/include/boost/test/tree/test_case_template.hpp(84): error: identifier "std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt;::_Rep::_S_terminal" is undefined in device code </pre><p> The test suite is more or less equal to the simple test in the boost.test documentation for templated tests. Here a snippet: </p> <pre class="wiki">#define BOOST_TEST_DYN_LINK #define BOOST_TEST_MODULE "Tests" #include &lt;boost/test/unit_test.hpp&gt; #include &lt;boost/mpl/list.hpp&gt; typedef boost::mpl::list&lt;int,long,unsigned char&gt; test_types; BOOST_AUTO_TEST_SUITE( template_test ) BOOST_AUTO_TEST_CASE_TEMPLATE( my_test, T, test_types ) { BOOST_CHECK_EQUAL( sizeof(T), (unsigned)4 ); } BOOST_AUTO_TEST_SUITE_END() </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/11822 Trac 1.4.3 Raffi Enficiaud Wed, 09 Dec 2015 20:06:01 GMT <link>https://svn.boost.org/trac10/ticket/11822#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11822#comment:1</guid> <description> <p> Hi, </p> <p> Are you sure you are able to compile any C++ code? What is the command line that you use for compiling with nvcc? </p> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Tue, 02 Feb 2016 04:06:13 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/11822#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11822#comment:2</guid> <description> <p> I don't think we can avoid using std::string in Boost.Test. Is there a way to enable STL in cuda code? </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Raffi Enficiaud</dc:creator> <pubDate>Thu, 08 Sep 2016 11:14:07 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/11822#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11822#comment:3</guid> <description> <p> It is not clear what you are trying to do and what the problem is. Please post a snippet/file with the command line for compilation, and the trace of the error you got. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Raffi Enficiaud</dc:creator> <pubDate>Wed, 06 Sep 2017 10:38:15 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/11822#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11822#comment:4</guid> <description> <p> Ay news? </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Raffi Enficiaud</dc:creator> <pubDate>Tue, 02 Jan 2018 21:22:20 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/11822#comment:5 https://svn.boost.org/trac10/ticket/11822#comment:5 <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">invalid</span> </li> </ul> <p> Closing, no news for 2 years. </p> Ticket