[R-SIG-Mac] R, sudo, and install.packages()

Don MacQueen macq at llnl.gov
Mon Jun 16 13:47:41 MEST 2003


Following up in my recent message about a problem with 
library(gstat), for which the error message is:

>  library(gstat)
Error: package gstat was built for  Win32

I tried install.packages('gstat'). Note the failure.

Naturally, since this version of R was installed in /usr/local with 
an installer that required admin privileges, R files are owned by 
root, and a user running R in "ordinary" mode can't write to 
/usr/local. When I was installing from sources, I never had this 
problem, because I installed R as myself, thus I owned RHOME, and so 
I could use install.packages().

>  install.packages('gstat')
trying URL `http://cran.r-project.org/src/contrib/PACKAGES'
Content type `text/plain; charset=iso-8859-1' length 108772 bytes
opened URL
.......... .......... .......... .......... ..........
.......... .......... .......... .......... ..........
......
downloaded 106Kb

trying URL `http://cran.r-project.org/src/contrib/gstat_0.9-6.tar.gz'
Content type `application/x-tar' length 367529 bytes
opened URL
.......... .......... .......... .......... ..........
.......... .......... .......... .......... ..........
.......... .......... .......... .......... ..........
.......... .......... .......... .......... ..........
.......... .......... .......... .......... ..........
.......... .......... .......... .......... ..........
.......... .......... .......... .......... ..........
........
downloaded 358Kb

ERROR: cannot write to or create directory '/usr/local/lib/R/library'

Delete downloaded files (y/N)? y

Warning message:
Installation of package gstat had non-zero exit status in: 
install.packages("gstat")
>  ?install.packages
>  q()
Save workspace image? [y/n/c]: y
Warning messages:
1: namespaces may not be available when loading
2: names in persistent strings are currently ignored

--------------------------------------------------------------------
The work-around is to start R with

   sudo R

in which case installation is possible. This is kind of a bother, but 
at least it's possible.

Specific to gstat, there is unfortunately still a problem, but at 
least now it's something to do with how the package and maybe its 
makefiles are coded.

>  install.packages('gstat')
trying URL `http://cran.r-project.org/src/contrib/PACKAGES'
Content type `text/plain; charset=iso-8859-1' length 108772 bytes
opened URL
.......... .......... .......... .......... ..........
.......... .......... .......... .......... ..........
......
downloaded 106Kb

trying URL `http://cran.r-project.org/src/contrib/gstat_0.9-6.tar.gz'
Content type `application/x-tar' length 367529 bytes
opened URL
.......... .......... .......... .......... ..........
.......... .......... .......... .......... ..........
.......... .......... .......... .......... ..........
.......... .......... .......... .......... ..........
.......... .......... .......... .......... ..........
.......... .......... .......... .......... ..........
.......... .......... .......... .......... ..........
........
downloaded 358Kb

* Installing *source* package 'gstat' ...
creating cache ./config.cache
checking for gcc... gcc
checking whether the C compiler (gcc -I/sw/include -L/sw/lib) works... yes
checking whether the C compiler (gcc -I/sw/include -L/sw/lib) is a 
cross-compiler... no
checking whether we are using GNU C... yes
checking whether gcc accepts -g... yes
checking how to run the C preprocessor... gcc -E -traditional-cpp
checking for AIX... no
checking for minix/config.h... no
checking for POSIXized ISC... no
checking for ANSI C header files... yes
checking for working const... yes
checking whether time.h and sys/time.h may both be included... yes
checking for 8-bit clean memcmp... yes
checking for vprintf... yes
checking for strstr... yes
checking for strtod... yes
checking for strtol... yes
checking for popen... yes
checking for drand48... yes
checking for gettimeofday... yes
checking for getopt... yes
checking whether byte ordering is bigendian... yes
checking for memory.h... yes
checking for ANSI C header files... (cached) yes
checking for gcc option to accept ANSI C...
checking for function prototypes... yes
checking for working const... (cached) yes
checking for complex.h... no
checking for malloc.h... no
checking for varargs.h... yes
checking for size_t... yes
checking for working const... (cached) yes
checking whether byte ordering is bigendian... (cached) yes
checking for u_int
computing machine epsilon(s)
gcc -o macheps ./src/meschach/dmacheps.c
gcc -o macheps ./src/meschach/fmacheps.c
computing M_MAX_INT
gcc -o maxint maxint.c
checking char \\0 vs. float zeros
checking for bcopy... yes
checking for bzero... yes
checking for function prototypes
checking for function prototypes in structures
updating cache ./config.cache
creating ./config.status
creating makefile
creating src/makefile
creating src/config.h
creating src/machine.h
** libs
Makefile:306: warning: overriding commands for target `.c.o'
/usr/local/lib/R/etc/Makeconf:65: warning: ignoring old commands for 
target `.c.o'
gcc -c -g -Wall -I../include -I/sw/include  -DHAVE_CONFIG_H block.c
gcc -c -g -Wall -I../include -I/sw/include  -DHAVE_CONFIG_H data.c
gcc -c -g -Wall -I../include -I/sw/include  -DHAVE_CONFIG_H direct.c
make: *** No rule to make target `palet.h', needed by `fig.o'.  Stop.
ERROR: compilation failed for package 'gstat'

Delete downloaded files (y/N)? y

Warning message:
Installation of package gstat had non-zero exit status in: 
install.packages("gstat")
>


This is still R 1.7.0 installed using the gifi version.

Thanks
-Don
-- 
--------------------------------------
Don MacQueen
Environmental Protection Department
Lawrence Livermore National Laboratory
Livermore, CA, USA



More information about the R-SIG-Mac mailing list