###############################################################################
#
-# Copyright (c) 2019 Intel.
+# Copyright (c) 2021 Intel.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
##############################################################
# Tools configuration
##############################################################
+ifeq ($(WIRELESS_SDK_TOOLCHAIN),icc)
CC := icc
CPP := icpc
AS := as
AR := ar
LD := icc
-OBJDUMP := objdump
-
-ifeq ($(SHELL),cmd.exe)
-MD := mkdir.exe -p
-RM := rm.exe -rf
+else ifeq ($(WIRELESS_SDK_TOOLCHAIN),icx)
+ CC := icx
+ CPP := icx
+ AS := as
+ AR := ar
+ LD := icx
else
+ $(error "Please define WIRELESS_SDK_TOOLCHAIN environment variable")
+endif
+
+ifeq ($(WIRELESS_SDK_TARGET_ISA),sse)
+ TARGET_PROCESSOR := -xSSE4.2
+else ifeq ($(WIRELESS_SDK_TARGET_ISA),avx2)
+ TARGET_PROCESSOR := -xCORE-AVX2
+else ifeq ($(WIRELESS_SDK_TARGET_ISA),avx512)
+ TARGET_PROCESSOR := -xCORE-AVX512
+else ifeq ($(WIRELESS_SDK_TARGET_ISA),snc)
+ TARGET_PROCESSOR := -xicelake-server
+else ifeq ($(WIRELESS_SDK_TARGET_ISA),spr)
+ TARGET_PROCESSOR := -march=sapphirerapids
+endif
+
+ifeq ($(TARGET_PROCESSOR),)
+ $(error "Please define valid WIRELESS_SDK_TARGET_ISA environment variable $(WIRELESS_SDK_TARGET_ISA)")
+endif
+OBJDUMP := objdump
MD := mkdir -p
+CP := cp -f
RM := rm -rf
-endif
##############################################################
# TARGET
##############################################################
-ifeq ($(RTE_TARGET),)
- RTE_TARGET :=x86_64-native-linuxapp-icc
-endif
-##############################################################
-# DPDK
-##############################################################
ifeq ($(RTE_SDK),)
-$(info Please make sure RTE_SDK points to DPDK folder (current version of DPDK is 18.08))
- RTE_SDK := /opt/dpdk-18.08
+ $(error "Please define RTE_SDK environment variable")
endif
+RTE_INC := $(shell PKG_CONFIG_PATH=/usr/lib64/pkgconfig:$(RTE_SDK)/build/meson-uninstalled pkgconf --cflags-only-I libdpdk)
+
##############################################################
# Projects folders
##############################################################
APP := ../bin/oran_5g_fapi
INC := \
- $(WLSDIR) \
- $(SRCDIR)/../include \
- $(SRCDIR)/common \
- $(SRCDIR)/include \
- $(SRCDIR)/framework/workers \
- $(SRCDIR)/framework/wls/fapi2mac \
- $(SRCDIR)/framework/wls/fapi2phy \
- $(SRCDIR)/framework/wls/lib \
- $(SRCDIR)/api/fapi2mac \
- $(SRCDIR)/api/fapi2phy \
- $(FLEXRANDIR)/source/nr5g/api \
- $(FLEXRANDIR)/source/common \
- $(RTE_SDK)/$(RTE_TARGET)/include \
- $(SRCDIR)/api/fapi2phy/p5 \
- $(SRCDIR)/api/fapi2phy/p7 \
- $(SRCDIR)/api/fapi2mac/p5 \
- $(SRCDIR)/api/fapi2mac/p7 \
- $(SRCDIR)/utils \
-
-INC := $(addprefix -I,$(INC))
+ -I$(WLSDIR) \
+ -I$(SRCDIR)/../include \
+ -I$(SRCDIR)/common \
+ -I$(SRCDIR)/include \
+ -I$(SRCDIR)/framework/workers \
+ -I$(SRCDIR)/framework/wls/fapi2mac \
+ -I$(SRCDIR)/framework/wls/fapi2phy \
+ -I$(SRCDIR)/framework/wls/lib \
+ -I$(SRCDIR)/api/fapi2mac \
+ -I$(SRCDIR)/api/fapi2phy \
+ -I$(FLEXRANDIR)/l1/source/nr5g/api \
+ -I$(FLEXRANDIR)/l1/source/common \
+ -I$(SRCDIR)/api/fapi2phy/p5 \
+ -I$(SRCDIR)/api/fapi2phy/p7 \
+ -I$(SRCDIR)/api/fapi2mac/p5 \
+ -I$(SRCDIR)/api/fapi2mac/p7 \
+ -I$(SRCDIR)/utils \
+ $(RTE_INC) \
DEFS := USE_WO_LOCK _GNU_SOURCE
DEFS := $(DEFS) DEBUG_MODE
endif
+ifeq ($(STATISTIC_MODE),true)
+DEFS := $(DEFS) STATISTIC_MODE
+endif
+
DEFS := $(addprefix -D,$(DEFS))
-CFLAGS := -g -Wall -Wextra -Wunused -wd9 -Wno-deprecated-declarations -Wimplicit-function-declaration -fasm-blocks -fstack-protector-strong -z,now, -z,relro -z noexecstack -Wformat -Wformat-security -Werror=format-security -fno-strict-overflow -fwrapv $(DEFS) $(INC)
+CFLAGS := -g -Wall -Wextra -Wunused -diag-disable9 -Wno-deprecated-declarations -Wimplicit-function-declaration -fasm-blocks -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security -fwrapv -mssse3 $(DEFS) $(INC)
ifeq ($(PRINTDBG),)
CFLAGS := $(CFLAGS) -Werror
endif
-RTE_LIBS := -L$(RTE_SDK)/$(RTE_TARGET)/lib -Wl,--whole-archive -Wl,-lrte_distributor -Wl,-lrte_kni -Wl,-lrte_pipeline -Wl,-lrte_table -Wl,-lrte_port -Wl,-lrte_timer -Wl,-lrte_hash -Wl,-lrte_lpm -Wl,-lrte_power -Wl,-lrte_acl -Wl,-lrte_meter -Wl,-lrte_sched -Wl,-lm -Wl,-lrt -Wl,--start-group -Wl,-lrte_kvargs -Wl,-lrte_mbuf -Wl,-lrte_ip_frag -Wl,-lrte_ethdev -Wl,-lrte_mempool -Wl,-lrte_mempool_ring -Wl,-lrte_ring -Wl,-lrte_bus_pci -Wl,-lrte_bus_vdev -Wl,-lrte_pci -Wl,-lrte_net -Wl,-lrte_eal -Wl,-lrte_cmdline -Wl,-lrte_cfgfile -Wl,-lrte_pmd_bond -Wl,-lrte_pmd_vmxnet3_uio -Wl,-lrte_pmd_i40e -Wl,-lrte_pmd_ixgbe -Wl,-lrte_pmd_e1000 -Wl,-lrte_pmd_ring -Wl,-lrt -Wl,-lm -Wl,-ldl -Wl,--end-group -Wl,--no-whole-archive
-LDFLAGS := -g -Wl,-lrt -Wl,-lpthread -Wl,-lhugetlbfs -Wl,-lm -Wl,-lnuma -L $(WLSDIR) -lwls
+RTE_LIBS := $(shell PKG_CONFIG_PATH=/usr/lib64/pkgconfig:$(RTE_SDK)/build/meson-uninstalled pkgconf --static --libs libdpdk)
+LDFLAGS := -z now -z relro -z noexecstack -g -Wl,-lrt -Wl,-lpthread -Wl,-lhugetlbfs -Wl,-lm -Wl,-lnuma -L $(WLSDIR) -lwls
LINUX_ORAN_5G_FAPI_SRC := \
$(SRCDIR)/nr5g_fapi.c \
$(SRCDIR)/utils/nr5g_fapi_stats.c \
$(SRCDIR)/utils/nr5g_fapi_memory.c \
$(SRCDIR)/utils/nr5g_fapi_cmd.c \
+ $(SRCDIR)/utils/nr5g_fapi_snr_conversion.c \
$(SRCDIR)/framework/workers/nr5g_fapi_mac2phy_thread.c \
$(SRCDIR)/framework/workers/nr5g_fapi_phy2mac_thread.c \
+ $(SRCDIR)//framework/workers/nr5g_fapi_urllc_phy2mac_thread.c \
+ $(SRCDIR)//framework/workers/nr5g_fapi_urllc_mac2phy_thread.c \
$(SRCDIR)/framework/nr5g_fapi_framework.c \
$(SRCDIR)/framework/wls/fapi2mac/nr5g_fapi_fapi2mac_wls.c \
$(SRCDIR)/framework/wls/fapi2phy/nr5g_fapi_fapi2phy_wls.c \
$(SRCDIR)/api/fapi2mac/p7/nr5g_fapi_proc_crc_ind.c \
$(SRCDIR)/api/fapi2mac/p7/nr5g_fapi_proc_rach_ind.c \
$(SRCDIR)/api/fapi2mac/p7/nr5g_fapi_proc_rx_data_ind.c \
+ $(SRCDIR)/api/fapi2mac/p7/nr5g_fapi_proc_rx_data_uci_ind.c \
$(SRCDIR)/api/fapi2mac/p7/nr5g_fapi_proc_srs_ind.c \
$(SRCDIR)/api/fapi2mac/p7/nr5g_fapi_proc_uci_ind.c \
+ $(SRCDIR)/api/fapi2mac/p7/nr5g_fapi_proc_vendor_p7_msgs.c \
$(SRCDIR)/api/fapi2phy/nr5g_fapi_fapi2phy_api.c \
+ $(SRCDIR)/api/fapi2phy/p5/nr5g_fapi_proc_add_remove_core_msg.c \
$(SRCDIR)/api/fapi2phy/p5/nr5g_fapi_proc_config_req.c \
+ $(SRCDIR)/api/fapi2phy/p5/nr5g_fapi_proc_param_resp.c \
$(SRCDIR)/api/fapi2phy/p5/nr5g_fapi_proc_start_req.c \
$(SRCDIR)/api/fapi2phy/p5/nr5g_fapi_proc_stop_req.c \
$(SRCDIR)/api/fapi2phy/p5/nr5g_fapi_proc_shutdown_req.c \
$(SRCDIR)/api/fapi2phy/p5/nr5g_fapi_proc_ul_iq_samples_req.c \
$(SRCDIR)/api/fapi2phy/p7/nr5g_fapi_proc_dl_tti_req.c \
$(SRCDIR)/api/fapi2phy/p7/nr5g_fapi_proc_ul_tti_req.c \
+ $(SRCDIR)/api/fapi2phy/p7/nr5g_fapi_proc_tti_req_common.c \
$(SRCDIR)/api/fapi2phy/p7/nr5g_fapi_proc_tx_data_req.c \
$(SRCDIR)/api/fapi2phy/p7/nr5g_fapi_proc_ul_dci_req.c
.PHONY: $(APP)
$(APP): $(DIRLIST) echo_options $(GEN_DEP) $(OBJS)
@echo [LD] $(APP)
- @$(CC) -o $(APP) $(OBJS) $(RTE_LIBS) $(LDFLAGS)
+ @$(CC) -o $(APP) $(OBJS) $(LDFLAGS) $(RTE_LIBS) -lstdc++ # stdc++ flag needed for RTE LIBS
# $(OBJDUMP) -d $(APP) > $(APP).asm
.PHONY : echo_options