How to reproduce ERROR seen by CRAN maintainer / how to add .R/Makevars

StackOverflow https://stackoverflow.com/questions/23239727

  •  08-07-2023
  •  | 
  •  

Вопрос

As part of my PhD project I have completely redesigned an early draft of my R package quantspec. After I uploaded the tar.gz-file I obtained via BUILD, which passed CHECK on my Windows 7 computer, using the webform, I received an email that one of the examples in my package produced an ERROR.

I've tested my package by installing it via

devtools::install_github("tobiaskley/quantspec", ref="develop")

on different computers (> 5) that are using Windows, Linux and MacOS as operating systems, but was unable to reproduce the ERROR reported.

EDIT: It seems to me that I'm missing some important step when building and checking the package. In Section 4.3.6 of Writing R Extensions it says that I should add to ~/.R/Makevars something like (for gfortran)

FCFLAGS = -g -O2 -mtune=native -fbounds-check
FFLAGS = -g -O2 -mtune=native -fbounds-check

How do I do that?

Это было полезно?

Решение

I've finally managed to reproduce the error.

For some reason, on all systems (> 5) I have used to test my package, checking of the array bounds was turned off. It can be switched on by options(CBoundsCheck = TRUE) or via an environment variable R_C_BOUNDS_CHECK=yes.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top