Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to install sf in Ubuntu 20.04 - 2 #1700

Closed
lionelvoirol opened this issue Jun 20, 2021 · 7 comments
Closed

Unable to install sf in Ubuntu 20.04 - 2 #1700

lionelvoirol opened this issue Jun 20, 2021 · 7 comments

Comments

@lionelvoirol
Copy link

lionelvoirol commented Jun 20, 2021

Following my previous issue #1685, I followed #1628 and updated all the UbuntuGIS packages. (thanks @rsbivand ).
I still however had the issue with checking PROJ: checking whether PROJ and sqlite3 are available for linking:... no discussed for example in #1268.

I then found a solution with remotes::install_github('r-spatial/sf', configure.args= '--with-proj-lib=/lib/x86_64-linux-gnu') discussed in #1670 and as

▶ sudo ldconfig -p | grep libproj
	libproj.so.19 (libc6,x86-64) => /lib/x86_64-linux-gnu/libproj.so.19
	libproj.so (libc6,x86-64) => /lib/x86_64-linux-gnu/libproj.so

However, I know have the following:

remotes::install_github('r-spatial/sf', configure.args= '--with-proj-lib=/lib/x86_64-linux-gnu')
Downloading GitHub repo r-spatial/sf@HEAD
✓  checking for file ‘/tmp/Rtmp3Odbw6/remotes7374688579df/r-spatial-sf-7f8e52c/DESCRIPTION’ ...
─  preparing ‘sf’:
✓  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 ‘sf_1.0-1.tar.gz’
   
Installing package into ‘/home/lionel/R/x86_64-pc-linux-gnu-library/4.0’
(as ‘lib’ is unspecified)
* installing *source* package ‘sf’ ...
** using staged installation
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: 3.2.1
checking GDAL version >= 2.0.1... 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... /usr/bin/grep
checking for egrep... /usr/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/pcs.csv readable... no
checking GDAL: checking whether PROJ is available for linking:... yes
checking GDAL: checking whether PROJ is available fur running:... yes
configure: GDAL: 3.2.1
configure: pkg-config proj exists, will use it
configure: using proj.h.
checking PROJ: checking whether PROJ and sqlite3 are available for linking:... yes
checking for geos-config... /home/linuxbrew/.linuxbrew/bin/geos-config
checking geos-config usability... yes
configure: GEOS: 3.9.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/home/linuxbrew/.linuxbrew/Cellar/geos/3.9.1/lib -lgeos_c... no
checking geos: linking with -L/home/linuxbrew/.linuxbrew/Cellar/geos/3.9.1/lib -lgeos_c -lgeos -lm... no
/home/linuxbrew/.linuxbrew/bin/ld: /home/linuxbrew/.linuxbrew/Cellar/geos/3.9.1/lib/libgeos_c.a(libgeos_c_la-geos_ts_c.o): relocation R_X86_64_32 against `.rodata' can not be used when making a PIE object; recompile with -fPIE
/home/linuxbrew/.linuxbrew/bin/ld: /home/linuxbrew/.linuxbrew/Cellar/geos/3.9.1/lib/libgeos_c.a(libgeos_c_la-geos_ts_c.o): warning: relocation against `memcpy@@GLIBC_2.14' in read-only section `.text'
collect2: error: ld returned 1 exit status
configure: Install failure: compilation and/or linkage problems.
configure: error: initGEOS_r not found in libgeos_c.
ERROR: configuration failed for package ‘sf’
* removing ‘/home/lionel/R/x86_64-pc-linux-gnu-library/4.0/sf’
Error: Failed to install 'sf' from GitHub:
  (converted from warning) installation of package ‘/tmp/Rtmp3Odbw6/file73744351c814/sf_1.0-1.tar.gz’ had non-zero exit status

Also, the PKG_CONFIG_PATH is set to:

▶ env | grep PKG                                            
PKG_CONFIG_PATH=/lib/x86_64-linux-gnu/lib/pkgconfig

and this is my sessionInfo

> sessionInfo()
R version 4.0.5 (2021-03-31)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 20.04.2 LTS

Matrix products: default
BLAS:   /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.9.0
LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.9.0

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

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

loaded via a namespace (and not attached):
 [1] processx_3.5.1     compiler_4.0.5     R6_2.5.0           rprojroot_2.0.2    cli_2.5.0          prettyunits_1.1.1  tools_4.0.5        withr_2.4.1       
 [9] RColorBrewer_1.1-2 rstudioapi_0.13    curl_4.3           crayon_1.4.1       remotes_2.2.0      callr_3.5.1        ps_1.6.0           pkgbuild_1.2.0  

EDIT 1:

After this last output, I ran:

locate geos-config
/home/linuxbrew/.linuxbrew/Cellar/geos/3.9.1/bin/geos-config
/home/linuxbrew/.linuxbrew/bin/geos-config
/usr/bin/geos-config
/usr/share/man/man1/geos-config.1.gz

and tried the installation with:

remotes::install_github('r-spatial/sf', configure.args= '--with-proj-lib=/lib/x86_64-linux-gnu --with-gdal-config=/usr/bin/gdal-config --with-geos-config=/usr/bin/geos-config')

and this time it worked with * DONE (sf) at the end of the installation.

However, I get the following error when trying to load the library:

> library(sf)
Error: package or namespace load failed for ‘sf’ in dyn.load(file, DLLpath = DLLpath, ...):
 unable to load shared object '/home/lionel/R/x86_64-pc-linux-gnu-library/4.0/sf/libs/sf.so':
  /usr/lib/x86_64-linux-gnu/libcurl-gnutls.so.4: undefined symbol: gnutls_srp_allocate_client_credentials, version GNUTLS_3_4

EDIT 2:

Following #1158, I given the output of locate geos-config showed above, I remove the brew geos installation with ▶ brew uninstall geos and I now have:

▶ locate geos-config                 
/usr/bin/geos-config
/usr/share/man/man1/geos-config.1.gz

but still this error when trying to load sf:

> library(sf)
Error: package or namespace load failed for ‘sf’ in dyn.load(file, DLLpath = DLLpath, ...):
 unable to load shared object '/home/lionel/R/x86_64-pc-linux-gnu-library/4.0/sf/libs/sf.so':
  /usr/lib/x86_64-linux-gnu/libcurl-gnutls.so.4: undefined symbol: gnutls_srp_allocate_client_credentials, version GNUTLS_3_4

EDIT3:

After reading various issues that mentioned a similar issue (i.e. Error: package or namespace load failed for ‘sf’ in dyn.load(file, DLLpath = DLLpath, ...):), I did a complete cleanup of all GDAL, GEOS and PROJ and reinstalled them as described in the README.

The simple command install.packages("sf") then worked and I could install sf

However I know have this error message when I try library(sf):

> library(sf)
Error: package or namespace load failed for ‘sf’ in get(Info[i, 1], envir = env):
 lazy-load database '/home/lionel/R/x86_64-pc-linux-gnu-library/4.0/sf/R/sf.rdb' is corrupt
In addition: Warning message:
In get(Info[i, 1], envir = env) : internal error -3 in R_decompress1

EDIT 4:

After reinstalling sf, I now have this error when trying to load the library:

> library(sf)
Error: package or namespace load failed for ‘sf’ in dyn.load(file, DLLpath = DLLpath, ...):
 unable to load shared object '/home/lionel/R/x86_64-pc-linux-gnu-library/4.0/sf/libs/sf.so':
  /usr/lib/x86_64-linux-gnu/libcurl-gnutls.so.4: undefined symbol: gnutls_srp_allocate_client_credentials, version GNUTLS_3_4

I have found issue #1158 and can see that this suggests that there are multiple GDAL installations on my system @rsbivand in #1158 (comment)_.

I have the following output:

▶ locate libgdal.so
/usr/lib/libgdal.so
/usr/lib/libgdal.so.28
/usr/lib/libgdal.so.28.0.1

Does this indicates two versions of GDAL installed (28 and 28.0.1)?

EDIT 5:

I just tried to remove all GDAL installed on my installation and reinstall it with ▶ sudo apt-get install libgdal-dev .

Checkin at installed version of GDAL after this operation returns

▶ locate libgdal                  
/usr/lib/libgdal.a
/usr/lib/libgdal.so
/usr/lib/libgdal.so.28
/usr/lib/libgdal.so.28.0.1
/usr/share/doc/libgdal-dev
/usr/share/doc/libgdal28
/usr/share/doc/libgdal-dev/NEWS.Debian.gz
/usr/share/doc/libgdal-dev/NOTICE
/usr/share/doc/libgdal-dev/changelog.Debian.gz
/usr/share/doc/libgdal-dev/changelog.gz
/usr/share/doc/libgdal-dev/copyright
/usr/share/doc/libgdal28/NOTICE
/usr/share/doc/libgdal28/TODO.Debian
/usr/share/doc/libgdal28/changelog.Debian.gz
/usr/share/doc/libgdal28/changelog.gz
/usr/share/doc/libgdal28/copyright
/usr/share/lintian/overrides/libgdal-dev
/usr/share/lintian/overrides/libgdal28
/var/cache/apt/archives/libgdal-dev_3.2.1+dfsg-1~focal0_amd64.deb
/var/cache/apt/archives/libgdal28_3.2.1+dfsg-1~focal0_amd64.deb
/var/lib/dpkg/info/libgdal-dev.list
/var/lib/dpkg/info/libgdal-dev.md5sums
/var/lib/dpkg/info/libgdal28.list
/var/lib/dpkg/info/libgdal28.md5sums
/var/lib/dpkg/info/libgdal28.shlibs
/var/lib/dpkg/info/libgdal28.symbols
/var/lib/dpkg/info/libgdal28.triggers

So I don't think there are 2 installed versions of GDAL, right?

@edzer or @rsbivand any issues or directions that you may suggest given this output?

Thanks a lot!

@edzer
Copy link
Member

edzer commented Jun 21, 2021

The origin of your troubles seems to be linuxbrew. The last issues you point to seem to be related to gnutls, a library GDAL may link to. Do you have multiple installs of that? Other people here have run into problems when linuxbrew was installed; don't expect support for that.

@lionelvoirol
Copy link
Author

Thanks a lot @edzer for the reply!
Following your reply, I have uninstalled linuxbrew and all packages which were installed with it.
I then check than there is no existing installation of GEOS, GDAL or PROJ with

▶ sudo updatedb 
 lionel@lionel-pc 
▶ locate libproj
 lionel@lionel-pc 
▶ locate libgdal
 lionel@lionel-pc 
▶ locate libgeos
 lionel@lionel-pc 

As you can see, there is apparently no installed GEOS, GDAL or PROJ in my machine.

I also deleted sf rgdal and rgeos from R with command remove.packages()

I then install all three libraries following the README by running:

sudo add-apt-repository ppa:ubuntugis/ubuntugis-unstable
sudo apt-get update
sudo apt-get install libudunits2-dev libgdal-dev libgeos-dev libproj-dev 

I then run the following to see installed versions of GEOS, GDAL or PROJ

▶ sudo updatedb                                           
 lionel@lionel-pc 
▶ locate libproj                                          
/usr/lib/x86_64-linux-gnu/libproj.a
/usr/lib/x86_64-linux-gnu/libproj.la
/usr/lib/x86_64-linux-gnu/libproj.so
/usr/lib/x86_64-linux-gnu/libproj.so.19
/usr/lib/x86_64-linux-gnu/libproj.so.19.2.1
/usr/share/doc/libproj-dev
/usr/share/doc/libproj19
/usr/share/doc/libproj-dev/AUTHORS
/usr/share/doc/libproj-dev/NEWS.Debian.gz
/usr/share/doc/libproj-dev/NEWS.gz
/usr/share/doc/libproj-dev/README
/usr/share/doc/libproj-dev/changelog.Debian.gz
/usr/share/doc/libproj-dev/copyright
/usr/share/doc/libproj19/AUTHORS
/usr/share/doc/libproj19/NEWS.Debian.gz
/usr/share/doc/libproj19/NEWS.gz
/usr/share/doc/libproj19/README
/usr/share/doc/libproj19/changelog.Debian.gz
/usr/share/doc/libproj19/copyright
/var/cache/apt/archives/libproj-dev_7.2.1-1~focal0_amd64.deb
/var/cache/apt/archives/libproj19_7.2.1-1~focal0_amd64.deb
/var/lib/dpkg/info/libproj-dev:amd64.list
/var/lib/dpkg/info/libproj-dev:amd64.md5sums
/var/lib/dpkg/info/libproj19:amd64.list
/var/lib/dpkg/info/libproj19:amd64.md5sums
/var/lib/dpkg/info/libproj19:amd64.shlibs
/var/lib/dpkg/info/libproj19:amd64.symbols
/var/lib/dpkg/info/libproj19:amd64.triggers
 lionel@lionel-pc 
▶ locate libgdal                                          
/usr/lib/libgdal.a
/usr/lib/libgdal.so
/usr/lib/libgdal.so.28
/usr/lib/libgdal.so.28.0.1
/usr/share/doc/libgdal-dev
/usr/share/doc/libgdal28
/usr/share/doc/libgdal-dev/NEWS.Debian.gz
/usr/share/doc/libgdal-dev/NOTICE
/usr/share/doc/libgdal-dev/changelog.Debian.gz
/usr/share/doc/libgdal-dev/changelog.gz
/usr/share/doc/libgdal-dev/copyright
/usr/share/doc/libgdal28/NOTICE
/usr/share/doc/libgdal28/TODO.Debian
/usr/share/doc/libgdal28/changelog.Debian.gz
/usr/share/doc/libgdal28/changelog.gz
/usr/share/doc/libgdal28/copyright
/usr/share/lintian/overrides/libgdal-dev
/usr/share/lintian/overrides/libgdal28
/var/cache/apt/archives/libgdal-dev_3.2.1+dfsg-1~focal0_amd64.deb
/var/cache/apt/archives/libgdal28_3.2.1+dfsg-1~focal0_amd64.deb
/var/lib/dpkg/info/libgdal-dev.list
/var/lib/dpkg/info/libgdal-dev.md5sums
/var/lib/dpkg/info/libgdal28.list
/var/lib/dpkg/info/libgdal28.md5sums
/var/lib/dpkg/info/libgdal28.shlibs
/var/lib/dpkg/info/libgdal28.symbols
/var/lib/dpkg/info/libgdal28.triggers
 lionel@lionel-pc 
▶ locate libgeos                                          
/usr/lib/x86_64-linux-gnu/libgeos-3.9.0.so
/usr/lib/x86_64-linux-gnu/libgeos_c.a
/usr/lib/x86_64-linux-gnu/libgeos_c.so
/usr/lib/x86_64-linux-gnu/libgeos_c.so.1
/usr/lib/x86_64-linux-gnu/libgeos_c.so.1.16.2
/usr/share/doc/libgeos-3.9.0
/usr/share/doc/libgeos-c1v5
/usr/share/doc/libgeos-dev
/usr/share/doc/libgeos-3.9.0/NEWS.Debian.gz
/usr/share/doc/libgeos-3.9.0/changelog.Debian.gz
/usr/share/doc/libgeos-3.9.0/copyright
/usr/share/doc/libgeos-c1v5/NEWS.Debian.gz
/usr/share/doc/libgeos-c1v5/changelog.Debian.gz
/usr/share/doc/libgeos-c1v5/copyright
/usr/share/doc/libgeos-dev/AUTHORS
/usr/share/doc/libgeos-dev/NEWS.Debian.gz
/usr/share/doc/libgeos-dev/NEWS.gz
/usr/share/doc/libgeos-dev/README.Debian
/usr/share/doc/libgeos-dev/README.md.gz
/usr/share/doc/libgeos-dev/changelog.Debian.gz
/usr/share/doc/libgeos-dev/copyright
/var/cache/apt/archives/libgeos-3.9.0_3.9.0-1~focal0_amd64.deb
/var/cache/apt/archives/libgeos-c1v5_3.9.0-1~focal0_amd64.deb
/var/cache/apt/archives/libgeos-dev_3.9.0-1~focal0_amd64.deb
/var/lib/dpkg/info/libgeos-3.9.0:amd64.list
/var/lib/dpkg/info/libgeos-3.9.0:amd64.md5sums
/var/lib/dpkg/info/libgeos-3.9.0:amd64.shlibs
/var/lib/dpkg/info/libgeos-3.9.0:amd64.symbols
/var/lib/dpkg/info/libgeos-3.9.0:amd64.triggers
/var/lib/dpkg/info/libgeos-c1v5:amd64.list
/var/lib/dpkg/info/libgeos-c1v5:amd64.md5sums
/var/lib/dpkg/info/libgeos-c1v5:amd64.shlibs
/var/lib/dpkg/info/libgeos-c1v5:amd64.symbols
/var/lib/dpkg/info/libgeos-c1v5:amd64.triggers
/var/lib/dpkg/info/libgeos-dev.list
/var/lib/dpkg/info/libgeos-dev.md5sums

I then try to install sf with

install.packages("sf")

This then lead to a successful installation procedure with:

> install.packages("sf")
Installing package into ‘/home/lionel/R/x86_64-pc-linux-gnu-library/4.0’
(as ‘lib’ is unspecified)
trying URL 'https://cloud.r-project.org/src/contrib/sf_1.0-0.tar.gz'
Content type 'application/x-gzip' length 3645803 bytes (3.5 MB)
==================================================
downloaded 3.5 MB

* installing *source* package ‘sf’ ...
** package ‘sf’ successfully unpacked and MD5 sums checked
** using staged installation
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: 3.2.1
checking GDAL version >= 2.0.1... 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... /usr/bin/grep
checking for egrep... /usr/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/pcs.csv readable... no
checking GDAL: checking whether PROJ is available for linking:... yes
checking GDAL: checking whether PROJ is available fur running:... yes
configure: GDAL: 3.2.1
configure: pkg-config proj exists, will use it
configure: using proj.h.
configure: PROJ: 7.2.1
checking PROJ: checking whether PROJ and sqlite3 are available for linking:... yes
checking for geos-config... /usr/bin/geos-config
checking geos-config usability... yes
configure: GEOS: 3.9.0
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/lib/x86_64-linux-gnu -lgeos_c... yes
configure: Package CPP flags:   -DHAVE_PROJ_H -I/usr/include/gdal -I/usr/include
configure: Package LIBS: -lproj -lsqlite3 -ltiff -lcurl -lstdc++   -L/usr/lib -lgdal -L/usr/lib/x86_64-linux-gnu -lgeos_c
configure: creating ./config.status
config.status: creating src/Makevars
** libs
g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -DHAVE_PROJ_H -I/usr/include/gdal -I/usr/include -I'/home/lionel/R/x86_64-pc-linux-gnu-library/4.0/Rcpp/include'    -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-tRgc13/r-base-4.0.5=. -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 -DHAVE_PROJ_H -I/usr/include/gdal -I/usr/include -I'/home/lionel/R/x86_64-pc-linux-gnu-library/4.0/Rcpp/include'    -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-tRgc13/r-base-4.0.5=. -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 -DHAVE_PROJ_H -I/usr/include/gdal -I/usr/include -I'/home/lionel/R/x86_64-pc-linux-gnu-library/4.0/Rcpp/include'    -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-tRgc13/r-base-4.0.5=. -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 -DHAVE_PROJ_H -I/usr/include/gdal -I/usr/include -I'/home/lionel/R/x86_64-pc-linux-gnu-library/4.0/Rcpp/include'    -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-tRgc13/r-base-4.0.5=. -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 -DHAVE_PROJ_H -I/usr/include/gdal -I/usr/include -I'/home/lionel/R/x86_64-pc-linux-gnu-library/4.0/Rcpp/include'    -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-tRgc13/r-base-4.0.5=. -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 -DHAVE_PROJ_H -I/usr/include/gdal -I/usr/include -I'/home/lionel/R/x86_64-pc-linux-gnu-library/4.0/Rcpp/include'    -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-tRgc13/r-base-4.0.5=. -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 -DHAVE_PROJ_H -I/usr/include/gdal -I/usr/include -I'/home/lionel/R/x86_64-pc-linux-gnu-library/4.0/Rcpp/include'    -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-tRgc13/r-base-4.0.5=. -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 -DHAVE_PROJ_H -I/usr/include/gdal -I/usr/include -I'/home/lionel/R/x86_64-pc-linux-gnu-library/4.0/Rcpp/include'    -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-tRgc13/r-base-4.0.5=. -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 -DHAVE_PROJ_H -I/usr/include/gdal -I/usr/include -I'/home/lionel/R/x86_64-pc-linux-gnu-library/4.0/Rcpp/include'    -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-tRgc13/r-base-4.0.5=. -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 -DHAVE_PROJ_H -I/usr/include/gdal -I/usr/include -I'/home/lionel/R/x86_64-pc-linux-gnu-library/4.0/Rcpp/include'    -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-tRgc13/r-base-4.0.5=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c mdim.cpp -o mdim.o
g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -DHAVE_PROJ_H -I/usr/include/gdal -I/usr/include -I'/home/lionel/R/x86_64-pc-linux-gnu-library/4.0/Rcpp/include'    -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-tRgc13/r-base-4.0.5=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c ops.cpp -o ops.o
g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -DHAVE_PROJ_H -I/usr/include/gdal -I/usr/include -I'/home/lionel/R/x86_64-pc-linux-gnu-library/4.0/Rcpp/include'    -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-tRgc13/r-base-4.0.5=. -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 -DHAVE_PROJ_H -I/usr/include/gdal -I/usr/include -I'/home/lionel/R/x86_64-pc-linux-gnu-library/4.0/Rcpp/include'    -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-tRgc13/r-base-4.0.5=. -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 -DHAVE_PROJ_H -I/usr/include/gdal -I/usr/include -I'/home/lionel/R/x86_64-pc-linux-gnu-library/4.0/Rcpp/include'    -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-tRgc13/r-base-4.0.5=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c proj_info.cpp -o proj_info.o
g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -DHAVE_PROJ_H -I/usr/include/gdal -I/usr/include -I'/home/lionel/R/x86_64-pc-linux-gnu-library/4.0/Rcpp/include'    -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-tRgc13/r-base-4.0.5=. -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 -DHAVE_PROJ_H -I/usr/include/gdal -I/usr/include -I'/home/lionel/R/x86_64-pc-linux-gnu-library/4.0/Rcpp/include'    -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-tRgc13/r-base-4.0.5=. -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 -DHAVE_PROJ_H -I/usr/include/gdal -I/usr/include -I'/home/lionel/R/x86_64-pc-linux-gnu-library/4.0/Rcpp/include'    -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-tRgc13/r-base-4.0.5=. -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 -DHAVE_PROJ_H -I/usr/include/gdal -I/usr/include -I'/home/lionel/R/x86_64-pc-linux-gnu-library/4.0/Rcpp/include'    -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-tRgc13/r-base-4.0.5=. -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 -DHAVE_PROJ_H -I/usr/include/gdal -I/usr/include -I'/home/lionel/R/x86_64-pc-linux-gnu-library/4.0/Rcpp/include'    -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-tRgc13/r-base-4.0.5=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c wkb.cpp -o wkb.o
g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -DHAVE_PROJ_H -I/usr/include/gdal -I/usr/include -I'/home/lionel/R/x86_64-pc-linux-gnu-library/4.0/Rcpp/include'    -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-tRgc13/r-base-4.0.5=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c zm_range.cpp -o zm_range.o
g++ -std=gnu++11 -shared -L/usr/lib/R/lib -Wl,-Bsymbolic-functions -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 mdim.o ops.o polygonize.o proj.o proj_info.o raster2sf.o sfg.o signed_area.o stars.o wkb.o zm_range.o -lproj -lsqlite3 -ltiff -lcurl -lstdc++ -L/usr/lib -lgdal -L/usr/lib/x86_64-linux-gnu -lgeos_c -L/usr/lib/R/lib -lR
installing to /home/lionel/R/x86_64-pc-linux-gnu-library/4.0/00LOCK-sf/00new/sf/libs
** R
** 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”
in method for ‘coerce’ with signature ‘"crs","CRS"’: no definition for class “CRS”
** help
*** installing help indices
*** copying figures
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
** checking absolute paths in shared objects and dynamic libraries
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (sf)

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

but when I try to load sf I still have:

> library(sf)
Error: package or namespace load failed for ‘sf’ in dyn.load(file, DLLpath = DLLpath, ...):
 unable to load shared object '/home/lionel/R/x86_64-pc-linux-gnu-library/4.0/sf/libs/sf.so':
  /usr/lib/x86_64-linux-gnu/libcurl-gnutls.so.4: undefined symbol: gnutls_srp_allocate_client_credentials, version GNUTLS_3_4

What do you think is the reason for that and how can I solve it?

Thanks a lot for your help

@edzer
Copy link
Member

edzer commented Jun 21, 2021

I wrote:

The last issues you point to seem to be related to gnutls, a library GDAL may link to. Do you have multiple installs of that?

Did you check that?

@lionelvoirol
Copy link
Author

lionelvoirol commented Jun 21, 2021

Okay, so I ran

lionel@lionel-pc  ~  
▶ sudo updatedb                  
 lionel@lionel-pc  ~  
▶ locate gnutls.so

and obtained:

/home/lionel/snap/fakecam/common/.cache/gio-modules/libgiognutls.so
/home/lionel/snap/losslesscut/common/.cache/gio-modules/libgiognutls.so
/home/lionel/snap/mathpix-snipping-tool/common/.cache/gio-modules/libgiognutls.so
/home/lionel/snap/p3x-onenote/common/.cache/gio-modules/libgiognutls.so
/home/lionel/snap/p7zip-desktop/common/.cache/gio-modules/libgiognutls.so
/home/lionel/snap/skype/common/.cache/gio-modules/libgiognutls.so
/home/lionel/snap/slack/common/.cache/gio-modules/libgiognutls.so
/home/lionel/snap/snap-store/common/.cache/gio-modules/libgiognutls.so
/home/lionel/snap/spotify/common/.cache/gio-modules/libgiognutls.so
/home/lionel/snap/vlc/common/.cache/gio-modules/libgiognutls.so
/snap/core/11167/usr/lib/x86_64-linux-gnu/libgnutls.so.30
/snap/core/11167/usr/lib/x86_64-linux-gnu/libgnutls.so.30.6.2
/snap/core/11187/usr/lib/x86_64-linux-gnu/libgnutls.so.30
/snap/core/11187/usr/lib/x86_64-linux-gnu/libgnutls.so.30.6.2
/snap/core18/1997/usr/lib/x86_64-linux-gnu/libgnutls.so.30
/snap/core18/1997/usr/lib/x86_64-linux-gnu/libgnutls.so.30.14.10
/snap/core18/2066/usr/lib/x86_64-linux-gnu/libgnutls.so.30
/snap/core18/2066/usr/lib/x86_64-linux-gnu/libgnutls.so.30.14.10
/snap/fakecam/104/usr/lib/x86_64-linux-gnu/libgnutls.so.30
/snap/fakecam/104/usr/lib/x86_64-linux-gnu/libgnutls.so.30.14.10
/snap/fakecam/104/usr/lib/x86_64-linux-gnu/gio/modules/libgiognutls.so
/snap/gnome-3-28-1804/145/usr/lib/x86_64-linux-gnu/libcurl-gnutls.so.3
/snap/gnome-3-28-1804/145/usr/lib/x86_64-linux-gnu/libcurl-gnutls.so.4
/snap/gnome-3-28-1804/145/usr/lib/x86_64-linux-gnu/libcurl-gnutls.so.4.5.0
/snap/gnome-3-28-1804/145/usr/lib/x86_64-linux-gnu/libgnutls.so.30
/snap/gnome-3-28-1804/145/usr/lib/x86_64-linux-gnu/libgnutls.so.30.14.10
/snap/gnome-3-28-1804/145/usr/lib/x86_64-linux-gnu/gio/modules/libgiognutls.so
/snap/gnome-3-34-1804/66/usr/lib/x86_64-linux-gnu/libcurl-gnutls.so.3
/snap/gnome-3-34-1804/66/usr/lib/x86_64-linux-gnu/libcurl-gnutls.so.4
/snap/gnome-3-34-1804/66/usr/lib/x86_64-linux-gnu/libcurl-gnutls.so.4.5.0
/snap/gnome-3-34-1804/66/usr/lib/x86_64-linux-gnu/libgnutls.so.30
/snap/gnome-3-34-1804/66/usr/lib/x86_64-linux-gnu/libgnutls.so.30.14.10
/snap/gnome-3-34-1804/66/usr/lib/x86_64-linux-gnu/gio/modules/libgiognutls.so
/snap/gnome-3-34-1804/72/usr/lib/x86_64-linux-gnu/libcurl-gnutls.so.3
/snap/gnome-3-34-1804/72/usr/lib/x86_64-linux-gnu/libcurl-gnutls.so.4
/snap/gnome-3-34-1804/72/usr/lib/x86_64-linux-gnu/libcurl-gnutls.so.4.5.0
/snap/gnome-3-34-1804/72/usr/lib/x86_64-linux-gnu/libgnutls.so.30
/snap/gnome-3-34-1804/72/usr/lib/x86_64-linux-gnu/libgnutls.so.30.14.10
/snap/gnome-3-34-1804/72/usr/lib/x86_64-linux-gnu/gio/modules/libgiognutls.so
/snap/mathpix-snipping-tool/195/usr/lib/x86_64-linux-gnu/libgnutls.so.30
/snap/mathpix-snipping-tool/195/usr/lib/x86_64-linux-gnu/libgnutls.so.30.6.2
/snap/mathpix-snipping-tool/195/usr/lib/x86_64-linux-gnu/gio/modules/libgiognutls.so
/snap/p7zip-desktop/220/usr/lib/x86_64-linux-gnu/libgnutls.so.30
/snap/p7zip-desktop/220/usr/lib/x86_64-linux-gnu/libgnutls.so.30.6.2
/snap/p7zip-desktop/220/usr/lib/x86_64-linux-gnu/gio/modules/libgiognutls.so
/snap/skype/173/usr/lib/x86_64-linux-gnu/libgnutls.so.30
/snap/skype/173/usr/lib/x86_64-linux-gnu/libgnutls.so.30.14.10
/snap/skype/173/usr/lib/x86_64-linux-gnu/gio/modules/libgiognutls.so
/snap/skype/176/usr/lib/x86_64-linux-gnu/libgnutls.so.30
/snap/skype/176/usr/lib/x86_64-linux-gnu/libgnutls.so.30.14.10
/snap/skype/176/usr/lib/x86_64-linux-gnu/gio/modules/libgiognutls.so
/snap/slack/40/usr/lib/x86_64-linux-gnu/libgnutls.so.30
/snap/slack/40/usr/lib/x86_64-linux-gnu/libgnutls.so.30.6.2
/snap/slack/40/usr/lib/x86_64-linux-gnu/gio/modules/libgiognutls.so
/snap/slack/42/usr/lib/x86_64-linux-gnu/libgnutls.so.30
/snap/slack/42/usr/lib/x86_64-linux-gnu/libgnutls.so.30.14.10
/snap/slack/42/usr/lib/x86_64-linux-gnu/gio/modules/libgiognutls.so
/snap/snap-store/542/usr/lib/x86_64-linux-gnu/libcurl-gnutls.so.3
/snap/snap-store/542/usr/lib/x86_64-linux-gnu/libcurl-gnutls.so.4
/snap/snap-store/542/usr/lib/x86_64-linux-gnu/libcurl-gnutls.so.4.5.0
/snap/snap-store/542/usr/lib/x86_64-linux-gnu/libgnutls.so.30
/snap/snap-store/542/usr/lib/x86_64-linux-gnu/libgnutls.so.30.14.10
/snap/snap-store/547/usr/lib/x86_64-linux-gnu/libcurl-gnutls.so.3
/snap/snap-store/547/usr/lib/x86_64-linux-gnu/libcurl-gnutls.so.4
/snap/snap-store/547/usr/lib/x86_64-linux-gnu/libcurl-gnutls.so.4.5.0
/snap/snap-store/547/usr/lib/x86_64-linux-gnu/libgnutls.so.30
/snap/snap-store/547/usr/lib/x86_64-linux-gnu/libgnutls.so.30.14.10
/snap/spotify/45/usr/lib/x86_64-linux-gnu/libcurl-gnutls.so.3
/snap/spotify/45/usr/lib/x86_64-linux-gnu/libcurl-gnutls.so.4
/snap/spotify/45/usr/lib/x86_64-linux-gnu/libcurl-gnutls.so.4.5.0
/snap/spotify/45/usr/lib/x86_64-linux-gnu/libgnutls.so.30
/snap/spotify/45/usr/lib/x86_64-linux-gnu/libgnutls.so.30.14.10
/snap/spotify/45/usr/lib/x86_64-linux-gnu/gio/modules/libgiognutls.so
/snap/spotify/46/usr/lib/x86_64-linux-gnu/libcurl-gnutls.so.3
/snap/spotify/46/usr/lib/x86_64-linux-gnu/libcurl-gnutls.so.4
/snap/spotify/46/usr/lib/x86_64-linux-gnu/libcurl-gnutls.so.4.5.0
/snap/spotify/46/usr/lib/x86_64-linux-gnu/libgnutls.so.30
/snap/spotify/46/usr/lib/x86_64-linux-gnu/libgnutls.so.30.14.10
/snap/spotify/46/usr/lib/x86_64-linux-gnu/gio/modules/libgiognutls.so
/snap/vlc/2103/usr/lib/x86_64-linux-gnu/libgnutls.so.30
/snap/vlc/2103/usr/lib/x86_64-linux-gnu/libgnutls.so.30.14.10
/snap/vlc/2103/usr/lib/x86_64-linux-gnu/gio/modules/libgiognutls.so
/snap/vlc/2288/usr/lib/x86_64-linux-gnu/libgnutls.so.30
/snap/vlc/2288/usr/lib/x86_64-linux-gnu/libgnutls.so.30.14.10
/snap/vlc/2288/usr/lib/x86_64-linux-gnu/gio/modules/libgiognutls.so
/usr/lib/libgnutls.so.30
/usr/lib/x86_64-linux-gnu/libcurl-gnutls.so
/usr/lib/x86_64-linux-gnu/libcurl-gnutls.so.3
/usr/lib/x86_64-linux-gnu/libcurl-gnutls.so.4
/usr/lib/x86_64-linux-gnu/libcurl-gnutls.so.4.6.0
/usr/lib/x86_64-linux-gnu/libgnutls.so.30
/usr/lib/x86_64-linux-gnu/libgnutls.so.30.27.0
/usr/lib/x86_64-linux-gnu/libneon-gnutls.so.27
/usr/lib/x86_64-linux-gnu/libneon-gnutls.so.27.3.2
/usr/lib/x86_64-linux-gnu/gio/modules/libgiognutls.so
/var/lib/flatpak/runtime/org.freedesktop.Platform/x86_64/20.08/f7ca632f38fbf46f8ec2ad01cd2cb123e1683d58a9b29ecefa352edae383b17c/files/lib/x86_64-linux-gnu/libgnutls.so.30
/var/lib/flatpak/runtime/org.freedesktop.Platform/x86_64/20.08/f7ca632f38fbf46f8ec2ad01cd2cb123e1683d58a9b29ecefa352edae383b17c/files/lib/x86_64-linux-gnu/libgnutls.so.30.28.1
/var/lib/flatpak/runtime/org.freedesktop.Platform/x86_64/20.08/f7ca632f38fbf46f8ec2ad01cd2cb123e1683d58a9b29ecefa352edae383b17c/files/lib/x86_64-linux-gnu/gio/modules/libgiognutls.so
/var/lib/flatpak/runtime/org.gnome.Platform/x86_64/3.36/d2d28ade097d961b4938cac265d5f0ac1a0baafb7aa023d67f888594800df355/files/lib/x86_64-linux-gnu/libgnutls.so.30
/var/lib/flatpak/runtime/org.gnome.Platform/x86_64/3.36/d2d28ade097d961b4938cac265d5f0ac1a0baafb7aa023d67f888594800df355/files/lib/x86_64-linux-gnu/libgnutls.so.30.27.0
/var/lib/flatpak/runtime/org.gnome.Platform/x86_64/3.36/d2d28ade097d961b4938cac265d5f0ac1a0baafb7aa023d67f888594800df355/files/lib/x86_64-linux-gnu/gio/modules/libgiognutls.so
/var/lib/flatpak/runtime/org.gnome.Platform/x86_64/40/2a2992ab0413ae5e067983a9d0e186289f84ea6b9e2bbb17523879131dd354f7/files/lib/x86_64-linux-gnu/libgnutls.so.30
/var/lib/flatpak/runtime/org.gnome.Platform/x86_64/40/2a2992ab0413ae5e067983a9d0e186289f84ea6b9e2bbb17523879131dd354f7/files/lib/x86_64-linux-gnu/libgnutls.so.30.28.1
/var/lib/flatpak/runtime/org.gnome.Platform/x86_64/40/2a2992ab0413ae5e067983a9d0e186289f84ea6b9e2bbb17523879131dd354f7/files/lib/x86_64-linux-gnu/gio/modules/libgiognutls.so

so apparently there are different versions of gnutls installed and this is a bit of a mess. Do you know how I can find where each versions is installed and how to remove each of them? I am gonna remove them and will tell you how does this improve the situation.

Thanks!

@lionelvoirol
Copy link
Author

Should I just go to /usr/lib/x86_64-linux-gnu/ and remove all .so files except libgnutls.so.30.27.0 manually or is there an other way to remove all these files? It is also not clear to me why there are so many xxgnutls.so.xx files in different repository for different applications. Any tips?

Thanks!

@edzer
Copy link
Member

edzer commented Jun 21, 2021

I have no clue.

@edzer
Copy link
Member

edzer commented Jun 23, 2021

See #1685.

@edzer edzer closed this as completed Jun 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants