I started programming Cuda a couple of months ago at my University. Our task was to optimize a video encoder and our precode was written in C. This caused a lot of trouble when including .cu files, since NVCC 2.x actually compiles these files as c++ files. c++ compilation enforces a different syntax for function symbols in object code, which resolved in linking errors of the type “undefined reference” when linking .cu object code with c compiled code (in the cases where the .c and .cu source files share headers). The situation can be remedied by putting all shared function declarations inside extern “C” {}.
While the latest NVCC documentation includes options for steering this aspect of compilation, e.g. the “–host-compilation” flag, these are deprecated with the latest NVCC version. In my current situation I am developing on an open source project written entirely in C, and while I am able to compile it successfully the c++ compiler is a lot stricter than the c compiler and generates errors in the native code.
Therefore - is it still possible to generate c compiled host code with the latest version of NVCC?