nvcc fails to compile boost::spirit

I’ve found out that the following code does not copile with nvcc:


#include <boost/spirit/include/qi.hpp>

int main(){



Compiling with [font=“Courier New”]nvcc main.cu[/font] I get a lot of errors that can be seen here.

Note that I’m just including the header.

But if I change the filename to main.cpp, and compile again with [font=“Courier New”]nvcc main.cpp[/font], it works.

I don’t know if this is a problem with boost or nvcc, but in any case I’m putting it here to let you guys know.

The system on witch I’m trying this:

    Linux 2.6.32-34 x86_64

    Ubuntu 10.04.3 LTS

    Cuda compilation tools release 4.0, V0.2.1221

    On a GeForce GT 430

Have you had a chance to try the toolchain from the CUDA 4.1 release candidate to see whether the issue persists?

Given that the code compiles with the host compiler, but causes problems when nvcc handles the code before passing it on to the host compiler, a problem with the CUDA compiler seems likely. It would be helpful if you could file a bug for this. Please attach a self-contained repro case, and state relevant system information (in case the problem is isolated to specific platforms). Thank you for your help.

I’m attaching a repro case. There is a read-me file with instructions to reproduce the problem.

Unfortunately I’m not able to try the toolchain from the CUDA 4.1 rc right now.

boostNVCC.tar.gz (614 Bytes)

Bugs can be submitted through the registered developer website, partners.nvidia.com. Once you log in, there is a column with menu of items on the left hand side. The third item from the top is “Bug Report”. Clicking on that opens a browser form for entering a bug into the bug data base. Each registered developer can check on the status of bugs they have filed.