【问题标题】:CRAN submission - R CMD Check warning - compilation flags usedCRAN 提交 - R CMD 检查警告 - 使用的编译标志
【发布时间】:2018-11-12 11:13:38
【问题描述】:

我正在尝试将我的第一个包提交给CRAN,在我的机器上,我在运行R CMD check 时收到以下警告(通过RStudio

checking compilation flags used ... WARNING
Compilation used the following non-portable flag(s):
  ‘-Wno-unused-function’ ‘-Wno-unused-variable’
including flag(s) suppressing warnings
R CMD check results
0 errors | 1 warning  | 0 notes

R CMD check succeeded

Rwin-builder 上构建我的包时,我没有收到此警告。我确实从 win-builder 服务中获得了 NOTE,但我认为这是因为这是第一次提交并且有 CRAN 无法识别的拼写,即

* checking CRAN incoming feasibility ... NOTE

New submission

Possibly mis-spelled words in DESCRIPTION:
  CVODE (8:167)
  CVODES (8:219)
  Livermore (8:108)

我并不担心第一次提交和拼写错误的单词注释,因为我可以在 cmets(和 cran-comments.md 文件中)解释它们。但是有没有办法消除我在系统上收到的警告(macOSR = 3.5.0)。该软件包在 travis-ciappveyor 上构建良好。

另外,是否准备好提交带有 1 个警告的包,我知道 Hadley 的书提到我们必须在提交前尝试删除所有错误、警告和注释。

我刚刚发现了 r-hub,包在上面构建得很好

Build ID:   sundialr_0.1.0.tar.gz-aa50507b5a2a8b57b091643fa3e7aae2
Platform:   Debian Linux, R-devel, GCC
Submitted:  3 minutes 36.3 seconds ago
Build time: 3 minutes 32.1 seconds

包码可以查到here

任何帮助将不胜感激!

【问题讨论】:

  • 您应该为非英语单词或其他软件包和外部软件的名称使用单引号。任何也许你可以改写一下第二句话。

标签: r r-package cran


【解决方案1】:

2019 年 5 月更新:Debian 软件包中的 Recent changes 使这些配置更改对于最新软件包来说是不必要的。

AFAIK 这些标志被 Debian 用作每次编译的默认设置。 R 会记住使用过的标志。您可以在~/.R/Makevars 中进行调整,例如:

# Settings from /etc/R/Makeconf with "non-portable flag(s):"
# ‘-Wdate-time’ ‘-Werror=format-security’ ‘-Wformat’ replaced by -Wall -pedantic
# and without -fdebug-prefix-map=... 
CFLAGS = -g -O2 -Wall -pedantic -fstack-protector-strong -D_FORTIFY_SOURCE=2 $(LTO)
CXXFLAGS = -g -O2 -Wall -pedantic -fstack-protector-strong -D_FORTIFY_SOURCE=2 $(LTO)
CXX98FLAGS = -g -O2 -Wall -pedantic -fstack-protector-strong -D_FORTIFY_SOURCE=2
CXX11FLAGS = -g -O2 -Wall -pedantic -fstack-protector-strong -D_FORTIFY_SOURCE=2
CXX14FLAGS = -g -O2 -Wall -pedantic -fstack-protector-strong -D_FORTIFY_SOURCE=2

【讨论】:

  • 注意:如果不确定Makevars文件的本地化,可以使用:usethis::edit_r_makevars()
猜你喜欢
  • 2013-02-08
  • 1970-01-01
  • 2014-11-05
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2017-05-28
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多