Open whynotAC opened 4 weeks ago
CMake Error at CMakeLists.txt:154 (message): CUDA not found, please build explicitly with -DENABLE_CUDA=OFF if you do not want CUDA.
Please install CUDA first.
your cuda version is too old for the msvc compiler in use. The cmake error is a little bit criptic but that's my first suspicion
your cuda version is too old for the msvc compiler in use. The cmake error is a little bit criptic but that's my first suspicion
nvcc --version nvcc: NVIDIA (R) Cuda compiler driver Copyright (c) 2005-2022 NVIDIA Corporation Built on Wed_Sep_21_10:41:10_Pacific_Daylight_Time_2022 Cuda compilation tools, release 11.8, V11.8.89 Build cuda_11.8.r11.8/compiler.31833905_0
I have installed the package before, but I couldn't do it again.
I closed this issue by accident, could you please reopen it for me?
MSVC 19.40 requires CUDA 12.4 or newer; you can try using _ALLOW_COMPILER_AND_STL_VERSION_MISMATCH
define but it's totally unsupported
the fact that the issue is closed is ok, you have to upgrade cuda, that's it. If you were able to install the package before, maybe it was with an older version of MSVC
Thanks a lot, I will try it.
bad news, opencv will rebuild again.
I have installed "darknet" successfully, however, I can't find the library know as "PThreads4W" while using "darknet".
code as follow:
find_package(Darknet CONFIG REQUIRED)
error as follow:
[CMake] CMake Error at D:/program files/Microsoft Visual Studio/2022/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.29/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
[CMake] Could NOT find PThreads4W (missing: PThreads4W_LIBRARY
[CMake] PThreads4W_CXXEXC_LIBRARY PThreads4W_STRUCTEXC_LIBRARY
[CMake] PThreads4W_INCLUDE_DIR)
[CMake] Call Stack (most recent call first):
[CMake] D:/program files/Microsoft Visual Studio/2022/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.29/Modules/FindPackageHandleStandardArgs.cmake:600 (_FPHSA_FAILURE_MESSAGE)
[CMake] E:/github/newvcpkg/vcpkg/installed/x64-windows/share/PThreads4W/PThreads4WConfig.cmake:77 (find_package_handle_standard_args)
[CMake] D:/program files/Microsoft Visual Studio/2022/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.29/Modules/CMakeFindDependencyMacro.cmake:76 (find_package)
[CMake] E:/github/newvcpkg/vcpkg/installed/x64-windows/share/darknet/DarknetConfig.cmake:27 (find_dependency)
[CMake] src/CMakeLists.txt:7 (find_package)
if you add
set(_VCPKG_INSTALLED_DIR "E:/github/newvcpkg/vcpkg/installed")
set(VCPKG_TARGET_TRIPLET "x64-windows")
into this file(vcpkg\installed\x64-windows\share\PThreads4W\PThreads4WConfig.cmake), I think it will work.
Also, there's a problem. It's the darknet that has been compiled and installed, and the corresponding function can't be found when it's linked. For example:
error LNK2019: An external symbol load_network_custom that cannot be resolved
Due to my limited abilities, I haven't found the problem yet.
if you add ... into this file(vcpkg\installed\x64-windows\share\PThreads4W\PThreads4WConfig.cmake), I think it will work.
The "Call Stack" shows that you are not using the vcpkg.cmake toolchain file (correctly).
Package: darknet[core,cuda,opencv-cuda]:x64-windows@2022-03-06#4
Host Environment
To Reproduce
vcpkg install darknet[opencv-cuda]
Failure logs
E:\github\vcpkg\buildtrees\darknet\config-x64-windows-dbg-err.log
``` Darknet_VERSION: 0.2.5.4 CMake Error at CMakeLists.txt:154 (message): CUDA not found, please build explicitly with -DENABLE_CUDA=OFF if you do not want CUDA. ```E:\github\vcpkg\buildtrees\darknet\config-x64-windows-dbg-out.log
``` -- Using toolchain: E:/github/vcpkg/scripts/buildsystems/vcpkg.cmake -- Toolchain uses VCPKG integration -- VCPKG_MANIFEST_FEATURES: cuda;opencv-cuda -- The C compiler identification is MSVC 19.41.34123.0 -- The CXX compiler identification is MSVC 19.41.34123.0 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: D:/program files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.41.34120/bin/Hostx64/x64/cl.exe - skipped -- Detecting C compile features -- Detecting C compile features - done -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working CXX compiler: D:/program files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.41.34120/bin/Hostx64/x64/cl.exe - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done -- Looking for a CUDA compiler -- Looking for a CUDA compiler - NOTFOUND -- CUDA_PATH: C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8 -- CUDACXX: C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8/bin/nvcc.exe -- Configuring incomplete, errors occurred! ```E:\github\vcpkg\buildtrees\darknet\config-x64-windows-dbg-CMakeCache.txt.log
``` # This is the CMakeCache file. # For build in directory: e:/github/vcpkg/buildtrees/darknet/x64-windows-dbg # It was generated by CMake: E:/github/vcpkg/downloads/tools/cmake-3.30.1-windows/cmake-3.30.1-windows-i386/bin/cmake.exe # You can edit this file to change values found and used by cmake. # If you do not want to change any of the values, simply exit the editor. # If you do want to change a value, simply edit, save, and exit the editor. # The syntax for the file is as follows: # KEY:TYPE=VALUE # KEY is the name of a variable in the cache. # TYPE is a hint to GUIs for the type of VALUE, DO NOT EDIT TYPE!. # VALUE is the current value for the KEY. ######################## # EXTERNAL cache entries ######################## //Build Darknet using C++ compiler also for C files BUILD_AS_CPP:BOOL=OFF //Create dark as a shared library BUILD_SHARED_LIBS:BOOL=ON //Build uselib_track BUILD_USELIB_TRACK:BOOL=ON //Path to a program. CMAKE_AR:FILEPATH=D:/program files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.41.34120/bin/Hostx64/x64/lib.exe //Choose the type of build, options are: None Debug Release RelWithDebInfo // MinSizeRel ... CMAKE_BUILD_TYPE:STRING=Debug CMAKE_CROSSCOMPILING:STRING=OFF //CUDA compiler CMAKE_CUDA_COMPILER:FILEPATH=NOTFOUND //CXX compiler CMAKE_CXX_COMPILER:FILEPATH=D:/program files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.41.34120/bin/Hostx64/x64/cl.exe CMAKE_CXX_FLAGS:STRING=' /nologo /DWIN32 /D_WINDOWS /utf-8 /GR /EHsc /MP ' CMAKE_CXX_FLAGS_DEBUG:STRING='/D_DEBUG /MDd /Z7 /Ob0 /Od /RTC1 ' //Flags used by the CXX compiler during MINSIZEREL builds. CMAKE_CXX_FLAGS_MINSIZEREL:STRING=/O1 /Ob1 /DNDEBUG CMAKE_CXX_FLAGS_RELEASE:STRING='/MD /O2 /Oi /Gy /DNDEBUG /Z7 ' //Flags used by the CXX compiler during RELWITHDEBINFO builds. CMAKE_CXX_FLAGS_RELWITHDEBINFO:STRING=/Zi /O2 /Ob1 /DNDEBUG //Libraries linked by default with all C++ applications. CMAKE_CXX_STANDARD_LIBRARIES:STRING=kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib //C compiler CMAKE_C_COMPILER:FILEPATH=D:/program files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.41.34120/bin/Hostx64/x64/cl.exe CMAKE_C_FLAGS:STRING=' /nologo /DWIN32 /D_WINDOWS /utf-8 /MP ' CMAKE_C_FLAGS_DEBUG:STRING='/D_DEBUG /MDd /Z7 /Ob0 /Od /RTC1 ' //Flags used by the C compiler during MINSIZEREL builds. CMAKE_C_FLAGS_MINSIZEREL:STRING=/O1 /Ob1 /DNDEBUG CMAKE_C_FLAGS_RELEASE:STRING='/MD /O2 /Oi /Gy /DNDEBUG /Z7 ' //Flags used by the C compiler during RELWITHDEBINFO builds. CMAKE_C_FLAGS_RELWITHDEBINFO:STRING=/Zi /O2 /Ob1 /DNDEBUG //Libraries linked by default with all C applications. CMAKE_C_STANDARD_LIBRARIES:STRING=kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib //No help, variable specified on the command line. CMAKE_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION:UNINITIALIZED=ON //Flags used by the linker during all build types. CMAKE_EXE_LINKER_FLAGS:STRING=/machine:x64 //Flags used by the linker during DEBUG builds. CMAKE_EXE_LINKER_FLAGS_DEBUG:STRING=/nologo /debug /INCREMENTAL //Flags used by the linker during MINSIZEREL builds. CMAKE_EXE_LINKER_FLAGS_MINSIZEREL:STRING=/INCREMENTAL:NO CMAKE_EXE_LINKER_FLAGS_RELEASE:STRING='/nologo /DEBUG /INCREMENTAL:NO /OPT:REF /OPT:ICF ' //Flags used by the linker during RELWITHDEBINFO builds. CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO:STRING=/debug /INCREMENTAL //Enable/Disable output of compile commands during generation. CMAKE_EXPORT_COMPILE_COMMANDS:BOOL= //No help, variable specified on the command line. CMAKE_EXPORT_NO_PACKAGE_REGISTRY:UNINITIALIZED=ON //No help, variable specified on the command line. CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY:UNINITIALIZED=ON //No help, variable specified on the command line. CMAKE_FIND_PACKAGE_NO_SYSTEM_PACKAGE_REGISTRY:UNINITIALIZED=ON //Value Computed by CMake. CMAKE_FIND_PACKAGE_REDIRECTS_DIR:STATIC=E:/github/vcpkg/buildtrees/darknet/x64-windows-dbg/CMakeFiles/pkgRedirects //No help, variable specified on the command line. CMAKE_INSTALL_BINDIR:STRING=bin //No help, variable specified on the command line. CMAKE_INSTALL_LIBDIR:STRING=lib //Install path prefix, prepended onto install directories. CMAKE_INSTALL_PREFIX:PATH=E:/github/vcpkg/packages/darknet_x64-windows/debug //No help, variable specified on the command line. CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP:UNINITIALIZED=TRUE //Path to a program. CMAKE_LINKER:FILEPATH=D:/program files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.41.34120/bin/Hostx64/x64/link.exe //make program CMAKE_MAKE_PROGRAM:FILEPATH=D:/program files/Microsoft Visual Studio/2022/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/Ninja/ninja.exe //Flags used by the linker during the creation of modules during // all build types. CMAKE_MODULE_LINKER_FLAGS:STRING=/machine:x64 //Flags used by the linker during the creation of modules during // DEBUG builds. CMAKE_MODULE_LINKER_FLAGS_DEBUG:STRING=/nologo /debug /INCREMENTAL //Flags used by the linker during the creation of modules during // MINSIZEREL builds. CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL:STRING=/INCREMENTAL:NO CMAKE_MODULE_LINKER_FLAGS_RELEASE:STRING='/nologo /DEBUG /INCREMENTAL:NO /OPT:REF /OPT:ICF ' //Flags used by the linker during the creation of modules during // RELWITHDEBINFO builds. CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO:STRING=/debug /INCREMENTAL CMAKE_MSVC_RUNTIME_LIBRARY:STRING=MultiThreaded$<$