renozao / NMF

NMF: A Flexible R package for Nonnegative Matrix Factorization
137 stars 40 forks source link

stringr version #42

Open apford opened 9 years ago

apford commented 9 years ago

Trying to install NMF I get an error about stringr versions I first tried without success to fix on R 3.1.2 (Centos, Mac and Ubuntu) but have now done a clean install on Centos of R 3.2.1 and after updating stringr get

R version 3.2.1 (2015-06-18) -- "World-Famous Astronaut"
Copyright (C) 2015 The R Foundation for Statistical Computing
Platform: x86_64-unknown-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

  Natural language support but running in an English locale

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> packageVersion('stringr')
[1] ‘1.0.0’
> library(stringr)
> install.packages("NMF")
Installing package into ‘/home/ashley/R/x86_64-unknown-linux-gnu-library/3.2’
(as ‘lib’ is unspecified)
--- Please select a CRAN mirror for use in this session ---
trying URL 'http://cran.rstudio.com/src/contrib/NMF_0.20.6.tar.gz'
Content type 'application/x-gzip' length 1764466 bytes (1.7 MB)
==================================================
downloaded 1.7 MB

* installing *source* package ‘NMF’ ...
** package ‘NMF’ successfully unpacked and MD5 sums checked
** libs
g++ -I/usr/local/lib64/R/include         -I/usr/local/include    -fpic  -O2        -c distance.cpp -o distance.o
g++ -I/usr/local/lib64/R/include         -I/usr/local/include    -fpic  -O2        -c divergence.cpp -o divergence.o
g++ -I/usr/local/lib64/R/include         -I/usr/local/include    -fpic  -O2        -c euclidean.cpp -o euclidean.o
g++ -I/usr/local/lib64/R/include         -I/usr/local/include    -fpic  -O2        -c utils.cpp -o utils.o
g++ -shared -L/usr/local/lib64/R/lib -L/usr/local/lib64 -o NMF.so distance.o divergence.o euclidean.o utils.o -L/usr/local/lib64/R/lib -lR
installing to /home/ashley/R/x86_64-unknown-linux-gnu-library/3.2/NMF/libs
** R
** data
** demo
** inst
** preparing package for lazy loading
Error in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]) : 
  namespace ‘stringr’ 0.6.2 is already loaded, but >= 1.0.0 is required
ERROR: lazy loading failed for package ‘NMF’
* removing ‘/home/ashley/R/x86_64-unknown-linux-gnu-library/3.2/NMF’

The downloaded source packages are in
    ‘/tmp/Rtmp9oK6kO/downloaded_packages’
Warning message:
In install.packages("NMF") :
  installation of package ‘NMF’ had non-zero exit status
renozao commented 9 years ago

This is weird. It looks as if the installation step loads stringr 0.6.2, although the install.package detects the correct version since it does not download the stringr dependency. Do you have stringr installed in the system library, typically in /usr/lib/R/library?

apford commented 9 years ago

No, I use the default user library /home/ashley/R/x86_64-unknown-linux-gnu-library/3.2
As on several systems, as a user I can't install to /usr I do the same on my own PC's

renozao commented 9 years ago

I can't reproduce the error on my side. Maybe try with R --vanilla and without loading stringr in the same session (although I believe the installation is performed by a separate R process)?

apford commented 9 years ago

Same result with R --vanilla and with R CMD INSTALL /home/ashley/Downloads/NMF_0.20.6.tar.gz

installing as root works OK so I now have a working version on this system, (but not some others) I don't know how to debug the R install process, either R CMD INSTALL or the sub process from install.packges()

apford commented 9 years ago

Same result with R --vanilla and with R CMD INSTALL /home/ashley/Downloads/NMF_0.20.6.tar.gz

installing as root works OK so I now have a working version on this system, (but not some others) I don't know how to debug the R install process, either R CMD INSTALL or the sub process from install.packges()

apford commented 9 years ago

I now have a workaround (which makes no sense to me) I have user library v1.0.0 then system library v0.6.2

> packageVersion('stringr', .libPaths()[1])
[1] ‘1.0.0’
> packageVersion('stringr', .libPaths()[2])
[1] ‘0.6.2’

this then works

 wget http://cran.uk.r-project.org/src/contrib/NMF_0.20.6.tar.gz
tar zxvf  NMF_0.20.6.tar.gz

edit NMF/DESCRIPTION to remove the version dependency

diff NMF/DESCRIPTION.orig NMF/DESCRIPTION
23c23
< Imports: graphics, stats, stringr (>= 1.0.0), digest, grid, grDevices,
> Imports: graphics, stats, stringr, digest, grid, grDevices,

R CMD INSTALL -d NMF

all works fine and it doesn't do namespace ‘stringr’ 0.6.2 is already loaded,

renozao commented 9 years ago

This is what I thought: 2 versions, one in system lib, another in the user lib. That might be due to an early loading of stringr by dependent packages. Will try to investigate with such settings.

You may want to simply remove stringr from the system lib. I believe this should solve the plain installation problem.

@gaborcsardi : looks like this a solved problem.