You are not logged in.

#1 2012-04-27 07:05:22

jikubtyuo
Member
Registered: 2012-04-27
Posts: 2

matlab and shared C++ library with no root permission

Hi everyone,

I am installing a package that requires me to run mex on some cpp files. I do set LD_LIBRARY_PATH to /usr/lib and the cpp program compiles ok using mex and when i run
system('ldd mexProgram.mexglx') in matlab it shows me
libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0xb7657000)

But when i attempt to run the program (calling it from a matlab script), it throws the following error:
??? Invalid MEX-file
'mexProgram.mexglx': /home/mathworks_2011a/bin/glnx86/../../sys/os/glnx86/libstdc++.so.6: version `GLIBCXX_3.4.11' not
found (required by mexProgram.mexglx)

I think my problem is very related to https://bbs.archlinux.org/viewtopic.php?id=86809
except that I do not have root permissions to change the contents in $MATLABROOT/sys/os/glnx86

Could any one point me in a direction to get this working?

Thank you very much!

Offline

#2 2012-04-27 23:06:33

jikubtyuo
Member
Registered: 2012-04-27
Posts: 2

Re: matlab and shared C++ library with no root permission

Found the solution here : http://www.mathworks.de/matlabcentral/n … ead/162466

basically run the following (assuming you have csh or use export for bash)
setenv LD_PRELOAD '/usr/lib/libstdc++.so.6.0.16'
matlab

Offline

Board footer

Powered by FluxBB