Skip to content

Build of OpenCV 4.10.0 with Emscripten fails if simd options enabled #26536

@philip-lamb

Description

@philip-lamb

System Information

OpenCV version: OpenCV 4.10.0-dev (git commit d6b674a)
OS: Mac OS 14.1.1
Toolchain: Emscripten 3.1.38 (also tested with latest 3.1.72)

Detailed description

OpenCV emscripten build fails if simd options are enabled.

Building with: mkdir build && cd build && python3 ../platforms/js/build_js.py --emscripten_dir "$EMSDK/upstream/emscripten" --threads --simd --build_wasm .

fails with error:

modules/imgproc/src/color_yuv.simd.hpp:477:23: error: no matching function for call to 'v_shr'
                y11 = v_shr(v_reinterpret_as_u32(v_add(v_dotprod(bg11, bg2y), v_dotprod(rd11, r12y))), shift);

The required function is present in the file modules/core/include/opencv2/core/hal/intrin_wasm.hpp but has a misspelling in the title (uppercase V). Same error also present in file modules/core/include/opencv2/core/hal/intrin_lasx.hpp. Fixing this results in a correct build.

Error is present in branch 4.x and branch 5.x.

Steps to reproduce

mkdir build && cd build && python3 ../platforms/js/build_js.py --emscripten_dir "$EMSDK/upstream/emscripten" --threads --simd --build_wasm .

Issue submission checklist

  • I report the issue, it's not a question
  • I checked the problem with documentation, FAQ, open issues, forum.opencv.org, Stack Overflow, etc and have not found any solution
  • I updated to the latest OpenCV version and the issue is still there
  • There is reproducer code and related data files (videos, images, onnx, etc)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions