CMake for OpenCV (opencv.cpp) + CUDA (cuda.cu) code. [closed]

asked 2016-02-13 10:04:16 -0600

I am using OpenCV and also CUDA, i have done experiments with gpu:: functions available in OpenCV, but now i want to use cuda Kernel, and want to add .cu file with my current project. I am using CMake to build opencv+cuda code, and i am using Ubuntu, the main problem is that i don't know how to build CMake for these kind of projects ( I know only about OpenCV, .cpp projects), please help me if any one has the solution

Thanks in advance.

edit retag flag offensive reopen merge delete

Closed for the following reason question is not relevant or outdated by sturkmen
close date 2020-10-07 12:54:29.262325

Comments

CMake Docs

Some example on google

It was a pretty quick google search.

mynameisjohnj gravatar imagemynameisjohnj ( 2016-02-13 16:05:39 -0600 )edit

Thanks for prompt reply, but examples are for only CUDA with .CPP file, not with OpenCV files When i am trying to build such files, like in one of the Udacity course (Code: https://github.com/udacity/cs344) [Problem set 1] it is giving me errors like main.cpp:(.text+0xcb): undefined reference to `cv::imread .

I have compiled OpenCV codes with GPU support, they are working fine, with following CMakeLists.txt file, now i just want to add cuda kernel with it, I am using following CMakeLists.txt for only OpenCV code,

cmake_minimum_required(VERSION 2.8) project( opencv ) find_package( OpenCV REQUIRED ) add_executable( opencv opencv.cpp ) target_link_libraries( opencv ${OpenCV_LIBS} )

mistryalok gravatar imagemistryalok ( 2016-02-13 22:09:58 -0600 )edit

wow I have this same problem! any luck?

jubuntitus gravatar imagejubuntitus ( 2017-09-28 18:52:55 -0600 )edit