2018-02-01 17:18:17 +00:00
|
|
|
.. SPDX-License-Identifier: BSD-3-Clause
|
|
|
|
Copyright(c) 2015 Intel Corporation.
|
2017-10-25 15:50:59 +00:00
|
|
|
|
|
|
|
Compiling the Sample Applications
|
|
|
|
=================================
|
|
|
|
|
|
|
|
This section explains how to compile the DPDK sample applications.
|
|
|
|
|
|
|
|
To compile all the sample applications
|
|
|
|
--------------------------------------
|
|
|
|
|
2020-10-21 08:17:20 +00:00
|
|
|
Go to DPDK build directory:
|
2017-10-25 15:50:59 +00:00
|
|
|
|
|
|
|
.. code-block:: console
|
|
|
|
|
2020-10-21 08:17:20 +00:00
|
|
|
cd dpdk/<build_dir>
|
2017-10-25 15:50:59 +00:00
|
|
|
|
2020-10-21 08:17:20 +00:00
|
|
|
Enable examples compilation:
|
2017-10-25 15:50:59 +00:00
|
|
|
|
|
|
|
.. code-block:: console
|
|
|
|
|
2020-10-21 08:17:20 +00:00
|
|
|
meson configure -Dexamples=all
|
2017-10-25 15:50:59 +00:00
|
|
|
|
2020-10-21 08:17:20 +00:00
|
|
|
Build:
|
2017-10-25 15:50:59 +00:00
|
|
|
|
|
|
|
.. code-block:: console
|
|
|
|
|
2020-10-21 08:17:20 +00:00
|
|
|
ninja
|
2017-10-25 15:50:59 +00:00
|
|
|
|
2020-10-21 08:17:20 +00:00
|
|
|
For additional information on compiling see
|
2017-10-25 15:50:59 +00:00
|
|
|
:ref:`Compiling DPDK on Linux <linux_gsg_compiling_dpdk>` or
|
|
|
|
:ref:`Compiling DPDK on FreeBSD <building_from_source>`.
|
2020-10-21 08:17:20 +00:00
|
|
|
Applications are output to: ``dpdk/<build_dir>/examples``.
|
2017-10-25 15:50:59 +00:00
|
|
|
|
|
|
|
|
2020-10-21 08:17:20 +00:00
|
|
|
To compile a single application
|
|
|
|
-------------------------------
|
2017-10-25 15:50:59 +00:00
|
|
|
|
|
|
|
|
2020-10-21 08:17:20 +00:00
|
|
|
Using meson
|
|
|
|
~~~~~~~~~~~
|
2017-10-25 15:50:59 +00:00
|
|
|
|
2020-10-21 08:17:20 +00:00
|
|
|
Go to DPDK build directory:
|
2017-10-25 15:50:59 +00:00
|
|
|
|
|
|
|
.. code-block:: console
|
|
|
|
|
2020-10-21 08:17:20 +00:00
|
|
|
cd dpdk/<build_dir>
|
2017-10-25 15:50:59 +00:00
|
|
|
|
2020-10-21 08:17:20 +00:00
|
|
|
Enable example app compilation:
|
2017-10-25 15:50:59 +00:00
|
|
|
|
2020-10-21 08:17:20 +00:00
|
|
|
.. code-block:: console
|
2017-10-25 15:50:59 +00:00
|
|
|
|
2020-10-21 08:17:20 +00:00
|
|
|
meson configure -Dexamples=helloworld
|
2017-10-25 15:50:59 +00:00
|
|
|
|
2020-10-21 08:17:20 +00:00
|
|
|
Build:
|
2017-10-25 15:50:59 +00:00
|
|
|
|
2020-10-21 08:17:20 +00:00
|
|
|
.. code-block:: console
|
2017-10-25 15:50:59 +00:00
|
|
|
|
2020-10-21 08:17:20 +00:00
|
|
|
ninja
|
2017-10-25 15:50:59 +00:00
|
|
|
|
|
|
|
|
2020-10-21 08:17:20 +00:00
|
|
|
Using Make
|
|
|
|
~~~~~~~~~~
|
2017-10-25 15:50:59 +00:00
|
|
|
|
2020-10-21 08:17:20 +00:00
|
|
|
Pkg-config is used when building an example app standalone using make, please
|
|
|
|
see :ref:`building_app_using_installed_dpdk` for more information.
|
2017-10-25 15:50:59 +00:00
|
|
|
|
|
|
|
Go to the sample application directory. Unless otherwise specified the sample
|
2020-10-21 08:17:20 +00:00
|
|
|
applications are located in ``dpdk/examples/``.
|
2017-10-25 15:50:59 +00:00
|
|
|
|
|
|
|
Build the application:
|
|
|
|
|
|
|
|
.. code-block:: console
|
|
|
|
|
|
|
|
make
|
2018-09-17 02:13:23 +00:00
|
|
|
|
2020-10-21 08:17:20 +00:00
|
|
|
To build the application for debugging use the ``DEBUG`` option.
|
|
|
|
This option adds some extra flags, disables compiler optimizations and
|
|
|
|
sets verbose output.
|
2018-09-17 02:13:23 +00:00
|
|
|
|
|
|
|
.. code-block:: console
|
|
|
|
|
2020-10-21 08:17:20 +00:00
|
|
|
make DEBUG=1
|