Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

netbeans cannot open shared library during RUN comm

Tags:

netbeans

everything worked fine but I've just tried to run my CUDA programs on Linux Ubuntu 12.10 in NetBeans and I get error:

dist/Debug/GNU-Linux-x86/my_cuda_1: error while loading shared libraries: libcudart.so.5.0: cannot open shared object file: No such file or directory

RUN FAILED (exit value 127, total time: 191ms)

the projects can build: compile + link without problems, I can also run it from commandline but if I try run it from NetBeans I get this error. I was able to run it few minutes ago, what might happened?

I have added file my_lib to ld.so.conf.d containing such text:

/usr/local/cuda-5.0/lib64:/lib
/usr/lib
/usr/lib64

can it be a link issue libcudart.so.5.0 -> licudart.so? there are two libs in cuda/lib libcudart.so.5.0 (link) and libcudart.so (link) and libcudart.so.5.0.35 (shared lib) why it complains about .so.5.0? mayve link like: sudo ln -s /usr/lib/x86_64-linux-gnu/libglut.so.3 /usr/lib/libglut.so is necessary

it is related to link to shared library I think

root@comp:# echo $LD_LIBRARY_PATH /usr/lib/nvidia-current:/usr/local/cuda-5.0/lib::/usr/local/cuda-5.0/lib64:/lib

isn't this :: a problem? seems that No because I changed this and still same error. I specify PATHS, I run ldconfig, I put exports in the .bashrc, still nothing. the reason is that I cannot load these libraries if program is started from NetBeans GUI, however I start NetBeans as root always

like image 913
4pie0 Avatar asked Jan 13 '23 23:01

4pie0


1 Answers

add to the Project -> Properties -> Run -> Environment

Name: LD_LIBRARY_PATH

Value: $LD_LIBRARY_PATH:/usr/lib/nvidia-current:/usr/local/cuda-5.0/lib:/usr/local/cuda-5.0/lib64:/lib

Thank you all. I don't know what happened before as it worked just fine.

like image 100
4pie0 Avatar answered Jan 17 '23 22:01

4pie0