Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Error while compiling opencv 3.4.15 #20209

Closed
nerdola-de-cartola opened this issue Sep 7, 2023 · 7 comments
Closed

Error while compiling opencv 3.4.15 #20209

nerdola-de-cartola opened this issue Sep 7, 2023 · 7 comments

Comments

@nerdola-de-cartola
Copy link

I currently have a project in C++ that uses opencv 3.4.15, and I would like to compile this project to wasm and runit in wasmtime

I started by compiling opencv to wasm, my goal here was to generete some sort of .a file wich I could link to my code later on

I followed this tutorial for replacing cmake and make, but during the cmake process I got an error

Notes
I suceffuly compiled the same source code but for machine code instead of wasm

If there is a easier way of using opencv in wasm. Please let me know

Version of emscripten/emsdk:

emcc (Emscripten gcc/clang-like replacement + linker emulating GNU ld) 3.1.45 (ef3e4e3b044de98e1811546e0bc605c65d3412f4)
clang version 18.0.0 (https://github.com/llvm/llvm-project d1e685df45dc5944b43d2547d0138cd4a3ee4efe)
Target: wasm32-unknown-emscripten
Thread model: posix
InstalledDir: /home/matheus-lucas/downloads/emsdk/upstream/bin

Failing command line in full:

emcmake cmake -DOPENCV_EXTRA_MODULES_PATH=../opencv_contrib/modules ../

Output

configure: cmake -DOPENCV_EXTRA_MODULES_PATH=../opencv_contrib/modules ../ -DCMAKE_TOOLCHAIN_FILE=/home/matheus-lucas/downloads/emsdk/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake -DCMAKE_CROSSCOMPILING_EMULATOR=/home/matheus-lucas/downloads/emsdk/node/16.20.0_64bit/bin/node
Python 2.7.17
Cleaning INTERNAL cached variable: ZLIB_LIBRARY
Cleaning INTERNAL cached variable: ZLIB_INCLUDE_DIR
Cleaning INTERNAL cached variable: JPEG_LIBRARY
Cleaning INTERNAL cached variable: JPEG_INCLUDE_DIR
Cleaning INTERNAL cached variable: TIFF_LIBRARY
Cleaning INTERNAL cached variable: TIFF_INCLUDE_DIR
Cleaning INTERNAL cached variable: WEBP_LIBRARY
Cleaning INTERNAL cached variable: WEBP_INCLUDE_DIR
Cleaning INTERNAL cached variable: PNG_LIBRARY
Cleaning INTERNAL cached variable: PNG_INCLUDE_DIR

Call Stack (most recent call first):
  cmake/OpenCVModule.cmake:989 (ocv_add_library)
  cmake/OpenCVModule.cmake:905 (_ocv_create_module)
  cmake/OpenCVModule.cmake:1131 (ocv_create_module)
  opencv_contrib/modules/stereo/CMakeLists.txt:2 (ocv_define_module)
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Error: install(EXPORT "OpenCVModules" ...) includes target "opencv_core" which requires target "zlib" that is not in the export set.
CMake Error: install(EXPORT "OpenCVModules" ...) includes target "opencv_core" which requires target "ittnotify" that is not in the export set.
CMake Error: install(EXPORT "OpenCVModules" ...) includes target "opencv_dnn" which requires target "ocv.3rdparty.flatbuffers" that is not in the export set.
CMake Error: install(EXPORT "OpenCVModules" ...) includes target "opencv_dnn" which requires target "libprotobuf" that is not in the export set.
CMake Error: install(EXPORT "OpenCVModules" ...) includes target "opencv_imgcodecs" which requires target "libjpeg-turbo" that is not in the export set.
CMake Error: install(EXPORT "OpenCVModules" ...) includes target "opencv_imgcodecs" which requires target "libwebp" that is not in the export set.
CMake Error: install(EXPORT "OpenCVModules" ...) includes target "opencv_imgcodecs" which requires target "libpng" that is not in the export set.
CMake Error: install(EXPORT "OpenCVModules" ...) includes target "opencv_imgcodecs" which requires target "libtiff" that is not in the export set.
CMake Error: install(EXPORT "OpenCVModules" ...) includes target "opencv_imgcodecs" which requires target "libopenjp2" that is not in the export set.
CMake Error: install(EXPORT "OpenCVModules" ...) includes target "opencv_imgcodecs" which requires target "zlib" that is not in the export set.
CMake Error: install(EXPORT "OpenCVModules" ...) includes target "opencv_objdetect" which requires target "quirc" that is not in the export set.
CMake Error: install(EXPORT "OpenCVModules" ...) includes target "opencv_gapi" which requires target "ade" that is not in the export set.
CMake Error: install(EXPORT "OpenCVModules" ...) includes target "opencv_gapi" which requires target "ittnotify" that is not in the export set.
emcmake: error: 'cmake -DOPENCV_EXTRA_MODULES_PATH=../opencv_contrib/modules ../ -DCMAKE_TOOLCHAIN_FILE=/home/matheus-lucas/downloads/emsdk/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake -DCMAKE_CROSSCOMPILING_EMULATOR=/home/matheus-lucas/downloads/emsdk/node/16.20.0_64bit/bin/node' failed (returned 1)

Full link command and output with -v appended:

emcmake cmake -v -DOPENCV_EXTRA_MODU
LES_PATH=../opencv_contrib/modules ../
configure: cmake -v -DOPENCV_EXTRA_MODULES_PATH=../opencv_contrib/modules ../ -DCMAKE_TOOLCHAIN_FILE=/home/matheus-lucas/downloads/emsdk/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake -DCMAKE_CROSSCOMPILING_EMULATOR=/home/matheus-lucas/downloads/emsdk/node/16.20.0_64bit/bin/node
-- Detected processor: x86
Python 2.7.17
-- Looking for ccache - not found
-- SSE is not supported by C++ compiler
-- SSE2 is not supported by C++ compiler
-- SSE3 is not supported by C++ compiler
-- SSSE3 is not supported by C++ compiler
-- SSE4_1 is not supported by C++ compiler
-- POPCNT is not supported by C++ compiler
-- SSE4_2 is not supported by C++ compiler
-- FP16 is not supported by C++ compiler
-- AVX is not supported by C++ compiler
-- Optimization SSE2 is not available, skipped
-- Dispatch optimization SSE4_1 is not available, skipped
-- Dispatch optimization SSE4_2 is not available, skipped
-- Dispatch optimization AVX is not available, skipped
-- Dispatch optimization FP16 is not available, skipped
Cleaning INTERNAL cached variable: ZLIB_LIBRARY
Cleaning INTERNAL cached variable: ZLIB_INCLUDE_DIR
-- Could NOT find ZLIB (missing: ZLIB_LIBRARY ZLIB_INCLUDE_DIR) (Required is at least version "1.2.3")
Cleaning INTERNAL cached variable: JPEG_LIBRARY
Cleaning INTERNAL cached variable: JPEG_INCLUDE_DIR
-- Could NOT find JPEG (missing: JPEG_LIBRARY JPEG_INCLUDE_DIR)
-- libjpeg-turbo: VERSION = 2.1.3, BUILD = opencv-4.8.0-dev-libjpeg-turbo
Cleaning INTERNAL cached variable: TIFF_LIBRARY
Cleaning INTERNAL cached variable: TIFF_INCLUDE_DIR
-- Could NOT find TIFF (missing: TIFF_LIBRARY TIFF_INCLUDE_DIR)
Cleaning INTERNAL cached variable: WEBP_LIBRARY
Cleaning INTERNAL cached variable: WEBP_INCLUDE_DIR
-- Could NOT find OpenJPEG (minimal suitable version: 2.0, recommended version >= 2.3.1). OpenJPEG will be built from sources
-- OpenJPEG: VERSION = 2.5.0, BUILD = opencv-4.8.0-dev-openjp2-2.5.0
-- OpenJPEG libraries will be built from sources: libopenjp2 (version "2.5.0")
Cleaning INTERNAL cached variable: PNG_LIBRARY
Cleaning INTERNAL cached variable: PNG_INCLUDE_DIR
-- Could NOT find PNG (missing: PNG_LIBRARY PNG_PNG_INCLUDE_DIR)
-- math lib 'libm' not found; floating point support disabled
-- libva: missing va.h header (VA_INCLUDE_DIR)
-- On 32-bit Linux Intel IPP can not currently be used with dynamic libs because of linker errors. Set BUILD_SHARED_LIBS=OFF
-- Could not find OpenBLAS include. Turning OpenBLAS_FOUND off
-- Could not find OpenBLAS lib. Turning OpenBLAS_FOUND off
-- Could NOT find Atlas (missing: Atlas_CBLAS_INCLUDE_DIR Atlas_CLAPACK_INCLUDE_DIR Atlas_CBLAS_LIBRARY Atlas_BLAS_LIBRARY Atlas_LAPACK_LIBRARY)
-- A library with BLAS API not found. Please specify library location.
-- LAPACK requires BLAS
-- A library with LAPACK API not found. Please specify library location.
-- Checking for module 'gtk+-3.0'
--   No package 'gtk+-3.0' found
-- Checking for module 'gtk+-2.0'
--   No package 'gtk+-2.0' found
-- Checking for module 'gthread-2.0>=2.32'
--   No package 'gthread-2.0' found
-- Checking for modules 'libavcodec;libavformat;libavutil;libswscale'
--   No package 'libavcodec' found
--   No package 'libavformat' found
--   No package 'libavutil' found
--   No package 'libswscale' found
-- FFMPEG is disabled. Required libraries: libavcodec;libavformat;libavutil;libswscale. Missing libraries: libavcodec;libavformat;libavutil;libswscale
-- Checking for module 'gstreamer-base-1.0'
--   No package 'gstreamer-base-1.0' found
-- Checking for module 'gstreamer-app-1.0'
--   No package 'gstreamer-app-1.0' found
-- Checking for module 'gstreamer-riff-1.0'
--   No package 'gstreamer-riff-1.0' found
-- Checking for module 'gstreamer-pbutils-1.0'
--   No package 'gstreamer-pbutils-1.0' found
-- Checking for module 'gstreamer-video-1.0'
--   No package 'gstreamer-video-1.0' found
-- Checking for module 'gstreamer-audio-1.0'
--   No package 'gstreamer-audio-1.0' found
-- Checking for module 'libdc1394-2'
--   No package 'libdc1394-2' found
-- Module opencv_alphamat disabled because the following dependencies are not found: Eigen
-- Checking for module 'freetype2'
--   No package 'freetype2' found
-- Checking for module 'harfbuzz'
--   No package 'harfbuzz' found
-- freetype2:   NO
-- harfbuzz:    NO
-- Julia not found. Not compiling Julia Bindings.
-- Module opencv_ovis disabled because OGRE3D was not found
-- No preference for use of exported gflags CMake configuration set, and no hints for include/library directories provided. Defaulting to preferring an installed/exported gflags CMake configuration if available.
-- Failed to find installed gflags CMake configuration, searching for gflags build directories exported with CMake.
-- Failed to find gflags - Failed to find an installed/exported CMake configuration for gflags, will perform search for installed gflags components.
-- Failed to find gflags - Could not find gflags include directory, set GFLAGS_INCLUDE_DIR to directory containing gflags/gflags.h
-- Failed to find glog - Could not find glog include directory, set GLOG_INCLUDE_DIR to directory containing glog/logging.h
-- Module opencv_sfm disabled because the following dependencies are not found: Eigen Glog/Gflags
-- Allocator metrics storage type: 'long long'
CMake Warning (dev) at cmake/OpenCVUtils.cmake:1560 (add_library):
  ADD_LIBRARY called with SHARED option but the target platform does not
  support dynamic linking.  Building a STATIC library instead.  This may lead
  to problems.
Call Stack (most recent call first):
  cmake/OpenCVModule.cmake:989 (ocv_add_library)
  cmake/OpenCVModule.cmake:905 (_ocv_create_module)
  modules/core/CMakeLists.txt:165 (ocv_create_module)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Excluding from source files list: <BUILD>/modules/core/test/test_intrin128.sse2.cpp
-- Excluding from source files list: <BUILD>/modules/core/test/test_intrin128.sse3.cpp
-- Excluding from source files list: <BUILD>/modules/core/test/test_intrin128.ssse3.cpp
-- Excluding from source files list: <BUILD>/modules/core/test/test_intrin128.sse4_1.cpp
-- Excluding from source files list: <BUILD>/modules/core/test/test_intrin128.sse4_2.cpp
-- Excluding from source files list: <BUILD>/modules/core/test/test_intrin128.avx.cpp
-- Excluding from source files list: <BUILD>/modules/core/test/test_intrin128.fp16.cpp
-- Excluding from source files list: <BUILD>/modules/core/test/test_intrin128.avx2.cpp
-- Excluding from source files list: <BUILD>/modules/core/test/test_intrin128.avx512_skx.cpp
-- Excluding from source files list: <BUILD>/modules/core/test/test_intrin256.avx2.cpp
-- Excluding from source files list: <BUILD>/modules/core/test/test_intrin256.avx512_skx.cpp
-- Excluding from source files list: <BUILD>/modules/core/test/test_intrin512.avx512_skx.cpp
CMake Warning (dev) at cmake/OpenCVUtils.cmake:1560 (add_library):
  ADD_LIBRARY called with SHARED option but the target platform does not
  support dynamic linking.  Building a STATIC library instead.  This may lead
  to problems.
Call Stack (most recent call first):
  cmake/OpenCVModule.cmake:989 (ocv_add_library)
  cmake/OpenCVModule.cmake:905 (_ocv_create_module)
  cmake/OpenCVModule.cmake:1131 (ocv_create_module)
  modules/flann/CMakeLists.txt:2 (ocv_define_module)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Excluding from source files list: modules/imgproc/src/corner.avx.cpp
-- Excluding from source files list: modules/imgproc/src/imgwarp.avx2.cpp
-- Excluding from source files list: modules/imgproc/src/imgwarp.lasx.cpp
-- Excluding from source files list: modules/imgproc/src/imgwarp.sse4_1.cpp
-- Excluding from source files list: modules/imgproc/src/resize.avx2.cpp
-- Excluding from source files list: modules/imgproc/src/resize.lasx.cpp
-- Excluding from source files list: modules/imgproc/src/resize.sse4_1.cpp

-- Found 'misc' Python modules from /home/matheus-lucas/tests/wasm-opencv/opencv/modules/python/package/extra_modules
-- Found 'mat_wrapper;utils' Python modules from /home/matheus-lucas/tests/wasm-opencv/opencv/modules/core/misc/python/package
-- Found 'gapi' Python modules from /home/matheus-lucas/tests/wasm-opencv/opencv/modules/gapi/misc/python/package
--
-- General configuration for OpenCV 4.8.0-dev =====================================
--   Version control:               4.8.0-205-ge8f94182f5
--
--   Extra modules:
--     Location (extra):            /home/matheus-lucas/tests/wasm-opencv/opencv/opencv_contrib/modules
--     Version control (extra):     4.8.0-14-g9e134699
--
--   Platform:
--     Timestamp:                   2023-09-07T16:42:36Z
--     Host:                        Linux 5.15.90.3-microsoft-standard-WSL2+ x86_64
--     Target:                      Emscripten 1 x86
--     CMake:                       3.10.2
--     CMake generator:             Unix Makefiles
--     CMake build tool:            /usr/bin/make
--     Configuration:               Release
--
--   CPU/HW features:
--     Baseline:
--       requested:                 SSE2
--     Dispatched code generation:
--       requested:                 SSE4_1 SSE4_2 AVX FP16
--
--   C/C++:
--     Built as dynamic libs?:      YES
--     C++ standard:                11
--     C++ Compiler:                /home/matheus-lucas/downloads/emsdk/upstream/emscripten/em++  (ver 18.0.0)
--     C++ flags (Release):         -fsigned-char -W -Wall -Wreturn-type -Wnon-virtual-dtor -Waddress -Wsequence-point -Wformat -Wformat-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Winconsistent-missing-override -Wno-delete-non-virtual-dtor -Wno-unnamed-type-template-args -Wno-comment -Wno-deprecated-enum-enum-conversion -Wno-deprecated-anon-enum-enum-conversion -fdiagnostics-show-option -pthread -Qunused-arguments -ffunction-sections -fdata-sections  -fvisibility=hidden -fvisibility-inlines-hidden -O3 -DNDEBUG  -DNDEBUG
--     C++ flags (Debug):           -fsigned-char -W -Wall -Wreturn-type -Wnon-virtual-dtor -Waddress -Wsequence-point -Wformat -Wformat-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Winconsistent-missing-override -Wno-delete-non-virtual-dtor -Wno-unnamed-type-template-args -Wno-comment -Wno-deprecated-enum-enum-conversion -Wno-deprecated-anon-enum-enum-conversion -fdiagnostics-show-option -pthread -Qunused-arguments -ffunction-sections -fdata-sections  -fvisibility=hidden -fvisibility-inlines-hidden -g  -O0 -DDEBUG -D_DEBUG
--     C Compiler:                  /home/matheus-lucas/downloads/emsdk/upstream/emscripten/emcc
--     C flags (Release):           -fsigned-char -W -Wall -Wreturn-type -Wnon-virtual-dtor -Waddress -Wsequence-point -Wformat -Wformat-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Winconsistent-missing-override -Wno-delete-non-virtual-dtor -Wno-unnamed-type-template-args -Wno-comment -Wno-deprecated-enum-enum-conversion -Wno-deprecated-anon-enum-enum-conversion -fdiagnostics-show-option -pthread -Qunused-arguments -ffunction-sections -fdata-sections  -fvisibility=hidden -fvisibility-inlines-hidden -O3 -DNDEBUG  -DNDEBUG
--     C flags (Debug):             -fsigned-char -W -Wall -Wreturn-type -Wnon-virtual-dtor -Waddress -Wsequence-point -Wformat -Wformat-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Winconsistent-missing-override -Wno-delete-non-virtual-dtor -Wno-unnamed-type-template-args -Wno-comment -Wno-deprecated-enum-enum-conversion -Wno-deprecated-anon-enum-enum-conversion -fdiagnostics-show-option -pthread -Qunused-arguments -ffunction-sections -fdata-sections  -fvisibility=hidden -fvisibility-inlines-hidden -g  -O0 -DDEBUG -D_DEBUG
--     Linker flags (Release):      -Wl,--gc-sections
--     Linker flags (Debug):        -Wl,--gc-sections
--     ccache:                      NO
--     Precompiled headers:         NO
--     Extra dependencies:
--     3rdparty dependencies:
--
--   OpenCV modules:
--     To be built:                 aruco bgsegm bioinspired calib3d ccalib core datasets dnn dnn_objdetect dnn_superres dpm face features2d flann fuzzy gapi hfs highgui img_hash imgcodecs imgproc intensity_transform line_descriptor mcc ml objdetect optflow phase_unwrapping photo plot quality rapid reg rgbd saliency shape stereo stitching structured_light superres surface_matching text tracking ts video videoio videostab wechat_qrcode xfeatures2d ximgproc xobjdetect xphoto
--     Disabled:                    world
--     Disabled by dependency:      -
--     Unavailable:                 alphamat cudaarithm cudabgsegm cudacodec cudafeatures2d cudafilters cudaimgproc cudalegacy cudaobjdetect cudaoptflow cudastereo cudawarping cudev cvv freetype hdf java julia matlab ovis python2 python3 sfm viz
--     Applications:                tests perf_tests apps
--     Documentation:               NO
--     Non-free algorithms:         NO
--
--   GUI:                           NONE
--     GTK+:                        NO
--
--   Media I/O:
--     ZLib:                        zlib (ver 1.2.13)
--     JPEG:                        libjpeg-turbo (ver 2.1.3-62)
--     WEBP:                        build (ver encoder: 0x020f)
--     PNG:                         build (ver 1.6.37)
--     TIFF:                        build (ver 42 - 4.2.0)
--     JPEG 2000:                   build (ver 2.5.0)
--     HDR:                         YES
--     SUNRASTER:                   YES
--     PXM:                         YES
--     PFM:                         YES
--
--   Video I/O:
--     DC1394:                      NO
--     FFMPEG:                      NO
--       avcodec:                   NO
--       avformat:                  NO
--       avutil:                    NO
--       swscale:                   NO
--       avresample:                NO
--     GStreamer:                   NO
--     v4l/v4l2:                    NO
--
--   Parallel framework:            pthreads
--
--   Trace:                         YES (with Intel ITT)
--
--   Other third-party libraries:
--     VA:                          NO
--     Lapack:                      NO
--     Custom HAL:                  NO
--     Protobuf:                    build (3.19.1)
--     Flatbuffers:                 builtin/3rdparty (23.5.9)
--
--   OpenCL:                        YES (no extra features)
--     Include path:                /home/matheus-lucas/tests/wasm-opencv/opencv/3rdparty/include/opencl/1.2
--     Link libraries:              Dynamic load
--
--   Python (for build):            /usr/bin/python2.7
--
--   Install to:                    /home/matheus-lucas/tests/wasm-opencv/opencv/build/install
-- -----------------------------------------------------------------
--
-- Configuring done
CMake Error: install(EXPORT "OpenCVModules" ...) includes target "opencv_core" which requires target "zlib" that is not in the export set.
CMake Error: install(EXPORT "OpenCVModules" ...) includes target "opencv_core" which requires target "ittnotify" that is not in the export set.
CMake Error: install(EXPORT "OpenCVModules" ...) includes target "opencv_dnn" which requires target "ocv.3rdparty.flatbuffers" that is not in the export set.
CMake Error: install(EXPORT "OpenCVModules" ...) includes target "opencv_dnn" which requires target "libprotobuf" that is not in the export set.
CMake Error: install(EXPORT "OpenCVModules" ...) includes target "opencv_imgcodecs" which requires target "libjpeg-turbo" that is not in the export set.
CMake Error: install(EXPORT "OpenCVModules" ...) includes target "opencv_imgcodecs" which requires target "libwebp" that is not in the export set.
CMake Error: install(EXPORT "OpenCVModules" ...) includes target "opencv_imgcodecs" which requires target "libpng" that is not in the export set.
CMake Error: install(EXPORT "OpenCVModules" ...) includes target "opencv_imgcodecs" which requires target "libtiff" that is not in the export set.
CMake Error: install(EXPORT "OpenCVModules" ...) includes target "opencv_imgcodecs" which requires target "libopenjp2" that is not in the export set.
CMake Error: install(EXPORT "OpenCVModules" ...) includes target "opencv_imgcodecs" which requires target "zlib" that is not in the export set.
CMake Error: install(EXPORT "OpenCVModules" ...) includes target "opencv_objdetect" which requires target "quirc" that is not in the export set.
CMake Error: install(EXPORT "OpenCVModules" ...) includes target "opencv_gapi" which requires target "ade" that is not in the export set.
CMake Error: install(EXPORT "OpenCVModules" ...) includes target "opencv_gapi" which requires target "ittnotify" that is not in the export set.
-- Generating done
-- Build files have been written to: /home/matheus-lucas/tests/wasm-opencv/opencv/build
emcmake: error: 'cmake -v -DOPENCV_EXTRA_MODULES_PATH=../opencv_contrib/modules ../ -DCMAKE_TOOLCHAIN_FILE=/home/matheus-lucas/downloads/emsdk/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake -DCMAKE_CROSSCOMPILING_EMULATOR=/home/matheus-lucas/downloads/emsdk/node/16.20.0_64bit/bin/node' failed (returned 1)
@sbc100
Copy link
Collaborator

sbc100 commented Sep 7, 2023

If your goal is to run under wasmtime then you are better of using wasi-sdk.

The problem you are running into is that you need to build and install the prerequisites. e.g. zlib, libpng, etc and make sure they are installed in the sysroot (or in the include/lib path somehow).

@nerdola-de-cartola
Copy link
Author

You are correct, I thought that was not the case because I do have zlib installed but in fact my version is too old for this build (1.2.11)

Since you mentioned, what do you mean by "using wasi-sdk"? I thought that I was already using wasi, there is any link or documentation on that subject?

Btw, thanks for your help

@sbc100
Copy link
Collaborator

sbc100 commented Sep 8, 2023

wasi-sdk is a completely separate toolchain to emscripten: https://github.com/WebAssembly/wasi-sdk. emscripten's support for WASI is extremely limited.

@nerdola-de-cartola
Copy link
Author

Thank you, I will have a look on wasi-sdk

@Brennanzuz
Copy link

Thank you, I will have a look on wasi-sdk

Any luck? I'm trying to do the exact same thing as you

@kripken
Copy link
Member

kripken commented Sep 24, 2024

There are official docs on the OpenCV project for how to build it, which might be useful:

https://docs.opencv.org/3.4/d4/da1/tutorial_js_setup.html

@Brennanzuz
Copy link

Thanks, but I've tried that and it doesn't work; OpenCV.js seems to be building javascript files that are to be used for people making webpages from scratch, or smth.

See, I'm using Godot, and I simply need OpenCV's libraries not in a format that won't be rejected by wasm-ld. The opencv_js.wasm file provided by that repository can't be found by wasm-ld for some reason, and I have no idea what to do.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants