From patchwork Tue Nov 17 18:14:42 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Ananyev, Konstantin" X-Patchwork-Id: 8964 Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id 49AE95A97; Tue, 17 Nov 2015 19:14:59 +0100 (CET) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 32F435A92 for ; Tue, 17 Nov 2015 19:14:58 +0100 (CET) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga102.jf.intel.com with ESMTP; 17 Nov 2015 10:14:56 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,309,1444719600"; d="scan'208";a="840775715" Received: from irvmail001.ir.intel.com ([163.33.26.43]) by fmsmga001.fm.intel.com with ESMTP; 17 Nov 2015 10:14:56 -0800 Received: from sivswdev01.ir.intel.com (sivswdev01.ir.intel.com [10.237.217.45]) by irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id tAHIEttb002660; Tue, 17 Nov 2015 18:14:55 GMT Received: from sivswdev01.ir.intel.com (localhost [127.0.0.1]) by sivswdev01.ir.intel.com with ESMTP id tAHIEt6n015301; Tue, 17 Nov 2015 18:14:55 GMT Received: (from kananye1@localhost) by sivswdev01.ir.intel.com with id tAHIEtfU015297; Tue, 17 Nov 2015 18:14:55 GMT From: Konstantin Ananyev To: dev@dpdk.org Date: Tue, 17 Nov 2015 18:14:42 +0000 Message-Id: <1447784082-15259-1-git-send-email-konstantin.ananyev@intel.com> X-Mailer: git-send-email 1.7.4.1 Subject: [dpdk-dev] [PATCH] ACL: fix build for native-icc target on haswell fails X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On HSW box with icc 16.0.0 build for x86_64-default-linuxapp-icc fails with: icc: command line warning #10120: overriding '-march=native' with '-msse4.1' ... dpdk.org/x86_64-native-linuxapp-icc/include/rte_memcpy.h(96): error: identifier "__m256i" is undefined The reason is that icc treats "-march=native ... -msse4.1" in a different way, then gcc and clang. For icc it means override all flags enabled with '-march=native' with '-msse4.1'. Even when '-march=native' is a superset for '-msse4.1'. To overcome the problem add a check is SSE4.1 compilation flag already enabled. If yes, then no need to add '-msse4.1' Similar change for avx2 compilation option. Fixes: 074f54ad03ee ("acl: fix build and runtime for default target") Reported-by: Declan Doherty Reported-by: Sergio Gonzalez Monroy Signed-off-by: Konstantin Ananyev --- lib/librte_acl/Makefile | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/lib/librte_acl/Makefile b/lib/librte_acl/Makefile index 7a1cf8a..ff63a0c 100644 --- a/lib/librte_acl/Makefile +++ b/lib/librte_acl/Makefile @@ -50,24 +50,35 @@ SRCS-$(CONFIG_RTE_LIBRTE_ACL) += acl_gen.c SRCS-$(CONFIG_RTE_LIBRTE_ACL) += acl_run_scalar.c SRCS-$(CONFIG_RTE_LIBRTE_ACL) += acl_run_sse.c -CFLAGS_acl_run_sse.o += -msse4.1 +#check if flag for SSE4.1 is already on, if not set it up manually +ifeq ($(findstring RTE_MACHINE_CPUFLAG_SSE4_1,$(CFLAGS)),) + CFLAGS_acl_run_sse.o += -msse4.1 +endif # # If the compiler supports AVX2 instructions, # then add support for AVX2 classify method. # -CC_AVX2_SUPPORT=$(shell $(CC) -march=core-avx2 -dM -E - &1 | \ -grep -q AVX2 && echo 1) +#check if flag for AVX2 is already on, if not set it up manually +ifeq ($(findstring RTE_MACHINE_CPUFLAG_AVX2,$(CFLAGS)),RTE_MACHINE_CPUFLAG_AVX2) + CC_AVX2_SUPPORT=1 +else + CC_AVX2_SUPPORT=\ + $(shell $(CC) -march=core-avx2 -dM -E - &1 | \ + grep -q AVX2 && echo 1) + ifeq ($(CC_AVX2_SUPPORT), 1) + ifeq ($(CC), icc) + CFLAGS_acl_run_avx2.o += -march=core-avx2 + else + CFLAGS_acl_run_avx2.o += -mavx2 + endif + endif +endif ifeq ($(CC_AVX2_SUPPORT), 1) SRCS-$(CONFIG_RTE_LIBRTE_ACL) += acl_run_avx2.c CFLAGS_rte_acl.o += -DCC_AVX2_SUPPORT - ifeq ($(CC), icc) - CFLAGS_acl_run_avx2.o += -march=core-avx2 - else - CFLAGS_acl_run_avx2.o += -mavx2 - endif endif # install this header file