f-stack/dpdk/doc/guides/sample_app_ug/compiling.rst

84 lines
1.6 KiB
ReStructuredText
Raw Normal View History

2019-06-25 11:12:58 +00:00
.. SPDX-License-Identifier: BSD-3-Clause
Copyright(c) 2015 Intel Corporation.
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:
.. code-block:: console
2021-02-05 08:48:47 +00:00
cd dpdk/<build_dir>
2021-02-05 08:48:47 +00:00
Enable examples compilation:
.. code-block:: console
2021-02-05 08:48:47 +00:00
meson configure -Dexamples=all
2021-02-05 08:48:47 +00:00
Build:
.. code-block:: console
2021-02-05 08:48:47 +00:00
ninja
2021-02-05 08:48:47 +00:00
For additional information on compiling see
: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``.
2021-02-05 08:48:47 +00:00
To compile a single application
-------------------------------
2021-02-05 08:48:47 +00:00
Using meson
~~~~~~~~~~~
2021-02-05 08:48:47 +00:00
Go to DPDK build directory:
.. code-block:: console
2021-02-05 08:48:47 +00:00
cd dpdk/<build_dir>
2021-02-05 08:48:47 +00:00
Enable example app compilation:
2021-02-05 08:48:47 +00:00
.. code-block:: console
2021-02-05 08:48:47 +00:00
meson configure -Dexamples=helloworld
2021-02-05 08:48:47 +00:00
Build:
2021-02-05 08:48:47 +00:00
.. code-block:: console
2021-02-05 08:48:47 +00:00
ninja
2021-02-05 08:48:47 +00:00
Using Make
~~~~~~~~~~
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.
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/``.
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