1 .. SPDX-License-Identifier: BSD-3-Clause
2 Copyright(c) 2015 Intel Corporation.
4 Compiling the Sample Applications
5 =================================
7 This section explains how to compile the DPDK sample applications.
9 To compile all the sample applications
10 --------------------------------------
12 Set the path to DPDK source code if its not set:
14 .. code-block:: console
16 export RTE_SDK=/path/to/rte_sdk
20 .. code-block:: console
26 .. code-block:: console
31 Build the sample applications:
33 .. code-block:: console
35 export RTE_TARGET=build
38 For other possible ``RTE_TARGET`` values and additional information on
40 :ref:`Compiling DPDK on Linux <linux_gsg_compiling_dpdk>` or
41 :ref:`Compiling DPDK on FreeBSD <building_from_source>`.
42 Applications are output to: ``$RTE_SDK/examples/app-dir/build`` or
43 ``$RTE_SDK/examples/app-dir/$RTE_TARGET``.
46 In the example above the compiled application is written to the ``build`` subdirectory.
47 To have the applications written to a different location,
48 the ``O=/path/to/build/directory`` option may be specified in the make command.
50 .. code-block:: console
54 To build the applications for debugging use the ``DEBUG`` option.
55 This option adds some extra flags, disables compiler optimizations and
58 .. code-block:: console
63 To compile a single application
64 -------------------------------
66 Set the path to DPDK source code:
68 .. code-block:: console
70 export RTE_SDK=/path/to/rte_sdk
74 .. code-block:: console
80 .. code-block:: console
85 Go to the sample application directory. Unless otherwise specified the sample
86 applications are located in ``$RTE_SDK/examples/``.
89 Build the application:
91 .. code-block:: console
93 export RTE_TARGET=build
96 To cross compile the sample application(s)
97 ------------------------------------------
99 For cross compiling the sample application(s), please append 'CROSS=$(CROSS_COMPILER_PREFIX)' to the 'make' command.
100 In example of AARCH64 cross compiling:
102 .. code-block:: console
104 export RTE_TARGET=build
105 export RTE_SDK=/path/to/rte_sdk
106 make -C examples CROSS=aarch64-linux-gnu-
108 make CROSS=aarch64-linux-gnu-