title: Errors when building TensorFlow with CMake on Windows 10
body: <p>I am attempting a <a href="https://github.com/tensorflow/tensorflow/tree/master/tensorflow/contrib/cmake" rel="nofollow noreferrer">TensorFlow CMake build</a> on Windows, but I'm running into problems.</p>
  
  <p>First, I run</p>
  
  <pre><code>C:\work\tensorflow\tensorflow\contrib\cmake\build&gt;cmake .. -A x64 -DCMAKE_BUILD_TYPE=Release ^
  More? -DSWIG_EXECUTABLE=C:/Program1/swigwin-3.0.12/swig.exe ^
  More? -DPYTHON_EXECUTABLE=C:/Python3.5/python.exe ^
  More? -DPYTHON_LIBRARIES=C:/Python3.5/libs/python35.lib ^
  More? -Dtensorflow_ENABLE_GPU=ON ^
  More? -DCUDNN_HOME="C:\Program1\cudnn\cuda"
  </code></pre>
  
  <p>and get the output</p>
  
  <pre><code>-- Building for: Visual Studio 14 2015
  -- The C compiler identification is MSVC 19.0.24215.1
  -- The CXX compiler identification is MSVC 19.0.24215.1
  -- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/x86_amd64/cl.exe
  -- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/x86_amd64/cl.exe -- works
  -- Detecting C compiler ABI info
  -- Detecting C compiler ABI info - done
  -- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/x86_amd64/cl.exe
  -- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/x86_amd64/cl.exe -- works
  -- Detecting CXX compiler ABI info
  -- Detecting CXX compiler ABI info - done
  -- Detecting CXX compile features
  -- Detecting CXX compile features - done
  -- Performing Test COMPILER_OPT_ARCH_NATIVE_SUPPORTED
  -- Performing Test COMPILER_OPT_ARCH_NATIVE_SUPPORTED - Failed
  -- Found CUDA: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v8.0 (found suitable version "8.0", minimum required is "8.0")
  -- Found PythonInterp: C:/Python3.5/python.exe (found version "3.5")
  -- Found PythonLibs: C:/Python3.5/libs/python35.lib (found version "3.5.0")
  -- Found SWIG: C:/Program1/swigwin-3.0.12/swig.exe (found version "3.0.12")
  -- Configuring done
  -- Generating done
  -- Build files have been written to: C:/work/tensorflow/tensorflow/contrib/cmake/build
  </code></pre>
  
  <p>The only troubling line here is <code>-- Performing Test COMPILER_OPT_ARCH_NATIVE_SUPPORTED - Failed</code>, which I don't really know what it means or whether it's a serious problem. (<em>Is it?</em>)</p>
  
  <p>Second, I run</p>
  
  <pre><code>MSBuild /p:Configuration=Release tf_tutorials_example_trainer.vcxproj
  </code></pre>
  
  <p>and this gives me several errors:</p>
  
  <pre><code>"C:\work\tensorflow\tensorflow\contrib\cmake\build\tf_tutorials_example_trainer.vcxproj" (default target) (1) -&gt;
  "C:\work\tensorflow\tensorflow\contrib\cmake\build\tf_core_gpu_kernels.vcxproj" (default target) (90) -&gt;
  (CustomBuild target) -&gt;
    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]
  
  
  "C:\work\tensorflow\tensorflow\contrib\cmake\build\tf_tutorials_example_trainer.vcxproj" (default target) (1) -&gt;
  "C:\work\tensorflow\tensorflow\contrib\cmake\build\tf_core_kernels.vcxproj" (default target) (91) -&gt;
  (ClCompile target) -&gt;
    c:\work\tensorflow\tensorflow\core\kernels\cuda_solvers.h(24): fatal error C1083: Cannot open include file: 'cuda/include/cusolverDn.h': No such file or directory (compiling source file C:\work\tensorflow\tensorflow\core\kernels\cholesky_op.cc) [C:\work\tensorflow\tensorflow\contrib\cmake\build\tf_core_kernels.vcxproj]
    c:\work\tensorflow\tensorflow\core\kernels\cuda_solvers.h(24): fatal error C1083: Cannot open include file: 'cuda/include/cusolverDn.h': No such file or directory (compiling source file C:\work\tensorflow\tensorflow\core\kernels\cuda_solvers.cc) [C:\work\tensorflow\tensorflow\contrib\cmake\build\tf_core_kernels.vcxproj]
    c:\work\tensorflow\tensorflow\contrib\cmake\build\external\eigen_archive\eigen\src\core\coreevaluators.h(1052): fatal error C1060: compiler is out of heap space (compiling source file C:\work\tensorflow\tensorflow\core\kernels\svd_op_float.cc) [C:\work\tensorflow\tensorflow\contrib\cmake\build\tf_core_kernels.vcxproj]
  
      696 Warning(s)
      4 Error(s)
  </code></pre>
  
  <p>I don't know relative to which folder MSBuild is looking for <code>cuda/include/cusolverDn.h</code>. I don't have any folder called <code>cuda</code> in <code>c:\work\tensorflow\tensorflow\core\kernels</code>, and no file named <code>cusolverDn.h</code> exists anywhere in the <code>tensorflow</code> repository. (I do have the file <code>cusolverDn.h</code> in my CUDA install directory, though.) So,</p>
  
  <p><em>What can I do to make MSBuild find <code>cusolverDn.h</code>? And what can I do to prevent the compiler from running out of heap space?</em></p>
  
  <p>In a previous attempt to run the last command I also received the message</p>
  
  <pre><code>nvcc fatal   : Microsoft Visual Studio configuration file 'vcvars64.bat' could not be found for installation at 'C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/../..'
  </code></pre>
  
  <p>Some recommend <a href="https://github.com/philferriere/dlwin/issues/3" rel="nofollow noreferrer">renaming a folder and a file in that folder</a>. I can't really verify that this works right now since the problem temporarily seems to have disappeared (maybe masked by the "compiler is out of heap space" problem, which I didn't have before...).</p>
  
  <p><em>Is renaming this file and this folder the correct solution?</em></p>