From 252c9db24660284cb1e1ddc2148e03f2806a84b7 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Tue, 18 Feb 2025 11:01:20 +0000 Subject: [PATCH] Correctly express dependency on LOG headers Various libraries in this commit use the log headers (that is the direct dependency). The log headers in turn include the T headers (transitive dependency). Building on gracehopper with its many cores triggers the build of these libraries before T headers have been generated. To resolve this and force the generation of T headers before building the libraries, correctly express their dependency on the log headers, which in turn ensures that T headers have been generated. Depending on log_headers is preferrable because it is really the headers that we depend on. Using instead e.g., utils, would trigger build of source files, that we don't need for these libraries. This commit is part of a larger cleanup that I have that is not merged yet. Follow-up work will generalize this in the repo, and ensure that every(!) library builds. We have to add CONFIG_LIB, as the log module has a direct dependency onto the configuration module (it uses it). I am not sure why this was not relevant before. --- common/utils/LOG/CMakeLists.txt | 7 ++++++- openair1/PHY/CODING/CMakeLists.txt | 2 ++ openair3/NAS/COMMON/IES/CMakeLists.txt | 1 + openair3/NAS/COMMON/UTIL/CMakeLists.txt | 1 + openair3/NAS/NR_UE/5GS/5GMM/IES/CMakeLists.txt | 5 +++-- openair3/NAS/NR_UE/5GS/5GSM/MSG/CMakeLists.txt | 2 +- openair3/NAS/UE/API/USIM/CMakeLists.txt | 1 + openair3/UICC/CMakeLists.txt | 1 + 8 files changed, 16 insertions(+), 4 deletions(-) diff --git a/common/utils/LOG/CMakeLists.txt b/common/utils/LOG/CMakeLists.txt index c525969015..ff224329de 100644 --- a/common/utils/LOG/CMakeLists.txt +++ b/common/utils/LOG/CMakeLists.txt @@ -1,10 +1,15 @@ +add_library(log_headers INTERFACE) +target_include_directories(log_headers INTERFACE .) +target_link_libraries(log_headers INTERFACE T_headers) + set(log_sources log.c) if (ENABLE_LTTNG) set(log_sources ${log_sources} lttng-tp.c) endif() add_library(LOG ${log_sources}) target_include_directories(LOG PUBLIC .) -target_link_libraries(LOG PRIVATE ${T_LIB}) +target_link_libraries(LOG PRIVATE CONFIG_LIB) +target_link_libraries(LOG PUBLIC log_headers) if (ENABLE_LTTNG) target_link_libraries(LOG PUBLIC lttng-ust) endif() diff --git a/openair1/PHY/CODING/CMakeLists.txt b/openair1/PHY/CODING/CMakeLists.txt index e4e8d43a95..4eee35a2cd 100644 --- a/openair1/PHY/CODING/CMakeLists.txt +++ b/openair1/PHY/CODING/CMakeLists.txt @@ -7,6 +7,8 @@ add_library(coding MODULE 3gpplte_turbo_decoder.c ) set_target_properties(coding PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}) +#ensure that the T header files are generated before targets depending on them +target_link_libraries(coding PRIVATE log_headers) add_library(ldpc_orig MODULE nrLDPC_decoder/nrLDPC_decoder.c diff --git a/openair3/NAS/COMMON/IES/CMakeLists.txt b/openair3/NAS/COMMON/IES/CMakeLists.txt index 67cc9d782a..dd10fe3018 100644 --- a/openair3/NAS/COMMON/IES/CMakeLists.txt +++ b/openair3/NAS/COMMON/IES/CMakeLists.txt @@ -4,3 +4,4 @@ add_library(nas_common_ies_lib OBJECT ) target_include_directories(nas_common_ies_lib PUBLIC .) +target_link_libraries(nas_common_ies_lib PUBLIC log_headers) diff --git a/openair3/NAS/COMMON/UTIL/CMakeLists.txt b/openair3/NAS/COMMON/UTIL/CMakeLists.txt index dc29dff207..0947e80991 100644 --- a/openair3/NAS/COMMON/UTIL/CMakeLists.txt +++ b/openair3/NAS/COMMON/UTIL/CMakeLists.txt @@ -2,5 +2,6 @@ add_library(nas_utils OBJECT TLVDecoder.c OctetString.c ) +target_link_libraries(nas_utils PUBLIC log_headers) target_include_directories(nas_utils PRIVATE .) diff --git a/openair3/NAS/NR_UE/5GS/5GMM/IES/CMakeLists.txt b/openair3/NAS/NR_UE/5GS/5GMM/IES/CMakeLists.txt index 24ed3022a6..e865dd0046 100644 --- a/openair3/NAS/NR_UE/5GS/5GMM/IES/CMakeLists.txt +++ b/openair3/NAS/NR_UE/5GS/5GMM/IES/CMakeLists.txt @@ -8,6 +8,7 @@ add_library(fgs_5gmm_ies_lib OBJECT SORTransparentContainer.c ) -target_link_libraries(fgs_5gmm_ies_lib PUBLIC - nas_common_ies_lib +target_link_libraries(fgs_5gmm_ies_lib + PUBLIC nas_common_ies_lib + PRIVATE log_headers ) diff --git a/openair3/NAS/NR_UE/5GS/5GSM/MSG/CMakeLists.txt b/openair3/NAS/NR_UE/5GS/5GSM/MSG/CMakeLists.txt index 1630a48222..de75e7157f 100644 --- a/openair3/NAS/NR_UE/5GS/5GSM/MSG/CMakeLists.txt +++ b/openair3/NAS/NR_UE/5GS/5GSM/MSG/CMakeLists.txt @@ -1,6 +1,6 @@ add_library(fgs_5gsm_lib OBJECT PduSessionEstablishRequest.c PduSessionEstablishmentAccept.c) -target_link_libraries(fgs_5gsm_lib PUBLIC nas_common_ies_lib) +target_link_libraries(fgs_5gsm_lib PUBLIC nas_common_ies_lib log_headers) target_include_directories(fgs_5gsm_lib PUBLIC . ../../) diff --git a/openair3/NAS/UE/API/USIM/CMakeLists.txt b/openair3/NAS/UE/API/USIM/CMakeLists.txt index 90a9cb40fe..63ae905461 100644 --- a/openair3/NAS/UE/API/USIM/CMakeLists.txt +++ b/openair3/NAS/UE/API/USIM/CMakeLists.txt @@ -3,6 +3,7 @@ add_library(usim_lib OBJECT aka_functions.c usim_api.c ) +target_link_libraries(usim_lib PRIVATE log_headers) target_include_directories(usim_lib PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} diff --git a/openair3/UICC/CMakeLists.txt b/openair3/UICC/CMakeLists.txt index 0570c7238f..c80694e1a5 100644 --- a/openair3/UICC/CMakeLists.txt +++ b/openair3/UICC/CMakeLists.txt @@ -1,2 +1,3 @@ add_library(lib_uicc OBJECT usim_interface.c) target_include_directories(lib_uicc PRIVATE .) +target_link_libraries(lib_uicc PRIVATE log_headers)