[dpdk-dev] [PATCH v2 0/3] fix C++ includes
2016-02-16 08:14, Thomas Monjalon: > 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 > > v2: > - move keep-alive struct out of header > - fix syntax in mbuf_offload cast > > Thomas Monjalon (3): > eal: fix keep alive header for C++ > hash: fix header for C++ > mbuf_offload: fix header for C++ Applied
[dpdk-dev] [PATCH v2 0/3] fix C++ includes
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
[dpdk-dev] [PATCH v2 0/3] fix C++ includes
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; }
[dpdk-dev] [PATCH v2 0/3] fix C++ includes
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 > Hi Thomas, 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. Thanks, ferruh
[dpdk-dev] [PATCH v2 0/3] fix C++ includes
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 v2: - move keep-alive struct out of header - fix syntax in mbuf_offload cast Thomas Monjalon (3): eal: fix keep alive header for C++ hash: fix header for C++ mbuf_offload: fix header for C++ lib/librte_eal/common/include/rte_keepalive.h | 37 +++--- lib/librte_eal/common/rte_keepalive.c | 38 +++ lib/librte_hash/rte_jhash.h | 2 +- lib/librte_mbuf_offload/rte_mbuf_offload.h| 5 +++- 4 files changed, 46 insertions(+), 36 deletions(-) -- 2.7.0