[Rcpp-devel] Upload library with object files

Iñaki Ucar iucar at fedoraproject.org
Wed Feb 20 09:48:24 CET 2019


On Wed, 20 Feb 2019 at 09:33, Sergio Bra <sergio.bra88 at gmail.com> wrote:
>
> Hi community,
>
> In the near future I'll be trying to publish a package in the CRAN and after reading "Writing R extensions" I have some doubts.
>
> I have some c++ functions, available from the R-side with Rcpp. These c++ functions have calls to some C packages. In the src directory I have the source code of these C libraries, and a directory with the .o files of the .c files, and informed in the PKG_LIBS variable. I've included the compiled files for different platforms: ubuntu x32, x64, and windows x32, x64 (I'll probably include support for OSX) and in the Makevars I select the .o files to use depending on the OS and arch.
>
> If I execute the R CMD check command, I have no errors but some warnings like "Object files/libraries should not be included in a source package". The message and the documentation just recommend not to use them but doesn't say that it is forbidden.

It's a recommendation because there may be unavoidable exceptions. But
in general, take it as a "must".

> Can I have problems if I try to attemp the upload of the library in this circumstance?

In short, yes, don't do that. And anyway, what's the point if you have
the source code of these libraries? Just provide it with the proper
setup to compile them during package installation. There are plenty of
examples on CRAN of packages bundling third-party libraries.

Iñaki


More information about the Rcpp-devel mailing list