前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >Folly库编译官方说的相关依赖开始编译

Folly库编译官方说的相关依赖开始编译

作者头像
扫帚的影子
发布2018-09-05 17:16:51
3.8K0
发布2018-09-05 17:16:51
举报

官方说的相关依赖

Dependencies folly requires gcc 4.8+ and a version of boost compiled with C++11 support. Please download googletest fromhttps://googletest.googlecode.com/files/gtest-1.7.0.zip and unzip it in thefolly/test subdirectory.

开始编译

获取源码

编译

  1. 进入folly/build, 我去,发现了 build_debs_ubuntu_14.04.sh 我的就是ubuntu啊
  • 立马运行 build_debs_ubuntu_14.04.sh, 我机器上boost1.58, 结果

BOOST_VERSION=1.54.0

  • 懒得改这个脚本了,想方法直接生成configure文件吧
  • 切到folly根目录,执行 autoreconf -if, 嘿!还真成功了
  • ./configure

说我g-flag库没装

  • 直接 sudo apt-get install libgflags-dev 成功!
  • ./configure

说我glog库没装

  • 直接 sudo apt-get install libgflags-log, 没这个包啊,没这个包 :-(
  • git clone https://github.com/google/glog.git
  • 用cmake编译glog成功
  • 切到folly根目录,./configure, 哪尼啊V_V, 结果:

checking for glog viability... no configure: error: "libglog invalid, see config.log for details"

  • 查看config.log,发现是没连接pthread lib, 打开configure文件,在16553行, <pre><code>“LIBS="-lglog $LIBS" => "LIBS="-lglog -lpthread $LIBS"</code></pre>
  • ./configure, 结果:

checking double-conversion/double-conversion.h usability... no checking double-conversion/double-conversion.h presence... no checking for double-conversion/double-conversion.h... no configure: error: Couldn't find double-conversion.h, please download from https://github.com/google/double-conversion

  • git clone https://github.com/google/double-conversion
  • 用cmake来编译double-conversion <pre><code>mkdir build && cd build && cmake ../ && make && sudo make install</code></pre>
  • ./configure, 终于成功了!!!
  • make && sudo make install

总结

  • 编译还好没什么太难的地方,过程有问题直接看config.log里面的信息,基本上就是需要的库没有安装;
  • 大公司间总是惺惺相惜,folly用了google的库。这也验证了folly不是要从头打造一个C++11库,它是std和boost的补充。
本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
原始发表:2016.06.23 ,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 官方说的相关依赖
  • 开始编译
    • 获取源码
      • 编译
        • 总结
        领券
        问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档