I am trying to build an R package with c++ code on Travis CI and checking it with valgrind by running R CMD check
with the --use-valgrind
option. In the R extensions manual it says to either provide a ~/.valgrindrc
file with the required options or set them in the environment variable VALGRIND_OPTS
but I haven't been able to figure out either of these.
I have created a demo repo here that includes a Rcpp function which valgrind ought to respond to.
My .travis.yml
setup looks like this:
language: r
sudo: false
cache: packages
r_check_args: '--use-valgrind'
addons:
apt:
packages:
- valgrind
I have a .valgrindrc
file with the following,
--leak-check=full
--track-origins=yes
, and have tried to put it in ./inst/
and the root directory but none of that has worked. Does anybody know how to set these options properly?
Edit: here is a link to the latest travis build.
According to the docs, the file
./.valgrindrc
(so in the current working directory, is only read if the file~/.valgrindrc
does not exist, and the environment variable$VALGRIND_OPTS
is not set.Not sure what is the case, but you might want to do the following:
The first two are there for diagnostic purposes. The last one might fix the issue (it appends your configuration to the global configuration). If it would not work, you will likely have some more insight in what is at play.