Programming CUDA in Netbeans IDE

I have been trying to compile a project with CUDA (.cu) files in it via the Netbeans IDE (version 7.1) on Ubuntu 11.10 unsuccesfully for a while now and I came here to see if anyone has done this or done this on any free IDE for Linux for that matter?

I can get the sample programs that come with the SDK in ~/NVIDIA_GPU_Computing_SDK/C/src/ to compile just fine using make in the respective program’s directory but I cannot for the life of me get the same exact program to compile on Netbeans. I have tried several tutorials online, all to no avail. The proper include directories are all there, my C and C++ compiler is set to nvcc and I even tried using the same exact makefile that one of the sample programs in the SDK (bandwidthTest) uses in my netbeans project. The most recent error I am getting is

make: *** No rule to make target `obj/x86_64/release/main.cu.o', needed by `../../bin/linux/release/bandwidthTest'.  Stop.

I only have one file which I renamed to main.cu and that is the bandwidthTest.cu file. Much thanks to anyone who can help or perhaps point out something I might not be considering.

I have no experience with NetBeans, but I’m successfully writing and compiling CUDA code using Eclipse. I use YDL CUDA Toolchain or Eclipse Toolchain for CUDa and QT. The first one seems kinda abandoned, but who knows. For serious work I use Makefiles, there’s a nice tutorial here.

I’ve been struggling with the same problem and have had some success getting this to work. When you create a new project don’t select Automatic configuration mode on the first tab of the new project wizard. You need to create the project using the existing makefiles rather than have Netbeans try and create the Makefile for you. Basically select manual configuration at every point in the generation of the new project. To get the samples to run in Netbeans you can’t just use the makefile in the directory of the sample code you’re trying to build. The makefile in the project directory only builds the sources in that directory. In order for the project to build it includes the common.mk from the C/common directory that builds the cuda utilities which in turn need the libraries in shared. You have to build using the makefile in the C directory that will build common, shared and the project you are interested in. It’s all rather painful to setup with Netbeans and I’m still trying to sort out how to do some critical things. I can’t get Netbeans to send the dbg=1 command when it executes make to build the code with debugging (you need to execute this from the command line outside of netbeans).
Sincerely,
Jennifer Milburn

Hi,

I’ve been writing CUDA code in Netbeans for like 3 months now. I’ve done remote an local debug. I think I can help you there.

To append commands to the make command do it in Project->Properties->Build->Make and in the Build Command box you can see it’s running ${MAKE} -f Makefile, there it’s just like if you were executing this line straight in the termial substituting ${MAKE} with whatever path to the make executable you selected, so in other words if you want to append dbg=1 (which is the case for the SDK) it must be:

${MAKE} -f Makefile dbg=1

You can se in the Clean Command box its running:

${MAKE} -f Makefile clean

So you can tell from there that you can actually execute any configuration from your make file. Let’s say you want to execute “make demo1” you would write in the Build Command box:

${MAKE} -f Makefile demo1 dbg=1

You can even use a different makefile…

And so on and so forth…

Anyone succeeded in installing this plugin for

Mac OS X version 10.6.8 | NB7.1 ?

(I know it’s for linux users here…)

Cheers

N