From: Bruce Richardson <bruce.richardson@intel.com>
To: dev@dpdk.org
Cc: Bruce Richardson <bruce.richardson@intel.com>
Subject: [PATCH 2/8] build: add detection and use of libnuma
Date: Tue, 17 Oct 2017 17:12:14 +0100 [thread overview]
Message-ID: <20171017161220.59941-3-bruce.richardson@intel.com> (raw)
In-Reply-To: <20171017161220.59941-1-bruce.richardson@intel.com>
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 <bruce.richardson@intel.com>
---
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')
--
2.13.6
next prev parent reply other threads:[~2017-10-17 16:12 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-17 16:12 [PATCH 0/8] Support sample applications with new build system Bruce Richardson
2017-10-17 16:12 ` [PATCH 1/8] build: add maths library to libs in pkg-config file Bruce Richardson
2017-10-17 18:11 ` Luca Boccassi
2017-10-17 18:17 ` Luca Boccassi
2017-10-18 9:35 ` Bruce Richardson
2017-10-18 9:51 ` Bruce Richardson
2017-10-18 10:14 ` Luca Boccassi
2017-10-18 12:24 ` Bruce Richardson
2017-10-18 14:20 ` Bruce Richardson
2017-10-18 15:28 ` Luca Boccassi
2017-10-18 19:13 ` Aaron Conole
2017-10-18 19:21 ` Thomas Monjalon
2017-10-19 8:38 ` Bruce Richardson
2017-10-18 11:20 ` Thomas Monjalon
2017-10-18 12:28 ` Bruce Richardson
2017-10-17 16:12 ` Bruce Richardson [this message]
2017-10-17 16:12 ` [PATCH 3/8] lpm: install vector header files Bruce Richardson
2017-10-17 16:12 ` [PATCH 4/8] event: add skeleton and sw eventdevs to meson build Bruce Richardson
2017-10-17 16:12 ` [PATCH 5/8] net/bonding: add " Bruce Richardson
2017-10-17 16:12 ` [PATCH 6/8] examples: allow building examples as part of a " Bruce Richardson
2017-10-17 16:12 ` [PATCH 7/8] examples: put app name and sources at top of makefiles Bruce Richardson
2017-10-17 16:12 ` [PATCH 8/8] examples: use pkg-config info when building examples Bruce Richardson
2017-10-18 17:11 ` [PATCH 0/8] Support sample applications with new build system Luca Boccassi
2017-10-19 8:39 ` Bruce Richardson
2017-10-23 10:43 ` Bruce Richardson
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=20171017161220.59941-3-bruce.richardson@intel.com \
--to=bruce.richardson@intel.com \
--cc=dev@dpdk.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.