saied Vanguard saied Vanguard - 4 months ago 208
Linux Question

matlab on linux can't plot anything(can't load libstdc++.so.6: version `CXXABI_1.3.8' not found)

I'm running matlab R2016a on Fedora 24 and I can't use the plot command.

This is the error I get:


Error using gca


While setting the 'Parent' property of 'Axes':


Can't load
'/usr/local/MATLAB/R2016a/bin/glnxa64/libmwosgserver.so':
/usr/local/MATLAB/R2016a/bin/glnxa64/../../sys/os/glnxa64/libstdc++.so.6:
version 'CXXABI_1.3.8' not found (required by /lib64/libGLU.so.1)


Error in newplot (line 73)


ax = gca(fig);



Also I have seen
How to fix: [program name] /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version CXXABI_1.3.8' not found (required by [program name])
and it doesn't help.

Answer

What I did was I edited a file called .matlab7rc.sh (located in "path_to_ matlab/bin" folder and its hidden) and uncommented all lines that were(there are several of them):

LDPATH_PREFIX='$MATLAB/sys/opengl/lib/$ARCH'

The following is stated in the file for uncommenting this line(s)

To always use the OpenGL libraries shipped with MATLAB uncomment the next line.

Although it certainly did the trick I'm curious whether using OpenGL that was shipped with MATLAB degrades the performance and in general how does this approach compares to @joe_st_amand's answer.