You are here: Start Linux and Computers Compile OSC for MATLAB
Compile OSC for MATLAB PDF Print E-mail
Written by Andreas Böhler   
Tuesday, 10 March 2009 14:26
For one of our projects we needed an OSC implementation in MATLAB. Fortunately, there is a free version available from Andy Schmeder. However, it is only pre-compiled available for MacOS X and Windows, but not for Linux. This guide shows how you can compile mexosc on Ubuntu Linux.


  • Download the source frome here:
  • Unzip the source to any folder
  • Install liblo0-dev
sudo apt-get install liblo0-dev
  • Install GCC 4.1
sudo apt-get install gcc-4.1
  • Create a symbolic link to the Standard C++ library
sudo ln -s /usr/lib/ /usr/lib/
  • Edit /usr/include/lo/lo_endian.h and comment out lines 89 to 99 (just before the #endif)
  • Start MATLAB and navigate to the folder where you extracted the source code
  • Type
mex -setup
  • and select "2" for the GCC compiler
  • Edit ~/.matlab/R2008b/ and change line 57 to the following:
CFLAGS='-ansi -std=c99 -D_GNU_SOURCE'
  • Patch the whole OSC tree to remove all comments using osc_gcc.patch (see attachment) not needed anymore if you add -std=c99 to CFLAGS (see above)
  • Type
  • to compile OSC for MATLAB
Download this file (osc_gcc.patch)osc_gcc.patch[Patch for OSC to allow compilation using GCC under Linux]5 Kb
Comments (0)
Write comment
Your Contact Details:
[b] [i] [u] [url] [quote] [code] [img]   
Please input the anti-spam code that you can read in the image.
Last Updated on Friday, 24 April 2009 10:42
Template is Powered by © 2008 | CSS 2.1 | XHTML 1.0