AlexeyAB / darknet

YOLOv4 / Scaled-YOLOv4 / YOLO - Neural Networks for Object Detection (Windows and Linux version of Darknet )
http://pjreddie.com/darknet/
Other
21.6k stars 7.95k forks source link

Windows pthreads library misspelling #2564

Open Logitude opened 5 years ago

Logitude commented 5 years ago

In cmake/Modules/FindPThreads_windows.cmake the pthreads library is misspelled as "pthreadsVC2". It should be "pthreadVC2".

AlexeyAB commented 5 years ago

@Logitude Hi,

It looks like it was renamed 3 days ago: https://github.com/Microsoft/vcpkg/commit/fd2330af7af3c8b523bec5e3de8fdbaf7ed75f5e

Do you get an error during compiling?

Logitude commented 5 years ago

I did get an error during the cmake checks:

-- Could NOT find PTHREADS (missing: PTHREADS_LIBRARY)
-- Found OpenMP_C: -openmp (found version "2.0")
-- Found OpenMP_CXX: -openmp (found version "2.0")
-- Found OpenMP: TRUE (found version "2.0")
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
PTHREADS_LIBRARY (ADVANCED)

I was able to build after making the following change:

diff --git a/cmake/Modules/FindPThreads_windows.cmake b/cmake/Modules/FindPThreads_windows.cmake
index 2b7d76a..6ecfd3e 100644
--- a/cmake/Modules/FindPThreads_windows.cmake
+++ b/cmake/Modules/FindPThreads_windows.cmake
@@ -31,8 +31,8 @@ endif()

 # Allow libraries to be set manually
 if(NOT PTHREADS_LIBRARY)
-  find_library(PTHREADS_LIBRARY_RELEASE NAMES pthreadsVC2)
-  find_library(PTHREADS_LIBRARY_DEBUG NAMES pthreadsVC2d)
+  find_library(PTHREADS_LIBRARY_RELEASE NAMES pthreadVC2)
+  find_library(PTHREADS_LIBRARY_DEBUG NAMES pthreadVC2d)
   select_library_configurations(PTHREADS)
 endif()
cagnulein commented 5 years ago

i confirm the bug