mirror of
https://github.com/ceph/ceph
synced 2025-01-02 09:02:34 +00:00
Merge pull request #9385 from ceph/wip-cmake-kefu
cmake: more fixes fixes make install workflow
This commit is contained in:
commit
6147f5f7eb
@ -1,6 +1,6 @@
|
||||
cmake_minimum_required(VERSION 2.8.11)
|
||||
|
||||
project(Ceph)
|
||||
project(ceph)
|
||||
set(VERSION "10.2.1")
|
||||
|
||||
if (NOT (CMAKE_MAJOR_VERSION LESS 3))
|
||||
|
73
cmake/modules/Distutils.cmake
Normal file
73
cmake/modules/Distutils.cmake
Normal file
@ -0,0 +1,73 @@
|
||||
function(distutils_install_module name)
|
||||
if(DEFINED ENV{DESTDIR})
|
||||
get_filename_component(debian_version /etc/debian_version ABSOLUTE)
|
||||
if(EXISTS ${debian_version})
|
||||
set(options "--install-layout=deb")
|
||||
else()
|
||||
set(options "--prefix=/usr")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set(py_srcs setup.py README.rst requirements.txt test-requirements.txt ${name})
|
||||
foreach(src ${py_srcs})
|
||||
list(APPEND py_clone ${CMAKE_CURRENT_BINARY_DIR}/${src})
|
||||
add_custom_command(
|
||||
OUTPUT ${src}
|
||||
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${src}
|
||||
COMMAND ${CMAKE_COMMAND} -E create_symlink ${CMAKE_CURRENT_SOURCE_DIR}/${src} ${src})
|
||||
endforeach()
|
||||
add_custom_target(${name}-clone ALL
|
||||
DEPENDS ${py_clone})
|
||||
install(CODE
|
||||
"execute_process(COMMAND ${PYTHON_EXECUTABLE} setup.py install ${options} --root=$DESTDIR
|
||||
WORKING_DIRECTORY \"${CMAKE_CURRENT_BINARY_DIR}\")")
|
||||
endfunction(distutils_install_module)
|
||||
|
||||
function(distutils_add_cython_module name src)
|
||||
get_property(compiler_launcher GLOBAL PROPERTY RULE_LAUNCH_COMPILE)
|
||||
get_property(link_launcher GLOBAL PROPERTY RULE_LAUNCH_LINK)
|
||||
set(PY_CC \"${compiler_launcher} ${CMAKE_C_COMPILER}\")
|
||||
set(PY_CXX \"${compiler_launcher} ${CMAKE_CXX_COMPILER}\")
|
||||
set(PY_LDSHARED \"${link_launcher} ${CMAKE_C_COMPILER} -shared\")
|
||||
add_custom_target(${name} ALL
|
||||
COMMAND
|
||||
env
|
||||
CC=${PY_CC}
|
||||
CXX=${PY_CXX}
|
||||
LDSHARED=${PY_LDSHARED}
|
||||
OPT=\"-DNDEBUG -g -fwrapv -O2 -Wall\"
|
||||
LDFLAGS=-L${CMAKE_LIBRARY_OUTPUT_DIRECTORY}
|
||||
CYTHON_BUILD_DIR=${CMAKE_CURRENT_BINARY_DIR}
|
||||
CFLAGS=\"-iquote ${CMAKE_SOURCE_DIR}/src/include\"
|
||||
${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/setup.py build --build-base ${CYTHON_MODULE_DIR} --verbose
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
DEPENDS ${src})
|
||||
endfunction(distutils_add_cython_module)
|
||||
|
||||
function(distutils_install_cython_module name)
|
||||
install(CODE "
|
||||
set(options --prefix=/usr)
|
||||
if(DEFINED ENV{DESTDIR})
|
||||
if(EXISTS /etc/debian_version)
|
||||
set(options --install-layout=deb)
|
||||
endif()
|
||||
set(root --root=\$ENV{DESTDIR})
|
||||
else()
|
||||
set(options \"--prefix=${CMAKE_INSTALL_PREFIX}\")
|
||||
set(root --root=/)
|
||||
endif()
|
||||
execute_process(
|
||||
COMMAND env
|
||||
CYTHON_BUILD_DIR=${CMAKE_CURRENT_BINARY_DIR}
|
||||
CFLAGS=\"-iquote ${CMAKE_SOURCE_DIR}/src/include\"
|
||||
${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/setup.py
|
||||
build --build-base ${CYTHON_MODULE_DIR} --verbose
|
||||
install \${options} \${root} --verbose
|
||||
--single-version-externally-managed --record /dev/null
|
||||
WORKING_DIRECTORY \"${CMAKE_CURRENT_SOURCE_DIR}\"
|
||||
RESULT_VARIABLE install_res)
|
||||
if(NOT \"\${install_res}\" STREQUAL 0)
|
||||
message(FATAL_ERROR \"Failed to build and install ${name} python module\")
|
||||
endif()
|
||||
")
|
||||
endfunction(distutils_install_cython_module)
|
@ -48,32 +48,35 @@ ENDIF (Cython_FOUND)
|
||||
# 2) to compile assembly.pyx and something.cpp to assembly.so:
|
||||
# CYTHON_ADD_MODULE(assembly something.cpp)
|
||||
|
||||
if(NOT CYTHON_INCLUDE_DIRECTORIES)
|
||||
set(CYTHON_INCLUDE_DIRECTORIES .)
|
||||
endif(NOT CYTHON_INCLUDE_DIRECTORIES)
|
||||
|
||||
# Cythonizes the .pyx files into .cpp file (but doesn't compile it)
|
||||
macro(CYTHON_ADD_MODULE_PYX name)
|
||||
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${name}.pxd)
|
||||
set(DEPENDS ${name}.pyx ${name}.pxd)
|
||||
else(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${name}.pxd)
|
||||
set(DEPENDS ${name}.pyx)
|
||||
endif(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${name}.pxd)
|
||||
# Allow the user to specify dependencies as optional arguments
|
||||
set(DEPENDS ${DEPENDS} ${ARGN})
|
||||
add_custom_command(
|
||||
OUTPUT ${name}.cpp
|
||||
COMMAND ${CYTHON_BIN}
|
||||
ARGS ${CYTHON_FLAGS} -I ${CYTHON_INCLUDE_DIRECTORIES} -o ${name}.cpp ${CMAKE_CURRENT_SOURCE_DIR}/${name}.pyx
|
||||
DEPENDS ${DEPENDS}
|
||||
COMMENT "Cythonizing ${name}.pyx")
|
||||
set(depends ${name}.pyx)
|
||||
if(CYTHON_INCLUDE_DIRECTORIES)
|
||||
foreach(dir ${CYTHON_INCLUDE_DIRECTORIES})
|
||||
file(GLOB pxd_srcs ${CYTHON_INCLUDE_DIRECTORIES}/*.pxd)
|
||||
list(APPEND depends ${pxd_srcs})
|
||||
endforeach()
|
||||
elseif(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${name}.pxd)
|
||||
list(APPEND depends ${CMAKE_CURRENT_SOURCE_DIR}/${name}.pxd)
|
||||
set(CYTHON_INCLUDE_DIRECTORIES ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
endif()
|
||||
# Allow the user to specify dependencies as optional arguments
|
||||
list(APPEND depends ${ARGN})
|
||||
add_custom_command(
|
||||
OUTPUT ${name}.cpp
|
||||
COMMAND ${CYTHON_BIN}
|
||||
ARGS ${CYTHON_FLAGS} -I ${CYTHON_INCLUDE_DIRECTORIES} -o ${name}.cpp ${CMAKE_CURRENT_SOURCE_DIR}/${name}.pyx
|
||||
DEPENDS ${depends}
|
||||
COMMENT "Cythonizing ${name}.pyx")
|
||||
endmacro(CYTHON_ADD_MODULE_PYX)
|
||||
|
||||
# Cythonizes and compiles a .pyx file
|
||||
macro(CYTHON_ADD_MODULE name)
|
||||
CYTHON_ADD_MODULE_PYX(${name})
|
||||
# We need Python for this:
|
||||
find_package(Python REQUIRED)
|
||||
add_python_library(${name} ${name}.cpp ${ARGN})
|
||||
macro(CYTHON_ADD_MODULE name pyx)
|
||||
CYTHON_ADD_MODULE_PYX(${pyx})
|
||||
add_library(${name} MODULE ${pyx}.cpp)
|
||||
target_include_directories(${name} PRIVATE ${PYTHON_INCLUDE_PATH})
|
||||
target_link_libraries(${name} ${PYTHON_LIBRARIES})
|
||||
set_target_properties(${name} PROPERTIES
|
||||
PREFIX "${PYTHON_MODULE_PREFIX}"
|
||||
OUTPUT_NAME ${pyx})
|
||||
endmacro(CYTHON_ADD_MODULE)
|
||||
|
||||
|
@ -2,10 +2,19 @@ include(GetGitRevisionDescription)
|
||||
|
||||
enable_language(C ASM)
|
||||
include(GNUInstallDirs)
|
||||
# for erasure and compressor plugins
|
||||
set(CMAKE_INSTALL_PKGLIBDIR ${CMAKE_INSTALL_LIBDIR}/${PROJECT_NAME})
|
||||
# to be compatible with configure_files shared with autoconfig
|
||||
set(bindir ${CMAKE_INSTALL_BINDIR})
|
||||
set(sbindir ${CMAKE_INSTALL_SBINDIR})
|
||||
set(libdir ${CMAKE_INSTALL_LIBDIR})
|
||||
set(sysconfdir ${CMAKE_INSTALL_SYSCONFDIR})
|
||||
set(pkgdatadir ${CMAKE_INSTALL_DATADIR})
|
||||
set(datadir ${CMAKE_INSTALL_DATADIR}/${PROJECT_NAME})
|
||||
set(prefix ${CMAKE_INSTALL_PREFIX})
|
||||
|
||||
add_definitions("-DCEPH_LIBDIR=\"${CMAKE_INSTALL_LIBDIR}\"")
|
||||
add_definitions("-DCEPH_PKGLIBDIR=\"${CMAKE_INSTALL_LIBDIR}\"")
|
||||
add_definitions("-DCEPH_PKGLIBDIR=\"${CMAKE_INSTALL_PKGLIBDIR}\"")
|
||||
add_definitions("-DHAVE_CONFIG_H -D__CEPH__ -D_FILE_OFFSET_BITS=64 -D_REENTRANT -D_THREAD_SAFE -D__STDC_FORMAT_MACROS -D_GNU_SOURCE")
|
||||
|
||||
set(CMAKE_ASM_COMPILER ${PROJECT_SOURCE_DIR}/src/yasm-wrapper)
|
||||
@ -203,6 +212,7 @@ find_package(PythonInterp 2 QUIET)
|
||||
if(NOT PYTHONINTERP_FOUND)
|
||||
message(FATAL_ERROR "Python 2 interpreter not found.")
|
||||
endif(NOT PYTHONINTERP_FOUND)
|
||||
find_package(PythonLibs REQUIRED)
|
||||
|
||||
# if CMAKE_INSTALL_PREFIX is an empty string, must replace
|
||||
# it with "/" to make PYTHON_INSTALL_TEMPLATE an absolute path to be
|
||||
@ -528,7 +538,7 @@ add_library(librados ${librados_srcs}
|
||||
$<TARGET_OBJECTS:common_util_obj>)
|
||||
add_dependencies(librados osdc)
|
||||
if(WITH_LTTNG)
|
||||
add_dependencies(librados librados-tp)
|
||||
add_dependencies(librados rados-tp)
|
||||
endif()
|
||||
# LINK_PRIVATE instead of PRIVATE is used to backward compatibility with cmake 2.8.11
|
||||
target_link_libraries(librados LINK_PRIVATE osdc osd os global common cls_lock_client
|
||||
@ -577,6 +587,9 @@ install(TARGETS ceph-osdomap-tool DESTINATION bin)
|
||||
add_executable(ceph-monstore-tool tools/ceph_monstore_tool.cc)
|
||||
target_link_libraries(ceph-monstore-tool os global ${Boost_PROGRAM_OPTIONS_LIBRARY})
|
||||
install(TARGETS ceph-monstore-tool DESTINATION bin)
|
||||
install(PROGRAMS
|
||||
tools/ceph-monstore-update-crush.sh
|
||||
DESTINATION lib/ceph)
|
||||
|
||||
add_executable(ceph-objectstore-tool
|
||||
tools/ceph_objectstore_tool.cc
|
||||
@ -593,7 +606,7 @@ set(rados_srcs
|
||||
tools/rados/PoolDump.cc
|
||||
common/obj_bencher.cc)
|
||||
add_executable(rados ${rados_srcs})
|
||||
target_link_libraries(rados librados global ${BLKID_LIBRARIES} ${CMAKE_DL_LIBS} libradosstriper)
|
||||
target_link_libraries(rados librados global ${BLKID_LIBRARIES} ${CMAKE_DL_LIBS} radosstriper)
|
||||
|
||||
if (WITH_CEPHFS)
|
||||
set(cephfs_journal_tool_srcs
|
||||
@ -626,8 +639,14 @@ if (WITH_CEPHFS)
|
||||
tools/cephfs/MDSUtility.cc)
|
||||
add_executable(cephfs-data-scan ${cephfs_data_scan_srcs})
|
||||
target_link_libraries(cephfs-data-scan librados mds osdc global
|
||||
cls_cephfs_client
|
||||
${BLKID_LIBRARIES} ${CMAKE_DL_LIBS})
|
||||
cls_cephfs_client
|
||||
${BLKID_LIBRARIES} ${CMAKE_DL_LIBS})
|
||||
|
||||
install(TARGETS
|
||||
cephfs-journal-tool
|
||||
cephfs-table-tool
|
||||
cephfs-data-scan
|
||||
DESTINATION bin)
|
||||
endif (WITH_CEPHFS)
|
||||
|
||||
set(librados_config_srcs
|
||||
@ -851,9 +870,17 @@ if(WITH_SPDK)
|
||||
${PCIACCESS_INCLUDE_DIR})
|
||||
endif(WITH_SPDK)
|
||||
if(WITH_LTTNG)
|
||||
add_dependencies(os objectstore-tp)
|
||||
add_dependencies(os os-tp)
|
||||
endif()
|
||||
target_link_libraries(os kv)
|
||||
if(HAVE_LIBAIO)
|
||||
add_executable(ceph-bluefs-tool
|
||||
os/bluestore/bluefs_tool.cc)
|
||||
target_link_libraries(ceph-bluefs-tool
|
||||
os global)
|
||||
install(TARGETS ceph-bluefs-tool
|
||||
DESTINATION bin)
|
||||
endif()
|
||||
|
||||
set(cls_references_files objclass/class_api.cc)
|
||||
add_library(cls_references_objs OBJECT ${cls_references_files})
|
||||
@ -882,7 +909,6 @@ set(osd_srcs
|
||||
osd/ScrubStore.cc
|
||||
osd/osd_types.cc
|
||||
osd/ECUtil.cc
|
||||
objclass/class_api.cc
|
||||
${osdc_osd_srcs})
|
||||
set(osd_mon_files
|
||||
mon/Monitor.cc)
|
||||
@ -899,8 +925,7 @@ if(WITH_LTTNG)
|
||||
endif()
|
||||
|
||||
set(ceph_osd_srcs
|
||||
ceph_osd.cc
|
||||
objclass/class_api.cc)
|
||||
ceph_osd.cc)
|
||||
add_executable(ceph-osd ${ceph_osd_srcs}
|
||||
$<TARGET_OBJECTS:common_util_obj>)
|
||||
add_dependencies(ceph-osd erasure_code_plugins)
|
||||
@ -1009,9 +1034,9 @@ install(TARGETS osdmaptool DESTINATION bin)
|
||||
|
||||
set(ceph_psim_srcs
|
||||
tools/psim.cc)
|
||||
add_executable(ceph-psim ${ceph_psim_srcs})
|
||||
target_link_libraries(ceph-psim global)
|
||||
install(TARGETS ceph-psim DESTINATION bin)
|
||||
add_executable(ceph_psim ${ceph_psim_srcs})
|
||||
target_link_libraries(ceph_psim global)
|
||||
install(TARGETS ceph_psim DESTINATION bin)
|
||||
|
||||
set(ceph_authtool_srcs
|
||||
tools/ceph_authtool.cc)
|
||||
@ -1034,16 +1059,30 @@ configure_file(${CMAKE_SOURCE_DIR}/src/ceph-crush-location.in
|
||||
configure_file(${CMAKE_SOURCE_DIR}/src/init-ceph.in
|
||||
${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/init-ceph @ONLY)
|
||||
|
||||
configure_file(ceph-post-file.in
|
||||
${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ceph-post-file @ONLY)
|
||||
|
||||
install(PROGRAMS
|
||||
${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ceph
|
||||
${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ceph-debugpack
|
||||
${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ceph-coverage
|
||||
${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/init-ceph
|
||||
${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ceph-crush-location
|
||||
${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ceph-post-file
|
||||
${CMAKE_SOURCE_DIR}/src/ceph-run
|
||||
${CMAKE_SOURCE_DIR}/src/ceph-rest-api
|
||||
${CMAKE_SOURCE_DIR}/src/vstart.sh
|
||||
${CMAKE_SOURCE_DIR}/src/ceph-clsinfo
|
||||
DESTINATION bin)
|
||||
install(PROGRAMS
|
||||
${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/init-ceph
|
||||
DESTINATION ${CMAKE_INSTALL_SYSCONFDIR}/init.d
|
||||
RENAME ceph)
|
||||
|
||||
install(FILES
|
||||
${CMAKE_SOURCE_DIR}/share/id_dsa_drop.ceph.com
|
||||
${CMAKE_SOURCE_DIR}/share/id_dsa_drop.ceph.com.pub
|
||||
${CMAKE_SOURCE_DIR}/share/known_hosts_drop.ceph.com
|
||||
DESTINATION ${CMAKE_INSTALL_DATADIR}/ceph)
|
||||
|
||||
install(FILES
|
||||
${CMAKE_SOURCE_DIR}/doc/start/ceph.conf
|
||||
@ -1117,6 +1156,7 @@ endif(BUILD_SHARED_LIBS)
|
||||
target_link_libraries(ceph-fuse ${FUSE_LIBRARIES} client global)
|
||||
set_target_properties(ceph-fuse PROPERTIES COMPILE_FLAGS "-I${FUSE_INCLUDE_DIRS}")
|
||||
install(TARGETS ceph-fuse DESTINATION bin)
|
||||
install(PROGRAMS mount.fuse.ceph DESTINATION /sbin)
|
||||
endif(HAVE_LIBFUSE)
|
||||
endif(WITH_LIBCEPHFS)
|
||||
|
||||
@ -1428,14 +1468,25 @@ if(${WITH_RADOSGW})
|
||||
cls_version_client cls_replica_log_client cls_user_client
|
||||
curl expat global fcgi resolv)
|
||||
install(TARGETS radosgw-object-expirer DESTINATION bin)
|
||||
add_subdirectory(rgw)
|
||||
endif(${WITH_RADOSGW})
|
||||
|
||||
install(FILES
|
||||
sample.ceph.conf
|
||||
DESTINATION ${CMAKE_INSTALL_DOCDIR})
|
||||
install(FILES
|
||||
fetch_config
|
||||
DESTINATION ${CMAKE_INSTALL_DOCDIR}
|
||||
RENAME sample.fetch_config)
|
||||
|
||||
# Now create a useable config.h
|
||||
configure_file(
|
||||
${CMAKE_SOURCE_DIR}/src/include/config-h.in.cmake
|
||||
${CMAKE_BINARY_DIR}/include/acconfig.h
|
||||
)
|
||||
|
||||
add_subdirectory(brag)
|
||||
|
||||
# Everything you need to spin up a cluster with vstart.sh
|
||||
add_custom_target(vstart DEPENDS
|
||||
ceph-osd
|
||||
|
@ -11,5 +11,5 @@ if(WITH_RADOSGW)
|
||||
endif()
|
||||
|
||||
install(FILES ${completions}
|
||||
DESTINATION ${sysconfdir}/bash_completion.d)
|
||||
DESTINATION ${CMAKE_INSTALL_SYSCONFDIR}/bash_completion.d)
|
||||
|
||||
|
3
src/brag/CMakeLists.txt
Normal file
3
src/brag/CMakeLists.txt
Normal file
@ -0,0 +1,3 @@
|
||||
install(PROGRAMS
|
||||
client/ceph-brag
|
||||
DESTINATION bin)
|
@ -6,3 +6,6 @@ add_custom_target(ceph-detect-init
|
||||
${CEPH_DETECT_INIT_VIRTUALENV}/bin/pip install --no-index --use-wheel --find-links=file:${CMAKE_SOURCE_DIR}/src/ceph-detect-init/wheelhouse -e .
|
||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/src/ceph-detect-init
|
||||
COMMENT "ceph-detect-init is being created")
|
||||
|
||||
include(Distutils)
|
||||
distutils_install_module(ceph_detect_init)
|
||||
|
@ -6,3 +6,6 @@ add_custom_target(ceph-disk
|
||||
${CEPH_DISK_VIRTUALENV}/bin/pip install --no-index --use-wheel --find-links=file:${CMAKE_SOURCE_DIR}/src/ceph-disk/wheelhouse -e .
|
||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/src/ceph-disk
|
||||
COMMENT "ceph-disk is being created")
|
||||
|
||||
include(Distutils)
|
||||
distutils_install_module(ceph_disk)
|
||||
|
@ -6,7 +6,7 @@ add_library(compressor_objs OBJECT ${compressor_srcs})
|
||||
|
||||
## compressor plugins
|
||||
|
||||
set(compressorlibdir ${LIBRARY_OUTPUT_PATH}/compressor)
|
||||
set(compressor_plugin_dir ${CMAKE_INSTALL_PKGLIBDIR}/compressor)
|
||||
|
||||
add_subdirectory(snappy)
|
||||
add_subdirectory(zlib)
|
||||
|
@ -8,4 +8,4 @@ add_library(ceph_snappy SHARED ${snappy_sources})
|
||||
add_dependencies(ceph_snappy ${CMAKE_SOURCE_DIR}/src/ceph_ver.h)
|
||||
target_link_libraries(ceph_snappy snappy)
|
||||
set_target_properties(ceph_snappy PROPERTIES VERSION 2.0.0 SOVERSION 2)
|
||||
install(TARGETS ceph_snappy DESTINATION lib/compressor)
|
||||
install(TARGETS ceph_snappy DESTINATION ${compressor_plugin_dir})
|
||||
|
@ -9,4 +9,4 @@ add_library(ceph_zlib SHARED ${zlib_sources})
|
||||
add_dependencies(ceph_zlib ${CMAKE_SOURCE_DIR}/src/ceph_ver.h)
|
||||
target_link_libraries(ceph_zlib z)
|
||||
set_target_properties(ceph_zlib PROPERTIES VERSION 2.0.0 SOVERSION 2)
|
||||
install(TARGETS ceph_zlib DESTINATION lib/compressor)
|
||||
install(TARGETS ceph_zlib DESTINATION ${compressor_plugin_dir})
|
||||
|
@ -1,4 +1,7 @@
|
||||
## erasure code plugins
|
||||
|
||||
set(erasure_plugin_dir ${CMAKE_INSTALL_PKGLIBDIR}/erasure-code)
|
||||
|
||||
#jerasure subdir must be before shec so jerasure & neon obj libs are declared
|
||||
include_directories(jerasure/jerasure/include)
|
||||
include_directories(jerasure/gf-complete/include)
|
||||
|
@ -55,4 +55,4 @@ add_library(ec_isa SHARED ${isa_srcs})
|
||||
add_dependencies(ec_isa ${CMAKE_SOURCE_DIR}/src/ceph_ver.h)
|
||||
target_link_libraries(ec_isa ${EXTRALIBS})
|
||||
set_target_properties(ec_isa PROPERTIES VERSION 2.14.0 SOVERSION 2)
|
||||
install(TARGETS ec_isa DESTINATION lib/erasure-code)
|
||||
install(TARGETS ec_isa DESTINATION ${erasure_plugin_dir})
|
||||
|
@ -33,7 +33,7 @@ add_library(ec_jerasure_generic SHARED
|
||||
add_dependencies(ec_jerasure_generic ${CMAKE_SOURCE_DIR}/src/ceph_ver.h)
|
||||
target_link_libraries(ec_jerasure_generic crush ${EXTRALIBS})
|
||||
set_target_properties(ec_jerasure_generic PROPERTIES VERSION 2.0.0 SOVERSION 2)
|
||||
install(TARGETS ec_jerasure_generic DESTINATION lib/erasure-code)
|
||||
install(TARGETS ec_jerasure_generic DESTINATION ${erasure_plugin_dir})
|
||||
|
||||
# ec_jerasure_neon
|
||||
#TODO:build libec_jerasure_neon library on an ARM machine
|
||||
@ -57,7 +57,7 @@ if(ARM_NEON OR ARM_NEON2)
|
||||
target_link_libraries(ec_jerasure_neon crush pthread ${EXTRALIBS})
|
||||
set_target_properties(ec_jerasure_neon PROPERTIES VERSION 2.0.0 SOVERSION 2
|
||||
COMPILE_FLAGS ${ARM_NEON_FLAGS})
|
||||
install(TARGETS ec_jerasure_neon DESTINATION lib/erasure-code)
|
||||
install(TARGETS ec_jerasure_neon DESTINATION ${erasure_plugin_dir})
|
||||
endif(ARM_NEON OR ARM_NEON2)
|
||||
|
||||
# ec_jerasure_sse3
|
||||
@ -71,7 +71,7 @@ if(INTEL_SSE)
|
||||
target_link_libraries(ec_jerasure_sse3 crush ${EXTRALIBS})
|
||||
set_target_properties(ec_jerasure_sse3 PROPERTIES VERSION 2.0.0 SOVERSION 2
|
||||
COMPILE_FLAGS ${SSE3_FLAGS})
|
||||
install(TARGETS ec_jerasure_sse3 DESTINATION lib/erasure-code)
|
||||
install(TARGETS ec_jerasure_sse3 DESTINATION ${erasure_plugin_dir})
|
||||
endif(INTEL_SSE)
|
||||
|
||||
# ec_jerasure_sse4
|
||||
@ -85,11 +85,11 @@ if(INTEL_SSE4_1)
|
||||
target_link_libraries(ec_jerasure_sse4 crush ${EXTRALIBS})
|
||||
set_target_properties(ec_jerasure_sse4 PROPERTIES VERSION 2.0.0 SOVERSION 2
|
||||
COMPILE_FLAGS ${SSE4_FLAGS})
|
||||
install(TARGETS ec_jerasure_sse4 DESTINATION lib/erasure-code)
|
||||
install(TARGETS ec_jerasure_sse4 DESTINATION ${erasure_plugin_dir})
|
||||
endif(INTEL_SSE4_1)
|
||||
|
||||
add_library(ec_jerasure SHARED ErasureCodePluginSelectJerasure.cc)
|
||||
add_dependencies(ec_jerasure ${CMAKE_SOURCE_DIR}/src/ceph_ver.h)
|
||||
target_link_libraries(ec_jerasure ${EXTRALIBS})
|
||||
set_target_properties(ec_jerasure PROPERTIES VERSION 2.0.0 SOVERSION 2)
|
||||
install(TARGETS ec_jerasure DESTINATION lib/erasure-code)
|
||||
install(TARGETS ec_jerasure DESTINATION ${erasure_plugin_dir})
|
||||
|
@ -11,4 +11,4 @@ add_library(ec_lrc SHARED ${lrc_srcs})
|
||||
add_dependencies(ec_lrc ${CMAKE_SOURCE_DIR}/src/ceph_ver.h)
|
||||
target_link_libraries(ec_lrc crush json_spirit)
|
||||
set_target_properties(ec_lrc PROPERTIES VERSION 1.0.0 SOVERSION 1)
|
||||
install(TARGETS ec_lrc DESTINATION lib/erasure-code)
|
||||
install(TARGETS ec_lrc DESTINATION ${erasure_plugin_dir})
|
||||
|
@ -18,7 +18,7 @@ add_library(ec_shec_generic SHARED
|
||||
target_link_libraries(ec_shec_generic crush pthread)
|
||||
add_dependencies(ec_shec_generic ${CMAKE_SOURCE_DIR}/src/ceph_ver.h)
|
||||
set_target_properties(ec_shec_generic PROPERTIES VERSION 1.0.0 SOVERSION 1)
|
||||
install(TARGETS ec_shec_generic DESTINATION lib/erasure-code)
|
||||
install(TARGETS ec_shec_generic DESTINATION ${erasure_plugin_dir})
|
||||
|
||||
# ec_shec_neon
|
||||
#TODO:build libec_shec_neon library on an ARM machine
|
||||
@ -33,7 +33,7 @@ if(ARM_NEON OR ARM_NEON2)
|
||||
target_link_libraries(ec_shec_neon ${EXTRALIBS})
|
||||
set_target_properties(ec_shec_neon PROPERTIES VERSION 2.0.0 SOVERSION 2
|
||||
COMPILE_FLAGS ${ARM_NEON_FLAGS})
|
||||
install(TARGETS ec_shec_neon DESTINATION lib/erasure-code)
|
||||
install(TARGETS ec_shec_neon DESTINATION ${erasure_plugin_dir})
|
||||
endif(ARM_NEON OR ARM_NEON2)
|
||||
|
||||
# ec_shec_sse3
|
||||
@ -45,7 +45,7 @@ if(INTEL_SSE)
|
||||
target_link_libraries(ec_shec_sse3 crush ${EXTRALIBS})
|
||||
set_target_properties(ec_shec_sse3 PROPERTIES VERSION 2.0.0 SOVERSION 2
|
||||
COMPILE_FLAGS ${SSE3_FLAGS})
|
||||
install(TARGETS ec_shec_sse3 DESTINATION lib/erasure-code)
|
||||
install(TARGETS ec_shec_sse3 DESTINATION ${erasure_plugin_dir})
|
||||
endif(INTEL_SSE)
|
||||
|
||||
# ec_shec_sse4
|
||||
@ -57,11 +57,11 @@ if(INTEL_SSE4_1)
|
||||
target_link_libraries(ec_shec_sse4 crush ${EXTRALIBS})
|
||||
set_target_properties(ec_shec_sse4 PROPERTIES VERSION 2.0.0 SOVERSION 2
|
||||
COMPILE_FLAGS ${SSE4_FLAGS})
|
||||
install(TARGETS ec_shec_sse4 DESTINATION lib/erasure-code)
|
||||
install(TARGETS ec_shec_sse4 DESTINATION ${erasure_plugin_dir})
|
||||
endif(INTEL_SSE4_1)
|
||||
|
||||
add_library(ec_shec SHARED ErasureCodePluginSelectShec.cc)
|
||||
add_dependencies(ec_shec ${CMAKE_SOURCE_DIR}/src/ceph_ver.h)
|
||||
target_link_libraries(ec_shec ${EXTRALIBS})
|
||||
set_target_properties(ec_shec PROPERTIES VERSION 2.0.0 SOVERSION 2)
|
||||
install(TARGETS ec_shec DESTINATION lib/erasure-code)
|
||||
install(TARGETS ec_shec DESTINATION ${erasure_plugin_dir})
|
||||
|
@ -2,8 +2,11 @@ set(libradosstriper_srcs
|
||||
libradosstriper.cc
|
||||
RadosStriperImpl.cc
|
||||
MultiAioCompletionImpl.cc)
|
||||
add_library(libradosstriper ${libradosstriper_srcs})
|
||||
target_link_libraries(libradosstriper librados cls_lock_client osdc common pthread ${CRYPTO_LIBS} ${EXTRALIBS})
|
||||
set_target_properties(libradosstriper PROPERTIES OUPUT_NAME libradosstriper VERSION "1.0.0" SOVERSION "1")
|
||||
add_library(radosstriper ${libradosstriper_srcs})
|
||||
target_link_libraries(radosstriper librados cls_lock_client osdc common pthread ${CRYPTO_LIBS} ${EXTRALIBS})
|
||||
set_target_properties(radosstriper PROPERTIES
|
||||
OUPUT_NAME radosstriper
|
||||
VERSION "1.0.0"
|
||||
SOVERSION "1")
|
||||
|
||||
install(TARGETS libradosstriper DESTINATION lib)
|
||||
install(TARGETS radosstriper DESTINATION lib)
|
||||
|
@ -65,7 +65,7 @@ set(librbd_internal_srcs
|
||||
add_library(rbd_api STATIC librbd.cc)
|
||||
add_library(rbd_internal STATIC ${librbd_internal_srcs})
|
||||
if(WITH_LTTNG)
|
||||
add_dependencies(rbd_internal librbd-tp)
|
||||
add_dependencies(rbd_internal rbd-tp)
|
||||
endif()
|
||||
|
||||
add_library(librbd
|
||||
|
@ -3,9 +3,8 @@
|
||||
# not "lib64" (even on 64-bit platforms).
|
||||
set(ocf_dir ${CMAKE_INSTALL_PREFIX}/lib/ocf)
|
||||
|
||||
string(TOLOWER ${PROJECT_NAME} lower_project_name)
|
||||
# The ceph provider directory
|
||||
set(ra_dir ${ocf_dir}/resource.d/${lower_project_name})
|
||||
set(ra_dir ${ocf_dir}/resource.d/${PROJECT_NAME})
|
||||
|
||||
foreach(agent ceph rbd)
|
||||
configure_file(${agent}.in
|
||||
|
@ -1,9 +1,7 @@
|
||||
find_package(Cython REQUIRED)
|
||||
include(Distutils)
|
||||
|
||||
set(CYTHON_MODULE_DIR ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/cython_modules)
|
||||
get_property(compiler_launcher GLOBAL PROPERTY RULE_LAUNCH_COMPILE)
|
||||
get_property(link_launcher GLOBAL PROPERTY RULE_LAUNCH_LINK)
|
||||
set(PY_CC \"${compiler_launcher} ${CMAKE_C_COMPILER}\")
|
||||
set(PY_CXX \"${compiler_launcher} ${CMAKE_CXX_COMPILER}\")
|
||||
set(PY_LDSHARED \"${link_launcher} ${CMAKE_C_COMPILER} -shared\")
|
||||
|
||||
add_subdirectory(rados)
|
||||
add_subdirectory(rbd)
|
||||
|
@ -1,14 +1,3 @@
|
||||
add_custom_target(cython_cephfs
|
||||
COMMAND
|
||||
env
|
||||
CC=${PY_CC}
|
||||
CXX=${PY_CXX}
|
||||
LDSHARED=${PY_LDSHARED}
|
||||
OPT=\"-DNDEBUG -g -fwrapv -O2 -Wall\"
|
||||
LDFLAGS=-L${CMAKE_LIBRARY_OUTPUT_DIRECTORY}
|
||||
CYTHON_BUILD_DIR=${CMAKE_BINARY_DIR}/src/pybind/cephfs
|
||||
CFLAGS=\"-iquote ${CMAKE_SOURCE_DIR}/src/include\"
|
||||
python ${CMAKE_SOURCE_DIR}/src/pybind/cephfs/setup.py build --build-base ${CYTHON_MODULE_DIR} --verbose
|
||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/src/pybind/cephfs
|
||||
DEPENDS rados cephfs)
|
||||
|
||||
distutils_add_cython_module(cython_cephfs ${CMAKE_CURRENT_SOURCE_DIR}/cephfs.pyx)
|
||||
add_dependencies(cython_cephfs cephfs)
|
||||
distutils_install_cython_module(cython_cephfs)
|
||||
|
@ -1,14 +1,3 @@
|
||||
add_custom_target(cython_rados
|
||||
COMMAND
|
||||
env
|
||||
CC=${PY_CC}
|
||||
CXX=${PY_CXX}
|
||||
LDSHARED=${PY_LDSHARED}
|
||||
OPT=\"-DNDEBUG -g -fwrapv -O2 -Wall\"
|
||||
LDFLAGS=-L${CMAKE_LIBRARY_OUTPUT_DIRECTORY}
|
||||
CYTHON_BUILD_DIR=${CMAKE_BINARY_DIR}/src/pybind/rados
|
||||
CFLAGS=\"-iquote ${CMAKE_SOURCE_DIR}/src/include\"
|
||||
python ${CMAKE_SOURCE_DIR}/src/pybind/rados/setup.py build --build-base ${CYTHON_MODULE_DIR} --verbose
|
||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/src/pybind/rados
|
||||
DEPENDS rados)
|
||||
|
||||
distutils_add_cython_module(cython_rados ${CMAKE_CURRENT_SOURCE_DIR}/rados.pyx)
|
||||
add_dependencies(cython_rados rados)
|
||||
distutils_install_cython_module(cython_rados)
|
||||
|
@ -1,14 +1,3 @@
|
||||
add_custom_target(cython_rbd
|
||||
COMMAND
|
||||
env
|
||||
CC=${PY_CC}
|
||||
CXX=${PY_CXX}
|
||||
LDSHARED=${PY_LDSHARED}
|
||||
OPT=\"-DNDEBUG -g -fwrapv -O2 -Wall\"
|
||||
LDFLAGS=-L${CMAKE_LIBRARY_OUTPUT_DIRECTORY}
|
||||
CYTHON_BUILD_DIR=${CMAKE_BINARY_DIR}/src/pybind/rbd
|
||||
CFLAGS=\"-iquote ${CMAKE_SOURCE_DIR}/src/include\"
|
||||
python ${CMAKE_SOURCE_DIR}/src/pybind/rbd/setup.py build --build-base ${CYTHON_MODULE_DIR} --verbose
|
||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/src/pybind/rbd
|
||||
DEPENDS rbd)
|
||||
|
||||
distutils_add_cython_module(cython_rbd ${CMAKE_CURRENT_SOURCE_DIR}/rbd.pyx)
|
||||
add_dependencies(cython_rbd rbd)
|
||||
distutils_install_cython_module(cython_rbd)
|
||||
|
19
src/rgw/CMakeLists.txt
Normal file
19
src/rgw/CMakeLists.txt
Normal file
@ -0,0 +1,19 @@
|
||||
add_executable(ceph_rgw_jsonparser
|
||||
rgw_jsonparser.cc
|
||||
rgw_common.cc
|
||||
rgw_env.cc
|
||||
rgw_json_enc.cc)
|
||||
target_link_libraries(ceph_rgw_jsonparser
|
||||
rgw_a
|
||||
global)
|
||||
|
||||
add_executable(ceph_rgw_multiparser
|
||||
rgw_multiparser.cc)
|
||||
target_link_libraries(ceph_rgw_multiparser
|
||||
rgw_a
|
||||
global)
|
||||
|
||||
install(TARGETS
|
||||
ceph_rgw_jsonparser
|
||||
ceph_rgw_multiparser
|
||||
DESTINATION bin)
|
@ -356,13 +356,13 @@ set_target_properties(ceph_perf_local PROPERTIES COMPILE_FLAGS
|
||||
${PERF_LOCAL_FLAGS})
|
||||
target_link_libraries(ceph_perf_local os global ${UNITTEST_LIBS})
|
||||
|
||||
# ceph_test_xattr_bench
|
||||
add_executable(ceph_test_xattr_bench
|
||||
# ceph_xattr_bench
|
||||
add_executable(ceph_xattr_bench
|
||||
xattr_bench.cc
|
||||
)
|
||||
set_target_properties(ceph_test_xattr_bench PROPERTIES COMPILE_FLAGS
|
||||
set_target_properties(ceph_xattr_bench PROPERTIES COMPILE_FLAGS
|
||||
${UNITTEST_CXX_FLAGS})
|
||||
target_link_libraries(ceph_test_xattr_bench
|
||||
target_link_libraries(ceph_xattr_bench
|
||||
os
|
||||
common
|
||||
${UNITTEST_LIBS}
|
||||
@ -372,6 +372,16 @@ target_link_libraries(ceph_test_xattr_bench
|
||||
${CMAKE_DL_LIBS}
|
||||
)
|
||||
|
||||
install(TARGETS
|
||||
ceph_bench_log
|
||||
ceph_kvstorebench
|
||||
ceph_multi_stress_watch
|
||||
ceph_objectstore_bench
|
||||
ceph_omapbench
|
||||
ceph_perf_local
|
||||
ceph_xattr_bench
|
||||
DESTINATION bin)
|
||||
|
||||
# ceph_test_filejournal
|
||||
add_executable(ceph_test_filejournal
|
||||
test_filejournal.cc
|
||||
|
@ -73,3 +73,10 @@ add_executable(ceph_tpbench
|
||||
target_link_libraries(ceph_tpbench librados ${Boost_PROGRAM_OPTIONS_LIBRARY} global
|
||||
${BLKID_LIBRARIES} ${CMAKE_DL_LIBS})
|
||||
|
||||
install(TARGETS
|
||||
ceph_smalliobench
|
||||
ceph_smalliobenchrbd
|
||||
ceph_smalliobenchfs
|
||||
ceph_smalliobenchdumb
|
||||
ceph_tpbench
|
||||
DESTINATION bin)
|
||||
|
@ -3,12 +3,16 @@ add_executable(ceph_erasure_code_benchmark
|
||||
${CMAKE_SOURCE_DIR}/src/erasure-code/ErasureCode.cc
|
||||
ceph_erasure_code_benchmark.cc)
|
||||
target_link_libraries(ceph_erasure_code_benchmark osd common ${Boost_PROGRAM_OPTIONS_LIBRARY} global dl)
|
||||
install(TARGETS ceph_erasure_code_benchmark
|
||||
DESTINATION bin)
|
||||
|
||||
add_executable(ceph_erasure_code_non_regression ceph_erasure_code_non_regression.cc)
|
||||
target_link_libraries(ceph_erasure_code_non_regression osd common ${Boost_PROGRAM_OPTIONS_LIBRARY} global dl)
|
||||
|
||||
add_executable(ceph_erasure_code ceph_erasure_code.cc)
|
||||
target_link_libraries(ceph_erasure_code osd common ${Boost_PROGRAM_OPTIONS_LIBRARY} global dl)
|
||||
install(TARGETS ceph_erasure_code
|
||||
DESTINATION bin)
|
||||
|
||||
add_library(ec_example SHARED
|
||||
ErasureCodePluginExample.cc
|
||||
|
@ -6,7 +6,7 @@ set_target_properties(rados_striper_test PROPERTIES COMPILE_FLAGS
|
||||
add_executable(ceph_test_rados_api_striping
|
||||
striping.cc
|
||||
)
|
||||
target_link_libraries(ceph_test_rados_api_striping librados libradosstriper
|
||||
target_link_libraries(ceph_test_rados_api_striping librados radosstriper
|
||||
${UNITTEST_LIBS} rados_striper_test)
|
||||
set_target_properties(ceph_test_rados_api_striping PROPERTIES COMPILE_FLAGS
|
||||
${UNITTEST_CXX_FLAGS})
|
||||
|
@ -26,3 +26,7 @@ set_target_properties(ceph_perf_msgr_client PROPERTIES COMPILE_FLAGS
|
||||
${UNITTEST_CXX_FLAGS})
|
||||
target_link_libraries(ceph_perf_msgr_client os global ${UNITTEST_LIBS})
|
||||
|
||||
install(TARGETS
|
||||
ceph_perf_msgr_server
|
||||
ceph_perf_msgr_client
|
||||
DESTINATION bin)
|
||||
|
@ -5,6 +5,8 @@ add_executable(ceph_perf_objectstore
|
||||
set_target_properties(ceph_perf_objectstore PROPERTIES COMPILE_FLAGS
|
||||
${UNITTEST_CXX_FLAGS})
|
||||
target_link_libraries(ceph_perf_objectstore os osdc global ${UNITTEST_LIBS})
|
||||
install(TARGETS ceph_perf_objectstore
|
||||
DESTINATION bin)
|
||||
|
||||
#ceph_test_objectstore
|
||||
add_executable(ceph_test_objectstore
|
||||
|
@ -18,14 +18,13 @@ foreach(tp ${tps})
|
||||
COMMENT "generating ${header} ${src}")
|
||||
set_source_files_properties(${header} ${src}
|
||||
PROPERTIES GENERATED TRUE)
|
||||
add_custom_target(
|
||||
${name}-tp
|
||||
DEPENDS ${header})
|
||||
endforeach()
|
||||
|
||||
function(add_tracing_library name tracings version)
|
||||
foreach(tp_file ${tracings})
|
||||
get_filename_component(tp ${tp_file} NAME_WE)
|
||||
list(APPEND hdrs
|
||||
${header_dir}/${tp}.h)
|
||||
list(APPEND srcs
|
||||
${header_dir}/${tp}.h
|
||||
${header_dir}/${tp}.c)
|
||||
@ -33,18 +32,21 @@ function(add_tracing_library name tracings version)
|
||||
add_library(${name} SHARED ${srcs})
|
||||
target_link_libraries(${name} ${LTTNG_LIBRARIES} dl)
|
||||
string(REGEX MATCH "^[0-9]+" soversion ${version})
|
||||
string(REGEX REPLACE "^lib" "" output_name ${name})
|
||||
set_target_properties(${name} PROPERTIES
|
||||
OUTPUT_NAME ${output_name}
|
||||
OUTPUT_NAME ${name}
|
||||
VERSION ${version}
|
||||
SOVERSION ${soversion})
|
||||
string(REGEX REPLACE "_tp$" "" traced ${name})
|
||||
add_custom_target(
|
||||
${traced}-tp
|
||||
DEPENDS ${hdrs})
|
||||
endfunction()
|
||||
|
||||
set(osd_traces oprequest.tp osd.tp pg.tp)
|
||||
add_tracing_library(libosd_tp "${osd_traces}" 1.0.0)
|
||||
add_tracing_library(librados_tp librados.tp 2.0.0)
|
||||
add_tracing_library(librbd_tp librbd.tp 1.0.0)
|
||||
add_tracing_library(libos_tp objectstore.tp 1.0.0)
|
||||
add_tracing_library(osd_tp "${osd_traces}" 1.0.0)
|
||||
add_tracing_library(rados_tp librados.tp 2.0.0)
|
||||
add_tracing_library(rbd_tp librbd.tp 1.0.0)
|
||||
add_tracing_library(os_tp objectstore.tp 1.0.0)
|
||||
|
||||
install(TARGETS librados_tp libosd_tp librbd_tp libos_tp DESTINATION lib)
|
||||
install(TARGETS rados_tp osd_tp rbd_tp os_tp DESTINATION lib)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user