mYm is a toolbox for Matlab that allows MySQL connections and calls to be made from within the application. I’ve stored a local copy of the mYm Source v1.0.9, but the author, Yannick Maret, maintains a site with the latest version.
The code will successfully compile on both Windows and Linux using the latest version of Matlab, 2006a at the time of this writing. The following command will compile it on Linux provided you have the necessary MySQL development packages installed:
mex -I/usr/include/mysql -L/usr/lib/mysql -L/usr/lib -lz -lmysqlclient mym.cpp
However, the toolbox will fail with the following error:
>> mym(’open’,'localhost’,'username’,'password’);
??? Invalid MEX-file ‘mym.mexglx’: mym.mexglx: undefined symbol: compressBound.
This error appears related to the zlib/zlib-devel 1.2.1 package that ships with RHEL 4.3, but can be reproduced with the more recent 1.2.3 zlib installed from scratch.
Fortunately, Yannick reports that a hack to the source prior to compile will work around the zlib issue:
“That’s indeed a very strange error, and that’s the first time I’ve heard of it. I use zlib 1.2.3, and if I look at the zlib header, the function ‘compressBound’ is declared at line 1040:
ZEXTERN uLong ZEXPORT compressBound OF((uLong sourceLen));
So, this function should be part of a working zlib distribution… If you cannot solve the error, maybe you can replace the line
const uLongf max_len = compressBound(plen[i]);
in mym.cpp by something like that
const uLongf max_len =2*(plen[i]+10);
It’s very dirty, but it should work just fine!”
And indeed it does…