[Rcpp-devel] Multiple definition problem with RcppArmadillo:sample() function during package compilation

Subodh Acharya shoebodh at gmail.com
Sat Aug 24 21:42:35 CEST 2013


Thank for the responses.

Subodh


On Sat, Aug 24, 2013 at 1:32 PM, Dirk Eddelbuettel <edd at debian.org> wrote:

>
> On 24 August 2013 at 09:04, romain at r-enthusiasts.com wrote:
> | This is now fixed in svn.
> | The file did not have include guards and it was defining functions that
> | were too long to be inlined.
>
> Thanks!
>
> | Since I don't want the user to have to link against an RcppArmadillo
> | library (like we do in Rcpp), I made these functions (SampleReplace, etc
> | ...) templates.
> | This should allow people to include this file more than once.
> |
> | The alternative would be to only have declarations of the
> | SampleReplace, etc ... functions in sample.h and definitions in a .cpp
> | file in RcppArmadillo, but then we would need users to mess with their
> | PKG_LIBS, and we would need to store a library we can link against. This
> | is already a lot of trouble to do this with Rcpp, so I'm not doing that
> | for RcppArmadillo.
>
> Nobody suggested that. RcppArmadillo is, and should remain for the
> forseeable
> future, a templates-based headers-only library.
>
> | The other alternative is to not host sample in RcppArmadillo but in
> | another package. I don't have strong opinion on this, but sample is
> | somewhat of an outlier in RcppArmadillo. RcppArmadillo is just supposed
> | to make armadillo available. sample is an example use case.
>
> Which is why it is off to the side and not included by default. I think
> that
> is a reasonably setup.
>
> A package of its own is possibly, but a tad on the heavy side for a single
> header file of a few dozen lines.  Other suggestions are surely welcome.
>
> Dirk
>
> --
> Dirk Eddelbuettel | edd at debian.org | http://dirk.eddelbuettel.com
> _______________________________________________
> 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
>



-- 
Acharya, Subodh
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/rcpp-devel/attachments/20130824/31db1f66/attachment.html>


More information about the Rcpp-devel mailing list