Tuesday, September 15, 2015

Pickled Object Problem

When unpickling an object of some class, if you encounter the error,
AttributeError: 'module' object has no attribute 'classname'
read this.

Insert Code in the 'right format' in Blogger Posts

To insert code into blogger posts, use one of the following :
  1. htmlify
  2. markup
  3. hilite.me

Saturday, February 7, 2015

Building MEX files in MATLAB 2014B on Ubuntu 14.04

Ubuntu 14.04 by default has the compiler GCC 4.8, but Matlab R2014b .mex files require GCC 4.7.x

Error: You are using gcc version '4.8.2'. The version of gcc is not supported.
Solution:

Install GCC 4.7 and G++ 4.7

sudo apt-get install gcc-4.7 g++-4.7

Copy the mex-options file 
cp /usr/local/MATLAB/R2014b/bin/mexopts.sh ~/.matlab/R2014b/mexopts.sh

Provide read permissions
chmod 644 ~/.matlab/R2013b/mexopts.sh

Make edits
vim ~/.matlab/R2013b/mexopts.sh

Change :
CC=’gcc’ to CC=’gcc-4.7′
CCX=’g++’ to CCX=’g++-4.7′