]> git.proxmox.com Git - ceph.git/blob - ceph/src/seastar/cooking_recipe.cmake
import quincy beta 17.1.0
[ceph.git] / ceph / src / seastar / cooking_recipe.cmake
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
124 URL https://zlib.net/zlib-1.2.11.tar.gz
125 URL_MD5 1c9f62f0778697a09d36121ead88e08e
126 CONFIGURE_COMMAND <SOURCE_DIR>/configure --prefix=<INSTALL_DIR>
127 BUILD_COMMAND <DISABLE>
128 INSTALL_COMMAND ${make_command} install)
129
130 ##
131 ## Private and private/public dependencies.
132 ##
133
134 cooking_ingredient (Boost
135 EXTERNAL_PROJECT_ARGS
136 URL https://boostorg.jfrog.io/artifactory/main/release/1.77.0/source/boost_1_77_0.tar.bz2
137 URL_HASH SHA256=fc9f85fc030e233142908241af7a846e60630aa7388de9a5fafb1f3a26840854
138 PATCH_COMMAND
139 ./bootstrap.sh
140 --prefix=<INSTALL_DIR>
141 --with-libraries=atomic,chrono,date_time,filesystem,program_options,system,test,thread
142 CONFIGURE_COMMAND <DISABLE>
143 BUILD_COMMAND <DISABLE>
144 INSTALL_COMMAND
145 ${CMAKE_COMMAND} -E chdir <SOURCE_DIR>
146 ./b2
147 -j ${build_concurrency_factor}
148 --layout=system
149 --build-dir=<BINARY_DIR>
150 install
151 variant=debug
152 link=shared
153 threading=multi
154 hardcode-dll-paths=true
155 dll-path=<INSTALL_DIR>/lib)
156
157 cooking_ingredient (GnuTLS
158 REQUIRES
159 gmp
160 nettle
161 EXTERNAL_PROJECT_ARGS
162 URL https://www.gnupg.org/ftp/gcrypt/gnutls/v3.5/gnutls-3.5.18.tar.xz
163 URL_MD5 c2d93d305ecbc55939bc2a8ed4a76a3d
164 CONFIGURE_COMMAND
165 ${CMAKE_COMMAND} -E env ${PKG_CONFIG_PATH}
166 <SOURCE_DIR>/configure
167 --prefix=<INSTALL_DIR>
168 --srcdir=<SOURCE_DIR>
169 --with-included-unistring
170 --with-included-libtasn1
171 --without-p11-kit
172 # https://lists.gnupg.org/pipermail/gnutls-help/2016-February/004085.html
173 --disable-non-suiteb-curves
174 --disable-doc
175 ${autotools_ingredients_flags}
176 BUILD_COMMAND <DISABLE>
177 INSTALL_COMMAND ${make_command} install)
178
179 cooking_ingredient (hwloc
180 REQUIRES
181 numactl
182 libpciaccess
183 EXTERNAL_PROJECT_ARGS
184 URL https://download.open-mpi.org/release/hwloc/v2.2/hwloc-2.2.0.tar.gz
185 URL_MD5 762c93cdca3249eed4627c4a160192bd
186 CONFIGURE_COMMAND <SOURCE_DIR>/configure --prefix=<INSTALL_DIR> --srcdir=<SOURCE_DIR>
187 BUILD_COMMAND <DISABLE>
188 INSTALL_COMMAND ${make_command} install)
189
190 cooking_ingredient (ragel
191 REQUIRES colm
192 EXTERNAL_PROJECT_ARGS
193 URL http://www.colm.net/files/ragel/ragel-6.10.tar.gz
194 URL_MD5 748cae8b50cffe9efcaa5acebc6abf0d
195 PATCH_COMMAND
196 sed -i "s/ CHAR_M/ SCHAR_M/g" ragel/common.cpp
197 # This is upsetting.
198 BUILD_IN_SOURCE YES
199 CONFIGURE_COMMAND
200 ${CMAKE_COMMAND} -E env ${amended_PATH}
201 ./configure
202 --prefix=<INSTALL_DIR>
203 # This is even more upsetting.
204 ${autotools_ingredients_flags}
205 BUILD_COMMAND <DISABLE>
206 INSTALL_COMMAND ${make_command} install)
207
208 cooking_ingredient (lksctp-tools
209 EXTERNAL_PROJECT_ARGS
210 URL https://sourceforge.net/projects/lksctp/files/lksctp-tools/lksctp-tools-1.0.16.tar.gz
211 URL_MD5 708bb0b5a6806ad6e8d13c55b067518e
212 PATCH_COMMAND ./bootstrap
213 CONFIGURE_COMMAND <SOURCE_DIR>/configure --prefix=<INSTALL_DIR> --srcdir=<SOURCE_DIR>
214 BUILD_COMMAND <DISABLE>
215 INSTALL_COMMAND ${make_command} install)
216
217 cooking_ingredient (yaml-cpp
218 REQUIRES Boost
219 CMAKE_ARGS
220 -DYAML_CPP_BUILD_TESTS=OFF
221 -DBUILD_SHARED_LIBS=ON
222 EXTERNAL_PROJECT_ARGS
223 URL https://github.com/jbeder/yaml-cpp/archive/yaml-cpp-0.5.3.tar.gz
224 URL_MD5 2bba14e6a7f12c7272f87d044e4a7211)
225
226 ##
227 ## Public dependencies.
228 ##
229
230 cooking_ingredient (c-ares
231 EXTERNAL_PROJECT_ARGS
232 URL https://c-ares.haxx.se/download/c-ares-1.13.0.tar.gz
233 URL_MD5 d2e010b43537794d8bedfb562ae6bba2
234 CONFIGURE_COMMAND <SOURCE_DIR>/configure --prefix=<INSTALL_DIR> --srcdir=<SOURCE_DIR>
235 BUILD_COMMAND <DISABLE>
236 INSTALL_COMMAND ${make_command} install)
237
238 cooking_ingredient (cryptopp
239 CMAKE_ARGS
240 -DCMAKE_INSTALL_LIBDIR=<INSTALL_DIR>/lib
241 -DBUILD_TESTING=OFF
242 EXTERNAL_PROJECT_ARGS
243 URL https://github.com/weidai11/cryptopp/archive/CRYPTOPP_5_6_5.tar.gz
244 URL_MD5 88224d9c0322f63aa1fb5b8ae78170f0)
245
246
247 # Use the "native" profile that DPDK defines in `dpdk/config`, but in `dpdk_configure.cmake` we override
248 # CONFIG_RTE_MACHINE with `Seastar_DPDK_MACHINE`.
249 if (CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64")
250 set (dpdk_quadruple arm64-armv8a-linuxapp-gcc)
251 else()
252 set (dpdk_quadruple ${CMAKE_SYSTEM_PROCESSOR}-native-linuxapp-gcc)
253 endif()
254
255 set (dpdk_args
256 # gcc 10 defaults to -fno-common, which dpdk is not prepared for
257 "EXTRA_CFLAGS=-Wno-error -fcommon"
258 O=<BINARY_DIR>
259 DESTDIR=<INSTALL_DIR>
260 T=${dpdk_quadruple})
261
262 cooking_ingredient (dpdk
263 EXTERNAL_PROJECT_ARGS
264 SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/dpdk
265 CONFIGURE_COMMAND
266 COMMAND
267 ${CMAKE_COMMAND} -E chdir <SOURCE_DIR>
268 make ${dpdk_args} config
269 COMMAND
270 ${CMAKE_COMMAND}
271 -DSeastar_DPDK_MACHINE=${Seastar_DPDK_MACHINE}
272 -DSeastar_DPDK_CONFIG_FILE_IN=<BINARY_DIR>/.config
273 -DSeastar_DPDK_CONFIG_FILE_CHANGES=${CMAKE_CURRENT_SOURCE_DIR}/dpdk_config
274 -DSeastar_DPDK_CONFIG_FILE_OUT=<BINARY_DIR>/${dpdk_quadruple}/.config
275 -P ${CMAKE_CURRENT_SOURCE_DIR}/cmake/dpdk_configure.cmake
276 BUILD_COMMAND <DISABLE>
277 INSTALL_COMMAND
278 ${CMAKE_COMMAND} -E chdir <SOURCE_DIR>
279 ${make_command} ${dpdk_args} install)
280
281 cooking_ingredient (fmt
282 EXTERNAL_PROJECT_ARGS
283 URL https://github.com/fmtlib/fmt/archive/5.2.1.tar.gz
284 URL_MD5 eaf6e3c1b2f4695b9a612cedf17b509d
285 CMAKE_ARGS
286 -DFMT_DOC=OFF
287 -DFMT_TEST=OFF)
288
289 cooking_ingredient (lz4
290 EXTERNAL_PROJECT_ARGS
291 URL https://github.com/lz4/lz4/archive/v1.8.0.tar.gz
292 URL_MD5 6247bf0e955899969d1600ff34baed6b
293 # This is upsetting.
294 BUILD_IN_SOURCE ON
295 CONFIGURE_COMMAND <DISABLE>
296 BUILD_COMMAND <DISABLE>
297 INSTALL_COMMAND ${make_command} PREFIX=<INSTALL_DIR> install)