gpt4 book ai didi

r - 在 rocker/r-devel-ubsan-clang 中安装 Rcpp

转载 作者:行者123 更新时间:2023-12-02 19:30:32 25 4
gpt4 key购买 nike

我正在尝试为我的 R 包复制 CRAN sanitizer 故障,该包依赖于 rocker/r-devel-ubsan-clang docker 镜像上的 Rcpp。

当我尝试安装 Rcpp 时,我收到一个关于 no type named 'R_ContinueUnwind' 的错误。 .这是我做错了什么,还是与 Rcpp 和 Rdevel 不兼容?

如果是后者,有没有办法获得一个类似的 docker 镜像,该镜像使用地址清理器用于 R 的非开发版本?

这是我一直试图运行和输出的命令:

docker run --cap-add SYS_PTRACE --rm -it rocker/r-devel-ubsan-clang /bin/bash
root@e9f11aceb087:/# Rscriptdevel -e "install.packages('Rcpp')"
Installing package into ‘/usr/local/lib/R/site-library’
(as ‘lib’ is unspecified)
trying URL 'http://cran.rstudio.com/src/contrib/Rcpp_0.12.18.tar.gz'
Content type 'application/x-gzip' length 3809164 bytes (3.6 MB)
==================================================
downloaded 3.6 MB

* installing *source* package ‘Rcpp’ ...
** package ‘Rcpp’ successfully unpacked and MD5 sums checked
** libs
clang++-4.0 -stdlib=libc++ -fsanitize=address,undefined -fno-sanitize=float-divide-by-zero -fno-omit-frame-pointer -fsanitize-address-use-after-scope -I/usr/local/lib/R/include -DNDEBUG -I../inst/include/ -I/usr/local/include -fpic -g -O3 -Wall -pedantic -mtune=native -c Date.cpp -o Date.o
In file included from Date.cpp:31:
In file included from ../inst/include/Rcpp.h:27:
In file included from ../inst/include/RcppCommon.h:128:
../inst/include/Rcpp/exceptions.h:150:7: error: no type named 'R_ContinueUnwind' in the global namespace
::R_ContinueUnwind(token);
~~^
1 error generated.
/usr/local/lib/R/etc/Makeconf:166: recipe for target 'Date.o' failed
make: *** [Date.o] Error 1
ERROR: compilation failed for package ‘Rcpp’
* removing ‘/usr/local/lib/R/site-library/Rcpp’

The downloaded source packages are in
‘/tmp/RtmpqVuvlD/downloaded_packages’
Warning message:
In install.packages("Rcpp") :
installation of package ‘Rcpp’ had non-zero exit status

编辑

这是 docker image list 的结果并从容器内 Rdevel --version
 docker image list rocker/r-devel-ubsan-clang
REPOSITORY TAG IMAGE ID CREATED SIZE
rocker/r-devel-ubsan-clang latest c769161f77fb 10 months ago 4.47GB

Rdevel --version
Rdevel --version
R Under development (unstable) (2017-09-16 r73288) -- "Unsuffered Consequences"
Copyright (C) 2017 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under the terms of the
GNU General Public License versions 2 or 3.
For more information about these matters see
http://www.gnu.org/licenses/.

我通过使用 docker pull 获得了该图像,我现在正尝试从头开始构建它,遵循图像已有 10 个月大的线索。

最佳答案

该 repo 协议(protocol)的维护者在这里。我们也可以在问题单中在 repo 中讨论这个问题。我没有尝试用 clang 编译 R-devel有一段时间我自己(当我通过 gcc 在家里构建 r-devel 时),所以不知道为什么这个符号丢失了。

Winston 提出了整个概念,他创建了一整套调试 Docker 容器 in this repo .

否则,(优秀)R hub builder也有 sanitizer 版本。剩下的一个问题是 CRAN 不太愿意改变他们的设置(除了发布他们的简短描述),所以永远不清楚设置是否实际上与他们的相同。

编辑:实际上grep 'ing 你的符号表明它是 contingent on R version 3.5.0 or later :

#if (defined(R_VERSION) && R_VERSION >= R_Version(3, 5, 0))
::R_ContinueUnwind(token);
#endif

如果给出的话,你能仔细检查你的容器设置吗?我们可能在 R 版本和 R-devel 版本之间存在不匹配——应该很容易修复。

关于r - 在 rocker/r-devel-ubsan-clang 中安装 Rcpp,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51638351/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com