PyOpenCL in Ubuntu repositories [Edit]

Ubuntu Maverick Meerkat (10.10) contains PyOpenCL packages for architectures amd64 and i386 in multiverse. Package is called python-pyopencl and depends on NVIDIA drivers.

For Ubuntu Lucid Lynx (10.04 LTS) there is PPA with backported python-pyopencl packages: https://launchpad.net/~fajran/+archive/opencl

To be able to install PyOpenCL in Lucid Lynx you can:

Add ppa:fajran/opencl to the Software Sources

or add following lines to the software sources list:

deb http://ppa.launchpad.net/fajran/opencl/ubuntu lucid main 
deb-src http://ppa.launchpad.net/fajran/opencl/ubuntu lucid main 

Installing PyOpenCL on Ubuntu [Edit]

These instructions were written for Ubuntu 9.10. Older versions work just like this, except for a changed boost version number. You may also look at the generic instructions if you'd like to install manually.

Step 1: Install Boost and numpy [Edit]

Use synaptic or apt-get to install python-numpy libboost1.38-dev or libboost1.40-all-dev

Step 2: Download and unpack PyOpenCL [Edit]

Download PyOpenCL and unpack it:

$ tar xfz pyopencl-VERSION.tar.gz

Step 3: Build PyOpenCL [Edit]

This example is for the ATI Stream (64bit) beta4-implementation. (If you want to compile in 32bit, change the cl-lib-dir from x86_64 to x86. {SHould you also change -lnx64 to lnx32 in ati-stream-sdk-v2.0-beta4-lnx64?})

$ cd pyopencl-VERSION # if you're not there already
$ python configure.py \
  --boost-inc-dir=/usr/include/boost \
  --boost-lib-dir=/usr/lib \
  --boost-python-libname=boost_python-mt-py26 \
  --boost-thread-libname=boost_thread-mt \
  --cl-inc-dir=/etc/ati-stream-sdk-v2.0-beta4-lnx64/include \
  --cl-lib-dir=/etc/ati-stream-sdk-v2.0-beta4-lnx64/lib/x86_64 \
  --cl-libname=OpenCL

Now type:

$ make
$ sudo make install

Now you should be done with compiling and installing.

PyOpenCL/Installation/Linux/Ubuntu (last edited 2012-01-15 10:54:56 by 109)