From patchwork Mon Oct 26 14:30:27 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Moessbauer, Felix" X-Patchwork-Id: 82197 Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id A8C74A04DC; Mon, 26 Oct 2020 15:30:44 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 7598D2BC7; Mon, 26 Oct 2020 15:30:43 +0100 (CET) Received: from david.siemens.de (david.siemens.de [192.35.17.14]) by dpdk.org (Postfix) with ESMTP id 2AC702BB8 for ; Mon, 26 Oct 2020 15:30:40 +0100 (CET) Received: from mail1.sbs.de (mail1.sbs.de [192.129.41.35]) by david.siemens.de (8.15.2/8.15.2) with ESMTPS id 09QEUemf006125 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 26 Oct 2020 15:30:40 +0100 Received: from derbion.ppmd.siemens.net (derbion.ppmd.siemens.net [139.25.68.102]) by mail1.sbs.de (8.15.2/8.15.2) with ESMTP id 09QEUdZ4003601; Mon, 26 Oct 2020 15:30:39 +0100 From: Felix Moessbauer To: keith.wiles@intel.com Cc: dev@dpdk.org, henning.schild@siemens.com, Felix Moessbauer Date: Mon, 26 Oct 2020 15:30:27 +0100 Message-Id: <20201026143027.15246-1-felix.moessbauer@siemens.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH] Add build option to enable/disable AVX2 support 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" 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 Signed-off-by: Felix Moessbauer --- 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')