Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Compiling OpenCL on Ubuntu

Tags:

opencl

ati

My programming experience is about 1 year of C/C++ experience from high school, but I did my research and wrote a simple program with OpenCL a few months ago. I was able to compile and run this on an Apple computer relatively easily with g++ and the --framework option. Now I'm on my Ubuntu machine and I have no idea how to compile it. The correct drivers have been downloaded along with ATI's Stream SDK (I have an ATI Radeon HD5870). Any help would be appreciated!

like image 285
user492268 Avatar asked Oct 30 '10 16:10

user492268


People also ask

How do I know if OpenCL is installed Linux?

Executing the command clocl --version will display the version of the OpenCL compiler installed. Executing the command ls -l /usr/lib/libOpenCL* will display the OpenCL libraries installed on the device.


1 Answers

Try

locate libOpenCL.so

If it is in one of the standard directories (most likely /usr/lib, or /usr/local/lib) you need to replace "--framework OpenCL" with "-lOpenCL". If g++ cannot find the lib you can tell g++ to look in a specific directory by adding "-L/path/to/library".

I wish I had my Linux to be more helpful... It is probably best if you redownload the ati-stream-sdk, after extracting it, open the Terminal and "cd /path/to/extracted/files"; in that directory execute make && sudo make install

  • make you probably know this from windows, this compiles, whatever needs to be compiled
  • && chains commands together, the following commands will only be executed if the first command succeeded
  • sudo make install this will put the files in the expected places (sudo executes a command with superuser priviledges, you will have to enter your password)

Hope that helps.

like image 123
bjoernz Avatar answered Oct 15 '22 16:10

bjoernz