Skip to content

[Rcpp-devel] Rcpp and boost on Windows 7

4 messages · André de Boer, Romain Francois, Dirk Eddelbuettel +1 more

#
Hello,

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?
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.



Regards,

Andr?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/rcpp-devel/attachments/20130203/f01a048d/attachment.html>
#
Le 03/02/13 12:09, Andr? de Boer a ?crit :
Hello,

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.

Romain
#
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
#
Maybe we (I) should accept requests for additions to BH, rebuild, and
make available on R-Forge.  When there is proof that the addition has
been used successfully, bump up to CRAN.  We don't want excessive
uploads to CRAN because of the size, of course.

Sounds like foreach may be next?

Jay
On Sun, Feb 3, 2013 at 8:49 AM, Dirk Eddelbuettel <edd at debian.org> wrote: