DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] cmake/Makefile sample application
@ 2021-02-18 18:56 hamidreza Kheirabadi
  2021-02-19 11:59 ` Burakov, Anatoly
  0 siblings, 1 reply; 2+ messages in thread
From: hamidreza Kheirabadi @ 2021-02-18 18:56 UTC (permalink / raw)
  To: dev

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [dpdk-dev] cmake/Makefile sample application
  2021-02-18 18:56 [dpdk-dev] cmake/Makefile sample application hamidreza Kheirabadi
@ 2021-02-19 11:59 ` Burakov, Anatoly
  0 siblings, 0 replies; 2+ messages in thread
From: Burakov, Anatoly @ 2021-02-19 11:59 UTC (permalink / raw)
  To: hamidreza Kheirabadi, dev

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-02-19 11:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-18 18:56 [dpdk-dev] cmake/Makefile sample application hamidreza Kheirabadi
2021-02-19 11:59 ` Burakov, Anatoly

DPDK patches and discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://inbox.dpdk.org/dev/0 dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dev dev/ http://inbox.dpdk.org/dev \
		dev@dpdk.org
	public-inbox-index dev

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dev


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git