Commit 0f2a2698 authored by Siddharth Rana's avatar Siddharth Rana

Additional Changes for cmake_targets

parent d3bc5803
This diff is collapsed.
......@@ -106,8 +106,12 @@ check_supported_distribution() {
"ubuntu22.04") return 0 ;;
"ubuntu21.04") return 0 ;;
"ubuntu20.04") return 0 ;;
"ubuntu18.04") return 0 ;;
"ubuntu18.04") return 0 ;;
"ubuntu17.10") return 0 ;;
"ubuntu17.04") return 0 ;;
"ubuntu16.04") return 0 ;;
"ubuntu14.04") return 0 ;;
"fedora24") return 0 ;;
"fedora35") return 0 ;;
"fedora36") return 0 ;;
"rhel7") return 0 ;;
......@@ -160,6 +164,7 @@ clean_kernel() {
echo_info "Flushed iptables"
$SUDO rmmod nasmesh > /dev/null 2>&1
$SUDO rmmod oai_nw_drv > /dev/null 2>&1
$SUDO rmmod openair_rf > /dev/null 2>&1
$SUDO rmmod ue_ip > /dev/null 2>&1
echo_info "removed drivers from kernel"
}
......@@ -167,6 +172,7 @@ clean_kernel() {
clean_all_files() {
set_openair_env
dir=$OPENAIR_DIR/cmake_targets
rm -rf $dir/log $OPENAIR_DIR/targets/bin/*
rm -rf $dir/ran_build $dir/ran_build_noLOG
rm -rf $dir/lte-simulators/build
rm -rf $dir/nas_sim_tools/build
......@@ -245,6 +251,69 @@ compilations() {
# External packages installers
############################################
install_protobuf_from_source(){
protobuf_install_log=$OPENAIR_DIR/cmake_targets/log/protobuf_install_log.txt
echo_info "\nInstalling Google Protobuf from sources. The log file for Protobuf installation is here: $protobuf_install_log "
(
cd /tmp
echo "Downloading protobuf"
#rm -rf /tmp/protobuf-2.6.1.tar.gz* /tmp/protobuf-2.6.1
#wget https://github.com/protocolbuffers/protobuf/releases/download/v2.6.1/protobuf-2.6.1.tar.gz
#tar -xzvf protobuf-2.6.1.tar.gz --owner $USER --group $USER --no-same-owner
#cd protobuf-2.6.1/
if [ $IS_CONTAINER -eq 0 ]
then
rm -rf /tmp/protobuf-cpp-3.3.0.tar.gz* /tmp/protobuf-3.3.0
wget --tries=3 --retry-connrefused https://github.com/protocolbuffers/protobuf/releases/download/v3.3.0/protobuf-cpp-3.3.0.tar.gz
tar -xzvf protobuf-cpp-3.3.0.tar.gz --owner $(id -u) --group $(id -g) --no-same-owner
cd protobuf-3.3.0/
else
export LD_LIBRARY_PATH=/usr/local/lib #protoc needs to know where toclook for shared libs
rm -rf /tmp/protobuf
git clone --depth=1 --branch=v3.3.0 https://github.com/protocolbuffers/protobuf.git /tmp/protobuf
cd /tmp/protobuf
git submodule update --init --recursive
./autogen.sh
fi
./configure
echo "Compiling protobuf"
make -j`nproc`
$SUDO make install
$SUDO ldconfig
if [[ -v CI_ENV ]]; then
cd /tmp
$SUDO rm -rf protobuf*
fi
) >& $protobuf_install_log
}
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
git clone https://github.com/protobuf-c/protobuf-c.git
cd protobuf-c
git checkout 2a46af42784abf86804d536f6e0122d47cfeea45
./autogen.sh
./configure
echo "Compiling protobuf-c"
make -j`nproc`
$SUDO make install
$SUDO ldconfig
if [[ -v CI_ENV ]]; then
cd /tmp
$SUDO rm -rf protobuf*
fi
) >& $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 "
......@@ -426,6 +495,10 @@ install_bladerf_driver_from_source(){
check_install_bladerf_driver(){
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 bladerf libbladerf-dev
$SUDO apt-get install -y bladerf-firmware-fx3
$SUDO apt-get install -y bladerf-fpga-hostedx40
......@@ -544,6 +617,8 @@ check_install_additional_tools (){
libpthread-stubs0-dev \
openvpn \
pkg-config \
python-dev \
python-pexpect \
sshfs \
swig \
tshark \
......@@ -551,13 +626,18 @@ check_install_additional_tools (){
unzip \
valgrind \
vlan \
ctags \
ntpdate \
iperf3 \
android-tools-adb \
wvdial \
python-numpy \
sshpass \
nscd \
bc \
ntp"
ntp \
python-scipy \
python-matplotlib"
elif [[ "$OS_DISTRO" == "rhel" ]] || [[ "$OS_DISTRO" == "centos" ]]; then
PACKAGE_LIST="\
check \
......@@ -580,6 +660,7 @@ check_install_additional_tools (){
wvdial \
numpy \
sshpass \
nscd \
python2-paramiko \
python-pyroute2 \
python-netifaces \
......@@ -602,18 +683,26 @@ check_install_additional_tools (){
valgrind \
vconfig \
ctags \
ntpdate \
ntpsec \
iperf3 \
wvdial \
python-numpy \
sshpass \
python-paramiko \
nscd \
python2-paramiko \
python-pyroute2 \
python-netifaces \
python-scipy \
python-matplotlib"
python2-scipy \
python2-matplotlib"
fi
$SUDO $INSTALLER install -y $PACKAGE_LIST $optional_packages
$SUDO $INSTALLER install -y $PACKAGE_LIST
$SUDO rm -fr /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
......@@ -644,6 +733,12 @@ check_install_oai_software() {
local LAPACK_TARGET="/usr/lib/atlas-base/atlas/liblapack.so"
$SUDO apt install -y software-properties-common
case "$(get_distribution_release)" in
"ubuntu14.04")
specific_packages="libtasn1-3-dev libgnutls-dev libatlas-dev iproute libconfig8-dev iptables libidn2-0-dev guile-2.0-dev libgcrypt11-dev pydb python iptables-dev"
# For iperf3
$SUDO add-apt-repository "deb http://archive.ubuntu.com/ubuntu trusty-backports universe iptables python-pip"
$SUDO apt-get update
;;
"ubuntu16.04")
specific_packages="libtasn1-6-dev libgnutls-dev libatlas-dev iproute libconfig8-dev iptables-dev libgcrypt11-dev python-pip pydb python guile-2.0-dev"
;;
......@@ -719,6 +814,7 @@ check_install_oai_software() {
openssl \
subversion \
xmlstarlet \
libyaml-dev \
wget \
libxpm-dev \
libboost-all-dev
......@@ -735,6 +831,8 @@ check_install_oai_software() {
$SUDO $INSTALLER install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
fi
$SUDO $INSTALLER install -y python-epdb vim-common
else
$SUDO $INSTALLER install -y pydb
fi
$SUDO $INSTALLER install -y \
......@@ -799,11 +897,14 @@ check_install_oai_software() {
lapack \
lapack-devel \
blas \
blas-devel
blas-devel \
libyaml-devel
fi
install_asn1c_from_source $1
install_simde_from_source $1
$SUDO rm -fr /opt/ssh
$SUDO git clone https://gist.github.com/2190472.git /opt/ssh
}
install_asn1c_from_source(){
......@@ -922,3 +1023,53 @@ do
fi
done
}
install_simde_from_source(){
echo_info "\nInstalling SIMDE from source without test cases (header files only)"
cd /tmp
$SUDO rm -rf /tmp/simde
git clone https://github.com/simd-everywhere/simde-no-tests.git /tmp/simde
cd /tmp/simde
# brute force copy into /usr/include
$SUDO \cp -rv ../simde /usr/include
$SUDO patch -p1 /usr/include/simde/x86/avx.h << FIN
/usr/include/simde/x86/avx.h | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/usr/icnlude/x86/avx.h b/usr/include/x86/avx.h
index a10974c..a7fcf8c 100644
--- a/usr/include/x86/avx.h
+++ b/usr/include/x86/avx.h
@@ -3643,6 +3643,11 @@ simde__m256i simde_mm256_insertf128_si256(simde__m256i a, simde__m128i b, int im
return simde__m256i_from_private(a_);
}
+
+#if defined(SIMDE_X86_AVX_NATIVE)
+ #define simde_mm256_insertf128_si256(a, b, imm8) _mm256_insertf128_si256(a, b, imm8)
+#endif
+
#if defined(SIMDE_X86_AVX_ENABLE_NATIVE_ALIASES)
#undef _mm256_insertf128_si256
#define _mm256_insertf128_si256(a, b, imm8) simde_mm256_insertf128_si256(a, b, imm8)
FIN
}
# get from http://www.linuxjournal.com/content/validating-ip-address-bash-script
validate_ip() {
local ip=$1
local stat=1
if [[ $ip =~ ^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$ ]]; then
OIFS=$IFS
IFS='.'
ip=($ip)
IFS=$OIFS
[[ ${ip[0]} -le 255 && ${ip[1]} -le 255 \
&& ${ip[2]} -le 255 && ${ip[3]} -le 255 ]]
stat=$?
fi
return $stat
}
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