-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathGNUmakefile.defns
379 lines (289 loc) · 9.86 KB
/
GNUmakefile.defns
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
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
OS_TYPE := $(shell uname)
# Allow for this file to be included and for them to override what
# BASE_DIR is (relative to their project)
ifndef BASE_DIR
BASE_DIR := $(CURDIR)
endif
###############################################################################
# The following options are the default compilation flags.
###############################################################################
# debugging or normal compiling and linking
USE_GCC := 1
USE_GCC_VERBOSE := 0
USE_GCC_DEBUG := 0
# use intel c/c++ compile
USE_INTEL_C := 0
# Prepare the binary for profiling
USE_PREPARE_PROFILING := 0
# profiling using gprof
USE_GPROF := 0
# if use print for debug
USE_PDEBUG := 0
# use the system memory management
USE_PURIFY := 0
# special compression for index file
# better enabled by defualt
USE_SPECIAL_COMPRESSION := 1
# parallel compiling and linking
USE_PARALLEL_INDEXING := 1
# Please use either system or built-in libs, not both
#
# use system libz and libbz2 libraries
USE_SYSTEM_ZLIB := 0
USE_SYSTEM_BZLIB := 0
# use ant's built-in libz and libbz2 libraries
USE_BUILT_IN_ZLIB := 1
USE_BUILT_IN_BZLIB := 1
# use LZO compression lib
# Please use either system or built-in libs, not both
USE_SYSTEM_LZO := 0
USE_BUILT_IN_LZO := 1
# use google's snappy compression library
USE_SNAPPY := 1
# if to add a term_max_impact to the structure
# of the dictionary for each term (This is just
# a temporary flag. In future, this should be
# added to the structure by default).
USE_TERM_LOCAL_MAX_IMPACT := 0
# print stats without converting millisecond to second, minute, hour
# for profiling purpose
USE_PRINT_TIME_NO_CONVERSION := 0
# construct impact headers for easy handling the quantums of the postings (version 0.4 of the index)
USE_IMPACT_HEADER := 1
# place the external document ID (its "filename") in the index and build and index on that for fast access (version 0.5 of the index)
USE_FILENAME_INDEX := 1
# print extra info for quantum-at-a-time and term-at-a-time
USE_PRINT_QUANTUM_STATS := 0
# partial decompression of postings list
USE_PARTIAL_DCOMPRESSION := 1
# represent the static array in two dimensions, reduce accumulators
# initialisation time
USE_TWO_D_ACCUMULATORS := 1
USE_TWO_D_ACCUMULATORS_POW2_WIDTH := 1
# use mysql database backend
USE_MYSQL := 0
# use Paice Husk Stemmer
USE_STEM_PAICE_HUSK := 1
# use snowball stemmers
USE_SNOWBALL := 1
# what type to use for the accumulators
override MINUS_D += -DANT_ACCUMULATOR_T="short"
override MINUS_D += -DANT_PREGEN_T="unsigned long long"
override MINUS_D += -DDOUBLE_HASH
ifeq ($(USE_GCC_DEBUG), 1)
override MINUS_D += -DDEBUG
endif
ifeq ($(USE_PURIFY), 1)
override MINUS_D += -DPURIFY
endif
rb := -1
HASHER := LOOKUP3
override MINUS_D += -D${HASHER}=1 -DHASHER=1 -DONE_PARSER -D__STDC_LIMIT_MACROS -DREBALANCE_FACTOR=$(rb)
ifeq ($(USE_FILENAME_INDEX), 1)
override MINUS_D += -DFILENAME_INDEX
endif
ifeq ($(USE_IMPACT_HEADER), 1)
override MINUS_D += -DIMPACT_HEADER
endif
ifeq ($(USE_PRINT_QUANTUM_STATS), 1)
override MINUS_D += -DPRINT_QUANTUM_STATS
endif
ifeq ($(USE_SPECIAL_COMPRESSION), 1)
override MINUS_D += -DSPECIAL_COMPRESSION
endif
ifeq ($(USE_PARALLEL_INDEXING), 1)
override MINUS_D += -DPARALLEL_INDEXING -DPARALLEL_INDEXING_DOCUMENTS
endif
ifeq ($(USE_SYSTEM_ZLIB), 1)
override MINUS_D += -DANT_HAS_ZLIB
endif
ifeq ($(USE_SYSTEM_BZLIB), 1)
override MINUS_D += -DANT_HAS_BZLIB
endif
ifeq ($(USE_BUILT_IN_ZLIB), 1)
override MINUS_D += -DANT_HAS_ZLIB
endif
ifeq ($(USE_BUILT_IN_BZLIB), 1)
override MINUS_D += -DANT_HAS_BZLIB
endif
ifeq ($(USE_SYSTEM_LZO), 1)
override MINUS_D += -DANT_HAS_LZO
endif
ifeq ($(USE_BUILT_IN_LZO), 1)
override MINUS_D += -DANT_HAS_LZO
endif
ifeq ($(USE_TERM_LOCAL_MAX_IMPACT), 1)
override MINUS_D += -DTERM_LOCAL_MAX_IMPACT
endif
ifeq ($(USE_PDEBUG), 1)
override MINUS_D += -DPDEBUG
endif
ifeq ($(USE_PRINT_TIME_NO_CONVERSION), 1)
override MINUS_D += -DPRINT_TIME_NO_CONVERSION
endif
ifeq ($(USE_PARTIAL_DCOMPRESSION), 1)
override MINUS_D += -DTOP_K_READ_AND_DECOMPRESSOR
endif
ifeq ($(USE_TWO_D_ACCUMULATORS), 1)
override MINUS_D += -DTWO_D_ACCUMULATORS
endif
ifeq ($(USE_TWO_D_ACCUMULATORS_POW2_WIDTH), 1)
ifeq ($(USE_TWO_D_ACCUMULATORS), 0)
# The next line has to be spaces indented, not tabs. (something funny with GNU make)
$(error TWO_D_ACCUMULATORS_POW2_WIDTH requries TWO_D_ACCUMULATORS to be enabled)
endif
override MINUS_D += -DTWO_D_ACCUMULATORS_POW2_WIDTH
endif
ifeq ($(USE_MYSQL), 1)
override MINUS_D += -DANT_HAS_MYSQL $(shell mysql_config --cflags)
endif
ifeq ($(USE_SNAPPY), 1)
override MINUS_D += -DANT_HAS_SNAPPYLIB
endif
ifeq ($(USE_SNOWBALL), 1)
override MINUS_D += -DANT_HAS_SNOWBALL
endif
ifeq ($(USE_STEM_PAICE_HUSK), 1)
override CFLAGS += -DANT_HAS_PAICE_HUSK
endif
###############################################################################
# Please use above options to enable corresponding flags
###############################################################################
ifeq ($(USE_GCC), 1)
CC = @g++
PUT_FILENAME = @echo $<
ifeq ($(USE_GCC_VERBOSE), 1)
CC = g++
#CC = /opt/local/bin/g++-mp-4.4
PUT_FILENAME =
endif
endif
ifeq ($(USE_INTEL_C), 1)
CC = icpc
endif
ZLIB_DIR := $(BASE_DIR)/external/unencumbered/zlib
ZLIB_VERSION := zlib-1.2.5
BZIP_DIR := $(BASE_DIR)/external/unencumbered/bzip
BZIP_VERSION := bzip2-1.0.6
SNAPPY_DIR := $(BASE_DIR)/external/unencumbered/snappy
SNAPPY_VERSION := snappy-1.0.4
LZO_DIR := $(BASE_DIR)/external/gpl/lzo
LZO_VERSION := lzo-2.06
SNOWBALL_DIR := $(BASE_DIR)/external/unencumbered/snowball
SNOWBALL_VERSION := libstemmer_c
ifeq ($(USE_GCC_DEBUG), 1)
LDFLAGS += -g -ggdb
override CFLAGS += -g -ggdb
ifeq ($(OS_TYPE), Darwin)
LDFLAGS += -gdwarf-2
override CFLAGS += -gdwarf-2
endif
else
#LDFLAGS +=
override CFLAGS += -O3 -fno-tree-vectorize
endif
ifeq ($(USE_PREPARE_PROFILING), 1)
LDFLAGS += -g
override CFLAGS += -g -O2
endif
ifeq ($(USE_GPROF), 1)
LDFLAGS += -pg
override CFLAGS += -pg
endif
ifeq ($(OS_TYPE), SUNOS)
LDFLAGS += -lsocket -lnsl
endif
# common flags
LDFLAGS += -ldl
override CFLAGS += -x c++ -Wall \
-Wno-missing-braces -Wno-unknown-pragmas -Wno-write-strings \
-Wno-sign-compare -Wno-parentheses
# link the pthread library even if the parallel indexing is not enabled
ifeq ($(OS_TYPE), SUNOS)
LDFLAGS += -lpthread
else
LDFLAGS += -pthread
endif
ifeq ($(USE_SYSTEM_ZLIB), 1)
LDFLAGS += -lz
endif
ifeq ($(USE_SYSTEM_BZLIB), 1)
# use system libbz2 library
LDFLAGS += -lbz2
endif
ifeq ($(USE_BUILT_IN_ZLIB), 1)
override CFLAGS += -I $(ZLIB_DIR)/$(ZLIB_VERSION)
EXTRA_OBJS += $(ZLIB_DIR)/libz.a
endif
ifeq ($(USE_BUILT_IN_BZLIB), 1)
override CFLAGS += -I $(BZIP_DIR)/$(BZIP_VERSION)
EXTRA_OBJS += $(BZIP_DIR)/libbz2.a
endif
ifeq ($(USE_SYSTEM_LZO), 1)
override CFLAGS += -I /usr/include/lzo
LDFLAGS += -llzo2
endif
ifeq ($(USE_BUILT_IN_LZO), 1)
override CFLAGS += -I $(LZO_DIR)/$(LZO_VERSION)/include/lzo -I $(LZO_DIR)/$(LZO_VERSION)/include
EXTRA_OBJS += $(LZO_DIR)/liblzo2.a
endif
ifeq ($(USE_MYSQL), 1)
LDFLAGS += $(shell mysql_config --libs)
endif
ifeq ($(USE_SNAPPY), 1)
override CFLAGS += -I $(SNAPPY_DIR)/$(SNAPPY_VERSION)
EXTRA_OBJS += $(SNAPPY_DIR)/libsnappy.a
endif
ifeq ($(USE_SNOWBALL), 1)
override CFLAGS += -I $(SNOWBALL_DIR)/$(SNOWBALL_VERSION)/include
EXTRA_OBJS += $(SNOWBALL_DIR)/libstemmer.a
endif
###############################################################################
# source files and compile commands
###############################################################################
ATIRE_DIR = $(BASE_DIR)/atire
SRC_DIR = $(BASE_DIR)/source
OBJ_DIR = $(BASE_DIR)/obj
BIN_DIR = $(BASE_DIR)/bin
LIB_DIR = $(BASE_DIR)/lib
TOOLS_DIR = $(BASE_DIR)/tools
TESTS_DIR = $(BASE_DIR)/tests
IGNORE_LIST := $(SRC_DIR)/stem_paice_husk.c
MAIN_FILES := $(ATIRE_DIR)/atire.c \
$(ATIRE_DIR)/index.c \
$(ATIRE_DIR)/atire_client.c \
$(ATIRE_DIR)/atire_broker.c \
$(ATIRE_DIR)/atire_merge.c \
$(ATIRE_DIR)/atire_reorder.c \
$(ATIRE_DIR)/atire_doclist.c \
$(ATIRE_DIR)/atire_dictionary.c
ALL_SOURCES := $(shell ls $(ATIRE_DIR)/*.c $(SRC_DIR)/*.c)
SOURCES := $(filter-out $(MAIN_FILES) $(IGNORE_LIST), $(ALL_SOURCES))
ifeq ($(USE_STEM_PAICE_HUSK), 1)
SOURCES += $(SRC_DIR)/stem_paice_husk.c
endif
SOURCES_OBJECTS := $(addprefix $(OBJ_DIR)/, $(subst .c,.o, $(notdir $(SOURCES))))
INDEX_SOURCES := index.c $(notdir $(SOURCES))
INDEX_OBJECTS := $(addprefix $(OBJ_DIR)/, $(subst .c,.o, $(INDEX_SOURCES)))
ATIRE_DICT_SOURCES := atire_dictionary.c $(notdir $(SOURCES))
ATIRE_DICT_OBJECTS := $(addprefix $(OBJ_DIR)/, $(subst .c,.o, $(ATIRE_DICT_SOURCES)))
ATIRE_CLIENT_SOURCES := atire_client.c $(notdir $(SOURCES))
ATIRE_CLIENT_OBJECTS := $(addprefix $(OBJ_DIR)/, $(subst .c,.o, $(ATIRE_CLIENT_SOURCES)))
ATIRE_SOURCES := atire.c $(notdir $(SOURCES))
ATIRE_OBJECTS := $(addprefix $(OBJ_DIR)/, $(subst .c,.o, $(ATIRE_SOURCES)))
ATIRE_MERGE_SOURCES := atire_merge.c $(notdir $(SOURCES))
ATIRE_MERGE_OBJECTS := $(addprefix $(OBJ_DIR)/, $(subst .c,.o, $(ATIRE_MERGE_SOURCES)))
ATIRE_REORDER_SOURCES := atire_reorder.c $(notdir $(SOURCES))
ATIRE_REORDER_OBJECTS := $(addprefix $(OBJ_DIR)/, $(subst .c,.o, $(ATIRE_REORDER_SOURCES)))
ATIRE_BROKER_SOURCES := atire_broker.c $(notdir $(SOURCES))
ATIRE_BROKER_OBJECTS := $(addprefix $(OBJ_DIR)/, $(subst .c,.o, $(ATIRE_BROKER_SOURCES)))
ATIRE_DOCLIST_SOURCES := atire_doclist.c $(notdir $(SOURCES))
ATIRE_DOCLIST_OBJECTS := $(addprefix $(OBJ_DIR)/, $(subst .c,.o, $(ATIRE_DOCLIST_SOURCES)))
TOOLS_IGNORES := $(TOOLS_DIR)/mysql_xml_dump.c
TOOLS_SOURCES := $(notdir $(filter-out $(TOOLS_IGNORES), $(shell ls $(TOOLS_DIR)/*.c)))
TOOLS_EXES := $(basename $(TOOLS_SOURCES))
TOOLS_OBJECTS := $(addprefix $(OBJ_DIR)/, $(subst .c,.o, $(TOOLS_SOURCES)))
TESTS_IGNORES :=
TESTS_SOURCES := $(notdir $(filter-out $(TESTS_IGNORES), $(shell ls $(TESTS_DIR)/*.c)))
TESTS_EXES := $(basename $(TESTS_SOURCES))
TESTS_OBJECTS := $(addprefix $(OBJ_DIR)/, $(subst .c,.o, $(TESTS_SOURCES)))