OpenCV error file INSTALL cannot find /bin/opencv_annotation - opencv3.0

I have a problem on compiling OpenCV 3.X.X on Debian but It is OK on Ubuntu. I compile OpenCV with these commands:
cmake -D CMAKE_BUILD_TYPE=RELEASE \
-D CMAKE_INSTALL_PREFIX=/opt/opencv-3.3.0/build \
-D OPENCV_EXTRA_MODULES_PATH=/opt/opencv_contrib-3.3.0/modules \
-D BUILD_SHARED_LIBS=ON \
-D WITH_FFMPEG=ON \
-D PYTHON_EXECUTABLE=/opt/virtualenvs/cv/bin/python \
-D BUILD_EXAMPLES=ON \
-D WITH_QT=ON \
-D WITH_OPENGL=ON \
-D WITH_TBB=OFF \
-D WITH_OPENMP=ON \
-D BUILD_opencv_apps=ON \
-D BUILD_DOCS=ON ..
make -j12
sudo make install - j12
After "make install" I get this error and all shared library in build/lib that were built successfully before error, are deleted!
CMake Error at apps/annotation/cmake_install.cmake:42 (file):
file INSTALL cannot find "/opt/opencv-3.3.0/build/bin/opencv_annotation".
Call Stack (most recent call first):
apps/cmake_install.cmake:39 (include)
cmake_install.cmake:88 (include)
Makefile:66: recipe for target 'install' failed
make: *** [install] Error 1
If I set -D BUILD_opencv_apps=OFF, there is no error in compiling but again at the end all *.so files in build/lib are deleted.
Once in another computer I manage to compile OpenCV successfully but I don't know what exactly I had done.
My system has:
OpenCV 3.3.0
Debian GNU/Linux 8.9 (jessie) 3.16.43-2+deb8u5 (2017-09-19) x86_64 GNU/Linux
cmake version 3.0.2
gcc (Debian 4.9.2-10) 4.9.2
What's the problem?

I found the solution. This error happens when build directory is the same with install directory, At least on some Linux distributions!
I should change install directory.

Related

error compiling CPython with very unhelpful message

I'm trying to compile CPython, specifically tag 3.9.0
( git checkout tags/v3.9.0 -b v3.9.0)
I'm following the instructions from the book CPython Internals by Real Python.
When I tried to compile with:
CPPFLAGS="-I$(brew --prefix zlib)/include" \
LDFLAGS="-L$(brew --prefix zlib)/lib" \
./configure --with-openssl=$(brew --prefix openssl) \
--with-pydebug --enable-framework
I received the error: configure: error: internal configure error for the platform triplet; please file a bug report.
Here is a screenshot :
This is my system:
Any help will be appreciated it.

How do I use CMake on OS X, target the new Arm M1

I have some dependencies that use cmake I need to compile and I am not sure I am doing this correctly. I am currently using -march=x86-64 in my CFLAGS for amd64 which seems to work, but I'm not sure that's correct because it is not working when I try targeting the new M1. Is there something else I should be doing to target different architectures with cmake from the command line?
export CFLAGS="-O2 -march=aarch64 -fomit-frame-pointer -fno-stack-protector -pipe"
cmake -B ${{github.workspace}}/build \
-G "Unix Makefiles" \
-D CMAKE_INSTALL_PREFIX=${{github.workspace}}/dist/darwin/arm64 \
-D CMAKE_VERBOSE_MAKEFILE=ON \
-D BUILD_SHARED_LIBS=ON \
-D BUILD_DEMO=ON
cmake --build ${{github.workspace}}/build \
--parallel 2 \
--config RelWithDebInfo \
--clean-first
cmake --install ${{github.workspace}}/build --config RelWithDebInfo
Update: I am seeing this error.
CMake Error at /usr/local/Cellar/cmake/3.18.4/share/cmake/Modules/CMakeTestCCompiler.cmake:66 (message):
The C compiler
"/Applications/Xcode_12.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang"
is not able to compile a simple test program.
It fails with the following output:
-- Configuring incomplete, errors occurred!
See also "/Users/runner/work/project/project/build/CMakeFiles/CMakeOutput.log".
error: unknown target CPU 'aarch64'
note: valid target CPU values are: nocona, core2, penryn, bonnell, atom, silvermont, slm, goldmont, goldmont-plus, tremont, nehalem, corei7, westmere, sandybridge, corei7-avx, ivybridge, core-avx-i, haswell, core-avx2, broadwell, skylake, skylake-avx512, skx, cascadelake, cooperlake, cannonlake, icelake-client, icelake-server, tigerlake, knl, knm, k8, athlon64, athlon-fx, opteron, k8-sse3, athlon64-sse3, opteron-sse3, amdfam10, barcelona, btver1, btver2, bdver1, bdver2, bdver3, bdver4, znver1, znver2, x86-64
make[1]: *** [CMakeFiles/cmTC_72653.dir/testCCompiler.c.o] Error 1
make: *** [cmTC_72653/fast] Error 2
It was as simple as adding the CFLAG -target arm64-apple-macos10.5.

boost and btrfs-tools failed with Yocto build

I am trying to build a custom Linux image using the Poky 2.6(thud) with ROS meta layer(thud-draft) in it. The image is built for a x86-64 system . The contents of my bblayers.conf file are given below
# POKY_BBLAYERS_CONF_VERSION is increased each time build/conf/bblayers.conf
# changes incompatibly
POKY_BBLAYERS_CONF_VERSION = "2"
BBPATH = "${TOPDIR}"
BBFILES ?= ""
ROS_DISTRO = "melodic"
BBLAYERS ?= " \
/home/kogrob/devel/poky/meta \
/home/kogrob/devel/poky/meta-poky \
/home/kogrob/devel/poky/meta-yocto-bsp \
/home/kogrob/devel/poky/meta-openembedded/meta-oe \
/home/kogrob/devel/poky/meta-ros/meta-ros-common \
/home/kogrob/devel/poky/meta-ros/meta-ros1-melodic \
/home/kogrob/devel/poky/meta-openembedded/meta-python \
/home/kogrob/devel/poky/meta-ros/meta-ros-backports-warrior \
/home/kogrob/devel/poky/meta-ros/meta-ros1 \
"
The build failed with the following errors
Function failed: do_compile (log file is located at /home/kogrob/poky/build-toaster-2/tmp/work/core2-64-poky-linux/btrfs-tools/4.17.1-r0/temp/log.do_compile.26496)
Function failed: do_compile (log file is located at /home/kogrob/poky/build-toaster-2/tmp/work/core2-64-poky-linux/boost/1.68.0-r0/temp/log.do_compile.27908)
The boost build when it is build seperately using bitbake boost but the btrfs-tools fails everytime. What is the need of btrfs-tools and Is it possible to remove btrfs-tools and build an image without it.
The log files can be found here:
log.do_compile.26496
log.do_compile.27908
On my Unbuntu host (Ubuntu 16.04.6 LTS x86_64), try the command:
pip install setuptools
but it doens't work, because the do_compile() use yocto generated python binary, not the one Ubuntu builtin, something like this:
build/tmp/work/aarch64-sdrv-linux/btrfs-tools/4.17.1-r0/recipe-sysroot-native/usr/bin/python3-native/python3
.

Building Qt 5.6 on macOS for the Raspberry Pi 3

I am trying to set up a cross compiling environment for the Raspberry Pi 3 on my Mac because compiling on the Pi just became to slow.
Following this guide I successfully created a cross compiler using crosstool-ng that is able to compile a simple "Hello World" program that runs on the Pi.
I try to follow the RaspberryPi2EGLFS-Guide on the Qt wiki.
It is written for Ubuntu but that should not make a difference when you have a compiler for your host system, does it?
I created the sysroot and fixed symbolic links as described in the guide, but the configure command for Qt fails.
./configure \
-release \
-opensource -confirm-license \
-make libs \
-opengl es2 \
-device linux-rpi3-g++ \
-sysroot $SYSROOT \
-opensource -confirm-license -make libs \
-prefix /usr/local/qt5pi -extprefix ~/dev/raspi/qt5pi \
-hostprefix ~/dev/raspi/qt5 \
-device-option CROSS_COMPILE=$TOOLCHAIN \
-v
There, $TOOLCHAIN points to the toolchain I compiled and $SYSROOT is the sysroot I set up according to the guide.
But the command fails with a bunch of errors because header files could not be found:
fatal error: sys/cdefs.h: No such file or directory
fatal error: zconf.h: No such file or directory
fatal error: sys/types.h: No such file or directory
Edit 12-14-2016
Apparently the compiler can't determine the cpu architecture:
/Volumes/xtools/armv8-rpi3-linux-gnueabihf/lib/gcc/armv8-rpi3-linux-gnueabihf/5.2.0/../../../../armv8-rpi3-linux-gnueabihf/bin/ld.gold: error: /Volumes/xtools/armv8-rpi3-linux-gnueabihf/armv8-rpi3-linux-gnueabihf/sysroot/usr/lib/crti.o: unknown CPU architecture
From my (limited) understanding, these headers should apear somewhere in $SYSROOT.
I have checked my sysroot, the missing headers a located in $SYSROOT/usr/include/arm-arm-linux-gnueabihf/.
I created a symlink from there to $SYSROOT/sys but that did not work either.
Am I missing something?
Other threads suggest installing g++-multilib on the host system, but there is no multlib-equivalent on macOS.

'make install' failed after 'make' KiCad on OS X 10.10

i'm trying to install kicad on osx 10.10. After successfully build make, failed
make install at
-- fixup_bundle
-- app='/Users/bolor/Downloads/KiCad/bin/eeschema.app/Contents/MacOS/eeschema'
-- libs=''
-- dirs=''
-- fixup_bundle: preparing...
-- warning: embedded item does not exist '/Users/bolor/Downloads/KiCad/bin/eeschema.app/Contents/MacOS/libboost_chrono-mt.dylib'
--
warning: cannot resolve item '#loader_path/libboost_chrono-mt.dylib'
possible problems:
need more directories?
need to use InstallRequiredSystemLibraries?
run in install tree instead of build tree?
error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/otool: can't open file: #loader_path/libboost_chrono-mt.dylib (No such file or directory)
CMake was configured like below:
cmake ../kicad \
-DCMAKE_C_COMPILER=clang \
-DCMAKE_CXX_COMPILER=clang++ \
-DCMAKE_OSX_DEPLOYMENT_TARGET=10.10 \
-DwxWidgets_CONFIG_EXECUTABLE=../wx-bin/bin/wx-config \
-DKICAD_SCRIPTING=OFF \
-DKICAD_SCRIPTING_MODULES=OFF \
-DKICAD_SCRIPTING_WXPYTHON=OFF \
-DCMAKE_INSTALL_PREFIX=../bin \
-DCMAKE_BUILD_TYPE=Release \
-DKICAD_SKIP_BOOST=ON \
-DCMAKE_OSX_SYSROOT=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk
does anyone know how to solve this?
thanks!
i have saved all the build log in a txt file and put on dropbox readable
here
I am pretty sure that's a bug in kicad's CMake script.
Other have the same problem, see https://gist.github.com/rhaamo/497d3c94929b69874411
In
http://www.mikrocontroller.net/topic/380428
they say it either works with -DKICAD_SKIP_BOOST=ON or with letting kicad build its own Boost library.

Resources