Re: [Rd] Package with multiple shared libraries

From: Prof Brian Ripley <ripley_at_stats.ox.ac.uk>
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 'bar.so' built from a distinct set of
> source files should be installed in addition to the default 'foo.so' (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
>
> UNIVERSITÄTSMEDIZIN
> der Johannes Gutenberg-Universität
> Institut für Medizinische Biometrie, Epidemiologie und Informatik
> Obere Zahlbacher Straße 69, 55131 Mainz
> www.imbei.uni-mainz.de
>
> Telefon +49 (0) 6131 175062
> E-Mail: borg_at_imbei.uni-mainz.de

-- 
Brian D. Ripley,                  ripley_at_stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595


______________________________________________ R-devel_at_r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel

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 https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.

list of date sections of archive