1.1.3 Linux 平台直接编译¶
这里使用 Ubuntu 16.04 及以上系统来直接编译。
-
确保拥有以下系统依赖
GCC 10+,Oracle JDK 8+,Python 2.7+,Apache Maven 3.5+,CMake 3.19.2+,Bison 3.0+Bash 1 2 3 4 5
sudo apt install build-essential openjdk-8-jdk maven cmake byacc flex automake libtool-bin bison binutils-dev libiberty-dev zip unzip libncurses5-dev curl git ninja-build python sudo add-apt-repository ppa:ubuntu-toolchain-r/ppa sudo apt update sudo apt install gcc-10 g++-10 sudo apt-get install autoconf automake libtool autopoint -
与使用
Docker开发镜像编译一样,编译之前先检查是否支持AVX2指令Bash 1cat /proc/cpuinfo | grep avx2 -
支持则使用下面命令进行编译
Bash 1 2 3 4 5 6 7 8
# 默认编译出支持 AVX2 的 $ sh build.sh # 如不支持 AVX2 需要加 USE_AVX2=0 $ USE_AVX2=0 sh build.sh # 如需编译 Debug 版本的 BE,增加 BUILD_TYPE=Debug $ BUILD_TYPE=Debug sh build.sh -
编译完成后,产出文件在
output/目录中。