That looks like this bug https://github.com/kripken/emscripten/issues/4395. Unfortunately we don't currently have a fix for that, but for OpenCV, you can try editing the CMakeLists.txt to remove SIMD support to see if that works around the issue.
2016-08-10 2:42 GMT+03:00 Gunjan Shrivastava <[email protected]>: > Thanks jj, > > I was able to successfully compile opencv (https://github.com/kakukogou/ > opencv/tree/opencvjs) after installing the incoming branch but still > there are errors coming when I tried to run the segmentation demo( > https://github.com/kakukogou/opencvjs_demo_segmentation). > > When I build 'make', I am getting the following error: > > mkdir -p ./bin > /home/gunjan/gsoc/emsdk-07-26-2016/emsdk_portable/emscripten/incoming/emcc > \ > ../src/segmentation.cpp \ > ../src/export.cpp \ > -I /home/gunjan/gsoc/emsdk-07-26-2016/emsdk_portable/ > emscripten/incoming/opencv/release_asm/install/include \ > /home/gunjan/gsoc/emsdk-07-26-2016/emsdk_portable/ > emscripten/incoming/opencv/release_asm/install/lib/libopencv_core.so \ > /home/gunjan/gsoc/emsdk-07-26-2016/emsdk_portable/ > emscripten/incoming/opencv/release_asm/install/lib/libopencv_imgproc.so \ > -s EXPORTED_FUNCTIONS="['_on_mouse', '_on_init', '_on_process']" \ > -O3 \ > --llvm-lto 1 \ > --closure 1 \ > -s PRECISE_F32=1 \ > > %703 = extractelement <2 x i64> %bc.i.i135, i32 0 > 0 llc 0x0000000000e38d98 > llvm::sys::PrintStackTrace(llvm::raw_ostream&) > + 56 > 1 llc 0x0000000000e37026 llvm::sys::RunSignalHandlers() + 54 > 2 llc 0x0000000000e37189 > 3 libpthread.so.0 0x00007f291f9c43d0 > 4 llc 0x0000000000b65091 > llvm::CallInst::init(llvm::FunctionType*, > llvm::Value*, llvm::ArrayRef<llvm::Value*>, llvm::ArrayRef<llvm:: > OperandBundleDefT<llvm::Value*> >, llvm::Twine const&) + 177 > 5 llc 0x0000000000ef3982 > 6 llc 0x0000000000ef6cb0 > 7 llc 0x0000000000b8677f > llvm::legacy::PassManagerImpl::run(llvm::Module&) > + 783 > 8 llc 0x0000000000569e5b > 9 llc 0x000000000054bb10 main + 256 > 10 libc.so.6 0x00007f291ed69830 __libc_start_main + 240 > 11 llc 0x0000000000562349 _start + 41 > Stack dump: > 0. Program arguments: /home/gunjan/gsoc/emsdk-07-26- > 2016/emsdk_portable/clang/fastcomp/build_incoming_64/bin/llc > /tmp/tmpPJYtDm/a.out.bc -march=js -filetype=asm -o /tmp/tmpdIDpbR.4.js > -emscripten-precise-f32 -emscripten-global-base=8 -O3 > 1. Running pass 'Expand and lower illegal >i32 operations into 32-bit > chunks' on module '/tmp/tmpPJYtDm/a.out.bc'. > Traceback (most recent call last): > File > "/home/gunjan/gsoc/emsdk-07-26-2016/emsdk_portable/emscripten/incoming/emcc", > line 13, in <module> > emcc.run() > File > "/home/gunjan/gsoc/emsdk-07-26-2016/emsdk_portable/emscripten/incoming/emcc.py", > line 1490, in run > final = shared.Building.emscripten(final, append_ext=False, > extra_args=extra_args) > File "/home/gunjan/gsoc/emsdk-07-26-2016/emsdk_portable/ > emscripten/incoming/tools/shared.py", line 1691, in emscripten > call_emscripten(cmdline) > File "/home/gunjan/gsoc/emsdk-07-26-2016/emsdk_portable/ > emscripten/incoming/emscripten.py", line 1721, in _main > temp_files.run_and_clean(lambda: main( > File "/home/gunjan/gsoc/emsdk-07-26-2016/emsdk_portable/ > emscripten/incoming/tools/tempfiles.py", line 64, in run_and_clean > return func() > File "/home/gunjan/gsoc/emsdk-07-26-2016/emsdk_portable/ > emscripten/incoming/emscripten.py", line 1726, in <lambda> > DEBUG=DEBUG, > File "/home/gunjan/gsoc/emsdk-07-26-2016/emsdk_portable/ > emscripten/incoming/emscripten.py", line 1627, in main > temp_files=temp_files, DEBUG=DEBUG) > File "/home/gunjan/gsoc/emsdk-07-26-2016/emsdk_portable/ > emscripten/incoming/emscripten.py", line 86, in emscript > funcs, metadata, mem_init = get_and_parse_backend(infile, settings, > temp_files, DEBUG) > > > > > *File > "/home/gunjan/gsoc/emsdk-07-26-2016/emsdk_portable/emscripten/incoming/emscripten.py", > line 146, in get_and_parse_backend backend_output = > open(temp_js).read()IOError: [Errno 2] No such file or directory: > '/tmp/tmpdIDpbR.4.js'Makefile:7: recipe for target 'segmentation' > failedmake: *** [segmentation] Error 1* > > Can someone help me here, anyone who may have faced a similar issue? > > Thanks, > Gunjan. > > On Tuesday, 21 June 2016 08:13:47 UTC-4, jj wrote: >> >> Thanks for reporting, >> >> I think this is fixed by https://github.com/kripken/ >> emscripten/commit/2e56e7764fcfac0dc617723283cf064dd7115cbd, which is >> currently in the incoming branch (./emsdk install sdk-incoming-64bit && >> ./emsdk activate sdk-incoming-64bit) >> >> 2016-06-14 10:11 GMT+03:00 Gunjan Shrivastava <[email protected]>: >> >>> Hello Kuo, >>> >>> >>> I am trying to compile OpenCV library in Emscripten using >>> https://github.com/kakukogou/opencv/tree/opencvjs. I successfully >>> completed the steps till: >>> >>> >>> emcmake cmake -DBUILD_CUDA_STUBS=OFF -DBUILD_DOCS=OFF >>> -DBUILD_EXAMPLES=OFF -DBUILD_JASPER=OFF -DBUILD_JPEG=OFF >>> -DBUILD_OPENEXR=OFF -DBUILD_PERF_TESTS=OFF -DBUILD_PNG=OFF -DBUILD_TBB=OFF >>> -DBUILD_TESTS=OFF -DBUILD_TIFF=OFF -DBUILD_WITH_DEBUG_INFO=OFF >>> -DBUILD_ZLIB=OFF -DBUILD_opencv_apps=OFF -DBUILD_opencv_ts=OFF >>> -DBUILD_opencv_world=OFF -DWITH_1394=OFF -DWITH_CLP=OFF -DWITH_CUBLAS=OFF >>> -DWITH_CUDA=OFF -DWITH_CUFFT=OFF -DWITH_FFMPEG=OFF -DWITH_GDAL=OFF >>> -DWITH_GIGEAPI=OFF -DWITH_GSTREAMER=OFF -DWITH_GSTREAMER_0_10=OFF >>> -DWITH_GTK=OFF -DWITH_GTK_2_X=OFF -DWITH_JASPER=OFF -DWITH_JPEG=OFF >>> -DWITH_LIBV4L=OFF -DWITH_NVCUVID=OFF -DWITH_OPENCL=OFF >>> -DWITH_OPENCLAMDBLAS=OFF -DWITH_OPENCLAMDFFT=OFF -DWITH_OPENEXR=OFF >>> -DWITH_OPENGL=OFF -DWITH_OPENMP=OFF -DWITH_OPENNI=OFF -DWITH_OPENNI2=OFF >>> -DWITH_PNG=OFF -DWITH_PVAPI=OFF -DWITH_QT=OFF -DWITH_TBB=OFF >>> -DWITH_TIFF=OFF -DWITH_UNICAP=OFF -DWITH_V4L=OFF -DWITH_VTK=OFF >>> -DWITH_WEBP=OFF -DWITH_XIMEA=OFF -DWITH_XINE=OFF -DBUILD_SHARED_LIBS=ON >>> -DBUILD_PACKAGE=ON -DCMAKE_COLOR_MAKEFILE=ON -DWITH_EIGEN=ON >>> -DCMAKE_BUILD_TYPE=RELEASE -DCMAKE_CXX_FLAGS_RELEASE="-DNDEBUG -O3 -s >>> PRECISE_F32=1 -Wno-warn-absolute-paths" >>> -DCMAKE_CXX_FLAGS_RELWITHDEBINFO="-O3 >>> -s PRECISE_F32=1" -DCMAKE_C_FLAGS_RELEASE="-DNDEBUG -O3 -s >>> PRECISE_F32=1" -DCMAKE_C_FLAGS_RELWITHDEBINFO="-O3 -s PRECISE_F32=1" >>> -DCMAKE_EXE_LINKER_FLAGS_RELEASE="-O3 -s PRECISE_F32=1" >>> -DCMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO="-O3 -g -s PRECISE_F32=1" >>> -DCMAKE_MODULE_LINKER_FLAGS_RELEASE="-O3 -s PRECISE_F32=1" >>> -DCMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO="-O3 -g -s PRECISE_F32=1" >>> -DCMAKE_SHARED_LINKER_FLAGS_RELEASE="-O3 -s PRECISE_F32=1" >>> -DCMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO="-O3 -g -s PRECISE_F32=1" .. >>> >>> >>> but I am getting following error on ‘emmake make’: >>> >>> >>> [ 5%] Built target zlib >>> >>> [ 5%] Generating opencl_kernels_core.cpp, opencl_kernels_core.hpp >>> >>> Scanning dependencies of target opencv_core >>> >>> [ 7%] Building CXX object modules/core/CMakeFiles/opencv >>> _core.dir/src/rand.cpp.o >>> >>> In file included from /home/gunjan/Downloads/emsdk_p >>> ortable/opencv/modules/core/src/rand.cpp:49: >>> >>> In file included from /home/gunjan/Downloads/emsdk_p >>> ortable/opencv/modules/core/src/precomp.hpp:55: >>> >>> In file included from /home/gunjan/Downloads/emsdk_p >>> ortable/opencv/modules/core/include/opencv2/core/private.hpp:58: >>> >>> In file included from /usr/include/eigen3/Eigen/Core:263: >>> >>> */usr/include/eigen3/Eigen/src/Core/arch/SSE/PacketMath.h:333:76: error: >>> no matching function for call to '_mm_prefetch'* >>> >>> *template<> EIGEN_STRONG_INLINE void prefetch<float>(const float* >>> addr) { _mm_prefetch((const char*)(addr), _MM_HINT_T0);* } >>> >>> >>> ^~~~~~~~~~~~ >>> >>> */home/gunjan/Downloads/emsdk_portable/emscripten/master/system/include/emscripten/xmmintrin.h:129:1: >>> note: candidate function not viable: no known conversion from 'const char >>> *' to 'void *' for 1st* >>> >>> * argument* >>> >>> *_mm_prefetch(void *__p, int __i)* >>> >>> >>> Please refer the screenshot for additional information. >>> >>> Any help in this regard would be greatly beneficial for my project. >>> Please let me know if you need any other detail. >>> >>> >>> >>> Thank you. >>> >>> -Gunjan >>> >>> >>> >>> >>> On Wednesday, 31 December 2014 01:51:22 UTC-5, Tzu-Hao Kuo (Kaku) wrote: >>>> >>>> HI, >>>> >>>> I recently evaluate the performance of OpenCV with asm.js. >>>> Thanks to the OpenCV team, there are already lots of performance tests in >>>> each OpenCV module. >>>> What I have done is that compile OpenCV library and its performance tests >>>> both in native and with asm.js. >>>> Run the native performance test and the javascript performance test (with >>>> the Firefox javascript engine). >>>> And the statistics data could be found in the following Google Sheet >>>> link:https://docs.google.com/spreadsheets/d/1w8gr1_q_dQclTaGyiMtAhlwj_5_HPVKbHWfwUszPU40/edit?usp=sharing >>>> >>>> In summary, there are about 20% tests are faster or equal to the native >>>> performance and about 60% tests are faster than 3x native performance. >>>> >>>> Some patterns are observed. >>>> First, tests with operations which convert floating point values into >>>> integer values are much slower. >>>> Second, in native environment, single operation is much faster when it is >>>> dealing with integer type data comparing to dealing with floating point >>>> values; >>>> however, in javascript environment, the same operation performs equally in >>>> each data type, which leads to relatively larger performance drop in >>>> non-floating point data type. >>>> >>>> >>>> By traversing old posts, I found several people have tried to use >>>> OpenCV in their own projects, however, there is few performance >>>> information. >>>> I post this message here is intending to open a discussion forum which >>>> could collect information about OpenCV with asm.js and especially the >>>> performance. >>>> This message is also posted as a discussion bug in Mozilla Bugzilla, >>>> the link is, https://bugzilla.mozilla.org/show_bug.cgi?id=1116674. >>>> >>>> Tzuhao >>>> >>> -- >>> You received this message because you are subscribed to the Google >>> Groups "emscripten-discuss" group. >>> To unsubscribe from this group and stop receiving emails from it, send >>> an email to [email protected]. >>> For more options, visit https://groups.google.com/d/optout. >>> >> >> -- > You received this message because you are subscribed to the Google Groups > "emscripten-discuss" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "emscripten-discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
