From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f44.google.com (mail-wm0-f44.google.com [74.125.82.44]) by dpdk.org (Postfix) with ESMTP id 5BFCDBDC2 for ; Tue, 16 Feb 2016 19:33:23 +0100 (CET) Received: by mail-wm0-f44.google.com with SMTP id g62so165694440wme.0 for ; Tue, 16 Feb 2016 10:33:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=nPlfSRNO6Av+Af40b7oPXdI+PaKRa5U+vJYFoc/riRs=; b=R7SnLCJo9+JIUqG0n1omH+x2Bu9JinDoha5LoXdXh2NMBi4JK9E7yvr83NhpJYQ3Rp C7A+HL+ep1vP+u4icRoLlSPziwNxdBbHphnet6Tj2sXoRBPg5ChIjBYDCEMkDYzzMNR8 bzFzP6Svrfkb7J4RhUyZecztP+qhhZuUVyScSN8lZDOpkyb+N/qPgxC2FKXysTETa5Wy iTYvBd+Zy9Ja5dEFTP3Xs2KNVlY1rlRVjWunIOCAqy5KoW39l8rg12cy9s6PiclAmBBZ s2KR398BYt+xC6Z2zbZTv35cvbXD7lbD2jsdI/EdnHl++Keaw6XylmjYQp82kC3foZ6A tNKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc:content-type; bh=nPlfSRNO6Av+Af40b7oPXdI+PaKRa5U+vJYFoc/riRs=; b=XlUnnrsW2khc1DsYTtOHHV+vTdSuPOP34cQviKt3gs9iv8hhWI4GJ5Q+0qmHOEzg/A OIimSJf4slTupP/mVTSmfy47C7J4CWfHerKHYokjIWFKUI4ZOV7cO7WSas2yI0b0S8OO MvzCjS1uyLixr0bfkUEmw2bXUbZ2aX8cljstS9r3if8OyBVYJOqjiOWhC+koxe1WhG/l mtfpDIVR8phm5YHjre40K/lfuqc9VTlIrSZRFoqtEOQ4v03EwZggICoolk2IonhP1vQD X3XcseLhdQYJcADUPmA1diNDFGHWvhUqg4OM6Tb3Dxbymduo+ilk0KQdmWtPlFB/kHrx Q2/A== X-Gm-Message-State: AG10YOTTk/PoyPIIPkC+sFsVEhpxeEGSejT5L9bAGvn30dqbU/od1lIaNrsKzqfC6Ad2tTWvmdOusToED2rs3g== X-Received: by 10.194.77.193 with SMTP id u1mr23800693wjw.73.1455647603187; Tue, 16 Feb 2016 10:33:23 -0800 (PST) MIME-Version: 1.0 Sender: marc.sune@gmail.com Received: by 10.27.95.202 with HTTP; Tue, 16 Feb 2016 10:33:03 -0800 (PST) In-Reply-To: <3258026.sKzRUcIKf8@xps13> References: <1454691969-25734-1-git-send-email-thomas.monjalon@6wind.com> <1455606865-22680-1-git-send-email-thomas.monjalon@6wind.com> <20160216162134.GA30782@sivlogin002.ir.intel.com> <3258026.sKzRUcIKf8@xps13> From: Marc Date: Tue, 16 Feb 2016 19:33:03 +0100 X-Google-Sender-Auth: ulTHM_rt4K63pWHqAKIGHbgQR5Y Message-ID: To: Thomas Monjalon Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Cc: dev@dpdk.org Subject: Re: [dpdk-dev] [PATCH v2 0/3] fix C++ includes X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Feb 2016 18:33:23 -0000 On 16 February 2016 at 17:26, Thomas Monjalon wrote: > 2016-02-16 16:21, Ferruh Yigit: > > On Tue, Feb 16, 2016 at 08:14:22AM +0100, Thomas Monjalon wrote: > > > When trying to build a C++ application, some errors appear from DPDK > headers. > > > 2 libraries are not fixed in this series: > > > - cmdline > > > - vhost which includes some not compliant Linux virtio headers > > > > Out of curiosity, how can we detect C++ compilation problems, do we have > a C++ sample application? > > Or how can we compile any existing application with c++, I tried > "EXTRA_CFLAGS="-x c++" or "CC=g++" but both failed to compile. > > I will submit a test. > At the moment, I use CC=g++ with this file: > > #ifdef RTE_LIBRTE_EAL > #include > #include > #include > #include > #include > #include > #include > #include > #include > #include > #include > #include > #include > #include > #include > #include > #include > #include > #include > #include > #include > #include > #include > #include > #include > #include > #include > #include > #include > #include > #include > #include > #ifdef RTE_ARCH_X86 > #include > #endif > #include > #include > #include > #include > #include > #include > #include > #include > #endif > #ifdef RTE_LIBRTE_CMDLINE > /* TODO: C++ support > #include > #include > #include > */ > #include > #include > #include > #include > #include > #include > #include > #include > #endif > #ifdef RTE_LIBRTE_ACL > #include > #endif > #ifdef RTE_LIBRTE_SCHED > #include > #include > #include > #include > #include > #endif > #ifdef RTE_LIBRTE_NET > #include > #include > #include > #include > #include > #include > #endif > #ifdef RTE_LIBRTE_CFGFILE > #include > #endif > #include > #include > #ifdef RTE_LIBRTE_CRYPTODEV > #include > #include > #include > #endif > #ifdef RTE_LIBRTE_DISTRIBUTOR > #include > #endif > #ifdef RTE_LIBRTE_PMD_AF_PACKET > #include > #endif > #ifdef RTE_LIBRTE_PMD_BOND > #include > #include > #endif > #ifdef RTE_LIBRTE_ETHER > #include > #include > #include > #endif > #ifdef RTE_LIBRTE_PMD_NULL > #include > #endif > #ifdef RTE_LIBRTE_PMD_RING > #include > #endif > #ifdef RTE_LIBRTE_HASH > #include > #include > #include > #include > #include > #endif > #ifdef RTE_LIBRTE_IP_FRAG > #include > #endif > #ifdef RTE_LIBRTE_JOBSTATS > #include > #endif > #ifdef RTE_LIBRTE_KNI > #include > #endif > #ifdef RTE_LIBRTE_KVARGS > #include > #endif > #ifdef RTE_LIBRTE_LPM > #include > #include > #endif > #ifdef RTE_LIBRTE_MBUF > #include > #endif > #ifdef RTE_LIBRTE_MBUF_OFFLOAD > #include > #endif > #ifdef RTE_LIBRTE_MEMPOOL > #include > #endif > #ifdef RTE_LIBRTE_METER > #include > #endif > #ifdef RTE_LIBRTE_PIPELINE > #include > #endif > #ifdef RTE_LIBRTE_PORT > #include > #include > #include > #include > #include > #include > #include > #endif > #ifdef RTE_LIBRTE_POWER > #include > #endif > #ifdef RTE_LIBRTE_REORDER > #include > #endif > #ifdef RTE_LIBRTE_RING > #include > #endif > #ifdef RTE_LIBRTE_TABLE > #include > #include > #include > #include > #include > #include > #include > #include > #endif > #ifdef RTE_LIBRTE_VHOST > /* TODO: fix vhost header for C++ > #include > */ > #endif > > int > main(int argc, char **argv) > { > RTE_LOG(NOTICE, USER1, "function %s\n", __func__); > return 0; > } > > I don't know what you have in mind for the test, but with this file you can only detect things like using reserved keywords of C++ in DPDK headers and things like that. It will not detect linking issues (fundamentally missing extern "C" in function declarations), which happen from time to time, specially with new headers. We would need to compile a .cc/.cpp file including all these headers and link against all the functions on those headers, similarly to what autoconf does to test libs. I could help on that for 2.4. Marc