CentOS7离线安装pgRouting

冷暖自知 提交于 2020-01-29 01:08:17

一、编译环境准备

pgRouting的安装需要boost,cgal的编译环境,而cgal的安装又需要cmake编译工具。

1. 检查编译环境

在postgresql和postgis的安装中,我们已经安装了系统镜像的全部rpm包,boost也会被自动安装,可通过一下命令检查boost版本。
在这里插入图片描述
vim /usr/include/boost/version.hpp
在这里插入图片描述

  1. cgal

https://github.com/CGAL/cgal/releases/tag/releases%2FCGAL-4.13.2

  1. cmake

https://cmake.org/files/v3.2/cmake-3.2.0.tar.gz

  1. pgrouting

https://github.com/pgRouting/pgrouting/releases/download/v2.6.3/pgrouting-2.6.3.tar.gz

二、编译安装上述依赖

1. 卸载旧版本cmake

如果服务器版本足够,可忽略此步骤
可以通过命令cmake -version检查服务器自带版本。如果偏低,需要卸载后重新安装新版本。在这里插入图片描述
需要3.1以上版本

yum remove cmake -y 

2. cmake

cmake
tar -zxvf cmake-3.2.0.tar.gz
cd  cmake-3.2.0
./bootstrap
gmake
gmake install

新建软连接
将安装路径连接到编译时查找的路径

ln -s /usr/local/bin/cmake /usr/bin/

3. cgal

tar -zxvf CGAL-4.13.2.tar.gz
cd cgal-releases-CGAL-4.13.2
mkdir build
cd build
cmake ..
make
make install

三、安装pgrouting

tar -zxvf pgrouting-2.6.3.tar.gz
cd pgrouting-2.6.3
mkdir build 
cd build
cmake ..
make
make install

四、配置pgrouting安装路径

cp /usr/local/lib64/libCGAL.so.13 /home/work/postgresql/lib

编辑配置文件vim /etc/ld.so.conf,增加pgrouting安装的路径后,执行ldconfig,使配置生效
在这里插入图片描述

五、测试

进入数据库客户端,增加空间扩展,具体参考我上篇postgis安装博客
在这里插入图片描述

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!