PDA

View Full Version : How to compile OpenCL example in GCC?



nalox
05-20-2009, 09:12 AM
Some one know how to compile OpenCL example with gcc or VC?

thanks,
nalox :oops:

memmaker650
09-22-2009, 10:47 AM
I have the same question as you.
I want to add an OpenCl part in my C++ code but i don't know how to compile it.
I use makefiles to compile my projects and have Snow Leopard installed.

Thanks

awoodland
09-23-2009, 08:41 AM
I don't actually have snow leopard here, so I'm guessing, but

'-framework OpenCL'

Would be the normal mac way of doing this...

dbs2
09-23-2009, 09:37 AM
Using OpenCL isn't any different than any other library. Tell your compiler how to link against the library (on the Mac you use the -framework option) and include the appropriate header files.

memmaker650
09-23-2009, 09:41 AM
Ok, thanks, I'll try it.

aplyer
09-23-2009, 11:38 AM
Precisely, the kernel compilation in OpenCL is make in running time (library call).

In Gcc, for compilation, you only need the headers (aviables on Kronos site). But for linkage, you have to install OpenCL compatible driver.

in the Makefile :
for Mac OSX : -framework OpenCL
for Linux : -lOpenCL

memmaker650
09-23-2009, 02:54 PM
Precisely, the kernel compilation in OpenCL is make in running time (library call).

In Gcc, for compilation, you only need the headers (aviables on Kronos site). But for linkage, you have to install OpenCL compatible driver.

in the Makefile :
for Mac OSX : -framework OpenCL
for Linux : -lOpenCL

Sorry, OpenCL run on Linux too ??? I think they only run in MAC and afterwards in Windows 7 and maybe in nexts version of linux kernel.

dbs2
09-23-2009, 11:20 PM
The supported platforms depend on the vendor. I believe that AMD has CPU support for linux and Nvidia has GPU support for linux. The only CPU/GPU support I know of today is on the Mac, but the platform layer should (at some point, at least) allow you to use two vendor's implementations together.

awoodland
09-24-2009, 06:10 AM
<shamless plug>I'm also working on a proof of concept implementation that runs on any (POSIX) Cluster using OpenMPI</shamless plug>
http://sf.net/projects/clumpi/