diff --git a/content/zh/post/xingchen/boost_compile_failed.md b/content/zh/post/xingchen/boost_compile_failed.md new file mode 100644 index 0000000000000000000000000000000000000000..f770105a2658840df3a819a92f174ac36f224bd5 --- /dev/null +++ b/content/zh/post/xingchen/boost_compile_failed.md @@ -0,0 +1,64 @@ ++++ +title = "boost编译失败" +date = "2021-05-21" +tags = ["boost编译失败"] +archives = "2021-05-21" +author = "xingchen" +summary = "boost编译失败" +img = "/zh/post/xingchen/title/img1.png" +times = "19:30" ++++ + +## 概述 + +本文档介绍再编译openGauss-third_party三方库时候,boost编译失败解决方法。 目前在 1.1.0 2.0.0 版本都适用。 + +## 错误分析和处理 + +在编译openGauss-third_party三方库时候,我们首先在build目录下执行`sh build.sh`,三方库自行编译。 但是经常遇到在编译到boost的时候,脚本终止掉了。很明显,这里面编译出错了。 + +![](../images/boost/image1.png) + +dependency依赖的编译日志在 `dependency/build` 目录下demo.log,这里面可以很明显的看到错误信息。 +也可以进入到`dependency/boost`目录下,单独编译,看看报错。 + +``` +sh build.sh -m all +``` +![](../images/boost/image2.png) + +可以看到缺少了 pyconfig.h 头文件。 +使用 `yum provides */pyconfig.h` 查找下,发现在python-devel包里面,需要安装下`python2-devel`包。 +![](../images/boost/image3.png) + +``` +yum install python2-devel +yum install python3-devel +``` + +其实我们在编译前,已经安装过这两个依赖。但是还是出现了这个问题。。。。 + +我们在开始编译的时候,做了这个操作,将python链接到python3: `ln -s /usr/bin/python3 /usr/bin/python` +![](../images/boost/image5.png) + +这里是因为,三方库里面有很多需要使用python3编译的三方库,但是脚本中写的`/usr/bin/python`的执行环境,所以需要做这个链接操作,将python指向python3。\ +但是boost编译,依赖的头文件是python2-devel的,这里需要将python链接到python2上。如下: + +``` +unlink /usr/bin/python +ln -s /usr/bin/python2 /usr/bin/python +``` + +再次编译 `sh build.sh -m all`,编译成功。 + +![](../images/boost/image4.png) + +在 `dependency/build/build_dependency.sh` 里面,注释掉已经编译好的脚本片段,执行 `sh build_dependency.sh` +继续编译未完成的三方库。 + +***注意:在编译完boost后,还需要将python再链接到python3,以完成后面三方库的编译工作。*** + +``` +unlink /usr/bin/python +ln -s /usr/bin/python3 /usr/bin/python +``` \ No newline at end of file diff --git a/content/zh/post/xingchen/compile_without_lse.md b/content/zh/post/xingchen/compile_without_lse.md new file mode 100644 index 0000000000000000000000000000000000000000..dcdafa37594a41ec2150ae27307a4c4a2865c877 --- /dev/null +++ b/content/zh/post/xingchen/compile_without_lse.md @@ -0,0 +1,39 @@ ++++ +title = "安装时报指令错误的处理" +date = "2021-05-21" +tags = ["安装时报指令错误的处理"] +archives = "2021-05-21" +author = "xingchen" +summary = "安装时报指令错误的处理" +img = "/zh/post/xingchen/title/img1.png" +times = "19:30" ++++ + +### 概述 + +在一些非官方指定的系统上面 (官方指定的系统:https://opengauss.org/zh/docs/latest/docs/Description/%E8%BF%90%E8%A1%8C%E7%8E%AF%E5%A2%83.html), 使用官网提供的镜像安装数据库,有时会遇到一些 `"非法指令" "illegal instruction"` 的问题, 这些往往是由于CPU指令集不兼容导致的。 + +此处我们只说下在ARM上面安装失败的问题。 + +常见的主要如下: + +官网发布的 `openEuler_arm` 包,在编译的时候,打开了`ARM_LSE`指令集做了编译的优化。但是对于一些其他版本的arm服务器,不一定支持。 + +代码注释中这么写的: +``` +build\script\mpp_package.sh + +# it may be risk to enable 'ARM_LSE' for all ARM CPU, but we bid our CPUs are not elder than ARMv8.1 +``` + +实测在 ***鲲鹏920*** 和 ***麒麟990*** 的cpu芯片下是支持安装的。 +cpu可以通过 `lscpu` 名称查看。 + +对于其他不自持该指令的系统,需要去掉 `-D__ARM_LSE` 指令重新编译即可。 + +在编译脚本中 `build\script\mpp_package.sh`,删除掉所有的 `-D__ARM_LSE` , 重新编译数据库。 + +patch如下图: + +![](../images/compile/withoutlse.png) + diff --git a/content/zh/post/xingchen/images/boost/image1.png b/content/zh/post/xingchen/images/boost/image1.png new file mode 100644 index 0000000000000000000000000000000000000000..dafda6f55292f413a51692dae36d78a693d03000 Binary files /dev/null and b/content/zh/post/xingchen/images/boost/image1.png differ diff --git a/content/zh/post/xingchen/images/boost/image2.png b/content/zh/post/xingchen/images/boost/image2.png new file mode 100644 index 0000000000000000000000000000000000000000..1b4e9a980d8ba6c67374118d0d0e7f80a096bd07 Binary files /dev/null and b/content/zh/post/xingchen/images/boost/image2.png differ diff --git a/content/zh/post/xingchen/images/boost/image3.png b/content/zh/post/xingchen/images/boost/image3.png new file mode 100644 index 0000000000000000000000000000000000000000..d83b8c71dcc5fb842d74fe396efc5ee0a8c8ee8a Binary files /dev/null and b/content/zh/post/xingchen/images/boost/image3.png differ diff --git a/content/zh/post/xingchen/images/boost/image4.png b/content/zh/post/xingchen/images/boost/image4.png new file mode 100644 index 0000000000000000000000000000000000000000..1ccf5b9ebbc2b28d61ca898371f5085dcb090dc8 Binary files /dev/null and b/content/zh/post/xingchen/images/boost/image4.png differ diff --git a/content/zh/post/xingchen/images/boost/image5.png b/content/zh/post/xingchen/images/boost/image5.png new file mode 100644 index 0000000000000000000000000000000000000000..325458758738102cf351962dced3ba8a27bbabda Binary files /dev/null and b/content/zh/post/xingchen/images/boost/image5.png differ diff --git a/content/zh/post/xingchen/images/compile/withoutlse.png b/content/zh/post/xingchen/images/compile/withoutlse.png new file mode 100644 index 0000000000000000000000000000000000000000..f37fdfe49a8e1016423ed3e643dcd7aae138cb16 Binary files /dev/null and b/content/zh/post/xingchen/images/compile/withoutlse.png differ diff --git a/content/zh/post/xingchen/om_support_os.md b/content/zh/post/xingchen/om_support_os.md new file mode 100644 index 0000000000000000000000000000000000000000..3d5ebd25d78c97fcbbe692594e23134a468b5cd7 --- /dev/null +++ b/content/zh/post/xingchen/om_support_os.md @@ -0,0 +1,71 @@ ++++ +title = "openGauss-OM修改来适配其他操作系统的安装" +date = "2021-05-21" +tags = ["openGauss-OM修改来适配其他操作系统的安装"] +archives = "2021-05-21" +author = "xingchen" +summary = "OM修改来适配其他操作系统的安装" +img = "/zh/post/xingchen/title/img1.png" +times = "19:30" ++++ + +## 概述 + +openGauss官方发布的镜像(https://opengauss.org/zh/download.html), 企业版镜像的安装支持如下系统: +``` +centos7.6 x86_64 +openEuler20.03LTS arm | x86_64 +kylin v10 arm | x86_64 +``` +此外其他的系统,在使用OM工具进行安装的时候,提示不支持该操作系统。 + +但是也有很多系统,比如说上面这些系统的发行版,在操作系统内核方面与以上并没有多少区别,但是由于修改了os-release的信息,导致在安装openGauss数据库时候被识别为不支持的系统,安装不上。 + +## 解决方案 + +可以通过两种方式来解决: 1.修改OM代码,增加对操作系统适配 2.修改操作系统os-release信息 + +#### 1.修改OM代码,增加对操作系统适配 + +OM工具安装(也就是企业版的安装),在安装过程中,会对操作系统进行校验,我们修改相关的python文件,添加我们的系统信息。 + +获取当前操作系统的脚本: +``` +source /etc/os-release; echo $ID +``` +获取当前cpu系统架构: +``` +uname -p +``` + +在如下文件中添加系统信息,可以参照代码已有的系统修改: + +`script/gspylib/os/gsplatform.py` 文件: + +> 80 - 13行左右,增加操作系统平台信息和对应的版本。 + +> 1472行,getPackageFile 函数,增加对应的包名称。 + +`script/local/LocalCheckOS.py` 文件: + +> CheckPlatformInfo函数,增加操作系统平台与对应版本信息。 + +#### 2.修改操作系统os-release信息 + +安装的脚本代码会校验操作系统的版本,是否在支持的列表中。 我们也可以通过修改操作系统的版本标识为已有的这些系统,来骗过安装的脚本校验。 + +操作系统版本相关的信息,在 /etc目录下的release文件中: +``` +[root@ecs-6ac8 ~]# ll /etc | grep release +-rw-r--r-- 1 root root 37 Apr 6 15:52 centos-release +-rw-r--r-- 1 root root 51 Nov 23 23:08 centos-release-upstream +drwxr-xr-x. 2 root root 4096 Dec 13 00:27 lsb-release.d +lrwxrwxrwx 1 root root 21 Apr 1 14:32 os-release -> ../usr/lib/os-release +lrwxrwxrwx 1 root root 14 Apr 1 14:32 redhat-release -> centos-release +lrwxrwxrwx 1 root root 14 Apr 1 14:32 system-release -> centos-release +-rw-r--r-- 1 root root 23 Nov 23 23:08 system-release-cpe +``` + +我们修改这些文件,将其中内容改为对应的openEuler的或者centos的信息。 + +例如在centos7.4系统下,使用官方发布的包安装不上,可以修改`/etc/os-release`,改版本为7.6,即可正常安装。