【我和openGauss的故事】openEuler20.03上编译安装opengauss-5.0.0
ziyoo0830 openGauss 2023-08-03 16:49 发表于四川
为了更好地学习openGauss数据库知识,有时候需要去调试源代码来深入了解一些东西。以下记录了在openEuler20.03上编译最新的openGauss-server源代码的过程,记录了手工编译过程遇到的一些问题,同时尝试使用vscode去调试了下源代码,文中也提供了几个vscode的调试样例。
vscode调试参考:构建openGauss开发编译提交一体化环境-阅读源码为国产数据库加把油 - 墨天轮,使用vscode远程开发&调试opengauss的om代码 - 墨天轮。
以下采用的是手工编译的方法来安装。
下载第三方libs
mkdir -p /home/debug/opengauss/binarylibs/ wget https://opengauss.obs.cn-south-1.myhuaweicloud.com/5.0.0/binarylibs/openGauss-third_party_binarylibs_openEuler_x86_64.tar.gz # 以上提供的是已经编译好的包,无需再次编译, 用--with-3rdpartydir不要用--with-3rdparty_sourcedir tar -xf openGauss-third_party_binarylibs_openEuler_x86_64.tar.gz -C /home/debug/opengauss/binarylibs/
下载opengauss-server
代码
下载5.0.0
的源代码
cd /home/debug/opengauss/ git clone https://gitee.com/opengauss/openGauss-server.git openGauss-server -b 5.0.0
configure
cd openGauss-server # 编译debug版本 ./configure --gcc-version=7.3.0 CC=g++ CFLAGS='-O0' --prefix=$GAUS