[Rd] multiple packages using the same native code.

James Bullard bullard at berkeley.edu
Thu Mar 16 00:58:04 CET 2006


This might fall under the purview of bundles, but I could not find any 
example bundles which demonstrated what I am after.

I would like to construct two packages (A, B) which utilize a number of 
common C functions. The most straightforward way to do this is just copy 
the relevant .c and .h files from one src directory to the next, but 
this is tedious especially in the face of multiple developers and changes.

If I declare in the depends field that package A needs to be present in 
order to install package B this only enforces that package A has been 
installed correct? Is there a way to check whether the src of a package 
is available and to be able to compile against it (the source of a 
package does not seem to be installed by default so this might, in 
general, be impossible)? Linking against installed packages seems to be 
easier in the sense that I know that if a package is installed that uses 
native code the .so is available, but is there a makevars variable which 
I can use to tell R to add to its linking command upon R CMD INSTALL?

Does anyone have examples of configure scripts which are doing this by 
hand? I could see this as being a relatively painless addition for 
linking by mapping any dependency specified in the depends field (in 
DESCRIPTION) to additional dependencies in the list of directories to 
link against, but in terms of compiling I don't see an obvious solution 
besides writing it myself in the configure, but then it might make it 
much harder for the user to install.

Sorry if this is in the help manual - I have looked at places where I 
thought it might naturally be, but did not see anything.

Thanks in advance, jim



More information about the R-devel mailing list