Commit 2ba2ecbb authored by Navid Nikaein's avatar Navid Nikaein

further improve the oai build tool

git-svn-id: http://svn.eurecom.fr/openair4G/trunk@5974 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent 1fa29baf
......@@ -333,6 +333,10 @@ check_install_oai_software() {
test_install_package sshfs
test_install_package subversion
test_install_package valgrind
# TODO: install the USRP UHD packages
# uninstall some automatically installed packges
# we need a newer version
# test_uninstall_package libnettle4
......@@ -343,7 +347,6 @@ check_install_oai_software() {
# check_install_freediamter
# fi
fi
if [ $OAI_INSTALLED = 1 ]; then
touch ./.lock_oaibuild
......@@ -371,6 +374,9 @@ check_install_oai_software() {
fi
done
fi
else
echo_info "skip the package installations"
fi
}
......@@ -496,9 +502,7 @@ compile_ltesoftmodem() {
cd $OPENAIR_TARGETS/RT/USER
if [ -f Makefile ]; then
echo "Compiling directives: $SOFTMODEM_DIRECTIVES"
if [ $1 = 1 ]; then
make cleanall > /dev/null 2>&1
fi
make $SOFTMODEM_DIRECTIVES
make -j $NUM_CPU $SOFTMODEM_DIRECTIVES
if [ $? -ne 0 ]; then
......@@ -518,9 +522,7 @@ compile_oaisim() {
cd $OPENAIR_TARGETS/SIMU/USER
if [ -f Makefile ]; then
echo "Compiling for oaisim target ($OAISIM_DIRECTIVES)"
if [ $1 = 1 ]; then
make cleanall > /dev/null
fi
make $OAISIM_DIRECTIVES
make -j $NUM_CPU $OAISIM_DIRECTIVES
if [ $? -ne 0 ]; then
......@@ -540,9 +542,7 @@ compile_unisim() {
cd $OPENAIR1_DIR/SIMULATION/LTE_PHY
if [ -f Makefile ]; then
echo "Compiling for UNISIM target ..."
if [ $1 = 1 ]; then
make cleanall
fi
make -j $NUM_CPU all
if [ $? -ne 0 ]; then
echo_error "Build unisim failed, returning"
......@@ -662,10 +662,6 @@ install_ltesoftmodem() {
else
echo_warning " 8.1 RTAI modules already inserted"
fi
else
if [ $1 = "RT_PREEMPT" ]; then
echo_info " 8.1 setup RT_PREMMPT"
fi
fi
#HW
if [ $2 = "EXMIMO" ]; then
......@@ -736,12 +732,12 @@ print_help(){
echo_success "-b : enables S1 interface for eNB (default enabled)"
echo_success "-c : enables clean OAI build (default disabled)"
echo_success "-d : enables debug mode (default disabled)"
echo_success "-e : sets realtime mode: RTAI, RT_PREEMPT, RT_DISABLED (default RTAI)"
echo_success "-e : sets realtime mode: RTAI, NONE (default NONE)"
echo_success "-m : enables build from the makefile (default disabled)"
echo_success "-r : sets the release: REL8, REL10 (default REL8)"
echo_success "-s : enables OAI sanity check (default disabled)"
echo_success "-t : sets the build target: ALL, SOFTMODEM,OAISIM,UNISIM (default ALL)"
echo_success "-w : sets the hardware platform: EXMIMO, USRP, NONE, (default EXMIMO)"
echo_success "-w : sets the hardware platform: EXMIMO, USRP, ETHERNET NONE, (default EXMIMO)"
echo_success "-x : enables xforms (default disabled)"
echo_success "-z : sets the default build options"
}
......
......@@ -27,7 +27,7 @@
#
################################################################################
# file build_oai.bash
# brief
# brief OAI automated build tool that can be used to install, compile, run OAI.
# author Navid Nikaein
# company Eurecom
# email: navid.nikaein@eurecom.fr
......@@ -92,6 +92,7 @@ while getopts "bcdmsxzhe:w:r:t:" OPTION; do
rm -rf ./.lock_oaibuild
OAI_CLEAN=1
echo "setting clean flag to: $OAI_CLEAN"
echo "check package installation, and recompile OAI"
;;
d)
DEBUG=1
......@@ -138,7 +139,7 @@ while getopts "bcdmsxzhe:w:r:t:" OPTION; do
TARGET="ALL"
ENB_S1=1
REL="REL8"
RT="RTAI"
RT="NONE"
DEBUG=0
ENB_CONFIG_FILE=$OPENAIR_TARGETS/"PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.conf"
OAI_TEST=0
......@@ -152,7 +153,7 @@ done
#####################
# create a bin dir
#####################
echo_info "3. Creating the bin dir ..."
echo_info "1. Creating the bin dir ..."
rm -rf bin
mkdir -m 777 -p bin
......@@ -288,18 +289,20 @@ oaisim_compiled=1
unisim_compiled=1
if [ $TARGET = "ALL" ]; then
echo "############# compile_ltesoftmodem #############"
output=$(compile_ltesoftmodem $OAI_CLEAN )
echo "############# compile_ltesoftmodem #############" >> bin/install_log.txt
output=$(compile_ltesoftmodem >> bin/install_log.txt 2>&1 )
softmodem_compiled=$?
check_for_ltesoftmodem_executable
echo_info "7.1 finished ltesoftmodem target : check the installation log file bin/install_log.txt"
echo "################ compile_oaisim #################"
output=$(compile_oaisim $OAI_CLEAN )
echo "################ compile_oaisim #################" >> bin/install_log.txt
output=$(compile_oaisim >> bin/install_log.txt 2>&1 )
oaisim_compiled=$?
check_for_oaisim_executable
echo_info "7.2 finished oaisim target : check the installation log file bin/install_log.txt"
echo "################## compile_unisim ##################"
output=$(compile_unisim $OAI_CLEAN )
echo "################## compile_unisim ##################" >> bin/install_log.txt
output=$(compile_unisim >> bin/install_log.txt 2>&1 )
unisim_compiled=$?
check_for_dlsim_executable
check_for_ulsim_executable
......@@ -308,24 +311,30 @@ if [ $TARGET = "ALL" ]; then
check_for_pdcchsim_executable
check_for_pbchsim_executable
check_for_mbmssim_executable
echo_info "7.3 finished unisim target : check the installation log file bin/install_log.txt"
else
if [ $TARGET = "SOFTMODEM" ]; then
echo "################ compile_ltesoftmodem #################"
output=$(compile_ltesoftmodem $OAI_CLEAN )
echo "############# compile_ltesoftmodem #############" >> bin/install_log.txt
output=$(compile_ltesoftmodem >> bin/install_log.txt 2>&1 )
softmodem_compiled=$?
check_for_ltesoftmodem_executable
echo_info "7.1 finished ltesoftmodem target: check the installation log file bin/install_log.txt"
fi
if [ $TARGET = "OAISIM" ]; then
echo "################ compile_oaisim ###############"
output=$(compile_oaisim $OAI_CLEAN )
echo "################ compile_oaisim #################" >> bin/install_log.txt
output=$(compile_oaisim >> bin/install_log.txt 2>&1 )
oaisim_compiled=$?
check_for_oaisim_executable
echo_info "7.2 finished oaisim target: check the installation log file bin/install_log.txt"
fi
if [ $TARGET = "UNISIM" ]; then
echo "################ compile_unisim ###############"
output=$(compile_unisim $OAI_CLEAN )
echo "################## compile_unisim ##################" >> bin/install_log.txt
output=$(compile_unisim >> bin/install_log.txt 2>&1 )
unisim_compiled=$?
check_for_dlsim_executable
check_for_ulsim_executable
......@@ -334,6 +343,8 @@ else
check_for_pdcchsim_executable
check_for_pbchsim_executable
check_for_mbmssim_executable
echo_info "7.3 finished unisim target: check the installation log file bin/install_log.txt"
fi
fi
......@@ -345,33 +356,39 @@ fi
echo_info "8. Installing ..."
if [ $softmodem_compiled = 0 ]; then
echo_success "target lte-softmodem built "
echo "target lte-softmodem built " >> bin/${oai_build_date}
echo_success "target lte-softmodem built and installed in the bin directory"
echo "target lte-softmodem built and installed in the bin directory" >> bin/${oai_build_date}
output=$(install_ltesoftmodem $RT $HW $ENB_S1 )
fi
if [ $oaisim_compiled = 0 ]; then
echo_success "target oaisim built "
echo "target oaisim built " >> bin/${oai_build_date}
echo_success "target oaisim built and installed in the bin directory"
echo "target oaisim built and installed in the bin directory" >> bin/${oai_build_date}
output=$(install_oaisim $ENB_S1 )
fi
if [ $unisim_compiled = 0 ]; then
echo_success "target unisim built "
echo "target unisim built " >> bin/${oai_build_date}
echo_success "target unisim built and installed in the bin directory"
echo "target unisim built and installed in the bin directory" >> bin/${oai_build_date}
fi
echo_info "build terminated, binaries are located in bin/"
echo_info "build terminated, logs are located in bin/${oai_build_date}"
echo_info "build terminated, logs are located in bin/${oai_build_date} and bin/install_log.txt"
############################################
# testing
############################################
if [ $OAI_TEST = 1 ]; then
echo_info "9. Testing ..."
echo_info "10. Testing ..."
python $OPENAIR_TARGETS/TEST/OAI/test01.py
else
echo_info "9. Bypassing the Tests ..."
fi
############################################
# run
############################################
echo_info "10. Running ... To be done"
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