繁体   English   中英

在 ubuntu 16.04 上安装 rgdal 的问题

[英]trouble in installing rgdal on ubuntu 16.04

我一直在尝试在 R 3.4.2 (RStudio 1.1.383) 和 ubuntu 16.04 上安装 rgdal,但它总是以问题告终。

我遵循了许多建议,例如手动安装 libproj-dev 等依赖项,或者我最后一次尝试使用homebrew

我能够安装 gdal 1.11.3,但这还不够。

这是我写时的输出

    install.packages('rgdal', type = "source", configure.args=c('--with-proj-include=/usr/local/include','--with-proj-lib=/usr/local/lib'))

Installing package into ‘/home/tupac/R/x86_64-pc-linux-gnu-library/3.4’
(as ‘lib’ is unspecified)
essai de l'URL 'https://cran.rstudio.com/src/contrib/rgdal_1.2-15.tar.gz'
Content type 'application/x-gzip' length 1648779 bytes (1.6 MB)
==================================================
downloaded 1.6 MB

* installing *source* package ‘rgdal’ ...
** package ‘rgdal’ correctement décompressé et sommes MD5 vérifiées
configure: CC: gcc -std=gnu99
configure: CXX: g++
configure: rgdal: 1.2-15
checking for /usr/bin/svnversion... no
configure: svn revision: 691
checking for gdal-config... /usr/bin/gdal-config
checking gdal-config usability... yes
configure: GDAL: 1.11.3
checking GDAL version >= 1.6.3... yes
checking gdal: linking with --libs only... yes
checking GDAL: /usr/share/gdal/1.11/pcs.csv readable... yes
configure: -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -I/usr/local/include 
checking proj_api.h presence and usability... no
configure: error: proj_api.h not found in standard or given locations.
ERROR: configuration failed for package ‘rgdal’
* removing ‘/home/tupac/R/x86_64-pc-linux-gnu-library/3.4/rgdal’
Warning in install.packages :
  installation of package ‘rgdal’ had non-zero exit status

该错误“找不到proj_api.h”也已在同发现,但同时,它似乎对许多其他用户的工作给出的解决方案不工作,我的情况。

感谢您帮助我解决此问题。

我终于能够找到解决方案。

我跟着这篇文章的答案

奇迹代码是

sudo add-apt-repository -y ppa:ubuntugis/ubuntugis-unstable
sudo apt update
sudo apt install gdal-bin python-gdal python3-gdal libgdal1-dev

谢谢你的帮助

在CFLAGS中显式添加include路径对我有用

install.packages('rgdal', type = "source", configure.args=c('CFLAGS=-I/apps/proj4/5.2.0/include'))

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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