代码拉取完成,页面将自动刷新
#!/bin/bash
#FLAGS is filled with arguments for bind-interfaces.sh
FLAGS=""
#OPTIONS is filled with options for cmake
OPTIONS=''
MLX5=false
MLX4=false
MOON=false
while :; do
case $1 in
-h|--help)
echo "Usage: <no option> compile without Mellanox drivers; <-m|--mlx5> compile mlx5; <-n|--mlx4> compile mlx4; <-h|--help> help;"
exit
;;
-m|--mlx5)
echo "Build with mlx5 driver selected"
OPTIONS="$OPTIONS""-DUSE_MLX5=ON "
MLX5=true
FLAGS="$FLAGS""--mlx5 "
;;
-n|--mlx4)
echo "Build with mlx4 driver selected"
OPTIONS="$OPTIONS""-DUSE_MLX4=ON "
MLX4=true
FLAGS="$FLAGS""--mlx4 "
;;
--moongen) #For internal use only
echo "Build libmoon with MoonGen"
MOON=true
;;
-?*)
printf 'WARN: Unknown option (abort): %s\n' "$1" >&2
exit
;;
*)
break
esac
shift
done
# TODO: this should probably be a makefile
(
cd $(dirname "${BASH_SOURCE[0]}")
git submodule update --init --recursive
NUM_CPUS=$(cat /proc/cpuinfo | grep "processor\\s: " | wc -l)
(
cd deps/luajit
make -j $NUM_CPUS BUILDMODE=static 'CFLAGS=-DLUAJIT_NUMMODE=2 -DLUAJIT_ENABLE_LUA52COMPAT'
make install DESTDIR=$(pwd)
)
(
cd deps/dpdk
#build DPDK with the right configuration
make config T=x86_64-native-linux-gcc O=x86_64-native-linux-gcc
sed -ri 's,(CONFIG_RTE_LIBRTE_IEEE1588=).*,\1y,' x86_64-native-linux-gcc/.config
if ${MLX5} ; then
sed -ri 's,(MLX5_PMD=).*,\1y,' x86_64-native-linux-gcc/.config
fi
if ${MLX4} ; then
sed -ri 's,(MLX4_PMD=).*,\1y,' x86_64-native-linux-gcc/.config
fi
make -j $NUM_CPUS O=x86_64-native-linux-gcc
)
(
cd lua/lib/turbo
make 2> /dev/null
if [[ $? > 0 ]]
then
echo "Could not compile Turbo with TLS support, disabling TLS"
echo "Install libssl-dev and OpenSSL to enable TLS support"
make SSL=none
fi
)
(
cd deps/highwayhash
make
)
(
if ! ${MOON}
then
cd build
else
cd ../build
fi
cmake ${OPTIONS}..
make -j $NUM_CPUS
)
echo Trying to bind interfaces, this will fail if you are not root
echo Try "sudo ./bind-interfaces.sh" if this step fails
./bind-interfaces.sh ${FLAGS}
)
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。