path: root/examples/
AgeCommit message (Collapse)Author
2019-05-02examples: install as part of ninja installBruce Richardson
When we install dpdk onto a system, we want to put the examples into the /usr/share/dpdk (or /usr/local/share) directory for reference. Signed-off-by: Bruce Richardson <> Acked-by: Luca Boccassi <>
2019-04-17build: increase readability via shortcut variablesBruce Richardson
Define variables for "is_linux", "is_freebsd" and "is_windows" to make the code shorter for comparisons and more readable. Signed-off-by: Bruce Richardson <> Reviewed-by: David Marchand <> Acked-by: Luca Boccassi <>
2019-04-03build: add workarounds for Windows helloworldAnand Rawat
Added meson workarounds to build helloworld on Windows. Windows currently only supports kvargs and eal libraries. This change restricts the build flow to supported libraries only. Signed-off-by: Anand Rawat <> Signed-off-by: Pallavi Kadam <> Reviewed-by: Jeff Shaw <> Reviewed-by: Ranjit Menon <> Acked-by: Harini Ramakrishnan <>
2018-10-22mk: build with _GNU_SOURCE defined by defaultAnatoly Burakov
We use _GNU_SOURCE all over the place, but often times we miss defining it, resulting in broken builds on musl. Rather than fixing every library's and driver's and application's makefile, fix it by simply defining _GNU_SOURCE by default for all builds. Remove all usages of _GNU_SOURCE in source files and makefiles, and also fixup a couple of instances of using __USE_GNU instead of _GNU_SOURCE. Signed-off-by: Anatoly Burakov <>
2018-07-26build: remove duplicate checks for cflagsBruce Richardson
There is no need to check for each library, driver and example whether certain cflags are supported. Instead of checking inside the loop, do so outside and reuse the value. Signed-off-by: Bruce Richardson <>
2018-07-11build: fix for host clang and cross gccGavin Hu
The following error hits if host cc compiler is clang(default one in most linux distributions) and the cross compiler is gcc. The root cause is: the hybride compilers add the warning options to the meson project as project arguments, which apply for both host compiling and cross compiling. But some options such as '-Wno-format-truncation' are not supported nor recognized by clang, so they have to be removed from the project arguments for the host compiler to run smoothily and added back as cflags for the cross compiler to compile for cross source files. The fix is remove unrecognized warning options from the meson project arguments shared by gcc and clang, as add them specifically for gcc or clang as cflags. [265/893] Compiling C object 'buildtools/pmdinfogen/pmdinfogen@exe/pmdinfogen.c.o'. warning: unknown warning option '-Wno-format-truncation' [-Wunknown-warning-option] Fixes: a55277a788 ("devtools: add test script for meson builds") Cc: Signed-off-by: Gavin Hu <> Reviewed-by: Phil Yang <> Reviewed-by: Song Zhu <> Reviewed-by: Steve Capper <> Acked-by: Bruce Richardson <>
2018-04-17examples: improve error report for missing meson depsBruce Richardson
When a required library is missing on a platform, rather than having meson report an error about the missing variable, catch the problem earlier and provide a more readable message. Signed-off-by: Bruce Richardson <> Tested-by: Harry van Haaren <>
2018-04-17examples: allow building all as part of meson buildBruce Richardson
To test building all relevant example applications as part of a build, we add support for the "all" keyword to be passed to the "examples" build option. Since not all examples can actually be built on all systems, we also add support for the "build" option inside the sub-dirs. However, in case where "all" is not used, and a particular example is requested to be built, we will error out if building the requested app is not possible. Signed-off-by: Bruce Richardson <> Tested-by: Harry van Haaren <>
2018-02-02build: fix dependency on execinfo for BSD meson buildsBruce Richardson
The binaries and apps in DPDK all need to be linked against the execinfo library on FreeBSD so add this as a dependency in cases where it is found. It's available by default on BSD, but not at all on Linux Fixes: 16ade738fd0d ("app/testpmd: build with meson") Fixes: 89f0711f9ddf ("examples: build some samples with meson") Fixes: b5dc795a8a55 ("test: build app with meson as dpdk-test") Fixes: 2ff67267b049 ("app/eventdev: build with meson") Signed-off-by: Bruce Richardson <>
2018-01-30build: detect micro-arch on ARMPavan Nikhilesh
Added support for detecting march and mcpu by reading midr_el1 register. The implementer, primary part number values read can be used to figure out the underlying arm cpu. Signed-off-by: Pavan Nikhilesh <> Acked-by: Jerin Jacob <>
2018-01-30build: remove architecture flag as default C flagBruce Richardson
Any flags added to the project args are automatically added to all builds, both native and cross-compiled. This is not what we want for the -march flag as a valid -march for the cross-compile is not valid for pmdinfogen which is a native-build tool. Instead we store the march flag as a variable, and add it to the default cflags for all libs, drivers, examples, etc. This will allow pmdinfogen to compile successfully in a cross-compilation environment. Signed-off-by: Bruce Richardson <> Acked-by: Luca Boccassi <>
2018-01-30build: replace license text with SPDX tagBruce Richardson
Signed-off-by: Bruce Richardson <> Reviewed-by: Luca Boccassi <>
2018-01-30build: build as both static and shared libsBruce Richardson
This patch changes the build process to group all .o files for a driver or library into a static archive first, and then link the .o files together into a shared library. This eliminates the need for separate static or shared object builds when packaging, for instance. The "default_library" configuration option now only affects the apps and examples, which are either linked against the static or shared library versions depending on the value of the option. Signed-off-by: Bruce Richardson <> Acked-by: Luca Boccassi <>
2018-01-30examples: build some samples with mesonBruce Richardson
Add support for having selected example apps built as part of a meson, ninja build. By default none are built, and those to be built should be named directly in the -Dexamples='' meson configuration argument. This is useful for developers working on a feature who want to use a suitable example, or examples, to test that feature, as they can compile everything up in one go, and run the example without having to do a ninja install first. This commit adds examples which don't consist of multiple apps in subdirectories to the meson build, so they can be built by default by passing -Dexamples parameter to meson. Not included are the following examples: * ethtool * multi-process * netmap_compat * performance-thread * quota_watermark * server_node_efd * vm_power_manager To test the apps added here, use the following command, merged to one line, to add them to your meson build (command to be run inside the build directory): meson configure -Dexamples=bbdev_app,bond,cmdline,distributor,\ eventdev_pipeline_sw_pmd, exception_path,helloworld,\ ip_fragmentation,ip_pipeline,ip_reassembly, ipsec-secgw,\ ipv4_multicast,kni,l2fwd-cat,l2fwd-crypto,l2fwd-jobstats,\ l2fwd-keepalive,l2fwd,l3fwd-acl,l3fwd-power,l3fwd-vf,l3fwd,\ link_status_interrupt,load_balancer,packet_ordering,ptpclient,\ qos_meter,qos_sched,rxtx_callbacks,skeleton,tep_termination,\ timer,vhost,vhost_scsi,vmdq,vmdq_dcb Signed-off-by: Bruce Richardson <> Reviewed-by: Luca Boccassi <>