DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Burakov, Anatoly" <anatoly.burakov@intel.com>
To: hamidreza Kheirabadi <hamidreza.kheirabadi@gmail.com>, dev@dpdk.org
Subject: Re: [dpdk-dev] cmake/Makefile sample application
Date: Fri, 19 Feb 2021 11:59:41 +0000	[thread overview]
Message-ID: <53fbb26f-8daa-50b2-6733-d0fb3b3f1c11@intel.com> (raw)
In-Reply-To: <CAKtNQLjKvjBOftNiG_+F83PUXMQE_g_qW=Pn_9HAeAJO=hrdsA@mail.gmail.com>

On 18-Feb-21 6:56 PM, hamidreza Kheirabadi wrote:
> Hi,
> I'd like to change my dpdk-based application from a pure C to C++ version.
> Can anybody help me with a sample cmake or Makefile?
> Is there any performance degradation when compiling apps with g++ instead
> of gcc?
> Regards
> 

Hi,

We have documented examples for building external applications with Make 
and Meson [1], but not CMake. Still, i imagine it would be pretty 
straightforward because CMake will use pkg-config under the hood when 
resolving dependencies.

If DPDK is installed onto your local system (using `ninja install` 
command), things should Just Work (tm). If you only have a local 
compiled version of DPDK, you may still compile/link against it using 
`<build-dir>/meson-uninstalled` directory which will have a pkg-config 
file that will allow you to get all necessary paths/includes. (you may 
need to set PKG_CONFIG_DIR environment variable, or its CMake 
equivalent, for pkg-config to find DPDK)

The DPDK examples have Makefiles that is self-contained and should be a 
good basis for building any external application as well.

As for the question of C++, I've written C++ DPDK applications before, 
and i haven't noticed any performance degradation. Obviously the kind of 
features you plan on using (e.g. exceptions, dynamic dispatch, etc.) 
will determine the performance impact you may or may not get, but seeing 
how C++ model is "not paying for abstractions you don't use", I imagine 
that a carefully designed C++ application will perform just as well as a 
C application, with roughly half the code :D

[1] 
http://doc.dpdk.org/guides/linux_gsg/build_dpdk.html#building-applications-using-installed-dpdk

-- 
Thanks,
Anatoly

      reply	other threads:[~2021-02-19 11:59 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-18 18:56 hamidreza Kheirabadi
2021-02-19 11:59 ` Burakov, Anatoly [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=53fbb26f-8daa-50b2-6733-d0fb3b3f1c11@intel.com \
    --to=anatoly.burakov@intel.com \
    --cc=dev@dpdk.org \
    --cc=hamidreza.kheirabadi@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).