Bug 15141 - Installation of dependencies fails when R_LIBS differs from libpaths
Summary: Installation of dependencies fails when R_LIBS differs from libpaths
Status: NEW
Alias: None
Product: R
Classification: Unclassified
Component: Installation (show other bugs)
Version: R 2.15.2
Hardware: x86_64/x64/amd64 (64-bit) Linux-Ubuntu
: P5 normal
Assignee: R-core
URL:
Depends on:
Blocks:
 
Reported: 2012-12-16 19:18 UTC by Winston Chang
Modified: 2015-12-24 14:00 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Winston Chang 2012-12-16 19:18:33 UTC
From: http://r.789695.n4.nabble.com/install-packages-fails-if-libPaths-set-tp4647797p4647954.html



Reproducible example:
1. Create directory ~/rlibtest
    mkdir ~/rlibtest
2. Create ~/.Renviron with the contents "R_LIB=~/rlibtest"
    echo "R_LIBS=~/rlibtest" > .Renviron
3. Start R and run the following code:
    dir.create("test") 
    .libPaths("test") 
    install.packages("relations", type = "source") 

Installing the 'relations' package should also install the dependencies 'sets' and 'slam'. But the result here is that only 'sets' is installed into ~/test. I believe this is because relations depends on sets, but the installation of relations has the wrong libpaths and so it can't find sets. (Output is included below)

If you remove the .Renviron file and run the same code, installation works fine.

I think this problem happens when:
- R_LIBS is set
- The current value of R_LIBS is not in .libPaths()



===================================================
Output from running the installation with .Renviron file present
===================================================

>     dir.create("test") 
>     .libPaths("test") 
>     install.packages("relations", type = "source") 
Installing package(s) into ‘/home/ubuntu/test’
(as ‘lib’ is unspecified)
also installing the dependencies ‘sets’, ‘slam’

trying URL 'http://cran.rstudio.com/src/contrib/sets_1.0-12.tar.gz'
Content type 'application/x-gzip' length 488837 bytes (477 Kb)
opened URL
==================================================
downloaded 477 Kb

trying URL 'http://cran.rstudio.com/src/contrib/slam_0.1-26.tar.gz'
Content type 'application/x-gzip' length 39506 bytes (38 Kb)
opened URL
==================================================
downloaded 38 Kb

trying URL 'http://cran.rstudio.com/src/contrib/relations_0.6.tar.gz'
Content type 'application/x-gzip' length 493292 bytes (481 Kb)
opened URL
==================================================
downloaded 481 Kb

* installing *source* package ‘sets’ ...
** package ‘sets’ successfully unpacked and MD5 sums checked
** libs
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG      -fpic  -O3 -pipe  -g  -c closure.c -o closure.o
gcc -std=gnu99 -shared -o sets.so closure.o -L/usr/lib/R/lib -lR
installing to /home/ubuntu/test/sets/libs
** R
** data
** inst
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
   ‘sets.Rnw’ 
** testing if installed package can be loaded

* DONE (sets)
* installing *source* package ‘slam’ ...
** package ‘slam’ successfully unpacked and MD5 sums checked
** libs
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG      -fpic  -O3 -pipe  -g  -c grouped.c -o grouped.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG      -fpic  -O3 -pipe  -g  -c sparse.c -o sparse.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG      -fpic  -O3 -pipe  -g  -c util.c -o util.o
gcc -std=gnu99 -shared -o slam.so grouped.o sparse.o util.o -lblas -lgfortran -lm -lquadmath -L/usr/lib/R/lib -lR
installing to /home/ubuntu/test/slam/libs
** R
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded

* DONE (slam)
* installing *source* package ‘relations’ ...
** package ‘relations’ successfully unpacked and MD5 sums checked
** R
** data
**  moving datasets to lazyload DB
** inst
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
   ‘relations.Rnw’ 
** testing if installed package can be loaded
Error : package ‘sets’ required by ‘relations’ could not be found
Error: loading failed
Execution halted
ERROR: loading failed
* removing ‘/home/ubuntu/test/relations’

The downloaded source packages are in
        ‘/mnt/tmp/Rtmp60g9Qf/downloaded_packages’
Warning message:
In install.packages("relations", type = "source") :
  installation of package ‘relations’ had non-zero exit status
Comment 1 Winston Chang 2012-12-16 19:19:21 UTC
This problem happens on Linux (Ubuntu 12.04) and Mac OS (10.8) for me.
Comment 2 Sander Maijers 2015-12-24 14:00:16 UTC
What is the status of this bug now?