e6800cb6e50c04a9053cf22a4a818a17b15ff34b
[folly.git] / README.md
1 Folly: Facebook Open-source Library
2 -----------------------------------
3
4 Folly is an open-source C++ library developed and used at Facebook.
5
6 ###[Get Started](folly/docs/Overview.md)
7
8 Folly is published on Github at https://github.com/facebook/folly; for
9 discussions, there is a Google group at
10 https://groups.google.com/d/forum/facebook-folly.
11
12 Dependencies
13 ------------
14
15 folly requires gcc 4.8+ and a version of boost compiled with C++11 support.
16
17 Please download googletest from
18 https://googletest.googlecode.com/files/gtest-1.7.0.zip and unzip it in the
19 folly/test subdirectory.
20
21 Ubuntu 13.10
22 ------------
23
24 The following packages are required (feel free to cut and paste the apt-get
25 command below):
26
27 ```
28 sudo apt-get install \
29     g++ \
30     automake \
31     autoconf \
32     autoconf-archive \
33     libtool \
34     libboost-all-dev \
35     libevent-dev \
36     libdouble-conversion-dev \
37     libgoogle-glog-dev \
38     libgflags-dev \
39     liblz4-dev \
40     liblzma-dev \
41     libsnappy-dev \
42     make \
43     zlib1g-dev \
44     binutils-dev \
45     libjemalloc-dev \
46     libssl-dev
47 ```
48
49 Ubuntu 14.04 LTS
50 ----------------
51
52 The packages listed above for Ubuntu 13.10 are required, as well as:
53
54 ```
55 sudo apt-get install \
56     libiberty-dev
57 ```
58
59 The above packages are sufficient for Ubuntu 13.10 and Ubuntu 14.04.
60
61 In the folly directory, run
62 ```
63   autoreconf -ivf
64   ./configure
65   make
66   make check
67   sudo make install
68 ```
69
70 OS X (Homebrew)
71 ----
72 folly is available as a Formula and releases may be built via `brew install folly`.
73
74 You may also use `folly/bootstrap-osx-homebrew.sh` to build against `master`:
75
76 ```
77   cd folly
78   ./bootstrap-osx-homebrew.sh
79   make
80   make check
81 ```
82
83 OS X (MacPorts)
84 ----
85 Install the required packages from MacPorts:
86
87 ```
88   sudo port install \
89     autoconf \
90     automake \
91     boost \
92     gflags \
93     git \
94     google-glog \
95     libevent \
96     libtool \
97     lz4 \
98     lzma \
99     scons \
100     snappy \
101     zlib
102 ```
103
104 Download and install double-conversion:
105
106 ```
107   git clone https://github.com/google/double-conversion.git
108   cd double-conversion
109   cmake -DBUILD_SHARED_LIBS=ON .
110   make
111   sudo make install
112 ```
113
114 Download and install folly with the parameters listed below:
115
116 ```
117   git clone https://github.com/facebook/folly.git
118   cd folly/folly
119   autoreconf -ivf
120   ./configure CPPFLAGS="-I/opt/local/include" LDFLAGS="-L/opt/local/lib"
121   make
122   sudo make install
123 ```
124
125 Other Linux distributions
126 -------------------------
127
128 - double-conversion (https://github.com/google/double-conversion)
129
130   Download and build double-conversion.
131   You may need to tell configure where to find it.
132
133   [double-conversion/] `ln -s src double-conversion`
134
135   [folly/] `./configure LDFLAGS=-L$DOUBLE_CONVERSION_HOME/ CPPFLAGS=-I$DOUBLE_CONVERSION_HOME/`
136
137   [folly/] `LD_LIBRARY_PATH=$DOUBLE_CONVERSION_HOME/ make`
138
139 - additional platform specific dependencies:
140
141   Fedora 17 64-bit
142     - gcc
143     - gcc-c++
144     - autoconf
145     - autoconf-archive
146     - automake
147     - boost-devel
148     - libtool
149     - lz4-devel
150     - lzma-devel
151     - snappy-devel
152     - zlib-devel
153     - glog-devel
154     - gflags-devel
155     - scons (for double-conversion)