1

I am trying to use cmake to compile darknet for YOLO V3. But I'm getting following error:

CMake Error at C:/Program Files/CMake/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake:146 (message): Could NOT find PThreads_windows (missing: PThreads_windows_LIBRARY PThreads_windows_INCLUDE_DIR) Call Stack (most recent call first): C:/Program Files/CMake/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake:393 (_FPHSA_FAILURE_MESSAGE) cmake/Modules/FindPThreads_windows.cmake:39 (find_package_handle_standard_args)
C:/Users/MSI/vcpkg/scripts/buildsystems/vcpkg.cmake:288 (_find_package) CMakeLists.txt:93 (find_package)

How can I fix this?

matthias_h
  • 11,356
  • 9
  • 22
  • 40
Rukan Mahfuz
  • 87
  • 3
  • 6

1 Answers1

0

You have defined CMAKE_TOOLCHAIN_FILE as vcpkg. If this variable is defined, darknet will by default think that you have configured pthread_window in vcpkg (it happens at around 30 ~40 lines in CMakeLists.txt), but you actually not. So you need to replace

if(WIN32 AND NOT DEFINED CMAKE_TOOLCHAIN_FILE)
  set(USE_INTEGRATED_LIBS "TRUE" CACHE BOOL "Use libs distributed with this repo")
else()
  set(USE_INTEGRATED_LIBS "FALSE" CACHE BOOL "Use libs distributed with this repo")
endif()

by

set(USE_INTEGRATED_LIBS "TRUE" CACHE BOOL "Use libs distributed with this repo")

It will allow darknet to use its own 3rdparty pthreads in the root directory.

Tx.Yang
  • 11
  • 1