代码改变世界

facebook folly编译脚本

2012-06-23 22:19  zhenjing  阅读(4197)  评论(1编辑  收藏  举报

folly in github https://github.com/facebook/folly
autoconf,autmake使用详解 http://www.laruence.com/2009/11/18/1154.html

folly库中的README有关于库依赖第三方库的详细说明,其中double-conversion需要特殊编译。

  Ubuntu 12.04 64-bit
    - g++
    - automake
    - autoconf
    - autoconf-archive
    - libtool
    - libboost1.46-all-dev
    - libgoogle-glog-dev
        This package has been removed from 12.04 -- use the one from 11.10
    - gflags (packages need to be downloaded from below)
        http://gflags.googlecode.com/files/libgflags-dev_2.0-1_amd64.deb
        http://gflags.googlecode.com/files/libgflags0_2.0-1_amd64.deb
    - scons (for double-conversion)

1) 安装工具和库,直接大多可以直接从Ubuntu软件包从安装。比如:sudo apt-get install libboost1.46-all-dev; sudo apt-get install scons。

2)编译double-conversion。所有工具均安装后,需要先编译double-conversion。

3)编译和安装folly:写了个脚本直接在folly目录下运行脚本即可。

#!/bin/sh

if [ $# != 1 ]
then
    echo "Usage: $0 double-conversion_path"
    exit●
fi

DOUBLE_CONV_DIR=$1
echo "double-conversion_path: $DOUBLE_CONV_DIR"

aclocal
autoreconf      # must use autoreconf. autoconf has some problem!
automake --force-missing --add-missing

LDFLAGS="-L$DOUBLE_CONV_DIR" CPPFLAGS="-I$DOUBLE_CONV_DIR/src " ./configure --
enable-static --disable-shared

make
make install

自己在编译过程中,碰到的最大问题就是autoconf和automake不熟,碰到了些问题,感谢dirlt的文章:编译folly

希望后来者编译顺利,少花些时间。

注:Ubuntu的版本:11.10; gcc version 4.6.1 (Ubuntu/Linaro 4.6.1-9ubuntu3)