Configure: error: geos-config not found or not executable.

Knowing that the package rgeos, from the R language, requieres a prior installation of geos libraries, I installed, both, libgeos and libgeos-c1 (3.2.2), using the synaptic installer in my Ubuntu 12.04 (32 bit) machine.

Then I tried to install rgeos directly from the R console, and it issued a message in the sense that geos-config was not found. The output is as follows:

> install.packages("rgeos")
Installing package(s) into ‘/home/checo/R/i486-pc-linux-gnu-library/2.15’
(as ‘lib’ is unspecified)
also installing the dependency ‘sp’

probando la URL 'http://cran.rstudio.com/src/contrib/sp_1.0-9.tar.gz'
Content type 'application/x-gzip' length 882102 bytes (861 Kb)
URL abierta
==================================================
downloaded 861 Kb

probando la URL 'http://cran.rstudio.com/src/contrib/rgeos_0.2-19.tar.gz'
Content type 'application/x-gzip' length 221471 bytes (216 Kb)
URL abierta
==================================================
downloaded 216 Kb

* installing *source* package ‘sp’ ...
** package ‘sp’ successfully unpacked and MD5 sums checked
** libs
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG      -fpic  -O3 -pipe  -g  -c R    centroid.c -o Rcentroid.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG      -fpic  -O3 -pipe  -g  -c gcdist.c -o gcdist.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG      -fpic  -O3 -pipe  -g  -c init.c -o init.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG      -fpic  -O3 -pipe  -g  -c pip.c -o pip.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG      -fpic  -O3 -pipe  -g  -c pip2.c -o pip2.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG      -fpic  -O3 -pipe  -g  -c sp_xports.c -o sp_xports.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG      -fpic  -O3 -pipe  -g  -c surfaceArea.c -o surfaceArea.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG      -fpic  -O3 -pipe  -g  -c zerodist.c -o zerodist.o
gcc -std=gnu99 -shared -o sp.so Rcentroid.o gcdist.o init.o pip.o pip2.o sp_xports.o surfaceArea.o zerodist.o -L/usr/lib/R/lib -lR
installing to /home/checo/R/i486-pc-linux-gnu-library/2.15/sp/libs
** R
** data
** demo
** inst
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
   ‘intro_sp.Rnw’ 
   ‘over.Rnw’ 
** testing if installed package can be loaded

* DONE (sp)
* 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... no
configure: svn revision: 394
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’
* removing ‘/home/checo/R/i486-pc-linux-gnu-library/2.15/rgeos’
Warning in install.packages :
  installation of package ‘rgeos’ had non-zero exit status

Forgive my ignorance, but I don't know where this file, "geos-config", comes from: should it be generated by the gcc compilations above, or should it be previously installed when the libgeos libraries were intalled?

I learnt, from another machine, that "geos-config" is an executable and that it should be installed in /usr/bin.

Do you have any idea on what's wrong with my procedure?

Thanks,

-Sergio.

Installing the R-package rgeos on linux: geos-config not found or not executable

Questions : Installing the R-package rgeos on linux: geos-config not found or not executable

2022-09-16T15:48:57+00:00 2022-09-16T15:48:57+00:00

717

I am running R 3.4.1 on gentoo. When i try anycodings_package to install the 'rgeos' package, i get this:

> install.packages("rgeos")
Installing package into ‘/home/jody/R/x86_64-pc-linux-gnu-library/3.4’
(as ‘lib’ is unspecified)
trying URL 'https://stat.ethz.ch/CRAN/src/contrib/rgeos_0.4-2.tar.gz'
Content type 'application/x-gzip' length 255244 bytes (249 KB)
==================================================
downloaded 249 KB

* installing *source* package ‘rgeos’ ...
** package ‘rgeos’ successfully unpacked and MD5 sums checked
configure: CC: x86_64-pc-linux-gnu-gcc
configure: CXX: x86_64-pc-linux-gnu-g++
configure: rgeos: 0.4-2
checking for /usr/bin/svnversion... yes
configure: svn revision: 581
checking for geos-config... no
no
configure: error: geos-config not found or not executable.
ERROR: configuration failed for package ‘rgeos’
* removing ‘/home/jody/R/x86_64-pc-linux-gnu-library/3.4/rgeos’

The downloaded source packages are in
    ‘/tmp/RtmppEeDps/downloaded_packages’
Warning message:
In install.packages("rgeos") :
  installation of package ‘rgeos’ had non-zero exit status

(The same happens if i try to install rgeos anycodings_package on gentoo with R 3.5.1, and also on Centos anycodings_package 7.5 with R 3.5.1.)

While there is a rgeos/configure which is anycodings_package executable in the tar file mentioned above, anycodings_package there is indeed no geos-config in there.

How can i get the rgeos package installed?

Is there perhaps a binary version which i anycodings_package could download?

Total Answers 4

30

Answers 1 : of Installing the R-package rgeos on linux: geos-config not found or not executable

For Ubuntu (19.10 and likely onward) anycodings_package use:

sudo apt install libgeos-dev

0

2022-09-16T15:48:57+00:00 2022-09-16T15:48:57+00:00Answer Link

mRahman

5

Answers 2 : of Installing the R-package rgeos on linux: geos-config not found or not executable

I found the solution.

The "rgeos" package depends on libraries anycodings_package you have to install before running R.

In gentoo i had to do:

sudo emerge --ask sci-libs/geos

In CentOS:

sudo yum install geos geos-devel

After installing these libraries i anycodings_package started R and could install the 'rgeos' anycodings_package package without problems

0

2022-09-16T15:48:57+00:00 2022-09-16T15:48:57+00:00Answer Link

miraj

5

Answers 3 : of Installing the R-package rgeos on linux: geos-config not found or not executable

For Ubuntu 20.04, the solution is:

sudo apt install libgeos-dev

0

2022-09-16T15:48:57+00:00 2022-09-16T15:48:57+00:00Answer Link

miraj

4

Answers 4 : of Installing the R-package rgeos on linux: geos-config not found or not executable

For Arch/Manjaro:

   sudo pacman -S geos

0

2022-09-16T15:48:57+00:00 2022-09-16T15:48:57+00:00Answer Link

joy