I am trying to build OpenCV with an up to date version of emscripten (3.1.41) using OpenCV4.7.0. If I add a simple mod to intrin_wasm.hpp
:
#include <emscripten/version.h>
in the includes near the top, I can get this to compile if (and only if)
I build with the -msimd128
flag. (The extra include is required because
the emscripten version defines are no longer present by default. I also
have a section in that file to rename some of the function calls to what
clang itself supports, but that just stops lots of warnings and is not I think absolutely necessary).
Issue I have is that this code runs find on Chrome but I am having problems on Safari - on Safari the support for simd128 is recent many iphone devices don’t support it. (Let alone I am getting different results compared to not only Chrome but running the same code native). I thought it would be a good idea to try to compile without the flag, but if I do that I get a lot of errors about wasm_v128_load
etc being only supported with simd128 enabled. I find this odd because there are protection in the header file in some places for:
#ifdef __wasm_unimplemented_simd128__
in some places to protect for this, but not in all. Did older versions of emscripten not throw up an error until (say) linkage or use?
Anyway, what do others do?