AlexeyAB / darknet

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

Unable to install darknet because of CMAKE errors. #8769

Open OishikGuha opened 1 year ago

OishikGuha commented 1 year ago

I am trying to build darknet by following the required steps for a project and use its YOLO algorithm. However, I get this error whenever I do it:

CMake Error: CMake was unable to find a build program corresponding to "Ninja".  CMAKE_MAKE_PROGRAM is not set.  You probably need to select a different build tool.
CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage

I am using Windows 11. I installed the latest version of Ninja using chocolatey.

OishikGuha commented 1 year ago

Here is the full error log:

PS D:\darknet\darknet> .\build.ps1 -UseVCPKG -EnableOPENCV -EnableCUDA -EnableCUDNN
Start-Transcript : Transcription cannot be started.
At D:\darknet\darknet\build.ps1:195 char:1
+ Start-Transcript -Path $BuildLogPath
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [Start-Transcript], PSInvalidOperationException
    + FullyQualifiedErrorId : CannotStartTranscription,Microsoft.PowerShell.Commands.StartTranscriptCommand

Build script version 3.1.0, utils module version 0.3.0
Working directory: D:\darknet\darknet, log file: D:\darknet\darknet/build.log, build.ps1 is in submodule: False
PowerShell version:
Major  Minor  Build  Revision
-----  -----  -----  --------
5      1      22000  653
Running on Windows Powershell, please consider update and running on newer Powershell versions
vcpkg bootstrap script: bootstrap-vcpkg.bat
CUDA is enabled
CUDNN is enabled
OPENCV is enabled
OPENCV with CUDA extension is not enabled, you can enable it passing -EnableOPENCV_CUDA
VCPKG is enabled
VCPKG will be updated to latest version if found
VisualStudio integration is enabled, please pass -DoNotSetupVS to the script to disable
Yolo C# wrapper integration is disabled, please pass -EnableCSharpWrapper to the script to enable. You must be on Windows!
Ninja is enabled, please pass -DoNotUseNinja to the script to disable
ForceCPP build mode is disabled, please pass -ForceCPP to the script to enable
Using git from F:\Git\cmd\git.exe
This tool has been cloned with git and supports self-updating mechanism
This tool will self-update sources, please pass -DoNotUpdateTOOL to the script to disable
Already up to date.
Using CMake from D:\CMake\bin\cmake.exe
cmake version 3.26.3

CMake suite maintained and supported by Kitware (kitware.com/cmake).
Using Ninja from C:\ProgramData\chocolatey\bin\ninja.exe
Ninja version 1.10.2
Found vcpkg in D:\darknet\darknet/vcpkg: D:\darknet\darknet\vcpkg
Already up to date.
Downloading https://github.com/microsoft/vcpkg-tool/releases/download/2023-03-29/vcpkg.exe -> D:\darknet\darknet\vcpkg\vcpkg.exe... done.
Validating signature... done.

Found VS in E:\Visual Studio\Main
Visual Studio Command Prompt variables set
Setting up environment to use CMake generator: Ninja
Unable to find CUDA, if necessary please install it or define a CUDA_PATH env variable pointing to the install folder
Removing folder D:\darknet\darknet/build_release
Configuring release CMake project
CMake args: -G "Ninja"  -DCMAKE_INSTALL_PREFIX=D:\darknet\darknet -DCMAKE_BUILD_TYPE=Release  -DENABLE_VCPKG_INTEGRATION:BOOL=ON -DX_VCPKG_APPLOCAL_DEPS_INSTALL=ON -DVCPKG_BUILD_OPENCV_WITH_CUDA:BOOL=OFF -DENABLE_DEPLOY_CUSTOM_CMAKE_MODULES:BOOL=ON -S ..
Darknet_VERSION: 0.2.5.4
-- Setting default vcpkg target triplet to x64-windows-release
-- VCPKG found: D:\darknet\darknet\vcpkg
-- Using VCPKG integration
-- VCPKG_MANIFEST_FEATURES: cuda;cudnn;opencv-base
-- Running vcpkg install
Detecting compiler hash for triplet x64-windows-release...
The following packages will be built and installed:
  * bzip2[core,tool]:x64-windows-release -> 1.0.8#3
    cuda[core]:x64-windows-release -> 10.1#13
    cudnn[core]:x64-windows-release -> 7.6.5#9
  * curl[core,non-http,schannel,ssl,sspi]:x64-windows-release -> 8.0.1
  * ffmpeg[avcodec,avdevice,avfilter,avformat,core,swresample,swscale]:x64-windows-release -> 5.1.2#5
  * giflib[core]:x64-windows-release -> 5.2.1#3
  * hdf5[core,szip,zlib]:x64-windows-release -> 1.14.0#1
  * leptonica[core]:x64-windows-release -> 1.83.1
  * libarchive[bzip2,core,crypto,libxml2,lz4,lzma,zstd]:x64-windows-release -> 3.6.2
  * libiconv[core]:x64-windows-release -> 1.17#1
  * libjpeg-turbo[core]:x64-windows-release -> 2.1.5.1
  * liblzma[core]:x64-windows-release -> 5.4.1#1
  * libpng[core]:x64-windows-release -> 1.6.39#1
  * libwebp[core,libwebpmux,nearlossless,simd,unicode]:x64-windows-release -> 1.3.0
  * libxml2[core,iconv,lzma,zlib]:x64-windows-release -> 2.10.3#1
  * lz4[core]:x64-windows-release -> 1.9.4#1
    opencv[contrib,core,default-features,dnn,ffmpeg]:x64-windows-release -> 4.7.0#1
  * opencv4[contrib,core,default-features,dnn,ffmpeg,jpeg,png,quirc,tiff,webp]:x64-windows-release -> 4.7.0#3
  * openjpeg[core]:x64-windows-release -> 2.5.0
  * openssl[core]:x64-windows-release -> 3.1.0#1
  * pkgconf[core]:x64-windows-release -> 1.8.0#5
  * protobuf[core]:x64-windows-release -> 3.21.12
    pthreads[core]:x64-windows-release -> 3.0.0#13
  * quirc[core]:x64-windows-release -> 1.1#3
    stb[core]:x64-windows-release -> 2022-09-09
  * szip[core]:x64-windows-release -> 2.1.1#10
  * tesseract[core]:x64-windows-release -> 5.3.0
  * tiff[core,jpeg,lzma,zip]:x64-windows-release -> 4.5.0#2
  * vcpkg-cmake[core]:x64-windows-release -> 2022-12-22
  * vcpkg-cmake-config[core]:x64-windows-release -> 2022-02-06#1
  * vcpkg-cmake-get-vars[core]:x64-windows-release -> 2023-03-02
  * vcpkg-get-python-packages[core]:x64-windows-release -> 2022-06-30
  * vcpkg-pkgconfig-get-modules[core]:x64-windows-release -> 2022-02-10#1
  * vcpkg-tool-meson[core]:x64-windows-release -> 0.63
  * zlib[core]:x64-windows-release -> 1.2.13
  * zstd[core]:x64-windows-release -> 1.5.4#1
Additional packages (*) will be modified to complete this operation.
Restored 3 package(s) from C:\Users\Administrator\AppData\Local\vcpkg\archives in 52.6 ms. Use --debug to see more details.
Installing 1/36 vcpkg-cmake-config:x64-windows-release...
Elapsed time to handle vcpkg-cmake-config:x64-windows-release: 6.09 ms
Installing 2/36 pthreads:x64-windows-release...
Elapsed time to handle pthreads:x64-windows-release: 12.1 ms
Installing 3/36 stb:x64-windows-release...
Elapsed time to handle stb:x64-windows-release: 13.9 ms
Installing 4/36 cuda:x64-windows-release...
Building cuda[core]:x64-windows-release...
warning: -- Using community triplet x64-windows-release. This triplet configuration is not guaranteed to succeed.
-- [COMMUNITY] Loading triplet configuration from: D:\darknet\darknet\vcpkg\triplets\community\x64-windows-release.cmake
-- Executing NVCC-NOTFOUND --version resulted in error: 1
CMake Error at ports/cuda/vcpkg_find_cuda.cmake:69 (message):
  Could not find CUDA.  Before continuing, please download and install CUDA
  (v10.1.0 or higher) from:

      https://developer.nvidia.com/cuda-downloads

Call Stack (most recent call first):
  ports/cuda/portfile.cmake:9 (vcpkg_find_cuda)
  scripts/ports.cmake:147 (include)

error: building cuda:x64-windows-release failed with: BUILD_FAILED
Please ensure you're using the latest port files with `git pull` and `vcpkg update`.
Then check for known issues at:
    https://github.com/microsoft/vcpkg/issues?q=is%3Aissue+is%3Aopen+in%3Atitle+cuda
You can submit a new issue at:
    https://github.com/microsoft/vcpkg/issues/new?title=[cuda]+Build+error&body=Copy+issue+body+from+D%3A%2Fdarknet%2Fdarknet%2Fbuild_release%2Fvcpkg_installed%2Fvcpkg%2Fissue_body.md

-- Running vcpkg install - failed
CMake Error at vcpkg/scripts/buildsystems/vcpkg.cmake:892 (message):
  vcpkg install failed.  See logs for more information:
  D:\darknet\darknet\build_release\vcpkg-manifest-install.log
Call Stack (most recent call first):
  D:/CMake/share/cmake-3.26/Modules/CMakeDetermineSystem.cmake:148 (include)
  CMakeLists.txt:109 (project)

CMake Error: CMake was unable to find a build program corresponding to "Ninja".  CMAKE_MAKE_PROGRAM is not set.  You probably need to select a different build tool.
CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
-- Configuring incomplete, errors occurred!
Config failed! Exited with error code 1.
Press any key to continue...
ScriptHalted
At D:\darknet\darknet\scripts\utils.psm1:320 char:5
+     throw
+     ~~~~~
    + CategoryInfo          : OperationStopped: (:) [], RuntimeException
    + FullyQualifiedErrorId : ScriptHalted
stephanecharette commented 1 year ago

See the FAQ: https://www.ccoderun.ca/programming/darknet_faq/#how_to_build_on_windows

Coronadojoe commented 1 year ago

Did you figure it out? I installed the latest stable version of CMAKE and followed the steps in the FAQ and haven't figured it out yet.

CaCu999 commented 1 year ago

Maybe it is related to CUDA

Could not find CUDA. Before continuing, please download and install CUDA (v10.1.0 or higher) from: https://developer.nvidia.com/cuda-downloads