IBVerbs is optional

This commit is contained in:
2023-04-07 13:28:09 +02:00
parent bffaa17bcd
commit 940764ff2f
8 changed files with 26 additions and 5 deletions

View File

@@ -33,7 +33,7 @@ Instructions see [here](receiver/README.md)
5. Google Remote Procedure Call (gRPC) - see notes below
6. CUDA compiler version 11 or newer (spot finding, indexing, and radial integration)
7. TIFF library with C++ bindings
8. Mellanox OFED - Infinibands Verbs (ibverbs)
8. Mellanox OFED - Infinibands Verbs (optional)
9. NUMA library (optional)
Additional dependencies: SLS Detector Package, tinycbor (Intel) and Zstandard (Facebook) are provided as GIT submodules.

View File

@@ -1,5 +1,3 @@
FIND_LIBRARY(IBVERBS REQUIRED NAMES ibverbs DOC "Infiniband verbs")
ADD_LIBRARY(JungfraujochHost STATIC
AcquisitionDevice.cpp AcquisitionDevice.h
AcquisitionOnlineCounters.cpp AcquisitionOnlineCounters.h
@@ -17,6 +15,13 @@ TARGET_LINK_LIBRARIES(JungfraujochHost CommonFunctions HLSSimulation ${IBVERBS}
TARGET_INCLUDE_DIRECTORIES(JungfraujochHost PUBLIC ../../include)
FIND_LIBRARY(IBVERBS NAMES ibverbs DOC "Infiniband verbs")
IF(IBVERBS)
TARGET_COMPILE_DEFINITIONS(JungfraujochHost PRIVATE -DJFJOCH_USE_IBVERBS)
TARGET_LINK_LIBRARIES(JungfraujochHost ${IBVERBS})
MESSAGE(STATUS "JFJochReceiver compiled with IBVerbs support")
ENDIF()
IF(HAS_NUMA_H AND NUMA_LIBRARY)
TARGET_COMPILE_DEFINITIONS(JungfraujochHost PRIVATE -DJFJOCH_USE_NUMA_H)
TARGET_LINK_LIBRARIES(JungfraujochHost ${NUMA_LIBRARY})

View File

@@ -1,6 +1,7 @@
// Copyright (2019-2022) Paul Scherrer Institute
// SPDX-License-Identifier: GPL-3.0-or-later
#ifdef JFJOCH_USE_IBVERBS
#include "IBReceiver.h"
#include <sys/mman.h>
@@ -161,3 +162,5 @@ IBReceiver::~IBReceiver() {
iter.get();
}
}
#endif //JFJOCH_USE_IBVERBS

View File

@@ -1,6 +1,8 @@
// Copyright (2019-2022) Paul Scherrer Institute
// SPDX-License-Identifier: GPL-3.0-or-later
#ifdef JFJOCH_USE_IBVERBS
#ifndef JUNGFRAUJOCH_IBRECEIVER_H
#define JUNGFRAUJOCH_IBRECEIVER_H
@@ -41,3 +43,4 @@ public:
#endif //JUNGFRAUJOCH_IBRECEIVER_H
#endif //JFJOCH_USE_IBVERBS

View File

@@ -1,6 +1,8 @@
// Copyright (2019-2022) Paul Scherrer Institute
// SPDX-License-Identifier: GPL-3.0-or-later
#ifdef JFJOCH_USE_IBVERBS
#include <thread>
#include <chrono>
@@ -316,3 +318,5 @@ uint32_t IBMemoryRegion::GetRemoteKey() {
IBMemoryRegion::~IBMemoryRegion() {
ibv_dereg_mr(buffer_mr);
}
#endif //JFJOCH_USE_IBVERBS

View File

@@ -1,6 +1,7 @@
// Copyright (2019-2022) Paul Scherrer Institute
// SPDX-License-Identifier: GPL-3.0-or-later
#ifdef JFJOCH_USE_IBVERBS
#ifndef JUNGFRAUJOCH_IBWRAPPERS_H
#define JUNGFRAUJOCH_IBWRAPPERS_H
@@ -65,5 +66,5 @@ public:
~IBQueuePair();
};
#endif //JUNGFRAUJOCH_IBWRAPPERS_H
#endif // JFJOCH_USE_IBVERBS

View File

@@ -1,6 +1,7 @@
// Copyright (2019-2022) Paul Scherrer Institute
// SPDX-License-Identifier: GPL-3.0-or-later
#ifdef JFJOCH_USE_IBVERBS
#include "RawEthDevice.h"
RawEthDevice::RawEthDevice(const std::string &device_name, uint16_t data_stream, size_t in_frame_buffer_size_modules,
@@ -83,4 +84,6 @@ void RawEthDevice::SetMACAddress(uint64_t mac_addr_network_order) {
uint64_t RawEthDevice::HW_GetMACAddress() const {
return mac_addr;
}
}
#endif //JFJOCH_USE_IBVERBS

View File

@@ -1,6 +1,7 @@
// Copyright (2019-2022) Paul Scherrer Institute
// SPDX-License-Identifier: GPL-3.0-or-later
#ifdef JFJOCH_USE_IBVERBS
#ifndef JUNGFRAUJOCH_RAWETHDEVICE_H
#define JUNGFRAUJOCH_RAWETHDEVICE_H
@@ -39,3 +40,4 @@ public:
#endif //JUNGFRAUJOCH_RAWETHDEVICE_H
#endif //JFJOCH_USE_IBVERBS