bazel

centos7安装bazel

淺唱寂寞╮ 提交于 2020-01-11 20:31:03
先决条件:openjdk1.8 ,openjdk-devel1.8 1. 操作系统需求 centos7 2. 资源库下载 https://docs.bazel.build/versions/master/install-redhat.html 参见以上链接,下载repo文件并复制到 /etc/yum.repos.d/. 3. 安装 yum install bazel 可能会存在镜像连接超时的情况,这时候可以多几次或者尝试科学上网 完成后,bazel是无法识别命令的。此时bazel安装在/usr/bin 下面 在/etc/profile中天剑环境变量: export BAZEL_HOME=/usr/bin export PATH =$PATH:$BAZEL_HOME 注意不要写成,会无法识别 export BAZEL_HOME=/usr/bin/ 然后再次运行 bazel命令: WARNING: --batch mode is deprecated. Please instead explicitly shut down your Bazel server using the command "bazel shutdown". [bazel release 0.19.2- (@non-git)] Usage: bazel <command> <options> ...

vmware workstation12+centos7.2+tensorflow安装

隐身守侯 提交于 2020-01-10 00:08:20
由于之前在虚拟机 centos7安装cuda7失败,虚拟显卡繁琐又效果又不好,打算只在虚拟机用CPU的tensorflow, GPU的在window 7下安装。 这篇博文主要是虚拟机centos7中cpu的tensorflow的使用。 参考官网安装文档 git clone https://github.com/bazelbuild/bazel.git cd bazel git checkout tags/0.1.0 ./compile.sh git clone --recurse-submodules https://github.com/tensorflow/tensorflow cd tensorflow ./configure 提示:Cannot find bazel. Please install bazel 接下来配置路径 export PATH=$PATH:bazel所在绝对路径/output/bazel ./configure Do you wish to build TensorFlow with MPI support?[y/N]:y MPI support will be enabled for Tensorflow. Please specify the MPI toolkit folder.[Default is]: /usr 然后出现如下提示,就退出了

CentOS-6.x系统基于python-3.5安装tensorflow-1.4

久未见 提交于 2020-01-10 00:00:18
简介 tensorflow的安装分cpu版本和gpu版本, 这里只讨论cpu版本。 google提供了很多种安装方式, 主要分三种, 一种是pip安装,非常简单,重要的是它在各个平台都是可以用的,包括windows,但是CentOS6需升级glibc和gcc(CXXABI_)版本 第二种是通过docker安装,也差不多是一键安装,内核版本低于3.10不能安装docker,具体的介绍可以看https://github.com/tensorflow/tensorflow/tree/master/tensorflow/tools/docker 最后一种,就是源码编译安装,最麻烦。 Linux系统官方推荐安装在ubuntu-14及以上 本文采用pip安装 编译安装python3.5(tensorflow要求python版本至少是2.7或者3.3) Linux下默认系统自带python2.6的版本,这个版本被系统很多程序所依赖,所以不建议删除, 如果使用最新的Python3那么我们知道编译安装源码包和系统默认包之间是没有任何影响的,所以可以安装python3和python2共存 1.1 安装编译工具 $ yum install wget gcc automake autoconf libtool make xz 1.2 安装依赖库 $ yum install zlib-devel

How to pass optimization flags to bazel build for tensorflow

可紊 提交于 2020-01-04 17:25:13
问题 I am trying to build TF for android with bazel. I noticed that when I build TF with makefile c++ code is optimized and it almost 2 times faster than the bazel produced library. What can be the reason of this? Here the modified tf_copts() def tf_copts(): return ([ "-Wno-sign-compare", "-fno-exceptions", ] + if_cuda(["-DGOOGLE_CUDA=1"]) + if_android_arm(["-mfpu=neon", "-mfloat-abi=softfp"]) + if_x86(["-msse4.1"]) + select({ "//tensorflow:android": [ "-DNDEBUG", "-std=c++11", "-DTF_LEAN_BINARY",

Tensorflow install from Source (Win7): bazel, python -> No module named 'encodings'

岁酱吖の 提交于 2020-01-04 07:52:10
问题 Goal Use Python-trained (keras) model in c/c++. See section work-around for c-work-around. Compile Tensorflow from source (rev 1.0 or 1.2.1) following the instructions from https://www.tensorflow.org/install/install_windows (tensorflow already is installed via pip in python3, but I need to use it from c++, so installing from source seems mandatory) System win7(64) bazel 0.5.2, python(env) 3.5.2 (64), pip(env) 9.0.1, msys64/msys2_shell.cmd (GNU bash, 4.4.12 (64-pc-msys)) gcc 6.3.0 java SE "1.8

Unable to install bazel on Ubuntu 14.04 using apt-get

喜夏-厌秋 提交于 2020-01-04 07:47:07
问题 I tried following commands but keep getting same error everytime: echo "deb [arch=amd64] http://storage.googleapis.com/bazel-apt stable jdk1.8" | sudo tee /etc/apt/sources.list.d/bazel.list curl https://bazel.build/bazel-release.pub.gpg | sudo apt-key add - sudo apt-get update But the command sudo apt-get install bazel gives same error every time: Reading package lists... Done Building dependency tree Reading state information... Done E: Unable to locate package bazel How would I be able to

tensorflow bazel building fails

泄露秘密 提交于 2020-01-03 21:01:52
问题 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

tensorflow bazel building fails

感情迁移 提交于 2020-01-03 21:01:04
问题 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

How can work on an external dependency and my project at the same time in bazel?

谁都会走 提交于 2020-01-03 18:00:38
问题 My question is about sub projects and working on them together with their dependencies in bazel. I have a c++ project I'm working on. Call it project A. Project A depends on 2 others I'm working on, B and C. Project B also depends on project C. so it looks like this. A -> (B, C) B -> (C) C -> no external dependencies I want to be able to work on these 3 projects in parallel, but I want to keep them independent. I have tried a few ways of setting this up: External dependencies from git in my

Bazel: How do you get the path to a generated file?

放肆的年华 提交于 2020-01-02 05:32:15
问题 In Bazel, given a build target, how would a script (which is running outside of Bazel) get the path to the generated file? Scenario: I'm using Bazel to do the build, and then when it's done, I want to copy the result to a server. I just need to know what files to copy. I could hard-code the list of files, but I would prefer not to do that. A simple example: This Bazel script: genrule( name = "main", srcs = ["main.in"], outs = ["main.out"], cmd = "cp $< $@", ) If you then make a file named