From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id F2F0D2C1A for ; Wed, 7 Jun 2017 13:16:23 +0200 (CEST) Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga105.jf.intel.com with ESMTP; 07 Jun 2017 04:16:22 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.39,311,1493708400"; d="scan'208";a="111454128" Received: from silpixa00399126.ir.intel.com (HELO silpixa00399126.ger.corp.intel.com) ([10.237.223.223]) by fmsmga005.fm.intel.com with ESMTP; 07 Jun 2017 04:16:21 -0700 From: Bruce Richardson To: dev@dpdk.org Cc: Bruce Richardson Date: Wed, 7 Jun 2017 11:47:42 +0100 Message-Id: <20170607104743.275149-1-bruce.richardson@intel.com> X-Mailer: git-send-email 2.9.4 Subject: [dpdk-dev] [RFC PATCH] replace DPDK config and build system X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Jun 2017 11:16:25 -0000 Hi all, following on from the pressing need to add support in DPDK for detecting and managing external dependencies, I undertook to see what options we had. However, unrelated to this, over time, I have become increasingly frustrated by the complexity of the DPDK configuration and build system. As such, I feel that looking at some of the newer build tools that are out there might give us the additional functionality we want, along with other benefits. As such, I undertook a prototype using "meson"[1] for configuration, which uses "ninja" as a backend for doing the actual build. With these tools we get the following benefits (not a complete list): * support for detecting dependencies on the system * support for detecting compiler features, including functions, defines * improved maintainability through a high-level language, which gives decent error messages including line numbers (!!) * co-existence with the existing makefile system without making any changes to it * faster builds using ninja - on my many-core system, the builds seem significantly faster than with our existing system. Especially in the nothing-has-changed case, builds with my prototype return instantly, compared to taking a few seconds to recursively check each directory with the current build system * the ability to switch to using a standard "ninja" + "ninja install" setup * the chance to rework our existing build-config files, and hopefully pretty much remove them. * pkg-config support. * we get to move away from our bespoke build system * dependencies in each lib can be moved back to being tracked in the libs files themselves, not up a level Of course, it's not a panacea, but having spent hours on the prototype thus far, I find working with meson and ninja far more user-friendly than working on our makefiles, and again the build speed is a really nice improvment too. The prototype is incomplete, but it does build a reasonable number of our libraries, some unit tests, the i40e PMD and the testpmd binary, and I have successfully passed traffic using testpmd from the build. Some things are not fully correct, e.g. static builds aren't working right now, as I haven't correctly done all the dependency tracking, I think, and the cpu flag detection has issues. It also has only been tried on x86_64 linux, on a couple of systems, so YMMV. However, I feel it's a reasonable enough start point to show what we might be able to achieve. Please take the prototype and test it out. I think it's a better alternative to trying to bolt on additional functionality to our existing config and build system. [1] http://mesonbuild.com/ Bruce Richardson (1): build for DPDK with meson and ninja .gitignore | 2 + app/meson.build | 1 + app/test-pmd/meson.build | 20 +++++++ config/meson.build | 5 ++ config/rte_config.h | 20 +++++++ drivers/mempool/meson.build | 2 + drivers/mempool/ring/meson.build | 9 +++ drivers/mempool/stack/meson.build | 9 +++ drivers/meson.build | 2 + drivers/net/i40e/meson.build | 61 +++++++++++++++++++ drivers/net/meson.build | 1 + lib/librte_acl/meson.build | 44 ++++++++++++++ lib/librte_cmdline/meson.build | 30 ++++++++++ lib/librte_compat/meson.build | 4 ++ lib/librte_eal/common/arch/x86/meson.build | 1 + lib/librte_eal/common/arch/x86_64 | 1 + lib/librte_eal/common/eal_common_cpuflags.c | 1 + lib/librte_eal/common/include/arch/x86/meson.build | 16 +++++ lib/librte_eal/common/include/arch/x86_64 | 1 + lib/librte_eal/common/include/meson.build | 36 +++++++++++ lib/librte_eal/common/include/rte_common.h | 1 + lib/librte_eal/common/include/rte_eal.h | 2 +- lib/librte_eal/linuxapp/eal/eal.c | 6 +- lib/librte_eal/linuxapp/eal/eal_pci_uio.c | 9 +-- lib/librte_eal/linuxapp/eal/meson.build | 57 ++++++++++++++++++ lib/librte_eal/linuxapp/meson.build | 1 + lib/librte_eal/meson.build | 10 ++++ lib/librte_ether/meson.build | 16 +++++ lib/librte_hash/meson.build | 21 +++++++ lib/librte_kvargs/meson.build | 10 ++++ lib/librte_mbuf/meson.build | 10 ++++ lib/librte_mbuf/rte_mbuf.h | 1 + lib/librte_mempool/meson.build | 10 ++++ lib/librte_metrics/meson.build | 10 ++++ lib/librte_net/meson.build | 19 ++++++ lib/librte_ring/meson.build | 10 ++++ lib/meson.build | 12 ++++ meson.build | 70 ++++++++++++++++++++++ meson_options.txt | 2 + test/meson.build | 1 + test/test/meson.build | 23 +++++++ test/test/test.c | 17 +++--- 42 files changed, 568 insertions(+), 16 deletions(-) create mode 100644 app/meson.build create mode 100644 app/test-pmd/meson.build create mode 100644 config/meson.build create mode 100644 config/rte_config.h create mode 100644 drivers/mempool/meson.build create mode 100644 drivers/mempool/ring/meson.build create mode 100644 drivers/mempool/stack/meson.build create mode 100644 drivers/meson.build create mode 100644 drivers/net/i40e/meson.build create mode 100644 drivers/net/meson.build create mode 100644 lib/librte_acl/meson.build create mode 100644 lib/librte_cmdline/meson.build create mode 100644 lib/librte_compat/meson.build create mode 100644 lib/librte_eal/common/arch/x86/meson.build create mode 120000 lib/librte_eal/common/arch/x86_64 create mode 100644 lib/librte_eal/common/include/arch/x86/meson.build create mode 120000 lib/librte_eal/common/include/arch/x86_64 create mode 100644 lib/librte_eal/common/include/meson.build create mode 100644 lib/librte_eal/linuxapp/eal/meson.build create mode 100644 lib/librte_eal/linuxapp/meson.build create mode 100644 lib/librte_eal/meson.build create mode 100644 lib/librte_ether/meson.build create mode 100644 lib/librte_hash/meson.build create mode 100644 lib/librte_kvargs/meson.build create mode 100644 lib/librte_mbuf/meson.build create mode 100644 lib/librte_mempool/meson.build create mode 100644 lib/librte_metrics/meson.build create mode 100644 lib/librte_net/meson.build create mode 100644 lib/librte_ring/meson.build create mode 100644 lib/meson.build create mode 100644 meson.build create mode 100644 meson_options.txt create mode 100644 test/meson.build create mode 100644 test/test/meson.build -- 2.9.4