无法在Red hat linux上安装rgdal和rgeos R库

11

在我们的Redhat Linux机器上编译rgdal adn rgoes软件包时,我遇到了错误。我尝试过一些研究,但找不到可能的解决方案。由于这对我来说非常重要,请您帮忙解决问题,谢谢。

**ERROR WHILE COMPILING RGDAL in R 3.0**

**strong text**
* installing *source* package ârgdalâ ...
** package ârgdalâ successfully unpacked and MD5 sums checked
configure: CC: gcc -std=gnu99
configure: CXX: g++
configure: rgdal: 0.8-10
checking for /usr/bin/svnversion... yes
configure: svn revision: 496
configure: gdal-config: gdal-config
checking gdal-config usability... ./configure: line 1397: gdal-config: command not found
no
Error: gdal-config not found
The gdal-config script distributed with GDAL could not be found.
If you have not installed the GDAL libraries, you can
download the source from  http://www.gdal.org/
If you have installed the GDAL libraries, then make sure that
gdal-config is in your path. Try typing gdal-config at a
shell prompt and see if it runs. If not, use:
--configure-args='--with-gdal-config=/usr/local/bin/gdal-config'
with appropriate values for your installation.

ERROR: configuration failed for package ârgdalâ


*****ERROR WHILE COMPILING RGEOS:*****
**strong text**
* installing *source* package ârgeosâ ...
** package ârgeosâ successfully unpacked and MD5 sums checked
configure: CC: gcc -std=gnu99
configure: CXX: g++
configure: rgeos: 0.2-17
checking for /usr/bin/svnversion... yes
configure: svn revision: 413M
checking geos-config usability... ./configure: line 1385: geos-config: command not found
no
configure: error: geos-config not usable
ERROR: configuration failed for package ârgeosâ

6
你是否已安装C(++)库libgeos-devlibgdal1-dev?如果没有,请先安装它们。 - Justin
谢谢回复,贾斯汀。您的意思是我必须先安装这些库,然后才能从www dot rgeos dot com安装GDAL库吗?您介意分享一下如何使rgdal和rgeos软件包运行的步骤吗?我很难弄清楚...但我们的用户正在寻找这些软件包... - user2448881
1
@Justin 谢谢。我感觉每次在新机器上安装时都会遇到这个问题。我希望这个依赖关系能够更明确地列出(除了在 Stack Overflow 上搜索以外,我不确定该如何回退到 GEOS 库 = libgeos-dev)。 - MichaelChirico
2个回答

14

在Fedora 20上,您需要安装geosgeos-devel

sudo yum install geos geos-devel

之后在R中编译成功了!

** building package indices
** installing vignettes
** testing if installed package can be loaded
* DONE (gstat)

The downloaded source packages are in
    ‘/tmp/Rtmp9ciIzG/downloaded_packages’

2
我想补充一下,如果有其他人从Linux Mint / Ubuntu通过谷歌搜索到这里,正确安装的软件包是libgeoslibgeos-dev - MichaelChirico

-2

我不在Redhat上(我在Ubuntu上),所以可能有人能够提供更好的软件包名称...但是,当从源代码安装软件包时,您需要所需库的dev版本。在这种情况下,您可能需要安装:

libgdal1-dev
libgeos-dev

所以:

yum install libgdal1 libgdal1-dev libgeos libgeos-dev

然后在R中:

install.packages('gdal')

这个还没有经过测试,因为我不想要与这两个相关的所有额外包!


1
非常感谢,Justin。然而,当我运行 sudo yum install libgdal1 libgdal1-dev libgeos libgeos-dev 时,我得到了以下信息:没有可用的 libgdal1 包,没有可用的 libgdal1-dev 包,geos-3.4.2-1.3.amzn1.x86_64 包已经安装并且是最新版本,没有可用的 libgeos-dev 包。 - Michael Davidson

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接