Why cmake is unable to find threads (missing: threads found) and how to solve

asked 2019-08-23 12:30:37 -0500

I am new in opencv c++, I used to run opencv on python. Here is my system details:

ubuntu 18.04 cmake 3.10 opencv 4.1.1 g++ 7.4.0 cuda 10.0 opencv installed using source compile

While trying to run cuda samples provided officially I get this error when I hit 'cmake .'

CMake Error at /usr/share/cmake-3.10/Modules/FindPackageHandleStandardArgs.cmake:137 (message): Could NOT find Threads (missing: Threads_FOUND) Call Stack (most recent call first): /usr/share/cmake-3.10/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE) /usr/share/cmake-3.10/Modules/FindThreads.cmake:205 (FIND_PACKAGE_HANDLE_STANDARD_ARGS) /usr/share/cmake-3.10/Modules/FindCUDA.cmake:868 (find_package) /usr/local/lib/cmake/opencv4/OpenCVConfig.cmake:86 (find_package) /usr/local/lib/cmake/opencv4/OpenCVConfig.cmake:108 (find_host_package) CMakeLists.txt:3 (find_package)

-- Configuring incomplete, errors occurred! See also "/home/misbah/opencv/samples/gpu/CMakeFiles/CMakeOutput.log". See also "/home/misbah/opencv/samples/gpu/CMakeFiles/CMakeError.log".

Here is my CMakeLists.txt

cmake_minimum_required(VERSION 2.8) project(project_name) find_package(OpenCV REQUIRED) include_directories(${OpenCV_INCLUDE_DIRS}) add_executable(project_name houghlines.cpp) target_link_libraries(project_name ${OpenCV_LIBS})

How can I get rid of this problem?

edit retag flag offensive close merge delete