DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] lib/librte_sched: Fix compile with gcc 4.3.4
@ 2015-11-26 10:49 Michael Qiu
  2015-11-26 21:28 ` Thomas Monjalon
                   ` (2 more replies)
  0 siblings, 3 replies; 15+ messages in thread
From: Michael Qiu @ 2015-11-26 10:49 UTC (permalink / raw)
  To: dev

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 <michael.qiu@intel.com>
---
 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 <immintrin.h>
+#define SCHED_VECTOR_ENABLE
+#endif
+
+#else
+
+#include <x86intrin.h>
+#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

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2015-12-02 22:10 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-26 10:49 [dpdk-dev] [PATCH] lib/librte_sched: Fix compile with gcc 4.3.4 Michael Qiu
2015-11-26 21:28 ` Thomas Monjalon
2015-11-27  2:26   ` Qiu, Michael
2015-11-27  8:59     ` Thomas Monjalon
2015-11-27 11:53       ` Qiu, Michael
2015-11-27 12:34         ` Ananyev, Konstantin
2015-11-27 14:01           ` Qiu, Michael
2015-11-27 14:09             ` Ananyev, Konstantin
2015-11-27 15:22               ` Qiu, Michael
2015-11-27 16:21                 ` Ananyev, Konstantin
2015-12-02  2:09 ` [dpdk-dev] [PATCH v2] " Michael Qiu
2015-12-02  2:18   ` Thomas Monjalon
2015-12-02  2:29     ` Qiu, Michael
2015-12-02  2:39 ` [dpdk-dev] [PATCH v3] " Michael Qiu
2015-12-02 22:10   ` Thomas Monjalon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).