【问题标题】:Bazel doesn't find MSVC 2015 during TensorFlow installationBazel 在 TensorFlow 安装期间找不到 MSVC 2015
【发布时间】:2019-01-12 14:57:33
【问题描述】:


我在 Windows 10 上从源代码构建 Tensorflow 时遇到了这个问题。
问题是 Bazel 找不到 MSVC 2015 Update 3 的路径。
这是输出:

C:\tensorflow>bazel build --config=opt //tensorflow/tools/pip_package:build_pip_package
调试:C:/users/maxim/_bazel_maxim/xv6zejqw/external/bazel_tools/tools/cpp/lib_cc_configure.bzl:115:5:
自动配置警告:未设置“BAZEL_VC”,开始寻找最新安装的 Visual C++。
调试:C:/users/maxim/_bazel_maxim/xv6zejqw/external/bazel_tools/tools/cpp/lib_cc_configure.bzl:115:5:
自动配置警告:寻找 VS%VERSION%COMNTOOLS 环境变量,例如。 VS140COMNTOOLS
调试:C:/users/maxim/_bazel_maxim/xv6zejqw/external/bazel_tools/tools/cpp/lib_cc_configure.bzl:115:5:
自动配置警告:通过注册表寻找 Visual C++
错误:跳过'//tensorflow/tools/pip_package:build_pip_package':加载包'tensorflow/tools/pip_package'时出错:读取扩展文件'cuda/build_defs.bzl'时遇到错误:没有这样的包'@local_config_cuda//cuda' : Traceback (最近一次通话最后一次):
文件“C:/tensorflow/third_party/gpus/cuda_configure.bzl”,第 1447 行 _create_local_cuda_repository(repository_ctx)
_create_local_cuda_repository
中的文件“C:/tensorflow/third_party/gpus/cuda_configure.bzl”,第 1303 行 find_cc(repository_ctx)
文件“C:/tensorflow/third_party/gpus/cuda_configure.bzl”,第 217 行,在 find_cc
_get_msvc_compiler(repository_ctx)
_get_msvc_compiler
中的文件“C:/tensorflow/third_party/gpus/cuda_configure.bzl”,第 153 行 find_msvc_tool(repository_ctx, vc_path, "cl.exe")
文件“C:/users/maxim/_bazel_maxim/xv6zejqw/external/bazel_tools/tools/cpp/windows_cc_configure.bzl”,第 223 行,在 find_msvc_tool
_is_vs_2017(vc_path)
_is_vs_2017 中的文件“C:/users/maxim/_bazel_maxim/xv6zejqw/external/bazel_tools/tools/cpp/windows_cc_configure.bzl”,第 183 行
vc_path.find("2017")
类型“NoneType”没有方法 find(string)
警告:目标模式解析失败。
错误:加载包'tensorflow/tools/pip_package'时出错:读取扩展文件'cuda/build_defs.bzl'时遇到错误:没有这样的包'@local_config_cuda//cuda':回溯(最近一次调用):
文件“C:/tensorflow/third_party/gpus/cuda_configure.bzl”,第 1447 行 _create_local_cuda_repository(repository_ctx)
_create_local_cuda_repository
中的文件“C:/tensorflow/third_party/gpus/cuda_configure.bzl”,第 1303 行 find_cc(repository_ctx)
文件“C:/tensorflow/third_party/gpus/cuda_configure.bzl”,第 217 行,在 find_cc
_get_msvc_compiler(repository_ctx)
_get_msvc_compiler
中的文件“C:/tensorflow/third_party/gpus/cuda_configure.bzl”,第 153 行 find_msvc_tool(repository_ctx, vc_path, "cl.exe")
文件“C:/users/maxim/_bazel_maxim/xv6zejqw/external/bazel_tools/tools/cpp/windows_cc_configure.bzl”,第 223 行,在 find_msvc_tool
_is_vs_2017(vc_path)
_is_vs_2017 中的文件“C:/users/maxim/_bazel_maxim/xv6zejqw/external/bazel_tools/tools/cpp/windows_cc_configure.bzl”,第 183 行
vc_path.find("2017")
类型“NoneType”没有方法 find(string)
信息:经过时间:1,361 秒
信息:0 个进程。
失败:构建未成功完成(已加载 0 个包)
当前加载:tensorflow/tools/pip_package

最后一次测试是使用 Bazel 0.15.0,但我也尝试了 0.21.0、0.20.0、0.18.0 版本。

有什么我可以做的吗?
谢谢。

【问题讨论】:

    标签: python tensorflow bazel


    【解决方案1】:

    尝试显式设置BAZEL_VC 或BAZEL_VS 环境变量。

    有关差异的示例和说明,请参见此页面:https://docs.bazel.build/versions/0.21.0/install-compile-source.html#bootstrap-windows-bootstrap

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-10-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-04-12
      相关资源
      最近更新 更多