[R-pkg-devel] Why would src/Makevars be ignored?

Duncan Murdoch murdoch.duncan at gmail.com
Tue Nov 21 22:51:33 CET 2017


On 21/11/2017 3:37 PM, Dirk Eddelbuettel wrote:
> 
> Having a bit of a puzzle with a package at work (which I can't share).
> 
> In src/Makevars I override CC, CXX, CXX11, CXX14 to point to a specific
> (version) of g++ on my system, say g++-x.y.  I also set CXX_STD=CXX14
> 
> Only it doesn't work. I need an extra dot.RMakevars and an invocation via
> 
>    R_MAKEVARS_USER=~/git/thatpackage/dot.RMakevars R CMD INSTALL .
> 
> or else the values from R's default Makeconf come through.
> 
> How could that be?  I have invoked R CMD INSTALL probably thousands of times,
> and most got it to what I wanted but setting values in it.  What could be
> wrong here?
> 
> R 3.4.2; Ubuntu 17.04.
> 
> Puzzled,  Dirk
> 


According to section 1.2.1 "Using Makevars" in Writing R Extensions, 
R_HOME/etcR_ARCH/Makeconf is included after Makevars, so what you're 
seeing is by design.  I believe this is so that packages are built with 
tools compatible with those that built R.  (Remember, packages are 
designed for distribution to diverse systems.)

If you happen to know how to override some of these settings in a safe 
way on your own system, then do what you did (as recommended in the R 
Admin manual, section 6.3.3.)

Duncan Murdoch



More information about the R-package-devel mailing list