[Rcpp-devel] Add include path to sourceCpp

Tim Keitt tkeitt at utexas.edu
Sat Feb 4 18:58:54 CET 2017


Thanks.

Here's what I came up with:

Sys.setenv(R_TESTS = "")

wd = getwd()
wd = sub(".tests.testthat$", "", wd)
ipath1 = file.path(wd, "inst", "include")
ipath2 = file.path(wd, "include")
Sys.setenv(PKG_CXXFLAGS = paste(paste0("-I", ipath1), paste0("-I", ipath2)))

That works sometimes, but not always. It seems to pass R CMD check
--as-cran (still need to run on devel release), so that's what I needed.
But oddly it fails on apveyor and travis.ci. As far as I can tell, you
cannot have any confidence in the current working directory using testthat
in different environments.

THK


http://www.keittlab.org/

On Wed, Feb 1, 2017 at 1:13 PM, Dirk Eddelbuettel <edd at debian.org> wrote:

>
> On 1 February 2017 at 13:01, Tim Keitt wrote:
> | Is there a way to add an additional include path when calling sourceCpp?
> I am
> | trying to get it to find "inst/include" in my package because I am
> calling
> | sourceCpp during testing with testthat.
>
> Sys.setenv() on the variables make and everything it calls.
>
> Dirk
>
> --
> http://dirk.eddelbuettel.com | @eddelbuettel | edd at debian.org
> _______________________________________________
> 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/rcpp-devel/attachments/20170204/f159b8e4/attachment.html>


More information about the Rcpp-devel mailing list