[Rcpp-devel] Rcpp package building

Dirk Eddelbuettel edd at debian.org
Thu Nov 19 17:51:26 CET 2015

On 19 November 2015 at 17:02, Hmamouche Youssef wrote:
| For example, I have installed my package on Mac using  R CMD install 'package',
| so I had already C/C++ compiler, it works well. Then I generate the tar.gz 

(To be pedantic: because your as your sysadmin installed the tools required
for this to work on OS X.  Other operating systems have similar needs, sadly.)

| package using  R CMD build ‘package'.
| But, when I try to install the tar.gz package on other machines (Mac Or Windows
| in my case), I must have a C/C++ compiler..

On Windows, you can also use win-builder to prepare a package. On either the
Mac or Windows you can also do it locally.

Then look into drat (eg at http://dirk.eddelbuettel.com/code/drat.html) to
see how super-easily you can set up and host a 'R repository' (ie like CRAN)
at GitHub (or if you prefer, locally). We use both at work to supply some
'public but not on CRAN' as well as local/non-public packages.  Note that you
still need to build the binary packages---but with drat it becomes
install.packages() as usual.
| The point is that i like to install it without C/C++ compiler on the other
| machines.

I understand that.  But it is not the Rcpp team's fault that Windoze ships
without a compiler (or that R does not include Rtools).  It is what is it,
and (literally) tens of thousands of developers have learned to cope within
these constraints.

| Following the ancient discussions of this email,  I have to generate the binary
| package using:     R CMD INSTALL --build ‘package', rather than R CMD
| build ‘package’.

Yes. I think years ago R CMD build had an option for that too.

| So in my case, there is a difference between R CMD INSTALL —build and R CMD
| build when generating a binary package.

Yes.  I believe this is all documented in either Writing R Packages, or R
Installation and Administration, and both came with your R installation.

Good to know you have it all working, so we can close this now.


http://dirk.eddelbuettel.com | @eddelbuettel | edd at debian.org

More information about the Rcpp-devel mailing list