bvibber / ogv.js

JavaScript media player using Ogg/Vorbis/Theora/Opus/WebM libs compiled with Emscripten
https://brooke.vibber.net/misc/ogv.js/demo/
Other
1.2k stars 101 forks source link

simd dav1d build files - compileDav1dWasmSIMD.sh #557

Closed yafesdev closed 4 years ago

yafesdev commented 4 years ago

I just wanted to report that on Ubuntu with the latest emscripten (1.39.11) as of now the build fails for SIMD, all other builds succeed.

Step to reproduce

git clone https://github.com/brion/ogv.js.git
cd ogv.js
git submodule update --init
export SIMD=1
npm install

Error: Makefile:253: recipe for target 'build/wasm-simd/root/lib/libdav1d.a' failed

11 warnings and 2 errors generated.
shared:ERROR: '/git/emsdk/upstream/bin/clang -target wasm32-unknown-emscripten -D__EMSCRIPTEN_major__=1 -D__EMSCRIPTEN_minor__=39 -D__EMSCRIPTEN_tiny__=11 -D_LIBCPP_ABI_VERSION=2 -Dunix -D__unix -D__unix__ -Werror=implicit-function-declaration -Xclang -nostdsysteminc -Xclang -isystem/git/emsdk/upstream/emscripten/system/include/libcxx -Xclang -isystem/git/emsdk/upstream/emscripten/system/lib/libcxxabi/include -Xclang -isystem/git/emsdk/upstream/emscripten/system/lib/libunwind/include -Xclang -isystem/git/emsdk/upstream/emscripten/system/include/compat -Xclang -isystem/git/emsdk/upstream/emscripten/system/include -Xclang -isystem/git/emsdk/upstream/emscripten/system/include/libc -Xclang -isystem/git/emsdk/upstream/emscripten/system/lib/libc/musl/arch/emscripten -Xclang -isystem/git/emsdk/upstream/emscripten/system/local/include -Xclang -isystem.emscripten_cache/wasm/include -Isrc/25a6634@@dav1d@sta -Isrc -I../../../dav1d/src -I. -I../../../dav1d/ -Iinclude/dav1d -I../../../dav1d/include/dav1d -Iinclude -I../../../dav1d/include -I../../../dav1d/include/compat/fake_atomics -Xclang -fcolor-diagnostics -DNDEBUG -pipe -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -O3 -D_GNU_SOURCE -fvisibility=hidden -Wundef -Werror=vla -Wno-missing-field-initializers -Wno-unused-parameter -Werror=missing-prototypes -Wshorten-64-to-32 -fomit-frame-pointer -ffast-math -fPIC -MD -MQ src/25a6634@@dav1d@sta/wasm_cdef.c.o -MF src/25a6634@@dav1d@sta/wasm_cdef.c.o.d -c -DEMSCRIPTEN -fignore-exceptions -msimd128 ../../../dav1d/src/wasm/cdef.c -Xclang -isystem/git/emsdk/upstream/emscripten/system/include/SDL -c -o src/25a6634@@dav1d@sta/wasm_cdef.c.o -mllvm -combiner-global-alias-analysis=false -mllvm -enable-emscripten-sjlj -mllvm -disable-lsr' failed (1)
[2/4] .local/bin/meson --internal vcstagger ../../../dav1d/include/vcs_version.h.in include/vcs_version.h 0.6.0 /git/ogvTest1/ogv.js/dav1d/include @VCS_TAG@ '(.*)' /usr/bin/git --git-dir /git/ogvTest1/ogv.js/dav1d/.git describe --tags --long --match '?.*.*' --always
ninja: build stopped: subcommand failed.
Makefile:253: recipe for target 'build/wasm-simd/root/lib/libdav1d.a' failed
make: *** [build/wasm-simd/root/lib/libdav1d.a] Error 1
bvibber commented 4 years ago

Looks like a bunch of functions got renamed out from under me :D Fixing...

yafesdev commented 4 years ago

With the latest emsdk, I'm still getting 6 errors. I've checked the changes on the llvm side, it doesn't seem related to the naming convention changes. Wasn't able to make much sense out of it.

../../../dav1d/src/wasm/wasm_simd.h:42:11: error: implicit declaration of function 'wasm_i16x8_max' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
   return wasm_i16x8_max(wasm_i16x8_min(val, max), min);
          ^
../../../dav1d/src/wasm/wasm_simd.h:42:26: error: implicit declaration of function 'wasm_i16x8_min' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
   return wasm_i16x8_max(wasm_i16x8_min(val, max), min);
                         ^
../../../dav1d/src/wasm/wasm_simd.h:42:11: error: returning 'int' from a function with incompatible result type 'int16x8' (vector of 8 'int16_t' values)
   return wasm_i16x8_max(wasm_i16x8_min(val, max), min);
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../../dav1d/src/wasm/wasm_simd.h:46:12: error: implicit declaration of function 'wasm_i32x4_max' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
    return wasm_i32x4_max(wasm_i32x4_min(val, max), min);
           ^
../../../dav1d/src/wasm/wasm_simd.h:46:12: note: did you mean 'wasm_f32x4_max'?
/Users/test/GIT/emsdk/upstream/emscripten/system/include/wasm_simd128.h:914:45: note: 'wasm_f32x4_max' declared here
static __inline__ v128_t __DEFAULT_FN_ATTRS wasm_f32x4_max(v128_t a, v128_t b) {
                                            ^
In file included from ../../../dav1d/src/wasm/looprestoration_tmpl.c:35:
../../../dav1d/src/wasm/wasm_simd.h:46:27: error: implicit declaration of function 'wasm_i32x4_min' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
    return wasm_i32x4_max(wasm_i32x4_min(val, max), min);
                          ^
../../../dav1d/src/wasm/wasm_simd.h:46:27: note: did you mean 'wasm_f32x4_min'?
/Users/test/GIT/emsdk/upstream/emscripten/system/include/wasm_simd128.h:909:45: note: 'wasm_f32x4_min' declared here
static __inline__ v128_t __DEFAULT_FN_ATTRS wasm_f32x4_min(v128_t a, v128_t b) {
                                            ^
In file included from ../../../dav1d/src/wasm/looprestoration_tmpl.c:35:
../../../dav1d/src/wasm/wasm_simd.h:46:12: error: returning 'int' from a function with incompatible result type 'int32x4' (vector of 4 'int32_t' values)
    return wasm_i32x4_max(wasm_i32x4_min(val, max), min);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
bvibber commented 4 years ago

wasm_simd128.h should live in upstream/lib/clang/11.0.0/include now, as of 1.39.12. Do you have an old version of emscripten where it was still in the system headers instead of the compiler headers, or might your emsdk install have a mix of emscripten and llvm versions?

bvibber commented 4 years ago

("Old" means like "last week")