My goal here is to have opencv embedded in macOS application as static framework. I clone the repo
cd opencv/platforms/osx
python build_framework.py build
Then i get the following error
** BUILD FAILED **
The following build commands failed:
CompileC platforms/osx/build/build/build-x86_64-
macosx/modules/world/OpenCV.build/Release/opencv_world.build/Objects-normal/x86_64/opencv-
onnx.pb.o modules/dnn/misc/onnx/opencv-onnx.pb.cc normal x86_64 c++
com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)
============================================================
ERROR: Command '['xcodebuild', 'MACOSX_DEPLOYMENT_TARGET=10.12', 'ARCHS=x86_64', '-sdk',
'macosx', '-configuration', 'Release', '-parallelizeTargets', '-jobs', '16', '-target',
'ALL_BUILD', 'build']' returned non-zero exit status 65
============================================================
Traceback (most recent call last):
File "/Volumes/Dev/XCode-openCV/please/opencv/platforms/ios/build_framework.py", line 148,
in build
self._build(outdir)
File "/Volumes/Dev/XCode-openCV/please/opencv/platforms/ios/build_framework.py", line 122,
in _build
self.buildOne(target[0], target[1], main_build_dir, cmake_flags)
File "/Volumes/Dev/XCode-openCV/please/opencv/platforms/ios/build_framework.py", line 255,
in buildOne
execute(buildcmd + ["-target", "ALL_BUILD", "build"], cwd = builddir)
File "/Volumes/Dev/XCode-openCV/please/opencv/platforms/ios/build_framework.py", line 44, in
execute
retcode = check_call(cmd, cwd = cwd)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py",
line 190, in check_call
raise CalledProcessError(retcode, cmd)
CalledProcessError: Command '['xcodebuild', 'MACOSX_DEPLOYMENT_TARGET=10.12',
'ARCHS=x86_64', '-sdk', 'macosx', '-configuration', 'Release', '-parallelizeTargets', '-
jobs', '16', '-target', 'ALL_BUILD', 'build']' returned non-zero exit status 65
I give up on this after couple hours. And maybe try to find another route. I find these two videos showing how to build the library with the cmake app, which builds and installs opencv at /usr/local/bin. He then opens XCode and points to these files, but he is making a macOS c++ command line app. Is there a way to use this c++ app in a swift app as a library or submodule?
Related
I am running Ubuntu 16.04 with Xilinx Petalinux 2018.03 SDK. After a number of successful compilations I am now facing this error
$ petalinux-build
[INFO] building project
[INFO] sourcing bitbake
ERROR: Failed to source bitbake
ERROR: Failed to build project
How can I solved this issue?
Another reason to get the errors "ERROR: Failed to source bitbake" as well as "ERROR: Failed to build project" is a possible upgrade of Python on the build machine. The Petalinux SDK requires python v2 (>= 2.7.3) for the 2018.3 edition.
You can check under [YOUR_PROJECT]/build/build.log and you might see a log similar to this one below:
[INFO] building project
[INFO] sourcing bitbake
SDK environment now set up; additionally you may now run devtool to perform development tasks.
Run devtool --help for further details.
OpenEmbedded requires 'python' to be python v2 (>= 2.7.3), not python v3.
Please set up python v2 as your default 'python' interpreter.
ERROR: Failed to source bitbake
ERROR: Failed to build project
To remedy this issue remove the symbolic link under /usr/bin and make sure to create a new one that is pointing to Python 2.7:
sudo rm /usr/bin/python
sudo ln -s /usr/bin/python2.7 /usr/bin/python
First you need to investigate the error a little further, do this:
source /opt/pkg/petalinux/2018.3/settings.sh
It will return something similar to this below:
PetaLinux environment set to '/opt/pkg/petalinux/2018.3'
INFO: Checking free disk space
INFO: Checking installed tools
INFO: Checking installed development libraries
INFO: Checking network and other services
Source the environment setup:
source /opt/pkg/petalinux/2018.3/components/yocto/source/aarch64/environment-setup-aarch64-xilinx-linux
followed by:
devtool --help
In my case I can see more about the actual error:
NOTE: Starting bitbake server...
ERROR: Unable to start bitbake server
ERROR: Last 10 lines of server log for this session (/opt/pkg/petalinux/2018.3/components/yocto/source/aarch64/bitbake-cookerdaemon.log):
Traceback (most recent call last):
File "/opt/pkg/petalinux/2018.3/components/yocto/source/aarch64/layers/core/bitbake/lib/bb/daemonize.py", line 77, in createDaemon
function()
File "/opt/pkg/petalinux/2018.3/components/yocto/source/aarch64/layers/core/bitbake/lib/bb/server/process.py", line 433, in _startServer
self.cooker = bb.cooker.BBCooker(self.configuration, self.featureset)
File "/opt/pkg/petalinux/2018.3/components/yocto/source/aarch64/layers/core/bitbake/lib/bb/cooker.py", line 178, in __init__
self.configwatcher = pyinotify.WatchManager()
File "/opt/pkg/petalinux/2018.3/components/yocto/source/aarch64/layers/core/bitbake/lib/pyinotify.py", line 1764, in __init__
raise OSError(err % self._inotify_wrapper.str_errno())
OSError: Cannot initialize new instance of inotify, Errno=Too many open files (EMFILE)
ERROR: Unable to start bitbake server
ERROR: Last 10 lines of server log for this session (/opt/pkg/petalinux/2018.3/components/yocto/source/aarch64/bitbake-cookerdaemon.log):
Traceback (most recent call last):
File "/opt/pkg/petalinux/2018.3/components/yocto/source/aarch64/layers/core/bitbake/lib/bb/daemonize.py", line 77, in createDaemon
function()
File "/opt/pkg/petalinux/2018.3/components/yocto/source/aarch64/layers/core/bitbake/lib/bb/server/process.py", line 433, in _startServer
self.cooker = bb.cooker.BBCooker(self.configuration, self.featureset)
File "/opt/pkg/petalinux/2018.3/components/yocto/source/aarch64/layers/core/bitbake/lib/bb/cooker.py", line 178, in __init__
self.configwatcher = pyinotify.WatchManager()
File "/opt/pkg/petalinux/2018.3/components/yocto/source/aarch64/layers/core/bitbake/lib/pyinotify.py", line 1764, in __init__
raise OSError(err % self._inotify_wrapper.str_errno())
OSError: Cannot initialize new instance of inotify, **Errno=Too many open files (EMFILE)**
This is pointing to the /proc/sys/fs/inotify/max_user_instances that need to be increased. In my case I went from 128 to 256 by doing this:
sudo su
echo 256 > /proc/sys/fs/inotify/max_user_instances
You need to become root with "su" and change the mac_user_instances.
I have downloaded a framework F2MD from git repository https://github.com/josephkamel/F2MD.git which integrates VEINS framework. I am using Sumo 1.5.0 and Omnet++ 5.6.1 on Ubuntu 18.04. This framework had some submodules. I am getting an error while building the one of the submodules veins-f2md by using the following command:
./configure && make -j$(nproc) MODE=release all**
This command gives an error message:
Creating Makefile in /home/rukhsar/F2MD-master/F2MD/veins-f2md/src...
/home/rukhsar/Downloads/omnetpp-5.6.1/bin/opp_makemake: error: too many subdirs for --deep
Traceback (most recent call last):
File "./configure", line 78, in <module>
subprocess.check_call(['env', 'opp_makemake'] + makemake_flags, cwd='src')
File "/usr/lib/python3.6/subprocess.py", line 311, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['env', 'opp_makemake', '-f', '--deep', '--no-deep-includes', '--make-so', '-I', '.', '-o', 'veins', '-O', 'out', '-p', 'VEINS']' returned non-zero exit status 1.
The following is a part of code written in opp_makemake file from where this error occurs:
# collect source files
if ($isDeep) {
my #allExcludedDirs = ();
push(#allExcludedDirs, $outDir);
push(#allExcludedDirs, #exceptSubdirs);
push(#allExcludedDirs, #submakeDirs);
#sourceDirs = collectDirs(".", \#allExcludedDirs);
error("too many subdirs for --deep") if (#sourceDirs > 1000);
} else {
#sourceDirs = ();
if (isGoodDir(".", \#exceptSubdirs)) {
#sourceDirs = (".");
}
}
I am unable to understand that which directories or files are for --deep. I have not used these frameworks and simulators before. Please give a solution so that I can fixed this issue and build the framework successfully.
At the time of building f2md, there should be a boost library in the "F2MD/veins-f2md/src" directory containing required header files. The error was occurring because of too many subdirectories and header files (more than 1000) in the downloaded boost library. So I deleted the unwanted header files and subdirectories from that library. After that, the framework was built correctly.
I'm making a simple apk using buildozer in kivy.
I tried re-installing two times android sdk ndk, but sdkmanager tools are not automatically installed.
# Apache ANT found at /home/shivam/.buildozer/android/platform/apache-ant-1.9.4
# Android SDK found at /home/shivam/.buildozer/android/platform/android-sdk
# Android NDK found at /home/shivam/.buildozer/android/platform/android-ndk-r17c
# Read available permissions from api-versions.xml
# Check application requirements
# Check garden requirements
# Compile platform
# Run '/usr/bin/python -m pythonforandroid.toolchain create --dist_name=firstapp --bootstrap=sdl2 --requirements=python3,kivy --arch armeabi-v7a --copy-libs --color=always --storage-dir="/home/shivam/.buildozer/android/platform/build" --ndk-api=21'
# Cwd /home/shivam/.buildozer/android/platform/python-for-android
[INFO]: Will compile for the following archs: armeabi-v7a
[INFO]: Found Android API target in $ANDROIDAPI: 27
Traceback (most recent call last):
File "/usr/lib/python2.7/runpy.py", line 174, in _run_module_as_main
"__main__", fname, loader, pkg_name)
File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
exec code in run_globals
File "/home/shivam/.buildozer/android/platform/python-for-android/pythonforandroid/toolchain.py", line 1073, in
main()
File "/home/shivam/.buildozer/android/platform/python-for-android/pythonforandroid/toolchain.py", line 1067, in main
ToolchainCL()
File "/home/shivam/.buildozer/android/platform/python-for-android/pythonforandroid/toolchain.py", line 576, in
__init__
getattr(self, args.subparser_name.replace('-', '_'))(args)
File "/home/shivam/.buildozer/android/platform/python-for-android/pythonforandroid/toolchain.py", line 144, in
wrapper_func
user_ndk_api=self.ndk_api)
File "pythonforandroid/build.py", line 236, in prepare_build_environment
avdmanager = sh.Command(join(sdk_dir, 'tools', 'bin', 'avdmanager'))
File "/home/shivam/.local/lib/python2.7/site-packages/sh.py", line 1202, in __init__
raise CommandNotFound(path)
sh.CommandNotFound: /home/shivam/.buildozer/android/platform/android-sdk/tools/bin/avdmanager
# Command failed: /usr/bin/python -m pythonforandroid.toolchain create --dist_name=firstapp --bootstrap=sdl2 –
requirements=python3,kivy --arch armeabi-v7a --copy-libs --color=always --storage-
dir="/home/shivam/.buildozer/android/platform/build" --ndk-api=21
#
# Buildozer failed to execute the last command
# The error might be hidden in the log above this error
# Please read the full log, and search for it before
# raising an issue with buildozer itself.
# In case of a bug report, please add a full log with log_level = 2
Just installed Yocto. On a morty branch. Executed the following commands:
cd poky
source oe-init-build-env build-qemuarm
In conf/local.conf changed the name of the machine to MACHINE ?= "qemuarm"
Then executed the following:
$ bitbake core-image-minimal
Loading cache: 100% |##########################################################################################################| Time: 0:00:00
Loaded 1320 entries from dependency cache.
ERROR: Execution of event handler 'sstate_eventhandler2' failed
Traceback (most recent call last):
File "/home/some-user/projects/melp/poky/meta/classes/sstate.bbclass", line 1015, in sstate_eventhandler2(e=<bb.event.ReachableStamps object at 0x7fbc17f2e0f0>):
for l in lines:
> (stamp, manifest, workdir) = l.split()
if stamp not in stamps:
ValueError: not enough values to unpack (expected 3, got 1)
ERROR: Command execution failed: Traceback (most recent call last):
File "/home/some-user/projects/melp/poky/bitbake/lib/bb/command.py", line 101, in runAsyncCommand
self.cooker.updateCache()
File "/home/some-user/projects/melp/poky/bitbake/lib/bb/cooker.py", line 1658, in updateCache
bb.event.fire(event, self.databuilder.mcdata[mc])
File "/home/some-user/projects/melp/poky/bitbake/lib/bb/event.py", line 201, in fire
fire_class_handlers(event, d)
File "/home/some-user/projects/melp/poky/bitbake/lib/bb/event.py", line 124, in fire_class_handlers
execute_handler(name, handler, event, d)
File "/home/some-user/projects/melp/poky/bitbake/lib/bb/event.py", line 96, in execute_handler
ret = handler(event)
File "/home/some-user/projects/melp/poky/meta/classes/sstate.bbclass", line 1015, in sstate_eventhandler2
(stamp, manifest, workdir) = l.split()
ValueError: not enough values to unpack (expected 3, got 1)
It looks like it is a python error. Does anyone know what is the issue? Am I using the wrong version?
Here is the output of python --version
$ python --version
Python 2.7.12
What am I doing wrong?
You realise that Morty is 18 months old and in a few weeks will be longer supported right?
Anyway, looks like the sstate-cache/ somehow is corrupted. Delete your tmp/ and sstate-cache/ directories and try again.
help solve the problem!
I have:
--Mac OS X 10.7.2
--Titanium Studio, build: 1.0.7.201112281340
--Xcode, ver 4.2.1, Build 4D502
--iPhone 5.0.1 iOs
--application I am trying to write
When I try to run the application on the iPhone Device I get the error.
Hier is Console Log
[TRACE] app property, ti.android.runtime : rhino
[DEBUG] Detecting modules in /Users/<USER>/Documents/Titanium Studio Workspace/sinoptic/modules
[DEBUG] Detecting modules in /Users/<USER>/Library/Application Support/Titanium/modules
[INFO] Performing clean build
[ERROR]
[ERROR] Error: Traceback (most recent call last):
File "/Users/<USER>/Library/Application Support/Titanium/mobilesdk/osx/1.8.0.1/iphone/builder.py", line 1418, in main
execute_xcode("iphoneos%s" % iphone_version,args,False)
File "/Users/<USER>/Library/Application Support/Titanium/mobilesdk/osx/1.8.0.1/iphone/builder.py", line 1180, in execute_xcode
output = run.run(args,False,False,o)
File "/Users/<USER>/Library/Application Support/Titanium/mobilesdk/osx/1.8.0.1/iphone/run.py", line 39, in run
sys.exit(rc)
SystemExit: 65
In /Users//Documents/Titanium Studio Workspace/sinoptic/build/iphone/build/build.log i have:
CodeSign build/Debug-iphoneos/ZeusLight.app
cd "/Users/<USER>/Documents/Titanium Studio Workspace/sinoptic/build/iphone"
setenv CODESIGN_ALLOCATE /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/codesign_allocate
setenv PATH "/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/usr/bin/codesign --force --sign "iPhone Developer: <CERTIFICATE HIER>" "--resource-rules=/Users/<USER>/Documents/Titanium Studio Workspace/sinoptic/build/iphone/build/Debug-iphoneos/ZeusLight.app/ResourceRules.plist" --entitlements "/Users/<USER>/Documents/Titanium Studio Workspace/sinoptic/build/iphone/build/ZeusLight.build/Debug-iphoneos/ZeusLight-universal.build/ZeusLight.xcent" "/Users/<USER>/Documents/Titanium Studio Workspace/sinoptic/build/iphone/build/Debug-iphoneos/ZeusLight.app"
/Users/<USER>/Documents/Titanium Studio Workspace/sinoptic/build/iphone/build/Debug-iphoneos/ZeusLight.app: object file format unrecognized, invalid, or unsuitable
Command /usr/bin/codesign failed with exit code 1
** BUILD FAILED **
The following build commands failed:
CodeSign build/Debug-iphoneos/ZeusLight.app
(1 failure)
EXIT CODE WAS: 65
Exception detected in script:
Traceback (most recent call last):
File "/Users/<USER>/Library/Application Support/Titanium/mobilesdk/osx/1.8.0.1/iphone/builder.py", line 1418, in main
execute_xcode("iphoneos%s" % iphone_version,args,False)
File "/Users/<USER>/Library/Application Support/Titanium/mobilesdk/osx/1.8.0.1/iphone/builder.py", line 1180, in execute_xcode
output = run.run(args,False,False,o)
File "/Users/<USER>/Library/Application Support/Titanium/mobilesdk/osx/1.8.0.1/iphone/run.py", line 39, in run
sys.exit(rc)
SystemExit: 65
Running on the emulator - there is no error, all is well.
The reason? This is driving me crazy!
Regards...
Try to delete the "build" folder inside your app source directory. Then again build for device.