nvcc bug w/ templaes - compiles .cpp but not .cu

Hi, I was using the CGAL libraries with my code and everything was fine until I tried to use this particular piece of code:
So I decided to compile a minimal example with nvcc:
and I get the same errors I got with my own code:

As long as the source file is named “.cpp" everything works fine, but if I change the ending to ".cu”, these template errors pop out.

I know this is lot to look at, but I’m just wondering: is anyone aware if nvcc is having some difficulties with templates?

$nvcc --version
Cuda compilation tools, release 9.0, V9.0.176

errors when compiling as:

nvcc as.cu -lCGAL -lmpfr -lgmp -lboost_thread

everything ok when compiling like:

nvcc as.cpp -lCGAL -lmpfr -lgmp -lboost_thread

I didn’t look carefully through your error output so, I may take a wild guess that CGAL uses many c++14 features. To enable those, you can try

nvcc -std=c++14 as.cu -lCGAL -lmpfr -lgmp -lboost_thread

Apologies if it is not helpful.

Oh, I forgot to say that I tried that too. In the end I just reordered my code, so these libraries only showed up in *cpp files.

simple template does work fine for all nvcc’s that I’ve used,

but I know CGAL code is heavy on template, especially latest standards, portability has always been an issue. try an old CGAL release perhaps.