R CMD INSTALL on RcppArmadillo source package inhibits installing on other platforms

49 views Asked by At

Running R CMD INSTALL on an RcppArmadillo source package skeleton (RcppArmadillo.package.skeleton()) on Ubuntu compiles the C++ files and supposedly does nothing else, as checked via Git diffing. However, removing the C++ binaries and copying the exact same package directory to a Windows 10 system and running R CMD INSTALL fails the Windows installation chain (with a generic error). Creating a completely new skeleton on Windows however works as expected.

What does R CMD INSTALL do beyond compiling the source files that makes the source package subsequently unusable for installation on different architectures?

To clarify, I've found a solution in running R CMD build on either platform to generate a tarball and R CMD INSTALL on the specific platform. However, I'm very much interested in the workings of R CMD INSTALL on source packages, as there seem to be changes made that are not directly obvious.

1

There are 1 answers

0
Dirk is no longer here On

As note in the comment above, the standard way of installing is to run

 R CMD build .               # if in the source directory
 R CMD build RcppArmadillo   # if above it

and then use the generated file RcppArmadillo_*.tar.gz in

 R CMD INSTALL RcppArmadillo_*.tar.gz

which works on all supported platforms, and always starts from freshly prepared sources.

This approach is general, specified by R itself, and independent of RcppArmadillo so there was no bug.