Can't build 3.3.0 on Windows 10 under CMake

asked 2017-10-12 00:15:20 -0500

updated 2017-10-12 00:59:48 -0500

berak gravatar image

I've downloaded the latest 3.3.0. I'm on a plain vanilla Windows 10 system w/ Visual Studio 2017 latest edition installed on it. Windows x64. CMake is version 3.9.4. I load up cmake, turn off a few things (tests, docs, apps, calib3d), and choose the x64 2017 compiler... I also have the very latest cuda sdk installed.

when I build, it chokes trying to build the .CU files, it can't find $(VCINSTALLDIR)/bin, which doesn't exist on my machine. I can't imagine I'm the ONLY person getting this error?

edit retag flag offensive close merge delete


Are you sure that CUDA is compatible with vs 2017?

LBerger gravatar imageLBerger ( 2017-10-12 03:03:09 -0500 )edit

You're right, it wasn't compatible. I uninstalled Cuda 8.0 SDK, installed Cuda 9.0 SDK, made the required changes to cmake's FindCuda.cmake, made the required changes to saturate_cast.hpp, and deleted cmake's cache and reconfigured. Now, when I try to build it says:

3>Building NVCC (Device) object modules/world/CMakeFiles/cuda_compile.dir/__/core/src/cuda/Debug/ 3>CMake Error at (message): 3> Error generating

which ain't that illuminating.

BroncoBilli gravatar imageBroncoBilli ( 2017-10-12 12:42:44 -0500 )edit

CMake defaults CUDA_HOST_COMPILER to $(VCInstallDir)\bin, which on my system (with VS2017 installed), VCInstallDir = c:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\, and that directory does not have a "bin" directory in it. When I look at the cuda flags in the cmake generated vxcproj, I see it's trying to reference --ccbin at the above non-existent directory. When I try to change that directory (in cmake) to something else and regenerate the files, it still stays at $(VCInstallDir)/bin, it has no effect.

What should the directory really point to? I don't know what a CUDA_HOST_COMPILER should point to.

BroncoBilli gravatar imageBroncoBilli ( 2017-10-12 13:29:58 -0500 )edit

I've been fooling around w/ the flags sent to the compiler on the command line and if I remove the --ccbin xxx from the parameters to nvcc, it compiles. If I pass in the non-existent path, the compile fails. Something is wrong with CUDA_HOST_COMPILER, it shouldn't be set to $(VCInstallDir)\bin. But what should it be set to?

BroncoBilli gravatar imageBroncoBilli ( 2017-10-12 13:48:08 -0500 )edit

try to disable world with cuda. You can find a cmakeoutput with cuda on linux here

LBerger gravatar imageLBerger ( 2017-10-12 13:57:58 -0500 )edit

But I want the world to build. Besides, it should work. Help me figure out what is wrong with CUDA_HOST_COMPILER!

BroncoBilli gravatar imageBroncoBilli ( 2017-10-12 20:33:43 -0500 )edit