"src/fwd_conv_batchnorm_rewrite.cpp" did not exist on "30a94e97ac1f0e9f3b1d87820d9ae3540e21512d"
install-mtcp.sh 3 KB
Newer Older
1
2
3
4
#!/bin/bash -eux

set -eux

5
apt-get -y install libnuma-dev libgmp-dev bc python libpcre3-dev libpcre++-dev zlib1g-dev
6
7
8
9
10
11
12
13
14
15
16
17
18
19

cd /tmp
wget https://ftp.gnu.org/gnu/automake/automake-1.16.2.tar.gz
tar xf automake-1.16.2.tar.gz
cd automake-1.16.2
./configure
make -j4 install

cd /tmp
git clone https://github.com/mtcp-stack/mtcp.git /root/mtcp
cd /root/mtcp
git submodule init
git submodule update

20
export MTCPDIR=$PWD
21
22
23
24
25
26
27
28
29
export RTE_SDK=$PWD/dpdk
export RTE_TARGET=x86_64-native-linuxapp-gcc

sed -i -e 's/O_TO_EXE_STR =/\$(shell if [ \! -d \${RTE_SDK}\/\${RTE_TARGET}\/lib ]\; then mkdir \${RTE_SDK}\/\${RTE_TARGET}\/lib\; fi)\nLINKER_FLAGS = \$(call linkerprefix,\$(LDLIBS))\n\$(shell echo \${LINKER_FLAGS} \> \${RTE_SDK}\/\${RTE_TARGET}\/lib\/ldflags\.txt)\nO_TO_EXE_STR =/g' $RTE_SDK/mk/rte.app.mk

sed -i -e 's/-Werror//' dpdk/kernel/linux/kni/Makefile
sed -i -e 's/-Werror//' dpdk/kernel/linux/igb_uio/Makefile
sed -i -e 's/-Werror//' dpdk/mk/toolchain/gcc/rte.vars.mk
rm -rf dpdk/.git
30
31
32
33
34
35
#sed -i \
#    -e 's/CONFIG_RTE_LIBRTE_I40E_DEBUG_RX=n/CONFIG_RTE_LIBRTE_I40E_DEBUG_RX=y/' \
#    -e 's/CONFIG_RTE_LIBRTE_I40E_DEBUG_TX=n/CONFIG_RTE_LIBRTE_I40E_DEBUG_TX=y/' \
#    -e 's/CONFIG_RTE_LIBRTE_I40E_DEBUG_TX_FREE=n/CONFIG_RTE_LIBRTE_I40E_DEBUG_TX_FREE=y/' \
#    -e 's/CONFIG_RTE_LOG_LEVEL=RTE_LOG_INFO/CONFIG_RTE_LOG_LEVEL=RTE_LOG_DEBUG/' \
#    dpdk/config/common_base
36
37
38
39
make -j4 -C dpdk install T=$RTE_TARGET

./configure --with-dpdk-lib=$RTE_SDK/$RTE_TARGET CFLAGS="-DMAX_CPUS=8"

40
41
42
#sed -i -e 's://#define DEBUG:#define DEBUG:' \
#    -e 's/RTE_LOG_EMERG/RTE_LOG_DEBUG/g' \
#    dpdk-iface-kmod/dpdk_iface_main.c
43
(cd dpdk-iface-kmod && make -j4)
44
45
make -j4

46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90

ls -l $MTCPDIR/apps

ln -s $MTCPDIR/apps/lighttpd-1.4.32 apps/lighttpd-mtcp
cp -r apps/lighttpd-1.4.32 apps/lighttpd-mtlinux
cp -r apps/lighttpd-1.4.32 apps/lighttpd-mtlinux-rop

ls -l $MTCPDIR/apps

# build mtcp version of lighttpd
cd $MTCPDIR/apps/lighttpd-mtcp
touch aclocal.m4 Makefile.in
./configure --without-bzip2 CFLAGS="-O3" \
    --with-libmtcp="$MTCPDIR/mtcp/" \
    --with-libdpdk="$RTE_SDK/$RTE_TARGET"
make -j4

cd $MTCPDIR/apps/lighttpd-mtlinux
touch aclocal.m4 Makefile.in
./configure --without-bzip2 CFLAGS="-O3" --enable-multithreading
make -j4

cd $MTCPDIR/apps/lighttpd-mtlinux-rop
touch aclocal.m4 Makefile.in
./configure --without-bzip2 CFLAGS="-O3 -DREUSEPORT" --enable-multithreading
make -j4


cd $MTCPDIR
ln -s $MTCPDIR/apps/apache_benchmark apps/ab-mtcp
cp -r apps/apache_benchmark apps/ab-linux

# build mtcp version of ab
cd $MTCPDIR/apps/ab-mtcp
./configure --with-libmtcp="$MTCPDIR/mtcp/" \
    --with-libdpdk="$RTE_SDK/$RTE_TARGET"
make -j4

# build linux version of ab
cd $MTCPDIR/apps/ab-linux
./configure
make -j4


# build tas microbenchmarks
91
92
93
94
95
96
97
98
git clone https://github.com/tcp-acceleration-service/tas.git /root/tas
(cd /root/tas && make lib/utils/rng.o)

git clone https://github.com/FreakyPenguin/benchmarks.git /root/tasbench
cd /root/tasbench/micro_rpc
make echoserver_mtcp testclient_mtcp MTCP_BASE="/root/mtcp" TAS_CODE="/root/tas"

echo "blacklist i40e" > /etc/modprobe.d/i40e_bl.conf