[Rcpp-devel] Rcpp and boost on Windows 7

Dirk Eddelbuettel edd at debian.org
Sun Feb 3 14:49:36 CET 2013


On 3 February 2013 at 12:18, Romain Francois wrote:
| Le 03/02/13 12:09, André de Boer a écrit :
| > I want to use Rcpp with boost, the boost headers are installed in
| > 'C:\libraries\boost_1_49_0'. How to set the -I flag?
| >
| >>sourceCpp("testBoost.cpp")
| >
| > g++ -m64 -I"C:/R/R-215~1.2/include" -DNDEBUG     -I"C:/R/R-2.15.2/library/Rcpp/include" -I"d:/RCompile/CRANpkg/extralibs64/local/include"     -O2 -Wall  -mtune=core2 -c testBoost.cpp -o testBoost.o testBoost.cpp:2:29: fatal error: boost\foreach.hpp: No such file or directory compilation terminated. make: *** [testBoost.o] Error 1
| > Error in sourceCpp("testBoost.cpp") :
| >    Error 1 occurred building shared library.
| 
| You should have a look at the BH package, with which all you have to do 
| (I think) is to have this in your DESCRIPTION:
| 
| LinkingTo: BH, Rcpp
| 
| And you're good to go.

Yes, but only if the parts of Boost Andre wants are in fact included in
BH. It is not a "full copy" -- it is a bcp-driven build of what a few
packages need.  I already found a small and useful piece (Boost foreach)
missing.  But longer term the plan clearly is to have BH provide what is
useful, and used.  Feedback is welcome.

More generally, what Andre wants to know is described in full detail in the
Rcpp vignette 'Rcpp-package.pdf' which details how to write a package using
Rcpp.  The short version is:  edit src/Makevars and src/Makevars.win. 

You can find a examples on using Boost at the Rcpp Gallery under its tag:

    http://gallery.rcpp.org/tags/boost/

Dirk

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


More information about the Rcpp-devel mailing list