【问题标题】:Cannot install roxygen2 on Debian Jessie无法在 Debian Jessie 上安装 roxygen2
【发布时间】:2016-10-12 15:35:43
【问题描述】:

当我尝试安装 roxygen2 时,我得到:

> sudo Rscript -e 'install.packages("roxygen2", repos="http://mirrors.dotsrc.org/cran/")'         
Installing package into ‘/usr/local/lib/R/site-library’
(as ‘lib’ is unspecified)
trying URL 'http://mirrors.dotsrc.org/cran/src/contrib/roxygen2_5.0.1.tar.gz'
Content type 'text/plain' length 106197 bytes (103 Kb)
opened URL
==================================================
downloaded 103 Kb

* installing *source* package ‘roxygen2’ ...
** package ‘roxygen2’ successfully unpacked and MD5 sums checked
** libs
g++ -I/usr/share/R/include -DNDEBUG   -I"/usr/lib/R/site-library/Rcpp/include"   -fpic  -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -g  -c RcppExports.cpp -o RcppExports.o
g++ -I/usr/share/R/include -DNDEBUG   -I"/usr/lib/R/site-library/Rcpp/include"   -fpic  -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -g  -c isComplete.cpp -o isComplete.o
g++ -I/usr/share/R/include -DNDEBUG   -I"/usr/lib/R/site-library/Rcpp/include"   -fpic  -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -g  -c leadingSpaces.cpp -o leadingSpaces.o
g++ -I/usr/share/R/include -DNDEBUG   -I"/usr/lib/R/site-library/Rcpp/include"   -fpic  -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -g  -c parser2.cpp -o parser2.o
parser2.cpp: In function ‘Rcpp::CharacterVector find_includes(std::string)’:
parser2.cpp:165:35: error: too many arguments to function ‘void Rcpp::stop(const string&)’
     stop("Failed to open %s", path);
                                   ^
In file included from /usr/lib/R/site-library/Rcpp/include/RcppCommon.h:131:0,
                 from /usr/lib/R/site-library/Rcpp/include/Rcpp.h:27,
                 from parser2.cpp:1:
/usr/lib/R/site-library/Rcpp/include/Rcpp/exceptions.h:195:17: note: declared here
     inline void stop(const std::string& message) {
                 ^
/usr/lib/R/etc/Makeconf:137: recipe for target 'parser2.o' failed
make: *** [parser2.o] Error 1
ERROR: compilation failed for package ‘roxygen2’
* removing ‘/usr/local/lib/R/site-library/roxygen2’

The downloaded source packages are in
    ‘/tmp/RtmpSn8jzt/downloaded_packages’
Warning message:
In install.packages("roxygen2", repos = "http://mirrors.dotsrc.org/cran/") :
  installation of package ‘roxygen2’ had non-zero exit status

我尝试了几个不同的 repos,但结果总是一样的。是在 repos 中发布的版本有问题吗?我还能尝试什么?

【问题讨论】:

    标签: r linux installation roxygen2


    【解决方案1】:

    Hadley 注意到其他包的这个问题,并在 Github 线程上声明解决方案是使用 Rcpp 的开发版本,即

    install_github("RcppCore/Rcpp")
    

    所以,升级 Rcpp 然后完全关闭所有 RStudio 和 R 进程,然后重新启动并重新安装 roxygen2

    【讨论】:

    • 我认为这个答案不正确。 Rcpp 的 CRAN 版本应该没问题:我在家里和工作的几台机器上同时使用 roxygen2 和 Rcpp 的发布版本,它们进入 Docker 等 pp 的 Rocker 容器。再说一次,我主要使用 Debian“测试”而不是稳定.最有可能的罪魁祸首可能是该机器上的旧发行版r-cran-rcpp。所以只需从 CRAN 添加 Rcpp 就可以了。 FWIW,我基本上从不推荐install_github(),因为我们有适当的 Rcpp 发布程序。从 GitHub 获取随机快照更加随机。
    猜你喜欢
    • 2016-12-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-11-14
    • 2016-01-05
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多