Advertisement
Guest User

Untitled

a guest
Jan 29th, 2021
796
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 3.48 KB | None | 0 0
  1. #!/usr/bin/env bash
  2.  
  3. export RTE_TARGET_O=x86_64-native-linuxapp-gcc
  4. export RTE_TARGET=$RTE_TARGET_O
  5. export RTE_SDK=$(pwd)/dpdk-19.11
  6.  
  7. export GTEST_ROOT=$(pwd)/googletest-release-1.7.0
  8. export GTEST_DIR=$(pwd)/googletest-release-1.7.0
  9. export DIR_ROOT_GTEST=$GTEST_DIR
  10.  
  11. export DIR_ROOT=$(pwd)/oran
  12. export DIR_ROOT_PHY=$DIR_ROOT/phy
  13. export DIR_ROOT_L1_BIN=$DIR_ROOT/FlexRAN
  14.  
  15. export XRAN_DIR=$DIR_ROOT_PHY/fhi_lib
  16. export XRAN_LIB_SO=1
  17.  
  18.  
  19. func run_octave()
  20. {
  21.     # Install docker if not found
  22.     if ! which docker > /dev/null;
  23.     then
  24.         sudo apt-get install apt-transport-https ca-certificates \
  25.         curl gnupg-agent software-properties-common
  26.         curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
  27.         apt update
  28.         sudo apt-get install docker-ce docker-ce-cli containerd.io
  29.     fi
  30.    
  31.     # Run octave version 3.8.1 from docker
  32.     docker run -i -t --rm --name octavecli -v $HOME:$HOME \
  33.     --user $UID:$GID simexp/octave:3.8.1 /bin/bash -c "export \
  34.     HOME=$HOME; USER=$USER; cd $(pwd); source \
  35.     /opt/minc-itk4/minc-toolkit-config.sh; octave $1"
  36. }
  37.  
  38. # Clone du-low repository
  39. mkdir -p oran
  40. cd oran
  41. git clone https://gerrit.o-ran-sc.org/r/o-du/phy.git phy
  42. cd ../
  43.  
  44. # Install intel compiler if not found
  45. if ! which /opt/intel/system_studio_2020/compilers_and_libraries_2020.2.254/linux/bin/intel64/icc > /dev/null;
  46. then
  47.  
  48.     wget https://registrationcenter-download.intel.com/akdlm/IRC_NAS/16789/system_studio_2020_u2_ultimate_edition_offline.tar.gz
  49.     tar -zxvf system_studio_2020_u2_ultimate_edition_offline.tar.gz
  50.     sudo mkdir -p /opt/intel/
  51.     sudo cp license.lic /opt/intel/license.lic
  52.     cd system_studio_2020_u2_ultimate_edition_offline
  53.     sed -i "s/ACCEPT_EULA.*/ACCEPT_EULA=accept/" silent.cfg && \
  54.     sed -i "s/PSET_INSTALL_DIR.*/PSET_INSTALL_DIR=\/opt\/intel/" silent.cfg && \
  55.     sed -i "s/.*ACTIVATION_LICENSE_FILE.*/ACTIVATION_LICENSE_FILE=\/opt\/intel\/license.lic/" silent.cfg && \
  56.     sed -i "s/ACTIVATION_TYPE.*/ACTIVATION_TYPE=license_file/" silent.cfg
  57.     sudo ./install.sh -s silent.cfg
  58.     cd ../
  59. fi
  60.  
  61.  
  62. # Setup intel compiler environment
  63. source /opt/intel/system_studio_2020/bin/iccvars.sh intel64
  64. export PATH=/opt/intel/system_studio_2020/bin/:$PATH
  65.  
  66.  
  67. # Clone Intel flexran
  68. cd $DIR_ROOT
  69. git clone https://github.com/intel/FlexRAN.git
  70. cd ../
  71.  
  72. # Build gtest
  73. wget https://github.com/google/googletest/archive/release-1.7.0.tar.gz
  74. tar -zxvf release-1.7.0.tar.gz
  75. cd googletest-release-1.7.0
  76. g++ -isystem ${GTEST_DIR}/include -I${GTEST_DIR} -pthread -c ${GTEST_DIR}/src/gtest-all.cc
  77. ar -rv libgtest.a gtest-all.o && cd build-aux/ && cmake $GTEST_DIR && make && cd .. && ln -s build-aux/libgtest_main.a libgtest_main.a
  78. cd ../
  79.  
  80. # Build dpdk
  81. sudo apt install libnuma-dev ethtool net-tools pciutils -y
  82. wget http://static.dpdk.org/rel/dpdk-19.11.tar.xz
  83. tar -xf dpdk-19.11.tar.xz
  84. cd $RTE_SDK
  85. make config T=$RTE_TARGET O=$RTE_TARGET
  86. cd $RTE_SDK/$RTE_TARGET
  87. sed -i "s/CONFIG_RTE_EAL_IGB_UIO=y/CONFIG_RTE_EAL_IGB_UIO=n/"  .config
  88. sed -i "s/CONFIG_RTE_KNI_KMOD=y/CONFIG_RTE_KNI_KMOD=n/"  .config
  89. make -j
  90.  
  91.  
  92. # Setup du-low environment
  93. cd $DIR_ROOT_PHY
  94. sed -i "s/export DIR_ROOT=\/home\//#export DIR_ROOT=\/home\//" setupenv.sh
  95. . setupenv.sh
  96. sudo apt install libhugetlbfs-dev -y # Required for wls lib
  97. # Build XRAN lib, unittests, sample app
  98. cd $DIR_ROOT_PHY/fhi_lib/
  99. ./build.sh
  100. cd app && run_octave gen_test.m && cd ../
  101. # Build wls lib
  102. cd $DIR_ROOT_PHY/wls_lib
  103. make -j
  104. cd testapp
  105. make -j
  106. # Build 5g fapi
  107. cd $DIR_ROOT_PHY/fapi_5g/build
  108. ./build.sh
  109.  
  110. export RTE_TARGET=$RTE_TARGET_O
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement