Cannot get Emscripten path, please specify it either by EMSCRIPTEN environment variable or --emscripten_dir option.

asked 2018-02-14 06:02:22 -0600

generator gravatar image

Hello guys.I am totally new for opencv.js.I have some problems on building opencv.js I am using Windows 10.I follow below steps for setup opencv.js.The problem look like "EMPSCRÄ°PTEN cannot set the path properly and part 5 fail to execute".How can i solve this problem?

https://docs.opencv.org/3.3.1/d4/da1/...

1-)First I used below link to download the Empscripten https://kripken.github.io/emscripten-...

2-)And execute this line son command propmpt(in empscripten folder)

emsdk
emsdk_env.bat

After this Execution , Empscripten set the path

EMSDK = C:/Users/q/Desktop/web/opencv.js/emsdk-portable-64bit
EM_CONFIG = C:\Users\q\.emscripten

3-)Download phyton 3

4-)Clone opencv

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

5-)Execute this code to build opencv.js but i get following error

python C:\Users\q\opencv\platforms\js\build_js.py C:\OpencvJS

C:\Users\q>python C:\Users\q\opencv\platforms\js\build_js.py C:\OpencvJS
Args: Namespace(build_dir='C:\\OpencvJS', build_doc=False, build_test=False, build_wasm=False, clean_build_dir=False, config_only=False, emscripten_dir=None, enable_exception=False, opencv_dir='C:\\Users\\q\\opencv', skip_config=False)
Cannot get Emscripten path, please specify it either by EMSCRIPTEN environment variable or --emscripten_dir option.
edit retag flag offensive close merge delete

Comments

cd into C:\Users\q\opencv\platforms\js ( so it finds the opencv code ), then

try either:

set EMSCRIPTEN=C:/Users/q/Desktop/web/opencv.js/emsdk-portable-64bit

(on the cmdline) or add it to the build_js.py args:

python build_js.py C:\OpencvJS --emscripten_dir=C:/Users/q/Desktop/web/opencv.js/emsdk-portable-64bit

try, and report back, please !

berak gravatar imageberak ( 2018-02-14 06:20:03 -0600 )edit

After execute this code , i get this : https://anotepad.com/notes/6pnq5j

generator gravatar imagegenerator ( 2018-02-14 06:23:20 -0600 )edit
1

i find emcc https://imgur.com/Zej042e

Place emcc in my PATH: https://imgur.com/CMcPeQt

And type : python build_js.py C:\OpencvJS --emscripten_dir=C:/Users/q/Desktop/web/opencv.js/emsdk-portable-64bit

I get this: https://anotepad.com/notes/jphh3f

generator gravatar imagegenerator ( 2018-02-14 06:47:01 -0600 )edit

hmm, it's actually emcc.bat , in your sdk folder right ?

there might be a bug, since subprocess cannot guess, that you want to start emcc.bat , not emcc . (which is the corresponding linux shell script)

can you try to change this line

to:

ret = subprocess.check_output([os.path.join(emscripten_dir, "emcc.bat"), "--version"])

???

berak gravatar imageberak ( 2018-02-14 06:49:42 -0600 )edit

I change this file :C:\Users\q\opencv\platforms\js\build_js.py

Now my file like this: https://anotepad.com/notes/jn5m7p

I am getting this error: https://anotepad.com/notes/fh3qxf

My emcc file path:C:\Users\q\Desktop\web\opencv.js\emsdk-portable-64bit

My emsdk file path:C:\Users\q\Desktop\web\opencv.js\emsdk-portable-64bit

generator gravatar imagegenerator ( 2018-02-14 06:59:16 -0600 )edit

apologies, out of ideas then. ;(

berak gravatar imageberak ( 2018-02-14 07:14:13 -0600 )edit

thank you for your interest :) Can you use this opencv.js file without building it?(like jquery) Where can i find this file?

generator gravatar imagegenerator ( 2018-02-14 07:20:28 -0600 )edit

yes, you can take utils.js and opencv.js it from the docs webpages (just follow the iframes !)

berak gravatar imageberak ( 2018-02-14 07:40:47 -0600 )edit

woww.Thank you a lot.It is definitely huge library(32MB).How can i minify this file?I tried to copy code and minify this javascript file by following sites and my browser have crashed and cannot respond.

generator gravatar imagegenerator ( 2018-02-14 08:02:17 -0600 )edit

woww, last time i looked, it had grown from 6mb to 12mb ;)

(and no idea, sorry.)

berak gravatar imageberak ( 2018-02-14 08:06:43 -0600 )edit