Commit 306b4974 authored by Robert Schmidt's avatar Robert Schmidt

Simplify build_oai

parent 5f58ccb5
......@@ -37,8 +37,7 @@ set_openair_env
gen_nvram_path=$OPENAIR_DIR/cmake_targets/ran_build/build
conf_nvram_path=$OPENAIR_DIR/openair3/NAS/TOOLS/ue_eurecom_test_sfr.conf
HW="None"
TP="None"
HW=""
VERBOSE_CI=0
VERBOSE_COMPILE=0
RUN_GROUP=0
......@@ -49,7 +48,7 @@ DISABLE_HARDWARE_DEPENDENCY="False"
CMAKE_BUILD_TYPE="RelWithDebInfo"
CMAKE_CMD="$CMAKE"
OPTIONAL_LIBRARIES="telnetsrv enbscope uescope nrscope nrqtscope ldpc_cuda ldpc_t1 websrv oai_iqplayer"
RU=0
TARGET_LIST=""
function print_help() {
echo_info "
......@@ -226,22 +225,27 @@ function main() {
shift;;
--eNB)
eNB=1
TARGET_LIST="$TARGET_LIST lte-softmodem"
echo_info "Will compile eNB"
shift;;
--gNB)
gNB=1
TARGET_LIST="$TARGET_LIST nr-softmodem nr-cuup"
echo_info "Will compile gNB"
shift;;
--RU)
RU=1
TARGET_LIST="$TARGET_LIST oairu"
echo_info "Will compile RRU"
shift;;
--UE)
UE=1
TARGET_LIST="$TARGET_LIST lte-uesoftmodem"
echo_info "Will compile UE"
shift;;
--nrUE)
nrUE=1
TARGET_LIST="$TARGET_LIST nr-uesoftmodem"
echo_info "Will compile NR UE"
shift;;
--mu)
......@@ -255,38 +259,48 @@ function main() {
gen_nvram_path=$(readlink -f "$2")
shift 2;;
--UE-ip)
UE_ip=1
echo_info "Will compile UE"
TARGET_LIST="$TARGET_LIST ue_ip"
shift;;
-w | --hardware)
# Use OAI_USRP as the key word USRP is used inside UHD driver
case "$2" in
"USRP" | "BLADERF" | "LMSSDR" | "IRIS" | "SIMU" | "AW2SORI")
"USRP" | "BLADERF" | "LMSSDR" | "IRIS" | "SIMU")
HW="OAI_"$2
TARGET_LIST="$TARGET_LIST oai_${2,,}devif" # ,, makes lowercase
CMAKE_CMD="$CMAKE_CMD -DOAI_$2=ON"
;;
"AW2SORI")
HW="OAI_"$2
TARGET_LIST="$TARGET_LIST aw2sori_transpro"
CMAKE_CMD="$CMAKE_CMD -DOAI_$2=ON"
;;
"None")
HW="None"
;;
*)
echo_fatal "Unknown HW type $2: exit..."
echo_fatal "Unknown hardware type $2: exit..."
;;
esac
shift 2;;
-t | --transport)
case "$2" in
"Ethernet" | "benetel4g" | "benetel5g")
TP=$2
"Ethernet")
TARGET_LIST="$TARGET_LIST oai_eth_transpro"
CMAKE_CMD="$CMAKE_CMD -DOAI_${2^^}=ON" # ^^ makes uppercase
;;
"benetel4g" | "benetel5g")
TARGET_LIST="$TARGET_LIST $2"
CMAKE_CMD="$CMAKE_CMD -DOAI_${2^^}=ON" # ^^ makes uppercase
;;
"None")
HW="None"
;;
*)
echo_fatal "Unknown TP type $2; exit..."
echo_fatal "Unknown transport type $2; exit..."
;;
esac
shift 2;;
-P | --phy_simulators)
SIMUS_PHY=1
# TODO: fix: dlsim_tm4 pucchsim prachsim pdcchsim pbchsim mbmssim
TARGET_LIST="$TARGET_LIST dlsim ulsim ldpctest polartest smallblocktest nr_pbchsim nr_dlschsim nr_ulschsim nr_dlsim nr_ulsim nr_pucchsim nr_prachsim"
echo_info "Will compile dlsim, ulsim, ..."
shift;;
-s | --check)
......@@ -347,26 +361,19 @@ function main() {
echo_info "Enabling build eclipse project support"
shift 1;;
--build-lib)
BUILD_OPTLIB=""
if [ "$2" == "all" ] ; then
BUILD_OPTLIB="$OPTIONAL_LIBRARIES"
TARGET_LIST="$TARGET_LIST $OPTIONAL_LIBRARIES"
for lib in $OPTIONAL_LIBRARIES; do CMAKE_CMD="$CMAKE_CMD -DENABLE_${lib^^}=ON"; done
echo_info "Enabling build of all optional shared libraries ($OPTIONAL_LIBRARIES)"
else
for alib in $2 ; do
for oklib in $OPTIONAL_LIBRARIES ; do
if [ "$alib" = "$oklib" ] ; then
BUILD_OPTLIB="$BUILD_OPTLIB $alib"
echo_info "Enabling build of lib${alib}.so"
fi
done
for reqlib in $2; do
lib=$(echo $OPTIONAL_LIBRARIES | tr ' ' '\n' | grep -w $reqlib) # search given parameter in list
[[ $? -ne 0 ]] && echo_fatal "Unknown optional library in $reqlib, valid libraries are $OPTIONAL_LIBRARIES"
TARGET_LIST="$TARGET_LIST $lib" # will append the found library
CMAKE_CMD="$CMAKE_CMD -DENABLE_${lib^^}=ON"
echo_info "Enabling build of optional shared library $lib"
done
if [ "${BUILD_OPTLIB## }" != "$2" ] ; then
echo_fatal "Unknown optional library in $2, valid libraries are $OPTIONAL_LIBRARIES"
fi
fi
for oklib in $BUILD_OPTLIB ; do
CMAKE_CMD="$CMAKE_CMD -DENABLE_${oklib^^}=ON"
done
shift 2;;
--noavx512)
CMAKE_CMD="$CMAKE_CMD -DAVX512=OFF"
......@@ -444,96 +451,46 @@ function main() {
check_install_additional_tools
fi
execlist=""
[[ "$eNB" == "1" ]] && execlist="$execlist lte-softmodem"
[[ "$gNB" == "1" ]] && execlist="$execlist nr-softmodem nr-cuup"
[[ "$RU" == "1" ]] && execlist="$execlist oairu"
[[ "$UE" == 1 ]] && execlist="$execlist lte-uesoftmodem"
[[ "$nrUE" == 1 ]] && execlist="$execlist nr-uesoftmodem"
# TODO: fix: dlsim_tm4 pucchsim prachsim pdcchsim pbchsim mbmssim
[[ "$SIMUS_PHY" == "1" ]] && execlist="$execlist dlsim ulsim ldpctest polartest smallblocktest nr_pbchsim nr_dlschsim nr_ulschsim nr_dlsim nr_ulsim nr_pucchsim nr_prachsim"
[[ "$BUILD_OPTLIB" != "" ]] && execlist="$execlist $BUILD_OPTLIB"
[[ "$execlist" != "" ]] && execlist="$execlist params_libconfig coding rfsimulator"
DIR=$OPENAIR_DIR/cmake_targets
[ "$CLEAN" = "1" ] && rm -rf $DIR/$BUILD_DIR/build
mkdir -p $DIR/$BUILD_DIR/build
cd $DIR/$BUILD_DIR/build
# for historical reasons we build in a subdirectory cmake_targets/XYZ/build,
# e.g., cmake_targets/ran_build/build, hence the ../../..
CMAKE_CMD="$CMAKE_CMD ../../.."
echo_info "Running \"$CMAKE_CMD\""
eval $CMAKE_CMD
if [[ "$execlist" != "" ]]; then
compilations $BUILD_DIR all.txt $execlist
fi
if [ "$UE" = 1 ] ; then
echo_info "Compiling UE specific part"
if [[ $TARGET_LIST != "" ]]; then
# add some default libraries that should always be built
# for eNB, gNB, UEs, simulators
if [[ $gNB == 1 || $eNB == 1 || $UE == 1 || $nrUE == 1 || $SIMUS_PHY == 1 || $RU == 1 ]]; then
TARGET_LIST="$TARGET_LIST params_libconfig coding rfsimulator dfts"
fi
if [ "$UE_ip" = 1 ]
then
echo_info "Building ue_ip module"
compilations $BUILD_DIR ue_ip.txt ue_ip
else
echo_info "Bypassing ue_ip build"
fi #IS_CONTAINER
mkdir -p $DIR/$BUILD_DIR/build
cd $DIR/$BUILD_DIR/build
# mkdir -p $DIR/at_commands/build
# cd $DIR/at_commands/build
# eval $CMAKE_CMD
# compilations at_commands at_nas_ue
# for historical reasons we build in a subdirectory cmake_targets/XYZ/build,
# e.g., cmake_targets/ran_build/build, hence the ../../..
CMAKE_CMD="$CMAKE_CMD ../../.."
echo_info "Running \"$CMAKE_CMD\""
eval $CMAKE_CMD
compilations $BUILD_DIR all.txt $TARGET_LIST
[ "$CLEAN" = "1" ] && rm -rf $DIR/nas_sim_tools/build
mkdir -p $DIR/nas_sim_tools/build
cd $DIR/nas_sim_tools/build
if [ "$UE" = 1 ] ; then
eval $CMAKE_CMD ..
compilations nas_sim_tools usim.txt usim
compilations nas_sim_tools nvram.txt nvram
compilations nas_sim_tools conf2uedata.txt conf2uedata
echo_info "Compiling UE specific part"
# generate USIM data
if [ -f conf2uedata ]; then
install_nas_tools $conf_nvram_path $DIR/$BUILD_DIR/build "$DIR/$BUILD_DIR/build/conf2uedata.txt"
else
echo_warning "not generated UE NAS files: binaries not found"
fi
fi
[ "$CLEAN" = "1" ] && rm -rf $DIR/nas_sim_tools/build
mkdir -p $DIR/nas_sim_tools/build
cd $DIR/nas_sim_tools/build
####################################################
# Build RF device and transport protocol libraries #
####################################################
if [ "$HW" != "None" ] ; then
if [ "$HW" == "OAI_USRP" ] ; then
compilations $BUILD_DIR oai_usrpdevif.txt oai_usrpdevif
elif [ "$HW" == "OAI_BLADERF" ] ; then
compilations $BUILD_DIR oai_bladerfdevif.txt oai_bladerfdevif
elif [ "$HW" == "OAI_LMSSDR" ] ; then
compilations $BUILD_DIR oai_lmssdrdevif.txt oai_lmssdrdevif
elif [ "$HW" == "OAI_IRIS" ] ; then
compilations $BUILD_DIR oai_irisdevif.txt oai_irisdevif
elif [ "$HW" == "OAI_AW2SORI" ] ; then
compilations $BUILD_DIR aw2sori_transpro.txt aw2sori_transpro
else
echo_fatal "illegal HW option $HW"
fi
fi
eval $CMAKE_CMD ..
compilations nas_sim_tools usim.txt usim
compilations nas_sim_tools nvram.txt nvram
compilations nas_sim_tools conf2uedata.txt conf2uedata
if [ "$TP" != "None" ]; then
if [ "$TP" == "Ethernet" ]; then
compilations $BUILD_DIR oai_eth_transpro.txt oai_eth_transpro
elif [ "$TP" == "benetel4g" ]; then
compilations $BUILD_DIR benetel_4g.txt benetel4g
elif [ "$TP" == "benetel5g" ]; then
compilations $BUILD_DIR benetel_5g.txt benetel_5g
else
echo_fatal "illegal TP option $TP"
# generate USIM data
if [ -f conf2uedata ]; then
install_nas_tools $conf_nvram_path $DIR/$BUILD_DIR/build "$DIR/$BUILD_DIR/build/conf2uedata.txt"
else
echo_warning "not generated UE NAS files: binaries not found"
fi
fi
fi
......
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