Commit a85c64c3 authored by aikaterini.trilyraki's avatar aikaterini.trilyraki

build_oai script and cmake updated - rf device and transport protocol...

build_oai script and cmake updated - rf device and transport protocol libraries are dynamically linked Note: EXMIMO not supported yet (even though compilation is successful)
parent 40d63869
This diff is collapsed.
...@@ -46,7 +46,8 @@ XFORMS="False" ...@@ -46,7 +46,8 @@ XFORMS="False"
PRINT_STATS="False" PRINT_STATS="False"
VCD_TIMING="False" VCD_TIMING="False"
REL="Rel10" REL="Rel10"
HW="EXMIMO" HW="NO_VALUE"
TP="NO_VALUE"
NOS1=0 NOS1=0
EPC=0 EPC=0
VERBOSE_COMPILE=0 VERBOSE_COMPILE=0
...@@ -88,10 +89,13 @@ Options ...@@ -88,10 +89,13 @@ Options
default is Rel10, default is Rel10,
Rel8 limits the implementation to 3GPP Release 8 version Rel8 limits the implementation to 3GPP Release 8 version
-w | --hardware -w | --hardware
EXMIMO (Default), USRP, BLADERF, ETHERNET, None EXMIMO, USRP, BLADERF
Adds this RF board support (in external packages installation and in compilation) Adds this RF board support (in external packages installation and in compilation)
-t | --transport protocol
ETHERNET , None
Adds this trasport protocol support in compilation
--oaisim --oaisim
Makes the oaisim simulator. Hardware will be defaulted to "NONE". Makes the oaisim simulator. Hardware will be defaulted to "NO_VALUE".
--phy_simulators --phy_simulators
Makes the unitary tests Layer 1 simulators Makes the unitary tests Layer 1 simulators
--core_simulators --core_simulators
...@@ -169,7 +173,7 @@ function main() { ...@@ -169,7 +173,7 @@ function main() {
shift;; shift;;
-r | --3gpp-release) -r | --3gpp-release)
REL=$2 REL=$2
echo_info "setting release to: $REL" echo_info "Setting release to: $REL"
shift 2;; shift 2;;
-w | --hardware) -w | --hardware)
HW="$2" #"${i#*=}" HW="$2" #"${i#*=}"
...@@ -180,7 +184,11 @@ function main() { ...@@ -180,7 +184,11 @@ function main() {
if [ "$HW" == "BLADERF" ] ; then if [ "$HW" == "BLADERF" ] ; then
HW="OAI_BLADERF" HW="OAI_BLADERF"
fi fi
echo_info "setting hardware to: $HW" echo_info "Setting hardware to: $HW"
shift 2;;
-t | --transport_protocol)
TP="$2" #"${i#*=}"
echo_info "Setting transport protocol to: $TP"
shift 2;; shift 2;;
--oaisim) --oaisim)
oaisim=1 oaisim=1
...@@ -204,7 +212,7 @@ function main() { ...@@ -204,7 +212,7 @@ function main() {
echo_info "executing test cases only in group: $TEST_CASE_GROUP" echo_info "executing test cases only in group: $TEST_CASE_GROUP"
shift 2;; shift 2;;
-V | --vcd) -V | --vcd)
echo_info "setting gtk-wave output" echo_info "Setting gtk-wave output"
VCD_TIMING=1 VCD_TIMING=1
EXE_ARGUMENTS="$EXE_ARGUMENTS -V" EXE_ARGUMENTS="$EXE_ARGUMENTS -V"
shift;; shift;;
...@@ -227,7 +235,7 @@ function main() { ...@@ -227,7 +235,7 @@ function main() {
shift;; shift;;
--cflags_processor) --cflags_processor)
CFLAGS_PROCESSOR_USER=$2 CFLAGS_PROCESSOR_USER=$2
echo_info "setting CPU FLAGS from USER to: $CFLAGS_PROCESSOR_USER" echo_info "Setting CPU FLAGS from USER to: $CFLAGS_PROCESSOR_USER"
shift 2;; shift 2;;
-h | --help) -h | --help)
print_help print_help
...@@ -238,6 +246,35 @@ function main() { ...@@ -238,6 +246,35 @@ function main() {
break;; break;;
esac esac
done done
############################################
# check validity of HW and TP parameters for RRH and eNB
#############################################
if [ "$eNB" = "1" ] ; then
if [ "$HW" = "NO_VALUE" -a "$TP" = "NO_VALUE" ] ; then
echo_fatal "A hardware target or a transport protocol must be defined!!"
fi
if [ "$HW" != "NO_VALUE" -a "$TP" != "NO_VALUE" ] ; then
echo_fatal "Currentlt lte-softmodem can not support simultaniously local and remote RF heads!!"
fi
if [ "$HW" = "NO_VALUE" ] ; then
echo_info "No RF device has been selected: (HW=$HW)"
fi
if [ "$TP" = "NO_VALUE" ] ; then
echo_info "No transport protocol has been selected: (TP=$TP)"
fi
fi
if [ "$RRH" = "1" ] ; then
if [ "$TP" = "NO_VALUE" ] ; then
echo_fatal "A transport protocol must be defined!!"
fi
if [ "$HW" = "NO_VALUE" ] ; then
echo_info "No RF device has been selected: (HW=$HW)"
fi
fi
############################################ ############################################
# setting and printing OAI envs, we should check here # setting and printing OAI envs, we should check here
...@@ -277,7 +314,7 @@ function main() { ...@@ -277,7 +314,7 @@ function main() {
check_install_usrp_uhd_driver check_install_usrp_uhd_driver
fi fi
if [ "$HW" == "OAI_BLADERF" ] ; then if [ "$HW" == "OAI_BLADERF" ] ; then
echo_info "installing packages for BALDERF support" echo_info "installing packages for BLADERF support"
check_install_bladerf_driver check_install_bladerf_driver
fi fi
fi fi
...@@ -288,16 +325,18 @@ function main() { ...@@ -288,16 +325,18 @@ function main() {
fi fi
if [ "$oaisim" = "1" ] ; then if [ "$oaisim" = "1" ] ; then
if [ "$HW" != "ETHERNET" ] ; then # if [ "$HW" == "ETHERNET" ] ; then # to ask
HW="NONE" # HW="NONE"
fi #fi
if [ $HW != "EXMIMO" -a $HW != "OAI_USRP" -a $HW != "OAI_BLADERF" ] ; then
HW="NO_VALUE"
fi
if [ "$XFORMS" == "True" ] ; then if [ "$XFORMS" == "True" ] ; then
PRINT_STATS="True" PRINT_STATS="True"
fi fi
fi fi
echo_info "3. building the compilation directives ..."
echo_info "3. building the compilation directives ..."
DIR=$OPENAIR_DIR/cmake_targets DIR=$OPENAIR_DIR/cmake_targets
if [ "$NOS1" = "1" ] ; then if [ "$NOS1" = "1" ] ; then
...@@ -324,7 +363,9 @@ function main() { ...@@ -324,7 +363,9 @@ function main() {
echo "set ( RRC_ASN1_VERSION \"${REL}\")" >> $cmake_file echo "set ( RRC_ASN1_VERSION \"${REL}\")" >> $cmake_file
echo "set ( ENABLE_VCD_FIFO $VCD_TIMING )" >> $cmake_file echo "set ( ENABLE_VCD_FIFO $VCD_TIMING )" >> $cmake_file
echo "set ( RF_BOARD \"${HW}\")" >> $cmake_file echo "set ( RF_BOARD \"${HW}\")" >> $cmake_file
echo "set(PACKAGE_NAME \"${lte_exec}\")" >> $cmake_file echo "set ( TRANSP_PRO \"${TP}\")" >> $cmake_file
echo "set ( SHRLIBDEV ${SHRLIBDEV})" >> $cmake_file
echo "set(PACKAGE_NAME \"${lte_exec}\")" >> $cmake_file
echo 'include(${CMAKE_CURRENT_SOURCE_DIR}/../CMakeLists.txt)' >> $cmake_file echo 'include(${CMAKE_CURRENT_SOURCE_DIR}/../CMakeLists.txt)' >> $cmake_file
cd $DIR/$lte_build_dir/build cd $DIR/$lte_build_dir/build
cmake .. cmake ..
...@@ -529,30 +570,86 @@ function main() { ...@@ -529,30 +570,86 @@ function main() {
fi fi
# RRH compilation # RRH compilation
################## #####################
if [ "$RRH" = "1" ] ; then if [ "$RRH" = "1" ] ; then
echo_info "Compiling RRH" rrh_exec=rrh_gw
if [ $HW == "ETHERNET" ] ; then rrh_build_dir=rrh_gw
echo_info "RF frontend for RRH is not defined. This mode is used for testing (loopback)."
elif [ $HW != "EXMIMO" -a $HW != "OAI_USRP" -a $HW != "OAI_BLADERF" ] ; then echo_info "Compiling $rrh_exec ..."
echo_fatal "Hardware not defined ($HW)"
fi cmake_file=$DIR/$rrh_build_dir/CMakeLists.txt
cmake_file=$DIR/rrh_gw/CMakeLists.txt echo "cmake_minimum_required(VERSION 2.8)" > $cmake_file
echo "cmake_minimum_required(VERSION 2.8)" > $cmake_file echo "set(ENABLE_VCD_FIFO $VCD_TIMING )" >> $cmake_file
echo "set(ENABLE_VCD_FIFO $VCD_TIMING )" >> $cmake_file echo "set(ENABLE_ITTI False )" >> $cmake_file
echo "set(ENABLE_ITTI False )" >> $cmake_file echo "set(RF_BOARD \"${HW}\")" >> $cmake_file
echo "set(RF_BOARD \"${HW}\")" >> $cmake_file echo "set(TRANSP_PRO \"${TP}\")" >> $cmake_file
echo 'set(PACKAGE_NAME "\"rrh_gw\"")' >> $cmake_file echo "set(SHRLIBDEV ${SHRLIBDEV})" >> $cmake_file
echo 'include(${CMAKE_CURRENT_SOURCE_DIR}/../CMakeLists.txt)' >> $cmake_file echo 'set(PACKAGE_NAME "\"rrh_gw\"")' >> $cmake_file
echo 'include(${CMAKE_CURRENT_SOURCE_DIR}/../CMakeLists.txt)' >> $cmake_file
[ "$CLEAN" = "1" ] && rm -rf $DIR/rrh_gw/build [ "$CLEAN" = "1" ] && rm -rf $DIR/rrh_gw/build
mkdir -p $DIR/rrh_gw/build mkdir -p $DIR/$rrh_build_dir/build
cd $DIR/rrh_gw/build cd $DIR/$rrh_build_dir/build
cmake .. cmake ..
compilations \ compilations \
rrh_gw rrh_gw \ rrh_gw rrh_gw \
rrh_gw $dbin/rrh_gw rrh_gw $dbin/rrh_gw
fi fi
# build RF device and transport protocol libraries
#####################################
if [ "$eNB" = "1" -o "$RRH" = "1" ] ; then
if [ "$eNB" = "1" ] ; then
build_dir=$lte_build_dir
else
build_dir=$rrh_build_dir
fi
# build RF device libraries (currently EXMIMO is not complied with the rest of HW targets)
if [ "$HW" != "NO_VALUE" ] ; then
rm -f liboai_device.so
if [ -d "/usr/include/uhd" ] ; then
compilations \
$build_dir oai_usrpdevif \
liboai_usrpdevif.so $dbin/liboai_usrpdevif.so.$REL
fi
if [ -f "/usr/include/libbladeRF.h" ] ; then
compilations \
$build_dir oai_bladerfdevif \
liboai_bladerfdevif.so $dbin/liboai_bladerfdevif.so.$REL
fi
#add exmimo compilation
if [ "$HW" == "EXMIMO" ] ; then
ln -s liboai_exmimodevif.so liboai_device.so
echo_info "liboai_device.so is linked to EXMIMO device library"
elif [ "$HW" == "OAI_USRP" ] ; then
ln -s liboai_usrpdevif.so liboai_device.so
echo_info "liboai_device.so is linked to USRP device library"
elif [ "$HW" == "OAI_BLADERF" ] ; then
ln -s liboai_bladerfdevif.so liboai_device.so
echo_info "liboai_device.so is linked to BLADERF device library"
else
echo_info "liboai_device.so is not linked to any device library"
fi
fi
# build trasport protocol libraries (currently only ETHERNET is available)
if [ "$TP" != "NO_VALUE" ] ; then
rm -f liboai_transpro.so
compilations \
$build_dir oai_eth_transpro \
liboai_eth_transpro.so $dbin/liboai_eth_transpro.so.$REL
if [ "$TP" == "ETHERNET" ] ; then
ln -s liboai_eth_transpro.so liboai_transpro.so
echo_info "liboai_transpro.so is linked with ETHERNET library"
fi
fi
fi
# EPC compilation # EPC compilation
################## ##################
......
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