Reputation: 806
I'm having issue with building this demo. https://github.com/kakukogou/opencvjs_demo_segmentation
When i cd into this folder and run make command i get this error message:
/bin/sh: 1: emcc: not found
make: *** [segmentation] Error 127
This is how make file looks like.
segmentation: ../src/segmentation.cpp ../src/export.cpp
mkdir -p $(OBJDIR)
emcc \
../src/segmentation.cpp \
../src/export.cpp \
-I $(OPENCV_INSTALL_DIR)/include \
$(OPENCV_INSTALL_DIR)/lib/libopencv_core.so \
$(OPENCV_INSTALL_DIR)/lib/libopencv_imgproc.so \
-s EXPORTED_FUNCTIONS="['_on_mouse', '_on_init', '_on_process']" \
-O3 \
--llvm-lto 1 \
--closure 1 \
-s PRECISE_F32=1 \
-s FORCE_ALIGNED_MEMORY=1 \
-s TOTAL_MEMORY=306777216 \
-o ./bin/segmentation.js
clean:
rm ./bin/*.js ./bin/*.mem
Is there any issue with my environment variables. What is the proper way to compile this ?
Upvotes: 6
Views: 8790
Reputation: 255
You have to make the environment manually, try this
source /emsdk/emsdk_env.sh
Upvotes: 0
Reputation: 703
Encounter same problem in window 11
In my case there was problem with path of EMSDK
After running emsdk_env.bat
I have check path in environment variable and I found it was E:/emsdk
Then I have changed it to E:\emsdk
Now working fine for me
Upvotes: 2
Reputation: 21
this works for me
adding
source ./emsdk_env.sh
to .bashrc
or .zshrc
file
Upvotes: 2
Reputation: 947
For Windows, in 'emsdk' folder (downloaded from ' git clone https://github.com/emscripten-core/emsdk.git ') run :
./emsdk activate latest --permanent
Upvotes: 5
Reputation: 806
For whatever reason default path configurations in .emscripten does not enable emcc in terminal. so i manually set the EMSCRIPTEN_ROOT in /etc/environment and now it recognizes the emcc command in terminal.
Upvotes: 6