generator
generator

Reputation: 49

OPENCV.js Cannot get Emscripten path

I am trying to setup OPENCV.js on linux.But I have infuriating problems on Empscripten path. I am following this documentation:https://docs.opencv.org/3.3.1/d4/da1/tutorial_js_setup.html

1-)I download empscripten and execute following code.

./emsdk update
./emsdk install latest
./emsdk activate latest

2-)Set the environment path

source ./emsdk_env.sh

3-)Clone opencv with git

git clone https://github.com/opencv/opencv.git

4-)To build this directory (/root/Downloads/opencvjspackage)

 python ./platforms/js/build_js.py /root/Downloads/opencvjspackage

I get this output on part 4

root@kali:~/Downloads/opencvjs/opencv# python ./platforms/js/build_js.py /root/Downloads/opencvjspackage
Args: Namespace(build_dir='/root/Downloads/opencvjspackage', build_doc=False, build_test=False, build_wasm=False, clean_build_dir=False, config_only=False, emscripten_dir=None, enable_exception=False, opencv_dir='/root/Downloads/opencvjs/opencv', skip_config=False)
Cannot get Emscripten path, please specify it either by EMSCRIPTEN environment variable or --emscripten_dir option.

I try this

python ./platforms/js/build_js.py /root/Downloads/opencvjspackage --emscripten_dir=/root/Downloads/emsdk-portable/emscripten/1.37.33 

And get this output:

usage: build_js.py [-h] [--opencv_dir OPENCV_DIR]
                   [--emscripten_dir EMSCRIPTEN_DIR] [--build_wasm]
                   [--build_test] [--build_doc] [--clean_build_dir]
                   [--skip_config] [--config_only] [--enable_exception]
                   build_dir
build_js.py: error: too few arguments

Upvotes: 0

Views: 2015

Answers (1)

Eyal Person Shahar
Eyal Person Shahar

Reputation: 46

There should be no = between --emscripten_dir and the Empscripten path. Also the output folder should be the last argument. Try like this:

python ./platforms/js/build_js.py --emscripten_dir /root/Downloads/emsdk-portable/emscripten/1.37.33 /root/Downloads/opencvjspackage

Tip: make sure /root/Downloads/opencvjspackage exists and is where you want opencv.js to be built into. Also make sure cmake is installed.

Upvotes: 3

Related Questions