[Rcpp-devel] Rcmd build in Windows

Dirk Eddelbuettel edd at debian.org
Tue Mar 22 20:47:56 CET 2011


On 22 March 2011 at 10:32, Dahir Alihassan wrote:
| Hi,
| 
| I am trying to build and install (Rcmd build) an RCPP package, with RTools
| etc installed. Initially I setup the project in an IDE (CodeBlocks) and
| managed to link against rcpp thus producing a DLL file just fine.
| Following this I had a look at the Writing R Extensions Manual
| (http://cran.r-project.org/doc/manuals/R-exts.pdf) and so I am aware of
| makevars.win and configure.win files. I also managed to install Rcpp using
| Rcmd so clearly the toolchain is setup correctly, and thus I have setup a
| skeleton Rcpp project for which Rcmd build and install work fine.
| 
| What I don't understand - in my case, with a prebuilt DLL - is why Rcmd
| build needs to call g++ to recreate another DLL; it seems like I am
| repeating the whole process I went through in the IDE. The main issue is
| that my project links to external libraries (like C++ Boost) and so Rcmd
| build/install complains about the project include headers and paths; I
| assume the only way to set this up is in the configure.win and
| makevars.win files which seems fairly tedious - am I repeating the whole
| process? I hope I am just misunderstanding the build process; I have tried
| reading the manuals but I was hoping you could clear my head with regards
| to this issue. Thanks very much.

Yes, you do need 'R CMD INSTALL someSourceArchive-1.2-3.tar.gz' because that
is how R works. 

How to add your own dependencies is explained in Writing R Extensions as well
as in our Rcpp-package vignette.

Lastly, the CRAN package for Rcpp lists 20 other packages uses it. Some use
GSL, some use Boost, ... so you could look around there and see how others
have solved the issue.

Dirk

-- 
Dirk Eddelbuettel | edd at debian.org | http://dirk.eddelbuettel.com


More information about the Rcpp-devel mailing list