lwgeom
lwgeom copied to clipboard
lwgeom fails to install on Centos 7 with R 3.6.2 and proj 6.0.0
Hello, I am trying to install from github lwgeom using R 3.6.2 with centos 7 Linux. Here is my setup OS : centos 7 R version : 3.6.2 GDAL version : 3.1.0 GEOS version : 3.8.1 PROJ version : 6.0.0
Command executed is as follows ; devtools::install_github("r-spatial/lwgeom",configure.args=c('--with-proj-lib=/gpfs/software/ada/proj/6.0.0/lib','--with-proj-include=/gpfs/software/ada/proj/6.0.0/include','--with-proj-share=/gpfs/software/ada/proj/6.0.0/share/proj'))
The error generated is as follows: checking for file ‘/tmp/RtmpDI3tVi/remotes161ee3f4c1ab1/r-spatial-lwgeom-0ac3✔ checking for file ‘/tmp/RtmpDI3tVi/remotes161ee3f4c1ab1/r-spatial-lwgeom-0ac3113/DESCRIPTION’ ─ preparing ‘lwgeom’: ✔ checking DESCRIPTION meta-information ... ─ cleaning src ─ running ‘cleanup’ ─ checking for LF line-endings in source and make files and shell scripts ─ checking for empty or unneeded directories ─ building ‘lwgeom_0.2-5.tar.gz’
- installing source package ‘lwgeom’ ...
** using staged installation
configure: CC: gcc -std=gnu99
configure: CXX: g++ -std=gnu++11
configure: pkg-config proj exists, will use it
configure: using proj_api.h even with PROJ 5/6
checking for pj_init_plus in -lproj... yes
configure: PROJ_LIB: /gpfs/software/ada/proj/6.0.0/share/proj
checking PROJ: proj.db found and readable... yes
checking PROJ: conus found and readable... no
Note: proj/conus not found
No support available in PROJ4 for NAD grid datum transformations
If required, consider re-installing from source with the contents
of proj-datumgrid-1.
.zip from http://download.osgeo.org/proj/ in nad/. configure: POSTGIS_PROJ_VERSION: 60 checking for geos-config... /gpfs/software/ada/geos/3.8.1/bin/geos-config checking geos-config usability... yes configure: GEOS: 3.8.1 checking GEOS version >= 3.6.0... yes checking geos: linking with -L/gpfs/software/ada/geos/3.8.1/lib -lgeos_c... yes checking for GEOS_init_r in -lgeos_c... yes configure: Package CPP flags: -DUSE_PROJ_H -I/gpfs/software/ada/geos/3.8.1/include -DPOSTGIS_GEOS_VERSION=35 -I./liblwgeom -DHAVE_LIBGEOM_INTERNAL_H configure: Package LIBS: -lproj -L/gpfs/software/ada/proj/6.0.0/lib -lproj -L/gpfs/software/ada/geos/3.8.1/lib -lgeos_c configure: creating ./config.status config.status: creating src/Makevars config.status: creating src/postgis_config.h ** libs g++ -std=gnu++11 -I"/gpfs/software/ada/R/3.6.2/lib64/R/include" -DNDEBUG -DUSE_PROJ_H -I/gpfs/software/ada/geos/3.8.1/include -DPOSTGIS_GEOS_VERSION=35 -I./liblwgeom -DHAVE_LIBGEOM_INTERNAL_H -I"/gpfs/software/ada/R/3.6.2/lib64/R/library/Rcpp/include" -I"/gpfs/software/ada/R/3.6.2/lib64/R/library/sf/include" -I/usr/local/include -fpic -g -O2 -c geodetic.cpp -o geodetic.o In file included from geodetic.cpp:6:0: ./liblwgeom/liblwgeom.h:49:18: fatal error: proj.h: No such file or directory #include "proj.h" ^ compilation terminated. make: *** [geodetic.o] Error 1 ERROR: compilation failed for package ‘lwgeom’ - removing ‘/gpfs/software/ada/R/3.6.2/lib64/R/library/lwgeom’ Error: Failed to install 'lwgeom' from GitHub: (converted from warning) installation of package ‘/tmp/RtmpDI3tVi/file161ee7795d7e9/lwgeom_0.2-5.tar.gz’ had non-zero exit status
Is there something i am missing
The proj.h is here /gpfs/software/ada/proj/6.0.0/include/proj.h
Thanks
Here is my setup:
OS : centos 7 R version : 4.0.2 GDAL version : 3.1.2 GEOS version : 3.8.1 PROJ version : 6.3.2
I got it to work by setting the CPPFLAGS to the location of the header files on my system using the $PROJ_INC variable:
export MAKEFLAGS="CPPFLAGS=-I$PROJ_INC CFLAGS=-I$PROJ_INC" R CMD INSTALL lwgeom_0.2-5.tar.gz