在Rocker / R-Devel-Ubsan-Clang中安装Rcpp

时间:2018-08-01 16:38:21

标签: r docker rcpp

我正在尝试为我的R软件包复制CRAN消毒剂故障,该软件包依赖于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个月了。

1 个答案:

答案 0 :(得分:1)

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

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

否则,(优秀)R hub builder也具有消毒剂的功能。剩下的一个问题是CRAN不太会改变其设置(除了发布简短描述之外),因此永远不清楚设置是否实际上与他们的设置相同。

编辑:实际上grep代表您的符号表明它是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版本之间不匹配-应该易于修复。