[Rcpp-devel] Makefile CPP flag

Dirk Eddelbuettel edd at debian.org
Fri Jun 17 13:33:48 CEST 2011

[resending, this time with CC to list. --Dirk]

On 17 June 2011 at 12:11, soeren.vogel at uzh.ch wrote:
| How can I assure an include directory of a library on UNIX likes, wherever that library is installed on the user machine?

The answer, as you know, is to use configure.
| Both, Makevars and Makevars.win are from Rcpp.package.skeleton(). I have added
| PKG_CPPFLAGS = '-I/opt/local/include'
| to Makevars to point to the boost sources on the mac here. Uwe Ligges pointed to the use of the variable BOOSTLIB in Makevars.win (I am about testing how this works). Now I *mean* this could principally also be an issue on UNIX machines where boost does not reside inside a standard directory (or opt). I've browsed through the Rcpp packages' sources, however, the configure scripts there go far beyond my current programming skills. I *mean* (again) that the user could be prompted for the boost path on installation, but I have no idea of how to achieve this.

You must be kidding. 3000+ CRAN packages, and now you want to burden the
maintainers with __manual__ questions? 

Your package works where Boost is found in default locations. That includes
OS X as well as Debian/Ubuntu which is why Kurt probably hasn't asked you to
generalize this.

A long time ago (December 2004), I addressed that problem in configure.in for
my RQuantLib package. That has been working ever since, and you could look at
that. (And yes, it also looks for QuantLib libraries which you can skip). You
could also look at the other Boost-using packages on CRAN.

This means that eg for Makevars.win, instead of 

   PKG_CPPFLAGS = '-I/Boost'

you should use


or whichever variable Uwe recommends. (For QuanntLib he uses a bundle
containing QL header, library as well as Boost template headers.)

You can also ask on r-devel about how to use configure properly; that is not
an Rcpp question per se.

Hope this helps, Dirk

Gauss once played himself in a zero-sum game and won $50.
                      -- #11 at http://www.gaussfacts.com

More information about the Rcpp-devel mailing list