Files
openairinterface5g/radio/fhi_72/CMakeLists.txt
T
Robert SchmidtandSagar Arora 68c28a4828 Modify default xran DPDK socket memory/limit to 0
The default values set by xran for DPDK socket memory/limit is 8192. It
is changed when the variable for the memory size, given down to xran, is
non-zero (cf also previous patch). Since the last patch, if nothing is
given in OAI configuration, OAI will pass down a size of 8192. However,
a configuration value of 0 is a valid choice (it is a pre-allocation,
DPDK will allocate dynamically), so modify the default in xran to be 0
so that all sizes, including 0, can be given to DPDK.

Note that the currently used implementation of xran will always try to
allocate this memory on NUMA node 0. If you want to use another one,
this field has to be set to 0 (no pre-allocation), and DPDK will
allocate it dynamically.

Co-authored-by: Sagar Arora <sagar.arora@openairinterface.org>
2024-09-21 07:12:07 +02:00

42 lines
1.7 KiB
CMake

# we need at least gcc-11 to build xran, so let's enforce it here
# (because xran might not check it, and we have control here)
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 11.0
OR CMAKE_C_COMPILER_VERSION VERSION_LESS 11.0)
message(FATAL_ERROR "you need to have at least gcc/g++-11 to use 7.2 FHI through xran")
endif()
# use env var PKG_CONFIG_PATH to override paths to libdpdk.pc
pkg_check_modules(dpdk REQUIRED libdpdk)
pkg_check_modules(numa REQUIRED numa)
find_package(xran 5.1.4 EXACT REQUIRED) # E release -> 5
# Ignore xran-specific warning: we don't care/can't change the following warning, so suppress
# alignment 1 of 'struct XYZ' is less than 2
add_compile_options(-Wno-packed-not-aligned)
add_library(oran_fhlib_5g MODULE
oran_isolate.c
oaioran.c
oran-config.c
oran-init.c
)
set_target_properties(oran_fhlib_5g PROPERTIES COMPILE_FLAGS "-fvisibility=hidden -march=native")
target_link_libraries(oran_fhlib_5g PRIVATE xran::xran)
target_link_libraries(oran_fhlib_5g PRIVATE ${dpdk_LINK_LIBRARIES})
target_include_directories(oran_fhlib_5g PRIVATE ${dpdk_INCLUDE_DIRS})
target_link_libraries(oran_fhlib_5g PRIVATE pthread dl rt m numa)
target_link_libraries(oran_fhlib_5g PRIVATE ${T_LIB})
# TODO: can be removed?
target_include_directories(oran_fhlib_5g PRIVATE ${xran_INCLUDE_DIRS}/../src/)
set_target_properties(oran_fhlib_5g PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
add_custom_command(TARGET oran_fhlib_5g POST_BUILD
COMMAND ${CMAKE_COMMAND} -E create_symlink liboran_fhlib_5g.so liboai_transpro.so
WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
message(STATUS "Temporary added -DOAI_FHI72")
target_compile_definitions(nr-softmodem PUBLIC OAI_FHI72)