/usr/bin/ld: cannot find -lOpenCL // Fedora 13

Hi!

I’m using Fedora 13 x86_64 (on dell Vostro 1320 with GeForce 9300M GS) and I did the following things:

-installed cuda toolkit 3.2 and newest atistream

-changed variables in .bashrc to:

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

export PATH

LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/lib64 //cuda path

LD_LIBRARY_PATH=$LD_LIBRARY_PATH:~/ati-stream/lib/x86_64 //opencl_amd path

export LD_LIBRARY_PATH

export ATISTREAMSDKROOT="~/ati-stream"

export ATISTREAMSDKSAMPLESROOT="~/ati-stream/samples"

-downloaded OpenCL SDK, and linked */common/inc/CL to /usr/include/CL, I did not compile it because I don’t need to.

-put an icd for nvidia and 2 for ati into /etc/OpenCL/vendors/

and still after executing:

$ gcc t1.c -lOpenCL

I get:

/usr/bin/ld: cannot find -lOpenCL

collect2: ld returned 1 exit status

Did I miss something?

Source files are ok, because I can run and compile them at my university.

I have driver ver 260.19.12 downloaded from rpmfusion, not from nvidia, but it has OpenCL.so and CUDA works flawlessly.

Cheers,

Mike

Well, i made a Makefile with following lines

OPENCLINCLUDE=-I$(NVIDIASDKROOT)/shared/inc -I$(NVIDIASDKROOT)/OpenCL/common/inc

OPENCLLIBS=-L$(NVIDIASDKROOT)/OpenCL/common/lib -L$(NVIDIASDKROOT)/shared/lib -loclUtil -lOpenCL  -lshrutil

I’m testing on Ubuntu, but I reckon it’s more or less same as Fedora. So I think your lib paths are wrong.

Specify library path to search for compiling. On my machine (fedora 14 x86_74) it put libraries under ‘nvidia’ subfolder

I think /usr/lib64/nvidia

so -L/usr/lib64/nvidia

search for libOpenCL.so in /usr/lib64

Thank you for your replies.
I tried to link AMD libraries and libOpenCL.so and it worked so it must have been Fedora’s driver fault.
I installed official nvidia one and everything works fine.
Thanks!