CRAN submission - R CMD Check warning - compilation flags used
Asked Answered
D

1

12

I am trying to submit my first package to CRAN and on my machine, I am getting the following warning on running R CMD check (via 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

I don't get this warning on building my package on R win-builder. I do get a NOTE from the win-builder service, but I think this is due to the fact that this is the first submission and there are spellings that CRAN does not recognize, i.e.,

* checking CRAN incoming feasibility ... NOTE

New submission

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

I am not so worried about the first submission and the mis-spelled words note as I can explain them in the comments (and in cran-comments.md file). But is there a way to remove the warnings I get on my system (macOS, R = 3.5.0). The package builds fine on travis-ci and appveyor.

Also, is the package ready for submission with the 1 warning, I know that Hadley's book mentions that we must try to remove ALL errors, warnings and notes before submission.

I just found out about r-hub, the package builds fine on it

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

The package code can be found here

Any help will be highly appreciated!!

Desma answered 2/6, 2018 at 15:2 Comment(1)
You should use single quotes for non-English words or names of other packages and external software. Any maybe you could rephrase the second sentence a bit.Farica
T
17

Update May 2019: Recent changes in the Debian packages have made these configuration changes unnecessary for the latest packages.

AFAIK these flags are used by Debian as default for every compilation. And R memorizes the flags that where used. You can adjust that in ~/.R/Makevars, e.g.:

# 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
Trihydric answered 30/8, 2018 at 14:59 Comment(1)
Note: if you are not sure about the localization of the Makevars file, you can use: usethis::edit_r_makevars()Isocracy

© 2022 - 2024 — McMap. All rights reserved.