seastar在openEuler上的系统移植
1.源码下载
# 下载seastar代码 seastar:git clone https://gitee.com/mirrors/seastar.git # cd 到 seastar目录中,下载依赖。 在码云极速下载中有就在码云下载,没有在github上下载。 dpdk: git clone https://gitee.com/mirrors/dpdk.git c-ares: git clone https://gitee.com/mirrors/c-ares.git fmt:git clone https://github.com/scylladb/fmt.git
2.切换源码版本
找到目标源码合适版本是编译尝试出来的,采用编译错误版本最少的一个版本。
这里找到的版本是:seastar-18.08-branch
git branch -a git checkout seastar-18.08-branch
具体依赖包的版本号:
把依赖包切换到对应的版本,以fmt为例。
#切换到fmt目录运行如下命令: git log | grep fd6124c git checkout fd6124c74da0801f23f9d324559d8b66fb83f533 # 注意 Dpdk 要切换到 git checkout local-17.05,才能找 a1774652 # 注意2 子模块更新的通常命令如下: ## git submodule update --init --recursive ## 即可将子模块内容下载下来后工程才不会缺少相应的文件,但我们这个工程,有的子模块下载不下来。
3. seastar编译工具ninja安装
# 下载ninja源代码 git clone https://github.com/ninja-build/ninja.git # 编译ninja ./configure.py --bootstrap # 拷贝到/usr/bin/或者/usr/local/bin/目录下 cp ninja /usr/bin/ # . 编译ninja警告解决 warning: A compatible version of re2c (>= 0.11.3) was not found; changes to src/*.in.cc will not affect your build. ## 是因为没有re2c,下载re2c:https://github.com/skvadrik/re2c/releases ## 编译re2c tar -xvzf re2c-2.0.3.tar.gz cd re2c-2.0.3/ ./autogen.sh ./configure make make install # 1.1 在re2c中运行:./autogen.sh: 报行47: autoreconf: 未找到命令.执行下面的命令: yum -y install autoconf automake libtool 然后在编译re2c # re3c编译安装成功后,重新新编译安装ninja 注意:#### 把ninja拷贝到/usr/bin/目录中后,运行ninja不正常,设置执行ninja命令的当前目录中缺少build.ninja文件,不是安装异常。
4. seastar编译
4.1 依赖库:
0. boost, boost-devel (1.58以上), cmake, ninja 1. gnutls-devel 2. hwloc-devel 3. numactl-devel 4. protobuf protobuf-devel 5. ragel 6. yaml-cpp, yaml-cpp-devel 7. xfsprogs, xfsprogs-devel 8. lksctp-tools lksctp-tools-devel 9. lz4, lz4-devel 10. libpciaccess, libpciaccess-devel 11. libxml2, libxml2-devel
4.2 cryptopp依赖库编译安装
# 下载代码 git clone https://gitee.com/mirrors/cryptopp.git # 执行make make && make intall # 不使用make编译安装,使用rpm 打包安装 参考:https://blog..net/ustb_atrx/article/details/108599198
4.3 seatar编译:
# -j 后面的参数可选 ./configure.py --compiler=g++ --static-stdc++ ninja -j 2 release # seastar通过rpm打包 https://gitee.com/src-openeuler/seastar