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

sf fails to install on ubuntu 20.04 (GDAL?) #2121

Closed
maksymiuks opened this issue Mar 15, 2023 · 7 comments
Closed

sf fails to install on ubuntu 20.04 (GDAL?) #2121

maksymiuks opened this issue Mar 15, 2023 · 7 comments

Comments

@maksymiuks
Copy link

Hi

to begin with, I'm sorry to start yet another issue regarding installation failures, but I've dug through:

#844
#1377
#2092
https://github.com/r-spatial/sf#ubuntu
https://github.com/r-spatial/sf#multiple-gdal-geos-andor-proj-versions-on-your-system

only to find that none of the suggestions works for me. That's why I decided to start this.

I'm trying to install sf package in the ubuntu 20.04 docker image, unfortunately, this is the output I'm getting

** testing if installed package can be loaded from temporary location
Error: package or namespace load failed for ‘sf’ in dyn.load(file, DLLpath = DLLpath, ...):
 unable to load shared object '/opt/autovalidate-r/lib/00LOCK-sf/00new/sf/libs/sf.so':
  /opt/autovalidate-r/lib/00LOCK-sf/00new/sf/libs/sf.so: undefined symbol: _Z21CPL_gdalmdimtranslateN4Rcpp6VectorILi16ENS_15PreserveStorageEEES2_S2_S2_S2_b
Error: loading failed
Execution halted
ERROR: loading failed

where autovalidate-r/ is a custom library to which I install packages. To exclude rule out the problem of double installation I've run which and also search through the entire file system

/home/root# which -a gdal-config
/usr/bin/gdal-config
/bin/gdal-config
/home/root# find / -name "*libgdal*"
/usr/share/lintian/overrides/libgdal-dev
/usr/share/lintian/overrides/libgdal26
/usr/share/doc/libgdal-dev
/usr/share/doc/libgdal26
/usr/lib/libgdal.so
/usr/lib/libgdal.a
/usr/lib/libgdal.so.26
/usr/lib/ogdi/libgdal.so
/usr/lib/libgdal.so.26.0.4
/var/lib/dpkg/info/libgdal-dev.list
/var/lib/dpkg/info/libgdal26.symbols
/var/lib/dpkg/info/libgdal26.triggers
/var/lib/dpkg/info/libgdal-dev.md5sums
/var/lib/dpkg/info/libgdal26.shlibs
/var/lib/dpkg/info/libgdal26.list
/var/lib/dpkg/info/libgdal26.md5sums
/home/root# find / -name "*libproj*"
/usr/share/doc/libproj-dev
/usr/share/doc/libproj15
/usr/lib/x86_64-linux-gnu/libproj.so.15
/usr/lib/x86_64-linux-gnu/libproj.a
/usr/lib/x86_64-linux-gnu/libproj.so.15.3.1
/usr/lib/x86_64-linux-gnu/libproj.so
/usr/lib/x86_64-linux-gnu/libproj.la
/var/lib/dpkg/info/libproj-dev:amd64.list
/var/lib/dpkg/info/libproj15:amd64.symbols
/var/lib/dpkg/info/libproj-dev:amd64.md5sums
/var/lib/dpkg/info/libproj15:amd64.md5sums
/var/lib/dpkg/info/libproj15:amd64.triggers
/var/lib/dpkg/info/libproj15:amd64.shlibs
/var/lib/dpkg/info/libproj15:amd64.list
/home/root# find / -name "*libgeos*"
/usr/share/lintian/overrides/libgeos-3.8.0
/usr/share/doc/libgeos-dev
/usr/share/doc/libgeos-3.8.0
/usr/share/doc/libgeos-c1v5
/usr/lib/x86_64-linux-gnu/libgeos_c.so.1
/usr/lib/x86_64-linux-gnu/libgeos_c.so
/usr/lib/x86_64-linux-gnu/libgeos_c.so.1.13.1
/usr/lib/x86_64-linux-gnu/libgeos_c.a
/usr/lib/x86_64-linux-gnu/libgeos-3.8.0.so
/var/lib/dpkg/info/libgeos-c1v5:amd64.shlibs
/var/lib/dpkg/info/libgeos-dev.list
/var/lib/dpkg/info/libgeos-c1v5:amd64.md5sums
/var/lib/dpkg/info/libgeos-3.8.0:amd64.list
/var/lib/dpkg/info/libgeos-c1v5:amd64.symbols
/var/lib/dpkg/info/libgeos-c1v5:amd64.triggers
/var/lib/dpkg/info/libgeos-3.8.0:amd64.triggers
/var/lib/dpkg/info/libgeos-c1v5:amd64.list
/var/lib/dpkg/info/libgeos-3.8.0:amd64.symbols
/var/lib/dpkg/info/libgeos-3.8.0:amd64.shlibs
/var/lib/dpkg/info/libgeos-dev.md5sums
/var/lib/dpkg/info/libgeos-3.8.0:amd64.md5sums

Surprisingly, the problem occurs only for versions 1.0-11 (latest) and 1.0-10 (archive). Installation of the old release 1.0-9 succeeds without any issues. Therefore I also attach session info with attached sf 1.0-9 to capture R dependencies.

loaded via a namespace (and not attached):
 [1] compiler_4.2.2     magrittr_2.0.3     class_7.3-21       tools_4.2.2       
 [5] DBI_1.1.3          units_0.8-1        proxy_0.4-27       Rcpp_1.0.10       
 [9] KernSmooth_2.23-20 grid_4.2.2         e1071_1.7-13       classInt_0.4-9 

I've tried playing with LD_LIBRARY_PATH, preloading libs with dyn.load() and obviously reinstalling all packages. Neither approach succeeded. And what bugs me the most is the fact everything works for the old realease.

I'll appreciate any bit of advice on how I could address this issue.

@edzer
Copy link
Member

edzer commented Mar 15, 2023

If you'd share a minimal Dockerfile that reproduces your problem, I could take a look.

@bart1
Copy link
Contributor

bart1 commented Mar 15, 2023

I can confirm I get the same error installing on my desktop ubuntu 20.04 machine

edzer added a commit that referenced this issue Mar 16, 2023
@edzer
Copy link
Member

edzer commented Mar 16, 2023

Thanks, 1d0302a might have fixed this.

@bart1
Copy link
Contributor

bart1 commented Mar 16, 2023

@edzer the development version from github now installs without a problem

@maksymiuks
Copy link
Author

@edzer Installing the package from the commit you've provided succeeded! 🥳 Thank you so much for such a fast reaction.

May I ask if you are intending to bring these changes to CRAN reasonably soon? Or do you prefer to wait considering recent releases?

@ssj1739
Copy link

ssj1739 commented Mar 16, 2023

Just as an FYI, I was having the same issue on Ubuntu 18.04, using GDAL 3.0.4, GEOS 3.8.0, and proj 7.0.0. Checked up and down for any extra GDAL/GEOS/PROJ versions, removed and reinstalled existing installs.
Solved by installing latest GitHub version from remotes::install_github("r-spatial/sf").

Thank you!

@edzer
Copy link
Member

edzer commented Mar 17, 2023

Thanks!

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

4 participants