On 9/16/21 13:46, Van Haaren, Harry wrote:
>> -----Original Message-----
>> From: Ilya Maximets <[email protected]>
>> Sent: Wednesday, September 15, 2021 1:08 PM
>> To: ovs-dev <[email protected]>; Van Haaren, Harry
>> <[email protected]>; Stokes, Ian <[email protected]>; Ferriter,
>> Cian <[email protected]>
>> Cc: [email protected]; Eelco Chaudron <[email protected]>; Flavio
>> Leitner <[email protected]>
>> Subject: Build failure: attribute(target("avx512vpopcntdq")) is unknown
>>
>> Hi,
>>
>> On a weekend I noticed a following question on IRC:
>>
>> <Guest68> Compiling openvswitch v2.16.0; stuck at  ...#/bin/sh ./libtool  
>> --tag=CC
>> --mode=compile gcc -DHAVE_CONFIG_H -I.    -I ./include -I ./include -I ./lib 
>> -I ./lib
>> -mavx512f -mavx512bw -mavx512dq -mbmi -mbmi2 -fPIC -Wstrict-prototypes -
>> Wall -Wextra
>> -Wno-sign-compare -Wpointer-arith -Wformat -Wformat-security -Wswitch-
>> enum
>> -Wunused-parameter -Wbad-function-cast -Wcast-align -Wstrict-prototypes
>> -Wold-style-definition -Wmissing-prototypes -Wmissing-field-initializers
>> -fno-strict-aliasing -Wswitch-bool -Wlogical-not-parentheses -Wsizeof-array-
>> argument
>> -Wbool-compare -Wshadow    -g -O2 -MT
>> lib/libopenvswitchavx512_la-dpif-netdev-lookup-avx512-gather.lo -MD -MP -MF
>> lib/.deps/libopenvswitchavx512_la-dpif-netdev-lookup-avx512-gather.Tpo -c -o
>> lib/libopenvswitchavx512_la-dpif-netdev-lookup-avx512-gather.lo `test -f
>> 'lib/dpif-netdev-lookup-avx512-gather.c' || echo './'`
>> lib/dpif-netdev-lookup-avx512-gather.c
>> getting libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I ./include -I ./include 
>> -I ./lib -
>> I
>> ./lib -mavx512f -mavx512bw -mavx512dq -mbmi -mbmi2 -fPIC -Wstrict-
>> prototypes -Wall -Wextra
>> -Wno-sign-compare -Wpointer-arith -Wformat -Wformat-security -Wswitch-
>> enum
>> -Wunused-parameter -Wbad-function-cast -Wcast-align -Wstrict-prototypes
>> -Wold-style-definition -Wmissing-prototypes -Wmissing-field-initializers
>> -fno-strict-aliasing -Wswitch-bool -Wlogical-not-parentheses -Wsizeof-array-
>> argument
>> -Wbool-compare -Wshadow -g -O2 -MT
>> lib/libopenvswitchavx512_la-dpif-netdev-lookup-avx512-gather.lo -MD -MP -MF
>> lib/.deps/libopenvswitchavx512_la-dpif-netdev-lookup-avx512-gather.Tpo -c
>> lib/dpif-netdev-lookup-avx512-gather.c -o
>> lib/libopenvswitchavx512_la-dpif-netdev-lookup-avx512-gather.o
>> <Guest68> lib/dpif-netdev-lookup-avx512-gather.c:88:1: error:
>> attribute(target("avx512vpopcntdq")) is unknown
>> <Guest68>  {
>> <Guest68>  ^
>> <Guest68> lib/dpif-netdev-lookup-avx512-gather.c:356:47: error:
>> attribute(target("avx512vpopcntdq")) is unknown
>> <Guest68>                                         struct dpcls_rule **rules) 
>>             \
>> <Guest68>                                                ^
>> <Guest68> lib/dpif-netdev-lookup-avx512-gather.c:363:1: note: in expansion of
>> macro 'DECLARE_OPTIMIZED_LOOKUP_FUNCTION'
>> <Guest68>  DECLARE_OPTIMIZED_LOOKUP_FUNCTION(9, 4)
>> <Guest68>  ^
>> <Guest68> lib/dpif-netdev-lookup-avx512-gather.c:356:47: error:
>> attribute(target("avx512vpopcntdq")) is unknown
>> <Guest68>                                         struct dpcls_rule **rules) 
>>             \
>> <Guest68>                                                ^
>> <Guest68> lib/dpif-netdev-lookup-avx512-gather.c:364:1: note: in expansion of
>> macro 'DECLARE_OPTIMIZED_LOOKUP_FUNCTION'
>> <Guest68>  DECLARE_OPTIMIZED_LOOKUP_FUNCTION(9, 1)
>> <Guest68>  ^
>> <Guest68>  DECLARE_OPTIMIZED_LOOKUP_FUNCTION(4, 0)
>> <Guest68>  ^
>> <Guest68> Any help ?
>> <Guest68> The closest I found is  '[ovs-dev] [PATCH] dpcls: fix build on 
>> compilers
>> without AVX512-VPOPCNT',
>> <Guest68> but I can't see the patch.     TIA, Jan
> 
> Thanks for reporting/passing-on from IRC.
> 
>> Unfortunately, I noticed only after a few hours after, and reporter seems
>> to disconnect before I asked for details.  However, the case looks like
>> avx512 checks in ./configure passed, but compiler doesn't support the
>> attribute(target).  I'm not sure why this happened though.  But it seems
>> that not all copilers supports this attribute.  Do we need to check that
>> at configuration time?  Or do we need a knob to fully disable all avx512
>> stuff during configuration?
> 
> I'm not aware of any compilers that fail on this - so perhaps a very old 
> version
> is in use? I've tried to find an indicator of compiler version from the 
> output but
> I don't think there is any substantial info indicating anything...
> 
> I'm not sure taking an approach of specifically selecting compiler versions 
> and
> disabling them will work - alternative suggestion below.
> 
> 
>> While googling things around attribute 'target' I also noticed that it's
>> not supported by some older versions of clang and gcc, but we do not
>> check that anywhere.
> 
> Perhaps there's a way to ./configure time test if compiling a "target(isa)" 
> test fails,
> and then selectively disable the ISA optimizations? I expect only old 
> compilers will
> fail, which are likely only used for legacy systems anyway, so this seems an 
> acceptable
> solution?

Sounds OK to me.  There is an AC_COMPILE_IFELSE function that can be used.
See acinclude.m4 for usage examples.

> 
> 
>> Best regards, Ilya Maximets.
> 
> Regards, -Harry
> 

_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to