Skip to content

Consistency of information about installed packages

10 messages · Don MacQueen, Simon Urbanek, Rob Goedman +2 more

#
It appears to me that the Gui-based installer for binary format 
packages in the new R 2.1.0 binary distribution can report a package 
as installed when in fact it has not been successfully installed. 
This results from a previous attempt to install the package from 
source code that failed.

Details:

I just installed the new R 2.1.0 binary for OS X.
I installed over the existing R 2.0.1, which had also been installed 
from the binary.
Other then the fact that it was installed over the previous version, 
this is a completely fresh installation of R 2.1.0.

I started R by double-clicking R.app.
The very first thing I tried to do was to install the deldir package.
In the console, I typed
    install.packages('deldir')

The installation failed, final message was
   "installation of package 'deldir' had a non-zero exit status..."

I then went to the GUI menu item for installing binary format 
packages. I found deldir. However, it told me I had an installed 
version of deldir (there was an entry in the "Installed Version" 
column of the GUI window). Since the attempt to install from source 
had failed, this is not correct.

The version number for deldir in the GUI package installer window was 
the same as that of the attempt to install from source.
I had not installed deldir in R 2.0.1 (even if I had, it shouldn't be 
relevant, I believe)

-Don
#
Don,
On Apr 28, 2005, at 1:46 PM, Don MacQueen wrote:

            
This doesn't necessarily mean that the installation failed. Does
library(deldir)
work?
See above - the installation may have been successful with non-zero  
exit status. In that case it may be ineresting to figure out why  
exactly (I remember that sometimes the script tries to change  
permissions of the .css file, which fails depending on your setup,  
but that's irrelevat for the package), but if a package is retained  
after installation it usaully indicates that the installation was  
successful, regardles of the exit status.

Cheers,
Simon
#
Don,

Correct. It does give a hint while installing to remove old versions.

The safe and correct way to install is removing previous versions of R 
(usually in /Applications) and
and R.framework (/Library/Frameworks/R.framework). It might ask for 
authentication to drag these
into the Trash.

If in the past you have used/updated a library in your home directory, 
also remove this library
(~/Library/library).

All packages need to be updated for R-2.1.0.

Hope this helps,
Rob
On Apr 28, 2005, at 10:46 AM, Don MacQueen wrote:

            
#
I'm sorry, I thought the non-zero exit status message was sufficient 
and definitive.

Yes, it had failed. Prior to that message, it had said, in bright red text,

make: *** [deldir.so] Error 1
ERROR: compilation failed for package 'deldir'

(and prior to that:  ld: can't locate file for : -lbundle1.o)

So I had no doubt that the installation had failed.

library(deldir) works in the sense that it returns no error or warning message.
deldir then shows up 2nd in the search path, but there's nothing there:
character(0)

After all this, there is a folder,
   ~/Library/R/Library/deldir
but its contents are incomplete, having only a DESCRIPTION file, and 
'libs' and 'Meta' folders. The libs folder is empty, the Meta folder 
has a single file, package.rds. The contents of the DESCRIPTION file 
look generally ok.

Thanks
-Don
At 2:09 PM -0400 4/28/05, Simon Urbanek wrote:

  
    
#
Hi, Rob,

The only hint I saw, and it showed up in the Installer, was to remove 
copies of old RAqua. In fact, it says "previous versions of the Cocoa 
GUI are fine". Maybe I didn't look hard enough, but that looked 
pretty definite to me.

I had some packages previously installed; they were, as usual, gone. 
That's of course not a problem; it's expected.

Thanks
-Don
At 11:10 AM -0700 4/28/05, Rob J Goedman wrote:

  
    
#
Don,
On Apr 28, 2005, at 2:34 PM, Don MacQueen wrote:

            
Ok, that qualifies for "failed installation" :).
This is the reason why R.app shows it as installed - the package is  
there and loads. In fact R.app simply asks R about the package list -  
it doesn't try to determine anything on its own. Hence this is not a  
problem in R.app (and has nothing to do with consistency of  
information about installed packages - because it is consistent), but  
rather something with the package installation.
Oh, ok - you're installing your own private copy then.
On Apr 28, 2005, at 2:53 PM, Don MacQueen wrote:
It's ok to install over previous version, no problem, but if you use  
your own private R packages, you cannot share them across R versions  
(that's why personally I recommend to avoid that practice unless you  
have no admin access). The safest thing is to delete ~/Library/R  
after upgrade. We don't want the installer to be destructive, that's  
why don't do it by default.

Nevertheless, I still don't know how you happen to get the half- 
installed package. Did you use the Package Installer or did you  
install it manually? If so, can you reproduce it even after deleting  
~/Library/R?

Cheers,
Simon
#
Hi Don and Simon,
On Apr 28, 2005, at 1:00 PM, Simon Urbanek wrote:

            
I know, but if you install R-2.1.0 on top of an existing install, 
except the default libraries, doesn't it leave
all other libraries in the system library folder intact as well? I've 
not seen many problems with packages in
this upgrade (from R-2.0.1 to R-2.1.0), but isn't it a good idea to 
pick up a fresh set of packages? Hence
my earlier suggestion to delete  both /Library/Frameworks/R.framework 
and ~/Library/R/library before
doing the install. And thanks to Stefano nearly all of them are 
available in binary format on the CRAN
web site.

If Don has a copy of deldir in the system library, could this behaviour 
be the result?

Maybe helpful for other folks on the mailing list, on the other part of 
Simon's earlier response:
Indeed, I typically change the permissions of the R.css file
( /Library/Frameworks/R.framework/Resources/library/R.css ) to allow 
Read & Write
permissions by myself.

Rob
#
On Apr 28, 2005, at 4:44 PM, Rob J Goedman wrote:

            
It does, but they are in let's say
/Library/Frameworks/R.framework/Versions/2.0.1/Resources/library
so they won't bother your most recent R which will look in
/Library/Frameworks/R.framework/Versions/2.1.0/Resources/library

In fact each R (unless you use R_HOME or patch the R script) will  
look into
/Library/Frameworks/R.framework/Resources/library
which symlinks to
/Library/Frameworks/R.framework/Versions/Current/Resources/library
and "Current" is the symlink that the installer changes to point to  
2.1.0

The bottom line is that each new version of R framework doesn't care  
about any other installed version and won't touch it(*).
Yes, but the fact that the paths are different will force you to re- 
install system-wide packages anyway.(**)
It should not, because install.packages won't touch any other  
locations than the one it is told to install the package into. It  
doesn't care if there are other versions around, either (AFAIK).
I may be wrong, but I think that the script actually tries to change  
the permissions to g-w, which it's not allowed to as non-root. In a  
sense it's good that the system prevents it from doing so :P

BTW: I think there may an unrelated bug indeed - for some strange  
reason my R.app adds ~/library/R to the library paths even if the  
preferences tell it to not do so - I'll investigate that...

Cheers,
Simon

(*) - technically the latest installer will actually touch all  
versions inside R.framework, namely setting the permissions to g+w.  
This is consistent with Apple's permissions concept and allows admin  
users to install system-wide package w/o root authentication. It  
won't change any content, though.
(**) - in order to allow retention of packages across patch-levels,  
there is in fact a symlink 2.1 in Versions in the CRAN release, but  
it's not used (yet).
(***) - I like those footnotes, don't you? ;)
#
It seems clear to be clear to Don, but probably other users will be 
interested to know this:  when upgrading to a major version of R like 
from 2.0.x to 2.1.0 it is not an option to re-install fresh packages as 
most of the package contain DLL's linked against libR.dylib, and entry 
points/symbols are stable (inside libR.dylib) only inside each major 
version of R (i.e. packages built for R 2.0.0 works with R 2.0.1, but 
not with R 2.1.x)
stefano
On 28/apr/05, at 23:04, Simon Urbanek wrote:

            
#
More details on how I got a half-installed package; see below. (kind of long)
Fundamentally, what's happening (I believe) is that in the context 
where I used it,
install.packages() is not cleaning up after itself like it normally does.

-Don
At 4:00 PM -0400 4/28/05, Simon Urbanek wrote:
Yes, I can.

Frist, I decided to make a fresh start by entirely deleting R. I 
deleted ~Library/R, and  /Library/Frameworks/R.framework. Then I 
reinstalled R (2.1.0) from the mpkg installer. In the custom install 
I selected all three options, including the optional X11/tcltk 
package.

Then I started R.app. The very first thing I did was use 
install.packages('deldir') at the command line in the console. Did 
not use the GUI package installer. The full transcript is below.

Note that I am installing my own private copy of deldir, but not by 
intent. That's just what happened. I do have admin privileges.

For comparison, I can mention that on another OS X box, where I have 
installed R 2.1.0 from source, installation of deldir by the same 
method succeeds, and does install globally, not as a private copy.


  R : Copyright 2005, The R Foundation for Statistical Computing
Version 2.1.0  (2005-04-18), ISBN 3-900051-07-0

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 a HTML browser interface to help.
Type 'q()' to quit R.
Warning in install.packages("deldir") : argument 'lib' is missing: 
using /Users/macq/Library/R/library
--- Please select a CRAN mirror for use in this session ---
trying URL 'http://cran.cnr.Berkeley.edu/src/contrib/deldir_0.0-2.tar.gz'
Content type 'application/x-tar' length 33380 bytes
opened URL
==================================================
downloaded 32Kb

* Installing *source* package 'deldir' ...
** libs
g77   -fno-common  -g -O2 -c acchk.f -o acchk.o
g77   -fno-common  -g -O2 -c addpt.f -o addpt.o
g77   -fno-common  -g -O2 -c adjchk.f -o adjchk.o
g77   -fno-common  -g -O2 -c binsrt.f -o binsrt.o
g77   -fno-common  -g -O2 -c circen.f -o circen.o
g77   -fno-common  -g -O2 -c cross.f -o cross.o
g77   -fno-common  -g -O2 -c delet.f -o delet.o
g77   -fno-common  -g -O2 -c delet1.f -o delet1.o
g77   -fno-common  -g -O2 -c delout.f -o delout.o
g77   -fno-common  -g -O2 -c delseg.f -o delseg.o
g77   -fno-common  -g -O2 -c dirout.f -o dirout.o
g77   -fno-common  -g -O2 -c dirseg.f -o dirseg.o
g77   -fno-common  -g -O2 -c inddup.f -o inddup.o
g77   -fno-common  -g -O2 -c initad.f -o initad.o
g77   -fno-common  -g -O2 -c inside.f -o inside.o
g77   -fno-common  -g -O2 -c insrt.f -o insrt.o
g77   -fno-common  -g -O2 -c insrt1.f -o insrt1.o
g77   -fno-common  -g -O2 -c locn.f -o locn.o
g77   -fno-common  -g -O2 -c master.f -o master.o
g77   -fno-common  -g -O2 -c mnnd.f -o mnnd.o
g77   -fno-common  -g -O2 -c pred.f -o pred.o
g77   -fno-common  -g -O2 -c qtest.f -o qtest.o
g77   -fno-common  -g -O2 -c qtest1.f -o qtest1.o
g77   -fno-common  -g -O2 -c stoke.f -o stoke.o
g77   -fno-common  -g -O2 -c succ.f -o succ.o
g77   -fno-common  -g -O2 -c swap.f -o swap.o
g77   -fno-common  -g -O2 -c testeq.f -o testeq.o
g77   -fno-common  -g -O2 -c triar.f -o triar.o
g77   -fno-common  -g -O2 -c trifnd.f -o trifnd.o
gcc -bundle -flat_namespace -undefined suppress -L/usr/local/lib -o 
deldir.so acchk.o addpt.o adjchk.o binsrt.o circen.o cross.o delet.o 
delet1.o delout.o delseg.o dirout.o dirseg.o inddup.o initad.o 
inside.o insrt.o insrt1.o locn.o master.o mnnd.o pred.o qtest.o 
qtest1.o stoke.o succ.o swap.o testeq.o triar.o trifnd.o 
-L/usr/local/lib/gcc/powerpc-apple-darwin6.8/3.4.2 -lg2c -lSystem 
-lcc_dynamic -framework R
ld: can't locate file for: -lbundle1.o
make: *** [deldir.so] Error 1
ERROR: compilation failed for package 'deldir'

The downloaded packages are in
	/private/tmp/RtmpIXX01o/downloaded_packages
Warning message:
installation of package 'deldir' had non-zero exit status in: 
install.packages("deldir")
Loading required package: deldir
[1] TRUE
[1] ".GlobalEnv"        "package:deldir"    "package:methods" 
"package:stats"     "package:graphics"
  [6] "package:grDevices" "package:utils"     "package:datasets" 
"Autoloads"         "package:base"
character(0)
At this point, if I go look in ~/Library/R, I see a folder named 
deldir, with incomplete contents as I described yesterday.



Next, if I go to the GUI package installer and install the deldir 
binary at the "System Level", it succeeds.

But, and I suppose this is no surprise, I now have a half-installed 
private deldir, and a fully installed system deldir. require(deldir) 
loads the private one in preference to the system one. The private 
one has to be manually deleted outside of R. The lesson here is that 
a user can get in trouble by mixing source and binary installations 
of packages.


One more point. If I start R at the command line, using the 
recommended alias in /usr/bin, then install.packages('deldir') fails 
as in R.app, but it (1) goes for a system install instead of a 
private one, and (2) cleans up after itself:

make: *** [deldir.so] Error 1
ERROR: compilation failed for package 'deldir'
** Removing 
'/Library/Frameworks/R.framework/Versions/2.1.0/Resources/library/deldir'
** Restoring previous 
'/Library/Frameworks/R.framework/Versions/2.1.0/Resources/library/deldir'



And just to be complete,
_                       
platform powerpc-apple-darwin7.9.0
arch     powerpc                 
os       darwin7.9.0             
system   powerpc, darwin7.9.0    
status                           
major    2                       
minor    1.0                     
year     2005                    
month    04                      
day      18                      
language R