DPDK patches and discussions
 help / color / mirror / Atom feed
From: Marc <marcdevel@gmail.com>
To: Thomas Monjalon <thomas.monjalon@6wind.com>
Cc: dev@dpdk.org
Subject: Re: [dpdk-dev] [PATCH v2 0/3] fix C++ includes
Date: Tue, 16 Feb 2016 19:33:03 +0100	[thread overview]
Message-ID: <CAExC=0R8QHOcyVHuWfgBZmE=JzEgPoxpaDtdUGci24N80Atvbg@mail.gmail.com> (raw)
In-Reply-To: <3258026.sKzRUcIKf8@xps13>

On 16 February 2016 at 17:26, Thomas Monjalon <thomas.monjalon@6wind.com>
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 <rte_alarm.h>
> #include <rte_atomic.h>
> #include <rte_branch_prediction.h>
> #include <rte_byteorder.h>
> #include <rte_common.h>
> #include <rte_cpuflags.h>
> #include <rte_cycles.h>
> #include <rte_debug.h>
> #include <rte_devargs.h>
> #include <rte_dev.h>
> #include <rte_dev_info.h>
> #include <rte_eal.h>
> #include <rte_eal_memconfig.h>
> #include <rte_errno.h>
> #include <rte_hexdump.h>
> #include <rte_interrupts.h>
> #include <rte_keepalive.h>
> #include <rte_launch.h>
> #include <rte_lcore.h>
> #include <rte_log.h>
> #include <rte_malloc.h>
> #include <rte_malloc_heap.h>
> #include <rte_memcpy.h>
> #include <rte_memory.h>
> #include <rte_memzone.h>
> #include <rte_pci.h>
> #include <rte_pci_dev_feature_defs.h>
> #include <rte_pci_dev_features.h>
> #include <rte_pci_dev_ids.h>
> #include <rte_per_lcore.h>
> #include <rte_prefetch.h>
> #include <rte_random.h>
> #ifdef RTE_ARCH_X86
> #include <rte_rtm.h>
> #endif
> #include <rte_rwlock.h>
> #include <rte_spinlock.h>
> #include <rte_string_fns.h>
> #include <rte_tailq.h>
> #include <rte_time.h>
> #include <rte_timer.h>
> #include <rte_vect.h>
> #include <rte_version.h>
> #endif
> #ifdef RTE_LIBRTE_CMDLINE
> /* TODO: C++ support
> #include <cmdline.h>
> #include <cmdline_cirbuf.h>
> #include <cmdline_parse_etheraddr.h>
> */
> #include <cmdline_parse.h>
> #include <cmdline_parse_ipaddr.h>
> #include <cmdline_parse_num.h>
> #include <cmdline_parse_portlist.h>
> #include <cmdline_parse_string.h>
> #include <cmdline_rdline.h>
> #include <cmdline_socket.h>
> #include <cmdline_vt100.h>
> #endif
> #ifdef RTE_LIBRTE_ACL
> #include <rte_acl.h>
> #endif
> #ifdef RTE_LIBRTE_SCHED
> #include <rte_approx.h>
> #include <rte_bitmap.h>
> #include <rte_red.h>
> #include <rte_sched_common.h>
> #include <rte_sched.h>
> #endif
> #ifdef RTE_LIBRTE_NET
> #include <rte_arp.h>
> #include <rte_icmp.h>
> #include <rte_ip.h>
> #include <rte_sctp.h>
> #include <rte_tcp.h>
> #include <rte_udp.h>
> #endif
> #ifdef RTE_LIBRTE_CFGFILE
> #include <rte_cfgfile.h>
> #endif
> #include <rte_compat.h>
> #include <rte_config.h>
> #ifdef RTE_LIBRTE_CRYPTODEV
> #include <rte_crypto.h>
> #include <rte_cryptodev.h>
> #include <rte_cryptodev_pmd.h>
> #endif
> #ifdef RTE_LIBRTE_DISTRIBUTOR
> #include <rte_distributor.h>
> #endif
> #ifdef RTE_LIBRTE_PMD_AF_PACKET
> #include <rte_eth_af_packet.h>
> #endif
> #ifdef RTE_LIBRTE_PMD_BOND
> #include <rte_eth_bond.h>
> #include <rte_eth_bond_8023ad.h>
> #endif
> #ifdef RTE_LIBRTE_ETHER
> #include <rte_eth_ctrl.h>
> #include <rte_ethdev.h>
> #include <rte_ether.h>
> #endif
> #ifdef RTE_LIBRTE_PMD_NULL
> #include <rte_eth_null.h>
> #endif
> #ifdef RTE_LIBRTE_PMD_RING
> #include <rte_eth_ring.h>
> #endif
> #ifdef RTE_LIBRTE_HASH
> #include <rte_fbk_hash.h>
> #include <rte_hash_crc.h>
> #include <rte_hash.h>
> #include <rte_jhash.h>
> #include <rte_thash.h>
> #endif
> #ifdef RTE_LIBRTE_IP_FRAG
> #include <rte_ip_frag.h>
> #endif
> #ifdef RTE_LIBRTE_JOBSTATS
> #include <rte_jobstats.h>
> #endif
> #ifdef RTE_LIBRTE_KNI
> #include <rte_kni.h>
> #endif
> #ifdef RTE_LIBRTE_KVARGS
> #include <rte_kvargs.h>
> #endif
> #ifdef RTE_LIBRTE_LPM
> #include <rte_lpm.h>
> #include <rte_lpm6.h>
> #endif
> #ifdef RTE_LIBRTE_MBUF
> #include <rte_mbuf.h>
> #endif
> #ifdef RTE_LIBRTE_MBUF_OFFLOAD
> #include <rte_mbuf_offload.h>
> #endif
> #ifdef RTE_LIBRTE_MEMPOOL
> #include <rte_mempool.h>
> #endif
> #ifdef RTE_LIBRTE_METER
> #include <rte_meter.h>
> #endif
> #ifdef RTE_LIBRTE_PIPELINE
> #include <rte_pipeline.h>
> #endif
> #ifdef RTE_LIBRTE_PORT
> #include <rte_port.h>
> #include <rte_port_ethdev.h>
> #include <rte_port_frag.h>
> #include <rte_port_ras.h>
> #include <rte_port_ring.h>
> #include <rte_port_sched.h>
> #include <rte_port_source_sink.h>
> #endif
> #ifdef RTE_LIBRTE_POWER
> #include <rte_power.h>
> #endif
> #ifdef RTE_LIBRTE_REORDER
> #include <rte_reorder.h>
> #endif
> #ifdef RTE_LIBRTE_RING
> #include <rte_ring.h>
> #endif
> #ifdef RTE_LIBRTE_TABLE
> #include <rte_lru.h>
> #include <rte_table.h>
> #include <rte_table_acl.h>
> #include <rte_table_array.h>
> #include <rte_table_hash.h>
> #include <rte_table_lpm.h>
> #include <rte_table_lpm_ipv6.h>
> #include <rte_table_stub.h>
> #endif
> #ifdef RTE_LIBRTE_VHOST
> /* TODO: fix vhost header for C++
> #include <rte_virtio_net.h>
> */
> #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

  reply	other threads:[~2016-02-16 18:33 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-05 17:06 [dpdk-dev] [PATCH " Thomas Monjalon
2016-02-05 17:06 ` [dpdk-dev] [PATCH 1/3] eal: fix keep alive header for C++ Thomas Monjalon
2016-02-15 11:16   ` Remy Horton
2016-02-05 17:06 ` [dpdk-dev] [PATCH 2/3] hash: fix " Thomas Monjalon
2016-02-08 13:42   ` De Lara Guarch, Pablo
2016-02-05 17:06 ` [dpdk-dev] [PATCH 3/3] mbuf_offload: " Thomas Monjalon
2016-02-05 21:33   ` Thomas Monjalon
2016-02-16  7:14 ` [dpdk-dev] [PATCH v2 0/3] fix C++ includes Thomas Monjalon
2016-02-16  7:14   ` [dpdk-dev] [PATCH v2 1/3] eal: fix keep alive header for C++ Thomas Monjalon
2016-02-16 10:16     ` Remy Horton
2016-02-16  7:14   ` [dpdk-dev] [PATCH v2 2/3] hash: fix " Thomas Monjalon
2016-02-16  7:14   ` [dpdk-dev] [PATCH v2 3/3] mbuf_offload: " Thomas Monjalon
2016-02-16 16:21   ` [dpdk-dev] [PATCH v2 0/3] fix C++ includes Ferruh Yigit
2016-02-16 16:26     ` Thomas Monjalon
2016-02-16 18:33       ` Marc [this message]
2016-02-21 10:49   ` Thomas Monjalon

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='CAExC=0R8QHOcyVHuWfgBZmE=JzEgPoxpaDtdUGci24N80Atvbg@mail.gmail.com' \
    --to=marcdevel@gmail.com \
    --cc=dev@dpdk.org \
    --cc=thomas.monjalon@6wind.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).