1
votes

when I unchecked Enable Make Dependency Checking in NetBeans IDE (see this issue) now IDE uses nvcc and compiles my .cu to .o but it doesn't do linking at all:

"/usr/bin/make" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-conf make1: Entering directory /me/NetBeansProjects/my_CUDA_1' "/usr/bin/make" -f nbproject/Makefile-Debug.mk dist/Debug/GNU-Linux-x86/libmy_cuda_1.a make[2]: Entering directory/me/NetBeansProjects/my_CUDA_1' mkdir -p build/Debug/GNU-Linux-x86 /usr/local/cuda-5.0/bin/nvcc -c -g -I/usr/local/cuda-5.0/include -I/usr/local/cuda-5.0/samples/common/inc -o build/Debug/GNU-Linux-x86/cudaMain.o cudaMain.cu mkdir -p dist/Debug/GNU-Linux-x86 rm -f dist/Debug/GNU-Linux-x86/libmy_cuda_1.a ar -rv dist/Debug/GNU-Linux-x86/libmy_cuda_1.a build/Debug/GNU-Linux-x86/cudaMain.o ar: creating dist/Debug/GNU-Linux-x86/libmy_cuda_1.a a - build/Debug/GNU-Linux-x86/cudaMain.o ranlib dist/Debug/GNU-Linux-x86/libmy_cuda_1.a make[2]: Leaving directory /me/NetBeansProjects/my_CUDA_1' make[1]: Leaving directory /me/NetBeansProjects/my_CUDA_1'

BUILD SUCCESSFUL (total time: 2s)

I can link from terminal:

comp@comp:# ls
cudaMain.o

comp@comp:# g++ -m64 -o cudaMain cudaMain.o -L/usr/local/cuda-5.0/lib64 -lcudart comp@comp:#./cudaMain comp@comp:/me/NetBeansProjects/my_CUDA_1/build/Debug/GNU-Linux-x86#

I think this is something related to the fact that it doesn't check make dependency (?) what to check/uncheck/delete/add/change in IDE to enable linking? I don't know why but there is no options related to linking in Projects->Properties.

EDIT:

at this moment I resolved ALL issues to install (with Soroosh help, thanks again) CUDA-5.0 on Ubuntu 12.10 (and use "NVIDIA binary Xorg driver, kernel module and VDPAU library from nvidia-current" driver - only this gives me extra graphics/resolution) and compile with Netbeans ALL samples projects and to compile and run my own. if anyone has any problems, please ask

enter image description here

1
since I know you from askubuntu, hello first! I just wanted to ask why don't you use nsight eclipse edition? you can just open a terminal and type nsight or /usr/local/cuda/bin/nsightSoroosh Bateni
at last you used neauveau driver? how? does it support CUDA now?Soroosh Bateni
no, sorry. hi Soroosh! I didn't know about this, thank you, though at this moment I resolved ALL issues to install (with your help, thanks again) CUDA-5.0 on Ubuntu 12.10 (and use "NVIDIA binary Xorg driver, kernel module and VDPAU library from nvidia-current" driver - only this gives me extra graphics/resolution) and compile with Netbeans ALL samples projects and to compile and run my own. if anyone has any problems, please ask4pie0
aha,again you are very welcome ;), hope they fix that soon and very impressive work with netbeans as it is not the standard IDE for CUDA, you've done a great job fixing it. More option is always better. good luck ;)Soroosh Bateni
I prefer NetBeans, simply I just don't want to have other IDE for every framework/library, I like NetBeans and I want work within it, including all libraries and frameworks, at the moment I can do Qt project and NVIDIA + QuantLib, boost: all in one IDE4pie0

1 Answers

1
votes

I changed before Configuration Type to Static Library and it was mistake: should be Application, then linking is possible. and I have to change Run command in Ide from debug location to:

dist/Debug/GNU-Linux-x86/my_cuda_1

and use GNU Tool Collections. now it is ok. it build .o and then links with libcudart.so to create executable:

"/usr/bin/make" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .clean-conf
make[1]: Entering directory `/me/NetBeansProjects/my_CUDA_1'
rm -f -r build/Debug
rm -f dist/Debug/GNU-Linux-x86/my_cuda_1
make[1]: Leaving directory `/me/NetBeansProjects/my_CUDA_1'


CLEAN SUCCESSFUL (total time: 113ms)

"/usr/bin/make" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-conf
make[1]: Entering directory `/me/NetBeansProjects/my_CUDA_1'
"/usr/bin/make"  -f nbproject/Makefile-Debug.mk dist/Debug/GNU-Linux-x86/my_cuda_1
make[2]: Entering directory `/me/NetBeansProjects/my_CUDA_1'
mkdir -p build/Debug/GNU-Linux-x86
/usr/local/cuda-5.0/bin/nvcc    -c -g -I/usr/local/cuda-5.0/include -I/usr/local/cuda-5.0/samples/common/inc -o build/Debug/GNU-Linux-x86/cudaMain.o cudaMain.cu
mkdir -p dist/Debug/GNU-Linux-x86
/usr/local/cuda-5.0/bin/nvcc     -o dist/Debug/GNU-Linux-x86/my_cuda_1 build/Debug/GNU-Linux-x86/cudaMain.o -lcudart 
make[2]: Leaving directory `/me/NetBeansProjects/my_CUDA_1'
make[1]: Leaving directory `/me/NetBeansProjects/my_CUDA_1'


BUILD SUCCESSFUL (total time: 2s)

CUDA Clock sample GPU Device 0: "GeForce GT 630" with compute capability 2.1

Total clocks = 52926

RUN SUCCESSFUL (total time: 151ms)