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

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

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 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.

#1
Posted 01/27/2012 04:06 AM   
I have no experience with NetBeans, but I'm successfully writing and compiling CUDA code using Eclipse. I use [url="http://ydl.net/eclipse_cuda_plugin/quickstart.shtml"]YDL CUDA Toolchain[/url] or [url="http://www.ai3.uni-bayreuth.de/software/eclipsecudaqt/"]Eclipse Toolchain for CUDa and QT[/url]. The first one seems kinda abandoned, but who knows. For serious work I use Makefiles, there's a nice tutorial [url="http://lifeofaprogrammergeek.blogspot.com/2008/07/using-eclipse-for-cuda-development.html"]here[/url].
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.

#2
Posted 01/28/2012 12:17 AM   
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
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

#3
Posted 01/29/2012 09:01 PM   
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:
[code]${MAKE} -f Makefile dbg=1[/code]

You can se in the Clean Command box its running:
[code]${MAKE} -f Makefile clean[/code]

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:
[code]${MAKE} -f Makefile demo1 dbg=1[/code]

You can even use a different makefile...

And so on and so forth...
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...

#4
Posted 02/07/2012 05:13 AM   
[size="2"]Anyone succeeded in installing this [url="http://plugins.netbeans.org/plugin/36176#comm"]plugin[/url] for
Mac OS X version 10.6.8 | NB7.1 ?
[/size][size="2"](I know it's for linux users here..) [/size]
[size="2"][color="#000000"]
Cheers

N[/color][/size]
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

#5
Posted 04/10/2012 07:42 PM   
Scroll To Top