IT Share you

오류 : gdal-config를 찾을 수 없습니다.

shareyou 2021. 1. 9. 10:53
반응형

오류 : gdal-config를 찾을 수 없습니다.


내가 놓친 점을 지적하십시오.

오픈 수세 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

Such renaming of upstream libraries is common; something such as apt-cache search libgdal can help locate the current package names. The important key though is that the "abstract" development package libgdal-dev is all that is needed to build as it pulls the "concrete" current run-time package (here: libgdal1i) in via a dependency.


In Ubuntu 18.04

I fixed this by sudo apt install libgdal-dev Hope someone find this helpful. Some above answers seems to be outdated and lengthy.

In earlier versions (which had apt-get)

sudo apt-get install libgdal-dev


You can use apt-file package, to find which package contains the missing file you are looking for.

First install the apt-file using the command apt-get install apt-file
Update apt-file using the command apt-file update
Now you can use apt-file to find the missing file. apt-file search gdal-config

For my case, I got the same error when configuring grass-7.1 from svn. As shown below:

    $ ./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.

But, after looking for gdal-config file with apt-file as shown below, I was able to resolve the error, after installing the package libgdal1-dev

$ apt-file search gdal-config

Results

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

So I installed libgdal1-dev, as shown below:

$ sudo apt-get install libgdal1-dev

This happens because the configuration failed for package ‘rgdal’ so we have to install necessary dependencies.

The packages libgdal-dev and libproj-dev are required:

sudo apt-get install gdal-bin proj-bin libgdal-dev libproj-dev

Then install rgdal by

install.packages("rgdal")

Load rgdal by

library(rgdal)

Read the reference manual.

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/;


Try this on CentOS 6

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

On macOS

brew install gdal

removed the error

gdal-config not found

ReferenceURL : https://stackoverflow.com/questions/12141422/error-gdal-config-not-found

반응형