[Rd] Is it possible to make install.packages compile source code on Unix but use shipped binary on Windows?

Renaud Gaujoux renaud at mancala.cbio.uct.ac.za
Wed Jun 18 10:11:44 CEST 2014

Thank you for the replies and hints.

> A 'pre-built windows binary' of what?

Sorry this was not clear, src/ contains source code for a binary
executable, which produces no .lib or .dll.
It is all fine in a R development environment:
  * On Linux, the executable is compiled and copied to
R_PACKAGE_DIR/binR_ARCH using a custom install.libs.R script.
  * Same thing on Windows, if Rtools is installed, install.packages
compiles and installs both 32 and 64 bits .exe.

> You can easily ship a DLL or .exe for use on Windows: just make use of
> configure.win and/or Makefile.win.  If you have a Makefile.win it will
> override the normal procedures for directory src.

I have tried using Makevars.win, but this requires make to be
installed (as by Rtools). So I guess using Makefile.win would also not
work, on a classic non-development geared Windows host.
Would using configure.win work without Rtools?

> OTOH, shipping something in exec will be installed everwhere.

True, although it seems that sub-directories of exec/ are actually not
installed though. Is this intentional?

> Watch out for sub-architectures: 'Windows' is in fact two platforms.  We
> have over the years seen a lot of problem with people shipping 64-bit
> Windows binaries: 32-bit Windows does not recognize those.

Indeed, and I think I properly take care of this in install.libs.R.

@Grabriel: the package is provided as a source package. This one is
installable locally from file, although in may case users actually get
it through a personal CRAN-like repository, using argument

Thank you.


More information about the R-devel mailing list