summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 3e3e104)
raw | patch | inline | side by side (parent: 3e3e104)
author | Maryam Tahhan <maryam.tahhan@intel.com> | |
Tue, 7 Jun 2016 11:31:44 +0000 (12:31 +0100) | ||
committer | Kim Jones <kim-marie.jones@intel.com> | |
Thu, 28 Jul 2016 12:23:38 +0000 (13:23 +0100) |
Check AVX support before adding -mavx flag.
Change-Id: I2de2a12704126590ef991de89880ad5bd5c3805e
Signed-off-by: Maryam Tahhan <maryam.tahhan@intel.com>
Change-Id: I2de2a12704126590ef991de89880ad5bd5c3805e
Signed-off-by: Maryam Tahhan <maryam.tahhan@intel.com>
configure.ac | patch | blob | history |
diff --git a/configure.ac b/configure.ac
index 098829964017ad7fadb7dca7e0a58e6296ec0395..5b7a950589334e85981be66ae9b5dfd07ea620af 100644 (file)
--- a/configure.ac
+++ b/configure.ac
then
AC_MSG_ERROR([cannot link with dpdk in $DPDK_LIB_DIR])
fi
- BUILD_WITH_DPDK_CFLAGS="-mavx -fPIC -I$DPDK_INCLUDE"
+ BUILD_WITH_DPDK_CFLAGS=""
+ AC_MSG_NOTICE([Checking for avx instructions])
+ AC_RUN_IFELSE(
+ [AC_LANG_PROGRAM(
+[[
+#include <immintrin.h>
+]],
+[[
+__m128i zero = _mm_setzero_si128();
+]]
+ )],
+ [HAVE_AVX=true], [HAVE_AVX=false])
+ if test "x$HAVE_AVX" = "xtrue"
+ then
+ BUILD_WITH_DPDK_CFLAGS="-mavx "
+ AC_MSG_NOTICE([avx instructions supported])
+ fi
+
+ BUILD_WITH_DPDK_CFLAGS+="-fPIC -I$DPDK_INCLUDE"
if test "x$LOCAL_DPDK_INSTALL" != "xtrue"
then
BUILD_WITH_DPDK_LDFLAGS="-Wl,--no-as-needed"