[Rcpp-devel] Specifying additional include path in Rcpp package

Rainer M Krug Rainer at krugs.de
Thu Jul 18 18:00:50 CEST 2013


Dirk Eddelbuettel <edd at debian.org> writes:

> Hi Rainer,
>
> On 18 July 2013 at 16:51, Rainer M Krug wrote:
> | Hi
> | 
[snip: some stuff (28 lines)]
> | 
> | ,----
> | | #!/bin/bash
> | | ## Use the R_HOME indirection to support installations of multiple R version
> | | PKG_LIBS = `$(R_HOME)/bin/Rscript -e "Rcpp:::LdFlags()"`
> | | PKG_LIBS = $PKG_LIBS:/Applications/GRASS/GRASS-7.0.app/Contents/MacOS/include/
>
> That is for __linking__ but not compiling and hence does nothing for header
> files.  
>
> You want to set PKG_CXXFLAGS, or PKG_CPPFLAGS.

Ah - that solved it. My Makevars looks now as follow:

,----
| PKG_LIBS = `$(R_HOME)/bin/Rscript -e "Rcpp:::LdFlags()"`
| PKG_CXXFLAGS="-I/Applications/GRASS/GRASS-7.0.app/Contents/MacOS/include/"
`----

And I don't get that error anymore.

>
> One (in my eyes) easy way is to look at existing packages...  Pick one where
> you know an external library and headers are used.

Agreed - but I figured it out now.

>
> | | ## some commentsAs an alternative, one can also add this code in a file 'configure'
> | `----
> | 
> | with the idea that the include path is added. But when I use load_all(.)
> | to laod the package, I get the following error:
> | 
[snip: Some irrelevant output (54 lines)]
> | 
> | telling me that the additional header files are not found, even though
> | the path seems to be added:
> | 
> | ,----
> | | -I/Library/Frameworks/R.framework/Resources/include 
> | `----
>
> Well ... are the grass/* files in that directory?

Oh no - I should better look at the output - I saw "Framework" and
thought "grass" - shame on me.

>  
> | It is probably my limited C / C++ expertise, but wat is going on here?
> | 
> | I am working on OS X Mountain Lion, gcc is installed via homebrew, and I
> | can compile other packages without problems.
>
> "Other packages" may have working configurations, yours does not yet it seems.

Most likely they do.

Thanks a lot,

Rainer

>
> Dirk
>  
> | You can find the package at github:
> | 
> | https://github.com/rkrug/grassRLink
> | 
> | Any suggestions?
> | 
> | Thanks,
> | 
> | Rainer
> | 
> | -- 
> | Rainer M. Krug
> | 
> | email: RMKrug<at>gmail<dot>com
> | application/pgp-signature [Press RETURN to save to a file]
> | 
> | ----------------------------------------------------------------------
> | _______________________________________________
> | Rcpp-devel mailing list
> | Rcpp-devel at lists.r-forge.r-project.org
> | https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel
<#secure method=pgpmime mode=sign>

-- 
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, UCT), Dipl. Phys. (Germany)

Centre of Excellence for Invasion Biology
Stellenbosch University
South Africa

Tel :       +33 - (0)9 53 10 27 44
Cell:       +33 - (0)6 85 62 59 98
Fax :       +33 - (0)9 58 10 27 44

Fax (D):    +49 - (0)3 21 21 25 22 44

email:      Rainer at krugs.de

Skype:      RMkrug


More information about the Rcpp-devel mailing list