• Welcome to LiuJason's Blog!

[已解决]"checking for gdal-config... no" 安装gdal2.x——R语言中GIS包rgdal的依赖包|CentOS7为例

Linux笔记 Jason 6 years ago (2018-12-07) 1796 Views 1 Comments QR code of this page

在编译R环境的时候,最讨厌的额就是一些特殊的依赖包,只能通过ssh安装,而且还经常找不到这些包或者是版本不匹配...这次的gdal 2.x就是一个例子,浪费了我很长的时间去找相关的安装方法,这里记一下笔记,下次碰到了的话就方便了。
这里还是强烈建议,安装各种包之前看一看包的介绍:packages/rgdal。 有很明确的说明需要什么样子的环境:

for building from source: GDAL >= 1.11.4, library from https://trac.osgeo.org/gdal/wiki/DownloadSource and PROJ.4 (proj >= 4.8.0) from https://download.osgeo.org/proj/; GDAL OSX frameworks built by William Kyngesburye at http://www.kyngchaos.com/ may be used for source installs on OSX. For installation with older external dependencies, override configure checks with --configure-args="enable-deprecated=yes". Consider source installations using archived versions of rgdal contemporary with installed external dependencies, for example rgdal_0.8-7 for PROJ4 4.8.0 (March 2012).


#Install the tools that we will use
yum groupinstall "Development Tools"
yum install wget

#for Postgresql support
sudo yum install postgresql postgresql-devel

#libkml Support
##---------This part is depending on prebuilt libraries. In the future we may replace this by compiling them from source.
wget http://s3.amazonaws.com/etc-data.koordinates.com/gdal-travisci/install-libkml-r864-64bit.tar.gz
tar xzf install-libkml-r864-64bit.tar.gz

#Copy these required files to  /usr/local
sudo cp -r install-libkml/include/* /usr/local/include
sudo cp -r install-libkml/lib/* /usr/local/lib
sudo ldconfig

#download GDAL
wget http://download.osgeo.org/gdal/2.2.3/gdal-2.2.3.tar.gz

tar xzf gdal-2.2.3.tar.gz
cd gdal-2.2.3

#Compile from source
./configure --with-libkml 
make install


This article is under CC BY-NC-SA 4.0 license.
Please quote the original link:https://www.liujason.com/article/152.html
Like (0)

表情 贴图 加粗 删除线 居中 斜体 签到


  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址