$ nvcc test.cu
gcc: language c++ not recognized
gcc: language c++ not recognized
gcc: test.cu: linker input file unused because linking not done
Catastrophic error: cannot open source file “/tmp/tmpxft_00005c75_00000000-4_test.cpp1.ii”
1 catastrophic error detected in the compilation of “/tmp/tmpxft_00005c75_00000000-4_test.cpp1.ii”.
Compilation terminated.
You’ve got a custom-build gcc version where C++ support has been switched off. However, CUDA uses C++ mode to implement its language extensions, even if you select C as language. As you figured out, switching to the gcc supplied with Xcode solves the problem, as would a custom gcc install with C++ enabled.
You’ve got a custom-build gcc version where C++ support has been switched off. However, CUDA uses C++ mode to implement its language extensions, even if you select C as language. As you figured out, switching to the gcc supplied with Xcode solves the problem, as would a custom gcc install with C++ enabled.