I have been troubling with changing version of opencv. I deleted old version of it for some reason and installed new version follow this site:
https://docs.opencv.org/master/d7/d9f/tutorial_linux_install.html
my cmake parameters are as follows:
cmake -D CMAKE_BUILD_TYPE=Release -D CMAKE_INSTALL_PREFIX=/usr/local -D OPENCV_GENERATE_PKGCONFIG=ON -D WITH_CUDA=ON -D OPENCV_DNN_CUDA=ON -D OPENCV_EXTRA_MODULES_PATH=/home/robotics/opencv_contrib/modules ..
and now I realized that I can not catkin_make. the error message is below:
CMake Error at /usr/share/OpenCV/OpenCVModules.cmake:179 (message):
The imported target "opencv_core" references the file
"/usr/lib/libopencv_core.so.3.3.1"
but this file does not exist. Possible reasons include:
The file was deleted, renamed, or moved to another location.
An install or uninstall procedure did not complete successfully.
The installation package was faulty and contained
"/usr/share/OpenCV/OpenCVModules.cmake"
but not all the files it references.
I think the problem is that cmake is still searching old version of opencv I installed by package, but I don't know how to change that path to new opencv I installed is any idea can allow me to edit this path? Or any way to install opencv with path set correctly? Thank you!
Related
I am following this guide to build an optimized version of OpenCV for android:
https://medium.com/#tomdeore/opencv-on-android-tiny-with-optimization-enabled-932460acfe38
Step 4:
I downloaded OpenCV from Github (https://github.com/opencv/opencv)
I run:
fabio#fabio-XPS-15-9560:~/Software/opencv-3.4.9$ mkdir build
fabio#fabio-XPS-15-9560:~/Software/opencv-3.4.9$ cd build/
fabio#fabio-XPS-15-9560:~/Software/opencv-3.4.9/build$ cmake -DCMAKE_TOOLCHAIN_FILE=../platforms/android/android.toolchain.cmake -DANDROID_STL=gnustl_shared -DANDROID_NATIVE_API_LEVEL=23
But I got this error:
CMake Error: The source directory "/home/fabio/Software/opencv-3.4.9/build" does not appear to contain CMakeLists.txt.
Specify --help for usage, or press the help button on the CMake GUI.
What am I doing wrong?
Note, in your linked build guide, the cmake command ends with a .. telling CMake to run on the parent directory:
cmake \
-DCMAKE_TOOLCHAIN_FILE=../platforms/android/android.toolchain.cmake\
-DANDROID_STL=gnustl_shared \
-DANDROID_NATIVE_API_LEVEL=23 ..
You are running CMake from the build directory, which is incorrect. You want to run on the parent directory, which does contain a CMakeLIsts.txt file.
I want to install MongoDB C++ Driver, so first is mongocxx
I follow this installation:
http://mongocxx.org/mongocxx-v3/installation/
but I can not pass step 4
when I run this in mongo-cxx-driver/build
sudo cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local ..
it shows
-- Auto-configuring bsoncxx to use MNMLSTC for polyfills since C++17 is inactive
CMake Error at src/mongocxx/CMakeLists.txt:37 (find_package):
By not providing "Findlibmongoc-1.0.cmake" in CMAKE_MODULE_PATH this
project has asked CMake to find a package configuration file provided by
"libmongoc-1.0", but CMake did not find one.
Could not find a package configuration file provided by "libmongoc-1.0"
(requested version 1.13.0) with any of the following names:
[![enter image description here][1]][1]
libmongoc-1.0Config.cmake
libmongoc-1.0-config.cmake
Add the installation prefix of "libmongoc-1.0" to CMAKE_PREFIX_PATH or set
"libmongoc-1.0_DIR" to a directory containing one of the above files. If
"libmongoc-1.0" provides a separate development package or SDK, be sure it
has been installed.
second question,
Step 2: Choose a C++17 polyfill how can I set MNMLSTC/core?
does anyone can help me,I already trap here for a long time ?
my env:
mongo-c-driver 1.15.1
libmongoc-1.0
mongocxx-3.4.x
Cmake is complaining about not finding a package configuration file (xxx.cmake), probably because you didn't build libmongoc/libbson.
I've tried to reproduce your issue and hit the same problem when I only installed them (apt-get install), so my suggestion is that you get the sources and build them as described at: http://mongoc.org/libmongoc/current/installing.html
Here's the list of commands (with the latest version of mongo-c-driver=1.15.1) which I just tried and worked fine:
wget https://github.com/mongodb/mongo-c-driver/releases/download/1.15.1/mongo-c-driver-1.15.1.tar.gz
tar xzf mongo-c-driver-1.15.1.tar.gz
cd mongo-c-driver-1.15.1
mkdir cmake-build
cd cmake-build
cmake -DENABLE_AUTOMATIC_INIT_AND_CLEANUP=OFF ..
make
sudo make install
At this point you can go back into mongocxx/build and run again the command you were stuck at:
cd ../../mongo-cxx-driver/build
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local ..
I'm currently working on a study comparing the performance of different operating systems in image processing.
Because of this, i have to install OpenCV 2.4.x (2.4.3 preferably) on a FreeBSD system.
The problem is that it includes asm/types.h, which is not a POSIX-compliant library but rather a Linux one.
So i run cmake with the standard flags suggested by the install guide:
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local ..
Where .. points correctly to the source folder. Everything goes ok, so i run make:
[ 16%] Building CXX object modules/highgui/CMakeFiles/opencv_highgui.dir/src/cap_libv4l.cpp.o
/root/work/OpenCV-2.4.3/modules/highgui/src/cap_libv4l.cpp:238:54: error: asm/types.h: No such file or directory
The question is: what should i do in order to tell the compiler that it needs to include another header instead of the original header file?
This problem was addressed at Bug#651872: opencv: FTBFS on kfreebsd
In modules/highgui/src/cap_libv4l.cpp, remove or comment out the following include:
#include <asm/types.h>
Do the same in modules/highgui/src/cap_v4l.cpp.
I'm trying to use CMake to build generate the make file for a project of mine that uses Lua. When I run make I get this error:
/path/to/my/project/luaudio/luaudio.c:1:17: fatal error: lua.h: No such file or directory
In the CMakeLists.txt file, I have the following lines, which I thought would do it, but apparently they're not enough:
find_package(Lua51 REQUIRED)
set(Luaudio_INCLUDE_DIRS ${Luaudio_SOURCE_DIR} ${Lua51_INCLUDE_DIRS} PARENT_SCOPE)
include_directories(${Luaudio_INCLUDE_DIRS})
Lua51_Include_Dirs appears to be empty (attempting to run it though the message command doesn't print anything) so I suspect that it just can't find it. Do I need to specify where to look for Lua? I was under the impression that the whole point of find_package was that it would look in a set a predefined places so that I don't need to specify where it is specifically.
(This is on an Ubuntu machine and I do have the Lua packages installed.)
install lua bin:
sudo apt-get install lua5.1
install lua lib:
sudo apt-get install lua5.1-dev
Exploring FindLua51.cmake from cmake 2.8 I found that it sets LUA_INCLUDE_DIR variable instead of Lua51_INCLUDE_DIRS. So cmake code should be
find_package(Lua51 REQUIRED)
set(Luaudio_INCLUDE_DIRS ${Luaudio_SOURCE_DIR} ${LUA_INCLUDE_DIR} PARENT_SCOPE)
include_directories(${Luaudio_INCLUDE_DIRS})
for Ubuntu 14.04
sudo apt install lua5.2;
sudo apt install liblua5.2-dev;
I am compiling a dependency for a project on Ubuntu 10.10, and instead of having it install to /usr/local by default, I am instead installing it to /tmp/stage/usr/local. How do I go about informing CMake of the location of this custom installed dependency when I call it to generate the build files for said project.
I am running CMake 2.8.1, and I have tried to set CMAKE_PREFIX_PATH on the cmake command line, like so
cmake -D CMAKE_PREFIX_PATH=/tmp/stage/usr/local
but this doesn't seem to make a difference - the project doesn't seem to detect the dependency.
Also, if it matters, the project in question is OpenCV 2.2, and the dependency in question is FFMPEG...
I figured out how to fix my problem, and trying to point CMake at the appropriate install location isn't the issue.
Apparently, CMake is unable to find the pkg-config files for FFMPEG (i.e. libavcodec.pc, libavdevice.pc, etc.) that tell it where the FFMPEG headers and libraries are located. In a typical install scenario, these files would be located at /usr/lib/pkgconfig. However because of the custom install location, they are instead located at /tmp/stage/usr/local/lib/pkgconfig.
So that CMake could find these files, I had to add the following environment variable:
export PKG_CONFIG_PATH=/tmp/stage/usr/local/lib/pkgconfig
After which point, OpenCV built against FFMPEG as expected.