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)产品需求文档.产品原型图.接口说 ...
随机推荐
- Spring 4学习——问题与注意事项(一)
1.Spring项目依赖的jar包有5个: 2.applicationContext.xml文件中,如下bean的property的name值对应的是HelloWorld类中的setter方法,即na ...
- 简单介绍phpcms以及phpcms如何安装?
一.先大体介绍一下phpcms,及存放位置 1.将phpcms放在www目录下的phpcms,并解压 其中,readme 没什么用,重要的是install_package; 2.打开install_p ...
- 通过bin-log对mysql进行数据恢复
mysqlbinlog --database=数据库名 --start-date="2017-06-01 5:00:00" --stop-date="2017-06-1 ...
- CSS的小三角
上三角▲ width: 0; height: 0; line-height: 0; font-size: 0; border-width: 10px; border-style: solid; bor ...
- IT学习网站
网站 网站定位 http://www.51cto.com/ 中国领先的IT技术网站. http://www.iteye.com/ 内容齐全,功能丰富的中文IT技术门户和社区网站. http://www ...
- 深入理解YYCache
前言 本篇文章将带来YYCache的解读,YYCache支持内存和本地两种方式的数据存储.我们先抛出两个问题: YYCache是如何把数据写入内存之中的?又是如何实现的高效读取? YYCache采用了 ...
- thinkphp中try catch的运用
public function doedit_set(){ $info=$this->_post("info"); $id=$this->_post("id& ...
- 解决发http get请求的时候不成功,出现android.os.NetworkOnMainThreadException的异常
问题描述:在接游戏sdk的时候,由于游戏要求购买的时候是在主线程里面进行的,但是发http请求是不能在主线程里面发,否则就会出现android.os.NetworkOnMainThreadExcept ...
- 读书笔记-Software Testing(By Ron Patton)
Software Testing Part I:The Big Picture 1.Software Testing Background Bug's formal definition 1.The ...
- javascript闭包的妙用——实现函数的重载
最近在看John Resig 与 Bear Bibeault的<JavaScript 忍者秘籍>.这本书处处提现了js的魔法(从我这个写强类型语言的人看来).js能够点石成金,处处体现着它 ...