install rgdal on ubuntu 18.04

旧巷老猫 提交于 2020-12-12 04:01:45

问题


I am trying to install rgdal on Ubuntu 18.04.

The error message I am having now is:

configure: R_HOME: /usr/lib/R
configure: CC: gcc -std=gnu99
configure: CXX: g++ -std=gnu++11
configure: C++11 support available
configure: rgdal: 1.4-4
checking for /usr/bin/svnversion... no
configure: svn revision: 833
checking for gdal-config... /home/kchen/anaconda3/bin/gdal-config
checking gdal-config usability... yes
configure: GDAL: 2.3.3
checking C++11 support for GDAL >= 2.3.0... yes
checking GDAL version >= 1.11.4... yes
checking GDAL version <= 2.5 or >= 3.0... yes
checking gdal: linking with --libs only... no
checking gdal: linking with --libs and --dep-libs... no
/usr/lib/x86_64-linux-gnu/libdapserver.so.7: undefined reference to `uuid_generate@UUID_1.0'
/usr/lib/x86_64-linux-gnu/libdapserver.so.7: undefined reference to `uuid_unparse@UUID_1.0'
collect2: error: ld returned 1 exit status
/home/kchen/anaconda3/lib/libcurl.so: undefined reference to `SSL_CTX_set_ciphersuites@OPENSSL_1_1_1'
/home/kchen/anaconda3/lib/libcurl.so: undefined reference to `SSL_CTX_set_post_handshake_auth@OPENSSL_1_1_1'
/home/kchen/anaconda3/lib/libcurl.so: undefined reference to `SSL_CTX_set_keylog_callback@OPENSSL_1_1_1'
collect2: error: ld returned 1 exit status
configure: Install failure: compilation and/or linkage problems.
configure: error: GDALAllRegister not found in libgdal.
ERROR: configuration failed for package ‘rgdal’

I did the followings before trying to install 'rgdal' in R

$ sudo apt-get upgrade libgdal-dev
$ sudo apt-get upgrade libproj-dev
$ sudo apt-get upgrade gdal-bin

Not sure what else should I try. Thank you in advance!


回答1:


You first have to install the dependend libraries. R also has to be >3.3.0.

sudo apt-get install libgdal1-dev libproj-dev

If that does not work, get sure you installed C++

g++: command not found

It is also a better solution to install the R-Packages from the console, not inside R, since every user on the machine will have access to the package then. Otherwise it will just be in your personal library.

sudo su - -c "R -e \"install.packages('rgdal', repos='http://cran.rstudio.com/')\""


来源:https://stackoverflow.com/questions/56445865/install-rgdal-on-ubuntu-18-04

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!