Re: [Rcpp-devel] Shared code in C++ files

2016-04-14 Thread Kyle Baron
Here is a MWE of the workflow I was describing for passing a user-d https://gist.github.com/kylebmetrum/6b31775702e1b8441a1cff669aeb0f1d I used sourceCpp() to mimic the code in an R package and used R CMD SHLIB to compile the user function. It would be great to be able to use sourceCpp() to comp

Re: [Rcpp-devel] Shared code in C++ files

2016-04-14 Thread Dirk Eddelbuettel
On 14 April 2016 at 17:28, Martin Lysy wrote: | I am very grateful for your input/recommendations.  Let me try to wrap my head | around how to do this with a single package and get your approval on an MWE. That's the spirit, and we'll try to help. I won't claim that this is _trivial_ but it is _

Re: [Rcpp-devel] Shared code in C++ files

2016-04-14 Thread Martin Lysy
Hi All, I am very grateful for your input/recommendations. Let me try to wrap my head around how to do this with a single package and get your approval on an MWE. Best regards, Martin Lysy Assistant Professor of Statistics Department of Statistics and Actuarial Science University of Waterloo

Re: [Rcpp-devel] Shared code in C++ files

2016-04-14 Thread Kyle Baron
Hi Martin - I, too, am unsure about the mechanics of what you are wanting to do. But this piece: I can think of many applications in which the useR could supply a minimal > amount of C++ code (e.g., a log-likelihood function) to hook in with a > large amount of code provided by the developer in

Re: [Rcpp-devel] Shared code in C++ files

2016-04-14 Thread Dirk Eddelbuettel
On 14 April 2016 at 11:55, JJ Allaire wrote: | I don't know enough about the mechanics of your scenario to comment | intelligently, but I would in general agree with Dirk that if there is a way to | put something like this in a package that's the way it ought to be done. You | could certainly dis

Re: [Rcpp-devel] Shared code in C++ files

2016-04-14 Thread JJ Allaire
I don't know enough about the mechanics of your scenario to comment intelligently, but I would in general agree with Dirk that if there is a way to put something like this in a package that's the way it ought to be done. You could certainly dispatch to different C++ functions within a package using

Re: [Rcpp-devel] Shared code in C++ files

2016-04-14 Thread Martin Lysy
Dear J.J., Thank you very much for the fix. I can confirm that it works on my computer. Would you or Dirk care to weigh in on the appropriate usage of Rcpp for the project I described in my previous post? I realize you are both busy, and thank you both again for the time you've taken to answer

Re: [Rcpp-devel] Shared code in C++ files

2016-04-14 Thread JJ Allaire
Happily it was an easy fix! https://github.com/RcppCore/Rcpp/commit/3c096d7ae8523222ac8e83d0e15d92af07df1abe J.J. On Thu, Apr 14, 2016 at 5:17 AM, JJ Allaire wrote: > Martin, > > The code = variation won't work on either platform (as there is no > baseline file path from which to compute the l

Re: [Rcpp-devel] Shared code in C++ files

2016-04-14 Thread JJ Allaire
Martin, The code = variation won't work on either platform (as there is no baseline file path from which to compute the location of included files). The file = variation that works on Linux should indeed work on Windows, I'll take a look and see what's going on there. J.J. On Wed, Apr 13, 2016 a