Skip to content
Prev 8461 / 10988 Next

[Rcpp-devel] Linking to c++ files in a package without Rcpp overhead for faster computation

Hi, John,

Making your code header-only is your best choice and it will make
everything easier.

If header-only is impossible, this can happen, there is one trick you may
want to try.

As I remember the early version of Rcpp, maybe before 0.9, it builds a
libRcpp.so when installing Rcpp.

You can also do this by adding several lines in Makevars [1] and write
helper functions to help system find the shared library you want to link to
[2].

But I don't think this is good practice for Rcpp developing.

Best wishes,

KK

[1] https://github.com/thirdwing/RcppMLPACK/blob/master/src/Makevars#L44-L61

[2] https://github.com/thirdwing/RcppMLPACK/blob/master/R/flags.R
On Fri, Mar 6, 2015 at 5:03 PM, John Tipton <jtipton25 at gmail.com> wrote: