]>
Commit | Line | Data |
---|---|---|
11fdf7f2 TL |
1 | # |
2 | # This file is open source software, licensed to you under the terms | |
3 | # of the Apache License, Version 2.0 (the "License"). See the NOTICE file | |
4 | # distributed with this work for additional information regarding copyright | |
5 | # ownership. You may not use this file except in compliance with the License. | |
6 | # | |
7 | # You may obtain a copy of the License at | |
8 | # | |
9 | # http://www.apache.org/licenses/LICENSE-2.0 | |
10 | # | |
11 | # Unless required by applicable law or agreed to in writing, | |
12 | # software distributed under the License is distributed on an | |
13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | |
14 | # KIND, either express or implied. See the License for the | |
15 | # specific language governing permissions and limitations | |
16 | # under the License. | |
17 | # | |
18 | ||
19 | # | |
20 | # Copyright (C) 2018 Scylladb, Ltd. | |
21 | # | |
22 | ||
23 | # | |
24 | # Useful definitions for `cmake -E env`. | |
25 | # | |
26 | ||
27 | set (amended_PATH PATH=${Cooking_INGREDIENTS_DIR}/bin:$ENV{PATH}) | |
28 | set (PKG_CONFIG_PATH PKG_CONFIG_PATH=${Cooking_INGREDIENTS_DIR}/lib/pkgconfig) | |
29 | ||
30 | # | |
31 | # Some Autotools ingredients need this information because they don't use pkgconfig. | |
32 | # | |
33 | ||
34 | set (autotools_ingredients_flags | |
35 | CFLAGS=-I${Cooking_INGREDIENTS_DIR}/include | |
36 | CXXFLAGS=-I${Cooking_INGREDIENTS_DIR}/include | |
37 | LDFLAGS=-L${Cooking_INGREDIENTS_DIR}/lib) | |
38 | ||
39 | # | |
40 | # Some Autotools projects amend the info file instead of making a package-specific one. | |
41 | # This doesn't play nicely with GNU Stow. | |
42 | # | |
43 | # Just append the name of the ingredient, like | |
44 | # | |
45 | # ${info_dir}/gmp | |
46 | # | |
47 | ||
48 | set (info_dir --infodir=<INSTALL_DIR>/share/info) | |
49 | ||
50 | # | |
51 | # Build-concurrency. | |
52 | # | |
53 | ||
54 | cmake_host_system_information ( | |
55 | RESULT build_concurrency_factor | |
56 | QUERY NUMBER_OF_LOGICAL_CORES) | |
57 | ||
58 | set (make_command make -j ${build_concurrency_factor}) | |
59 | ||
60 | # | |
61 | # All the ingredients. | |
62 | # | |
63 | ||
64 | ## | |
65 | ## Dependencies of dependencies of dependencies. | |
66 | ## | |
67 | ||
68 | cooking_ingredient (gmp | |
69 | EXTERNAL_PROJECT_ARGS | |
70 | URL https://gmplib.org/download/gmp/gmp-6.1.2.tar.bz2 | |
71 | URL_MD5 8ddbb26dc3bd4e2302984debba1406a5 | |
72 | CONFIGURE_COMMAND <SOURCE_DIR>/configure --prefix=<INSTALL_DIR> --srcdir=<SOURCE_DIR> ${info_dir}/gmp | |
73 | BUILD_COMMAND <DISABLE> | |
74 | INSTALL_COMMAND ${make_command} install) | |
75 | ||
76 | ## | |
77 | ## Dependencies of dependencies. | |
78 | ## | |
79 | ||
80 | cooking_ingredient (colm | |
81 | EXTERNAL_PROJECT_ARGS | |
82 | URL http://www.colm.net/files/colm/colm-0.13.0.6.tar.gz | |
83 | URL_MD5 16aaf566cbcfe9a06154e094638ac709 | |
84 | # This is upsetting. | |
85 | BUILD_IN_SOURCE YES | |
86 | CONFIGURE_COMMAND ./configure --prefix=<INSTALL_DIR> | |
87 | BUILD_COMMAND <DISABLE> | |
88 | INSTALL_COMMAND ${make_command} install) | |
89 | ||
90 | cooking_ingredient (libpciaccess | |
91 | EXTERNAL_PROJECT_ARGS | |
92 | URL https://www.x.org/releases/individual/lib/libpciaccess-0.13.4.tar.gz | |
93 | URL_MD5 cc1fad87da60682af1d5fa43a5da45a4 | |
94 | CONFIGURE_COMMAND <SOURCE_DIR>/configure --prefix=<INSTALL_DIR> --srcdir=<SOURCE_DIR> | |
95 | BUILD_COMMAND <DISABLE> | |
96 | INSTALL_COMMAND ${make_command} install) | |
97 | ||
98 | cooking_ingredient (nettle | |
99 | REQUIRES gmp | |
100 | EXTERNAL_PROJECT_ARGS | |
101 | URL https://ftp.gnu.org/gnu/nettle/nettle-3.4.tar.gz | |
102 | URL_MD5 dc0f13028264992f58e67b4e8915f53d | |
103 | CONFIGURE_COMMAND | |
104 | <SOURCE_DIR>/configure | |
105 | --prefix=<INSTALL_DIR> | |
106 | --srcdir=<SOURCE_DIR> | |
107 | --libdir=<INSTALL_DIR>/lib | |
108 | ${info_dir}/nettle | |
109 | ${autotools_ingredients_flags} | |
110 | BUILD_COMMAND <DISABLE> | |
111 | INSTALL_COMMAND ${make_command} install) | |
112 | ||
113 | # Also a direct dependency of Seastar. | |
114 | cooking_ingredient (numactl | |
115 | EXTERNAL_PROJECT_ARGS | |
116 | URL https://github.com/numactl/numactl/releases/download/v2.0.12/numactl-2.0.12.tar.gz | |
117 | URL_MD5 2ba9777d78bfd7d408a387e53bc33ebc | |
118 | CONFIGURE_COMMAND <SOURCE_DIR>/configure --prefix=<INSTALL_DIR> --srcdir=<SOURCE_DIR> | |
119 | BUILD_COMMAND <DISABLE> | |
120 | INSTALL_COMMAND ${make_command} install) | |
121 | ||
122 | cooking_ingredient (zlib | |
123 | EXTERNAL_PROJECT_ARGS | |
1e59de90 TL |
124 | URL https://zlib.net/zlib-1.2.12.tar.gz |
125 | URL_MD5 5fc414a9726be31427b440b434d05f78 | |
9f95a23c | 126 | CONFIGURE_COMMAND <SOURCE_DIR>/configure --prefix=<INSTALL_DIR> |
11fdf7f2 TL |
127 | BUILD_COMMAND <DISABLE> |
128 | INSTALL_COMMAND ${make_command} install) | |
129 | ||
130 | ## | |
131 | ## Private and private/public dependencies. | |
132 | ## | |
133 | ||
1e59de90 TL |
134 | if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") |
135 | set (boost_toolset gcc) | |
136 | elseif (CMAKE_CXX_COMPILER_ID STREQUAL "Clang") | |
137 | set (boost_toolset clang) | |
138 | else () | |
139 | set(boost_toolset "cook_cxx") | |
140 | endif () | |
141 | set (boost_user_config "${CMAKE_CURRENT_BINARY_DIR}/cook_boost.jam") | |
142 | if (CMAKE_C_FLAGS) | |
143 | string (JOIN " <cflags>" boost_cflags | |
144 | "<cflags>${CMAKE_C_FLAGS}") | |
145 | endif () | |
146 | if (CMAKE_CXX_FLAGS) | |
147 | string (JOIN " <cxxflags>" boost_cxxflags | |
148 | "<cxxflags>${CMAKE_CXX_FLAGS}") | |
149 | endif () | |
150 | file (WRITE "${boost_user_config}" | |
151 | "using ${boost_toolset}" | |
152 | " : " # toolset's version | |
153 | " : ${CMAKE_CXX_COMPILER}" | |
154 | " : ${boost_cflags}${boost_cxxflags} <cxxflags>-std=c++${CMAKE_CXX_STANDARD}" | |
155 | " ;\n") | |
156 | ||
11fdf7f2 TL |
157 | cooking_ingredient (Boost |
158 | EXTERNAL_PROJECT_ARGS | |
1e59de90 TL |
159 | URL https://boostorg.jfrog.io/artifactory/main/release/1.81.0/source/boost_1_81_0.tar.bz2 |
160 | URL_HASH SHA256=71feeed900fbccca04a3b4f2f84a7c217186f28a940ed8b7ed4725986baf99fa | |
11fdf7f2 TL |
161 | PATCH_COMMAND |
162 | ./bootstrap.sh | |
163 | --prefix=<INSTALL_DIR> | |
164 | --with-libraries=atomic,chrono,date_time,filesystem,program_options,system,test,thread | |
1e59de90 | 165 | --with-toolset=${boost_toolset} |
11fdf7f2 TL |
166 | CONFIGURE_COMMAND <DISABLE> |
167 | BUILD_COMMAND <DISABLE> | |
168 | INSTALL_COMMAND | |
169 | ${CMAKE_COMMAND} -E chdir <SOURCE_DIR> | |
170 | ./b2 | |
171 | -j ${build_concurrency_factor} | |
172 | --layout=system | |
173 | --build-dir=<BINARY_DIR> | |
1e59de90 | 174 | --user-config=${boost_user_config} |
11fdf7f2 | 175 | install |
1e59de90 | 176 | toolset=${boost_toolset} |
11fdf7f2 TL |
177 | variant=debug |
178 | link=shared | |
179 | threading=multi | |
180 | hardcode-dll-paths=true | |
181 | dll-path=<INSTALL_DIR>/lib) | |
182 | ||
183 | cooking_ingredient (GnuTLS | |
184 | REQUIRES | |
185 | gmp | |
186 | nettle | |
187 | EXTERNAL_PROJECT_ARGS | |
188 | URL https://www.gnupg.org/ftp/gcrypt/gnutls/v3.5/gnutls-3.5.18.tar.xz | |
189 | URL_MD5 c2d93d305ecbc55939bc2a8ed4a76a3d | |
190 | CONFIGURE_COMMAND | |
191 | ${CMAKE_COMMAND} -E env ${PKG_CONFIG_PATH} | |
192 | <SOURCE_DIR>/configure | |
193 | --prefix=<INSTALL_DIR> | |
194 | --srcdir=<SOURCE_DIR> | |
195 | --with-included-unistring | |
196 | --with-included-libtasn1 | |
197 | --without-p11-kit | |
198 | # https://lists.gnupg.org/pipermail/gnutls-help/2016-February/004085.html | |
199 | --disable-non-suiteb-curves | |
200 | --disable-doc | |
201 | ${autotools_ingredients_flags} | |
202 | BUILD_COMMAND <DISABLE> | |
203 | INSTALL_COMMAND ${make_command} install) | |
204 | ||
11fdf7f2 TL |
205 | cooking_ingredient (hwloc |
206 | REQUIRES | |
207 | numactl | |
208 | libpciaccess | |
209 | EXTERNAL_PROJECT_ARGS | |
f67539c2 TL |
210 | URL https://download.open-mpi.org/release/hwloc/v2.2/hwloc-2.2.0.tar.gz |
211 | URL_MD5 762c93cdca3249eed4627c4a160192bd | |
11fdf7f2 TL |
212 | CONFIGURE_COMMAND <SOURCE_DIR>/configure --prefix=<INSTALL_DIR> --srcdir=<SOURCE_DIR> |
213 | BUILD_COMMAND <DISABLE> | |
214 | INSTALL_COMMAND ${make_command} install) | |
215 | ||
216 | cooking_ingredient (ragel | |
217 | REQUIRES colm | |
218 | EXTERNAL_PROJECT_ARGS | |
219 | URL http://www.colm.net/files/ragel/ragel-6.10.tar.gz | |
220 | URL_MD5 748cae8b50cffe9efcaa5acebc6abf0d | |
20effc67 TL |
221 | PATCH_COMMAND |
222 | sed -i "s/ CHAR_M/ SCHAR_M/g" ragel/common.cpp | |
11fdf7f2 TL |
223 | # This is upsetting. |
224 | BUILD_IN_SOURCE YES | |
225 | CONFIGURE_COMMAND | |
226 | ${CMAKE_COMMAND} -E env ${amended_PATH} | |
227 | ./configure | |
228 | --prefix=<INSTALL_DIR> | |
229 | # This is even more upsetting. | |
230 | ${autotools_ingredients_flags} | |
231 | BUILD_COMMAND <DISABLE> | |
232 | INSTALL_COMMAND ${make_command} install) | |
233 | ||
234 | cooking_ingredient (lksctp-tools | |
235 | EXTERNAL_PROJECT_ARGS | |
236 | URL https://sourceforge.net/projects/lksctp/files/lksctp-tools/lksctp-tools-1.0.16.tar.gz | |
237 | URL_MD5 708bb0b5a6806ad6e8d13c55b067518e | |
238 | PATCH_COMMAND ./bootstrap | |
239 | CONFIGURE_COMMAND <SOURCE_DIR>/configure --prefix=<INSTALL_DIR> --srcdir=<SOURCE_DIR> | |
240 | BUILD_COMMAND <DISABLE> | |
241 | INSTALL_COMMAND ${make_command} install) | |
242 | ||
243 | cooking_ingredient (yaml-cpp | |
11fdf7f2 TL |
244 | CMAKE_ARGS |
245 | -DYAML_CPP_BUILD_TESTS=OFF | |
1e59de90 | 246 | -DYAML_BUILD_SHARED_LIBS=ON |
11fdf7f2 | 247 | EXTERNAL_PROJECT_ARGS |
1e59de90 TL |
248 | URL https://github.com/jbeder/yaml-cpp/archive/yaml-cpp-0.7.0.tar.gz |
249 | URL_MD5 74d646a3cc1b5d519829441db96744f0) | |
11fdf7f2 TL |
250 | |
251 | ## | |
252 | ## Public dependencies. | |
253 | ## | |
254 | ||
255 | cooking_ingredient (c-ares | |
256 | EXTERNAL_PROJECT_ARGS | |
257 | URL https://c-ares.haxx.se/download/c-ares-1.13.0.tar.gz | |
258 | URL_MD5 d2e010b43537794d8bedfb562ae6bba2 | |
259 | CONFIGURE_COMMAND <SOURCE_DIR>/configure --prefix=<INSTALL_DIR> --srcdir=<SOURCE_DIR> | |
260 | BUILD_COMMAND <DISABLE> | |
261 | INSTALL_COMMAND ${make_command} install) | |
262 | ||
263 | cooking_ingredient (cryptopp | |
11fdf7f2 | 264 | EXTERNAL_PROJECT_ARGS |
1e59de90 TL |
265 | URL https://github.com/weidai11/cryptopp/archive/CRYPTOPP_8_7_0.tar.gz |
266 | URL_MD5 69b11e59094c10d437f295f11e51c16a | |
267 | CONFIGURE_COMMAND <DISABLE> | |
268 | BUILD_IN_SOURCE ON | |
269 | BUILD_COMMAND | |
270 | ${CMAKE_COMMAND} -E env CXX=${CMAKE_CXX_COMPILER} CXXFLAGS=${CMAKE_CXX_FLAGS} ${make_command} static | |
271 | INSTALL_COMMAND | |
272 | ${CMAKE_COMMAND} -E env CXX=${CMAKE_CXX_COMPILER} CXXFLAGS=${CMAKE_CXX_FLAGS} ${make_command} install-lib PREFIX=<INSTALL_DIR>) | |
11fdf7f2 | 273 | |
9f95a23c TL |
274 | |
275 | # Use the "native" profile that DPDK defines in `dpdk/config`, but in `dpdk_configure.cmake` we override | |
276 | # CONFIG_RTE_MACHINE with `Seastar_DPDK_MACHINE`. | |
277 | if (CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64") | |
278 | set (dpdk_quadruple arm64-armv8a-linuxapp-gcc) | |
279 | else() | |
280 | set (dpdk_quadruple ${CMAKE_SYSTEM_PROCESSOR}-native-linuxapp-gcc) | |
281 | endif() | |
11fdf7f2 TL |
282 | |
283 | set (dpdk_args | |
f67539c2 | 284 | # gcc 10 defaults to -fno-common, which dpdk is not prepared for |
1e59de90 | 285 | "EXTRA_CFLAGS=-Wno-error -fcommon -fpie" |
11fdf7f2 TL |
286 | O=<BINARY_DIR> |
287 | DESTDIR=<INSTALL_DIR> | |
288 | T=${dpdk_quadruple}) | |
289 | ||
290 | cooking_ingredient (dpdk | |
291 | EXTERNAL_PROJECT_ARGS | |
292 | SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/dpdk | |
293 | CONFIGURE_COMMAND | |
294 | COMMAND | |
295 | ${CMAKE_COMMAND} -E chdir <SOURCE_DIR> | |
296 | make ${dpdk_args} config | |
297 | COMMAND | |
298 | ${CMAKE_COMMAND} | |
9f95a23c | 299 | -DSeastar_DPDK_MACHINE=${Seastar_DPDK_MACHINE} |
11fdf7f2 | 300 | -DSeastar_DPDK_CONFIG_FILE_IN=<BINARY_DIR>/.config |
9f95a23c | 301 | -DSeastar_DPDK_CONFIG_FILE_CHANGES=${CMAKE_CURRENT_SOURCE_DIR}/dpdk_config |
11fdf7f2 | 302 | -DSeastar_DPDK_CONFIG_FILE_OUT=<BINARY_DIR>/${dpdk_quadruple}/.config |
9f95a23c | 303 | -P ${CMAKE_CURRENT_SOURCE_DIR}/cmake/dpdk_configure.cmake |
11fdf7f2 TL |
304 | BUILD_COMMAND <DISABLE> |
305 | INSTALL_COMMAND | |
306 | ${CMAKE_COMMAND} -E chdir <SOURCE_DIR> | |
307 | ${make_command} ${dpdk_args} install) | |
308 | ||
309 | cooking_ingredient (fmt | |
9f95a23c | 310 | EXTERNAL_PROJECT_ARGS |
1e59de90 TL |
311 | URL https://github.com/fmtlib/fmt/archive/9.1.0.tar.gz |
312 | URL_MD5 21fac48cae8f3b4a5783ae06b443973a | |
11fdf7f2 | 313 | CMAKE_ARGS |
11fdf7f2 | 314 | -DFMT_DOC=OFF |
9f95a23c | 315 | -DFMT_TEST=OFF) |
11fdf7f2 | 316 | |
1e59de90 TL |
317 | cooking_ingredient (liburing |
318 | EXTERNAL_PROJECT_ARGS | |
319 | URL https://github.com/axboe/liburing/archive/liburing-2.1.tar.gz | |
320 | URL_MD5 78f13d9861b334b9a9ca0d12cf2a6d3c | |
321 | CONFIGURE_COMMAND <SOURCE_DIR>/configure --prefix=<INSTALL_DIR> | |
322 | BUILD_COMMAND <DISABLE> | |
323 | BUILD_BYPRODUCTS "<SOURCE_DIR>/src/liburing.a" | |
324 | BUILD_IN_SOURCE ON | |
325 | INSTALL_COMMAND ${make_command} -s install) | |
326 | ||
11fdf7f2 TL |
327 | cooking_ingredient (lz4 |
328 | EXTERNAL_PROJECT_ARGS | |
329 | URL https://github.com/lz4/lz4/archive/v1.8.0.tar.gz | |
330 | URL_MD5 6247bf0e955899969d1600ff34baed6b | |
331 | # This is upsetting. | |
332 | BUILD_IN_SOURCE ON | |
333 | CONFIGURE_COMMAND <DISABLE> | |
334 | BUILD_COMMAND <DISABLE> | |
335 | INSTALL_COMMAND ${make_command} PREFIX=<INSTALL_DIR> install) |