Skip to content

“emcc” command does not recognized

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 ?

Answer

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.