baseband/turbo_sw: detect dependencies automatically

The meson for the turbo_sw PMD is updated to prevent the
requirement for any device specific toplevel flags to be
passed down (unlike what used to be the case with make).
The linking to the optional libraries is purely auto
detected at build time and flags are then set appropriately.

Signed-off-by: Nicolas Chautru <nicolas.chautru@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
This commit is contained in:
Nicolas Chautru 2020-09-03 18:05:35 -07:00 committed by Akhil Goyal
parent cbcda56cce
commit 93b043df3d

View File

@ -3,28 +3,28 @@
path = get_option('flexran_sdk') path = get_option('flexran_sdk')
if dpdk_conf.has('RTE_BBDEV_SDK_AVX2') # check for FlexRAN SDK libraries for AVX2
lib = cc.find_library('libturbo', dirs: [path + '/lib_turbo'], required: false) lib4g = cc.find_library('libturbo', dirs: [path + '/lib_turbo'], required: false)
if not lib.found() if lib4g.found()
build = false ext_deps += cc.find_library('libturbo', dirs: [path + '/lib_turbo'], required: true)
reason = 'missing dependency, "libturbo"' ext_deps += cc.find_library('libcrc', dirs: [path + '/lib_crc'], required: true)
else ext_deps += cc.find_library('librate_matching', dirs: [path + '/lib_rate_matching'], required: true)
ext_deps += cc.find_library('libturbo', dirs: [path + '/lib_turbo'], required: true) ext_deps += cc.find_library('libcommon', dirs: [path + '/lib_common'], required: true)
ext_deps += cc.find_library('libcrc', dirs: [path + '/lib_crc'], required: true) ext_deps += cc.find_library('libstdc++', required: true)
ext_deps += cc.find_library('librate_matching', dirs: [path + '/lib_rate_matching'], required: true) ext_deps += cc.find_library('libirc', required: true)
ext_deps += cc.find_library('libcommon', dirs: [path + '/lib_common'], required: true) ext_deps += cc.find_library('libimf', required: true)
ext_deps += cc.find_library('libstdc++', required: true) ext_deps += cc.find_library('libipps', required: true)
ext_deps += cc.find_library('libirc', required: true) ext_deps += cc.find_library('libsvml', required: true)
ext_deps += cc.find_library('libimf', required: true) includes += include_directories(path + '/lib_turbo')
ext_deps += cc.find_library('libipps', required: true) includes += include_directories(path + '/lib_crc')
ext_deps += cc.find_library('libsvml', required: true) includes += include_directories(path + '/lib_rate_matching')
includes += include_directories(path + '/lib_turbo') includes += include_directories(path + '/lib_common')
includes += include_directories(path + '/lib_crc') cflags += ['-DRTE_BBDEV_SDK_AVX2']
includes += include_directories(path + '/lib_rate_matching')
includes += include_directories(path + '/lib_common')
endif
endif endif
if dpdk_conf.has('RTE_BBDEV_SDK_AVX512')
# check for FlexRAN SDK libraries for AVX512
lib5g = cc.find_library('libldpc_decoder_5gnr', dirs: [path + '/lib_ldpc_decoder_5gnr'], required: false)
if lib5g.found()
ext_deps += cc.find_library('libldpc_encoder_5gnr', dirs: [path + '/lib_ldpc_encoder_5gnr'], required: true) ext_deps += cc.find_library('libldpc_encoder_5gnr', dirs: [path + '/lib_ldpc_encoder_5gnr'], required: true)
ext_deps += cc.find_library('libldpc_decoder_5gnr', dirs: [path + '/lib_ldpc_decoder_5gnr'], required: true) ext_deps += cc.find_library('libldpc_decoder_5gnr', dirs: [path + '/lib_ldpc_decoder_5gnr'], required: true)
ext_deps += cc.find_library('libLDPC_ratematch_5gnr', dirs: [path + '/lib_LDPC_ratematch_5gnr'], required: true) ext_deps += cc.find_library('libLDPC_ratematch_5gnr', dirs: [path + '/lib_LDPC_ratematch_5gnr'], required: true)
@ -33,6 +33,7 @@ if dpdk_conf.has('RTE_BBDEV_SDK_AVX512')
includes += include_directories(path + '/lib_ldpc_decoder_5gnr') includes += include_directories(path + '/lib_ldpc_decoder_5gnr')
includes += include_directories(path + '/lib_LDPC_ratematch_5gnr') includes += include_directories(path + '/lib_LDPC_ratematch_5gnr')
includes += include_directories(path + '/lib_rate_dematching_5gnr') includes += include_directories(path + '/lib_rate_dematching_5gnr')
cflags += ['-DRTE_BBDEV_SDK_AVX512']
endif endif
deps += ['bbdev', 'bus_vdev', 'ring'] deps += ['bbdev', 'bus_vdev', 'ring']