Call to R error [...unable to load shared object '/usr/lib6​4/R/librar​y/dplyr/li​bs/dplyr.s​o':...] with system(command)

7 次查看(过去 30 天)
I'm trying to call an 'R' routine from MatLab and keep getting an error:
Error: package or namespace load failed for ‘plotly’ in dyn.load(file, DLLpath = DLLpath, ...):
unable to load shared object '/usr/lib64/R/library/dplyr/libs/dplyr.so':
/usr/local/MATLAB/R2014a/sys/os/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.18' not found (required by /usr/lib64/R/library/dplyr/libs/dplyr.so)
Execution halted
I've tried it on later Matlab versions also.
Here is the reduced code:
w= pwd;
command= strcat('Rscript',{' '}, '"/media/scratch/JWRdevWork/aScriptCode4SS/Bort2_3_jwr/DC_Bort_2_hld/lm_Interaction_drug_all_V5_do_not_print_avg_Z_bortezomib_HLD.R"',{' '},'"!!ResultsStd_DC19_0717_BTZKI_2.txt "',{' '},'"lm_ZScoreResults"')
command= char(command)
cd('/usr/bin')
system(command)
cd(w)
Originally this had a gui using MatLab uigetfile etc. to provide the Input and Output arguments in the R command.
Ultimately I am trying to run code written by different people, which utilized 'R', 'Python and Java as well as a mess of spreadsheet .csv files, so as to make a good user friendly gui process under Matlab.
I can provide the Input file '!!ResultsStd_DC19_0717_BTZKI_2.txt'.
Hopefully there is a simple answer so I can get on with the converting this mess of hacked command line routines into something a non-computer literate human being can run.
The reason for R2014a is some existing Matlab graphics work came from before the graphics change and work more consistently with it although will work on newer versions.
I like the Matlab and am I long time user.
Thanks,
John Rodgers

回答(1 个)

Walter Roberson
Walter Roberson 2020-6-26
I think you will probably need to have the command set LD_LIBRARY_PATH . R is looking for GLIBCXX_3.4.18 but not finding it because it is finding the libstdc++.so.6 from /usr/local/MATLAB/R2014a/sys/os/glnxa64 because that the existing LD_LIBRARY_PATH would have been set to MATLAB's version.
If your R code calls back into MATLAB then You Might Have A Problem

类别

Help CenterFile Exchange 中查找有关 Startup and Shutdown 的更多信息

产品


版本

R2014a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by