Skip to content

Commit fbfa0b6

Browse files
committed
[rdma-core] Add new port
1 parent d68a18f commit fbfa0b6

12 files changed

Lines changed: 294 additions & 0 deletions
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
diff --git a/CMakeLists.txt b/CMakeLists.txt
2+
index 718b7d2dd..533860ed6 100644
3+
--- a/CMakeLists.txt
4+
+++ b/CMakeLists.txt
5+
@@ -718,7 +718,6 @@ configure_file("${BUILDLIB}/config.h.in" "${BUILD_INCLUDE}/config.h" ESCAPE_QUOT
6+
# Sub-directories
7+
add_subdirectory(ccan)
8+
add_subdirectory(util)
9+
-add_subdirectory(util/tests)
10+
add_subdirectory(Documentation)
11+
add_subdirectory(kernel-boot)
12+
add_subdirectory(kernel-headers)
13+
@@ -768,7 +767,6 @@ add_subdirectory(infiniband-diags/man)
14+
15+
if (CYTHON_EXECUTABLE)
16+
add_subdirectory(pyverbs)
17+
- add_subdirectory(tests)
18+
endif()
19+
20+
# Binaries
21+
@@ -779,7 +777,6 @@ endif()
22+
if (NOT NL_KIND EQUAL 0)
23+
add_subdirectory(iwpmd)
24+
endif()
25+
-add_subdirectory(libibumad/tests)
26+
add_subdirectory(libibverbs/examples)
27+
add_subdirectory(librdmacm/examples)
28+
if (UDEV_FOUND)
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
diff --git a/CMakeLists.txt b/CMakeLists.txt
2+
index 533860ed6..fa1a57b4f 100644
3+
--- a/CMakeLists.txt
4+
+++ b/CMakeLists.txt
5+
@@ -777,8 +777,6 @@ endif()
6+
if (NOT NL_KIND EQUAL 0)
7+
add_subdirectory(iwpmd)
8+
endif()
9+
-add_subdirectory(libibverbs/examples)
10+
-add_subdirectory(librdmacm/examples)
11+
if (UDEV_FOUND)
12+
add_subdirectory(rdma-ndd)
13+
endif()
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
diff --git a/CMakeLists.txt b/CMakeLists.txt
2+
index fa1a57b4f..f0c411792 100644
3+
--- a/CMakeLists.txt
4+
+++ b/CMakeLists.txt
5+
@@ -718,7 +718,6 @@ configure_file("${BUILDLIB}/config.h.in" "${BUILD_INCLUDE}/config.h" ESCAPE_QUOT
6+
# Sub-directories
7+
add_subdirectory(ccan)
8+
add_subdirectory(util)
9+
-add_subdirectory(Documentation)
10+
add_subdirectory(kernel-boot)
11+
add_subdirectory(kernel-headers)
12+
# Libraries
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
diff --git a/CMakeLists.txt b/CMakeLists.txt
2+
index f0c411792..ffa784de1 100644
3+
--- a/CMakeLists.txt
4+
+++ b/CMakeLists.txt
5+
@@ -760,9 +760,6 @@ add_subdirectory(providers/siw)
6+
add_subdirectory(libibmad)
7+
add_subdirectory(libibnetdisc)
8+
add_subdirectory(libibnetdisc/man)
9+
-add_subdirectory(infiniband-diags)
10+
-add_subdirectory(infiniband-diags/scripts)
11+
-add_subdirectory(infiniband-diags/man)
12+
13+
if (CYTHON_EXECUTABLE)
14+
add_subdirectory(pyverbs)
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
diff --git a/CMakeLists.txt b/CMakeLists.txt
2+
index ffa784de1..45d736147 100644
3+
--- a/CMakeLists.txt
4+
+++ b/CMakeLists.txt
5+
@@ -776,7 +776,6 @@ endif()
6+
if (UDEV_FOUND)
7+
add_subdirectory(rdma-ndd)
8+
endif()
9+
-add_subdirectory(srp_daemon)
10+
11+
ibverbs_finalize()
12+
rdma_finalize_libs()
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
diff --git a/CMakeLists.txt b/CMakeLists.txt
2+
index 45d736147..cd713f897 100644
3+
--- a/CMakeLists.txt
4+
+++ b/CMakeLists.txt
5+
@@ -718,7 +718,6 @@ configure_file("${BUILDLIB}/config.h.in" "${BUILD_INCLUDE}/config.h" ESCAPE_QUOT
6+
# Sub-directories
7+
add_subdirectory(ccan)
8+
add_subdirectory(util)
9+
-add_subdirectory(kernel-boot)
10+
add_subdirectory(kernel-headers)
11+
# Libraries
12+
add_subdirectory(libibumad)
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
diff --git a/librdmacm/CMakeLists.txt b/librdmacm/CMakeLists.txt
2+
index ea1d1550f..400c18f49 100644
3+
--- a/librdmacm/CMakeLists.txt
4+
+++ b/librdmacm/CMakeLists.txt
5+
@@ -25,28 +25,6 @@ target_link_libraries(rdmacm LINK_PRIVATE
6+
${RT_LIBRARIES}
7+
)
8+
9+
-# The preload library is a bit special, it needs to be open coded
10+
-# Since it is a LD_PRELOAD it has no soname, and is installed in sub dir
11+
-add_library(rspreload MODULE
12+
- preload.c
13+
- indexer.c
14+
- )
15+
-# Even though this is a module we still want to use Wl,--no-undefined
16+
-set_target_properties(rspreload PROPERTIES LINK_FLAGS ${CMAKE_SHARED_LINKER_FLAGS})
17+
-set_target_properties(rspreload PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${BUILD_LIB}")
18+
-rdma_set_library_map(rspreload librspreload.map)
19+
-target_link_libraries(rspreload LINK_PRIVATE
20+
- rdmacm
21+
- ${CMAKE_THREAD_LIBS_INIT}
22+
- ${CMAKE_DL_LIBS}
23+
-)
24+
-install(TARGETS rspreload DESTINATION "${CMAKE_INSTALL_LIBDIR}/rsocket/")
25+
-
26+
-# These are for compat with old packaging, these name should not be used.
27+
-# FIXME: Maybe we can get rid of them?
28+
-rdma_install_symlink("librspreload.so" "${CMAKE_INSTALL_LIBDIR}/rsocket/librspreload.so.1")
29+
-rdma_install_symlink("librspreload.so" "${CMAKE_INSTALL_LIBDIR}/rsocket/librspreload.so.1.0.0")
30+
-
31+
if (ENABLE_STATIC)
32+
if (NOT NL_KIND EQUAL 0)
33+
set(REQUIRES "libnl-3.0, libnl-route-3.0, ")
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
diff --git a/buildlib/rdma_functions.cmake b/buildlib/rdma_functions.cmake
2+
index ef77d95d0..84e650497 100644
3+
--- a/buildlib/rdma_functions.cmake
4+
+++ b/buildlib/rdma_functions.cmake
5+
@@ -117,7 +117,10 @@ function(rdma_library DEST VERSION_SCRIPT SOVERSION VERSION)
6+
SOVERSION ${SOVERSION}
7+
VERSION ${VERSION}
8+
LIBRARY_OUTPUT_DIRECTORY "${BUILD_LIB}")
9+
- install(TARGETS ${DEST} DESTINATION "${CMAKE_INSTALL_LIBDIR}")
10+
+
11+
+ if(NOT ENABLE_STATIC)
12+
+ install(TARGETS ${DEST} DESTINATION "${CMAKE_INSTALL_LIBDIR}")
13+
+ endif()
14+
endfunction()
15+
16+
# Create a special provider with exported symbols in it The shared provider
17+
@@ -153,20 +156,23 @@ function(rdma_shared_provider DEST VERSION_SCRIPT SOVERSION VERSION)
18+
SOVERSION ${SOVERSION}
19+
VERSION ${VERSION}
20+
LIBRARY_OUTPUT_DIRECTORY "${BUILD_LIB}")
21+
- install(TARGETS ${DEST} DESTINATION "${CMAKE_INSTALL_LIBDIR}")
22+
-
23+
- # Compute a relative symlink from VERBS_PROVIDER_DIR to LIBDIR
24+
- execute_process(COMMAND ${PYTHON_EXECUTABLE} ${PROJECT_SOURCE_DIR}/buildlib/relpath
25+
- "${CMAKE_INSTALL_FULL_LIBDIR}/lib${DEST}.so.${VERSION}"
26+
- "${VERBS_PROVIDER_DIR}"
27+
- OUTPUT_VARIABLE DEST_LINK_PATH OUTPUT_STRIP_TRAILING_WHITESPACE
28+
- RESULT_VARIABLE retcode)
29+
- if(NOT "${retcode}" STREQUAL "0")
30+
- message(FATAL_ERROR "Unable to run buildlib/relpath, do you have python?")
31+
- endif()
32+
33+
- rdma_install_symlink("${DEST_LINK_PATH}" "${VERBS_PROVIDER_DIR}/lib${DEST}${IBVERBS_PROVIDER_SUFFIX}")
34+
- rdma_create_symlink("lib${DEST}.so.${VERSION}" "${BUILD_LIB}/lib${DEST}${IBVERBS_PROVIDER_SUFFIX}")
35+
+ if(NOT ENABLE_STATIC)
36+
+ install(TARGETS ${DEST} DESTINATION "${CMAKE_INSTALL_LIBDIR}")
37+
+
38+
+ # Compute a relative symlink from VERBS_PROVIDER_DIR to LIBDIR
39+
+ execute_process(COMMAND ${PYTHON_EXECUTABLE} ${PROJECT_SOURCE_DIR}/buildlib/relpath
40+
+ "${CMAKE_INSTALL_FULL_LIBDIR}/lib${DEST}.so.${VERSION}"
41+
+ "${VERBS_PROVIDER_DIR}"
42+
+ OUTPUT_VARIABLE DEST_LINK_PATH OUTPUT_STRIP_TRAILING_WHITESPACE
43+
+ RESULT_VARIABLE retcode)
44+
+ if(NOT "${retcode}" STREQUAL "0")
45+
+ message(FATAL_ERROR "Unable to run buildlib/relpath, do you have python?")
46+
+ endif()
47+
+
48+
+ rdma_install_symlink("${DEST_LINK_PATH}" "${VERBS_PROVIDER_DIR}/lib${DEST}${IBVERBS_PROVIDER_SUFFIX}")
49+
+ rdma_create_symlink("lib${DEST}.so.${VERSION}" "${BUILD_LIB}/lib${DEST}${IBVERBS_PROVIDER_SUFFIX}")
50+
+ endif()
51+
endfunction()
52+
53+
# Create a provider shared library for libibverbs
54+
@@ -201,15 +207,17 @@ function(rdma_provider DEST)
55+
# Provider Plugins do not use SONAME versioning, there is no reason to
56+
# create the usual symlinks.
57+
58+
- if (VERBS_PROVIDER_DIR)
59+
- install(TARGETS ${DEST} DESTINATION "${VERBS_PROVIDER_DIR}")
60+
- else()
61+
- install(TARGETS ${DEST} DESTINATION "${CMAKE_INSTALL_LIBDIR}")
62+
+ if(NOT ENABLE_STATIC)
63+
+ if (VERBS_PROVIDER_DIR)
64+
+ install(TARGETS ${DEST} DESTINATION "${VERBS_PROVIDER_DIR}")
65+
+ else()
66+
+ install(TARGETS ${DEST} DESTINATION "${CMAKE_INSTALL_LIBDIR}")
67+
68+
- # FIXME: This symlink is provided for compat with the old build, but it
69+
- # never should have existed in the first place, nothing should use this
70+
- # name, we can probably remove it.
71+
- rdma_install_symlink("lib${DEST}${IBVERBS_PROVIDER_SUFFIX}" "${CMAKE_INSTALL_LIBDIR}/lib${DEST}.so")
72+
+ # FIXME: This symlink is provided for compat with the old build, but it
73+
+ # never should have existed in the first place, nothing should use this
74+
+ # name, we can probably remove it.
75+
+ rdma_install_symlink("lib${DEST}${IBVERBS_PROVIDER_SUFFIX}" "${CMAKE_INSTALL_LIBDIR}/lib${DEST}.so")
76+
+ endif()
77+
endif()
78+
endfunction()
79+

ports/rdma-core/portfile.cmake

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
vcpkg_from_github(
2+
OUT_SOURCE_PATH SOURCE_PATH
3+
REPO linux-rdma/rdma-core
4+
REF "v${VERSION}"
5+
SHA512 0251340e2b3b90562f903bcc26d489516c6efba3179423932c6b9c2e8dd2c6ef934fa476d9963db26544ddb5232e0da94574774e578ea6c0268c57961a0aeb47
6+
HEAD_REF master
7+
PATCHES
8+
0001-disable-tests.patch
9+
0002-disable-examples.patch
10+
0003-disable-documentation.patch
11+
0004-disable-infiniband-diags.patch
12+
0005-disable-srp-daemon.patch
13+
0006-disable-kernel-boot.patch
14+
0007-disable-librspreload.patch
15+
0008-enable-static-libs-only.patch
16+
)
17+
18+
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" ENABLE_STATIC)
19+
20+
vcpkg_cmake_configure(
21+
SOURCE_PATH "${SOURCE_PATH}"
22+
OPTIONS
23+
-DENABLE_RESOLVE_NEIGH=OFF
24+
-DNO_MAN_PAGES=ON
25+
-DNO_PYVERBS=ON
26+
-DENABLE_STATIC="${ENABLE_STATIC}"
27+
-DVCPKG_LOCK_FIND_PACKAGE_PythonLibs=ON
28+
-DVCPKG_LOCK_FIND_PACKAGE_Systemd=OFF
29+
-DVCPKG_LOCK_FIND_PACKAGE_UDev=OFF
30+
-DVCPKG_LOCK_FIND_PACKAGE_cython=OFF
31+
-DVCPKG_LOCK_FIND_PACKAGE_pandoc=OFF
32+
-DVCPKG_LOCK_FIND_PACKAGE_rst2man=OFF
33+
MAYBE_UNUSED_VARIABLES
34+
VCPKG_LOCK_FIND_PACKAGE_PythonLibs
35+
VCPKG_LOCK_FIND_PACKAGE_cython
36+
VCPKG_LOCK_FIND_PACKAGE_pandoc
37+
VCPKG_LOCK_FIND_PACKAGE_rst2man
38+
)
39+
40+
vcpkg_cmake_install()
41+
42+
vcpkg_fixup_pkgconfig()
43+
44+
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/etc")
45+
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
46+
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/libexec")
47+
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
48+
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/etc")
49+
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/libexec")
50+
51+
vcpkg_install_copyright(FILE_LIST
52+
"${SOURCE_PATH}/COPYING.md"
53+
"${SOURCE_PATH}/COPYING.BSD_MIT"
54+
"${SOURCE_PATH}/COPYING.GPL2"
55+
)

ports/rdma-core/vcpkg.json

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"name": "rdma-core",
3+
"version": "62.0",
4+
"description": "The userspace components for the Linux Kernel's drivers/infiniband subsystem.",
5+
"homepage": "https://github.com/linux-rdma/rdma-core",
6+
"license": "GPL-2.0-only OR Linux-OpenIB",
7+
"supports": "linux",
8+
"dependencies": [
9+
{
10+
"name": "python3",
11+
"host": true,
12+
"default-features": false
13+
},
14+
{
15+
"name": "vcpkg-cmake",
16+
"host": true
17+
},
18+
{
19+
"name": "vcpkg-cmake-config",
20+
"host": true
21+
}
22+
]
23+
}

0 commit comments

Comments
 (0)