CMake: CUDA libraries not found when compiling OpenCV

后端 未结 3 1102
逝去的感伤
逝去的感伤 2021-02-08 14:17

I am compiling OpenCV 3.0.0 with CUDA support on Windows, using CMAKE. When I click \"configure\", errors occur as following:

CMake Error: The following variable         


        
3条回答
  •  不要未来只要你来
    2021-02-08 14:57

    Thanks to tips from Drop in the comments, I solved this problem. In order to close this question, I'm answering my own question.

    It's a "Win32 or x64" architecture problem. Since NVIDIA only provides cufft, nvblas, nppc, nppi, npps libs for x64, it's naturally impossible for CMAKE to find these libs for configuring a Win32 OpenCV library.

    My solution was to choose Visual Studio 11 Win64 instead of Visual Studio 11 as generator in CMAKE. So that CMAKE will automatically load libs from \lib\x64 rather than \lib\Win32. Further more, I also need to load all the other libs required by OpenCV in 64 bit version, such as OpenGL. I will also need to compile OpenCV in x64 architecture. All the code I'm going to write in the future will have to build and debug in x64 only.


    Should one have no trouble reading Chinese materials, I'm happy to provide a link towards a post regarding the complete guide on building OpenCV 3.0 on VS2012 with CUDA supports.

提交回复
热议问题