emscripten-core / emscripten-core/emscripten
emmake make command makes error when used for openCV
- Dominant language
- C++
- Stars
- 27.6k
- Forks
- 3.6k
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 105
Description
I am trying to make a simple application in cpp that uses openCV and compile it to wasm. I followed the documentation and tried to produce static library files *.a and the cpp file that references the opencv library as a .o file. This is where I had the error.
I ran the command
cmake ../ -B./ -DBUILD_SHARED_LIBS=OFF -DCMAKE_OSX_ARCHITECTURES="x86_64" -DWITH_1394=OFF -DWITH_FFMPEG=OFF -DBUILD_TESTS=OFF
to build opencv statically into the current folder. Then I ran the commands
- make
- sudo make install
after this I navigated to where my cpp file is, then ran
- cmake .
- make
based on this I get the executable. It all works well here.
But when I ran the following commands instead based on the documentation, I got the error.
- emcmake cmake ../ -B./ -DBUILD_SHARED_LIBS=OFF -DCMAKE_OSX_ARCHITECTURES="x86_64" -DWITH_1394=OFF -
DWITH_FFMPEG=OFF -DBUILD_TESTS=OFF
- emmake make
error happens.
make: make
Scanning dependencies of target gen-pkgconfig
[ 0%] Generate opencv.pc
[ 0%] Built target gen-pkgconfig
Scanning dependencies of target ittnotify
[ 0%] Building C object 3rdparty/ittnotify/CMakeFiles/ittnotify.dir/src/ittnotify/ittnotify_static.c.o
In file included from /Users/atul109/MyDocuments/work/new/emscripten_playground/opencv-3.4.14/3rdparty/ittnotify/src/ittnotify/ittnotify_static.c:59:
/Users/atul109/MyDocuments/work/new/emscripten_playground/opencv-3.4.14/3rdparty/ittnotify/src/ittnotify/ittnotify_config.h:376:12: error: implicit declaration of function '__TBB_machine_fetchadd4' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
return __TBB_machine_fetchadd4(ptr, 1) + 1L;
^
1 error generated.
emcc: error: '/Users/atul109/MyDocuments/work/new/emscripten_playground/emsdk/upstream/bin/clang -target wasm32-unknown-emscripten -D__EMSCRIPTEN_PTHREADS__=1 -DEMSCRIPTEN -fignore-exceptions -mllvm -combiner-global-alias-analysis=false -mllvm -enable-emscripten-sjlj -mllvm -disable-lsr -D__EMSCRIPTEN_major__=2 -D__EMSCRIPTEN_minor__=0 -D__EMSCRIPTEN_tiny__=17 -D_LIBCPP_ABI_VERSION=2 -Dunix -D__unix -D__unix__ -Werror=implicit-function-declaration -Xclang -iwithsysroot/include/SDL --sysroot=/Users/atul109/MyDocuments/work/new/emscripten_playground/emsdk/upstream/emscripten/cache/sysroot -Xclang -iwithsysroot/include/compat -I/Users/atul109/MyDocuments/work/new/emscripten_playground/opencv-3.4.14/3rdparty/ittnotify/include -I/Users/atul109/MyDocuments/work/new/emscripten_playground/opencv-3.4.14/WasmBuild/3rdparty/ippicv/ippicv_lnx/icv/include -I/Users/atul109/MyDocuments/work/new/emscripten_playground/opencv-3.4.14/WasmBuild/3rdparty/ippicv/ippicv_lnx/iw/include -I/Users/atul109/MyDocuments/work/new/emscripten_playground/opencv-3.4.14/WasmBuild -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Winconsistent-missing-override -Wno-delete-non-virtual-dtor -Wno-unnamed-type-template-args -Wno-comment -Wno-deprecated-enum-enum-conversion -Wno-deprecated-anon-enum-enum-conversion -fdiagnostics-show-option -pthread -Qunused-arguments -ffunction-sections -fdata-sections -fvisibility=hidden -fvisibility-inlines-hidden -Wno-implicit-fallthrough -Wno-undef -Wno-sign-compare -O3 -DNDEBUG -DNDEBUG -fPIC -c -pthread /Users/atul109/MyDocuments/work/new/emscripten_playground/opencv-3.4.14/3rdparty/ittnotify/src/ittnotify/ittnotify_static.c -o CMakeFiles/ittnotify.dir/src/ittnotify/ittnotify_static.c.o' failed (1)
make[2]: *** [3rdparty/ittnotify/CMakeFiles/ittnotify.dir/src/ittnotify/ittnotify_static.c.o] Error 1
make[1]: *** [3rdparty/ittnotify/CMakeFiles/ittnotify.dir/all] Error 2
make: *** [all] Error 2
emmake: error: 'make' failed (2)
From what I understand the ittnotify is causing error. But somehow it was fine when I did the normal cmake and make. It only does this for emcmake cmake and emmake make.
/Users/atul109/MyDocuments/work/new/emscripten_playground/opencv-3.4.14/3rdparty/ittnotify/src/ittnotify/ittnotify_config.h:376:12: error: implicit declaration of function '__TBB_machine_fetchadd4' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
return __TBB_machine_fetchadd4(ptr, 1) + 1L;
^
1 error generated.
Please help.
Contributor guide
Assessment
This issue has not been assessed yet.