r-spatial / lwgeom

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

./liblwgeom/liblwgeom.h:49:10: fatal error: proj.h: No such file or directory [lwgeom@0.2.5] #67

Closed Tom-python0121 closed 3 years ago

Tom-python0121 commented 3 years ago

See:

> install.packages("lwgeom")
Installing package into ‘/home/spack/spack/opt/spack/linux-centos8-aarch64/gcc-8.3.1/r-testthat-2.3.2-bfjih2xikzlqryku7amoi7qbjegvrm5t/rlib/R/library’
(as ‘lib’ is unspecified)
trying URL 'https://mirrors.bfsu.edu.cn/CRAN/src/contrib/lwgeom_0.2-5.tar.gz'
Content type 'application/octet-stream' length 501653 bytes (489 KB)
==================================================
downloaded 489 KB

* installing *source* package ‘lwgeom’ ...
** package ‘lwgeom’ successfully unpacked and MD5 sums checked
** using staged installation
configure: CC: /usr/bin/gcc
configure: CXX: /usr/bin/g++ -std=gnu++11
configure: pkg-config proj exists, will use it
configure: using proj.h.
configure: PROJ: 6.3.2
checking PROJ: checking whether PROJ and sqlite3 are available for linking:... yes
configure: POSTGIS_PROJ_VERSION: 63
checking for geos-config... /home/spack/spack/opt/spack/linux-centos8-aarch64/gcc-8.3.1/geos-3.8.1-cxocfswylusmwtaw3l7466zcuhjduyal/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/home/spack/spack/opt/spack/linux-centos8-aarch64/gcc-8.3.1/geos-3.8.1-cxocfswylusmwtaw3l7466zcuhjduyal/lib -lgeos_c... yes
checking for GEOS_init_r in -lgeos_c... yes
configure: Package CPP flags:  -DUSE_PROJ_H -I/home/spack/spack/opt/spack/linux-centos8-aarch64/gcc-8.3.1/geos-3.8.1-cxocfswylusmwtaw3l7466zcuhjduyal/include -DPOSTGIS_GEOS_VERSION=35 -I./liblwgeom -DHAVE_LIBGEOM_INTERNAL_H
configure: Package LIBS: -L/home/spack/spack/opt/spack/linux-centos8-aarch64/gcc-8.3.1/proj-6.3.2-2dabkosmblt475wdejd72vbwkowq7d4k/lib -lproj      -L/home/spack/spack/opt/spack/linux-centos8-aarch64/gcc-8.3.1/geos-3.8.1-cxocfswylusmwtaw3l7466zcuhjduyal/lib -lgeos_c
configure: creating ./config.status
config.status: creating src/Makevars
config.status: creating src/postgis_config.h
** libs
/usr/bin/g++ -std=gnu++11 -I"/home/spack/spack/opt/spack/linux-centos8-aarch64/gcc-8.3.1/r-4.0.3-m6krre343vll5qheioulnieut6awar2h/rlib/R/include" -DNDEBUG -DUSE_PROJ_H -I/home/spack/spack/opt/spack/linux-centos8-aarch64/gcc-8.3.1/geos-3.8.1-cxocfswylusmwtaw3l7466zcuhjduyal/include -DPOSTGIS_GEOS_VERSION=35 -I./liblwgeom -DHAVE_LIBGEOM_INTERNAL_H -I'/home/spack/spack/opt/spack/linux-centos8-aarch64/gcc-8.3.1/r-rcpp-1.0.6-2b5vljrmzutkcd5pcuksov3qkhc4jg5h/rlib/R/library/Rcpp/include' -I'/home/spack/spack/opt/spack/linux-centos8-aarch64/gcc-8.3.1/r-testthat-2.3.2-bfjih2xikzlqryku7amoi7qbjegvrm5t/rlib/R/library/sf/include' -I   -fpic  -g -O2  -c geodetic.cpp -o geodetic.o
In file included from geodetic.cpp:6:
./liblwgeom/liblwgeom.h:49:10: fatal error: proj.h: No such file or directory
 #include "proj.h"
          ^~~~~~~~
compilation terminated.
make: *** [/home/spack/spack/opt/spack/linux-centos8-aarch64/gcc-8.3.1/r-4.0.3-m6krre343vll5qheioulnieut6awar2h/rlib/R/etc/Makeconf:181: geodetic.o] Error 1
ERROR: compilation failed for package ‘lwgeom’
* removing ‘/home/spack/spack/opt/spack/linux-centos8-aarch64/gcc-8.3.1/r-testthat-2.3.2-bfjih2xikzlqryku7amoi7qbjegvrm5t/rlib/R/library/lwgeom’

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

Information on your system

edzer commented 3 years ago

Well, PROJ 6.3.2 definitely provides proj.h, maybe you installed it at an unusual location?

Tom-python0121 commented 3 years ago

yes,I have resolved it.I forgot to install proj-static.aarch64, proj-devel.aarch64, geos-devel.aarch64, udunits2-devel, gdal-devel.aarch64, After installing these configurations, enter the R environment again to install lwgeom, it took me a long time to solve the problem, thank you for reminding me.