diff --git a/content/zh/post/zhengxue/images/opengauss_compile/1.1.0.png b/content/zh/post/zhengxue/images/opengauss_compile/1.1.0.png
new file mode 100644
index 0000000000000000000000000000000000000000..7927105a7ef6c66fa46a5c442c650de027da46a9
Binary files /dev/null and b/content/zh/post/zhengxue/images/opengauss_compile/1.1.0.png differ
diff --git a/content/zh/post/zhengxue/images/opengauss_compile/1.1.1.png b/content/zh/post/zhengxue/images/opengauss_compile/1.1.1.png
new file mode 100644
index 0000000000000000000000000000000000000000..d29ff117f31df416bd851e57a7ea7ba2bd6aee46
Binary files /dev/null and b/content/zh/post/zhengxue/images/opengauss_compile/1.1.1.png differ
diff --git a/content/zh/post/zhengxue/images/opengauss_compile/1.1.2.png b/content/zh/post/zhengxue/images/opengauss_compile/1.1.2.png
new file mode 100644
index 0000000000000000000000000000000000000000..754483dcf95b58a848ee0b765b3fe6e897534a23
Binary files /dev/null and b/content/zh/post/zhengxue/images/opengauss_compile/1.1.2.png differ
diff --git a/content/zh/post/zhengxue/images/opengauss_compile/1.1.3.png b/content/zh/post/zhengxue/images/opengauss_compile/1.1.3.png
new file mode 100644
index 0000000000000000000000000000000000000000..f8b21926df8bc95777e3ee35fe1c6b605b11a035
Binary files /dev/null and b/content/zh/post/zhengxue/images/opengauss_compile/1.1.3.png differ
diff --git a/content/zh/post/zhengxue/images/opengauss_compile/1.1.4.png b/content/zh/post/zhengxue/images/opengauss_compile/1.1.4.png
new file mode 100644
index 0000000000000000000000000000000000000000..fb862ee79a45c4f268861162802885bf0ca0bbe0
Binary files /dev/null and b/content/zh/post/zhengxue/images/opengauss_compile/1.1.4.png differ
diff --git a/content/zh/post/zhengxue/images/opengauss_compile/1.1.5.png b/content/zh/post/zhengxue/images/opengauss_compile/1.1.5.png
new file mode 100644
index 0000000000000000000000000000000000000000..28306c6bf0004deef740f963dbee0c642b3e769d
Binary files /dev/null and b/content/zh/post/zhengxue/images/opengauss_compile/1.1.5.png differ
diff --git a/content/zh/post/zhengxue/images/problem/1.1.0.png b/content/zh/post/zhengxue/images/problem/1.1.0.png
new file mode 100644
index 0000000000000000000000000000000000000000..60b1a7aee4a829513d76522ed59d1e40a9f223fa
Binary files /dev/null and b/content/zh/post/zhengxue/images/problem/1.1.0.png differ
diff --git a/content/zh/post/zhengxue/images/problem/1.1.1.png b/content/zh/post/zhengxue/images/problem/1.1.1.png
new file mode 100644
index 0000000000000000000000000000000000000000..251a0038dea7056b18bfeb4684f1bbd482cc5449
Binary files /dev/null and b/content/zh/post/zhengxue/images/problem/1.1.1.png differ
diff --git a/content/zh/post/zhengxue/images/problem/1.1.10.png b/content/zh/post/zhengxue/images/problem/1.1.10.png
new file mode 100644
index 0000000000000000000000000000000000000000..427666652f5a8041523e72aa423ca9688f26d073
Binary files /dev/null and b/content/zh/post/zhengxue/images/problem/1.1.10.png differ
diff --git a/content/zh/post/zhengxue/images/problem/1.1.11.png b/content/zh/post/zhengxue/images/problem/1.1.11.png
new file mode 100644
index 0000000000000000000000000000000000000000..d272c435c8a98c4d3828e1ad3575efb0550ed033
Binary files /dev/null and b/content/zh/post/zhengxue/images/problem/1.1.11.png differ
diff --git a/content/zh/post/zhengxue/images/problem/1.1.12.png b/content/zh/post/zhengxue/images/problem/1.1.12.png
new file mode 100644
index 0000000000000000000000000000000000000000..62bf194e62a5196c54c1492f6e199026c593ab33
Binary files /dev/null and b/content/zh/post/zhengxue/images/problem/1.1.12.png differ
diff --git a/content/zh/post/zhengxue/images/problem/1.1.13.png b/content/zh/post/zhengxue/images/problem/1.1.13.png
new file mode 100644
index 0000000000000000000000000000000000000000..c3040933d4d5be3260c59b3205c47439bf605635
Binary files /dev/null and b/content/zh/post/zhengxue/images/problem/1.1.13.png differ
diff --git a/content/zh/post/zhengxue/images/problem/1.1.14.png b/content/zh/post/zhengxue/images/problem/1.1.14.png
new file mode 100644
index 0000000000000000000000000000000000000000..1c05e41e901e5ab6de0a0b4079a6289a0ab953d4
Binary files /dev/null and b/content/zh/post/zhengxue/images/problem/1.1.14.png differ
diff --git a/content/zh/post/zhengxue/images/problem/1.1.15.png b/content/zh/post/zhengxue/images/problem/1.1.15.png
new file mode 100644
index 0000000000000000000000000000000000000000..9443d67acfef75a0b387ec57478614f2a1ffac55
Binary files /dev/null and b/content/zh/post/zhengxue/images/problem/1.1.15.png differ
diff --git a/content/zh/post/zhengxue/images/problem/1.1.16.png b/content/zh/post/zhengxue/images/problem/1.1.16.png
new file mode 100644
index 0000000000000000000000000000000000000000..73bdcba3710ade52a40b191e43479acdaad85868
Binary files /dev/null and b/content/zh/post/zhengxue/images/problem/1.1.16.png differ
diff --git a/content/zh/post/zhengxue/images/problem/1.1.17.png b/content/zh/post/zhengxue/images/problem/1.1.17.png
new file mode 100644
index 0000000000000000000000000000000000000000..440e1dcbe92ad97f3e1afb0978674eb918ea79d2
Binary files /dev/null and b/content/zh/post/zhengxue/images/problem/1.1.17.png differ
diff --git a/content/zh/post/zhengxue/images/problem/1.1.18.png b/content/zh/post/zhengxue/images/problem/1.1.18.png
new file mode 100644
index 0000000000000000000000000000000000000000..13b7546424ec820eed6df6f0da6507db9bfc9894
Binary files /dev/null and b/content/zh/post/zhengxue/images/problem/1.1.18.png differ
diff --git a/content/zh/post/zhengxue/images/problem/1.1.19.png b/content/zh/post/zhengxue/images/problem/1.1.19.png
new file mode 100644
index 0000000000000000000000000000000000000000..a3e1eda0005bc26359491b1abcffad4d25944262
Binary files /dev/null and b/content/zh/post/zhengxue/images/problem/1.1.19.png differ
diff --git a/content/zh/post/zhengxue/images/problem/1.1.2.png b/content/zh/post/zhengxue/images/problem/1.1.2.png
new file mode 100644
index 0000000000000000000000000000000000000000..06497c28d0bd2453fb892ec4526c227a7d42c010
Binary files /dev/null and b/content/zh/post/zhengxue/images/problem/1.1.2.png differ
diff --git a/content/zh/post/zhengxue/images/problem/1.1.20.png b/content/zh/post/zhengxue/images/problem/1.1.20.png
new file mode 100644
index 0000000000000000000000000000000000000000..eda34f49ea7c3362cc6896314881a20f6136f315
Binary files /dev/null and b/content/zh/post/zhengxue/images/problem/1.1.20.png differ
diff --git a/content/zh/post/zhengxue/images/problem/1.1.21.png b/content/zh/post/zhengxue/images/problem/1.1.21.png
new file mode 100644
index 0000000000000000000000000000000000000000..8b05ba99bd23c66fdc9838b467cea92073dda337
Binary files /dev/null and b/content/zh/post/zhengxue/images/problem/1.1.21.png differ
diff --git a/content/zh/post/zhengxue/images/problem/1.1.22.png b/content/zh/post/zhengxue/images/problem/1.1.22.png
new file mode 100644
index 0000000000000000000000000000000000000000..e8654cb80643349b425c7dac6a213998baad878d
Binary files /dev/null and b/content/zh/post/zhengxue/images/problem/1.1.22.png differ
diff --git a/content/zh/post/zhengxue/images/problem/1.1.23.png b/content/zh/post/zhengxue/images/problem/1.1.23.png
new file mode 100644
index 0000000000000000000000000000000000000000..022d46c2da73cb3fbea942506f64db8119f8bfee
Binary files /dev/null and b/content/zh/post/zhengxue/images/problem/1.1.23.png differ
diff --git a/content/zh/post/zhengxue/images/problem/1.1.24.png b/content/zh/post/zhengxue/images/problem/1.1.24.png
new file mode 100644
index 0000000000000000000000000000000000000000..5f85551be563d7210002da7ef83425285512daad
Binary files /dev/null and b/content/zh/post/zhengxue/images/problem/1.1.24.png differ
diff --git a/content/zh/post/zhengxue/images/problem/1.1.3.png b/content/zh/post/zhengxue/images/problem/1.1.3.png
new file mode 100644
index 0000000000000000000000000000000000000000..d6196d04cdd335643e0e8944c4ebdcf8e304d1f0
Binary files /dev/null and b/content/zh/post/zhengxue/images/problem/1.1.3.png differ
diff --git a/content/zh/post/zhengxue/images/problem/1.1.4.png b/content/zh/post/zhengxue/images/problem/1.1.4.png
new file mode 100644
index 0000000000000000000000000000000000000000..3cf4dd43c6c73787cf66919601c3c7513cf4b5eb
Binary files /dev/null and b/content/zh/post/zhengxue/images/problem/1.1.4.png differ
diff --git a/content/zh/post/zhengxue/images/problem/1.1.5.png b/content/zh/post/zhengxue/images/problem/1.1.5.png
new file mode 100644
index 0000000000000000000000000000000000000000..f27396c127a19b09b48fb158ba89d1c6329f6988
Binary files /dev/null and b/content/zh/post/zhengxue/images/problem/1.1.5.png differ
diff --git a/content/zh/post/zhengxue/images/problem/1.1.6.png b/content/zh/post/zhengxue/images/problem/1.1.6.png
new file mode 100644
index 0000000000000000000000000000000000000000..60aa7351ccd6fe91ec11be11715b0139975bce61
Binary files /dev/null and b/content/zh/post/zhengxue/images/problem/1.1.6.png differ
diff --git a/content/zh/post/zhengxue/images/problem/1.1.7.png b/content/zh/post/zhengxue/images/problem/1.1.7.png
new file mode 100644
index 0000000000000000000000000000000000000000..5f9b06146be0bb9e33f617ac777f5c4bcb0177a6
Binary files /dev/null and b/content/zh/post/zhengxue/images/problem/1.1.7.png differ
diff --git a/content/zh/post/zhengxue/images/problem/1.1.8.png b/content/zh/post/zhengxue/images/problem/1.1.8.png
new file mode 100644
index 0000000000000000000000000000000000000000..12e07c0be898b01e1d1eb9b178e1ba4964773a3f
Binary files /dev/null and b/content/zh/post/zhengxue/images/problem/1.1.8.png differ
diff --git a/content/zh/post/zhengxue/images/problem/1.1.9.png b/content/zh/post/zhengxue/images/problem/1.1.9.png
new file mode 100644
index 0000000000000000000000000000000000000000..49d5302e5ab2ed702e8d5981884677a36632b9ae
Binary files /dev/null and b/content/zh/post/zhengxue/images/problem/1.1.9.png differ
diff --git a/content/zh/post/zhengxue/images/third_compile/1.1.0.png b/content/zh/post/zhengxue/images/third_compile/1.1.0.png
new file mode 100644
index 0000000000000000000000000000000000000000..f5d64b2046133b985dd5a88ea7b2293887c19167
Binary files /dev/null and b/content/zh/post/zhengxue/images/third_compile/1.1.0.png differ
diff --git a/content/zh/post/zhengxue/images/third_compile/1.1.1.png b/content/zh/post/zhengxue/images/third_compile/1.1.1.png
new file mode 100644
index 0000000000000000000000000000000000000000..6f02d0068419c27926763d3b7e7e21e5a33ce83a
Binary files /dev/null and b/content/zh/post/zhengxue/images/third_compile/1.1.1.png differ
diff --git a/content/zh/post/zhengxue/opengauss_compile.md b/content/zh/post/zhengxue/opengauss_compile.md
new file mode 100644
index 0000000000000000000000000000000000000000..81e10203b743cba1353485f2bc2d5b4f3d52f3fc
--- /dev/null
+++ b/content/zh/post/zhengxue/opengauss_compile.md
@@ -0,0 +1,426 @@
++++
+title = "ubuntu18.04_x86_64系统----openGauss数据库编译指导"
+date = "2021-04-20"
+tags = ["ubuntu18.04_x86_64系统----openGauss数据库编译指导"]
+archives = "2021-04-20"
+author = "shirley_zhengx"
+summary = "ubuntu18.04_x86_64系统----openGauss数据库编译指导"
+img = "/zh/post/zhengxue/title/img1.png"
+times = "9:30"
++++
+
+
+
+- [1. 环境描述](#1.环境描述)
+ - [1.1.平台信息](#1.1.平台信息)
+ - [1.2.编译版本](#1.2.编译版本)
+ - [1.3.系统目录软链接](#1.3.系统目录软链接)
+- [2. 编译三方库](#2.编译三方库)
+ - [2.1.编译步骤综述](#2.1.编译步骤概述)
+ - [2.2.依赖库](#2.2.依赖库)
+ - [2.3.源码脚本修改](#2.3.源码脚本修改)
+ - [2.4.三方库编译及结果](#2.4.三方库编译及结果)
+- [3. 编译数据库](#3.编译数据库)
+ - [3.1.准备openGauss-server源码以及代码修改](#3.1.准备openGauss-server源码以及代码修改)
+ - [3.2.环境变量](#3.2.环境变量)
+ - [3.3.数据库编译与打包](#3.3.数据库编译与打包)
+
+
+
+# openGauss数据库编译指导
+
+openGauss数据库的编译需要依赖许多三方库,在社区 `openGauss-third_party` 仓库中存放了主要的依赖,首先依赖特定的gcc版本编译完三方库后,就可使用已编译好的三方库来编译数据库。
+
+
+## 1.环境描述
+
+ 针对X86平台Ubuntu系统下openGauss二进制安装包的编译作出指导,平台信息描述如下:
+
+### 1.1.平台信息
+
+
+
+ 架构 |
+ x86_64 (通过uname -p命令查看) |
+
+
+ CPU |
+ Intel(R) Xeon(R) Gold 6266C CPU @ 3.00GHz (通过lscpu命令查看) |
+
+
+ 硬盘 |
+ 40 + 100 (通过lscpu命令查) |
+
+
+ 内存 |
+ 48G (通过lscpu命令查看) |
+
+
+ OS |
+ Ubuntu18.04.5 LTS (通过ls-release -a命令查看) |
+
+
+
+
+### 1.2.编译版本
+
+
+
+
+ openGauss-third-party |
+ 社区仓库下载最新源码 |
+
+
+ openGauss-server |
+ 社区仓库master分支 |
+
+
+
+
+### 1.3.系统目录软链接
+软链接1:ln -s /usr/lib/x86_64-linux-gnu /usr/lib64/
+
+
+
+软链接2:ln -s /usr/lib64 /lib64
+
+
+
+## 2.编译三方库
+
+针对 `centos`和`openEuler`操作系统已经提供了编译好的二进制三方库,可直接使用社区提供的编译好的文件[openGauss-third_party_binarylibs.tar.gz](https://opengauss.obs.cn-south-1.myhuaweicloud.com/1.1.0/openGauss-third_party_binarylibs.tar.gz)。
+
+针对Ubuntu操作系统,社区不提供编译好的三方库二进制文件,需用户自己编译,也可使用博客中已编译好的三方库二进制文件[openGauss-third_party_binarylibs.tar.gz](链接)。基于Ubuntu系统的三方库编译步骤如下:
+
+### 2.1.编译步骤概述
+
+(1) 编译 `gcc` 和 `cmake` \
+(2) 下载三方库源码,修改脚本增加Ubuntu平台信息 \
+(3) 在`openGauss-third_party/build` 下,运行 `sh build_all.sh` ,即可进行全量三方库的编译。\
+ 编译顺序为 `openssl` , `buildtools` , `platform` , `dependency`\
+(4) 编译完成后,编译结果在 `openGauss-third_party/output` 目录下。
+
+### 2.2.依赖库
+#### 2.2.1 依赖安装
+
+
+
+ 依赖库 |
+ Ubuntu对应安装版本 |
+
+
+ libaio |
+ apt install libaio-dev |
+
+
+ ncurses |
+ apt install libncurses5-dev |
+
+
+ pam |
+ apt install libpam0g-dev |
+
+
+ libffi |
+ apt install libffi-dev |
+
+
+ libtool |
+ apt install libtool |
+
+
+ openssl |
+ apt install openssl |
+
+
+ rpm2cpio |
+ apt install rpm2cpio |
+
+
+ flex |
+ apt install flex |
+
+
+ bison |
+ apt install bison |
+
+
+
+
+#### 2.2.2 特殊依赖
+
+(1) gcc (推荐使用 `7.3.0` 版本)
+
+ gcc编译请参照:[gcc编译指导](/zh/post/xingchen/gcc_compile/)
+
+(2) cmake (cmake推荐 `>=3.16`(如果系统中的cmake版本>=3.16则直接使用系统自带cmake即可) \
+ 下载源码:`https://github.com/Kitware/CMake/releases` \
+ 解压源码:tar cmake-3.18.5.tar.gz \
+ 编译安装:../configure prefix=/usr/local/cmake318 (prefix为安装路径) \
+ make -j && make install -j \
+ 导入环境变量:
+
+ export CMAKE_PATH=/usr/local/cmake318
+
+ export LD_LIBRARY_PATH=$CMAKE_PATH/lib:$LD_LIBRARY_PATH
+
+ export PATH=$CMAKE_PATH/bin:$PATH
+
+
+(3) python \
+ 安装:apt install python3 \
+ `Tips`: 确保python命令链接的Python版本是python3,通过python --version确定,如果不是python3,可通过软链接修改:ln -s /usr/bin/python3.7 /usr/bin/python,修改之后再次通过python --version确定python版本
+
+#### 2.2.3 其它依赖
+
+(1) jemalloc 依赖 autoconf : apt install autoconf\
+(2) libthrift 依赖 pkg-config : apt install pkg-config\
+(3) etcd 依赖 golang : apt install golang\
+(4) pljava 依赖 libkrb5-dev: apt install libkrb5-dev
+
+### 2.3.源码脚本修改
+
+(1) 修改 `openGauss-third_party/build/get_PlatForm_str.sh` 增加新的平台,如下图
+
+
+
+$kernel信息可以通过命令获取:
+```
+lsb_release -d | awk -F ' ' '{print $2}'| tr A-Z a-z
+```
+
+(2) 在以下三方依赖中, 在其build.py文件中增加ubuntu平台信息。
+```
+openGauss-third_party/dependency/fio/build.py
+openGauss-third_party/dependency/iperf /build.py
+openGauss-third_party/dependency/jemalloc/build.py
+openGauss-third_party/dependency/kerberos/build.py
+openGauss-third_party/dependency/libcgroup/build.py
+openGauss-third_party/dependency/libedit/build.py
+openGauss-third_party/dependency/nanomsg /build.py
+openGauss-third_party/dependency/numactl/build.py
+openGauss-third_party/dependency/openssl/build.py
+openGauss-third_party/dependency/protobuf/build.py
+```
+在build.py/binary_parse函数中增加平台信息:
+```
+elif platform_str == 'ubuntu18.04_x86_64':
+ binary_list.append(platform_str)
+```
+以下错误信息均是由于未增加平台信息引起:
+```
+Failed
+[Error] the plat form is not supported!
+[ERROR] Not supported platform type
+```
+
+(4) 在ubuntu系统中对三方库的特殊修改
+
+/openGauss-third_party/dependency/masstree/build.sh修改rename命令
+
+
+ ```
+ $PLATFORM = "$(bash $(pwd)/../../build/get_PlatForm_str.sh"
+ If [ "$PLATFORM"x = "ubuntu18.04_x86_64"x ];then
+ rename 's/\.cc/\.cpp/' $MASSTREE_MEGRED_SOURCES_DIR/*.cc
+ else
+ rename ".cc" ".cpp" $MASSTREE_MEGRED_SOURCES_DIR/*.cc
+ fi
+ ```
+
+/openGauss-third_party/dependency/snappy/build.sh修改mv命令
+
+ ```
+ LIB_PATH=install_comm/lib64
+ if [ -d "$LIB_PATH" ];then
+ mv install_comm/lib64 install_comm/lib
+ fi
+ ```
+/openGauss-third_party/dependency/zstd/build.sh修改mv命令
+```
+LIB_PATH=../../../../install_comm/lib64
+if [ -d "$LIB_PATH" ];then
+ mv ../../../../install_comm/lib64/libzstd* ../../../../install_comm/lib/
+fi
+```
+/openGauss-third_party/dependency/parquet/build.sh修改mv命令
+```
+LIB_PATH=${LOCAL_DIR}/install_comm/lib64
+if [ -d "$LIB_PATH" ]; then
+ mv ${LOCAL_DIR}/install_comm/lib64 ${LOCAL_DIR}/install_comm/lib
+fi
+```
+openGauss-third_party/dependency/protobuf/build.py中的build_component函数,修改mv_cmd变量,如下图。
+
+
+### 2.4.三方库编译及结果
+(1) 进入到`openGauss-third_party/build`目录,运行 `sh build_all.sh`,全量编译三方库。
+如果在编译dependency过程中,某一三方库编译有错误,可进入某一个三方库中单独编译,解决错误后,可以在`dependency/build/build_dependency.sh`中注释掉已经编译好的三方库,只编译还未编译成功的库,分组单独进行编译。
+
+***编译dependency***
+```
+cd openGauss-third_party/dependency/build/
+sh build_dependency.sh
+```
+
+(2) 编译结果在 `openGauss-third_party/output` 之中。
+
+将编译好的 `gmp mpfr mpc isl gcc` 目录拷贝到`openGauss-third_party/output/buildtools/${platform}/gcc7.3`下,output目录即为完整的三方库二级制。将output目录拷贝出去,重命名为binarylibs,便可以使用它进行数据库编译。
+
+`Tips`: 对于学生,不建议自己编译三方库,可直接使用提供的三方库二进制包 \
+ ubuntu三方库二进制包:
+
+## 3.编译数据库
+
+以下介绍如何进行openGauss在ubuntu系统上编译
+
+### 3.1.准备openGauss-server源码以及代码修改
+
+(1) 进入openGauss-server/src/get_PlatForm_str,添加ubuntu平台信息,如下图。
+ 
+
+`Tips`: 如果三方库要自己编译,请保持`openGauss-third_party/build/get_PlatForm_str.sh`和`openGauss-server/src/get_PlatForm_str`的平台信息一致。
+
+(2) 进入openGauss-server/src/gausskernel/Makefile,修改代码,如下图。
+
+ 
+
+(3) 进入openGauss-server/build/script/mpp_package.sh,添加ubuntu信息。
+```
+if [ X"$kernel" == X"centos" ]; then
+ dist_version="CentOS"
+elif [ X"$kernel" == X"openeuler" ]; then
+ dist_version="openEuler"
+elif [ X"$kernel" == X"euleros" ]; then
+ dist_version="EulerOS"
+elif [ X"$kernel" == X"kylin" ]; then
+ dist_version="Kylin"
+elif [ X"$kernel" == X"ubuntu" ]; then
+ dist_version="Ubuntu"
+else
+ echo "We only support openEuler(aarch64), EulerOS(aarch64), CentOS, Kylin(aarch64) and Ubuntu(x86) platform."
+ echo "Kernel is $kernel"
+ exit 1
+fi
+```
+(4) 进入openGauss-server/build/script/package_opengauss.sh,添加Ubuntu信息。
+ 同(3)添加信息一样
+
+### 3.2.依赖库
+建议使用从列出的操作系统安装盘或安装源中获取的以下依赖软件的默认安装包进行安装。如果不存在以下软件,请参考推荐的软件版本。
+
+
+
+ 依赖库 |
+ Ubuntu对应版本 |
+
+
+ libaio |
+ 0.3.110.-5ubuntu0.1 |
+
+
+ ncurses |
+ apt install libncurses5-dev 版本6.1-1ubuntu1.18.04 |
+
+
+ glibc |
+ 2.27-3ubuntu1.3 |
+
+
+ flex |
+ flex2.6.1 |
+
+
+ bison |
+ bison3.5.3 |
+
+
+ patch |
+ 2.7.6 |
+
+
+ lsb_release |
+ 9.20170808ubuntu1 |
+
+
+ lsb_release |
+ 9.20170808ubuntu1 |
+
+
+ cmake |
+ 3.16以上版本 |
+
+
+
+
+查看版本方式:
+```
+ apt list | grep libaio-dev
+ flex –version
+ bison --version
+ patch --version
+ apt list | grep lsb
+ glibc:ldd --version
+```
+`Tips`: flex2.6.1和bison3.5.3 版本对应,数据库编译才能成功
+### 3.2.环境变量
+将自己的opengauss源码包和binarylibs路径放入环境变量文件gauss_env,内容如下:
+
+导入环境变量:
+```
+export CODE_BASE=/usr2/compile/openGauss-server
+export BINARYLIBS=/usr2/compile/binarylibs
+export GAUSSHOME=$CODE_BASE/dest/
+export GCC_PATH=$BINARYLIBS/buildtools/ubuntu18.04_x86_64/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
+```
+`Tips`: 环境变量里面一定要写export,即使`echo $GCC_PATH`存在,也要写export才能真正导入路径
+
+参数说明:
+CODE_BASE 为openGauss-server源码目录;
+BINARYLIBS 为第一步编译好的三方库二进制目录;
+GAUSSHOME 为编译完成的目标文件路径;
+GCC_PATH 二进制中,GCC编译结果存放的路径,在三方库buildtools/ubuntu18.04_x86_64/目录下;
+
+### 3.3.数据库编译与打包
+#### 3.3.1 手动编译
+(1) 导入3.2节环境变量
+(2) 选择一个版本进行配置
+```
+debug版本:
+./configure --gcc-version=7.3.0 CC=g++ CFLAGS='-O0' --prefix=$GAUSSHOME --3rd=$BINARYLIBS --enable-debug --enable-cassert --enable-thread-safety --without-zlib
+
+release版本:
+
+./configure --gcc-version=7.3.0 CC=g++ CFLAGS="-O2 -g3" --prefix=$GAUSSHOME --3rd=$BINARYLIBS --enable-thread-safety --with-readline --without-zlib
+
+```
+(3) make -sj && make install –sj
+
+#### 3.3.2 一键编译
+无需导入环境变量
+```
+sh build.sh -m release -3rd /usr2/compile/binarylibs
+```
+#### 3.3.1 二进制打包
+无需导入环境变量
+```
+sh build.sh -m release -3rd /usr3/zxgauss/binarylibs -pkg (参数-pkg表示打包)
+```
+打包之后的结果在openGauss-server/output目录下,如下图:
+
+
+
+在openGauss-server/output目录下,主要tar包如下图:
+
+
+
+
+`Tips`: 三方库和数据库编译过程中出现的问题请参考:[编译问题解决](/zh/post/zhengxue/problem_solution/)
+
+
+
+
diff --git a/content/zh/post/zhengxue/problem_solution.md b/content/zh/post/zhengxue/problem_solution.md
new file mode 100644
index 0000000000000000000000000000000000000000..bc48ea07910cef9183bee4ce890e73843bb9f5bb
--- /dev/null
+++ b/content/zh/post/zhengxue/problem_solution.md
@@ -0,0 +1,190 @@
++++
+title = "ubuntu18.04_x86_64系统----openGauss数据库编译问题解决"
+date = "2021-04-20"
+tags = ["ubuntu18.04_x86_64系统----openGauss数据库编译问题解决"]
+archives = "2021-04-20"
+author = "shirley_zhengx"
+summary = "ubuntu18.04_x86_64系统----openGauss数据库编译问题解决"
+img = "/zh/post/zhengxue/title/img1.png"
+times = "9:30"
++++
+
+
+
+- [1. 编译三方库的问题解决](#1.编译三方库的问题解决)
+- [2. 编译数据库的问题解决](#2.编译数据库的问题解决)
+
+
+
+
+# 1.编译三方库的问题解决
+(1) python没有找到
+
+原因:输入命令`python`,发现是python2版本,需要python3
+
+解决:
+```
+rm -rf /usr/bin/python
+ln -s /usr/bin/python3 /usr/bin/python
+```
+(2) 编译libcgroup
+
+原因分析:去/data/openGauss-third_party/dependency/libcgroup下执行该命令,提示信息:
+```
+Command 'rpm2cpip' not found, but can be installed with:
+apt install rpm2cpio
+```
+解决:apt install rpm2cpio
+
+(3) 编译cJson
+
+
+
+原因分析:source 没有找到,可能是因为bash的问题,用命令ls -l `which sh` 查看发现是dash,不是bash,如下图:
+
+
+
+解决:sudo dpkg-reconfigure dash 重新配置dash,选择no则是bash
+
+(4) 编译cffi
+
+
+
+解决:安装apt install libffi-dev,apt install libssl-dev,如果安装之后还报错误,换一个窗口执行
+
+(5) 编译masstree
+
+
+
+解决:apt install rename
+
+(6) 编译libthrift
+
+
+
+解决:apt install pkg-config
+
+(7) 编译libthrift
+
+
+
+原因分析:依赖的问题,boost要在libthrift之前编译,libthrift编译依赖boost
+
+解决: 编译libthrift之前确保boost、openSSL已编译完成。
+
+(8) 编译parquet
+
+出现关于boost、zlib包的问题
+
+解决:parquet依赖boost、zlib,编译arquet之前确保boost、zlib已编译完成
+
+(9) 编译parquet
+
+
+
+原因分析: 查看log,发现cmake问题
+
+
+
+解决: 安装cmake3.16版本以上,并导入环境变量
+
+(10) 编译libxml2
+
+
+
+原因分析:用file命令(辨识文件类型:file 文件名),执行 `file libxml2-2.9.9.tar.gz`,如下图,发现包类型不对,包与社区源码的大小不一样,是因为包没有下载好。
+
+
+
+解决:用root用户重新git clone,如果还是包大小不对,则去gitee仓库页面下载。
+
+(11) 编译pljava
+
+
+
+原因分析:同(10)一样
+
+解决:root用户重新git clone,如果还是包大小不对,则去gitee仓库页面下载。
+
+(12) 编译pljava
+
+
+
+解决: apt install libkrb5-dev
+
+(13)
+
+
+
+解决: apt install libjsoncpp-dev
+
+(14)
+
+
+
+原因分析: 原因1:查看是不是python3
+ 原因2:查看:boost_1_72_0/tools/build/src/tools/python.jam,如下图:
+ 
+
+解决: 修改为includes ?= $(prefix)/include/python$(version)m
+
+
+# 2.编译数据库的问题解决
+
+(1)
+
+
+
+原因: felx和bison版本不一致引起
+
+解决: 需安装flex和bison对应版本,安装flex2.6.1 和 bison3.5.3,并导入环境变量。
+ 此错误一旦出现,安装flex和bison之后,make distclean无法清除所有残留文件,再次编译会同样报错,建议重新下载源码编译。
+
+(2)
+
+
+
+去掉s,重新make,可以看到详细信息
+
+
+
+解决:安装apt install libstdc++-8-dev,一定要make clean之后再重新编译
+
+(3)
+
+
+
+
+
+原因分析:编译中需要usr/bin/flex
+解决: apt install flex apt install bison
+
+(4)
+
+
+
+原因分析: 查看config.log,如下图:
+
+
+
+解决:
+```
+cd /usr/include
+ln -s x86_64-linux-gnu/asm asm
+```
+(5)
+
+
+
+解决:apt install libedit-dev
+
+
+
+
+
+
+
+
+
+
+
diff --git a/content/zh/post/zhengxue/title/img1.png b/content/zh/post/zhengxue/title/img1.png
new file mode 100644
index 0000000000000000000000000000000000000000..65e2d4c4751f069c64357704715e2ba99beb511a
Binary files /dev/null and b/content/zh/post/zhengxue/title/img1.png differ