From 42a10e4700973fa95f82c7a1b21700ac43195e28 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Wed, 11 Dec 2024 16:15:05 +0100 Subject: [PATCH 1/2] Correctly initialize u64 mask 1 needs to be marked as long long, to allow shifting numbers >= 32. Otherwise, 1 is an int, limited to 32 bits. --- radio/fhi_72/oran-config.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/radio/fhi_72/oran-config.c b/radio/fhi_72/oran-config.c index f165044429..ea6d158f86 100644 --- a/radio/fhi_72/oran-config.c +++ b/radio/fhi_72/oran-config.c @@ -452,7 +452,7 @@ static uint64_t get_u64_mask(const paramdef_t *pd) for (int i = 0; i < pd->numelt; ++i) { int num = pd->iptr[i]; AssertFatal(num >= 0 && num < 64, "cannot put element of %d in 64-bit mask\n", num); - mask |= 1 << num; + mask |= 1LL << num; } return mask; } From f8d7e1fd1b7c5aaffdcf25c810d8d66fcea674f5 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Wed, 11 Dec 2024 17:05:02 +0100 Subject: [PATCH 2/2] Findxran: exclude default paths, use hints Some users copy libxran.so to a system directory (e.g., /usr/local/lib). At the same time, we require xran_LOCATION to be set to find the build directory. Use HINTS to prefer the location passed through xran_LOCATION. Also, use NO_DEFAULT_PATH to outright disallow global scope, to prevent "accidentally" finding libxran.so in global scope (this is for multi-user systems that are used in development, and where people have different version of libxran for testing purposes). To still use packages in e.g., /usr/local/, it would be possible to set xran_LOCATION to this directory. (there is a problem that the version information will likely not be read correctly, so this might not be enough) --- cmake_targets/tools/MODULES/Findxran.cmake | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/cmake_targets/tools/MODULES/Findxran.cmake b/cmake_targets/tools/MODULES/Findxran.cmake index 39f0ffeb75..290a782350 100644 --- a/cmake_targets/tools/MODULES/Findxran.cmake +++ b/cmake_targets/tools/MODULES/Findxran.cmake @@ -83,12 +83,15 @@ find_path(xran_INCLUDE_DIR xran_pkt.h xran_pkt_up.h xran_sync_api.h - PATHS ${xran_LOCATION} - PATH_SUFFIXES api + HINTS ${xran_LOCATION} + PATH_SUFFIXES api include + NO_DEFAULT_PATH ) find_library(xran_LIBRARY NAMES xran - PATHS ${xran_LOCATION}/build + HINTS ${xran_LOCATION} + PATH_SUFFIXES build api + NO_DEFAULT_PATH ) if (NOT xran_LIBRARY) message(FATAL_ERROR "could not detect xran build artifacts at ${xran_LOCATION}/build")