Issue 1536 in webm: build fails: error: assigning to '__m512i' (vector of 8 'long long' values) from incompatible type 'int'

139 views
Skip to first unread message

hossam.a… via monorail

unread,
Jun 6, 2018, 4:27:26 PM6/6/18
to webm-d...@webmproject.org
Status: Unconfirmed
Owner: ----

New issue 1536 by hossam.a...@gmail.com: build fails: error: assigning to '__m512i' (vector of 8 'long long' values) from incompatible type 'int'
https://bugs.chromium.org/p/webm/issues/detail?id=1536

I am trying to build libvpx.

However, here is what I see:

vpx_dsp/x86/sad4d_avx512.c:27:14: warning: implicit declaration of function '_mm512_set1_epi16' is invalid in C99 [-Wimplicit-function-declaration]
sum_ref0 = _mm512_set1_epi16(0);
^
The code is:

23 ref0 = ref[0];
24 ref1 = ref[1];
25 ref2 = ref[2];
26 ref3 = ref[3];
27 sum_ref0 = _mm512_set1_epi16(0);
28 sum_ref1 = _mm512_set1_epi16(0);
29 sum_ref2 = _mm512_set1_epi16(0);
30 sum_ref3 = _mm512_set1_epi16(0);

A full description of the bug: https://trac.macports.org/ticket/55800

Potential solution: https://github.com/macports/macports-ports/commit/797915c5451d6c2fd20b1a9c9629536eb45534de

That solution is not clear to me -- Can you please help?

--
You received this message because:
1. The project was configured to send all issue notifications to this address

You may adjust your notification preferences at:
https://bugs.chromium.org/hosting/settings

hossam.a… via monorail

unread,
Jun 6, 2018, 4:36:29 PM6/6/18
to webm-d...@webmproject.org

Comment #1 on issue 1536 by hossam.a...@gmail.com: build fails: error: assigning to '__m512i' (vector of 8 'long long' values) from incompatible type 'int'
https://bugs.chromium.org/p/webm/issues/detail?id=1536#c1

System: Mac OSX 10.11.6

ya… via monorail

unread,
Jun 6, 2018, 5:11:48 PM6/6/18
to webm-d...@webmproject.org
Updates:
Cc: jz...@google.com
Owner: tomfi...@google.com
Status: Assigned

Comment #2 on issue 1536 by ya...@google.com: build fails: error: assigning to '__m512i' (vector of 8 'long long' values) from incompatible type 'int'
https://bugs.chromium.org/p/webm/issues/detail?id=1536#c2

jz… via monorail

unread,
Jun 6, 2018, 7:47:52 PM6/6/18
to webm-d...@webmproject.org

Comment #3 on issue 1536 by jz...@google.com: build fails: error: assigning to '__m512i' (vector of 8 'long long' values) from incompatible type 'int'
https://bugs.chromium.org/p/webm/issues/detail?id=1536#c3

It looks like support for avx512 was miss detected. Can you provide the cmake command line used and the full output of make VERBOSE=1?

hossam.a… via monorail

unread,
Jun 7, 2018, 12:28:17 PM6/7/18
to webm-d...@webmproject.org

Comment #4 on issue 1536 by hossam.a...@gmail.com: build fails: error: assigning to '__m512i' (vector of 8 'long long' values) from incompatible type 'int'
https://bugs.chromium.org/p/webm/issues/detail?id=1536#c4

Here is the output from make VERBOSE = 1:

[CC] vpx_dsp/x86/sad4d_avx512.c.o
vpx_dsp/x86/sad4d_avx512.c:29:14: warning: implicit declaration of function '_mm512_set1_epi16' is invalid in C99

[-Wimplicit-function-declaration]
sum_ref0 = _mm512_set1_epi16(0);
^
vpx_dsp/x86/sad4d_avx512.c:29:12: error: assigning to '__m512i' (vector of 8 'long long' values) from incompatible type
'int'
sum_ref0 = _mm512_set1_epi16(0);
^ ~~~~~~~~~~~~~~~~~~~~
vpx_dsp/x86/sad4d_avx512.c:30:12: error: assigning to '__m512i' (vector of 8 'long long' values) from incompatible type
'int'
sum_ref1 = _mm512_set1_epi16(0);
^ ~~~~~~~~~~~~~~~~~~~~
vpx_dsp/x86/sad4d_avx512.c:31:12: error: assigning to '__m512i' (vector of 8 'long long' values) from incompatible type
'int'
sum_ref2 = _mm512_set1_epi16(0);
^ ~~~~~~~~~~~~~~~~~~~~
vpx_dsp/x86/sad4d_avx512.c:32:12: error: assigning to '__m512i' (vector of 8 'long long' values) from incompatible type
'int'
sum_ref3 = _mm512_set1_epi16(0);
^ ~~~~~~~~~~~~~~~~~~~~
vpx_dsp/x86/sad4d_avx512.c:35:15: warning: implicit declaration of function '_mm512_loadu_si512' is invalid in C99
[-Wimplicit-function-declaration]
src_reg = _mm512_loadu_si512((const __m512i *)src);
^
vpx_dsp/x86/sad4d_avx512.c:35:13: error: assigning to '__m512i' (vector of 8 'long long' values) from incompatible type
'int'
src_reg = _mm512_loadu_si512((const __m512i *)src);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
vpx_dsp/x86/sad4d_avx512.c:36:14: error: assigning to '__m512i' (vector of 8 'long long' values) from incompatible type
'int'
ref0_reg = _mm512_loadu_si512((const __m512i *)ref0);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
vpx_dsp/x86/sad4d_avx512.c:37:14: error: assigning to '__m512i' (vector of 8 'long long' values) from incompatible type
'int'
ref1_reg = _mm512_loadu_si512((const __m512i *)ref1);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
vpx_dsp/x86/sad4d_avx512.c:38:14: error: assigning to '__m512i' (vector of 8 'long long' values) from incompatible type
'int'
ref2_reg = _mm512_loadu_si512((const __m512i *)ref2);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
vpx_dsp/x86/sad4d_avx512.c:39:14: error: assigning to '__m512i' (vector of 8 'long long' values) from incompatible type
'int'
ref3_reg = _mm512_loadu_si512((const __m512i *)ref3);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
vpx_dsp/x86/sad4d_avx512.c:41:16: warning: implicit declaration of function '_mm512_sad_epu8' is invalid in C99
[-Wimplicit-function-declaration]
ref0_reg = _mm512_sad_epu8(ref0_reg, src_reg);
^
vpx_dsp/x86/sad4d_avx512.c:41:14: error: assigning to '__m512i' (vector of 8 'long long' values) from incompatible type
'int'
ref0_reg = _mm512_sad_epu8(ref0_reg, src_reg);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
vpx_dsp/x86/sad4d_avx512.c:42:14: error: assigning to '__m512i' (vector of 8 'long long' values) from incompatible type
'int'
ref1_reg = _mm512_sad_epu8(ref1_reg, src_reg);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
vpx_dsp/x86/sad4d_avx512.c:43:14: error: assigning to '__m512i' (vector of 8 'long long' values) from incompatible type
'int'
ref2_reg = _mm512_sad_epu8(ref2_reg, src_reg);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
vpx_dsp/x86/sad4d_avx512.c:44:14: error: assigning to '__m512i' (vector of 8 'long long' values) from incompatible type
'int'
ref3_reg = _mm512_sad_epu8(ref3_reg, src_reg);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
vpx_dsp/x86/sad4d_avx512.c:63:16: warning: implicit declaration of function '_mm512_bslli_epi128' is invalid in C99
[-Wimplicit-function-declaration]
sum_ref1 = _mm512_bslli_epi128(sum_ref1, 4);
^
vpx_dsp/x86/sad4d_avx512.c:63:14: error: assigning to '__m512i' (vector of 8 'long long' values) from incompatible type
'int'
sum_ref1 = _mm512_bslli_epi128(sum_ref1, 4);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
vpx_dsp/x86/sad4d_avx512.c:64:14: error: assigning to '__m512i' (vector of 8 'long long' values) from incompatible type
'int'
sum_ref3 = _mm512_bslli_epi128(sum_ref3, 4);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
vpx_dsp/x86/sad4d_avx512.c:71:16: warning: implicit declaration of function '_mm512_unpacklo_epi64' is invalid in C99
[-Wimplicit-function-declaration]
sum_mlow = _mm512_unpacklo_epi64(sum_ref0, sum_ref2);
^
vpx_dsp/x86/sad4d_avx512.c:71:14: error: assigning to '__m512i' (vector of 8 'long long' values) from incompatible type
'int'
sum_mlow = _mm512_unpacklo_epi64(sum_ref0, sum_ref2);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
vpx_dsp/x86/sad4d_avx512.c:72:17: warning: implicit declaration of function '_mm512_unpackhi_epi64' is invalid in C99
[-Wimplicit-function-declaration]
sum_mhigh = _mm512_unpackhi_epi64(sum_ref0, sum_ref2);
^
vpx_dsp/x86/sad4d_avx512.c:72:15: error: assigning to '__m512i' (vector of 8 'long long' values) from incompatible type
'int'
sum_mhigh = _mm512_unpackhi_epi64(sum_ref0, sum_ref2);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
vpx_dsp/x86/sad4d_avx512.c:78:31: warning: implicit declaration of function '_mm512_castsi512_si256' is invalid in C99
[-Wimplicit-function-declaration]
sum256 = _mm256_add_epi32(_mm512_castsi512_si256(sum_mlow),
^
vpx_dsp/x86/sad4d_avx512.c:79:31: warning: implicit declaration of function '_mm512_extracti32x8_epi32' is invalid in C99
[-Wimplicit-function-declaration]
_mm512_extracti32x8_epi32(sum_mlow, 1));
^
vpx_dsp/x86/sad4d_avx512.c:78:31: error: passing 'int' to parameter of incompatible type '__m256i'
(vector of 4 'long long' values)
sum256 = _mm256_add_epi32(_mm512_castsi512_si256(sum_mlow),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/8.0.0/include/avx2intrin.h:92:26: note:
passing argument to parameter '__a' here
_mm256_add_epi32(__m256i __a, __m256i __b)
^
8 warnings and 18 errors generated.
make[1]: *** [vpx_dsp/x86/sad4d_avx512.c.o] Error 1
make: *** [.DEFAULT] Error 2

hossam.a… via monorail

unread,
Jun 7, 2018, 12:31:08 PM6/7/18
to webm-d...@webmproject.org

Comment #5 on issue 1536 by hossam.a...@gmail.com: build fails: error: assigning to '__m512i' (vector of 8 'long long' values) from incompatible type 'int'
https://bugs.chromium.org/p/webm/issues/detail?id=1536#c5

Do you know the way for displaying the cmake command line?

hossam.a… via monorail

unread,
Jun 7, 2018, 12:31:37 PM6/7/18
to webm-d...@webmproject.org

Comment #6 on issue 1536 by hossam.a...@gmail.com: build fails: error: assigning to '__m512i' (vector of 8 'long long' values) from incompatible type 'int'
https://bugs.chromium.org/p/webm/issues/detail?id=1536#c6

Do you know the way for displaying the full cmake command line?

tomfine… via monorail

unread,
Jun 7, 2018, 12:32:41 PM6/7/18
to webm-d...@webmproject.org

Comment #7 on issue 1536 by tomfi...@google.com: build fails: error: assigning to '__m512i' (vector of 8 'long long' values) from incompatible type 'int'
https://bugs.chromium.org/p/webm/issues/detail?id=1536#c7

I think jzern@ meant the configure command line. Are you passing any arguments to configure, or just using the default configuration?

hossam.a… via monorail

unread,
Jun 7, 2018, 1:34:08 PM6/7/18
to webm-d...@webmproject.org

Comment #8 on issue 1536 by hossam.a...@gmail.com: build fails: error: assigning to '__m512i' (vector of 8 'long long' values) from incompatible type 'int'
https://bugs.chromium.org/p/webm/issues/detail?id=1536#c8

I am using the default configuration

tomfine… via monorail

unread,
Jun 7, 2018, 1:45:30 PM6/7/18
to webm-d...@webmproject.org

Comment #9 on issue 1536 by tomfi...@google.com: build fails: error: assigning to '__m512i' (vector of 8 'long long' values) from incompatible type 'int'
https://bugs.chromium.org/p/webm/issues/detail?id=1536#c9

The macports bug you cite in your bug report seems to clearly point out that this is an issue with older clang releases. What version of Xcode are you using, and is there a reason why you can't use a newer release?

jz… via monorail

unread,
Jun 7, 2018, 1:47:39 PM6/7/18
to webm-d...@webmproject.org

Comment #10 on issue 1536 by jz...@google.com: build fails: error: assigning to '__m512i' (vector of 8 'long long' values) from incompatible type 'int'
https://bugs.chromium.org/p/webm/issues/detail?id=1536#c10

Sorry for the confusion, I mistook this as an aomedia bug report.
I was looking for the output from the ./configure run and make V=1 in this case; note there are no spaces around the '=' in the command line.

jz… via monorail

unread,
Jun 7, 2018, 1:48:56 PM6/7/18
to webm-d...@webmproject.org
Updates:
Cc: johannko...@google.com

Comment #11 on issue 1536 by jz...@google.com: build fails: error: assigning to '__m512i' (vector of 8 'long long' values) from incompatible type 'int'
https://bugs.chromium.org/p/webm/issues/detail?id=1536#c11

A workaround for now would be adding --disable-avx512 to the configure command line.

hossam.a… via monorail

unread,
Jun 7, 2018, 2:52:20 PM6/7/18
to webm-d...@webmproject.org

Comment #12 on issue 1536 by hossam.a...@gmail.com: build fails: error: assigning to '__m512i' (vector of 8 'long long' values) from incompatible type 'int'
https://bugs.chromium.org/p/webm/issues/detail?id=1536#c12

My Xcode version is Version 8.2.1 (8C1002) - I checked for Xcode updates, and I have the most updated one.

I have already shown the output with 'make V=1' without space -- Sorry about my typo.

I added --disable-avx512 and now libvpx produces:

test/bench.cc:34:12: error: use of undeclared identifier 'abs'
sad += abs(times[t] - med);
^
1 error generated.

Another question, do you run vp9 from ffmpeg? or you can run it as a standalone application?

I appreciate your support!

tomfine… via monorail

unread,
Jun 7, 2018, 3:11:37 PM6/7/18
to webm-d...@webmproject.org

Comment #13 on issue 1536 by tomfi...@google.com: build fails: error: assigning to '__m512i' (vector of 8 'long long' values) from incompatible type 'int'
https://bugs.chromium.org/p/webm/issues/detail?id=1536#c13


> I have already shown the output with 'make V=1' without space -- Sorry about my typo.

It hasn't been added to the bug:

> [CC] vpx_dsp/x86/sad4d_avx512.c.o

Instead of "[CC] vpx_dsp/x86/sad4d_avx512.c.o" you would see a full compile command here for make V=1.


> I added --disable-avx512 and now libvpx produces:
>
> test/bench.cc:34:12: error: use of undeclared identifier 'abs'
> sad += abs(times[t] - med);
> ^
> 1 error generated.

If you're not running the unit tests your can work around this by adding --disable-unit-tests to your configure command.


> Another question, do you run vp9 from ffmpeg? or you can run it as a standalone application?

Both. VP9 video can be encoded using vpxenc from the libvpx repository, or by including libvpx in an FFmpeg build. Note, generally speaking, the bug tracker is not a help forum. This question would be better posed on a mailing list like webm-d...@webmproject.org.

hossam.a… via monorail

unread,
Jun 7, 2018, 4:16:12 PM6/7/18
to webm-d...@webmproject.org

Comment #14 on issue 1536 by hossam.a...@gmail.com: build fails: error: assigning to '__m512i' (vector of 8 'long long' values) from incompatible type 'int'
https://bugs.chromium.org/p/webm/issues/detail?id=1536#c14


> Instead of "[CC] vpx_dsp/x86/sad4d_avx512.c.o" you would see a full compile command here for make V=1.

Here is the command that produced the original error:
gcc -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk -mmacosx-version-min=10.11 -m64 -arch x86_64 -DNDEBUG -O3 -Wall -Wdeclaration-after-statement -Wdisabled-optimization -Wfloat-conversion -Wparentheses-equality -Wpointer-arith -Wtype-limits -Wcast-qual -Wvla -Wimplicit-function-declaration -Wuninitialized -Wunused -Wextra -Wundef -Wframe-larger-than=52000 -Wshorten-64-to-32 -I. -I"/Users/hossam.amer/7aS7aS_Works/work/workspace/vp9/src/libvpx" -mavx512f -mavx512cd -mavx512bw -mavx512dq -mavx512vl -c -o vpx_dsp/x86/sad4d_avx512.c.o vpx_dsp/x86/sad4d_avx512.c


> If you're not running the unit tests your can work around this by adding --disable-unit-tests to your configure command.

If I do this, this is what I get:
Undefined symbols for architecture x86_64:
"_vpx_sad64x64x4d_avx512", referenced from:
_setup_rtcd_internal in libvpx.a(vpx_dsp_rtcd.c.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[1]: *** [vpxdec] Error 1

make: *** [.DEFAULT] Error 2


> Both. VP9 video can be encoded using vpxenc from the libvpx repository, or by including libvpx in an FFmpeg build. Note, generally speaking, the bug tracker is not a help forum. This question would be better posed on a mailing list like webm-d...@webmproject.org.

Sure! Do you think that I should post my last questions over there?

bugdro… via monorail

unread,
Jun 8, 2018, 11:11:55 AM6/8/18
to webm-d...@webmproject.org

Comment #15 on issue 1536 by bugd...@chromium.org: build fails: error: assigning to '__m512i' (vector of 8 'long long' values) from incompatible type 'int'
https://bugs.chromium.org/p/webm/issues/detail?id=1536#c15

The following revision refers to this bug:
https://chromium.googlesource.com/webm/libvpx/+/393f7856587d58292febb0a3e82edc405aab4498

commit 393f7856587d58292febb0a3e82edc405aab4498
Author: Tom Finegan <tomfi...@google.com>
Date: Thu Jun 07 23:05:48 2018

Add avx512 compile test.

Some compiler releases allow the -mavx512f arg without actually
implementing support. Test for this situation, and disable avx512
when it is detected by configure.

BUG=webm:1536

Change-Id: I63952153bb4b24aa9f25267ed47a0fe845d61f8b

[modify] https://crrev.com/393f7856587d58292febb0a3e82edc405aab4498/build/make/configure.sh

tomfine… via monorail

unread,
Jun 8, 2018, 11:26:33 AM6/8/18
to webm-d...@webmproject.org
Updates:
Status: Fixed

Comment #16 on issue 1536 by tomfi...@google.com: build fails: error: assigning to '__m512i' (vector of 8 'long long' values) from incompatible type 'int'
https://bugs.chromium.org/p/webm/issues/detail?id=1536#c16

This is "fixed" in that the reported issue will no longer occur, but additional checks that map specific AVX512 intrinsics to their corresponding flags might be necessary.

For example, in Xcode 9.3.1, AppleClang enables _mm512_set1_epi16() with the -mavx512f flag. The patch in #15 tests that combination (-mavx512f with a compile test that uses _mm512_set1_epi16()). The patch simply disables all AVX512 optimizations when the test fails. It's theoretically possible that a compiler release will support that combination while not supporting others, and in that case the fix here will need to be extended.

Marking fixed for now since the reported issue no longer reproduces. This bug could need to be reopened.
Reply all
Reply to author
Forward
0 new messages