title: Cuda with Boost
body: <p>I am currently writing a CUDA application and want to use the <a href="http://www.boost.org/doc/libs/1_47_0/doc/html/program_options.html" rel="noreferrer">boost::program_options</a> library to get the required parameters and user input.</p>
  
  <p>The trouble I am having is that NVCC cannot handle compiling the boost file <code>any.hpp</code> giving errors such as</p>
  
  <pre><code>1&gt;C:\boost_1_47_0\boost/any.hpp(68): error C3857: 'boost::any': multiple template parameter lists are not allowed
  </code></pre>
  
  <p>I searched online and found it is because NVCC <a href="http://forums.nvidia.com/index.php?showtopic=105359" rel="noreferrer">cannot handle the certain constructs used in the boost code</a> but that NVCC should delegate compilation of host code to the C++ compiler. In my case I am using Visual Studio 2010 so host code should be passed to <code>cl</code>.</p>
  
  <p>Since NVCC seemed to be getting confused I even wrote a simple wrapper around the boost stuff and stuck it in a separate <code>.cpp</code> (instead of <code>.cu</code>) file but I am still getting build errors. Weirdly the error is thrown upon compiling my <code>main.cu</code> instead of the <code>wrapper.cpp</code> but still is caused by boost even though <code>main.cu</code> doesn't include any boost <em>code</em>.</p>
  
  <p>Does anybody know of a solution or even workaround for this problem?</p>