Build OpenCV for iOS fail - python

I downloaded OpenCV folder from GitHub and followed the ReadMe instruction to build it for ios.
After use python opencv/platforms/ios/build_framework.py ios command I have the following error:
Executing: ['cmake', '-GXcode', '-DAPPLE_FRAMEWORK=ON', '-DCMAKE_INSTALL_PREFIX=install', '-DCMAKE_BUILD_TYPE=Release', '-DIOS_ARCH=armv7', '-DCMAKE_TOOLCHAIN_FILE=/Users/name/Downloads/opencv/platforms/ios/cmake/Toolchains/Toolchain-iPhoneOS_Xcode.cmake', '-DENABLE_NEON=ON', '/Users/name/Downloads/opencv', '-DCMAKE_C_FLAGS=-fembed-bitcode', '-DCMAKE_CXX_FLAGS=-fembed-bitcode'] in /Users/name/Downloads/ios/build/build-armv7-iphoneos
============================================================
ERROR: [Errno 2] No such file or directory
============================================================
Traceback (most recent call last):
File "opencv/platforms/ios/build_framework.py", line 112, in build
self._build(outdir)
File "opencv/platforms/ios/build_framework.py", line 104, in _build
self.buildOne(t[0], t[1], mainBD, cmake_flags)
File "opencv/platforms/ios/build_framework.py", line 186, in buildOne
execute(cmakecmd, cwd = builddir)
File "opencv/platforms/ios/build_framework.py", line 36, in execute
retcode = check_call(cmd, cwd = cwd)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 535, in check_call
retcode = call(*popenargs, **kwargs)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 522, in call
return Popen(*popenargs, **kwargs).wait()
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 710, in __init__
errread, errwrite)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1335, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory
What I have to do to fix it?

If someone in the future will have the same problem.
This problem was in the master branch, downloading branch 2.4 and adding CMake at PATH the build process go well

I also encountered the same problem.
In the master branch or 3.4 branch or 2.4 branch.
But after installing cmake, it will be fine.
In the 2.4 branch error message will show :
/bin/sh: cmake: command not found

Related

install v8js extension to php

I'm trying to install v8js on a local http/ssh server built with Debian 9.3, so I need to install v8 chromium engine first according to this documentation.
But when I'm trying to run the command line tools/dev/v8gen.py -vv x64.release -- is_component_build=true the command sends me this:
################################################################################
/usr/bin/python -u tools/mb/mb.py gen -f infra/mb/mb_config.pyl -m developer_default -b x64.release out.gn/x64.release
Writing """\
is_debug = false
target_cpu = "x64"
""" to /home/dev/v8/out.gn/x64.release/args.gn.
/home/dev/v8/buildtools/linux64/gn gen out.gn/x64.release --check
Traceback (most recent call last):
File "tools/mb/mb.py", line 67, in Main
ret = self.args.func()
File "tools/mb/mb.py", line 317, in CmdGen
return self.RunGNGen(vals)
File "tools/mb/mb.py", line 856, in RunGNGen
ret, _, _ = self.Run(cmd)
File "tools/mb/mb.py", line 1378, in Run
ret, out, err = self.Call(cmd, env=env, buffer_output=buffer_output)
File "tools/mb/mb.py", line 1392, in Call
env=env)
File "/usr/lib/python2.7/subprocess.py", line 390, in __init__
errread, errwrite)
File "/usr/lib/python2.7/subprocess.py", line 1024, in _execute_child
raise child_exception
OSError: [Errno 8] Exec format error
Traceback (most recent call last):
File "tools/dev/v8gen.py", line 304, in <module>
sys.exit(gen.main())
File "tools/dev/v8gen.py", line 298, in main
return self._options.func()
File "tools/dev/v8gen.py", line 166, in cmd_gen
gn_outdir,
File "tools/dev/v8gen.py", line 208, in _call_cmd
stderr=subprocess.STDOUT,
File "/usr/lib/python2.7/subprocess.py", line 219, in check_output
raise CalledProcessError(retcode, cmd, output=output)
subprocess.CalledProcessError: Command '['/usr/bin/python', '-u', 'tools/mb/mb.py', 'gen', '-f', 'infra/mb/mb_config.pyl', '-m', 'developer_default', '-b', 'x64.release', 'out.gn/x64.release']' returned non-zero exit status 1
Obviously I can not continue the following installation steps (I can't use ninja) and I do not really know about Python so a help would be really convenient :)
PS: I saw (I don't remember where) that there is probably minimum RAM (8GB) and Disk space (100GB) requirements to build v8, is that it ...?

Cannot install crawler for ABP

I'm getting errors when trying to install abpcrawler (Repository below).
https://github.com/adblockplus/abpcrawler
When running the command
./run.py -b /usr/bin/firefox urls.txt outputdir
I am receiving the following error:
bash-3.2# ./run.py -b /usr/bin/firefox urls.txt outputdir
Communicating with client on port 29922
['/usr/bin/firefox', '--crawler-port', '29922', '-foreground', '-profile', '/tmp/tmpgZYg1r.mozrunner']
Traceback (most recent call last):
File "./run.py", line 195, in <module>
run()
File "./run.py", line 178, in run
runner.start()
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/mozrunner/base/browser.py", line 67, in start
BaseRunner.start(self, *args, **kwargs)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/mozrunner/base/runner.py", line 102, in start
self.process_handler.run(self.timeout, self.output_timeout)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/mozprocess/processhandler.py", line 700, in run
self.proc = self.Process([self.cmd] + self.args, **args)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/mozprocess/processhandler.py", line 103, in __init__
universal_newlines, startupinfo, creationflags)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 710, in __init__
errread, errwrite)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1327, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory
Am I missing something? I have Mercurial installed and am able to clone the build tools repo.
Judging from the error message, /usr/bin/firefox couldn't be started because:
OSError: [Errno 2] No such file or directory
ABP Crawler requires Firefox to be installed, it will automate Firefox in order to collect data. If Firefox is actually installed, maybe the path is /usr/local/bin/firefox or something similar. You can run which firefox from the command line if you aren't sure.

How do I install kbuild?

How do I run/install this: https://github.com/kevmoo/kbuild?
I installed the dependencies and tried to execute the bin/kbuild Python script, but it's giving me this error:
Traceback (most recent call last):
File "kbuild/bin/kbuild", line 12, in <module>
BREW_PREFIX = subprocess.check_output(['brew', '--prefix']).strip()
File "/usr/lib/python2.7/subprocess.py", line 537, in check_output
process = Popen(stdout=PIPE, *popenargs, **kwargs)
File "/usr/lib/python2.7/subprocess.py", line 679, in __init__
errread, errwrite)
File "/usr/lib/python2.7/subprocess.py", line 1259, in _execute_child
raise child_exception OSError: [Errno 2] No such file or directory
My guess is that this tool was intended for OSX and Homebrew and that's why it's choking. I just wasn't sure based on the minimalist installation instructions.
Line 12:
BREW_PREFIX = subprocess.check_output(['brew', '--prefix']).strip()
is explicitly trying to run 'brew' in the shell, so yes I'd say it is written only for OSX.
I'd suggest you wait for your Issue to be answered on GitHub, or try modifying it yourself. It seems brew is only being used to check for available compilers.

Setting up django-nonrel?

I'm trying to set up django-nonrel into a new virtualenv, but am getting an error saying: OSError: [Errno 2] No such file or directory.
I can't tell from the error log exactly which file or directory is missing. Please could anyone suggest what might be going wrong?
The bitbucket file seems to be present:
(nonrel)delirium:nonrel anna$ pip install hg+https://bitbucket.org/wkornewald/django-nonrel
Downloading/unpacking hg+https://bitbucket.org/wkornewald/django-nonrel
Cloning hg https://bitbucket.org/wkornewald/django-nonrel to /var/folders/q5/_0_8qh59147_0vmr8tm1_mq80000gn/T/pip-3Trv56-build
Error [Errno 2] No such file or directory while executing command /usr/local/bin/hg clone --noupdate -q https://bitbucket.org/wkornewald/django-nonrel /var/folders/q5/_0_8qh59147_0vmr8tm1_mq80000gn/T/pip-3Trv56-build
Exception:
Traceback (most recent call last):
File "/Users/anna/Dropbox/nonrel/lib/python2.7/site-packages/pip-1.1-py2.7.egg/pip/basecommand.py", line 104, in main
status = self.run(options, args)
File "/Users/anna/Dropbox/nonrel/lib/python2.7/site-packages/pip-1.1-py2.7.egg/pip/commands/install.py", line 245, in run
requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)
File "/Users/anna/Dropbox/nonrel/lib/python2.7/site-packages/pip-1.1-py2.7.egg/pip/req.py", line 985, in prepare_files
self.unpack_url(url, location, self.is_download)
File "/Users/anna/Dropbox/nonrel/lib/python2.7/site-packages/pip-1.1-py2.7.egg/pip/req.py", line 1103, in unpack_url
return unpack_vcs_link(link, loc, only_download)
File "/Users/anna/Dropbox/nonrel/lib/python2.7/site-packages/pip-1.1-py2.7.egg/pip/download.py", line 294, in unpack_vcs_link
vcs_backend.unpack(location)
File "/Users/anna/Dropbox/nonrel/lib/python2.7/site-packages/pip-1.1-py2.7.egg/pip/vcs/__init__.py", line 233, in unpack
self.obtain(location)
File "/Users/anna/Dropbox/nonrel/lib/python2.7/site-packages/pip-1.1-py2.7.egg/pip/vcs/mercurial.py", line 81, in obtain
call_subprocess([self.cmd, 'clone', '--noupdate', '-q', url, dest])
File "/Users/anna/Dropbox/nonrel/lib/python2.7/site-packages/pip-1.1-py2.7.egg/pip/__init__.py", line 221, in call_subprocess
cwd=cwd, env=env)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 672, in __init__
errread, errwrite)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1202, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory
Storing complete log in /Users/anna/.pip/pip.log
What is going wrong?
I'd recommend getting the latest version from github
https://github.com/django-nonrel/django-nonrel
You'd wanna use git to download it rather than pip.

Error message when I try adblocker build

I am trying to build adblockplus from this link. When I issue the command:
python build.py build
I end up getting the following error message. I tried with and without sudo to no avail.
Traceback (most recent call last):
File "build.py", line 10, in <module>
buildtools.build.processArgs('.', sys.argv)
File "/home/machine/projects/weird/buildtools/build.py", line 352, in processArgs
commands[command](baseDir, scriptName, opts, args, type)
File "/home/machine/projects/weird/buildtools/build.py", line 39, in __call__
return self._handler(baseDir, scriptName, opts, args, type)
File "/home/machine/projects/weird/buildtools/build.py", line 166, in runBuild
limitMetadata=limitMetadata)
File "/home/machine/projects/weird/buildtools/packager.py", line 274, in createBuild
buildNum = getBuildNum(baseDir)
File "/home/machine/projects/weird/buildtools/packager.py", line 80, in getBuildNum
(result, dummy) = subprocess.Popen(['hg', 'id', '-n'], stdout=subprocess.PIPE).communicate()
File "/usr/lib/python2.6/subprocess.py", line 623, in __init__
errread, errwrite)
File "/usr/lib/python2.6/subprocess.py", line 1141, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory
Am I missing a package? Any hint on what the problem could be will be much appreciated.
The stack trace makes it clear that the issue is caused by the following line:
(result, dummy) = subprocess.Popen(['hg', 'id', '-n'], stdout=subprocess.PIPE).communicate()
If you look at the subprocess package documentation, this line is trying to run the hg id -n command (get numerical Mercurial revision). Apparently, the Mercurial command line tool isn't present on your system (a possibility that this build script didn't consider) so it fails.
Disclaimer: I happen to be the one who wrote this script and I fixed this bug now. Mercurial isn't essential for the build, the revision number is pretty much only necessary to determine the output file name.

Categories

Resources