gpt4 book ai didi

在 ubuntu 上重现 CRAN GCC-UBSAN 测试结果 'at home'

转载 作者:行者123 更新时间:2023-12-02 07:25:15 27 4
gpt4 key购买 nike

我正在为这个问题挠头。如何重现 CRAN's gcc ubsan tests of my package的结果在家里,在 ubuntu 上? (准备步骤说明来自here)

1) 我安装更新所有需要的包:

apt-get update
apt-get install bash-completion bison debhelper default-jdk g++ gcc gfortran groff-base libblas-dev libbz2-dev libcairo2-dev libcurl4-openssl-dev libjpeg-dev liblapack-dev liblzma-dev libncurses5-dev libpango1.0-dev libpcre3-dev libpng-dev libreadline-dev libtiff5-dev libx11-dev libxt-dev mpack subversion tcl8.5-dev texinfo texlive-base texlive-extra-utils texlive-fonts-extra texlive-fonts-recommended texlive-generic-recommended texlive-latex-base texlive-latex-extra texlive-latex-recommended tk8.5-dev valgrind x11proto-core-dev xauth xdg-utils xfonts-base xvfb zlib1g-dev

2) 使用所需选项构建 Rdevel:

cd /tmp
svn co http://svn.r-project.org/R/trunk R-devel
cd /tmp/R-devel
R_PAPERSIZE=letter R_BATCHSAVE="--no-save --no-restore" PAGER=/usr/bin/pager PERL=/usr/bin/perl R_UNZIPCMD=/usr/bin/unzip R_ZIPCMD=/usr/bin/zip R_PRINTCMD=/usr/bin/lpr LIBnn=lib AWK=/usr/bin/awk CFLAGS="-pipe -std=gnu99 -Wall -pedantic -O2" CXXFLAGS="-pipe -Wall -pedantic -O2" CC="gcc -fsanitize=address,undefined" CXX="g++ -fsanitize=address,undefined" CXX1X="g++ -fsanitize=address,undefined" FC="gfortran -fsanitize=address,undefined" F77="gfortran -fsanitize=address,undefined" ./configure --enable-R-shlib --without-blas --without-lapack --with-readline --without-recommended-packages --program-suffix=dev --disable-openmp
make
make install
make clean

3) 最后,使用 as-cran 标志在本地构建/编译所述包:

wget https://cran.r-project.org/src/contrib/FastRCS_0.0.6.tar.gz
tar -xvzf FastRCS_0.0.6.tar.gz
Rdevel CMD check --as-cran FastRCS

但我没有得到与 cran 相同的错误报告(参见 here )。我的意思是例如这个:

/usr/local/gcc5/lib/gcc/x86_64-unknown-linux-gnu/5.2.0/include/emmintrin.h:140:21: runtime error: load of misaligned address 0x61800007fc84 for type 'const double', which requires 8 byte alignment
0x61800007fc84: note: pointer points here
00 00 80 3f 00 00 80 3f 00 00 80 3f 00 00 80 3f 00 00 80 3f 00 00 80 3f 00 00 80 3f 00 00 80 3f

我使用的脚本有什么问题?

最佳答案

另一个开箱即用的解决方案似乎是使用 r-hub package/service ,其工作方式与 devtools::check() 类似,您只需要运行

rhub::check_with_sanitizers()

关于在 ubuntu 上重现 CRAN GCC-UBSAN 测试结果 'at home',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33178878/

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