cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

jeanluca
Journeyman III

compile/run c code

Hi All

On my fedora 12 system I've installed

ati-stream-sdk-v2.0-lnx32.tgz

I can run the samples from ati-stream-sdk.

Here is the problem, I want to program in C, but I cannot get it to work. For example, I'm used to program OpenCL stuff on my Mac. All I needed to do  was to include

#include <OpenCL/opencl.h>

and compile

$> gcc -framework OpenCL helloworld.c

 

However, this code doesn't compile at all on my Linux system. Also I cannot find much about C, most is C++, right ?

Anu suggestion how to get my C code to work? Maybe someone has a working hello_world.c

 

thnx

Luca

0 Likes
4 Replies
nou
Exemplar

you must specify path to headers and lib so gcc can find it.

gcc helloopencl.c -l'/path/to/ATI-stream/lib/x86/libOpenCL.so' -I'/path/to/ATI-stream/include'

0 Likes

thnx for your reply!

If I split -l'/path/to/ATI-stream/lib/x86/libOpenCL.so' into -l'/path/to/ATI-stream/lib/x86/' -LOpenCL and change

#include <OpenCL/opencl.h>

into

#include <CL/cl.h>

I can compile it!

It makes you wonder why those things aren't the same on mac/NVIDIA

0 Likes

well -framework is mac specific. on linux you must specify which lib you want link. gcc have in linux default search path. /usr/include and /usr/lib where he search for headers and lib.

0 Likes

sorry, I ment changing

#include <OpenCL/opencl.h>

into

#include <CL/cl.h>

0 Likes