From renaud at mancala.cbio.uct.ac.za  Wed Jun 18 10:11:44 2014
From: renaud at mancala.cbio.uct.ac.za (Renaud Gaujoux)
Date: Wed, 18 Jun 2014 10:11:44 +0200
Subject: [Rd] Is it possible to make install.packages compile source
 code on Unix but use shipped binary on Windows?
In-Reply-To: <539B21CD.6090704@stats.ox.ac.uk>
References: <CAHavPHE1WW4JV735EQsGMdv_-wLY8_AnfAGqzCq=k96_D-wgYw@mail.gmail.com>
	<539B21CD.6090704@stats.ox.ac.uk>
Message-ID: <CAHavPHHH8TjtpVbbrGBc+ZtTHo4HoXsUswrRcb=9bJv76w2GYQ@mail.gmail.com>

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
type='both'.

Thank you.

Bests,
Renaud



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