Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,16 @@ find_package(IBVerbs)
find_package(NUMA REQUIRED)
find_package(Threads REQUIRED)

set(CMAKE_COLOR_DIAGNOSTICS ON)
function(msg_red text)
string(ASCII 27 ESC)
message("${ESC}[31m${text}${ESC}[0m")
endfunction()

if(NOT IBVERBS_FOUND)
msg_red("libibverbs not found. Install libibverbs-dev or rdma-core-devel.")
endif()

include(FetchContent)
FetchContent_Declare(json URL https://github.com/nlohmann/json/releases/download/v3.11.3/json.tar.xz)
FetchContent_MakeAvailable(json)
Expand Down
13 changes: 12 additions & 1 deletion src/include/ibverbs_wrapper.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,18 @@ struct IBVerbs {
// Static method to initialize the library
static void initialize() {
initialized = true;
handle = dlopen("libibverbs.so", RTLD_NOW);

// Try different versions of libibverbs
const char* lib_possible_names[] = {
"libibverbs.so",
"libibverbs.so.1",
};
for (int i = 0; lib_possible_names[i] != nullptr; i++) {
handle = dlopen(lib_possible_names[i], RTLD_NOW);
if (handle) {
break;
}
}
if (!handle) {
throw mscclpp::IbError("Failed to load libibverbs: " + std::string(dlerror()), errno);
}
Expand Down
Loading