Make advanced init function for test optional
[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 12.04
22 ------------
23
24 This release is old, requiring many upgrades. However, since Travis CI runs
25 on 12.04, `folly/build/deps_ubuntu_12.04.sh` is provided, and upgrades all
26 the required packages.
27
28 Ubuntu 13.10
29 ------------
30
31 The following packages are required (feel free to cut and paste the apt-get
32 command below):
33
34 ```
35 sudo apt-get install \
36     g++ \
37     automake \
38     autoconf \
39     autoconf-archive \
40     libtool \
41     libboost-all-dev \
42     libevent-dev \
43     libdouble-conversion-dev \
44     libgoogle-glog-dev \
45     libgflags-dev \
46     liblz4-dev \
47     liblzma-dev \
48     libsnappy-dev \
49     make \
50     zlib1g-dev \
51     binutils-dev \
52     libjemalloc-dev \
53     libssl-dev 
54 ```
55
56 If advanced dubugging functionality for tests are required
57
58 ```
59 sudo apt-get install \
60     libunwind8-dev \
61     libelf-dev \
62     libdwarf-dev
63 ```
64
65 Ubuntu 14.04 LTS
66 ----------------
67
68 The packages listed above for Ubuntu 13.10 are required, as well as:
69
70 ```
71 sudo apt-get install \
72     libiberty-dev
73 ```
74
75 The above packages are sufficient for Ubuntu 13.10 and Ubuntu 14.04.
76
77 In the folly directory, run
78 ```
79   autoreconf -ivf
80   ./configure
81   make
82   make check
83   sudo make install
84 ```
85
86 OS X (Homebrew)
87 ----
88 folly is available as a Formula and releases may be built via `brew install folly`.
89
90 You may also use `folly/build/bootstrap-osx-homebrew.sh` to build against `master`:
91
92 ```
93   cd folly
94   ./build/bootstrap-osx-homebrew.sh
95   make
96   make check
97 ```
98
99 OS X (MacPorts)
100 ----
101 Install the required packages from MacPorts:
102
103 ```
104   sudo port install \
105     autoconf \
106     automake \
107     boost \
108     gflags \
109     git \
110     google-glog \
111     libevent \
112     libtool \
113     lz4 \
114     lzma \
115     scons \
116     snappy \
117     zlib
118 ```
119
120 Download and install double-conversion:
121
122 ```
123   git clone https://github.com/google/double-conversion.git
124   cd double-conversion
125   cmake -DBUILD_SHARED_LIBS=ON .
126   make
127   sudo make install
128 ```
129
130 Download and install folly with the parameters listed below:
131
132 ```
133   git clone https://github.com/facebook/folly.git
134   cd folly/folly
135   autoreconf -ivf
136   ./configure CPPFLAGS="-I/opt/local/include" LDFLAGS="-L/opt/local/lib"
137   make
138   sudo make install
139 ```
140
141 Other Linux distributions
142 -------------------------
143
144 - double-conversion (https://github.com/google/double-conversion)
145
146   Download and build double-conversion.
147   You may need to tell configure where to find it.
148
149   [double-conversion/] `ln -s src double-conversion`
150
151   [folly/] `./configure LDFLAGS=-L$DOUBLE_CONVERSION_HOME/ CPPFLAGS=-I$DOUBLE_CONVERSION_HOME/`
152
153   [folly/] `LD_LIBRARY_PATH=$DOUBLE_CONVERSION_HOME/ make`
154
155 - additional platform specific dependencies:
156
157   Fedora 21 64-bit
158     - gcc
159     - gcc-c++
160     - autoconf
161     - autoconf-archive
162     - automake
163     - boost-devel
164     - libtool
165     - lz4-devel
166     - lzma-devel
167     - snappy-devel
168     - zlib-devel
169     - glog-devel
170     - gflags-devel
171     - scons
172     - double-conversion-devel
173     - openssl-devel
174     - libevent-devel
175
176   Optional
177     - libdwarf-dev
178     - libelf-dev
179     - libunwind8-dev