First of all, I'm testing all of this on Lucid 64bit, but I suppose it'd work also on newer Ubuntu releases (though you need to be using 64bit version, cause the Intel package is for 64).
So let's get to it.
- First of all grab the rpm package from http://software.intel.com/en-us/articles/download-intel-opencl-sdk/.
- Install the rpm and alien packages (`sudo apt-get install rpm alien`).
- Convert the rpm package to deb using alien - `fakeroot alien --to-deb <intel's rpm package filename>`. The conversion spits some warnings, I wouldn't pay any attention to them.
- Install the newly created deb package. `sudo dpkg -i intel-ocl-sdk-suse+11.1_1.1-2_amd64.deb`
- One extra package you need to install for the library to work is libnuma. `sudo apt-get install libnuma1`
- Make sure the ICD is installed. `sudo echo "libintelocl.so" > /etc/OpenCL/vendors/intelocl64.icd`
- The package is nice and also installs OpenCL headers in /usr/include/CL. Also the main binary (libOpenCL.so) is installed in /usr/lib64 - if you don't have any other OpenCL platform installed on your system, I suggest moving it to /usr/lib (run `sudo ldconfig` afterwards), if you do have this library already (for example nvidia driver also contains it) just leave it there.
- Since the libraries are installed in non-standard location for Ubuntu (/usr/lib64/OpenCL/vendors/intel), you'll need to adjust your LD_LIBRARY_PATH. I usually do this using a script, but you can just run:
Running a OpenCL program that just lists available platforms should return now at least one platform. Or if you have multiple platforms including their ICDs installed you'd get something like:
There are 3 platforms available PLATFORM_NAME: Intel(R) OpenCL VERSION: OpenCL 1.1 LINUX VENDOR: Intel(R) Corporation PROFILE: FULL_PROFILE DEVICE: Intel(R) Core(TM)2 Duo CPU P7370 @ 2.00GHz MAX COMPUTE UNITS: 2 DEVICE VERSION: OpenCL 1.1 DRIVER VERSION: 1.1 PLATFORM_NAME: ATI Stream VERSION: OpenCL 1.1 ATI-Stream-v2.3 (451) VENDOR: Advanced Micro Devices, Inc. PROFILE: FULL_PROFILE DEVICE: Intel(R) Core(TM)2 Duo CPU P7370 @ 2.00GHz MAX COMPUTE UNITS: 2 DEVICE VERSION: OpenCL 1.1 ATI-Stream-v2.3 (451) DRIVER VERSION: 2.0 PLATFORM_NAME: NVIDIA CUDA VERSION: OpenCL 1.0 CUDA 3.2.1 VENDOR: NVIDIA Corporation PROFILE: FULL_PROFILE DEVICE: GeForce 9300M GS MAX COMPUTE UNITS: 1 DEVICE VERSION: OpenCL 1.0 CUDA DRIVER VERSION: 260.19.29
Good luck implementing your OpenCL kernels. :)