10/07/2009

Matlab Symbolic Toolbox on Linux - GLIBC_2.0 issue fixed also on kernel 2.6.17

Original Post

Hi folks!
First of all I have to thank slackwarelife and Anonymus (I hope he will post me his nick!) to have posted on their comments two sources for the solution of MATLAB's Symbolic Toolbox issue with the not found GLIBC_2.0!

If you are on this page you are probably trying to fix this:

Unable to load mex file: /usr/local/matlab7/toolbox/symbolic/maplemex.mexglx.
/usr/local/matlab7/bin/glnx86/libmaple.so: symbol errno, version GLIBC_2.0 not defined in file libc.so.6 with link time reference
??? Invalid MEX-file '/usr/local/matlab7/toolbox/symbolic/maplemex.mexglx': .

Error in ==> maple at 104
[result,status] = maplemex(statement);

Error in ==> sym.maple at 85
[result,status] = maple(statement);

Error in ==> sym.plus at 22
X = maple(A(:),'+',B(:));
We got a solution with a strange method: setting the global variable LD_ASSUME_KERNEL to 2.4.1 avoiding libmaple's call to GLIBC_2.0 that caused the crash.

On kernel 2.6.17 (for the Ubuntu-users as I am it means from Dapper to Edgy) this trick doesn't work anymore because with the new kernel setting that variable to 2.4.1 cause the system not to find the base libraries like libc6.so that is needed for command calls like "matlab" to start the program!
So MATLAB doesn't start!!!

Instead to reinstall Dapper or search about kernel patch I decided to wait and to try other things because in this period I don't needed Symbolic Toolbox.

Yesterday that two bloggers brought to me the solution!

I fixed the issue in this way:

download THIS FILE with the patched libmaple.so directly from the MathWorks site

Unpack the zip, I guess you unpacked it on your desktop if not change some path in the next rows.

From the terminal go to your MATLAB installation directory for me:

~$ cd /usr/local/matlab7
go to bin/glnx86

[install_folder]$ cd bin/glnx86
make a backup copy of libmaple:

$ sudo mv libmaple.so libmaple.so.old
copy the patchd libmaple.so in the same folder:

$ sudo cp /home/[user]/Desktop/libmaple.so ./
change file's owner and group

$chown root:root libmaple.so
make the file executable by the owner, by the group any by any users:

$chmod ugo+x libmaple.so
Little explanation of chmod... I typed "ugo" because it was funny ;-) to be more strict we have had to use "ogu":
"o" means owner
"g" means group
"u" means users
"+x" means add the execution permission to the file (type "-x" to remove it)

so we added exec permission to that file either for the owner "o" either for the users in the group "g", either for the generic user "u"!
The typical order of permission is owner-group-users so "ogu" is more correct... but "ugo" is funnier!!! ;-)

To view the permission of files use ls -l instead of the optionsless ls.

Now all is fixed, this is the ultimate solution to the issue because the new library doesn't link anymore to GLIBC_2.0

没有评论:

发表评论