r - R 3.6.1 配置中缺少“-fdebug-prefix-map”
问题描述
我想使用 调试基于 Rcpp 的包gdb
,但我的 R 配置丢失-fdebug-prefix-map
,这似乎是调试器无法找到错误行的原因。如何配置此选项?
# etc/Makeconf. Generated from Makeconf.in by configure.
#
# ${R_HOME}/etc/Makeconf
#
# R was configured using the following call
# (not including env. vars and site configuration)
# configure '--prefix=/usr' '--with-cairo' '--with-jpeglib' '--with-readline' '--with-tcltk' '--with-system-bzlib' '--with-system-pcre' '--with-system-zlib' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--datadir=/usr/share/R/share' '--includedir=/usr/share/R/include' '--with-blas' '--with-lapack' '--enable-R-profiling' '--enable-R-shlib' '--enable-memory-profiling' '--without-recommended-packages' '--build' 'x86_64-linux-gnu' 'build_alias=x86_64-linux-gnu' 'R_PRINTCMD=/usr/bin/lpr' 'R_PAPERSIZE=letter' 'TAR=/bin/tar' 'R_BROWSER=xdg-open' 'LIBnn=lib' 'JAVA_HOME=/usr/lib/jvm/default-java' 'R_SHELL=/bin/bash' 'CC=gcc -std=gnu99' 'CFLAGS=-g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g' 'LDFLAGS=-Wl,-Bsymbolic-functions -Wl,-z,relro' 'CPPFLAGS=' 'FC=gfortran' 'FCFLAGS=-g -O2 -fstack-protector-strong' 'CXX=g++' 'CXXFLAGS=-g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g'
这是我的包编译消息。
g++ -std=gnu++17 -I"/usr/share/R/include" -DNDEBUG -I"/home/sasa/R/x86_64-pc-linux-gnu-library/3.6/Rcpp/include" -ggdb3 -Og -march=native -flto -Wall -Werror -fpic -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c train.cpp -o train.o
g++ -std=gnu++17 -shared -L/usr/lib/R/lib -Wl,-Bsymbolic-functions -Wl,-z,relro -o fast.beta.train.so RcppExports.o train.o -ggdb3 -Og -march=native -flto -Wall -Werror -L/usr/lib/R/lib -lR```
解决方案
你可以
- 编辑
~/.R/Makevars
(可能是首选)或 - 编辑
Makeconf
R 自己的文件etc/
(如下$RHOME
)或 - “对于未发布的包”
src/Makevars
直接编辑
设置这个。没有编程方式,Policy 不鼓励您将其添加到每个包文件中,因此您不能在 CRAN 包中执行第三个选项。
推荐阅读
- reactjs - React hooks useEffect fetch CORS 问题
- postgresql - 错误:在加载备份时,编码“WIN1252”中字节序列为 0x9d 的字符在编码“UTF8”中没有等效项
- android - 如何使用数据绑定从视图模型调用活动类型扩展函数?
- python - 为什么输出数据一直在变化
- amazon-web-services - 将 Sonarqube 与 AWS Codebuild 连接时出现 SSL 连接问题
- java - org.openqa.selenium.chromium.ChromiumOptions 类型无法解析。请找到附件
- flutter - 颤动中的水平日期选择器
- r - R中的多轴重叠绘图(问题)
- mapbox - Mapbox iOS:Clusterproperties NSExpression all & any 不工作
- sharepoint-online - Sharepoint Online 搜索未完全重新抓取