diff mbox

[PATCHv4,1/2] scripts: add builddpdk

Message ID 1458815487-8076-2-git-send-email-maxim.uvarov@linaro.org
State Superseded
Headers show

Commit Message

Maxim Uvarov March 24, 2016, 10:31 a.m. UTC
Add script to quickly build odp with dpdk pktio support.

Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
---
 .gitignore               |  1 +
 scripts/build-pktio-dpdk | 34 ++++++++++++++++++++++++++++++++++
 2 files changed, 35 insertions(+)
 create mode 100755 scripts/build-pktio-dpdk
diff mbox

Patch

diff --git a/.gitignore b/.gitignore
index b4c146b..4945d25 100644
--- a/.gitignore
+++ b/.gitignore
@@ -31,6 +31,7 @@  core
 cscope.out
 depcomp
 doc/output
+dpdk/
 install-sh
 lib/
 libtool
diff --git a/scripts/build-pktio-dpdk b/scripts/build-pktio-dpdk
new file mode 100755
index 0000000..81d5411
--- /dev/null
+++ b/scripts/build-pktio-dpdk
@@ -0,0 +1,34 @@ 
+#!/bin/bash
+
+TARGET=${TARGET:-"x86_64-native-linuxapp-gcc"}
+
+export ROOT_DIR=$(readlink -e $(dirname $0) | sed 's|/scripts||')
+pushd ${ROOT_DIR}
+
+echo '#include "pcap.h"' | cpp -H -o /dev/null 2>&1
+if [ "$?" != "0" ]; then
+	echo "Error: pcap is not installed. You may need to install libpcap-dev"
+fi
+
+git clone http://dpdk.org/git/dpdk dpdk
+pushd dpdk
+git checkout -b bv2.2.0 v2.2.0
+
+#Make and edit DPDK configuration
+make config T=${TARGET} O=${TARGET}
+pushd x86_64-native-linuxapp-gcc
+sed -ri 's,(CONFIG_RTE_BUILD_COMBINE_LIBS=).*,\1y,' .config
+#To use I/O without DPDK supported NIC's enable pcap pmd:
+sed -ri 's,(CONFIG_RTE_LIBRTE_PMD_PCAP=).*,\1y,' .config
+popd
+
+#Build DPDK
+make install T=${TARGET} EXTRA_CFLAGS="-fPIC"
+popd
+
+#Build ODP
+./bootstrap;
+./configure  --enable-test-vald  --enable-test-perf --enable-test-cpp \
+	     --enable-debug --enable-debug-print \
+	     --with-dpdk-path=`pwd`/dpdk/${TARGET}
+make