Skip to content

OpenCV.js --simd build fails with recent Emscripten #18097

@tailsu

Description

@tailsu
System information (version)
  • OpenCV => recent master (949fe93)
  • Operating System / Platform => OSX
  • Compiler => Emscripten 2.0.0
Detailed description

Multiple source files fail with

In file included from .../opencv/modules/core/include/opencv2/core/hal/intrin.hpp:228:
.../opencv/modules/core/include/opencv2/core/hal/intrin_wasm.hpp:2810:55: error: use of undeclared identifier 'wasm_i8x16_mul'

Recent versions of Emscripten are based on LLVM 12. This version has an intrinsics headers that doesn't contain functions used by OpenCV that were present in e.g. LLVM 9 (e.g. in Emscripten 1.38.33).

~/Documents/emsdk/upstream/bin $ ./llc --version
LLVM (http://llvm.org/):
  LLVM version 12.0.0git
  Optimized build with assertions.
  Default target: x86_64-apple-darwin19.4.0
  Host CPU: skylake-avx512

  Registered Targets:
    wasm32 - WebAssembly 32-bit
    wasm64 - WebAssembly 64-bit
    x86    - 32-bit X86: Pentium-Pro and above
    x86-64 - 64-bit X86: EM64T and AMD64
Steps to reproduce
# install Emscripten 2.0.0
cd emsdk/
emsdk install 2.0.0
emsdk activate 2.0.0
./emsdk_env.sh

# build OpenCV.js
cd opencv/platforms/js/
emmake python build_js.py build --simd

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions