[GRASS-user] Installing spgrass6 package - Errors and warnings

Hello everybody!

I am using GRASS 6.4.0 RC6 in ubuntu 10.04. I installed R version 2.11.1 (2010-05-31) just today. As I need GRASS and R interface for my work, I went ahead as per instructions in http://www.osgeo.org/files/journal/final_pdfs/OSGeo_vol1_GRASS-R.pdf.

Initially when I started R from within GRASS and tried the command I got the following errors:

install.packages(“spgrass6”, dependencies = TRUE)
Warning in install.packages(“spgrass6”, dependencies = TRUE) :
argument ‘lib’ is missing: using ‘/usr/local/lib/R/site-library’
Warning in install.packages(“spgrass6”, dependencies = TRUE) :
‘lib = “/usr/local/lib/R/site-library”’ is not writable
Would you like to create a personal library
‘~/R/i486-pc-linux-gnu-library/2.11’
to install packages into? (y/n) n
Error in install.packages(“spgrass6”, dependencies = TRUE) :
unable to install packages
q()

Later I started R using “sudo R” and then the following errors and warnings occurred.

install.packages(“spgrass6”, dependencies = TRUE)
Warning in install.packages(“spgrass6”, dependencies = TRUE) :
argument ‘lib’ is missing: using ‘/usr/local/lib/R/site-library’
— Please select a CRAN mirror for use in this session —
Loading Tcl/Tk interface … done
also installing the dependencies ‘rgdal’, ‘XML’

trying URL ‘http://mirror.kapook.com/cran/src/contrib/rgdal_0.6-28.tar.gz
Content type ‘application/x-gzip’ length 1416605 bytes (1.4 Mb)
opened URL

downloaded 1.4 Mb

trying URL ‘http://mirror.kapook.com/cran/src/contrib/XML_3.1-1.tar.gz
Content type ‘application/x-gzip’ length 779143 bytes (760 Kb)
opened URL

downloaded 760 Kb

trying URL ‘http://mirror.kapook.com/cran/src/contrib/spgrass6_0.6-20.tar.gz
Content type ‘application/x-gzip’ length 334459 bytes (326 Kb)
opened URL

downloaded 326 Kb

  • installing source package ‘rgdal’ …
    gdal-config: gdal-config
    ./configure: line 1311: gdal-config: command not found
    Error: gdal-config not found
    The gdal-config script distributed with GDAL could not be found.
    If you have not installed the GDAL libraries, you can
    download the source from http://www.gdal.org/
    If you have installed the GDAL libraries, then make sure that
    gdal-config is in your path. Try typing gdal-config at a
    shell prompt and see if it runs. If not, use:
    –configure-args=‘–with-gdal-config=/usr/local/bin/gdal-config’ echo with appropriate values for your installation.

ERROR: configuration failed for package ‘rgdal’

  • removing ‘/usr/local/lib/R/site-library/rgdal’
  • installing source package ‘XML’ …
    checking for gcc… gcc
    checking for C compiler default output file name… a.out
    checking whether the C compiler works… yes
    checking whether we are cross compiling… no
    checking for suffix of executables…
    checking for suffix of object files… o
    checking whether we are using the GNU C compiler… yes
    checking whether gcc accepts -g… yes
    checking for gcc option to accept ISO C89… none needed
    checking how to run the C preprocessor… gcc -E
    checking for sed… /bin/sed
    checking for pkg-config… /usr/bin/pkg-config
    checking for xml2-config… no
    Cannot find xml2-config
    ERROR: configuration failed for package ‘XML’
  • removing ‘/usr/local/lib/R/site-library/XML’
    ERROR: dependencies ‘rgdal’, ‘XML’ are not available for package ‘spgrass6’
  • removing ‘/usr/local/lib/R/site-library/spgrass6’

The downloaded packages are in
‘/tmp/RtmpP2fUan/downloaded_packages’
Warning messages:
1: In install.packages(“spgrass6”, dependencies = TRUE) :
installation of package ‘rgdal’ had non-zero exit status
2: In install.packages(“spgrass6”, dependencies = TRUE) :
installation of package ‘XML’ had non-zero exit status
3: In install.packages(“spgrass6”, dependencies = TRUE) :
installation of package ‘spgrass6’ had non-zero exit status

The result is I am not able to use spgrass.

library(spgrass6)
Error in library(spgrass6) : there is no package called ‘spgrass6’

As an intermediate level user in terms of commands and also regarding R and GRASS packages I am not able to decide what went wrong. Can you please help me out.

Regards,

Chethan S.

Hello everybody!

I am using GRASS 6.4.0 RC6 in ubuntu 10.04. I installed R version 2.11.1 (2010-05-31) just today. As I need GRASS and R interface for my work, I went ahead as per instructions in http://www.osgeo.org/files/journal/final_pdfs/OSGeo_vol1_GRASS-R.pdf.

Initially when I started R from within GRASS and tried the command I got the following errors:

install.packages(“spgrass6”, dependencies = TRUE)
Warning in install.packages(“spgrass6”, dependencies = TRUE) :
argument ‘lib’ is missing: using ‘/usr/local/lib/R/site-library’
Warning in install.packages(“spgrass6”, dependencies = TRUE) :
‘lib = “/usr/local/lib/R/site-library”’ is not writable
Would you like to create a personal library
‘~/R/i486-pc-linux-gnu-library/2.11’
to install packages into? (y/n) n
Error in install.packages(“spgrass6”, dependencies = TRUE) :
unable to install packages
q()

To work this out, you should either start a library in your home dir (i.e. answer ‘yes’ to the question of creating a personal library). Or, alternatively, give yourself full rights on the system library directory, /usr/local/lib/R

  • installing source package ‘rgdal’ …
    gdal-config: gdal-config
    ./configure: line 1311: gdal-config: command not found
    Error: gdal-config not found

You’ll also need the libgdal1-dev package. That gives you the gdal-config utility. Then you should be good to go.

Regards,

Chethan S.

Cheers,
Micha

···
-- 
Micha Silver
[http://www.surfaces.co.il/](http://www.surfaces.co.il/)
Arava Development Co.  +972-52-3665918

Please see comments inline below. Please also consider the list for GRASS and
statistics, which specifically handles the GRASS-R interface. Also always
explain how you install software - assuming that software is installed
binary is not safe, as it leads (especially for Ubuntu/Debian users) to
dependency hell - dependencies undeclared by packages that intermediate
users may not know that they need when using interfaces between systems.
Installing everything from source always exposes missing dependencies, but
installing binaries doesn't show them, because the installed software is not
expected to interface with other software.

Chethan S. wrote:

Hello everybody!

I am using GRASS 6.4.0 RC6 in ubuntu 10.04. I installed R version 2.11.1
(2010-05-31) just today. As I need GRASS and R interface for my work, I
went
ahead as per instructions in
http://www.osgeo.org/files/journal/final_pdfs/OSGeo_vol1_GRASS-R.pdf.

Initially when I started R from within GRASS and tried the command I got
the
following errors:

install.packages("spgrass6", dependencies = TRUE)

Warning in install.packages("spgrass6", dependencies = TRUE) :
  argument 'lib' is missing: using '/usr/local/lib/R/site-library'
Warning in install.packages("spgrass6", dependencies = TRUE) :
  'lib = "/usr/local/lib/R/site-library"' is not writable
Would you like to create a personal library
'~/R/i486-pc-linux-gnu-library/2.11'
to install packages into? (y/n) n
Error in install.packages("spgrass6", dependencies = TRUE) :
  unable to install packages

q()

<COMMENT> You need to understand how your binary install of R handles the
installation of additional contributed packages. Your choice of "no" to
the question:

Would you like to create a personal library?

is the wrong answer. You should NEVER run anything sudo, ever, unless
doing system work - adding contributed packages is NOT system work. Read
the explanation that comes with your R distribution about personal
libraries, and allow one to be created. I'm not familiar with this
distribution, so I don't know if it adds the path to any created personal
library to the library search path, but if things work from then on, we
can assume that they do work.

Try install.packages("XML") first, and get that working - you have missing
dependencies that you need to provide. Then install.packages("rgdal")
using Micha's good advice to add at least the Ubuntu development package -
probably also for proj, not just libgdal, by the way, there are some
comments in the rgdal README file (under inst/ in the source package).
From there, spgrass6 will install.

</COMMENT>

Later I started R using "sudo R" and then the following errors and
warnings
occurred.

install.packages("spgrass6", dependencies = TRUE)

Warning in install.packages("spgrass6", dependencies = TRUE) :
  argument 'lib' is missing: using '/usr/local/lib/R/site-library'
--- Please select a CRAN mirror for use in this session ---
Loading Tcl/Tk interface ... done
also installing the dependencies ‘rgdal’, ‘XML’

trying URL 'http://mirror.kapook.com/cran/src/contrib/rgdal_0.6-28.tar.gz
Content type 'application/x-gzip' length 1416605 bytes (1.4 Mb)
opened URL

downloaded 1.4 Mb

trying URL 'http://mirror.kapook.com/cran/src/contrib/XML_3.1-1.tar.gz
Content type 'application/x-gzip' length 779143 bytes (760 Kb)
opened URL

downloaded 760 Kb

trying URL
'http://mirror.kapook.com/cran/src/contrib/spgrass6_0.6-20.tar.gz
'
Content type 'application/x-gzip' length 334459 bytes (326 Kb)
opened URL

downloaded 326 Kb

* installing *source* package ‘rgdal’ ...
gdal-config: gdal-config
./configure: line 1311: gdal-config: command not found
Error: gdal-config not found
The gdal-config script distributed with GDAL could not be found.
If you have not installed the GDAL libraries, you can
download the source from http://www.gdal.org/
If you have installed the GDAL libraries, then make sure that
gdal-config is in your path. Try typing gdal-config at a
shell prompt and see if it runs. If not, use:
--configure-args='--with-gdal-config=/usr/local/bin/gdal-config' echo
with
appropriate values for your installation.

ERROR: configuration failed for package ‘rgdal’
* removing ‘/usr/local/lib/R/site-library/rgdal’
* installing *source* package ‘XML’ ...
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking how to run the C preprocessor... gcc -E
checking for sed... /bin/sed
checking for pkg-config... /usr/bin/pkg-config
checking for xml2-config... no
Cannot find xml2-config
ERROR: configuration failed for package ‘XML’
* removing ‘/usr/local/lib/R/site-library/XML’
ERROR: dependencies ‘rgdal’, ‘XML’ are not available for package
‘spgrass6’
* removing ‘/usr/local/lib/R/site-library/spgrass6’

The downloaded packages are in
    ‘/tmp/RtmpP2fUan/downloaded_packages’
Warning messages:
1: In install.packages("spgrass6", dependencies = TRUE) :
  installation of package 'rgdal' had non-zero exit status
2: In install.packages("spgrass6", dependencies = TRUE) :
  installation of package 'XML' had non-zero exit status
3: In install.packages("spgrass6", dependencies = TRUE) :
  installation of package 'spgrass6' had non-zero exit status

The result is I am not able to use spgrass.

library(spgrass6)

Error in library(spgrass6) : there is no package called 'spgrass6'

As an intermediate level user in terms of commands and also regarding R
and
GRASS packages I am not able to decide what went wrong. Can you please
help
me out.

Regards,

Chethan S.

_______________________________________________
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

-----
Roger Bivand
Economic Geography Section
Department of Economics
Norwegian School of Economics and Business Administration
Helleveien 30
N-5045 Bergen, Norway

--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/Installing-spgrass6-package-Errors-and-warnings-tp5522860p5523163.html
Sent from the Grass - Users mailing list archive at Nabble.com.