繁体   English   中英

安装 rgdal 时“目标 'projectit.o' 的配方失败”

[英]“recipe for target 'projectit.o' failed” while installing rgdal

在 R 中安装rgdal_1.5-15时出现以下错误(我在 Ubuntu 18.04.4 LTS GNU/Linux 4.15.0-112-generic x86_64 上):

projectit.cpp:159:6: error: conflicting declaration of C function ‘SEXPREC* transform_ng(SEXP, SEXP, SEXP, SEXP, SEXP, SEXP, SEXP)’
SEXP transform_ng(SEXP fromargs, SEXP toargs, SEXP coordOp, SEXP npts, SEXP x, SEXP y, SEXP z SEXP aoi) {
  ^~~~~~~~~~~~
In file included from projectit.cpp:11:0:
rgdal.h:132:6: note: previous declaration ‘SEXPREC* transform_ng(SEXP, SEXP, SEXP, SEXP, SEXP, SEXP, SEXP, SEXP)’
SEXP transform_ng(SEXP fromargs, SEXP toargs, SEXP coordOp, SEXP npts, SEXP x, SEXP y, SEXP z, SEXP aoi); // both
  ^~~~~~~~~~~~
/usr/lib/R/etc/Makeconf:176: recipe for target 'projectit.o' failed
make: *** [projectit.o] Error 1
ERROR: compilation failed for package ‘rgdal’

我通过安装旧版本(rgdal_1.4-8)解决了这个问题。 这对我来说似乎是一个错误,但我找不到提交错误报告的存储库(他们的 github 是只读的)。 任何有关寻找帮助的帮助将不胜感激。

更新: rgdal 1.5-16 已发布,修复了 Ubuntu 18.04。 仍然建议升级 GDAL 和 PROJ(如果可能),新版本可以从UbuntuGIS获得或直接从源代码构建。

原始答案:我就此错误联系了 rgdal 维护人员,他们表示在针对 GDAL 和 PROJ 的过时版本构建 rgdal 时,这是一个已知问题。 要解决该错误,他们建议通过运行以下命令安装 package 的开发版本:

install.packages("rgdal", repos="http://R-Forge.R-project.org")

Ubuntu 18.04 目前有 GDAL 2.2.3 和 PROJ 4.9.3。 根据CRAN 上的 rgdal 页面,rgdal 仍应与这些版本的 GDAL 和 PROJ 一起使用,但与这两个软件包的上游版本相比,它们已经过时了。 rgdal 维护者强烈建议运行最新版本的 GDAL 和 PROJ,以便利用最新的修复、改进和 API 更改。

这个问题现在通过 CRAN 上新版本的 rgdal_1.5-16 得到解决。

https://twitter.com/RogerBivand/status/1291622288211750913?s=20

暂无
暂无

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

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