【问题标题】:install rgdal on ubuntu 18.04在 ubuntu 18.04 上安装 rgdal
【发布时间】:2019-10-20 02:25:19
【问题描述】:

我正在尝试在 Ubuntu 18.04 上安装 rgdal。

我现在收到的错误消息是:

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’

在尝试在 R 中安装“rgdal”之前,我做了以下操作

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

不知道我还应该尝试什么。提前谢谢!

【问题讨论】:

  • 升级前是否也安装了它们? sudo apt-get install libgdal-dev libproj-dev gdal-bin?
  • 是的,我做到了@SeGa

标签: r ubuntu rgdal


【解决方案1】:

您首先必须安装依赖库。 R 也必须 >3.3.0。

sudo apt-get install libgdal1-dev libproj-dev

如果这不起作用,请确保您安装了 C++

g++: command not found

从控制台而不是在 R 中安装 R-Packages 也是一个更好的解决方案,因为机器上的每个用户都可以访问该包。否则它只会在您的个人图书馆中。

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

【讨论】:

    猜你喜欢
    • 2023-03-15
    • 2020-09-05
    • 2017-08-16
    • 2021-02-25
    • 2021-12-01
    • 2019-04-03
    • 1970-01-01
    • 2016-03-10
    • 2018-04-18
    相关资源
    最近更新 更多