2021-07-19 04:55:57 +00:00
|
|
|
cmake_minimum_required(VERSION 3.16)
|
2014-06-23 22:32:32 +00:00
|
|
|
|
2019-07-24 16:57:27 +00:00
|
|
|
project(ceph
|
2021-01-22 20:13:22 +00:00
|
|
|
VERSION 17.0.0
|
2019-07-24 16:57:27 +00:00
|
|
|
LANGUAGES CXX C ASM)
|
2014-06-23 22:32:32 +00:00
|
|
|
|
2021-02-10 17:14:07 +00:00
|
|
|
cmake_policy(SET CMP0028 NEW)
|
|
|
|
cmake_policy(SET CMP0046 NEW)
|
|
|
|
cmake_policy(SET CMP0048 NEW)
|
|
|
|
cmake_policy(SET CMP0051 NEW)
|
|
|
|
cmake_policy(SET CMP0054 NEW)
|
|
|
|
cmake_policy(SET CMP0056 NEW)
|
|
|
|
cmake_policy(SET CMP0065 NEW)
|
|
|
|
cmake_policy(SET CMP0074 NEW)
|
|
|
|
cmake_policy(SET CMP0075 NEW)
|
|
|
|
cmake_policy(SET CMP0093 NEW)
|
2021-12-19 04:22:16 +00:00
|
|
|
if(POLICY CMP0127)
|
|
|
|
cmake_policy(SET CMP0127 NEW)
|
|
|
|
endif()
|
2020-02-24 04:32:54 +00:00
|
|
|
|
2016-07-20 07:10:45 +00:00
|
|
|
list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules/")
|
2014-06-23 22:32:32 +00:00
|
|
|
|
2016-07-19 14:17:23 +00:00
|
|
|
if(CMAKE_SYSTEM_NAME MATCHES "Linux")
|
|
|
|
set(LINUX ON)
|
|
|
|
FIND_PACKAGE(Threads)
|
|
|
|
elseif(CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
|
|
|
|
set(FREEBSD ON)
|
|
|
|
FIND_PACKAGE(Threads)
|
|
|
|
endif(CMAKE_SYSTEM_NAME MATCHES "Linux")
|
|
|
|
|
2020-02-05 14:54:16 +00:00
|
|
|
if(WIN32)
|
|
|
|
# The Windows headers (e.g. coming from mingw or the Windows SDK) check
|
|
|
|
# the targeted Windows version. The availability of certain functions and
|
|
|
|
# structures will depend on it.
|
|
|
|
set(WIN32_WINNT "0x0A00" CACHE STRING "Targeted Windows version.")
|
|
|
|
add_definitions(-D_WIN32_WINNT=${WIN32_WINNT})
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(MINGW)
|
2021-07-20 08:16:07 +00:00
|
|
|
string(APPEND CMAKE_SHARED_LINKER_FLAGS " -Wl,-allow-multiple-definition")
|
|
|
|
string(APPEND CMAKE_EXE_LINKER_FLAGS " -Wl,-allow-multiple-definition")
|
2021-01-07 13:14:00 +00:00
|
|
|
|
|
|
|
# By default, cmake generates import libs for executables. The issue is that
|
|
|
|
# for rados and rbd, the executable import lib overrides the library import lib.
|
|
|
|
# For example, for rados.exe, it will end up generating a librados.dll.a import lib.
|
|
|
|
# We're providing custom rules to disable import libs for executables.
|
|
|
|
set(CMAKE_C_LINK_EXECUTABLE
|
|
|
|
"<CMAKE_C_COMPILER> <FLAGS> <CMAKE_C_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> ${CMAKE_GNULD_IMAGE_VERSION} <LINK_LIBRARIES>")
|
|
|
|
set(CMAKE_CXX_LINK_EXECUTABLE
|
|
|
|
"<CMAKE_CXX_COMPILER> <FLAGS> <CMAKE_CXX_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> ${CMAKE_GNULD_IMAGE_VERSION} <LINK_LIBRARIES>")
|
|
|
|
|
2021-05-07 09:23:30 +00:00
|
|
|
link_directories(${MINGW_LINK_DIRECTORIES})
|
2020-02-05 14:54:16 +00:00
|
|
|
endif()
|
|
|
|
|
2015-12-09 17:55:30 +00:00
|
|
|
option(WITH_CCACHE "Build with ccache.")
|
|
|
|
if(WITH_CCACHE)
|
2021-02-10 03:47:15 +00:00
|
|
|
find_program(CCACHE_EXECUTABLE ccache)
|
|
|
|
if(NOT CCACHE_EXECUTABLE)
|
2015-12-09 17:55:30 +00:00
|
|
|
message(FATAL_ERROR "Can't find ccache. Is it installed?")
|
2020-02-24 04:44:11 +00:00
|
|
|
endif()
|
2021-02-10 03:47:15 +00:00
|
|
|
message(STATUS "Building with ccache: ${CCACHE_EXECUTABLE}, CCACHE_DIR=$ENV{CCACHE_DIR}")
|
|
|
|
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "${CCACHE_EXECUTABLE}")
|
2020-02-24 04:44:11 +00:00
|
|
|
# ccache does not accelerate link (ld), but let it handle it. by passing it
|
|
|
|
# along with cc to python's distutils, we are able to workaround
|
|
|
|
# https://bugs.python.org/issue8027.
|
2021-02-10 03:47:15 +00:00
|
|
|
set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK "${CCACHE_EXECUTABLE}")
|
2015-12-09 17:55:30 +00:00
|
|
|
endif(WITH_CCACHE)
|
|
|
|
|
2016-05-11 13:29:15 +00:00
|
|
|
option(WITH_MANPAGE "Build man pages." ON)
|
|
|
|
if(WITH_MANPAGE)
|
|
|
|
find_program(SPHINX_BUILD
|
2019-02-07 07:33:11 +00:00
|
|
|
NAMES sphinx-build sphinx-build-3)
|
2016-05-11 13:29:15 +00:00
|
|
|
if(NOT SPHINX_BUILD)
|
|
|
|
message(FATAL_ERROR "Can't find sphinx-build.")
|
|
|
|
endif(NOT SPHINX_BUILD)
|
|
|
|
endif(WITH_MANPAGE)
|
|
|
|
|
2016-01-12 14:39:58 +00:00
|
|
|
include_directories(
|
2014-06-23 22:32:32 +00:00
|
|
|
${PROJECT_BINARY_DIR}/src/include
|
2016-07-22 04:23:32 +00:00
|
|
|
${PROJECT_SOURCE_DIR}/src)
|
|
|
|
|
2019-10-08 10:49:31 +00:00
|
|
|
if(WIN32)
|
|
|
|
include_directories(
|
2020-08-01 05:33:23 +00:00
|
|
|
${PROJECT_SOURCE_DIR}/src/include/win32)
|
2019-10-08 10:49:31 +00:00
|
|
|
# Boost complains if winsock2.h (or windows.h) is included before asio.hpp.
|
2021-07-19 04:44:38 +00:00
|
|
|
add_compile_options("SHELL:-include winsock_wrapper.h")
|
2020-01-22 13:59:13 +00:00
|
|
|
# Boost is also defining some of the errno values, we'll have
|
|
|
|
# to avoid mismatches.
|
2021-07-19 04:44:38 +00:00
|
|
|
add_compile_options("SHELL:-include win32_errno.h")
|
2019-10-08 10:49:31 +00:00
|
|
|
endif()
|
|
|
|
|
2016-07-19 14:17:23 +00:00
|
|
|
if(FREEBSD)
|
2017-11-03 19:14:35 +00:00
|
|
|
include_directories(SYSTEM /usr/local/include)
|
2016-07-19 14:17:23 +00:00
|
|
|
link_directories(/usr/local/lib)
|
|
|
|
list(APPEND CMAKE_REQUIRED_INCLUDES /usr/local/include)
|
|
|
|
endif(FREEBSD)
|
|
|
|
|
2014-06-23 22:32:32 +00:00
|
|
|
|
2016-03-03 17:05:18 +00:00
|
|
|
#put all the libs and binaries in one place
|
|
|
|
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
|
|
|
|
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
|
|
|
|
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
|
|
|
|
|
2020-06-17 22:33:13 +00:00
|
|
|
include(GNUInstallDirs)
|
2019-07-09 06:25:52 +00:00
|
|
|
include(CephChecks)
|
2021-03-16 07:37:59 +00:00
|
|
|
if(CMAKE_GENERATOR MATCHES Ninja)
|
|
|
|
include(LimitJobs)
|
|
|
|
endif()
|
2015-12-01 14:07:48 +00:00
|
|
|
|
2014-06-23 22:32:32 +00:00
|
|
|
set(CEPH_MAN_DIR "share/man" CACHE STRING "Install location for man pages (relative to prefix).")
|
|
|
|
|
2016-06-04 01:50:00 +00:00
|
|
|
option(ENABLE_SHARED "build shared libraries" ON)
|
|
|
|
if(ENABLE_SHARED)
|
|
|
|
set(CEPH_SHARED SHARED)
|
|
|
|
else(ENABLE_SHARED)
|
|
|
|
set(CEPH_SHARED STATIC)
|
|
|
|
endif(ENABLE_SHARED)
|
2016-06-29 07:49:26 +00:00
|
|
|
set(CMAKE_POSITION_INDEPENDENT_CODE ${ENABLE_SHARED})
|
2016-06-04 01:50:00 +00:00
|
|
|
|
2017-12-09 11:27:03 +00:00
|
|
|
option(WITH_STATIC_LIBSTDCXX "Link against libstdc++ statically" OFF)
|
|
|
|
if(WITH_STATIC_LIBSTDCXX)
|
2020-02-24 04:44:11 +00:00
|
|
|
if(NOT CMAKE_COMPILER_IS_GNUCXX)
|
2017-12-09 11:27:03 +00:00
|
|
|
message(FATAL_ERROR "Please use GCC to enable WITH_STATIC_LIBSTDCXX")
|
|
|
|
endif()
|
2020-02-24 04:44:11 +00:00
|
|
|
set(static_linker_flags "-static-libstdc++ -static-libgcc")
|
2021-07-20 08:16:07 +00:00
|
|
|
string(APPEND CMAKE_SHARED_LINKER_FLAGS " ${static_linker_flags}")
|
|
|
|
string(APPEND CMAKE_EXE_LINKER_FLAGS " ${static_linker_flags}")
|
2020-02-24 04:44:11 +00:00
|
|
|
unset(static_linker_flags)
|
|
|
|
set(GPERFTOOLS_USE_STATIC_LIBS TRUE)
|
2017-12-09 11:27:03 +00:00
|
|
|
endif()
|
2018-07-09 17:17:54 +00:00
|
|
|
include(CheckCxxAtomic)
|
|
|
|
if(NOT HAVE_CXX11_ATOMIC)
|
2021-07-20 08:16:07 +00:00
|
|
|
string(APPEND CMAKE_CXX_STANDARD_LIBRARIES
|
|
|
|
" ${LIBATOMIC_LINK_FLAGS}")
|
2018-07-09 17:17:54 +00:00
|
|
|
endif()
|
2017-12-09 11:27:03 +00:00
|
|
|
|
2018-06-28 08:56:58 +00:00
|
|
|
option(WITH_RDMA "Enable RDMA in async messenger" ON)
|
|
|
|
if(WITH_RDMA)
|
2018-06-08 12:59:19 +00:00
|
|
|
find_package(verbs REQUIRED)
|
|
|
|
set(HAVE_VERBS ${VERBS_FOUND})
|
|
|
|
find_package(rdmacm REQUIRED)
|
|
|
|
set(HAVE_RDMACM ${RDMACM_FOUND})
|
2018-06-28 08:56:58 +00:00
|
|
|
set(HAVE_RDMA TRUE)
|
|
|
|
endif()
|
2016-10-13 03:44:55 +00:00
|
|
|
|
2016-07-20 06:13:40 +00:00
|
|
|
find_package(Backtrace)
|
2015-10-15 02:54:05 +00:00
|
|
|
|
2019-06-29 15:47:42 +00:00
|
|
|
option(WITH_RBD "Enable RADOS Block Device related targets" ON)
|
2019-06-04 18:32:09 +00:00
|
|
|
|
2016-07-19 14:17:23 +00:00
|
|
|
if(LINUX)
|
|
|
|
find_package(udev REQUIRED)
|
|
|
|
set(HAVE_UDEV ${UDEV_FOUND})
|
|
|
|
find_package(blkid REQUIRED)
|
|
|
|
set(HAVE_BLKID ${BLKID_FOUND})
|
2019-09-20 14:02:23 +00:00
|
|
|
find_package(keyutils REQUIRED)
|
|
|
|
set(HAVE_KEYUTILS ${KEYUTILS_FOUND})
|
2017-09-28 20:13:15 +00:00
|
|
|
elseif(FREEBSD)
|
|
|
|
set(HAVE_UDEV OFF)
|
|
|
|
set(HAVE_LIBAIO OFF)
|
|
|
|
set(HAVE_BLKID OFF)
|
2019-09-20 14:02:23 +00:00
|
|
|
set(HAVE_KEYUTILS OFF)
|
2016-07-19 14:17:23 +00:00
|
|
|
else()
|
|
|
|
set(HAVE_UDEV OFF)
|
|
|
|
set(HAVE_BLKID OFF)
|
|
|
|
endif(LINUX)
|
2014-06-23 22:32:32 +00:00
|
|
|
|
2015-11-14 19:51:13 +00:00
|
|
|
option(WITH_OPENLDAP "OPENLDAP is here" ON)
|
2017-10-27 17:57:55 +00:00
|
|
|
if(WITH_OPENLDAP)
|
2021-07-24 09:28:11 +00:00
|
|
|
find_package(OpenLDAP REQUIRED)
|
|
|
|
set(HAVE_OPENLDAP ${OpenLDAP_FOUND})
|
2017-10-27 17:57:55 +00:00
|
|
|
endif()
|
2018-11-22 00:10:33 +00:00
|
|
|
|
2019-02-03 20:27:49 +00:00
|
|
|
option(WITH_GSSAPI "GSSAPI/KRB5 is here" OFF)
|
2018-11-22 00:10:33 +00:00
|
|
|
if(WITH_GSSAPI)
|
|
|
|
find_package(GSSApi REQUIRED)
|
|
|
|
set(HAVE_GSSAPI ${GSSApi_FOUND})
|
|
|
|
endif()
|
2015-11-14 19:51:13 +00:00
|
|
|
|
2014-06-23 22:32:32 +00:00
|
|
|
option(WITH_FUSE "Fuse is here" ON)
|
2017-10-27 17:57:55 +00:00
|
|
|
if(WITH_FUSE)
|
2020-04-17 05:02:22 +00:00
|
|
|
find_package(FUSE)
|
2017-10-27 17:57:55 +00:00
|
|
|
set(HAVE_LIBFUSE ${FUSE_FOUND})
|
|
|
|
endif()
|
2014-06-23 22:32:32 +00:00
|
|
|
|
cephfs: Add ceph-dokan, providing Windows support
In order to expose ceph filesystems to Windows hosts, we propose
including ceph-dokan[1][2] in the Ceph tree, while updating it to
work with the latest CephFS and Dokany APIs.
Dokany is a well maintained project (fork of the original Dokan
project), allowing filesystems to be implemented in userspace,
even providing a Fuse compatibility layer.
One reason for not using the FUSE compatibility layer is that it's
only covering the high level API while Ceph is using the low level
FUSE API, which among other things is inode centric.
Changes made by this patch compared to the upstream ceph-dokan:
* support latest stable Dokany API. The upstream version relies on
the legacy unmaintained Dokan API
* return proper error codes, converting standard errno.h values to
NTSTATUS
* minor changes to support latest cephfs API
* drop duplicated ceph code, no longer needed if we're to include it
in tree. This makes it much easier to maintain.
* drop redundant permission checks, leaving it up to libcephfs
* use ceph argparse helpers
* use ceph logging and daemon initialization
* fixed unicode handling
* switched to ceph coding style
* made ceph.conf param optional, using the default path if available
* enabled setting file timestamps
* append support
* configurable timeouts set once per mount
* ensure that the error code is always logged
* various cleanups (removed unused entry points, checks that have
been moved to dokany, simplified conditional statements,
unnecessary conversions in the hot path, etc).
[1] https://github.com/ketor/ceph-dokan
[2] https://github.com/ceph/ceph-dokan
Signed-off-by: Lucian Petrut <lpetrut@cloudbasesolutions.com>
2020-08-07 12:07:20 +00:00
|
|
|
option(WITH_DOKAN "Dokan is here" OFF)
|
|
|
|
|
2015-09-21 16:18:43 +00:00
|
|
|
option(WITH_XFS "XFS is here" ON)
|
2017-06-26 03:58:28 +00:00
|
|
|
if(WITH_XFS)
|
|
|
|
find_package(xfs)
|
|
|
|
set(HAVE_LIBXFS ${XFS_FOUND})
|
|
|
|
endif()
|
|
|
|
|
|
|
|
option(WITH_ZFS "enable LibZFS if found" OFF)
|
|
|
|
if(WITH_ZFS)
|
|
|
|
find_package(zfs)
|
|
|
|
set(HAVE_LIBZFS ${ZFS_FOUND})
|
|
|
|
endif()
|
2015-09-21 16:18:43 +00:00
|
|
|
|
2017-11-20 04:55:54 +00:00
|
|
|
option(WITH_BLUESTORE "Bluestore OSD backend" ON)
|
|
|
|
if(WITH_BLUESTORE)
|
2017-09-25 20:53:14 +00:00
|
|
|
if(LINUX)
|
|
|
|
find_package(aio)
|
|
|
|
set(HAVE_LIBAIO ${AIO_FOUND})
|
|
|
|
elseif(FREEBSD)
|
|
|
|
# POSIX AIO is integrated into FreeBSD kernel, and exposed by libc.
|
|
|
|
set(HAVE_POSIXAIO ON)
|
|
|
|
endif()
|
2017-11-20 04:55:54 +00:00
|
|
|
endif()
|
|
|
|
|
2020-10-28 12:22:06 +00:00
|
|
|
# libcryptsetup is only available on linux
|
|
|
|
if(WITH_RBD AND LINUX)
|
2021-07-31 03:19:26 +00:00
|
|
|
find_package(libcryptsetup 2.0.5 REQUIRED)
|
2020-10-28 12:22:06 +00:00
|
|
|
set(HAVE_LIBCRYPTSETUP ${LIBCRYPTSETUP_FOUND})
|
|
|
|
endif()
|
|
|
|
|
2019-07-10 15:10:27 +00:00
|
|
|
include(CMakeDependentOption)
|
2020-09-05 05:00:17 +00:00
|
|
|
|
|
|
|
CMAKE_DEPENDENT_OPTION(WITH_ZBD "Enable libzbd bluestore backend" OFF
|
|
|
|
"WITH_BLUESTORE" OFF)
|
2020-10-29 03:17:32 +00:00
|
|
|
if(WITH_ZBD)
|
2020-11-02 13:07:11 +00:00
|
|
|
find_package(zbd REQUIRED)
|
2020-10-29 03:17:32 +00:00
|
|
|
set(HAVE_LIBZBD ${ZBD_FOUND})
|
|
|
|
endif()
|
2020-09-05 05:00:17 +00:00
|
|
|
|
2020-11-02 13:05:59 +00:00
|
|
|
CMAKE_DEPENDENT_OPTION(WITH_LIBURING "Enable io_uring bluestore backend" ON
|
2019-03-21 17:10:11 +00:00
|
|
|
"WITH_BLUESTORE;HAVE_LIBAIO" OFF)
|
|
|
|
set(HAVE_LIBURING ${WITH_LIBURING})
|
|
|
|
|
2020-04-13 09:55:49 +00:00
|
|
|
CMAKE_DEPENDENT_OPTION(WITH_SYSTEM_LIBURING "Require and build with system liburing" OFF
|
|
|
|
"HAVE_LIBAIO;WITH_BLUESTORE" OFF)
|
|
|
|
|
2019-07-10 15:10:27 +00:00
|
|
|
CMAKE_DEPENDENT_OPTION(WITH_BLUESTORE_PMEM "Enable PMDK libraries" OFF
|
|
|
|
"WITH_BLUESTORE" OFF)
|
|
|
|
|
2021-02-22 15:23:01 +00:00
|
|
|
CMAKE_DEPENDENT_OPTION(WITH_RBD_MIGRATION_FORMAT_QCOW_V1
|
|
|
|
"Enable librbd QCOW v1 migration format support" ON
|
|
|
|
"WITH_RBD" OFF)
|
|
|
|
|
2019-10-31 13:40:36 +00:00
|
|
|
CMAKE_DEPENDENT_OPTION(WITH_RBD_RWL "Enable librbd persistent write back cache" OFF
|
|
|
|
"WITH_RBD" OFF)
|
|
|
|
|
2020-10-08 10:55:00 +00:00
|
|
|
CMAKE_DEPENDENT_OPTION(WITH_RBD_SSD_CACHE "Enable librbd persistent write back cache for SSDs" OFF
|
|
|
|
"WITH_RBD" OFF)
|
|
|
|
|
2019-07-10 15:30:47 +00:00
|
|
|
CMAKE_DEPENDENT_OPTION(WITH_SYSTEM_PMDK "Require and build with system PMDK" OFF
|
2019-10-31 13:40:36 +00:00
|
|
|
"WITH_RBD_RWL OR WITH_BLUESTORE_PMEM" OFF)
|
2019-07-10 15:30:47 +00:00
|
|
|
|
2019-07-10 15:10:27 +00:00
|
|
|
if(WITH_BLUESTORE_PMEM)
|
|
|
|
set(HAVE_BLUESTORE_PMEM ON)
|
|
|
|
endif()
|
|
|
|
|
2019-08-19 07:21:06 +00:00
|
|
|
CMAKE_DEPENDENT_OPTION(WITH_SPDK "Enable SPDK" OFF
|
2019-08-19 07:18:49 +00:00
|
|
|
"CMAKE_SYSTEM_PROCESSOR MATCHES i386|i686|amd64|x86_64|AMD64|aarch64" OFF)
|
2016-02-03 10:39:28 +00:00
|
|
|
if(WITH_SPDK)
|
2017-11-20 04:55:54 +00:00
|
|
|
if(NOT WITH_BLUESTORE)
|
|
|
|
message(SEND_ERROR "Please enable WITH_BLUESTORE for using SPDK")
|
|
|
|
endif()
|
2017-11-15 12:54:46 +00:00
|
|
|
include(BuildSPDK)
|
|
|
|
build_spdk()
|
2016-02-03 10:39:28 +00:00
|
|
|
set(HAVE_SPDK TRUE)
|
|
|
|
endif(WITH_SPDK)
|
|
|
|
|
2017-11-20 04:55:54 +00:00
|
|
|
if(WITH_BLUESTORE)
|
2019-07-10 15:10:27 +00:00
|
|
|
if(NOT AIO_FOUND AND NOT HAVE_POSIXAIO AND NOT WITH_SPDK AND NOT WITH_BLUESTORE_PMEM)
|
2017-11-20 04:55:54 +00:00
|
|
|
message(SEND_ERROR "WITH_BLUESTORE is ON, "
|
|
|
|
"but none of the bluestore backends is enabled. "
|
2019-07-10 15:10:27 +00:00
|
|
|
"Please install libaio, or enable WITH_SPDK or WITH_BLUESTORE_PMEM (experimental)")
|
2017-11-20 04:55:54 +00:00
|
|
|
endif()
|
2017-10-19 16:44:09 +00:00
|
|
|
endif()
|
2017-06-07 15:22:52 +00:00
|
|
|
|
2017-08-01 23:16:16 +00:00
|
|
|
option(WITH_BLUEFS "libbluefs library" OFF)
|
|
|
|
|
2017-12-29 04:50:20 +00:00
|
|
|
option(WITH_QATZIP "Enable QATZIP" OFF)
|
|
|
|
if(WITH_QATZIP)
|
|
|
|
find_package(qatzip REQUIRED)
|
|
|
|
set(HAVE_QATZIP ${QATZIP_FOUND})
|
|
|
|
endif(WITH_QATZIP)
|
|
|
|
|
2014-06-23 22:32:32 +00:00
|
|
|
# needs mds and? XXX
|
|
|
|
option(WITH_LIBCEPHFS "libcephfs client library" ON)
|
2019-07-23 21:43:50 +00:00
|
|
|
|
2021-01-28 23:11:50 +00:00
|
|
|
option(WITH_LIBCEPHSQLITE "libcephsqlite client library" ON)
|
|
|
|
if(WITH_LIBCEPHSQLITE)
|
|
|
|
find_package(SQLite3 REQUIRED)
|
2019-07-23 21:43:50 +00:00
|
|
|
endif()
|
2014-06-23 22:32:32 +00:00
|
|
|
|
|
|
|
# key-value store
|
2021-07-31 03:36:37 +00:00
|
|
|
option(WITH_KVS "Key value store is here" OFF)
|
2014-06-23 22:32:32 +00:00
|
|
|
|
2019-06-29 15:47:42 +00:00
|
|
|
option(WITH_KRBD "Enable Linux krbd support of 'rbd' utility" ON)
|
2017-01-05 10:59:42 +00:00
|
|
|
|
2019-06-29 15:35:46 +00:00
|
|
|
if(WITH_KRBD AND NOT WITH_RBD)
|
|
|
|
message(FATAL_ERROR "Cannot have WITH_KRBD without WITH_RBD.")
|
2017-01-05 10:59:42 +00:00
|
|
|
endif()
|
2019-09-20 14:02:23 +00:00
|
|
|
if(LINUX)
|
|
|
|
if(WITH_LIBCEPHFS OR WITH_KRBD)
|
|
|
|
# keyutils is only used when talking to the Linux Kernel key store
|
|
|
|
find_package(keyutils REQUIRED)
|
|
|
|
set(HAVE_KEYUTILS ${KEYUTILS_FOUND})
|
|
|
|
endif()
|
|
|
|
endif()
|
2017-01-05 10:59:42 +00:00
|
|
|
|
2014-06-23 22:32:32 +00:00
|
|
|
find_package(snappy REQUIRED)
|
|
|
|
|
2017-12-14 20:13:23 +00:00
|
|
|
option(WITH_BROTLI "Brotli compression support" OFF)
|
|
|
|
if(WITH_BROTLI)
|
|
|
|
set(HAVE_BROTLI TRUE)
|
|
|
|
endif()
|
|
|
|
|
2017-08-15 15:58:35 +00:00
|
|
|
option(WITH_LZ4 "LZ4 compression support" ON)
|
2017-06-02 07:00:11 +00:00
|
|
|
if(WITH_LZ4)
|
2017-08-17 08:01:55 +00:00
|
|
|
find_package(LZ4 1.7 REQUIRED)
|
2017-06-02 07:00:11 +00:00
|
|
|
set(HAVE_LZ4 ${LZ4_FOUND})
|
|
|
|
endif(WITH_LZ4)
|
|
|
|
|
2021-03-12 11:29:54 +00:00
|
|
|
CMAKE_DEPENDENT_OPTION(WITH_CEPH_DEBUG_MUTEX "Use debug ceph::mutex with lockdep" ON
|
|
|
|
"CMAKE_BUILD_TYPE STREQUAL Debug" OFF)
|
2018-09-14 22:19:12 +00:00
|
|
|
|
2015-12-31 02:06:08 +00:00
|
|
|
#if allocator is set on command line make sure it matches below strings
|
2018-08-06 09:58:10 +00:00
|
|
|
set(ALLOCATOR "" CACHE STRING
|
|
|
|
"specify memory allocator to use. currently tcmalloc, tcmalloc_minimal, \
|
|
|
|
jemalloc, and libc is supported. if not specified, will try to find tcmalloc, \
|
|
|
|
and then jemalloc. If neither of then is found. use the one in libc.")
|
2015-12-31 02:06:08 +00:00
|
|
|
if(ALLOCATOR)
|
2016-10-10 21:37:58 +00:00
|
|
|
if(${ALLOCATOR} MATCHES "tcmalloc(_minimal)?")
|
2021-05-14 13:31:20 +00:00
|
|
|
find_package(gperftools 2.6.2 REQUIRED)
|
2016-08-10 16:12:05 +00:00
|
|
|
set(HAVE_LIBTCMALLOC ON)
|
2015-12-31 02:06:08 +00:00
|
|
|
elseif(${ALLOCATOR} STREQUAL "jemalloc")
|
|
|
|
find_package(JeMalloc REQUIRED)
|
2016-12-22 04:36:37 +00:00
|
|
|
set(HAVE_JEMALLOC 1)
|
2018-07-26 05:41:55 +00:00
|
|
|
elseif(NOT ALLOCATOR STREQUAL "libc")
|
|
|
|
message(FATAL_ERROR "Unsupported allocator selected: ${ALLOCATOR}")
|
2015-12-31 02:06:08 +00:00
|
|
|
endif()
|
|
|
|
else(ALLOCATOR)
|
2021-05-14 13:31:20 +00:00
|
|
|
find_package(gperftools 2.6.2)
|
2018-08-05 20:17:47 +00:00
|
|
|
set(HAVE_LIBTCMALLOC ${gperftools_FOUND})
|
2018-07-26 05:28:02 +00:00
|
|
|
if(NOT gperftools_FOUND)
|
2016-05-02 22:21:32 +00:00
|
|
|
find_package(JeMalloc)
|
2018-07-26 05:28:02 +00:00
|
|
|
endif()
|
|
|
|
if(gperftools_FOUND)
|
2016-06-08 03:34:44 +00:00
|
|
|
set(ALLOCATOR tcmalloc)
|
2018-07-26 05:28:02 +00:00
|
|
|
elseif(JeMalloc_FOUND)
|
2016-06-08 03:34:44 +00:00
|
|
|
set(ALLOCATOR jemalloc)
|
|
|
|
else()
|
2017-02-12 14:03:56 +00:00
|
|
|
if(NOT FREEBSD)
|
|
|
|
# FreeBSD already has jemalloc as its default allocator
|
|
|
|
message(WARNING "tcmalloc and jemalloc not found, falling back to libc")
|
|
|
|
endif()
|
2015-12-31 02:06:08 +00:00
|
|
|
set(ALLOCATOR "libc")
|
2018-07-26 05:28:02 +00:00
|
|
|
endif(gperftools_FOUND)
|
2015-12-31 02:06:08 +00:00
|
|
|
endif(ALLOCATOR)
|
2014-06-23 22:32:32 +00:00
|
|
|
|
2021-01-07 13:14:00 +00:00
|
|
|
# Mingw generates incorrect entry points when using "-pie".
|
|
|
|
if(WIN32 OR (HAVE_LIBTCMALLOC AND WITH_STATIC_LIBSTDCXX))
|
2018-07-12 09:17:44 +00:00
|
|
|
set(EXE_LINKER_USE_PIE FALSE)
|
|
|
|
else()
|
|
|
|
set(EXE_LINKER_USE_PIE ${ENABLE_SHARED})
|
|
|
|
endif()
|
2016-12-12 22:16:40 +00:00
|
|
|
|
2016-07-06 17:09:35 +00:00
|
|
|
find_package(CURL REQUIRED)
|
|
|
|
set(CMAKE_REQUIRED_INCLUDES ${CURL_INCLUDE_DIRS})
|
|
|
|
set(CMAKE_REQUIRED_LIBRARIES ${CURL_LIBRARIES})
|
2016-07-11 13:29:09 +00:00
|
|
|
CHECK_SYMBOL_EXISTS(curl_multi_wait curl/curl.h HAVE_CURL_MULTI_WAIT)
|
2015-09-21 15:50:45 +00:00
|
|
|
|
2018-04-26 13:35:20 +00:00
|
|
|
find_package(OpenSSL REQUIRED)
|
2019-04-23 13:47:52 +00:00
|
|
|
set(CRYPTO_LIBS OpenSSL::Crypto)
|
2014-06-23 22:32:32 +00:00
|
|
|
|
2016-08-02 15:50:13 +00:00
|
|
|
option(WITH_DPDK "Enable DPDK messaging" OFF)
|
|
|
|
if(WITH_DPDK)
|
2017-10-27 17:57:55 +00:00
|
|
|
find_package(dpdk)
|
2019-10-24 06:07:18 +00:00
|
|
|
if(NOT DPDK_FOUND)
|
2018-07-28 02:02:17 +00:00
|
|
|
include(BuildDPDK)
|
2018-09-05 07:16:26 +00:00
|
|
|
build_dpdk(${CMAKE_BINARY_DIR}/src/dpdk)
|
2017-11-17 05:47:52 +00:00
|
|
|
endif()
|
2018-07-28 02:02:17 +00:00
|
|
|
set(HAVE_DPDK TRUE)
|
2017-10-27 17:57:55 +00:00
|
|
|
endif()
|
2016-08-02 15:50:13 +00:00
|
|
|
|
2017-05-05 17:59:35 +00:00
|
|
|
option(WITH_BLKIN "Use blkin to emit LTTng tracepoints for Zipkin" OFF)
|
2015-08-17 18:17:23 +00:00
|
|
|
if(WITH_BLKIN)
|
2020-06-19 16:17:40 +00:00
|
|
|
find_package(LTTngUST REQUIRED)
|
2017-09-07 13:43:20 +00:00
|
|
|
set(BLKIN_LIBRARIES blkin ${LTTNGUST_LIBRARIES} lttng-ust-fork)
|
2017-11-03 19:14:35 +00:00
|
|
|
include_directories(SYSTEM src/blkin/blkin-lib)
|
2015-08-17 18:17:23 +00:00
|
|
|
endif(WITH_BLKIN)
|
|
|
|
|
2020-12-03 13:10:09 +00:00
|
|
|
option(WITH_JAEGER "Enable jaegertracing and it's dependent libraries" OFF)
|
2020-10-13 06:54:46 +00:00
|
|
|
if(WITH_JAEGER)
|
|
|
|
set(HAVE_JAEGER TRUE)
|
|
|
|
endif()
|
|
|
|
|
2014-06-23 22:32:32 +00:00
|
|
|
#option for RGW
|
|
|
|
option(WITH_RADOSGW "Rados Gateway is enabled" ON)
|
2018-02-06 22:06:11 +00:00
|
|
|
option(WITH_RADOSGW_BEAST_OPENSSL "Rados Gateway's Beast frontend uses OpenSSL" ON)
|
2019-02-21 07:59:23 +00:00
|
|
|
option(WITH_RADOSGW_AMQP_ENDPOINT "Rados Gateway's pubsub support for AMQP push endpoint" ON)
|
2019-10-10 13:27:35 +00:00
|
|
|
option(WITH_RADOSGW_KAFKA_ENDPOINT "Rados Gateway's pubsub support for Kafka push endpoint" ON)
|
2020-11-01 10:49:26 +00:00
|
|
|
option(WITH_RADOSGW_LUA_PACKAGES "Rados Gateway's support for dynamically adding lua packagess" ON)
|
2021-07-31 13:00:04 +00:00
|
|
|
option(WITH_RADOSGW_DBSTORE "DBStore backend for Rados Gateway" ON)
|
2022-01-14 19:50:47 +00:00
|
|
|
option(WITH_RADOSGW_SELECT_PARQUET "Support for s3 select on parquet objects" OFF)
|
2018-02-06 22:06:11 +00:00
|
|
|
|
2016-10-13 15:35:27 +00:00
|
|
|
if(WITH_RADOSGW)
|
|
|
|
find_package(EXPAT REQUIRED)
|
2018-06-06 02:27:38 +00:00
|
|
|
find_package(OATH REQUIRED)
|
2016-10-15 01:13:22 +00:00
|
|
|
|
2018-03-02 16:41:42 +00:00
|
|
|
# https://curl.haxx.se/docs/install.html mentions the
|
|
|
|
# configure flags for various ssl backends
|
|
|
|
execute_process(
|
|
|
|
COMMAND
|
|
|
|
"sh" "-c"
|
|
|
|
"curl-config --configure | grep with-ssl"
|
|
|
|
RESULT_VARIABLE NO_CURL_SSL_LINK
|
|
|
|
ERROR_VARIABLE CURL_CONFIG_ERRORS
|
|
|
|
)
|
|
|
|
if (CURL_CONFIG_ERRORS)
|
|
|
|
message(WARNING "unable to run curl-config; rgw cannot make ssl requests to external systems reliably")
|
|
|
|
endif()
|
2018-02-06 22:06:11 +00:00
|
|
|
|
2019-05-06 14:08:29 +00:00
|
|
|
if (NOT NO_CURL_SSL_LINK)
|
|
|
|
message(STATUS "libcurl is linked with openssl: explicitly setting locks")
|
|
|
|
set(WITH_CURL_OPENSSL ON)
|
|
|
|
endif() # CURL_SSL_LINK
|
|
|
|
execute_process(
|
|
|
|
COMMAND
|
|
|
|
"sh" "-c"
|
|
|
|
"objdump -p ${OPENSSL_SSL_LIBRARY} | sed -n 's/^ SONAME *//p'"
|
|
|
|
OUTPUT_VARIABLE LIBSSL_SONAME
|
|
|
|
ERROR_VARIABLE OBJDUMP_ERRORS
|
|
|
|
RESULT_VARIABLE OBJDUMP_RESULTS
|
|
|
|
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
|
|
|
if (OBJDUMP_RESULTS)
|
|
|
|
message(FATAL_ERROR "can't run objdump: ${OBJDUMP_RESULTS}")
|
2018-02-06 22:06:11 +00:00
|
|
|
endif()
|
2019-05-06 14:08:29 +00:00
|
|
|
if (NOT OBJDUMP_ERRORS STREQUAL "")
|
|
|
|
message(WARNING "message from objdump: ${OBJDUMP_ERRORS}")
|
|
|
|
endif()
|
|
|
|
execute_process(
|
|
|
|
COMMAND
|
|
|
|
"sh" "-c"
|
|
|
|
"objdump -p ${OPENSSL_CRYPTO_LIBRARY} | sed -n 's/^ SONAME *//p'"
|
|
|
|
OUTPUT_VARIABLE LIBCRYPTO_SONAME
|
|
|
|
ERROR_VARIABLE OBJDUMP_ERRORS
|
|
|
|
RESULT_VARIABLE OBJDUMP_RESULTS
|
|
|
|
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
|
|
|
if (OBJDUMP_RESULTS)
|
|
|
|
message(FATAL_ERROR "can't run objdump: ${OBJDUMP_RESULTS}")
|
|
|
|
endif()
|
|
|
|
if (NOT OBJDUMP_ERRORS STREQUAL "")
|
|
|
|
message(WARNING "message from objdump: ${OBJDUMP_ERRORS}")
|
|
|
|
endif()
|
|
|
|
message(STATUS "ssl soname: ${LIBSSL_SONAME}")
|
|
|
|
message(STATUS "crypto soname: ${LIBCRYPTO_SONAME}")
|
2016-07-11 21:54:07 +00:00
|
|
|
endif (WITH_RADOSGW)
|
|
|
|
|
2015-08-03 11:48:32 +00:00
|
|
|
#option for CephFS
|
|
|
|
option(WITH_CEPHFS "CephFS is enabled" ON)
|
|
|
|
|
2020-03-23 17:15:10 +00:00
|
|
|
if(NOT WIN32)
|
2019-12-18 09:08:21 +00:00
|
|
|
# Please specify 3.[0-7] if you want to build with a certain version of python3.
|
|
|
|
set(WITH_PYTHON3 "3" CACHE STRING "build with specified python3 version")
|
2020-08-08 08:49:54 +00:00
|
|
|
if(NOT WITH_PYTHON3 STREQUAL "3")
|
2019-12-18 09:08:21 +00:00
|
|
|
set(find_python3_exact "EXACT")
|
|
|
|
endif()
|
|
|
|
find_package(Python3 ${WITH_PYTHON3} ${find_python3_exact} REQUIRED
|
|
|
|
COMPONENTS Interpreter Development)
|
|
|
|
unset(find_python3_exact)
|
|
|
|
|
2016-06-30 13:04:30 +00:00
|
|
|
option(WITH_MGR "ceph-mgr is enabled" ON)
|
|
|
|
if(WITH_MGR)
|
2019-12-18 09:08:21 +00:00
|
|
|
set(MGR_PYTHON_EXECUTABLE ${Python3_EXECUTABLE})
|
|
|
|
set(MGR_PYTHON_LIBRARIES ${Python3_LIBRARIES})
|
|
|
|
set(MGR_PYTHON_VERSION_MAJOR ${Python3_VERSION_MAJOR})
|
|
|
|
set(MGR_PYTHON_VERSION_MINOR ${Python3_VERSION_MINOR})
|
2017-10-27 17:57:55 +00:00
|
|
|
# Boost dependency check deferred to Boost section
|
2016-06-30 13:04:30 +00:00
|
|
|
endif(WITH_MGR)
|
2020-03-23 17:15:10 +00:00
|
|
|
endif(NOT WIN32)
|
2016-06-30 13:04:30 +00:00
|
|
|
|
2015-10-16 17:12:41 +00:00
|
|
|
option(WITH_THREAD_SAFE_RES_QUERY "res_query is thread safe" OFF)
|
|
|
|
if(WITH_THREAD_SAFE_RES_QUERY)
|
2017-10-27 17:57:55 +00:00
|
|
|
set(HAVE_THREAD_SAFE_RES_QUERY 1 CACHE INTERNAL "Thread safe res_query supported.")
|
|
|
|
endif()
|
2015-10-16 17:12:41 +00:00
|
|
|
|
2015-12-07 18:33:32 +00:00
|
|
|
option(WITH_REENTRANT_STRSIGNAL "strsignal is reentrant" OFF)
|
|
|
|
if(WITH_REENTRANT_STRSIGNAL)
|
2017-10-27 17:57:55 +00:00
|
|
|
set(HAVE_REENTRANT_STRSIGNAL 1 CACHE INTERNAL "Reentrant strsignal is supported.")
|
|
|
|
endif()
|
2015-12-07 18:33:32 +00:00
|
|
|
|
2016-01-06 11:37:49 +00:00
|
|
|
# -lz link into kv
|
2015-12-31 03:58:55 +00:00
|
|
|
find_package(ZLIB REQUIRED)
|
|
|
|
|
2016-12-05 19:58:22 +00:00
|
|
|
#option for EventTrace
|
2019-06-21 00:46:21 +00:00
|
|
|
CMAKE_DEPENDENT_OPTION(
|
|
|
|
WITH_EVENTTRACE "Event tracing support, requires WITH_LTTNG"
|
|
|
|
OFF "USE_LTTNG" OFF)
|
2016-12-05 19:58:22 +00:00
|
|
|
|
2015-12-31 03:01:52 +00:00
|
|
|
#option for LTTng
|
2016-10-14 17:54:38 +00:00
|
|
|
option(WITH_LTTNG "LTTng tracing is enabled" ON)
|
2015-12-31 03:01:52 +00:00
|
|
|
if(${WITH_LTTNG})
|
2016-08-30 05:33:24 +00:00
|
|
|
find_package(LTTngUST REQUIRED)
|
|
|
|
find_program(LTTNG_GEN_TP
|
|
|
|
lttng-gen-tp)
|
|
|
|
if(NOT LTTNG_GEN_TP)
|
|
|
|
message(FATAL_ERROR "Can't find lttng-gen-tp.")
|
|
|
|
endif()
|
2015-12-31 03:01:52 +00:00
|
|
|
endif(${WITH_LTTNG})
|
|
|
|
|
2017-05-11 13:05:31 +00:00
|
|
|
option(WITH_OSD_INSTRUMENT_FUNCTIONS OFF)
|
|
|
|
|
2015-12-31 04:34:30 +00:00
|
|
|
#option for Babeltrace
|
2017-05-26 09:58:14 +00:00
|
|
|
option(WITH_BABELTRACE "Babeltrace libraries are enabled" ON)
|
|
|
|
if(WITH_BABELTRACE)
|
|
|
|
set(HAVE_BABELTRACE ON)
|
2015-12-31 04:34:30 +00:00
|
|
|
find_package(babeltrace REQUIRED)
|
|
|
|
set(HAVE_BABELTRACE_BABELTRACE_H ${BABELTRACE_FOUND})
|
|
|
|
set(HAVE_BABELTRACE_CTF_EVENTS_H ${BABELTRACE_FOUND})
|
2016-05-02 22:21:32 +00:00
|
|
|
set(HAVE_BABELTRACE_CTF_ITERATOR_H ${BABELTRACE_FOUND})
|
2017-05-26 09:58:14 +00:00
|
|
|
endif(WITH_BABELTRACE)
|
2015-12-31 04:34:30 +00:00
|
|
|
|
2016-05-02 22:21:32 +00:00
|
|
|
option(DEBUG_GATHER "C_Gather debugging is enabled" ON)
|
|
|
|
option(ENABLE_COVERAGE "Coverage is enabled" OFF)
|
|
|
|
option(PG_DEBUG_REFS "PG Ref debugging is enabled" OFF)
|
2014-06-23 22:32:32 +00:00
|
|
|
|
2016-08-23 11:32:47 +00:00
|
|
|
option(WITH_TESTS "enable the build of ceph-test package scripts/binaries" ON)
|
2019-02-22 05:37:43 +00:00
|
|
|
set(UNIT_TESTS_BUILT ${WITH_TESTS})
|
2018-07-02 20:40:38 +00:00
|
|
|
set(CEPH_TEST_TIMEOUT 3600 CACHE STRING
|
|
|
|
"Maximum time before a CTest gets killed" )
|
2016-08-23 11:32:47 +00:00
|
|
|
|
2018-02-21 12:03:23 +00:00
|
|
|
# fio
|
|
|
|
option(WITH_FIO "build with fio plugin enabled" OFF)
|
2020-11-09 07:36:47 +00:00
|
|
|
if(WITH_FIO)
|
2018-02-21 12:03:23 +00:00
|
|
|
include(BuildFIO)
|
|
|
|
build_fio()
|
|
|
|
endif()
|
2015-09-29 18:40:39 +00:00
|
|
|
|
2016-07-19 14:17:23 +00:00
|
|
|
if(LINUX)
|
|
|
|
add_definitions(-D__linux__)
|
|
|
|
endif(LINUX)
|
2014-06-23 22:32:32 +00:00
|
|
|
|
2016-12-22 04:36:37 +00:00
|
|
|
# ASAN and friends
|
|
|
|
option(WITH_ASAN "build with ASAN" OFF)
|
|
|
|
if(WITH_ASAN)
|
2018-08-02 05:59:31 +00:00
|
|
|
list(APPEND sanitizers "address")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
option(WITH_ASAN_LEAK "explicitly enable ASAN leak detection" OFF)
|
|
|
|
if(WITH_ASAN_LEAK)
|
|
|
|
list(APPEND sanitizers "leak")
|
2016-12-22 04:36:37 +00:00
|
|
|
endif()
|
|
|
|
|
|
|
|
option(WITH_TSAN "build with TSAN" OFF)
|
|
|
|
if(WITH_TSAN)
|
2018-08-02 05:59:31 +00:00
|
|
|
list(APPEND sanitizers "thread")
|
2016-12-22 04:36:37 +00:00
|
|
|
endif()
|
|
|
|
|
|
|
|
option(WITH_UBSAN "build with UBSAN" OFF)
|
|
|
|
if(WITH_UBSAN)
|
2019-06-24 15:35:25 +00:00
|
|
|
list(APPEND sanitizers "undefined_behavior")
|
2017-10-13 05:34:09 +00:00
|
|
|
endif()
|
|
|
|
|
2018-08-02 05:59:31 +00:00
|
|
|
if(sanitizers)
|
|
|
|
find_package(Sanitizers REQUIRED ${sanitizers})
|
2020-06-17 23:08:06 +00:00
|
|
|
add_compile_options(${Sanitizers_COMPILE_OPTIONS})
|
2020-08-31 08:09:21 +00:00
|
|
|
string(REPLACE ";" " " sanitiers_compile_flags "${Sanitizers_COMPILE_OPTIONS}")
|
2021-07-20 08:16:07 +00:00
|
|
|
string(APPEND CMAKE_EXE_LINKER_FLAGS " ${sanitiers_compile_flags}")
|
|
|
|
string(APPEND CMAKE_SHARED_LINKER_FLAGS " ${sanitiers_compile_flags}")
|
2016-12-22 04:36:37 +00:00
|
|
|
endif()
|
|
|
|
|
2016-12-10 04:45:22 +00:00
|
|
|
# Rocksdb
|
|
|
|
option(WITH_SYSTEM_ROCKSDB "require and build with system rocksdb" OFF)
|
|
|
|
if (WITH_SYSTEM_ROCKSDB)
|
2019-08-27 10:48:52 +00:00
|
|
|
find_package(RocksDB 5.14 REQUIRED)
|
2016-12-10 04:45:22 +00:00
|
|
|
endif()
|
|
|
|
|
2017-10-08 18:46:26 +00:00
|
|
|
option(WITH_SEASTAR "Build seastar components")
|
|
|
|
set(HAVE_SEASTAR ${WITH_SEASTAR})
|
|
|
|
|
2016-09-22 15:41:53 +00:00
|
|
|
# Boost
|
|
|
|
option(WITH_SYSTEM_BOOST "require and build with system Boost" OFF)
|
|
|
|
|
2017-05-23 07:44:45 +00:00
|
|
|
# Boost::thread depends on Boost::atomic, so list it explicitly.
|
2017-04-20 07:14:02 +00:00
|
|
|
set(BOOST_COMPONENTS
|
2018-06-12 04:35:39 +00:00
|
|
|
atomic chrono thread system regex random program_options date_time
|
2021-07-22 07:49:51 +00:00
|
|
|
iostreams context coroutine)
|
2017-05-18 07:32:59 +00:00
|
|
|
set(BOOST_HEADER_COMPONENTS container)
|
|
|
|
|
2017-04-20 07:14:02 +00:00
|
|
|
if(WITH_MGR)
|
2018-08-09 06:07:10 +00:00
|
|
|
list(APPEND BOOST_COMPONENTS
|
|
|
|
python${MGR_PYTHON_VERSION_MAJOR}${MGR_PYTHON_VERSION_MINOR})
|
2017-04-20 07:14:02 +00:00
|
|
|
endif()
|
2018-06-12 04:35:39 +00:00
|
|
|
if(WITH_SEASTAR)
|
2019-12-19 13:32:47 +00:00
|
|
|
list(APPEND BOOST_COMPONENTS timer)
|
2018-06-12 04:35:39 +00:00
|
|
|
endif()
|
2017-04-20 07:14:02 +00:00
|
|
|
|
2020-11-01 10:49:26 +00:00
|
|
|
if(WITH_RADOSGW AND WITH_RADOSGW_LUA_PACKAGES)
|
|
|
|
list(APPEND BOOST_COMPONENTS filesystem)
|
|
|
|
endif()
|
|
|
|
|
2017-04-16 05:03:52 +00:00
|
|
|
set(Boost_USE_MULTITHREADED ON)
|
|
|
|
# require minimally the bundled version
|
|
|
|
if(WITH_SYSTEM_BOOST)
|
2016-09-22 15:41:53 +00:00
|
|
|
if(ENABLE_SHARED)
|
|
|
|
set(Boost_USE_STATIC_LIBS OFF)
|
|
|
|
else()
|
|
|
|
set(Boost_USE_STATIC_LIBS ON)
|
|
|
|
endif()
|
2018-09-09 07:20:01 +00:00
|
|
|
if(BOOST_ROOT AND CMAKE_LIBRARY_ARCHITECTURE)
|
|
|
|
set(BOOST_LIBRARYDIR "${BOOST_ROOT}/lib/${CMAKE_LIBRARY_ARCHITECTURE}")
|
|
|
|
endif()
|
2021-03-28 21:52:08 +00:00
|
|
|
find_package(Boost 1.73 COMPONENTS ${BOOST_COMPONENTS} REQUIRED)
|
2020-08-18 05:57:59 +00:00
|
|
|
if(NOT ENABLE_SHARED)
|
|
|
|
set_property(TARGET Boost::iostreams APPEND PROPERTY
|
|
|
|
INTERFACE_LINK_LIBRARIES ZLIB::ZLIB)
|
|
|
|
endif()
|
2016-09-22 15:41:53 +00:00
|
|
|
else()
|
|
|
|
set(BOOST_J 1 CACHE STRING
|
|
|
|
"max jobs for Boost build") # override w/-DBOOST_J=<n>
|
2017-04-20 07:14:02 +00:00
|
|
|
set(Boost_USE_STATIC_LIBS ON)
|
2017-04-16 05:03:52 +00:00
|
|
|
include(BuildBoost)
|
2021-03-30 01:45:41 +00:00
|
|
|
build_boost(1.75
|
2017-04-16 05:03:52 +00:00
|
|
|
COMPONENTS ${BOOST_COMPONENTS} ${BOOST_HEADER_COMPONENTS})
|
2016-09-22 15:41:53 +00:00
|
|
|
endif()
|
2018-09-09 07:48:14 +00:00
|
|
|
include_directories(BEFORE SYSTEM ${Boost_INCLUDE_DIRS})
|
2016-09-22 15:41:53 +00:00
|
|
|
|
2018-02-28 09:08:55 +00:00
|
|
|
# dashboard angular2 frontend
|
2018-03-15 08:50:22 +00:00
|
|
|
option(WITH_MGR_DASHBOARD_FRONTEND "Build the mgr/dashboard frontend using `npm`" ON)
|
2018-06-14 12:27:08 +00:00
|
|
|
option(WITH_SYSTEM_NPM "Assume that dashboard build tools already installed through packages" OFF)
|
|
|
|
if(WITH_SYSTEM_NPM)
|
2021-07-21 02:46:51 +00:00
|
|
|
find_program(NPM_EXECUTABLE npm)
|
|
|
|
if(NOT NPM_EXECUTABLE)
|
2018-06-14 12:27:08 +00:00
|
|
|
message(FATAL_ERROR "Can't find npm.")
|
|
|
|
endif()
|
|
|
|
endif()
|
2019-09-30 14:52:40 +00:00
|
|
|
set(DASHBOARD_FRONTEND_LANGS "" CACHE STRING
|
|
|
|
"List of comma separated ceph-dashboard frontend languages to build. \
|
|
|
|
Use value `ALL` to build all languages")
|
2021-04-18 13:38:23 +00:00
|
|
|
CMAKE_DEPENDENT_OPTION(WITH_MGR_ROOK_CLIENT "Enable the mgr's Rook support" ON
|
|
|
|
"WITH_MGR" OFF)
|
2020-01-13 12:00:41 +00:00
|
|
|
|
2016-11-08 19:18:48 +00:00
|
|
|
include_directories(SYSTEM ${PROJECT_BINARY_DIR}/include)
|
2014-06-23 22:32:32 +00:00
|
|
|
|
|
|
|
find_package(Threads REQUIRED)
|
2020-11-27 15:54:27 +00:00
|
|
|
find_package(StdFilesystem REQUIRED)
|
2018-02-09 21:16:43 +00:00
|
|
|
|
2016-05-15 12:39:53 +00:00
|
|
|
option(WITH_SELINUX "build SELinux policy" OFF)
|
|
|
|
if(WITH_SELINUX)
|
2016-06-30 05:10:58 +00:00
|
|
|
find_file(SELINUX_MAKEFILE selinux/devel/Makefile
|
2016-05-15 12:39:53 +00:00
|
|
|
PATH /usr/share)
|
|
|
|
if(NOT SELINUX_MAKEFILE)
|
|
|
|
message(FATAL_ERROR "Can't find selinux's Makefile")
|
|
|
|
endif()
|
|
|
|
add_subdirectory(selinux)
|
|
|
|
endif(WITH_SELINUX)
|
|
|
|
|
2015-08-17 20:26:47 +00:00
|
|
|
# enables testing and creates Make check command
|
2016-07-13 13:14:30 +00:00
|
|
|
add_custom_target(tests
|
|
|
|
COMMENT "Building tests")
|
2015-08-17 20:26:47 +00:00
|
|
|
enable_testing()
|
2016-05-17 15:48:33 +00:00
|
|
|
set(CMAKE_CTEST_COMMAND ctest)
|
2016-07-13 13:14:30 +00:00
|
|
|
add_custom_target(check
|
|
|
|
COMMAND ${CMAKE_CTEST_COMMAND}
|
|
|
|
DEPENDS tests)
|
2015-08-17 20:26:47 +00:00
|
|
|
|
2021-04-08 08:43:33 +00:00
|
|
|
option(WITH_SYSTEMD "build with systemd support" ON)
|
|
|
|
|
2014-06-23 22:32:32 +00:00
|
|
|
add_subdirectory(src)
|
2015-05-22 14:38:29 +00:00
|
|
|
|
2019-12-09 15:17:23 +00:00
|
|
|
add_subdirectory(qa)
|
2021-10-19 10:34:11 +00:00
|
|
|
add_subdirectory(monitoring)
|
2019-12-09 15:17:23 +00:00
|
|
|
|
2016-05-11 13:29:15 +00:00
|
|
|
add_subdirectory(doc)
|
|
|
|
if(WITH_MANPAGE)
|
|
|
|
add_subdirectory(man)
|
|
|
|
endif(WITH_MANPAGE)
|
2016-06-30 08:01:08 +00:00
|
|
|
|
|
|
|
if(WITH_SYSTEMD)
|
|
|
|
add_subdirectory(systemd)
|
|
|
|
endif()
|
|
|
|
|
2017-11-20 07:42:09 +00:00
|
|
|
if(LINUX)
|
|
|
|
add_subdirectory(etc/sysctl)
|
|
|
|
endif()
|
2017-11-14 15:32:39 +00:00
|
|
|
|
2018-10-24 11:17:00 +00:00
|
|
|
option(WITH_GRAFANA "install grafana dashboards" OFF)
|
|
|
|
if(WITH_GRAFANA)
|
|
|
|
add_subdirectory(monitoring/grafana/dashboards)
|
|
|
|
endif()
|
|
|
|
|
2020-03-18 20:26:30 +00:00
|
|
|
CMAKE_DEPENDENT_OPTION(WITH_BOOST_VALGRIND "Boost support for valgrind" OFF
|
|
|
|
"NOT WITH_SYSTEM_BOOST" OFF)
|
|
|
|
|
2017-04-04 02:28:10 +00:00
|
|
|
include(CTags)
|
2017-04-07 03:55:10 +00:00
|
|
|
option(CTAG_EXCLUDES "Exclude files/directories when running ctag.")
|
|
|
|
add_tags(ctags
|
|
|
|
SRC_DIR src
|
|
|
|
TAG_FILE tags
|
|
|
|
EXCLUDE_OPTS ${CTAG_EXCLUDES}
|
2020-08-06 02:05:10 +00:00
|
|
|
EXCLUDES "*.js" "*.css" ".tox" "python-common/build")
|
2017-04-07 03:55:10 +00:00
|
|
|
add_custom_target(tags DEPENDS ctags)
|