MATLAB OpenCL Toolbox on Mac Lion

Steps:

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

[sourcecode language=”bash”]
opencl_include_dir = ‘/System/Library/Frameworks/OpenCL.framework/Headers’;
mex(‘src/openclcmd.cpp’, ‘-Iinclude’, [‘-I’ opencl_include_dir]);
[/sourcecode]

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

[sourcecode language=”bash”]
CLIBS="$MLIBS -framework OpenCL"
CXXLIBS="$MLIBS -lstdc++ -framework OpenCL"
[/sourcecode]

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/

Leave a Reply

Your email address will not be published. Required fields are marked *