ericmckean / webm

Automatically exported from code.google.com/p/webm
0 stars 0 forks source link

libvpx build fails with SSSE3 disabled #724

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Trying to build with SSSE3 disabled due to the system assembler OpenBSD has 
fails..

$ cd libvpx-1.3.0/
$ ./configure --disable-optimizations --disable-unit-tests --enable-shared 
--disable-ssse3
Configuring selected codecs
  enabling vp8_encoder
  enabling vp8_decoder
  enabling vp9_encoder
  enabling vp9_decoder
Configuring for target 'x86_64-linux-gcc'
  enabling x86_64
  enabling pic
  enabling runtime_cpu_detect
  enabling mmx
  enabling sse
  enabling sse2
  enabling sse3
  using yasm
  checking here for x86inc "x86_64" "yes" 
  enabling use_x86inc
  enabling postproc
Creating makefiles for x86_64-linux-gcc libs
Creating makefiles for x86_64-linux-gcc examples
Creating makefiles for x86_64-linux-gcc docs

Compiler / assembler: GCC 4.2.1 / binutils 2.15

    [CC] vp9/encoder/x86/vp9_dct_sse2.c.o
cc1: warning: -Wuninitialized is not supported without -O
In file included from /usr/include/emmintrin.h:34,
                 from vp9/encoder/x86/vp9_dct_sse2.c:11:
/usr/include/xmmintrin.h: In function '_mm_loadh_pi':
/usr/include/xmmintrin.h:750: warning: cast discards qualifiers from pointer 
target type
/usr/include/xmmintrin.h: In function '_mm_loadl_pi':
/usr/include/xmmintrin.h:779: warning: cast discards qualifiers from pointer 
target type
/usr/include/xmmintrin.h: In function '_mm_load_ps':
/usr/include/xmmintrin.h:904: warning: cast discards qualifiers from pointer 
target type
/usr/include/xmmintrin.h: In function '_mm_loadr_ps':
/usr/include/xmmintrin.h:918: warning: cast discards qualifiers from pointer 
target type
In file included from vp9/encoder/x86/vp9_dct_sse2.c:11:
/usr/include/emmintrin.h: In function '_mm_load_pd':
/usr/include/emmintrin.h:104: warning: cast discards qualifiers from pointer 
target type
/usr/include/emmintrin.h: In function '_mm_loadl_epi64':
/usr/include/emmintrin.h:689: warning: cast discards qualifiers from pointer 
target type
vp9/encoder/x86/vp9_dct_sse2.c: In function 'vp9_short_fht8x8_sse2':
vp9/encoder/x86/vp9_dct_sse2.c:567: error: shift must be an immediate

Original issue reported on code.google.com by brad.ope...@gmail.com on 7 Mar 2014 at 10:29

GoogleCodeExporter commented 9 years ago
Can you be more specific about your issue? Are you trying to build with an 
older version of yasm? What is the system assembler? From the output, it looks 
like an issue with the sse2 code. That particular issue has been fixed in 
master. Can you please try master?

Disabling individual extensions has become more complicated. It's currently 
only possible to disable an extension plus all higher extensions because the 
code gets re-used in some interesting ways.

Original comment by johannko...@google.com on 17 Mar 2014 at 10:31

GoogleCodeExporter commented 9 years ago
The issue being that the compiler and assembler do not support SSSE3 support.

cc  -O2 -pipe -m64 -fPIC -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0 
-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -Wall -Wdeclaration-after-statement 
-Wdisabled-optimization -Wpointer-arith -Wcast-qual 
-Wimplicit-function-declaration -Wuninitialized -Wunused-variable 
-Wno-unused-function -I. -I"/home/ports/pobj/libvpx-1.3.0/libvpx-v1.3.0" 
-mssse3 -c -o vp8/common/x86/variance_ssse3.c.o vp8/common/x86/variance_ssse3.c
cc1: error: unrecognized command line option "-mssse3"

So the SSSE3 support was being manually disabled to try to get libvpx to build. 
But as you can see from the error above it still does not build.

As long as MMX / SSE / SSE2 / SSE3 support is utilized that is fine.

Original comment by brad.ope...@gmail.com on 18 Mar 2014 at 12:11

GoogleCodeExporter commented 9 years ago
Please try with --disable-ssse3 --disable-sse4 --disable-avx2

The build error above is an issue with the sse2 code which was fixed in head. 
Can you give it another try please?

Original comment by johannko...@google.com on 18 Mar 2014 at 12:15

GoogleCodeExporter commented 9 years ago
Even with Git code I cannot build..

I tried with..

--disable-ssse3 --disable-sse4_1 --disable-avx --disable-avx2
--disable-sse3 --disable-ssse3 --disable-sse4_1 --disable-avx --disable-avx2

    [CC] vp9/encoder/x86/vp9_dct_sse2.c.o
In file included from /usr/include/emmintrin.h:34,
                 from vp9/encoder/x86/vp9_dct_sse2.c:11:
/usr/include/xmmintrin.h: In function '_mm_loadh_pi':
/usr/include/xmmintrin.h:750: warning: cast discards qualifiers from pointer 
target type
/usr/include/xmmintrin.h: In function '_mm_loadl_pi':
/usr/include/xmmintrin.h:779: warning: cast discards qualifiers from pointer 
target type
/usr/include/xmmintrin.h: In function '_mm_load_ps':
/usr/include/xmmintrin.h:904: warning: cast discards qualifiers from pointer 
target type
/usr/include/xmmintrin.h: In function '_mm_loadr_ps':
/usr/include/xmmintrin.h:918: warning: cast discards qualifiers from pointer 
target type
In file included from vp9/encoder/x86/vp9_dct_sse2.c:11:
/usr/include/emmintrin.h: In function '_mm_load_pd':
/usr/include/emmintrin.h:104: warning: cast discards qualifiers from pointer 
target type
/usr/include/emmintrin.h: In function '_mm_loadl_epi64':
/usr/include/emmintrin.h:689: warning: cast discards qualifiers from pointer 
target type
vp9/encoder/x86/vp9_dct_sse2.c: In function 'vp9_fdct4x4_sse2':
vp9/encoder/x86/vp9_dct_sse2.c:183: error: shift must be an immediate
vp9/encoder/x86/vp9_dct_sse2.c:184: error: shift must be an immediate
vp9/encoder/x86/vp9_dct_sse2.c:185: error: shift must be an immediate
vp9/encoder/x86/vp9_dct_sse2.c:186: error: shift must be an immediate
Makefile:138: recipe for target 'vp9/encoder/x86/vp9_dct_sse2.c.o' failed

If I use also --disable-sse2 in addition to..
--disable-sse3 --disable-ssse3 --disable-sse4_1 --disable-avx --disable-avx2

I can get further but it fails at..

    [CC] third_party/libyuv/source/scale.c.o
/tmp//cc0dVhz1.s: Assembler messages:
/tmp//cc0dVhz1.s:796: Error: no such instruction: `palignr $0x8,%xmm0,%xmm1'
/tmp//cc0dVhz1.s:870: Error: no such instruction: `pmaddubsw %xmm5,%xmm0'
/tmp//cc0dVhz1.s:879: Error: no such instruction: `pmaddubsw %xmm6,%xmm0'
/tmp//cc0dVhz1.s:889: Error: no such instruction: `pmaddubsw %xmm8,%xmm0'
/tmp//cc0dVhz1.s:965: Error: no such instruction: `pmaddubsw %xmm5,%xmm0'
/tmp//cc0dVhz1.s:975: Error: no such instruction: `pmaddubsw %xmm6,%xmm0'
/tmp//cc0dVhz1.s:986: Error: no such instruction: `pmaddubsw %xmm8,%xmm0'
/tmp//cc0dVhz1.s:1492: Error: no such instruction: `pmaddubsw %xmm5,%xmm0'
/tmp//cc0dVhz1.s:1493: Error: no such instruction: `pmaddubsw %xmm5,%xmm1'
Makefile:138: recipe for target 'third_party/libyuv/source/scale.c.o' failed

which I believe is SSSE3 code.

Original comment by brad.ope...@gmail.com on 18 Mar 2014 at 12:28

GoogleCodeExporter commented 9 years ago
What compiler and what version are you using? Also, what is your
intended application? ssse3 was introduced in 2006. If your processors
support it but the compiler does not, you are leaving out significant
performance potential.

This is an error in the compiler. That instruction is allowed to have
a variable shift.
http://www.rz.uni-karlsruhe.de/rz/docs/VTune/reference/vc257.htm

Unfortunately we don't pass the instruction set disabling through to
the third_party libraries. If you --disable-examples this should work.

Original comment by johannko...@google.com on 18 Mar 2014 at 12:54

GoogleCodeExporter commented 9 years ago
The compiler and assembler are mentioned in the initial bug report. The 
intended application is moot at this point. It has to be able to build first.

Although --disable-examples helps with the second issue we need the examples 
binaries.

Also I looked into our other option for potentially having a modern compiler / 
assembler and it does not build as seen with bug report 708.

Original comment by brad.ope...@gmail.com on 18 Mar 2014 at 1:20

GoogleCodeExporter commented 9 years ago
gcc 4.2.1 was released in 2007 and is not even the most recent version of 4.2 
available:
http://www.gnu.org/software/gcc/gcc-4.2/

Is there any way you can use gcc 4.6 (or even better, 4.8)?

Original comment by johannko...@google.com on 18 Mar 2014 at 2:21

GoogleCodeExporter commented 9 years ago
-mssse3 flag detection should be fixed at v1.3.0-1897-g55dbbbb.

https://gerrit.chromium.org/gerrit/#/c/69281

As for libyuv a somewhat heavy handed fix would like the attached.

Original comment by jz...@google.com on 19 Mar 2014 at 3:01

Attachments:

GoogleCodeExporter commented 9 years ago
Please close the ticket. I have decided to use LLVM to build libvpx.

Original comment by brad.ope...@gmail.com on 20 Jun 2014 at 7:03

GoogleCodeExporter commented 9 years ago
James fixed the ssse3 detection in the main library:
https://gerrit.chromium.org/gerrit/#/c/69282/

Original comment by johannko...@google.com on 20 Jun 2014 at 4:07

GoogleCodeExporter commented 9 years ago
There were still other issues building with the combination of compiler / 
assembler we are using even with the SSSE3 detection being fixed. Not sure if 
the libyuv fix was commited but I'm not going to push in that direction as 
we're building with LLVM now anyway.

Original comment by brad.ope...@gmail.com on 21 Jun 2014 at 3:06