Cuda project in Eclipse Nsight with GCC and NVCC


I’m trying to use GCC and NVCC in a eclipse nsight, does anyone have makefile template that could compile .cu with nvcc and .cpp with gcc??

I’m new to make file project and it seems too complicated to make one!


You can do custom makefile, or you could create two project - a library project and an executable project. Then one of them would be built with GCC toolchain and another with CUDA Toolkit. Then you would link them together.

As far as i know NVCC just calls GCC for host source compilation. Unless you need C++11 features, i think you can just use the default CUDA C/C++ project.

If you want to pass custom arguments such as -march=native to GCC you can do so in the project properties -> Build -> Settings -> Tool Settings Tab -> Build Stages -> Preprocessor Options. (One argument per field)

Sorry if it’s not a direct answer to your question. I’m unfamiliar with making custom makefiles myself.