From winstonchang1 at gmail.com  Wed Oct 31 01:12:22 2012
From: winstonchang1 at gmail.com (Winston Chang)
Date: Tue, 30 Oct 2012 19:12:22 -0500
Subject: [Rd] install.packages() fails if .libPaths() set
In-Reply-To: <CABdHhvHx_-Frk9vcrvmMp1Hx053ygGVYDgdiUyXMQABgrdpQqw@mail.gmail.com>
References: <CABdHhvHhi_paqqK1wUhqcg0KqOeh2YTHX-FszNHwhFYbZfb5wg@mail.gmail.com>
	<508FDC6A.30502@statistik.tu-dortmund.de>
	<CABdHhvGB+-Hx1a_K6g7YnEYvNTP1DhgAGtPNfErP0ZtueJo9Hw@mail.gmail.com>
	<508FDE3E.7060501@statistik.tu-dortmund.de>
	<CABdHhvHx_-Frk9vcrvmMp1Hx053ygGVYDgdiUyXMQABgrdpQqw@mail.gmail.com>
Message-ID: <CAFOpNVHEaFdXrFTFDZAiVoB57+NJdULtvsC-V4ytytfrZOAP1A@mail.gmail.com>

It appears that this problem only happens when R_LIBS is specified in
~/.Renviron. When it compiles 'relations', it's somehow not passing
along the correct lib paths.


This is the test code:
dir.create("test")
.libPaths("test")
install.packages("relations", type = "source")


The 'relations' package depends on 'sets' and 'slam'. When there is no
~/.Renviron file it works: all three packages get installed into
test/.


The story is different when there is an file ~/.Renviron with the contents:
R_LIBS=~/R

(And the ~/R directory exists, of course.)

It manages to install 'sets' and 'slam' into test/, but it fails to
install 'relations'. I've added the output to the bottom of this
email.

I test this with  R 2.15.1 and R 2.15.2 on Windows XP, and R 2.15.1 on
Mac OS X 10.7.5. In all cases, I get the same result.


Here's the output when there _is_ an .Renviron file:

> install.packages("relations", type = "source")
Installing package(s) into ?C:/Documents and Settings/user/My Documents/test?
(as ?lib? is unspecified)
also installing the dependencies ?sets?, ?slam?

trying URL 'http://cran.rstudio.com/src/contrib/sets_1.0-11.tar.gz'
Content type 'application/x-gzip' length 283388 bytes (276 Kb)
opened URL
downloaded 276 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
cygwin warning:
  MS-DOS style path detected: C:/R/R-215~1.1/etc/i386/Makeconf
  Preferred POSIX equivalent is: /cygdrive/c/R/R-215~1.1/etc/i386/Makeconf
  CYGWIN environment variable option "nodosfilewarning" turns off this warning.
  Consult the user's guide for more details about POSIX paths:
    http://cygwin.com/cygwin-ug-net/using.html#using-pathnames
gcc  -I"C:/R/R-215~1.1/include" -DNDEBUG          -O3 -Wall
-std=gnu99 -mtune=core2 -c closure.c -o closure.o
gcc -shared -s -static-libgcc -o sets.dll tmp.def closure.o
-LC:/R/R-215~1.1/bin/i386 -lR
installing to C:/Documents and Settings/user/My Documents/test/sets/libs/i386
** 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
cygwin warning:
  MS-DOS style path detected: C:/R/R-215~1.1/etc/i386/Makeconf
  Preferred POSIX equivalent is: /cygdrive/c/R/R-215~1.1/etc/i386/Makeconf
  CYGWIN environment variable option "nodosfilewarning" turns off this warning.
  Consult the user's guide for more details about POSIX paths:
    http://cygwin.com/cygwin-ug-net/using.html#using-pathnames
gcc  -I"C:/R/R-215~1.1/include" -DNDEBUG          -O3 -Wall
-std=gnu99 -mtune=core2 -c grouped.c -o grouped.o
gcc  -I"C:/R/R-215~1.1/include" -DNDEBUG          -O3 -Wall
-std=gnu99 -mtune=core2 -c sparse.c -o sparse.o
gcc  -I"C:/R/R-215~1.1/include" -DNDEBUG          -O3 -Wall
-std=gnu99 -mtune=core2 -c util.c -o util.o
gcc -shared -s -static-libgcc -o slam.dll tmp.def grouped.o sparse.o
util.o -LC:/R/R-215~1.1/bin/i386 -lRblas -lgfortran
-LC:/R/R-215~1.1/bin/i386 -lR
installing to C:/Documents and Settings/user/My Documents/test/slam/libs/i386
** 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 'C:/Documents and Settings/user/My Documents/test/relations'
Warning in install.packages :
  running command 'C:/R/R-215~1.1/bin/i386/R CMD INSTALL -l
"C:/Documents and Settings/user/My Documents/test"
C:\DOCUME~1\user\LOCALS~1\Temp\RtmpGSxf4J/downloaded_packages/relations_0.6.tar.gz'
had status 1
Warning in install.packages :
  installation of package ?relations? had non-zero exit status

The downloaded source packages are in
?C:\Documents and Settings\user\Local
Settings\Temp\RtmpGSxf4J\downloaded_packages?



[Rd] install.packages() fails if .libPaths() set
Winston Chang