Gauss DB 安装 PostGIS-失败

   这是一次失败的尝试,如果是寻找解决方案的请离开,如果有想一起探讨的大神,可以看下我安装的过程,并在评论区留言,非常感谢。
   经过如下过程的尝试,最终证明了,arm架构的centos7.6是无法安装GCC-5.4的。
   但是华为的客服说此版本自带的GCC-4.8.5也是可以支持PostGIS的,我会另起一篇文章记录过程。

PostGIS概述

PostGIS Extension是PostgreSQL的空间数据库扩展,提供如下空间信息服务功能:空间对象、空间索引、空间操作函数和空间操作符。PostGIS Extension完全遵循OpenGIS规范。GaussDB 200提供PostGIS Extension(版本为PostGIS-2.4.2)。
GaussDB 200中PostGIS Extension依赖第三方开源软件如下。依赖的第三方软件需要用户进行单独安装,具体请参考PostGIS安装。

  • Geos 3.6.2
  • Proj 4.9.2
  • Json 0.12.1
  • Libxml2 2.7.1

PostGIS安装

GaussDB 200数据库的PostGIS Extension源码包可通过网站获取。该Extension需使用GCC-5.4(GNU编译器套件)进行编译安装。在整个安装过程中,可使用make -sj和make install -sj命令并行加速编译,-sj命令极低概率性出现安装错误,如果安装失败则请使用make和make install进行串行安装。

GCC-5.4

GCC-5.4(GNU编译器套件)编译器安装。若集群中已经安装GCC-5.4编译器,可直接跳过本步骤。
PostGIS安装依赖GCC-5.4编译器。GCC-5.4编译器推荐使用源码由低版本的gcc和g++编译器进行升级安装。若集群中没有低版本gcc和g++编译器,可以通过挂载操作系统镜像等方法进行安装,这里不做赘述。GCC-5.4编译器相关依赖软件包,包括gcc-5.4.0、gmp-4.3.2、mpfr-2.4.2、mpc-1.0.3,安装包下载地址分别为:
gcc-5.4.0 gmp-4.3.2 mpfr-2.4.2 mpc-1.0.3

启动环境变量

以操作系统用户omm登录安装有MPPDB服务的任一主机。执行source ${BIGDATA_HOME}/mppdb/.mppdbgs_profile命令启动环境变量。

su - omm
source ${BIGDATA_HOME}/mppdb/.mppdbgs_profile

创建安装目录

创建GCC安装主目录GAUSSHOME/gcc和代码下载目录GAUSSHOME/gcc/packages,并下载软件包gcc-5.4.0.tar.gz、gmp-4.3.2.tar.gz、mpc-1.0.3.tar.gz、mpfr-2.4.2.tar.gz至$GAUSSHOME/gcc/packages目录。

mkdir $GAUSSHOME/gcc
mkdir $GAUSSHOME/gcc/packages

mv gcc-5.4.0.tar.gz $GAUSSHOME/gcc/packages/gcc-5.4.0.tar.gz
mv gmp-4.3.2.tar.gz $GAUSSHOME/gcc/packages/gmp-4.3.2.tar.gz
mv mpc-1.0.3.tar.gz $GAUSSHOME/gcc/packages/mpc-1.0.3.tar.gz
mv mpfr-2.4.2.tar.gz $GAUSSHOME/gcc/packages/mpfr-2.4.2.tar.gz
mv postgis-xc-master.zip $GAUSSHOME/gcc/packages/postgis-xc-master.zip

解压下载软件

cd $GAUSSHOME/gcc/packages
tar -xzf gcc-5.4.0.tar.gz
tar -xzf gmp-4.3.2.tar.gz
tar -xzf mpc-1.0.3.tar.gz
tar -xzf mpfr-2.4.2.tar.gz

创建GCC安装目录

mkdir $GAUSSHOME/gcc/gcc-5.4.0
mkdir $GAUSSHOME/gcc/gcc-5.4.0/depend
mkdir $GAUSSHOME/gcc/gcc-5.4.0/depend/gmp-4.3.2
mkdir $GAUSSHOME/gcc/gcc-5.4.0/depend/mpfr-2.4.2
mkdir $GAUSSHOME/gcc/gcc-5.4.0/depend/mpc-1.0.3
mkdir $GAUSSHOME/gcc/gcc-5.4.0/depend/gcc

安装gmp-4.3.2

进入$GAUSSHOME/gcc/packages/gmp-4.3.2目录,执行下列命令完成gmp安装操作。

cd $GAUSSHOME/gcc/packages/gmp-4.3.2
  • 生成Makefile文件
./configure --prefix $GAUSSHOME/gcc/gcc-5.4.0/depend/gmp-4.3.2 --build=aarch64-unknown-linux-gnu

因为我的系统是arm架构的,会报如下错误信息

checking build system type... ./configfsf.guess: unable to guess system type

This script, last modified 2008-04-14, has failed to recognize
the operating system you are using. It is advised that you
download the most up to date version of the config scripts from

  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
and
  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD

If the version you run (./configfsf.guess) is already up to date, please
send the following data and any information you think might be
pertinent to <config-patches@gnu.org> in order to provide the needed
information to handle your system.

config.guess timestamp = 2008-04-14

uname -m = aarch64
uname -r = 4.14.0-115.el7a.0.1.aarch64
uname -s = Linux
uname -v = #1 SMP Sun Nov 25 20:54:21 UTC 2018

/usr/bin/uname -p = aarch64
/bin/uname -X     = 

hostinfo               = 
/bin/universe          = 
/usr/bin/arch -k       = 
/bin/arch              = aarch64
/usr/bin/oslevel       = 
/usr/convex/getsysinfo = 

UNAME_MACHINE = aarch64
UNAME_RELEASE = 4.14.0-115.el7a.0.1.aarch64
UNAME_SYSTEM  = Linux
UNAME_VERSION = #1 SMP Sun Nov 25 20:54:21 UTC 2018
configure: error: cannot guess build type; you must specify one

从错误提示看,不能有效的识别的我的系统类型,但是给出了解决方案,就是根据官方地址给出的内容,更新两个配置文件config.guess、config.sub,官方内容如下:
config.guess
config.sub
修改之后重新执行configure,可以顺利通过了。

  • 编译
make -sj
  • 安装
make install -sj

安装mpfr-2.4.2

进入$GAUSSHOME/gcc/packages/mpfr-2.4.2目录,执行以下命令完成mpfr安装操作。

cd $GAUSSHOME/gcc/packages/mpfr-2.4.2
  • 生成Makefile文件
./configure --prefix $GAUSSHOME/gcc/gcc-5.4.0/depend/mpfr-2.4.2 --with-gmp=$GAUSSHOME/gcc/gcc-5.4.0/depend/gmp-4.3.2 --build=aarch64-unknown-linux-gnu

出现同样的报错信息。

checking for a BSD-compatible install... /bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether to disable maintainer-specific portions of Makefiles... yes
checking build system type... ./config.guess: unable to guess system type

This script, last modified 2009-06-10, has failed to recognize
the operating system you are using. It is advised that you
download the most up to date version of the config scripts from

  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
and
  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD

If the version you run (./config.guess) is already up to date, please
send the following data and any information you think might be
pertinent to <config-patches@gnu.org> in order to provide the needed
information to handle your system.

config.guess timestamp = 2009-06-10

uname -m = aarch64
uname -r = 4.14.0-115.el7a.0.1.aarch64
uname -s = Linux
uname -v = #1 SMP Sun Nov 25 20:54:21 UTC 2018

/usr/bin/uname -p = aarch64
/bin/uname -X     = 

hostinfo               = 
/bin/universe          = 
/usr/bin/arch -k       = 
/bin/arch              = aarch64
/usr/bin/oslevel       = 
/usr/convex/getsysinfo = 

UNAME_MACHINE = aarch64
UNAME_RELEASE = 4.14.0-115.el7a.0.1.aarch64
UNAME_SYSTEM  = Linux
UNAME_VERSION = #1 SMP Sun Nov 25 20:54:21 UTC 2018
configure: error: cannot guess build type; you must specify one

同样根据官方提供的材料更新对应的脚本。
config.guess
config.sub

  • 编译
make -sj
  • 安装
make install -sj

安装mpc-1.0.3

进入$GAUSSHOME/gcc/packages/mpc-1.0.3目录,执行下列命令完成mpc安装操作。

cd $GAUSSHOME/gcc/packages/mpc-1.0.3
  • 生成Makefile文件
./configure --prefix=$GAUSSHOME/gcc/gcc-5.4.0/depend/mpc-1.0.3  --with-gmp=$GAUSSHOME/gcc/gcc-5.4.0/depend/gmp-4.3.2 --with-mpfr=$GAUSSHOME/gcc/gcc-5.4.0/depend/mpfr-2.4.2 --build=aarch64-unknown-linux-gnu

这次没有报错,顺利往下进行。

  • 编译
make -sj
  • 安装
make install -sj

安装gcc-5.4.0

  • 添加lib路径至~/.bashrc。
    在vim编辑器中打开~/.bashrc文档。
vim ~/.bashrc

添加以下内容:

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$GAUSSHOME/gcc/gcc-5.4.0/depend/gmp-4.3.2/lib:$GAUSSHOME/gcc/gcc-5.4.0/depend/mpfr-2.4.2/lib:$GAUSSHOME/gcc/gcc-5.4.0/depend/mpc-1.0.3/lib

执行如下命令使设置生效。

source ~/.bashrc
  • 进入$GAUSSHOME/gcc/packages/gcc-5.4.0目录
cd $GAUSSHOME/gcc/packages/gcc-5.4.0

我再做这一步的是报了如下错误

-bash: cd: /opt/huawei/Bigdata/om-server_6.5.1/OMS/gaussdb/gcc/packages/gcc-5.4.0: No such file or directory

原因是环境变量$GAUSSHOME失效了,应该是上一步添加lib造成的,重新执行了启动环境变量的脚本。

source ${BIGDATA_HOME}/mppdb/.mppdbgs_profile
  • 生成Makefile文件
./configure --prefix=$GAUSSHOME/gcc/gcc-5.4.0/depend/gcc -disable-multilib --with-gmp=$GAUSSHOME/gcc/gcc-5.4.0/depend/gmp-4.3.2 -enable-languages=c,c++ --with-mpfr=$GAUSSHOME/gcc/gcc-5.4.0/depend/mpfr-2.4.2 --with-mpc=$GAUSSHOME/gcc/gcc-5.4.0/depend/mpc-1.0.3 --build=aarch64-unknown-linux-gnu

checking build system type... aarch64-unknown-linux-gnu
checking host system type... aarch64-unknown-linux-gnu
checking target system type... aarch64-unknown-linux-gnu
checking for a BSD-compatible install... /bin/install -c
checking whether ln works... yes
checking whether ln -s works... yes
checking for a sed that does not truncate output... /bin/sed
checking for gawk... gawk
checking for libatomic support... yes
checking for libcilkrts support... no
checking for libitm support... yes
checking for libsanitizer support... yes
checking for libvtv support... no
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables... 
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking whether g++ accepts -static-libstdc++ -static-libgcc... no
checking for gnatbind... no
checking for gnatmake... no
checking whether compiler driver understands Ada... no
checking how to compare bootstrapped objects... cmp --ignore-initial=16 $$f1 $$f2
checking for objdir... .libs
checking for the correct version of gmp.h... yes
checking for the correct version of mpfr.h... yes
checking for the correct version of mpc.h... no
configure: error: Building GCC requires GMP 4.2+, MPFR 2.4.0+ and MPC 0.8.0+.
Try the --with-gmp, --with-mpfr and/or --with-mpc options to specify
their locations.  Source code for these libraries can be found at
their respective hosting sites as well as at
ftp://gcc.gnu.org/pub/gcc/infrastructure/.  See also
http://gcc.gnu.org/install/prerequisites.html for additional info.  If
you obtained GMP, MPFR and/or MPC from a vendor distribution package,
make sure that you have installed both the libraries and the header
files.  They may be located in separate packages.
  • 编译
make -sj

报错

Cleaning up unneeded directories:
fixincludes is done
mkdir -p -- aarch64-unknown-linux-gnu/libgcc
Checking multilib configuration for libgcc...
Configuring stage 1 in aarch64-unknown-linux-gnu/libgcc
configure: creating cache ./config.cache
checking build system type... aarch64-unknown-linux-gnu
checking host system type... aarch64-unknown-linux-gnu
checking for --enable-version-specific-runtime-libs... no
checking for a BSD-compatible install... /bin/install -c
checking for gawk... gawk
checking for aarch64-unknown-linux-gnu-ar... ar
checking for aarch64-unknown-linux-gnu-lipo... lipo
checking for aarch64-unknown-linux-gnu-nm... /opt/huawei/Bigdata/mppdb/core/gcc/packages/gcc-5.4.0/host-aarch64-unknown-linux-gnu/gcc/nm
checking for aarch64-unknown-linux-gnu-ranlib... ranlib
checking for aarch64-unknown-linux-gnu-strip... strip
checking whether ln -s works... yes
checking for aarch64-unknown-linux-gnu-gcc... /opt/huawei/Bigdata/mppdb/core/gcc/packages/gcc-5.4.0/host-aarch64-unknown-linux-gnu/gcc/xgcc -B/opt/huawei/Bigdata/mppdb/core/gcc/packages/gcc-5.4.0/host-aarch64-unknown-linux-gnu/gcc/ -B/opt/huawei/Bigdata/mppdb/core/gcc/gcc-5.4.0/depend/gcc/aarch64-unknown-linux-gnu/bin/ -B/opt/huawei/Bigdata/mppdb/core/gcc/gcc-5.4.0/depend/gcc/aarch64-unknown-linux-gnu/lib/ -isystem /opt/huawei/Bigdata/mppdb/core/gcc/gcc-5.4.0/depend/gcc/aarch64-unknown-linux-gnu/include -isystem /opt/huawei/Bigdata/mppdb/core/gcc/gcc-5.4.0/depend/gcc/aarch64-unknown-linux-gnu/sys-include   
checking for suffix of object files... configure: error: in `/opt/huawei/Bigdata/mppdb/core/gcc/packages/gcc-5.4.0/aarch64-unknown-linux-gnu/libgcc':
configure: error: cannot compute suffix of object files: cannot compile
See `config.log' for more details.
make[2]: *** [configure-stage1-target-libgcc] Error 1
make[1]: *** [stage1-bubble] Error 2
make: *** [all] Error 2

  • 安装
make install -sj

然后,就没有然后了。

©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 200,612评论 5 471
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 84,345评论 2 377
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 147,625评论 0 332
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 54,022评论 1 272
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 62,974评论 5 360
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 48,227评论 1 277
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 37,688评论 3 392
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 36,358评论 0 255
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 40,490评论 1 294
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 35,402评论 2 317
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 37,446评论 1 329
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 33,126评论 3 315
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 38,721评论 3 303
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 29,802评论 0 19
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 31,013评论 1 255
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 42,504评论 2 346
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 42,080评论 2 341

推荐阅读更多精彩内容