3
votes

I am trying to run R from Matlab using the system command. When I enter the command system('R'), I get the following error:

/usr/lib64/R/bin/exec/R: /usr/local/MATLAB/R2014a/sys/os/glnxa64/libstdc++.so.6: version `CXXABI_1.3.8' not found (required by /lib64/libicuuc.so.52) /usr/lib64/R/bin/exec/R: /usr/local/MATLAB/R2014a/sys/os/glnxa64/libstdc++.so.6: version `CXXABI_1.3.8' not found (required by /lib64/libicui18n.so.52)

R works when I use it outside of the Matlab. I am using Linux.

1
Could you add the relevant MATLAB code? - Yellows
I just tried running system('R') on OS X 10.10.2 and R2014b and it worked fine. You should probably also edit your question to include further details about your OS, Matlab version (R2014a, I assume), and R version. I wonder if this might be off-topic for here and better suited for SuperUser? Also, does this help? - horchler
I found the answer that I needed stackoverflow.com/questions/9959306/…. Matlab was using it own version of libstdc++.so.6 so I had to load the system version instead of the Matlab version - Bob

1 Answers

4
votes

The answer can be found at How to tell mex to link with the libstdc++.so.6 in /usr/lib instead of the one in the MATLAB directory?

Essentially, Matlab uses it's own version of libstdc++.so.6 when it runs commands from system, so you have to make sure the system uses the libstdc++.so.6 in the default location on the computer.

% Save library paths
MatlabPath = getenv('LD_LIBRARY_PATH');
% Make Matlab use system libraries
setenv('LD_LIBRARY_PATH',getenv('PATH'))
system( 'R' )
% Reassign old library paths
setenv('LD_LIBRARY_PATH',MatlabPath)