r-spatial / lwgeom

bindings to the liblwgeom library
https://r-spatial.github.io/lwgeom/
58 stars 23 forks source link

Installation failure; configure: error: GEOS_init_r not found in libgeos_c; fatal error: /usr/local/include/geos/export.h: Permission denied #76

Closed tedmoorman closed 2 years ago

tedmoorman commented 2 years ago

Thank you for your package. I'm trying to install and encountering some errors. Any help is appreciated.

> install.packages("/projects/CI_Analysts/R/src/contrib/lwgeom_0.2-8.tar.gz", repos=NULL, dependencies = TRUE, type="source")
Installing package into ‘/projects/CI_Analysts/R/x86_64-pc-linux-gnu-library/3.5’
(as ‘lib’ is unspecified)
* installing *source* package ‘lwgeom’ ...
** package ‘lwgeom’ successfully unpacked and MD5 sums checked
configure: CC: gcc
configure: CXX: g++
configure: pkg-config proj exists, will use it
configure: PROJ: 4.8.0
checking for pj_init_plus in -lproj... yes
checking PROJ: epsg found and readable... yes
configure: POSTGIS_PROJ_VERSION: 48
checking for geos-config... /usr/local/bin/geos-config
checking geos-config usability... yes
configure: GEOS: 3.8.1
checking GEOS version >= 3.5.0... yes
checking geos: linking with -L/usr/local/lib -lgeos_c... no
checking geos: linking with -L/usr/local/lib -lgeos_c -lgeos -lm... no
In file included from geos_test.cpp:1:
/usr/local/include/geos_c.h:152:10: fatal error: /usr/local/include/geos/export.h: Permission denied
  152 | #include <geos/export.h>
      |          ^~~~~~~~~~~~~~~
compilation terminated.
configure: Install failure: compilation and/or linkage problems.
configure: error: GEOS_init_r not found in libgeos_c.
ERROR: configuration failed for package ‘lwgeom’
* removing ‘/projects/CI_Analysts/R/x86_64-pc-linux-gnu-library/3.5/lwgeom’
Warning in install.packages :
  installation of package ‘/projects/CI_Analysts/R/src/contrib/lwgeom_0.2-8.tar.gz’ had non-zero exit status

Here is my session info.

R version 3.5.3 (2019-03-11)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Red Hat Enterprise Linux Server 7.9 (Maipo)

Matrix products: default
BLAS: /opt/R/R-3.5.3/lib64/R/lib/libRblas.so
LAPACK: /opt/R/R-3.5.3/lib64/R/lib/libRlapack.so

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C               LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8     LC_MONETARY=en_US.UTF-8   
 [6] LC_MESSAGES=en_US.UTF-8    LC_PAPER=en_US.UTF-8       LC_NAME=C                  LC_ADDRESS=C               LC_TELEPHONE=C            
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

loaded via a namespace (and not attached):
[1] compiler_3.5.3 tools_3.5.3    renv_0.14.0 

for what it's worth, I ran locate geos_c.h | less and found the following:

/usr/include/geos_c.h
/usr/local/include/geos_c.h
edzer commented 2 years ago

Your GEOS installation is broken:

/usr/local/include/geos_c.h:152:10: fatal error: /usr/local/include/geos/export.h: Permission denied
tedmoorman commented 2 years ago

Thank you for the feedback. Hopefully, a fixed installation will solve the following issue as well: https://github.com/r-spatial/sf/issues/1867