超實(shí)用干貨(1)-Apache greenplum在aarch64架構(gòu)體系的適配編譯
編譯環(huán)境
操作系統(tǒng):EulerOS 2.0 sp8
● 內(nèi)核:4.19.36
● CPU:aarch64
編譯所需軟件類別
cmake-3.23.0-rc1.tar.gz
下載地址:
https://cmake.org/files/v3.23/cmake-3.23.0-rc1.tar.gz
gp-xerces-3.1.2-p1.zip
下載地址:
https://github.com/greenplum-db/gp-xer ces/archive/refs/tags/v3.1.2-p1.zip
ninja-1.10.2.zip
下載地址:
https://github.com/ninja-build/ninja/archive /refs/tags/v1.10.2.zip
re2c-3.0.zip
下載地址:
https://github.com/skvadrik/re2c/archive/refs/ta gs/3.0.zip
zstd-1.5.2.tar.gz
下載地址:
https://github.com/facebook/zstd/releases/download/v1.5.2/zstd-1.5.2.tar.gz
配置yum源,并安裝如下依賴包
autoconf
automake
libtool
gcc
curl-devel
bzip2-devel
python-devel
openssl-devel
readline-devel
perl-ExtUtils-Embed
libxml2-devel
openldap-devel
pam
pam-devel
apr-devel
libevent-devel
libyaml
libyaml-devel
libedit-devel
libffi-devel
bison
flex
flex-devel
安裝python依賴包
# 使?pip 進(jìn)?python包管理,命令如下:
pip install --upgrade pip
pip install --no-cache-dir lockfile paramiko setuptools psutil conan
逐個(gè)安裝軟件列表內(nèi)容
可以根據(jù)每個(gè)軟件的readme?件進(jìn)?安裝
編譯
編譯GreenPlum 需要cmake和gcc,在上?操作中已經(jīng)配置完成,開始前可通過(guò)如下命令進(jìn)?確認(rèn)
檢查gcc版本
[root@RI_BDTL ~]# gcc --version
gcc (GCC) 7.3.0
檢查cmake版本
[root@RI_BDTL ~]# cmake --version
cmake version 3.23.0-rc1
準(zhǔn)備源碼包
6.19.1-src-full.tar.gz
下載地址:
https://github.com/greenplum-db/gpdb/releases/download/6.19.1/ 6.19.1-src-full.tar.gz
修改源碼 (6.19.1源碼中沒(méi)有對(duì)平臺(tái)判斷,修改為aarch64?持的指令)
[root@RI_BDTL packages]# tar -zxvf 6.19.1-src-full.tar.gz
[root@RI_BDTL packages]# vi gpdb_src/src/backend/gporca/libgpos/includ e/gpos/utils.h
修改 gpdb_src/src/backend/gporca/libgpos/include/gpos/utils.h 中22?和23?為:
#define GPOS_ASMFP asm volatile("mov %0, fp" : "=g"(ulp));
#define GPOS_ASMSP asm volatile("mov %0, sp" : "=g"(ulp));
編譯,編譯命令使?的readme中的命令,默認(rèn)是帶orca編譯的,這?通過(guò) --enable-orca 顯示指定了
[root@RI_BDTL packages]# cd gpdb_src
# Configure build environment to install at /usr/local/greenplum-6.19.1
[root@RI_BDTL gpdb_src]# export LD_LIBRARY_PATH=/usr/local/gp-xerces/l ib/ CFLAGS="-I/usr/local/gp-xerces/include" LDFLAGS="-L/usr/local/gp-x erces/lib/"
[root@RI_BDTL gpdb_src]# ./configure --enable-orca --with-perl --withpython --with-libxml --with-gssapi --prefix=/usr/local/greenplum-6.19.1
[root@RI_BDTL gpdb_src]# make -j8
[root@RI_BDTL gpdb_src]# make -j8 install
漫?的等待之后,出現(xiàn)如下提示,就說(shuō)明編譯成功了
Greenplum Database installation complete
查看編譯結(jié)果
[root@RI_BDTL local]# ls -lrt greenplum-6.19.1/
總?量 32
drwx------ 3 gpadmin gpadmin 4096 2? 11 15:47 docs
drwx------ 4 gpadmin gpadmin 4096 2? 11 16:11 share
drwx------ 4 gpadmin gpadmin 4096 2? 11 16:14 include
drwx------ 5 gpadmin gpadmin 4096 2? 11 16:14 lib
-rw------- 1 gpadmin gpadmin 491 2? 11 16:14 greenplum_path.sh
drwx------ 2 gpadmin gpadmin 4096 2? 11 16:14 libexec
drwx------ 2 gpadmin gpadmin 4096 2? 11 16:14 sbin
drwx------ 7 gpadmin gpadmin 4096 2? 11 16:14 bin
總結(jié)
編譯過(guò)程并不復(fù)雜,難點(diǎn)在于有?些依賴包安裝的不全,導(dǎo)致編譯不成功。
另外就是源碼包6.19.1中對(duì)aarch64指令集的修改,使GreenPlum可以正常編譯。
*博客內(nèi)容為網(wǎng)友個(gè)人發(fā)布,僅代表博主個(gè)人觀點(diǎn),如有侵權(quán)請(qǐng)聯(lián)系工作人員刪除。