Skip to contentSkip to conversation

standard make install

PATCH Superseded Thomas Monjalon 5 participants 67 messages Dec 2, 2015 – Dec 7, 2015

lore
Share & tools
lore
#0 lore raw

cover standard make install

Following the recent discussions, this is a proposal to have a standard installation process while keeping compatibility with most of the old behaviours.
Thank you Mario and Bruce for having submitted other proposals. I hope there will be a strong consensus for this one.
The doc and pkg/dpdk.spec are not updated yet. There will be a v2.

More details below and in the commit messages.

These variables can be overriden:

prefix ?= /usr/local
exec_prefix ?= $(prefix)
kerneldir ?= $(exec_prefix)/kmod
bindir ?= $(exec_prefix)/bin
sbindir ?= $(exec_prefix)/sbin
libdir ?= $(exec_prefix)/lib
includedir ?= $(prefix)/include/dpdk
datarootdir ?= $(prefix)/share
docdir ?= $(datarootdir)/doc/dpdk
datadir ?= $(datarootdir)/dpdk
sdkdir ?= $(datadir)

All paths are prefixed with $(DESTDIR)

One rule install = install-runtime install-kmod install-sdk In current behaviour, the doc is not installed by default.

--------

System-wise install example with
DESTDIR=
prefix=/usr
kerneldir=/lib/modules/kver/extra

# make install-runtime
/usr/bin/testpmd
/usr/lib/libethdev*
/usr/lib/librte_*
/usr/sbin/dpdk_nic_bind -> /usr/share/dpdk/tools/dpdk_nic_bind.py
/usr/share/dpdk/.config
/usr/share/dpdk/tools/
# make install-kmod
/lib/modules/kver/extra/
# make install-sdk
/usr/include/dpdk/
/usr/share/dpdk/mk/
/usr/share/dpdk/scripts/
/usr/share/dpdk/include -> /usr/include/dpdk/
/usr/share/dpdk/lib     -> /usr/lib/
# make install-doc
/usr/share/doc/dpdk/api/
/usr/share/doc/dpdk/examples/
/usr/share/doc/dpdk/guides/

--------

Local install example with old (compatible) command:

# make install T=x86_64-native-linuxapp-gcc DESTDIR=install

would be equivalent to:

# make config T=x86_64-native-linuxapp-gcc 0=x86_64-native-linuxapp-gcc
# make O=x86_64-native-linuxapp-gcc
# make install O=x86_64-native-linuxapp-gcc prefix= DESTDIR=install

install/bin/testpmd
install/include/dpdk/
install/kmod/
install/lib/
install/sbin/dpdk_nic_bind -> ../share/dpdk/tools/dpdk_nic_bind.py install/share/dpdk/.config
install/share/dpdk/include -> install/include/dpdk/
install/share/dpdk/lib -> install/lib/
install/share/dpdk/mk/
install/share/dpdk/scripts/
install/share/dpdk/tools/

It must be usable to build some applications as before:

# make -C examples/helloworld RTE_SDK=$(readlink -m install) RTE_TARGET=x86_64-native-linuxapp-gcc

The RTE_SDK directory must point to install/share/dpdk with a default install. RTE_TARGET was used to get the include and lib directories but is useless now.

--------

Thomas Monjalon (10):
mk: remove multi-target install
mk: move installation procedure in install rule
mk: install a standard cutomizable tree
mk: introduce new install syntax
mk: split install rule
mk: install kernel modules
mk: install binding tool in sbin directory
mk: install doc
mk: install examples
app/proc_info: rename binary with prefix

 app/proc_info/Makefile     |   2 +-
 doc/build-sdk-quick.txt    |  11 ++--
 mk/internal/rte.extvars.mk |   8 +++
 mk/rte.sdkbuild.mk         |  16 ------
 mk/rte.sdkinstall.mk       | 134 +++++++++++++++++++++++++++++++--------------
 mk/rte.sdkroot.mk          |   6 +-
 mk/rte.vars.mk             |   7 ---
 7 files changed, 113 insertions(+), 71 deletions(-)
Signature · 1 line
2.5.2
#1 lore raw

PATCH 1/10 mk: remove multi-target install

The multi-target install create some subdirectories with the target name which is not standard for a "make install" procedure.

The uninstall procedure cannot be applied properly (without removing all files in a directory). It would need to pre-compute paths.
As it is a packaging issue, it is removed from the build system capabilities.

---
 doc/build-sdk-quick.txt |  5 ++--
 mk/rte.sdkinstall.mk    | 61 +++++++++++++------------------------------------
 mk/rte.sdkroot.mk       |  4 ++--
 3 files changed, 20 insertions(+), 50 deletions(-)
doc/build-sdk-quick.txt +2 -3
index bf18b48..b5f752e 100644
@@ -5,8 +5,7 @@ Build commands
 	all              same as build (default rule)
 	build            build in a configured directory
 	clean            remove files but keep configuration
-	install          build many targets (wildcard allowed) and install in DESTDIR
-	uninstall        remove all installed targets
+	install          configure, build and install a target in DESTDIR
 	examples         build examples for given targets (T=)
 	examples_clean   clean examples for given targets (T=)
 Build variables
@@ -20,6 +19,6 @@ Build variables
 	D         debug dependencies
 	O         build directory (default: build/ - install default: ./)
 	DESTDIR   second-stage install directory
-	T         target template (install default: *) - used with config or install
+	T         target template - used with config or install
 			format: <arch-machine-execenv-toolchain>
 			templates in config/defconfig_*
mk/rte.sdkinstall.mk +16 -45

74 lines not on this page · raw message

mk/rte.sdkroot.mk +2 -2
index e8423b0..18180fa 100644
@@ -97,8 +97,8 @@ test fast_test ring_test mempool_test perf_test coverage:
 testall:
 	$(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdktestall.mk $@
 
-.PHONY: install uninstall
-install uninstall:
+.PHONY: install
+install:
 	$(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdkinstall.mk $@
 
 .PHONY: doc help
Signature · 1 line
2.5.2
#2 lore raw

PATCH 2/10 mk: move installation procedure in install rule

In reply to Thomas Monjalon

The real installation was called "binary install" and was done after the build when DESTDIR was specified.
Remove this limitation and move the code in install rule only.

---
 mk/rte.sdkbuild.mk   | 16 ----------------
 mk/rte.sdkinstall.mk | 21 ++++++++++++++++++---
 2 files changed, 18 insertions(+), 19 deletions(-)
mk/rte.sdkbuild.mk +0 -16
index 38ec7bd..85f603c 100644
@@ -29,8 +29,6 @@
 #   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 #   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-# If DESTDIR variable is given, install binary dpdk
-
 #
 # include rte.vars.mk if config file exists
 #
@@ -61,20 +59,6 @@ CLEANDIRS = $(addsuffix _clean,$(ROOTDIRS-y) $(ROOTDIRS-n) $(ROOTDIRS-))
 .PHONY: build
 build: $(ROOTDIRS-y)
 	@echo "Build complete [$(RTE_TARGET)]"
-ifneq ($(DESTDIR),)
-	$(Q)mkdir -p $(DESTDIR)
-	$(Q)tar -C $(RTE_SDK) -cf - mk scripts/*.sh | tar -C $(DESTDIR) -x \
-	  --keep-newer-files --warning=no-ignore-newer -f -
-	$(Q)mkdir -p $(DESTDIR)/`basename $(RTE_OUTPUT)`
-	$(Q)tar -C $(RTE_OUTPUT) -chf - \
-	  --exclude app --exclude hostapp --exclude build \
-	  --exclude Makefile --exclude .depdirs . | \
-	  tar -C $(DESTDIR)/`basename $(RTE_OUTPUT)` -x --keep-newer-files \
-	  --warning=no-ignore-newer -f -
-	$(Q)install -D $(RTE_OUTPUT)/app/testpmd \
-	  $(DESTDIR)/`basename $(RTE_OUTPUT)`/app/testpmd
-	@echo Installation in $(DESTDIR) complete
-endif
 
 .PHONY: clean
 clean: $(CLEANDIRS)
mk/rte.sdkinstall.mk +18 -3
index e8355eb..ed3ed86 100644
@@ -37,9 +37,8 @@ O ?= .
 # The build directory is T and may be prepended with O
 BUILD_DIR := $O/$T
 
-.PHONY: install
-install:
-	@echo ================== Installing $T
+.PHONY: pre_install
+pre_install:
 	$(Q)if [ ! -f $(BUILD_DIR)/.config ]; then \
 		$(MAKE) config T=$T O=$(BUILD_DIR); \
 	elif cmp -s $(BUILD_DIR)/.config.orig $(BUILD_DIR)/.config; then \
@@ -56,3 +55,19 @@ install:
 		echo "Using local configuration"; \
 	fi
 	$(Q)$(MAKE) all O=$(BUILD_DIR)
+
+.PHONY: install
+install: pre_install
+	@echo ================== Installing $(DESTDIR)
+	$(Q)mkdir -p $(DESTDIR)
+	$(Q)tar -C $(RTE_SDK) -cf - mk scripts/*.sh | tar -C $(DESTDIR) -x \
+	  --keep-newer-files --warning=no-ignore-newer -f -
+	$(Q)mkdir -p $(DESTDIR)/$T
+	$(Q)tar -C $(BUILD_DIR) -chf - \
+	  --exclude app --exclude hostapp --exclude build \
+	  --exclude Makefile --exclude .depdirs . | \
+	  tar -C $(DESTDIR)/$T -x --keep-newer-files \
+	  --warning=no-ignore-newer -f -
+	$(Q)install -D $(BUILD_DIR)/app/testpmd \
+	  $(DESTDIR)/$T/app/testpmd
+	@echo Installation in $(DESTDIR) complete
Signature · 1 line
2.5.2
#3 lore raw

PATCH 3/10 mk: install a standard cutomizable tree

In reply to Thomas Monjalon

The rule "install" follows these conventions:
https://www.gnu.org/prep/standards/html_node/Directory-Variables.html
https://www.gnu.org/prep/standards/html_node/DESTDIR.html

The variable sdkdir has been added to the more standards ones, to configure the directory used with RTE_SDK when using the DPDK makefiles to build an application.

The old installed tree was static and always had .config, includes and libs in a RTE_TARGET subdirectory. There is no such directory anymore in an installed SDK. So the top directory is checked.
But RTE_TARGET can still be used, especially to build an app with a compiled but not installed SDK.
That's why both cases are looked for RTE_SDK_BIN.

The default prefix /usr/local is empty in the T= case which is used only for a local install.
It is still possible to build DPDK with the "install T=" rule without specifying any DESTDIR. In such case there is no install, as before.

The old usage of an installed SDK is:

    make -C examples/helloworld RTE_SDK=$(readlink -m $DESTDIR) \
         RTE_TARGET=x86_64-native-linuxapp-gcc

RTE_TARGET can be specified but is useless now with an installed SDK. The RTE_SDK directory must now point to a different path depending of the installation.

---
 doc/build-sdk-quick.txt    |  1 +
 mk/internal/rte.extvars.mk |  8 +++++++
 mk/rte.sdkinstall.mk       | 59 ++++++++++++++++++++++++++++++++++++----------
 mk/rte.vars.mk             |  7 ------
 4 files changed, 55 insertions(+), 20 deletions(-)
doc/build-sdk-quick.txt +1 -0
index b5f752e..662ef63 100644
@@ -19,6 +19,7 @@ Build variables
 	D         debug dependencies
 	O         build directory (default: build/ - install default: ./)
 	DESTDIR   second-stage install directory
+	prefix    root install directory
 	T         target template - used with config or install
 			format: <arch-machine-execenv-toolchain>
 			templates in config/defconfig_*
mk/internal/rte.extvars.mk +8 -0
index e248d19..dfba2f2 100644
@@ -51,7 +51,15 @@ endif
 RTE_EXTMK ?= $(RTE_SRCDIR)/Makefile
 export RTE_EXTMK
 
+# RTE_SDK_BIN must point to .config, include/ and lib/.
 RTE_SDK_BIN := $(RTE_SDK)/$(RTE_TARGET)
+ifeq ($(wildcard $(RTE_SDK_BIN)/.config),)
+# RTE_TARGET is empty when using a default SDK installation.
+RTE_SDK_BIN := $(RTE_SDK)
+ifeq ($(wildcard $(RTE_SDK_BIN)/.config),)
+$(error Cannot find .config in $(RTE_SDK))
+endif
+endif
 
 #
 # Output files wil go in a separate directory: default output is
mk/rte.sdkinstall.mk +46 -13

78 lines not on this page · raw message

mk/rte.vars.mk +0 -7
index f87cf4b..e26d193 100644
@@ -67,13 +67,6 @@ endif
 
 RTE_LIBNAME := dpdk
 
-# RTE_TARGET is deducted from config when we are building the SDK.
-# Else, when building an external app, RTE_TARGET must be specified
-# by the user.
-ifeq ($(RTE_TARGET),)
-$(error RTE_TARGET is not defined)
-endif
-
 ifeq ($(BUILDING_RTE_SDK),)
 # if we are building an external app/lib, include internal/rte.extvars.mk that will
 # define RTE_OUTPUT, RTE_SRCDIR, RTE_EXTMK, RTE_SDK_BIN, (etc ...)
Signature · 1 line
2.5.2
#9 lore raw

PATCH 4/10 mk: introduce new install syntax

In reply to Thomas Monjalon

The old install command was:
make install T=x86_64-native-linuxapp-gcc DESTDIR=install
It still works and can be replaced by these more standard commands:

	make config T=x86_64-native-linuxapp-gcc 0=x86_64-native-linuxapp-gcc
	make O=x86_64-native-linuxapp-gcc
	make install O=x86_64-native-linuxapp-gcc prefix= DESTDIR=install

It means the "make install" do not perform any compilation anymore when T is not used. It is done only in pre_install to keep compatibility with the old syntax based on T= option.

---
 doc/build-sdk-quick.txt | 7 ++++---
 mk/rte.sdkinstall.mk    | 5 +++++
 2 files changed, 9 insertions(+), 3 deletions(-)
doc/build-sdk-quick.txt +4 -3
index 662ef63..acd1bfe 100644
@@ -5,7 +5,8 @@ Build commands
 	all              same as build (default rule)
 	build            build in a configured directory
 	clean            remove files but keep configuration
-	install          configure, build and install a target in DESTDIR
+	install T=       configure, build and install a target in DESTDIR
+	install          install optionally staged in DESTDIR
 	examples         build examples for given targets (T=)
 	examples_clean   clean examples for given targets (T=)
 Build variables
@@ -17,8 +18,8 @@ Build variables
 	CROSS     toolchain prefix
 	V         verbose
 	D         debug dependencies
-	O         build directory (default: build/ - install default: ./)
-	DESTDIR   second-stage install directory
+	O         build directory (default: build/ - install T= default: ./)
+	DESTDIR   staging install directory
 	prefix    root install directory
 	T         target template - used with config or install
 			format: <arch-machine-execenv-toolchain>
mk/rte.sdkinstall.mk +5 -0
index 91273be..9b4303a 100644
@@ -32,6 +32,7 @@
 
 # Build directory is given with O=
 O ?= .
+BUILD_DIR := $O
 
 prefix      ?=     /usr/local
 exec_prefix ?=      $(prefix)
@@ -46,10 +47,12 @@ sdkdir      ?= $(datadir)
 
 # Configuration, compilation and installation can be done at once
 # with make install T=<config>
+ifdef T
 # The build directory is T and may be prepended with O
 BUILD_DIR := $O/$T
 # Default usage of T= will install an almost flat staging tree
 export prefix =
+endif
 
 # Create the directory $1 if not exists
 rte_mkdir = test -d $1 || mkdir -p $1
@@ -60,6 +63,7 @@ rte_symlink = ln -snf $$($(RTE_SDK)/scripts/relpath.sh $1 $(dir $2)) $2
 
 .PHONY: pre_install
 pre_install:
+ifdef T
 	$(Q)if [ ! -f $(BUILD_DIR)/.config ]; then \
 		$(MAKE) config T=$T O=$(BUILD_DIR); \
 	elif cmp -s $(BUILD_DIR)/.config.orig $(BUILD_DIR)/.config; then \
@@ -76,6 +80,7 @@ pre_install:
 		echo "Using local configuration"; \
 	fi
 	$(Q)$(MAKE) all O=$(BUILD_DIR)
+endif
 
 .PHONY: install
 install: pre_install
Signature · 1 line
2.5.2
#10 lore raw

PATCH 5/10 mk: split install rule

In reply to Thomas Monjalon

Provides new sub-rules to install runtime and sdk separately.

The build directory must be changed from BUILD_DIR to O in install rules to avoid a bad recursive effect (O being BUILD_DIR being O + T).

---
 mk/rte.sdkinstall.mk | 18 ++++++++++++------
 mk/rte.sdkroot.mk    |  2 ++
 2 files changed, 14 insertions(+), 6 deletions(-)
mk/rte.sdkinstall.mk +12 -6
index 9b4303a..5585974 100644
@@ -88,24 +88,30 @@ ifeq '$(DESTDIR)$(if $T,,+)' ''
 	@echo Installation cannot run with T defined and DESTDIR undefined
 else
 	@echo ================== Installing $(DESTDIR)$(prefix)/
+	$(Q)$(MAKE) O=$(BUILD_DIR) install-runtime
+	$(Q)$(MAKE) O=$(BUILD_DIR) install-sdk
+	@echo Installation in $(DESTDIR)$(prefix)/ complete
+endif
+
+install-runtime:
 	$(Q)$(call rte_mkdir, $(DESTDIR)$(libdir))
-	$(Q)cp -a $(BUILD_DIR)/lib/* $(DESTDIR)$(libdir)
+	$(Q)cp -a    $O/lib/* $(DESTDIR)$(libdir)
 	$(Q)$(call rte_mkdir, $(DESTDIR)$(bindir))
-	$(Q)tar -cf -      -C $(BUILD_DIR) app  --exclude 'app/*.map' \
+	$(Q)tar -cf -      -C $O app  --exclude 'app/*.map' \
 		--exclude 'app/cmdline*' --exclude app/test \
 		--exclude app/testacl --exclude app/testpipeline | \
 	    tar -xf -      -C $(DESTDIR)$(bindir) --strip-components=1 \
 		--keep-newer-files --warning=no-ignore-newer
 	$(Q)$(call rte_mkdir,      $(DESTDIR)$(datadir))
 	$(Q)cp -a $(RTE_SDK)/tools $(DESTDIR)$(datadir)
+
+install-sdk:
 	$(Q)$(call rte_mkdir, $(DESTDIR)$(includedir))
-	$(Q)tar -chf -     -C $(BUILD_DIR) include | \
+	$(Q)tar -chf -     -C $O include | \
 	    tar -xf -      -C $(DESTDIR)$(includedir) --strip-components=1 \
 		--keep-newer-files --warning=no-ignore-newer
 	$(Q)$(call rte_mkdir,                            $(DESTDIR)$(sdkdir))
-	$(Q)cp -a               $(BUILD_DIR)/.config     $(DESTDIR)$(sdkdir)
+	$(Q)cp -a               $O/.config               $(DESTDIR)$(sdkdir)
 	$(Q)cp -a               $(RTE_SDK)/{mk,scripts}  $(DESTDIR)$(sdkdir)
 	$(Q)$(call rte_symlink, $(DESTDIR)$(includedir), $(DESTDIR)$(sdkdir)/include)
 	$(Q)$(call rte_symlink, $(DESTDIR)$(libdir),     $(DESTDIR)$(sdkdir)/lib)
-	@echo Installation in $(DESTDIR)$(prefix)/ complete
-endif
mk/rte.sdkroot.mk +2 -0
index 18180fa..dbb7bce 100644
@@ -100,6 +100,8 @@ testall:
 .PHONY: install
 install:
 	$(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdkinstall.mk $@
+install-%:
+	$(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdkinstall.mk $@
 
 .PHONY: doc help
 doc: doc-all
Signature · 1 line
2.5.2
#11 lore raw

PATCH 6/10 mk: install kernel modules

In reply to Thomas Monjalon

Add kernel modules to "make install".
Nothing is done if there is no kernel module compiled.

On native Linux, this path is suggested:

	kerneldir=/lib/modules/$(uname -r)/extra/dpdk
---
 mk/rte.sdkinstall.mk | 8 ++++++++
 1 file changed, 8 insertions(+)
mk/rte.sdkinstall.mk +8 -0
index 5585974..46253ff 100644
@@ -36,6 +36,7 @@ BUILD_DIR := $O
 
 prefix      ?=     /usr/local
 exec_prefix ?=      $(prefix)
+kerneldir   ?= $(exec_prefix)/kmod
 bindir      ?= $(exec_prefix)/bin
 libdir      ?= $(exec_prefix)/lib
 includedir  ?=      $(prefix)/include/dpdk
@@ -89,6 +90,7 @@ ifeq '$(DESTDIR)$(if $T,,+)' ''
 else
 	@echo ================== Installing $(DESTDIR)$(prefix)/
 	$(Q)$(MAKE) O=$(BUILD_DIR) install-runtime
+	$(Q)$(MAKE) O=$(BUILD_DIR) install-kmod
 	$(Q)$(MAKE) O=$(BUILD_DIR) install-sdk
 	@echo Installation in $(DESTDIR)$(prefix)/ complete
 endif
@@ -105,6 +107,12 @@ install-runtime:
 	$(Q)$(call rte_mkdir,      $(DESTDIR)$(datadir))
 	$(Q)cp -a $(RTE_SDK)/tools $(DESTDIR)$(datadir)
 
+install-kmod:
+ifneq '$(wildcard $O/kmod/*)' ''
+	$(Q)$(call rte_mkdir, $(DESTDIR)$(kerneldir))
+	$(Q)cp -a   $O/kmod/* $(DESTDIR)$(kerneldir)
+endif
+
 install-sdk:
 	$(Q)$(call rte_mkdir, $(DESTDIR)$(includedir))
 	$(Q)tar -chf -     -C $O include | \
Signature · 1 line
2.5.2
#14 lore raw

PATCH 7/10 mk: install binding tool in sbin directory

In reply to Thomas Monjalon

sbin/dpdk_nic_bind is a symbolic link to tools/dpdk_nic_bind.py where some python objects may be generated.

---
 mk/rte.sdkinstall.mk | 4 ++++
 1 file changed, 4 insertions(+)
mk/rte.sdkinstall.mk +4 -0
index 46253ff..d6df30c 100644
@@ -38,6 +38,7 @@ prefix      ?=     /usr/local
 exec_prefix ?=      $(prefix)
 kerneldir   ?= $(exec_prefix)/kmod
 bindir      ?= $(exec_prefix)/bin
+sbindir     ?= $(exec_prefix)/sbin
 libdir      ?= $(exec_prefix)/lib
 includedir  ?=      $(prefix)/include/dpdk
 datarootdir ?=      $(prefix)/share
@@ -106,6 +107,9 @@ install-runtime:
 		--keep-newer-files --warning=no-ignore-newer
 	$(Q)$(call rte_mkdir,      $(DESTDIR)$(datadir))
 	$(Q)cp -a $(RTE_SDK)/tools $(DESTDIR)$(datadir)
+	$(Q)$(call rte_mkdir,      $(DESTDIR)$(sbindir))
+	$(Q)$(call rte_symlink,    $(DESTDIR)$(datadir)/dpdk_nic_bind.py, \
+	                           $(DESTDIR)$(sbindir)/dpdk_nic_bind)
 
 install-kmod:
 ifneq '$(wildcard $O/kmod/*)' ''
Signature · 1 line
2.5.2
#16 lore raw

PATCH 8/10 mk: install doc

In reply to Thomas Monjalon

The HTML API and HTML/PDF guides may be installed if generated.

---
 mk/rte.sdkinstall.mk | 11 +++++++++++
 1 file changed, 11 insertions(+)
mk/rte.sdkinstall.mk +11 -0
index d6df30c..6a26d5b 100644
@@ -42,6 +42,7 @@ sbindir     ?= $(exec_prefix)/sbin
 libdir      ?= $(exec_prefix)/lib
 includedir  ?=      $(prefix)/include/dpdk
 datarootdir ?=      $(prefix)/share
+docdir      ?=       $(datarootdir)/doc/dpdk
 datadir     ?=       $(datarootdir)/dpdk
 sdkdir      ?= $(datadir)
 
@@ -127,3 +128,13 @@ install-sdk:
 	$(Q)cp -a               $(RTE_SDK)/{mk,scripts}  $(DESTDIR)$(sdkdir)
 	$(Q)$(call rte_symlink, $(DESTDIR)$(includedir), $(DESTDIR)$(sdkdir)/include)
 	$(Q)$(call rte_symlink, $(DESTDIR)$(libdir),     $(DESTDIR)$(sdkdir)/lib)
+
+install-doc:
+	$(Q)$(call rte_mkdir, $(DESTDIR)$(docdir))
+	$(Q)tar -cf -      -C $O/doc html --exclude 'html/guides/.*' | \
+	    tar -xf -      -C $(DESTDIR)$(docdir) --strip-components=1 \
+		--keep-newer-files --warning=no-ignore-newer
+ifneq '$(wildcard $O/doc/*/*/*pdf)' ''
+	$(Q)$(call rte_mkdir,     $(DESTDIR)$(docdir)/guides)
+	$(Q)cp -a $O/doc/*/*/*pdf $(DESTDIR)$(docdir)/guides
+endif
Signature · 1 line
2.5.2
#17 lore raw

PATCH 9/10 mk: install examples

In reply to Thomas Monjalon

The examples are part of the installed documentation.

---
 mk/rte.sdkinstall.mk | 1 +
 1 file changed, 1 insertion(+)
mk/rte.sdkinstall.mk +1 -0
index 6a26d5b..e151c46 100644
@@ -138,3 +138,4 @@ ifneq '$(wildcard $O/doc/*/*/*pdf)' ''
 	$(Q)$(call rte_mkdir,     $(DESTDIR)$(docdir)/guides)
 	$(Q)cp -a $O/doc/*/*/*pdf $(DESTDIR)$(docdir)/guides
 endif
+	$(Q)cp -a $(RTE_SDK)/examples $(DESTDIR)$(docdir)
Signature · 1 line
2.5.2
#18 lore raw

PATCH 10/10 app/proc_info: rename binary with prefix

In reply to Thomas Monjalon

In order to be installed system-wise, this application needs a prefix. So it makes clear that it is DPDK related.

---
 app/proc_info/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
app/proc_info/Makefile +1 -1
index 243b060..33e058e 100644
@@ -31,7 +31,7 @@
 
 include $(RTE_SDK)/mk/rte.vars.mk
 
-APP = proc_info
+APP = dpdk_proc_info
 
 CFLAGS += $(WERROR_FLAGS)
 
Signature · 1 line
2.5.2
#19 lore raw
In reply to Thomas Monjalon
Quoted 5 lines · Thomas Monjalon

Following the recent discussions, this is a proposal to have a standard installation process while keeping compatibility with most of the old behaviours.
Thank you Mario and Bruce for having submitted other proposals. I hope there will be a strong consensus for this one.

Mm, can't help it but this situation reminds me of https://imgs.xkcd.com/comics/standards.png

That aside, a bigger problem is that it doesn't seem to work.

make clean
make config T=x86_64-native-linuxapp-gcc
make
make install DESTDIR=/tmp/dpdk-root

...results in this:

[pmatilai@sopuli dpdk]$ make DESTDIR=/tmp/dpdk-root install ================== Installing /tmp/dpdk-root/usr/local/
make[3]: Nothing to be done for 'install-kmod'.
tar: include: Cannot stat: No such file or directory
tar: Exiting with failure status due to previous errors
cp: cannot stat ‘./.config’: No such file or directory /srv/work/repos/dpdk/mk/rte.sdkinstall.mk:122: recipe for target 'install-sdk' failed make[3]: *** [install-sdk] Error 1 /srv/work/repos/dpdk/mk/rte.sdkroot.mk:104: recipe for target 'install-sdk' failed make[2]: *** [install-sdk] Error 2 /srv/work/repos/dpdk/mk/rte.sdkinstall.mk:93: recipe for target 'install' failed make[1]: *** [install] Error 2 /srv/work/repos/dpdk/mk/rte.sdkroot.mk:102: recipe for target 'install' failed
make: *** [install] Error 2
[pmatilai@sopuli dpdk]$

The failure appears to be install-sdk failing since invoking it alone results in similar errors.

install-runtime appears to do something but it mainly installs sources to various directories in DESTDIR, eg:
[pmatilai@sopuli dpdk]$ find /tmp/dpdk-root/
/tmp/dpdk-root/
/tmp/dpdk-root/usr
/tmp/dpdk-root/usr/local
/tmp/dpdk-root/usr/local/lib
/tmp/dpdk-root/usr/local/lib/librte_mempool /tmp/dpdk-root/usr/local/lib/librte_mempool/rte_dom0_mempool.c /tmp/dpdk-root/usr/local/lib/librte_mempool/rte_mempool.c /tmp/dpdk-root/usr/local/lib/librte_mempool/Makefile /tmp/dpdk-root/usr/local/lib/librte_mempool/rte_mempool_version.map /tmp/dpdk-root/usr/local/lib/librte_mempool/rte_mempool.h
[...]
/tmp/dpdk-root/usr/local/bin/test-pmd
/tmp/dpdk-root/usr/local/bin/test-pmd/testpmd.h /tmp/dpdk-root/usr/local/bin/test-pmd/icmpecho.c /tmp/dpdk-root/usr/local/bin/test-pmd/parameters.c /tmp/dpdk-root/usr/local/bin/test-pmd/macswap.c /tmp/dpdk-root/usr/local/bin/test-pmd/csumonly.c /tmp/dpdk-root/usr/local/bin/test-pmd/macfwd.c
[...]

install-kmod doesn't seem to do anything at all:

[pmatilai@sopuli dpdk]$ rm -rf /tmp/dpdk-root/ [pmatilai@sopuli dpdk]$ ls build/kmod/
igb_uio.ko rte_kni.ko
[pmatilai@sopuli dpdk]$ make DESTDIR=/tmp/dpdk-root install-kmod make[1]: Nothing to be done for 'install-kmod'. [pmatilai@sopuli dpdk]$ find /tmp/dpdk-root/
find: ‘/tmp/dpdk-root/’: No such file or directory [pmatilai@sopuli dpdk]$

- Panu -

#20 lore raw

2015-12-02 09:44, Panu Matilainen:

Quoted 6 lines

That aside, a bigger problem is that it doesn't seem to work.

make clean
make config T=x86_64-native-linuxapp-gcc
make
make install DESTDIR=/tmp/dpdk-root

Oh, I forgot to test the simple case where O= is not specified!

It should be fixed with this change:

mk/rte.sdkinstall.mk +4 -1
@@ -31,8 +31,10 @@
 #   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 # Build directory is given with O=
-O ?= .
+ifndef T
+O ?= build
 BUILD_DIR := $O
+endif
 
 prefix      ?=     /usr/local
 exec_prefix ?=      $(prefix)
@@ -52,6 +54,7 @@ sdkdir      ?= $(datadir)
 # with make install T=<config>
 ifdef T
 # The build directory is T and may be prepended with O
+O ?= .
 BUILD_DIR := $O/$T
 # Default usage of T= will install an almost flat staging tree
 export prefix =
#21 lore raw
Quoted 12 lines · Thomas Monjalon

2015-12-02 09:44, Panu Matilainen:

Quoted 6 lines

That aside, a bigger problem is that it doesn't seem to work.

make clean
make config T=x86_64-native-linuxapp-gcc
make
make install DESTDIR=/tmp/dpdk-root

Oh, I forgot to test the simple case where O= is not specified!

It should be fixed with this change:

Okay, that helped a bunch :)

Now that I can actually test it, seems mostly ok to me. As for the rest, I'll comment on the specific patches.

- Panu -

#12 lore raw

Re: [PATCH 06/10] mk: install kernel modules

In reply to Thomas Monjalon
Quoted 36 lines · Thomas Monjalon

Add kernel modules to "make install".
Nothing is done if there is no kernel module compiled.

On native Linux, this path is suggested:

	kerneldir=/lib/modules/$(uname -r)/extra/dpdk
---
  mk/rte.sdkinstall.mk | 8 ++++++++
  1 file changed, 8 insertions(+)
mk/rte.sdkinstall.mk +2 -0
index 5585974..46253ff 100644
@@ -36,6 +36,7 @@ BUILD_DIR := $O
 
  prefix      ?=     /usr/local
  exec_prefix ?=      $(prefix)
+kerneldir   ?= $(exec_prefix)/kmod
  bindir      ?= $(exec_prefix)/bin
  libdir      ?= $(exec_prefix)/lib
  includedir  ?=      $(prefix)/include/dpdk
@@ -89,6 +90,7 @@ ifeq '$(DESTDIR)$(if $T,,+)' ''
  else
  	@echo ================== Installing $(DESTDIR)$(prefix)/
  	$(Q)$(MAKE) O=$(BUILD_DIR) install-runtime
+	$(Q)$(MAKE) O=$(BUILD_DIR) install-kmod
  	$(Q)$(MAKE) O=$(BUILD_DIR) install-sdk
  	@echo Installation in $(DESTDIR)$(prefix)/ complete
  endif
@@ -105,6 +107,12 @@ install-runtime:
  	$(Q)$(call rte_mkdir,      $(DESTDIR)$(datadir))
  	$(Q)cp -a $(RTE_SDK)/tools $(DESTDIR)$(datadir)

mk/rte.sdkinstall.mk install-runtime: · line 118

Quoted 10 lines
mk/rte.sdkinstall.mk +6 -0
 
+install-kmod:
+ifneq '$(wildcard $O/kmod/*)' ''
+	$(Q)$(call rte_mkdir, $(DESTDIR)$(kerneldir))
+	$(Q)cp -a   $O/kmod/* $(DESTDIR)$(kerneldir)
+endif
+
  install-sdk:
  	$(Q)$(call rte_mkdir, $(DESTDIR)$(includedir))
  	$(Q)tar -chf -     -C $O include | \

This by default installs the modules to /usr/local/kmod/ with no kernel version etc. That's so broken that it'd be better not to install them at all.

So either get the kerneldir right (the correct path is known on Linux and surely BSD too) or dont install them at all unless kerneldir is manually specified. For Linux, it should default to /lib/modules/<kernelver>/extra/dpdk on Linux, where <kernelver> is the version those modules were built against (which might or might not have anything to do with uname -r output).

- Panu -

#15 lore raw

Re: [PATCH 07/10] mk: install binding tool in sbin directory

In reply to Thomas Monjalon
Quoted 22 lines · Thomas Monjalon

sbin/dpdk_nic_bind is a symbolic link to tools/dpdk_nic_bind.py where some python objects may be generated.

---
  mk/rte.sdkinstall.mk | 4 ++++
  1 file changed, 4 insertions(+)
mk/rte.sdkinstall.mk +1 -0
index 46253ff..d6df30c 100644
@@ -38,6 +38,7 @@ prefix      ?=     /usr/local
  exec_prefix ?=      $(prefix)
  kerneldir   ?= $(exec_prefix)/kmod
  bindir      ?= $(exec_prefix)/bin
+sbindir     ?= $(exec_prefix)/sbin
  libdir      ?= $(exec_prefix)/lib
  includedir  ?=      $(prefix)/include/dpdk
  datarootdir ?=      $(prefix)/share

mk/rte.sdkinstall.mk install-runtime: · line 115

Quoted 9 lines
mk/rte.sdkinstall.mk +3 -0
@@ -106,6 +107,9 @@ install-runtime:
  		--keep-newer-files --warning=no-ignore-newer
  	$(Q)$(call rte_mkdir,      $(DESTDIR)$(datadir))
  	$(Q)cp -a $(RTE_SDK)/tools $(DESTDIR)$(datadir)
+	$(Q)$(call rte_mkdir,      $(DESTDIR)$(sbindir))
+	$(Q)$(call rte_symlink,    $(DESTDIR)$(datadir)/dpdk_nic_bind.py, \
+	                           $(DESTDIR)$(sbindir)/dpdk_nic_bind)
 
  install-kmod:
  ifneq '$(wildcard $O/kmod/*)' ''

This symlink is broken, it expects dpdk_nic_bind.py to reside in $(datadir) root when it actually is in $(datadir)/tools/

Other than that, getting rid of the .py suffix is a nice touch.

- Panu -

#22 lore raw
In reply to Panu Matilainen

2015-12-02 11:47, Panu Matilainen:

Quoted 11 lines · Thomas Monjalon
Quoted 10 lines

2015-12-02 09:44, Panu Matilainen:

Quoted 6 lines

That aside, a bigger problem is that it doesn't seem to work.

make clean
make config T=x86_64-native-linuxapp-gcc
make
make install DESTDIR=/tmp/dpdk-root

Oh, I forgot to test the simple case where O= is not specified!

Quoted 7 lines
Quoted 2 lines

It should be fixed with this change:

Okay, that helped a bunch :)

Now that I can actually test it, seems mostly ok to me. As for the rest, I'll comment on the specific patches.

OK thanks :)

#13 lore raw

Re: [PATCH 06/10] mk: install kernel modules

In reply to Panu Matilainen

2015-12-02 11:53, Panu Matilainen:

Quoted 6 lines · Thomas Monjalon
Quoted 5 lines

Add kernel modules to "make install".
Nothing is done if there is no kernel module compiled.

On native Linux, this path is suggested:

	kerneldir=/lib/modules/$(uname -r)/extra/dpdk

[...]

Quoted 6 lines
Quoted 1 line

+kerneldir ?= $(exec_prefix)/kmod

This by default installs the modules to /usr/local/kmod/ with no kernel version etc. That's so broken that it'd be better not to install them at all.

Quoted 6 lines

So either get the kerneldir right (the correct path is known on Linux and surely BSD too) or dont install them at all unless kerneldir is manually specified. For Linux, it should default to /lib/modules/<kernelver>/extra/dpdk on Linux, where <kernelver> is the version those modules were built against (which might or might not have anything to do with uname -r output).

Yes. That's what Mario did.
I wanted to keep the same default as with the old T= command. But both are do-able by using "ifdef T".

#4 lore raw

Re: [PATCH 03/10] mk: install a standard cutomizable tree

In reply to Thomas Monjalon
Quoted 29 lines · Thomas Monjalon

The rule "install" follows these conventions:
https://www.gnu.org/prep/standards/html_node/Directory-Variables.html
https://www.gnu.org/prep/standards/html_node/DESTDIR.html

The variable sdkdir has been added to the more standards ones, to configure the directory used with RTE_SDK when using the DPDK makefiles to build an application.

The old installed tree was static and always had .config, includes and libs in a RTE_TARGET subdirectory. There is no such directory anymore in an installed SDK. So the top directory is checked.
But RTE_TARGET can still be used, especially to build an app with a compiled but not installed SDK.
That's why both cases are looked for RTE_SDK_BIN.

The default prefix /usr/local is empty in the T= case which is used only for a local install.
It is still possible to build DPDK with the "install T=" rule without specifying any DESTDIR. In such case there is no install, as before.

The old usage of an installed SDK is:

     make -C examples/helloworld RTE_SDK=$(readlink -m $DESTDIR) \
          RTE_TARGET=x86_64-native-linuxapp-gcc

RTE_TARGET can be specified but is useless now with an installed SDK. The RTE_SDK directory must now point to a different path depending of the installation.

---

[...]

Quoted 14 lines
mk/rte.sdkinstall.mk +10 -0
@@ -32,10 +33,30 @@
  # Build directory is given with O=
  O ?= .
 
+prefix      ?=     /usr/local
+exec_prefix ?=      $(prefix)
+bindir      ?= $(exec_prefix)/bin
+libdir      ?= $(exec_prefix)/lib
+includedir  ?=      $(prefix)/include/dpdk
+datarootdir ?=      $(prefix)/share
+datadir     ?=       $(datarootdir)/dpdk
+sdkdir      ?= $(datadir)
+
+# The install directories may be staged in DESTDIR

[...]

Quoted 12 lines
mk/rte.sdkinstall.mk +12 -0
+	@echo ================== Installing $(DESTDIR)$(prefix)/
+	$(Q)$(call rte_mkdir, $(DESTDIR)$(libdir))
+	$(Q)cp -a $(BUILD_DIR)/lib/* $(DESTDIR)$(libdir)
+	$(Q)$(call rte_mkdir, $(DESTDIR)$(bindir))
+	$(Q)tar -cf -      -C $(BUILD_DIR) app  --exclude 'app/*.map' \
+		--exclude 'app/cmdline*' --exclude app/test \
+		--exclude app/testacl --exclude app/testpipeline | \
+	    tar -xf -      -C $(DESTDIR)$(bindir) --strip-components=1 \
+		--keep-newer-files --warning=no-ignore-newer
+	$(Q)$(call rte_mkdir,      $(DESTDIR)$(datadir))
+	$(Q)cp -a $(RTE_SDK)/tools $(DESTDIR)$(datadir)
+	$(Q)$(call rte_mkdir, $(DESTDIR)$(includedir))

mk/rte.sdkinstall.mk pre_install: · line 106

Quoted 10 lines
mk/rte.sdkinstall.mk +10 -0
+	$(Q)tar -chf -     -C $(BUILD_DIR) include | \
+	    tar -xf -      -C $(DESTDIR)$(includedir) --strip-components=1 \
+		--keep-newer-files --warning=no-ignore-newer
+	$(Q)$(call rte_mkdir,                            $(DESTDIR)$(sdkdir))
+	$(Q)cp -a               $(BUILD_DIR)/.config     $(DESTDIR)$(sdkdir)
+	$(Q)cp -a               $(RTE_SDK)/{mk,scripts}  $(DESTDIR)$(sdkdir)
+	$(Q)$(call rte_symlink, $(DESTDIR)$(includedir), $(DESTDIR)$(sdkdir)/include)
+	$(Q)$(call rte_symlink, $(DESTDIR)$(libdir),     $(DESTDIR)$(sdkdir)/lib)
+	@echo Installation in $(DESTDIR)$(prefix)/ complete
+endif

$(prefix)/share is supposed to be shareable across different architectures. Most of the content here is, but at least the lib symlink and .config file are not.

One option is to install .config and the symlinks within $(sdkdir)/$(T) directories, then it can be shared across architectures because each lives in their own directory. Another possibility is moving the whole sdk directory into a subdir in $(libdir), but that misses the opportunity to share across architectures (whether anybody actually cares is a whole other question :)

$(sdkdir)/lib -> $(libdir) symlink seems reasonable when installing to an empty staging root, but on a real-world installation it'd point to /usr/lib(something) which has hundreds or thousands of other unrelated libraries. My memory is hazy on details but I think this caused an actual problem with something because I ended up $(sdkdir)/lib an actual directory populated with symlinks to the individual DPDK libraries.

- Panu -

#5 lore raw

Re: [PATCH 03/10] mk: install a standard cutomizable tree

2015-12-02 12:27, Panu Matilainen:

Quoted 7 lines · Thomas Monjalon
Quoted 6 lines

The old installed tree was static and always had .config, includes and libs in a RTE_TARGET subdirectory. There is no such directory anymore in an installed SDK. So the top directory is checked.
But RTE_TARGET can still be used, especially to build an app with a compiled but not installed SDK.
That's why both cases are looked for RTE_SDK_BIN.

[...]

Quoted 6 lines
Quoted 6 lines

The old usage of an installed SDK is:

     make -C examples/helloworld RTE_SDK=$(readlink -m $DESTDIR) \
          RTE_TARGET=x86_64-native-linuxapp-gcc

RTE_TARGET can be specified but is useless now with an installed SDK. The RTE_SDK directory must now point to a different path depending of the installation.

[...]

Quoted 9 lines

mk/rte.sdkinstall.mk pre_install: · line 104

Quoted 5 lines
mk/rte.sdkinstall.mk +5 -0
+	$(Q)$(call rte_mkdir,                            $(DESTDIR)$(sdkdir))
+	$(Q)cp -a               $(BUILD_DIR)/.config     $(DESTDIR)$(sdkdir)
+	$(Q)cp -a               $(RTE_SDK)/{mk,scripts}  $(DESTDIR)$(sdkdir)
+	$(Q)$(call rte_symlink, $(DESTDIR)$(includedir), $(DESTDIR)$(sdkdir)/include)
+	$(Q)$(call rte_symlink, $(DESTDIR)$(libdir),     $(DESTDIR)$(sdkdir)/lib)

$(prefix)/share is supposed to be shareable across different architectures. Most of the content here is, but at least the lib symlink and .config file are not.

The case you want to address is multilib 32/x32/64, right?

Quoted 6 lines

One option is to install .config and the symlinks within $(sdkdir)/$(T) directories, then it can be shared across architectures because each lives in their own directory. Another possibility is moving the whole sdk directory into a subdir in $(libdir), but that misses the opportunity to share across architectures (whether anybody actually cares is a whole other question :)

Yes, I tried to remove the use of RTE_TARGET when building an example. But we can keep it with a subdirectory in $(sdkdir).

Quoted 6 lines

$(sdkdir)/lib -> $(libdir) symlink seems reasonable when installing to an empty staging root, but on a real-world installation it'd point to /usr/lib(something) which has hundreds or thousands of other unrelated libraries. My memory is hazy on details but I think this caused an actual problem with something because I ended up $(sdkdir)/lib an actual directory populated with symlinks to the individual DPDK libraries.

I don't see the problem.
I suggest to keep it and see how to fix it if an issue is raised.

#6 lore raw

Re: [PATCH 03/10] mk: install a standard cutomizable tree

Quoted 26 lines · Thomas Monjalon

2015-12-02 12:27, Panu Matilainen:

Quoted 7 lines · Thomas Monjalon
Quoted 6 lines

The old installed tree was static and always had .config, includes and libs in a RTE_TARGET subdirectory. There is no such directory anymore in an installed SDK. So the top directory is checked.
But RTE_TARGET can still be used, especially to build an app with a compiled but not installed SDK.
That's why both cases are looked for RTE_SDK_BIN.

[...]

Quoted 6 lines
Quoted 6 lines

The old usage of an installed SDK is:

      make -C examples/helloworld RTE_SDK=$(readlink -m $DESTDIR) \
           RTE_TARGET=x86_64-native-linuxapp-gcc

RTE_TARGET can be specified but is useless now with an installed SDK. The RTE_SDK directory must now point to a different path depending of the installation.

[...]

Quoted 9 lines

mk/rte.sdkinstall.mk pre_install: · line 104

Quoted 5 lines
mk/rte.sdkinstall.mk +5 -0
+	$(Q)$(call rte_mkdir,                            $(DESTDIR)$(sdkdir))
+	$(Q)cp -a               $(BUILD_DIR)/.config     $(DESTDIR)$(sdkdir)
+	$(Q)cp -a               $(RTE_SDK)/{mk,scripts}  $(DESTDIR)$(sdkdir)
+	$(Q)$(call rte_symlink, $(DESTDIR)$(includedir), $(DESTDIR)$(sdkdir)/include)
+	$(Q)$(call rte_symlink, $(DESTDIR)$(libdir),     $(DESTDIR)$(sdkdir)/lib)

$(prefix)/share is supposed to be shareable across different architectures. Most of the content here is, but at least the lib symlink and .config file are not.

Quoted 1 line

The case you want to address is multilib 32/x32/64, right?

That, plus modern Debian/Ubuntu supports multiarch, not just -lib.

And then there's the pedantic side, ie to be in line with the FHS definition: http://www.pathname.com/fhs/pub/fhs-2.3.html#USRSHAREARCHITECTUREINDEPENDENTDATA

Quoted 10 lines
Quoted 7 lines

One option is to install .config and the symlinks within $(sdkdir)/$(T) directories, then it can be shared across architectures because each lives in their own directory. Another possibility is moving the whole sdk directory into a subdir in $(libdir), but that misses the opportunity to share across architectures (whether anybody actually cares is a whole other question :)

Yes, I tried to remove the use of RTE_TARGET when building an example. But we can keep it with a subdirectory in $(sdkdir).

Just realized my suggestion $(sdkdir)/$(T) would not cut it because if T= is specified then this installation method wont be invoked at all :D

So yeah, RTE_TARGET. Or perhaps just RTE_ARCH. Dunno if there's actual added value to having the whole target string there, but I wont mind either.

Quoted 10 lines
Quoted 7 lines

$(sdkdir)/lib -> $(libdir) symlink seems reasonable when installing to an empty staging root, but on a real-world installation it'd point to /usr/lib(something) which has hundreds or thousands of other unrelated libraries. My memory is hazy on details but I think this caused an actual problem with something because I ended up $(sdkdir)/lib an actual directory populated with symlinks to the individual DPDK libraries.

I don't see the problem.
I suggest to keep it and see how to fix it if an issue is raised.

The problem probably had to do with something external, like compiling OVS or pktgen, but ... this is too hand-wavy to worry about right now. Just wanted to mention it because I dont think I added the extra complexity in packaging just for fun.

- Panu -

#7 lore raw

Re: [PATCH 03/10] mk: install a standard cutomizable tree

2015-12-02 14:54, Panu Matilainen:

Quoted 9 lines · Thomas Monjalon
Quoted 6 lines

2015-12-02 12:27, Panu Matilainen:

Quoted 3 lines

$(prefix)/share is supposed to be shareable across different architectures. Most of the content here is, but at least the lib symlink and .config file are not.

The case you want to address is multilib 32/x32/64, right?

That, plus modern Debian/Ubuntu supports multiarch, not just -lib.

We do not support completely different platforms (e.g. ARM and x86) with only one include directory. At the moment, only variants (32/64) live together.

Quoted 7 lines
Quoted 7 lines
Quoted 6 lines

One option is to install .config and the symlinks within $(sdkdir)/$(T) directories, then it can be shared across architectures because each lives in their own directory. Another possibility is moving the whole sdk directory into a subdir in $(libdir), but that misses the opportunity to share across architectures (whether anybody actually cares is a whole other question :)

Quoted 5 lines
Quoted 2 lines

Yes, I tried to remove the use of RTE_TARGET when building an example. But we can keep it with a subdirectory in $(sdkdir).

Just realized my suggestion $(sdkdir)/$(T) would not cut it because if T= is specified then this installation method wont be invoked at all :D

I don't understand what you mean.
In my patchset, the installation is the same (except some default values) with and without T=.

Quoted 2 lines

So yeah, RTE_TARGET. Or perhaps just RTE_ARCH. Dunno if there's actual added value to having the whole target string there, but I wont mind either.

RTE_TARGET is a safe choice for future.

#8 lore raw

Re: [PATCH 03/10] mk: install a standard cutomizable tree

Quoted 7 lines · Thomas Monjalon

2015-12-02 14:54, Panu Matilainen:

Quoted 6 lines · Thomas Monjalon
Quoted 5 lines

2015-12-02 12:27, Panu Matilainen:

Quoted 3 lines

$(prefix)/share is supposed to be shareable across different architectures. Most of the content here is, but at least the lib symlink and .config file are not.

Quoted 7 lines
Quoted 3 lines
Quoted 1 line

The case you want to address is multilib 32/x32/64, right?

That, plus modern Debian/Ubuntu supports multiarch, not just -lib.

We do not support completely different platforms (e.g. ARM and x86) with only one include directory. At the moment, only variants (32/64) live together.

Actually even the variants will run into problems because eg rte_config.h will differ between 32- and 64-bit. But that's a problem for another day, this is hardly the most pressing of issues :)

Quoted 11 lines
Quoted 11 lines
Quoted 10 lines
Quoted 7 lines

One option is to install .config and the symlinks within $(sdkdir)/$(T) directories, then it can be shared across architectures because each lives in their own directory. Another possibility is moving the whole sdk directory into a subdir in $(libdir), but that misses the opportunity to share across architectures (whether anybody actually cares is a whole other question :)

Yes, I tried to remove the use of RTE_TARGET when building an example. But we can keep it with a subdirectory in $(sdkdir).

Quoted 6 lines
Quoted 2 lines

Just realized my suggestion $(sdkdir)/$(T) would not cut it because if T= is specified then this installation method wont be invoked at all :D

I don't understand what you mean.
In my patchset, the installation is the same (except some default values) with and without T=.

Hmm, must've misuderstood/mixed up with something Marios patches do. Never mind, I was just mumbling out loud anyhow.

Quoted 6 lines
Quoted 3 lines

So yeah, RTE_TARGET. Or perhaps just RTE_ARCH. Dunno if there's actual added value to having the whole target string there, but I wont mind either.

RTE_TARGET is a safe choice for future.

Nod.

- Panu -

#23 lore raw

v2 cover standard make install

In reply to Thomas Monjalon

Following the recent discussions, this is a proposal to have a standard installation process while keeping compatibility with most of the old behaviours.

v2 changes:
- fix default build dir
- RTE_TARGET subdir in $(sdkdir).
- better kerneldir defaults
- fix dpdk_nic_bind symlink
- always install doc if generated
- doc
- pkg/dpdk.spec

More details below and in the commit messages.

These variables can be overriden:

kerneldir ?= /lib/modules/$(shell uname -r)/extra/dpdk
prefix ?= /usr/local
exec_prefix ?= $(prefix)

bindir      ?= $(exec_prefix)/bin
sbindir     ?= $(exec_prefix)/sbin
libdir      ?= $(exec_prefix)/lib
includedir  ?=      $(prefix)/include/dpdk
datarootdir ?=      $(prefix)/share
docdir      ?=       $(datarootdir)/doc/dpdk
datadir     ?=       $(datarootdir)/dpdk
sdkdir      ?=                $(datadir)
targetdir   ?=                $(datadir)/$(RTE_TARGET)

All paths are prefixed with $(DESTDIR)

One rule install = install-runtime install-kmod install-sdk install-doc

--------

System-wise install example with
DESTDIR=
prefix=/usr
kerneldir=/lib/modules/kver/extra

# make install-runtime
/usr/bin/testpmd
/usr/lib/libethdev*
/usr/lib/librte_*
/usr/sbin/dpdk_nic_bind -> /usr/share/dpdk/tools/dpdk_nic_bind.py
/usr/share/dpdk/tools/
# make install-kmod
/lib/modules/kver/extra/
# make install-sdk
/usr/include/dpdk/
/usr/share/dpdk/mk/
/usr/share/dpdk/scripts/
/usr/share/dpdk/x86_64-default-linuxapp-gcc/.config
/usr/share/dpdk/x86_64-default-linuxapp-gcc/include -> /usr/include/dpdk/
/usr/share/dpdk/x86_64-default-linuxapp-gcc/lib     -> /usr/lib/
# make install-doc
/usr/share/doc/dpdk/api/
/usr/share/doc/dpdk/guides/
/usr/share/dpdk/examples/

--------

Local install example with old (compatible) command:

# make install T=x86_64-native-linuxapp-gcc DESTDIR=install

would be equivalent to:

# make config T=x86_64-native-linuxapp-gcc 0=x86_64-native-linuxapp-gcc
# make O=x86_64-native-linuxapp-gcc
# make install O=x86_64-native-linuxapp-gcc prefix= DESTDIR=install

install/bin/testpmd
install/include/dpdk/
install/kmod/
install/lib/
install/sbin/dpdk_nic_bind -> ../share/dpdk/tools/dpdk_nic_bind.py install/share/doc/dpdk/
install/share/dpdk/examples/
install/share/dpdk/mk/
install/share/dpdk/scripts/
install/share/dpdk/tools/ install/share/dpdk/x86_64-native-linuxapp-gcc/.config install/share/dpdk/x86_64-native-linuxapp-gcc/include -> install/include/dpdk/
install/share/dpdk/x86_64-native-linuxapp-gcc/lib -> install/lib/

It should be usable to build some applications as before:

# make -C examples/helloworld RTE_SDK=$(readlink -m install) RTE_TARGET=x86_64-native-linuxapp-gcc

The RTE_SDK directory must point to install/share/dpdk with a default install.

--------

Thomas Monjalon (12):
mk: remove testall
mk: remove multi-target install
mk: move installation procedure in install rule
mk: install a standard cutomizable tree
mk: introduce new install syntax
mk: split install rule
mk: install kernel modules
mk: install binding tool in sbin directory
mk: install doc
mk: install examples
app/proc_info: rename binary with prefix
pkg: update RPM with standard install

 app/proc_info/Makefile                           |   2 +-
 doc/build-sdk-quick.txt                          |  11 +-
 doc/guides/linux_gsg/build_dpdk.rst              |  16 ---
 doc/guides/prog_guide/dev_kit_root_make_help.rst |  28 +----
 doc/guides/sample_app_ug/proc_info.rst           |   8 +-
 mk/internal/rte.extvars.mk                       |   4 +
 mk/rte.sdkbuild.mk                               |  16 ---
 mk/rte.sdkinstall.mk                             | 148 +++++++++++++++++------
 mk/rte.sdkroot.mk                                |  10 +-
 mk/rte.sdktest.mk                                |   4 +-
 mk/rte.sdktestall.mk                             |  57 ---------
 mk/rte.vars.mk                                   |  10 +-
 pkg/dpdk.spec                                    |  59 +++------
 tools/setup.sh                                   |  31 ++---
 14 files changed, 163 insertions(+), 241 deletions(-)
 delete mode 100644 mk/rte.sdktestall.mk
Signature · 1 line
2.5.2
#24 lore raw

PATCH v2 1/12 mk: remove testall

It is not possible to test every configs on an unique machine.

---
 doc/guides/prog_guide/dev_kit_root_make_help.rst | 13 ------
 mk/rte.sdkroot.mk                                |  4 --
 mk/rte.sdktestall.mk                             | 57 ------------------------
 3 files changed, 74 deletions(-)
 delete mode 100644 mk/rte.sdktestall.mk
doc/guides/prog_guide/dev_kit_root_make_help.rst +0 -13
index a5cd196..e02c544 100644
@@ -138,19 +138,6 @@ Test Targets
 
         make test O=mybuild
 
-*   testall
-
-    Launch automatic tests for all installed target directories (after a make install).
-    The name of the targets to test can be optionally specified using T=mytarget.
-    The target name can contain wildcard (\*) characters.
-    The list of available targets are in $(RTE_SDK)/config (remove the defconfig\_  prefix).
-
-    Examples:
-
-    .. code-block:: console
-
-        make testall, make testall T=x86_64-*
-
 Documentation Targets
 ---------------------
 
mk/rte.sdkroot.mk +0 -4
index e8423b0..0e97308 100644
@@ -93,10 +93,6 @@ config showconfigs showversion:
 test fast_test ring_test mempool_test perf_test coverage:
 	$(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdktest.mk $@
 
-.PHONY: testall
-testall:
-	$(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdktestall.mk $@
-
 .PHONY: install uninstall
 install uninstall:
 	$(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdkinstall.mk $@
mk/rte.sdktestall.mk deleted +0 -57

57 lines not on this page · raw message

Signature · 1 line
2.5.2
#25 lore raw

PATCH v2 2/12 mk: remove multi-target install

In reply to Thomas Monjalon

The multi-target install create some subdirectories with the target name which is not standard for a "make install" procedure.

The uninstall procedure cannot be applied properly (without removing all files in a directory). It would need to pre-compute paths.
As it is a packaging issue, it is removed from the build system capabilities.

---
 doc/build-sdk-quick.txt                          |  5 +-
 doc/guides/linux_gsg/build_dpdk.rst              | 16 ------
 doc/guides/prog_guide/dev_kit_root_make_help.rst | 11 +----
 mk/rte.sdkinstall.mk                             | 62 ++++++------------------
 mk/rte.sdkroot.mk                                |  4 +-
 tools/setup.sh                                   | 31 ++++--------
 6 files changed, 32 insertions(+), 97 deletions(-)
doc/build-sdk-quick.txt +2 -3
index bf18b48..b5f752e 100644
@@ -5,8 +5,7 @@ Build commands
 	all              same as build (default rule)
 	build            build in a configured directory
 	clean            remove files but keep configuration
-	install          build many targets (wildcard allowed) and install in DESTDIR
-	uninstall        remove all installed targets
+	install          configure, build and install a target in DESTDIR
 	examples         build examples for given targets (T=)
 	examples_clean   clean examples for given targets (T=)
 Build variables
@@ -20,6 +19,6 @@ Build variables
 	D         debug dependencies
 	O         build directory (default: build/ - install default: ./)
 	DESTDIR   second-stage install directory
-	T         target template (install default: *) - used with config or install
+	T         target template - used with config or install
 			format: <arch-machine-execenv-toolchain>
 			templates in config/defconfig_*
doc/guides/linux_gsg/build_dpdk.rst +0 -16
index 2680e66..fd0fcc8 100644
@@ -110,22 +110,6 @@ To compile a 32-bit build using gcc, the make command should be:
 
     make install T=i686-native-linuxapp-gcc
 
-To compile all 64-bit targets using gcc, use:
-
-.. code-block:: console
-
-    make install T=x86_64*gcc
-
-To compile all 64-bit targets using both gcc and icc, use:
-
-.. code-block:: console
-
-    make install T=x86_64-*
-
-.. note::
-
-    The wildcard operator (*) can be used to create multiple targets at the same time.
-
 To prepare a target without building it, for example, if the configuration changes need to be made before compilation,
 use the make config T=<target> command:
 
doc/guides/prog_guide/dev_kit_root_make_help.rst +2 -9
index e02c544..458fc91 100644
@@ -108,21 +108,14 @@ Install Targets
 *   Install
 
     Build the DPDK binary.
-    Actually, this builds each supported target in a separate directory.
-    The name of each directory is the name of the target.
-    The name of the targets to install can be optionally specified using T=mytarget.
-    The target name can contain wildcard \* characters.
+    The name of the target to install is specified using T=mytarget.
     The list of available targets are in $(RTE_SDK)/config (remove the defconfig\_ prefix).
 
     Example:
 
     .. code-block:: console
 
-        make install T=x86_64-*
-
-*   Uninstall
-
-    Remove installed target directories.
+        make install T=x86_64-native-linuxapp-gcc
 
 Test Targets
 ------------
mk/rte.sdkinstall.mk +16 -46

75 lines not on this page · raw message

mk/rte.sdkroot.mk +2 -2
index 0e97308..9fdecf4 100644
@@ -93,8 +93,8 @@ config showconfigs showversion:
 test fast_test ring_test mempool_test perf_test coverage:
 	$(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdktest.mk $@
 
-.PHONY: install uninstall
-install uninstall:
+.PHONY: install
+install:
 	$(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdkinstall.mk $@
 
 .PHONY: doc help
tools/setup.sh +10 -21
index 5a8b2f3..58a08e7 100755
@@ -105,14 +105,6 @@ setup_target()
 }
 
 #
-# Uninstall all targets.
-#
-uninstall_targets()
-{
-	make uninstall
-}
-
-#
 # Creates hugepage filesystem.
 #
 create_mnt_huge()
@@ -571,23 +563,20 @@ step5_func()
 {
 	TITLE="Uninstall and system cleanup"
 
-	TEXT[1]="Uninstall all targets"
-	FUNC[1]="uninstall_targets"
-
-	TEXT[2]="Unbind NICs from IGB UIO or VFIO driver"
-	FUNC[2]="unbind_nics"
+	TEXT[1]="Unbind NICs from IGB UIO or VFIO driver"
+	FUNC[1]="unbind_nics"
 
-	TEXT[3]="Remove IGB UIO module"
-	FUNC[3]="remove_igb_uio_module"
+	TEXT[2]="Remove IGB UIO module"
+	FUNC[2]="remove_igb_uio_module"
 
-	TEXT[4]="Remove VFIO module"
-	FUNC[4]="remove_vfio_module"
+	TEXT[3]="Remove VFIO module"
+	FUNC[3]="remove_vfio_module"
 
-	TEXT[5]="Remove KNI module"
-	FUNC[5]="remove_kni_module"
+	TEXT[4]="Remove KNI module"
+	FUNC[4]="remove_kni_module"
 
-	TEXT[6]="Remove hugepage mappings"
-	FUNC[6]="clear_huge_pages"
+	TEXT[5]="Remove hugepage mappings"
+	FUNC[5]="clear_huge_pages"
 }
 
 STEPS[1]="step1_func"
Signature · 1 line
2.5.2
#26 lore raw

PATCH v2 3/12 mk: move installation procedure in install rule

In reply to Thomas Monjalon

The real installation was called "binary install" and was done after the build when DESTDIR was specified.
Remove this limitation and move the code in install rule only.

---
 mk/rte.sdkbuild.mk   | 16 ----------------
 mk/rte.sdkinstall.mk | 21 ++++++++++++++++++---
 2 files changed, 18 insertions(+), 19 deletions(-)
mk/rte.sdkbuild.mk +0 -16
index 38ec7bd..85f603c 100644
@@ -29,8 +29,6 @@
 #   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 #   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-# If DESTDIR variable is given, install binary dpdk
-
 #
 # include rte.vars.mk if config file exists
 #
@@ -61,20 +59,6 @@ CLEANDIRS = $(addsuffix _clean,$(ROOTDIRS-y) $(ROOTDIRS-n) $(ROOTDIRS-))
 .PHONY: build
 build: $(ROOTDIRS-y)
 	@echo "Build complete [$(RTE_TARGET)]"
-ifneq ($(DESTDIR),)
-	$(Q)mkdir -p $(DESTDIR)
-	$(Q)tar -C $(RTE_SDK) -cf - mk scripts/*.sh | tar -C $(DESTDIR) -x \
-	  --keep-newer-files --warning=no-ignore-newer -f -
-	$(Q)mkdir -p $(DESTDIR)/`basename $(RTE_OUTPUT)`
-	$(Q)tar -C $(RTE_OUTPUT) -chf - \
-	  --exclude app --exclude hostapp --exclude build \
-	  --exclude Makefile --exclude .depdirs . | \
-	  tar -C $(DESTDIR)/`basename $(RTE_OUTPUT)` -x --keep-newer-files \
-	  --warning=no-ignore-newer -f -
-	$(Q)install -D $(RTE_OUTPUT)/app/testpmd \
-	  $(DESTDIR)/`basename $(RTE_OUTPUT)`/app/testpmd
-	@echo Installation in $(DESTDIR) complete
-endif
 
 .PHONY: clean
 clean: $(CLEANDIRS)
mk/rte.sdkinstall.mk +18 -3
index 3e6e8ca..54ea501 100644
@@ -36,9 +36,8 @@
 O ?= .
 BUILD_DIR := $O/$T
 
-.PHONY: install
-install:
-	@echo ================== Installing $T
+.PHONY: pre_install
+pre_install:
 	$(Q)if [ ! -f $(BUILD_DIR)/.config ]; then \
 		$(MAKE) config T=$T O=$(BUILD_DIR); \
 	elif cmp -s $(BUILD_DIR)/.config.orig $(BUILD_DIR)/.config; then \
@@ -55,3 +54,19 @@ install:
 		echo "Using local configuration"; \
 	fi
 	$(Q)$(MAKE) all O=$(BUILD_DIR)
+
+.PHONY: install
+install: pre_install
+	@echo ================== Installing $(DESTDIR)
+	$(Q)mkdir -p $(DESTDIR)
+	$(Q)tar -C $(RTE_SDK) -cf - mk scripts/*.sh | tar -C $(DESTDIR) -x \
+	  --keep-newer-files --warning=no-ignore-newer -f -
+	$(Q)mkdir -p $(DESTDIR)/$T
+	$(Q)tar -C $(BUILD_DIR) -chf - \
+	  --exclude app --exclude hostapp --exclude build \
+	  --exclude Makefile --exclude .depdirs . | \
+	  tar -C $(DESTDIR)/$T -x --keep-newer-files \
+	  --warning=no-ignore-newer -f -
+	$(Q)install -D $(BUILD_DIR)/app/testpmd \
+	  $(DESTDIR)/$T/app/testpmd
+	@echo Installation in $(DESTDIR) complete
Signature · 1 line
2.5.2
#27 lore raw

PATCH v2 4/12 mk: install a standard cutomizable tree

In reply to Thomas Monjalon

The rule "install" follows these conventions:
http://gnu.org/prep/standards/html_node/Directory-Variables.html
http://gnu.org/prep/standards/html_node/DESTDIR.html

The variable sdkdir has been added to the more standards ones, to configure the directory used with RTE_SDK when using the DPDK makefiles to build an application.

It is still possible to build DPDK with the "install T=" rule without specifying any DESTDIR. In such case there is no install, as before.

The old usage of an installed SDK is:

    make -C examples/helloworld RTE_SDK=$(readlink -m $DESTDIR) \
         RTE_TARGET=x86_64-native-linuxapp-gcc

RTE_TARGET can be specified but is useless now with an installed SDK. The RTE_SDK directory must now point to a different path depending of the installation.

---
 doc/build-sdk-quick.txt                          |  1 +
 doc/guides/prog_guide/dev_kit_root_make_help.rst |  6 ++-
 mk/internal/rte.extvars.mk                       |  4 ++
 mk/rte.sdkinstall.mk                             | 59 ++++++++++++++++++------
 mk/rte.vars.mk                                   | 10 +---
 5 files changed, 58 insertions(+), 22 deletions(-)
doc/build-sdk-quick.txt +1 -0
index b5f752e..662ef63 100644
@@ -19,6 +19,7 @@ Build variables
 	D         debug dependencies
 	O         build directory (default: build/ - install default: ./)
 	DESTDIR   second-stage install directory
+	prefix    root install directory
 	T         target template - used with config or install
 			format: <arch-machine-execenv-toolchain>
 			templates in config/defconfig_*
doc/guides/prog_guide/dev_kit_root_make_help.rst +5 -1
index 458fc91..b0429d8 100644
@@ -111,11 +111,15 @@ Install Targets
     The name of the target to install is specified using T=mytarget.
     The list of available targets are in $(RTE_SDK)/config (remove the defconfig\_ prefix).
 
+    The GNU standards variables may be used:
+    http://gnu.org/prep/standards/html_node/Directory-Variables.html and
+    http://gnu.org/prep/standards/html_node/DESTDIR.html
+
     Example:
 
     .. code-block:: console
 
-        make install T=x86_64-native-linuxapp-gcc
+        make install T=x86_64-native-linuxapp-gcc prefix=/usr
 
 Test Targets
 ------------
mk/internal/rte.extvars.mk +4 -0
index e248d19..040d39f 100644
@@ -51,7 +51,11 @@ endif
 RTE_EXTMK ?= $(RTE_SRCDIR)/Makefile
 export RTE_EXTMK
 
+# RTE_SDK_BIN must point to .config, include/ and lib/.
 RTE_SDK_BIN := $(RTE_SDK)/$(RTE_TARGET)
+ifeq ($(wildcard $(RTE_SDK_BIN)/.config),)
+$(error Cannot find .config in $(RTE_SDK))
+endif
 
 #
 # Output files wil go in a separate directory: default output is
mk/rte.sdkinstall.mk +46 -13

74 lines not on this page · raw message

mk/rte.vars.mk +2 -8
index f87cf4b..7e7ee14 100644
@@ -61,18 +61,12 @@ ifneq ($(BUILDING_RTE_SDK),)
   RTE_MACHINE := $(CONFIG_RTE_MACHINE:"%"=%)
   RTE_EXEC_ENV := $(CONFIG_RTE_EXEC_ENV:"%"=%)
   RTE_TOOLCHAIN := $(CONFIG_RTE_TOOLCHAIN:"%"=%)
-  RTE_TARGET := $(RTE_ARCH)-$(RTE_MACHINE)-$(RTE_EXEC_ENV)-$(RTE_TOOLCHAIN)
   RTE_SDK_BIN := $(RTE_OUTPUT)
 endif
 
-RTE_LIBNAME := dpdk
+RTE_TARGET ?= $(RTE_ARCH)-$(RTE_MACHINE)-$(RTE_EXEC_ENV)-$(RTE_TOOLCHAIN)
 
-# RTE_TARGET is deducted from config when we are building the SDK.
-# Else, when building an external app, RTE_TARGET must be specified
-# by the user.
-ifeq ($(RTE_TARGET),)
-$(error RTE_TARGET is not defined)
-endif
+RTE_LIBNAME := dpdk
 
 ifeq ($(BUILDING_RTE_SDK),)
 # if we are building an external app/lib, include internal/rte.extvars.mk that will
Signature · 1 line
2.5.2
#28 lore raw

PATCH v2 5/12 mk: introduce new install syntax

In reply to Thomas Monjalon

The old install command was:
make install T=x86_64-native-linuxapp-gcc DESTDIR=install
It still works and can be replaced by these more standard commands:

	make config T=x86_64-native-linuxapp-gcc 0=x86_64-native-linuxapp-gcc
	make O=x86_64-native-linuxapp-gcc
	make install O=x86_64-native-linuxapp-gcc prefix= DESTDIR=install

It means the "make install" do not perform any compilation anymore when T is not used. It is done only in pre_install to keep compatibility with the old syntax based on T= option.

The default prefix /usr/local is empty in the T= case which is used only for a local install.

---
 doc/build-sdk-quick.txt                          |  7 ++++---
 doc/guides/prog_guide/dev_kit_root_make_help.rst |  4 +---
 mk/rte.sdkinstall.mk                             | 12 ++++++++++++
 3 files changed, 17 insertions(+), 6 deletions(-)
doc/build-sdk-quick.txt +4 -3
index 662ef63..acd1bfe 100644
@@ -5,7 +5,8 @@ Build commands
 	all              same as build (default rule)
 	build            build in a configured directory
 	clean            remove files but keep configuration
-	install          configure, build and install a target in DESTDIR
+	install T=       configure, build and install a target in DESTDIR
+	install          install optionally staged in DESTDIR
 	examples         build examples for given targets (T=)
 	examples_clean   clean examples for given targets (T=)
 Build variables
@@ -17,8 +18,8 @@ Build variables
 	CROSS     toolchain prefix
 	V         verbose
 	D         debug dependencies
-	O         build directory (default: build/ - install default: ./)
-	DESTDIR   second-stage install directory
+	O         build directory (default: build/ - install T= default: ./)
+	DESTDIR   staging install directory
 	prefix    root install directory
 	T         target template - used with config or install
 			format: <arch-machine-execenv-toolchain>
doc/guides/prog_guide/dev_kit_root_make_help.rst +1 -3
index b0429d8..fb3520e 100644
@@ -107,8 +107,6 @@ Install Targets
 
 *   Install
 
-    Build the DPDK binary.
-    The name of the target to install is specified using T=mytarget.
     The list of available targets are in $(RTE_SDK)/config (remove the defconfig\_ prefix).
 
     The GNU standards variables may be used:
@@ -119,7 +117,7 @@ Install Targets
 
     .. code-block:: console
 
-        make install T=x86_64-native-linuxapp-gcc prefix=/usr
+        make install DESTDIR=myinstall prefix=/usr
 
 Test Targets
 ------------
mk/rte.sdkinstall.mk +12 -0
index 4816998..6a7aedd 100644
@@ -33,11 +33,21 @@
 # Configuration, compilation and installation can be done at once
 # with make install T=<config>
 
+ifdef T # config, build and install combined
 # The build directory is T and may be prepended with O
 O ?= .
 BUILD_DIR := $O/$T
+else # standard install
+# Build directory is given with O=
+O ?= build
+BUILD_DIR := $O
+endif
 
+ifdef T # defaults with T= will install an almost flat staging tree
+export prefix ?=
+else
 prefix      ?=     /usr/local
+endif
 exec_prefix ?=      $(prefix)
 bindir      ?= $(exec_prefix)/bin
 libdir      ?= $(exec_prefix)/lib
@@ -58,6 +68,7 @@ rte_symlink = ln -snf $$($(RTE_SDK)/scripts/relpath.sh $1 $(dir $2)) $2
 
 .PHONY: pre_install
 pre_install:
+ifdef T
 	$(Q)if [ ! -f $(BUILD_DIR)/.config ]; then \
 		$(MAKE) config T=$T O=$(BUILD_DIR); \
 	elif cmp -s $(BUILD_DIR)/.config.orig $(BUILD_DIR)/.config; then \
@@ -74,6 +85,7 @@ pre_install:
 		echo "Using local configuration"; \
 	fi
 	$(Q)$(MAKE) all O=$(BUILD_DIR)
+endif
 
 .PHONY: install
 install: pre_install
Signature · 1 line
2.5.2
#29 lore raw

PATCH v2 6/12 mk: split install rule

In reply to Thomas Monjalon

Provides new sub-rules to install runtime and sdk separately.

The build directory must be changed from BUILD_DIR to O in install rules to avoid a bad recursive effect (O being BUILD_DIR being O + T).

---
 mk/rte.sdkinstall.mk | 18 ++++++++++++------
 mk/rte.sdkroot.mk    |  2 ++
 2 files changed, 14 insertions(+), 6 deletions(-)
mk/rte.sdkinstall.mk +12 -6
index 6a7aedd..509b50e 100644
@@ -93,25 +93,31 @@ ifeq ($(DESTDIR)$(if $T,,+),)
 	@echo Installation cannot run with T defined and DESTDIR undefined
 else
 	@echo ================== Installing $(DESTDIR)$(prefix)/
+	$(Q)$(MAKE) O=$(BUILD_DIR) install-runtime
+	$(Q)$(MAKE) O=$(BUILD_DIR) install-sdk
+	@echo Installation in $(DESTDIR)$(prefix)/ complete
+endif
+
+install-runtime:
 	$(Q)$(call rte_mkdir, $(DESTDIR)$(libdir))
-	$(Q)cp -a $(BUILD_DIR)/lib/* $(DESTDIR)$(libdir)
+	$(Q)cp -a    $O/lib/* $(DESTDIR)$(libdir)
 	$(Q)$(call rte_mkdir, $(DESTDIR)$(bindir))
-	$(Q)tar -cf -      -C $(BUILD_DIR) app  --exclude 'app/*.map' \
+	$(Q)tar -cf -      -C $O app  --exclude 'app/*.map' \
 		--exclude 'app/cmdline*' --exclude app/test \
 		--exclude app/testacl --exclude app/testpipeline | \
 	    tar -xf -      -C $(DESTDIR)$(bindir) --strip-components=1 \
 		--keep-newer-files --warning=no-ignore-newer
 	$(Q)$(call rte_mkdir,      $(DESTDIR)$(datadir))
 	$(Q)cp -a $(RTE_SDK)/tools $(DESTDIR)$(datadir)
+
+install-sdk:
 	$(Q)$(call rte_mkdir, $(DESTDIR)$(includedir))
-	$(Q)tar -chf -     -C $(BUILD_DIR) include | \
+	$(Q)tar -chf -     -C $O include | \
 	    tar -xf -      -C $(DESTDIR)$(includedir) --strip-components=1 \
 		--keep-newer-files --warning=no-ignore-newer
 	$(Q)$(call rte_mkdir,                            $(DESTDIR)$(sdkdir))
 	$(Q)cp -a               $(RTE_SDK)/{mk,scripts}  $(DESTDIR)$(sdkdir)
 	$(Q)$(call rte_mkdir,                            $(DESTDIR)$(targetdir))
-	$(Q)cp -a               $(BUILD_DIR)/.config     $(DESTDIR)$(targetdir)
+	$(Q)cp -a               $O/.config               $(DESTDIR)$(targetdir)
 	$(Q)$(call rte_symlink, $(DESTDIR)$(includedir), $(DESTDIR)$(targetdir)/include)
 	$(Q)$(call rte_symlink, $(DESTDIR)$(libdir),     $(DESTDIR)$(targetdir)/lib)
-	@echo Installation in $(DESTDIR)$(prefix)/ complete
-endif
mk/rte.sdkroot.mk +2 -0
index 9fdecf4..ce6b0fc 100644
@@ -96,6 +96,8 @@ test fast_test ring_test mempool_test perf_test coverage:
 .PHONY: install
 install:
 	$(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdkinstall.mk $@
+install-%:
+	$(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdkinstall.mk $@
 
 .PHONY: doc help
 doc: doc-all
Signature · 1 line
2.5.2
#30 lore raw

PATCH v2 7/12 mk: install kernel modules

In reply to Thomas Monjalon

Add kernel modules to "make install".
Nothing is done if there is no kernel module compiled.

When using "make install T=", the default path is the same as before.

The Linux path is based on host kernel version.

---
 mk/rte.sdkinstall.mk | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
mk/rte.sdkinstall.mk +15 -0
index 509b50e..3daf241 100644
@@ -43,9 +43,17 @@ O ?= build
 BUILD_DIR := $O
 endif
 
+include $(RTE_SDK)/mk/rte.vars.mk
+
 ifdef T # defaults with T= will install an almost flat staging tree
 export prefix ?=
+kerneldir   ?= $(prefix)/kmod
+else
+ifeq ($(RTE_EXEC_ENV),linuxapp)
+kerneldir   ?= /lib/modules/$(shell uname -r)/extra/dpdk
 else
+kerneldir   ?= /boot/modules
+endif
 prefix      ?=     /usr/local
 endif
 exec_prefix ?=      $(prefix)
@@ -94,6 +102,7 @@ ifeq ($(DESTDIR)$(if $T,,+),)
 else
 	@echo ================== Installing $(DESTDIR)$(prefix)/
 	$(Q)$(MAKE) O=$(BUILD_DIR) install-runtime
+	$(Q)$(MAKE) O=$(BUILD_DIR) install-kmod
 	$(Q)$(MAKE) O=$(BUILD_DIR) install-sdk
 	@echo Installation in $(DESTDIR)$(prefix)/ complete
 endif
@@ -110,6 +119,12 @@ install-runtime:
 	$(Q)$(call rte_mkdir,      $(DESTDIR)$(datadir))
 	$(Q)cp -a $(RTE_SDK)/tools $(DESTDIR)$(datadir)
 
+install-kmod:
+ifneq ($(wildcard $O/kmod/*),)
+	$(Q)$(call rte_mkdir, $(DESTDIR)$(kerneldir))
+	$(Q)cp -a   $O/kmod/* $(DESTDIR)$(kerneldir)
+endif
+
 install-sdk:
 	$(Q)$(call rte_mkdir, $(DESTDIR)$(includedir))
 	$(Q)tar -chf -     -C $O include | \
Signature · 1 line
2.5.2
#31 lore raw

PATCH v2 8/12 mk: install binding tool in sbin directory

In reply to Thomas Monjalon

sbin/dpdk_nic_bind is a symbolic link to tools/dpdk_nic_bind.py where some python objects may be generated.

---
 mk/rte.sdkinstall.mk | 4 ++++
 1 file changed, 4 insertions(+)
mk/rte.sdkinstall.mk +4 -0
index 3daf241..884c915 100644
@@ -58,6 +58,7 @@ prefix      ?=     /usr/local
 endif
 exec_prefix ?=      $(prefix)
 bindir      ?= $(exec_prefix)/bin
+sbindir     ?= $(exec_prefix)/sbin
 libdir      ?= $(exec_prefix)/lib
 includedir  ?=      $(prefix)/include/dpdk
 datarootdir ?=      $(prefix)/share
@@ -118,6 +119,9 @@ install-runtime:
 		--keep-newer-files --warning=no-ignore-newer
 	$(Q)$(call rte_mkdir,      $(DESTDIR)$(datadir))
 	$(Q)cp -a $(RTE_SDK)/tools $(DESTDIR)$(datadir)
+	$(Q)$(call rte_mkdir,      $(DESTDIR)$(sbindir))
+	$(Q)$(call rte_symlink,    $(DESTDIR)$(datadir)/tools/dpdk_nic_bind.py, \
+	                           $(DESTDIR)$(sbindir)/dpdk_nic_bind)
 
 install-kmod:
 ifneq ($(wildcard $O/kmod/*),)
Signature · 1 line
2.5.2
#32 lore raw

PATCH v2 9/12 mk: install doc

In reply to Thomas Monjalon

The HTML API and HTML/PDF guides may be installed if generated.

---
 mk/rte.sdkinstall.mk | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
mk/rte.sdkinstall.mk +14 -0
index 884c915..902a933 100644
@@ -62,6 +62,7 @@ sbindir     ?= $(exec_prefix)/sbin
 libdir      ?= $(exec_prefix)/lib
 includedir  ?=      $(prefix)/include/dpdk
 datarootdir ?=      $(prefix)/share
+docdir      ?=       $(datarootdir)/doc/dpdk
 datadir     ?=       $(datarootdir)/dpdk
 sdkdir      ?=                $(datadir)
 targetdir   ?=                $(datadir)/$(RTE_TARGET)
@@ -105,6 +106,7 @@ else
 	$(Q)$(MAKE) O=$(BUILD_DIR) install-runtime
 	$(Q)$(MAKE) O=$(BUILD_DIR) install-kmod
 	$(Q)$(MAKE) O=$(BUILD_DIR) install-sdk
+	$(Q)$(MAKE) O=$(BUILD_DIR) install-doc
 	@echo Installation in $(DESTDIR)$(prefix)/ complete
 endif
 
@@ -140,3 +142,15 @@ install-sdk:
 	$(Q)cp -a               $O/.config               $(DESTDIR)$(targetdir)
 	$(Q)$(call rte_symlink, $(DESTDIR)$(includedir), $(DESTDIR)$(targetdir)/include)
 	$(Q)$(call rte_symlink, $(DESTDIR)$(libdir),     $(DESTDIR)$(targetdir)/lib)
+
+install-doc:
+ifneq ($(wildcard $O/doc),)
+	$(Q)$(call rte_mkdir, $(DESTDIR)$(docdir))
+	$(Q)tar -cf -      -C $O/doc html --exclude 'html/guides/.*' | \
+	    tar -xf -      -C $(DESTDIR)$(docdir) --strip-components=1 \
+		--keep-newer-files --warning=no-ignore-newer
+endif
+ifneq ($(wildcard $O/doc/*/*/*pdf),)
+	$(Q)$(call rte_mkdir,     $(DESTDIR)$(docdir)/guides)
+	$(Q)cp -a $O/doc/*/*/*pdf $(DESTDIR)$(docdir)/guides
+endif
Signature · 1 line
2.5.2
#33 lore raw

PATCH v2 10/12 mk: install examples

In reply to Thomas Monjalon

The examples are part of the installed documentation.

---
 mk/rte.sdkinstall.mk | 1 +
 1 file changed, 1 insertion(+)
mk/rte.sdkinstall.mk +1 -0
index 902a933..13fa819 100644
@@ -154,3 +154,4 @@ ifneq ($(wildcard $O/doc/*/*/*pdf),)
 	$(Q)$(call rte_mkdir,     $(DESTDIR)$(docdir)/guides)
 	$(Q)cp -a $O/doc/*/*/*pdf $(DESTDIR)$(docdir)/guides
 endif
+	$(Q)cp -a $(RTE_SDK)/examples $(DESTDIR)$(datadir)
Signature · 1 line
2.5.2
#37 lore raw

PATCH v2 11/12 app/proc_info: rename binary with prefix

In reply to Thomas Monjalon

In order to be installed system-wise, this application needs a prefix. So it makes clear that it is DPDK related.

---
 app/proc_info/Makefile                 | 2 +-
 doc/guides/sample_app_ug/proc_info.rst | 8 ++++----
 mk/rte.sdktest.mk                      | 4 ++--
 3 files changed, 7 insertions(+), 7 deletions(-)
app/proc_info/Makefile +1 -1
index 243b060..33e058e 100644
@@ -31,7 +31,7 @@
 
 include $(RTE_SDK)/mk/rte.vars.mk
 
-APP = proc_info
+APP = dpdk_proc_info
 
 CFLAGS += $(WERROR_FLAGS)
 
doc/guides/sample_app_ug/proc_info.rst +4 -4
index a0c0b06..542950b 100644
@@ -30,10 +30,10 @@
     OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 
-proc_info Application
-========================
+dpdk_proc_info Application
+==========================
 
-The proc_info application is a Data Plane Development Kit (DPDK) application
+The dpdk_proc_info application is a Data Plane Development Kit (DPDK) application
 that runs as a DPDK secondary process and is capable of retrieving port
 statistics, resetting port statistics and printing DPDK memory information.
 This application extends the original functionality that was supported by
@@ -45,7 +45,7 @@ The application has a number of command line options:
 
 .. code-block:: console
 
-   ./$(RTE_TARGET)/app/proc_info -- -m | [-p PORTMASK] [--stats | --xstats |
+   ./$(RTE_TARGET)/app/dpdk_proc_info -- -m | [-p PORTMASK] [--stats | --xstats |
    --stats-reset | --xstats-reset]
 
 Parameters
mk/rte.sdktest.mk +2 -2
index 59a29de..ee25f28 100644
@@ -66,7 +66,7 @@ test fast_test ring_test mempool_test perf_test:
 	fi
 
 # this is a special target to ease the pain of running coverage tests
-# this runs all the autotests, cmdline_test script and proc_info
+# this runs all the autotests, cmdline_test script and dpdk_proc_info
 coverage:
 	@mkdir -p $(AUTOTEST_DIR) ; \
 	cd $(AUTOTEST_DIR) ; \
@@ -78,7 +78,7 @@ coverage:
 			$(RTE_OUTPUT)/app/test \
 			$(RTE_TARGET) \
 			$(BLACKLIST) $(WHITELIST) ; \
-		$(RTE_OUTPUT)/app/proc_info --file-prefix=ring_perf -- -m; \
+		$(RTE_OUTPUT)/app/dpdk_proc_info --file-prefix=ring_perf -- -m; \
 	else \
 		echo "No test found, please do a 'make build' first, or specify O=" ;\
 	fi
Signature · 1 line
2.5.2
#38 lore raw

PATCH v2 12/12 pkg: update RPM with standard install

In reply to Thomas Monjalon

The "make install" is more standard now.
So the recipe can be simplified.

---
 pkg/dpdk.spec | 59 ++++++++++++++++-------------------------------------------
 1 file changed, 16 insertions(+), 43 deletions(-)
pkg/dpdk.spec +16 -43
index 7437025..e68985f 100644
@@ -41,8 +41,9 @@ Group: System Environment/Libraries
 License: BSD and LGPLv2 and GPLv2
 
 ExclusiveArch: i686, x86_64
-%global target %{_arch}-native-linuxapp-gcc
 %global machine default
+%global target %{_arch}-%{machine}-linuxapp-gcc
+%global config %{_arch}-native-linuxapp-gcc
 
 BuildRequires: kernel-devel, kernel-headers, libpcap-devel, xen-devel
 BuildRequires: doxygen, python-sphinx, inkscape
@@ -69,16 +70,11 @@ BuildArch: noarch
 DPDK doc is divided in two parts: API details in doxygen HTML format
 and guides in sphinx HTML/PDF formats.
 
-%global destdir %{buildroot}%{_prefix}
-%global moddir  /lib/modules/%(uname -r)/extra
-%global datadir %{_datadir}/dpdk
-%global docdir  %{_docdir}/dpdk
-
 %prep
 %setup -q
 
 %build
-make O=%{target} T=%{target} config
+make O=%{target} T=%{config} config
 sed -ri 's,(RTE_MACHINE=).*,\1%{machine},' %{target}/.config
 sed -ri 's,(RTE_APP_TEST=).*,\1n,'         %{target}/.config
 sed -ri 's,(RTE_BUILD_SHARED_LIB=).*,\1y,' %{target}/.config
@@ -93,51 +89,28 @@ make O=%{target} doc
 
 %install
 rm -rf %{buildroot}
-make            O=%{target}      DESTDIR=%{destdir}
-mkdir -p                                 %{buildroot}%{moddir}
-mv     %{destdir}/%{target}/kmod/*.ko    %{buildroot}%{moddir}
-rmdir  %{destdir}/%{target}/kmod
-mkdir -p                                 %{buildroot}%{_sbindir}
-ln -s  %{datadir}/tools/*nic_bind.py     %{buildroot}%{_sbindir}/dpdk_nic_bind
-mkdir -p                                 %{buildroot}%{_bindir}
-mv     %{destdir}/%{target}/app/testpmd  %{buildroot}%{_bindir}
-rmdir  %{destdir}/%{target}/app
-mv     %{destdir}/%{target}/include      %{buildroot}%{_includedir}
-mv     %{destdir}/%{target}/lib          %{buildroot}%{_libdir}
-mkdir -p                                 %{buildroot}%{docdir}
-rm -rf %{destdir}/%{target}/doc/*/*/.{build,doc}*
-mv     %{destdir}/%{target}/doc/html/*   %{buildroot}%{docdir}
-mv     %{destdir}/%{target}/doc/*/*/*pdf %{buildroot}%{docdir}/guides
-rm -rf %{destdir}/%{target}/doc
-mkdir -p                                 %{buildroot}%{datadir}
-mv     %{destdir}/%{target}/.config      %{buildroot}%{datadir}/config
-mv     %{destdir}/%{target}              %{buildroot}%{datadir}
-mv     %{destdir}/scripts                %{buildroot}%{datadir}
-mv     %{destdir}/mk                     %{buildroot}%{datadir}
-cp -a             examples               %{buildroot}%{datadir}
-cp -a             tools                  %{buildroot}%{datadir}
-ln -s             %{datadir}/config      %{buildroot}%{datadir}/%{target}/.config
-ln -s             %{_includedir}         %{buildroot}%{datadir}/%{target}/include
-ln -s             %{_libdir}             %{buildroot}%{datadir}/%{target}/lib
+make install O=%{target} DESTDIR=%{buildroot} \
+	prefix=%{_prefix} bindir=%{_bindir} sbindir=%{_sbindir} \
+	includedir=%{_includedir}/dpdk libdir=%{_libdir} \
+	datadir=%{_datadir}/dpdk docdir=%{_docdir}/dpdk
 
 %files
-%dir %{datadir}
-%{datadir}/config
-%{datadir}/tools
-%{moddir}/*
+%dir %{_datadir}/dpdk
+%{_datadir}/dpdk/tools
+/lib/modules/%(uname -r)/extra/*
 %{_sbindir}/*
 %{_bindir}/*
 %{_libdir}/*
 
 %files devel
-%{_includedir}/*
-%{datadir}/mk
-%{datadir}/scripts
-%{datadir}/%{target}
-%{datadir}/examples
+%{_includedir}/dpdk
+%{_datadir}/dpdk/mk
+%{_datadir}/dpdk/scripts
+%{_datadir}/dpdk/%{target}
+%{_datadir}/dpdk/examples
 
 %files doc
-%doc %{docdir}
+%doc %{_docdir}/dpdk
 
 %post
 /sbin/ldconfig
Signature · 1 line
2.5.2
#39 lore raw
In reply to Thomas Monjalon
Quoted 4 lines · Thomas Monjalon

Following the recent discussions, this is a proposal to have a standard installation process while keeping compatibility with most of the old behaviours.

How compatible are we looking for here. The standard way of compiling up DPDK up till now has always been "make install T=$RTE_TARGET", but that seems to no longer work.

bruce@silpixa00389037-Fedora:dpdk-clean$ echo $RTE_TARGET
x86_64-native-linuxapp-gcc
bruce@silpixa00389037-Fedora:dpdk-clean$ make install T=$RTE_TARGET
/home/bruce/dpdk-clean/mk/rte.vars.mk:58: /home/bruce/dpdk-clean/build/.config: No such file or directory
/home/bruce/dpdk-clean/mk/rte.vars.mk:83: *** RTE_ARCH is not defined.  Stop.
/home/bruce/dpdk-clean/mk/rte.sdkroot.mk:98: recipe for target 'install' failed
make: *** [install] Error 2

When I look for backward compatibilty, this is the main thing I look for, as I'm not aware of anyone (on my team here at least!) who does a make config first etc. When developing, most people just do a "make install T=..."straight up.

/Bruce

#40 lore raw

2015-12-03 10:57, Bruce Richardson:

Quoted 18 lines · Thomas Monjalon
Quoted 4 lines

Following the recent discussions, this is a proposal to have a standard installation process while keeping compatibility with most of the old behaviours.

How compatible are we looking for here. The standard way of compiling up DPDK up till now has always been "make install T=$RTE_TARGET", but that seems to no longer work.

bruce@silpixa00389037-Fedora:dpdk-clean$ echo $RTE_TARGET
x86_64-native-linuxapp-gcc
bruce@silpixa00389037-Fedora:dpdk-clean$ make install T=$RTE_TARGET
/home/bruce/dpdk-clean/mk/rte.vars.mk:58: /home/bruce/dpdk-clean/build/.config: No such file or directory
/home/bruce/dpdk-clean/mk/rte.vars.mk:83: *** RTE_ARCH is not defined.  Stop.
/home/bruce/dpdk-clean/mk/rte.sdkroot.mk:98: recipe for target 'install' failed
make: *** [install] Error 2
Quoted 3 lines

When I look for backward compatibilty, this is the main thing I look for, as I'm not aware of anyone (on my team here at least!) who does a make config first etc. When developing, most people just do a "make install T=..."straight up.

I agree.
And it works on my machine.
I'd like to understand what is the problem on yours.

#41 lore raw
Quoted 19 lines · Thomas Monjalon

2015-12-03 10:57, Bruce Richardson:

Quoted 18 lines · Thomas Monjalon
Quoted 4 lines

Following the recent discussions, this is a proposal to have a standard installation process while keeping compatibility with most of the old behaviours.

How compatible are we looking for here. The standard way of compiling up DPDK up till now has always been "make install T=$RTE_TARGET", but that seems to no longer work.

bruce@silpixa00389037-Fedora:dpdk-clean$ echo $RTE_TARGET
x86_64-native-linuxapp-gcc
bruce@silpixa00389037-Fedora:dpdk-clean$ make install T=$RTE_TARGET
/home/bruce/dpdk-clean/mk/rte.vars.mk:58: /home/bruce/dpdk-clean/build/.config: No such file or directory
/home/bruce/dpdk-clean/mk/rte.vars.mk:83: *** RTE_ARCH is not defined.  Stop.
/home/bruce/dpdk-clean/mk/rte.sdkroot.mk:98: recipe for target 'install' failed
make: *** [install] Error 2
Quoted 7 lines
Quoted 3 lines

When I look for backward compatibilty, this is the main thing I look for, as I'm not aware of anyone (on my team here at least!) who does a make config first etc. When developing, most people just do a "make install T=..."straight up.

I agree.
And it works on my machine.
I'd like to understand what is the problem on yours.

Ok, it must be a local problem on my end so. I'll investigate and see if I can see what the issue is - maybe some leftover files from previous builds or something. I'll try with a clean clone.

/Bruce

#42 lore raw
In reply to Thomas Monjalon

2015-12-03 12:02, Thomas Monjalon:

Quoted 19 lines

2015-12-03 10:57, Bruce Richardson:

Quoted 18 lines · Thomas Monjalon
Quoted 4 lines

Following the recent discussions, this is a proposal to have a standard installation process while keeping compatibility with most of the old behaviours.

How compatible are we looking for here. The standard way of compiling up DPDK up till now has always been "make install T=$RTE_TARGET", but that seems to no longer work.

bruce@silpixa00389037-Fedora:dpdk-clean$ echo $RTE_TARGET
x86_64-native-linuxapp-gcc
bruce@silpixa00389037-Fedora:dpdk-clean$ make install T=$RTE_TARGET
/home/bruce/dpdk-clean/mk/rte.vars.mk:58: /home/bruce/dpdk-clean/build/.config: No such file or directory
/home/bruce/dpdk-clean/mk/rte.vars.mk:83: *** RTE_ARCH is not defined.  Stop.
/home/bruce/dpdk-clean/mk/rte.sdkroot.mk:98: recipe for target 'install' failed
make: *** [install] Error 2
Quoted 7 lines
Quoted 3 lines

When I look for backward compatibilty, this is the main thing I look for, as I'm not aware of anyone (on my team here at least!) who does a make config first etc. When developing, most people just do a "make install T=..."straight up.

I agree.
And it works on my machine.
I'd like to understand what is the problem on yours.

My bad. When deleting build/.config, the bug appears. I will fix it. Sorry for the inconvenience.

#43 lore raw
Quoted 24 lines · Thomas Monjalon

2015-12-03 12:02, Thomas Monjalon:

Quoted 23 lines

2015-12-03 10:57, Bruce Richardson:

Quoted 21 lines · Thomas Monjalon
Quoted 4 lines

Following the recent discussions, this is a proposal to have a standard installation process while keeping compatibility with most of the old behaviours.

How compatible are we looking for here. The standard way of compiling up DPDK up till now has always been "make install T=$RTE_TARGET", but that seems to no longer work.

bruce@silpixa00389037-Fedora:dpdk-clean$ echo $RTE_TARGET
x86_64-native-linuxapp-gcc
bruce@silpixa00389037-Fedora:dpdk-clean$ make install T=$RTE_TARGET
/home/bruce/dpdk-clean/mk/rte.vars.mk:58: /home/bruce/dpdk-clean/build/.config: No such file or directory
/home/bruce/dpdk-clean/mk/rte.vars.mk:83: *** RTE_ARCH is not defined.  Stop.
/home/bruce/dpdk-clean/mk/rte.sdkroot.mk:98: recipe for target 'install' failed
make: *** [install] Error 2

When I look for backward compatibilty, this is the main thing I look for, as I'm not aware of anyone (on my team here at least!) who does a make config first etc. When developing, most people just do a "make install T=..."straight up.

Quoted 6 lines
Quoted 3 lines

I agree.
And it works on my machine.
I'd like to understand what is the problem on yours.

My bad. When deleting build/.config, the bug appears. I will fix it. Sorry for the inconvenience.

Thanks, saves me from doing further digging. :-)

#34 lore raw

Re: [PATCH v2 10/12] mk: install examples

In reply to Thomas Monjalon
Quoted 13 lines · Thomas Monjalon

The examples are part of the installed documentation.

---
  mk/rte.sdkinstall.mk | 1 +
  1 file changed, 1 insertion(+)
mk/rte.sdkinstall.mk +0 -0
index 902a933..13fa819 100644

mk/rte.sdkinstall.mk ifneq ($(wildcard $O/doc/*/*/*pdf),) · line 157

Quoted 4 lines
mk/rte.sdkinstall.mk +1 -0
@@ -154,3 +154,4 @@ ifneq ($(wildcard $O/doc/*/*/*pdf),)
  	$(Q)$(call rte_mkdir,     $(DESTDIR)$(docdir)/guides)
  	$(Q)cp -a $O/doc/*/*/*pdf $(DESTDIR)$(docdir)/guides
  endif
+	$(Q)cp -a $(RTE_SDK)/examples $(DESTDIR)$(datadir)

If examples are considered documentation (and I agree on that), then shouldn't they be installed in $(docdir) instead?

- Panu -

#44 lore raw
In reply to Thomas Monjalon
Quoted 4 lines · Thomas Monjalon

Following the recent discussions, this is a proposal to have a standard installation process while keeping compatibility with most of the old behaviours.

Quoted 9 lines

v2 changes:
- fix default build dir
- RTE_TARGET subdir in $(sdkdir).
- better kerneldir defaults
- fix dpdk_nic_bind symlink
- always install doc if generated
- doc
- pkg/dpdk.spec

Except for the minor nit about examples location (one could bikeshed on things like these forever), seems fine to me and quick-n-dirty conversion of my own spec didn't reveal any nasty surprises.

It also appears more comprehensive and integrated with other workflows than the competing patches so FWIW, you have my ACK :)

- Panu -

#35 lore raw

Re: [PATCH v2 10/12] mk: install examples

In reply to Panu Matilainen

2015-12-03 15:19, Panu Matilainen:

Quoted 8 lines · Thomas Monjalon
Quoted 7 lines

The examples are part of the installed documentation.

---
  mk/rte.sdkinstall.mk | 1 +
  1 file changed, 1 insertion(+)
Quoted 13 lines

mk/rte.sdkinstall.mk ifneq ($(wildcard $O/doc/*/*/*pdf),) · line 157

Quoted 10 lines
mk/rte.sdkinstall.mk +1 -0
index 902a933..13fa819 100644
@@ -154,3 +154,4 @@ ifneq ($(wildcard $O/doc/*/*/*pdf),)
  	$(Q)$(call rte_mkdir,     $(DESTDIR)$(docdir)/guides)
  	$(Q)cp -a $O/doc/*/*/*pdf $(DESTDIR)$(docdir)/guides
  endif
+	$(Q)cp -a $(RTE_SDK)/examples $(DESTDIR)$(datadir)

If examples are considered documentation (and I agree on that), then shouldn't they be installed in $(docdir) instead?

I was hesitating. I think it's strange to install some code in /usr/share/doc/.
It's not really important and may be changed easily at any time.

#45 lore raw
In reply to Panu Matilainen

2015-12-03 15:26, Panu Matilainen:

Quoted 15 lines · Thomas Monjalon
Quoted 4 lines

Following the recent discussions, this is a proposal to have a standard installation process while keeping compatibility with most of the old behaviours.

Quoted 9 lines

v2 changes:
- fix default build dir
- RTE_TARGET subdir in $(sdkdir).
- better kerneldir defaults
- fix dpdk_nic_bind symlink
- always install doc if generated
- doc
- pkg/dpdk.spec

Quoted 6 lines

Except for the minor nit about examples location (one could bikeshed on things like these forever), seems fine to me and quick-n-dirty conversion of my own spec didn't reveal any nasty surprises.

It also appears more comprehensive and integrated with other workflows than the competing patches so FWIW, you have my ACK :)

Thank you.
I'm going to send a v3.
Mario, what is your opinion about this series?

#36 lore raw

Re: [PATCH v2 10/12] mk: install examples

In reply to Thomas Monjalon
Quoted 23 lines · Thomas Monjalon

2015-12-03 15:19, Panu Matilainen:

Quoted 8 lines · Thomas Monjalon
Quoted 7 lines

The examples are part of the installed documentation.

---
   mk/rte.sdkinstall.mk | 1 +
   1 file changed, 1 insertion(+)
Quoted 13 lines

mk/rte.sdkinstall.mk ifneq ($(wildcard $O/doc/*/*/*pdf),) · line 157

Quoted 10 lines
mk/rte.sdkinstall.mk +1 -0
index 902a933..13fa819 100644
@@ -154,3 +154,4 @@ ifneq ($(wildcard $O/doc/*/*/*pdf),)
   	$(Q)$(call rte_mkdir,     $(DESTDIR)$(docdir)/guides)
   	$(Q)cp -a $O/doc/*/*/*pdf $(DESTDIR)$(docdir)/guides
   endif
+	$(Q)cp -a $(RTE_SDK)/examples $(DESTDIR)$(datadir)

If examples are considered documentation (and I agree on that), then shouldn't they be installed in $(docdir) instead?

Quoted 4 lines

I was hesitating. I think it's strange to install some code in /usr/share/doc/.
It's not really important and may be changed easily at any time.

Installing source code anywhere at all seems a bit strange, being in doc seems like the least-worst alternative to me :) But like said, no big deal.

- Panu -

#47 lore raw

v3 cover standard make install

In reply to Thomas Monjalon

Following the recent discussions, this is a proposal to have a standard installation process while keeping compatibility with most of the old behaviours.

v2 changes:
- fix default build dir
- RTE_TARGET subdir in $(sdkdir).
- better kerneldir defaults
- fix dpdk_nic_bind symlink
- always install doc if generated
- doc
- pkg/dpdk.spec

v3 changes:
- fix install in a clean dir
- take responsibility in MAINTAINERS

More details below and in the commit messages.

These variables can be overriden:

kerneldir ?= /lib/modules/$(shell uname -r)/extra/dpdk
prefix ?= /usr/local
exec_prefix ?= $(prefix)

bindir      ?= $(exec_prefix)/bin
sbindir     ?= $(exec_prefix)/sbin
libdir      ?= $(exec_prefix)/lib
includedir  ?=      $(prefix)/include/dpdk
datarootdir ?=      $(prefix)/share
docdir      ?=       $(datarootdir)/doc/dpdk
datadir     ?=       $(datarootdir)/dpdk
sdkdir      ?=                $(datadir)
targetdir   ?=                $(datadir)/$(RTE_TARGET)

All paths are prefixed with $(DESTDIR)

One rule install = install-runtime install-kmod install-sdk install-doc

--------

System-wise install example with
DESTDIR=
prefix=/usr
kerneldir=/lib/modules/kver/extra

# make install-runtime
/usr/bin/testpmd
/usr/lib/libethdev*
/usr/lib/librte_*
/usr/sbin/dpdk_nic_bind -> /usr/share/dpdk/tools/dpdk_nic_bind.py
/usr/share/dpdk/tools/
# make install-kmod
/lib/modules/kver/extra/
# make install-sdk
/usr/include/dpdk/
/usr/share/dpdk/mk/
/usr/share/dpdk/scripts/
/usr/share/dpdk/x86_64-default-linuxapp-gcc/.config
/usr/share/dpdk/x86_64-default-linuxapp-gcc/include -> /usr/include/dpdk/
/usr/share/dpdk/x86_64-default-linuxapp-gcc/lib     -> /usr/lib/
# make install-doc
/usr/share/doc/dpdk/api/
/usr/share/doc/dpdk/guides/
/usr/share/dpdk/examples/

--------

Local install example with old (compatible) command:

# make install T=x86_64-native-linuxapp-gcc DESTDIR=install

would be equivalent to:

# make config T=x86_64-native-linuxapp-gcc 0=x86_64-native-linuxapp-gcc
# make O=x86_64-native-linuxapp-gcc
# make install O=x86_64-native-linuxapp-gcc prefix= DESTDIR=install

install/bin/testpmd
install/include/dpdk/
install/kmod/
install/lib/
install/sbin/dpdk_nic_bind -> ../share/dpdk/tools/dpdk_nic_bind.py install/share/doc/dpdk/
install/share/dpdk/examples/
install/share/dpdk/mk/
install/share/dpdk/scripts/
install/share/dpdk/tools/ install/share/dpdk/x86_64-native-linuxapp-gcc/.config install/share/dpdk/x86_64-native-linuxapp-gcc/include -> install/include/dpdk/
install/share/dpdk/x86_64-native-linuxapp-gcc/lib -> install/lib/

It should be usable to build some applications as before:

# make -C examples/helloworld RTE_SDK=$(readlink -m install) RTE_TARGET=x86_64-native-linuxapp-gcc

The RTE_SDK directory must point to install/share/dpdk with a default install.

--------

Thomas Monjalon (13):
mk: remove testall
mk: remove multi-target install
mk: move installation procedure in install rule
mk: install a standard cutomizable tree
mk: introduce new install syntax
mk: split install rule
mk: install kernel modules
mk: install binding tool in sbin directory
mk: install doc
mk: install examples
app/proc_info: rename binary with prefix
pkg: update RPM with standard install
maintainers: take responsibility for build system

 MAINTAINERS                                      |   2 +-
 app/proc_info/Makefile                           |   2 +-
 doc/build-sdk-quick.txt                          |  11 +-
 doc/guides/linux_gsg/build_dpdk.rst              |  16 ---
 doc/guides/prog_guide/dev_kit_root_make_help.rst |  28 +----
 doc/guides/sample_app_ug/proc_info.rst           |   8 +-
 mk/internal/rte.extvars.mk                       |   4 +
 mk/rte.sdkbuild.mk                               |  16 ---
 mk/rte.sdkinstall.mk                             | 150 +++++++++++++++++------
 mk/rte.sdkroot.mk                                |  11 +-
 mk/rte.sdktest.mk                                |   4 +-
 mk/rte.sdktestall.mk                             |  57 ---------
 mk/rte.vars.mk                                   |  10 +-
 pkg/dpdk.spec                                    |  59 +++------
 tools/setup.sh                                   |  31 ++---
 15 files changed, 167 insertions(+), 242 deletions(-)
 delete mode 100644 mk/rte.sdktestall.mk
Signature · 1 line
2.5.2
#48 lore raw

PATCH v3 1/13 mk: remove testall

It is not possible to test every configs on an unique machine.

---
 doc/guides/prog_guide/dev_kit_root_make_help.rst | 13 ------
 mk/rte.sdkroot.mk                                |  4 --
 mk/rte.sdktestall.mk                             | 57 ------------------------
 3 files changed, 74 deletions(-)
 delete mode 100644 mk/rte.sdktestall.mk
doc/guides/prog_guide/dev_kit_root_make_help.rst +0 -13
index a5cd196..e02c544 100644
@@ -138,19 +138,6 @@ Test Targets
 
         make test O=mybuild
 
-*   testall
-
-    Launch automatic tests for all installed target directories (after a make install).
-    The name of the targets to test can be optionally specified using T=mytarget.
-    The target name can contain wildcard (\*) characters.
-    The list of available targets are in $(RTE_SDK)/config (remove the defconfig\_  prefix).
-
-    Examples:
-
-    .. code-block:: console
-
-        make testall, make testall T=x86_64-*
-
 Documentation Targets
 ---------------------
 
mk/rte.sdkroot.mk +0 -4
index e8423b0..0e97308 100644
@@ -93,10 +93,6 @@ config showconfigs showversion:
 test fast_test ring_test mempool_test perf_test coverage:
 	$(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdktest.mk $@
 
-.PHONY: testall
-testall:
-	$(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdktestall.mk $@
-
 .PHONY: install uninstall
 install uninstall:
 	$(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdkinstall.mk $@
mk/rte.sdktestall.mk deleted +0 -57

57 lines not on this page · raw message

Signature · 1 line
2.5.2
#49 lore raw

PATCH v3 2/13 mk: remove multi-target install

In reply to Thomas Monjalon

The multi-target install create some subdirectories with the target name which is not standard for a "make install" procedure.

The uninstall procedure cannot be applied properly (without removing all files in a directory). It would need to pre-compute paths.
As it is a packaging issue, it is removed from the build system capabilities.

The variable BUILD_DIR is also renamed to RTE_OUTPUT used in other files.

---
 doc/build-sdk-quick.txt                          |  5 +-
 doc/guides/linux_gsg/build_dpdk.rst              | 16 ------
 doc/guides/prog_guide/dev_kit_root_make_help.rst | 11 +----
 mk/rte.sdkinstall.mk                             | 62 ++++++------------------
 mk/rte.sdkroot.mk                                |  4 +-
 tools/setup.sh                                   | 31 ++++--------
 6 files changed, 32 insertions(+), 97 deletions(-)
doc/build-sdk-quick.txt +2 -3
index bf18b48..b5f752e 100644
@@ -5,8 +5,7 @@ Build commands
 	all              same as build (default rule)
 	build            build in a configured directory
 	clean            remove files but keep configuration
-	install          build many targets (wildcard allowed) and install in DESTDIR
-	uninstall        remove all installed targets
+	install          configure, build and install a target in DESTDIR
 	examples         build examples for given targets (T=)
 	examples_clean   clean examples for given targets (T=)
 Build variables
@@ -20,6 +19,6 @@ Build variables
 	D         debug dependencies
 	O         build directory (default: build/ - install default: ./)
 	DESTDIR   second-stage install directory
-	T         target template (install default: *) - used with config or install
+	T         target template - used with config or install
 			format: <arch-machine-execenv-toolchain>
 			templates in config/defconfig_*
doc/guides/linux_gsg/build_dpdk.rst +0 -16
index 2680e66..fd0fcc8 100644
@@ -110,22 +110,6 @@ To compile a 32-bit build using gcc, the make command should be:
 
     make install T=i686-native-linuxapp-gcc
 
-To compile all 64-bit targets using gcc, use:
-
-.. code-block:: console
-
-    make install T=x86_64*gcc
-
-To compile all 64-bit targets using both gcc and icc, use:
-
-.. code-block:: console
-
-    make install T=x86_64-*
-
-.. note::
-
-    The wildcard operator (*) can be used to create multiple targets at the same time.
-
 To prepare a target without building it, for example, if the configuration changes need to be made before compilation,
 use the make config T=<target> command:
 
doc/guides/prog_guide/dev_kit_root_make_help.rst +2 -9
index e02c544..458fc91 100644
@@ -108,21 +108,14 @@ Install Targets
 *   Install
 
     Build the DPDK binary.
-    Actually, this builds each supported target in a separate directory.
-    The name of each directory is the name of the target.
-    The name of the targets to install can be optionally specified using T=mytarget.
-    The target name can contain wildcard \* characters.
+    The name of the target to install is specified using T=mytarget.
     The list of available targets are in $(RTE_SDK)/config (remove the defconfig\_ prefix).
 
     Example:
 
     .. code-block:: console
 
-        make install T=x86_64-*
-
-*   Uninstall
-
-    Remove installed target directories.
+        make install T=x86_64-native-linuxapp-gcc
 
 Test Targets
 ------------
mk/rte.sdkinstall.mk +16 -46

75 lines not on this page · raw message

mk/rte.sdkroot.mk +2 -2
index 0e97308..9fdecf4 100644
@@ -93,8 +93,8 @@ config showconfigs showversion:
 test fast_test ring_test mempool_test perf_test coverage:
 	$(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdktest.mk $@
 
-.PHONY: install uninstall
-install uninstall:
+.PHONY: install
+install:
 	$(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdkinstall.mk $@
 
 .PHONY: doc help
tools/setup.sh +10 -21
index 5a8b2f3..58a08e7 100755
@@ -105,14 +105,6 @@ setup_target()
 }
 
 #
-# Uninstall all targets.
-#
-uninstall_targets()
-{
-	make uninstall
-}
-
-#
 # Creates hugepage filesystem.
 #
 create_mnt_huge()
@@ -571,23 +563,20 @@ step5_func()
 {
 	TITLE="Uninstall and system cleanup"
 
-	TEXT[1]="Uninstall all targets"
-	FUNC[1]="uninstall_targets"
-
-	TEXT[2]="Unbind NICs from IGB UIO or VFIO driver"
-	FUNC[2]="unbind_nics"
+	TEXT[1]="Unbind NICs from IGB UIO or VFIO driver"
+	FUNC[1]="unbind_nics"
 
-	TEXT[3]="Remove IGB UIO module"
-	FUNC[3]="remove_igb_uio_module"
+	TEXT[2]="Remove IGB UIO module"
+	FUNC[2]="remove_igb_uio_module"
 
-	TEXT[4]="Remove VFIO module"
-	FUNC[4]="remove_vfio_module"
+	TEXT[3]="Remove VFIO module"
+	FUNC[3]="remove_vfio_module"
 
-	TEXT[5]="Remove KNI module"
-	FUNC[5]="remove_kni_module"
+	TEXT[4]="Remove KNI module"
+	FUNC[4]="remove_kni_module"
 
-	TEXT[6]="Remove hugepage mappings"
-	FUNC[6]="clear_huge_pages"
+	TEXT[5]="Remove hugepage mappings"
+	FUNC[5]="clear_huge_pages"
 }
 
 STEPS[1]="step1_func"
Signature · 1 line
2.5.2
#50 lore raw

PATCH v3 3/13 mk: move installation procedure in install rule

In reply to Thomas Monjalon

The real installation was called "binary install" and was done after the build when DESTDIR was specified.
Remove this limitation and move the code in install rule only.

---
 mk/rte.sdkbuild.mk   | 16 ----------------
 mk/rte.sdkinstall.mk | 21 ++++++++++++++++++---
 mk/rte.sdkroot.mk    |  1 +
 3 files changed, 19 insertions(+), 19 deletions(-)
mk/rte.sdkbuild.mk +0 -16
index 38ec7bd..85f603c 100644
@@ -29,8 +29,6 @@
 #   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 #   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-# If DESTDIR variable is given, install binary dpdk
-
 #
 # include rte.vars.mk if config file exists
 #
@@ -61,20 +59,6 @@ CLEANDIRS = $(addsuffix _clean,$(ROOTDIRS-y) $(ROOTDIRS-n) $(ROOTDIRS-))
 .PHONY: build
 build: $(ROOTDIRS-y)
 	@echo "Build complete [$(RTE_TARGET)]"
-ifneq ($(DESTDIR),)
-	$(Q)mkdir -p $(DESTDIR)
-	$(Q)tar -C $(RTE_SDK) -cf - mk scripts/*.sh | tar -C $(DESTDIR) -x \
-	  --keep-newer-files --warning=no-ignore-newer -f -
-	$(Q)mkdir -p $(DESTDIR)/`basename $(RTE_OUTPUT)`
-	$(Q)tar -C $(RTE_OUTPUT) -chf - \
-	  --exclude app --exclude hostapp --exclude build \
-	  --exclude Makefile --exclude .depdirs . | \
-	  tar -C $(DESTDIR)/`basename $(RTE_OUTPUT)` -x --keep-newer-files \
-	  --warning=no-ignore-newer -f -
-	$(Q)install -D $(RTE_OUTPUT)/app/testpmd \
-	  $(DESTDIR)/`basename $(RTE_OUTPUT)`/app/testpmd
-	@echo Installation in $(DESTDIR) complete
-endif
 
 .PHONY: clean
 clean: $(CLEANDIRS)
mk/rte.sdkinstall.mk +18 -3
index 0b80104..c5d0881 100644
@@ -36,9 +36,8 @@
 O ?= .
 RTE_OUTPUT := $O/$T
 
-.PHONY: install
-install:
-	@echo ================== Installing $T
+.PHONY: pre_install
+pre_install:
 	$(Q)if [ ! -f $(RTE_OUTPUT)/.config ]; then \
 		$(MAKE) config O=$(RTE_OUTPUT); \
 	elif cmp -s $(RTE_OUTPUT)/.config.orig $(RTE_OUTPUT)/.config; then \
@@ -55,3 +54,19 @@ install:
 		echo "Using local configuration"; \
 	fi
 	$(Q)$(MAKE) all O=$(RTE_OUTPUT)
+
+.PHONY: install
+install:
+	@echo ================== Installing $(DESTDIR)
+	$(Q)mkdir -p $(DESTDIR)
+	$(Q)tar -C $(RTE_SDK) -cf - mk scripts/*.sh | tar -C $(DESTDIR) -x \
+	  --keep-newer-files --warning=no-ignore-newer -f -
+	$(Q)mkdir -p $(DESTDIR)/$T
+	$(Q)tar -C $(RTE_OUTPUT) -chf - \
+	  --exclude app --exclude hostapp --exclude build \
+	  --exclude Makefile --exclude .depdirs . | \
+	  tar -C $(DESTDIR)/$T -x --keep-newer-files \
+	  --warning=no-ignore-newer -f -
+	$(Q)install -D $(RTE_OUTPUT)/app/testpmd \
+	  $(DESTDIR)/$T/app/testpmd
+	@echo Installation in $(DESTDIR) complete
mk/rte.sdkroot.mk +1 -0
index 9fdecf4..533afe9 100644
@@ -95,6 +95,7 @@ test fast_test ring_test mempool_test perf_test coverage:
 
 .PHONY: install
 install:
+	$(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdkinstall.mk pre_install
 	$(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdkinstall.mk $@
 
 .PHONY: doc help
Signature · 1 line
2.5.2
#51 lore raw

PATCH v3 4/13 mk: install a standard cutomizable tree

In reply to Thomas Monjalon

The rule "install" follows these conventions:
http://gnu.org/prep/standards/html_node/Directory-Variables.html
http://gnu.org/prep/standards/html_node/DESTDIR.html

The variable sdkdir has been added to the more standards ones, to configure the directory used with RTE_SDK when using the DPDK makefiles to build an application.

It is still possible to build DPDK with the "install T=" rule without specifying any DESTDIR. In such case there is no install, as before.

The old usage of an installed SDK is:

    make -C examples/helloworld RTE_SDK=$(readlink -m $DESTDIR) \
         RTE_TARGET=x86_64-native-linuxapp-gcc

RTE_TARGET can be specified but is useless now with an installed SDK. The RTE_SDK directory must now point to a different path depending of the installation.

---
 doc/build-sdk-quick.txt                          |  1 +
 doc/guides/prog_guide/dev_kit_root_make_help.rst |  6 ++-
 mk/internal/rte.extvars.mk                       |  4 ++
 mk/rte.sdkinstall.mk                             | 59 ++++++++++++++++++------
 mk/rte.vars.mk                                   | 10 +---
 5 files changed, 58 insertions(+), 22 deletions(-)
doc/build-sdk-quick.txt +1 -0
index b5f752e..662ef63 100644
@@ -19,6 +19,7 @@ Build variables
 	D         debug dependencies
 	O         build directory (default: build/ - install default: ./)
 	DESTDIR   second-stage install directory
+	prefix    root install directory
 	T         target template - used with config or install
 			format: <arch-machine-execenv-toolchain>
 			templates in config/defconfig_*
doc/guides/prog_guide/dev_kit_root_make_help.rst +5 -1
index 458fc91..b0429d8 100644
@@ -111,11 +111,15 @@ Install Targets
     The name of the target to install is specified using T=mytarget.
     The list of available targets are in $(RTE_SDK)/config (remove the defconfig\_ prefix).
 
+    The GNU standards variables may be used:
+    http://gnu.org/prep/standards/html_node/Directory-Variables.html and
+    http://gnu.org/prep/standards/html_node/DESTDIR.html
+
     Example:
 
     .. code-block:: console
 
-        make install T=x86_64-native-linuxapp-gcc
+        make install T=x86_64-native-linuxapp-gcc prefix=/usr
 
 Test Targets
 ------------
mk/internal/rte.extvars.mk +4 -0
index e248d19..040d39f 100644
@@ -51,7 +51,11 @@ endif
 RTE_EXTMK ?= $(RTE_SRCDIR)/Makefile
 export RTE_EXTMK
 
+# RTE_SDK_BIN must point to .config, include/ and lib/.
 RTE_SDK_BIN := $(RTE_SDK)/$(RTE_TARGET)
+ifeq ($(wildcard $(RTE_SDK_BIN)/.config),)
+$(error Cannot find .config in $(RTE_SDK))
+endif
 
 #
 # Output files wil go in a separate directory: default output is
mk/rte.sdkinstall.mk +46 -13

74 lines not on this page · raw message

mk/rte.vars.mk +2 -8
index f87cf4b..7e7ee14 100644
@@ -61,18 +61,12 @@ ifneq ($(BUILDING_RTE_SDK),)
   RTE_MACHINE := $(CONFIG_RTE_MACHINE:"%"=%)
   RTE_EXEC_ENV := $(CONFIG_RTE_EXEC_ENV:"%"=%)
   RTE_TOOLCHAIN := $(CONFIG_RTE_TOOLCHAIN:"%"=%)
-  RTE_TARGET := $(RTE_ARCH)-$(RTE_MACHINE)-$(RTE_EXEC_ENV)-$(RTE_TOOLCHAIN)
   RTE_SDK_BIN := $(RTE_OUTPUT)
 endif
 
-RTE_LIBNAME := dpdk
+RTE_TARGET ?= $(RTE_ARCH)-$(RTE_MACHINE)-$(RTE_EXEC_ENV)-$(RTE_TOOLCHAIN)
 
-# RTE_TARGET is deducted from config when we are building the SDK.
-# Else, when building an external app, RTE_TARGET must be specified
-# by the user.
-ifeq ($(RTE_TARGET),)
-$(error RTE_TARGET is not defined)
-endif
+RTE_LIBNAME := dpdk
 
 ifeq ($(BUILDING_RTE_SDK),)
 # if we are building an external app/lib, include internal/rte.extvars.mk that will
Signature · 1 line
2.5.2
#52 lore raw

PATCH v3 5/13 mk: introduce new install syntax

In reply to Thomas Monjalon

The old install command was:
make install T=x86_64-native-linuxapp-gcc DESTDIR=install
It still works and can be replaced by these more standard commands:

	make config T=x86_64-native-linuxapp-gcc 0=x86_64-native-linuxapp-gcc
	make O=x86_64-native-linuxapp-gcc
	make install O=x86_64-native-linuxapp-gcc prefix= DESTDIR=install

It means the "make install" do not perform any compilation anymore when T is not used. It is done only in pre_install to keep compatibility with the old syntax based on T= option.

The default prefix /usr/local is empty in the T= case which is used only for a local install.

---
 doc/build-sdk-quick.txt                          |  7 ++++---
 doc/guides/prog_guide/dev_kit_root_make_help.rst |  4 +---
 mk/rte.sdkinstall.mk                             | 12 ++++++++++++
 3 files changed, 17 insertions(+), 6 deletions(-)
doc/build-sdk-quick.txt +4 -3
index 662ef63..acd1bfe 100644
@@ -5,7 +5,8 @@ Build commands
 	all              same as build (default rule)
 	build            build in a configured directory
 	clean            remove files but keep configuration
-	install          configure, build and install a target in DESTDIR
+	install T=       configure, build and install a target in DESTDIR
+	install          install optionally staged in DESTDIR
 	examples         build examples for given targets (T=)
 	examples_clean   clean examples for given targets (T=)
 Build variables
@@ -17,8 +18,8 @@ Build variables
 	CROSS     toolchain prefix
 	V         verbose
 	D         debug dependencies
-	O         build directory (default: build/ - install default: ./)
-	DESTDIR   second-stage install directory
+	O         build directory (default: build/ - install T= default: ./)
+	DESTDIR   staging install directory
 	prefix    root install directory
 	T         target template - used with config or install
 			format: <arch-machine-execenv-toolchain>
doc/guides/prog_guide/dev_kit_root_make_help.rst +1 -3
index b0429d8..fb3520e 100644
@@ -107,8 +107,6 @@ Install Targets
 
 *   Install
 
-    Build the DPDK binary.
-    The name of the target to install is specified using T=mytarget.
     The list of available targets are in $(RTE_SDK)/config (remove the defconfig\_ prefix).
 
     The GNU standards variables may be used:
@@ -119,7 +117,7 @@ Install Targets
 
     .. code-block:: console
 
-        make install T=x86_64-native-linuxapp-gcc prefix=/usr
+        make install DESTDIR=myinstall prefix=/usr
 
 Test Targets
 ------------
mk/rte.sdkinstall.mk +12 -0
index 3201b5b..dc57baf 100644
@@ -33,11 +33,21 @@
 # Configuration, compilation and installation can be done at once
 # with make install T=<config>
 
+ifdef T # config, build and install combined
 # The build directory is T and may be prepended with O
 O ?= .
 RTE_OUTPUT := $O/$T
+else # standard install
+# Build directory is given with O=
+O ?= build
+RTE_OUTPUT := $O
+endif
 
+ifdef T # defaults with T= will install an almost flat staging tree
+export prefix ?=
+else
 prefix      ?=     /usr/local
+endif
 exec_prefix ?=      $(prefix)
 bindir      ?= $(exec_prefix)/bin
 libdir      ?= $(exec_prefix)/lib
@@ -58,6 +68,7 @@ rte_symlink = ln -snf $$($(RTE_SDK)/scripts/relpath.sh $1 $(dir $2)) $2
 
 .PHONY: pre_install
 pre_install:
+ifdef T
 	$(Q)if [ ! -f $(RTE_OUTPUT)/.config ]; then \
 		$(MAKE) config O=$(RTE_OUTPUT); \
 	elif cmp -s $(RTE_OUTPUT)/.config.orig $(RTE_OUTPUT)/.config; then \
@@ -74,6 +85,7 @@ pre_install:
 		echo "Using local configuration"; \
 	fi
 	$(Q)$(MAKE) all O=$(RTE_OUTPUT)
+endif
 
 .PHONY: install
 install:
Signature · 1 line
2.5.2
#53 lore raw

PATCH v3 6/13 mk: split install rule

In reply to Thomas Monjalon

Provides new sub-rules to install runtime and sdk separately.

The build directory must be changed from BUILD_DIR to O in install rules to avoid a bad recursive effect (O being BUILD_DIR being O + T).

---
 mk/rte.sdkinstall.mk | 18 ++++++++++++------
 mk/rte.sdkroot.mk    |  2 ++
 2 files changed, 14 insertions(+), 6 deletions(-)
mk/rte.sdkinstall.mk +12 -6
index dc57baf..ec093d3 100644
@@ -93,25 +93,31 @@ ifeq ($(DESTDIR)$(if $T,,+),)
 	@echo Installation cannot run with T defined and DESTDIR undefined
 else
 	@echo ================== Installing $(DESTDIR)$(prefix)/
+	$(Q)$(MAKE) O=$(RTE_OUTPUT) T= install-runtime
+	$(Q)$(MAKE) O=$(RTE_OUTPUT) T= install-sdk
+	@echo Installation in $(DESTDIR)$(prefix)/ complete
+endif
+
+install-runtime:
 	$(Q)$(call rte_mkdir, $(DESTDIR)$(libdir))
-	$(Q)cp -a $(RTE_OUTPUT)/lib/* $(DESTDIR)$(libdir)
+	$(Q)cp -a    $O/lib/* $(DESTDIR)$(libdir)
 	$(Q)$(call rte_mkdir, $(DESTDIR)$(bindir))
-	$(Q)tar -cf -      -C $(RTE_OUTPUT) app  --exclude 'app/*.map' \
+	$(Q)tar -cf -      -C $O app  --exclude 'app/*.map' \
 		--exclude 'app/cmdline*' --exclude app/test \
 		--exclude app/testacl --exclude app/testpipeline | \
 	    tar -xf -      -C $(DESTDIR)$(bindir) --strip-components=1 \
 		--keep-newer-files --warning=no-ignore-newer
 	$(Q)$(call rte_mkdir,      $(DESTDIR)$(datadir))
 	$(Q)cp -a $(RTE_SDK)/tools $(DESTDIR)$(datadir)
+
+install-sdk:
 	$(Q)$(call rte_mkdir, $(DESTDIR)$(includedir))
-	$(Q)tar -chf -     -C $(RTE_OUTPUT) include | \
+	$(Q)tar -chf -     -C $O include | \
 	    tar -xf -      -C $(DESTDIR)$(includedir) --strip-components=1 \
 		--keep-newer-files --warning=no-ignore-newer
 	$(Q)$(call rte_mkdir,                            $(DESTDIR)$(sdkdir))
 	$(Q)cp -a               $(RTE_SDK)/{mk,scripts}  $(DESTDIR)$(sdkdir)
 	$(Q)$(call rte_mkdir,                            $(DESTDIR)$(targetdir))
-	$(Q)cp -a               $(RTE_OUTPUT)/.config    $(DESTDIR)$(targetdir)
+	$(Q)cp -a               $O/.config               $(DESTDIR)$(targetdir)
 	$(Q)$(call rte_symlink, $(DESTDIR)$(includedir), $(DESTDIR)$(targetdir)/include)
 	$(Q)$(call rte_symlink, $(DESTDIR)$(libdir),     $(DESTDIR)$(targetdir)/lib)
-	@echo Installation in $(DESTDIR)$(prefix)/ complete
-endif
mk/rte.sdkroot.mk +2 -0
index 533afe9..2424dce 100644
@@ -97,6 +97,8 @@ test fast_test ring_test mempool_test perf_test coverage:
 install:
 	$(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdkinstall.mk pre_install
 	$(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdkinstall.mk $@
+install-%:
+	$(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdkinstall.mk $@
 
 .PHONY: doc help
 doc: doc-all
Signature · 1 line
2.5.2
#56 lore raw

PATCH v3 7/13 mk: install kernel modules

In reply to Thomas Monjalon

Add kernel modules to "make install".
Nothing is done if there is no kernel module compiled.

When using "make install T=", the default path is the same as before.

The Linux path is based on host kernel version.

---
 mk/rte.sdkinstall.mk | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
mk/rte.sdkinstall.mk +17 -0
index ec093d3..30dea0f 100644
@@ -43,9 +43,19 @@ O ?= build
 RTE_OUTPUT := $O
 endif
 
+ifneq ($(MAKECMDGOALS),pre_install)
+include $(RTE_SDK)/mk/rte.vars.mk
+endif
+
 ifdef T # defaults with T= will install an almost flat staging tree
 export prefix ?=
+kerneldir   ?= $(prefix)/kmod
+else
+ifeq ($(RTE_EXEC_ENV),linuxapp)
+kerneldir   ?= /lib/modules/$(shell uname -r)/extra/dpdk
 else
+kerneldir   ?= /boot/modules
+endif
 prefix      ?=     /usr/local
 endif
 exec_prefix ?=      $(prefix)
@@ -94,6 +104,7 @@ ifeq ($(DESTDIR)$(if $T,,+),)
 else
 	@echo ================== Installing $(DESTDIR)$(prefix)/
 	$(Q)$(MAKE) O=$(RTE_OUTPUT) T= install-runtime
+	$(Q)$(MAKE) O=$(RTE_OUTPUT) T= install-kmod
 	$(Q)$(MAKE) O=$(RTE_OUTPUT) T= install-sdk
 	@echo Installation in $(DESTDIR)$(prefix)/ complete
 endif
@@ -110,6 +121,12 @@ install-runtime:
 	$(Q)$(call rte_mkdir,      $(DESTDIR)$(datadir))
 	$(Q)cp -a $(RTE_SDK)/tools $(DESTDIR)$(datadir)
 
+install-kmod:
+ifneq ($(wildcard $O/kmod/*),)
+	$(Q)$(call rte_mkdir, $(DESTDIR)$(kerneldir))
+	$(Q)cp -a   $O/kmod/* $(DESTDIR)$(kerneldir)
+endif
+
 install-sdk:
 	$(Q)$(call rte_mkdir, $(DESTDIR)$(includedir))
 	$(Q)tar -chf -     -C $O include | \
Signature · 1 line
2.5.2
#57 lore raw

PATCH v3 8/13 mk: install binding tool in sbin directory

In reply to Thomas Monjalon

sbin/dpdk_nic_bind is a symbolic link to tools/dpdk_nic_bind.py where some python objects may be generated.

---
 mk/rte.sdkinstall.mk | 4 ++++
 1 file changed, 4 insertions(+)
mk/rte.sdkinstall.mk +4 -0
index 30dea0f..0667b70 100644
@@ -60,6 +60,7 @@ prefix      ?=     /usr/local
 endif
 exec_prefix ?=      $(prefix)
 bindir      ?= $(exec_prefix)/bin
+sbindir     ?= $(exec_prefix)/sbin
 libdir      ?= $(exec_prefix)/lib
 includedir  ?=      $(prefix)/include/dpdk
 datarootdir ?=      $(prefix)/share
@@ -120,6 +121,9 @@ install-runtime:
 		--keep-newer-files --warning=no-ignore-newer
 	$(Q)$(call rte_mkdir,      $(DESTDIR)$(datadir))
 	$(Q)cp -a $(RTE_SDK)/tools $(DESTDIR)$(datadir)
+	$(Q)$(call rte_mkdir,      $(DESTDIR)$(sbindir))
+	$(Q)$(call rte_symlink,    $(DESTDIR)$(datadir)/tools/dpdk_nic_bind.py, \
+	                           $(DESTDIR)$(sbindir)/dpdk_nic_bind)
 
 install-kmod:
 ifneq ($(wildcard $O/kmod/*),)
Signature · 1 line
2.5.2
#58 lore raw

PATCH v3 9/13 mk: install doc

In reply to Thomas Monjalon

The HTML API and HTML/PDF guides may be installed if generated.

---
 mk/rte.sdkinstall.mk | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
mk/rte.sdkinstall.mk +14 -0
index 0667b70..ce077a4 100644
@@ -64,6 +64,7 @@ sbindir     ?= $(exec_prefix)/sbin
 libdir      ?= $(exec_prefix)/lib
 includedir  ?=      $(prefix)/include/dpdk
 datarootdir ?=      $(prefix)/share
+docdir      ?=       $(datarootdir)/doc/dpdk
 datadir     ?=       $(datarootdir)/dpdk
 sdkdir      ?=                $(datadir)
 targetdir   ?=                $(datadir)/$(RTE_TARGET)
@@ -107,6 +108,7 @@ else
 	$(Q)$(MAKE) O=$(RTE_OUTPUT) T= install-runtime
 	$(Q)$(MAKE) O=$(RTE_OUTPUT) T= install-kmod
 	$(Q)$(MAKE) O=$(RTE_OUTPUT) T= install-sdk
+	$(Q)$(MAKE) O=$(RTE_OUTPUT) T= install-doc
 	@echo Installation in $(DESTDIR)$(prefix)/ complete
 endif
 
@@ -142,3 +144,15 @@ install-sdk:
 	$(Q)cp -a               $O/.config               $(DESTDIR)$(targetdir)
 	$(Q)$(call rte_symlink, $(DESTDIR)$(includedir), $(DESTDIR)$(targetdir)/include)
 	$(Q)$(call rte_symlink, $(DESTDIR)$(libdir),     $(DESTDIR)$(targetdir)/lib)
+
+install-doc:
+ifneq ($(wildcard $O/doc),)
+	$(Q)$(call rte_mkdir, $(DESTDIR)$(docdir))
+	$(Q)tar -cf -      -C $O/doc html --exclude 'html/guides/.*' | \
+	    tar -xf -      -C $(DESTDIR)$(docdir) --strip-components=1 \
+		--keep-newer-files --warning=no-ignore-newer
+endif
+ifneq ($(wildcard $O/doc/*/*/*pdf),)
+	$(Q)$(call rte_mkdir,     $(DESTDIR)$(docdir)/guides)
+	$(Q)cp -a $O/doc/*/*/*pdf $(DESTDIR)$(docdir)/guides
+endif
Signature · 1 line
2.5.2
#59 lore raw

PATCH v3 10/13 mk: install examples

In reply to Thomas Monjalon

The examples are part of the installed documentation.

---
 mk/rte.sdkinstall.mk | 1 +
 1 file changed, 1 insertion(+)
mk/rte.sdkinstall.mk +1 -0
index ce077a4..c611d45 100644
@@ -156,3 +156,4 @@ ifneq ($(wildcard $O/doc/*/*/*pdf),)
 	$(Q)$(call rte_mkdir,     $(DESTDIR)$(docdir)/guides)
 	$(Q)cp -a $O/doc/*/*/*pdf $(DESTDIR)$(docdir)/guides
 endif
+	$(Q)cp -a $(RTE_SDK)/examples $(DESTDIR)$(datadir)
Signature · 1 line
2.5.2
#60 lore raw

PATCH v3 11/13 app/proc_info: rename binary with prefix

In reply to Thomas Monjalon

In order to be installed system-wise, this application needs a prefix. So it makes clear that it is DPDK related.

---
 app/proc_info/Makefile                 | 2 +-
 doc/guides/sample_app_ug/proc_info.rst | 8 ++++----
 mk/rte.sdktest.mk                      | 4 ++--
 3 files changed, 7 insertions(+), 7 deletions(-)
app/proc_info/Makefile +1 -1
index 243b060..33e058e 100644
@@ -31,7 +31,7 @@
 
 include $(RTE_SDK)/mk/rte.vars.mk
 
-APP = proc_info
+APP = dpdk_proc_info
 
 CFLAGS += $(WERROR_FLAGS)
 
doc/guides/sample_app_ug/proc_info.rst +4 -4
index a0c0b06..542950b 100644
@@ -30,10 +30,10 @@
     OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 
-proc_info Application
-========================
+dpdk_proc_info Application
+==========================
 
-The proc_info application is a Data Plane Development Kit (DPDK) application
+The dpdk_proc_info application is a Data Plane Development Kit (DPDK) application
 that runs as a DPDK secondary process and is capable of retrieving port
 statistics, resetting port statistics and printing DPDK memory information.
 This application extends the original functionality that was supported by
@@ -45,7 +45,7 @@ The application has a number of command line options:
 
 .. code-block:: console
 
-   ./$(RTE_TARGET)/app/proc_info -- -m | [-p PORTMASK] [--stats | --xstats |
+   ./$(RTE_TARGET)/app/dpdk_proc_info -- -m | [-p PORTMASK] [--stats | --xstats |
    --stats-reset | --xstats-reset]
 
 Parameters
mk/rte.sdktest.mk +2 -2
index 59a29de..ee25f28 100644
@@ -66,7 +66,7 @@ test fast_test ring_test mempool_test perf_test:
 	fi
 
 # this is a special target to ease the pain of running coverage tests
-# this runs all the autotests, cmdline_test script and proc_info
+# this runs all the autotests, cmdline_test script and dpdk_proc_info
 coverage:
 	@mkdir -p $(AUTOTEST_DIR) ; \
 	cd $(AUTOTEST_DIR) ; \
@@ -78,7 +78,7 @@ coverage:
 			$(RTE_OUTPUT)/app/test \
 			$(RTE_TARGET) \
 			$(BLACKLIST) $(WHITELIST) ; \
-		$(RTE_OUTPUT)/app/proc_info --file-prefix=ring_perf -- -m; \
+		$(RTE_OUTPUT)/app/dpdk_proc_info --file-prefix=ring_perf -- -m; \
 	else \
 		echo "No test found, please do a 'make build' first, or specify O=" ;\
 	fi
Signature · 1 line
2.5.2
#61 lore raw

PATCH v3 12/13 pkg: update RPM with standard install

In reply to Thomas Monjalon

The "make install" is more standard now.
So the recipe can be simplified.

---
 pkg/dpdk.spec | 59 ++++++++++++++++-------------------------------------------
 1 file changed, 16 insertions(+), 43 deletions(-)
pkg/dpdk.spec +16 -43
index 7437025..e68985f 100644
@@ -41,8 +41,9 @@ Group: System Environment/Libraries
 License: BSD and LGPLv2 and GPLv2
 
 ExclusiveArch: i686, x86_64
-%global target %{_arch}-native-linuxapp-gcc
 %global machine default
+%global target %{_arch}-%{machine}-linuxapp-gcc
+%global config %{_arch}-native-linuxapp-gcc
 
 BuildRequires: kernel-devel, kernel-headers, libpcap-devel, xen-devel
 BuildRequires: doxygen, python-sphinx, inkscape
@@ -69,16 +70,11 @@ BuildArch: noarch
 DPDK doc is divided in two parts: API details in doxygen HTML format
 and guides in sphinx HTML/PDF formats.
 
-%global destdir %{buildroot}%{_prefix}
-%global moddir  /lib/modules/%(uname -r)/extra
-%global datadir %{_datadir}/dpdk
-%global docdir  %{_docdir}/dpdk
-
 %prep
 %setup -q
 
 %build
-make O=%{target} T=%{target} config
+make O=%{target} T=%{config} config
 sed -ri 's,(RTE_MACHINE=).*,\1%{machine},' %{target}/.config
 sed -ri 's,(RTE_APP_TEST=).*,\1n,'         %{target}/.config
 sed -ri 's,(RTE_BUILD_SHARED_LIB=).*,\1y,' %{target}/.config
@@ -93,51 +89,28 @@ make O=%{target} doc
 
 %install
 rm -rf %{buildroot}
-make            O=%{target}      DESTDIR=%{destdir}
-mkdir -p                                 %{buildroot}%{moddir}
-mv     %{destdir}/%{target}/kmod/*.ko    %{buildroot}%{moddir}
-rmdir  %{destdir}/%{target}/kmod
-mkdir -p                                 %{buildroot}%{_sbindir}
-ln -s  %{datadir}/tools/*nic_bind.py     %{buildroot}%{_sbindir}/dpdk_nic_bind
-mkdir -p                                 %{buildroot}%{_bindir}
-mv     %{destdir}/%{target}/app/testpmd  %{buildroot}%{_bindir}
-rmdir  %{destdir}/%{target}/app
-mv     %{destdir}/%{target}/include      %{buildroot}%{_includedir}
-mv     %{destdir}/%{target}/lib          %{buildroot}%{_libdir}
-mkdir -p                                 %{buildroot}%{docdir}
-rm -rf %{destdir}/%{target}/doc/*/*/.{build,doc}*
-mv     %{destdir}/%{target}/doc/html/*   %{buildroot}%{docdir}
-mv     %{destdir}/%{target}/doc/*/*/*pdf %{buildroot}%{docdir}/guides
-rm -rf %{destdir}/%{target}/doc
-mkdir -p                                 %{buildroot}%{datadir}
-mv     %{destdir}/%{target}/.config      %{buildroot}%{datadir}/config
-mv     %{destdir}/%{target}              %{buildroot}%{datadir}
-mv     %{destdir}/scripts                %{buildroot}%{datadir}
-mv     %{destdir}/mk                     %{buildroot}%{datadir}
-cp -a             examples               %{buildroot}%{datadir}
-cp -a             tools                  %{buildroot}%{datadir}
-ln -s             %{datadir}/config      %{buildroot}%{datadir}/%{target}/.config
-ln -s             %{_includedir}         %{buildroot}%{datadir}/%{target}/include
-ln -s             %{_libdir}             %{buildroot}%{datadir}/%{target}/lib
+make install O=%{target} DESTDIR=%{buildroot} \
+	prefix=%{_prefix} bindir=%{_bindir} sbindir=%{_sbindir} \
+	includedir=%{_includedir}/dpdk libdir=%{_libdir} \
+	datadir=%{_datadir}/dpdk docdir=%{_docdir}/dpdk
 
 %files
-%dir %{datadir}
-%{datadir}/config
-%{datadir}/tools
-%{moddir}/*
+%dir %{_datadir}/dpdk
+%{_datadir}/dpdk/tools
+/lib/modules/%(uname -r)/extra/*
 %{_sbindir}/*
 %{_bindir}/*
 %{_libdir}/*
 
 %files devel
-%{_includedir}/*
-%{datadir}/mk
-%{datadir}/scripts
-%{datadir}/%{target}
-%{datadir}/examples
+%{_includedir}/dpdk
+%{_datadir}/dpdk/mk
+%{_datadir}/dpdk/scripts
+%{_datadir}/dpdk/%{target}
+%{_datadir}/dpdk/examples
 
 %files doc
-%doc %{docdir}
+%doc %{_docdir}/dpdk
 
 %post
 /sbin/ldconfig
Signature · 1 line
2.5.2
#62 lore raw

PATCH v3 13/13 maintainers: take responsibility for build system

In reply to Thomas Monjalon
---
 MAINTAINERS | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
MAINTAINERS +1 -1
index 460245b..eb7df3e 100644
@@ -44,7 +44,7 @@ F: doc/
 
 Build System
 ------------
-M: Olivier Matz <[email protected]>
+M: Thomas Monjalon <[email protected]>
 F: GNUmakefile
 F: Makefile
 F: config/
Signature · 1 line
2.5.2
#64 lore raw
In reply to Thomas Monjalon
Quoted 94 lines · Thomas Monjalon

Following the recent discussions, this is a proposal to have a standard installation process while keeping compatibility with most of the old behaviours.

v2 changes:
- fix default build dir
- RTE_TARGET subdir in $(sdkdir).
- better kerneldir defaults
- fix dpdk_nic_bind symlink
- always install doc if generated
- doc
- pkg/dpdk.spec

v3 changes:
- fix install in a clean dir
- take responsibility in MAINTAINERS

More details below and in the commit messages.

These variables can be overriden:

kerneldir ?= /lib/modules/$(shell uname -r)/extra/dpdk
prefix ?= /usr/local
exec_prefix ?= $(prefix)

bindir      ?= $(exec_prefix)/bin
sbindir     ?= $(exec_prefix)/sbin
libdir      ?= $(exec_prefix)/lib
includedir  ?=      $(prefix)/include/dpdk
datarootdir ?=      $(prefix)/share
docdir      ?=       $(datarootdir)/doc/dpdk
datadir     ?=       $(datarootdir)/dpdk
sdkdir      ?=                $(datadir)
targetdir   ?=                $(datadir)/$(RTE_TARGET)

All paths are prefixed with $(DESTDIR)

One rule install = install-runtime install-kmod install-sdk install-doc

--------

System-wise install example with
DESTDIR=
prefix=/usr
kerneldir=/lib/modules/kver/extra

# make install-runtime
/usr/bin/testpmd
/usr/lib/libethdev*
/usr/lib/librte_*
/usr/sbin/dpdk_nic_bind -> /usr/share/dpdk/tools/dpdk_nic_bind.py
/usr/share/dpdk/tools/
# make install-kmod
/lib/modules/kver/extra/
# make install-sdk
/usr/include/dpdk/
/usr/share/dpdk/mk/
/usr/share/dpdk/scripts/
/usr/share/dpdk/x86_64-default-linuxapp-gcc/.config
/usr/share/dpdk/x86_64-default-linuxapp-gcc/include -> /usr/include/dpdk/
/usr/share/dpdk/x86_64-default-linuxapp-gcc/lib     -> /usr/lib/
# make install-doc
/usr/share/doc/dpdk/api/
/usr/share/doc/dpdk/guides/
/usr/share/dpdk/examples/

--------

Local install example with old (compatible) command:

# make install T=x86_64-native-linuxapp-gcc DESTDIR=install

would be equivalent to:

# make config T=x86_64-native-linuxapp-gcc 0=x86_64-native-linuxapp-gcc
# make O=x86_64-native-linuxapp-gcc
# make install O=x86_64-native-linuxapp-gcc prefix= DESTDIR=install

install/bin/testpmd
install/include/dpdk/
install/kmod/
install/lib/
install/sbin/dpdk_nic_bind -> ../share/dpdk/tools/dpdk_nic_bind.py install/share/doc/dpdk/
install/share/dpdk/examples/
install/share/dpdk/mk/
install/share/dpdk/scripts/
install/share/dpdk/tools/ install/share/dpdk/x86_64-native-linuxapp-gcc/.config install/share/dpdk/x86_64-native-linuxapp-gcc/include -> install/include/dpdk/
install/share/dpdk/x86_64-native-linuxapp-gcc/lib -> install/lib/

Quoted 8 lines

It should be usable to build some applications as before:

# make -C examples/helloworld RTE_SDK=$(readlink -m install) RTE_TARGET=x86_64-native-linuxapp-gcc

The RTE_SDK directory must point to install/share/dpdk with a default install.

--------

While I have no huge objections to this patchset, I don't like the fact that install does completely different things depending upon whether certain variables are defined or not. I believe the "old" default behaviour for install was poorly named, and while it's behaviour should be kept, a new name should be given to it to avoid having the target "install" so heavily overloaded.

/Bruce

#46 lore raw
In reply to Thomas Monjalon

Hi Thomas,

In general looks good :), I'm going to test this serie and sounds good the feedback from other developers, maybe I'm going to send a version number 9 in order to get a good way together :)

Thanks :)
Mario.
________________________________________
From: Thomas Monjalon [[email protected]]
Sent: Thursday, December 03, 2015 5:34 AM
To: Panu Matilainen; Arevalo, Mario Alfredo C
Cc: [email protected]; [email protected]; Richardson, Bruce
Subject: Re: [PATCH v2 00/12] standard make install

2015-12-03 15:26, Panu Matilainen:

Quoted 15 lines · Thomas Monjalon
Quoted 4 lines

Following the recent discussions, this is a proposal to have a standard installation process while keeping compatibility with most of the old behaviours.

Quoted 9 lines

v2 changes:
- fix default build dir
- RTE_TARGET subdir in $(sdkdir).
- better kerneldir defaults
- fix dpdk_nic_bind symlink
- always install doc if generated
- doc
- pkg/dpdk.spec

Quoted 6 lines

Except for the minor nit about examples location (one could bikeshed on things like these forever), seems fine to me and quick-n-dirty conversion of my own spec didn't reveal any nasty surprises.

It also appears more comprehensive and integrated with other workflows than the competing patches so FWIW, you have my ACK :)

Thank you.
I'm going to send a v3.
Mario, what is your opinion about this series?

#65 lore raw
In reply to Bruce Richardson

2015-12-03 15:31, Bruce Richardson:

Quoted 4 lines · Thomas Monjalon
Quoted 3 lines

Following the recent discussions, this is a proposal to have a standard installation process while keeping compatibility with most of the old behaviours.

[...]

Quoted 10 lines
Quoted 9 lines

Local install example with old (compatible) command:

# make install T=x86_64-native-linuxapp-gcc DESTDIR=install

would be equivalent to:

# make config T=x86_64-native-linuxapp-gcc 0=x86_64-native-linuxapp-gcc
# make O=x86_64-native-linuxapp-gcc
# make install O=x86_64-native-linuxapp-gcc prefix= DESTDIR=install
Quoted 5 lines

While I have no huge objections to this patchset, I don't like the fact that install does completely different things depending upon whether certain variables are defined or not. I believe the "old" default behaviour for install was poorly named, and while it's behaviour should be kept, a new name should be given to it to avoid having the target "install" so heavily overloaded.

Yes.
It is a first step to fix a common complain.
The we can remove the T= syntax or move the "all-in-one feature" to another command name. I suggest "make config-build-install" :)

Acked-by on v3 13/13
#63 lore raw

Re: [PATCH v3 13/13] maintainers: take responsibility for build system

In reply to Thomas Monjalon

Hi Thomas,

Quoted 11 lines · Thomas Monjalon
---
 MAINTAINERS | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
MAINTAINERS +0 -0
index 460245b..eb7df3e 100644

MAINTAINERS F: doc/ · line 50

Quoted 8 lines
MAINTAINERS +1 -1
@@ -44,7 +44,7 @@ F: doc/
 
 Build System
 ------------
-M: Olivier Matz <[email protected]>
+M: Thomas Monjalon <[email protected]>
 F: GNUmakefile
 F: Makefile
 F: config/

Thank you Thomas for you hard work on this, and sorry for not being very present recently.

Olivier

author Applied
#66 lore raw
In reply to Thomas Monjalon

2015-12-03 14:45, Thomas Monjalon:

Quoted 3 lines

Following the recent discussions, this is a proposal to have a standard installation process while keeping compatibility with most of the old behaviours.

[...]

Quoted 6 lines

Thomas Monjalon (13):
mk: remove testall
mk: remove multi-target install
mk: move installation procedure in install rule
mk: install a standard cutomizable tree
mk: introduce new install syntax

Quoted 8 lines

mk: split install rule
mk: install kernel modules
mk: install binding tool in sbin directory
mk: install doc
mk: install examples
app/proc_info: rename binary with prefix
pkg: update RPM with standard install
maintainers: take responsibility for build system

Applied

Acked-by Panu Matilainen on v3 6/13
#54 lore raw

Re: [PATCH v3 06/13] mk: split install rule

In reply to Thomas Monjalon

Hi Thomas,

I'm testing this set of patches that has been applied, and I haven't noticed before that you exclude some binaries in "install-runtime" (test, testpipeline, testacl etc...), I would like to ask you the reason about this :)

Thanks.
Mario.
________________________________________
From: Thomas Monjalon [[email protected]]
Sent: Thursday, December 03, 2015 5:45 AM
To: [email protected]
Cc: [email protected]; Arevalo, Mario Alfredo C; Richardson, Bruce; Panu Matilainen
Subject: [PATCH v3 06/13] mk: split install rule

Provides new sub-rules to install runtime and sdk separately.

The build directory must be changed from BUILD_DIR to O in install rules to avoid a bad recursive effect (O being BUILD_DIR being O + T).

---
 mk/rte.sdkinstall.mk | 18 ++++++++++++------
 mk/rte.sdkroot.mk    |  2 ++
 2 files changed, 14 insertions(+), 6 deletions(-)
mk/rte.sdkinstall.mk +12 -6
index dc57baf..ec093d3 100644
@@ -93,25 +93,31 @@ ifeq ($(DESTDIR)$(if $T,,+),)
        @echo Installation cannot run with T defined and DESTDIR undefined
 else
        @echo ================== Installing $(DESTDIR)$(prefix)/
+       $(Q)$(MAKE) O=$(RTE_OUTPUT) T= install-runtime
+       $(Q)$(MAKE) O=$(RTE_OUTPUT) T= install-sdk
+       @echo Installation in $(DESTDIR)$(prefix)/ complete
+endif
+
+install-runtime:
        $(Q)$(call rte_mkdir, $(DESTDIR)$(libdir))
-       $(Q)cp -a $(RTE_OUTPUT)/lib/* $(DESTDIR)$(libdir)
+       $(Q)cp -a    $O/lib/* $(DESTDIR)$(libdir)
        $(Q)$(call rte_mkdir, $(DESTDIR)$(bindir))
-       $(Q)tar -cf -      -C $(RTE_OUTPUT) app  --exclude 'app/*.map' \
+       $(Q)tar -cf -      -C $O app  --exclude 'app/*.map' \
                --exclude 'app/cmdline*' --exclude app/test \
                --exclude app/testacl --exclude app/testpipeline | \
            tar -xf -      -C $(DESTDIR)$(bindir) --strip-components=1 \
                --keep-newer-files --warning=no-ignore-newer
        $(Q)$(call rte_mkdir,      $(DESTDIR)$(datadir))
        $(Q)cp -a $(RTE_SDK)/tools $(DESTDIR)$(datadir)
+
+install-sdk:
        $(Q)$(call rte_mkdir, $(DESTDIR)$(includedir))
-       $(Q)tar -chf -     -C $(RTE_OUTPUT) include | \
+       $(Q)tar -chf -     -C $O include | \
            tar -xf -      -C $(DESTDIR)$(includedir) --strip-components=1 \
                --keep-newer-files --warning=no-ignore-newer
        $(Q)$(call rte_mkdir,                            $(DESTDIR)$(sdkdir))
        $(Q)cp -a               $(RTE_SDK)/{mk,scripts}  $(DESTDIR)$(sdkdir)
        $(Q)$(call rte_mkdir,                            $(DESTDIR)$(targetdir))
-       $(Q)cp -a               $(RTE_OUTPUT)/.config    $(DESTDIR)$(targetdir)
+       $(Q)cp -a               $O/.config               $(DESTDIR)$(targetdir)
        $(Q)$(call rte_symlink, $(DESTDIR)$(includedir), $(DESTDIR)$(targetdir)/include)
        $(Q)$(call rte_symlink, $(DESTDIR)$(libdir),     $(DESTDIR)$(targetdir)/lib)
-       @echo Installation in $(DESTDIR)$(prefix)/ complete
-endif
mk/rte.sdkroot.mk +2 -0
index 533afe9..2424dce 100644
@@ -97,6 +97,8 @@ test fast_test ring_test mempool_test perf_test coverage:
 install:
        $(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdkinstall.mk pre_install
        $(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdkinstall.mk $@
+install-%:
+       $(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdkinstall.mk $@
 
 .PHONY: doc help
 doc: doc-all

--
2.5.2

#55 lore raw

Re: [PATCH v3 06/13] mk: split install rule

Hi,

2015-12-07 23:22, Arevalo, Mario Alfredo C:

Quoted 5 lines

Hi Thomas,

I'm testing this set of patches that has been applied, and I haven't noticed before that you exclude some binaries in "install-runtime" (test, testpipeline, testacl etc...), I would like to ask you the reason about this :)

The test apps are used in the development/validation cycle. They have no interest in a deployment IMHO.

If you see something missing, you are welcome to fix it. Thanks