Re: [Rd] Package with multiple shared libraries

From: Prof Brian Ripley <>
Date: Mon, 15 Nov 2010 11:02:02 +0000 (GMT)

R CMD INSTALL is R code, and you can read it for yourself rather than asking other people to do so for you. If you look in tools:::.install.packages you will see

         shlib_install <- function(instdir, arch)
             files <- Sys.glob(paste0("*", SHLIB_EXT))
             if (length(files)) {

so it does in general install all the *.so or *.dll's generated. I am not aware of a package that does so for more than one, though.

On Mon, 15 Nov 2010, Andreas Borg wrote:

> Dear R-devel members,
> I would like to compile a package with two seperate shared libraries. For
> example, in a package 'foo', a file '' built from a distinct set of
> source files should be installed in addition to the default '' (or .dll
> on windows). Does anyone know about a way to achieve this without having a
> custom Makefile, e.g. via 'Makevars'?
> Also, I'd be thankful for information on existing packages which make use of
> this or a similar customization.
> Just in case anyone is interested in details: I have some C-code which is not
> intended to be loaded into R but into a SQLite database to which I connect
> via RSQLite. I would like to have these object in a seperate library.

In which case it seems that the library should not be in the package's libs directory, which is intended for DSO/DLLs to be loaded into R.

If you want to do this in a public package you need to remember that multiple architectures are used on Mac OS and Windows.

> Thanks and kind regards,
> Andreas
> --
> Andreas Borg
> Medizinische Informatik
> der Johannes Gutenberg-Universität
> Institut für Medizinische Biometrie, Epidemiologie und Informatik
> Obere Zahlbacher Straße 69, 55131 Mainz
> Telefon +49 (0) 6131 175062
> E-Mail:

Brian D. Ripley,        
Professor of Applied Statistics,
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

______________________________________________ mailing list

Received on Mon 15 Nov 2010 - 11:20:41 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Tue 16 Nov 2010 - 09:10:21 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.

list of date sections of archive