I am trying to build OpenCV to include OpenCV contrib modules which is in a repository. I am following the instructions in this link, but i could not understand the cmd commands which is i mentioned in the section titled "cmd commands" as follows.
cmd commands:
$ cd <opencv_build_directory>
$ cmake -DOPENCV_EXTRA_MODULES_PATH=<opencv_contrib>/modules
<opencv_source_directory>
$ make -j5
here are my attempts to get the cmd commands as mentioned above running:
1-concerning the opencv_build_directory: i just created it by myself and named it 'build' as shown in the image in the section titled "OpenCV3.0.0 source"
2-concerning the opencv_source_directory: i think it should be "OpenCV-android-sdk" as shown in the image section titled "OpenCV3.0.0 source"
3- for the cmd command '$ cd ' i set it as follows:
c:\xxxx\libs\OpenCV-3.0.0-android-sdk-1\OpenCV-android-sdk\build>
4- for the cmd command '$ cmake -DOPENCV_EXTRA_MODULES_PATH=/modules' iset it as follows:
cmake -DOPENCV_EXTRA_MODULES_PATH=opencv_contrib-master/modules OpenCV-
android-sdk
the entire command i type in the cmd is:
c:\xxxx\libs\OpenCV-3.0.0-android-sdk-1\OpenCV-android-
sdk\build>cmake -DOPENCV_EXTRA_MODULES_PATH=opencv_contrib-
master/modules OpenCV-android-sdk
but after running it, i get:
CMake Error: The source directory "C:/xxxx/libs/OpenCV-3.0.0-
android-sdk-1/OpenCV-android-sdk/build/OpenCV-android-sdk" does not
exist.
Specify --help for usage, or press the help button on the CMake GUI.
please help me to build the path correctly as stated in the linke mentioned
note:
I am trying to install opencv contrib modules on android through android Studio
OpenCV3.0.0 source
OpenCV-contrib source:
Related
In AOSP, I often use the following to setup my environment and build target and build the entire image:
$ cd ~/aosp
$ source build/envsetup.sh
$ lunch sdk_phone_x86_64
$ m
I also like to use the following to build a specific package/module instead of the entire image:
$ m <my package>
or
$ cd <path_to_package>
$ mm
Is there a way to simply list all possible packages/modules in all of AOSP? Similar to how running lunch displays all possible targets, I'm interested in seeing a list of all possible packages/modules (e.g. defined in Android.bp and Android.mk).
Follow up question: given a package/module name, is there a way to get the directory or path to the file that defines it?
build/make/envsetup.sh has define the shell function:
- allmod: List all modules.
- pathmod: Get the directory containing a module.
Please help me. I try to build PJSIP library in Windows for Android by using Cygwin terminal. I follow steps exactly, but when I write $ ./configre-android I get this error - >
$ ./configure-android
./configure-android: line 3: $'\r': command not found
./configure-android: line 5: $'\r': command not found
./configure-android: line 71: syntax error near unexpected token `$'do\r''
'/configure-android: line 71: ` for i in `$NDK_OUT`; do
I used this steps to build sources are
Download sources from PJSIP site. Pay attention if you will compile
on Windows machine download .zip file, if on Unix machine (including
OS X) then download .bz2 file.
Go to pjlib/include/pj/ from the downloaded sources. Create (or
overwrite) a file called config_site.h. Copy the following code
snippet
#define PJ_CONFIG_ANDROID 1
#include <pj/config_site_sample.h>
Open Cmd or Terminal
Go to pjsip root folder (the downloaded sources)
$ cd /path/to/your/pjsip/dir
Export bash var ANDROID_NDK_ROOT as a environment variable.
Variable value should be the path of android ndk directory.
$ export ANDROID_NDK_ROOT=/path_to_android_ndk_dir
Perform build for target armeabi
$ ./configure-android
If you need to perform build for target arm64-v8a do $
TARGET_ABI=armeabi-v8a ./configure-android --use-ndk-cflags
target armeabi-v7a do $
TARGET_ABI=armeabi-v7a ./configure-android --use-ndk-cflags
target x86 do $ TARGET_ABI=x86 ./configure-android --use-ndk-cflags
Compile sources
$ make dep && make clean && make
This fixed problem for me:
tr -d '\015' < configure-android > configure-android2
After this launch configure-android2, not configure-android
I am trying to import some third party module like pygoogle in my app when i run app in computer using kivy it works fine but when i make apk using buildozer it crashes every time then i find that i have to go in python-for-android and run this command to include module ./distribute.sh -m "pil ffmpeg kivy" but i still get error that
root#kali:~# cd ~/.buildozer/android/platform/python-for-android
root#kali:~/.buildozer/android/platform/python-for-android# ls
COPYING dist docs README.rst src
cythonizer.py distribute.sh LICENSE recipes tools
root#kali:~/.buildozer/android/platform/python-for-android# ./distribute.sh -m "pil ffmpeg kivy"
Check build dependencies for Kali
Avoid check build dependencies, unknow platform Kali
Check environment
No ANDROIDSDK environment set, abort
root#kali:~/.buildozer/android/platform/python-for-android#
I am using KAli Linux and please solve this someone ...it will be very helpfull to me
Try pasting the pygoogle folder in your app's directory, at the same level as main.py. Also, from the error, it looks like you need to set the ANDROIDSDK environment variable. See the docs.
I had a similar problem, and simply setting the ANDROIDSDK environment variable didn't sort it, but the following did.
Try the following and then run the ./distribute.sh -m "pil ffmpeg kivy" command from the same terminal(as the environment vars will only have been set for that terminal and any child processes), or alternatively, add these lines to your ~/.bashrc file for them to be permanent:
export ANDROIDSDK=/path/to/android-sdk
export ANDROIDNDK=/path/to/android-ndk
export ANDROIDNDKVER=rX
export ANDROIDAPI=X
# example
export ANDROIDSDK="/home/tito/code/android/android-sdk-linux_86"
export ANDROIDNDK="/home/tito/code/android/android-ndk-r7"
export ANDROIDNDKVER=r7
export ANDROIDAPI=14
Examples taken from here. I recommend having a look.
I am trying to build webrtc android demo application. I was following README applied by the project. First thing was mentioned about gclient but when i tried to run it "no external or internal command". Then i got this link according to the this link i cloned the depot_tool repository but when at the step when i try to run gclient i got this
So after hours of trying i am not able to run it. if any one has experience with this WebRTC library please provide some help. Any guidance? Any Hlep will be appreciated
I heard few things were changed from svn to GIT. We tried building webRTC to windows7 using visual studio. See if you can use any parts on this.
Get depot_tools software and extract to a location (set this path in environment variable).
cd to depot_tools directory and hit 'gclient' (this should take sometime)
Install python 2.7 and put it path.
create a folder of your choice for webRTC and open command prompt there.
Now hit, gclient config http://webrtc.googlecode.com/svn/trunk
then, gclient sync.
Then set GYP_GENERATORS=msvs environment variable (use ninja if you want that).
Also set msvs_version=2012 (depending on your visual studio version)
now run, gclient runhooks --force
This should generate solutions files for your folder. fireup the libjingle/webrtc.sln files and start building it. I'm not sure if it builds as is. But we had hicupps with that.
See this link on WebRTC native development if you haven't already. From my personal experience building this tricky job initially.
Also note that links might be deprecated as they moved to git, don't know if they are still maintaining it.
How to compile WEBRTC On ubuntu
download script and run:
https://cs.chromium.org/chromium/src/build/install-build-deps.sh
./build/install-build-deps.sh --no-chromeos-fonts
Now download depot tools
$ git clone --depth 1 https://chromium.googlesource.com/chromium/tools/depot_tools.git
Put it in Path
$ export PATH=`pwd`/depot_tools:"$PATH"
Define your settings:
export GYP_DEFINES="target_arch=x64 host_arch=x64 build_with_chromium=0 use_openssl=0 use_gtk=0 use_x11=0 include_examples=0 include_tests=1 fastbuild=1 remove_webcore_debug_symbols=1 include_pulse_audio=0 include_internal_video_render=0 clang=1 "
make file to download the source
mkdir webrtc-checkout
cd webrtc-checkout
I chose branch 50 you can change it
gclient config https://chromium.googlesource.com/external/webrtc.git#branch-heads/50 --name=src
gclient sync --force --with_branch_heads
gclient sync --force --with_branch_heads --nohooks
cd src
git checkout branch-heads/50
gclient runhooks
ninja -C ./out/Release
Collect your LIB & Include file to use it in your project
mkdir ../lib/
find ./ -name "*.o" -and -not -name do_not_use -and -not -name protoc -and -not -name genperf -exec ar crs ../lib/libwebrtc.a {} +
mkdir ../include
find ./ -name *.h -exec cp --parents '{}' ../include ';'
I am facing issues in building the android kernel. I tried the following steps from the following link ( http://source.android.com/source/building-kernels.html )
I donot have the AOSP. I am just trying to compile the kernel
Source: git clone https://android.googlesource.com/kernel/goldfish.git
I placed the tool chain in the following directory
/home/chid/goldfish/prebuilts/gcc/linux-x86/x86/i686-linux-android-4.6/bin
I set the path as follows
export PATH=$(pwd)/prebuilts/gcc/linux-x86/x86/i686-linux-android-4.6/bin:$PATH
pwd: /home/chid/goldfish
set the environment variables as follows.
export ARCH=x86
export SUBARCH=x86
export CROSS_COMPILE=i686-linux-android-
setup the config file as
make arch=x86 goldfish_defconfig
gave make as follows.
make -j6
But it tells me a "cannot find" error.
Error:
/home/chid/goldfish/scripts/gcc-version.sh: line 25: /home/chid/goldfish/prebuilts/gcc/linux-x86/x86/i686-linux-android-4.6/bin/i686-linux-android-gcc: No such file or directory
Can you tell me what I am missing? I ensured that the above mentioned file is present and the path is set correctly. Is there something else I need to take care of?
You got the toolchain as the following?
$ git clone https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/x86/i686-linux-android-4.6
Have you tried to launch gcc directly?
$ /home/chid/goldfish/prebuilts/gcc/linux-x86/x86/i686-linux-android-4.6/bin/i686-linux-android-gcc
How about ldd?
$ ldd /home/chid/goldfish/prebuilts/gcc/linux-x86/x86/i686-linux-android-4.6/bin/i686-linux-android-gcc
In vagrant precise32 Ubuntu image, no problems at all.
$ ldd i686-linux-android-4.6/bin/i686-linux-android-gcc
linux-gate.so.1 => (0xb77c7000)
libc.so.6 => /lib/i386-linux-gnu/libc.so.6 (0xb7619000)
/lib/ld-linux.so.2 (0xb77c8000)
$ i686-linux-android-4.6/bin/i686-linux-android-gcc
i686-linux-android-gcc: fatal error: no input files
compilation terminated.
$ sh goldfish/scripts/gcc-version.sh i686-linux-android-4.6/bin/i686-linux-android-gcc
0406
You might need to have another Linux environment to execute gcc.