[Rcpp-devel] Makevars portability

Jeff Newmiller jdnewmil at dcn.davis.ca.us
Sun Mar 4 00:11:55 CET 2018


Thanks for the prompt reply, and the slick package.  Indeed, it appears to be unnecessary. I must have created it in an attempt to fix another problem and lost track of that. 
-- 
Sent from my phone. Please excuse my brevity.

On March 3, 2018 9:52:57 AM PST, Dirk Eddelbuettel <edd at debian.org> wrote:
>
>On 3 March 2018 at 09:32, Jeff Newmiller wrote:
>| I have an existing legacy.c file with legacy.h interface that I am
>putting into a package. I figured out how to create an rcpp glue file
>that uses an extern "C" block to include the .h file so my C++ function
>can call it.
>| 
>| However, it looks like Rcpp is defining the OBJECTS variable before I
>put legacy.o in, so I have had to use
>| 
>| OBJECTS += legacy.o
>| 
>| in the Makevars file so it will compile and link the legacy code in
>along with the object files setup by Rcpp,  but R CMD check complains
>about portability.
>| 
>| Is there a way to do this that does not irritate R CMD check?
>
>In the simplest cases you need _nothing_ in src/Makevars. Just drop
>files
>src/legacy.{c,h} and, say, src/legacyWrapper.cpp in src/, and
>everything
>should work.
>
>That is what the skeleton package does.  (For RcppArmadillo we need to
>link
>to BLAS/LAPACK/Fortran/... but not here.)
>
>So if you check existing packages (easy to browse on GitHub too) you
>should
>notice that very few, possibly none, set OBJECTS.  None of mine do,
>methinks.
>
>Dirk


More information about the Rcpp-devel mailing list