IDE for CUDA Using Netbeans C/C++ IDE with CUDA
  1 / 2    
Installing CUDA compiler/debugger for NetBeans IDE on Linux Ubuntu
Hi everyone,

I use Netbeans everyday as my main IDE for Java and C++ projects, and here is my experience using it for CUDA. With it you have everything you need compile projects with colored syntax and auto-complete and also debug step by step, view variables.... I use Ubuntu 7.10 but it should be about the same for Windows except the "path" and "lib".
I think it could be interesting for users who don't already have an IDE and it's FREE!

How to install?

After installing CUDA toolkit, SDK, video driver...

download nebeans 6.0 on [url="http://www.netbeans.org/"]http://www.netbeans.org/[/url] all or C++ only
install

launch netbeans
open new project c/c++ application

how to have the keywords colored for a .cu file extension?
in the menu tool-->option button advanced
open "IDE Configuration" folder on the left tree
open "System" folder
open "Object Types" folder
select "C Data Object" and add ",cu" at the end of "Extensions and MIME type"
close the option box

how to create a source file?
on the left project tree, right click on "Source Files"
New-->Other create an "empty file" and name it whatever.cu
the next time the menu will show the New-->Empty file right away

how to create a kernel source file that is used with #include from the main .cu file?
same as a .cu file except at the end, right click on the file and "properties"
and in the General category, check the box "Excluded from build"

how to compile?
Right click on your project and "properties"
In the General tab, uncheck both "C compiler required" and "C++ compiler required", select "Generic" in the list box of "Platform"
On the tree select "C/C++"-->"C Compiler"-->"General"
and change the include directories to somewhat like that:
.:/usr/local/cuda/include:/home/patrick/NVIDIA_CUDA_SDK/common/inc
modify to your very path.
and in the "Tool" type nvcc
noe in the "C/C++"-->"C Compiler"-->"Command Line" set these options -v -deviceemu --compile -G0
do exactly the same for the "C/C++"-->"C++ Compiler"
now set the linker, in the same properties box, select "Linker"-->"General", change "Tool" to nvcc
in the "Linker"-->"Libraries" add "cudart" and cutil with th e"Add Library button" select .a and get the library for your "NVIDIA_CUDA_SDK/lib/libcuda.a"
same for cudart but select dynamic library ".so" and get it from /usr/local/cuda/libcudart.so
put "--link" in the "Linker"-->"Command Line"
and "OK" the project properties box

everything should work well if you have the right path for lib and nvcc in your system environment
I couldn't find an easy way to set the LD_LIBRARY_PATH on Ubuntu, so if you know... anyway I have modified the /etc/ld.so.conf.d/libc.conf and add the cuda lib at the end, it require to restart the machine, I know it's bad but works well :">
# libc default configuration
/usr/local/lib
/usr/local/cuda/lib

Same for the path to nvcc
I have modified the /etc/environment
to that:
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/u
sr/local/cuda/bin"
LANG="en_US.UTF-8"
Installing CUDA compiler/debugger for NetBeans IDE on Linux Ubuntu

Hi everyone,



I use Netbeans everyday as my main IDE for Java and C++ projects, and here is my experience using it for CUDA. With it you have everything you need compile projects with colored syntax and auto-complete and also debug step by step, view variables.... I use Ubuntu 7.10 but it should be about the same for Windows except the "path" and "lib".

I think it could be interesting for users who don't already have an IDE and it's FREE!



How to install?



After installing CUDA toolkit, SDK, video driver...



download nebeans 6.0 on http://www.netbeans.org/ all or C++ only

install



launch netbeans

open new project c/c++ application



how to have the keywords colored for a .cu file extension?

in the menu tool-->option button advanced

open "IDE Configuration" folder on the left tree

open "System" folder

open "Object Types" folder

select "C Data Object" and add ",cu" at the end of "Extensions and MIME type"

close the option box



how to create a source file?

on the left project tree, right click on "Source Files"

New-->Other create an "empty file" and name it whatever.cu

the next time the menu will show the New-->Empty file right away



how to create a kernel source file that is used with #include from the main .cu file?

same as a .cu file except at the end, right click on the file and "properties"

and in the General category, check the box "Excluded from build"



how to compile?

Right click on your project and "properties"

In the General tab, uncheck both "C compiler required" and "C++ compiler required", select "Generic" in the list box of "Platform"

On the tree select "C/C++"-->"C Compiler"-->"General"

and change the include directories to somewhat like that:

.:/usr/local/cuda/include:/home/patrick/NVIDIA_CUDA_SDK/common/inc

modify to your very path.

and in the "Tool" type nvcc

noe in the "C/C++"-->"C Compiler"-->"Command Line" set these options -v -deviceemu --compile -G0

do exactly the same for the "C/C++"-->"C++ Compiler"

now set the linker, in the same properties box, select "Linker"-->"General", change "Tool" to nvcc

in the "Linker"-->"Libraries" add "cudart" and cutil with th e"Add Library button" select .a and get the library for your "NVIDIA_CUDA_SDK/lib/libcuda.a"

same for cudart but select dynamic library ".so" and get it from /usr/local/cuda/libcudart.so

put "--link" in the "Linker"-->"Command Line"

and "OK" the project properties box



everything should work well if you have the right path for lib and nvcc in your system environment

I couldn't find an easy way to set the LD_LIBRARY_PATH on Ubuntu, so if you know... anyway I have modified the /etc/ld.so.conf.d/libc.conf and add the cuda lib at the end, it require to restart the machine, I know it's bad but works well :">

# libc default configuration

/usr/local/lib

/usr/local/cuda/lib



Same for the path to nvcc

I have modified the /etc/environment

to that:

PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/u

sr/local/cuda/bin"

LANG="en_US.UTF-8"

#1
Posted 01/16/2008 10:44 PM   
I will appreciate if you have some info (step by step) how to set up the 169 driver on Ubuntu 7.10 in order to run CUDA 1.1. I am using CUDA 1.0 with 100.xx driver but have no success to install the new driver.
I will appreciate if you have some info (step by step) how to set up the 169 driver on Ubuntu 7.10 in order to run CUDA 1.1. I am using CUDA 1.0 with 100.xx driver but have no success to install the new driver.

#2
Posted 01/17/2008 10:42 AM   
[quote name='zoro123' date='Jan 17 2008, 03:42 AM']I will appreciate if you have some info (step by step) how to set up the 169 driver on Ubuntu 7.10 in order to run CUDA 1.1. I am using CUDA 1.0 with 100.xx driver but have no success to install the new driver.
[right][snapback]311224[/snapback][/right]
[/quote]

I don't know what is the 169 driver where to find it?

I have downloaded the install package from Nvidia
NVIDIA-Linux-x86-96.43.01-pkg1.run
the latest one should work the same way (NVIDIA-Linux-x86-100.14.11-pkg1.run)

then logout Ubuntu
from the login panel "Ctrl" "Alt" "F2" opens a text console
login as an administrator, yourself by default, not root
to kill the Xorg process
search for process id with ps -e | more
....
4564 tty7 00:03:54 Xorg
....

"sudo killl processid#" (e.g. kill 4564)

go to ring 3 level
"sudo /sbin/init 3"

cd where you have the package
cd /home/you/downloads

sudo chmod +x NVIDIA-Linux-x86-96.43.01-pkg1.run
sudo ./NVIDIA-Linux-x86-96.43.01-pkg1.run
accept the license

sudo reboot

that's it
but sometimes when you kill the X.org your console is logout, so redo again and it works
[quote name='zoro123' date='Jan 17 2008, 03:42 AM']I will appreciate if you have some info (step by step) how to set up the 169 driver on Ubuntu 7.10 in order to run CUDA 1.1. I am using CUDA 1.0 with 100.xx driver but have no success to install the new driver.

[snapback]311224[/snapback]






I don't know what is the 169 driver where to find it?



I have downloaded the install package from Nvidia

NVIDIA-Linux-x86-96.43.01-pkg1.run

the latest one should work the same way (NVIDIA-Linux-x86-100.14.11-pkg1.run)



then logout Ubuntu

from the login panel "Ctrl" "Alt" "F2" opens a text console

login as an administrator, yourself by default, not root

to kill the Xorg process

search for process id with ps -e | more

....

4564 tty7 00:03:54 Xorg

....



"sudo killl processid#" (e.g. kill 4564)



go to ring 3 level

"sudo /sbin/init 3"



cd where you have the package

cd /home/you/downloads



sudo chmod +x NVIDIA-Linux-x86-96.43.01-pkg1.run

sudo ./NVIDIA-Linux-x86-96.43.01-pkg1.run

accept the license



sudo reboot



that's it

but sometimes when you kill the X.org your console is logout, so redo again and it works

#3
Posted 01/17/2008 06:22 PM   
[quote name='patrick16' date='Jan 17 2008, 11:22 AM']I don't know what is the 169 driver where to find it?
[/quote]

I found it on the same download page, my screen is maybe not big enough /crying.gif' class='bbc_emoticon' alt=':'(' />
[quote name='patrick16' date='Jan 17 2008, 11:22 AM']I don't know what is the 169 driver where to find it?





I found it on the same download page, my screen is maybe not big enough /crying.gif' class='bbc_emoticon' alt=':'(' />

#4
Posted 01/17/2008 06:31 PM   
Tanks a lot :) I upgraded successfully. Probably ENVY set the all files previous time (e.g. removing the nv driver), so now upgrade to new driver manually is as just you described.
Tanks a lot :) I upgraded successfully. Probably ENVY set the all files previous time (e.g. removing the nv driver), so now upgrade to new driver manually is as just you described.

#5
Posted 01/20/2008 09:34 PM   
Thanks for the setup. I have set up a project including C++ and CUDA where the CUDA code is called from a C++ main. I configured the C compiler to use nvcc and the left the c++ compiler as is (g++). As linker I also use g++.

However, I am unable to step through the code. I insert a breakpoint in the cpp and cu files, but the program just runs straight through. Is there anything special I have to do to make debugging work?

- Atle
Thanks for the setup. I have set up a project including C++ and CUDA where the CUDA code is called from a C++ main. I configured the C compiler to use nvcc and the left the c++ compiler as is (g++). As linker I also use g++.



However, I am unable to step through the code. I insert a breakpoint in the cpp and cu files, but the program just runs straight through. Is there anything special I have to do to make debugging work?



- Atle

#6
Posted 01/23/2008 04:46 PM   
[quote name='atlruds' date='Jan 23 2008, 09:46 AM']Thanks for the setup. I have set up a project including C++ and CUDA where the CUDA code is called from a C++ main. I configured the C compiler to use nvcc and the left the c++ compiler as is (g++). As linker I also use g++.

However, I am unable to step through the code. I insert a breakpoint in the cpp and cu files, but the program just runs straight through. Is there anything special I have to do to make debugging work?

- Atle
[right][snapback]313689[/snapback][/right]
[/quote]

I personally use nvcc for any files even to compile and link C++ ( the nvcc calls g++ ). I use the regular gdb debugger, I am able to debug (CTRL + F5) any code even the kernel (in Debug Emu mode only), except the the step in (F7) doesn't go it the kernel code, to step in I have to first put a break point in the kernel source code and step over(F8). May be it's ok to use g++ to compile but I guess the nvcc is required to link in emulation mode. But even if you link with g++ you should be able to stop on a break set in the c++ file.
Have you tried to debug in a terminal with the gdb or with kDbg ?
[quote name='atlruds' date='Jan 23 2008, 09:46 AM']Thanks for the setup. I have set up a project including C++ and CUDA where the CUDA code is called from a C++ main. I configured the C compiler to use nvcc and the left the c++ compiler as is (g++). As linker I also use g++.



However, I am unable to step through the code. I insert a breakpoint in the cpp and cu files, but the program just runs straight through. Is there anything special I have to do to make debugging work?



- Atle

[snapback]313689[/snapback]






I personally use nvcc for any files even to compile and link C++ ( the nvcc calls g++ ). I use the regular gdb debugger, I am able to debug (CTRL + F5) any code even the kernel (in Debug Emu mode only), except the the step in (F7) doesn't go it the kernel code, to step in I have to first put a break point in the kernel source code and step over(F8). May be it's ok to use g++ to compile but I guess the nvcc is required to link in emulation mode. But even if you link with g++ you should be able to stop on a break set in the c++ file.

Have you tried to debug in a terminal with the gdb or with kDbg ?

#7
Posted 01/25/2008 06:37 PM   
Hi,

I am starting to learn CUDA and I would like to continue using Netbeans as IDE. So far the steps I have to do are clear, however I have a question about the make file (which so far I have never touched, so I don't really know much about it). Do I have to change the make file? Should I copy one makefile from the CUDA examples or can I continue using the standard make file from netbeans?

tom
Hi,



I am starting to learn CUDA and I would like to continue using Netbeans as IDE. So far the steps I have to do are clear, however I have a question about the make file (which so far I have never touched, so I don't really know much about it). Do I have to change the make file? Should I copy one makefile from the CUDA examples or can I continue using the standard make file from netbeans?



tom

#8
Posted 06/10/2008 08:19 AM   
[quote name='tomasito' date='Jun 10 2008, 01:19 AM']Hi,

I am starting to learn CUDA and I would like to continue using Netbeans as IDE. So far the steps I have to do are clear, however I have a question about the make file (which so far I have never touched, so I don't really know much about it). Do I have to change the make file? Should I copy one makefile from the CUDA examples or can I continue using the standard make file from netbeans?

tom
[right][snapback]391296[/snapback][/right]
[/quote]

I have never made any complicate project that require a make file, my projects are simple, 10-20 files of C/C++. I think Netbeans generates the basic make for your project during the build.
[quote name='tomasito' date='Jun 10 2008, 01:19 AM']Hi,



I am starting to learn CUDA and I would like to continue using Netbeans as IDE. So far the steps I have to do are clear, however I have a question about the make file (which so far I have never touched, so I don't really know much about it). Do I have to change the make file? Should I copy one makefile from the CUDA examples or can I continue using the standard make file from netbeans?



tom

[snapback]391296[/snapback]






I have never made any complicate project that require a make file, my projects are simple, 10-20 files of C/C++. I think Netbeans generates the basic make for your project during the build.

#9
Posted 06/10/2008 03:28 PM   
[quote name='patrick16' date='Jun 10 2008, 04:28 PM']I have never made any complicate project that require a make file, my projects are simple, 10-20 files of C/C++. I think Netbeans generates the basic make for your project during the build.
[right][snapback]391498[/snapback][/right]
[/quote]

OK, to finish another project I had to interrupt my CUDA learning process, but now I am starting again and I have a problem getting CUDA run on Netbeans.

Following message I get if I want to compile a program:

[code]Running "/usr/bin/make  -f Makefile CONF=Debug" in /l/thofel/NetBeansProjects/Cuda_test

/usr/bin/make -f nbproject/Makefile-Debug.mk SUBPROJECTS= .build-conf
make[1]: Entering directory `/l/thofel/NetBeansProjects/Cuda_test'
mkdir -p dist/Debug/GNU-Linux-x86
nvcc -o dist/Debug/GNU-Linux-x86/cuda_test build/Debug/GNU-Linux-x86/moveArrays.o -lcudart -lcutil
/usr/bin/ld: cannot find -lcutil
collect2: ld returned 1 exit status
make[1]: *** [dist/Debug/GNU-Linux-x86/cuda_test] Error 255
make[1]: Leaving directory `/l/thofel/NetBeansProjects/Cuda_test'
make: *** [.build-impl] Error 2

Build failed. Exit value 2.[/code]

I saw in the release note that a similar problem occured with Linux Redhat 4.3 (which I use) with the "usr/bin/ld: cannot find -lglut" file, however there is nothing mentioned about the cudart library. I followed all the steps to integrate CUDA in netbeans as explained above.

I am using CUDA 1.1 on Cientific Linux 4.3 (based on Redhat Enterprise 4.3).

Anyone an idea what is going wrong here?
[quote name='patrick16' date='Jun 10 2008, 04:28 PM']I have never made any complicate project that require a make file, my projects are simple, 10-20 files of C/C++. I think Netbeans generates the basic make for your project during the build.

[snapback]391498[/snapback]






OK, to finish another project I had to interrupt my CUDA learning process, but now I am starting again and I have a problem getting CUDA run on Netbeans.



Following message I get if I want to compile a program:



Running "/usr/bin/make  -f Makefile CONF=Debug" in /l/thofel/NetBeansProjects/Cuda_test



/usr/bin/make -f nbproject/Makefile-Debug.mk SUBPROJECTS= .build-conf

make[1]: Entering directory `/l/thofel/NetBeansProjects/Cuda_test'

mkdir -p dist/Debug/GNU-Linux-x86

nvcc -o dist/Debug/GNU-Linux-x86/cuda_test build/Debug/GNU-Linux-x86/moveArrays.o -lcudart -lcutil

/usr/bin/ld: cannot find -lcutil

collect2: ld returned 1 exit status

make[1]: *** [dist/Debug/GNU-Linux-x86/cuda_test] Error 255

make[1]: Leaving directory `/l/thofel/NetBeansProjects/Cuda_test'

make: *** [.build-impl] Error 2



Build failed. Exit value 2.




I saw in the release note that a similar problem occured with Linux Redhat 4.3 (which I use) with the "usr/bin/ld: cannot find -lglut" file, however there is nothing mentioned about the cudart library. I followed all the steps to integrate CUDA in netbeans as explained above.



I am using CUDA 1.1 on Cientific Linux 4.3 (based on Redhat Enterprise 4.3).



Anyone an idea what is going wrong here?

#10
Posted 08/21/2008 02:57 PM   
I couldnt get CUDA - netbeans to work in the way described it kept giving me the error

couldnt find -lcutil

however i did manage to get netbeens to compile stuff using the template file from the sdk projects folder, you can rename the template and all of the source files, and modify the Makefile variables accordingly

you can now add that project using the "add from existing makefile" button when starting a project in net beans (you have to add the .cu extension as before)

i seem to be only able to biuld the project if i have it in the ~/NVIDIA_CUDA_SDK/projects/myproject/ folder. otherwise it throws up the same error that:
-lcutil or
cutil.h can not be found

any explination as to why it can only find the literary when in a specific path? i think it must be defined directory relative in the template makefile, or in the file /home/**********/NVIDIA_CUDA_SDK/common/common.mk
and cant be found in the PATH and LD_LIBRARY_PATH variables
i have set both of these correctly btw you have to put
# CUDA stuff
PATH=$PATH:/usr/local/cuda/bin:
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/lib:/home/richard/pool/lib:
export PATH
export LD_LIBRARY_PATH
into ~/.bashrc

also you can add the path "/usr/local/cuda/bin" to the netbeans environment
"Tools->options->C/C++"
current path

i had to do this for netbeans to see nvcc, but then i got these errors about libcutil

anyway, its good to know there is a second way
I couldnt get CUDA - netbeans to work in the way described it kept giving me the error



couldnt find -lcutil



however i did manage to get netbeens to compile stuff using the template file from the sdk projects folder, you can rename the template and all of the source files, and modify the Makefile variables accordingly



you can now add that project using the "add from existing makefile" button when starting a project in net beans (you have to add the .cu extension as before)



i seem to be only able to biuld the project if i have it in the ~/NVIDIA_CUDA_SDK/projects/myproject/ folder. otherwise it throws up the same error that:

-lcutil or

cutil.h can not be found



any explination as to why it can only find the literary when in a specific path? i think it must be defined directory relative in the template makefile, or in the file /home/**********/NVIDIA_CUDA_SDK/common/common.mk

and cant be found in the PATH and LD_LIBRARY_PATH variables

i have set both of these correctly btw you have to put

# CUDA stuff

PATH=$PATH:/usr/local/cuda/bin:

LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/lib:/home/richard/pool/lib:

export PATH

export LD_LIBRARY_PATH

into ~/.bashrc



also you can add the path "/usr/local/cuda/bin" to the netbeans environment

"Tools->options->C/C++"

current path



i had to do this for netbeans to see nvcc, but then i got these errors about libcutil



anyway, its good to know there is a second way

#11
Posted 11/06/2008 10:51 AM   
[quote name='MATRICS' post='460614' date='Nov 6 2008, 12:51 PM']i seem to be only able to biuld the project if i have it in the ~/NVIDIA_CUDA_SDK/projects/myproject/ folder. otherwise it throws up the same error that:
-lcutil or
cutil.h can not be found[/quote]

I'm guessing you're using the "template" project and modified it. The make file there contains a relative reference to your SDK folder, where the cutil header in lib are located, which is why it works in the projects folder but not any other. To solve your you have to link the [i]lib[/i] and [i]common/inc[/i] from your SDK directory to your project in Netbeans.
[quote name='MATRICS' post='460614' date='Nov 6 2008, 12:51 PM']i seem to be only able to biuld the project if i have it in the ~/NVIDIA_CUDA_SDK/projects/myproject/ folder. otherwise it throws up the same error that:

-lcutil or

cutil.h can not be found



I'm guessing you're using the "template" project and modified it. The make file there contains a relative reference to your SDK folder, where the cutil header in lib are located, which is why it works in the projects folder but not any other. To solve your you have to link the lib and common/inc from your SDK directory to your project in Netbeans.

#12
Posted 11/06/2008 11:05 AM   
dear patrick,

thanks for sharing this. i downloaded the recent version which happens to be 6.5. i dont see any menu tool-->option button advanced, etc..

This is really cool, and probably the only tutorial which might make cuda work with an ide on linux. i would be really grateful to you if you could spare some more time and be a little clearer as to what to do, step by step.. we are a bunch of students here, and it would benifit all of us.

hoping your kind help!
arjun
dear patrick,



thanks for sharing this. i downloaded the recent version which happens to be 6.5. i dont see any menu tool-->option button advanced, etc..



This is really cool, and probably the only tutorial which might make cuda work with an ide on linux. i would be really grateful to you if you could spare some more time and be a little clearer as to what to do, step by step.. we are a bunch of students here, and it would benifit all of us.



hoping your kind help!

arjun

#13
Posted 11/20/2008 01:37 PM   
Hello,

Good news, the Netbeans 6.5 is working again with the .cu files, unfortunately the 6.1 was not able to colorize the syntax of the .cu files and for this and other reasons (WxWidgets integration) I switched to codelite.org IDE, more configurable because targeted for C/C++.
But the Netbeans 6.5 seems to resolve these issues nicely.

To create a project with 6.5, follow the same steps as 6.1 except for the cu mime type and compiler options.

[b]How to colorize the source code of a .cu file:[/b]
Menu->Tools->Options
Click on the button "Miscellaneous"
Select the tab note "Files"
New...
enter "cu" int the input field
and choose the mime for C Files (text/x-c)

[b]How to add the nvcc compiler in Netbeans:[/b]
Menu->Tools->Options
Click on the button "C/C++"
Select the tab note "Other"
Click new..
Type "cu" (without quotes) int the field and click "Add"
OK

Menu->Tools->Options
Click on the button "C/C++"
Select the tab note "Build Tools"
On the "Tool Collection" list click on "Add..."
Browse the Base Directory to where you have installed nvcc (usually /usr/local/cuda/bin )
Select GCC for type of compiler
Type nvcc for Tool collection name
OK

[attachment=10148:Screenshot_Options.png]

[b]How to set the compiler in your project:[/b]
On the left hand tree, right click on your project and "Properties"
On the "Build" panel, un-check the "Enable Make Dependency Checking" otherwise this add -MDD -M to the nvcc command line and the compiler doesn't understand.
On the "C Compiler" tab choose the Toll "nvcc"

Patrick
Hello,



Good news, the Netbeans 6.5 is working again with the .cu files, unfortunately the 6.1 was not able to colorize the syntax of the .cu files and for this and other reasons (WxWidgets integration) I switched to codelite.org IDE, more configurable because targeted for C/C++.

But the Netbeans 6.5 seems to resolve these issues nicely.



To create a project with 6.5, follow the same steps as 6.1 except for the cu mime type and compiler options.



How to colorize the source code of a .cu file:

Menu->Tools->Options

Click on the button "Miscellaneous"

Select the tab note "Files"

New...

enter "cu" int the input field

and choose the mime for C Files (text/x-c)



How to add the nvcc compiler in Netbeans:

Menu->Tools->Options

Click on the button "C/C++"

Select the tab note "Other"

Click new..

Type "cu" (without quotes) int the field and click "Add"

OK



Menu->Tools->Options

Click on the button "C/C++"

Select the tab note "Build Tools"

On the "Tool Collection" list click on "Add..."

Browse the Base Directory to where you have installed nvcc (usually /usr/local/cuda/bin )

Select GCC for type of compiler

Type nvcc for Tool collection name

OK



[attachment=10148:Screenshot_Options.png]



How to set the compiler in your project:

On the left hand tree, right click on your project and "Properties"

On the "Build" panel, un-check the "Enable Make Dependency Checking" otherwise this add -MDD -M to the nvcc command line and the compiler doesn't understand.

On the "C Compiler" tab choose the Toll "nvcc"



Patrick

#14
Posted 11/21/2008 08:37 PM   
Hello,

Good news, the Netbeans 6.5 is working again with the .cu files, unfortunately the 6.1 was not able to colorize the syntax of the .cu files and for this and other reasons (WxWidgets integration) I switched to codelite.org IDE, more configurable because targeted for C/C++.
But the Netbeans 6.5 seems to resolve these issues nicely.

To create a project with 6.5, follow the same steps as 6.1 except for the cu mime type and compiler options.

[b]How to colorize the source code of a .cu file:[/b]
Menu->Tools->Options
Click on the button "Miscellaneous"
Select the tab note "Files"
New...
enter "cu" int the input field
and choose the mime for C Files (text/x-c)

[b]How to add the nvcc compiler in Netbeans:[/b]
Menu->Tools->Options
Click on the button "C/C++"
Select the tab note "Other"
Click new..
Type "cu" (without quotes) int the field and click "Add"
OK

Menu->Tools->Options
Click on the button "C/C++"
Select the tab note "Build Tools"
On the "Tool Collection" list click on "Add..."
Browse the Base Directory to where you have installed nvcc (usually /usr/local/cuda/bin )
Select GCC for type of compiler
Type nvcc for Tool collection name
OK

[attachment=7862:Screenshot_Options.png]

[b]How to set the compiler in your project:[/b]
On the left hand tree, right click on your project and "Properties"
On the "Build" panel, un-check the "Enable Make Dependency Checking" otherwise this add -MDD -M to the nvcc command line and the compiler doesn't understand.
On the "C Compiler" tab choose the Toll "nvcc"

Patrick
Hello,



Good news, the Netbeans 6.5 is working again with the .cu files, unfortunately the 6.1 was not able to colorize the syntax of the .cu files and for this and other reasons (WxWidgets integration) I switched to codelite.org IDE, more configurable because targeted for C/C++.

But the Netbeans 6.5 seems to resolve these issues nicely.



To create a project with 6.5, follow the same steps as 6.1 except for the cu mime type and compiler options.



How to colorize the source code of a .cu file:

Menu->Tools->Options

Click on the button "Miscellaneous"

Select the tab note "Files"

New...

enter "cu" int the input field

and choose the mime for C Files (text/x-c)



How to add the nvcc compiler in Netbeans:

Menu->Tools->Options

Click on the button "C/C++"

Select the tab note "Other"

Click new..

Type "cu" (without quotes) int the field and click "Add"

OK



Menu->Tools->Options

Click on the button "C/C++"

Select the tab note "Build Tools"

On the "Tool Collection" list click on "Add..."

Browse the Base Directory to where you have installed nvcc (usually /usr/local/cuda/bin )

Select GCC for type of compiler

Type nvcc for Tool collection name

OK



[attachment=7862:Screenshot_Options.png]



How to set the compiler in your project:

On the left hand tree, right click on your project and "Properties"

On the "Build" panel, un-check the "Enable Make Dependency Checking" otherwise this add -MDD -M to the nvcc command line and the compiler doesn't understand.

On the "C Compiler" tab choose the Toll "nvcc"



Patrick

#15
Posted 11/21/2008 08:38 PM   
  1 / 2    
Scroll To Top