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

Installing Rcpp in rocker/r-devel-ubsan-clang

我正在尝试为依赖于 rocker/r-devel-ubsan-clang docker 图像上的 Rcpp 的 R 包复制 CRAN 消毒剂故障。

当我尝试安装 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 个月大了。

此处是该回购协议的维护者。我们也可以在问题单中的回购协议中讨论这个问题。我有一段时间没有尝试自己用 clang 编译 R-devel(因为我在家里通过 gcc 构建 r-devel),所以不确定为什么缺少符号。

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

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

编辑: 实际上 grep'ing for your symbol 表明它是 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 版本之间可能存在不匹配——应该很容易修复。