我试图通过install.packages("Rcpp")
在R中安装Rcpp,但是发生以下错误:
* installing *source* package ‘Rcpp’ ...
** package ‘Rcpp’ successfully unpacked and MD5 sums checked
** libs
g++ -I/home/jerry/local/lib64/R/include -DNDEBUG -I../inst/include/ -I/usr/local/include -fpic -diag-disable 308 -c Date.cpp -o Date.o
g++: 308: No such file or directory
cc1plus: warning: unrecognized gcc debugging option: i
cc1plus: warning: unrecognized gcc debugging option: g
cc1plus: warning: unrecognized gcc debugging option: -
cc1plus: warning: unrecognized gcc debugging option: d
cc1plus: warning: unrecognized gcc debugging option: i
cc1plus: warning: unrecognized gcc debugging option: s
cc1plus: warning: unrecognized gcc debugging option: b
cc1plus: warning: unrecognized gcc debugging option: l
cc1plus: warning: unrecognized gcc debugging option: e
make: *** [Date.o] Error 1
ERROR: compilation failed for package ‘Rcpp’
* removing ‘/home/jerry/r-lib/Rcpp’
* restoring previous ‘/home/jerry/r-lib/Rcpp’
The downloaded source packages are in
‘/tmp/RtmpfxSJDZ/downloaded_packages’
Warning message:
In install.packages("Rcpp") :
installation of package ‘Rcpp’ had non-zero exit status
对我来说,这似乎是一个编译问题(他们对编译软件不太了解),但是我不知道如何解决。我检查了文件Rcpp / src / Date.cpp。它包含以下包含行:
#include <Rcpp.h>
#include <time.h>
#include <Rcpp/exceptions.h>
Rcpp.h和Rcpp / exceptions.h都在Rcpp/inst
中,它们应该已经包含在搜索路径-I../inst/include/
中。我不知道time.h
在哪里。
我正在使用没有root访问权限的群集。我下载了R-3.2.3,并使用以下方法自行编译:
./configure --prefix=~/local
make
make install
我能够使用系统提供的R(3.2.1)版本安装Rcpp。我所有的软件包都在〜/ r-lib中。
我将不胜感激。非常感谢!