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 1/4] 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 2/4] 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 3/4] 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 4/4] 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 }