错误:找不到gdal-config

请指出我缺less的一点:

openSUSE 11.3


anisha@linux-y3pi:~/Desktop/R> sudo R CMD INSTALL rgdal_0.7-12.tar.gz root's password: * installing to library '/usr/lib64/R/library' * installing *source* package 'rgdal' ... ** package 'rgdal' successfully unpacked and MD5 sums checked configure: gdal-config: gdal-config checking gdal-config usability... ./configure: line 1353: 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' * removing '/usr/lib64/R/library/rgdal' 

 anisha@linux-y3pi:~/Desktop/R> whereis gdal-config gdal-config: /usr/local/bin/gdal-config anisha@linux-y3pi:~/Desktop/R> gdal-config Usage: gdal-config [OPTIONS] Options: [--prefix[=DIR]] [--libs] [--dep-libs] [--cflags] [--datadir] [--version] [--ogr-enabled] [--formats] anisha@linux-y3pi:~/Desktop/R> 

 > sessionInfo() R version 2.15.1 (2012-06-22) Platform: x86_64-unknown-linux-gnu (64-bit) locale: [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C [3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8 [5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 [7] LC_PAPER=C LC_NAME=C [9] LC_ADDRESS=C LC_TELEPHONE=C [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C attached base packages: [1] stats graphics grDevices utils datasets methods base > 

编辑:


 anisha@linux-y3pi:~/Desktop/R> gdal-config --version 1.9.0 anisha@linux-y3pi:~/Desktop/R> proj Rel. 4.8.0, 6 March 2012 usage: proj [ -beEfiIlormsStTvVwW [args] ] [ +opts[=arg] ] [ files ] 

 linux-y3pi:~ # $PATH bash: /home/anisha/qtsdk-2010.05/qt/bin/:/home/anisha/qtsdk-2010.05/bin:/home/anisha/qtsdk-2010.05/qt/bin:/home/anisha/qtsdk-2010.05/qt/bin/:/home/anisha/qtsdk-2010.05/bin:/usr/lib64/mpi/gcc/openmpi/bin:/home/anisha/bin:/usr/local/bin:/usr/bin:/sbin:/usr/sbin:/bin:/usr/bin/X11:/usr/X11R6/bin:/usr/games: No such file or directory 

除了正常的部署包之外,您还需要使用包头和共享库链接进行开发-dev包。 就发行而言,有两种不同的用例。

在我的发行版上:

 edd@max:/tmp$ dpkg -l | grep gdal | cut -c-72 ii libgdal1-1.7.0 1.7.3-6ubuntu3 ii libgdal1-dev 1.7.3-6ubuntu3 edd@max:/tmp$ 

R CMD INSTALL rgdal_0.7-8.tar.gz工作得很好,正如你所期待的那样,在CRAN所有的构建时间检查中,CRAN包都是如此。

2016年末更新:正如@JoshO'Brien在评论中指出的那样

次要更新:在2016年,运行Ubuntu 14.04.2, libgdal1h似乎取代了libgdal1 (尽管仍然需要libgdal1-dev )。 至少我得到这样的错误,当我试图apt-get install libgdal1

对于Ubuntu 16.04相应的行将是
sudo apt-get install libgdal1i

上游库的这种重命名是常见的; 诸如apt-cache search libgdal可以帮助查找当前的软件包名称。 然而, 重要的关键是,“抽象”开发包libgdal-dev是所有需要构建的,因为它通过依赖关系libgdal1i “具体”当前运行时包(这里是: libgdal1i )。

您可以使用apt-file软件包来查找哪个软件包包含您正在查找的丢失文件。

首先使用apt-get install apt-file命令apt-get install apt-file
使用apt-file update命令apt-file update
现在你可以使用apt-file找到丢失的文件。 apt-file search gdal-config

对于我的情况,从svn配置grass-7.1时出现同样的错误。 如下所示:

  $ ./configure ...more... checking whether to use GDAL... yes checking for gdal-config... /usr/bin/gdal-config ...more.... ./configure: 1: ./configure: /usr/bin/gdal-config: not found ./configure: 6093: test: =: unexpected operator configure: error: *** Unable to locate GDAL library. 

但是,在使用apt-file来查找gdal-config文件(如下所示)之后,我可以在安装软件包libgdal1-dev后解决错误

 $ apt-file search gdal-config 

结果

 libgdal1-dev: /usr/bin/gdal-config 

所以我安装了libgdal1-dev ,如下图所示:

 $ sudo apt-get install libgdal1-dev 

阅读参考手册。

用于从源代码构建的SystemRequirements: http://trac.osgeo中 http://trac.osgeo.org/gdal/wiki/DownloadSource和PROJ.4(proj> = 4.4.9)的GDAL> = 1.6.0库。 org / proj / ;

在CentOS 6上试试这个

 sudo yum install gdal gdal-python gdal-devel mapserver mapserver-python libxml2 libxml2-python python-lxml python-pip python-devel gcc