Chen-tao / webm

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

vp9 encoder build issues on msys #522

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What is the expected behavior?
builds same as on linux

What do you see instead?
$ ../libvpx/configure --target=x86-win32-gcc --disable-multithread 
--disable-unit-tests --disable-sse4_1 --prefix=/mingw
make -i V=1

    [CC] vpx/src/vpx_encoder.c.o
    [CC] vp8/encoder/mcomp.c.o
../libvpx/vp8/encoder/mcomp.c: In function 
'vp8_find_best_sub_pixel_step_iteratively':
../libvpx/vp8/encoder/mcomp.c:238:33: warning: variable 'buf_c2' set but not 
used [-Wunused-but-set-variable]
    [CC] vp8/encoder/modecosts.c.o
    [CC] vp8/encoder/onyx_if.c.o
    [CC] vp9/encoder/vp9_dct.c.o
    [CC] vp9/encoder/vp9_encodeframe.c.o
../libvpx/vp9/encoder/vp9_encodeframe.c: In function 'encode_macroblock':
../libvpx/vp9/encoder/vp9_encodeframe.c:2126:7: warning: variable 'seg_ref_activ
e' set but not used [-Wunused-but-set-variable]
    [CC] vp9/encoder/vp9_encodeintra.c.o
    [CC] vp9/encoder/vp9_encodemb.c.o
    [CC] vp9/encoder/vp9_encodemv.c.o
    [CC] vp9/encoder/vp9_firstpass.c.o
../libvpx/vp9/encoder/vp9_firstpass.c: In function 'estimate_modemvcost':
../libvpx/vp9/encoder/vp9_firstpass.c:804:7: warning: variable 'mode_cost' set b
ut not used [-Wunused-but-set-variable]
../libvpx/vp9/encoder/vp9_firstpass.c:803:7: warning: variable 'mv_cost' set but
 not used [-Wunused-but-set-variable]
../libvpx/vp9/encoder/vp9_firstpass.c: In function 'vp9_second_pass':
../libvpx/vp9/encoder/vp9_firstpass.c:1959:20: warning: variable 'start_pos' set
 but not used [-Wunused-but-set-variable]
../libvpx/vp9/encoder/vp9_firstpass.c:1955:10: warning: variable 'this_frame_err
or' set but not used [-Wunused-but-set-variable]
    [CC] vp9/encoder/vp9_lookahead.c.o
    [CC] vp9/encoder/vp9_mcomp.c.o
../libvpx/vp9/encoder/vp9_mcomp.c: In function 'vp9_find_best_sub_pixel_step_ite
ratively':
../libvpx/vp9/encoder/vp9_mcomp.c:274:31: warning: variable 'buf_c2' set but not
 used [-Wunused-but-set-variable]
    [CC] vp9/encoder/vp9_modecosts.c.o
    [CC] vp9/encoder/vp9_onyx_if.c.o
../libvpx/vp9/encoder/vp9_onyx_if.c: In function 'calculate_minq_index':
../libvpx/vp9/encoder/vp9_onyx_if.c:151:10: warning: variable 'thisq' set but no
t used [-Wunused-but-set-variable]
../libvpx/vp9/encoder/vp9_onyx_if.c: In function 'encode_frame_to_data_rate':
../libvpx/vp9/encoder/vp9_onyx_if.c:2943:7: warning: variable 'loop_size_estimat
e' set but not used [-Wunused-but-set-variable]
../libvpx/vp9/encoder/vp9_onyx_if.c:2929:7: warning: variable 'last_zbin_oq' set
 but not used [-Wunused-but-set-variable]
../libvpx/vp9/encoder/vp9_onyx_if.c:2928:7: warning: variable 'this_q' set but n
ot used [-Wunused-but-set-variable]
    [CC] vp9/encoder/vp9_picklpf.c.o
../libvpx/vp9/encoder/vp9_picklpf.c: In function 'vp9_yv12_copy_partial_frame_c'
:
../libvpx/vp9/encoder/vp9_picklpf.c:27:7: warning: variable 'border' set but not
 used [-Wunused-but-set-variable]
    [CC] vp9/encoder/vp9_psnr.c.o
    [CC] vp9/encoder/vp9_quantize.c.o
    [CC] vp9/encoder/vp9_ratectrl.c.o
    [CC] vp9/encoder/vp9_rdopt.c.o
../libvpx/vp9/encoder/vp9_rdopt.c: In function 'vp9_rd_pick_intra_mode':
../libvpx/vp9/encoder/vp9_rdopt.c:4733:15: warning: variable 'modeuv8x8' set but
 not used [-Wunused-but-set-variable]
    [CC] vp9/encoder/vp9_sad_c.c.o
    [CC] vp9/encoder/vp9_satd_c.c.o
    [CC] vp9/encoder/vp9_segmentation.c.o
    [CC] vp9/encoder/vp9_tokenize.c.o
    [CC] vp9/encoder/vp9_treewriter.c.o
    [CC] vp9/encoder/vp9_variance_c.c.o
    [CC] vp9/encoder/vp9_temporal_filter.c.o
../libvpx/vp9/encoder/vp9_temporal_filter.c: In function 'temporal_filter_find_m
atching_mb_c':
../libvpx/vp9/encoder/vp9_temporal_filter.c:133:7: warning: variable 'further_st
eps' set but not used [-Wunused-but-set-variable]
    [CC] vp9/encoder/vp9_mbgraph.c.o
../libvpx/vp9/encoder/vp9_mbgraph.c: In function 'do_16x16_motion_iteration':
../libvpx/vp9/encoder/vp9_mbgraph.c:30:19: warning: variable 'further_steps' set
 but not used [-Wunused-but-set-variable]
    [CC] vp9/encoder/x86/vp9_x86_csystemdependent.c.o

    [AS] vp9/encoder/x86/vp9_encodeopt.asm.o
    [AS] vp9/decoder/x86/vp9_dequantize_mmx.asm.o
    [AS] vpx_ports/emms.asm.o
    [AS] vpx_ports/x86_abi_support.asm.o
    [AS] third_party/x86inc/x86inc.asm.o
    [AR] libvpx_g.a
    [STRIP] libvpx.a < libvpx_g.a
/bin/sh: /mingw/bin/strip: Bad file number
make[1]: [libvpx.a] Error 126 (ignored)
    [CREATE] vpx.pc
    [DEP] decode_with_drops.c.d
    [DEP] decode_to_md5.c.d
    [DEP] postproc.c.d
    [DEP] simple_decoder.c.d
    [DEP] vpxenc.c.d
    [DEP] vpxdec.c.d
    [STRIP] libvpx.a < libvpx_g.a
/bin/sh: /mingw/bin/strip: Bad file number
make[1]: [libvpx.a] Error 126 (ignored)
    [CC] args.c.o
    [CC] tools_common.c.o
    [CC] nestegg/halloc/src/halloc.c.o
    [CC] nestegg/src/nestegg.c.o
    [CC] vpxdec.c.o
    [LD] vpxdec
vpxdec.c.o:vpxdec.c:(.text+0xe0): undefined reference to `vpx_codec_vp9_dx'
vpxdec.c.o:vpxdec.c:(.text+0x930): undefined reference to `vpx_codec_vp9_dx'
vpxdec.c.o:vpxdec.c:(.rdata+0x954): undefined reference to `vpx_codec_vp9_dx'
c:/mingw/bin/../lib/gcc/mingw32/4.6.1/../../../libvpx.a(systemdependent.c.o): 
In function `once':
c:\on2\msys32/../libvpx-v1.1.0/vp8/common/generic/systemdependent.c:91: 
undefined reference to `_imp__pthread_once'
collect2: ld returned 1 exit status
make[1]: [vpxdec] Error 1 (ignored)
    [CC] y4minput.c.o
    [CC] libmkv/EbmlWriter.c.o
    [CC] vpxenc.c.o
    [LD] vpxenc
vpxenc.c.o:vpxenc.c:(.text+0x4a0): undefined reference to `vpx_codec_vp9_cx'
vpxenc.c.o:vpxenc.c:(.text+0x955): undefined reference to `vpx_codec_vp9_cx'
vpxenc.c.o:vpxenc.c:(.rdata+0xc14): undefined reference to `vpx_codec_vp9_cx'
vpxenc.c.o:vpxenc.c:(.rdata+0xc18): undefined reference to `vpx_codec_vp9_dx'
c:/mingw/bin/../lib/gcc/mingw32/4.6.1/../../../libvpx.a(systemdependent.c.o): 
In function `once':
c:\on2\msys32/../libvpx-v1.1.0/vp8/common/generic/systemdependent.c:91: 
undefined reference to `_imp__pthread_once'
collect2: ld returned 1 exit status
make[1]: [vpxenc] Error 1 (ignored)

What version are you using?
experimental

On what operating system?
Window7 w/ msys 1.1 / gcc 4.6 32 bit

Please provide any additional information below.
linux cross build is able to produce working binaries.

Original issue reported on code.google.com by fbarch...@google.com on 8 Jan 2013 at 12:13

GoogleCodeExporter commented 8 years ago
We think this is fixed, if not, can you try to add the hash commit you are 
trying? 

thanks

Original comment by albe...@google.com on 17 Jan 2013 at 11:32

GoogleCodeExporter commented 8 years ago
warnings are fixed, but link error occurs related to threading?

command prompt
cd \on2
git clone http://git.chromium.org/webm/libvpx.git
cd libvpx
git checkout master
#git checkout experimental
cd ..

msys:
mkdir msys32
cd msys32
../libvpx/configure --disable-multithread --target=x86-win32-gcc 
--disable-multithread --disable-unit-tests --prefix=/mingw
make -i V=1

Current build
    [LD] vpxdec
vpxdec.c.o:vpxdec.c:(.text+0xe0): undefined reference to `vpx_codec_vp9_dx'
vpxdec.c.o:vpxdec.c:(.text+0x930): undefined reference to `vpx_codec_vp9_dx'
vpxdec.c.o:vpxdec.c:(.rdata+0x954): undefined reference to `vpx_codec_vp9_dx'
./libvpx.a(systemdependent.c.o): In function `once':
c:\on2\msys32/../libvpx-v1.1.0/vp8/common/generic/systemdependent.c:91: undefine
d reference to `_imp__pthread_once'
collect2: ld returned 1 exit status
make[1]: [vpxdec] Error 1 (ignored)
    [CC] y4minput.c.o
    [CC] libmkv/EbmlWriter.c.o
    [CC] vpxenc.c.o
    [LD] vpxenc
vpxenc.c.o:vpxenc.c:(.text+0x4a0): undefined reference to `vpx_codec_vp9_cx'
vpxenc.c.o:vpxenc.c:(.text+0x955): undefined reference to `vpx_codec_vp9_cx'
vpxenc.c.o:vpxenc.c:(.rdata+0xc14): undefined reference to `vpx_codec_vp9_cx'
vpxenc.c.o:vpxenc.c:(.rdata+0xc18): undefined reference to `vpx_codec_vp9_dx'
./libvpx.a(systemdependent.c.o): In function `once':
c:\on2\msys32/../libvpx-v1.1.0/vp8/common/generic/systemdependent.c:91: undefine
d reference to `_imp__pthread_once'
collect2: ld returned 1 exit status

Original comment by fbarch...@google.com on 18 Jan 2013 at 2:05

GoogleCodeExporter commented 8 years ago
Cross compiling for gprecise. Install mingw32 or mingw-w64. The cross tool is 
i586-mingw32- (IIRC) for mingw32 and i686-w64-mingw32- (win32) or 
x86_64-w64-mingw32- (win64) for mingw-w64

CROSS=x86_64-w64-mingw32- ../libvpx/configure --target=x86_64-win64-gcc

I haven't managed to reproduce the pthread error on linux though

Original comment by johannkoenig@google.com on 18 Jan 2013 at 2:33

GoogleCodeExporter commented 8 years ago
Just to be clear, the issue I'm asking to be addressed is pthreads.

--disable-multithread should disable threads.

pthreads dont natively come with windows.  They can be added somehow, so it 
might be nice to have instructions on how.  But since vp9 doesnt support 
threads, its moot.

Original comment by fbarch...@google.com on 18 Jan 2013 at 2:37

GoogleCodeExporter commented 8 years ago
I'll see if I can find the holdouts.

Original comment by johannkoenig@google.com on 18 Jan 2013 at 2:43

GoogleCodeExporter commented 8 years ago
Does this help:
https://gerrit.chromium.org/gerrit/41653

Original comment by johannkoenig@google.com on 18 Jan 2013 at 7:31

GoogleCodeExporter commented 8 years ago
Issue 525 has been merged into this issue.

Original comment by johannkoenig@google.com on 18 Jan 2013 at 7:58

GoogleCodeExporter commented 8 years ago
Merged. Reopen if it wasn't enough.

Original comment by johannkoenig@google.com on 19 Jan 2013 at 12:16

GoogleCodeExporter commented 8 years ago
Looks like your CL should work.  I was unable to build 'master' on Thursday.  
Which branch is your CL in?

Original comment by fbarch...@google.com on 19 Jan 2013 at 9:39

GoogleCodeExporter commented 8 years ago
It is in 'master'

Original comment by johannkoenig@google.com on 20 Jan 2013 at 5:38

GoogleCodeExporter commented 8 years ago
Still occurs for msys
c:\on2\msys32/../libvpx-v1.1.0/vp8/common/generic/systemdependent.c:91: undefine
d reference to `_imp__pthread_once'
collect2: ld returned 1 exit status

How to reproduce

windows command prompt
cd \on2
git clone http://git.chromium.org/webm/libvpx.git
cd libvpx
git checkout master
cd ..

msys:
cd /c/on2
mkdir msys32
cd msys32
../libvpx/configure --target=x86-win32-gcc --enable-experimental 
--disable-multithread --disable-unit-tests --prefix=/mingw
make -i V=1

Original comment by fbarch...@google.com on 21 Jan 2013 at 4:41

GoogleCodeExporter commented 8 years ago
Re comment #3
Linux cross build works.  Steps taken:

sudo apt-get install mingw-w64
sudo apt-get install yasm
cd ~
mkdir on2
git clone http://git.chromium.org/webm/libvpx.git
cd libvpx
git checkout master
cd ..
mkdir win64
cd win64
CROSS=x86_64-w64-mingw32- ../libvpx/configure --target=x86_64-win64-gcc 
--enable-experimental --enable-static-msvcrt --disable-install-docs 
--disable-unit-tests --disable-docs
make -i V=1

Original comment by fbarch...@google.com on 21 Jan 2013 at 6:21

GoogleCodeExporter commented 8 years ago
Successfully compiled with
CROSS=i686-w64-mingw32- ./configure --target=x86-win32-gcc

but when using
CROSS=x86_64-w64-mingw32- ./configure --target=x86_64-win64-gcc
configure succeeded, while make (with -j8; w/o it the output is similar) got:
    [STRIP] libvpx.a < libvpx_g.a
    [STRIP] libgtest.a < libgtest_g.a
/bin/sh: /mingw/bin/x86_64-w64-mingw32-strip: Bad file number
make[1]: *** [libgtest.a] Error 126
make[1]: *** Waiting for unfinished jobs....
/bin/sh: /mingw/bin/x86_64-w64-mingw32-strip: Bad file number
make[1]: *** [libvpx.a] Error 126
make: *** [.DEFAULT] Error 2

Original comment by astrat...@gmail.com on 21 Jan 2013 at 6:38

GoogleCodeExporter commented 8 years ago
The problem is due the w32pthreads library that can be optionally provided by 
mingw-w64. Sadly it is incomplete, the simplest solution is not just check for 
the header presence but also check if the library has the needed symbols.

Original comment by luca.bar...@gmail.com on 21 Jan 2013 at 11:25

GoogleCodeExporter commented 8 years ago
Tried all the solutions in this thread to no avail under Win32 MinGW.

Successfully compiled after following the instructions here:
http://blog.k-tai-douga.com/article/53351775.html

Original comment by leighton...@gmail.com on 26 Mar 2013 at 6:47

GoogleCodeExporter commented 8 years ago
Re #15
Thats a long article with several problems/solutions.
As I work on libyuv, the scale.c compile error concerns me.

Can you clarify which parts of the article are relevant?

Original comment by fbarch...@chromium.org on 26 Mar 2013 at 7:29