I've been hunting round for the accepted method of bundling system dependencies into binary packages. For example, there are some CRAN packages (e.g. gmp, RcppArmadillo, ...) which don't require the system dependencies be installed for the Windows and Mac binary builds. I understand that there are a very limited number of packages for which CRAN would do this, so as a first step I'm *not* asking how to get this on CRAN, but rather this highlights there must be a (fairly automated/easy) mechanism to achieve this. Is it as simple as statically linking? If so there's surely an automated way to trigger this without having to modify Makevars to produce the static linked packages? The Writing R Extensions manual section on binary packages doesn't mention this and I've tried extensive Googling without joy. So in a nut shell, I'm looking to bundle a binary version of GMP (https://gmplib.org) and FLINT (http://flintlib.org) into my package for Windows/Mac users who can't/won't compile the libraries and which I can distribute independently of CRAN, but without having to do so in a manual/hacky way by tweaking Makevars each time, or modifying the tgz/zip produced by R. Hope I've been clear enough there. Any pointers much appreciated, Louis
Dirk Eddelbuettel
2014-Dec-02 20:20 UTC
[Rd] Bundling system dependencies in binary packages
On 2 December 2014 at 18:34, Louis Aslett wrote: | I've been hunting round for the accepted method of bundling system | dependencies into binary packages. | | For example, there are some CRAN packages (e.g. gmp, RcppArmadillo, | ...) which don't require the system dependencies be installed for the | Windows and Mac binary builds. I understand that there are a very | limited number of packages for which CRAN would do this, so as a first | step I'm *not* asking how to get this on CRAN, but rather this | highlights there must be a (fairly automated/easy) mechanism to | achieve this. Is it as simple as statically linking? If so there's | surely an automated way to trigger this without having to modify | Makevars to produce the static linked packages? | | The Writing R Extensions manual section on binary packages doesn't | mention this and I've tried extensive Googling without joy. | | So in a nut shell, I'm looking to bundle a binary version of GMP | (https://gmplib.org) and FLINT (http://flintlib.org) into my package | for Windows/Mac users who can't/won't compile the libraries and which | I can distribute independently of CRAN, but without having to do so in | a manual/hacky way by tweaking Makevars each time, or modifying the | tgz/zip produced by R. | | Hope I've been clear enough there. | | Any pointers much appreciated, I am not certain I fully understand what you are asking, but here is one optmistic interpretation. Sometimes you need a binary library present on the system. In some of these cases, we help CRAN by providing pre-built libraries -- with instructions which make it reproducible, eg Makefiles. Sometimes CRAN even helps, ie the last time we needed a QuantLib update Prof Ripley kindly built one via the crosscompiler set up on one of his machines. Per CRAN Policies, these libraries need to be Open Source, and be buildable from sources. The sources, and zipfiles, are generally somewhere on the Oxford archive; pointers are in the appendix of either / both of Writing R Extensions and R Installation and Administration. Eg look at http://www.stats.ox.ac.uk/pub/Rtools/goodies/ Hope this helps, Dirk -- http://dirk.eddelbuettel.com | @eddelbuettel | edd at debian.org
Prof Brian Ripley
2014-Dec-03 06:40 UTC
[Rd] Bundling system dependencies in binary packages
On 02/12/2014 18:34, Louis Aslett wrote:> I've been hunting round for the accepted method of bundling system > dependencies into binary packages. > > For example, there are some CRAN packages (e.g. gmp, RcppArmadillo, > ...) which don't require the system dependencies be installed for the > Windows and Mac binary builds. I understand that there are a very > limited number of packages for which CRAN would do this, so as a first > step I'm *not* asking how to get this on CRAN, but rather this > highlights there must be a (fairly automated/easy) mechanism to > achieve this. Is it as simple as statically linking? If so there'sWell, packages using just C++ headers (RcppArmadillo is one) do not have libraries to link to. But as far as possible the Windows and OS X binary packages are statically linked. What is available to CRAN package builds is at http://www.stats.ox.ac.uk/pub/Rtools/libs.html http://r.research.att.com/libs/ (and includes gmp).> surely an automated way to trigger this without having to modify > Makevars to produce the static linked packages? > > The Writing R Extensions manual section on binary packages doesn't > mention this and I've tried extensive Googling without joy.Nothing special is needed: the linkers use static linking if there is no dynamic library available. So the external software is built with configure options --enable-static --disable-shared . On OS X it also has to be built with PIC flags (not the default for static libraries).> So in a nut shell, I'm looking to bundle a binary version of GMP > (https://gmplib.org) and FLINT (http://flintlib.org) into my package > for Windows/Mac users who can't/won't compile the libraries and which > I can distribute independently of CRAN, but without having to do so in > a manual/hacky way by tweaking Makevars each time, or modifying the > tgz/zip produced by R.There are a few exceptions where dynamic linking is used on Windows, and the configure scripts are used to install DLLs into the libs directory. (RCurl is one, currently.) The main reason for not doing so is naming conflicts for DLLs on Windows. For example, if you were to have a gmp.dll and so did package gmp, the first loaded would win, even though they might be different versions (and this was common for zlib1.dll).> > Hope I've been clear enough there. > > Any pointers much appreciated, > > Louis > > ______________________________________________ > R-devel at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-devel >-- Brian D. Ripley, ripley at stats.ox.ac.uk Emeritus Professor of Applied Statistics, University of Oxford 1 South Parks Road, Oxford OX1 3TG, UK
Maybe Matching Threads
- Bundling system dependencies in binary packages
- error al instalar paquete
- How to install gmp in R on fedora
- Installing package fails at "testing if installed package can be loaded from temporary location"
- Installing package fails at "testing if installed package can be loaded from temporary location"