11

I have error while compiling rgdal adn rgoes package on our redhat linux machine. I tried to do some research but couldn't find a possible solution. Could you please help me with this as this is very important for me to solve.

**ERROR WHILE COMPILING RGDAL in R 3.0**

**strong text**
* installing *source* package ârgdalâ ...
** package ârgdalâ successfully unpacked and MD5 sums checked
configure: CC: gcc -std=gnu99
configure: CXX: g++
configure: rgdal: 0.8-10
checking for /usr/bin/svnversion... yes
configure: svn revision: 496
configure: gdal-config: gdal-config
checking gdal-config usability... ./configure: line 1397: gdal-config: command not found
no
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'
with appropriate values for your installation.

ERROR: configuration failed for package ârgdalâ


*****ERROR WHILE COMPILING RGEOS:*****
**strong text**
* installing *source* package ârgeosâ ...
** package ârgeosâ successfully unpacked and MD5 sums checked
configure: CC: gcc -std=gnu99
configure: CXX: g++
configure: rgeos: 0.2-17
checking for /usr/bin/svnversion... yes
configure: svn revision: 413M
checking geos-config usability... ./configure: line 1385: geos-config: command not found
no
configure: error: geos-config not usable
ERROR: configuration failed for package ârgeosâ
llrs
  • 3,308
  • 35
  • 68
user2448881
  • 311
  • 1
  • 3
  • 7
  • 6
    Do you have the C(++) libraries `libgeos-dev` and `libgdal1-dev` installed? If not, install them first. – Justin Feb 10 '14 at 16:52
  • Thanks for the reply Justin. Do you mean i have to install these libraries first and then install GDAL library from www dot rgeos dot com.... Do you mind, sharng the information about what are the steps to have rgdal and rgeos package working. I have a hard time figuring it out...but our users are looking for these packages... – user2448881 Feb 11 '14 at 19:26
  • 1
    @Justin thanks. I feel like this bites me every time I try to install on a new machine. I wish this dependency was listed somewhere more explicitly (not sure how I'm supposed to back out that GEOS library = `libgeos-dev`, besides googling to SO) – MichaelChirico Feb 16 '17 at 05:29

2 Answers2

14

On fedora 20 you need to install geos and geos-devel !

sudo yum install geos geos-devel

After that the compilation in R work well!

** building package indices
** installing vignettes
** testing if installed package can be loaded
* DONE (gstat)

The downloaded source packages are in
    ‘/tmp/Rtmp9ciIzG/downloaded_packages’
delaye
  • 1,357
  • 27
  • 45
  • 2
    I'll add for anyone else getting here from Google on Linux Mint / Ubuntu that the proper packages to install are `libgeos` and `libgeos-dev` – MichaelChirico May 17 '15 at 22:44
-2

I'm not on redhat (I'm on Ubuntu) so someone who is may be able to give better package names.. . But, when installing packages from source, you need the dev of the required libraries. In this case, you probably need to install:

libgdal1-dev
libgeos-dev

So:

yum install libgdal1 libgdal1-dev libgeos libgeos-dev

Then in R:

install.packages('gdal')

this is untested, since I don't want all the extra packages associated with those two!

Justin
  • 42,475
  • 9
  • 93
  • 111
  • 1
    Thanks a lot, Justin. When I run `sudo yum install libgdal1 libgdal1-dev libgeos libgeos-dev`, however, I get the following: No package libgdal1 available. No package libgdal1-dev available. Package geos-3.4.2-1.3.amzn1.x86_64 already installed and latest version No package libgeos-dev available. – Michael Davidson Mar 04 '15 at 19:43