MATLAB OpenCL Toolbox on Mac Lion

Steps:

1. download toolbox source from this link and unzip it.
2. edit make.m

opencl_include_dir = '/System/Library/Frameworks/OpenCL.framework/Headers';
mex('src/openclcmd.cpp', '-Iinclude', ['-I' opencl_include_dir]);

3. edit your ~/.matlab/R20XXa/mexopts.sh. Check lines after “maci64” line and modify CLIBS and CXXLIBS so they become:

CLIBS="$MLIBS -framework OpenCL"
CXXLIBS="$MLIBS -lstdc++ -framework OpenCL"

4. open MATLAB and go to the opencl-toolbox directory
5. run make

>> make

6. add this directory as MATLAB path

>> addpath /replace/with/the/directory/path/

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s