Commit 91e57c8a authored by Cedric Roux's avatar Cedric Roux

fully integrate the T into build_oai/CMake

The unit simulators may still need some checks.
parent fb674653
......@@ -212,6 +212,7 @@ add_boolean_option(TEST_OMG False "???")
add_boolean_option(DEBUG_OMG False "???")
add_boolean_option(XFORMS False "This adds the possibility to see the signal oscilloscope")
add_boolean_option(PRINT_STATS False "This adds the possibility to see the status")
add_boolean_option(T_TRACER False "Activate the T tracer, a debugging/monitoring framework" )
add_boolean_option(DEBUG_CONSOLE False "makes debugging easier, disables stdout/stderr buffering")
......@@ -1484,13 +1485,36 @@ endif (${XFORMS})
set(CMAKE_MODULE_PATH "${OPENAIR_DIR}/cmake_targets/tools/MODULES" "${CMAKE_MODULE_PATH}")
#add the T tracer
add_boolean_option(T_TRACER True "Activate the T tracer" )
#include T directory even if the T is off because T macros are in the code
#no matter what
include_directories("${OPENAIR_DIR}/common/utils/T")
set(T_SOURCE
if (${T_TRACER})
set(T_SOURCE
${OPENAIR_DIR}/common/utils/T/T.c
${OPENAIR_DIR}/common/utils/T/local_tracer.c)
set (T_LIB "-lrt")
set (T_LIB "rt")
endif (${T_TRACER})
#Some files in the T directory are generated.
#This rule and the following deal with it.
add_custom_command (
OUTPUT ${OPENAIR_DIR}/common/utils/T/T_IDs.h
COMMAND make
WORKING_DIRECTORY ${OPENAIR_DIR}/common/utils/T
DEPENDS ${OPENAIR_DIR}/common/utils/T/T_messages.txt
)
#This rule is specifically needed to generate T files
#before anything else in a project that uses the T.
#See below, there are some 'add_dependencies' showing that.
#Basically we create a custom target and we make other
#targets depend on it. That forces cmake to generate
#T files before anything else.
add_custom_target (
generate_T
DEPENDS ${OPENAIR_DIR}/common/utils/T/T_IDs.h
)
# Hack on a test of asn1c version (already dirty)
add_definitions(-DASN1_MINIMUM_VERSION=924)
......@@ -1536,7 +1560,6 @@ target_link_libraries (lte-softmodem ${LIBXML2_LIBRARIES})
target_link_libraries (lte-softmodem pthread m ${CONFIG_LIBRARIES} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} sctp ${option_HW_lib} ${option_TP_lib} ${XFORMS_LIBRARIES} )
target_link_libraries (lte-softmodem ${LIBBOOST_LIBRARIES})
target_link_libraries (lte-softmodem ${LIB_LMS_LIBRARIES})
target_link_libraries (lte-softmodem ${T_LIB})
# lte-softmodem-nos1 is both eNB and UE implementation
......@@ -1573,7 +1596,6 @@ target_link_libraries (lte-softmodem-nos1 ${LIBXML2_LIBRARIES})
target_link_libraries (lte-softmodem-nos1 pthread m ${CONFIG_LIBRARIES} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} ${option_HW_lib} ${option_TP_lib} ${XFORMS_LIBRARIES} )
target_link_libraries (lte-softmodem-nos1 ${LIBBOOST_LIBRARIES})
target_link_libraries (lte-softmodem-nos1 ${LIB_LMS_LIBRARIES})
target_link_libraries (lte-softmodem ${T_LIB})
# rrh
......@@ -1587,6 +1609,7 @@ add_executable(rrh_gw
${OPENAIR_TARGETS}/ARCH/COMMON/common_lib.c
${HW_SOURCE}
${TRANSPORT_SOURCE}
${T_SOURCE}
)
target_include_directories(rrh_gw PRIVATE ${OPENAIR_DIR}/common/utils/itti)
target_link_libraries(rrh_gw
......@@ -1596,6 +1619,7 @@ target_link_libraries(rrh_gw
target_link_libraries (rrh_gw rt pthread m )
target_link_libraries (rrh_gw ${option_HW_lib} ${option_TP_lib} ${LIBBOOST_LIBRARIES} )
target_link_libraries (rrh_gw ${LIB_LMS_LIBRARIES})
target_link_libraries (rrh_gw ${T_LIB})
Message("-- option_HW_lib=${option_HW_lib}")
Message("-- HW_SOURCE=${HW_SOURCE}")
......@@ -1661,6 +1685,7 @@ add_executable(oaisim
${HW_SOURCE}
${TRANSPORT_SOURCE}
${XFORMS_SOURCE}
${T_SOURCE}
)
......@@ -1675,6 +1700,7 @@ target_link_libraries (oaisim pthread m ${CONFIG_LIBRARIES} rt crypt ${CRYPTO_LI
${ATLAS_LIBRARIES} ${XFORMS_LIBRARIES} ${OPENPGM_LIBRARIES})
#Force link with forms, regardless XFORMS option
target_link_libraries (oaisim forms)
target_link_libraries (oaisim ${T_LIB})
......@@ -1713,8 +1739,7 @@ target_link_libraries (oaisim_nos1 pthread m ${CONFIG_LIBRARIES} rt crypt ${CRYP
${ATLAS_LIBRARIES} ${XFORMS_LIBRARIES} ${OPENPGM_LIBRARIES})
#Force link with forms, regardless XFORMS option
target_link_libraries (oaisim_nos1 forms)
target_link_libraries (lte-softmodem ${T_LIB})
target_link_libraries (oaisim_nos1 ${T_LIB})
# Unitary tests for each piece of L1: example, mbmssim is MBMS L1 simulator
#####################################
......@@ -1724,10 +1749,11 @@ foreach(myExe dlsim ulsim pbchsim scansim mbmssim pdcchsim pucchsim prachsim syn
${OPENAIR_BIN_DIR}/messages_xml.h
${OPENAIR1_DIR}/SIMULATION/LTE_PHY/${myExe}.c
${XFORMS_SOURCE}
${T_SOURCE}
)
target_link_libraries (${myExe}
-Wl,--start-group SIMU UTIL SCHED_LIB PHY LFDS ${ITTI_LIB} -Wl,--end-group
pthread m rt ${CONFIG_LIBRARIES} ${ATLAS_LIBRARIES} ${XFORMS_LIBRARIES}
pthread m rt ${CONFIG_LIBRARIES} ${ATLAS_LIBRARIES} ${XFORMS_LIBRARIES} ${T_LIB}
)
endforeach(myExe)
......@@ -1770,8 +1796,23 @@ endforeach(myExe)
#../targets/TEST/PDCP/test_pdcp.c
#../targets/TEST/PDCP/with_rlc/test_pdcp_rlc.c
#ensure that the T header files are generated before targets depending on them
if (${T_TRACER})
add_dependencies(lte-softmodem generate_T)
add_dependencies(lte-softmodem-nos1 generate_T)
add_dependencies(rrh_gw generate_T)
add_dependencies(oaisim generate_T)
add_dependencies(oaisim_nos1 generate_T)
add_dependencies(dlsim generate_T)
add_dependencies(ulsim generate_T)
add_dependencies(pbchsim generate_T)
add_dependencies(scansim generate_T)
add_dependencies(mbmssim generate_T)
add_dependencies(pdcchsim generate_T)
add_dependencies(pucchsim generate_T)
add_dependencies(prachsim generate_T)
add_dependencies(syncsim generate_T)
endif (${T_TRACER})
##################################################
# Generated specific cases is not regular code
......
......@@ -57,6 +57,7 @@ CFLAGS_PROCESSOR_USER=""
RUN_GROUP=0
TEST_CASE_GROUP=""
BUILD_DOXYGEN=0
T_TRACER="False"
trap handle_ctrl_c INT
function print_help() {
......@@ -125,6 +126,8 @@ Options
Disables deadline scheduler of Linux kernel (>=3.14.x).
--enable-deadline
Disables deadline scheduler of Linux kernel (>=3.14.x).
--T-tracer
Enables the T tracer.
Usage (first build):
oaisim (eNB + UE): ./build_oai -I -g --oaisim -x --install-system-files
Eurecom EXMIMO + COTS UE : ./build_oai -I -g --eNB -x --install-system-files
......@@ -263,6 +266,10 @@ function main() {
FORCE_LOWLATENCY_FLAG_USER="True"
echo_info "Enabling the usage of deadline scheduler"
shift 1;;
--T-tracer)
T_TRACER="True"
echo_info "Enabling the T tracer"
shift 1;;
-h | --help)
print_help
exit 1;;
......@@ -421,6 +428,7 @@ function main() {
echo "set ( TRANSP_PRO \"${TP}\")" >> $cmake_file
echo "set(PACKAGE_NAME \"${lte_exec}\")" >> $cmake_file
echo "set (LOWLATENCY \"${LOWLATENCY_FLAG_USER}\" )" >>$cmake_file
echo "set ( T_TRACER $T_TRACER )" >> $cmake_file
echo 'include(${CMAKE_CURRENT_SOURCE_DIR}/../CMakeLists.txt)' >> $cmake_file
cd $DIR/$lte_build_dir/build
cmake ..
......@@ -549,6 +557,7 @@ function main() {
echo "set ( PRINT_STATS $PRINT_STATS )" >> $cmake_file
echo "set ( RRC_ASN1_VERSION \"${REL}\")" >> $cmake_file
echo "set ( ENABLE_VCD_FIFO $VCD_TIMING )" >> $cmake_file
echo "set ( T_TRACER $T_TRACER )" >> $cmake_file
echo 'include(${CMAKE_CURRENT_SOURCE_DIR}/../CMakeLists.txt)' >> $cmake_file
[ "$CLEAN" = "1" ] && rm -rf $DIR/$oaisim_build_dir/build
mkdir -p $DIR/$oaisim_build_dir/build
......@@ -614,6 +623,7 @@ function main() {
echo "set(XFORMS $XFORMS )" >> $cmake_file
echo "set(RRC_ASN1_VERSION \"${REL}\")" >> $cmake_file
echo "set(ENABLE_VCD_FIFO $VCD_TIMING )" >> $cmake_file
echo "set ( T_TRACER $T_TRACER )" >> $cmake_file
echo 'include(${CMAKE_CURRENT_SOURCE_DIR}/../CMakeLists.txt)' >> $cmake_file
#[ "$CLEAN" = "1" ] && rm -rf $DIR/oaisim_mme_build_oai/build
#mkdir -p $DIR/oaisim_mme_build_oai/build
......@@ -643,6 +653,7 @@ function main() {
echo "set(TRANSP_PRO \"${TP}\")" >> $cmake_file
echo 'set(PACKAGE_NAME "\"rrh_gw\"")' >> $cmake_file
echo "set (LOWLATENCY \"${LOWLATENCY_FLAG_USER}\" )" >>$cmake_file
echo "set ( T_TRACER $T_TRACER )" >> $cmake_file
echo 'include(${CMAKE_CURRENT_SOURCE_DIR}/../CMakeLists.txt)' >> $cmake_file
cd $DIR/$rrh_build_dir/build
cmake ..
......
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