Skip to content

How to compile WASM OpenCV libs ? #27502

Open
@Honya2000

Description

@Honya2000

Hello,

I'm trying to compile WASM OpenCV libraries to include in another project.
Spent entire day trying different options, but no success so far.

Official way is to use script platforms/js/build_js.py.

But this is just doesn't work for me:

$ emcmake python ./platforms/js/build_js.py build_js --build_test configure: python ./platforms/js/build_js.py build_js --build_test '-DCMAKE_TOOLCHAIN_FILE=C:\Projects\emsdk\upstream\emscripten\cmake\Modules\Platform\Emscripten.cmake' -DCMAKE_CROSSCOMPILING_EMULATOR=C:/Projects/emsdk/node/22.16.0_64bit/bin/node.exe -G Ninja usage: build_js.py [-h] [--opencv_dir OPENCV_DIR] [--emscripten_dir EMSCRIPTEN_DIR] [--build_wasm] [--disable_wasm] [--disable_single_file] [--threads] [--simd] [--build_test] [--build_perf] [--build_doc] [--build_loader] [--clean_build_dir] [--skip_config] [--config_only] [--enable_exception] [--cmake_option CMAKE_OPTION] [--build_flags BUILD_FLAGS] [--build_wasm_intrin_test] [--config CONFIG] [--webnn] build_dir build_js.py: error: unrecognized arguments: -G Ninja emcmake: error: 'python ./platforms/js/build_js.py build_js --build_test '-DCMAKE_TOOLCHAIN_FILE=C:\Projects\emsdk\upstream\emscripten\cmake\Modules\Platform\Emscripten.cmake' -DCMAKE_CROSSCOMPILING_EMULATOR=C:/Projects/emsdk/node/22.16.0_64bit/bin/node.exe -G Ninja' failed (returned 2)
Not sure why it invokes node.exe with -G Ninja flag. Is this suppose to work ?
Also i'm not sure i can compile just static libs this way (just .a files, and without .wasm files). There is no specific build flags for this.

I also tried to invoke cmake myself, but in this case it throws lot of errors about missing dependencies, There is no way to gather all this dependencies manually in reasonable amount of time.

Any idea how to compile the libs ?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy