Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have an ASUS Notebook with nVidia gt 520m and thought about trying some OpenCL programming (first time) on Ubuntu 11.10. I installed the nvidia-current-dev package. Thus, I found libOpenCL.so and such in /usr/lib/nvidia-current/ folder:

$razvan@...:~$ locate libOpenCL.so
/usr/lib/nvidia-current/libOpenCL.so
/usr/lib/nvidia-current/libOpenCL.so.1
/usr/lib/nvidia-current/libOpenCL.so.1.0
/usr/lib/nvidia-current/libOpenCL.so.1.0.0
/usr/lib32/nvidia-current/libOpenCL.so
/usr/lib32/nvidia-current/libOpenCL.so.1
/usr/lib32/nvidia-current/libOpenCL.so.1.0
/usr/lib32/nvidia-current/libOpenCL.so.1.0.0

I then installed the CUDA Toolkit for Ubuntu 10.10 from nVidia website and also the NVIDIA GPU SDK (in /opt/gpu_sdk).

When I go to /opt/gpu_sdk/OpenCL and try the make command I get:

razvan@...:/opt/gpu_sdk/OpenCL$ make
make[1]: Entering directory `/opt/gpu_sdk/OpenCL/common'
a - obj/release/oclUtils.cpp.o
make[1]: Leaving directory `/opt/gpu_sdk/OpenCL/common'
make[1]: Entering directory `/opt/gpu_sdk/shared'
make[1]: Leaving directory `/opt/gpu_sdk/shared'
make -C src/oclConvolutionSeparable/
make[1]: Entering directory `/opt/gpu_sdk/OpenCL/src/oclConvolutionSeparable'
/usr/bin/ld: cannot find -lOpenCL
collect2: ld returned 1 exit status
make[1]: *** [../../..//OpenCL//bin//linux/release/oclConvolutionSeparable] Error 1
make[1]: Leaving directory `/opt/gpu_sdk/OpenCL/src/oclConvolutionSeparable'
make: *** [src/oclConvolutionSeparable/Makefile.ph_build] Error 2

Afeter installing the nvidia-current-dev package I went to /etc/ld.so.conf.d/ and made nvidia-current.conf where I specified /usr/lib/nvidia-current and /usr/lib32/nvidia-current. Then I used ldconfig for caching the new locations.

Needless to say, it didn't work. I also appended the /usr/lib/nvidia-current and /usr/lib32/nvidia-current to the LD_LIBRARY_PATH environment variable in the hope of working... it did not work.

share|improve this question
    
I found out by myself what the problem was. I was trying to set LD_LIBRARY_PATH which is related to /usr/bin/ld specifically, while I should have set LIBRARY_PATH which is the correct environment variable for the gnu compiler (used here). I don't know the connection between LD_LIBRARY_PATH and LIBRARY_PATH (or in this case ld and gcc and why gcc doesn't use the ld executable.. I thought that gcc is using it; but maybe someone experienced enough can answer that). –  razvanc Nov 8 '11 at 16:37

2 Answers 2

Cannot set LD_LIBRARY_PATH which is related to /usr/bin/ld specifically.

Should have set LIBRARY_PATH which is the correct environment variable for the gnu compiler (used here).

Whatever the connection between LD_LIBRARY_PATH and LIBRARY_PATH (or in this case ld and gcc and why gcc doesn't use the ld executable..

share|improve this answer

Look here for a good explanation of LIBRARY_PATH and LD_LIBRARY_PATH: click here

LIBRARY_PATH is checked when compiling, LD_LIBRARY_PATH upon program execution.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.