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.
98 lines
4.2 KiB
CMake
98 lines
4.2 KiB
CMake
add_library(coding MODULE
|
|
3gpplte_sse.c
|
|
3gpplte.c
|
|
3gpplte_turbo_decoder_sse_8bit.c
|
|
3gpplte_turbo_decoder_sse_16bit.c
|
|
3gpplte_turbo_decoder_avx2_16bit.c
|
|
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
|
|
nrLDPC_encoder/ldpc_encoder.c
|
|
)
|
|
set_target_properties(ldpc_orig PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
|
|
target_link_libraries(ldpc_orig PRIVATE ldpc_segment ldpc_gen_HEADERS)
|
|
|
|
add_library(ldpc_optim MODULE
|
|
nrLDPC_decoder/nrLDPC_decoder.c
|
|
nrLDPC_encoder/ldpc_encoder_optim.c
|
|
)
|
|
set_target_properties(ldpc_optim PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
|
|
target_link_libraries(ldpc_optim PRIVATE ldpc_segment ldpc_gen_HEADERS)
|
|
|
|
add_library(ldpc_optim8seg MODULE
|
|
nrLDPC_decoder/nrLDPC_decoder.c
|
|
nrLDPC_encoder/ldpc_encoder_optim8seg.c
|
|
)
|
|
set_target_properties(ldpc_optim8seg PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
|
|
target_link_libraries(ldpc_optim8seg PRIVATE ldpc_segment ldpc_gen_HEADERS)
|
|
|
|
add_library(ldpc MODULE
|
|
nrLDPC_decoder/nrLDPC_decoder.c
|
|
nrLDPC_encoder/ldpc_encoder_optim8segmulti.c
|
|
)
|
|
set_target_properties(ldpc PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
|
|
target_link_libraries(ldpc PRIVATE ldpc_segment ldpc_gen_HEADERS)
|
|
|
|
add_dependencies(ldpctest ldpc ldpc_orig ldpc_optim ldpc_optim8seg)
|
|
add_dependencies(nr-softmodem ldpc ldpc_orig ldpc_optim ldpc_optim8seg)
|
|
add_dependencies(nr-uesoftmodem ldpc ldpc_orig ldpc_optim ldpc_optim8seg)
|
|
add_dependencies(nr_ulsim ldpc ldpc_orig ldpc_optim ldpc_optim8seg)
|
|
add_dependencies(nr_ulschsim ldpc ldpc_orig ldpc_optim ldpc_optim8seg)
|
|
add_dependencies(nr_dlsim ldpc ldpc_orig ldpc_optim ldpc_optim8seg)
|
|
add_dependencies(nr_dlschsim ldpc ldpc_orig ldpc_optim ldpc_optim8seg)
|
|
|
|
add_custom_target(nrLDPC_decoder_kernels_CL
|
|
COMMAND gcc nrLDPC_decoder/nrLDPC_decoder_CL.c -dD -DNRLDPC_KERNEL_SOURCE -E -o ${CMAKE_CURRENT_BINARY_DIR}/nrLDPC_decoder_kernels_CL.clc
|
|
SOURCES nrLDPC_decoder/nrLDPC_decoder_CL.c
|
|
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
|
)
|
|
add_library(ldpc_cl MODULE
|
|
nrLDPC_decoder/nrLDPC_decoder_CL.c
|
|
nrLDPC_encoder/ldpc_encoder_optim8segmulti.c
|
|
)
|
|
set_target_properties(ldpc_cl PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
|
|
target_link_libraries(ldpc_cl PRIVATE ldpc_segment OpenCL)
|
|
add_dependencies(ldpc_cl nrLDPC_decoder_kernels_CL)
|
|
|
|
##############################################
|
|
# Base CUDA setting
|
|
##############################################
|
|
|
|
add_boolean_option(ENABLE_LDPC_CUDA OFF "Build support for CUDA" OFF)
|
|
if (ENABLE_LDPC_CUDA)
|
|
find_package(CUDA REQUIRED)
|
|
if (NOT CUDA_FOUND)
|
|
message(FATAL_ERROR "no CUDA found")
|
|
endif()
|
|
SET(CUDA_NVCC_FLAG "${CUDA_NVCC_FLAGS};-arch=sm_60;")
|
|
SET(CUDA_VERBOSE_BUILD ON)
|
|
cuda_add_library(ldpc_cuda MODULE
|
|
nrLDPC_decoder_LYC/nrLDPC_decoder_LYC.cu
|
|
nrLDPC_encoder/ldpc_encoder_optim8segmulti.c
|
|
# The slot coding layer cannot be linked with
|
|
# target_link_libraries like above
|
|
# because of cuda_add_library
|
|
# which already uses target_link_libraries
|
|
nrLDPC_coding/nrLDPC_coding_segment/nrLDPC_coding_segment_decoder.c
|
|
nrLDPC_coding/nrLDPC_coding_segment/nrLDPC_coding_segment_encoder.c
|
|
nrLDPC_coding/nrLDPC_coding_segment/nr_rate_matching.c
|
|
)
|
|
set_target_properties(ldpc_cuda PROPERTIES CUDA_SEPARABLE_COMPILATION ON)
|
|
set_target_properties(ldpc_cuda PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
|
|
|
|
add_dependencies(ldpctest ldpc_cuda)
|
|
add_dependencies(nr-softmodem ldpc_cuda)
|
|
add_dependencies(nr-uesoftmodem ldpc_cuda)
|
|
add_dependencies(nr_ulsim ldpc_cuda)
|
|
add_dependencies(nr_ulschsim ldpc_cuda)
|
|
add_dependencies(nr_dlsim ldpc_cuda)
|
|
add_dependencies(nr_dlschsim ldpc_cuda)
|
|
endif()
|
|
|
|
add_subdirectory(nrLDPC_coding)
|