Commit 2ae19083 authored by Robert Schmidt's avatar Robert Schmidt

Put T source library in subdirectory, don't build multiple times

- UTIL: has LOG which brings as (public) dependency T, so link it publicly
- Move T to top to ensure all targets can have it
parent c3f84884
...@@ -578,6 +578,15 @@ include_directories("${OPENAIR_DIR}") ...@@ -578,6 +578,15 @@ include_directories("${OPENAIR_DIR}")
# Utilities # Utilities
############### ###############
# include T directory even if the T is off because T macros are in the code
# no matter what. Note: sone files are generated, so we have both source and
# binary directories
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/common/utils/T
${CMAKE_CURRENT_BINARY_DIR}/common/utils/T)
# set the T_LIB name to T if the target exists, otherwise leave empty
set(T_LIB $<TARGET_NAME_IF_EXISTS:T>)
add_library(HASHTABLE add_library(HASHTABLE
${OPENAIR_DIR}/common/utils/hashtable/hashtable.c ${OPENAIR_DIR}/common/utils/hashtable/hashtable.c
${OPENAIR_DIR}/common/utils/hashtable/obj_hashtable.c ${OPENAIR_DIR}/common/utils/hashtable/obj_hashtable.c
...@@ -595,6 +604,7 @@ add_library(UTIL ...@@ -595,6 +604,7 @@ add_library(UTIL
${OPENAIR_DIR}/common/utils/time_meas.c ${OPENAIR_DIR}/common/utils/time_meas.c
${OPENAIR_DIR}/common/utils/time_stat.c ${OPENAIR_DIR}/common/utils/time_stat.c
) )
target_link_libraries(UTIL PUBLIC ${T_LIB})
set(SECURITY_SRC set(SECURITY_SRC
${OPENAIR3_DIR}/SECU/secu_defs.c ${OPENAIR3_DIR}/SECU/secu_defs.c
...@@ -1127,8 +1137,6 @@ set(PHY_MEX_UE ...@@ -1127,8 +1137,6 @@ set(PHY_MEX_UE
${OPENAIR1_DIR}/PHY/LTE_UE_TRANSPORT/dlsch_llr_computation_avx2.c ${OPENAIR1_DIR}/PHY/LTE_UE_TRANSPORT/dlsch_llr_computation_avx2.c
${OPENAIR1_DIR}/PHY/LTE_ESTIMATION/lte_ue_measurements.c ${OPENAIR1_DIR}/PHY/LTE_ESTIMATION/lte_ue_measurements.c
${OPENAIR_DIR}/common/utils/LOG/log.c ${OPENAIR_DIR}/common/utils/LOG/log.c
${OPENAIR_DIR}/common/utils/T/T.c
${OPENAIR_DIR}/common/utils/T/local_tracer.c
) )
add_library(PHY_MEX ${PHY_MEX_UE}) add_library(PHY_MEX ${PHY_MEX_UE})
target_link_libraries(PHY_MEX PRIVATE asn1_lte_rrc_hdrs) target_link_libraries(PHY_MEX PRIVATE asn1_lte_rrc_hdrs)
...@@ -1882,27 +1890,12 @@ add_library(oai_iqplayer MODULE ...@@ -1882,27 +1890,12 @@ add_library(oai_iqplayer MODULE
) )
set(CMAKE_MODULE_PATH "${OPENAIR_DIR}/cmake_targets/tools/MODULES" "${CMAKE_MODULE_PATH}") set(CMAKE_MODULE_PATH "${OPENAIR_DIR}/cmake_targets/tools/MODULES" "${CMAKE_MODULE_PATH}")
# include T directory even if the T is off because T macros are in the code
# no matter what. Note: sone files are generated, so we have both source and
# binary directories
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/common/utils/T
${CMAKE_CURRENT_BINARY_DIR}/common/utils/T)
if (${T_TRACER})
set(T_SOURCE
${OPENAIR_DIR}/common/utils/T/T.c
${OPENAIR_DIR}/common/utils/T/local_tracer.c)
set(T_LIB "rt")
endif (${T_TRACER})
################################# #################################
# add executables for operation # add executables for operation
################################# #################################
add_library(minimal_lib add_library(minimal_lib
${OPENAIR_DIR}/common/utils/LOG/log.c ${OPENAIR_DIR}/common/utils/LOG/log.c
${OPENAIR_DIR}/common/utils/minimal_stub.c ${OPENAIR_DIR}/common/utils/minimal_stub.c
${T_SOURCE}
) )
target_link_libraries(minimal_lib pthread dl ${T_LIB}) target_link_libraries(minimal_lib pthread dl ${T_LIB})
...@@ -1941,7 +1934,6 @@ add_executable(lte-softmodem ...@@ -1941,7 +1934,6 @@ add_executable(lte-softmodem
${OPENAIR_DIR}/common/utils/lte/ue_power.c ${OPENAIR_DIR}/common/utils/lte/ue_power.c
${OPENAIR_DIR}/common/utils/lte/prach_utils.c ${OPENAIR_DIR}/common/utils/lte/prach_utils.c
${OPENAIR1_DIR}/PHY/TOOLS/phy_scope_interface.c ${OPENAIR1_DIR}/PHY/TOOLS/phy_scope_interface.c
${T_SOURCE}
) )
add_dependencies(lte-softmodem oai_iqplayer) add_dependencies(lte-softmodem oai_iqplayer)
...@@ -1968,7 +1960,6 @@ add_executable(oairu ...@@ -1968,7 +1960,6 @@ add_executable(oairu
${OPENAIR_DIR}/executables/softmodem-common.c ${OPENAIR_DIR}/executables/softmodem-common.c
${OPENAIR_DIR}/openair1/SCHED/phy_procedures_lte_common.c ${OPENAIR_DIR}/openair1/SCHED/phy_procedures_lte_common.c
${OPENAIR_DIR}/executables/main_ru.c ${OPENAIR_DIR}/executables/main_ru.c
${T_SOURCE}
${OPENAIR_DIR}/common/utils/lte/prach_utils.c ${OPENAIR_DIR}/common/utils/lte/prach_utils.c
) )
target_link_libraries(oairu PRIVATE target_link_libraries(oairu PRIVATE
...@@ -2000,7 +1991,6 @@ add_executable(lte-uesoftmodem ...@@ -2000,7 +1991,6 @@ add_executable(lte-uesoftmodem
${OPENAIR_DIR}/common/utils/lte/ue_power.c ${OPENAIR_DIR}/common/utils/lte/ue_power.c
${OPENAIR_DIR}/common/utils/lte/prach_utils.c ${OPENAIR_DIR}/common/utils/lte/prach_utils.c
${OPENAIR1_DIR}/PHY/TOOLS/phy_scope_interface.c ${OPENAIR1_DIR}/PHY/TOOLS/phy_scope_interface.c
${T_SOURCE}
) )
if (NOT ${NOS1}) if (NOT ${NOS1})
...@@ -2043,7 +2033,6 @@ add_executable(nr-softmodem ...@@ -2043,7 +2033,6 @@ add_executable(nr-softmodem
${OPENAIR_DIR}/common/utils/nr/nr_common.c ${OPENAIR_DIR}/common/utils/nr/nr_common.c
${PHY_INTERFACE_DIR}/queue_t.c ${PHY_INTERFACE_DIR}/queue_t.c
${OPENAIR1_DIR}/PHY/TOOLS/phy_scope_interface.c ${OPENAIR1_DIR}/PHY/TOOLS/phy_scope_interface.c
${T_SOURCE}
) )
target_link_libraries(nr-softmodem PRIVATE target_link_libraries(nr-softmodem PRIVATE
...@@ -2080,13 +2069,12 @@ add_executable(nr-cuup ...@@ -2080,13 +2069,12 @@ add_executable(nr-cuup
${OPENAIR2_DIR}/E1AP/e1ap_setup.c ${OPENAIR2_DIR}/E1AP/e1ap_setup.c
${NR_PDCP_SRC} ${NR_PDCP_SRC}
${NR_SDAP_SRC} ${NR_SDAP_SRC}
${T_SOURCE}
) )
target_link_libraries(nr-cuup PRIVATE target_link_libraries(nr-cuup PRIVATE
CONFIG_LIB ITTI SCTP_CLIENT CONFIG_LIB ITTI SCTP_CLIENT
GTPV1U e1ap e1_pdcp_if f1ap SIMU_ETH GTPV1U e1ap e1_pdcp_if f1ap SIMU_ETH
z sctp dl pthread shlib_loader) z sctp dl pthread shlib_loader ${T_LIB})
target_link_libraries(nr-cuup PRIVATE asn1_lte_rrc_hdrs asn1_nr_rrc_hdrs) target_link_libraries(nr-cuup PRIVATE asn1_lte_rrc_hdrs asn1_nr_rrc_hdrs)
# nr-uesoftmodem is UE implementation # nr-uesoftmodem is UE implementation
...@@ -2107,7 +2095,6 @@ add_executable(nr-uesoftmodem ...@@ -2107,7 +2095,6 @@ add_executable(nr-uesoftmodem
${OPENAIR3_DIR}/NAS/UE/nas_ue_task.c ${OPENAIR3_DIR}/NAS/UE/nas_ue_task.c
${OPENAIR_DIR}/common/utils/nr/nr_common.c ${OPENAIR_DIR}/common/utils/nr/nr_common.c
${OPENAIR1_DIR}/PHY/TOOLS/phy_scope_interface.c ${OPENAIR1_DIR}/PHY/TOOLS/phy_scope_interface.c
${T_SOURCE}
) )
target_link_libraries(nr-uesoftmodem PRIVATE target_link_libraries(nr-uesoftmodem PRIVATE
...@@ -2144,7 +2131,6 @@ target_link_libraries(nr-uesoftmodem PRIVATE ...@@ -2144,7 +2131,6 @@ target_link_libraries(nr-uesoftmodem PRIVATE
add_executable(dlsim_tm4 add_executable(dlsim_tm4
${OPENAIR1_DIR}/SIMULATION/LTE_PHY/dlsim_tm4.c ${OPENAIR1_DIR}/SIMULATION/LTE_PHY/dlsim_tm4.c
${OPENAIR1_DIR}/PHY/TOOLS/lte_phy_scope_tm4.c ${OPENAIR1_DIR}/PHY/TOOLS/lte_phy_scope_tm4.c
${T_SOURCE}
) )
target_link_libraries (dlsim_tm4 target_link_libraries (dlsim_tm4
-Wl,--start-group SIMU UTIL SCHED_LIB SCHED_RU_LIB PHY ITTI -Wl,--end-group -Wl,--start-group SIMU UTIL SCHED_LIB SCHED_RU_LIB PHY ITTI -Wl,--end-group
...@@ -2163,29 +2149,26 @@ target_link_libraries(rftest PRIVATE asn1_lte_rrc_hdrs asn1_nr_rrc_hdrs) ...@@ -2163,29 +2149,26 @@ target_link_libraries(rftest PRIVATE asn1_lte_rrc_hdrs asn1_nr_rrc_hdrs)
add_executable(polartest add_executable(polartest
${OPENAIR1_DIR}/PHY/CODING/TESTBENCH/polartest.c ${OPENAIR1_DIR}/PHY/CODING/TESTBENCH/polartest.c
${OPENAIR_DIR}/common/utils/nr/nr_common.c ${OPENAIR_DIR}/common/utils/nr/nr_common.c
${T_SOURCE}
) )
target_link_libraries(polartest PRIVATE target_link_libraries(polartest PRIVATE
-Wl,--start-group UTIL SIMU PHY_COMMON PHY_NR PHY_NR_COMMON PHY_NR_UE CONFIG_LIB -Wl,--end-group -Wl,--start-group UTIL SIMU PHY_COMMON PHY_NR PHY_NR_COMMON PHY_NR_UE CONFIG_LIB -Wl,--end-group
m pthread dl m pthread dl ${T_LIB}
) )
add_executable(smallblocktest add_executable(smallblocktest
${OPENAIR1_DIR}/PHY/CODING/TESTBENCH/smallblocktest.c ${OPENAIR1_DIR}/PHY/CODING/TESTBENCH/smallblocktest.c
${OPENAIR_DIR}/common/utils/nr/nr_common.c ${OPENAIR_DIR}/common/utils/nr/nr_common.c
${T_SOURCE}
) )
target_link_libraries(smallblocktest PRIVATE target_link_libraries(smallblocktest PRIVATE
-Wl,--start-group UTIL SIMU PHY_NR PHY_COMMON PHY_NR_COMMON -Wl,--end-group -Wl,--start-group UTIL SIMU PHY_NR PHY_COMMON PHY_NR_COMMON -Wl,--end-group
m pthread dl shlib_loader m pthread dl shlib_loader ${T_LIB}
) )
add_executable(ldpctest add_executable(ldpctest
${PHY_NR_CODINGIF} ${PHY_NR_CODINGIF}
${OPENAIR1_DIR}/PHY/CODING/TESTBENCH/ldpctest.c ${OPENAIR1_DIR}/PHY/CODING/TESTBENCH/ldpctest.c
${T_SOURCE}
) )
add_dependencies( ldpctest ldpc_orig ldpc_optim ldpc_optim8seg ldpc ldpc_parityCheck) add_dependencies( ldpctest ldpc_orig ldpc_optim ldpc_optim8seg ldpc ldpc_parityCheck)
...@@ -2194,14 +2177,13 @@ if (ENABLE_LDPC_CUDA) ...@@ -2194,14 +2177,13 @@ if (ENABLE_LDPC_CUDA)
endif() endif()
target_link_libraries(ldpctest PRIVATE target_link_libraries(ldpctest PRIVATE
-Wl,--start-group UTIL SIMU PHY_NR PHY_COMMON PHY_NR_COMMON -Wl,--end-group -Wl,--start-group UTIL SIMU PHY_NR PHY_COMMON PHY_NR_COMMON -Wl,--end-group
m pthread dl shlib_loader m pthread dl shlib_loader ${T_LIB}
) )
add_executable(nr_dlschsim add_executable(nr_dlschsim
${OPENAIR1_DIR}/SIMULATION/NR_PHY/dlschsim.c ${OPENAIR1_DIR}/SIMULATION/NR_PHY/dlschsim.c
${OPENAIR1_DIR}/SIMULATION/NR_PHY/nr_dummy_functions.c ${OPENAIR1_DIR}/SIMULATION/NR_PHY/nr_dummy_functions.c
${OPENAIR_DIR}/common/utils/nr/nr_common.c ${OPENAIR_DIR}/common/utils/nr/nr_common.c
${T_SOURCE}
) )
target_link_libraries(nr_dlschsim PRIVATE target_link_libraries(nr_dlschsim PRIVATE
-Wl,--start-group UTIL SIMU PHY_COMMON PHY_NR_COMMON PHY_NR PHY_NR_UE SCHED_NR_LIB CONFIG_LIB MAC_NR_COMMON -Wl,--end-group -Wl,--start-group UTIL SIMU PHY_COMMON PHY_NR_COMMON PHY_NR PHY_NR_UE SCHED_NR_LIB CONFIG_LIB MAC_NR_COMMON -Wl,--end-group
...@@ -2213,7 +2195,6 @@ add_executable(nr_pbchsim ...@@ -2213,7 +2195,6 @@ add_executable(nr_pbchsim
${OPENAIR1_DIR}/SIMULATION/NR_PHY/pbchsim.c ${OPENAIR1_DIR}/SIMULATION/NR_PHY/pbchsim.c
${OPENAIR1_DIR}/SIMULATION/NR_PHY/nr_dummy_functions.c ${OPENAIR1_DIR}/SIMULATION/NR_PHY/nr_dummy_functions.c
${OPENAIR_DIR}/common/utils/nr/nr_common.c ${OPENAIR_DIR}/common/utils/nr/nr_common.c
${T_SOURCE}
) )
target_link_libraries(nr_pbchsim PRIVATE target_link_libraries(nr_pbchsim PRIVATE
-Wl,--start-group UTIL SIMU PHY_COMMON PHY_NR_COMMON PHY_NR PHY_NR_UE SCHED_NR_LIB CONFIG_LIB MAC_NR_COMMON -Wl,--end-group -Wl,--start-group UTIL SIMU PHY_COMMON PHY_NR_COMMON PHY_NR PHY_NR_UE SCHED_NR_LIB CONFIG_LIB MAC_NR_COMMON -Wl,--end-group
...@@ -2227,7 +2208,6 @@ add_executable(nr_pucchsim ...@@ -2227,7 +2208,6 @@ add_executable(nr_pucchsim
${OPENAIR1_DIR}/SIMULATION/NR_PHY/pucchsim.c ${OPENAIR1_DIR}/SIMULATION/NR_PHY/pucchsim.c
${OPENAIR1_DIR}/SIMULATION/NR_PHY/nr_dummy_functions.c ${OPENAIR1_DIR}/SIMULATION/NR_PHY/nr_dummy_functions.c
${OPENAIR_DIR}/common/utils/nr/nr_common.c ${OPENAIR_DIR}/common/utils/nr/nr_common.c
${T_SOURCE}
) )
target_link_libraries(nr_pucchsim PRIVATE target_link_libraries(nr_pucchsim PRIVATE
-Wl,--start-group UTIL SIMU PHY_COMMON PHY_NR_COMMON PHY_NR PHY_NR_UE SCHED_NR_LIB CONFIG_LIB MAC_NR_COMMON -Wl,--end-group -Wl,--start-group UTIL SIMU PHY_COMMON PHY_NR_COMMON PHY_NR PHY_NR_UE SCHED_NR_LIB CONFIG_LIB MAC_NR_COMMON -Wl,--end-group
...@@ -2245,7 +2225,6 @@ add_executable(nr_dlsim ...@@ -2245,7 +2225,6 @@ add_executable(nr_dlsim
${NFAPI_USER_DIR}/nfapi.c ${NFAPI_USER_DIR}/nfapi.c
${NFAPI_USER_DIR}/gnb_ind_vars.c ${NFAPI_USER_DIR}/gnb_ind_vars.c
${PHY_INTERFACE_DIR}/queue_t.c ${PHY_INTERFACE_DIR}/queue_t.c
${T_SOURCE}
) )
target_link_libraries(nr_dlsim PRIVATE target_link_libraries(nr_dlsim PRIVATE
-Wl,--start-group UTIL SIMU SIMU_ETH PHY_COMMON PHY_NR_COMMON PHY_NR PHY_NR_UE SCHED_NR_LIB SCHED_NR_UE_LIB MAC_NR MAC_UE_NR MAC_NR_COMMON nr_rrc CONFIG_LIB L2_NR HASHTABLE x2ap SECURITY ngap -lz -Wl,--end-group -Wl,--start-group UTIL SIMU SIMU_ETH PHY_COMMON PHY_NR_COMMON PHY_NR PHY_NR_UE SCHED_NR_LIB SCHED_NR_UE_LIB MAC_NR MAC_UE_NR MAC_NR_COMMON nr_rrc CONFIG_LIB L2_NR HASHTABLE x2ap SECURITY ngap -lz -Wl,--end-group
...@@ -2257,7 +2236,6 @@ add_executable(nr_prachsim ...@@ -2257,7 +2236,6 @@ add_executable(nr_prachsim
${OPENAIR1_DIR}/SIMULATION/NR_PHY/prachsim.c ${OPENAIR1_DIR}/SIMULATION/NR_PHY/prachsim.c
${OPENAIR1_DIR}/SIMULATION/NR_PHY/nr_dummy_functions.c ${OPENAIR1_DIR}/SIMULATION/NR_PHY/nr_dummy_functions.c
${OPENAIR_DIR}/common/utils/nr/nr_common.c ${OPENAIR_DIR}/common/utils/nr/nr_common.c
${T_SOURCE}
) )
target_link_libraries(nr_prachsim PRIVATE target_link_libraries(nr_prachsim PRIVATE
-Wl,--start-group UTIL SIMU PHY_COMMON PHY_NR_COMMON PHY_NR PHY_RU PHY_NR_UE MAC_NR_COMMON SCHED_NR_LIB CONFIG_LIB -lz -Wl,--end-group -Wl,--start-group UTIL SIMU PHY_COMMON PHY_NR_COMMON PHY_NR PHY_RU PHY_NR_UE MAC_NR_COMMON SCHED_NR_LIB CONFIG_LIB -lz -Wl,--end-group
...@@ -2269,7 +2247,6 @@ add_executable(nr_ulschsim ...@@ -2269,7 +2247,6 @@ add_executable(nr_ulschsim
${OPENAIR1_DIR}/SIMULATION/NR_PHY/nr_dummy_functions.c ${OPENAIR1_DIR}/SIMULATION/NR_PHY/nr_dummy_functions.c
${OPENAIR_DIR}/common/utils/nr/nr_common.c ${OPENAIR_DIR}/common/utils/nr/nr_common.c
${PHY_INTERFACE_DIR}/queue_t.c ${PHY_INTERFACE_DIR}/queue_t.c
${T_SOURCE}
) )
target_link_libraries(nr_ulschsim PRIVATE target_link_libraries(nr_ulschsim PRIVATE
-Wl,--start-group UTIL SIMU PHY_COMMON PHY_NR_COMMON PHY_NR PHY_NR_UE SCHED_NR_LIB CONFIG_LIB MAC_NR_COMMON -Wl,--end-group -Wl,--start-group UTIL SIMU PHY_COMMON PHY_NR_COMMON PHY_NR PHY_NR_UE SCHED_NR_LIB CONFIG_LIB MAC_NR_COMMON -Wl,--end-group
...@@ -2287,7 +2264,6 @@ add_executable(nr_ulsim ...@@ -2287,7 +2264,6 @@ add_executable(nr_ulsim
${NFAPI_USER_DIR}/nfapi.c ${NFAPI_USER_DIR}/nfapi.c
${NFAPI_USER_DIR}/gnb_ind_vars.c ${NFAPI_USER_DIR}/gnb_ind_vars.c
${PHY_INTERFACE_DIR}/queue_t.c ${PHY_INTERFACE_DIR}/queue_t.c
${T_SOURCE}
) )
if (ENABLE_LDPC_T1) if (ENABLE_LDPC_T1)
...@@ -2307,7 +2283,6 @@ foreach(myExe dlsim dlsim_tm7 ulsim pbchsim scansim mbmssim pdcchsim pucchsim pr ...@@ -2307,7 +2283,6 @@ foreach(myExe dlsim dlsim_tm7 ulsim pbchsim scansim mbmssim pdcchsim pucchsim pr
${OPENAIR_DIR}/common/utils/lte/ue_power.c ${OPENAIR_DIR}/common/utils/lte/ue_power.c
${OPENAIR_DIR}/common/utils/lte/prach_utils.c ${OPENAIR_DIR}/common/utils/lte/prach_utils.c
${OPENAIR1_DIR}/PHY/INIT/lte_param_init.c ${OPENAIR1_DIR}/PHY/INIT/lte_param_init.c
${T_SOURCE}
${NFAPI_USER_DIR}/nfapi.c ${NFAPI_USER_DIR}/nfapi.c
) )
target_link_libraries (${myExe} PRIVATE target_link_libraries (${myExe} PRIVATE
......
...@@ -38,3 +38,9 @@ add_custom_target(generate_T DEPENDS T_IDs.h check_vcd) ...@@ -38,3 +38,9 @@ add_custom_target(generate_T DEPENDS T_IDs.h check_vcd)
add_library(T_headers INTERFACE) add_library(T_headers INTERFACE)
add_dependencies(T_headers T_IDs.h T_messages.txt.h) add_dependencies(T_headers T_IDs.h T_messages.txt.h)
target_include_directories(T_headers INTERFACE ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}) target_include_directories(T_headers INTERFACE ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
if(T_TRACER)
add_library(T STATIC T.c local_tracer.c T_IDs.h T_messages.txt.h)
target_link_libraries(T PUBLIC rt)
target_link_libraries(T PRIVATE CONFIG_LIB T_headers)
endif()
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment