Matthias Burger
2004-Aug-04 11:17 UTC
[R] installing package with version number using namespaces & dynamic library
Hi, I wonder whether a package with namespace & dynamic library can be installed with the version number attached, ie. with the argument --with-package-versions. Is this currently possible? Using R 1.9.1 on Debian 3.0 I encounter a problem when trying to load a package installed with R91 CMD INSTALL --with-package-versions -l /mnt/local/R/R-1.9.x-libs-EpiR RIO in R started with R91 --vanilla > .libPaths() [1] "/mnt/local/R/R-1.9.x-libs" "/mnt/local/R/R-1.9.x-libs-BioC" [3] "/mnt/local/R/R-1.9.x-libs-EpiR" "/mnt/local/R/R-1.9.1/lib/R/library" either > library("RIO") Error in library.dynam(pkg, pkg, lib) : shared library 'RIO_1.4.0' not found Error: .onLoad failed in loadNamespace Error in library("RIO") : package/namespace load failed or > library("RIO_1.4.0") Error in library.dynam(pkg, pkg, lib) : shared library 'RIO_1.4.0' not found Error: .onLoad failed in loadNamespace Error in library("RIO_1.4.0") : package/namespace load failed fail. Without the '--with-package-versions' option the installed package loads without problem with the call library("RIO") file Namesapce defines (amoung other directives): useDynLib(RIO) I also tryed useDynLib("RIO_1.4.0") to no avail. But RIO/libs contains the file RIO.so anyway. I checked in 'Writing R Extensions" section 'Package name spaces' but did not find an answer. Any hints? Regards, Matthias -- Matthias Burger Project Manager/ Biostatistician Epigenomics AG Kleine Praesidentenstr. 1 10178 Berlin, Germany phone:+49-30-24345-371 fax:+49-30-24345-555 http://www.epigenomics.com matthias.burger at epigenomics.com
Prof Brian Ripley
2004-Aug-04 12:40 UTC
[R] installing package with version number using namespaces & dynamic library
On Wed, 4 Aug 2004, Matthias Burger wrote:> I wonder whether a package with namespace & dynamic library can be installed > with the version number attached, ie. with the argument --with-package-versions. > Is this currently possible?I've just successfully done this with package tree, so yes. gannet% R CMD INSTALL --with-package-versions tree_1.0-16.tar.gz gannet% R ...> library(tree) > library(tree, version="1.0-16")both work. The crucial piece of code in namespace loading is # load any dynamic libraries for (lib in nsInfo$dynlibs) library.dynam(lib, package, package.lib) which is *not* the call to library.dynam you quote. I think you have a call to library.dynam in your .onLoad, rather than/as well as using the useDynLib directive. .onLoad *is* run with the versioned package name as its `pkgname' argument, and we should document that.> Using R 1.9.1 on Debian 3.0 I encounter a problem when trying to load a package > installed with > > R91 CMD INSTALL --with-package-versions -l /mnt/local/R/R-1.9.x-libs-EpiR RIO > > in R started with > R91 --vanilla > > > .libPaths() > [1] "/mnt/local/R/R-1.9.x-libs" "/mnt/local/R/R-1.9.x-libs-BioC" > [3] "/mnt/local/R/R-1.9.x-libs-EpiR" "/mnt/local/R/R-1.9.1/lib/R/library" > > either > > library("RIO") > Error in library.dynam(pkg, pkg, lib) : shared library 'RIO_1.4.0' not found > Error: .onLoad failed in loadNamespace > Error in library("RIO") : package/namespace load failed > or > > library("RIO_1.4.0") > Error in library.dynam(pkg, pkg, lib) : shared library 'RIO_1.4.0' not found > Error: .onLoad failed in loadNamespace > Error in library("RIO_1.4.0") : package/namespace load failed > > fail. > > Without the '--with-package-versions' option the installed package loads without > problem with the call > library("RIO") > > > file Namesapce defines (amoung other directives): > > useDynLib(RIO) > > I also tryed > useDynLib("RIO_1.4.0") > to no avail. But RIO/libs contains the file RIO.so anyway.[As it should.]> I checked in 'Writing R Extensions" section 'Package name spaces' but did not > find an answer.-- 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
Reasonably Related Threads
- R 2.0.0: namespaces, S4 classes & versioned package installation: failure to resolve correct pkg version
- R 2.0.0: problem: installing --with-package-versions
- R (2.9.0 rc) CMD INSTALL will leave OOLOCK folder even if installation succeeded
- Changing Column names in (Output) csv file
- R 2.9.0 devel: package installation with configure-args option