tensorflow bazel构建失败 [英] tensorflow bazel building fails
问题描述
构建tf
(遵循此)
./configure && bazel build --config=opt //tensorflow/tools/pip_package:build_pip_package
失败:
root@commandor:/opt/tf/sc/tensorflow# bazel build --cxxopt="-D_GLIBCXX_USE_CXX11_ABI=0" --config=opt //tensorflow/tools/pip_package:build_pip_package
WARNING: /home/ertosns/.cache/bazel/_bazel_root/502c46fd2b7f9ff136e0381cc7e075fe/external/protobuf_archive/WORKSPACE:1: Workspace name in /home/ertosns/.cache/bazel/_bazel_root/502c46fd2b7f9ff136e0381cc7e075fe/external/protobuf_archive/WORKSPACE (@com_google_protobuf) does not match the name given in the repository's definition (@protobuf_archive); this will cause a build error in future versions
ERROR: /home/ertosns/.cache/bazel/_bazel_root/502c46fd2b7f9ff136e0381cc7e075fe/external/jpeg/BUILD:126:12: Illegal ambiguous match on configurable attribute "deps" in @jpeg//:jpeg:
@jpeg//:k8
@jpeg//:armeabi-v7a
Multiple matches are not allowed unless one is unambiguously more specialized.
ERROR: Analysis of target '//tensorflow/tools/pip_package:build_pip_package' failed; build aborted:
/home/ertosns/.cache/bazel/_bazel_root/502c46fd2b7f9ff136e0381cc7e075fe/external/jpeg/BUILD:126:12: Illegal ambiguous match on configurable attribute "deps" in @jpeg//:jpeg:
@jpeg//:k8
@jpeg//:armeabi-v7a
Multiple matches are not allowed unless one is unambiguously more specialized.
INFO: Elapsed time: 10.065s
FAILED: Build did NOT complete successfully (97 packages loaded)
currently loading: tensorflow/contrib/data/kernels ... (3 packages)
不太了解bazel,但根据此需要传递针对jpeg的条件参数,究竟是什么参数,为什么指南中没有提及?
在python 2.7、3.6下构建版本r1.6均会失败,并出现相同的错误.
配置过程:拒绝除jemalloc之外的所有支持.
root@commandor:/opt/tf/sc/tensorflow# ./configure
You have bazel 0.12.0 installed.
Please specify the location of python. [Default is /usr/bin/python]:
Found possible Python library paths:
/usr/local/lib/python2.7/dist-packages
/usr/lib/python2.7/dist-packages
Please input the desired Python library path to use. Default is [/usr/local/lib/python2.7/dist-packages]
Do you wish to build TensorFlow with jemalloc as malloc support? [Y/n]: y
jemalloc as malloc support will be enabled for TensorFlow.
Do you wish to build TensorFlow with Google Cloud Platform support? [Y/n]: n
No Google Cloud Platform support will be enabled for TensorFlow.
Do you wish to build TensorFlow with Hadoop File System support? [Y/n]: n
No Hadoop File System support will be enabled for TensorFlow.
Do you wish to build TensorFlow with Amazon S3 File System support? [Y/n]: n
No Amazon S3 File System support will be enabled for TensorFlow.
Do you wish to build TensorFlow with Apache Kafka Platform support? [y/N]: n
No Apache Kafka Platform support will be enabled for TensorFlow.
Do you wish to build TensorFlow with XLA JIT support? [y/N]: n
No XLA JIT support will be enabled for TensorFlow.
Do you wish to build TensorFlow with GDR support? [y/N]: n
No GDR support will be enabled for TensorFlow.
Do you wish to build TensorFlow with VERBS support? [y/N]: n
No VERBS support will be enabled for TensorFlow.
Do you wish to build TensorFlow with OpenCL SYCL support? [y/N]: n
No OpenCL SYCL support will be enabled for TensorFlow.
Do you wish to build TensorFlow with CUDA support? [y/N]: n
No CUDA support will be enabled for TensorFlow.
Do you wish to build TensorFlow with MPI support? [y/N]: n
No MPI support will be enabled for TensorFlow.
Please specify optimization flags to use during compilation when bazel option "--config=opt" is specified [Default is -march=native]:
Would you like to interactively configure ./WORKSPACE for Android builds? [y/N]: n
Not configuring the WORKSPACE for Android builds.
Preconfigured Bazel build configs. You can use any of the below by adding "--config=<>" to your build command. See tools/bazel.rc for more details.
--config=mkl # Build with MKL support.
--config=monolithic # Config for mostly static monolithic build.
--config=tensorrt # Build with TensorRT support.
Configuration finished
我正在尝试构建源代码,因为在卸载tensorflow并重新安装后,它不起作用!尽管它在以前的版本中可用,但是在ubuntu 17.xx上,当前的ubuntu版本是巧妙的17.10
google小组讨论 >
我之前的问题关于同一主题,但针对不同主题问题.
似乎bazel的0.12版本引起了问题,请尝试将其降级为0.11.
building tf
(following this)
./configure && bazel build --config=opt //tensorflow/tools/pip_package:build_pip_package
fails:
root@commandor:/opt/tf/sc/tensorflow# bazel build --cxxopt="-D_GLIBCXX_USE_CXX11_ABI=0" --config=opt //tensorflow/tools/pip_package:build_pip_package
WARNING: /home/ertosns/.cache/bazel/_bazel_root/502c46fd2b7f9ff136e0381cc7e075fe/external/protobuf_archive/WORKSPACE:1: Workspace name in /home/ertosns/.cache/bazel/_bazel_root/502c46fd2b7f9ff136e0381cc7e075fe/external/protobuf_archive/WORKSPACE (@com_google_protobuf) does not match the name given in the repository's definition (@protobuf_archive); this will cause a build error in future versions
ERROR: /home/ertosns/.cache/bazel/_bazel_root/502c46fd2b7f9ff136e0381cc7e075fe/external/jpeg/BUILD:126:12: Illegal ambiguous match on configurable attribute "deps" in @jpeg//:jpeg:
@jpeg//:k8
@jpeg//:armeabi-v7a
Multiple matches are not allowed unless one is unambiguously more specialized.
ERROR: Analysis of target '//tensorflow/tools/pip_package:build_pip_package' failed; build aborted:
/home/ertosns/.cache/bazel/_bazel_root/502c46fd2b7f9ff136e0381cc7e075fe/external/jpeg/BUILD:126:12: Illegal ambiguous match on configurable attribute "deps" in @jpeg//:jpeg:
@jpeg//:k8
@jpeg//:armeabi-v7a
Multiple matches are not allowed unless one is unambiguously more specialized.
INFO: Elapsed time: 10.065s
FAILED: Build did NOT complete successfully (97 packages loaded)
currently loading: tensorflow/contrib/data/kernels ... (3 packages)
not well acquainted with bazel, but according to this condition argument targeting jpeg need to be passed, what argument exactly, why the guide didn't mention that?
building version r1.6 under python 2.7, 3.6 both fail with the same error.
configuration process: refusing all support except for jemalloc.
root@commandor:/opt/tf/sc/tensorflow# ./configure
You have bazel 0.12.0 installed.
Please specify the location of python. [Default is /usr/bin/python]:
Found possible Python library paths:
/usr/local/lib/python2.7/dist-packages
/usr/lib/python2.7/dist-packages
Please input the desired Python library path to use. Default is [/usr/local/lib/python2.7/dist-packages]
Do you wish to build TensorFlow with jemalloc as malloc support? [Y/n]: y
jemalloc as malloc support will be enabled for TensorFlow.
Do you wish to build TensorFlow with Google Cloud Platform support? [Y/n]: n
No Google Cloud Platform support will be enabled for TensorFlow.
Do you wish to build TensorFlow with Hadoop File System support? [Y/n]: n
No Hadoop File System support will be enabled for TensorFlow.
Do you wish to build TensorFlow with Amazon S3 File System support? [Y/n]: n
No Amazon S3 File System support will be enabled for TensorFlow.
Do you wish to build TensorFlow with Apache Kafka Platform support? [y/N]: n
No Apache Kafka Platform support will be enabled for TensorFlow.
Do you wish to build TensorFlow with XLA JIT support? [y/N]: n
No XLA JIT support will be enabled for TensorFlow.
Do you wish to build TensorFlow with GDR support? [y/N]: n
No GDR support will be enabled for TensorFlow.
Do you wish to build TensorFlow with VERBS support? [y/N]: n
No VERBS support will be enabled for TensorFlow.
Do you wish to build TensorFlow with OpenCL SYCL support? [y/N]: n
No OpenCL SYCL support will be enabled for TensorFlow.
Do you wish to build TensorFlow with CUDA support? [y/N]: n
No CUDA support will be enabled for TensorFlow.
Do you wish to build TensorFlow with MPI support? [y/N]: n
No MPI support will be enabled for TensorFlow.
Please specify optimization flags to use during compilation when bazel option "--config=opt" is specified [Default is -march=native]:
Would you like to interactively configure ./WORKSPACE for Android builds? [y/N]: n
Not configuring the WORKSPACE for Android builds.
Preconfigured Bazel build configs. You can use any of the below by adding "--config=<>" to your build command. See tools/bazel.rc for more details.
--config=mkl # Build with MKL support.
--config=monolithic # Config for mostly static monolithic build.
--config=tensorrt # Build with TensorRT support.
Configuration finished
I'm trying to build the source, because after uninstalling tensorflow, and reinstalling it, it didn't work! although it was working in previous version, on ubuntu 17.xx, current ubuntu version is 17.10 artful
google groups discussion
my previous question on the same subject, but for different problem.
It seems that the 0.12 version of bazel cause the problem, try to downgrade it to 0.11.
这篇关于tensorflow bazel构建失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!