From 33027afd229cdc3c7066105b20bbb791cb3341f6 Mon Sep 17 00:00:00 2001 From: William Tu Date: Wed, 26 Jan 2022 19:45:26 -0800 Subject: acinclude: Detect avx512 vpopcntdq compiler support. Ubuntu Xenial 16.04 is using GCC 5.4 and it does not support target "-mavx512vpopcntdq" and cuases error lib/dpif-netdev-lookup-avx512-gather.c:356:47: error: attribute(target("avx512vpopcntdq")) is unknown GCC 7+ supports vpopcntdq: https://gcc.gnu.org/gcc-7/changes.html The patch detects vpopcntdq and disables AVX512 when not found. Fixes: 1e314891340d ("dpcls-avx512: Enable avx512 vector popcount instruction.") Reported-by: Greg Rose Signed-off-by: William Tu Tested-by: Greg Rose Reviewed-by: Greg Rose Acked-by: Cian Ferriter Signed-off-by: Ian Stokes --- acinclude.m4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'acinclude.m4') diff --git a/acinclude.m4 b/acinclude.m4 index 5c971e98c..0c360fd1e 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -77,7 +77,7 @@ dnl Checks if compiler and binutils supports AVX512. AC_DEFUN([OVS_CHECK_AVX512], [ OVS_CHECK_BINUTILS_AVX512 OVS_CHECK_CC_OPTION( - [-mavx512f], [ovs_have_cc_mavx512f=yes], [ovs_have_cc_mavx512f=no]) + [-mavx512f -mavx512vpopcntdq], [ovs_have_cc_mavx512f=yes], [ovs_have_cc_mavx512f=no]) AM_CONDITIONAL([HAVE_AVX512F], [test $ovs_have_cc_mavx512f = yes]) if test "$ovs_have_cc_mavx512f" = yes; then AC_DEFINE([HAVE_AVX512F], [1], -- cgit v1.2.1