OpenCV.js custom build failed in windows machine - opencv

I am trying to build opencv.js by following the steps mentioned in the Open CV [official document][1].
Note: I am trying to make a custom build instead of using the existing [opencv.js][2] library because I want to add some contrib modules as well.
Open CV source version: 4.5.1
Cmake: 3.20.0
Python: 3.7
Emscriptem: [latest][3]
operating system: windows 64 bit
The below is the stack trace of the issue I get when I try to execute the below command in the windows power shell..
emcmake python ./opencv/platforms/js/build_js.py build_js
Stack Trace
emcmake python ./opencv/platforms/js/build_js.py build_js
configure: python ./opencv/platforms/js/build_js.py build_js
Args: Namespace(build_dir='build_js', build_doc=False, build_flags=None, build_loader=False, build_perf=False, build_test=False, build_wasm=False, build_wasm_intrin_test=False, clean_build_dir=False, cmake_option=None, config='D:\\business\\Drapezy\\codetrials\\opencvjs\\opencv\\platforms\\js\\opencv_js.config.py', config_only=False, disable_wasm=False, emscripten_dir='D:\\business\\Drapezy\\codetrials\\opencvjs\\emsdk\\upstream\\emscripten', enable_exception=False, opencv_dir='D:\\business\\Drapezy\\codetrials\\opencvjs\\opencv', simd=False, skip_config=False, threads=False)
Check dir D:\business\Drapezy\codetrials\opencvjs\build_js (create: True, clean: False)
Check dir D:\business\Drapezy\codetrials\opencvjs\opencv (create: False, clean: False)
Check dir D:\business\Drapezy\codetrials\opencvjs\emsdk\upstream\emscripten (create: False, clean: False)
=====
===== Config OpenCV.js build for default target
=====
Executing: ['cmake', '-DPYTHON_DEFAULT_EXECUTABLE=C:\\Users\\girir\\AppData\\Local\\Programs\\Python\\Python37\\python.exe', '-DENABLE_PIC=FALSE', '-DCMAKE_BUILD_TYPE=Release', "-DCMAKE_TOOLCHAIN_FILE='D:\\business\\Drapezy\\codetrials\\opencvjs\\emsdk\\upstream\\emscripten\\cmake\\Modules\\Platform\\Emscripten.cmake'", "-DCPU_BASELINE=''", "-DCPU_DISPATCH=''", '-DCV_TRACE=OFF', '-DBUILD_SHARED_LIBS=OFF', '-DWITH_1394=OFF', '-DWITH_ADE=OFF', '-DWITH_VTK=OFF', '-DWITH_EIGEN=OFF', '-DWITH_FFMPEG=OFF', '-DWITH_GSTREAMER=OFF', '-DWITH_GTK=OFF', '-DWITH_GTK_2_X=OFF', '-DWITH_IPP=OFF', '-DWITH_JASPER=OFF', '-DWITH_JPEG=OFF', '-DWITH_WEBP=OFF', '-DWITH_OPENEXR=OFF', '-DWITH_OPENGL=OFF', '-DWITH_OPENVX=OFF', '-DWITH_OPENNI=OFF', '-DWITH_OPENNI2=OFF', '-DWITH_PNG=OFF', '-DWITH_TBB=OFF', '-DWITH_TIFF=OFF', '-DWITH_V4L=OFF', '-DWITH_OPENCL=OFF', '-DWITH_OPENCL_SVM=OFF', '-DWITH_OPENCLAMDFFT=OFF', '-DWITH_OPENCLAMDBLAS=OFF', '-DWITH_GPHOTO2=OFF', '-DWITH_LAPACK=OFF', '-DWITH_ITT=OFF', '-DWITH_QUIRC=ON', '-DBUILD_ZLIB=ON', '-DBUILD_opencv_apps=OFF', '-DBUILD_opencv_calib3d=ON', '-DBUILD_opencv_dnn=ON', '-DBUILD_opencv_features2d=ON', '-DBUILD_opencv_flann=ON', '-DBUILD_opencv_gapi=OFF', '-DBUILD_opencv_ml=OFF', '-DBUILD_opencv_photo=ON', '-DBUILD_opencv_imgcodecs=OFF', '-DBUILD_opencv_shape_transformer=ON', '-DBUILD_opencv_videoio=OFF', '-DBUILD_opencv_videostab=OFF', '-DBUILD_opencv_highgui=OFF', '-DBUILD_opencv_superres=OFF', '-DBUILD_opencv_stitching=OFF', '-DBUILD_opencv_java=OFF', '-DBUILD_opencv_js=ON', '-DBUILD_opencv_python2=OFF', '-DBUILD_opencv_python3=OFF', '-DBUILD_EXAMPLES=OFF', '-DBUILD_PACKAGE=OFF', '-DBUILD_TESTS=OFF', '-DBUILD_PERF_TESTS=OFF', '-DBUILD_DOCS=OFF', '-DWITH_PTHREADS_PF=OFF', '-DCV_ENABLE_INTRINSICS=OFF', '-DBUILD_WASM_INTRIN_TESTS=OFF', "-DCMAKE_C_FLAGS='-s USE_PTHREADS=0 '", "-DCMAKE_CXX_FLAGS='-s USE_PTHREADS=0 '", 'D:\\business\\Drapezy\\codetrials\\opencvjs\\opencv']
Re-run cmake no build system arguments
-- Detected processor: x86
-- Looking for ccache - not found
CMake Error at cmake/OpenCVCompilerOptimizations.cmake:593 (message):
Compiler doesn't support baseline optimization flags:
Call Stack (most recent call first):
cmake/OpenCVCompilerOptions.cmake:311 (ocv_compiler_optimization_options)
CMakeLists.txt:617 (include)
-- Configuring incomplete, errors occurred!
Traceback (most recent call last):
File "./opencv/platforms/js/build_js.py", line 279, in <module>
File "./opencv/platforms/js/build_js.py", line 192, in config
File "./opencv/platforms/js/build_js.py", line 23, in execute
__main__.Fail: Child returned: 1
[1]: https://docs.opencv.org/master/d4/da1/tutorial_js_setup.html
[2]: https://docs.opencv.org/master/opencv.js
[3]: https://emscripten.org/docs/getting_started/downloads.html
Any ideas to resolve this issue is appreciated.

Building opencv.js on Windows will NOT work, at least according to this open issue. An alternative is to install WSL and use it to build.

Related

Cmake.. command is not working for Dartsim on Ubuntu

I installed Dartsim C++ for my Ubuntu. When I enter command cmake .. to the terminal, this errors occur. What can be the possible solution?
CMake Warning at cmake/DARTFindfmt.cmake:9 (find_package):
By not providing "Findfmt.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "fmt", but
CMake did not find one.
Could not find a package configuration file provided by "fmt" with any of
the following names:
fmtConfig.cmake
fmt-config.cmake
Add the installation prefix of "fmt" to CMAKE_PREFIX_PATH or set "fmt_DIR"
to a directory containing one of the above files. If "fmt" provides a
separate development package or SDK, be sure it has been installed.
Call Stack (most recent call first):
cmake/DARTMacros.cmake:81 (include)
cmake/DARTFindDependencies.cmake:13 (dart_find_package)
CMakeLists.txt:186 (include)
CMake Warning at cmake/DARTMacros.cmake:145 (message):
Looking for doxygen - NOT found, to use generating API documentation,
please install doxygen
Call Stack (most recent call first):
cmake/DARTFindDependencies.cmake:127 (dart_check_optional_package)
CMakeLists.txt:186 (include)
CMake Warning at cmake/DARTMacros.cmake:145 (message):
Looking for pagmo - NOT found, to use dart-optimizer-pagmo, please install
pagmo
Call Stack (most recent call first):
dart/optimizer/pagmo/CMakeLists.txt:3 (dart_check_optional_package)
CMake Warning at cmake/DARTMacros.cmake:145 (message):
Looking for flann - NOT found, to use dart-planning, please install flann
Call Stack (most recent call first):
dart/planning/CMakeLists.txt:3 (dart_check_optional_package)
Checking for module 'glut'
No package 'glut' found
Adding 12 components including the default component 'dart'
CMake Error at dart/CMakeLists.txt:141 (message):
Failed to find fmt targets
I installed Dartsim C++ for my Ubuntu. When I enter command 'cmake ..' to the terminal, this errors occur. What can be the possible solution?

Dartium fails to build on windows

I am trying to build a version of Dartium on windows, but I keep running into a problem.
I am trying to build a Dartium with the proprietary codecs, so I can play AAC codec in an MP4 file, which normal Dartium can't play.
[22/22259] CXX obj\dart\runtime\vm\libdart_vm.thread.obj
FAILED: obj/dart/runtime/vm/libdart_vm.thread.obj
ninja -t msvc -e environment.x86 -- "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64_x86\cl.exe" /nologo /showIncludes /FC #obj\dart\runtime\vm\libdart_vm.thread.obj.rsp /c ..\..\dart\runtime\vm\thread.cc /Foobj\dart\runtime\vm\libdart_vm.thread.obj /Fdobj\dart\runtime\libdart_vm.cc.pdb
c:\dart\dartium\src\dart\runtime\vm\thread.cc(459) : error C2220: warning treated as error - no 'object' file generated
c:\dart\dartium\src\dart\runtime\vm\thread.cc(459) : warning C4172: returning address of local variable or temporary: func
[25/22259] CC obj\third_party\opus\src\silk\opus.resampler_rom.obj
ninja: build stopped: subcommand failed.
Traceback (most recent call last):
File "C:\dart\dartium\src\dart\tools\dartium\build.py", line 58, in <module>
main()
File "C:\dart\dartium\src\dart\tools\dartium\build.py", line 55, in main
+ targets)
File "C:\dart\dartium\src\dart\tools\dartium\utils.py", line 112, in runCommand
raise Exception('Failed to run command. return code=%s' % p.returncode)
Exception: Failed to run command. return code=1
I am building this on a windows 2016 Datacenter (VM), I have installed Dart 32bit, Visual Studio 2015, with windows SDK, and followed the instructions on: https://github.com/dart-lang/sdk/wiki/Building-Dartium
If you add
#pragma warning disable C4172
at the top of the thread.cc, that should fix the compilation.

Cmake error on ubuntu14.04

I am trying to build a project from git.Getting following error:
CMake Warning at cmake/OpenCVDetectCXXCompiler.cmake:95 (message):
GCC version not detected!
Call Stack (most recent call first):
CMakeLists.txt:116 (include)
-- Detected version of GNU GCC: 00 (0)
-- Check if the system is big endian
-- Searching 16 bit integer
CMake Error at /usr/share/cmake-3.2/Modules/TestBigEndian.cmake:51 (message):
no suitable type found
Call Stack (most recent call first):
CMakeLists.txt:529 (test_big_endian)
-- Configuring incomplete, errors occurred!
Not able to understand the error. Any help appreciated
In the project 3. Build Android OpenCV SDK with extra modules for Android when I am trying to sh ./scripts/cmake_android_arm.sh I am getting the above error.
I was getting the same error: TestBigEndian: no suitable type found.
However, deleting the CMakeCache.txt file under build_android_arm directory resolved this issue.

Build framework IOS OpenCV 3.1.0.2 failed on MAC (OS X El Capitan)

I would like to use OpenCV 3.1.0.2 (the latest one) with Xcode 7.2.1.
I downloaded the OpenCv then as I did with OpenCV 2.4.11 before, I used the following command to generate the opencv2.framework:
python opencv-3.1.0\ 2/platforms/ios/build_framework.py ios
But after a while, my build failed. Here the error:
** BUILD FAILED **
The following build commands failed:
CompileC /Users/nameUser/openCV/ios/build/arm64-iPhoneOS/3rdparty/zlib/OpenCV.build/Release-iphoneos/zlib.build/Objects-normal/arm64/gzlib.o 3rdparty/zlib/gzlib.c normal arm64 c com.apple.compilers.llvm.clang.1_0.compiler
CompileC /Users/nameUser/openCV/ios/build/arm64-iPhoneOS/3rdparty/zlib/OpenCV.build/Release-iphoneos/zlib.build/Objects-normal/arm64/gzread.o 3rdparty/zlib/gzread.c normal arm64 c com.apple.compilers.llvm.clang.1_0.compiler
(2 failures)
============================================================
ERROR: Command '['xcodebuild', 'IPHONEOS_DEPLOYMENT_TARGET=6.0', 'ARCHS=arm64', '-sdk', 'iphoneos', '-configuration', 'Release', '-parallelizeTargets', '-jobs', '4', '-target', 'ALL_BUILD', 'build']' returned non-zero exit status 65
============================================================
Traceback (most recent call last):
File "build_framework.py", line 87, in build
self._build(outdir)
File "build_framework.py", line 81, in _build
self.buildOne(t[0], t[1], mainBD, cmake_flags)
File "build_framework.py", line 139, in buildOne
execute(buildcmd + ["-target", "ALL_BUILD", "build"], cwd = builddir)
File "build_framework.py", line 34, in execute
retcode = check_call(cmd, cwd = cwd)
File "/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 540, in check_call
raise CalledProcessError(retcode, cmd)
CalledProcessError: Command '['xcodebuild', 'IPHONEOS_DEPLOYMENT_TARGET=6.0', 'ARCHS=arm64', '-sdk', 'iphoneos', '-configuration', 'Release', '-parallelizeTargets', '-jobs', '4', '-target', 'ALL_BUILD', 'build']' returned non-zero exit status 65
Before posting here, I searched on the internet but I couldn't find any solution for this problem. I don't even know what does this error means.
Can anyone help me please ?
Thank
It's not exactly same with my case but you can try two ways:
Did you install cmake?
If not, install that.
Did you check your python version?
Because Python 3 and 2 are much
different, you should check that.
In my case, 2.x is working. If you installed 2.x and 3.x both, the command "python" means 3. so you should use "python2.x" command.
I'm not sure you can understand what I'm writing(bc my english skill is not good..) but I hope It helps you to solve the problem!

Running html5 app template in ubuntu sdk failed?

My configuration :
Ubuntu 14.04 LTS
64bit
Qtcreator 3.1.1
everything is up-to-date
Hello everyone,
I'm trying to just compile and run an HTML5 App for ubuntu Phone, but after trying and searching for a week now, I still can't make it run !
For the moment I just want to run the simple html5 app template.
This is the situation :
I have installed ubuntu sdk as instructed in https://developer.ubuntu.com/en/start/ubuntu-sdk/installing-the-sdk/
I've created in the run click menu, an i386 build target. (15.04) --- which exited with no errors
I created an i386 emulator in devices --> i386 - devel - default password --- which is finally up and running correctly
The problem is when I compile the default template : theses are the errors I get :
desktop_Exec(app): found unexpected Exec with architecture 'all':./qtc_device_debughelper.py
security_policy_groups_safe_app(debug):(REJECT)reserved policy group 'debug':not for production use
security_policy_version_matches_framework(app.apparmor):invalid framework 'ubuntu-core-15.04'
And when I try to edit it anyway :
This is what I get :
Traceback (most recent call last):
File "/tmp/qtc_device_applaunch.py", line 29, in <module>
gi.Repository.get_default().require("UbuntuAppLaunch")
gi.RepositoryError: Typelib file for namespace 'UbuntuAppLaunch' (any version) not found
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<frozen importlib._bootstrap>", line 2158, in _find_spec
AttributeError: 'DynamicImporter' object has no attribute 'find_spec'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/tmp/qtc_device_applaunch.py", line 33, in <module>
from gi.repository import UpstartAppLaunch as UAL
File "/usr/lib/python3/dist-packages/gi/importer.py", line 53, in find_module
'introspection typelib not found' % namespace)
ImportError: cannot import name UpstartAppLaunch, introspection typelib not found
I have been looking for this everywhere but I couldn't find something that works.
I need some of your knowledge to help me understand all this!
I have the same errors. I think that the 'ubuntu-core-15.04'-error is related to the version of Ubuntu you are using. I use Mint 17, which is based on Ubuntu 14.04. Canonical recommends the newer Ubuntu Versions for app-developing, because there is some stuff in it they changed.
unfortunately, I can't help you with the other errors.

Resources