Differences between revisions 32 and 33
Revision 32 as of 2013-10-12 12:46:19
Size: 5904
Editor: 129
Comment: remove <pre> tags
Revision 33 as of 2014-02-09 23:54:19
Size: 6568
Editor: c-50-136-118-83
Comment:
Deletions are marked like this. Additions are marked like this.
Line 2: Line 2:
Line 14: Line 13:
Line 20: Line 20:
From tar file:
(((Information below may be wrong and need fixing)))
From tar file: (((Information below may be wrong and need fixing)))
Line 28: Line 27:
Line 32: Line 30:
Line 36: Line 33:
Line 39: Line 37:
If you don't see your updated NumPy install listed there, you may need to adjust your PYTHONPATH as follows:
Line 40: Line 39:
If you don't see your updated NumPy install listed there, you may need to adjust your PYTHONPATH as follows:
Line 46: Line 44:
Line 48: Line 45:
Line 57: Line 53:
Line 65: Line 60:
Line 85: Line 79:
Line 92: Line 85:
Note, if you've installed boost as described on the linked page, you'll need to either do this before using PyOpenCL:
Line 93: Line 87:
Note, if you've installed boost as described on the linked page, you'll need to either do this before using PyOpenCL:
Line 102: Line 95:
Support for OpenGL interoperation with OpenCL (sharing buffers) is available in the latest revision of the git repository:
Line 103: Line 97:
Support for OpenGL interoperation with OpenCL (sharing buffers) is available in the latest revision of the git repository:
{{{
git clone http://git.tiker.net/trees/pyopencl.git
{{{
git clone http://git.tiker.net/trees/pyopencl.git
Line 108: Line 101:
{{{ 
{{{
Line 112: Line 106:
To turn on OpenGL interop you run configure with the following option:
Line 113: Line 108:
To turn on OpenGL interop you run configure with the following option:
Line 120: Line 114:
Line 123: Line 118:
Line 125: Line 119:

May 2012 
May 2012
Line 130: Line 123:
OSX Lion,
XCode 4.3.2
OSX Lion, XCode 4.3.2
Line 133: Line 125:
My mac is an iMac 27" 2010 model with a Radeon HD 4850 GPU, and an Intel i5 processor  My mac is an iMac 27" 2010 model with a Radeon HD 4850 GPU, and an Intel i5 processor
Line 138: Line 130:
git clone http://git.tiker.net/trees/pyopencl.git  git clone http://git.tiker.net/trees/pyopencl.git
Line 147: Line 139:
If you get the following error, just run the last install command again and you're set. <pre> src/wrapper/wrap_cl.hpp:14:10: fatal error: 'OpenCL/opencl.h' file not found #include <OpenCL/opencl.h>
Line 148: Line 141:
If you get the following error, just run the last install command again and you're set.
<pre>
src/wrapper/wrap_cl.hpp:14:10: fatal error: 'OpenCL/opencl.h' file not found
#include <OpenCL/opencl.h>
        
^
1 error generated.
error: Setup script exited with error: command '/usr/bin/clang' failed with exit status 1
}}}
 . ^

1 error generated. error: Setup script exited with error: command '/usr/bin/clang' failed with exit status 1 }}}
Line 158: Line 146:

== OSX Maveriks 10.9.1 ==
Feb 2014

This is just a note to confirm that the above instructions for PyOpenCL on Lion work equally well on Maveriks:

Test System:

Computer: Mini Mac Intel Core i5 Late 2012

OS: OSX Maveriks 10.9.1

Compiling Tools: XCode 5.0.2

No discreete GPU , but using the Intel HD4000 embedded onboard of the i5 processor

I have used the following steps (as for Lion):

{{{
git clone http://git.tiker.net/trees/pyopencl.git
cd pyopencl
git submodule init
git submodule update
python configure.py
python setup.py build
make
sudo python setup.py install
}}}
One warning was generated several times during compilation, but everything looks OK

Installing PyOpenCL on Mac OS X

This tutorial will walk you through the process of building PyOpenCL. To follow, you really only need two basic things:

  • Mac OS X >= 10.6 (Snow Leopard).

  • XCode >= 3.2

In addition, PyOpenCL's installation process will automatically download py.test 1.0.2 or newer and pytools. If you are installing without web access, you need to download these packages manually and stick them in the package's root directory before installing.

Step 1: Download and unpack PyOpenCL

From git:

git clone http://git.tiker.net/trees/pyopencl.git
cd pyopencl
git submodule init
git submodule update

From tar file: (((Information below may be wrong and need fixing)))

Download PyOpenCL and unpack it:

$ tar xfz pyopencl-VERSION.tar.gz

(You need version 0.90.1 or newer.)

Step 2: Check NumPy

Mac OS X 10.6 includes an install of NumPy 1.2.1 in the following location (/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/numpy/). This NumPy install works fine with PyOpenCL 0.90.x, therefore if you're Python 2.6 provided by Apple in Mac OS X 10.6 you needn't do anything extra at this step.

If you have installed a newer version of NumPy and are using Python 2.6.1 from Apple you need to ensure that both the build and your running Python environment both are using the custom-installed NumPy. Check the version that python will import by default using the following command

$ python -c "import numpy; print numpy.version.version"

If you don't see your updated NumPy install listed there, you may need to adjust your PYTHONPATH as follows:

$ export PYTHONPATH=/Library/Python/2.6/site-packages:$PYTHONPATH

(to make this more permanent, add it to your ~/.bash_profile if using bash as your shell or your ~/.zshrc if using ZSH)

Step 3: Build PyOpenCL

Next, just type:

$ cd pyopencl-VERSION #2012.1 if you're not there already
$ python configure.py
$ make
$ sudo make install

Once that works, congratulations! You've successfully built PyOpenCL.

Make sure you restart your shell before attempting to import pyopencl.

Note that this step may automatically look for and, if necessary, install a number of Python packages from the Python package index. These packages are listed under install_requires in PyOpenCL's install control file.

Optional: Boost C++ Libraries

As of version 0.92, the Boost C++ libraries are no longer a dependency of PyOpenCL.

If you would like to use multiple packages that use Boost.Python (e.g. both PyCUDA and PyOpenCL), you can still build PyOpenCL against a separate Boost installation. If so, follow the BoostInstallationHowto. Continue here when you're done.

You may use the following configure/build snippet to specify where you installed Boost:

$ cd pyopencl-VERSION # if you're not there already
$ python configure.py \
  --boost-inc-dir=$HOME/pool/include \
  --boost-lib-dir=$HOME/pool/lib \
  --boost-python-libname=boost_python \
  --boost-thread-libname=boost_thread \
  --cl-libname='' \
  --ldflags='-Wl,-framework,OpenCL' \
  --boost-compiler='gcc42'
$ make
$ sudo make install

Note: You may find that the boost libraries installed into the $HOME/pool/lib directory are not just named boost_python.dylib and boost_thread.dylib, and may include version information for the GCC used in their filenames. If you find this is the case, you may want to replace the --boost-*-libname lines above with ones like the following:

  --boost-python-libname=boost_python-xgcc42-mt \
  --boost-thread-libname=boost_thread-xgcc42-mt \

Note, if you've installed boost as described on the linked page, you'll need to either do this before using PyOpenCL:

$ export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:$HOME/pool/lib

(you can add this to your .profile (default OS X shell), .bash_profile, .zshrc, etc..)

Or, you could vary the boost instructions to install boost for all users on the system.

Optional: OpenGL Interop

Support for OpenGL interoperation with OpenCL (sharing buffers) is available in the latest revision of the git repository:

git clone http://git.tiker.net/trees/pyopencl.git

If you don't have boost already installed, you can do the following to obtain a subset of boost to build against

git submodule init
git submodule update

To turn on OpenGL interop you run configure with the following option:

python configure.py --cl-enable-gl

Note that to use it you will need PyOpenGL

Now you should be able to run the example:

python examples/gl_interop_demo.py

OSX Lion

May 2012

This is just a note to confirm PyOpenCL is building and working correctly with:

OSX Lion, XCode 4.3.2

My mac is an iMac 27" 2010 model with a Radeon HD 4850 GPU, and an Intel i5 processor

I have used the following steps:

git clone http://git.tiker.net/trees/pyopencl.git
cd pyopencl
git submodule init
git submodule update
python configure.py
python setup.py build
make
sudo python setup.py install

If you get the following error, just run the last install command again and you're set. <pre> src/wrapper/wrap_cl.hpp:14:10: fatal error: 'OpenCL/opencl.h' file not found #include <OpenCL/opencl.h>

  • ^

1 error generated. error: Setup script exited with error: command '/usr/bin/clang' failed with exit status 1 }}}

PyOpenCL sees both the GPU and CPU and tests correctly

OSX Maveriks 10.9.1

Feb 2014

This is just a note to confirm that the above instructions for PyOpenCL on Lion work equally well on Maveriks:

Test System:

Computer: Mini Mac Intel Core i5 Late 2012

OS: OSX Maveriks 10.9.1

Compiling Tools: XCode 5.0.2

No discreete GPU , but using the Intel HD4000 embedded onboard of the i5 processor

I have used the following steps (as for Lion):

git clone http://git.tiker.net/trees/pyopencl.git
cd pyopencl
git submodule init
git submodule update
python configure.py
python setup.py build
make
sudo python setup.py install

One warning was generated several times during compilation, but everything looks OK

PyOpenCL/Installation/Mac (last edited 2014-02-09 23:54:19 by c-50-136-118-83)