沈天真
作者沈天真·2021-05-05 11:15
售前支持·IPS

源码编译安装 Envoy on K1 Power Linux

字数 3163阅读 2981评论 0赞 0

Envoy 是一款由 Lyft 开源的,使用 C++ 编写的 L7 代理和通信总线,目前是 CNCF 旗下的开源项目,代码托管在 GitHub 上,它也是 Istio service mesh 中默认的 data plane。

环境 : power9 ppc64le + Redhat 7.6

[root@clgitlab ~]# cat /etc/redhat-release

Red Hat Enterprise Linux Server release 7.6 (Maipo)

[root@clgitlab ~]#

[root@clgitlab ~]# uname -a

Linux clgitlab 4.14.0-115.8.1.el7a.ppc64le #1 SMP Wed Jun 5 15:02:21 UTC 2019 ppc64le ppc64le ppc64le GNU/Linux

[root@clgitlab ~]#

安装 bazel

https://docs.bazel.build/versions/master/install-compile-source.html

安装依赖

bash, openjdk-1.8, gcc, g++ ,zip, unzip, python

安装 advanced toolchain 12.0.3 ,编译 bazel 3.7.1 需要 gcc 8 以上

设置 gcc 路径 /opt/at12.0/bin

下载 https://github.com/bazelbuild/bazel/releases/download/3.7.1/bazel-3.7.1-dist.zip

unzip -d bazel-3.7.1-dist bazel-3.7.1-dist.zip

[root@clgitlab bazel-3.7.1-dist]# env EXTRA_BAZEL_ARGS="--host_javabase=@local_jdk//:jdk" bash ./compile.sh

Build successful! Binary is here: /home/bigdata/bazel-3.7.1-dist/output/bazel

[root@clgitlab bazel-3.7.1-dist]#

设置软链接

[root@clgitlab output]# ln -s /home/bigdata/bazel-3.7.1-dist/output/bazel /usr/bin/bazel

[root@clgitlab bigdata]# bazel version

WARNING: The following rc files are no longer being read, please transfer their contents or import their path into one of the standard rc files:

.bazelrc

Build label: 3.7.1- (@non-git)

Build target: bazel-out/ppc-opt/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar

Build time: Tue Dec 15 07:22:53 2020 (1608016973)

Build timestamp: 1608016973

Build timestamp as int: 1608016973

[root@clgitlab bigdata]#

安装 gcc

编译bazel,已经安装了 at 12.0.3

安装 git

至少升级到 2.9.5

安装 jdk

安装 openjdk-1.8

安装 cmake

wget https://github.com/Kitware/CMake/releases/download/v3.18.5/cmake-3.18.5.tar.gz

tar -zxvf cmake-3.18.5.tar.gz

./configure --prefix=/usr/local/cmake-3.18.5

make -j32

make install

设置 PATH

[root@clgitlab bigdata]# which cmake

/usr/local/cmake-3.18.5/bin/cmake

[root@clgitlab bigdata]# cmake --version

cmake version 3.18.5

CMake suite maintained and supported by Kitware (kitware.com/cmake).

[root@clgitlab bigdata]#

* 不要用 advanced toolchain 12.0 编译,openssl libcmcurl 库的版本配合有问题

安装 python 3.6 以上版本

yum install python36

[root@clgitlab bigdata]# python3 -V

Python 3.6.8

[root@clgitlab bigdata]#

安装 automake / autoconf

[root@clgitlab bigdata]# rpm -qa|grep automake

automake-1.13.4-3.el7.noarch

[root@clgitlab bigdata]# rpm -qa|grep autoconf

autoconf-2.69-11.el7.noarch

[root@clgitlab bigdata]#

安装 libtool

[root@clgitlab bigdata]# rpm -qa|grep libtool

libtool-ltdl-2.4.2-22.el7_3.ppc64le

libtool-2.4.2-22.el7_3.ppc64le

[root@clgitlab bigdata]#

安装 ninja-build

yum install ninja-build

[root@clgitlab bigdata]# ninja-build --version

1.7.2

[root@clgitlab bigdata]#

设置软链接

[root@clgitlab envoy]# ln -s /usr/bin/ninja-build /usr/bin/ninja

[root@clgitlab envoy]# which ninja

/usr/bin/ninja

[root@clgitlab envoy]#

编译 envoy

使用 advanced toolchain 12.0.3 编译,因为之前的 bazel 就是用 at 12.0.3 编译安装的;

[root@clgitlab envoy]# bazel build --sandbox_debug --verbose_failures -c opt //source/exe:envoy-static --cxxopt="-Wno-error=maybe-uninitialized" --cxxopt="-Wno-error=uninitialized" --cxxopt="-DENVOY_IGNORE_GLIBCXX_USE_CXX11_ABI_ERROR=1" --cxxopt="-Wno-error=type-limits"

参考链接:https://blog.csdn.net/netyeaxi/article/details/109174309

如果觉得我的文章对您有用,请点赞。您的支持将鼓励我继续创作!

0

添加新评论0 条评论

Ctrl+Enter 发表

作者其他文章

相关文章

相关问题

相关资料

X社区推广