[Rcpp-devel] sourceCpp and #include .hpp ?

Dirk Eddelbuettel edd at debian.org
Tue Aug 20 01:54:23 CEST 2013


On 19 August 2013 at 11:51, Kevin Ushey wrote:
| If you run sourceCpp(..., verbose=TRUE), you'll see that the source code is
| copied into a temporary directory, and then the working directory is reset to
| that directory. So the header file is no longer discovered there. (not to

Correct.  [ A colleague was just bitten / frustrated by that today. ]

| mention, you would have to tell sourceCpp where to find those function
| definitions that have been included as well... building a package does that
| behind the scenes for you)
| 
| I think you should stay with recompiling the package, rather than switching to
| sourceCpp, when debugging a package.

You can also use a standard -I/some/path/... switch --- but for the reason
Kevin explained so nicely (ie R building in a temp. dir) you cannot just say
"use my local dir" via -I. but have to be explicit: -I/home/tal/some/dirk or,
if you must -IC:/some/win/doze/path.

Longer-term, a package is your friend. And hey, you already have one :)

Dirk

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


More information about the Rcpp-devel mailing list