forked from facebook/wdt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
BUILD.txt
108 lines (82 loc) · 3.07 KB
/
BUILD.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
WDT opensource build uses CMake 3.2.x or later
This should build in a variety of environments (if it doesn't please open
and issue or even better, contribute a patch)
See also README.md Dependencies section
(Inside facebook see https://our.intern.facebook.com/intern/wiki/WDT/OpenSource)
Notes:
On Ubuntu 14.04 - to get g++ 4.9
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get upgrade
If using a vmware image/starting fresh
sudo vmware-config-tools.pl # to setup shared folders
# Cmake 3.2 or later
See below for mac (Cmake 3.3/head on a mac is recommended for Xcode support)
wget http://www.cmake.org/files/v3.2/cmake-3.2.3.tar.gz
tar xvfz cmake-3.2.3.tar.gz
cd cmake-3.2.3
./bootstrap --prefix=/usr --parallel=16 && make -j && sudo make install
# Get folly
mkdir deps/; cd deps
git clone https://github.com/facebook/folly.git
# Getting pre built dependencies: glog-dev (which adds gflags, libunwind)
# boost system, double conversion
sudo apt-get install libgoogle-glog-dev libboost-system-dev \
libdouble-conversion-dev # and optionally: libjemalloc-dev
# OR
# If double-conversion isn't available:
git clone https://github.com/floitsch/double-conversion.git
cd double-conversion; cmake . ; make -j && sudo make install
# Get and install gflags and glog - it's important to build and configure
# gflags correctly for glog to pick it up and avoid linking errors later
# or getting a wdt without flags working
git clone https://github.com/schuhschuh/gflags.git
mkdir gflags/build
cd gflags/build
cmake -D GFLAGS_NAMESPACE=google -D BUILD_SHARED_LIBS=on ..
make -j && sudo make install
# Glog
svn checkout http://google-glog.googlecode.com/svn/trunk/ glog
cd glog
./configure && make -j && sudo make install
# And finally Build wdt itself:
cmake pathtowdtsrcdir -DBUILD_TESTING=on # skip -D... if you don't want tests
make -j
make test
sudo make install
# Macos
Install Xcode 6 and the command line tools (so
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++
exists)
## cmake
# Until 3.3 is out we need the latest on a Mac to
# get CXX 11 support: ( http://www.cmake.org/Bug/view.php?id=15355 )
git clone http://cmake.org/cmake.git
cd cmake
./bootstrap --prefix=/usr --parallel=16
make -j && sudo make install
## Get homebrew at http://brew.sh/
### Glog and gflags and boost
brew update
brew install glog gflags boost
## Double conversion
git clone https://github.com/floitsch/double-conversion.git
cd double-conversion; cmake . ; make -j && sudo make install
### Get folly source tree
As above
## finally build wdt itself:
mkdir wdt_mac
cd wdt_mac
# For Xcode:
cmake pathtosrccode -G Xcode -DBUILD_TESTING=on
# Using unix makefiles
cmake pathtosrccode -G "Unix Makefiles" -DBUILD_TESTING=on
make -j
make test
sudo make install
# For Eclipse CDT
cmake ../wdt -G "Eclipse CDT4 - Unix Makefiles" -DBUILD_TESTING=on
# follow instruction to import the project like on
# http://www.cmake.org/Wiki/Eclipse_CDT4_Generator
# Troubleshooting
You may get certificate errors getting gmock and need to permanently
accept the certificate from the commandline