2012-08-27 38 views
27

请你指出我错过了点:错误:@中,配置未发现

的openSUSE 11.3


[email protected]:~/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’ 

[email protected]:~/Desktop/R> whereis gdal-config 
gdal-config: /usr/local/bin/gdal-config 

[email protected]:~/Desktop/R> gdal-config 
Usage: gdal-config [OPTIONS] 
Options: 
[--prefix[=DIR]] 
[--libs] 
[--dep-libs] 
[--cflags] 
[--datadir] 
[--version] 
[--ogr-enabled] 
[--formats] 
[email protected]:~/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  
> 

编辑:


[email protected]:~/Desktop/R> gdal-config --version 
1.9.0 

[email protected]:~/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 

回答

47

您需要-dev包头文件和共享库链接,发展除了正常的包部署。就发行而言,有两种不同的用例。

在我的分布:

[email protected]:/tmp$ dpkg -l | grep gdal | cut -c-72 
ii libgdal1-1.7.0        1.7.3-6ubuntu3   
ii libgdal1-dev         1.7.3-6ubuntu3   
[email protected]:/tmp$ 

R CMD INSTALL rgdal_0.7-8.tar.gz作品就好了,你会从CRAN包期望给所有的编译时检查在CRAN。

更新2016晚:如@ JoshO'Brien在评论指出

Minor update: Here in 2016, running Ubuntu 14.04.2, libgdal1h seems to have replaced libgdal1 (though libgdal1-dev is still needed). At least I get an error to that effect when I attempted to apt-get install libgdal1

为Ubuntu 16.04相应的线路将
sudo apt-get install libgdal1i

上游库的这种重命名是常见的;诸如apt-cache search libgdal之类的东西可以帮助找到当前的软件包名称。但关键在于“抽象”开发包libgdal-dev是构建所需的全部内容,因为它通过依赖关系抽取“具体”当前运行时包(此处为:libgdal1i)。

+0

次要更新:在2016年,运行Ubuntu 14.04.2,'libgdal1h'似乎已经替换了'libgdal1'(尽管仍然需要'libgdal1-dev')。至少我在尝试“apt-get install libgdal1”时遇到错误。 –

4

阅读参考手册。

SystemRequirements for building from source: GDAL >= 1.6.0 library from http://trac.osgeo.org/gdal/wiki/DownloadSource and PROJ.4 (proj >= 4.4.9) from http://trac.osgeo.org/proj/ ;

+0

我已经加入GDAL配置的版本的上方。我也检查proj4。但是,proj4与“这个”错误有关吗? –

+0

我已经安装了proj,请参阅编辑。问题仍然存在。 –

23

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

首先使用命令apt-get install apt-file
更新的apt-文件使用命令apt-file update
现在你可以使用的apt-文件找到丢失的文件安装的apt-文件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-文件寻找@中,配置文件后,如下图所示,我能够解决错误,安装包后libgdal1-dev的

$ apt-file search gdal-config 

结果

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

所以我installe d libgdal1-dev的,如下图所示:

$ sudo apt-get install libgdal1-dev 
+8

这解决了这个错误,但我还必须执行'sudo apt-get install libproj-dev'来安装'rgdal'。请参阅http://stackoverflow.com/questions/15248815/rgdal-package-installation – geneorama

+2

我可以确认'libproj-dev'也是需要的。 R返回'configure:error:proj_api.h not found ...',否则如@geneorama所述。 –

+0

我确认了这一点,包括评论中的软件包,解决了我在Ubuntu 16.04和R 3.4上遇到的问题。 – luchonacho

0

尝试此在CentOS 6

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