I'm running nvcc-6.5 on a remote Ubuntu machine. I don't have root access. The default g++ installed is 4.6, which doesn't support C++ 11. clang++ 3.4 is also installed, which does support -std=c++11 flag.
After much doc reading and googling online, I try to run the following command:
nvcc -ccbin /usr/bin/clang++ hello.cu
where hello.cu contains only the simplest main function. The error messages look like:
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/bits/allocator.h(151): error: identifier "__is_empty" is undefined
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/bits/allocator.h(151): error: function call is not allowed in a constant expression
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/bits/allocator.h(151): error: type name is not allowed
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/bits/allocator.h(168): error: identifier "__is_empty" is undefined
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/bits/allocator.h(168): error: function call is not allowed in a constant expression
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/bits/allocator.h(168): error: type name is not allowed
6 errors detected in the compilation of "/tmp/tmpxft_00007356_00000000-8_hello.cpp1.ii".
If I add a c++11 flag as suggested online,
nvcc -ccbin /usr/bin/clang++ -Xcompiler "-std=c++11" hello.cu
The error messages look very similar and get much longer.
I appreciate any help or comment! Please!
Aucun commentaire:
Enregistrer un commentaire