[R] advice on package devel with external libs
Matt Shotwell
shotwelm at musc.edu
Mon Jun 28 23:38:23 CEST 2010
Some ideas,
1. Wrap the library as an R package, as you said, and check for the
library at configure time (i.e. with autoconf or custom script). But if
you do, it would be great to provide an R-level API so that we can all
use it. This is the strategy of the 'cairo', 'RGtk', 'rgl', and 'gsl'
packages. Also, maybe try and collaborate with the developers of the
'rjson' package to improve it.
2. If the library is appropriately licensed, and truly 'lightweight',
simply add its sources to your package. R core does this with zlib and a
few other libraries. However, this puts the burden on you to maintain
code written by others. There are several JSON parsers with very liberal
licenses (www.json.org), and some are tiny.
-Matt
On Mon, 2010-06-28 at 16:10 -0400, Murat Tasan wrote:
> hi all - i'm working on an R package that makes use of my own shared
> library written in C.
> but i also am making use of another C-written library.
> (my package is for facilitating biological namespace translations via
> online (i.e. up-to-date) biological databases.)
>
> problem is, the library i'm using is not a standard library (i.e. i
> doubt it will be installed on most users' machines).
> i also don't think too many users will be particularly adept in
> installing a shared library.
> for users with a sysadmin, it can be done easily enough, but on local
> installations i fear most will be incapable of properly installing/
> locating the library so my code can link to it during compile time.
> (in case anyone was wondering, the library in question is a
> lightweight JSON parser... yes i know there are existing R packages
> for this, but they are *very* slow for large JSON object coding/
> encoding.)
>
> how have folks dealt with this in the past with R packages?
> i've thought about wrapping the other library itself as a separate R
> package which basically does nothing on installation other than
> compile and put the libraries a predictable location... but this seems
> rather silly (and may violate the JSON parser package's license).
>
> thanks for any input on this,
>
> -murat
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
--
Matthew S. Shotwell
Graduate Student
Division of Biostatistics and Epidemiology
Medical University of South Carolina
http://biostatmatt.com
More information about the R-help
mailing list