Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

when trying to install rgeos R cannot find -lgeos

Tags:

r

geospatial

I am trying to install rgeos in R 3.5.1 running in ubuntu 16.04. When I run

install.packages("rgeos")

I get the following message:

* installing *source* package ‘rgeos’ ...
** package ‘rgeos’ successfully unpacked and MD5 sums checked
configure: CC: gcc -std=gnu99
configure: CXX: g++
configure: rgeos: 0.4-1
checking for /usr/bin/svnversion... yes
configure: svn revision: 579
checking for geos-config... /usr/bin/geos-config
checking geos-config usability... yes
configure: GEOS version: 3.5.1
checking geos version at least 3.2.0... yes
checking geos-config clibs... yes
checking geos_c.h  presence and usability... yes
checking geos: linking with libgeos_c... no
/usr/bin/ld: cannot find -lgeos
collect2: error: ld returned 1 exit status
configure: Install failure: compilation and/or linkage problems.
configure: error: initGEOS_r not found in libgeos_c.
ERROR: configuration failed for package ‘rgeos’
* removing ‘/home/rstudio/R/x86_64-pc-linux-gnu-library/3.5/rgeos’  
Warning in install.packages :
 installation of package ‘rgeos’ had non-zero exit status

I tried installing geospatial libraries

sudo apt-get install binutils libproj-dev gdal-bin

but it didn't help

Any help would be apprecieated

like image 580
Derek Corcoran Avatar asked Oct 29 '18 09:10

Derek Corcoran


1 Answers

Same problem with R 3.5.1. This fixed the issue

sudo apt install libgeos++-dev
like image 127
JRR Avatar answered Oct 19 '22 05:10

JRR