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

在编译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).

然后我们要安装gdal的话,可以参考这里:gdal/wiki/FAQ

#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

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

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

解决了

1
说点什么

Please Login to comment
1 Comment threads
0 Thread replies
0 Followers
 
Most reacted comment
Hottest comment thread
1 Comment authors
Jason Recent comment authors
  Subscribe  
最新 最旧 得票最多
提醒