I have CUDA 10.1. I'm trying to build opencv4 using CUDA and CUDNN support.When i run make command i get the following error
/usr/bin/ld: cannot find -llib64 while trying to link with libopencv_cudev.so.
My cmake command is as follows:
cmake -DCMAKE_BUILD_TYPE=RELEASE -DCMAKE_INSTALL_PREFIX=/usr/local -DINSTALL_PYTHON_EXAMPLES=ON -DINSTALL_C_EXAMPLES=ON -DOPENCV_ENABLE_NONFREE=ON -DWITH_CUDA=ON -DWITH_CUDNN=ON -DCUDA_TOOLKIT_ROOT_DIR=/usr/local/cuda-10.1 -DOPENCV_EXTRA_MODULES_PATH=../../opencv_contrib/modules -DPYTHON_EXECUTABLE=/usr/bin/python3 -DBUILD_EXAMPLES=ON ..
My nvidia cuda toolkit version is: release 7.5, V7.5.17.
What might be the error? Please guide.
EDIT
I installed CUDA using this link. But that did not install nvcc. So i installed nvcc using terminal command line sudo apt install nvidia-cuda-toolkit. Is it not the correct way.
Related
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 have installed CUDA 8.0 on ubuntu and set the environment variable in .bashrc as below:
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/lib64
export CUDA_HOME=/usr/local/cuda
export PATH=$PATH:/usr/local/cuda/bin
Also, when I run
nvcc --version
I can find the correct version of CUDA.
However, it always shows "use cuda: NO" when I try to run "cmake .." inside opencv 3.3 directory.
Can anyone solve this problem? Thanks.
ps:
1. When I compile caffe, cmake can find CUDA correctly. It gets more confusing.
2. When I check OpenCVDetectCUDA.cmake, I found the following phrase sentence:
if(CMAKE_COMPILER_IS_GNUCXX AND NOT APPLE AND CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
message(STATUS "CUDA compilation is disabled (due to Clang unsupported on your platform).")
return()
endif()
Then I comment this paragraph, cmake can find CUDA. I am not sure what effect it will cause in later compilation and use.
If building from source is giving you as issue try installing via pip:
$ pip install opencv-python
I suspect the reason why you are having issues with building your opencv is because of the source of your files.
I am trying to build opencv for CARMA. I want to build it with GTK support but cmake not find gtk. i have installed gtk. i Debug the cmake and found that it not find pkg-config executable how i can solve this issue?
So i am running ubuntu 13.04 on the sd card of my new beaglebone black. I am attempting to install opencv-2.4.2. I've got everything installed without errors but when i try to build and run a program
g++ 'pkg-config opencv --cflags' FILE.cpp -o FILE 'pkg-config opencv --libs'
I get the error:
pkg-config opencv --cflags: no such file or directory
pkg-config opencv --libs: no such file or directory
When I run pkg-config --libs opencv it gives me the correct directory (/usr/lib/ .so) with all my libraries and I have confirmed they are all actually there. pkg-config opencv --cflags gives -I/usr/include/opencv. Which also exists.
I have edited my bash.bashrc, opencv.pc, and opencv.conf files reflect these paths. They were /usr/local/lib but no libraries installed there.
I'm running out of ideas guys, any help or suggestions would be great.
Thanks.
you should be using backticks (`) instead of ' to substitute the output of pkg-config into the command line.
opencv-2.4.2 is provided in the angstrom distribution that comes with the BeagleBone Black. One problem I found was that python-opencv is at 2.3 with angstrom, so if you want to do your development work in python you have to downgrade opencv to 2.3.
I already have OpenCV2.4.2 installed as part of ROS(Fuerte) in my computer(installed from Ubuntu Software Center, something due to ROS). How should I install OpenCV as a standalone?
I went through this guide and downloaded the opencv package from here. I am not quite clear as how to proceed. Can anyone give short list of steps to install? I want to use an IDE for my projects, so which IDE is proper for C++ and how to install the proper IDE and configure it correctly?
Also how to check if certain tools are installed?
This link which you also mentioned describes the necessary steps to compile OpenCV on your machine.
The version of OpenCV you install this way will be newer than the one installed with the ROS package, they usually have some delay. (Maybe not with Fuerte.)
Using multiple versions of the same library on a machine might cause problems with linking and it will create a bit of headache for you so I would avoid it.
Try running pkg-config opencv --libs to see if the ROS version pulled by Fuerte is available and you can use this with your projects later on.
For a starter IDE I would recommend Qt Creator.
The easy way to set OpenCV up with your project in Qt Creator is the following:
Create a project
Open the .pro file of the project
Run pkg-config opencv --cflags
Add this to the .pro file: INCLUDEPATH += __result__of__above
pkg-config opencv --libs
Add this to the .pro file: LIBS += __result__of__above
In the end what you add should look something like this:
INCLUDEPATH += -I/opt/ros/fuerte/include
LIBS += -L/opt/ros/fuerte/lib -lopencv_calib3d -lopencv_contrib -lopencv_core -lopencv_features2d -lopencv_flann -lopencv_gpu -lopencv_highgui -lopencv_imgproc -lopencv_legacy -lopencv_ml -lopencv_nonfree -lopencv_objdetect -lopencv_photo -lopencv_stitching -lopencv_ts -lopencv_video -lopencv_videostab
To install OpenCV using the terminal on Ubuntu:
$ su -
# apt-get update
# apt-get install build-essential
# apt-get install libavformat-dev
# apt-get install x264 v4l-utils ffmpeg
# apt-get install libcv2.3 libcvaux2.3 libhighgui2.3 python-opencv opencv-doc libcv-dev libcvaux-dev libhighgui-dev
OpenCV should be installed in /usr/local/ Installation Directory
You may also want to compile and view examples
$ cp -r /usr/share/doc/opencv-doc/examples .
$ cd examples
$ cd c
$ sh build_all.sh
You can read the complete article about How to install OpenCV on Ubuntu from Nam Huy Linux Blog at http://namhuy.net/1205/how-to-install-opencv-on-ubuntu.html
This github user has compiled all the installation steps using a shell script. You can install any OpenCV version you want by running the appropriate shell script inside.
$ git clone https://github.com/jayrambhia/Install-OpenCV.git
$ cd Ubuntu
$ chmod +x *
$ ./opencv_latest.sh
There is an installer for Ubuntu 16.04, and it may work well on Ubuntu 12.04, you could have a try. I have used it to install on Ubuntu 16.04 and it succeed!
An interactive installing script for install openCV on Ubuntu 16.04 LTS