forked from heydavid525/hotbox_third_party
-
Notifications
You must be signed in to change notification settings - Fork 9
/
Makefile
247 lines (178 loc) · 7.02 KB
/
Makefile
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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
THIRD_PARTY := $(shell readlink $(dir $(lastword $(MAKEFILE_LIST))) -f)
THIRD_PARTY_CENTRAL = $(THIRD_PARTY)/central
THIRD_PARTY_SRC = $(THIRD_PARTY)/src
THIRD_PARTY_INCLUDE = $(THIRD_PARTY)/include
THIRD_PARTY_LIB = $(THIRD_PARTY)/lib
THIRD_PARTY_BIN = $(THIRD_PARTY)/bin
all: third_party_all
third_party_minimal: path \
fastapprox \
eigen \
libconfig \
cuckoo \
leveldb \
boost
third_party_core: path \
gflags \
glog \
gperftools \
snappy \
sparsehash \
fastapprox \
yaml-cpp \
eigen \
zeromq
third_party_all: third_party_core \
oprofile \
boost \
libconfig \
cuckoo \
leveldb \
float_compressor
distclean:
rm -rf $(THIRD_PARTY_INCLUDE) $(THIRD_PARTY_LIB) $(THIRD_PARTY_BIN) \
$(THIRD_PARTY_SRC) $(THIRD_PARTY)/share
.PHONY: third_party_core third_party_all distclean
path:
mkdir -p $(THIRD_PARTY_LIB)
mkdir -p $(THIRD_PARTY_INCLUDE)
mkdir -p $(THIRD_PARTY_BIN)
mkdir -p $(THIRD_PARTY_SRC)
# ==================== boost ====================
BOOST_SRC = $(THIRD_PARTY_CENTRAL)/boost_1_58_0.tar.bz2
BOOST_INCLUDE = $(THIRD_PARTY_INCLUDE)/boost
boost: path $(BOOST_INCLUDE)
$(BOOST_INCLUDE): $(BOOST_SRC)
tar jxf $< -C $(THIRD_PARTY_SRC)
cd $(basename $(basename $(THIRD_PARTY_SRC)/$(notdir $<))); \
./bootstrap.sh --with-libraries=system,thread \
--prefix=$(THIRD_PARTY); \
./b2 install
# ===================== cuckoo =====================
CUCKOO_SRC = $(THIRD_PARTY_CENTRAL)/libcuckoo.tar
CUCKOO_INCLUDE = $(THIRD_PARTY_INCLUDE)/libcuckoo
cuckoo: path $(CUCKOO_SRC)
tar xf $(CUCKOO_SRC) -C $(THIRD_PARTY_SRC); \
cp -r $(THIRD_PARTY_SRC)/libcuckoo/libcuckoo $(THIRD_PARTY_INCLUDE)/
$(CUCKOO_INCLUDE): $(CUCKOO_SRC)
tar xf $< -C $(THIRD_PARTY_SRC)
cd $(basename $(basename $(THIRD_PARTY_SRC)/$(notdir $<))); \
autoreconf -fis; \
./configure --prefix=$(THIRD_PARTY); \
make; make install
# ==================== eigen ====================
EIGEN_SRC = $(THIRD_PARTY_CENTRAL)/eigen-3.2.4.tar.bz2
EIGEN_INCLUDE = $(THIRD_PARTY_INCLUDE)/Eigen
eigen: path $(EIGEN_INCLUDE)
$(EIGEN_INCLUDE): $(EIGEN_SRC)
tar jxf $< -C $(THIRD_PARTY_SRC)
cp -r $(THIRD_PARTY_SRC)/eigen-eigen-10219c95fe65/Eigen \
$(THIRD_PARTY_INCLUDE)/
# ==================== fastapprox ===================
FASTAPPROX_SRC = $(THIRD_PARTY_CENTRAL)/fastapprox-0.3.2.tar.gz
FASTAPPROX_INC = $(THIRD_PARTY_INCLUDE)/fastapprox
fastapprox: path $(FASTAPPROX_INC)
$(FASTAPPROX_INC): $(FASTAPPROX_SRC)
tar xzf $< -C $(THIRD_PARTY_SRC)
mkdir $(THIRD_PARTY_INCLUDE)/fastapprox
cp $(basename $(basename $(THIRD_PARTY_SRC)/$(notdir $<)))/src/*.h \
$(THIRD_PARTY_INCLUDE)/fastapprox
# ==================== float_compressor ====================
FC_SRC = $(THIRD_PARTY_CENTRAL)/float16_compressor.hpp
float_compressor: path
cp $(THIRD_PARTY_CENTRAL)/float16_compressor.hpp $(THIRD_PARTY_INCLUDE)/
# ===================== gflags ===================
GFLAGS_SRC = $(THIRD_PARTY_CENTRAL)/gflags-2.0.tar.gz
GFLAGS_LIB = $(THIRD_PARTY_LIB)/libgflags.so
gflags: path $(GFLAGS_LIB)
$(GFLAGS_LIB): $(GFLAGS_SRC)
tar zxf $< -C $(THIRD_PARTY_SRC)
cd $(basename $(basename $(THIRD_PARTY_SRC)/$(notdir $<))); \
./configure --prefix=$(THIRD_PARTY); \
make install
# ===================== glog =====================
GLOG_SRC = $(THIRD_PARTY_CENTRAL)/glog-0.3.3.tar.gz
GLOG_LIB = $(THIRD_PARTY_LIB)/libglog.so
glog: $(GLOG_LIB)
$(GLOG_LIB): $(GLOG_SRC)
tar zxf $< -C $(THIRD_PARTY_SRC)
cd $(basename $(basename $(THIRD_PARTY_SRC)/$(notdir $<))); \
./configure --prefix=$(THIRD_PARTY); \
make install
# ================== gperftools =================
GPERFTOOLS_SRC = $(THIRD_PARTY_CENTRAL)/gperftools-2.4.tar.gz
GPERFTOOLS_LIB = $(THIRD_PARTY_LIB)/libtcmalloc.so
gperftools: path $(GPERFTOOLS_LIB)
$(GPERFTOOLS_LIB): $(GPERFTOOLS_SRC)
tar zxf $< -C $(THIRD_PARTY_SRC)
cd $(basename $(basename $(THIRD_PARTY_SRC)/$(notdir $<))); \
./configure --prefix=$(THIRD_PARTY) --enable-frame-pointers; \
make install
# ==================== leveldb ===================
LEVELDB_SRC = $(THIRD_PARTY_CENTRAL)/leveldb-1.18.tar.gz
LEVELDB_LIB = $(THIRD_PARTY_LIB)/libleveldb.so
leveldb: path $(LEVELDB_LIB)
$(LEVELDB_LIB): $(LEVELDB_SRC)
tar zxf $< -C $(THIRD_PARTY_SRC)
cd $(basename $(basename $(THIRD_PARTY_SRC)/$(notdir $<))); \
LIBRARY_PATH=$(THIRD_PARTY_LIB):${LIBRARY_PATH} \
make; \
cp ./libleveldb.* $(THIRD_PARTY_LIB)/; \
cp -r include/* $(THIRD_PARTY_INCLUDE)/
# ==================== libconfig ===================
LIBCONFIG_SRC = $(THIRD_PARTY_CENTRAL)/libconfig-1.4.9.tar.gz
LIBCONFIG_LIB = $(THIRD_PARTY_LIB)/libconfig++.so
libconfig: path $(LIBCONFIG_LIB)
$(LIBCONFIG_LIB): $(LIBCONFIG_SRC)
tar zxf $< -C $(THIRD_PARTY_SRC)
cd $(basename $(basename $(THIRD_PARTY_SRC)/$(notdir $<))); \
./configure --prefix=$(THIRD_PARTY) --enable-frame-pointers; \
make install
# ==================== yaml-cpp ===================
YAMLCPP_SRC = $(THIRD_PARTY_CENTRAL)/yaml-cpp-0.5.1.tar.gz
YAMLCPP_MK = $(THIRD_PARTY_CENTRAL)/yaml-cpp.mk
YAMLCPP_LIB = $(THIRD_PARTY_LIB)/libyaml-cpp.a
yaml-cpp: boost $(YAMLCPP_LIB)
$(YAMLCPP_LIB): $(YAMLCPP_SRC)
tar zxf $< -C $(THIRD_PARTY_SRC)
cd $(basename $(basename $(THIRD_PARTY_SRC)/$(notdir $<))); \
make -f $(YAMLCPP_MK) BOOST_PREFIX=$(THIRD_PARTY) TARGET=$@; \
cp -r include/* $(THIRD_PARTY_INCLUDE)/
# =================== oprofile ===================
# NOTE: need libpopt-dev binutils-dev
OPROFILE_SRC = $(THIRD_PARTY_CENTRAL)/oprofile-1.0.0.tar.gz
OPROFILE_LIB = $(THIRD_PARTY_LIB)/libprofiler.so
oprofile: path $(OPROFILE_LIB)
$(OPROFILE_LIB): $(OPROFILE_SRC)
tar zxf $< -C $(THIRD_PARTY_SRC)
cd $(basename $(basename $(THIRD_PARTY_SRC)/$(notdir $<))); \
./configure --prefix=$(THIRD_PARTY); \
make install
# ================== sparsehash ==================
SPARSEHASH_SRC = $(THIRD_PARTY_CENTRAL)/sparsehash-2.0.2.tar.gz
SPARSEHASH_INCLUDE = $(THIRD_PARTY_INCLUDE)/sparsehash
sparsehash: path $(SPARSEHASH_INCLUDE)
$(SPARSEHASH_INCLUDE): $(SPARSEHASH_SRC)
tar zxf $< -C $(THIRD_PARTY_SRC)
cd $(basename $(basename $(THIRD_PARTY_SRC)/$(notdir $<))); \
./configure --prefix=$(THIRD_PARTY); \
make install
# ==================== snappy ===================
SNAPPY_SRC = $(THIRD_PARTY_CENTRAL)/snappy-1.1.2.tar.gz
SNAPPY_LIB = $(THIRD_PARTY_LIB)/libsnappy.so
snappy: path $(SNAPPY_LIB)
$(SNAPPY_LIB): $(SNAPPY_SRC)
tar zxf $< -C $(THIRD_PARTY_SRC)
cd $(basename $(basename $(THIRD_PARTY_SRC)/$(notdir $<))); \
./configure --prefix=$(THIRD_PARTY); \
make install
# ==================== zeromq ====================
ZMQ_SRC = $(THIRD_PARTY_CENTRAL)/zeromq-3.2.5.tar.gz
ZMQ_LIB = $(THIRD_PARTY_LIB)/libzmq.so
zeromq: path $(ZMQ_LIB)
$(ZMQ_LIB): $(ZMQ_SRC)
tar zxf $< -C $(THIRD_PARTY_SRC)
cd $(basename $(basename $(THIRD_PARTY_SRC)/$(notdir $<))); \
./configure --prefix=$(THIRD_PARTY); \
make install
cp $(THIRD_PARTY_CENTRAL)/zmq.hpp $(THIRD_PARTY_INCLUDE)