diff --git a/README.md b/README.md index 305c1e0d..bbe4af4a 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/receiver/host/CMakeLists.txt b/receiver/host/CMakeLists.txt index 4fe0f250..802186f1 100644 --- a/receiver/host/CMakeLists.txt +++ b/receiver/host/CMakeLists.txt @@ -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}) diff --git a/receiver/host/IBReceiver.cpp b/receiver/host/IBReceiver.cpp index c1822818..a1cbc431 100644 --- a/receiver/host/IBReceiver.cpp +++ b/receiver/host/IBReceiver.cpp @@ -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 @@ -161,3 +162,5 @@ IBReceiver::~IBReceiver() { iter.get(); } } + +#endif //JFJOCH_USE_IBVERBS \ No newline at end of file diff --git a/receiver/host/IBReceiver.h b/receiver/host/IBReceiver.h index e887fc48..30cf67ef 100644 --- a/receiver/host/IBReceiver.h +++ b/receiver/host/IBReceiver.h @@ -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 \ No newline at end of file diff --git a/receiver/host/IBWrappers.cpp b/receiver/host/IBWrappers.cpp index bdaf23f9..662ece87 100644 --- a/receiver/host/IBWrappers.cpp +++ b/receiver/host/IBWrappers.cpp @@ -1,6 +1,8 @@ // Copyright (2019-2022) Paul Scherrer Institute // SPDX-License-Identifier: GPL-3.0-or-later +#ifdef JFJOCH_USE_IBVERBS + #include #include @@ -316,3 +318,5 @@ uint32_t IBMemoryRegion::GetRemoteKey() { IBMemoryRegion::~IBMemoryRegion() { ibv_dereg_mr(buffer_mr); } + +#endif //JFJOCH_USE_IBVERBS diff --git a/receiver/host/IBWrappers.h b/receiver/host/IBWrappers.h index 56f6b6ed..e7f2987b 100644 --- a/receiver/host/IBWrappers.h +++ b/receiver/host/IBWrappers.h @@ -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 \ No newline at end of file diff --git a/receiver/host/RawEthDevice.cpp b/receiver/host/RawEthDevice.cpp index e01c1eb5..c3ea3663 100644 --- a/receiver/host/RawEthDevice.cpp +++ b/receiver/host/RawEthDevice.cpp @@ -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; -} \ No newline at end of file +} + +#endif //JFJOCH_USE_IBVERBS \ No newline at end of file diff --git a/receiver/host/RawEthDevice.h b/receiver/host/RawEthDevice.h index d9b4e83b..32487afb 100644 --- a/receiver/host/RawEthDevice.h +++ b/receiver/host/RawEthDevice.h @@ -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 \ No newline at end of file