From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id AE79A460D5; Tue, 21 Jan 2025 17:41:25 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7B0B5402A4; Tue, 21 Jan 2025 17:41:25 +0100 (CET) Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.17]) by mails.dpdk.org (Postfix) with ESMTP id 8A8524027D for ; Tue, 21 Jan 2025 17:41:23 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1737477684; x=1769013684; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=pEmBehIuU7fech3sFNvieNRNglo8uMG9PqU5lJZSgpY=; b=b/CDs21BKT9SHyJW1nya2jKrHz2rUUMSHW3CIr6ab+uLDin+jhvWJsHB xBMdofuZOPiR4d9RxdnevJ/vNVmTD8PC248PVG5ofLGufbKxfuPdNhVur qKJ83rKDqMcsv8CRwNHJzZ4JQDaAaRH9Z9XAnrQdpBL4BE/jmnBlKJLBx wMAwFQDoqmyew2jcs6m/Fo4j8+ZlmRGDBsogmyVmmfRMmPg4QDPL/2cKk TdxVDhh9h9fLfD7W0wBsq3AQniRG+5CtWiQSH0Uy4lVTbO4/W5h3zYVP9 tVXaJrUHtx/3BKT2Q4Tg/bkqbTs01bKA5xYwWEsKYGLG5f+Sg3nssqeYY w==; X-CSE-ConnectionGUID: XPcaIbFxT7OTBZzK/Dinvw== X-CSE-MsgGUID: mjroJluCTnm0NQCioykBPA== X-IronPort-AV: E=McAfee;i="6700,10204,11322"; a="37923116" X-IronPort-AV: E=Sophos;i="6.13,222,1732608000"; d="scan'208";a="37923116" Received: from orviesa007.jf.intel.com ([10.64.159.147]) by orvoesa109.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Jan 2025 08:41:23 -0800 X-CSE-ConnectionGUID: vktKqiwUTsWPJyfXh6nnEA== X-CSE-MsgGUID: k4KnaHamT4Wc9k0LT4Be+Q== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.12,224,1728975600"; d="scan'208";a="107302517" Received: from silpixa00401197coob.ir.intel.com (HELO silpixa00401385.ir.intel.com) ([10.237.214.45]) by orviesa007.jf.intel.com with ESMTP; 21 Jan 2025 08:41:22 -0800 From: Bruce Richardson To: dev@dpdk.org Cc: Bruce Richardson Subject: [PATCH] build: allow disabling avx512 support via compiler flag Date: Tue, 21 Jan 2025 16:41:14 +0000 Message-ID: <20250121164114.2311086-1-bruce.richardson@intel.com> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org DPDK build checks for build support for various instruction sets by checking both the target machine and the compiler for support. However, any disabling of instruction sets via compiler flags was not taken into account in many cases. For AVX512 support, check for a user-specified "no-avx512f" flag in the c_args parameter before checking if the compiler can actually build AVX512 code. As well as providing an option for the user, this can be used to test builds without AVX512 without having to use an older compiler. Signed-off-by: Bruce Richardson --- config/x86/meson.build | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/config/x86/meson.build b/config/x86/meson.build index 5455bb0210..47a5b0c04a 100644 --- a/config/x86/meson.build +++ b/config/x86/meson.build @@ -17,7 +17,8 @@ endif cc_avx512_flags = ['-mavx512f', '-mavx512vl', '-mavx512dq', '-mavx512bw'] cc_has_avx512 = false target_has_avx512 = false -if binutils_ok and cc.has_multi_arguments(cc_avx512_flags) +if (binutils_ok and cc.has_multi_arguments(cc_avx512_flags) + and '-mno-avx512f' not in get_option('c_args')) # check if compiler is working with _mm512_extracti64x4_epi64 # Ref: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82887 code = '''#include -- 2.43.0