2014-06-23 22:32:32 +00:00
|
|
|
include(GetGitRevisionDescription)
|
|
|
|
|
2015-05-07 09:16:31 +00:00
|
|
|
enable_language(C ASM)
|
2016-05-26 10:14:35 +00:00
|
|
|
include(GNUInstallDirs)
|
2016-05-28 09:09:37 +00:00
|
|
|
# for erasure and compressor plugins
|
|
|
|
set(CMAKE_INSTALL_PKGLIBDIR ${CMAKE_INSTALL_LIBDIR}/${PROJECT_NAME})
|
2016-06-29 13:20:28 +00:00
|
|
|
set(CMAKE_INSTALL_FULL_PKGLIBDIR ${CMAKE_INSTALL_FULL_LIBDIR}/${PROJECT_NAME})
|
2017-01-09 15:45:07 +00:00
|
|
|
# so libceph-common can be found
|
|
|
|
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
|
|
|
|
if(NOT CMAKE_INSTALL_RPATH)
|
|
|
|
set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_FULL_PKGLIBDIR}")
|
|
|
|
endif()
|
|
|
|
|
2016-05-28 09:09:37 +00:00
|
|
|
# to be compatible with configure_files shared with autoconfig
|
2016-06-29 13:20:28 +00:00
|
|
|
set(bindir ${CMAKE_INSTALL_FULL_BINDIR})
|
|
|
|
set(sbindir ${CMAKE_INSTALL_FULL_SBINDIR})
|
|
|
|
set(libdir ${CMAKE_INSTALL_FULL_LIBDIR})
|
|
|
|
set(sysconfdir ${CMAKE_INSTALL_FULL_SYSCONFDIR})
|
2016-07-01 13:04:17 +00:00
|
|
|
set(libexecdir ${CMAKE_INSTALL_FULL_LIBEXECDIR})
|
2016-06-29 13:20:28 +00:00
|
|
|
set(pkgdatadir ${CMAKE_INSTALL_FULL_DATADIR})
|
|
|
|
set(datadir ${CMAKE_INSTALL_FULL_DATADIR}/${PROJECT_NAME})
|
2014-06-23 22:32:32 +00:00
|
|
|
set(prefix ${CMAKE_INSTALL_PREFIX})
|
|
|
|
|
2016-06-29 13:20:28 +00:00
|
|
|
add_definitions("-DCEPH_LIBDIR=\"${CMAKE_INSTALL_FULL_LIBDIR}\"")
|
|
|
|
add_definitions("-DCEPH_PKGLIBDIR=\"${CMAKE_INSTALL_FULL_PKGLIBDIR}\"")
|
2016-07-24 11:31:54 +00:00
|
|
|
add_definitions("-DHAVE_CONFIG_H -D__CEPH__ -D_REENTRANT -D_THREAD_SAFE -D__STDC_FORMAT_MACROS")
|
2016-10-25 04:20:51 +00:00
|
|
|
if(LINUX)
|
|
|
|
add_definitions("-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64")
|
|
|
|
endif()
|
2014-06-23 22:32:32 +00:00
|
|
|
|
2016-07-24 11:31:54 +00:00
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wtype-limits -Wignored-qualifiers -Winit-self")
|
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wpointer-arith -Werror=format-security -fno-strict-aliasing -fsigned-char")
|
|
|
|
|
2016-11-23 08:16:36 +00:00
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ftemplate-depth-1024 -Wno-invalid-offsetof")
|
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wnon-virtual-dtor")
|
2016-07-24 11:31:54 +00:00
|
|
|
if(CMAKE_CXX_COMPILER_ID STREQUAL GNU)
|
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -rdynamic")
|
2016-11-23 07:55:15 +00:00
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unknown-pragmas")
|
2016-11-23 08:16:36 +00:00
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wstrict-null-sentinel -Woverloaded-virtual")
|
2016-08-17 11:46:40 +00:00
|
|
|
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pie")
|
2016-07-24 11:31:54 +00:00
|
|
|
elseif(CMAKE_CXX_COMPILER_ID STREQUAL Clang)
|
|
|
|
set(CMAKE_EXE_LINKER_FLAGS "-Wl,-export-dynamic")
|
|
|
|
set(CMAKE_LINKER_FLAGS "${CMAKE_LINKER_FLAGS} -rdynamic -Wl,-export-dynamic -export-dynamic")
|
2016-11-23 08:16:36 +00:00
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-inconsistent-missing-override -Wno-mismatched-tags")
|
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-private-field")
|
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unused-function")
|
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unused-local-typedef")
|
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-varargs")
|
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-gnu-designator")
|
2016-07-24 11:31:54 +00:00
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-missing-braces -Wno-parentheses -Wno-deprecated-register")
|
|
|
|
endif(CMAKE_CXX_COMPILER_ID STREQUAL GNU)
|
2016-11-23 08:16:36 +00:00
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} ${CMAKE_CXX_FLAGS}")
|
2014-06-23 22:32:32 +00:00
|
|
|
|
2016-06-17 19:55:52 +00:00
|
|
|
if(NOT CMAKE_BUILD_TYPE)
|
|
|
|
set(CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING "Default BUILD_TYPE is RelWithDebInfo, other options are: Debug, Release, and MinSizeRel." FORCE)
|
|
|
|
endif()
|
|
|
|
|
2016-06-28 04:57:21 +00:00
|
|
|
if(NOT CMAKE_BUILD_TYPE STREQUAL Debug)
|
|
|
|
# we use assert(3) for testing, so scrub the -DNDEBUG defined by default
|
|
|
|
string(TOUPPER "${CMAKE_BUILD_TYPE}" build_type_upper)
|
|
|
|
foreach(flags
|
|
|
|
CMAKE_CXX_FLAGS_${build_type_upper}
|
|
|
|
CMAKE_C_FLAGS_${build_type_upper})
|
|
|
|
string(REGEX REPLACE "(^| )[/-]D *NDEBUG($| )" " " "${flags}" "${${flags}}")
|
|
|
|
endforeach()
|
|
|
|
endif()
|
|
|
|
|
2016-03-24 15:20:44 +00:00
|
|
|
include(CheckCCompilerFlag)
|
2016-07-24 11:31:54 +00:00
|
|
|
if(CMAKE_CXX_COMPILER_ID STREQUAL GNU)
|
|
|
|
CHECK_C_COMPILER_FLAG("-Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=2" HAS_FORTIFY_SOURCE)
|
|
|
|
if(NOT CMAKE_BUILD_TYPE STREQUAL Debug)
|
|
|
|
if(HAS_FORTIFY_SOURCE)
|
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=2")
|
2016-11-23 08:16:36 +00:00
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=2")
|
2016-07-24 11:31:54 +00:00
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
CHECK_C_COMPILER_FLAG(-fstack-protector-strong HAS_STACK_PROTECT)
|
|
|
|
if (HAS_STACK_PROTECT)
|
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fstack-protector-strong")
|
2016-11-23 08:16:36 +00:00
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fstack-protector-strong")
|
2016-07-24 11:31:54 +00:00
|
|
|
endif()
|
|
|
|
endif(CMAKE_CXX_COMPILER_ID STREQUAL GNU)
|
2016-03-24 15:20:44 +00:00
|
|
|
|
2017-03-08 20:54:22 +00:00
|
|
|
if(CMAKE_SYSTEM_PROCESSOR MATCHES "ppc64le")
|
|
|
|
message(STATUS " we are ppc64le")
|
|
|
|
CHECK_C_COMPILER_FLAG("-maltivec" HAS_ALTIVEC)
|
|
|
|
if(HAS_ALTIVEC)
|
|
|
|
message(STATUS " HAS_ALTIVEC yes")
|
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -maltivec")
|
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} -maltivec")
|
|
|
|
endif(HAS_ALTIVEC)
|
|
|
|
CHECK_C_COMPILER_FLAG("-mcpu=power8" HAVE_POWER8)
|
|
|
|
if(HAVE_POWER8)
|
|
|
|
message(STATUS " HAVE_POWER8 yes")
|
|
|
|
endif(HAVE_POWER8)
|
|
|
|
else(CMAKE_SYSTEM_PROCESSOR MATCHES "ppc64le")
|
|
|
|
set(CMAKE_ASM_COMPILER ${PROJECT_SOURCE_DIR}/src/yasm-wrapper)
|
|
|
|
set(CMAKE_ASM_FLAGS "-f elf64")
|
|
|
|
endif(CMAKE_SYSTEM_PROCESSOR MATCHES "ppc64le")
|
2016-07-24 11:37:28 +00:00
|
|
|
|
2015-08-07 05:56:52 +00:00
|
|
|
execute_process(
|
2015-09-29 13:55:04 +00:00
|
|
|
COMMAND yasm -f elf64 ${CMAKE_SOURCE_DIR}/src/common/crc32c_intel_fast_asm.S -o /dev/null
|
|
|
|
RESULT_VARIABLE no_yasm
|
2015-08-07 05:56:52 +00:00
|
|
|
OUTPUT_QUIET)
|
|
|
|
if(no_yasm)
|
2015-09-29 13:55:04 +00:00
|
|
|
message(STATUS " we do not have a modern/working yasm")
|
2015-08-07 05:56:52 +00:00
|
|
|
else(no_yasm)
|
2015-09-29 13:55:04 +00:00
|
|
|
message(STATUS " we have a modern and working yasm")
|
2016-10-04 23:55:27 +00:00
|
|
|
if(CMAKE_SYSTEM_PROCESSOR MATCHES "amd64|x86_64")
|
2015-09-29 13:55:04 +00:00
|
|
|
message(STATUS " we are x84_64")
|
|
|
|
set(save_quiet ${CMAKE_REQUIRED_QUIET})
|
|
|
|
set(CMAKE_REQUIRED_QUIET true)
|
2015-08-07 05:56:52 +00:00
|
|
|
include(CheckCXXSourceCompiles)
|
|
|
|
check_cxx_source_compiles("
|
|
|
|
#if defined(__x86_64__) && defined(__ILP32__)
|
|
|
|
#error x32
|
|
|
|
#endif
|
|
|
|
int main() {}
|
|
|
|
" not_arch_x32)
|
2015-09-29 13:55:04 +00:00
|
|
|
set(CMAKE_REQUIRED_QUIET ${save_quiet})
|
2015-08-07 05:56:52 +00:00
|
|
|
if(not_arch_x32)
|
2015-09-29 13:55:04 +00:00
|
|
|
message(STATUS " we are not x32")
|
|
|
|
set(HAVE_GOOD_YASM_ELF64 1)
|
|
|
|
execute_process(COMMAND yasm -f elf64 -i
|
|
|
|
${CMAKE_SOURCE_DIR}/src/erasure-code/isa/isa-l/include/
|
|
|
|
${CMAKE_SOURCE_DIR}/src/erasure-code/isa/isa-l/erasure_code/gf_vect_dot_prod_avx2.asm.s
|
|
|
|
-o /dev/null
|
|
|
|
RESULT_VARIABLE rc
|
|
|
|
OUTPUT_QUIET)
|
|
|
|
if(NOT rc)
|
|
|
|
set(HAVE_BETTER_YASM_ELF64 1)
|
|
|
|
message(STATUS " yasm can also build the isa-l stuff")
|
|
|
|
endif(NOT rc)
|
2015-08-07 05:56:52 +00:00
|
|
|
else(not_arch_x32)
|
2015-09-29 13:55:04 +00:00
|
|
|
message(STATUS " we are x32; no yasm for you")
|
2015-08-07 05:56:52 +00:00
|
|
|
endif(not_arch_x32)
|
2016-10-04 23:55:27 +00:00
|
|
|
else(CMAKE_SYSTEM_PROCESSOR MATCHES "amd64|x86_64")
|
2015-09-29 13:55:04 +00:00
|
|
|
message(STATUS " we are not x86_64 && !x32")
|
2016-10-04 23:55:27 +00:00
|
|
|
endif(CMAKE_SYSTEM_PROCESSOR MATCHES "amd64|x86_64")
|
2015-08-07 05:56:52 +00:00
|
|
|
endif(no_yasm)
|
|
|
|
|
2015-07-30 20:16:58 +00:00
|
|
|
# require c++11
|
2016-07-13 09:43:12 +00:00
|
|
|
if(CMAKE_VERSION VERSION_LESS "3.1")
|
|
|
|
include(CheckCXXCompilerFlag)
|
|
|
|
CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11)
|
2016-12-08 01:48:24 +00:00
|
|
|
if(NOT COMPILER_SUPPORTS_CXX11)
|
|
|
|
message(FATAL_ERROR
|
|
|
|
"The compiler ${CMAKE_CXX_COMPILER} has no C++11 support.")
|
2016-07-13 09:43:12 +00:00
|
|
|
endif()
|
2016-12-08 01:48:24 +00:00
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
|
2016-12-08 01:45:18 +00:00
|
|
|
include(CheckCCompilerFlag)
|
|
|
|
CHECK_C_COMPILER_FLAG("-std=gnu99" COMPILER_SUPPORTS_GNU99)
|
|
|
|
if(NOT COMPILER_SUPPORTS_GNU99)
|
|
|
|
message(FATAL_ERROR
|
|
|
|
"The compiler ${CMAKE_C_COMPILER} has no GNU C99 support.")
|
|
|
|
endif()
|
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99")
|
2015-07-30 20:16:58 +00:00
|
|
|
else()
|
2016-07-13 09:43:12 +00:00
|
|
|
set(CMAKE_CXX_STANDARD 11)
|
|
|
|
set(CMAKE_CXX_EXTENSIONS OFF)
|
2016-12-08 01:48:24 +00:00
|
|
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
2016-12-08 01:45:18 +00:00
|
|
|
set(CMAKE_C_STANDARD 99)
|
|
|
|
# we use `asm()` to inline assembly, so enable the GNU extension
|
|
|
|
set(CMAKE_C_EXTENSIONS ON)
|
|
|
|
set(C_STANDARD_REQUIRED ON)
|
2015-07-30 20:16:58 +00:00
|
|
|
endif()
|
|
|
|
|
2016-06-06 15:32:01 +00:00
|
|
|
## Handle diagnostics color if compiler supports them.
|
2016-06-03 15:44:03 +00:00
|
|
|
CHECK_C_COMPILER_FLAG("-fdiagnostics-color=always"
|
2016-06-06 15:32:01 +00:00
|
|
|
COMPILER_SUPPORTS_DIAGNOSTICS_COLOR)
|
|
|
|
|
|
|
|
set(DIAGNOSTICS_COLOR "auto"
|
|
|
|
CACHE STRING "Used if the C/C++ compiler supports the -fdiagnostics-color option. May have one of three values -- 'auto' (default), 'always', or 'never'. If set to 'always' and the compiler supports the option, 'make [...] | less -R' will make visible diagnostics colorization of compiler output.")
|
|
|
|
|
|
|
|
if(COMPILER_SUPPORTS_DIAGNOSTICS_COLOR)
|
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fdiagnostics-color=${DIAGNOSTICS_COLOR}")
|
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fdiagnostics-color=${DIAGNOSTICS_COLOR}")
|
2016-06-03 15:44:03 +00:00
|
|
|
endif()
|
|
|
|
|
2016-07-29 04:11:14 +00:00
|
|
|
set(EXTRALIBS rt ${CMAKE_DL_LIBS} ${ATOMIC_OPS_LIBRARIES})
|
2016-07-24 11:51:16 +00:00
|
|
|
if(LINUX)
|
|
|
|
set(LIB_RESOLV resolv)
|
|
|
|
list(APPEND EXTRALIBS ${LIB_RESOLV})
|
|
|
|
endif(LINUX)
|
2014-06-23 22:32:32 +00:00
|
|
|
|
2016-07-20 05:48:54 +00:00
|
|
|
option(WITH_PROFILER "build extra profiler binaries" OFF)
|
|
|
|
if(WITH_PROFILER)
|
2016-07-25 08:18:46 +00:00
|
|
|
find_package(gperftools REQUIRED)
|
2014-06-23 22:32:32 +00:00
|
|
|
list(APPEND EXTRALIBS profiler)
|
2016-07-20 05:48:54 +00:00
|
|
|
endif(WITH_PROFILER)
|
2014-06-23 22:32:32 +00:00
|
|
|
|
2016-05-02 22:21:32 +00:00
|
|
|
if(${ENABLE_COVERAGE})
|
|
|
|
find_program(HAVE_GCOV gcov)
|
|
|
|
if(NOT HAVE_GCOV)
|
|
|
|
message(FATAL_ERROR "Coverage Enabled but gcov Not Found")
|
|
|
|
endif(NOT HAVE_GCOV)
|
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fprofile-arcs -ftest-coverage -O0")
|
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fprofile-arcs -ftest-coverage")
|
|
|
|
list(APPEND EXTRALIBS gcov)
|
|
|
|
endif(${ENABLE_COVERAGE})
|
|
|
|
|
2015-03-15 19:11:48 +00:00
|
|
|
if(USE_NSS)
|
|
|
|
if(NSS_FOUND)
|
|
|
|
if(NSPR_FOUND)
|
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -I${NSS_INCLUDE_DIR} -I${NSPR_INCLUDE_DIR}")
|
|
|
|
endif(NSPR_FOUND)
|
|
|
|
endif(NSS_FOUND)
|
|
|
|
endif(USE_NSS)
|
2014-06-23 22:32:32 +00:00
|
|
|
|
|
|
|
set(GCOV_PREFIX_STRIP 4)
|
|
|
|
|
2016-01-11 04:33:13 +00:00
|
|
|
option(ENABLE_GIT_VERSION "build Ceph with git version string" ON)
|
|
|
|
if(${ENABLE_GIT_VERSION})
|
|
|
|
get_git_head_revision(GIT_REFSPEC CEPH_GIT_VER)
|
|
|
|
git_describe(CEPH_GIT_NICE_VER --always)
|
2016-10-14 18:02:17 +00:00
|
|
|
#if building from a source tarball via make-dist
|
|
|
|
if(${CEPH_GIT_VER} STREQUAL "GITDIR-NOTFOUND")
|
|
|
|
message(STATUS "Ceph/.git directory not found, parsing ${CMAKE_CURRENT_SOURCE_DIR}/.git_version for CEPH_GIT_VER and CEPH_GIT_NICE_VER")
|
|
|
|
file(STRINGS ${CMAKE_CURRENT_SOURCE_DIR}/.git_version CEPH_GIT_SHA_AND_TAG)
|
|
|
|
list(GET CEPH_GIT_SHA_AND_TAG 0 CEPH_GIT_VER)
|
|
|
|
list(GET CEPH_GIT_SHA_AND_TAG 1 CEPH_GIT_NICE_VER)
|
|
|
|
endif(${CEPH_GIT_VER} STREQUAL "GITDIR-NOTFOUND")
|
2016-10-26 12:34:45 +00:00
|
|
|
# remove 'v' prefix from raw git version
|
|
|
|
string(SUBSTRING ${CEPH_GIT_NICE_VER} 1 -1 CEPH_GIT_NICE_VER)
|
2016-01-11 04:33:13 +00:00
|
|
|
else(${ENABLE_GIT_VERSION})
|
|
|
|
set(CEPH_GIT_VER "no_version")
|
|
|
|
set(CEPH_GIT_NICE_VER "Development")
|
|
|
|
endif(${ENABLE_GIT_VERSION})
|
2014-06-23 22:32:32 +00:00
|
|
|
|
2016-05-21 12:45:55 +00:00
|
|
|
option(WITH_OCF "build OCF-compliant cluster resource agent" OFF)
|
|
|
|
if(WITH_OCF)
|
|
|
|
add_subdirectory(ocf)
|
|
|
|
endif()
|
|
|
|
|
2016-05-24 19:25:16 +00:00
|
|
|
option(WITH_CEPHFS_JAVA "build libcephfs Java bindings" OFF)
|
|
|
|
if(WITH_CEPHFS_JAVA)
|
|
|
|
add_subdirectory(java)
|
|
|
|
endif()
|
|
|
|
|
2014-06-23 22:32:32 +00:00
|
|
|
# Python stuff
|
2016-08-12 09:27:34 +00:00
|
|
|
find_package(PythonInterp 2 REQUIRED)
|
|
|
|
find_package(PythonLibs 2 REQUIRED)
|
2016-09-08 08:47:59 +00:00
|
|
|
|
|
|
|
option(WITH_PYTHON3 "build python3 bindings" "CHECK")
|
|
|
|
if(WITH_PYTHON3 MATCHES "check|CHECK")
|
|
|
|
find_package(Python3Interp 3 QUIET)
|
|
|
|
find_package(Python3Libs 3 QUIET)
|
|
|
|
if(PYTHON3INTERP_FOUND AND PYTHON3LIBS_FOUND)
|
|
|
|
set(WITH_PYTHON3 ON)
|
|
|
|
else()
|
|
|
|
set(WITH_PYTHON3 OFF)
|
|
|
|
endif()
|
|
|
|
elseif(WITH_PYTHON3)
|
|
|
|
find_package(Python3Interp 3 REQUIRED)
|
|
|
|
find_package(Python3Libs 3 REQUIRED)
|
|
|
|
endif()
|
2014-06-23 22:32:32 +00:00
|
|
|
|
2014-09-04 15:18:55 +00:00
|
|
|
if(HAVE_XIO)
|
2016-05-03 17:19:43 +00:00
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -I${XIO_INCLUDE_DIR}")
|
|
|
|
list(APPEND EXTRALIBS ${XIO_LIBRARY} pthread rt)
|
2014-09-04 15:18:55 +00:00
|
|
|
endif(HAVE_XIO)
|
|
|
|
|
2016-10-13 03:44:55 +00:00
|
|
|
if(HAVE_RDMA)
|
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -I${RDMA_INCLUDE_DIR}")
|
|
|
|
list(APPEND EXTRALIBS ${RDMA_LIBRARIES} pthread rt)
|
|
|
|
endif(HAVE_RDMA)
|
|
|
|
|
2016-08-02 15:50:13 +00:00
|
|
|
if(HAVE_DPDK)
|
|
|
|
set(CMAKE_CXX_FLAGS "-march=native ${CMAKE_CXX_FLAGS} -I${DPDK_INCLUDE_DIR}")
|
|
|
|
list(APPEND EXTRALIBS ${DPDK_LIBRARY})
|
|
|
|
if(NOT USE_CRYPTOPP)
|
|
|
|
message(FATAL_ERROR "CRYPTOPP must be supported when enable DPDK.")
|
|
|
|
endif(NOT USE_CRYPTOPP)
|
|
|
|
list(APPEND EXTRALIBS ${DPDK_LIBRARIES})
|
|
|
|
endif(HAVE_DPDK)
|
|
|
|
|
2015-12-31 02:06:08 +00:00
|
|
|
# sort out which allocator to use
|
2016-06-08 03:34:44 +00:00
|
|
|
if(ALLOCATOR STREQUAL "tcmalloc")
|
2016-08-10 16:12:05 +00:00
|
|
|
set(ALLOC_LIBS ${GPERFTOOLS_TCMALLOC_LIBRARY})
|
2014-06-23 22:32:32 +00:00
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-builtin-malloc -fno-builtin-calloc -fno-builtin-realloc -fno-builtin-free")
|
|
|
|
set(TCMALLOC_srcs perfglue/heap_profiler.cc)
|
2016-09-17 04:51:05 +00:00
|
|
|
elseif(ALLOCATOR STREQUAL "tcmalloc_minimal")
|
|
|
|
set(ALLOC_LIBS ${GPERFTOOLS_TCMALLOC_MINIMAL_LIBRARY})
|
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-builtin-malloc -fno-builtin-calloc -fno-builtin-realloc -fno-builtin-free")
|
|
|
|
set(TCMALLOC_srcs perfglue/disabled_heap_profiler.cc)
|
2016-06-08 03:34:44 +00:00
|
|
|
elseif(ALLOCATOR STREQUAL "jemalloc")
|
2016-12-10 04:47:38 +00:00
|
|
|
set(ALLOC_LIBS ${JEMALLOC_LIBRARIES})
|
2015-12-31 02:06:08 +00:00
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-builtin-malloc -fno-builtin-calloc -fno-builtin-realloc -fno-builtin-free")
|
|
|
|
set(TCMALLOC_srcs perfglue/disabled_heap_profiler.cc)
|
2016-06-08 03:34:44 +00:00
|
|
|
elseif(ALLOCATOR STREQUAL "libc")
|
2014-06-23 22:32:32 +00:00
|
|
|
set(TCMALLOC_srcs perfglue/disabled_heap_profiler.cc)
|
2015-12-31 02:06:08 +00:00
|
|
|
endif()
|
2014-06-23 22:32:32 +00:00
|
|
|
|
|
|
|
# tcmalloc heap profiler
|
|
|
|
set(heap_profiler_files ${TCMALLOC_srcs})
|
|
|
|
add_library(heap_profiler_objs OBJECT ${heap_profiler_files})
|
|
|
|
|
|
|
|
# Common infrastructure
|
|
|
|
configure_file(
|
|
|
|
${CMAKE_SOURCE_DIR}/src/ceph_ver.h.in.cmake
|
|
|
|
${CMAKE_BINARY_DIR}/src/include/ceph_ver.h
|
|
|
|
@ONLY)
|
|
|
|
|
|
|
|
set(arch_files
|
|
|
|
arch/arm.c
|
|
|
|
arch/intel.c
|
2017-03-08 20:54:22 +00:00
|
|
|
arch/ppc.c
|
2014-06-23 22:32:32 +00:00
|
|
|
arch/probe.cc)
|
|
|
|
|
|
|
|
set(auth_files
|
|
|
|
auth/AuthAuthorizeHandler.cc
|
|
|
|
auth/AuthClientHandler.cc
|
|
|
|
auth/AuthSessionHandler.cc
|
|
|
|
auth/AuthMethodList.cc
|
|
|
|
auth/cephx/CephxAuthorizeHandler.cc
|
|
|
|
auth/cephx/CephxClientHandler.cc
|
|
|
|
auth/cephx/CephxProtocol.cc
|
|
|
|
auth/cephx/CephxSessionHandler.cc
|
|
|
|
auth/none/AuthNoneAuthorizeHandler.cc
|
|
|
|
auth/unknown/AuthUnknownAuthorizeHandler.cc
|
|
|
|
auth/Crypto.cc
|
|
|
|
auth/KeyRing.cc
|
|
|
|
auth/RotatingKeyRing.cc)
|
|
|
|
|
|
|
|
set(mds_files)
|
|
|
|
list(APPEND mds_files
|
|
|
|
mds/MDSMap.cc
|
2016-02-17 16:03:27 +00:00
|
|
|
mds/FSMap.cc
|
2016-04-06 12:50:54 +00:00
|
|
|
mds/FSMapUser.cc
|
2014-06-23 22:32:32 +00:00
|
|
|
mds/inode_backtrace.cc
|
2016-07-26 05:41:48 +00:00
|
|
|
mds/mdstypes.cc
|
|
|
|
mds/flock.cc)
|
2014-06-23 22:32:32 +00:00
|
|
|
|
|
|
|
set(crush_srcs
|
|
|
|
crush/builder.c
|
|
|
|
crush/mapper.c
|
|
|
|
crush/crush.c
|
|
|
|
crush/hash.c
|
|
|
|
crush/CrushWrapper.cc
|
|
|
|
crush/CrushCompiler.cc
|
2016-03-29 16:49:16 +00:00
|
|
|
crush/CrushTester.cc
|
|
|
|
crush/CrushLocation.cc)
|
2014-06-23 22:32:32 +00:00
|
|
|
|
2015-08-17 20:26:47 +00:00
|
|
|
add_library(crush STATIC ${crush_srcs})
|
|
|
|
|
2014-06-23 22:32:32 +00:00
|
|
|
add_subdirectory(json_spirit)
|
|
|
|
|
2015-10-26 02:07:03 +00:00
|
|
|
include_directories("${CMAKE_SOURCE_DIR}/src/xxHash")
|
|
|
|
|
2014-09-04 15:18:55 +00:00
|
|
|
set(xio_common_srcs)
|
|
|
|
if(HAVE_XIO)
|
|
|
|
list(APPEND xio_common_srcs
|
|
|
|
msg/xio/XioConnection.cc
|
|
|
|
msg/xio/XioMsg.cc
|
|
|
|
msg/xio/XioPool.cc
|
|
|
|
msg/xio/XioMessenger.cc
|
|
|
|
msg/xio/XioPortal.cc
|
|
|
|
msg/xio/QueueStrategy.cc)
|
|
|
|
endif(HAVE_XIO)
|
|
|
|
|
2016-10-13 03:44:55 +00:00
|
|
|
set(async_rdma_common_srcs)
|
|
|
|
if(HAVE_RDMA)
|
|
|
|
list(APPEND async_rdma_common_srcs
|
|
|
|
msg/async/rdma/Infiniband.cc
|
2017-03-15 09:08:38 +00:00
|
|
|
msg/async/rdma/Device.cc
|
2016-10-13 03:44:55 +00:00
|
|
|
msg/async/rdma/RDMAConnectedSocketImpl.cc
|
2017-03-22 07:05:21 +00:00
|
|
|
msg/async/rdma/RDMAConnTCP.cc
|
2016-10-13 03:44:55 +00:00
|
|
|
msg/async/rdma/RDMAServerSocketImpl.cc
|
|
|
|
msg/async/rdma/RDMAStack.cc)
|
|
|
|
endif(HAVE_RDMA)
|
|
|
|
|
2016-08-02 15:50:13 +00:00
|
|
|
set(dpdk_common_srcs)
|
|
|
|
if(HAVE_DPDK)
|
|
|
|
list(APPEND dpdk_common_srcs
|
|
|
|
msg/async/dpdk/ARP.cc
|
|
|
|
msg/async/dpdk/DPDK.cc
|
|
|
|
msg/async/dpdk/dpdk_rte.cc
|
|
|
|
msg/async/dpdk/DPDKStack.cc
|
|
|
|
msg/async/dpdk/EventDPDK.cc
|
|
|
|
msg/async/dpdk/IP.cc
|
|
|
|
msg/async/dpdk/net.cc
|
|
|
|
msg/async/dpdk/IPChecksum.cc
|
|
|
|
msg/async/dpdk/Packet.cc
|
|
|
|
msg/async/dpdk/TCP.cc
|
|
|
|
msg/async/dpdk/UserspaceEvent.cc
|
|
|
|
msg/async/dpdk/ethernet.cc)
|
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -I${DPDK_INCLUDE_DIR}")
|
|
|
|
endif(HAVE_DPDK)
|
|
|
|
|
2015-09-29 13:55:04 +00:00
|
|
|
if(HAVE_GOOD_YASM_ELF64)
|
|
|
|
set(yasm_srcs
|
|
|
|
common/crc32c_intel_fast_asm.S
|
|
|
|
common/crc32c_intel_fast_zero_asm.S)
|
|
|
|
endif(HAVE_GOOD_YASM_ELF64)
|
|
|
|
|
2016-07-26 06:53:07 +00:00
|
|
|
add_library(common_buffer_obj OBJECT
|
|
|
|
common/buffer.cc)
|
|
|
|
|
2016-05-19 04:49:58 +00:00
|
|
|
add_library(common_texttable_obj OBJECT
|
|
|
|
common/TextTable.cc)
|
|
|
|
|
2014-06-23 22:32:32 +00:00
|
|
|
set(libcommon_files
|
|
|
|
${CMAKE_BINARY_DIR}/src/include/ceph_ver.h
|
|
|
|
ceph_ver.c
|
2016-09-21 17:02:34 +00:00
|
|
|
common/AsyncOpTracker.cc
|
2014-06-23 22:32:32 +00:00
|
|
|
common/DecayCounter.cc
|
|
|
|
common/LogClient.cc
|
|
|
|
common/LogEntry.cc
|
|
|
|
common/PrebufferedStreambuf.cc
|
|
|
|
common/BackTrace.cc
|
|
|
|
common/perf_counters.cc
|
2017-02-01 09:03:06 +00:00
|
|
|
common/perf_histogram.cc
|
2015-09-14 17:30:38 +00:00
|
|
|
common/mutex_debug.cc
|
2014-06-23 22:32:32 +00:00
|
|
|
common/Mutex.cc
|
|
|
|
common/OutputDataSocket.cc
|
|
|
|
common/admin_socket.cc
|
|
|
|
common/admin_socket_client.cc
|
|
|
|
common/bloom_filter.cc
|
|
|
|
common/Readahead.cc
|
|
|
|
${crush_srcs}
|
|
|
|
common/cmdparse.cc
|
|
|
|
common/escape.c
|
|
|
|
common/io_priority.cc
|
|
|
|
common/Clock.cc
|
2015-09-14 16:18:57 +00:00
|
|
|
common/ceph_time.cc
|
2016-11-08 21:37:25 +00:00
|
|
|
common/mempool.cc
|
2014-06-23 22:32:32 +00:00
|
|
|
common/Throttle.cc
|
|
|
|
common/Timer.cc
|
|
|
|
common/Finisher.cc
|
|
|
|
common/environment.cc
|
|
|
|
common/sctp_crc32.c
|
|
|
|
common/crc32c.cc
|
|
|
|
common/crc32c_intel_baseline.c
|
|
|
|
common/crc32c_intel_fast.c
|
2017-03-08 20:54:22 +00:00
|
|
|
common/crc32c_ppc.c
|
2015-09-29 13:55:04 +00:00
|
|
|
${yasm_srcs}
|
2015-10-26 19:56:06 +00:00
|
|
|
xxHash/xxhash.c
|
2014-06-23 22:32:32 +00:00
|
|
|
common/assert.cc
|
|
|
|
common/run_cmd.cc
|
|
|
|
common/WorkQueue.cc
|
|
|
|
common/ConfUtils.cc
|
|
|
|
common/MemoryModel.cc
|
|
|
|
common/fd.cc
|
|
|
|
common/xattr.c
|
|
|
|
common/str_list.cc
|
|
|
|
common/str_map.cc
|
|
|
|
common/snap_types.cc
|
|
|
|
common/errno.cc
|
|
|
|
common/TrackedOp.cc
|
|
|
|
common/SloppyCRCMap.cc
|
|
|
|
common/types.cc
|
|
|
|
log/Log.cc
|
|
|
|
log/SubsystemMap.cc
|
|
|
|
mon/MonCap.cc
|
|
|
|
mon/MonClient.cc
|
|
|
|
mon/MonMap.cc
|
2016-06-30 13:04:30 +00:00
|
|
|
mgr/MgrClient.cc
|
2014-06-23 22:32:32 +00:00
|
|
|
msg/simple/Accepter.cc
|
2016-05-06 07:58:19 +00:00
|
|
|
msg/DispatchQueue.cc
|
2014-06-23 22:32:32 +00:00
|
|
|
msg/Message.cc
|
|
|
|
osd/ECMsgTypes.cc
|
|
|
|
osd/HitSet.cc
|
|
|
|
common/RefCountedObj.cc
|
|
|
|
msg/Messenger.cc
|
|
|
|
msg/simple/Pipe.cc
|
|
|
|
msg/simple/PipeConnection.cc
|
|
|
|
msg/simple/SimpleMessenger.cc
|
|
|
|
msg/async/AsyncConnection.cc
|
|
|
|
msg/async/AsyncMessenger.cc
|
|
|
|
msg/async/Event.cc
|
|
|
|
msg/async/EventSelect.cc
|
2016-07-04 06:41:13 +00:00
|
|
|
msg/async/Stack.cc
|
2016-07-13 07:56:56 +00:00
|
|
|
msg/async/PosixStack.cc
|
2014-06-23 22:32:32 +00:00
|
|
|
msg/async/net_handler.cc
|
|
|
|
${xio_common_srcs}
|
2016-10-13 03:44:55 +00:00
|
|
|
${async_rdma_common_srcs}
|
2016-08-02 15:50:13 +00:00
|
|
|
${dpdk_common_srcs}
|
2014-06-23 22:32:32 +00:00
|
|
|
msg/msg_types.cc
|
|
|
|
common/hobject.cc
|
|
|
|
osd/OSDMap.cc
|
2017-01-18 23:45:55 +00:00
|
|
|
osd/OSDMapMapping.cc
|
2014-06-23 22:32:32 +00:00
|
|
|
common/histogram.cc
|
|
|
|
osd/osd_types.cc
|
2016-12-15 14:38:02 +00:00
|
|
|
osd/OpRequest.cc
|
2014-06-23 22:32:32 +00:00
|
|
|
common/blkdev.cc
|
|
|
|
common/common_init.cc
|
|
|
|
common/pipe.c
|
|
|
|
common/ceph_argparse.cc
|
|
|
|
common/ceph_context.cc
|
|
|
|
common/code_environment.cc
|
|
|
|
common/dout.cc
|
|
|
|
common/signal.cc
|
|
|
|
common/simple_spin.cc
|
|
|
|
common/Thread.cc
|
|
|
|
common/Formatter.cc
|
2015-12-04 01:18:29 +00:00
|
|
|
common/HTMLFormatter.cc
|
2014-06-23 22:32:32 +00:00
|
|
|
common/HeartbeatMap.cc
|
2015-12-04 22:05:27 +00:00
|
|
|
common/PluginRegistry.cc
|
2014-06-23 22:32:32 +00:00
|
|
|
common/ceph_fs.cc
|
|
|
|
common/ceph_hash.cc
|
|
|
|
common/ceph_strings.cc
|
|
|
|
common/ceph_frag.cc
|
|
|
|
common/config.cc
|
2016-12-14 18:13:15 +00:00
|
|
|
common/config_validators.cc
|
2014-06-23 22:32:32 +00:00
|
|
|
common/utf8.c
|
|
|
|
common/mime.c
|
|
|
|
common/strtol.cc
|
|
|
|
common/page.cc
|
|
|
|
common/lockdep.cc
|
|
|
|
common/version.cc
|
|
|
|
common/hex.cc
|
|
|
|
common/entity_name.cc
|
|
|
|
common/ceph_crypto.cc
|
|
|
|
common/ceph_crypto_cms.cc
|
|
|
|
common/ceph_json.cc
|
|
|
|
common/ipaddr.cc
|
|
|
|
common/pick_address.cc
|
Ceph Accelio/RDMA Transport (XioMessenger).
XioMessenger implements a Ceph Messenger provider for Accelio,
a high-performance messaging transport by Mellanox. Current
Accelio is layered on ibverbs, and supports Infiniband, ROCE,
and other RDMA transports. Future Accelio verions will support
alternative transports (including TCP), and flexible transport
selection.
config: cluster_rdma drives messenger creation
ceph_mds ceph_mon and ceph_osd use XioMessengers for cluster
communication when cluster_rdma is set
Move XioMessenger to msg/xio.
This matches the other new Messenger locations.
test: tests for tcp and xio messengers
(Not tests only.)
buffer: add subclass for xio buffers
xio: convert to Connection::send_message interface
config: -x, --xio as aliases for client_rdma
ceph-fuse: create xio messenger if client_rdma
Find XioMessenger.h and QueueStrategy.h in msg/xio.
ceph-syn: create xio messenger if client_rdma
librados: create xio messenger if client_rdma
Find XioMessenger.h and QueueStrategy.h in msg/xio.
Restore non-abort from Xio Mon integration.
Fix xio_client send count, again.
xio: must signal cond under mutex lock
xio: dispatch strategies support ms_fast_dispatch
xio: config variable xio_port_shift
remove set_port_shift() from XioMessenger, and just use the value
from the configuration
xio: don't depend on g_ceph_context for dout
XioMessenger now uses its own cct for all logging operations
the accelio log function, however, still depends on a global
CephContext. so we maintain an extra one, separate from g_ceph_context,
in XioMessenger.cc that is initialized on first construction and a
reference is held indefinitely
script: cephfsnew to automate pool and fs creation
Use new on_ow_msg_send_complete hook.
Replaces on_msg_delivered for one-way message style.
Prototype new xio_discon behavior.
On shutdown, XioPortal threads should not exit before Accelio
finalizes all sessions.
Inline join_sessions, it needs sh_mtx held across wait loop.
Fix assert on Cond::Signal. Adds Cond2.
Avoid deadlock, xio_disconnect can deliver a session teardown event.
Also Mutex2.
(Note, Mutex2 and Cond2 are replaced by standard C++ downstream.)
Restore SimpleDispatcher Timings.
The simple_client/simple_server timings are based on a ping/pong
of messages between the client and server, unlike those of the
xio_client/server programs, which are one-way (so their corresponding
1-way bandwidth is appx. 2x what the test reports). We assert
that the results are in general comparable, because in both setups,
a fixed number of messages (def. 50) is maintained in flight.
Wrap Accelio mempool in XioPool, add stats.
To enable stat prints, set xio_trace_mempool. Currently, prints
to stdout at each 64K messages sent or received.
Restore _send_message(..).
Fix merge errors in simple_client, simple_dispatcher.
xio: fix for size in pool stats
Add in/outbound msg counters to XioPoolStats.
Pool stats are easier to read.
Pool stats are easier to read, and if enabled, print on session
teardown. This is a convenient time to view stats, and with a small
Make pool stats counters atomic.
Track requests using hook ctor/dtor.
Lockless, portal thread provides atomicity.
Adapt to recent changes on Accelio for_next
* Accelio options now of opaque type
* on_msg_err with extra direction param
* RDMA behavior now governed by 2 new options
XIO_OPTNAME_MAX_INLINE_DATA
XIO_OPTNAME_MAX_INLINE_HEADER
* Separated send and recv queue depth
xio_messenger: Change xio optname queue depth msgs
* Set 16k threshold to rdma buffers instead of send
* Change xio optname for queue depth msgs
XIO_OPTNAME_SND/RCV_QUEUE_DEPTH_MSGS
xio_messenger: Protect Accelio queue depth.
(Minimal send flow control.)
The guard is per xio_connection, and considering batches.
Increment happens only if xio_send_msg succeeded, decrement in
on_ms_ow_send_complete and on_msg_error. Note that we don't need
atomics because counters are touched only in the correct portal
thread.
Find XioMsg.h in msg/xio
Find XioMessenger.h and QueueStrategy.h in msg/xio (tests).
Adapt to 2 Accelio API changes.
1. xio_context_stop loop takes only 1 argument
2. xio_connect() now takes a structure argument, by reference
Set CMP0046 iif CMake version >= 3
Move XioMessenger to msg/xio
xio: fix for segfault on xio_connect()
No more Mutex2, Cond2.
xio: number of portal threads is configurable
xio: only create additional portals on bind()
xio: use QueueStrategy(1) as default
xio: Messenger factory accepts ms_type "xio"
xio: use ms_type instead of client,cluster_rdma
removing the ability to configure the client and cluster networks
separately in favor of a single global messenger type
--xio is now a command-line alias for --ms_type xio
all daemons now use the Messenger::create() factory function instead of
conditionally creating XioMessengers
the OSD and Monitor classes no longer need separate messengers to
deal with both tcp/rdma clients
xio: portal binding honors ms_bind_port_min,max
xio: remove xio_port_shift
port shifting is no longer necessary, because we won't create both tcp
and xio messengers for the same service
Use Accelio sglist helper macros.
xio: make xio buffer unshareable
xio: Nuke special_handling.
Replace GENERIC with MON (requested by Sage).
Signed-off-by: Casey Bodley <casey@cohortfs.com>
Signed-off-by: Vu Pham <vu@mellanox.com>
Signed-off-by: Matt Benjamin <matt@cohortfs.com>
2014-12-23 21:46:47 +00:00
|
|
|
common/address_helper.cc
|
2014-06-23 22:32:32 +00:00
|
|
|
common/linux_version.c
|
2015-12-07 10:57:53 +00:00
|
|
|
common/TracepointProvider.cc
|
2015-12-31 21:27:02 +00:00
|
|
|
common/Cycles.cc
|
2016-01-30 06:38:48 +00:00
|
|
|
common/scrub_types.cc
|
2016-01-27 10:26:13 +00:00
|
|
|
common/bit_str.cc
|
2014-06-23 22:32:32 +00:00
|
|
|
osdc/Striper.cc
|
|
|
|
osdc/Objecter.cc
|
2016-01-12 14:39:58 +00:00
|
|
|
common/Graylog.cc
|
2016-03-03 13:17:21 +00:00
|
|
|
common/fs_types.cc
|
2016-02-12 16:02:48 +00:00
|
|
|
common/dns_resolve.cc
|
2017-01-19 10:17:49 +00:00
|
|
|
common/hostname.cc
|
2014-06-23 22:32:32 +00:00
|
|
|
${arch_files}
|
|
|
|
${auth_files}
|
|
|
|
${mds_files})
|
2016-07-24 11:31:54 +00:00
|
|
|
if(LINUX)
|
|
|
|
list(APPEND libcommon_files msg/async/EventEpoll.cc)
|
|
|
|
message(STATUS " Using EventEpoll for events.")
|
|
|
|
elseif(FREEBSD OR APPLE)
|
|
|
|
list(APPEND libcommon_files msg/async/EventKqueue.cc)
|
|
|
|
message(STATUS " Using EventKqueue for events.")
|
|
|
|
endif(LINUX)
|
|
|
|
|
2017-03-08 20:54:22 +00:00
|
|
|
if(HAVE_POWER8)
|
|
|
|
list(APPEND libcommon_files common/crc32c_ppc_asm.S)
|
|
|
|
endif(HAVE_POWER8)
|
|
|
|
|
2016-12-05 19:58:22 +00:00
|
|
|
if(WITH_LTTNG AND WITH_EVENTTRACE)
|
|
|
|
message(STATUS " Using EventTrace class.")
|
|
|
|
add_definitions("-DWITH_EVENTTRACE")
|
|
|
|
list(APPEND libcommon_files common/EventTrace.cc)
|
|
|
|
endif()
|
|
|
|
|
2014-06-23 22:32:32 +00:00
|
|
|
set(mon_common_files
|
|
|
|
auth/AuthSessionHandler.cc
|
|
|
|
auth/cephx/CephxSessionHandler.cc
|
|
|
|
erasure-code/ErasureCodePlugin.cc)
|
|
|
|
add_library(mon_common_objs OBJECT ${mon_common_files})
|
|
|
|
set(common_mountcephfs_files
|
|
|
|
common/armor.c
|
|
|
|
common/safe_io.c
|
|
|
|
common/module.c
|
|
|
|
common/addr_parsing.c)
|
|
|
|
add_library(common_mountcephfs_objs OBJECT
|
|
|
|
${common_mountcephfs_files})
|
|
|
|
|
2016-07-25 08:18:46 +00:00
|
|
|
if(WITH_PROFILER)
|
2014-06-23 22:32:32 +00:00
|
|
|
list(APPEND libcommon_files
|
|
|
|
perfglue/cpu_profiler.cc)
|
|
|
|
else()
|
|
|
|
list(APPEND libcommon_files
|
|
|
|
perfglue/disabled_stubs.cc)
|
2016-07-25 08:18:46 +00:00
|
|
|
endif()
|
2014-06-23 22:32:32 +00:00
|
|
|
|
2017-01-09 15:45:07 +00:00
|
|
|
add_library(common-objs OBJECT ${libcommon_files})
|
2017-01-13 07:35:20 +00:00
|
|
|
set(ceph_common_objs
|
2017-01-09 15:45:07 +00:00
|
|
|
$<TARGET_OBJECTS:common_buffer_obj>
|
|
|
|
$<TARGET_OBJECTS:common_texttable_obj>
|
|
|
|
$<TARGET_OBJECTS:compressor_objs>
|
|
|
|
$<TARGET_OBJECTS:common-objs>
|
|
|
|
$<TARGET_OBJECTS:common_mountcephfs_objs>
|
|
|
|
$<TARGET_OBJECTS:global_common_objs>)
|
2017-01-13 07:35:20 +00:00
|
|
|
set(ceph_common_deps
|
|
|
|
json_spirit erasure_code rt ${LIB_RESOLV}
|
2017-01-09 15:45:07 +00:00
|
|
|
${Boost_THREAD_LIBRARY}
|
|
|
|
${Boost_SYSTEM_LIBRARY}
|
|
|
|
${Boost_REGEX_LIBRARY}
|
|
|
|
${Boost_RANDOM_LIBRARY}
|
|
|
|
${Boost_PROGRAM_OPTIONS_LIBRARY}
|
|
|
|
${Boost_DATE_TIME_LIBRARY}
|
|
|
|
${Boost_IOSTREAMS_LIBRARY}
|
|
|
|
${BLKID_LIBRARIES} ${Backtrace_LIBRARIES}
|
2016-07-29 16:26:43 +00:00
|
|
|
${CRYPTO_LIBS} ${CMAKE_THREAD_LIBS_INIT} ${CMAKE_DL_LIBS})
|
2017-01-26 07:48:20 +00:00
|
|
|
if(HAVE_RDMA)
|
2017-01-30 09:58:03 +00:00
|
|
|
list(APPEND ceph_common_deps ${RDMA_LIBRARY})
|
|
|
|
endif()
|
2017-01-09 15:45:07 +00:00
|
|
|
if(NOT WITH_SYSTEM_BOOST)
|
2017-01-13 07:35:20 +00:00
|
|
|
list(APPEND ceph_common_deps ${ZLIB_LIBRARIES})
|
2017-01-09 15:45:07 +00:00
|
|
|
endif()
|
2014-06-23 22:32:32 +00:00
|
|
|
|
|
|
|
set_source_files_properties(${CMAKE_SOURCE_DIR}/src/ceph_ver.c
|
|
|
|
${CMAKE_SOURCE_DIR}/src/common/version.cc
|
|
|
|
${CMAKE_SOURCE_DIR}/src/test/encoding/ceph_dencoder.cc
|
|
|
|
APPEND PROPERTY OBJECT_DEPENDS ${CMAKE_BINARY_DIR}/src/include/ceph_ver.h)
|
|
|
|
|
2016-09-07 11:58:44 +00:00
|
|
|
include(SIMDExt)
|
2016-07-20 06:29:24 +00:00
|
|
|
if(HAVE_ARMV8_CRC)
|
2016-05-02 22:21:32 +00:00
|
|
|
add_library(common_crc_aarch64 STATIC common/crc32c_aarch64.c)
|
2017-01-13 04:36:39 +00:00
|
|
|
set_target_properties(common_crc_aarch64 PROPERTIES COMPILE_FLAGS "${CMAKE_C_FLAGS} ${ARMV8_CRC_COMPILE_FLAGS}")
|
2017-01-13 07:35:20 +00:00
|
|
|
list(APPEND ceph_common_deps common_crc_aarch64)
|
2016-07-20 06:29:24 +00:00
|
|
|
endif(HAVE_ARMV8_CRC)
|
2016-05-02 22:21:32 +00:00
|
|
|
|
2017-01-13 07:35:20 +00:00
|
|
|
add_library(common STATIC ${ceph_common_objs})
|
|
|
|
target_link_libraries(common ${ceph_common_deps})
|
|
|
|
|
|
|
|
add_library(ceph-common SHARED ${ceph_common_objs})
|
|
|
|
target_link_libraries(ceph-common ${ceph_common_deps})
|
|
|
|
# appease dpkg-shlibdeps
|
|
|
|
set_target_properties(ceph-common PROPERTIES
|
|
|
|
SOVERSION 0
|
|
|
|
INSTALL_RPATH "")
|
|
|
|
install(TARGETS ceph-common DESTINATION ${CMAKE_INSTALL_PKGLIBDIR})
|
|
|
|
|
2015-05-07 09:01:45 +00:00
|
|
|
add_library(common_utf8 STATIC common/utf8.c)
|
|
|
|
|
2015-12-31 03:01:52 +00:00
|
|
|
if(${WITH_LTTNG})
|
|
|
|
add_subdirectory(tracing)
|
2016-12-15 14:38:02 +00:00
|
|
|
add_dependencies(common-objs oprequest-tp)
|
2015-12-31 03:01:52 +00:00
|
|
|
endif(${WITH_LTTNG})
|
2014-06-23 22:32:32 +00:00
|
|
|
|
2016-07-19 06:23:18 +00:00
|
|
|
add_subdirectory(global)
|
2014-06-23 22:32:32 +00:00
|
|
|
|
2016-01-31 18:47:10 +00:00
|
|
|
add_subdirectory(lua)
|
|
|
|
|
2014-06-23 22:32:32 +00:00
|
|
|
# rados object classes
|
|
|
|
add_subdirectory(cls)
|
|
|
|
|
|
|
|
# RADOS client/library
|
2016-07-19 06:23:18 +00:00
|
|
|
add_subdirectory(osdc)
|
2014-06-23 22:32:32 +00:00
|
|
|
|
2016-06-22 03:04:20 +00:00
|
|
|
add_library(rados_snap_set_diff_obj OBJECT librados/snap_set_diff.cc)
|
2015-12-31 21:37:49 +00:00
|
|
|
|
2016-07-20 06:45:31 +00:00
|
|
|
add_subdirectory(include)
|
2016-07-19 06:23:18 +00:00
|
|
|
add_subdirectory(librados)
|
2015-12-31 22:11:49 +00:00
|
|
|
add_subdirectory(libradosstriper)
|
2015-07-31 12:26:12 +00:00
|
|
|
|
2016-06-30 13:04:30 +00:00
|
|
|
if (WITH_MGR)
|
|
|
|
set(mgr_srcs
|
|
|
|
ceph_mgr.cc
|
2016-07-31 17:07:20 +00:00
|
|
|
mon/PGMap.cc
|
2016-07-03 18:45:28 +00:00
|
|
|
mgr/DaemonState.cc
|
2016-06-30 13:04:30 +00:00
|
|
|
mgr/DaemonServer.cc
|
|
|
|
mgr/ClusterState.cc
|
|
|
|
mgr/PyModules.cc
|
|
|
|
mgr/PyFormatter.cc
|
|
|
|
mgr/PyState.cc
|
|
|
|
mgr/MgrPyModule.cc
|
2016-07-14 23:39:22 +00:00
|
|
|
mgr/MgrStandby.cc
|
2016-06-30 13:04:30 +00:00
|
|
|
mgr/Mgr.cc)
|
|
|
|
add_executable(ceph-mgr ${mgr_srcs}
|
|
|
|
$<TARGET_OBJECTS:heap_profiler_objs>)
|
|
|
|
target_include_directories(ceph-mgr PRIVATE "${PYTHON_INCLUDE_DIRS}")
|
2017-01-13 07:41:15 +00:00
|
|
|
target_link_libraries(ceph-mgr mds osdc global-static common
|
2016-12-14 04:19:56 +00:00
|
|
|
${Boost_PYTHON_LIBRARY} ${PYTHON_LIBRARIES} ${BLKID_LIBRARIES} ${CMAKE_DL_LIBS} ${ALLOC_LIBS})
|
2016-09-07 05:39:36 +00:00
|
|
|
install(TARGETS ceph-mgr DESTINATION bin)
|
2016-06-30 13:04:30 +00:00
|
|
|
endif (WITH_MGR)
|
|
|
|
|
2014-06-23 22:32:32 +00:00
|
|
|
set(librados_config_srcs
|
|
|
|
librados-config.cc)
|
2016-02-29 21:37:57 +00:00
|
|
|
add_executable(librados-config ${librados_config_srcs})
|
2016-10-27 13:23:43 +00:00
|
|
|
target_link_libraries(librados-config librados global ${BLKID_LIBRARIES} ${RDMA_LIBRARIES}
|
2016-02-29 21:37:57 +00:00
|
|
|
${CMAKE_DL_LIBS})
|
2014-06-23 22:32:32 +00:00
|
|
|
|
2016-07-19 06:23:18 +00:00
|
|
|
install(TARGETS librados-config DESTINATION bin)
|
2014-06-23 22:32:32 +00:00
|
|
|
|
2016-04-28 20:58:15 +00:00
|
|
|
# virtualenv base directory for ceph-disk and ceph-detect-init
|
|
|
|
set(CEPH_BUILD_VIRTUALENV $ENV{TMPDIR})
|
|
|
|
if(NOT CEPH_BUILD_VIRTUALENV)
|
|
|
|
set(CEPH_BUILD_VIRTUALENV /tmp)
|
|
|
|
endif()
|
|
|
|
|
2016-03-03 17:05:18 +00:00
|
|
|
add_subdirectory(pybind)
|
2016-02-15 04:19:30 +00:00
|
|
|
add_subdirectory(ceph-disk)
|
2016-02-15 04:22:02 +00:00
|
|
|
add_subdirectory(ceph-detect-init)
|
2016-03-03 17:05:18 +00:00
|
|
|
|
2015-08-05 12:08:21 +00:00
|
|
|
## dencoder
|
2016-07-13 04:58:31 +00:00
|
|
|
CHECK_C_COMPILER_FLAG("-fvar-tracking-assignments" HAS_VTA)
|
|
|
|
if(HAS_VTA)
|
|
|
|
set_source_files_properties(test/encoding/ceph_dencoder.cc
|
|
|
|
PROPERTIES COMPILE_FLAGS -fno-var-tracking-assignments)
|
|
|
|
endif()
|
|
|
|
|
2015-08-05 12:08:21 +00:00
|
|
|
set(dencoder_srcs
|
|
|
|
test/encoding/ceph_dencoder.cc
|
2016-05-19 04:49:58 +00:00
|
|
|
$<TARGET_OBJECTS:common_texttable_obj>
|
2015-08-05 12:08:21 +00:00
|
|
|
)
|
|
|
|
if(${WITH_RADOSGW})
|
|
|
|
list(APPEND dencoder_srcs
|
|
|
|
rgw/rgw_dencoder.cc
|
|
|
|
)
|
|
|
|
set(DENCODER_EXTRALIBS
|
|
|
|
rgw_a
|
|
|
|
cls_rgw_client
|
2015-10-12 09:08:13 +00:00
|
|
|
)
|
2015-08-05 12:08:21 +00:00
|
|
|
endif(${WITH_RADOSGW})
|
2016-07-31 21:35:46 +00:00
|
|
|
if(WITH_RBD)
|
2015-10-14 16:49:17 +00:00
|
|
|
set(DENCODER_EXTRALIBS
|
2016-12-07 03:41:18 +00:00
|
|
|
${DENCODER_EXTRALIBS}
|
|
|
|
cls_rbd_client
|
2017-01-23 14:17:54 +00:00
|
|
|
rbd_mirror_types
|
2016-12-07 04:27:54 +00:00
|
|
|
rbd_types
|
|
|
|
rbd_replay_types)
|
2017-01-05 10:59:42 +00:00
|
|
|
if(WITH_KRBD)
|
|
|
|
set(DENCODER_EXTRALIBS
|
|
|
|
${DENCODER_EXTRALIBS}
|
|
|
|
krbd)
|
|
|
|
endif()
|
2016-07-31 21:35:46 +00:00
|
|
|
endif(WITH_RBD)
|
2015-09-17 19:01:08 +00:00
|
|
|
|
2016-02-29 21:37:57 +00:00
|
|
|
add_executable(ceph-dencoder ${dencoder_srcs})
|
2015-08-05 12:08:21 +00:00
|
|
|
target_link_libraries(ceph-dencoder
|
|
|
|
global
|
2016-06-02 03:37:18 +00:00
|
|
|
os
|
2015-08-05 12:08:21 +00:00
|
|
|
osd
|
|
|
|
mds
|
|
|
|
mon
|
2015-11-12 13:52:47 +00:00
|
|
|
journal
|
2015-08-26 14:43:49 +00:00
|
|
|
${DENCODER_EXTRALIBS}
|
2015-08-05 12:08:21 +00:00
|
|
|
cls_lock_client
|
|
|
|
cls_refcount_client
|
|
|
|
cls_log_client
|
|
|
|
cls_statelog_client
|
|
|
|
cls_version_client
|
|
|
|
cls_replica_log_client
|
|
|
|
cls_user_client
|
2015-11-12 13:52:47 +00:00
|
|
|
cls_journal_client
|
2015-09-17 19:01:08 +00:00
|
|
|
cls_timeindex_client
|
2015-08-05 12:08:21 +00:00
|
|
|
${EXTRALIBS}
|
|
|
|
${CMAKE_DL_LIBS}
|
|
|
|
)
|
2016-05-26 08:12:52 +00:00
|
|
|
install(TARGETS ceph-dencoder DESTINATION bin)
|
2015-08-05 12:08:21 +00:00
|
|
|
|
2014-06-23 22:32:32 +00:00
|
|
|
# Monitor
|
|
|
|
set(common_util_src
|
|
|
|
common/util.cc)
|
|
|
|
add_library(common_util_obj OBJECT ${common_util_src})
|
|
|
|
|
2016-07-19 06:23:18 +00:00
|
|
|
add_subdirectory(mon)
|
2014-06-23 22:32:32 +00:00
|
|
|
set(ceph_mon_srcs
|
2016-05-19 04:49:58 +00:00
|
|
|
ceph_mon.cc)
|
|
|
|
add_executable(ceph-mon ${ceph_mon_srcs}
|
|
|
|
$<TARGET_OBJECTS:common_texttable_obj>)
|
2015-10-13 13:40:27 +00:00
|
|
|
add_dependencies(ceph-mon erasure_code_plugins)
|
2017-01-13 07:41:15 +00:00
|
|
|
target_link_libraries(ceph-mon mon common os global-static common
|
|
|
|
${EXTRALIBS}
|
2016-02-29 21:37:57 +00:00
|
|
|
${CMAKE_DL_LIBS})
|
2014-06-23 22:32:32 +00:00
|
|
|
install(TARGETS ceph-mon DESTINATION bin)
|
|
|
|
|
2016-07-19 06:23:18 +00:00
|
|
|
# OSD/ObjectStore
|
2015-12-31 03:58:55 +00:00
|
|
|
# make rocksdb statically
|
2016-07-24 13:48:50 +00:00
|
|
|
|
2016-12-10 04:45:22 +00:00
|
|
|
if (NOT WITH_SYSTEM_ROCKSDB)
|
|
|
|
set(ROCKSDB_CMAKE_ARGS -DCMAKE_POSITION_INDEPENDENT_CODE=ON)
|
2016-10-11 05:56:18 +00:00
|
|
|
|
2016-12-10 04:45:22 +00:00
|
|
|
if(ALLOCATOR STREQUAL "jemalloc")
|
|
|
|
list(APPEND ROCKSDB_CMAKE_ARGS -DWITH_JEMALLOC=ON)
|
|
|
|
endif()
|
2016-07-24 13:48:50 +00:00
|
|
|
|
2016-12-10 04:45:22 +00:00
|
|
|
if (WITH_CCACHE AND CCACHE_FOUND)
|
|
|
|
list(APPEND ROCKSDB_CMAKE_ARGS -DCMAKE_CXX_COMPILER=ccache)
|
|
|
|
list(APPEND ROCKSDB_CMAKE_ARGS -DCMAKE_CXX_COMPILER_ARG1=${CMAKE_CXX_COMPILER})
|
|
|
|
else(WITH_CCACHE AND CCACHE_FOUND)
|
|
|
|
list(APPEND ROCKSDB_CMAKE_ARGS -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER})
|
|
|
|
endif(WITH_CCACHE AND CCACHE_FOUND)
|
2016-09-15 05:12:10 +00:00
|
|
|
|
2017-03-02 06:57:33 +00:00
|
|
|
# We really want to have the CRC32 calculation in RocksDB accelerated
|
|
|
|
# with SSE 4.2. For details refer to rocksdb/util/crc32c.cc.
|
|
|
|
if (HAVE_INTEL_SSE4_2)
|
|
|
|
list(APPEND ROCKSDB_CMAKE_ARGS -DCMAKE_CXX_FLAGS=${SIMD_COMPILE_FLAGS})
|
|
|
|
endif()
|
2016-12-10 04:45:22 +00:00
|
|
|
list(APPEND ROCKSDB_CMAKE_ARGS -DCMAKE_AR=${CMAKE_AR})
|
|
|
|
list(APPEND ROCKSDB_CMAKE_ARGS -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE})
|
2016-10-11 05:56:18 +00:00
|
|
|
|
2016-12-10 04:45:22 +00:00
|
|
|
if (CMAKE_CXX_COMPILER_ID STREQUAL Clang)
|
|
|
|
list(APPEND ROCKSDB_CMAKE_ARGS -DFAIL_ON_WARNINGS=OFF)
|
|
|
|
endif()
|
2016-12-18 22:13:11 +00:00
|
|
|
|
2016-12-10 04:45:22 +00:00
|
|
|
# we use an external project and copy the sources to bin directory to ensure
|
|
|
|
# that object files are built outside of the source tree.
|
|
|
|
include(ExternalProject)
|
|
|
|
ExternalProject_Add(rocksdb_ext
|
|
|
|
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/rocksdb
|
|
|
|
CMAKE_ARGS ${ROCKSDB_CMAKE_ARGS}
|
|
|
|
BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/rocksdb
|
2017-02-08 08:50:30 +00:00
|
|
|
BUILD_COMMAND $(MAKE) rocksdb
|
2016-12-10 04:45:22 +00:00
|
|
|
INSTALL_COMMAND "true")
|
|
|
|
|
|
|
|
# force rocksdb make to be called on each time
|
|
|
|
ExternalProject_Add_Step(rocksdb_ext forcebuild
|
|
|
|
DEPENDEES configure
|
|
|
|
DEPENDERS build
|
|
|
|
COMMAND "true"
|
|
|
|
ALWAYS 1)
|
|
|
|
|
|
|
|
set(ROCKSDB_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/rocksdb/include)
|
|
|
|
|
|
|
|
add_library(rocksdb STATIC IMPORTED)
|
|
|
|
add_dependencies(rocksdb rocksdb_ext)
|
2017-02-08 08:50:30 +00:00
|
|
|
set_property(TARGET rocksdb PROPERTY IMPORTED_LOCATION "${CMAKE_CURRENT_BINARY_DIR}/rocksdb/librocksdb.a")
|
2016-12-10 04:45:22 +00:00
|
|
|
set(ROCKSDB_LIBRARIES rocksdb)
|
|
|
|
|
|
|
|
endif(NOT WITH_SYSTEM_ROCKSDB)
|
2015-12-31 03:58:55 +00:00
|
|
|
|
|
|
|
add_subdirectory(kv)
|
2016-07-19 06:23:18 +00:00
|
|
|
add_subdirectory(os)
|
2014-06-23 22:32:32 +00:00
|
|
|
|
|
|
|
set(cls_references_files objclass/class_api.cc)
|
|
|
|
add_library(cls_references_objs OBJECT ${cls_references_files})
|
|
|
|
|
2016-07-19 06:23:18 +00:00
|
|
|
add_subdirectory(osd)
|
2014-06-23 22:32:32 +00:00
|
|
|
set(ceph_osd_srcs
|
2016-05-28 21:19:23 +00:00
|
|
|
ceph_osd.cc)
|
2015-05-22 14:40:16 +00:00
|
|
|
add_executable(ceph-osd ${ceph_osd_srcs}
|
|
|
|
$<TARGET_OBJECTS:common_util_obj>)
|
2015-10-13 13:40:27 +00:00
|
|
|
add_dependencies(ceph-osd erasure_code_plugins)
|
2017-01-13 07:41:15 +00:00
|
|
|
target_link_libraries(ceph-osd osd os global-static common
|
|
|
|
${BLKID_LIBRARIES} ${RDMA_LIBRARIES})
|
2016-07-20 07:29:41 +00:00
|
|
|
if(WITH_FUSE)
|
2016-01-28 06:47:07 +00:00
|
|
|
target_link_libraries(ceph-osd ${FUSE_LIBRARIES})
|
2016-07-20 07:29:41 +00:00
|
|
|
endif()
|
2014-06-23 22:32:32 +00:00
|
|
|
install(TARGETS ceph-osd DESTINATION bin)
|
|
|
|
|
2016-07-19 06:23:18 +00:00
|
|
|
add_subdirectory(mds)
|
2016-07-07 18:31:32 +00:00
|
|
|
set(ceph_mds_srcs
|
|
|
|
ceph_mds.cc)
|
|
|
|
add_executable(ceph-mds ${ceph_mds_srcs}
|
|
|
|
$<TARGET_OBJECTS:common_util_obj>)
|
2017-01-13 07:41:15 +00:00
|
|
|
target_link_libraries(ceph-mds mds ${CMAKE_DL_LIBS} global-static common
|
2016-07-07 18:31:32 +00:00
|
|
|
${Boost_THREAD_LIBRARY})
|
|
|
|
install(TARGETS ceph-mds DESTINATION bin)
|
2014-06-23 22:32:32 +00:00
|
|
|
|
|
|
|
add_subdirectory(erasure-code)
|
|
|
|
|
|
|
|
# Support/Tools
|
2016-08-23 11:32:47 +00:00
|
|
|
if(WITH_TESTS)
|
2016-05-15 12:41:19 +00:00
|
|
|
add_subdirectory(googletest/googlemock)
|
2014-06-23 22:32:32 +00:00
|
|
|
add_subdirectory(test)
|
2016-08-23 11:32:47 +00:00
|
|
|
endif(WITH_TESTS)
|
2014-06-23 22:32:32 +00:00
|
|
|
|
2016-02-02 00:59:37 +00:00
|
|
|
add_subdirectory(compressor)
|
2016-07-14 06:50:31 +00:00
|
|
|
add_subdirectory(tools)
|
2014-06-23 22:32:32 +00:00
|
|
|
|
2016-08-23 11:32:47 +00:00
|
|
|
if(WITH_TESTS)
|
2014-06-23 22:32:32 +00:00
|
|
|
configure_file(${CMAKE_SOURCE_DIR}/src/ceph-coverage.in
|
2016-01-11 22:28:47 +00:00
|
|
|
${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ceph-coverage @ONLY)
|
2014-06-23 22:32:32 +00:00
|
|
|
|
|
|
|
configure_file(${CMAKE_SOURCE_DIR}/src/ceph-debugpack.in
|
2016-01-11 22:28:47 +00:00
|
|
|
${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ceph-debugpack @ONLY)
|
2016-08-23 11:32:47 +00:00
|
|
|
endif(WITH_TESTS)
|
2014-06-23 22:32:32 +00:00
|
|
|
|
2015-08-03 23:09:53 +00:00
|
|
|
configure_file(${CMAKE_SOURCE_DIR}/src/ceph.in
|
2016-01-11 22:28:47 +00:00
|
|
|
${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ceph @ONLY)
|
2014-06-23 22:32:32 +00:00
|
|
|
|
|
|
|
configure_file(${CMAKE_SOURCE_DIR}/src/ceph-crush-location.in
|
2016-01-11 22:28:47 +00:00
|
|
|
${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ceph-crush-location @ONLY)
|
2014-06-23 22:32:32 +00:00
|
|
|
|
|
|
|
configure_file(${CMAKE_SOURCE_DIR}/src/init-ceph.in
|
2016-01-11 22:28:47 +00:00
|
|
|
${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/init-ceph @ONLY)
|
2014-06-23 22:32:32 +00:00
|
|
|
|
2016-05-28 09:03:08 +00:00
|
|
|
configure_file(ceph-post-file.in
|
|
|
|
${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ceph-post-file @ONLY)
|
|
|
|
|
2016-08-23 11:32:47 +00:00
|
|
|
if(WITH_TESTS)
|
2014-06-23 22:32:32 +00:00
|
|
|
install(PROGRAMS
|
2016-03-03 17:05:18 +00:00
|
|
|
${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ceph-debugpack
|
|
|
|
${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ceph-coverage
|
2016-08-23 11:32:47 +00:00
|
|
|
DESTINATION bin)
|
|
|
|
endif(WITH_TESTS)
|
|
|
|
|
|
|
|
install(PROGRAMS
|
|
|
|
${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ceph
|
2016-05-28 07:42:33 +00:00
|
|
|
${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ceph-crush-location
|
2016-05-28 09:03:08 +00:00
|
|
|
${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ceph-post-file
|
2014-06-23 22:32:32 +00:00
|
|
|
${CMAKE_SOURCE_DIR}/src/ceph-run
|
2016-05-26 08:12:52 +00:00
|
|
|
${CMAKE_SOURCE_DIR}/src/ceph-rest-api
|
2014-06-23 22:32:32 +00:00
|
|
|
${CMAKE_SOURCE_DIR}/src/ceph-clsinfo
|
|
|
|
DESTINATION bin)
|
2016-05-28 13:59:14 +00:00
|
|
|
install(PROGRAMS
|
|
|
|
${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/init-ceph
|
|
|
|
DESTINATION ${CMAKE_INSTALL_SYSCONFDIR}/init.d
|
|
|
|
RENAME ceph)
|
|
|
|
|
2016-05-28 09:03:08 +00:00
|
|
|
install(FILES
|
2016-08-19 20:09:30 +00:00
|
|
|
${CMAKE_SOURCE_DIR}/share/id_rsa_drop.ceph.com
|
|
|
|
${CMAKE_SOURCE_DIR}/share/id_rsa_drop.ceph.com.pub
|
2016-05-28 09:03:08 +00:00
|
|
|
${CMAKE_SOURCE_DIR}/share/known_hosts_drop.ceph.com
|
|
|
|
DESTINATION ${CMAKE_INSTALL_DATADIR}/ceph)
|
2014-06-23 22:32:32 +00:00
|
|
|
|
|
|
|
install(PROGRAMS
|
2016-05-26 08:12:52 +00:00
|
|
|
ceph_common.sh
|
|
|
|
ceph-osd-prestart.sh
|
2016-07-01 13:04:17 +00:00
|
|
|
DESTINATION ${CMAKE_INSTALL_LIBEXECDIR}/ceph)
|
2014-06-23 22:32:32 +00:00
|
|
|
|
|
|
|
install(PROGRAMS
|
|
|
|
${CMAKE_SOURCE_DIR}/src/ceph-create-keys
|
2016-02-05 20:54:19 +00:00
|
|
|
# ${CMAKE_SOURCE_DIR}/src/ceph-disk
|
2014-06-23 22:32:32 +00:00
|
|
|
${CMAKE_SOURCE_DIR}/src/ceph-disk-udev
|
|
|
|
DESTINATION sbin)
|
|
|
|
|
2016-05-26 08:13:28 +00:00
|
|
|
add_subdirectory(bash_completion)
|
|
|
|
|
2017-01-05 10:59:42 +00:00
|
|
|
if(WITH_LIBCEPHFS OR WITH_KRBD)
|
2016-09-03 14:23:02 +00:00
|
|
|
set(parse_secret_files
|
|
|
|
common/secret.c)
|
2017-01-04 12:29:45 +00:00
|
|
|
add_library(parse_secret_objs OBJECT ${parse_secret_files})
|
2016-09-03 14:23:02 +00:00
|
|
|
endif()
|
2015-07-31 12:26:12 +00:00
|
|
|
|
2014-06-23 22:32:32 +00:00
|
|
|
if(WITH_LIBCEPHFS)
|
2016-07-19 06:23:18 +00:00
|
|
|
add_subdirectory(client)
|
2014-06-23 22:32:32 +00:00
|
|
|
set(libcephfs_srcs libcephfs.cc)
|
2016-07-19 06:24:45 +00:00
|
|
|
add_library(cephfs ${CEPH_SHARED} ${libcephfs_srcs})
|
2017-02-13 14:04:24 +00:00
|
|
|
target_link_libraries(cephfs LINK_PRIVATE client ceph-common
|
2016-02-29 21:37:57 +00:00
|
|
|
${CRYPTO_LIBS} ${EXTRALIBS})
|
2016-03-18 05:03:45 +00:00
|
|
|
if(ENABLE_SHARED)
|
2017-01-09 15:45:07 +00:00
|
|
|
foreach(name ceph-common client osdc)
|
2016-07-26 06:53:07 +00:00
|
|
|
set(CEPHFS_LINK_FLAGS "${CEPHFS_LINK_FLAGS} -Wl,--exclude-libs,lib${name}.a")
|
|
|
|
endforeach()
|
2016-03-18 05:03:45 +00:00
|
|
|
set_target_properties(cephfs PROPERTIES
|
|
|
|
OUTPUT_NAME cephfs
|
2016-10-24 14:03:01 +00:00
|
|
|
VERSION 2.0.0
|
|
|
|
SOVERSION 2
|
2016-07-26 06:53:07 +00:00
|
|
|
LINK_FLAGS ${CEPHFS_LINK_FLAGS})
|
2016-03-18 05:03:45 +00:00
|
|
|
endif(ENABLE_SHARED)
|
2016-06-22 02:30:40 +00:00
|
|
|
install(TARGETS cephfs DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
2014-06-23 22:32:32 +00:00
|
|
|
install(DIRECTORY
|
|
|
|
"${CMAKE_SOURCE_DIR}/src/include/cephfs"
|
|
|
|
DESTINATION include)
|
|
|
|
set(ceph_syn_srcs
|
|
|
|
ceph_syn.cc
|
|
|
|
client/SyntheticClient.cc)
|
|
|
|
add_executable(ceph-syn ${ceph_syn_srcs})
|
2017-02-13 14:04:24 +00:00
|
|
|
target_link_libraries(ceph-syn client global-static common)
|
2014-06-23 22:32:32 +00:00
|
|
|
|
|
|
|
set(mount_ceph_srcs
|
|
|
|
mount/mount.ceph.c)
|
|
|
|
add_executable(mount.ceph ${mount_ceph_srcs}
|
2015-07-31 12:26:12 +00:00
|
|
|
$<TARGET_OBJECTS:parse_secret_objs>
|
|
|
|
$<TARGET_OBJECTS:common_mountcephfs_objs>)
|
2017-01-13 20:15:02 +00:00
|
|
|
set_target_properties(mount.ceph PROPERTIES
|
|
|
|
INSTALL_RPATH "")
|
2016-12-07 04:27:54 +00:00
|
|
|
target_link_libraries(mount.ceph ${KEYUTILS_LIBRARIES})
|
2014-06-23 22:32:32 +00:00
|
|
|
|
|
|
|
install(TARGETS ceph-syn DESTINATION bin)
|
2016-06-01 18:08:45 +00:00
|
|
|
install(TARGETS mount.ceph DESTINATION ${CMAKE_INSTALL_SBINDIR})
|
2014-06-23 22:32:32 +00:00
|
|
|
|
2016-07-31 21:35:46 +00:00
|
|
|
if(WITH_FUSE)
|
2014-06-23 22:32:32 +00:00
|
|
|
set(ceph_fuse_srcs
|
|
|
|
ceph_fuse.cc
|
|
|
|
client/fuse_ll.cc)
|
|
|
|
add_executable(ceph-fuse ${ceph_fuse_srcs})
|
2017-01-13 07:41:15 +00:00
|
|
|
target_link_libraries(ceph-fuse ${ALLOC_LIBS} ${FUSE_LIBRARIES}
|
2017-02-13 14:04:24 +00:00
|
|
|
client common global-static)
|
2015-09-01 15:35:42 +00:00
|
|
|
set_target_properties(ceph-fuse PROPERTIES COMPILE_FLAGS "-I${FUSE_INCLUDE_DIRS}")
|
2014-06-23 22:32:32 +00:00
|
|
|
install(TARGETS ceph-fuse DESTINATION bin)
|
2016-06-01 18:08:45 +00:00
|
|
|
install(PROGRAMS mount.fuse.ceph DESTINATION ${CMAKE_INSTALL_SBINDIR})
|
2016-07-31 21:35:46 +00:00
|
|
|
endif(WITH_FUSE)
|
2014-06-23 22:32:32 +00:00
|
|
|
endif(WITH_LIBCEPHFS)
|
|
|
|
|
2016-07-19 06:23:18 +00:00
|
|
|
add_subdirectory(journal)
|
2015-11-12 13:52:47 +00:00
|
|
|
|
2017-01-05 10:59:42 +00:00
|
|
|
if(WITH_RBD)
|
|
|
|
if(WITH_KRBD)
|
|
|
|
add_library(krbd STATIC krbd.cc
|
|
|
|
$<TARGET_OBJECTS:parse_secret_objs>)
|
|
|
|
target_link_libraries(krbd ${KEYUTILS_LIBRARIES} ${UDEV_LIBRARIES})
|
|
|
|
endif()
|
2016-02-02 02:14:44 +00:00
|
|
|
add_subdirectory(librbd)
|
2016-05-26 08:36:20 +00:00
|
|
|
if(WITH_FUSE)
|
2016-07-19 06:23:18 +00:00
|
|
|
add_subdirectory(rbd_fuse)
|
2016-05-26 08:36:20 +00:00
|
|
|
endif()
|
|
|
|
|
2016-06-30 14:41:49 +00:00
|
|
|
install(PROGRAMS
|
|
|
|
${CMAKE_SOURCE_DIR}/src/ceph-rbdnamer
|
|
|
|
${CMAKE_SOURCE_DIR}/src/rbd-replay-many
|
|
|
|
${CMAKE_SOURCE_DIR}/src/rbdmap
|
|
|
|
DESTINATION ${CMAKE_INSTALL_BINDIR})
|
2015-12-31 22:46:04 +00:00
|
|
|
add_subdirectory(rbd_replay)
|
2017-01-05 10:59:42 +00:00
|
|
|
endif(WITH_RBD)
|
2014-06-23 22:32:32 +00:00
|
|
|
|
|
|
|
# RadosGW
|
2016-07-19 06:23:18 +00:00
|
|
|
if(WITH_KVS)
|
|
|
|
add_subdirectory(key_value_store)
|
|
|
|
endif(WITH_KVS)
|
2014-06-23 22:32:32 +00:00
|
|
|
|
2016-07-31 21:35:46 +00:00
|
|
|
if(WITH_RADOSGW)
|
2016-02-11 00:14:06 +00:00
|
|
|
set(civetweb_common_files civetweb/src/civetweb.c)
|
|
|
|
add_library(civetweb_common_objs OBJECT ${civetweb_common_files})
|
2016-11-04 03:33:44 +00:00
|
|
|
target_include_directories(civetweb_common_objs PRIVATE
|
2016-02-27 07:34:14 +00:00
|
|
|
"${CMAKE_SOURCE_DIR}/src/civetweb/include")
|
2016-03-01 08:22:19 +00:00
|
|
|
set_property(TARGET civetweb_common_objs
|
|
|
|
APPEND PROPERTY COMPILE_DEFINITIONS USE_IPV6=1)
|
2016-07-11 21:54:07 +00:00
|
|
|
if(USE_OPENSSL)
|
2016-06-20 21:21:53 +00:00
|
|
|
set_property(TARGET civetweb_common_objs
|
|
|
|
APPEND PROPERTY COMPILE_DEFINITIONS NO_SSL_DL=1)
|
2016-07-11 21:54:07 +00:00
|
|
|
target_include_directories(civetweb_common_objs PRIVATE
|
2016-06-20 21:21:53 +00:00
|
|
|
"${SSL_INCLUDE_DIR}")
|
2016-07-11 21:54:07 +00:00
|
|
|
endif(USE_OPENSSL)
|
|
|
|
if (LIBSSL_SONAME)
|
|
|
|
set_property(TARGET civetweb_common_objs
|
|
|
|
APPEND PROPERTY COMPILE_DEFINITIONS SSL_LIB="${LIBSSL_SONAME}")
|
|
|
|
set_property(TARGET civetweb_common_objs
|
|
|
|
APPEND PROPERTY COMPILE_DEFINITIONS CRYPTO_LIB="${LIBCRYPTO_SONAME}")
|
|
|
|
endif()
|
|
|
|
|
2016-05-28 08:18:54 +00:00
|
|
|
add_subdirectory(rgw)
|
2016-07-11 21:54:07 +00:00
|
|
|
|
2016-07-31 21:35:46 +00:00
|
|
|
endif(WITH_RADOSGW)
|
2015-10-13 19:38:58 +00:00
|
|
|
|
2016-05-28 07:42:33 +00:00
|
|
|
install(FILES
|
|
|
|
sample.ceph.conf
|
|
|
|
DESTINATION ${CMAKE_INSTALL_DOCDIR})
|
|
|
|
install(FILES
|
|
|
|
fetch_config
|
|
|
|
DESTINATION ${CMAKE_INSTALL_DOCDIR}
|
|
|
|
RENAME sample.fetch_config)
|
|
|
|
|
2016-05-02 22:21:32 +00:00
|
|
|
# Now create a useable config.h
|
|
|
|
configure_file(
|
|
|
|
${CMAKE_SOURCE_DIR}/src/include/config-h.in.cmake
|
|
|
|
${CMAKE_BINARY_DIR}/include/acconfig.h
|
|
|
|
)
|
|
|
|
|
2016-05-28 08:53:36 +00:00
|
|
|
add_subdirectory(brag)
|
|
|
|
|
2015-10-13 19:38:58 +00:00
|
|
|
# Everything you need to spin up a cluster with vstart.sh
|
2016-12-14 06:51:25 +00:00
|
|
|
add_custom_target(vstart-base DEPENDS
|
2015-10-13 19:38:58 +00:00
|
|
|
ceph-osd
|
|
|
|
ceph-mon
|
2016-06-30 13:04:30 +00:00
|
|
|
ceph-mgr
|
2015-10-13 19:38:58 +00:00
|
|
|
ceph-authtool
|
|
|
|
ceph-conf
|
|
|
|
monmaptool
|
2016-05-19 08:12:06 +00:00
|
|
|
crushtool
|
2016-12-14 06:51:25 +00:00
|
|
|
rados
|
2016-07-13 18:36:37 +00:00
|
|
|
cython_rados
|
2016-12-14 06:51:25 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
add_custom_target(vstart DEPENDS
|
|
|
|
vstart-base
|
2016-07-13 18:36:37 +00:00
|
|
|
ceph-mds)
|
2016-06-23 16:05:09 +00:00
|
|
|
if(WITH_RADOSGW)
|
|
|
|
add_dependencies(vstart radosgw radosgw-admin)
|
|
|
|
endif(WITH_RADOSGW)
|
2015-10-13 19:38:58 +00:00
|
|
|
|
2016-12-14 06:51:25 +00:00
|
|
|
|
2015-10-13 19:38:58 +00:00
|
|
|
# Everything you need to run CephFS tests
|
|
|
|
add_custom_target(cephfs_testing DEPENDS
|
|
|
|
vstart
|
|
|
|
rados
|
2016-03-03 17:05:18 +00:00
|
|
|
cython_modules
|
2015-11-09 12:09:33 +00:00
|
|
|
cephfs
|
2015-12-22 11:50:13 +00:00
|
|
|
cls_cephfs
|
2015-10-13 19:38:58 +00:00
|
|
|
ceph-fuse
|
|
|
|
ceph-dencoder
|
|
|
|
cephfs-journal-tool
|
|
|
|
cephfs-data-scan
|
|
|
|
cephfs-table-tool)
|
2016-05-24 04:55:20 +00:00
|
|
|
|
|
|
|
if (IS_DIRECTORY "${PROJECT_SOURCE_DIR}/.git")
|
|
|
|
add_custom_target(
|
|
|
|
git-update
|
|
|
|
COMMAND git submodule sync
|
|
|
|
COMMAND git submodule update --force --init --recursive
|
|
|
|
WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}")
|
|
|
|
endif()
|
2016-07-21 17:42:39 +00:00
|
|
|
|
|
|
|
add_subdirectory(script)
|
2016-11-05 01:10:08 +00:00
|
|
|
|
|
|
|
if(WITH_EMBEDDED)
|
|
|
|
add_subdirectory(libcephd)
|
|
|
|
endif()
|