bazel 测试过程
google的bazel如日中天,尽管我觉得make已经很好用,但是还是尝试一下,记录之。
首先,从 https://github.com/bazelbuild/bazel/releases 下载对应的bazel 文件,
我下载的版本是:0.5.2
三个文件:
200 MBbazel-0.5.2-installer-linux-x86_64.sh
104 Bytesbazel-0.5.2-installer-linux-x86_64.sh.sha256
543 Bytesbazel-0.5.2-installer-linux-x86_64.sh.sig
安装:
[root@centos7 tensorflow_test]# chmod +x bazel-0.5.2-installer-linux-x86_64.sh
[root@centos7 tensorflow_test]# ./bazel-0.5.2-installer-linux-x86_64.sh
看到如下打印,安装相当快。
Bazel is now installed!
Make sure you have "/usr/local/bin" in your path. You can also activate bash
completion by adding the following line to your ~/.bashrc:
source /usr/local/lib/bazel/bin/bazel-complete.bash
See http://bazel.build/docs/getting-started.html to start a new project!
下一步,参考help文件:
https://docs.bazel.build/versions/master/tutorial/cpp.html
下载examples文件:
[root@centos7 examples-master]# ls
AUTHORS CONTRIBUTING.md CONTRIBUTORS cpp-tutorial java-maven java-tutorial LICENSE.txt README.md rules tutorial
进入路径:
[root@centos7 stage1]# pwd
/home/caq/code/bazelbuild/examples-master/cpp-tutorial/stage1
编译,看起来也不快,与期望值不相符合啊:
[root@centos7 stage1]# bazel build //main:hello-world
WARNING: ignoring http_proxy in environment.
..................................................................................................................
INFO: Found 1 target...
Target //main:hello-world up-to-date:
bazel-bin/main/hello-world
INFO: Elapsed time: 14.059s, Critical Path: 0.84s
执行:
[root@centos7 stage1]# ./bazel-bin/main/hello-world
Hello world
分析依赖图:
bazel query --nohost_deps --noimplicit_deps 'deps(//main:hello-world)' \
--output graph
WARNING: ignoring http_proxy in environment.
digraph mygraph {
node [shape=box];
"//main:hello-world"
"//main:hello-world" -> "//main:hello-world.cc" 这个说明只依赖于.cc文件
"//main:hello-world.cc"
}
好,进一步的,增加依赖,进入starge2
[root@centos7 main]# pwd
/home/caq/code/bazelbuild/examples-master/cpp-tutorial/stage2/main
[root@centos7 main]# bazel build //main:hello-world
WARNING: ignoring http_proxy in environment.
..................................................................................................................
INFO: Found 1 target...
Target //main:hello-world up-to-date:
bazel-bin/main/hello-world
INFO: Elapsed time: 13.470s, Critical Path: 0.35s
执行bin文件测试:
[root@centos7 stage2]# ./bazel-bin/main/hello-world
Thu Jul 27 19:49:41 2017
发现源文件少了一行代码,补上之后结果:
[root@centos7 stage2]# bazel-bin/main/hello-world
Hello world
Thu Jul 27 19:56:21 2017
[root@centos7 stage2]# bazel-bin/main/hello-world hahaha
Hello hahaha
Thu Jul 27 19:56:25 2017
[root@centos7 stage2]# bazel-bin/main/hello-world caq
Hello caq
Thu Jul 27 19:56:29 2017
那么,多个依赖怎么写?
[root@centos7 stage3]# pwd
/home/caq/code/bazelbuild/examples-master/cpp-tutorial/stage3
[root@centos7 stage3]# bazel build //main:hello-world
WARNING: ignoring http_proxy in environment.
..................................................................................................................
INFO: Found 1 target...
Target //main:hello-world up-to-date:
bazel-bin/main/hello-world
INFO: Elapsed time: 13.557s, Critical Path: 0.35s
[root@centos7 stage3]# bazel-bin/main/hello-world
Hello world
Thu Jul 27 19:59:20 2017
[root@centos7 stage3]# bazel-bin/main/hello-world caq
Hello caq
Thu Jul 27 19:59:23 2017
如果有疑问,可以直接从https://docs.bazel.build/versions/master/tutorial/cpp.html找到答案。
完毕。
bazel 测试过程的更多相关文章
- Google软件构建工具Bazel FAQ
Google软件构建工具Bazel FAQ 本文是我的翻译,原文在这里.欢迎转载,转载请注名本文作者和原始链接 注:如果想了解Bazel的原理,可以看看我之前翻译的Google Blaze原理及使用方 ...
- Google软件构建工具Bazel
转载Google软件构建工具Bazel FAQ 本文是我的翻译,原文在这里.欢迎转载,转载请注名本文作者和原始链接注:如果想了解Bazel的原理,可以看看我之前翻译的Google Blaze原理及使用 ...
- Google软件构建工具Bazel原理及使用方法介绍
近期,Google开源了强大的自动化构建工具Bazel. 正好博主近期在使用china版的Bazel--腾讯自主开发的Blade,所以准备跟大家分享一下Google Bazel这个分布式构建系统的原理 ...
- Qt for Android开发环境搭建及测试过程记录
最近学习了Qt的QML编程技术,感觉相较于以前的QtGUI来说更方便一些,使用QML可以将界面与业务逻辑解耦,便于开发. QML支持跨平台,包括支持Android平台,因此可以使用Qt的QML进行An ...
- Redhat环境下编译安装Google Bazel
Redhat环境下编译安装bazel 作者:Jack47 目前Google Bazel没有提供各个操作系统下的二进制安装包,只提供源代码,需要我们自己编译安装,详情可以见我翻译的中文版Google B ...
- 为什么google bazel构建工具流行不起来
作者Jack47 转载请保留作者和原文出处 之前博主写了系列文章Google软件构建工具Bazel原理及使用方法介绍.最近使用了一段时间后,觉得这个东西不是一种通用的构建工具,很难对接到情况复杂的大的 ...
- 【dom4j xml】使用dom4j处理XML文件--测试过程遇到的问题
首先 关于dom4j的API,有如下: 当然 其中的实体引用有以下: 测试使用环境: 使用Maven搭建web环境,pom.xml文件配置如下: <project xmlns="ht ...
- Google Tensorflow 源码编译(二):Bazel<v0.1.0>
这几天终于把tensorflow安装上了,中间遇到过不少的问题,这里记录下来.供大家想源码安装的参考. 安装环境:POWER8处理器,Docker容器Ubuntu14.04镜像. Build Baze ...
- 针对APP的测试过程和重点关注内容,做以下梳理和总结
转载自金阳光测试:http://blog.sina.com.cn/s/blog_12df1b9e60102vy57.html 1. 首先是测试资源确认及准备 (1)产品需求文档.产品原型图.接口说 ...
随机推荐
- re 学习随便
. 任意一个字符 \转义字符 * 字符重复0--多次 + 字符重复1-多次 ? 字符重复0-1次 ^行首匹配 或者在一个字符集中表示取反 \$ 匹配字符串末尾 \b 匹配\w 与\w 之间的 \B ...
- selenium+python浏览器窗口的切换
1.首先需要知道当前浏览器中有多少个活动的窗口 >>> br.window_handles[u'{075a54ee-3d10-4c76-b56d-b645259bbd54}', u' ...
- [codeforces631E]Product Sum
E. Product Sum time limit per test: 1 second memory limit per test: 256 megabytes input:standard inp ...
- 如何解决wamp中数据库读取数据是???的情况?
数据库中数据正常,但是从数据库读取出的数据在网页中显示时是???,该怎么办呢? 左键点击托盘区的WampServer图标,选择Mysql--my.ini,就会打开配置文件 1.在[client]段落增 ...
- 【开源】做了一个WinForm窗体的投影组件,能够为窗口添加影子效果
最近手头上的项目终于忙得差不多了,想起好久没有更新了的NanUI,再看着每天QQ群未读消息闪烁的标志,突然才发现似乎愧对了群里各位喜爱NanUI的朋友们.于是乎,就想趁这几天有时间,好好的修复一下Na ...
- 基于jQuery封装的分页组件
前言: 由于项目需要实现分页效果,上jQuery插件库找了下,但是木有找到自己想要的效果,于是自己封装了个分页组件. 思路: 主要是初始化时基于原型建立的分页模板然后绑定动态事件并实现刷新DOM的分页 ...
- ASP.NET初始化流程分析2
上一篇讲了从创建应用程序域到创建ISAPIRuntime实例的过程,本篇继续讲Asp.net处理第一次请求的必要的初始化过程. ISAPIRuntime分析 ISAPIRuntime在System.W ...
- 【LeetCode】190. Reverse Bits
题目: Reverse bits of a given 32 bits unsigned integer. For example, given input 43261596 (represented ...
- 如何利用php+android+新浪sae服务器做一个app下载应用
功能简介:提供一个app下载的平台,类似于appstore,上面有很多app可供下载 实现基本思路:利用android,在手机桌面建立一个图标,点击该图标不是打开app应用,而是跳转到一个web页面, ...
- workday3~4
这两天算是把一个模块的功能做完了,功能是数据统计,即按输入的时间统计X小时各个服务器status的数量以及各个服务器的信息,学到了不少东西,为了避免忘记,先记录,有空再整理一下. 1.时间戳的问题 选 ...