Modify DPDK CFLAGS
authorKim Jones <kim-marie.jones@intel.com>
Tue, 5 Jul 2016 16:09:33 +0000 (17:09 +0100)
committerKim Jones <kim-marie.jones@intel.com>
Wed, 3 Aug 2016 12:44:14 +0000 (13:44 +0100)
The failed compile when there are no additional
flags on Ub14.04 is specific to GCC 4.8 and below.

This can be fixed by installing GCC 4.9, or
alternately by adding -mssse3 or newer ISA flag.

The opensource community have requested that we
simply document the GCC version requirement,
rather than adding GCC ISA flags to configure.ac

Change-Id: I8ec7bd3f094b0dd608381068fd6b18a74050d420
Signed-off-by: Kim Jones <kim-marie.jones@intel.com>
README
configure.ac

diff --git a/README b/README
index 6460078..ab6f44d 100644 (file)
--- a/README
+++ b/README
@@ -998,6 +998,16 @@ Note: DPDK 16.04 is the minimum version of DPDK required for the dpdkstat
 plugin. This is to allow the plugin to take advantage of functions added to
 detect if the DPDK primary process is alive.
 
+Note: For Ubuntu, GCC 4.9 is the minimum version required to build collectd
+with DPDK. Ubuntu 14.04, for example, has GCC 4.8 by default and will require
+an upgrade:
+  $ sudo add-apt-repository ppa:ubuntu-toolchain-r/test
+  $ sudo apt-get update
+  $ sudo apt-get install gcc-4.9
+Alternatively, if you know that the platform that you wish to run collectd
+on supports the SSSE3 instruction set, you can run make as follows:
+  $ make -j CFLAGS+='-mssse3'
+
 Build DPDK for use with collectd:
   To compile DPDK for use with collectd dpdkstat start by:
     - Clone DPDK:
@@ -1088,8 +1098,9 @@ NOTE: The Address-Space Layout Randomization (ASLR) security feature in Linux sh
 
     - Build collectd:
           $ make -j && make -j install.
-      NOTE: If you are building on Ubuntu 14.04 you need to use:
-          $  make -j CFLAGS+='-mavx' && make -j install
+      NOTE: As mentioned above, if you are building on Ubuntu 14.04 with GCC <= 4.8.X,
+        you need to use:
+          $  make -j CFLAGS+='-mssse3' && make -j install
 
 Usage of dpdkstat:
     - The same PCI device configuration should be passed to the primary process
index 9560bbb..82ea4bb 100644 (file)
@@ -2438,7 +2438,7 @@ then
 
        SAVE_CFLAGS="$CFLAGS"
        SAVE_LDFLAGS="$LDFLAGS"
-       CFLAGS="$CFLAGS -mavx -I$DPDK_INCLUDE"
+       CFLAGS="$CFLAGS -I$DPDK_INCLUDE"
        if test "x$LOCAL_DPDK_INSTALL" != "xtrue"
         then
             LDFLAGS="$LDFLAGS -L$DPDK_LIB_DIR"
@@ -2457,23 +2457,6 @@ then
         then
            AC_MSG_ERROR([cannot link with dpdk in $DPDK_LIB_DIR])
        fi
-       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"