]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
qa: update test_envlibrados_for_rocksdb.sh for libradospp split
authorKefu Chai <kchai@redhat.com>
Mon, 29 Oct 2018 07:34:52 +0000 (15:34 +0800)
committerKefu Chai <kchai@redhat.com>
Thu, 1 Nov 2018 16:15:31 +0000 (00:15 +0800)
include a patch so rocksdb can use libradospp instead of librados. will
upstream the patch and make it work for both pre-nautilus librados and
nautilus libradospp

Signed-off-by: Kefu Chai <kchai@redhat.com>
qa/workunits/rados/0001-cmake-add-Findrados.cmake-and-use-it.patch [new file with mode: 0644]
qa/workunits/rados/test_envlibrados_for_rocksdb.sh

diff --git a/qa/workunits/rados/0001-cmake-add-Findrados.cmake-and-use-it.patch b/qa/workunits/rados/0001-cmake-add-Findrados.cmake-and-use-it.patch
new file mode 100644 (file)
index 0000000..4ab359d
--- /dev/null
@@ -0,0 +1,71 @@
+From 7535e5f47353658f966eb4dce344154678463e04 Mon Sep 17 00:00:00 2001
+From: Kefu Chai <tchaikov@gmail.com>
+Date: Mon, 29 Oct 2018 19:14:54 +0800
+Subject: [PATCH] cmake: add Findrados.cmake and use it
+
+ceph has extracted libradospp out from librados. the former offers the
+C++ API, while the latter offers the C API.
+
+Signed-off-by: Kefu Chai <tchaikov@gmail.com>
+---
+ CMakeLists.txt                  |  3 ++-
+ cmake/modules/Findradospp.cmake | 33 +++++++++++++++++++++++++++++++++
+ 2 files changed, 35 insertions(+), 1 deletion(-)
+ create mode 100644 cmake/modules/Findradospp.cmake
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 6cb80cd10..48c61f928 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -731,7 +731,8 @@ option(WITH_LIBRADOS "Build with librados" OFF)
+ if(WITH_LIBRADOS)
+   list(APPEND SOURCES
+     utilities/env_librados.cc)
+-  list(APPEND THIRDPARTY_LIBS rados)
++  find_package(radospp REQUIRED)
++  list(APPEND THIRDPARTY_LIBS rados::radospp)
+ endif()
+ if(WIN32)
+diff --git a/cmake/modules/Findradospp.cmake b/cmake/modules/Findradospp.cmake
+new file mode 100644
+index 000000000..18822adb9
+--- /dev/null
++++ b/cmake/modules/Findradospp.cmake
+@@ -0,0 +1,33 @@
++# - Find RADOS
++# Find librados library and includes
++#
++# RADOSPP_INCLUDE_DIR - where to find librados.hpp.
++# RADOSPP_LIBRARIES - List of libraries when using radospp.
++# radospp_FOUND - True if radospp found.
++
++find_path(RADOSPP_INCLUDE_DIR
++  NAMES rados/librados.hpp
++  HINTS ${LIBRADOS_ROOT}/include)
++
++find_library(RADOSPP_LIBRARIES
++  NAMES radospp
++  HINTS ${LIBRADOS_ROOT}/lib)
++
++include(FindPackageHandleStandardArgs)
++find_package_handle_standard_args(radospp
++  DEFAULT_MSG RADOSPP_LIBRARIES RADOSPP_INCLUDE_DIR)
++
++mark_as_advanced(
++  RADOSPP_INCLUDE_DIR
++  RADOSPP_LIBRARIES)
++
++message(STATUS "${RADOSPP_INCLUDE_DIR}")
++message(STATUS "${RADOSPP_LIBRARIES}")
++message(STATUS "${radospp_FOUND}")
++if(radospp_FOUND AND NOT (TARGET rados::radospp))
++  add_library(rados::radospp UNKNOWN IMPORTED)
++  set_target_properties(rados::radospp PROPERTIES
++    INTERFACE_INCLUDE_DIRECTORIES "${RADOSPP_INCLUDE_DIR}"
++    IMPORTED_LINK_INTERFACE_LANGUAGES "CXX"
++    IMPORTED_LOCATION "${RADOSPP_LIBRARIES}")
++endif()
+-- 
+2.19.1
+
index 05281cbb445ddbccca0044ac283527f8f5ba90c0..1ea2c26b5277930cb2ab874a53c2f32e28ef5bf4 100755 (executable)
@@ -42,10 +42,10 @@ CURRENT_PATH=`pwd`
 # for rocksdb
 case $(lsb_release -si) in
        Ubuntu|Debian|Devuan)
-               install g++ libsnappy-dev zlib1g-dev libbz2-dev librados-dev
+               install g++ libsnappy-dev zlib1g-dev libbz2-dev libradospp-dev
                ;;
        CentOS|Fedora|RedHatEnterpriseServer)
-               install gcc-c++.x86_64 snappy-devel zlib zlib-devel bzip2 bzip2-devel librados2-devel.x86_64
+               install gcc-c++.x86_64 snappy-devel zlib zlib-devel bzip2 bzip2-devel libradospp-devel.x86_64
                ;;
        *)
         echo "$(lsb_release -si) is unknown, $@ will have to be installed manually."
@@ -73,6 +73,8 @@ git clone https://github.com/facebook/rocksdb.git --depth 1
 
 # compile code
 cd rocksdb
+patch -p1 $(dirname $0)/0001-cmake-add-Findrados.cmake-and-use-it.patch
+
 mkdir build && cd build && cmake -DWITH_LIBRADOS=ON -DWITH_SNAPPY=ON -DWITH_GFLAGS=OFF -DFAIL_ON_WARNINGS=OFF ..
 make rocksdb_env_librados_test -j8