I have a R package for which I moved an MCMC algorithm containing matrix algebra to C++
using the RcppEigen
package which dramatically improved the speed.
However, R CMD check
gives the following NOTE
on Linux (Thanks to R-Forge):
* checking installed package size ... NOTE
installed size is 6.6Mb
sub-directories of 1Mb or more:
libs 6.1Mb
This warning is probably not driven by the incredible size of my C++ code (which is only around 150 lines), as it only appears on Linux, but probably by my inability to correctly configure the Makevars
file. (I have never used make
or a makefile
before).
Also when submitting the package to CRAN
, Brian Ripley wrote something regarding this NOTE
that makes me expect it is a Makevars
problem: "It comes from debugging symbols."
My Makevars
are the standard Rcpp
Makevars
(given below) produced by Rcpp.package.skeleton
.
My questions:
- How can I configure my
Makevars
in a way that reduces the size of the compiled library on Linux (i.e., get rid of theNOTE
)? - What are good resources on how to get into the magic of
Makevars
forRcpp
?
(I didn't find anything in the Gallery and the R extension manual on this was also incomprehensible to me)
my Makevars
:
## Use the R_HOME indirection to support installations of multiple R version
PKG_LIBS = `$(R_HOME)/bin/Rscript -e "Rcpp:::LdFlags()"`
PKG_CPPFLAGS = -I. -I../inst/include
my Makevars.win
:
## This assume that we can call Rscript to ask Rcpp about its locations
## Use the R_HOME indirection to support installations of multiple R version
PKG_LIBS = $(shell $(R_HOME)/bin/Rscript.exe -e "Rcpp:::LdFlags()")
PKG_CPPFLAGS = -I. -I../inst/include