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