From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH] lib/librte_sched: Fix compile with gcc 4.3.4 Date: Fri, 27 Nov 2015 09:59:38 +0100 Message-ID: <14808329.F48z9c4v47@xps13> References: <1448534997-24297-1-git-send-email-michael.qiu@intel.com> <40264692.U54vlS2tjY@xps13> <533710CFB86FA344BFBF2D6802E6028621B8CCF5@SHSMSX101.ccr.corp.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: dev@dpdk.org To: "Qiu, Michael" Return-path: Received: from mail-wm0-f41.google.com (mail-wm0-f41.google.com [74.125.82.41]) by dpdk.org (Postfix) with ESMTP id 29C875A31 for ; Fri, 27 Nov 2015 10:00:58 +0100 (CET) Received: by wmec201 with SMTP id c201so60757097wme.0 for ; Fri, 27 Nov 2015 01:00:58 -0800 (PST) In-Reply-To: <533710CFB86FA344BFBF2D6802E6028621B8CCF5@SHSMSX101.ccr.corp.intel.com> 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" 2015-11-27 02:26, Qiu, Michael: > On 2015/11/27 5:29, Thomas Monjalon wrote: > > 2015-11-26 18:49, Michael Qiu: > >> 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. > > [...] > >> +#if (defined(__ICC) || (__GNUC__ == 4 && __GNUC_MINOR__ < 4)) > >> + > >> +#if defined(__AVX__) > >> #include > >> +#define SCHED_VECTOR_ENABLE > >> +#endif > >> + > >> +#else > >> + > >> +#include > >> +#define SCHED_VECTOR_ENABLE > >> + > >> +#endif > > This kind of complication is managed by EAL. > > I think we should include rte_vect.h. > > As I know here it needs a flag to identify whether the platform support > AVX, if not it will not use it, so I don't know if we could only simply > include rte_vect.h? It's not exclusive. You can include rte_vect.h and check AVX to define SCHED_VECTOR_ENABLE.