简体   繁体   中英

Can't install package lwgeom in R 3.5.2

I'm trying to install, in R 3.5.2 (under Debian 9), package lwgeom , which is a dependency of sf , which is a dependency of spider , the final desired package. But I got a few errors:

> install.packages('lwgeom',depend=T)
Installing package into ‘/home/rodrigo/R/x86_64-pc-linux-gnu-library/3.5’
(as ‘lib’ is unspecified)
also installing the dependency ‘sf’

trying URL 'https://cloud.r-project.org/src/contrib/sf_0.7-2.tar.gz'
Content type 'application/x-gzip' length 8330773 bytes (7.9 MB)
==================================================
downloaded 7.9 MB

trying URL 'https://cloud.r-project.org/src/contrib/lwgeom_0.1-5.tar.gz'
Content type 'application/x-gzip' length 439764 bytes (429 KB)
==================================================
downloaded 429 KB

* installing *source* package ‘sf’ ...
** package ‘sf’ successfully unpacked and MD5 sums checked
configure: CC: gcc -std=gnu99
configure: CXX: g++ -std=gnu++11
checking for gdal-config... /usr/bin/gdal-config
checking gdal-config usability... yes
configure: GDAL: 2.1.2
checking GDAL version >= 2.0.0... yes
checking for gcc... gcc -std=gnu99
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc -std=gnu99 accepts -g... yes
checking for gcc -std=gnu99 option to accept ISO C89... none needed
checking how to run the C preprocessor... gcc -std=gnu99 -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking gdal.h usability... yes
checking gdal.h presence... yes
checking for gdal.h... yes
checking GDAL: linking with --libs only... yes
checking GDAL: /usr/share/gdal/2.1/pcs.csv readable... yes
checking GDAL: checking whether PROJ is available for linking:... yes
checking GDAL: checking whether PROJ is available fur running:... yes
configure: pkg-config proj exists, will use it
checking proj_api.h usability... yes
checking proj_api.h presence... yes
checking for proj_api.h... yes
configure: PROJ: 4.9.3
checking for pj_init_plus in -lproj... yes
checking PROJ: epsg found and readable... yes
checking PROJ: conus found and readable... yes
checking for geos-config... /usr/local/bin/geos-config
checking geos-config usability... yes
configure: GEOS: 3.7.1
checking GEOS version >= 3.4.0... yes
checking geos_c.h usability... yes
checking geos_c.h presence... yes
checking for geos_c.h... yes
checking geos: linking with -L/usr/local/lib -lgeos_c... yes
configure: Package CPP flags:   -I/usr/include/gdal -I/usr/local/include
configure: Package LIBS: -lproj   -L/usr/lib -lgdal -L/usr/local/lib -lgeos_c
configure: creating ./config.status
config.status: creating src/Makevars
** libs
g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -I/usr/include/gdal -I/usr/local/include -I"/home/rodrigo/R/x86_64-pc-linux-gnu-library/3.5/Rcpp/include"    -fpic  -g -O2 -fdebug-prefix-map=/home/jranke/git/r-backports/stretch/r-base-3.5.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c RcppExports.cpp -o RcppExports.o
g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -I/usr/include/gdal -I/usr/local/include -I"/home/rodrigo/R/x86_64-pc-linux-gnu-library/3.5/Rcpp/include"    -fpic  -g -O2 -fdebug-prefix-map=/home/jranke/git/r-backports/stretch/r-base-3.5.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c bbox.cpp -o bbox.o
g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -I/usr/include/gdal -I/usr/local/include -I"/home/rodrigo/R/x86_64-pc-linux-gnu-library/3.5/Rcpp/include"    -fpic  -g -O2 -fdebug-prefix-map=/home/jranke/git/r-backports/stretch/r-base-3.5.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c gdal.cpp -o gdal.o
g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -I/usr/include/gdal -I/usr/local/include -I"/home/rodrigo/R/x86_64-pc-linux-gnu-library/3.5/Rcpp/include"    -fpic  -g -O2 -fdebug-prefix-map=/home/jranke/git/r-backports/stretch/r-base-3.5.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c gdal_geom.cpp -o gdal_geom.o
g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -I/usr/include/gdal -I/usr/local/include -I"/home/rodrigo/R/x86_64-pc-linux-gnu-library/3.5/Rcpp/include"    -fpic  -g -O2 -fdebug-prefix-map=/home/jranke/git/r-backports/stretch/r-base-3.5.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c gdal_read.cpp -o gdal_read.o
g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -I/usr/include/gdal -I/usr/local/include -I"/home/rodrigo/R/x86_64-pc-linux-gnu-library/3.5/Rcpp/include"    -fpic  -g -O2 -fdebug-prefix-map=/home/jranke/git/r-backports/stretch/r-base-3.5.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c gdal_utils.cpp -o gdal_utils.o
g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -I/usr/include/gdal -I/usr/local/include -I"/home/rodrigo/R/x86_64-pc-linux-gnu-library/3.5/Rcpp/include"    -fpic  -g -O2 -fdebug-prefix-map=/home/jranke/git/r-backports/stretch/r-base-3.5.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c gdal_write.cpp -o gdal_write.o
g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -I/usr/include/gdal -I/usr/local/include -I"/home/rodrigo/R/x86_64-pc-linux-gnu-library/3.5/Rcpp/include"    -fpic  -g -O2 -fdebug-prefix-map=/home/jranke/git/r-backports/stretch/r-base-3.5.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c geos.cpp -o geos.o
g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -I/usr/include/gdal -I/usr/local/include -I"/home/rodrigo/R/x86_64-pc-linux-gnu-library/3.5/Rcpp/include"    -fpic  -g -O2 -fdebug-prefix-map=/home/jranke/git/r-backports/stretch/r-base-3.5.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c hex.cpp -o hex.o
g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -I/usr/include/gdal -I/usr/local/include -I"/home/rodrigo/R/x86_64-pc-linux-gnu-library/3.5/Rcpp/include"    -fpic  -g -O2 -fdebug-prefix-map=/home/jranke/git/r-backports/stretch/r-base-3.5.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c polygonize.cpp -o polygonize.o
g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -I/usr/include/gdal -I/usr/local/include -I"/home/rodrigo/R/x86_64-pc-linux-gnu-library/3.5/Rcpp/include"    -fpic  -g -O2 -fdebug-prefix-map=/home/jranke/git/r-backports/stretch/r-base-3.5.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c proj.cpp -o proj.o
g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -I/usr/include/gdal -I/usr/local/include -I"/home/rodrigo/R/x86_64-pc-linux-gnu-library/3.5/Rcpp/include"    -fpic  -g -O2 -fdebug-prefix-map=/home/jranke/git/r-backports/stretch/r-base-3.5.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c raster2sf.cpp -o raster2sf.o
g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -I/usr/include/gdal -I/usr/local/include -I"/home/rodrigo/R/x86_64-pc-linux-gnu-library/3.5/Rcpp/include"    -fpic  -g -O2 -fdebug-prefix-map=/home/jranke/git/r-backports/stretch/r-base-3.5.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c sfg.cpp -o sfg.o
g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -I/usr/include/gdal -I/usr/local/include -I"/home/rodrigo/R/x86_64-pc-linux-gnu-library/3.5/Rcpp/include"    -fpic  -g -O2 -fdebug-prefix-map=/home/jranke/git/r-backports/stretch/r-base-3.5.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c signed_area.cpp -o signed_area.o
g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -I/usr/include/gdal -I/usr/local/include -I"/home/rodrigo/R/x86_64-pc-linux-gnu-library/3.5/Rcpp/include"    -fpic  -g -O2 -fdebug-prefix-map=/home/jranke/git/r-backports/stretch/r-base-3.5.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c stars.cpp -o stars.o
g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -I/usr/include/gdal -I/usr/local/include -I"/home/rodrigo/R/x86_64-pc-linux-gnu-library/3.5/Rcpp/include"    -fpic  -g -O2 -fdebug-prefix-map=/home/jranke/git/r-backports/stretch/r-base-3.5.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c wkb.cpp -o wkb.o
g++ -std=gnu++11 -shared -L/usr/lib/R/lib -Wl,-z,relro -o sf.so RcppExports.o bbox.o gdal.o gdal_geom.o gdal_read.o gdal_utils.o gdal_write.o geos.o hex.o polygonize.o proj.o raster2sf.o sfg.o signed_area.o stars.o wkb.o -lproj -L/usr/lib -lgdal -L/usr/local/lib -lgeos_c -L/usr/lib/R/lib -lR
installing to /home/rodrigo/R/x86_64-pc-linux-gnu-library/3.5/sf/libs
** R
** data
** demo
** inst
** byte-compile and prepare package for lazy loading
in method for ‘dbWriteTable’ with signature ‘"PostgreSQLConnection","character","sf"’: no definition for class “PostgreSQLConnection”
in method for ‘dbDataType’ with signature ‘"PostgreSQLConnection","sf"’: no definition for class “PostgreSQLConnection”
in method for ‘coerce’ with signature ‘"Spatial","sf"’: no definition for class “Spatial”
in method for ‘coerce’ with signature ‘"Spatial","sfc"’: no definition for class “Spatial”
in method for ‘coerce’ with signature ‘"sf","Spatial"’: no definition for class “Spatial”
in method for ‘coerce’ with signature ‘"sfc","Spatial"’: no definition for class “Spatial”
in method for ‘coerce’ with signature ‘"XY","Spatial"’: no definition for class “Spatial”
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded
Error: package or namespace load failed for ‘sf’ in dyn.load(file, DLLpath = DLLpath, ...):
 unable to load shared object '/home/rodrigo/R/x86_64-pc-linux-gnu-library/3.5/sf/libs/sf.so':
  /home/rodrigo/R/x86_64-pc-linux-gnu-library/3.5/sf/libs/sf.so: undefined symbol: GEOSFrechetDistanceDensify_r
Error: loading failed
Execution halted
ERROR: loading failed
* removing ‘/home/rodrigo/R/x86_64-pc-linux-gnu-library/3.5/sf’
Warning in install.packages :
  installation of package ‘sf’ had non-zero exit status
ERROR: dependency ‘sf’ is not available for package ‘lwgeom’
* removing ‘/home/rodrigo/R/x86_64-pc-linux-gnu-library/3.5/lwgeom’
Warning in install.packages :
  installation of package ‘lwgeom’ had non-zero exit status

The downloaded source packages are in
    ‘/tmp/RtmptKPuTu/downloaded_packages’

The lines with errors are:

in method for ‘dbWriteTable’ with signature ‘"PostgreSQLConnection","character","sf"’: no definition for class “PostgreSQLConnection”
in method for ‘dbDataType’ with signature ‘"PostgreSQLConnection","sf"’: no definition for class “PostgreSQLConnection”

I installed the packages RSQLite and RPostgreSQL , but this didn't solved it.

in method for ‘coerce’ with signature ‘"Spatial","sf"’: no definition for class “Spatial”
in method for ‘coerce’ with signature ‘"Spatial","sfc"’: no definition for class “Spatial”
in method for ‘coerce’ with signature ‘"sf","Spatial"’: no definition for class “Spatial”
in method for ‘coerce’ with signature ‘"sfc","Spatial"’: no definition for class “Spatial”
in method for ‘coerce’ with signature ‘"XY","Spatial"’: no definition for class “Spatial”

I have no idea how to solve these, but I have the following packages installed in Debian:

libgdal-dev is already the newest version (2.1.2+dfsg-5).
libgeos-dev is already the newest version (3.5.1-3).
libproj-dev is already the newest version (4.9.3-1).
libudunits2-dev is already the newest version (2.2.20-1+b1).

The last important error:

ERROR: dependency ‘sf’ is not available for package ‘lwgeom’

But if I try to install sf , I got the following error:

> install.packages('sf',depend=T)
Installing package into ‘/home/rodrigo/R/x86_64-pc-linux-gnu-library/3.5’
(as ‘lib’ is unspecified)
also installing the dependencies ‘tmaptools’, ‘lwgeom’, ‘mapview’, ‘stars’, ‘tmap’

trying URL 'https://cloud.r-project.org/src/contrib/tmaptools_2.0-1.tar.gz'
Content type 'application/x-gzip' length 84292 bytes (82 KB)
==================================================
downloaded 82 KB

trying URL 'https://cloud.r-project.org/src/contrib/lwgeom_0.1-5.tar.gz'
Content type 'application/x-gzip' length 439764 bytes (429 KB)
==================================================
downloaded 429 KB

trying URL 'https://cloud.r-project.org/src/contrib/mapview_2.6.3.tar.gz'
Content type 'application/x-gzip' length 2016015 bytes (1.9 MB)
==================================================
downloaded 1.9 MB

trying URL 'https://cloud.r-project.org/src/contrib/stars_0.2-0.tar.gz'
Content type 'application/x-gzip' length 5999356 bytes (5.7 MB)
==================================================
downloaded 5.7 MB

trying URL 'https://cloud.r-project.org/src/contrib/tmap_2.2.tar.gz'
Content type 'application/x-gzip' length 2900602 bytes (2.8 MB)
==================================================
downloaded 2.8 MB

trying URL 'https://cloud.r-project.org/src/contrib/sf_0.7-2.tar.gz'
Content type 'application/x-gzip' length 8330773 bytes (7.9 MB)
==================================================
downloaded 7.9 MB

* installing *source* package ‘sf’ ...
** package ‘sf’ successfully unpacked and MD5 sums checked
configure: CC: gcc -std=gnu99
configure: CXX: g++ -std=gnu++11
checking for gdal-config... /usr/bin/gdal-config
checking gdal-config usability... yes
configure: GDAL: 2.1.2
checking GDAL version >= 2.0.0... yes
checking for gcc... gcc -std=gnu99
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc -std=gnu99 accepts -g... yes
checking for gcc -std=gnu99 option to accept ISO C89... none needed
checking how to run the C preprocessor... gcc -std=gnu99 -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking gdal.h usability... yes
checking gdal.h presence... yes
checking for gdal.h... yes
checking GDAL: linking with --libs only... yes
checking GDAL: /usr/share/gdal/2.1/pcs.csv readable... yes
checking GDAL: checking whether PROJ is available for linking:... yes
checking GDAL: checking whether PROJ is available fur running:... yes
configure: pkg-config proj exists, will use it
checking proj_api.h usability... yes
checking proj_api.h presence... yes
checking for proj_api.h... yes
configure: PROJ: 4.9.3
checking for pj_init_plus in -lproj... yes
checking PROJ: epsg found and readable... yes
checking PROJ: conus found and readable... yes
checking for geos-config... /usr/local/bin/geos-config
checking geos-config usability... yes
configure: GEOS: 3.7.1
checking GEOS version >= 3.4.0... yes
checking geos_c.h usability... yes
checking geos_c.h presence... yes
checking for geos_c.h... yes
checking geos: linking with -L/usr/local/lib -lgeos_c... yes
configure: Package CPP flags:   -I/usr/include/gdal -I/usr/local/include
configure: Package LIBS: -lproj   -L/usr/lib -lgdal -L/usr/local/lib -lgeos_c
configure: creating ./config.status
config.status: creating src/Makevars
** libs
g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -I/usr/include/gdal -I/usr/local/include -I"/home/rodrigo/R/x86_64-pc-linux-gnu-library/3.5/Rcpp/include"    -fpic  -g -O2 -fdebug-prefix-map=/home/jranke/git/r-backports/stretch/r-base-3.5.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c RcppExports.cpp -o RcppExports.o
g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -I/usr/include/gdal -I/usr/local/include -I"/home/rodrigo/R/x86_64-pc-linux-gnu-library/3.5/Rcpp/include"    -fpic  -g -O2 -fdebug-prefix-map=/home/jranke/git/r-backports/stretch/r-base-3.5.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c bbox.cpp -o bbox.o
g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -I/usr/include/gdal -I/usr/local/include -I"/home/rodrigo/R/x86_64-pc-linux-gnu-library/3.5/Rcpp/include"    -fpic  -g -O2 -fdebug-prefix-map=/home/jranke/git/r-backports/stretch/r-base-3.5.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c gdal.cpp -o gdal.o
g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -I/usr/include/gdal -I/usr/local/include -I"/home/rodrigo/R/x86_64-pc-linux-gnu-library/3.5/Rcpp/include"    -fpic  -g -O2 -fdebug-prefix-map=/home/jranke/git/r-backports/stretch/r-base-3.5.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c gdal_geom.cpp -o gdal_geom.o
g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -I/usr/include/gdal -I/usr/local/include -I"/home/rodrigo/R/x86_64-pc-linux-gnu-library/3.5/Rcpp/include"    -fpic  -g -O2 -fdebug-prefix-map=/home/jranke/git/r-backports/stretch/r-base-3.5.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c gdal_read.cpp -o gdal_read.o
g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -I/usr/include/gdal -I/usr/local/include -I"/home/rodrigo/R/x86_64-pc-linux-gnu-library/3.5/Rcpp/include"    -fpic  -g -O2 -fdebug-prefix-map=/home/jranke/git/r-backports/stretch/r-base-3.5.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c gdal_utils.cpp -o gdal_utils.o
g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -I/usr/include/gdal -I/usr/local/include -I"/home/rodrigo/R/x86_64-pc-linux-gnu-library/3.5/Rcpp/include"    -fpic  -g -O2 -fdebug-prefix-map=/home/jranke/git/r-backports/stretch/r-base-3.5.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c gdal_write.cpp -o gdal_write.o
g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -I/usr/include/gdal -I/usr/local/include -I"/home/rodrigo/R/x86_64-pc-linux-gnu-library/3.5/Rcpp/include"    -fpic  -g -O2 -fdebug-prefix-map=/home/jranke/git/r-backports/stretch/r-base-3.5.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c geos.cpp -o geos.o
g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -I/usr/include/gdal -I/usr/local/include -I"/home/rodrigo/R/x86_64-pc-linux-gnu-library/3.5/Rcpp/include"    -fpic  -g -O2 -fdebug-prefix-map=/home/jranke/git/r-backports/stretch/r-base-3.5.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c hex.cpp -o hex.o
g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -I/usr/include/gdal -I/usr/local/include -I"/home/rodrigo/R/x86_64-pc-linux-gnu-library/3.5/Rcpp/include"    -fpic  -g -O2 -fdebug-prefix-map=/home/jranke/git/r-backports/stretch/r-base-3.5.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c polygonize.cpp -o polygonize.o
g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -I/usr/include/gdal -I/usr/local/include -I"/home/rodrigo/R/x86_64-pc-linux-gnu-library/3.5/Rcpp/include"    -fpic  -g -O2 -fdebug-prefix-map=/home/jranke/git/r-backports/stretch/r-base-3.5.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c proj.cpp -o proj.o
g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -I/usr/include/gdal -I/usr/local/include -I"/home/rodrigo/R/x86_64-pc-linux-gnu-library/3.5/Rcpp/include"    -fpic  -g -O2 -fdebug-prefix-map=/home/jranke/git/r-backports/stretch/r-base-3.5.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c raster2sf.cpp -o raster2sf.o
g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -I/usr/include/gdal -I/usr/local/include -I"/home/rodrigo/R/x86_64-pc-linux-gnu-library/3.5/Rcpp/include"    -fpic  -g -O2 -fdebug-prefix-map=/home/jranke/git/r-backports/stretch/r-base-3.5.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c sfg.cpp -o sfg.o
g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -I/usr/include/gdal -I/usr/local/include -I"/home/rodrigo/R/x86_64-pc-linux-gnu-library/3.5/Rcpp/include"    -fpic  -g -O2 -fdebug-prefix-map=/home/jranke/git/r-backports/stretch/r-base-3.5.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c signed_area.cpp -o signed_area.o
g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -I/usr/include/gdal -I/usr/local/include -I"/home/rodrigo/R/x86_64-pc-linux-gnu-library/3.5/Rcpp/include"    -fpic  -g -O2 -fdebug-prefix-map=/home/jranke/git/r-backports/stretch/r-base-3.5.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c stars.cpp -o stars.o
g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -I/usr/include/gdal -I/usr/local/include -I"/home/rodrigo/R/x86_64-pc-linux-gnu-library/3.5/Rcpp/include"    -fpic  -g -O2 -fdebug-prefix-map=/home/jranke/git/r-backports/stretch/r-base-3.5.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c wkb.cpp -o wkb.o
g++ -std=gnu++11 -shared -L/usr/lib/R/lib -Wl,-z,relro -o sf.so RcppExports.o bbox.o gdal.o gdal_geom.o gdal_read.o gdal_utils.o gdal_write.o geos.o hex.o polygonize.o proj.o raster2sf.o sfg.o signed_area.o stars.o wkb.o -lproj -L/usr/lib -lgdal -L/usr/local/lib -lgeos_c -L/usr/lib/R/lib -lR
installing to /home/rodrigo/R/x86_64-pc-linux-gnu-library/3.5/sf/libs
** R
** data
** demo
** inst
** byte-compile and prepare package for lazy loading
in method for ‘dbWriteTable’ with signature ‘"PostgreSQLConnection","character","sf"’: no definition for class “PostgreSQLConnection”
in method for ‘dbDataType’ with signature ‘"PostgreSQLConnection","sf"’: no definition for class “PostgreSQLConnection”
in method for ‘coerce’ with signature ‘"Spatial","sf"’: no definition for class “Spatial”
in method for ‘coerce’ with signature ‘"Spatial","sfc"’: no definition for class “Spatial”
in method for ‘coerce’ with signature ‘"sf","Spatial"’: no definition for class “Spatial”
in method for ‘coerce’ with signature ‘"sfc","Spatial"’: no definition for class “Spatial”
in method for ‘coerce’ with signature ‘"XY","Spatial"’: no definition for class “Spatial”
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded
Error: package or namespace load failed for ‘sf’ in dyn.load(file, DLLpath = DLLpath, ...):
 unable to load shared object '/home/rodrigo/R/x86_64-pc-linux-gnu-library/3.5/sf/libs/sf.so':
  /home/rodrigo/R/x86_64-pc-linux-gnu-library/3.5/sf/libs/sf.so: undefined symbol: GEOSFrechetDistanceDensify_r
Error: loading failed
Execution halted
ERROR: loading failed
* removing ‘/home/rodrigo/R/x86_64-pc-linux-gnu-library/3.5/sf’
Warning in install.packages :
  installation of package ‘sf’ had non-zero exit status
ERROR: dependency ‘sf’ is not available for package ‘lwgeom’
* removing ‘/home/rodrigo/R/x86_64-pc-linux-gnu-library/3.5/lwgeom’
Warning in install.packages :
  installation of package ‘lwgeom’ had non-zero exit status
ERROR: dependency ‘sf’ is not available for package ‘mapview’
* removing ‘/home/rodrigo/R/x86_64-pc-linux-gnu-library/3.5/mapview’
Warning in install.packages :
  installation of package ‘mapview’ had non-zero exit status
ERROR: dependency ‘sf’ is not available for package ‘stars’
* removing ‘/home/rodrigo/R/x86_64-pc-linux-gnu-library/3.5/stars’
Warning in install.packages :
  installation of package ‘stars’ had non-zero exit status
ERROR: dependencies ‘sf’, ‘lwgeom’ are not available for package ‘tmaptools’
* removing ‘/home/rodrigo/R/x86_64-pc-linux-gnu-library/3.5/tmaptools’
Warning in install.packages :
  installation of package ‘tmaptools’ had non-zero exit status
ERROR: dependencies ‘tmaptools’, ‘sf’, ‘mapview’ are not available for package ‘tmap’
* removing ‘/home/rodrigo/R/x86_64-pc-linux-gnu-library/3.5/tmap’
Warning in install.packages :
  installation of package ‘tmap’ had non-zero exit status

The downloaded source packages are in
    ‘/tmp/RtmptKPuTu/downloaded_packages’

What I don't understand (apart from the errors that I can't solve) is: how can sf be a dependency for lwgeom , and lwgeom be a dependency for sf at the same time?

Well, I ended up uninstalling and installing again both GDAL and GEOS, from Debian official repositories and from source, a few times. Until I got it right, don't know exactly how or why. In the end I got up with this:

ldconfig -v | grep gdal
    libgdal.so.20 -> libgdal.so.20.1.2

ldconfig -v | grep geos
    libgeos-3.7.1.so -> libgeos.so
    libgeos_c.so.1 -> libgeos_c.so.1.11.1
    libgeos-3.5.1.so -> libgeos-3.5.1.so
    libgeos_c.so.1 -> libgeos_c.so.1.9.1

Which is quite similar to the first problem I had (more than one version of GEOS). So don't ask me...

The installation of lwgeom and sf gave a few warnings, but I was finally able to install spider .

EDIT

I've ran into the same problem again (trying to install stplanr ). This time, I found out that I have installed one of libgeos' versions from source. So I went to the directory of the source and issued sudo make uninstall , which removed it nicely. Then I just reinstalled the official version from Debian repository, and now I could install both lwgeom and sf in R.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM