DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] Add build option to enable/disable AVX2 support
@ 2020-10-26 14:30 Felix Moessbauer
  2020-10-27 11:47 ` Bruce Richardson
  2020-10-29 13:36 ` Wiles, Keith
  0 siblings, 2 replies; 3+ messages in thread
From: Felix Moessbauer @ 2020-10-26 14:30 UTC (permalink / raw)
  To: keith.wiles; +Cc: dev, henning.schild, Felix Moessbauer

This patch introduces a meson option to disable the AVX2 support.
If the build should be for a target without AVX2 support, the
know can be turned to false, even if the compiler supports AVX2.

Signed-off-by: Felix Moessbauer <felix.moessbauer@siemens.com>
---
 meson.build       | 3 ++-
 meson_options.txt | 1 +
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/meson.build b/meson.build
index 0ee98be..2e2380c 100644
--- a/meson.build
+++ b/meson.build
@@ -18,7 +18,8 @@ pktgen_conf = configuration_data()
 cc = meson.get_compiler('c')
 
 add_project_arguments('-march=native', language: 'c')
-if cc.has_argument('-mavx2')
+
+if get_option('enable-avx2') and cc.has_argument('-mavx2')
 	add_project_arguments('-mavx2', language: 'c')
 endif
 add_project_arguments('-DALLOW_EXPERIMENTAL_API', language: 'c')
diff --git a/meson_options.txt b/meson_options.txt
index 7b42577..c419517 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -1,3 +1,4 @@
 option('enable_lua', type: 'boolean', value: false, description: 'Enable Lua support')
 option('enable_gui', type: 'boolean', value: false, description: 'build the gui')
 option('enable_docs', type: 'boolean', value: false, description: 'build documentation')
+option('enable-avx2', type: 'boolean', value: true, description: 'compile with AVX2 support')
-- 
2.20.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-10-29 13:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-26 14:30 [dpdk-dev] [PATCH] Add build option to enable/disable AVX2 support Felix Moessbauer
2020-10-27 11:47 ` Bruce Richardson
2020-10-29 13:36 ` Wiles, Keith

DPDK patches and discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/dev/0 dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dev dev/ https://inbox.dpdk.org/dev \
		dev@dpdk.org
	public-inbox-index dev

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dev


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git