0
votes

When attempting to build TensorFlow with CMake and MSBuild on Windows 10, I get the following error when running MSBuild:

"C:\work\tensorflow\tensorflow\contrib\cmake\build\tf_tutorials_example_trainer.vcxproj" (default target) (1) ->
"C:\work\tensorflow\tensorflow\contrib\cmake\build\tf_core_gpu_kernels.vcxproj" (default target) (90) ->
(CustomBuild target) ->
  C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targets(171,5): error MSB6006: "cmd.exe" exited with code 1. [C:\work\tensorflow\tensorflow\contrib\cmake\build\tf_core_gpu_kernels.vcxproj]

    351 Warning(s)
    1 Error(s)

So I only get one error message, and that just tells me that cmd.exe was closed with an error code indicating that there was a problem, but not what the problem was. So how can I find out what caused this problem so I can solve it?

1
You can get more details using from msbuild by appending /v:diag > diag.log to the command and look for that error in the resulting diagnostic log. Also, did you run the command from the developer command prompt?Martin Ullrich

1 Answers

2
votes

This error commonly happens because the default cmake install location requires admin privileges (normally C:/Program Files/).

There are two simple ways around this:

Run visual studio as Administrator Override the CMAKE_INSTALL_PREFIX variable to point somewhere not requiring admin privileges Personally, I'd recommend the second option (When configuring cmake, the command would be something like: cmake . -DCMAKE_INSTALL_PREFIX=D:/Some/Path)