Reputation: 89
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.
Upvotes: 3
Views: 2704
Reputation: 89
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)
Upvotes: 4