From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 11472C3C0 for ; Thu, 26 Nov 2015 11:50:08 +0100 (CET) Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga103.jf.intel.com with ESMTP; 26 Nov 2015 02:50:07 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,346,1444719600"; d="scan'208";a="2587644" Received: from shvmail01.sh.intel.com ([10.239.29.42]) by fmsmga004.fm.intel.com with ESMTP; 26 Nov 2015 02:50:06 -0800 Received: from shecgisg004.sh.intel.com (shecgisg004.sh.intel.com [10.239.29.89]) by shvmail01.sh.intel.com with ESMTP id tAQAo4Eb004736; Thu, 26 Nov 2015 18:50:04 +0800 Received: from shecgisg004.sh.intel.com (localhost [127.0.0.1]) by shecgisg004.sh.intel.com (8.13.6/8.13.6/SuSE Linux 0.8) with ESMTP id tAQAo2U5024334; Thu, 26 Nov 2015 18:50:04 +0800 Received: (from dayuqiu@localhost) by shecgisg004.sh.intel.com (8.13.6/8.13.6/Submit) id tAQAo1H0024328; Thu, 26 Nov 2015 18:50:01 +0800 From: Michael Qiu To: dev@dpdk.org Date: Thu, 26 Nov 2015 18:49:57 +0800 Message-Id: <1448534997-24297-1-git-send-email-michael.qiu@intel.com> X-Mailer: git-send-email 1.7.4.1 Subject: [dpdk-dev] [PATCH] lib/librte_sched: Fix compile with gcc 4.3.4 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: , X-List-Received-Date: Thu, 26 Nov 2015 10:50:09 -0000 gcc 4.3.4 does not include "immintrin.h", and will post below error: lib/librte_sched/rte_sched.c:56:23: error: immintrin.h: No such file or directory To avoid this issue, a gcc version check is need and a flag to indicate vector ablility. Signed-off-by: Michael Qiu --- lib/librte_sched/rte_sched.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/lib/librte_sched/rte_sched.c b/lib/librte_sched/rte_sched.c index d47cfc2..780b314 100644 --- a/lib/librte_sched/rte_sched.c +++ b/lib/librte_sched/rte_sched.c @@ -53,7 +53,21 @@ #endif #ifdef RTE_SCHED_VECTOR + +#if (defined(__ICC) || (__GNUC__ == 4 && __GNUC_MINOR__ < 4)) + +#if defined(__AVX__) #include +#define SCHED_VECTOR_ENABLE +#endif + +#else + +#include +#define SCHED_VECTOR_ENABLE + +#endif + #endif #define RTE_SCHED_TB_RATE_CONFIG_ERR (1e-7) @@ -1667,7 +1681,7 @@ grinder_schedule(struct rte_sched_port *port, uint32_t pos) return 1; } -#ifdef RTE_SCHED_VECTOR +#ifdef SCHED_VECTOR_ENABLE static inline int grinder_pipe_exists(struct rte_sched_port *port, uint32_t base_pipe) -- 1.9.3