赞
踩
openGauss当前官方支持在ARM架构下的openEuler安装包,本文档帮助读者快速了解在x86架构的openEuler上如何编译openGauss数据库。
编译环境
环境
要求
硬件环境
CPU: 8核
CPU架构:x86
Memory: 32G
Free Disk:80G
操作系统
openEuler 20.03 LTS
准备openGauss代码仓库
yum install git -y
cd /root/
git clone https://gitee.com/opengauss/openGauss-server
git clone https://gitee.com/opengauss/openGauss-third_party
安装依赖包
yum install libaio-devel ncurses-devel pam-devel libffi-devel libtool readline-devel
zlib-devel python3-devel autoconf flex gcc gcc-c++ patch byacc bison -y
2. 下载gcc
https://github.com/gcc-mirror/gcc/archive/releases/gcc-8.2.0.tar.gz
从如上GitHub地址下载gcc重命名为:gcc-8.2.0.tar.gz,
并拷贝到/root/openGauss-third_party/buildtools/gcc/目录下。
rm -rf /usr/bin/python
ln -s /usr/bin/python3.7 /usr/bin/python
可以使用Python --version查看当前系统的默认Python版本。
编译第三方环境
cd /root/openGauss-third_party/build/
vi get_PlatForm_str.sh
在脚本中添加上绿字的elif条件以适配x86架构:
编译安装openGauss
vi bashrc
export CODE_BASE=/root/openGauss-server # Path of the openGauss-server file
export BINARYLIBS=$CODE_BASE/…/binarylibs # Path of the binarylibs file
export GAUSSHOME=/opt/opengauss/
export GCC_PATH=$BINARYLIBS/buildtools/openeuler_x86_64/gcc8.2
export CC=$GCC_PATH/gcc/bin/gcc
export CXX=$GCC_PATH/gcc/bin/g++
export LD_LIBRARY_PATH= G A U S S H O M E / l i b : GAUSSHOME/lib: GAUSSHOME/lib:GCC_PATH/gcc/lib64: G C C P A T H / i s l / l i b : GCC_PATH/isl/lib: GCCPATH/isl/lib:GCC_PATH/mpc/lib/: G C C P A T H / m p f r / l i b / : GCC_PATH/mpfr/lib/: GCCPATH/mpfr/lib/:GCC_PATH/gmp/lib/:$LD_LIBRARY_PATH
export PATH=
G
A
U
S
S
H
O
M
E
/
b
i
n
:
GAUSSHOME/bin:
GAUSSHOME/bin:GCC_PATH/gcc/bin:$PATH
source bashrc
2. 设置Makefile
当前openGauss官方支持ARM架构的openEuler,这里支持x86架构的openEuler需要修改Makefile文件。
cd openGauss-server
vi ./src/gausskernel/Makefile
看到上述截图中的结果表明编译成功。
看到上述截图中的结果表明安装成功。
软件安装路径为:$GAUSSHOME
二进制放置路径为:$GAUSSHOME/bin
openGauss开源社区官方网站:
https://opengauss.org/
openGauss组织仓库:
https://gitee.com/opengauss
openGauss镜像仓库:
https://github.com/opengauss-mirror
原文链接:https://www.hikunpeng.com/zh/developer/techArticles/20230911-3
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。