From 34801af904f5e819dacdab0f09966c20d4f65a59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Leroy?= Date: Tue, 7 Jun 2016 10:48:48 +0200 Subject: [PATCH 01/24] build_oai: exit early on error There are a lot of case where the build scripts fails. Despite this, the build script happily continue to the end and tells "Successfully built xxxx". This fix ensure the build stops early with the first error message on the bottom of the log. --- cmake_targets/build_oai | 1 + 1 file changed, 1 insertion(+) diff --git a/cmake_targets/build_oai b/cmake_targets/build_oai index d1306b804b..42bd6c82d7 100755 --- a/cmake_targets/build_oai +++ b/cmake_targets/build_oai @@ -33,6 +33,7 @@ # brief OAI automated build tool that can be used to install, compile, run OAI. # author Navid Nikaein, Lionel GAUTHIER, Laurent Thomas +set -e ################################ # include helper functions From 51b5fcd4896ebbcc20fc17ff12ebc5863243993b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Leroy?= Date: Thu, 9 Jun 2016 13:19:45 +0200 Subject: [PATCH 02/24] build_helper: tell where the log will be written in compilations() build_helper exits early on error. compilations() tells where the compilation logs can be found after compiling it. So in case of error, it was never displayed. Add a log info before compiling --- cmake_targets/tools/build_helper | 1 + 1 file changed, 1 insertion(+) diff --git a/cmake_targets/tools/build_helper b/cmake_targets/tools/build_helper index 00f6842ffd..b48f33d282 100755 --- a/cmake_targets/tools/build_helper +++ b/cmake_targets/tools/build_helper @@ -109,6 +109,7 @@ clean_all_files() { compilations() { cd $OPENAIR_DIR/cmake_targets/$1/build + echo_info "Log file for compilation written in: $dlog/$2.$REL.txt" { rm -f $3 if [ "$VERBOSE_COMPILE" == "1" ]; then From 67eb92cda9604c95ce62b6f4230834a31f6ca6b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Leroy?= Date: Mon, 13 Jun 2016 08:50:39 +0200 Subject: [PATCH 03/24] Check if the distribution is supported Thank to Thomas Laurent for refactorize get_distribution_released --- cmake_targets/tools/build_helper | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/cmake_targets/tools/build_helper b/cmake_targets/tools/build_helper index b48f33d282..b5c7a86d71 100755 --- a/cmake_targets/tools/build_helper +++ b/cmake_targets/tools/build_helper @@ -67,7 +67,33 @@ echo_warning() { cecho "$*" $yellow ;} echo_success() { cecho "$*" $green ;} echo_info() { cecho "$*" $blue ;} +######################## +# distribution helpers # +######################## +# This function return a string to identify the distribution we are running +# If we can't check the distribution, it returns "Unknown" +# This function return always true as exit code by design +# Examples: +# Ubuntu16.04 +# Debian8.5 +get_distribution_release() { + local distributor + if distributor=$(lsb_release -si 2>/dev/null) ; then + echo $distributor$(lsb_release -sr) + else + echo Unknown + fi +} + +check_supported_distribution() { + local distribution=$(get_distribution_release) + case "$distribution" in + "Ubuntu16.04") return 0 ;; + "Ubuntu14.04") return 0 ;; + esac + return 1 +} ########################### # Cleaners @@ -231,6 +257,10 @@ check_install_additional_tools (){ } check_install_oai_software() { + if ! check_supported_distribution; then + echo_error "Your distribution $(get_distribution_release) is not supported by oai !" + exit 1 + fi $SUDO apt-get update $SUDO apt-get install -y \ autoconf \ From 1c81ad97b3b4fd6feff6f37ef7a5eca32300669d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Leroy?= Date: Fri, 10 Jun 2016 15:17:23 +0200 Subject: [PATCH 04/24] add missing package software-properties-common This package is needed for the command add-apt-repository --- cmake_targets/tools/build_helper | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cmake_targets/tools/build_helper b/cmake_targets/tools/build_helper index b5c7a86d71..cb5ff0bba0 100755 --- a/cmake_targets/tools/build_helper +++ b/cmake_targets/tools/build_helper @@ -262,6 +262,8 @@ check_install_oai_software() { exit 1 fi $SUDO apt-get update + $SUDO apt install -y software-properties-common + # Now, we can add new repository here if needed $SUDO apt-get install -y \ autoconf \ automake \ From 02d321f9648a1f53b2e058039fdf45d42b896f6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Leroy?= Date: Wed, 15 Jun 2016 08:42:46 +0200 Subject: [PATCH 05/24] fix iperf3 installation for Ubuntu 14.04 --- cmake_targets/tools/build_helper | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cmake_targets/tools/build_helper b/cmake_targets/tools/build_helper index cb5ff0bba0..9ff34c2dd6 100755 --- a/cmake_targets/tools/build_helper +++ b/cmake_targets/tools/build_helper @@ -263,7 +263,12 @@ check_install_oai_software() { fi $SUDO apt-get update $SUDO apt install -y software-properties-common - # Now, we can add new repository here if needed + case "$(get_distribution_release)" in + "Ubuntu14.04") + # For iperf3 + $SUDO add-apt-repository "deb http://archive.ubuntu.com/ubuntu trusty-backports universe" + $SUDO apt-get update + esac $SUDO apt-get install -y \ autoconf \ automake \ From 6b2247f12c03030cbcba344b3bccfd9f49a2ab9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Leroy?= Date: Wed, 15 Jun 2016 12:37:37 +0200 Subject: [PATCH 06/24] build_helper: fix package version according to distribution --- cmake_targets/tools/build_helper | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/cmake_targets/tools/build_helper b/cmake_targets/tools/build_helper index 9ff34c2dd6..938e3fb9cb 100755 --- a/cmake_targets/tools/build_helper +++ b/cmake_targets/tools/build_helper @@ -257,6 +257,7 @@ check_install_additional_tools (){ } check_install_oai_software() { + local specific_packages="" if ! check_supported_distribution; then echo_error "Your distribution $(get_distribution_release) is not supported by oai !" exit 1 @@ -265,11 +266,17 @@ check_install_oai_software() { $SUDO apt install -y software-properties-common case "$(get_distribution_release)" in "Ubuntu14.04") + specific_packages="libtasn1-3-dev" # For iperf3 $SUDO add-apt-repository "deb http://archive.ubuntu.com/ubuntu trusty-backports universe" $SUDO apt-get update + ;; + "Ubuntu16.04") + specific_packages="libtasn1-6-dev" + ;; esac $SUDO apt-get install -y \ + $specific_packages \ autoconf \ automake \ bison \ @@ -310,7 +317,6 @@ check_install_oai_software() { libsctp1 \ libsctp-dev \ libssl-dev \ - libtasn1-3-dev \ libtool \ libusb-1.0-0-dev \ libxml2 \ From 2b98daec1b82cb13e10fb6d81be7fa4b866b8c08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Leroy?= Date: Thu, 9 Jun 2016 09:32:36 +0200 Subject: [PATCH 07/24] build_helper: add missing package in check_install_oai_software --- cmake_targets/tools/build_helper | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cmake_targets/tools/build_helper b/cmake_targets/tools/build_helper index 938e3fb9cb..7c7b792762 100755 --- a/cmake_targets/tools/build_helper +++ b/cmake_targets/tools/build_helper @@ -303,6 +303,7 @@ check_install_oai_software() { libblas3gf \ libblas-dev \ libconfig8-dev \ + libffi-dev \ libforms-bin \ libforms-dev \ libgcrypt11-dev \ @@ -314,6 +315,7 @@ check_install_oai_software() { liboctave-dev \ libpgm-5.1 \ libpgm-dev \ + libpython2.7-dev \ libsctp1 \ libsctp-dev \ libssl-dev \ @@ -333,6 +335,7 @@ check_install_oai_software() { xmlstarlet \ python-pip \ pydb \ + wget \ wvdial \ python-numpy \ sshpass \ From 12c0ec833486f366b2a0c50e6cb1429ba3780379 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Leroy?= Date: Wed, 15 Jun 2016 10:56:11 +0200 Subject: [PATCH 08/24] build_helper: remove libblas3gf for ubuntu 16.04 liblas3gf have been replaced by libblas3 on 16.04 liblas3* will be pulled by libblas-dev, so we don't need to add it to package list --- cmake_targets/tools/build_helper | 1 - 1 file changed, 1 deletion(-) diff --git a/cmake_targets/tools/build_helper b/cmake_targets/tools/build_helper index 7c7b792762..a8284313ca 100755 --- a/cmake_targets/tools/build_helper +++ b/cmake_targets/tools/build_helper @@ -300,7 +300,6 @@ check_install_oai_software() { iptables-dev \ libatlas-base-dev \ libatlas-dev \ - libblas3gf \ libblas-dev \ libconfig8-dev \ libffi-dev \ From 5710c1c3adc19be4f8208bd78c4f84def2d1bc37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Leroy?= Date: Mon, 13 Jun 2016 08:56:59 +0200 Subject: [PATCH 09/24] build_helper: replace dependency on libpgm-5.x.0 in check_install_oai_software libpgm-dev will add the dependency on libpgm 5.2.0 or 5.1.0 automatically according to the ubuntu version --- cmake_targets/tools/build_helper | 1 - 1 file changed, 1 deletion(-) diff --git a/cmake_targets/tools/build_helper b/cmake_targets/tools/build_helper index a8284313ca..3f4a4f17ad 100755 --- a/cmake_targets/tools/build_helper +++ b/cmake_targets/tools/build_helper @@ -312,7 +312,6 @@ check_install_oai_software() { libidn11-dev \ libmysqlclient-dev \ liboctave-dev \ - libpgm-5.1 \ libpgm-dev \ libpython2.7-dev \ libsctp1 \ From 81d96a31105f043a391a9330b4942306d5c2fba8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Leroy?= Date: Thu, 9 Jun 2016 14:08:45 +0200 Subject: [PATCH 10/24] CMakeLists.txt: Add missing check and include for pgm library --- cmake_targets/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake_targets/CMakeLists.txt b/cmake_targets/CMakeLists.txt index c23b0d1a91..379b213e27 100644 --- a/cmake_targets/CMakeLists.txt +++ b/cmake_targets/CMakeLists.txt @@ -1518,7 +1518,7 @@ if (${RF_BOARD} STREQUAL "OAI_USRP") include_directories(${LIBBOOST_INCLUDE_DIR}) endif (${RF_BOARD} STREQUAL "OAI_USRP") -pkg_search_module(OPENPGM openpgm-5.1) +pkg_search_module(OPENPGM openpgm-5.1 openpgm-5.2) if(NOT ${OPENPGM_FOUND}) message("PACKAGE openpgm-5.1 is required by binaries such as oaisim: will fail later if this target is built") else() From 05ad02d5556bf0ac1636a8efe365a1a76941d7b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Leroy?= Date: Mon, 13 Jun 2016 10:51:39 +0200 Subject: [PATCH 11/24] build_helper: add flag to allow compiling software without hardware Add --disable-hardware-dependency flag to avoid hardware need when compiling OAI. For the momment it avoids to flash bladeRF hardware --- cmake_targets/build_oai | 10 ++++++++++ cmake_targets/tools/build_helper | 5 ++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/cmake_targets/build_oai b/cmake_targets/build_oai index 42bd6c82d7..44c41d4a50 100755 --- a/cmake_targets/build_oai +++ b/cmake_targets/build_oai @@ -278,6 +278,10 @@ function main() { T_TRACER="True" echo_info "Enabling the T tracer" shift 1;; + --disable-hardware-dependency) + echo_info "Disabling hardware dependency for compiling software" + DISABLE_HARDWARE_DEPENDENCY="True" + shift 1;; -h | --help) print_help exit 1;; @@ -387,10 +391,16 @@ function main() { if [ "$HW" == "OAI_USRP" ] ; then echo_info "installing packages for USRP support" check_install_usrp_uhd_driver + if [ ! "$DISABLE_HARDWARE_DEPENDENCY" == "True" ]; then + install_usrp_uhd_driver + fi fi if [ "$HW" == "OAI_BLADERF" ] ; then echo_info "installing packages for BLADERF support" check_install_bladerf_driver + if [ ! "$DISABLE_HARDWARE_DEPENDENCY" == "True" ]; then + flash_firmware_bladerf + fi fi fi diff --git a/cmake_targets/tools/build_helper b/cmake_targets/tools/build_helper index 3f4a4f17ad..5435685c19 100755 --- a/cmake_targets/tools/build_helper +++ b/cmake_targets/tools/build_helper @@ -229,7 +229,10 @@ check_install_bladerf_driver(){ $SUDO apt-get install -y bladerf libbladerf-dev $SUDO apt-get install -y bladerf-firmware-fx3 $SUDO apt-get install -y bladerf-fpga-hostedx40 - $SUDO bladeRF-cli --flash-firmware /usr/share/Nuand/bladeRF/bladeRF_fw.img +} + +flash_firmware_bladerf() { + $SUDO bladeRF-cli --flash-firmware /usr/share/Nuand/bladeRF/bladeRF_fw.img } check_install_additional_tools (){ From feb5979830b1deab91c947291f7d8554b1a990ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Leroy?= Date: Mon, 13 Jun 2016 12:09:02 +0200 Subject: [PATCH 12/24] build_helper: remove non-existent package uhd It breaks apt-get remove command --- cmake_targets/tools/build_helper | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake_targets/tools/build_helper b/cmake_targets/tools/build_helper index 5435685c19..0babb9e423 100755 --- a/cmake_targets/tools/build_helper +++ b/cmake_targets/tools/build_helper @@ -213,7 +213,7 @@ install_gnutls_from_source(){ check_install_usrp_uhd_driver(){ #first we remove old installation - $SUDO apt-get remove uhd libuhd-dev libuhd003 uhd-host -y + $SUDO apt-get remove libuhd-dev libuhd003 uhd-host -y v=$(lsb_release -cs) $SUDO apt-add-repository --remove "deb http://files.ettus.com/binaries/uhd/repo/uhd/ubuntu/$v $v main" #The new USRP repository From ccddb7859446d5edb2833d6270fe41534acac11f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Leroy?= Date: Mon, 13 Jun 2016 12:07:16 +0200 Subject: [PATCH 13/24] build_oai: make USRP build possible without hardware --- cmake_targets/tools/build_helper | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/cmake_targets/tools/build_helper b/cmake_targets/tools/build_helper index 0babb9e423..7e2912b7d1 100755 --- a/cmake_targets/tools/build_helper +++ b/cmake_targets/tools/build_helper @@ -220,9 +220,16 @@ check_install_usrp_uhd_driver(){ $SUDO add-apt-repository ppa:ettusresearch/uhd -y $SUDO apt-get update $SUDO apt-get -y install python python-tk libboost-all-dev libusb-1.0-0-dev - $SUDO apt-get -y install libuhd-dev libuhd003 uhd-host + $SUDO apt-get -y install libuhd-dev libuhd003 +} + +install_usrp_uhd_driver() { + # We move uhd-host apart because it depends on linux kernel version + # On newer kernels, it fails to install + $SUDO apt-get -y install uhd-host $SUDO uhd_images_downloader } + check_install_bladerf_driver(){ $SUDO add-apt-repository -y ppa:bladerf/bladerf $SUDO apt-get update From eb029cb81156339a0d22afb76e2add5b205c08d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Leroy?= Date: Tue, 14 Jun 2016 11:10:28 +0200 Subject: [PATCH 14/24] build_helper: use official bladerf packages bladerf ppa don't publish packages for Ubuntu 16.04. There are official packages for bladerf so we use these. --- cmake_targets/tools/build_helper | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cmake_targets/tools/build_helper b/cmake_targets/tools/build_helper index 7e2912b7d1..68457164e7 100755 --- a/cmake_targets/tools/build_helper +++ b/cmake_targets/tools/build_helper @@ -231,8 +231,10 @@ install_usrp_uhd_driver() { } check_install_bladerf_driver(){ - $SUDO add-apt-repository -y ppa:bladerf/bladerf - $SUDO apt-get update + if [ "$(get_distribution_release)" == "Ubuntu14.04" ] ; then + $SUDO add-apt-repository -y ppa:bladerf/bladerf + $SUDO apt-get update + fi $SUDO apt-get install -y bladerf libbladerf-dev $SUDO apt-get install -y bladerf-firmware-fx3 $SUDO apt-get install -y bladerf-fpga-hostedx40 From 2349b37e1f41a65d678dd8bc7db3f17258d71842 Mon Sep 17 00:00:00 2001 From: cubiq Date: Tue, 12 Apr 2016 12:05:56 +0200 Subject: [PATCH 15/24] lte-softmodem: add "-ldl" options to linkage --- cmake_targets/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake_targets/CMakeLists.txt b/cmake_targets/CMakeLists.txt index 379b213e27..6f370b7144 100644 --- a/cmake_targets/CMakeLists.txt +++ b/cmake_targets/CMakeLists.txt @@ -1625,7 +1625,7 @@ add_executable(lte-softmodem ${T_SOURCE} ) -target_link_libraries (lte-softmodem +target_link_libraries (lte-softmodem -ldl -Wl,--start-group RRC_LIB S1AP_LIB S1AP_ENB GTPV1U SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT UDP SCHED_LIB PHY LFDS L2 ${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} ${ITTI_LIB} ${MIH_LIB} -Wl,--end-group ) From f81b6704f43c76fecaabf55eb33b2e72fcb0edfd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Leroy?= Date: Fri, 10 Jun 2016 14:39:00 +0200 Subject: [PATCH 16/24] lmsSDR: remove static from struct SamplesPacket. Th struct SamplesPacket is a type declaration. It is not defined in memory and thus samplesCount can't be declared static. Transform it to true cpp static variable class as this is c++ source. --- targets/ARCH/LMSSDR/USERSPACE/LIB/lmsSDR/dataTypes.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/targets/ARCH/LMSSDR/USERSPACE/LIB/lmsSDR/dataTypes.h b/targets/ARCH/LMSSDR/USERSPACE/LIB/lmsSDR/dataTypes.h index cba2b7341e..c97ac7857d 100644 --- a/targets/ARCH/LMSSDR/USERSPACE/LIB/lmsSDR/dataTypes.h +++ b/targets/ARCH/LMSSDR/USERSPACE/LIB/lmsSDR/dataTypes.h @@ -14,14 +14,15 @@ typedef struct int16_t q; } complex16_t; -typedef struct +class SamplesPacket { + public: uint64_t timestamp; //timestamp of the packet uint16_t first; //index of first unused sample in samples[] uint16_t last; //end index of samples static const uint16_t samplesCount = 1024; //maximum number of samples in packet complex16_t samples[samplesCount]; //must be power of two -} SamplesPacket; +}; complex16_t operator &=(complex16_t & other1, const complex16_t & other) // copy assignment { @@ -30,4 +31,4 @@ complex16_t operator &=(complex16_t & other1, const complex16_t & other) // copy return other1; } -#endif \ No newline at end of file +#endif From 22b278d43b61325efd910e1cf67177f269048818 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Leroy?= Date: Mon, 13 Jun 2016 14:05:45 +0200 Subject: [PATCH 17/24] CMakeLists.txt: fix lte-softmodem-nos1 build It can't link because nas_config.c and rb_config.c was commented. --- cmake_targets/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmake_targets/CMakeLists.txt b/cmake_targets/CMakeLists.txt index 6f370b7144..d542416315 100644 --- a/cmake_targets/CMakeLists.txt +++ b/cmake_targets/CMakeLists.txt @@ -1652,8 +1652,8 @@ add_executable(lte-softmodem-nos1 ${OPENAIR_TARGETS}/SIMU/USER/init_lte.c ${OPENAIR_TARGETS}/COMMON/create_tasks.c ${OPENAIR_TARGETS}/ARCH/COMMON/common_lib.c - #${OPENAIR2_DIR}/RRC/NAS/nas_config.c # enable if you want rrc to mount ip interface - #${OPENAIR2_DIR}/RRC/NAS/rb_config.c + ${OPENAIR2_DIR}/RRC/NAS/nas_config.c + ${OPENAIR2_DIR}/RRC/NAS/rb_config.c ${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/netlink_init.c ${HW_SOURCE} ${TRANSPORT_SOURCE} From cdb182c1535f960328b6d40c4a173619692ce5f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Leroy?= Date: Fri, 10 Jun 2016 08:58:50 +0200 Subject: [PATCH 18/24] CMakeLists.txt: force compilation to gnu89 standard for gccxml clang have changed its default standard to C11 compilation and is stricter. Ensure use of gnu89 standard to use pthread extension for --castxml-gccxml --- cmake_targets/CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cmake_targets/CMakeLists.txt b/cmake_targets/CMakeLists.txt index d542416315..67cc6cfc3a 100644 --- a/cmake_targets/CMakeLists.txt +++ b/cmake_targets/CMakeLists.txt @@ -1929,6 +1929,11 @@ foreach( d ${DirDefs} ) list(APPEND itti_compiler_options "-I${d}") endforeach() +# castxml doesn't work with c11 (gcc 5 default) +# force castxml and clang compilation with gnu89 standard +# we can't use cXX standard as pthread_rwlock_t is gnu standard +list(APPEND itti_compiler_options "-std=gnu89") + set (ITTI_H ${ITTI_DIR}/intertask_interface_types.h) add_custom_command ( OUTPUT ${OPENAIR_BIN_DIR}/messages.xml From 0bca3ea53dbdb76b29c5f1c587f696585023ac87 Mon Sep 17 00:00:00 2001 From: Rohit Gupta Date: Sat, 18 Jun 2016 23:44:38 +0200 Subject: [PATCH 19/24] minor fixes to build scripts --- cmake_targets/build_oai | 3 +++ cmake_targets/tools/build_helper | 16 ++++++++-------- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/cmake_targets/build_oai b/cmake_targets/build_oai index 44c41d4a50..04289a83fa 100755 --- a/cmake_targets/build_oai +++ b/cmake_targets/build_oai @@ -60,6 +60,7 @@ RUN_GROUP=0 TEST_CASE_GROUP="" BUILD_DOXYGEN=0 T_TRACER="False" +DISABLE_HARDWARE_DEPENDENCY="False" trap handle_ctrl_c INT function print_help() { @@ -132,6 +133,8 @@ Options Disables CPU Affinity between UHD/TX/RX Threads (Valid only when deadline scheduler is disabled). By defaulT, CPU Affinity is enabled when not using deadline scheduler. It is enabled only with >2 CPUs. For eNB, CPU_0-> Device library (UHD), CPU_1->TX Threads, CPU_2...CPU_MAX->Rx Threads. For UE, CPU_0->Device Library(UHD), CPU_1..CPU_MAX -> All the UE threads --T-tracer Enables the T tracer. +--disable-hardware-dependency + Disable HW dependency during installation Usage (first build): oaisim (eNB + UE): ./build_oai -I -g --oaisim -x --install-system-files Eurecom EXMIMO + COTS UE : ./build_oai -I -g --eNB -x --install-system-files diff --git a/cmake_targets/tools/build_helper b/cmake_targets/tools/build_helper index 550ee67bc7..36d3410349 100755 --- a/cmake_targets/tools/build_helper +++ b/cmake_targets/tools/build_helper @@ -213,7 +213,7 @@ install_gnutls_from_source(){ check_install_usrp_uhd_driver(){ #first we remove old installation - $SUDO apt-get remove libuhd-dev libuhd003 uhd-host -y + $SUDO apt-get remove uhd libuhd-dev libuhd003 uhd-host -y v=$(lsb_release -cs) $SUDO apt-add-repository --remove "deb http://files.ettus.com/binaries/uhd/repo/uhd/ubuntu/$v $v main" #The new USRP repository @@ -267,7 +267,11 @@ check_install_additional_tools (){ ctags \ ntpdate \ iperf3 \ - android-tools-adb + android-tools-adb \ + wvdial \ + python-numpy \ + sshpass \ + libxslt1-dev $SUDO pip install paramiko $SUDO pip install pyroute2 @@ -363,12 +367,7 @@ check_install_oai_software() { xmlstarlet \ python-pip \ pydb \ - wget \ - wvdial \ - python-numpy \ - sshpass \ - libxslt1-dev \ - android-tools-adb + wget $SUDO update-alternatives --set liblapack.so /usr/lib/atlas-base/atlas/liblapack.so @@ -394,6 +393,7 @@ install_asn1c_from_source(){ ./configure make -j`nproc` $SUDO make install + cd - ) > $asn1_install_log 2>&1 } From f7d815190b6230e7805d045f537a348094313b3c Mon Sep 17 00:00:00 2001 From: Rohit Gupta Date: Mon, 20 Jun 2016 18:58:06 +0200 Subject: [PATCH 20/24] Gitlab CI: fix for 0255* + iperf script route --- cmake_targets/autotests/test_case_list.xml | 44 +++++++++++----------- cmake_targets/autotests/tools/iperf_script | 12 ++++++ 2 files changed, 34 insertions(+), 22 deletions(-) diff --git a/cmake_targets/autotests/test_case_list.xml b/cmake_targets/autotests/test_case_list.xml index 7b92ce2d11..c59d83e30b 100644 --- a/cmake_targets/autotests/test_case_list.xml +++ b/cmake_targets/autotests/test_case_list.xml @@ -6082,7 +6082,7 @@ c lte-softmodem - calisson + tique stevens amerique 390 @@ -6099,10 +6099,10 @@ c targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf frame_type \"FDD\" targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_rx 1 targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_tx 1 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth5\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.82/24\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1U \"eth5\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.82/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.147/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1U \"eth1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.147/24\" targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_PORT_FOR_S1U 2152 $OPENAIR_DIR/cmake_targets/build_oai --eNB -w USRP -x -c @@ -6157,7 +6157,7 @@ c lte-softmodem - calisson + tique stevens amerique 390 @@ -6174,10 +6174,10 @@ c targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf frame_type \"FDD\" targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_rx 1 targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_tx 1 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth5\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.82/24\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1U \"eth5\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.82/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.147/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1U \"eth1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.147/24\" targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_PORT_FOR_S1U 2152 $OPENAIR_DIR/cmake_targets/build_oai --eNB -w USRP -x -c @@ -6305,7 +6305,7 @@ c lte-softmodem - calisson + tique stevens amerique 390 @@ -6322,10 +6322,10 @@ c targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf frame_type \"FDD\" targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_rx 1 targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_tx 1 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth5\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.82/24\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1U \"eth5\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.82/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.147/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1U \"eth1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.147/24\" targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_PORT_FOR_S1U 2152 $OPENAIR_DIR/cmake_targets/build_oai --eNB -w USRP -x -c @@ -6368,7 +6368,7 @@ c /opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 - $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 65 lo -c 192.172.0.2 -b 10Mbits/s -i 1 -f m -u + $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 65 lo -c 192.172.0.2 -b 17Mbits/s -i 1 -f m -u False @@ -6379,7 +6379,7 @@ c lte-softmodem - calisson + tique stevens amerique 390 @@ -6396,10 +6396,10 @@ c targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf frame_type \"FDD\" targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_rx 1 targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_tx 1 - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth5\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.82/24\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1U \"eth5\" - targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.82/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.147/24\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1U \"eth1\" + targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.147/24\" targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_PORT_FOR_S1U 2152 $OPENAIR_DIR/cmake_targets/build_oai --eNB -w USRP -x -c @@ -6442,7 +6442,7 @@ c /opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 - $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 65 lo -c 192.172.0.2 -b 20Mbits/s -i 1 -f m -u + $OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 65 lo -c 192.172.0.2 -b 34Mbits/s -i 1 -f m -u False diff --git a/cmake_targets/autotests/tools/iperf_script b/cmake_targets/autotests/tools/iperf_script index 5f9baff09f..fb540657b6 100755 --- a/cmake_targets/autotests/tools/iperf_script +++ b/cmake_targets/autotests/tools/iperf_script @@ -39,14 +39,26 @@ timeout=${args[0]} iface=${args[1]} iperf_args=(${args[@]:2}) +ip_client=echo "$iperf_args" | sed -ne 's/.*\-c[ ]*\([0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\).*/\1/p' + #array=${1:-1} echo "args = ${args[@]}" echo "timeout = $timeout" echo "iface = $iface" echo "iperf_args = ${iperf_args[@]}" +echo "ip_client = $ip_client" sleep $timeout +echo " Waiting for IP Address..." while true; do var=`ifconfig $iface` ;sleep 1; if [ "$var" != "" ]; then break; fi ; done ; sleep 5 +if [ -n "$ip_client" ]; then +echo "Waiting for route to be setup before iperf makes connection..." + var=`route -n | grep $ip_client` + if ["$var" != "" ] ; then break; fi + +fi +sleep 5 + iperf ${iperf_args[@]} From 71af065b486ce1dcc77414e063f0971bdb15c654 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Leroy?= Date: Thu, 23 Jun 2016 15:19:56 +0200 Subject: [PATCH 21/24] build_helper: move uhd to not break apt-get remove uhd is not part of ubuntu standard repositories >= 14.04. Move the removal of uhd in its own space and do not fail if it doesn't exists. --- cmake_targets/tools/build_helper | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmake_targets/tools/build_helper b/cmake_targets/tools/build_helper index 36d3410349..3d7b4045ae 100755 --- a/cmake_targets/tools/build_helper +++ b/cmake_targets/tools/build_helper @@ -213,7 +213,8 @@ install_gnutls_from_source(){ check_install_usrp_uhd_driver(){ #first we remove old installation - $SUDO apt-get remove uhd libuhd-dev libuhd003 uhd-host -y + $SUDO apt-get remove -y uhd || true + $SUDO apt-get remove libuhd-dev libuhd003 uhd-host -y v=$(lsb_release -cs) $SUDO apt-add-repository --remove "deb http://files.ettus.com/binaries/uhd/repo/uhd/ubuntu/$v $v main" #The new USRP repository From 30cf26c0dc54c49af1533692d61309391dfeb376 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Leroy?= Date: Fri, 24 Jun 2016 08:15:45 +0200 Subject: [PATCH 22/24] build_helper: fix libxslt1-dev installation libxslt1-dev is used at least for asn1 and usrp. It breaks the build when in check_install_additional_tools(). Move it to to check_install_oai_software() --- cmake_targets/tools/build_helper | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmake_targets/tools/build_helper b/cmake_targets/tools/build_helper index 3d7b4045ae..9971c56d86 100755 --- a/cmake_targets/tools/build_helper +++ b/cmake_targets/tools/build_helper @@ -271,8 +271,7 @@ check_install_additional_tools (){ android-tools-adb \ wvdial \ python-numpy \ - sshpass \ - libxslt1-dev + sshpass $SUDO pip install paramiko $SUDO pip install pyroute2 @@ -356,6 +355,7 @@ check_install_oai_software() { libusb-1.0-0-dev \ libxml2 \ libxml2-dev \ + libxslt1-dev \ linux-headers-`uname -r` \ mscgen \ octave \ From a3d26040de1dcf07d47fbc4d4c63d3a319276d9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Leroy?= Date: Fri, 24 Jun 2016 05:35:32 -0500 Subject: [PATCH 23/24] build_helper: add EXIT handler to inform that the build fails --- cmake_targets/tools/build_helper | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/cmake_targets/tools/build_helper b/cmake_targets/tools/build_helper index 9971c56d86..c3e1ebfb47 100755 --- a/cmake_targets/tools/build_helper +++ b/cmake_targets/tools/build_helper @@ -95,6 +95,18 @@ check_supported_distribution() { return 1 } +################## +# Error handlers # +################## + +handler_EXIT() { + local exit_code=$? + [ "$exit_code" -eq 0 ] || echo_error "build have failed" + exit $exit_code +} + +trap handler_EXIT EXIT + ########################### # Cleaners ########################### From 9624232f677c44b7ad89067e2c6a39ee9182d13f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Leroy?= Date: Fri, 24 Jun 2016 06:06:33 -0500 Subject: [PATCH 24/24] build_helper: show "compilation failed" error message --- cmake_targets/tools/build_helper | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cmake_targets/tools/build_helper b/cmake_targets/tools/build_helper index c3e1ebfb47..5b562a14c9 100755 --- a/cmake_targets/tools/build_helper +++ b/cmake_targets/tools/build_helper @@ -148,6 +148,7 @@ clean_all_files() { compilations() { cd $OPENAIR_DIR/cmake_targets/$1/build echo_info "Log file for compilation written in: $dlog/$2.$REL.txt" + set +e { rm -f $3 if [ "$VERBOSE_COMPILE" == "1" ]; then @@ -157,12 +158,14 @@ compilations() { fi } > $dlog/$2.$REL.txt 2>&1 + set -e echo_info "Log file for compilation has been written to: $dlog/$2.$REL.txt" if [ -s $3 ] ; then cp $3 $4 echo_success "$2 compiled" else echo_error "$2 compilation failed" + exit 1 fi }