summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKefu Chai <kchai@redhat.com>2021-04-15 10:43:28 +0200
committerGitHub <noreply@github.com>2021-04-15 10:43:28 +0200
commit117838c91d0cadbd4f5126dcfbfb5dfa938176fe (patch)
tree6875b988fd56338fdb6c1fc6e95c4c7a2a7d17e5
parentMerge pull request #40862 from ivancich/wip-rgw-reshard-contention-logging (diff)
parentcmake: use src/pmdk for building pmdk if it exists (diff)
downloadceph-117838c91d0cadbd4f5126dcfbfb5dfa938176fe.tar.xz
ceph-117838c91d0cadbd4f5126dcfbfb5dfa938176fe.zip
Merge pull request #40866 from hualongfeng/pmdk_in_dist
make-dist: add pmdk to dist tarball Reviewed-by: Kefu Chai <kchai@redhat.com>
-rw-r--r--cmake/modules/Buildpmem.cmake42
-rwxr-xr-xmake-dist21
2 files changed, 47 insertions, 16 deletions
diff --git a/cmake/modules/Buildpmem.cmake b/cmake/modules/Buildpmem.cmake
index 46a246b94e8..7068db85e88 100644
--- a/cmake/modules/Buildpmem.cmake
+++ b/cmake/modules/Buildpmem.cmake
@@ -1,7 +1,18 @@
function(build_pmem)
- include(ExternalProject)
- set(PMDK_SRC "${CMAKE_BINARY_DIR}/src/pmdk/src")
- set(PMDK_INCLUDE "${PMDK_SRC}/include")
+ include(FindMake)
+ find_make("MAKE_EXECUTABLE" "make_cmd")
+
+ if(EXISTS "${PROJECT_SOURCE_DIR}/src/pmdk/Makefile")
+ set(source_dir_args
+ SOURCE_DIR "${PROJECT_SOURCE_DIR}/src/pmdk")
+ else()
+ set(source_dir_args
+ SOURCE_DIR ${CMAKE_BINARY_DIR}/src/pmdk
+ GIT_REPOSITORY https://github.com/ceph/pmdk.git
+ GIT_TAG "1.7"
+ GIT_SHALLOW TRUE
+ GIT_CONFIG advice.detachedHead=false)
+ endif()
# Use debug PMDK libs in debug lib/rbd builds
if(CMAKE_BUILD_TYPE STREQUAL Debug)
@@ -9,29 +20,28 @@ function(build_pmem)
else()
set(PMDK_LIB_DIR "nondebug")
endif()
- set(PMDK_LIB "${PMDK_SRC}/${PMDK_LIB_DIR}")
-
- include(FindMake)
- find_make("MAKE_EXECUTABLE" "make_cmd")
+ include(ExternalProject)
ExternalProject_Add(pmdk_ext
- GIT_REPOSITORY "https://github.com/ceph/pmdk.git"
- GIT_TAG "1.7"
- GIT_SHALLOW TRUE
- GIT_CONFIG advice.detachedHead=false
- SOURCE_DIR ${CMAKE_BINARY_DIR}/src/pmdk
+ ${source_dir_args}
CONFIGURE_COMMAND ""
# Explicitly built w/o NDCTL, otherwise if ndtcl is present on the
# build system tests statically linking to librbd (which uses
# libpmemobj) will not link (because we don't build the ndctl
# static library here).
- BUILD_COMMAND ${make_cmd} CC=${CMAKE_C_COMPILER} NDCTL_ENABLE=n
+ BUILD_COMMAND ${make_cmd} CC=${CMAKE_C_COMPILER} NDCTL_ENABLE=n BUILD_EXAMPLES=n BUILD_BENCHMARKS=n DOC=n
BUILD_IN_SOURCE 1
- BUILD_BYPRODUCTS "${PMDK_LIB}/libpmem.a" "${PMDK_LIB}/libpmemobj.a"
+ BUILD_BYPRODUCTS "<SOURCE_DIR>/src/${PMDK_LIB_DIR}/libpmem.a" "<SOURCE_DIR>/src/${PMDK_LIB_DIR}/libpmemobj.a"
INSTALL_COMMAND "")
+ unset(make_cmd)
+
+ ExternalProject_Get_Property(pmdk_ext source_dir)
+ set(PMDK_SRC "${source_dir}/src")
+ set(PMDK_INCLUDE "${source_dir}/src/include")
+ set(PMDK_LIB "${source_dir}/src/${PMDK_LIB_DIR}")
# libpmem
- add_library(pmem::pmem STATIC IMPORTED)
+ add_library(pmem::pmem STATIC IMPORTED GLOBAL)
add_dependencies(pmem::pmem pmdk_ext)
file(MAKE_DIRECTORY ${PMDK_INCLUDE})
set_target_properties(pmem::pmem PROPERTIES
@@ -40,7 +50,7 @@ function(build_pmem)
INTERFACE_LINK_LIBRARIES ${CMAKE_THREAD_LIBS_INIT})
# libpmemobj
- add_library(pmem::pmemobj STATIC IMPORTED)
+ add_library(pmem::pmemobj STATIC IMPORTED GLOBAL)
add_dependencies(pmem::pmemobj pmdk_ext)
set_target_properties(pmem::pmemobj PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES ${PMDK_INCLUDE}
diff --git a/make-dist b/make-dist
index 8d27793bfc0..e4a78dafd70 100755
--- a/make-dist
+++ b/make-dist
@@ -109,6 +109,23 @@ download_liburing() {
rm -rf src/liburing
}
+download_pmdk() {
+ pmdk_version=$1
+ shift
+ pmdk_sha256=$1
+ shift
+ pmdk_fname=pmdk-${pmdk_version}.tar.gz
+ download_from $pmdk_fname $pmdk_sha256 $*
+ tar xzf $pmdk_fname -C src \
+ --exclude="pmdk-${pmdk_version}/doc" \
+ --exclude="pmdk-${pmdk_version}/src/test" \
+ --exclude="pmdk-${pmdk_version}/src/examples" \
+ --exclude="pmdk-${pmdk_version}/src/benchmarks"
+ mv src/pmdk-${pmdk_version} src/pmdk
+ tar cf ${outfile}.pmdk.tar ${outfile}/src/pmdk
+ rm -rf src/pmdk
+}
+
build_dashboard_frontend() {
CURR_DIR=`pwd`
TEMP_DIR=`mktemp -d`
@@ -169,11 +186,15 @@ download_boost $boost_version 953db31e016db7bb207f11432bef7df100516eeb746843fa04
download_liburing 0.7 8e2842cfe947f3a443af301bdd6d034455536c38a455c7a700d0c1ad165a7543 \
https://github.com/axboe/liburing/archive \
https://git.kernel.dk/cgit/liburing/snapshot
+pmdk_version=1.7
+download_pmdk $pmdk_version 865ce1b422bc83109cb4a63dcff8fd1077eea3617e668faf6a043208d8be03ca \
+ https://github.com/pmem/pmdk/releases/download/$pmdk_version
build_dashboard_frontend
generate_rook_ceph_client
for tarball in $outfile.version \
$outfile.boost \
$outfile.liburing \
+ $outfile.pmdk \
dashboard_frontend \
rook_ceph_client \
$outfile; do