Skip to content

Commit

Permalink
Remove unnecessary dependencies. (#1949)
Browse files Browse the repository at this point in the history
Signed-off-by: vegetableysm <[email protected]>
  • Loading branch information
vegetableysm authored Jul 22, 2024
1 parent c4679c0 commit a561b47
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 41 deletions.
6 changes: 0 additions & 6 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,14 +118,8 @@ jobs:
pandoc \
protobuf-compiler-grpc \
python3-pip \
uuid-dev \
automake \
libtool \
librdmacm-dev \
libibverbs-dev \
libnuma-dev \
libnl-3-dev \
libnl-genl-3-dev \
wget
# install apache-arrow
Expand Down
105 changes: 70 additions & 35 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -669,52 +669,87 @@ include("cmake/GenerateVineyardJava.cmake")
if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
find_library(RDMACM_LIB rdmacm)
find_library(IBVERBS_LIB ibverbs)
find_library(NL3_LIB nl-3)
find_library(NL_GENL3_LIB nl-genl-3)
find_library(UUID_LIB uuid)
find_library(NUMA_LIB numa)
find_library(RT_LIB rt)
if (NOT RT_LIB)
message(FATAL_ERROR "Missing librt, please install it and retry")
endif()
set(FABRIC_MAKEFILE "${CMAKE_SOURCE_DIR}/thirdparty/libfabric/Makefile")

if(IBVERBS_LIB AND RDMACM_LIB AND NL3_LIB AND NL_GENL3_LIB AND UUID_LIB AND NUMA_LIB AND RT_LIB)
set(RDMA_LIBS ${RDMACM_LIB} ${IBVERBS_LIB} ${NL3_LIB} ${NL_GENL3_LIB} ${UUID_LIB} ${NUMA_LIB} ${RT_LIB})
set(FABRIC_MAKEFILE "${CMAKE_SOURCE_DIR}/thirdparty/libfabric/Makefile")
if(IBVERBS_LIB AND RDMACM_LIB)
set(RDMA_LIBS ${RDMACM_LIB} ${IBVERBS_LIB} ${RT_LIB})

add_custom_command(
OUTPUT ${FABRIC_MAKEFILE}
COMMAND ./autogen.sh > /dev/null
COMMAND ./configure --disable-efa > /dev/null
COMMAND ./configure --disable-usnic
--disable-psm3
--disable-opx
--disable-dmabuf_peer_mem
--disable-hook_hmem
--disable-hook_debug
--disable-trace
--disable-rxm
--disable-psm2
--disable-xpmem
--disable-shm
--disable-rxd
--disable-perf
--disable-efa
--disable-mrail
--enable-verbs > /dev/null
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/thirdparty/libfabric
)
add_custom_target(
fabric_configure
DEPENDS ${FABRIC_MAKEFILE}
)
add_custom_target(
fabric ALL
COMMAND make CFLAGS+="-fPIC" -j$(nproc) > /dev/null
COMMAND ${CMAKE_COMMAND} -E copy_if_different
${CMAKE_SOURCE_DIR}/thirdparty/libfabric/src/.libs/libfabric.a ${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}/libfabric.a
DEPENDS fabric_configure
else()
set(RDMA_LIBS ${RT_LIB})
add_custom_command(
OUTPUT ${FABRIC_MAKEFILE}
COMMAND ./autogen.sh > /dev/null
COMMAND ./configure --disable-usnic
--disable-psm3
--disable-opx
--disable-dmabuf_peer_mem
--disable-hook_hmem
--disable-hook_debug
--disable-trace
--disable-rxm
--disable-psm2
--disable-xpmem
--disable-shm
--disable-rxd
--disable-perf
--disable-efa
--disable-mrail
--disable-verbs > /dev/null
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/thirdparty/libfabric
)
endif()
add_custom_target(
fabric_configure
DEPENDS ${FABRIC_MAKEFILE}
)
add_custom_target(
fabric ALL
COMMAND make CFLAGS+="-fPIC" -j$(nproc) > /dev/null
COMMAND ${CMAKE_COMMAND} -E copy_if_different
${CMAKE_SOURCE_DIR}/thirdparty/libfabric/src/.libs/libfabric.a ${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}/libfabric.a
DEPENDS fabric_configure
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/thirdparty/libfabric
)

set(LIBFABRIC "${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}/libfabric.a")
set(LIBFABRIC_VERSION_SCRIPT "${CMAKE_SOURCE_DIR}/src/common/rdma/libfabric.map")
install(DIRECTORY "${PROJECT_SOURCE_DIR}/thirdparty/libfabric/include"
DESTINATION ${CMAKE_INSTALL_PREFIX}/include/vineyard/contrib/libfabric
PATTERN "*.h"
)
include_directories(BEFORE SYSTEM
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/thirdparty/libfabric/include>
$<INSTALL_INTERFACE:include/vineyard/contrib>
)
list(APPEND VINEYARD_INSTALL_LIBS ${LIBFABRIC})
set(LIBFABRIC "${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}/libfabric.a")
set(LIBFABRIC_VERSION_SCRIPT "${CMAKE_SOURCE_DIR}/src/common/rdma/libfabric.map")
install(DIRECTORY "${PROJECT_SOURCE_DIR}/thirdparty/libfabric/include"
DESTINATION ${CMAKE_INSTALL_PREFIX}/include/vineyard/contrib/libfabric
PATTERN "*.h"
)
include_directories(BEFORE SYSTEM
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/thirdparty/libfabric/include>
$<INSTALL_INTERFACE:include/vineyard/contrib>
)
list(APPEND VINEYARD_INSTALL_LIBS ${LIBFABRIC})

set_property(DIRECTORY APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES
${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}/libfabric.a)
else()
message("${RDMACM_LIB} ${IBVERBS_LIB} ${NL3_LIB} ${NL_GENL3_LIB} ${UUID_LIB} ${NUMA_LIB} ${RT_LIB}")
message(FATAL_ERROR "Missing rdma dependencies, please install them and retry: rdmacm, ibverbs, libnl-3, libnl-genl-3, libuuid, libnuma, librt")
endif()
set_property(DIRECTORY APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES
${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}/libfabric.a)
endif()

# boost is only required by some components
Expand Down

0 comments on commit a561b47

Please sign in to comment.