diff --git a/CMakeLists.txt b/CMakeLists.txt index 99d3f8589..46eeae05b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -75,6 +75,8 @@ find_package(OpenSSL 1.0.0 REQUIRED) find_package(CURL 7.29 REQUIRED) find_package(Mosquitto) find_package(Opal) +find_package(IBverbs) +find_package(RDMACM) # Check programs find_program(PROTOBUFC_COMPILER NAMES protoc-c) diff --git a/include/villas/config.h.in b/include/villas/config.h.in index d62812107..282818f4d 100644 --- a/include/villas/config.h.in +++ b/include/villas/config.h.in @@ -81,6 +81,7 @@ extern "C"{ #cmakedefine PROTOBUF_FOUND #cmakedefine LIBNL3_ROUTE_FOUND #cmakedefine LIBCONFIG_FOUND +#cmakedefine IBVERBS_FOUND #ifdef __cplusplus } diff --git a/include/villas/memory.h b/include/villas/memory.h index d1829f71a..e3a5401a8 100644 --- a/include/villas/memory.h +++ b/include/villas/memory.h @@ -27,6 +27,7 @@ #include #include +#include #include #ifdef __cplusplus @@ -56,7 +57,7 @@ struct memory_allocation { size_t length; union { -#ifdef WITH_NODE_INFINIBAND +#ifdef IBVERBS_FOUND struct { struct ibv_mr *mr; } ib; diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt index a05a596ca..4245b3189 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt @@ -37,6 +37,9 @@ set(LIBRARIES set(LIB_SRC kernel/kernel.c kernel/rt.c + memory/heap.c + memory/hugepage.c + memory/managed.c sample.c path.c node.c @@ -69,6 +72,10 @@ set(LIB_SRC signal.c ) +if(IBVERBS_FOUND AND RDMACM_FOUND) + list(APPEND LIB_SRC memory/ib.c) +endif() + add_subdirectory(nodes) list(APPEND WHOLE_ARCHIVES nodes) diff --git a/lib/nodes/CMakeLists.txt b/lib/nodes/CMakeLists.txt index 21c6fb677..c12a96dab 100644 --- a/lib/nodes/CMakeLists.txt +++ b/lib/nodes/CMakeLists.txt @@ -126,6 +126,13 @@ if(COMEDILIB_FOUND) list(APPEND LIBRARIES PkgConfig::COMEDILIB) endif() +# Enable infiniband support +if(IBVERBS_FOUND AND RDMACM_FOUND) + list(APPEND NODE_SRC infiniband.c) + list(APPEND INCLUDE_DIRS ${IBVERBS_INCLUDE_DIRS} ${RDMACM_INCLUDE_DIRS}) + list(APPEND LIBRARIES ${IBVERBS_LIBRARIES} ${RDMACM_LIBRARIES}) +endif() + add_library(nodes STATIC ${NODE_SRC}) target_include_directories(nodes PUBLIC ${INCLUDE_DIRS}) target_link_libraries(nodes LINK_PRIVATE ${LIBRARIES}) diff --git a/packaging/docker/Dockerfile.dev b/packaging/docker/Dockerfile.dev index b2a1d9311..8f3e7811a 100644 --- a/packaging/docker/Dockerfile.dev +++ b/packaging/docker/Dockerfile.dev @@ -81,28 +81,9 @@ RUN dnf -y install \ libiec61850-devel \ librabbitmq-devel \ mosquitto-devel \ - comedilib-devel comedilib - -# IB Verbs Dependencies -RUN dnf -y install \ - libibverbs-utils \ - libibverbs-devel \ - libibverbs-devel-static \ - libmlx4 \ - libmlx5 \ - ibutils \ - libibcm \ - libibcommon \ - libibmad \ - libibumad - -# RDMA CM Dependencies -RUN dnf -y install \ - librdmacm-utils \ - librdmacm-devel \ - librdmacm \ - libibumad-devel \ - perftest + comedilib-devel comedilib \ + libibverbs-devel \ + librdmacm-devel # Build & Install Criterion RUN cd /tmp && \