Skip to content

Commit

Permalink
Merge pull request ceph#22752 from tchaikov/wip-freebsd-w/o-rdma
Browse files Browse the repository at this point in the history
cmake,do_freebsd.sh: disable rdma features

Reviewed-by: Willem Jan Withagen <[email protected]>
Reviewed-by: Haodong Tang <[email protected]>
  • Loading branch information
tchaikov authored Jun 29, 2018
2 parents 4f51d11 + 63656af commit 32cb302
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 36 deletions.
11 changes: 4 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -172,17 +172,14 @@ if(WITH_STATIC_LIBSTDCXX)
endif()
endif()

option(WITH_VERBS "Enable RDMA verbs in async messenger" ON)
if(WITH_VERBS)
option(WITH_RDMA "Enable RDMA in async messenger" ON)
if(WITH_RDMA)
find_package(verbs REQUIRED)
set(HAVE_VERBS ${VERBS_FOUND})
endif(WITH_VERBS)

option(WITH_RDMACM "Enable RDMA cm in async messenger" ON)
if(WITH_RDMACM)
find_package(rdmacm REQUIRED)
set(HAVE_RDMACM ${RDMACM_FOUND})
endif(WITH_RDMACM)
set(HAVE_RDMA TRUE)
endif()

find_package(Backtrace)

Expand Down
2 changes: 0 additions & 2 deletions cmake/modules/Findfcgi.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ find_library(FCGI_LIBRARY NAMES fcgi libfcgi PATHS
/usr/local/lib
/usr/lib)

# handle the QUIETLY and REQUIRED arguments and set UUID_FOUND to TRUE if
# all listed variables are TRUE
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(fcgi DEFAULT_MSG FCGI_LIBRARY FCGI_INCLUDE_DIR)

Expand Down
12 changes: 10 additions & 2 deletions cmake/modules/Findrdmacm.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,19 @@
find_path(RDMACM_INCLUDE_DIR rdma/rdma_cma.h)
find_library(RDMACM_LIBRARIES rdmacm)

# handle the QUIETLY and REQUIRED arguments and set UUID_FOUND to TRUE if
# all listed variables are TRUE
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(rdmacm DEFAULT_MSG RDMACM_LIBRARIES RDMACM_INCLUDE_DIR)

if(RDMACM_FOUND)
if(NOT TARGET RDMA::RDMAcm)
add_library(RDMA::RDMAcm UNKNOWN IMPORTED)
endif()
set_target_properties(RDMA::RDMAcm PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${RDMACM_INCLUDE_DIR}"
IMPORTED_LINK_INTERFACE_LANGUAGES "C"
IMPORTED_LOCATION "${RDMACM_LIBRARIES}")
endif()

mark_as_advanced(
RDMACM_LIBRARIES
)
2 changes: 0 additions & 2 deletions cmake/modules/Findsnappy.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ find_library(SNAPPY_LIBRARIES
NAMES snappy
HINTS ${SNAPPY_ROOT_DIR}/lib)

# handle the QUIETLY and REQUIRED arguments and set UUID_FOUND to TRUE if
# all listed variables are TRUE
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(snappy DEFAULT_MSG SNAPPY_LIBRARIES SNAPPY_INCLUDE_DIR)

Expand Down
16 changes: 7 additions & 9 deletions cmake/modules/Findverbs.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,15 @@
# VERBS_INCLUDE_DIR - where to find ibverbs.h, etc.
# VERBS_LIBRARIES - List of libraries when using ibverbs.
# VERBS_FOUND - True if ibverbs found.
# HAVE_IBV_EXP - True if experimental verbs is enabled.

find_path(VERBS_INCLUDE_DIR infiniband/verbs.h)
find_library(VERBS_LIBRARIES ibverbs)

# handle the QUIETLY and REQUIRED arguments and set UUID_FOUND to TRUE if
# all listed variables are TRUE
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(verbs DEFAULT_MSG VERBS_LIBRARIES VERBS_INCLUDE_DIR)

if(VERBS_FOUND)
message(STATUS "Found libibverbs: ${VERBS_LIBRARIES}")
include(CheckCXXSourceCompiles)
CHECK_CXX_SOURCE_COMPILES("
#include <infiniband/verbs.h>
Expand All @@ -24,13 +22,13 @@ if(VERBS_FOUND)
ibv_exp_query_gid_attr(ctxt, 1, 0, &gid_attr);
return 0;
} " HAVE_IBV_EXP)

else()
message(STATUS "Not Found libibverbs: ${VERBS_LIBRARIES}")
if (VERBS_FIND_REQUIRED)
message(STATUS "Looked for libibverbs named ${VERBS_NAMES}.")
message(FATAL_ERROR "Could NOT find libibverbs")
if(NOT TARGET IBVerbs::verbs)
add_library(IBVerbs::verbs UNKNOWN IMPORTED)
endif()
set_target_properties(IBVerbs::verbs PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${VERBS_INCLUDE_DIR}"
IMPORTED_LINK_INTERFACE_LANGUAGES "C"
IMPORTED_LOCATION "${VERBS_LIBRARIES}")
endif()

mark_as_advanced(
Expand Down
1 change: 1 addition & 0 deletions do_freebsd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ rm -rf build && ./do_cmake.sh "$*" \
-D WITH_LIBCEPHFS=OFF \
-D WITH_CEPHFS=OFF \
-D WITH_MGR=YES \
-D WITH_RDMA=OFF \
-D WITH_SPDK=OFF \
2>&1 | tee cmake.log

Expand Down
17 changes: 3 additions & 14 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -297,17 +297,6 @@ if(HAVE_XIO)
list(APPEND EXTRALIBS ${XIO_LIBRARY} pthread)
endif(HAVE_XIO)

if(HAVE_RDMACM)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -I${RDMACM_INCLUDE_DIR}")
list(APPEND EXTRALIBS ${RDMACM_LIBRARIES} pthread)
endif(HAVE_RDMACM)

if(HAVE_VERBS)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -I${VERBS_INCLUDE_DIR}")
list(APPEND EXTRALIBS ${VERBS_LIBRARIES} pthread)
endif(HAVE_VERBS)


# sort out which allocator to use
if(ALLOCATOR STREQUAL "tcmalloc")
set(ALLOC_LIBS ${GPERFTOOLS_TCMALLOC_LIBRARY})
Expand Down Expand Up @@ -411,7 +400,7 @@ if(HAVE_XIO)
endif(HAVE_XIO)

set(async_rdma_common_srcs)
if(HAVE_VERBS AND HAVE_RDMACM)
if(HAVE_RDMA)
list(APPEND async_rdma_common_srcs
msg/async/rdma/Infiniband.cc
msg/async/rdma/RDMAConnectedSocketImpl.cc
Expand Down Expand Up @@ -662,10 +651,10 @@ if(HAVE_UDEV)
list(APPEND ceph_common_deps ${UDEV_LIBRARIES})
endif()
if(HAVE_VERBS)
list(APPEND ceph_common_deps ${VERBS_LIBRARIES})
list(APPEND ceph_common_deps IBVerbs::verbs)
endif()
if(HAVE_RDMACM)
list(APPEND ceph_common_deps ${RDMACM_LIBRARIES})
list(APPEND ceph_common_deps RDMA::RDMAcm)
endif()
if(NOT WITH_SYSTEM_BOOST)
list(APPEND ceph_common_deps ${ZLIB_LIBRARIES})
Expand Down

0 comments on commit 32cb302

Please sign in to comment.