致命错误:安装R软件包时没有这样的文件或目录

时间:2018-03-05 06:03:08

标签: r g++ install.packages

在AWS中安装R软件包时出现此错误

* installing *source* package ‘kernlab’ ...
** package ‘kernlab’ successfully unpacked and MD5 sums checked
** libs
    g++ -m64 -I/usr/include/R -DNDEBUG  -I/usr/include    -fpic  -O2 -g -pipe -
    Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-
    buffer-size=4 -m64 -mtune=generic  -c brweight.cpp -o brweight.o
    In file included from brweight.h:42:0,
                 from brweight.cpp:41:
    errorcode.h:42:20: fatal error: iostream: No such file or directory
    #include <iostream>
                    ^
    compilation terminated.
    make: *** [brweight.o] Error 1
    ERROR: compilation failed for package ‘kernlab’
    * removing ‘/usr/lib64/R/library/kernlab’
    * installing *source* package ‘Rcpp’ ...
    ** package ‘Rcpp’ successfully unpacked and MD5 sums checked  
    ** libs
    g++ -m64 -I/usr/include/R -DNDEBUG -I../inst/include/ -I/usr/include    -
    fpic  -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-
    protector --param=ssp-buffer-size=4 -m64 -mtune=generic  -c Date.cpp -o 
    Date.o
    In file included from ../inst/include/Rcpp/r/headers.h:48:0,
                 from ../inst/include/RcppCommon.h:38,
                 from ../inst/include/Rcpp.h:27,
                 from Date.cpp:31: 
    ../inst/include/Rcpp/platform/compiler.h:100:17: fatal error: cmath: No such file or directory

gcc包也有同样的问题,但能够通过设置Lib路径来解决它

 Sys.setenv(LIBRARY_PATH='/usr/lib64/:$LIBRARY_PATH')

0 个答案:

没有答案