Building instructions for MAC OS X (MacPorts)
[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 There is a bootstrap script if you use Homebrew (http://brew.sh/). At the time
73 of writing (OS X Yosemite 10.10.1) the default compiler (clang) has some
74 issues building, but gcc 4.9.2 from Homebrew works fine. (This is taken care
75 of by the bootstrap script.)
76
77 ```
78   cd folly
79   ./bootstrap-osx-homebrew.sh
80   make
81   make check
82 ```
83
84 OS X (MacPorts)
85 ----
86 Install the required packages from MacPorts:
87
88 ```
89   sudo port install \
90     autoconf \
91     automake \
92     boost \
93     gflags \
94     git \
95     google-glog \
96     libevent \
97     libtool \
98     lz4 \
99     lzma \
100     scons \
101     snappy \
102     zlib
103 ```
104
105 Download and install double-conversion:
106
107 ```
108   git clone https://github.com/google/double-conversion.git
109   cd double-conversion
110   cmake -DBUILD_SHARED_LIBS=ON .
111   make
112   sudo make install
113 ```
114
115 Download and install folly with the parameters listed below:
116
117 ```
118   git clone https://github.com/facebook/folly.git
119   cd folly/folly
120   autoreconf -ivf
121   ./configure CPPFLAGS="-I/opt/local/include" LDFLAGS="-L/opt/local/lib"
122   make
123   sudo make install
124 ```
125
126 Other Linux distributions
127 -------------------------
128
129 - double-conversion (https://github.com/google/double-conversion)
130
131   Download and build double-conversion.
132   You may need to tell configure where to find it.
133
134   [double-conversion/] `ln -s src double-conversion`
135
136   [folly/] `./configure LDFLAGS=-L$DOUBLE_CONVERSION_HOME/ CPPFLAGS=-I$DOUBLE_CONVERSION_HOME/`
137
138   [folly/] `LD_LIBRARY_PATH=$DOUBLE_CONVERSION_HOME/ make`
139
140 - additional platform specific dependencies:
141
142   Fedora 17 64-bit
143     - gcc
144     - gcc-c++
145     - autoconf
146     - autoconf-archive
147     - automake
148     - boost-devel
149     - libtool
150     - lz4-devel
151     - lzma-devel
152     - snappy-devel
153     - zlib-devel
154     - glog-devel
155     - gflags-devel
156     - scons (for double-conversion)