From e5867b0f09cedb5710550f20662876683c6e602e Mon Sep 17 00:00:00 2001 From: Kim Jones Date: Tue, 5 Jul 2016 17:09:33 +0100 Subject: [PATCH] Modify DPDK CFLAGS 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 --- README | 15 +++++++++++++-- configure.ac | 19 +------------------ 2 files changed, 14 insertions(+), 20 deletions(-) diff --git a/README b/README index 64600782..ab6f44dd 100644 --- 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 diff --git a/configure.ac b/configure.ac index 9560bbbb..82ea4bb2 100644 --- a/configure.ac +++ b/configure.ac @@ -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 -]], -[[ -__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" -- 2.30.2