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.
7 # You may obtain a copy of the License at
9 # http://www.apache.org/licenses/LICENSE-2.0
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
20 # Copyright (C) 2018 Scylladb, Ltd.
24 # Useful definitions for `cmake -E env`.
27 set (amended_PATH PATH=${Cooking_INGREDIENTS_DIR}/bin:$ENV{PATH})
28 set (PKG_CONFIG_PATH PKG_CONFIG_PATH=${Cooking_INGREDIENTS_DIR}/lib/pkgconfig)
31 # Some Autotools ingredients need this information because they don't use pkgconfig.
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)
40 # Some Autotools projects amend the info file instead of making a package-specific one.
41 # This doesn't play nicely with GNU Stow.
43 # Just append the name of the ingredient, like
48 set (info_dir --infodir=<INSTALL_DIR>/share/info)
54 cmake_host_system_information (
55 RESULT build_concurrency_factor
56 QUERY NUMBER_OF_LOGICAL_CORES)
58 set (make_command make -j ${build_concurrency_factor})
61 # All the ingredients.
65 ## Dependencies of dependencies of dependencies.
68 cooking_ingredient (gmp
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)
77 ## Dependencies of dependencies.
80 cooking_ingredient (colm
82 URL http://www.colm.net/files/colm/colm-0.13.0.6.tar.gz
83 URL_MD5 16aaf566cbcfe9a06154e094638ac709
86 CONFIGURE_COMMAND ./configure --prefix=<INSTALL_DIR>
87 BUILD_COMMAND <DISABLE>
88 INSTALL_COMMAND ${make_command} install)
90 cooking_ingredient (libpciaccess
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)
98 cooking_ingredient (nettle
100 EXTERNAL_PROJECT_ARGS
101 URL https://ftp.gnu.org/gnu/nettle/nettle-3.4.tar.gz
102 URL_MD5 dc0f13028264992f58e67b4e8915f53d
104 <SOURCE_DIR>/configure
105 --prefix=<INSTALL_DIR>
106 --srcdir=<SOURCE_DIR>
107 --libdir=<INSTALL_DIR>/lib
109 ${autotools_ingredients_flags}
110 BUILD_COMMAND <DISABLE>
111 INSTALL_COMMAND ${make_command} install)
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)
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)
131 ## Private and private/public dependencies.
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
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>
145 ${CMAKE_COMMAND} -E chdir <SOURCE_DIR>
147 -j ${build_concurrency_factor}
149 --build-dir=<BINARY_DIR>
154 hardcode-dll-paths=true
155 dll-path=<INSTALL_DIR>/lib)
157 cooking_ingredient (GnuTLS
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
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
172 # https://lists.gnupg.org/pipermail/gnutls-help/2016-February/004085.html
173 --disable-non-suiteb-curves
175 ${autotools_ingredients_flags}
176 BUILD_COMMAND <DISABLE>
177 INSTALL_COMMAND ${make_command} install)
179 cooking_ingredient (hwloc
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)
190 cooking_ingredient (ragel
192 EXTERNAL_PROJECT_ARGS
193 URL http://www.colm.net/files/ragel/ragel-6.10.tar.gz
194 URL_MD5 748cae8b50cffe9efcaa5acebc6abf0d
196 sed -i "s/ CHAR_M/ SCHAR_M/g" ragel/common.cpp
200 ${CMAKE_COMMAND} -E env ${amended_PATH}
202 --prefix=<INSTALL_DIR>
203 # This is even more upsetting.
204 ${autotools_ingredients_flags}
205 BUILD_COMMAND <DISABLE>
206 INSTALL_COMMAND ${make_command} install)
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)
217 cooking_ingredient (yaml-cpp
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)
227 ## Public dependencies.
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)
238 cooking_ingredient (cryptopp
240 -DCMAKE_INSTALL_LIBDIR=<INSTALL_DIR>/lib
242 EXTERNAL_PROJECT_ARGS
243 URL https://github.com/weidai11/cryptopp/archive/CRYPTOPP_5_6_5.tar.gz
244 URL_MD5 88224d9c0322f63aa1fb5b8ae78170f0)
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)
252 set (dpdk_quadruple ${CMAKE_SYSTEM_PROCESSOR}-native-linuxapp-gcc)
256 # gcc 10 defaults to -fno-common, which dpdk is not prepared for
257 "EXTRA_CFLAGS=-Wno-error -fcommon"
259 DESTDIR=<INSTALL_DIR>
262 cooking_ingredient (dpdk
263 EXTERNAL_PROJECT_ARGS
264 SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/dpdk
267 ${CMAKE_COMMAND} -E chdir <SOURCE_DIR>
268 make ${dpdk_args} config
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>
278 ${CMAKE_COMMAND} -E chdir <SOURCE_DIR>
279 ${make_command} ${dpdk_args} install)
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
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
295 CONFIGURE_COMMAND <DISABLE>
296 BUILD_COMMAND <DISABLE>
297 INSTALL_COMMAND ${make_command} PREFIX=<INSTALL_DIR> install)