X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=doc%2Fguides%2Fprog_guide%2Fdev_kit_build_system.rst;h=05358d06f88c28866955e23877deea0ae92ce7a4;hb=c830cb295411fc71c3f3d3591308d531937dd58f;hp=d5ee9943f90379c7a5e20e824637eb8dfe99073b;hpb=d737e95480f4893f47b28acd7ac935d919456682;p=dpdk.git diff --git a/doc/guides/prog_guide/dev_kit_build_system.rst b/doc/guides/prog_guide/dev_kit_build_system.rst index d5ee9943f9..05358d06f8 100644 --- a/doc/guides/prog_guide/dev_kit_build_system.rst +++ b/doc/guides/prog_guide/dev_kit_build_system.rst @@ -33,82 +33,27 @@ Development Kit Build System ============================ -The Intel® DPDK requires a build system for compilation activities and so on. -This section describes the constraints and the mechanisms used in the Intel® DPDK framework. +The DPDK requires a build system for compilation activities and so on. +This section describes the constraints and the mechanisms used in the DPDK framework. There are two use-cases for the framework: -* Compilation of the Intel® DPDK libraries and sample applications; +* Compilation of the DPDK libraries and sample applications; the framework generates specific binary libraries, include files and sample applications -* Compilation of an external application or library, using an installed binary Intel® DPDK +* Compilation of an external application or library, using an installed binary DPDK Building the Development Kit Binary ----------------------------------- -The following provides details on how to build the Intel® DPDK binary. +The following provides details on how to build the DPDK binary. Build Directory Concept ~~~~~~~~~~~~~~~~~~~~~~~ After installation, a build directory structure is created. -Each build directory contains include files, libraries, and applications: - -.. code-block:: console - - ~/DPDK$ ls - app MAINTAINERS - config Makefile - COPYRIGHT mk - doc scripts - examples lib - tools x86_64-native-linuxapp-gcc - x86_64-native-linuxapp-icc i686-native-linuxapp-gcc - i686-native-linuxapp-icc - - ... - ~/DEV/DPDK$ ls i686-native-linuxapp-gcc - - app build hostapp include kmod lib Makefile - - - ~/DEV/DPDK$ ls i686-native-linuxapp-gcc/app/ - cmdline_test dump_cfg test testpmd - cmdline_test.map dump_cfg.map test.map - testpmd.map - - - ~/DEV/DPDK$ ls i686-native-linuxapp-gcc/lib/ - - libethdev.a librte_hash.a librte_mbuf.a librte_pmd_ixgbe.a - - librte_cmdline.a librte_lpm.a librte_mempool.a librte_ring.a - - librte_eal.a librte_malloc.a librte_pmd_e1000.a librte_timer.a - - - ~/DEV/DPDK$ ls i686-native-linuxapp-gcc/include/ - arch rte_cpuflags.h rte_memcpy.h - cmdline_cirbuf.h rte_cycles.h rte_memory.h - cmdline.h rte_debug.h rte_mempool.h - cmdline_parse_etheraddr.h rte_eal.h rte_memzone.h - cmdline_parse.h rte_errno.h rte_pci_dev_ids.h - cmdline_parse_ipaddr.h rte_ethdev.h rte_pci.h - cmdline_parse_num.h rte_ether.h rte_per_lcore.h - cmdline_parse_portlist.h rte_fbk_hash.h rte_prefetch.h - cmdline_parse_string.h rte_hash_crc.h rte_random.h - cmdline_rdline.h rte_hash.h rte_ring.h - cmdline_socket.h rte_interrupts.h rte_rwlock.h - cmdline_vt100.h rte_ip.h rte_sctp.h - exec-env rte_jhash.h rte_spinlock.h - rte_alarm.h rte_launch.h rte_string_fns.h - rte_atomic.h rte_lcore.h rte_tailq.h - rte_branch_prediction.h rte_log.h rte_tcp.h - rte_byteorder.h rte_lpm.h rte_timer.h - rte_common.h rte_malloc.h rte_udp.h - rte_config.h rte_mbuf.h - +Each build directory contains include files, libraries, and applications. A build directory is specific to a configuration that includes architecture + execution environment + toolchain. It is possible to have several build directories sharing the same sources with different configurations. @@ -179,12 +124,12 @@ The content of the my_sdk_build_dir is then: Refer to :ref:`Development Kit Root Makefile Help ` -for details about make commands that can be used from the root of Intel® DPDK. +for details about make commands that can be used from the root of DPDK. Building External Applications ------------------------------ -Since Intel® DPDK is in essence a development kit, the first objective of end users will be to create an application using this SDK. +Since DPDK is in essence a development kit, the first objective of end users will be to create an application using this SDK. To compile an application, the user must set the RTE_SDK and RTE_TARGET environment variables. .. code-block:: console @@ -194,7 +139,7 @@ To compile an application, the user must set the RTE_SDK and RTE_TARGET environm cd /path/to/my_app For a new application, the user must create their own Makefile that includes some .mk files, such as -${RTE_SDK}/mk/DPDK.vars.mk, and ${RTE_SDK}/mk/ DPDK.app.mk. +${RTE_SDK}/mk/rte.vars.mk, and ${RTE_SDK}/mk/ rte.app.mk. This is described in :ref:`Building Your Own Application `. @@ -212,16 +157,16 @@ Sample applications are provided in the examples directory. Makefile Description -------------------- -General Rules For Intel® DPDK Makefiles -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +General Rules For DPDK Makefiles +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -In the Intel® DPDK, Makefiles always follow the same scheme: +In the DPDK, Makefiles always follow the same scheme: -#. Include $(RTE_SDK)/mk/DPDK.vars.mk at the beginning. +#. Include $(RTE_SDK)/mk/rte.vars.mk at the beginning. #. Define specific variables for RTE build system. -#. Include a specific $(RTE_SDK)/mk/DPDK.XYZ.mk, where XYZ can be app, lib, extapp, extlib, obj, gnuconfigure, +#. Include a specific $(RTE_SDK)/mk/rte.XYZ.mk, where XYZ can be app, lib, extapp, extlib, obj, gnuconfigure, and so on, depending on what kind of object you want to build. :ref:`See Makefile Types ` below. @@ -231,7 +176,7 @@ In the Intel® DPDK, Makefiles always follow the same scheme: .. code-block:: make - include $(RTE_SDK)/mk/DPDK.vars.mk + include $(RTE_SDK)/mk/rte.vars.mk # binary name APP = helloworld @@ -242,7 +187,7 @@ In the Intel® DPDK, Makefiles always follow the same scheme: CFLAGS += -O3 CFLAGS += $(WERROR_FLAGS) - include $(RTE_SDK)/mk/DPDK.extapp.mk + include $(RTE_SDK)/mk/rte.extapp.mk .. _Makefile_Types: @@ -264,7 +209,7 @@ These Makefiles generate a binary application. * rte.extapp.mk: External application -* rte.hostapp.mk: Host application in the development kit framework +* rte.hostapp.mk: prerequisite tool to build dpdk Library ^^^^^^^ @@ -304,12 +249,50 @@ Misc * rte.subdir.mk: Build several directories in the development kit framework. +.. _Internally_Generated_Build_Tools: + +Internally Generated Build Tools +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +``app/dpdk-pmdinfogen`` + + +``dpdk-pmdinfogen`` scans an object (.o) file for various well known symbol names. +These well known symbol names are defined by various macros and used to export +important information about hardware support and usage for pmd files. For +instance the macro: + +.. code-block:: c + + DRIVER_REGISTER_PCI(name, drv) + +Creates the following symbol: + +.. code-block:: c + + static char this_pmd_name0[] __attribute__((used)) = ""; + + +Which ``dpdk-pmdinfogen`` scans for. Using this information other relevant +bits of data can be exported from the object file and used to produce a +hardware support description, that ``dpdk-pmdinfogen`` then encodes into a +json formatted string in the following format: + +.. code-block:: c + + static char ="PMD_INFO_STRING=\"{'name' : '', ...}\""; + + +These strings can then be searched for by external tools to determine the +hardware support of a given library or application. + + .. _Useful_Variables_Provided_by_the_Build_System: Useful Variables Provided by the Build System ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -* RTE_SDK: The absolute path to the Intel® DPDK sources. +* RTE_SDK: The absolute path to the DPDK sources. When compiling the development kit, this variable is automatically set by the framework. It has to be defined by the user as an environment variable if compiling an external application. @@ -317,7 +300,7 @@ Useful Variables Provided by the Build System When compiling an external application, the variable points to the root of external application sources. * RTE_OUTPUT: The path to which output files are written. - Typically, it is $(RTE_SRCDIR)/build, but it can be overriden by the O= option in the make command line. + Typically, it is $(RTE_SRCDIR)/build, but it can be overridden by the O= option in the make command line. * RTE_TARGET: A string identifying the target for which we are building. The format is arch-machine-execenv-toolchain. @@ -343,6 +326,8 @@ Useful Variables Provided by the Build System By default, the variable is set to /lib/modules/$(shell uname -r)/build, which is correct when the target machine is also the build machine. +* RTE_DEVEL_BUILD: Stricter options (stop on warning). It defaults to y in a git tree. + Variables that Can be Set/Overridden in a Makefile Only ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -368,7 +353,7 @@ Variables that Can be Set/Overridden in a Makefile Only * SYMLINK-y-$(INSTPATH): A list of files to be installed in $(INSTPATH). The files must be available from VPATH and will be linked (symbolically) in $(RTE_OUTPUT)/$(INSTPATH). - This variable can be used in almost any Intel® DPDK Makefile. + This variable can be used in almost any DPDK Makefile. * PREBUILD: A list of prerequisite actions to be taken before building. The user should use += to append data in this variable. @@ -407,12 +392,12 @@ Variables that Can be Set/Overridden by the User in a Makefile or Command Line * LDFLAGS_my_app: Specific flags to add when linking my_app. -* NO_AUTOLIBS: If set, the libraries provided by the framework will not be included in the LDLIBS variable automatically. - * EXTRA_CFLAGS: The content of this variable is appended after CFLAGS when compiling. * EXTRA_LDFLAGS: The content of this variable is appended after LDFLAGS when linking. +* EXTRA_LDLIBS: The content of this variable is appended after LDLIBS when linking. + * EXTRA_ASFLAGS: The content of this variable is appended after ASFLAGS when assembling. * EXTRA_CPPFLAGS: The content of this variable is appended after CPPFLAGS when using a C preprocessor on assembly files.