Is there no pthread library in bionic libc? - pthreads

I'm using a toolchain to cross compile some library which is dependent on lpthread for android. It had bionic version of libc. It says lpthred cannot be found and there is no libpthread.so to be found in the toolchain. So is there no pthread library in bionic libc? If yes, hat do I need to do to resolve this dependency? If not, how can I get pthread source so that I can create a libpthread.so by cross compiling?

Bionic has the pthread functions in libc itself. There is no need to link a separate threads library.

Related

mingw : Giving reference to opencv libraries in simpler way

Successfully installed opencv 4.5.4 in windows under mingw evironment. I was able to compile opencv applications. But is there any easy way to give reference to libraries instead of typing long list of opencv libraries (i.e. something like pkg-config in windows)
For a simple opencv program I need to give reference to 4 libraries.
g++ rotate.cpp -lopencv_core454 -lopencv_highgui454 -lopencv_imgproc454 -lopencv_imgcodecs454
instead do we have some option to give list of libraries through some flags in windows environment.
Thanks
You can actually use pkg-config in Windows. If you use MSYS2 shell is is usually available or it can be installed via pacman.

Using GPU in OpenCV

If I want to use my computer's GPU with OpenCV, is it necessary that I build OpenCV from source with CUDA enabled? Or can I install OpenCV with CUDA support via apt-get? I noticed the following 2 packages in apt-get:
libopencv-gpu-dev - development files for libopencv-gpu2.4v5
libopencv-gpu2.4v5 - computer vision GPU library
But I am not sure if these will work with OpenCV3 or if they are only compatible with OpenCV2. I know that the gpu module in Opencv2 was split up into multiple CUDA modules in OpenCV3.
Yes it is necessary that you build opencv from the source with CUDA option enabled. The apt-get packages won't work with OpenCV3 and above versions. I suggest you install the CUDA Toolkit first and then attempt installation of OpenCV or the GPU functions won't work.

OpenCV Crosscompile for ARM: highgui error (GTK2+)

I'm have build the OpenCV library from source for Zynq (ARM). But, OpenCV was build on the same PC for x86 (PC) also. Firstly, I can execute every example on my PC without any issues. Secondly, I am able to crosscompile and execute every program on the arm target, except the ones including highgui libraries, where I receive the following error:
OpenCV Error: Unspecified error (The function is not implemented. Rebuild the library with Windows, GTK+ 2.x or Carbon support. If you are on Ubuntu or Debian, install libgtk2.0-dev and pkg-config, then re-run cmake or configure script) in cvShowImage, file /home/hristov/workspace/opencv/modules/highgui/src/window.cpp, line 534
terminate called after throwing an instance of 'cv::Exception'
what(): /home/user/workspace/opencv/modules/highgui/src/window.cpp:534: error: (-2) The function is not implemented. Rebuild the library with Windows, GTK+ 2.x or Carbon support. If you are on Ubuntu or Debian, install libgtk2.0-dev and pkg-config, then re-run cmake or configure script in function cvShowImage
Yes, I have gone through the forum for solutions for this issue but some answers were unclear and I would like some more detail into this. I have created the OpenCV build for ARM build WITH_GTK and GTK2. Also installed libgtk2.0-dev, pkg-config
However, From another topic on this forum, I learned that the problem lies in setting up the pkg-config: http://answers.opencv.org/question/57945/opencv-gui-with-gtk-2-solved/
Q) Based on the above solution, Do you set the path for PKG_CONFIG_PATH on your ARM platform (Zynq) or on the PC platform (Ubuntu PC)? Because, it is already set to the described path on the ARM platform whereas it is different on the PC Linux platform. More details of the current path is shown below:
PKG_CONFIG_PATH in PC(Ubuntu):
/usr/local/lib/x86_64-linux-gnu/pkgconfig:/usr/local/lib/pkgconfig:/usr/local/share/pkgconfig:/usr/lib/x86_64-linux-gnu/pkgconfig:/usr/lib/pkgconfig:/usr/share/pkgconfig
PKG_CONFIG_PATH in ARM (Embedded platform):
/usr/local/lib/arm-linux-gnueabihf/pkgconfig:/usr/local/lib/pkgconfig:/usr/local/share/pkgconfig:/usr/lib/arm-linux-gnueabihf/pkgconfig:/usr/lib/pkgconfig:/usr/share/pkgconfig
If the pkg-config must be changed on my PC, to the /usr/lib/arm-linux-gnueabihf/pkgconfig/ location, I cannot find any pkg-config in that location. Should I create a new one, by copying the folder from my target?
Q) Also, Should the GTK libraries also be installed in the Target Embedded system (ARM)?
Hope someone can help me with this solution as I have rebuild the libraries umpteen times with many different solutions, but to no avail. Thanks!

Linux Version of Z3: Dependency On Old libgmp.so.3

Z3's dependency on libgmp.so.3 is unresolved in the linux package, leaving the user to provide this library. However, this library is very old and is not readily available.
Does anyone know a method for getting around this issue? I am currently running x86_64 and cannot get around this missing dependency without a great deal of hassle.
Is it possible the linux packages could be fixed such they include the expected library in the distribution?
You can get GMP3 by executing sudo apt install libgmp3-dev.
I'm not a Linux expert, but this is the command I used to install GMP before I compiled Z3.
When I installed the virtual machine for running Linux 64, I think I didn't find a package for the more recent versions of GMP.
I will try again. If it doesn't work, I will download the most recent GMP tar ball and build it from scratch.
BTW, the Z3 for Linux 32 comes with two .so files. One of them has GMP statically linked.
The trick I used for building this .so file didn't work for the 64 bit version.
As I said, I'm not a Linux expert, any suggestions on how to build a better Z3 library for Linux x86_64 users are welcome.

Does OpenCV for Mac use the Accelerate framework?

The Accelerate framework is a Mac-specific framework that provides things like image convolutions and LAPACK, supposedly optimized to be as fast as possible on Macs. My question: Does OpenCV take advantage of this? Specifically, does the function "filter2D" use Accelerate?
It does not use the Accelerate framework, but it looks like it has been speeded up using the CUDA stuff in 2.2
The relevant files in OpenCV2.2 ...
/modules/gpu/include/opencv2/gpu/gpu.hpp
/modules/gpu/src/filtering.cpp
and
modules/imgproc/src/filter.cpp
for the non-gpu stuff
Not a mac expert but AFAIK openCV uses IPP (if installed) TBB (build option) and NVidia-CUDA (build option)
If you use the MacPorts version, you can specify the options
$ port variants opencv
opencv has the variants:
debug: Enable debug binaries
python26: Add Python 2.6 bindings
* conflicts with python27
python27: Add Python 2.7 bindings
* conflicts with python26
tbb: Use Intel TBB
universal: Build for multiple architectures
I have used
sudo port install py26-numpy
sudo port install opencv +python26 +tbb
with success. Concerning the Accelerate.framework specifically, this blog entry says "# Add Accelerate.framework which is used internally from OpenCV library.", but I have no clue as to know if it is the case here.

Resources