forked from efficient/rocksdb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
thirdparty.inc
265 lines (215 loc) · 7.83 KB
/
thirdparty.inc
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
# Edit definitions below to specify paths to include files and libraries of all 3rd party libraries
#
# Edit these lines to set defaults for use of external libraries
#
set(USE_GFLAGS_DEFAULT 0) # GFLAGS is disabled by default, enable with -DGFLAGS=1 cmake command line agrument
set(USE_SNAPPY_DEFAULT 0) # SNAPPY is disabled by default, enable with -DSNAPPY=1 cmake command line agrument
set(USE_LZ4_DEFAULT 0) # LZ4 is disabled by default, enable with -DLZ4=1 cmake command line agrument
set(USE_ZLIB_DEFAULT 0) # ZLIB is disabled by default, enable with -DZLIB=1 cmake command line agrument
set(USE_XPRESS_DEFAULT 0) # XPRESS is disabled by default, enable with -DXPRESS=1 cmake command line agrument
set(USE_JEMALLOC_DEFAULT 0) # JEMALLOC is disabled by default, enable with -DJEMALLOC=1 cmake command line agrument
set(USE_JENONINIT_DEFAULT 1) # Default is enabled do not call je_init/je_uninit as the newer versions do not have it disable with -DJENONINIT=0
#
# This example assumes all the libraries locate in directories under THIRDPARTY_HOME environment variable
# Set environment variable THIRDPARTY_HOME to point to your third party libraries home (Unix style dir separators)
# or change the paths below to reflect where the libraries actually reside
#
set (THIRDPARTY_LIBS "") # Initialization, don't touch
#
# Edit these 4 lines to define paths to GFLAGS
#
set(GFLAGS_HOME $ENV{THIRDPARTY_HOME}/Gflags.Library)
set(GFLAGS_INCLUDE ${GFLAGS_HOME}/inc/include)
set(GFLAGS_LIB_DEBUG ${GFLAGS_HOME}/bin/debug/amd64/gflags.lib)
set(GFLAGS_LIB_RELEASE ${GFLAGS_HOME}/bin/retail/amd64/gflags.lib)
# ================================================== GFLAGS ==================================================
#
# Don't touch these lines
#
if (DEFINED GFLAGS)
set(USE_GFLAGS ${GFLAGS})
else ()
set(USE_GFLAGS ${USE_GFLAGS_DEFAULT})
endif ()
if (${USE_GFLAGS} EQUAL 1)
message(STATUS "GFLAGS library is enabled")
if(DEFINED ENV{GFLAGS_INCLUDE})
set(GFLAGS_INCLUDE $ENV{GFLAGS_INCLUDE})
endif()
if(DEFINED ENV{GFLAGS_LIB_DEBUG})
set(GFLAGS_LIB_DEBUG $ENV{GFLAGS_LIB_DEBUG})
endif()
if(DEFINED ENV{GFLAGS_LIB_RELEASE})
set(GFLAGS_LIB_RELEASE $ENV{GFLAGS_LIB_RELEASE})
endif()
set(GFLAGS_CXX_FLAGS -DGFLAGS=gflags)
set(GFLAGS_LIBS debug ${GFLAGS_LIB_DEBUG} optimized ${GFLAGS_LIB_RELEASE})
add_definitions(${GFLAGS_CXX_FLAGS})
include_directories(${GFLAGS_INCLUDE})
set (THIRDPARTY_LIBS ${THIRDPARTY_LIBS} ${GFLAGS_LIBS})
else ()
message(STATUS "GFLAGS library is disabled")
endif ()
# ================================================== SNAPPY ==================================================
#
# Edit these 4 lines to define paths to Snappy
#
set(SNAPPY_HOME $ENV{THIRDPARTY_HOME}/Snappy.Library)
set(SNAPPY_INCLUDE ${SNAPPY_HOME}/inc/inc)
set(SNAPPY_LIB_DEBUG ${SNAPPY_HOME}/bin/debug/amd64/snappy.lib)
set(SNAPPY_LIB_RELEASE ${SNAPPY_HOME}/bin/retail/amd64/snappy.lib)
#
# Don't touch these lines
#
if (DEFINED SNAPPY)
set(USE_SNAPPY ${SNAPPY})
else ()
set(USE_SNAPPY ${USE_SNAPPY_DEFAULT})
endif ()
if (${USE_SNAPPY} EQUAL 1)
message(STATUS "SNAPPY library is enabled")
if(DEFINED ENV{SNAPPY_INCLUDE})
set(SNAPPY_INCLUDE $ENV{SNAPPY_INCLUDE})
endif()
if(DEFINED ENV{SNAPPY_LIB_DEBUG})
set(SNAPPY_LIB_DEBUG $ENV{SNAPPY_LIB_DEBUG})
endif()
if(DEFINED ENV{SNAPPY_LIB_RELEASE})
set(SNAPPY_LIB_RELEASE $ENV{SNAPPY_LIB_RELEASE})
endif()
set(SNAPPY_CXX_FLAGS -DSNAPPY)
set(SNAPPY_LIBS debug ${SNAPPY_LIB_DEBUG} optimized ${SNAPPY_LIB_RELEASE})
add_definitions(${SNAPPY_CXX_FLAGS})
include_directories(${SNAPPY_INCLUDE})
set (THIRDPARTY_LIBS ${THIRDPARTY_LIBS} ${SNAPPY_LIBS})
else ()
message(STATUS "SNAPPY library is disabled")
endif ()
# ================================================== LZ4 ==================================================
#
# Edit these 4 lines to define paths to LZ4
#
set(LZ4_HOME $ENV{THIRDPARTY_HOME}/LZ4.Library)
set(LZ4_INCLUDE ${LZ4_HOME}/inc/include)
set(LZ4_LIB_DEBUG ${LZ4_HOME}/bin/debug/amd64/lz4.lib)
set(LZ4_LIB_RELEASE ${LZ4_HOME}/bin/retail/amd64/lz4.lib)
#
# Don't touch these lines
#
if (DEFINED LZ4)
set(USE_LZ4 ${LZ4})
else ()
set(USE_LZ4 ${USE_LZ4_DEFAULT})
endif ()
if (${USE_LZ4} EQUAL 1)
message(STATUS "LZ4 library is enabled")
if(DEFINED ENV{LZ4_INCLUDE})
set(LZ4_INCLUDE $ENV{LZ4_INCLUDE})
endif()
if(DEFINED ENV{LZ4_LIB_DEBUG})
set(LZ4_LIB_DEBUG $ENV{LZ4_LIB_DEBUG})
endif()
if(DEFINED ENV{LZ4_LIB_RELEASE})
set(LZ4_LIB_RELEASE $ENV{LZ4_LIB_RELEASE})
endif()
set(LZ4_CXX_FLAGS -DLZ4)
set(LZ4_LIBS debug ${LZ4_LIB_DEBUG} optimized ${LZ4_LIB_RELEASE})
add_definitions(${LZ4_CXX_FLAGS})
include_directories(${LZ4_INCLUDE})
set (THIRDPARTY_LIBS ${THIRDPARTY_LIBS} ${LZ4_LIBS})
else ()
message(STATUS "LZ4 library is disabled")
endif ()
# ================================================== ZLIB ==================================================
#
# Edit these 4 lines to define paths to ZLIB
#
set(ZLIB_HOME $ENV{THIRDPARTY_HOME}/ZLIB.Library)
set(ZLIB_INCLUDE ${ZLIB_HOME}/inc/include)
set(ZLIB_LIB_DEBUG ${ZLIB_HOME}/bin/debug/amd64/zlib.lib)
set(ZLIB_LIB_RELEASE ${ZLIB_HOME}/bin/retail/amd64/zlib.lib)
#
# Don't touch these lines
#
if (DEFINED ZLIB)
set(USE_ZLIB ${ZLIB})
else ()
set(USE_ZLIB ${USE_ZLIB_DEFAULT})
endif ()
if (${USE_ZLIB} EQUAL 1)
message(STATUS "ZLIB library is enabled")
if(DEFINED ENV{ZLIB_INCLUDE})
set(ZLIB_INCLUDE $ENV{ZLIB_INCLUDE})
endif()
if(DEFINED ENV{ZLIB_LIB_DEBUG})
set(ZLIB_LIB_DEBUG $ENV{ZLIB_LIB_DEBUG})
endif()
if(DEFINED ENV{ZLIB_LIB_RELEASE})
set(ZLIB_LIB_RELEASE $ENV{ZLIB_LIB_RELEASE})
endif()
set(ZLIB_CXX_FLAGS -DZLIB)
set(ZLIB_LIBS debug ${ZLIB_LIB_DEBUG} optimized ${ZLIB_LIB_RELEASE})
add_definitions(${ZLIB_CXX_FLAGS})
include_directories(${ZLIB_INCLUDE})
set (THIRDPARTY_LIBS ${THIRDPARTY_LIBS} ${ZLIB_LIBS})
else ()
message(STATUS "ZLIB library is disabled")
endif ()
if (DEFINED XPRESS)
set(USE_XPRESS ${XPRESS})
else ()
set(USE_XPRESS ${USE_XPRESS_DEFAULT})
endif ()
if (${USE_XPRESS} EQUAL 1)
message(STATUS "XPRESS is enabled")
add_definitions(-DXPRESS)
# We are using the implementation provided by the system
set (SYSTEM_LIBS ${SYSTEM_LIBS} Cabinet.lib)
else ()
message(STATUS "XPRESS is disabled")
endif ()
#
# Edit these 4 lines to define paths to Jemalloc
#
set(JEMALLOC_HOME $ENV{THIRDPARTY_HOME}/Jemalloc.Library)
set(JEMALLOC_INCLUDE ${JEMALLOC_HOME}/inc/include)
set(JEMALLOC_LIB_DEBUG ${JEMALLOC_HOME}/bin/debug/amd64/jemalloc.lib)
set(JEMALLOC_LIB_RELEASE ${JEMALLOC_HOME}/bin/retail/amd64/jemalloc.lib)
# ================================================== JEMALLOC ==================================================
#
# Don't touch these lines
#
if (DEFINED JEMALLOC)
set(USE_JEMALLOC ${JEMALLOC})
else ()
set(USE_JEMALLOC ${USE_JEMALLOC_DEFAULT})
endif ()
if (${USE_JEMALLOC} EQUAL 1)
message(STATUS "JEMALLOC library is enabled")
set(JEMALLOC_CXX_FLAGS "-DJEMALLOC -DJEMALLOC_EXPORT= ")
if(DEFINED ENV{JEMALLOC_INCLUDE})
set(JEMALLOC_INCLUDE $ENV{JEMALLOC_INCLUDE})
endif()
if(DEFINED ENV{JEMALLOC_LIB_DEBUG})
set(JEMALLOC_LIB_DEBUG $ENV{JEMALLOC_LIB_DEBUG})
endif()
if(DEFINED ENV{JEMALLOC_LIB_RELEASE})
set(JEMALLOC_LIB_RELEASE $ENV{JEMALLOC_LIB_RELEASE})
endif()
set(JEMALLOC_LIBS debug ${JEMALLOC_LIB_DEBUG} optimized ${JEMALLOC_LIB_RELEASE})
add_definitions(${JEMALLOC_CXX_FLAGS})
include_directories(${JEMALLOC_INCLUDE})
set (THIRDPARTY_LIBS ${THIRDPARTY_LIBS} ${JEMALLOC_LIBS})
set (ARTIFACT_SUFFIX "_je")
set(USE_JENONINIT USE_JENONINIT_DEFAULT)
if(JENONINIT)
set(USE_JENONINIT ${JENONINIT})
endif()
if(${USE_JENONINIT} EQUAL 1)
add_definitions(-DJEMALLOC_NON_INIT)
message(STATUS "JEMALLOC NONINIT version")
endif()
else ()
set (ARTIFACT_SUFFIX "")
message(STATUS "JEMALLOC library is disabled")
endif ()