2019-06-25 11:12:58 +00:00
|
|
|
.. SPDX-License-Identifier: BSD-3-Clause
|
|
|
|
Copyright(c) 2015 Intel Corporation.
|
2018-05-15 09:49:22 +00:00
|
|
|
|
|
|
|
Compiling the Sample Applications
|
|
|
|
=================================
|
|
|
|
|
|
|
|
This section explains how to compile the DPDK sample applications.
|
|
|
|
|
|
|
|
To compile all the sample applications
|
|
|
|
--------------------------------------
|
|
|
|
|
2021-02-05 08:48:47 +00:00
|
|
|
Go to DPDK build directory:
|
2018-05-15 09:49:22 +00:00
|
|
|
|
|
|
|
.. code-block:: console
|
|
|
|
|
2021-02-05 08:48:47 +00:00
|
|
|
cd dpdk/<build_dir>
|
2018-05-15 09:49:22 +00:00
|
|
|
|
2021-02-05 08:48:47 +00:00
|
|
|
Enable examples compilation:
|
2018-05-15 09:49:22 +00:00
|
|
|
|
|
|
|
.. code-block:: console
|
|
|
|
|
2021-02-05 08:48:47 +00:00
|
|
|
meson configure -Dexamples=all
|
2018-05-15 09:49:22 +00:00
|
|
|
|
2021-02-05 08:48:47 +00:00
|
|
|
Build:
|
2018-05-15 09:49:22 +00:00
|
|
|
|
|
|
|
.. code-block:: console
|
|
|
|
|
2021-02-05 08:48:47 +00:00
|
|
|
ninja
|
2018-05-15 09:49:22 +00:00
|
|
|
|
2021-02-05 08:48:47 +00:00
|
|
|
For additional information on compiling see
|
2018-05-15 09:49:22 +00:00
|
|
|
:ref:`Compiling DPDK on Linux <linux_gsg_compiling_dpdk>` or
|
|
|
|
:ref:`Compiling DPDK on FreeBSD <building_from_source>`.
|
2021-02-05 08:48:47 +00:00
|
|
|
Applications are output to: ``dpdk/<build_dir>/examples``.
|
2018-05-15 09:49:22 +00:00
|
|
|
|
|
|
|
|
2021-02-05 08:48:47 +00:00
|
|
|
To compile a single application
|
|
|
|
-------------------------------
|
2018-05-15 09:49:22 +00:00
|
|
|
|
|
|
|
|
2021-02-05 08:48:47 +00:00
|
|
|
Using meson
|
|
|
|
~~~~~~~~~~~
|
2018-05-15 09:49:22 +00:00
|
|
|
|
2021-02-05 08:48:47 +00:00
|
|
|
Go to DPDK build directory:
|
2018-05-15 09:49:22 +00:00
|
|
|
|
|
|
|
.. code-block:: console
|
|
|
|
|
2021-02-05 08:48:47 +00:00
|
|
|
cd dpdk/<build_dir>
|
2018-05-15 09:49:22 +00:00
|
|
|
|
2021-02-05 08:48:47 +00:00
|
|
|
Enable example app compilation:
|
2018-05-15 09:49:22 +00:00
|
|
|
|
2021-02-05 08:48:47 +00:00
|
|
|
.. code-block:: console
|
2018-05-15 09:49:22 +00:00
|
|
|
|
2021-02-05 08:48:47 +00:00
|
|
|
meson configure -Dexamples=helloworld
|
2018-05-15 09:49:22 +00:00
|
|
|
|
2021-02-05 08:48:47 +00:00
|
|
|
Build:
|
2018-05-15 09:49:22 +00:00
|
|
|
|
2021-02-05 08:48:47 +00:00
|
|
|
.. code-block:: console
|
2018-05-15 09:49:22 +00:00
|
|
|
|
2021-02-05 08:48:47 +00:00
|
|
|
ninja
|
2018-05-15 09:49:22 +00:00
|
|
|
|
|
|
|
|
2021-02-05 08:48:47 +00:00
|
|
|
Using Make
|
|
|
|
~~~~~~~~~~
|
2018-05-15 09:49:22 +00:00
|
|
|
|
2021-02-05 08:48:47 +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.
|
2018-05-15 09:49:22 +00:00
|
|
|
|
|
|
|
Go to the sample application directory. Unless otherwise specified the sample
|
2021-02-05 08:48:47 +00:00
|
|
|
applications are located in ``dpdk/examples/``.
|
2018-05-15 09:49:22 +00:00
|
|
|
|
|
|
|
Build the application:
|
|
|
|
|
|
|
|
.. code-block:: console
|
|
|
|
|
|
|
|
make
|
2019-06-25 11:12:58 +00:00
|
|
|
|
2021-02-05 08:48:47 +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.
|
2019-06-25 11:12:58 +00:00
|
|
|
|
|
|
|
.. code-block:: console
|
|
|
|
|
2021-02-05 08:48:47 +00:00
|
|
|
make DEBUG=1
|