further improve the oai build tool
git-svn-id: http://svn.eurecom.fr/openair4G/trunk@5974 818b1a75-f10b-46b9-bf7c-635c3b92a50f
This commit is contained in:
+32
-36
@@ -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,35 +347,37 @@ check_install_oai_software() {
|
||||
# check_install_freediamter
|
||||
# fi
|
||||
|
||||
fi
|
||||
|
||||
if [ $OAI_INSTALLED = 1 ]; then
|
||||
touch ./.lock_oaibuild
|
||||
fi
|
||||
|
||||
if [ $OAI_INSTALLED = 1 ]; then
|
||||
touch ./.lock_oaibuild
|
||||
fi
|
||||
|
||||
# echo_success "freediameter is installed"
|
||||
# check_s6a_certificate
|
||||
|
||||
|
||||
test_command_install_script "asn1c" "$OPENAIRCN_DIR/SCRIPTS/install_asn1c_0.9.24.modified.bash $SUDO"
|
||||
test_command_install_script "asn1c" "$OPENAIRCN_DIR/SCRIPTS/install_asn1c_0.9.24.modified.bash $SUDO"
|
||||
|
||||
# One mor check about version of asn1c
|
||||
ASN1C_COMPILER_REQUIRED_VERSION_MESSAGE="ASN.1 Compiler, v0.9.24"
|
||||
ASN1C_COMPILER_VERSION_MESSAGE=`asn1c -h 2>&1 | grep -i ASN\.1\ Compiler`
|
||||
ASN1C_COMPILER_REQUIRED_VERSION_MESSAGE="ASN.1 Compiler, v0.9.24"
|
||||
ASN1C_COMPILER_VERSION_MESSAGE=`asn1c -h 2>&1 | grep -i ASN\.1\ Compiler`
|
||||
##ASN1C_COMPILER_VERSION_MESSAGE=`trim $ASN1C_COMPILER_VERSION_MESSAGE`
|
||||
if [ "$ASN1C_COMPILER_VERSION_MESSAGE" != "$ASN1C_COMPILER_REQUIRED_VERSION_MESSAGE" ]; then
|
||||
if [ "$ASN1C_COMPILER_VERSION_MESSAGE" != "$ASN1C_COMPILER_REQUIRED_VERSION_MESSAGE" ]; then
|
||||
# diff <(echo -n "$ASN1C_COMPILER_VERSION_MESSAGE") <(echo -n "$ASN1C_COMPILER_REQUIRED_VERSION_MESSAGE")
|
||||
echo_error "Version of asn1c is not the required one, do you want to install the required one (overwrite installation) ? (Y/n)"
|
||||
echo_error "$ASN1C_COMPILER_VERSION_MESSAGE"
|
||||
while read -r -n 1 -s answer; do
|
||||
if [[ $answer = [YyNn] ]]; then
|
||||
[[ $answer = [Yy] ]] && $OPENAIRCN_DIR/SCRIPTS/install_asn1c_0.9.24.modified.bash $SUDO
|
||||
[[ $answer = [Nn] ]] && echo_error "Version of asn1c is not the required one, exiting." && exit 1
|
||||
break
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
echo_error "Version of asn1c is not the required one, do you want to install the required one (overwrite installation) ? (Y/n)"
|
||||
echo_error "$ASN1C_COMPILER_VERSION_MESSAGE"
|
||||
while read -r -n 1 -s answer; do
|
||||
if [[ $answer = [YyNn] ]]; then
|
||||
[[ $answer = [Yy] ]] && $OPENAIRCN_DIR/SCRIPTS/install_asn1c_0.9.24.modified.bash $SUDO
|
||||
[[ $answer = [Nn] ]] && echo_error "Version of asn1c is not the required one, exiting." && exit 1
|
||||
break
|
||||
fi
|
||||
done
|
||||
fi
|
||||
else
|
||||
echo_info "skip the package installations"
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
check_install_hss_software() {
|
||||
@@ -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 cleanall > /dev/null 2>&1
|
||||
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 cleanall > /dev/null
|
||||
make $OAISIM_DIRECTIVES
|
||||
make -j $NUM_CPU $OAISIM_DIRECTIVES
|
||||
if [ $? -ne 0 ]; then
|
||||
@@ -540,10 +542,8 @@ 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
|
||||
make cleanall
|
||||
make -j $NUM_CPU all
|
||||
if [ $? -ne 0 ]; then
|
||||
echo_error "Build unisim failed, returning"
|
||||
return 1
|
||||
@@ -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"
|
||||
}
|
||||
|
||||
+45
-28
@@ -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 "################ compile_oaisim #################"
|
||||
output=$(compile_oaisim $OAI_CLEAN )
|
||||
echo_info "7.1 finished ltesoftmodem target : check the installation log file bin/install_log.txt"
|
||||
|
||||
echo "################ compile_oaisim #################" >> bin/install_log.txt
|
||||
output=$(compile_oaisim >> bin/install_log.txt 2>&1 )
|
||||
oaisim_compiled=$?
|
||||
check_for_oaisim_executable
|
||||
|
||||
echo "################## compile_unisim ##################"
|
||||
output=$(compile_unisim $OAI_CLEAN )
|
||||
echo_info "7.2 finished oaisim target : check the installation log file bin/install_log.txt"
|
||||
|
||||
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"
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user