Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

r

fortran

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?

like image 879
tobias Avatar asked Apr 23 '14 09:04

tobias


1 Answers

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.

like image 197
tobias Avatar answered Oct 02 '22 18:10

tobias