当前位置:   article > 正文

OpenGauss数据库源码编译安装过程学习笔记

opengauss数据库源码编译安装

编译前准备工作

编译openGauss需要openGauss-serverbinarylibs两个组件。

openGauss-serveropenGauss的主要代码。可以从开源社区获取。
openGauss-server源码下载

binarylibsopenGauss依赖的第三方开源软件,你可以直接编译openGauss-third_party代码获取,也可以从开源社区下载已经编译好的并上传的一个副本。
注:软件依赖包版本需尽量与openGauss-server版本一致
Centos_x86平台编译好的第三方开源软件下载

对于数据库、三方库、GCC的编译以及常见问题,参照博客openGauss数据库编译指导,点击前往

编译安装步骤:

1、直接下载编译好的openGauss-third_party,解压后并将其重命名为binarylibs

[opengauss@VM-24-14-centos binarylibs]$ mv openGauss-third_party_binarylibs_Centos7.6_x86_64 binarylibs
[opengauss@VM-24-14-centos ~]$ cd binarylibs/
[opengauss@VM-24-14-centos binarylibs]$ ls
buildtools  common  component  dependency  platform
## 执行以下脚本获取系统版本号
[opengauss@VM-24-14-centos src]$ ./get_PlatForm_str.sh 
centos7.6_x86_64
[opengauss@VM-24-14-centos src]$ 
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8

2、配置环境变量

export CODE_BASE=/home/opengauss/openGauss-server    # Path of the openGauss-server file
export BINARYLIBS=/home/opengauss/binarylibs   # Path of the binarylibs file
export GAUSSHOME=$CODE_BASE/dest/
export GCC_PATH=$BINARYLIBS/buildtools/gcc7.3/  ### *请注意,这里不在有平台那一层目录了*
export CC=$GCC_PATH/gcc/bin/gcc
export CXX=$GCC_PATH/gcc/bin/g++
export LD_LIBRARY_PATH=$GAUSSHOME/lib:$GCC_PATH/gcc/lib64:$GCC_PATH/isl/lib:$GCC_PATH/mpc/lib/:$GCC_PATH/mpfr/lib/:$GCC_PATH/gmp/lib/:$LD_LIBRARY_PATH
export PATH=$GAUSSHOME/bin:$GCC_PATH/gcc/bin:$PATH
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8

执行source ~/.bashrc生效

3、手动编译

[opengauss@VM-24-14-centos openGauss-server]$./configure --gcc-version=7.3.0 CC=g++ CFLAGS='-O0' --prefix=$GAUSSHOME --3rd=$BINARYLIBS --enable-debug --enable-cassert --enable-thread-safety --with-readline --without-zlib
make
make install
  • 1
  • 2
  • 3

一键式脚本编译

注意:编译前虚拟机内存适当调大(本机环境调整为8GB
在这里插入图片描述
编译前环境变量如下:
在这里插入图片描述

[opengauss@local101 openGauss-server]$ sh build.sh -m debug -3rd /home/opengauss/binarylibs
ROOT_DIR : /home/opengauss/openGauss-server
[makegaussdb] 24-01-25 11:15:10: script dir : /home/opengauss/openGauss-server/build/script
[makegaussdb] 24-01-25 11:15:10: Work root dir : /home/opengauss/openGauss-server
WARNING: do not separate symbol in debug mode!
-I../../../../src/include -I../../../../src/lib/gstrace -I/home/opengauss/binarylibs/kernel/dependency/libxml2/comm/include/libxml2  -D_GNU_SOURCE -I/home/opengauss/binarylibs/kernel/dependency/libxml2/comm/include/libxml2  -I/home/opengauss/binarylibs/kernel/dependency/unixodbc/include -I/home/opengauss/binarylibs/kernel/dependency/libobs/comm/include -I/home/opengauss/binarylibs/kernel/dependency/libcgroup/comm/include -I/home/opengauss/binarylibs/kernel/dependency/openssl/comm/include -I/home/opengauss/binarylibs/kernel/dependency/boost/comm/include -I/home/opengauss/binarylibs/kernel/dependency/llvm/comm/include -I/home/opengauss/binarylibs/kernel/dependency/kerberos/comm/include -I/home/opengauss/binarylibs/kernel/dependency/cjson/comm/include -I/home/opengauss/binarylibs/kernel/dependency/numactl/comm/include -I/home/opengauss/binarylibs/kernel/dependency/zlib1.2.11/comm/include -I/home/opengauss/binarylibs/kernel/dependency/lz4/comm/include -I/home/opengauss/binarylibs/kernel/dependency/zstd/include -I/home/opengauss/binarylibs/kernel/dependency/libcurl/comm/include -I/home/opengauss/binarylibs/kernel/component/dcf/include -I/home/opengauss/binarylibs/kernel/dependency/masstree/comm/include -DUSE_SPQ
Makefile.local:181: warning: overriding recipe for target `objfiles.txt'
../../../../..//src/gausskernel/common.mk:34: warning: ignoring old recipe for target `objfiles.txt'
cat: snowball/objfiles.txt: 没有那个文件或目录
cat: ../../src/common/interfaces/libpq/objfiles.txt: 没有那个文件或目录
cat: ../../contrib/test_decoding/objfiles.txt: 没有那个文件或目录
cat: ../../contrib/mppdb_decoding/objfiles.txt: 没有那个文件或目录
cat: ../../contrib/postgres_fdw/objfiles.txt: 没有那个文件或目录
/bin/ld: warning: libssl.so.10, needed by /home/opengauss/binarylibs/kernel/dependency/libobs/comm/lib/libeSDKOBS.so, may conflict with libssl.so.1.1
/bin/ld: warning: libssl.so.10, needed by /home/opengauss/binarylibs/kernel/dependency/libobs/comm/lib/libeSDKOBS.so, may conflict with libssl.so.1.1
/bin/ld: warning: libssl.so.10, needed by /home/opengauss/binarylibs/kernel/dependency/libobs/comm/lib/libeSDKOBS.so, may conflict with libssl.so.1.1
/bin/ld: warning: libcrypto.so.10, needed by /home/opengauss/binarylibs/kernel/dependency/libobs/comm/lib/libeSDKOBS.so, may conflict with libcrypto.so.1.1
/bin/ld: warning: libcrypto.so.10, needed by /home/opengauss/binarylibs/kernel/dependency/libobs/comm/lib/libeSDKOBS.so, may conflict with libcrypto.so.1.1`在这里插入代码片`
/bin/ld: warning: libcrypto.so.10, needed by /home/opengauss/binarylibs/kernel/dependency/libobs/comm/lib/libeSDKOBS.so, may conflict with libcrypto.so.1.1
../../../../../..//src/Makefile.shlib:357: warning: overriding recipe for target `libgauss_cl_jni.so'
Makefile:39: warning: ignoring old recipe for target `libgauss_cl_jni.so'
../../../../../..//src/Makefile.shlib:357: warning: overriding recipe for target `libgauss_cl_jni.so'
Makefile:39: warning: ignoring old recipe for target `libgauss_cl_jni.so'
Makefile:71: warning: overriding recipe for target `../../../src/lib/elog/elog.a'
Makefile:65: warning: ignoring old recipe for target `../../../src/lib/elog/elog.a'
openGauss installation complete.
now, all build has finished!
[opengauss@local101 openGauss-server]$
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28

整个编译过程中的日志文件在/home/opengauss/openGauss-server/build/script/makemppdb_pkg.log 文件中查看
编译完成之后,安装目录为/home/opengauss/openGauss-server/mppdb_te

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/Cpp五条/article/detail/636070
推荐阅读
相关标签
  

闽ICP备14008679号