安装Rcpp时编译失败
Compilation failed when installing Rcpp
我是 运行 一台 8GB RAM、Debian 9、R 3.3 版的虚拟机。
我有这个 R 脚本。
install.packages("Rcpp")
我的机器给了我这个错误。
* installing *source* package ‘Rcpp’ ...
** package ‘Rcpp’ successfully unpacked and MD5 sums checked
** libs
g++ -I/usr/share/R/include -DNDEBUG -I../inst/include/ -fpic -g -O2 -fdebug-prefix-map=/build/r-base-3.3.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c api.cpp -o api.o
In file included from ../inst/include/RcppCommon.h:135:0,
from ../inst/include/Rcpp.h:27,
from api.cpp:24:
../inst/include/Rcpp/lang.h: In function ‘SEXPREC* Rcpp::Rcpp_list7(SEXP, SEXP, SEXP, SEXP, SEXP, SEXP, SEXP)’:
../inst/include/Rcpp/lang.h:45:55: error: ‘Rf_list6’ was not declared in this scope
x0 = Rf_cons(x0, Rcpp_list6(x1, x2, x3, x4, x5, x6));
^
../inst/include/Rcpp/lang.h: In function ‘SEXPREC* Rcpp::Rcpp_lang7(SEXP, SEXP, SEXP, SEXP, SEXP, SEXP, SEXP)’:
../inst/include/Rcpp/lang.h:53:56: error: ‘Rf_list6’ was not declared in this scope
x0 = Rf_lcons(x0, Rcpp_list6(x1, x2, x3, x4, x5, x6));
^
/usr/lib/R/etc/Makeconf:141: recipe for target 'api.o' failed
make: *** [api.o] Error 1
ERROR: compilation failed for package ‘Rcpp’
* removing ‘/home/chris/R/x86_64-pc-linux-gnu-library/3.3/Rcpp’
The downloaded source packages are in
‘/tmp/RtmppHiNzX/downloaded_packages’
Warning message:
In install.packages("Rcpp") :
installation of package ‘Rcpp’ had non-zero exit status
我需要安装这个包。为什么它不起作用?
您正在使用 运行ning R 3.3.* -- 大约四年前制作的主要版本,现在已经过时了 -- 您正在尝试安装已发布的 Rcpp 1.0.4 本周。不匹配。
R 3.3.* 不再在 CRAN 检查,这就是该错误在预发布时被遗漏的原因。所以你应该考虑升级——CRAN 甚至有向后移植,为你的发布提供 Debian 二进制文件。或者,如果您更喜欢 R 3.3.* 等旧软件,也可以使用四年前的 Rcpp 版本。要求混合和匹配适用于所有组合是一种延伸。
现在,构建问题已在 issue ticket #1048 at the repo -- and a related issue #1053 affected another package. And all of this has been fixed in the PRs chronicled in the closed PR tab 中讨论。所以现在你可以从通常的 Rcpp 'drat' repo via
访问一个新的临时版本,目前是 Rcpp 1.0.4.3
install.packages("Rcpp", repos="https://rcppcore.github.io/drat")
所有这些都在 Rcpp 常见问题解答、包描述文件和许多其他地方指出的 rcpp-devel mailing list 上进行了讨论。
简而言之,Rcpp 1.0.4 针对所有 CRAN 参考平台进行了广泛测试(但不包括过时的 R 3.3。*您仍然选择 运行)。同样,我们 运行 完成了对所有 1800 多个 CRAN 包的反向依赖检查——但仅限于 Linux。这需要我几天时间。然而这次我们遇到了一个反向依赖问题 只影响 macOS。为了抓住这一点,我们需要 macOS 用户的测试帮助。
同样,一个 BioConductor 软件包似乎也有问题(与您的类似)。为此,如果 BioConductor 用户可以帮助进行测试,那就太好了。
在发布前一周,我们制作了 pre-release available and asked for testing help。这些错误本可以被发现,但它需要更多的人参与并实际测试 预发布版。
总结一下:如果你想要current本周发布的Rcpp 1.0.4等CRAN包,真的最好使用(至少合理)current R 最好在合理的当前 OS 版本上发布,因为这些版本将获得最好的测试覆盖率。像您 运行 这样的更奇特的组合有被咬的风险。我们非常努力地避免这种情况,但我们无法单独测试所有组合。随时欢迎帮助!
编辑: 当时忘了补充 sudo apt-get install r-cran-rcpp
当然会为您安装保证工作的 Rcpp 版本。来自您的发行版的那个。你遇到的困难是由于 old Debian 你正在 运行ning(大概是出于稳定性原因)和 new Rcpp。如果稳定性是最重要的,请使用您的发行版包含的 Rcpp。
另一个编辑 (2020-04-09): 到目前为止,在与 CRAN 的协调下,补丁版本 Rcpp 1.0.4.6 现已在 CRAN 上,也避免了这个问题.再一次,我只能敦促 "non-standard setups"(定义为与 CRAN 测试的不同)的人测试预发布版。除了 测试发布候选 之外,没有其他方法可以在发布 之前找到 。帮助做到这一点总是很感激。
我是 运行 一台 8GB RAM、Debian 9、R 3.3 版的虚拟机。
我有这个 R 脚本。
install.packages("Rcpp")
我的机器给了我这个错误。
* installing *source* package ‘Rcpp’ ...
** package ‘Rcpp’ successfully unpacked and MD5 sums checked
** libs
g++ -I/usr/share/R/include -DNDEBUG -I../inst/include/ -fpic -g -O2 -fdebug-prefix-map=/build/r-base-3.3.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c api.cpp -o api.o
In file included from ../inst/include/RcppCommon.h:135:0,
from ../inst/include/Rcpp.h:27,
from api.cpp:24:
../inst/include/Rcpp/lang.h: In function ‘SEXPREC* Rcpp::Rcpp_list7(SEXP, SEXP, SEXP, SEXP, SEXP, SEXP, SEXP)’:
../inst/include/Rcpp/lang.h:45:55: error: ‘Rf_list6’ was not declared in this scope
x0 = Rf_cons(x0, Rcpp_list6(x1, x2, x3, x4, x5, x6));
^
../inst/include/Rcpp/lang.h: In function ‘SEXPREC* Rcpp::Rcpp_lang7(SEXP, SEXP, SEXP, SEXP, SEXP, SEXP, SEXP)’:
../inst/include/Rcpp/lang.h:53:56: error: ‘Rf_list6’ was not declared in this scope
x0 = Rf_lcons(x0, Rcpp_list6(x1, x2, x3, x4, x5, x6));
^
/usr/lib/R/etc/Makeconf:141: recipe for target 'api.o' failed
make: *** [api.o] Error 1
ERROR: compilation failed for package ‘Rcpp’
* removing ‘/home/chris/R/x86_64-pc-linux-gnu-library/3.3/Rcpp’
The downloaded source packages are in
‘/tmp/RtmppHiNzX/downloaded_packages’
Warning message:
In install.packages("Rcpp") :
installation of package ‘Rcpp’ had non-zero exit status
我需要安装这个包。为什么它不起作用?
您正在使用 运行ning R 3.3.* -- 大约四年前制作的主要版本,现在已经过时了 -- 您正在尝试安装已发布的 Rcpp 1.0.4 本周。不匹配。
R 3.3.* 不再在 CRAN 检查,这就是该错误在预发布时被遗漏的原因。所以你应该考虑升级——CRAN 甚至有向后移植,为你的发布提供 Debian 二进制文件。或者,如果您更喜欢 R 3.3.* 等旧软件,也可以使用四年前的 Rcpp 版本。要求混合和匹配适用于所有组合是一种延伸。
现在,构建问题已在 issue ticket #1048 at the repo -- and a related issue #1053 affected another package. And all of this has been fixed in the PRs chronicled in the closed PR tab 中讨论。所以现在你可以从通常的 Rcpp 'drat' repo via
访问一个新的临时版本,目前是 Rcpp 1.0.4.3install.packages("Rcpp", repos="https://rcppcore.github.io/drat")
所有这些都在 Rcpp 常见问题解答、包描述文件和许多其他地方指出的 rcpp-devel mailing list 上进行了讨论。
简而言之,Rcpp 1.0.4 针对所有 CRAN 参考平台进行了广泛测试(但不包括过时的 R 3.3。*您仍然选择 运行)。同样,我们 运行 完成了对所有 1800 多个 CRAN 包的反向依赖检查——但仅限于 Linux。这需要我几天时间。然而这次我们遇到了一个反向依赖问题 只影响 macOS。为了抓住这一点,我们需要 macOS 用户的测试帮助。
同样,一个 BioConductor 软件包似乎也有问题(与您的类似)。为此,如果 BioConductor 用户可以帮助进行测试,那就太好了。
在发布前一周,我们制作了 pre-release available and asked for testing help。这些错误本可以被发现,但它需要更多的人参与并实际测试 预发布版。
总结一下:如果你想要current本周发布的Rcpp 1.0.4等CRAN包,真的最好使用(至少合理)current R 最好在合理的当前 OS 版本上发布,因为这些版本将获得最好的测试覆盖率。像您 运行 这样的更奇特的组合有被咬的风险。我们非常努力地避免这种情况,但我们无法单独测试所有组合。随时欢迎帮助!
编辑: 当时忘了补充 sudo apt-get install r-cran-rcpp
当然会为您安装保证工作的 Rcpp 版本。来自您的发行版的那个。你遇到的困难是由于 old Debian 你正在 运行ning(大概是出于稳定性原因)和 new Rcpp。如果稳定性是最重要的,请使用您的发行版包含的 Rcpp。
另一个编辑 (2020-04-09): 到目前为止,在与 CRAN 的协调下,补丁版本 Rcpp 1.0.4.6 现已在 CRAN 上,也避免了这个问题.再一次,我只能敦促 "non-standard setups"(定义为与 CRAN 测试的不同)的人测试预发布版。除了 测试发布候选 之外,没有其他方法可以在发布 之前找到 。帮助做到这一点总是很感激。