Hi Tarek,
I can’t even get the build to work.
Here is what I get.
emcmake python3 opencv/platforms/js/build_js.py build_asm --disable_wasm --emscripten_dir=“/mnt/c/users/magma/emsdk/upstream/emscripten” --cmake_option=“-DCMAKE_TOOLCHAIN_FILE=/mnt/c/Users/magma/emsdk/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake” --cmake_option=“-DCMAKE_CROSSCOMPILING_EMULATOR=/mnt/c/Users/magma/emsdk/node/16.20.0_64bit/bin/node”
configure: python3 opencv/platforms/js/build_js.py build_asm --disable_wasm --emscripten_dir=/mnt/c/users/magma/emsdk/upstream/emscripten --cmake_option=-DCMAKE_TOOLCHAIN_FILE=/mnt/c/Users/magma/emsdk/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake --cmake_option=-DCMAKE_CROSSCOMPILING_EMULATOR=/mnt/c/Users/magma/emsdk/node/16.20.0_64bit/bin/node
EMSCRIPTEN environment variable is not available. Please properly activate Emscripten SDK and consider using ‘emcmake’ launcher
Args: Namespace(build_dir=‘build_asm’, opencv_dir=‘/home/frank/opencv’, emscripten_dir=‘/mnt/c/users/magma/emsdk/upstream/emscripten’, build_wasm=False, disable_wasm=True, disable_single_file=False, threads=False, simd=False, build_test=False, build_perf=False, build_doc=False, build_loader=False, clean_build_dir=False, skip_config=False, config_only=False, enable_exception=False, cmake_option=[‘-DCMAKE_TOOLCHAIN_FILE=/mnt/c/Users/magma/emsdk/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake’, ‘-DCMAKE_CROSSCOMPILING_EMULATOR=/mnt/c/Users/magma/emsdk/node/16.20.0_64bit/bin/node’], build_flags=None, build_wasm_intrin_test=False, config=‘/home/frank/opencv/platforms/js/opencv_js.config.py’, webnn=False)
Check dir /home/frank/build_asm (create: True, clean: False)
Check dir /home/frank/opencv (create: False, clean: False)
options.opencv_dir: /home/frank/opencv
Check dir /mnt/c/users/magma/emsdk/upstream/emscripten (create: False, clean: False)
===== Config OpenCV.js build for asm.js
Executing: [‘cmake’, ‘-DPYTHON_DEFAULT_EXECUTABLE=/usr/bin/python3’, ‘-DENABLE_PIC=FALSE’, ‘-DCMAKE_BUILD_TYPE=Release’, “-DCMAKE_TOOLCHAIN_FILE=‘/mnt/c/users/magma/emsdk/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake’”, “-DCPU_BASELINE=‘’”, ‘-DCMAKE_INSTALL_PREFIX=/usr/local’, “-DCPU_DISPATCH=‘’”, ‘-DCV_TRACE=OFF’, ‘-DBUILD_SHARED_LIBS=OFF’, ‘-DWITH_1394=OFF’, ‘-DWITH_ADE=OFF’, ‘-DWITH_VTK=OFF’, ‘-DWITH_EIGEN=OFF’, ‘-DWITH_FFMPEG=OFF’, ‘-DWITH_GSTREAMER=OFF’, ‘-DWITH_GTK=OFF’, ‘-DWITH_GTK_2_X=OFF’, ‘-DWITH_IPP=OFF’, ‘-DWITH_JASPER=OFF’, ‘-DWITH_JPEG=OFF’, ‘-DWITH_WEBP=OFF’, ‘-DWITH_OPENEXR=OFF’, ‘-DWITH_OPENGL=OFF’, ‘-DWITH_OPENVX=OFF’, ‘-DWITH_OPENNI=OFF’, ‘-DWITH_OPENNI2=OFF’, ‘-DWITH_PNG=OFF’, ‘-DWITH_TBB=OFF’, ‘-DWITH_TIFF=OFF’, ‘-DWITH_V4L=OFF’, ‘-DWITH_OPENCL=OFF’, ‘-DWITH_OPENCL_SVM=OFF’, ‘-DWITH_OPENCLAMDFFT=OFF’, ‘-DWITH_OPENCLAMDBLAS=OFF’, ‘-DWITH_GPHOTO2=OFF’, ‘-DWITH_LAPACK=OFF’, ‘-DWITH_ITT=OFF’, ‘-DWITH_QUIRC=ON’, ‘-DBUILD_ZLIB=ON’, ‘-DBUILD_opencv_apps=OFF’, ‘-DBUILD_opencv_calib3d=ON’, ‘-DBUILD_opencv_dnn=ON’, ‘-DBUILD_opencv_features2d=ON’, ‘-DBUILD_opencv_flann=ON’, ‘-DBUILD_opencv_gapi=OFF’, ‘-DBUILD_opencv_ml=OFF’, ‘-DBUILD_opencv_photo=ON’, ‘-DBUILD_opencv_imgcodecs=OFF’, ‘-DBUILD_opencv_shape=OFF’, ‘-DBUILD_opencv_videoio=OFF’, ‘-DBUILD_opencv_videostab=OFF’, ‘-DBUILD_opencv_highgui=OFF’, ‘-DBUILD_opencv_superres=OFF’, ‘-DBUILD_opencv_stitching=OFF’, ‘-DBUILD_opencv_java=OFF’, ‘-DBUILD_opencv_js=ON’, ‘-DBUILD_opencv_python2=OFF’, ‘-DBUILD_opencv_python3=OFF’, ‘-DBUILD_EXAMPLES=ON’, ‘-DBUILD_PACKAGE=OFF’, ‘-DBUILD_TESTS=ON’, ‘-DBUILD_PERF_TESTS=ON’, ‘-DCMAKE_TOOLCHAIN_FILE=/mnt/c/Users/magma/emsdk/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake’, ‘-DCMAKE_CROSSCOMPILING_EMULATOR=/mnt/c/Users/magma/emsdk/node/16.20.0_64bit/bin/node’, ‘-DBUILD_DOCS=OFF’, ‘-DWITH_PTHREADS_PF=OFF’, ‘-DCV_ENABLE_INTRINSICS=OFF’, ‘-DBUILD_WASM_INTRIN_TESTS=OFF’, “-DCMAKE_C_FLAGS='-s WASM=0 -s SINGLE_FILE=1 -s USE_PTHREADS=0 '”, “-DCMAKE_CXX_FLAGS='-s WASM=0 -s SINGLE_FILE=1 -s USE_PTHREADS=0 '”, ‘/home/frank/opencv’]
Re-run cmake no build system arguments
CMake Error at /usr/share/cmake-3.22/Modules/CMakeDetermineSystem.cmake:130 (message):
Could not find toolchain file:
/mnt/c/Users/magma/emsdk/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake
Call Stack (most recent call first):
CMakeLists.txt:113 (enable_language)
CMake Error: CMake was unable to find a build program corresponding to “Unix Makefiles”. CMAKE_MAKE_PROGRAM is not set. You probably need to select a different build tool.
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
– Configuring incomplete, errors occurred!
Traceback (most recent call last):
File “/home/frank/opencv/platforms/js/build_js.py”, line 291, in
builder.config()
File “/home/frank/opencv/platforms/js/build_js.py”, line 202, in config
execute(cmd)
File “/home/frank/opencv/platforms/js/build_js.py”, line 23, in execute
raise Fail(“Child returned: %s” % retcode)
main.Fail: Child returned: 1
emcmake: error: ‘python3 opencv/platforms/js/build_js.py build_asm --disable_wasm --emscripten_dir=/mnt/c/users/magma/emsdk/upstream/emscripten --cmake_option=-DCMAKE_TOOLCHAIN_FILE=/mnt/c/Users/magma/emsdk/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake --cmake_option=-DCMAKE_CROSSCOMPILING_EMULATOR=/mnt/c/Users/magma/emsdk/node/16.20.0_64bit/bin/node’ failed (returned 1)