From patchwork Tue Oct 17 16:12:14 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bruce Richardson X-Patchwork-Id: 30485 X-Patchwork-Delegate: bruce.richardson@intel.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 2F0391B7F6; Tue, 17 Oct 2017 18:12:57 +0200 (CEST) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id 3E33D1B7F4 for ; Tue, 17 Oct 2017 18:12:54 +0200 (CEST) Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga105.fm.intel.com with ESMTP; 17 Oct 2017 09:12:53 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.43,391,1503385200"; d="scan'208";a="163648749" Received: from silpixa00399126.ir.intel.com (HELO silpixa00399126.ger.corp.intel.com) ([10.237.223.223]) by fmsmga005.fm.intel.com with ESMTP; 17 Oct 2017 09:12:53 -0700 From: Bruce Richardson To: dev@dpdk.org Cc: Bruce Richardson Date: Tue, 17 Oct 2017 17:12:14 +0100 Message-Id: <20171017161220.59941-3-bruce.richardson@intel.com> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20171017161220.59941-1-bruce.richardson@intel.com> References: <20171017161220.59941-1-bruce.richardson@intel.com> Subject: [dpdk-dev] [PATCH 2/8] build: add detection and use of libnuma 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" DPDK has an optional dependency on libnuma, so manage that through the build system, by dynamically detecting the presence of the needed library and header files. Since this library is used by both EAL and vhost, check for the presence at the top level in the config directory. Signed-off-by: Bruce Richardson --- config/meson.build | 10 ++++++++++ lib/librte_eal/linuxapp/eal/meson.build | 3 +++ lib/librte_vhost/meson.build | 3 +++ 3 files changed, 16 insertions(+) diff --git a/config/meson.build b/config/meson.build index 542fea4de..ce26a29f0 100644 --- a/config/meson.build +++ b/config/meson.build @@ -37,6 +37,16 @@ add_project_arguments('-march=@0@'.format(machine), language: 'c') add_project_link_arguments('-lm', language: 'c') dpdk_extra_ldflags += '-lm' +# check for libraries used in multiple places in DPDK +has_libnuma = 0 +numa_dep = cc.find_library('numa', required: false) +if numa_dep.found() and cc.has_header('numaif.h') + dpdk_conf.set10('RTE_HAS_LIBNUMA', true) + has_libnuma = 1 + add_project_link_arguments('-lnuma', language: 'c') + dpdk_extra_ldflags += '-lnuma' +endif + # add -include rte_config to cflags add_project_arguments('-include', 'rte_config.h', language: 'c') diff --git a/lib/librte_eal/linuxapp/eal/meson.build b/lib/librte_eal/linuxapp/eal/meson.build index c0ceacd61..0d1ebad2f 100644 --- a/lib/librte_eal/linuxapp/eal/meson.build +++ b/lib/librte_eal/linuxapp/eal/meson.build @@ -50,6 +50,9 @@ sources = ['eal_alarm.c', ] eal_extra_link_arg = '-ldl' +if has_libnuma == 1 + dpdk_conf.set10('RTE_EAL_NUMA_AWARE_HUGEPAGES', true) +endif if get_option('per_library_versions') lib_version = '@0@.1'.format(version) diff --git a/lib/librte_vhost/meson.build b/lib/librte_vhost/meson.build index 9674dd056..c62c9ead2 100644 --- a/lib/librte_vhost/meson.build +++ b/lib/librte_vhost/meson.build @@ -32,6 +32,9 @@ if host_machine.system() != 'linux' build = false endif +if has_libnuma == 1 + dpdk_conf.set10('RTE_LIBRTE_VHOST_NUMA', true) +endif version = 4 sources = files('fd_man.c', 'iotlb.c', 'socket.c', 'vhost.c', 'vhost_user.c', 'virtio_net.c')