[Rcpp-devel] recommended way to use Rcpp in packages

Romain Francois romain at r-enthusiasts.com
Fri Jul 16 10:51:00 CEST 2010

Dear package maintainers,

Some of your package fail to compile on windows 64 with the current 
versions of R and Rcpp.

It appears to be related to the Makevars.win. What to write in the 
Makevars.win file has changed over time as new advice have been given, 
etc ... so I wanted to send an email to advise what is the currently 
best way to do it.

We need two things :

- Rcpp headers : this is really easy, you just need to add the following 
line in your DESCRIPTION

LinkingTo: Rcpp

if you do this, you don't need the PKG_CPPFLAGS line in the Makevars and 
Makevars.win anymore. This is recommended as there appears to be 
problems with both backticks and the use of $shell

- linking against the library : on windows, you need to follow Brian 
Ripley's advice : http://article.gmane.org/gmane.comp.lang.r.devel/24449

and use this in your Makevars.win:

PKG_LIBS = $(shell "${R_HOME}/bin${R_ARCH_BIN}/Rscript.exe" -e 

(this might change again in the future and we will advise again)

Please consider registering to the Rcpp-devel mailing list if you wish 
to reply to this email. 

Please read rhe "Rcpp-package" vignette for a more complete description 
of this.

Best Regards,


Romain Francois
Professional R Enthusiast
+33(0) 6 28 91 30 30
|- http://bit.ly/bc8jNi : Rcpp 0.8.4
|- http://bit.ly/dz0RlX : bibtex 0.2-1
`- http://bit.ly/a5CK2h : Les estivales 2010

More information about the Rcpp-devel mailing list