From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from dpdk.org (dpdk.org [92.243.14.124])
	by inbox.dpdk.org (Postfix) with ESMTP id DD976A0555;
	Wed, 19 Feb 2020 12:35:38 +0100 (CET)
Received: from [92.243.14.124] (localhost [127.0.0.1])
	by dpdk.org (Postfix) with ESMTP id 26DC51B13C;
	Wed, 19 Feb 2020 12:35:38 +0100 (CET)
Received: from smtp.tuxdriver.com (charlotte.tuxdriver.com [70.61.120.58])
 by dpdk.org (Postfix) with ESMTP id A803A397D
 for <dev@dpdk.org>; Wed, 19 Feb 2020 12:35:36 +0100 (CET)
Received: from 2606-a000-111b-43ee-0000-0000-0000-1bf2.inf6.spectrum.com
 ([2606:a000:111b:43ee::1bf2] helo=localhost)
 by smtp.tuxdriver.com with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.63)
 (envelope-from <nhorman@tuxdriver.com>)
 id 1j4NdS-0003Z6-9m; Wed, 19 Feb 2020 06:35:29 -0500
Date: Wed, 19 Feb 2020 06:35:21 -0500
From: Neil Horman <nhorman@tuxdriver.com>
To: Victor Huertas <vhuertas@gmail.com>
Cc: Bruce Richardson <bruce.richardson@intel.com>, dev <dev@dpdk.org>
Message-ID: <20200219113521.GA357121@hmswarspite.think-freely.org>
References: <CAGxG5ciYdGPREp0SJ2tVDopptE7-UT+QSD1Q1QN-h72yG=Z2+w@mail.gmail.com>
 <20200217143958.GA866@bricha3-MOBL.ger.corp.intel.com>
 <20200218131256.GA250991@hmswarspite.think-freely.org>
 <CAGxG5chCvGFyfwOhtQaAi8NJcRef8xQKyMiy7xu1NwOzL8Actw@mail.gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <CAGxG5chCvGFyfwOhtQaAi8NJcRef8xQKyMiy7xu1NwOzL8Actw@mail.gmail.com>
X-Spam-Score: -2.9 (--)
X-Spam-Status: No
Subject: Re: [dpdk-dev] Proposal to add a new toolchain for dpdk: g++
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
Errors-To: dev-bounces@dpdk.org
Sender: "dev" <dev-bounces@dpdk.org>

On Tue, Feb 18, 2020 at 03:06:51PM +0100, Victor Huertas wrote:
> Thanks Neil for your answer,
> I think I will try the first option you posted without touching the
> makefiles from the dpdk-stable and I will tell how it goes.
> So, as a conclusion, it seems that all the modifications I have done are
> not necessary in order to build your DPDK application using g++.
> 
That should be correct, yes.  As Bruce noted, all of the exported header files
are wrapped as extern C, and so they should interface to c++ code, even when the
library is compiled with gcc.  If that doesn't work, thats a bug in DPDK.

Neil

> Regards,
> 
> El mar., 18 feb. 2020 a las 14:13, Neil Horman (<nhorman@tuxdriver.com>)
> escribió:
> 
> > On Mon, Feb 17, 2020 at 02:39:58PM +0000, Bruce Richardson wrote:
> > > On Mon, Feb 17, 2020 at 11:01:21AM +0100, Victor Huertas wrote:
> > > > Hi all,
> > > >
> > > > I am using DPDK development environment to develop an application from
> > > > which I have to access C++ code.
> > > > I managed to modify some internal mk files in the dpdk-stable
> > repository to
> > > > allow g++ compiler to be supported.
> > > >
> > > > I have all the modified files well identified and I wonder if the
> > support
> > > > team is interested to add this toolchain in future DPDK releases.
> > > >
> > > Rather than trying to build DPDK with g++, or to use the DPDK makefiles
> > > with your C++ application, can I recommend instead that you treat DPDK as
> > > any third-party library and build it independently of your application.
> > >
> > > If you compile and install DPDK using meson and ninja - or install the
> > > DPDK package from your linux distro - you will have a 'libdpdk.pc' file
> > > installed for use by pkg-config. Then for building your application, put
> > in
> > > the relevant calls to pkg-config i.e. 'pkg-config --cflags libdpdk' and
> > > 'pkg-config --libs libdpdk', into your app makefile and work from there.
> > >
> > yes, exactly this.  The proscribed method of handling issues like this is
> > to
> > either:
> >
> > 1) Build dpdk separately (or just install it from whatever distribution
> > you are
> > using, if thats an option), and just link against it (either statically or
> > dynamically) when you build your application.
> >
> > 2)  If you embed dpdk source in your
> > environment, and build it at the same time as your application, you should
> > interface to its build system, by just calling ninja/meson or make from a
> > build
> > target in your application - the dpdk build file should properly select gcc
> > instead of g++, which you should already have if you have g++ installed.
> >
> > Neil
> >
> > > Note too, that all DPDK header files should already be safe for inclusion
> > > in C++ code - if not, please log a bug.
> > >
> > > Regards,
> > > /Bruce
> > >
> >
> 
> 
> -- 
> Victor