From c2a5199f0d7b59f4738c99b66bc57138c4f7fbde Mon Sep 17 00:00:00 2001 From: "Frank A. Zdarsky" Date: Sun, 30 Oct 2016 16:42:26 +0100 Subject: [PATCH 1/3] Add support for RHEL/CentOS 7 Signed-off-by: Frank A. Zdarsky --- cmake_targets/build_oai | 1 - cmake_targets/tools/build_helper | 186 ++++++++++++++++++++++++++++--- 2 files changed, 171 insertions(+), 16 deletions(-) diff --git a/cmake_targets/build_oai b/cmake_targets/build_oai index 93a7ac073e..790f1474c9 100755 --- a/cmake_targets/build_oai +++ b/cmake_targets/build_oai @@ -63,7 +63,6 @@ DISABLE_HARDWARE_DEPENDENCY="False" CMAKE_BUILD_TYPE="" UE_AUTOTEST_TRACE="False" BUILD_ECLIPSE=0 -CMAKE_CMD='cmake' trap handle_ctrl_c INT function print_help() { diff --git a/cmake_targets/tools/build_helper b/cmake_targets/tools/build_helper index a57040449c..383f0c002d 100755 --- a/cmake_targets/tools/build_helper +++ b/cmake_targets/tools/build_helper @@ -24,6 +24,22 @@ # authors Laurent Thomas, Lionel GAUTHIER # ####################################### +if [ ! -f /etc/os-release ]; then + echo "No /etc/os-release file found. You're likely on an unsupported distro." + exit -1 +fi +OS_DISTRO=$(grep "^ID=" /etc/os-release | sed "s/ID=//" | sed "s/\"//g") +OS_RELEASE=$(grep "^VERSION_ID=" /etc/os-release | sed "s/VERSION_ID=//" | sed "s/\"//g") +case "$OS_DISTRO" in + fedora) OS_BASEDISTRO="fedora"; INSTALLER="dnf"; CMAKE_CMD="cmake" ;; + rhel) OS_BASEDISTRO="fedora"; INSTALLER="yum"; CMAKE_CMD="cmake3" ;; + centos) OS_BASEDISTRO="fedora"; INSTALLER="yum"; CMAKE_CMD="cmake3" ;; + debian) OS_BASEDISTRO="debian"; INSTALLER="apt-get"; CMAKE_CMD="cmake" ;; + ubuntu) OS_BASEDISTRO="debian"; INSTALLER="apt-get"; CMAKE_CMD="cmake" ;; +esac +KERNEL_VERSION=$(uname -r | cut -d '.' -f1) +KERNEL_MAJOR=$(uname -r | cut -d '.' -f2) + SUDO='sudo -E' ############################### @@ -69,9 +85,8 @@ echo_info() { cecho "$*" $blue ;} # Ubuntu16.04 # Debian8.5 get_distribution_release() { - local distributor - if distributor=$(lsb_release -si 2>/dev/null) ; then - echo $distributor$(lsb_release -sr) + if [[ ! -z "$OS_DISTRO$OS_RELEASE" ]]; then + echo "$OS_DISTRO$OS_RELEASE" else echo Unknown fi @@ -80,8 +95,11 @@ get_distribution_release() { check_supported_distribution() { local distribution=$(get_distribution_release) case "$distribution" in - "Ubuntu16.04") return 0 ;; - "Ubuntu14.04") return 0 ;; + "ubuntu16.04") return 0 ;; + "ubuntu14.04") return 0 ;; + "fedora24") return 0 ;; + "rhel7") return 0 ;; + "centos7") return 0 ;; esac return 1 } @@ -215,6 +233,7 @@ install_protobuf_c_from_source(){ } check_install_usrp_uhd_driver(){ + if [[ "$OS_DISTRO" == "ubuntu" ]]; then #first we remove old installation $SUDO apt-get remove -y uhd || true $SUDO apt-get remove libuhd-dev libuhd003 uhd-host -y @@ -225,21 +244,27 @@ check_install_usrp_uhd_driver(){ $SUDO apt-get update $SUDO apt-get -y --allow-unauthenticated install python python-tk libboost-all-dev libusb-1.0-0-dev $SUDO apt-get -y --allow-unauthenticated install libuhd-dev libuhd003 uhd-host + elif [[ "$OS_BASEDISTRO" == "fedora" ]]; then + $SUDO $INSTALLER -y install python boost libusb-devel + $SUDO $INSTALLER -y install uhd uhd-devel uhd-firmware + fi } install_usrp_uhd_driver() { + if [[ "$OS_DISTRO" == "ubuntu" ]]; then # 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 - if [ -z $1 ]; then - $SUDO uhd_images_downloader - else - $SUDO uhd_images_downloader -i $1 - fi + fi + if [ -z $1 ]; then + $SUDO uhd_images_downloader + else + $SUDO uhd_images_downloader -i $1 + fi } check_install_bladerf_driver(){ - if [ "$(get_distribution_release)" == "Ubuntu14.04" ] ; then + if [ "$(get_distribution_release)" == "ubuntu14.04" ] ; then $SUDO add-apt-repository -y ppa:bladerf/bladerf $SUDO apt-get update fi @@ -268,7 +293,8 @@ check_install_lmssdr_driver(){ } check_install_additional_tools (){ - $SUDO apt-get update + $SUDO $INSTALLER update -y + if [[ "$OS_DISTRO" == "ubuntu" ]]; then $SUDO apt-get install -y \ check \ dialog \ @@ -315,6 +341,65 @@ check_install_additional_tools (){ $SUDO python setup.py install cd - ) >& $log_netiface + elif [[ "$OS_DISTRO" == "rhel" ]] || [[ "$OS_DISTRO" == "centos" ]]; then + $SUDO $INSTALLER install -y \ + check \ + dialog \ + dkms \ + gawk \ + boost-devel \ + openvpn \ + pkgconfig \ + pexpect \ + sshfs \ + swig \ + wireshark \ + unzip \ + valgrind \ + vconfig \ + ctags \ + ntpdate \ + iperf3 \ + wvdial \ + numpy \ + sshpass \ + nscd \ + python2-paramiko \ + python-pyroute2 \ + python-netifaces + + $SUDO rm -fr /opt/ssh + $SUDO GIT_SSL_NO_VERIFY=true git clone https://gist.github.com/2190472.git /opt/ssh + elif [[ "$OS_DISTRO" == "fedora" ]]; then + $SUDO $INSTALLER install -y \ + check \ + dialog \ + dkms \ + gawk \ + boost-devel \ + openvpn \ + pkgconfig \ + python-pexpect \ + sshfs \ + swig \ + wireshark \ + unzip \ + valgrind \ + vconfig \ + ctags \ + ntpdate \ + iperf3 \ + wvdial \ + python-numpy \ + sshpass \ + nscd \ + python2-paramiko \ + python-pyroute2 \ + python-netifaces + + $SUDO rm -fr /opt/ssh + $SUDO GIT_SSL_NO_VERIFY=true git clone https://gist.github.com/2190472.git /opt/ssh + fi } check_install_oai_software() { @@ -323,16 +408,17 @@ check_install_oai_software() { echo_error "Your distribution $(get_distribution_release) is not supported by oai !" exit 1 fi - $SUDO apt-get update + $SUDO $INSTALLER update -y + if [[ "$OS_DISTRO" == "ubuntu" ]]; then $SUDO apt install -y software-properties-common case "$(get_distribution_release)" in - "Ubuntu14.04") + "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") + "ubuntu16.04") specific_packages="libtasn1-6-dev" ;; esac @@ -406,7 +492,77 @@ check_install_oai_software() { remove_gnutls_from_source $SUDO apt-get install -y libgnutls-dev + elif [[ "$OS_BASEDISTRO" == "fedora" ]]; then + if [[ "$OS_DISTRO" == "rhel" ]] || [[ "$OS_DISTRO" == "centos" ]]; then + if rpm -q epel-release > /dev/null; then + echo "EPEL repos already present. Good." + else + echo "EPEL repos not present. Installing them." + $SUDO $INSTALLER install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm + fi + $SUDO $INSTALLER install -y python-epdb + $SUDO $INSTALLER install -y gccxml + else + $SUDO $INSTALLER install -y mscgen pydb + # Fedora repos already contain gccxml's successor castxml. + $SUDO $INSTALLER install -y castxml + fi + $SUDO $INSTALLER install -y \ + autoconf \ + automake \ + bison \ + $CMAKE_CMD \ + doxygen \ + ethtool \ + flex \ + gdb \ + git \ + graphviz \ + gtkwave \ + guile-devel \ + iperf \ + iproute \ + iptables \ + iptables-devel \ + atlas-devel \ + blas-devel \ + libconfig-devel \ + libffi-devel \ + xforms \ + xforms-devel \ + libgcrypt-devel \ + gmp-devel \ + gtk3-devel \ + libidn2-devel \ + libidn-devel \ + mariadb-devel \ + octave-devel \ + openpgm-devel \ + lksctp-tools \ + lksctp-tools-devel \ + openssl-devel \ + libtasn1 \ + libtool \ + libusb-devel \ + libxml2 \ + libxml2-devel \ + libxslt-devel \ + octave \ + octave-signal \ + openssh-clients \ + openssh-server \ + openssl \ + python \ + subversion \ + xmlstarlet \ + python-pip \ + wget \ + kernel-headers \ + nettle-devel \ + gnutls-devel + fi + install_asn1c_from_source $SUDO rm -fr /opt/ssh $SUDO git clone https://gist.github.com/2190472.git /opt/ssh From c5d321cb6f2bc5ded97176a3f72e7ac44bca7411 Mon Sep 17 00:00:00 2001 From: Rohit Gupta Date: Tue, 8 Nov 2016 03:07:01 +0100 Subject: [PATCH 2/3] minor fixes for CentOS7 installation+compilation --- cmake_targets/CMakeLists.txt | 20 ++++++- cmake_targets/tools/build_helper | 94 ++++++++++++++++++-------------- 2 files changed, 71 insertions(+), 43 deletions(-) diff --git a/cmake_targets/CMakeLists.txt b/cmake_targets/CMakeLists.txt index e20718ac36..2057c7c993 100644 --- a/cmake_targets/CMakeLists.txt +++ b/cmake_targets/CMakeLists.txt @@ -1633,9 +1633,25 @@ else() endif() # Atlas is required by some packages, but not found in pkg-config -if(EXISTS "/usr/include/atlas/cblas.h") +# So, here are some hacks here. Hope this gets fixed in future! +if(EXISTS "/usr/include/atlas/cblas.h" OR EXISTS "/usr/include/cblas.h") include_directories("/usr/include/atlas") - list(APPEND ATLAS_LIBRARIES cblas atlas lapack) + LINK_DIRECTORIES("/usr/lib64") + LINK_DIRECTORIES("/usr/lib64/atlas") #Added because atlas libraries in CentOS 7 are here! + + if(EXISTS "/usr/lib64/libblas.so" OR EXISTS "/usr/lib/libblas.so") #Case for CentOS7 + list(APPEND ATLAS_LIBRARIES blas) + else() # Case for Ubuntu + list(APPEND ATLAS_LIBRARIES cblas) + endif() + + if(EXISTS "/usr/lib/atlas/libtatlas.so" OR EXISTS "/usr/lib64/atlas/libtatlas.so") #Case for CentOS7 + list(APPEND ATLAS_LIBRARIES tatlas) + else() + list(APPEND ATLAS_LIBRARIES atlas) #Case for Ubuntu + endif() + + list(APPEND ATLAS_LIBRARIES lapack) else() message("No Blas/Atlas libs found, some targets will fail") endif() diff --git a/cmake_targets/tools/build_helper b/cmake_targets/tools/build_helper index 383f0c002d..362dce094c 100755 --- a/cmake_targets/tools/build_helper +++ b/cmake_targets/tools/build_helper @@ -82,8 +82,8 @@ echo_info() { cecho "$*" $blue ;} # 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 +# ubuntu16.04 +# debian8.5 get_distribution_release() { if [[ ! -z "$OS_DISTRO$OS_RELEASE" ]]; then echo "$OS_DISTRO$OS_RELEASE" @@ -245,7 +245,7 @@ check_install_usrp_uhd_driver(){ $SUDO apt-get -y --allow-unauthenticated install python python-tk libboost-all-dev libusb-1.0-0-dev $SUDO apt-get -y --allow-unauthenticated install libuhd-dev libuhd003 uhd-host elif [[ "$OS_BASEDISTRO" == "fedora" ]]; then - $SUDO $INSTALLER -y install python boost libusb-devel + $SUDO $INSTALLER -y install python boost libusb-devel boost-devel $SUDO $INSTALLER -y install uhd uhd-devel uhd-firmware fi } @@ -264,13 +264,17 @@ install_usrp_uhd_driver() { } check_install_bladerf_driver(){ - 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 --allow-unauthenticated bladerf libbladerf-dev - $SUDO apt-get install -y --allow-unauthenticated bladerf-firmware-fx3 - $SUDO apt-get install -y --allow-unauthenticated bladerf-fpga-hostedx40 + if [[ "$OS_DISTRO" == "ubuntu" ]]; then + 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 --allow-unauthenticated bladerf libbladerf-dev + $SUDO apt-get install -y --allow-unauthenticated bladerf-firmware-fx3 + $SUDO apt-get install -y --allow-unauthenticated bladerf-fpga-hostedx40 + else + echo_error "BladeRF Installer for OAI does not support automatic build. Install BladeRF compiling sources manually from BladeRF website" + fi } flash_firmware_bladerf() { @@ -295,7 +299,7 @@ check_install_lmssdr_driver(){ check_install_additional_tools (){ $SUDO $INSTALLER update -y if [[ "$OS_DISTRO" == "ubuntu" ]]; then - $SUDO apt-get install -y \ + PACKAGE_LIST="\ check \ dialog \ dkms \ @@ -324,25 +328,9 @@ check_install_additional_tools (){ bc \ ntp \ python-scipy \ - python-matplotlib - - $SUDO pip install paramiko - $SUDO pip install pyroute2 colorama - $SUDO rm -fr /opt/ssh - $SUDO GIT_SSL_NO_VERIFY=true git clone https://gitlab.eurecom.fr/oai/ssh.git /opt/ssh - - log_netiface=$OPENAIR_DIR/cmake_targets/log/netiface_install_log.txt - echo_info "Installing Netinterfaces package. The logfile for installation is in $log_netiface" - ( - $SUDO rm -fr /tmp/netifaces-0.10.4.tar.gz /tmp/netifaces - wget -P /tmp https://pypi.python.org/packages/18/fa/dd13d4910aea339c0bb87d2b3838d8fd923c11869b1f6e741dbd0ff3bc00/netifaces-0.10.4.tar.gz - tar -xzvf /tmp/netifaces-0.10.4.tar.gz -C /tmp - cd /tmp/netifaces-0.10.4 - $SUDO python setup.py install - cd - - ) >& $log_netiface + python-matplotlib" elif [[ "$OS_DISTRO" == "rhel" ]] || [[ "$OS_DISTRO" == "centos" ]]; then - $SUDO $INSTALLER install -y \ + PACKAGE_LIST="\ check \ dialog \ dkms \ @@ -366,12 +354,11 @@ check_install_additional_tools (){ nscd \ python2-paramiko \ python-pyroute2 \ - python-netifaces - - $SUDO rm -fr /opt/ssh - $SUDO GIT_SSL_NO_VERIFY=true git clone https://gist.github.com/2190472.git /opt/ssh + python-netifaces \ + scipy \ + python-matplotlib" elif [[ "$OS_DISTRO" == "fedora" ]]; then - $SUDO $INSTALLER install -y \ + PACKAGE_LIST=" \ check \ dialog \ dkms \ @@ -395,10 +382,29 @@ check_install_additional_tools (){ nscd \ python2-paramiko \ python-pyroute2 \ - python-netifaces - + python-netifaces \ + python2-scipy \ + python2-matplotlib" + fi + $SUDO $INSTALLER install -y $PACKAGE_LIST + $SUDO rm -fr /opt/ssh - $SUDO GIT_SSL_NO_VERIFY=true git clone https://gist.github.com/2190472.git /opt/ssh + $SUDO GIT_SSL_NO_VERIFY=true git clone https://gitlab.eurecom.fr/oai/ssh.git /opt/ssh + + #The packages below are already installed for Redhat distros (RHEL, CentOS, Fedora) + if [[ "$OS_DISTRO" == "ubuntu" ]]; then + $SUDO pip install paramiko + $SUDO pip install pyroute2 colorama + log_netiface=$OPENAIR_DIR/cmake_targets/log/netiface_install_log.txt + echo_info "Installing Netinterfaces package. The logfile for installation is in $log_netiface" + ( + $SUDO rm -fr /tmp/netifaces-0.10.4.tar.gz /tmp/netifaces + wget -P /tmp https://pypi.python.org/packages/18/fa/dd13d4910aea339c0bb87d2b3838d8fd923c11869b1f6e741dbd0ff3bc00/netifaces-0.10.4.tar.gz + tar -xzvf /tmp/netifaces-0.10.4.tar.gz -C /tmp + cd /tmp/netifaces-0.10.4 + $SUDO python setup.py install + cd - + ) >& $log_netiface fi } @@ -481,7 +487,8 @@ check_install_oai_software() { python-pip \ pydb \ libyaml-dev \ - wget + wget \ + libxpm-dev $SUDO update-alternatives --set liblapack.so /usr/lib/atlas-base/atlas/liblapack.so @@ -560,7 +567,12 @@ check_install_oai_software() { wget \ kernel-headers \ nettle-devel \ - gnutls-devel + gnutls-devel \ + libXpm-devel \ + lapack \ + lapack-devel \ + blas \ + libblas-devel fi install_asn1c_from_source @@ -570,7 +582,7 @@ check_install_oai_software() { install_protobuf_c_from_source } -### Remove Nettle installation which was done from sources +### Remove Nettle installation which was done from sources (only done for Ubuntu Distro) remove_nettle_from_source() { nettle_uninstall_log=$OPENAIR_DIR/cmake_targets/log/nettle_uninstall_log.txt echo_info "\nUn-Installing Nettle from sources. The log file for nettle un-installation is here: $nettle_uninstall_log " @@ -596,7 +608,7 @@ remove_nettle_from_source() { ) >& $nettle_uninstall_log } -### Remove Gnutls from source +### Remove Gnutls from source (Only done for Ubuntu Distro) remove_gnutls_from_source(){ gnutls_uninstall_log=$OPENAIR_DIR/cmake_targets/log/gnutls_uninstall_log.txt echo_info "\nUn-Installing Gnutls. The log file for Gnutls un-installation is here: $gnutls_uninstall_log " From 633fda9a6e6f77ba91178d4bccb8bbd8ddd2f84c Mon Sep 17 00:00:00 2001 From: "Frank A. Zdarsky" Date: Fri, 2 Jun 2017 12:31:19 +0200 Subject: [PATCH 3/3] minor fixes and add building drivers from source for CentOS7 Signed-off-by: Frank A. Zdarsky --- cmake_targets/build_oai | 1 + cmake_targets/tools/build_helper | 81 ++++++++++++++++++++++++++++---- openair2/UTIL/LOG/log.h | 3 ++ 3 files changed, 76 insertions(+), 9 deletions(-) diff --git a/cmake_targets/build_oai b/cmake_targets/build_oai index 790f1474c9..1d70f48277 100755 --- a/cmake_targets/build_oai +++ b/cmake_targets/build_oai @@ -61,6 +61,7 @@ BUILD_DOXYGEN=0 T_TRACER="False" DISABLE_HARDWARE_DEPENDENCY="False" CMAKE_BUILD_TYPE="" +CMAKE_CMD="$CMAKE" UE_AUTOTEST_TRACE="False" BUILD_ECLIPSE=0 trap handle_ctrl_c INT diff --git a/cmake_targets/tools/build_helper b/cmake_targets/tools/build_helper index 362dce094c..29d839b543 100755 --- a/cmake_targets/tools/build_helper +++ b/cmake_targets/tools/build_helper @@ -31,11 +31,11 @@ fi OS_DISTRO=$(grep "^ID=" /etc/os-release | sed "s/ID=//" | sed "s/\"//g") OS_RELEASE=$(grep "^VERSION_ID=" /etc/os-release | sed "s/VERSION_ID=//" | sed "s/\"//g") case "$OS_DISTRO" in - fedora) OS_BASEDISTRO="fedora"; INSTALLER="dnf"; CMAKE_CMD="cmake" ;; - rhel) OS_BASEDISTRO="fedora"; INSTALLER="yum"; CMAKE_CMD="cmake3" ;; - centos) OS_BASEDISTRO="fedora"; INSTALLER="yum"; CMAKE_CMD="cmake3" ;; - debian) OS_BASEDISTRO="debian"; INSTALLER="apt-get"; CMAKE_CMD="cmake" ;; - ubuntu) OS_BASEDISTRO="debian"; INSTALLER="apt-get"; CMAKE_CMD="cmake" ;; + fedora) OS_BASEDISTRO="fedora"; INSTALLER="dnf"; CMAKE="cmake" ;; + rhel) OS_BASEDISTRO="fedora"; INSTALLER="yum"; CMAKE="cmake3" ;; + centos) OS_BASEDISTRO="fedora"; INSTALLER="yum"; CMAKE="cmake3" ;; + debian) OS_BASEDISTRO="debian"; INSTALLER="apt-get"; CMAKE="cmake" ;; + ubuntu) OS_BASEDISTRO="debian"; INSTALLER="apt-get"; CMAKE="cmake" ;; esac KERNEL_VERSION=$(uname -r | cut -d '.' -f1) KERNEL_MAJOR=$(uname -r | cut -d '.' -f2) @@ -218,6 +218,9 @@ install_protobuf_c_from_source(){ protobuf_c_install_log=$OPENAIR_DIR/cmake_targets/log/protobuf_c_install_log.txt echo_info "\nInstalling Google Protobuf_C from sources. The log file for Protobuf_C installation is here: $protobuf_c_install_log " ( + if [[ "$OS_DISTRO" == "rhel" ]] || [[ "$OS_DISTRO" == "centos" ]]; then + export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig + fi cd /tmp echo "Downloading protobuf-c" rm -rf /tmp/protobuf-c @@ -232,6 +235,27 @@ install_protobuf_c_from_source(){ ) >& $protobuf_c_install_log } +install_usrp_uhd_driver_from_source(){ + uhd_install_log=$OPENAIR_DIR/cmake_targets/log/uhd_install_log.txt + echo_info "\nInstalling UHD driver from sources. The log file for UHD driver installation is here: $uhd_install_log " + ( + cd /tmp + echo "Downloading UHD driver" + rm -rf /tmp/uhd + git clone git://github.com/EttusResearch/uhd.git + cd uhd + git checkout tags/release_003_010_001_001 + mkdir -p host/build + cd host/build + $CMAKE ../ + echo "Compiling UHD" + make + make test + $SUDO make install + $SUDO ldconfig + ) >& $uhd_install_log +} + check_install_usrp_uhd_driver(){ if [[ "$OS_DISTRO" == "ubuntu" ]]; then #first we remove old installation @@ -245,8 +269,14 @@ check_install_usrp_uhd_driver(){ $SUDO apt-get -y --allow-unauthenticated install python python-tk libboost-all-dev libusb-1.0-0-dev $SUDO apt-get -y --allow-unauthenticated install libuhd-dev libuhd003 uhd-host elif [[ "$OS_BASEDISTRO" == "fedora" ]]; then - $SUDO $INSTALLER -y install python boost libusb-devel boost-devel - $SUDO $INSTALLER -y install uhd uhd-devel uhd-firmware + $SUDO $INSTALLER -y install python boost libusb-devel libusbx-devel boost-devel python-mako python-docutils cmake + if [[ "$OS_DISTRO" == "rhel" ]] || [[ "$OS_DISTRO" == "centos" ]]; then + # until EPEL repo hasn't bumped UHD driver to >=3.10 in EPEL, build driver from source + $SUDO $INSTALLER -y remove uhd uhd-devel uhd-firmware + install_ursp_uhd_driver_from_source + else + $SUDO $INSTALLER -y install uhd uhd-devel uhd-firmware + fi fi } @@ -263,6 +293,33 @@ install_usrp_uhd_driver() { fi } +install_bladerf_driver_from_source(){ + bladerf_install_log=$OPENAIR_DIR/cmake_targets/log/bladerf_install_log.txt + echo_info "\nInstalling BladeRF driver from sources. The log file for BladeRF driver installation is here: $bladerf_install_log " + ( + cd /tmp + echo "Downloading BladeRF driver" + rm -rf /tmp/bladeRF + git clone https://github.com/Nuand/bladeRF.git + cd bladeRF + git checkout tags/2016.06 + mkdir -p build + cd build + $CMAKE ../ + echo "Compiling BladeRF driver" + make + $SUDO make install + $SUDO ldconfig + echo "Downloading FPGA and firmware images" + cd /tmp/bladeRF + wget https://www.nuand.com/fx3/bladeRF_fw_latest.img + wget https://www.nuand.com/fpga/hostedx40-latest.rbf + sudo mkdir -p /usr/share/Nuand/bladeRF + sudo mv bladeRF_fw_latest.img /usr/share/Nuand/bladeRF/bladeRF_fw.img + sudo mv hostedx40-latest.rbf /usr/share/Nuand/bladeRF/hostedx40.rbf + ) >& $bladerf_install_log +} + check_install_bladerf_driver(){ if [[ "$OS_DISTRO" == "ubuntu" ]]; then if [ "$(get_distribution_release)" == "ubuntu14.04" ] ; then @@ -272,6 +329,8 @@ check_install_bladerf_driver(){ $SUDO apt-get install -y --allow-unauthenticated bladerf libbladerf-dev $SUDO apt-get install -y --allow-unauthenticated bladerf-firmware-fx3 $SUDO apt-get install -y --allow-unauthenticated bladerf-fpga-hostedx40 + elif [[ "$OS_BASEDISTRO" == "fedora" ]]; then + install_bladerf_driver_from_source else echo_error "BladeRF Installer for OAI does not support automatic build. Install BladeRF compiling sources manually from BladeRF website" fi @@ -518,8 +577,9 @@ check_install_oai_software() { $SUDO $INSTALLER install -y \ autoconf \ automake \ + bc \ bison \ - $CMAKE_CMD \ + $CMAKE \ doxygen \ ethtool \ flex \ @@ -560,19 +620,22 @@ check_install_oai_software() { openssh-clients \ openssh-server \ openssl \ + patch \ + psmisc \ python \ subversion \ xmlstarlet \ python-pip \ wget \ kernel-headers \ + kernel-devel \ nettle-devel \ gnutls-devel \ libXpm-devel \ lapack \ lapack-devel \ blas \ - libblas-devel + blas-devel fi install_asn1c_from_source diff --git a/openair2/UTIL/LOG/log.h b/openair2/UTIL/LOG/log.h index 5140a08dbd..73ad99311f 100644 --- a/openair2/UTIL/LOG/log.h +++ b/openair2/UTIL/LOG/log.h @@ -45,6 +45,9 @@ #include #include #include +#ifndef __STDC_FORMAT_MACROS +#define __STDC_FORMAT_MACROS +#endif #include #ifndef _GNU_SOURCE #define _GNU_SOURCE