CentOS7 安装bazel

先决条件: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> ...

 

Available commands:

analyze-profile Analyzes build profile data.

aquery Analyzes the given targets and queries the action graph.

build Builds the specified targets.

canonicalize-flags Canonicalizes a list of bazel options.

clean Removes output files and optionally stops the server.

coverage Generates code coverage report for specified test targets.

cquery Loads, analyzes, and queries the specified targets w/ configurations.

dump Dumps the internal state of the bazel server process.

fetch Fetches external repositories that are prerequisites to the targets.

help Prints help for commands, or the index.

info Displays runtime info about the bazel server.

license Prints the license of this software.

mobile-install Installs targets to mobile devices.

print_action Prints the command line args for compiling a file.

query Executes a dependency graph query.

run Runs the specified target.

shutdown Stops the bazel server.

sync Syncs all repositories specifed in the workspace file

test Builds and runs the specified test targets.

version Prints version information for bazel.

 

Getting more help:

bazel help <command>

Prints help and options for <command>.

bazel help startup_options

Options for the JVM hosting bazel.

bazel help target-syntax

Explains the syntax for specifying targets.

bazel help info-keys

Displays a list of keys used by the info command.

此时bazel已经安装成功,可以看到版本.

tensorflow 要求bazel的版本是0.5+

 

注意: bazel 运行需要 openjdk1.8 ,openjdk-devel1.8

 

 

 

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值