Greg Minshall
2014-Jul-13 19:13 UTC
[Rd] how to list external dependencies (i.e., non-R packages)?
hi. i'm working on a package which only works if one (or both) of two libraries (Imlib2 and MagickWand) exist on the machine on which the package is compiled and executed. as currently written, the program purposely generates an error at *compile* time if neither library is available (thinking the earlier the user is notified, the less frustrating). is there a way of specifying this dependency in, say, the DESCRIPTION file? (seems unlikely, as this is what the whole autotools/configure.ac framework is supposed to deal with.) or, should i take out the compile time error (maybe replace my #error with a #warning), and just generate at error at run time? (this will require me to figure out what that means for build tests/, but obviously some sort of hack is doable.) cheers, Greg
Kasper Daniel Hansen
2014-Jul-13 20:08 UTC
[Rd] how to list external dependencies (i.e., non-R packages)?
Several packages in Bioconductor (and possibly CRAN) uses SystemRequirements in DESCRIPTION, but unless the user reads the DESCRIPTION file, this is for naught. Still useful to some people I think. Best, Kasper On Sun, Jul 13, 2014 at 9:13 PM, Greg Minshall <minshall@acm.org> wrote:> hi. i'm working on a package which only works if one (or both) of two > libraries (Imlib2 and MagickWand) exist on the machine on which the > package is compiled and executed. as currently written, the program > purposely generates an error at *compile* time if neither library is > available (thinking the earlier the user is notified, the less > frustrating). > > is there a way of specifying this dependency in, say, the DESCRIPTION > file? (seems unlikely, as this is what the whole autotools/configure.ac > framework is supposed to deal with.) > > or, should i take out the compile time error (maybe replace my #error > with a #warning), and just generate at error at run time? (this will > require me to figure out what that means for build tests/, but obviously > some sort of hack is doable.) > > cheers, Greg > > ______________________________________________ > R-devel@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-devel >[[alternative HTML version deleted]]
Jeroen Ooms
2014-Jul-16 06:25 UTC
[Rd] how to list external dependencies (i.e., non-R packages)?
On Sun, Jul 13, 2014 at 12:13 PM, Greg Minshall <minshall at acm.org> wrote:> > is there a way of specifying this dependency in, say, the DESCRIPTION > file? (seems unlikely, as this is what the whole autotools/configure.ac > framework is supposed to deal with.)As was mentioned, the SystemRequirements field allows for this, but the format is quite informal and hence package managers cannot automatically resolve such dependencies. A few years ago [1] it was suggested on this mailing lists to extend the DESCRIPTION spec with fields that allow package authors to specify which particular deb or rpm packages are required to build the R package. However this was shot down with the argument that it is not the responsibility of the package author to determine the required build/runtime dependencies on the OS of the user. Debian/Ubuntu users can take advantage of the "debianized" packages from cran2deb [2,3,4] which, among other benefits, do have the capability to formally declare external dependencies. Such r-cran-xx and r-bioc-xx packages will automatically install build/runtime dependencies when needed (e.g. libmagickwand-dev). Due to the limitations above, this system currently relies on 3rd party volunteers (with limited resources) to maintain a database [5] of "Depends" and "Build-Depends" for all R packages. Dirk Eddelbuettel, Michael Rutter and Don Armstrong are doing a great job to keep this system going and provide binary builds of many cran/bioc packages for the various deb distributions. Creating a debianized version of your own R package is quite easy too, and solves the problem at least for your debian/ubuntu users :-) I still think it would be useful to introduce a standard field/format somewhere in the R package metadata that gives package authors the option to suggest deb/rpm/homebrew dependencies required to build/use the R package. But for now the best we can do is provide manual instructions in the SystemRequirements+readme. Jeroen [1] https://stat.ethz.ch/pipermail/r-devel/2011-February/059787.html [2] http://dirk.eddelbuettel.com/papers/useR2009cran2deb.pdf [3] http://www.personal.psu.edu/mar36/blogs/the_ubuntu_r_blog/cran2deb4ubuntu.html [4] http://debian-r.debian.net/ [5] http://debian-r.debian.net/debian-r/c2d/