Commit 737b1b57 authored by Jim Harris's avatar Jim Harris
Browse files

build: add dpdk as a submodule



This will allow a git clone to default to an SPDK-specific
version of the DPDK repository.  Users can still override
to use a separate DPDK repository/installation with the
--with-dpdk configure script options.

While here, remove gzip option for the git-archive operations
in autopackage.sh.  We need to add a git-archive for the DPDK
submodule if we are using it, and compressing at -9 adds a lot
of unnecessary time.  Since we are not archiving these packages,
there is no need to compress them.  Also explicitly disable
coverage and ubsan for the autopackage build, since this build
is only to test compilation and is not actually used for any
test execution.

Signed-off-by: default avatarJim Harris <james.r.harris@intel.com>
Change-Id: I3cf8a2ed984003a175cdece6542636ede8cb2479
parent 8de75f81
Loading
Loading
Loading
Loading

.gitmodules

0 → 100644
+3 −0
Original line number Diff line number Diff line
[submodule "dpdk"]
	path = dpdk
	url = https://github.com/spdk/dpdk.git
+6 −0
Original line number Diff line number Diff line
@@ -40,11 +40,17 @@ DIRS-y += lib test examples app

.PHONY: all clean $(DIRS-y) config.h CONFIG.local mk/cc.mk

ifeq ($(CURDIR)/dpdk/build,$(CONFIG_DPDK_DIR))
DPDKBUILD = dpdkbuild
DIRS-y += dpdkbuild
endif

all: $(DIRS-y)
clean: $(DIRS-y)
	$(Q)rm -f mk/cc.mk
	$(Q)rm -f config.h

lib: $(DPDKBUILD)
app: lib
test: lib
examples: lib
+20 −15
Original line number Diff line number Diff line
@@ -53,20 +53,13 @@ FreeBSD:

    sudo pkg install gmake cunit openssl

Additionally, [DPDK](http://dpdk.org/doc/quick-start) is required.
Additionally, [DPDK](http://dpdk.org/doc/quick-start) is required.  The SPDK
repository includes a suitable version of DPDK as a submodule.  Newer versions
of git will automatically fetch the DPDK submodule.  Older versions of git may
require:

    1) cd /path/to/spdk
    2) wget http://fast.dpdk.org/rel/dpdk-17.02.tar.xz
    3) tar xf dpdk-17.02.tar.xz
    4) mv dpdk-17.02 dpdk

Linux:

    4) (cd dpdk && make install T=x86_64-native-linuxapp-gcc DESTDIR=.)

FreeBSD:

    4) (cd dpdk && gmake install T=x86_64-native-bsdapp-clang DESTDIR=.)
    1) git submodule init
    2) git submodule update

Building
========
@@ -94,8 +87,6 @@ quickly. Currently this has only been tested on MacOS with the
[VirtualBox Extension Pack](https://www.virtualbox.org/wiki/Downloads) must
also be installed for NVMe support.

Download DPDK as a subdirectory in the SPDK repository as described above.
You do *not* need to build DPDK - the Vagrant scripts will do this for you.
If you are behind a corporate firewall, set http_proxy and https_proxy in
your environment before running the following steps.

@@ -135,6 +126,20 @@ line:

    make CONFIG_RDMA=y

Users may wish to use a version of DPDK different from the submodule included
in the SPDK repository.  To specify an alternate DPDK installation, run
configure with the --with-dpdk option.  For example:

Linux:

    ./configure --with-dpdk=/path/to/dpdk/x86_64-native-linuxapp-gcc
    make

FreeBSD:

    ./configure --with-dpdk=/path/to/dpdk/x86_64-native-bsdapp-clang
    gmake

The options specified on the `make` command line take precedence over the
default values in `CONFIG` and `CONFIG.local`. This can be useful if you, for
example, generate a `CONFIG.local` using the `configure` script and then have
+18 −7
Original line number Diff line number Diff line
@@ -20,20 +20,31 @@ if [ `git status --porcelain | wc -l` -ne 0 ]; then
	exit 1
fi

pv=spdk-$(date +%Y_%m_%d)
spdk_pv=spdk-$(date +%Y_%m_%d)
spdk_tarball=${spdk_pv}.tar
dpdk_pv=dpdk-$(date +%Y_%m_%d)
dpdk_tarball=${dpdk_pv}.tar

find . -iname "spdk-*.tar.gz" -delete
git archive HEAD -9 --prefix=${pv}/ -o ${pv}.tar.gz

tarball=$(ls -1 spdk-*.tar.gz)
find . -iname "spdk-*.tar* dpdk-*.tar*" -delete
git archive HEAD --prefix=${spdk_pv}/ -o ${spdk_tarball}

# Build from packaged source
tmpdir=$(mktemp -d)
echo "tmpdir=$tmpdir"
tar -C "$tmpdir" -xf $tarball
tar -C "$tmpdir" -xf $spdk_tarball

if [ -z "$WITH_DPDK_DIR" ]; then
	cd dpdk
	git archive HEAD --prefix=dpdk/ -o ../${dpdk_tarball}
	cd ..
	tar -C "$tmpdir/${spdk_pv}" -xf $dpdk_tarball
fi

(
	cd "$tmpdir"/spdk-*
	./configure $config_params --disable-debug --enable-werror
	# use $config_params to get the right dependency options, but disable coverage and ubsan
	#  explicitly since they are not needed for this build
	./configure $config_params --disable-debug --enable-werror --disable-coverage --disable-ubsan
	time $MAKE ${MAKEFLAGS}
)
rm -rf "$tmpdir"
+2 −3
Original line number Diff line number Diff line
@@ -27,7 +27,7 @@ function usage()
	echo "                           disable features and components."
	echo ""
	echo "Valid dependencies are listed below."
	echo " dpdk                      Required unless providing an alternate env implementation."
	echo " dpdk                      Optional.  Uses dpdk submodule in spdk tree if not specified."
	echo "                           example: /usr/share/dpdk/x86_64-default-linuxapp-gcc"
	echo " fio                       Required to build fio_plugin."
	echo "                           example: /usr/src/fio"
@@ -121,8 +121,7 @@ done

if [ -z "$CONFIG_ENV" ]; then
	if [ -z "$CONFIG_DPDK_DIR" ]; then
		echo "You must specify the path to dpdk using --with-dpdk=path."
		exit 1
		CONFIG_DPDK_DIR=$(readlink -f $(dirname $0))/dpdk/build
	fi
fi

Loading