build_oai 35.8 KB
Newer Older
thomasl's avatar
thomasl committed
1
#!/bin/bash
2 3 4 5 6
#/*
# * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
# * contributor license agreements.  See the NOTICE file distributed with
# * this work for additional information regarding copyright ownership.
# * The OpenAirInterface Software Alliance licenses this file to You under
Cedric Roux's avatar
Cedric Roux committed
7
# * the OAI Public License, Version 1.1  (the "License"); you may not use this file
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
# * except in compliance with the License.
# * You may obtain a copy of the License at
# *
# *      http://www.openairinterface.org/?page_id=698
# *
# * Unless required by applicable law or agreed to in writing, software
# * distributed under the License is distributed on an "AS IS" BASIS,
# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# * See the License for the specific language governing permissions and
# * limitations under the License.
# *-------------------------------------------------------------------------------
# * For more information about the OpenAirInterface (OAI) Software Alliance:
# *      contact@openairinterface.org
# */

23
# file build_oai
thomasl's avatar
thomasl committed
24 25 26
# brief OAI automated build tool that can be used to install, compile, run OAI.
# author  Navid Nikaein, Lionel GAUTHIER, Laurent Thomas

FredericLeroy's avatar
FredericLeroy committed
27
set -e
thomasl's avatar
thomasl committed
28 29 30 31

################################
# include helper functions
################################
thomasl's avatar
thomasl committed
32
ORIGIN_PATH=$PWD
thomasl's avatar
thomasl committed
33
THIS_SCRIPT_PATH=$(dirname $(readlink -f $0))
34
source $THIS_SCRIPT_PATH/tools/build_helper
thomasl's avatar
thomasl committed
35

36 37 38 39 40 41 42
# set environment variables (OPENAIR_HOME, ...)
set_openair_env

#variables for UE data generation
gen_nvram_path=$OPENAIR_DIR/targets/bin
conf_nvram_path=$OPENAIR_DIR/openair3/NAS/TOOLS/ue_eurecom_test_sfr.conf

43
MSC_GEN="False"
44
XFORMS="True"
45
PRINT_STATS="False"
thomasl's avatar
thomasl committed
46
VCD_TIMING="False"
laurent's avatar
laurent committed
47 48
DEADLINE_SCHEDULER_FLAG_USER="False"
FORCE_DEADLINE_SCHEDULER_FLAG_USER=""
49
CPU_AFFINITY_FLAG_USER="False" #Only valid when lowlatecy flag is set to False
Cedric Roux's avatar
Cedric Roux committed
50
REL="Rel14"
ChenWeiTai's avatar
ChenWeiTai committed
51
NR_REL="NR_Rel15"
52
HW="None"
53
TP="None"
Florian Kaltenberger's avatar
Florian Kaltenberger committed
54
NOS1=0
Wang's avatar
Wang committed
55
HW_LATENCY=0
gauthier's avatar
gauthier committed
56
EPC=0
57
VERBOSE_COMPILE=0
58
CFLAGS_PROCESSOR_USER=""
59 60
RUN_GROUP=0
TEST_CASE_GROUP=""
61
BUILD_DOXYGEN=0
62
T_TRACER="False"
Rohit Gupta's avatar
Rohit Gupta committed
63
DISABLE_HARDWARE_DEPENDENCY="False"
64
CMAKE_BUILD_TYPE=""
65
CMAKE_CMD="$CMAKE"
66
UE_AUTOTEST_TRACE="False"
Gabriel's avatar
Gabriel committed
67 68
UE_DEBUG_TRACE="False"
UE_TIMING_TRACE="False"
Cedric Roux's avatar
Cedric Roux committed
69
DISABLE_LOG_X="False"
70
USRP_REC_PLAY="False"
71
BUILD_ECLIPSE=0
Guy De Souza's avatar
Guy De Souza committed
72
NR="False"
73
UE_NAS_USE_TUN="False"
74

75 76
trap handle_ctrl_c INT

77
function print_help() {
Cedric Roux's avatar
Cedric Roux committed
78
  echo_info "
79 80 81 82 83 84
This program installs OpenAirInterface Software
You should have ubuntu 14.xx, updated, and the Linux kernel >= 3.14
Options
-h
   This help
-c | --clean
Cedric Roux's avatar
Cedric Roux committed
85
   Erase all files to make a rebuild from start
86
-C | --clean-all
Cedric Roux's avatar
Cedric Roux committed
87
   Erase all files made by previous compilations, installations
88 89
--clean-kernel
   Erase previously installed features in kernel: iptables, drivers, ...
gauthier's avatar
gauthier committed
90
-I | --install-external-packages
91 92 93 94 95
   Installs required packages such as LibXML, asn1.1 compiler, freediameter, ...
   This option will require root password
--install-optional-packages
   Install useful but not mandatory packages such as valgrind
-g | --run-with-gdb
96
   Add debugging symbols to compilation directives. It also disables any compiler optimization. Only for debugging. Do not use in normal operation!
97 98 99
-h | --help
   Print this help
--eNB
Guy De Souza's avatar
Guy De Souza committed
100 101 102 103 104
  Makes the LTE softmodem
--gNB
  Makes the NR softmodem
--nrUE
  Makes the NR UE softmodem
105
--UE
106
   Makes the UE specific parts (ue_ip, usim, nvram) from the given configuration file
Cedric Roux's avatar
Cedric Roux committed
107 108 109 110
--UE-conf-nvram [configuration file]
   Specify conf_nvram_path (default \"$conf_nvram_path\")
--UE-gen-nvram [output path]
   Specify gen_nvram_path (default \"$gen_nvram_path\")
Wang's avatar
Wang committed
111 112
--HWLAT
    Makes test program for haw latency tests
113
-r | --3gpp-release
Cedric Roux's avatar
Cedric Roux committed
114
   default is Rel14,
115
   Rel8 limits the implementation to 3GPP Release 8 version
Cedric Roux's avatar
Cedric Roux committed
116
   Rel10 limits the implementation to 3GPP Release 10 version
117
-w | --hardware
Wang's avatar
Wang committed
118
   EXMIMO, USRP, BLADERF, ETHERNET, LMSSDR, ADRV9371_ZC706, None (Default)
119
   Adds this RF board support (in external packages installation and in compilation)
120 121 122
-t | --transport protocol
   ETHERNET , None
   Adds this trasport protocol support in compilation
123
--oaisim
Cedric Roux's avatar
Cedric Roux committed
124
   Makes the oaisim simulator. Hardware will be defaulted to \"None\".
125 126 127 128 129 130
--phy_simulators
   Makes the unitary tests Layer 1 simulators
--core_simulators
   Makes the core security features unitary simulators
-s | --check
   runs a set of auto-tests based on simulators and several compilation tests
131 132
--run-group 
   runs only specified test cases specified here. This flag is only valid with -s
133 134 135
-V | --vcd
   Adds a debgging facility to the binary files: GUI with major internal synchronization events
-x | --xforms
136
   Adds a software oscilloscope feature to the produced binaries. If oaisim, then enable PRINT_STATS.
137
--install-system-files
gauthier's avatar
gauthier committed
138
   Install OpenArInterface required files in Linux system
139
   (will ask root password)
140 141
--noS1 
   Compiles oaisim or lte-softmodem without S1 interface, using direct link to IP instead
142 143
--verbose-compile
   Shows detailed compilation instructions in makefile
144 145
--cflags_processor
   Manually Add CFLAGS of processor if they are not detected correctly by script. Only add these flags if you know your processor supports them. Example flags: -msse3 -msse4.1 -msse4.2 -mavx2
146 147
--build-doxygen
   Builds doxygen based documentation.
148
--disable-deadline
149 150
   Disables deadline scheduler of Linux kernel (>=3.14.x).
--enable-deadline
laurent's avatar
laurent committed
151
   Enable deadline scheduler of Linux kernel (>=3.14.x). 
Rohit Gupta's avatar
Rohit Gupta committed
152
--disable-cpu-affinity
153
   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
154 155
--T-tracer
   Enables the T tracer.
Rohit Gupta's avatar
Rohit Gupta committed
156 157
--disable-hardware-dependency
   Disable HW dependency during installation
158 159
--ue-autotest-trace
    Enable specific traces for UE autotest framework
Gabriel's avatar
Gabriel committed
160 161 162 163
--ue-trace
    Enable traces for UE debugging
--ue-timing
    Enable traces for timing
Cedric Roux's avatar
Cedric Roux committed
164 165
--disable-log
   Disable all LOG_* macros
166 167
--build-eclipse
   Build eclipse project files. Paths are auto corrected by fixprj.sh
168 169
--usrp-recplay
   Build for I/Q record-playback modes
170 171
--ue-nas-use-tun
   Use TUN devices for the UEs instead of ue_ip.ko
172
Usage (first build):
173 174 175
 oaisim (eNB + UE): ./build_oai -I  --oaisim -x --install-system-files
 Eurecom EXMIMO + COTS UE : ./build_oai -I  --eNB -x --install-system-files
 NI/ETTUS B201  + COTS UE : ./build_oai -I  --eNB -x --install-system-files -w USRP
176 177 178
Usage (Regular):
 oaisim : ./build_oai --oaisim -x 
 Eurecom EXMIMO + OAI ENB : ./build_oai --eNB -x 
Cedric Roux's avatar
Cedric Roux committed
179
 NI/ETTUS B201  + OAI ENB : ./build_oai --eNB -x -w USRP"
180 181 182 183
}


function main() {
184

185 186
  until [ -z "$1" ]
  do
187
    case "$1" in
188 189 190 191 192
       -c | --clean)
            CLEAN=1
            shift;;
       -C | --clean-all)
            CLEAN_ALL=1
thomasl's avatar
thomasl committed
193
            shift;;
194 195 196
       --clean-kernel)
            clean_kernel
            echo_info "Erased iptables config and removed modules from kernel"
thomasl's avatar
thomasl committed
197
            shift;;
198
       -I | --install-external-packages)
199
            INSTALL_EXTERNAL=1
200
            echo_info "Will install external packages"
thomasl's avatar
thomasl committed
201
            shift;;
202
       --install-optional-packages)
thomasl's avatar
thomasl committed
203 204 205
            INSTALL_OPTIONAL=1
            echo_info "Will install optional packages"
            shift;;
206
       -g | --run-with-gdb)
thomasl's avatar
thomasl committed
207
            GDB=1
208 209
            CMAKE_BUILD_TYPE="Debug"
            echo_info "Will Compile with gdb symbols and disable compiler optimization"
210
            CMAKE_CMD="$CMAKE_CMD -DCMAKE_BUILD_TYPE=Debug --trace-expand"
thomasl's avatar
thomasl committed
211
            shift;;
212 213 214 215
       --eNB)
            eNB=1
            echo_info "Will compile eNB"
            shift;;
Guy De Souza's avatar
Guy De Souza committed
216 217 218 219 220
       --gNB)
            gNB=1
            NR="True"
            echo_info "Will compile gNB"
            shift;;
221
       -a | --agent)
Guy De Souza's avatar
Guy De Souza committed
222 223
            echo_info "FlexRAN support is always compiled into the eNB"
            shift;;
224 225 226 227
       --UE)
            UE=1
            echo_info "Will compile UE"
            shift;;
Guy De Souza's avatar
Guy De Souza committed
228 229 230 231 232
       --nrUE)
            nrUE=1
            NR="True"
            echo_info "Will compile NR UE"
            shift;;
Cedric Roux's avatar
Cedric Roux committed
233 234 235 236
       --UE-conf-nvram)
            conf_nvram_path=$(readlink -f "$1")
            shift 2;;
        --UE-gen-nvram)
237 238
            gen_nvram_path=$(readlink -f $2)
            shift 2;;
thomasl's avatar
thomasl committed
239
       -r | --3gpp-release)
gauthier's avatar
gauthier committed
240
            REL=$2
241
            echo_info "Setting release to: $REL"
thomasl's avatar
thomasl committed
242 243 244
            shift 2;;
       -w | --hardware)
            HW="$2" #"${i#*=}"
Wang's avatar
Wang committed
245 246
            # Use OAI_USRP  as the key word USRP is used inside UHD driver
	    if [ "$HW" != "BLADERF" -a  "$HW" != "USRP" -a "$HW" != "LMSSDR" -a  "$HW" != "None" -a  "$HW" != "EXMIMO" -a  "$HW" != "ADRV9371_ZC706"  ] ; then 
247 248 249 250 251
		echo_fatal "Unknown HW type $HW will exit..."		
	    else
		if [ "$HW" == "USRP" ] ; then 
		    HW="OAI_USRP"
		fi 
Wang's avatar
Wang committed
252 253 254
		if [ "$HW" == "ADRV9371_ZC706" ] ; then 
		    HW="OAI_ADRV9371_ZC706"
		fi 
255 256 257
		if [ "$HW" == "BLADERF" ] ; then 
		    HW="OAI_BLADERF"
		fi
258 259 260
		if [ "$HW" == "LMSSDR" ] ; then 
		    HW="OAI_LMSSDR"
		fi 
261 262
		echo_info "Setting hardware to: $HW"
	    fi
thomasl's avatar
thomasl committed
263
            shift 2;;
264 265
	-t | --transport_protocol)
            TP="$2" #"${i#*=}"
266 267 268 269 270
	    if [ "$TP" != "ETHERNET" -a "$TP" != "None" ] ; then 
		echo_fatal "Unknown TP type $TP will exit..."		
	    else
		echo_info "Setting transport protocol to: $TP"		
	    fi
thomasl's avatar
thomasl committed
271
            shift 2;;
272
	--oaisim)
273 274 275 276
            oaisim=1
            echo_info "Will compile oaisim and drivers nasmesh, ..."
            shift;;
       --phy_simulators)
thomasl's avatar
thomasl committed
277
            SIMUS_PHY=1
278 279 280 281 282 283
            echo_info "Will compile dlsim, ulsim, ..."
            shift;;
       --core_simulators)
            SIMUS_CORE=1
            echo_info "Will compile security unitary tests"
            shift;;
thomasl's avatar
thomasl committed
284 285
       -s | --check)
            OAI_TEST=1
286
            echo_info "Will run auto-tests"
thomasl's avatar
thomasl committed
287
            shift;;
288 289 290 291 292
       --run-group)
            RUN_GROUP=1
            TEST_CASE_GROUP=$2
            echo_info "executing test cases only in group: $TEST_CASE_GROUP"
            shift 2;;
thomasl's avatar
thomasl committed
293
       -V | --vcd)
294
            echo_info "Setting gtk-wave output"
thomasl's avatar
thomasl committed
295 296
            VCD_TIMING=1
            EXE_ARGUMENTS="$EXE_ARGUMENTS -V"
thomasl's avatar
thomasl committed
297
            shift;;
thomasl's avatar
thomasl committed
298
       -x | --xforms)
299
            XFORMS="True"
thomasl's avatar
thomasl committed
300
            EXE_ARGUMENTS="$EXE_ARGUMENTS -d"
301
            echo_info "Will generate the software oscilloscope features"
thomasl's avatar
thomasl committed
302
            shift;;
303 304 305 306
       --install-system-files)
            INSTALL_SYSTEM_FILES=1
            echo_info "Will copy OpenAirInterface files in Linux directories"
            shift;;
307 308 309 310
       --noS1)
	    NOS1=1
            echo_info "Will compile without S1 interface"
            shift;;
Wang's avatar
Wang committed
311 312 313 314 315 316 317 318
       --HWLAT)
            HWLAT=1
            echo_info "Will compile hw latency test program"
            shift;;
       --HWLAT_TEST)
            HWLAT_TEST=1
            echo_info "Will compile hw latency test program"
            shift;;
319 320 321 322
       --verbose-compile)
	    VERBOSE_COMPILE=1
            echo_info "Will compile with verbose instructions"
            shift;;
323 324
       --cflags_processor)
            CFLAGS_PROCESSOR_USER=$2
325
            echo_info "Setting CPU FLAGS from USER to: $CFLAGS_PROCESSOR_USER"
326
            shift 2;;
327 328 329 330
       --build-doxygen)
	    BUILD_DOXYGEN=1
            echo_info "Will build doxygen support"
            shift;;     
331
       --disable-deadline)
laurent's avatar
laurent committed
332
            FORCE_DEADLINE_SCHEDULER_FLAG_USER="False"
333 334
            echo_info "Disabling the usage of deadline scheduler"
            shift 1;;
335
       --enable-deadline)
laurent's avatar
laurent committed
336
            FORCE_DEADLINE_SCHEDULER_FLAG_USER="True"
337 338
            echo_info "Enabling the usage of deadline scheduler"
            shift 1;;
Rohit Gupta's avatar
Rohit Gupta committed
339 340 341 342
       --disable-cpu-affinity)
            CPU_AFFINITY_FLAG_USER="False"
            echo_info "Disabling CPU Affinity (only valid when not using deadline scheduler)"
            shift 1;;
343 344 345 346
       --T-tracer)
            T_TRACER="True"
            echo_info "Enabling the T tracer"
            shift 1;;
347 348 349 350
       --disable-hardware-dependency)
            echo_info "Disabling hardware dependency for compiling software"
            DISABLE_HARDWARE_DEPENDENCY="True"
            shift 1;;
351 352 353 354
        --ue-autotest-trace)
            UE_AUTOTEST_TRACE="True"
            echo_info "Enabling autotest specific trace for UE"
            shift 1;;
Gabriel's avatar
Gabriel committed
355 356 357 358 359 360 361 362
        --ue-trace)
            UE_DEBUG_TRACE="True"
            echo_info "Enabling UE trace for debug"
            shift 1;;
        --ue-timing)
            UE_TIMING_TRACE="True"
            echo_info "Enabling UE timing trace"
            shift 1;;
Cedric Roux's avatar
Cedric Roux committed
363 364 365 366
        --disable-log)
            DISABLE_LOG_X="True"
            echo_info "Disabling all LOG_* traces"
            shift 1;;
367 368 369 370
        --uhd-images-dir)
            UHD_IMAGES_DIR=$2
            echo_info "Downloading UHD images in the indicated location"
            shift 2;;
371 372 373 374
       --build-eclipse)
            BUILD_ECLIPSE=1
            CMAKE_CMD="$CMAKE_CMD"' -DCMAKE_ECLIPSE_GENERATE_SOURCE_PROJECT=TRUE -G"Eclipse CDT4 - Unix Makefiles"'
            echo_info "Enabling build eclipse project support"
oai's avatar
oai committed
375 376 377 378 379
            shift 1;;
       --build-telnetsrv)
            BUILD_TELNETSRV=1
            echo_info "Build embedded telnet server"
            shift ;;			
380 381 382 383
        --usrp-recplay)
            USRP_REC_PLAY="True"
            echo_info "Enabling USRP record playback mode"
            shift 1;;
384 385 386 387
        --ue-nas-use-tun)
            UE_NAS_USE_TUN="True"
            echo_info "Enabling UE NAS TUN device usage instead of ue_ip.ko"
            shift 1;;
thomasl's avatar
thomasl committed
388 389 390
        -h | --help)
            print_help
            exit 1;;
gauthier's avatar
gauthier committed
391
	*)
392 393
	    print_help
            echo_fatal "Unknown option $1"
thomasl's avatar
thomasl committed
394
            break;;
thomasl's avatar
thomasl committed
395
   esac
396
  done
397
  
398 399
  CMAKE_CMD="$CMAKE_CMD .."
  echo_info "CMAKE_CMD=$CMAKE_CMD"
Guy De Souza's avatar
Guy De Souza committed
400 401
  if [ "$eNB" = "1" -o "$gNB" = "1" ] && [ "$UE" = "1" -o "$nrUE" = "1" ]; then
    echo_error "Cannot build UE/nrUE and eNB/gNB on one build_oai execution"
402 403
    echo_error "use 2 build_oai invocations"
    exit
Guy De Souza's avatar
Guy De Souza committed
404 405
  fi

406
  #########################################################
Guy De Souza's avatar
Guy De Souza committed
407
  # check validity of HW and TP parameters for eNB / gNB
408
  #########################################################
409
  # to be discussed
410
  
Guy De Souza's avatar
Guy De Souza committed
411
  if [ "$eNB" = "1" -o "$gNB" = "1" ] ; then
412 413
      if [ "$HW" = "None" -a  "$TP" = "None" ] ; then
	  echo_fatal "Define a local radio head (e.g. -w EXMIMO) or a transport protocol (e.g. -t ETHERNET) to communicate with a remote radio head!"
414
      fi
415 416
      if [ "$HW" = "None" ] ; then 
	  echo_info "No radio head has been selected (HW set to $HW)"	
417
      fi
418 419
      if [ "$TP" = "None" ] ; then
	  echo_info "No transport protocol has been selected (TP set to $TP)"	
420 421 422
      fi
  fi
  
Wang's avatar
Wang committed
423 424 425 426 427 428
  if [ "$HWLAT" = "1" ] ; then
      if [ "$HW" = "None" ] ; then
    echo_info "No radio head has been selected (HW set to $HW)" 
      fi
  fi

knopp's avatar
knopp committed
429
  echo_info "RF HW set to $HW" 
430 431 432 433
  #Now we set flags to enable deadline scheduler settings
  #By default: USRP: disable, 
  #By default: BLADERF: enable,
  #By default: EXMIMO: enable
laurent's avatar
laurent committed
434
  if [ "$FORCE_DEADLINE_SCHEDULER_FLAG_USER" = "" ]; then
435
     if [ "$HW" = "EXMIMO" ] ; then 
436
        DEADLINE_SCHEDULER_FLAG_USER="True"
437
     elif [ "$HW" = "ETHERNET" ] ; then 
438
        DEADLINE_SCHEDULER_FLAG_USER="False"
439
     elif [ "$HW" = "OAI_USRP" ] ; then 
laurent's avatar
laurent committed
440
        DEADLINE_SCHEDULER_FLAG_USER="False"
Wang's avatar
Wang committed
441 442
     elif [ "$HW" = "OAI_ADRV9371_ZC706" ] ; then 
        DEADLINE_SCHEDULER_FLAG_USER="False"
443
     elif [ "$HW" = "OAI_BLADERF" ] ; then 
laurent's avatar
laurent committed
444
        DEADLINE_SCHEDULER_FLAG_USER="False"
445
     elif [ "$HW" = "OAI_LMSSDR" ] ; then 
laurent's avatar
laurent committed
446
        DEADLINE_SCHEDULER_FLAG_USER="False"
447
     elif [ "$HW" = "None" ] ; then 
laurent's avatar
laurent committed
448
        DEADLINE_SCHEDULER_FLAG_USER="False"
449 450 451 452 453
     else 
        echo_error "Unknown HW type $HW. Exiting now..."
        exit 
     fi
  else
laurent's avatar
laurent committed
454
     DEADLINE_SCHEDULER_FLAG_USER=$FORCE_DEADLINE_SCHEDULER_FLAG_USER
455 456
  fi

Rohit Gupta's avatar
Rohit Gupta committed
457
  #Disable CPU Affinity for deadline scheduler
laurent's avatar
laurent committed
458
  if [ "$DEADLINE_SCHEDULER_FLAG_USER" = "True" ] ; then 
Rohit Gupta's avatar
Rohit Gupta committed
459 460
     CPU_AFFINITY_FLAG_USER="False"
  fi
461

laurent's avatar
laurent committed
462
  echo_info "Flags for Deadline scheduler: $DEADLINE_SCHEDULER_FLAG_USER"
Rohit Gupta's avatar
Rohit Gupta committed
463
  echo_info "Flags for CPU Affinity: $CPU_AFFINITY_FLAG_USER"
464

465 466 467 468
  if [ -n "$UHD_IMAGES_DIR" ] && [ -z "$INSTALL_EXTERNAL" ]; then
    echo_error "UHD images download settings will not be applied without -I present"
    exit
  fi
469 470 471
  ############################################
  # setting and printing OAI envs, we should check here
  ############################################
gauthier's avatar
gauthier committed
472

473
  echo_info "2. Setting the OAI PATHS ..."
thomasl's avatar
thomasl committed
474

475
  cecho "OPENAIR_DIR    = $OPENAIR_DIR" $green
thomasl's avatar
thomasl committed
476

477 478 479 480 481 482 483 484 485 486
  # for conf files copy in this bash script
  if [ -d /usr/lib/freeDiameter ]; then
    export FREEDIAMETER_PREFIX=/usr
  else
    if [ -d /usr/local/lib/freeDiameter ]; then
      export FREEDIAMETER_PREFIX=/usr/local
    else
      echo_warning "FreeDiameter prefix not found, install freeDiameter if EPC, HSS"
    fi
  fi
thomasl's avatar
thomasl committed
487

488

489 490 491 492
  if [ "$CLEAN_ALL" = "1" ] ; then
    clean_all_files
    echo_info "Erased all previously producted files"
  fi
493

494 495 496 497 498 499 500
  dbin=$OPENAIR_DIR/targets/bin
  dlog=$OPENAIR_DIR/cmake_targets/log
  mkdir -p $dbin $dlog

  if [ "$INSTALL_EXTERNAL" = "1" ] ; then
    echo_info "Installing packages"
    check_install_oai_software
501 502 503
    if [ "$HW" == "OAI_USRP" ] ; then
      echo_info "installing packages for USRP support"
      check_install_usrp_uhd_driver
504
      if [ ! "$DISABLE_HARDWARE_DEPENDENCY" == "True" ]; then
505
        install_usrp_uhd_driver $UHD_IMAGES_DIR
506
      fi
507
    fi 
Wang's avatar
Wang committed
508 509 510 511
    if [ "$HW" == "OAI_ADRV9371_ZC706" ] ; then
      echo_info "\nInstalling packages for ADRV9371_ZC706 support"
      check_install_libiio_driver
    fi 
512
    if [ "$HW" == "OAI_BLADERF" ] ; then
513
      echo_info "installing packages for BLADERF support"
514
      check_install_bladerf_driver
515 516 517
      if [ ! "$DISABLE_HARDWARE_DEPENDENCY" == "True" ]; then
        flash_firmware_bladerf
      fi
518
    fi
519 520 521
    echo_info "installing protobuf/protobuf-c for flexran agent support"
    install_protobuf_from_source
    install_protobuf_c_from_source
522 523 524 525 526 527 528
  fi

  if [ "$INSTALL_OPTIONAL" = "1" ] ; then
    echo_info "Installing optional packages"
    check_install_additional_tools
  fi

529
  if [ "$oaisim" = "1" ] ; then
530
      #to be discussed
531
      # there is no RF device  transport protocol 
532
      HW="None" 
533
      TP="ETHERNET"
534
      
535 536 537 538 539 540
      if [ "$XFORMS" == "True" ] ; then 
	  PRINT_STATS="True"
      fi 
  fi
  
  
541 542 543
  echo_info "3. building the compilation directives ..."

  DIR=$OPENAIR_DIR/cmake_targets
Guy De Souza's avatar
Guy De Souza committed
544
  if [ "$NOS1" = "1" ] ; then
Guy De Souza's avatar
Guy De Souza committed
545
      build_dir=noS1_ran_build
Guy De Souza's avatar
Guy De Souza committed
546
      if [ "$gNB" = "1" ] ; then
tct-labo4's avatar
tct-labo4 committed
547
         exec=nr-softmodem-nos1
Guy De Souza's avatar
Guy De Souza committed
548 549 550 551 552 553 554
       elif [ "$nrUE" = "1" ] ; then
         exec=nr-uesoftmodem-nos1
       elif [ "$eNB" = "1" ] ; then
         exec=lte-softmodem-nos1
       elif [ "$UE" = "1" ] ; then
         exec=lte-uesoftmodem-nos1
       fi
555
  else
Guy De Souza's avatar
Guy De Souza committed
556
      build_dir=ran_build
Guy De Souza's avatar
Guy De Souza committed
557 558 559 560 561 562 563 564 565
      if [ "$gNB" = "1" ] ; then
         exec=nr-softmodem
       elif [ "$nrUE" = "1" ] ; then
         exec=nr-uesoftmodem
       elif [ "$eNB" = "1" ] ; then
         exec=lte-softmodem
       elif [ "$UE" = "1" ] ; then
         exec=lte-uesoftmodem
       fi
566
  fi
567

568 569 570
# configuration module libraries, one currently available, using libconfig 
  config_libconfig_shlib=params_libconfig
  
571
  # first generate the CMakefile in the right directory
Guy De Souza's avatar
Guy De Souza committed
572
  if [ "$eNB" = "1" -o "$UE" = "1" -o "$gNB" = "1" -o "$nrUE" = "1" -o "$HW" = "EXMIMO" ] ; then
573

Guy De Souza's avatar
Guy De Souza committed
574 575 576 577
    # softmodem compilation
    [ "$CLEAN" = "1" ] && rm -rf $DIR/$build_dir/build
    mkdir -p $DIR/$build_dir/build
    cmake_file=$DIR/$build_dir/CMakeLists.txt
578 579
    echo "cmake_minimum_required(VERSION 2.8)"   >  $cmake_file
    if [ "$NOS1" = "1" ] ; then
Guy De Souza's avatar
Guy De Souza committed
580
	cat  $DIR/$build_dir/CMakeLists.template >>  $cmake_file
581
    fi
582
    echo "set ( CMAKE_BUILD_TYPE $CMAKE_BUILD_TYPE )" >> $cmake_file
583
    echo "set ( CFLAGS_PROCESSOR_USER \"$CFLAGS_PROCESSOR_USER\" )" >>  $cmake_file
584 585
    echo "set ( XFORMS $XFORMS )"                  >>  $cmake_file
    echo "set ( RRC_ASN1_VERSION \"${REL}\")"      >>  $cmake_file
ChenWeiTai's avatar
ChenWeiTai committed
586
    echo "set ( NR_RRC_ASN1_VERSION \"${NR_REL}\")"      >>  $cmake_file
587 588
    echo "set ( ENABLE_VCD_FIFO $VCD_TIMING )"     >>  $cmake_file
    echo "set ( RF_BOARD \"${HW}\")"               >>  $cmake_file
589
    echo "set ( TRANSP_PRO \"${TP}\")"             >>  $cmake_file
Guy De Souza's avatar
Guy De Souza committed
590
    echo "set(PACKAGE_NAME \"${exec}\")"       >>  $cmake_file
laurent's avatar
laurent committed
591
    echo "set (DEADLINE_SCHEDULER \"${DEADLINE_SCHEDULER_FLAG_USER}\" )"    >>$cmake_file
Rohit Gupta's avatar
Rohit Gupta committed
592
    echo "set (CPU_AFFINITY \"${CPU_AFFINITY_FLAG_USER}\" )"      >>$cmake_file
593
    echo "set ( T_TRACER $T_TRACER )"              >>  $cmake_file
594
    echo "set (UE_AUTOTEST_TRACE $UE_AUTOTEST_TRACE)"        >>  $cmake_file
Gabriel's avatar
Gabriel committed
595 596
    echo "set (UE_DEBUG_TRACE $UE_DEBUG_TRACE)"        >>  $cmake_file
    echo "set (UE_TIMING_TRACE $UE_TIMING_TRACE)"        >>  $cmake_file
Cedric Roux's avatar
Cedric Roux committed
597
    echo "set (DISABLE_LOG_X $DISABLE_LOG_X)"        >>  $cmake_file
598
    echo "set (USRP_REC_PLAY $USRP_REC_PLAY)"        >>  $cmake_file
Gabriel's avatar
Gabriel committed
599 600 601 602 603
    if [ "$UE" = 1 -a "$NOS1" = "0" ] ; then
     echo_info "Compiling UE S1 build : enabling Linux and NETLINK"
     echo "set (LINUX True )"              >>  $cmake_file
     echo "set (PDCP_USE_NETLINK True )"   >>  $cmake_file
    fi
604
    echo 'include(${CMAKE_CURRENT_SOURCE_DIR}/../CMakeLists.txt)' >> $cmake_file
Guy De Souza's avatar
Guy De Souza committed
605
    cd  $DIR/$build_dir/build
606
    eval $CMAKE_CMD
607 608
  fi

Guy De Souza's avatar
Guy De Souza committed
609 610
  if [ "$eNB" = "1" -o "$UE" = "1" -o "$gNB" = "1" -o "$nrUE" = "1" ] ; then
    echo_info "Compiling $exec"
611
    compilations \
Guy De Souza's avatar
Guy De Souza committed
612 613
	  $build_dir $exec \
	  $exec $dbin/$exec.$REL
614

615 616
# mandatory shared lib
    compilations \
Guy De Souza's avatar
Guy De Souza committed
617
	  $build_dir $config_libconfig_shlib \
618
	  lib$config_libconfig_shlib.so $dbin/lib$config_libconfig_shlib.so
619
    compilations \
Guy De Souza's avatar
Guy De Souza committed
620
          $build_dir coding \
621
          libcoding.so $dbin/libcoding.so
622
	  
623 624
    if [ "$NOS1" = "1" ] ; then
	compilations \
Guy De Souza's avatar
Guy De Souza committed
625
	    $build_dir nasmesh \
626 627
	    CMakeFiles/nasmesh/nasmesh.ko $dbin/nasmesh.ko
	compilations \
Guy De Souza's avatar
Guy De Souza committed
628
	    $build_dir rb_tool \
629 630 631
	    rb_tool $dbin/rb_tool
	cp $OPENAIR_DIR/cmake_targets/tools/init_nas_nos1 $dbin
    fi
632
  fi
thomasl's avatar
thomasl committed
633

Florian Kaltenberger's avatar
Florian Kaltenberger committed
634
  if [ "$UE" = 1 -a "$NOS1" = "0" ] ; then
635 636 637
    # ue_ip driver compilation
    echo_info "Compiling UE specific part"
    compilations \
Guy De Souza's avatar
Guy De Souza committed
638
      $build_dir ue_ip \
gauthier's avatar
gauthier committed
639
      CMakeFiles/ue_ip/ue_ip.ko $dbin/ue_ip.ko
640

gauthier's avatar
gauthier committed
641 642
#    mkdir -p $DIR/at_commands/build
#    cd $DIR/at_commands/build
643
#    eval $CMAKE_CMD
gauthier's avatar
gauthier committed
644 645 646
#    compilations \
#      at_commands at_nas_ue \
#      at_nas_ue $dbin/at_nas_ue
647
    
gauthier's avatar
gauthier committed
648
    [ "$CLEAN" = "1" ] && rm -rf $DIR/nas_sim_tools/build
649 650
    mkdir -p $DIR/nas_sim_tools/build
    cd $DIR/nas_sim_tools/build
gauthier's avatar
gauthier committed
651
    
652
    eval $CMAKE_CMD
thomasl's avatar
thomasl committed
653
    compilations \
654 655
      nas_sim_tools usim \
      usim $dbin/usim
thomasl's avatar
thomasl committed
656
    compilations \
657 658
      nas_sim_tools nvram \
      nvram $dbin/nvram
thomasl's avatar
thomasl committed
659
    compilations \
660 661
        nas_sim_tools conf2uedata \
        conf2uedata $dbin/conf2uedata
662 663

    # generate USIM data
664 665
    if [ -f $dbin/conf2uedata ]; then
      install_nas_tools $conf_nvram_path $gen_nvram_path
Guy De Souza's avatar
Guy De Souza committed
666 667 668 669
      echo_info "Copying UE specific part to $DIR/$build_dir/build"
      cp -Rvf $dbin/.ue_emm.nvram0 $DIR/$build_dir/build
      cp -Rvf $dbin/.ue.nvram0 $DIR/$build_dir/build
      cp -Rvf $dbin/.usim.nvram0 $DIR/$build_dir/build
670 671 672
    else
      echo_warning "not generated UE NAS files: binaries not found"
    fi
673
  fi
thomasl's avatar
thomasl committed
674

675
  if [ "$SIMUS_PHY" = "1" -o "$SIMUS_CORE" = "1" ] ; then
676 677 678 679 680
    cd $OPENAIR_DIR/cmake_targets/lte-simulators
    [ "$CLEAN" = "1" ] && rm -rf build
    mkdir -p build
    cd build
    rm -f *sim
681
    eval $CMAKE_CMD
682
  fi
683

684 685 686
  if [ "$SIMUS_PHY" = "1" ] ; then
    # lte unitary simulators compilation
    echo_info "Compiling unitary tests simulators"
Cedric Roux's avatar
Cedric Roux committed
687 688
    # TODO: fix: dlsim_tm4 pucchsim prachsim pdcchsim pbchsim mbmssim
    #simlist="dlsim_tm4 dlsim ulsim pucchsim prachsim pdcchsim pbchsim mbmssim"
689
    simlist="dlsim ulsim polartest ldpctest"
690 691 692 693 694
    for f in $simlist ; do
      compilations \
      lte-simulators $f \
	  $f $dbin/$f.$REL
    done
Cedric Roux's avatar
Cedric Roux committed
695 696 697
    compilations \
          lte-simulators coding \
          libcoding.so $dbin/libcoding.so
698
  fi
thomasl's avatar
thomasl committed
699

gauthier's avatar
gauthier committed
700
  # Core simulators
701 702 703 704 705 706 707 708 709 710 711
  #############
  if [ "$SIMUS_CORE" = "1" ] ; then
    # lte unitary simulators compilation
    echo_info "Compiling unitary tests simulators"
    simlist="secu_knas_encrypt_eia1 secu_kenb aes128_ctr_encrypt aes128_ctr_decrypt secu_knas_encrypt_eea2 secu_knas secu_knas_encrypt_eea1 kdf aes128_cmac_encrypt secu_knas_encrypt_eia2"
    for f in $simlist ; do
      compilations \
	  lte-simulators test_$f \
	  test_$f $dbin/test_$f.$REL
    done
  fi
thomasl's avatar
thomasl committed
712

713 714
  # EXMIMO drivers & firmware loader
  ###############
715
  if [ "$HW" = "EXMIMO" ] ; then
gauthier's avatar
gauthier committed
716
    
717 718
    echo_info "Compiling Express MIMO 2 board drivers"
    compilations \
Guy De Souza's avatar
Guy De Souza committed
719
        $build_dir openair_rf \
thomasl's avatar
thomasl committed
720
        CMakeFiles/openair_rf/openair_rf.ko $dbin/openair_rf.ko
721
    compilations \
Guy De Souza's avatar
Guy De Souza committed
722
	  $build_dir updatefw \
gauthier's avatar
gauthier committed
723
	  updatefw $dbin/updatefw
724
    echo_info "Compiling oarf tools. The logfile for compilation is here: $dlog/oarf.txt"
Guy De Souza's avatar
Guy De Souza committed
725 726
    make -C $OPENAIR_DIR/cmake_targets/$build_dir/build oarf > $dlog/oarf.txt 2>&1
    cp $OPENAIR_DIR/cmake_targets/$build_dir/build/*.oct $dbin
727 728 729 730 731
    if [ -s $dbin/oarf_config_exmimo.oct ] ; then
	echo_success "oarf tools compiled"
    else
	echo_error "oarf tools compilation failed"
    fi
732
    cp $OPENAIR_DIR/cmake_targets/tools/init_exmimo2 $dbin
733
  fi
thomasl's avatar
thomasl committed
734

735 736
  # oaisim compilation
  ###############
737
  if [ "$oaisim" = "1" ] ; then
738
    dconf=$OPENAIR_DIR/targets/bin
739 740 741 742 743 744 745
      if [ "$NOS1" =  "1" ] ; then
	  oaisim_build_dir=oaisim_noS1_build_oai
	  oaisim_exec=oaisim_nos1
      else
	  oaisim_build_dir=oaisim_build_oai
	  oaisim_exec=oaisim
      fi
746
    
747 748 749
    echo_info "Compiling $oaisim_exec ($oaisim_build_dir)"
    cmake_file=$DIR/$oaisim_build_dir/CMakeLists.txt
    cp $DIR/$oaisim_build_dir/CMakeLists.template $cmake_file
750
    echo "set ( CMAKE_BUILD_TYPE $CMAKE_BUILD_TYPE )" >> $cmake_file
751
    echo "set ( CFLAGS_PROCESSOR_USER \"$CFLAGS_PROCESSOR_USER\" )" >>  $cmake_file
752 753 754 755
    echo "set ( XFORMS $XFORMS )" >>  $cmake_file
    echo "set ( PRINT_STATS $PRINT_STATS )" >>  $cmake_file
    echo "set ( RRC_ASN1_VERSION \"${REL}\")" >>  $cmake_file
    echo "set ( ENABLE_VCD_FIFO $VCD_TIMING )" >>  $cmake_file
756
    echo "set ( T_TRACER $T_TRACER )"          >>  $cmake_file
757
    echo "set ( UE_NAS_USE_TUN $UE_NAS_USE_TUN )" >>  $cmake_file
758
    echo 'include(${CMAKE_CURRENT_SOURCE_DIR}/../CMakeLists.txt)' >> $cmake_file
759 760 761
    [ "$CLEAN" = "1" ] && rm -rf $DIR/$oaisim_build_dir/build
    mkdir -p $DIR/$oaisim_build_dir/build
    cd $DIR/$oaisim_build_dir/build
762
    eval $CMAKE_CMD
763
    compilations \
764 765
	  $oaisim_build_dir $oaisim_exec \
	  $oaisim_exec $dbin/$oaisim_exec.$REL
Cedric Roux's avatar
Cedric Roux committed
766 767 768 769 770 771
    compilations \
	  $oaisim_build_dir $config_libconfig_shlib \
	  lib$config_libconfig_shlib.so $dbin/lib$config_libconfig_shlib.so
    compilations \
          $oaisim_build_dir coding \
          libcoding.so $dbin/libcoding.so
772 773 774 775 776 777 778

    if [ "$NOS1" != "1" ] ; then

	[ "$CLEAN" = "1" ] && rm -rf $DIR/at_commands/build
    	echo_info "Compiling at_nas_ue"
	mkdir -p $DIR/at_commands/build
	cd $DIR/at_commands/build
779
	eval $CMAKE_CMD
780 781 782 783 784 785 786 787 788 789 790 791 792
	compilations \
	    at_commands at_nas_ue \
	    at_nas_ue $dbin/at_nas_ue

	# ue_ip driver compilation
	echo_info "Compiling UE specific part (ue_ip driver and usim tools)"
	compilations \
	    oaisim_build_oai ue_ip \
	    CMakeFiles/ue_ip/ue_ip.ko $dbin/ue_ip.ko

	[ "$CLEAN" = "1" ] && rm -rf $DIR/nas_sim_tools/build
	mkdir -p $DIR/nas_sim_tools/build
	cd $DIR/nas_sim_tools/build
793
	eval $CMAKE_CMD
794 795 796 797 798 799 800
	compilations \
	    nas_sim_tools usim \
	    usim $dbin/usim
	compilations \
	    nas_sim_tools nvram \
	    nvram $dbin/nvram
	compilations \
801 802
        nas_sim_tools conf2uedata \
        conf2uedata $dbin/conf2uedata
803 804

	# generate USIM data
805 806
	if [ -f $dbin/conf2uedata ]; then
	    install_nas_tools $conf_nvram_path $gen_nvram_path
807 808 809
	else
	    echo_warning "not generated UE NAS files: binaries not found"
	fi
810 811
    else

812 813 814
	compilations \
	    $oaisim_build_dir rb_tool \
	    rb_tool $dbin/rb_tool
gauthier's avatar
gauthier committed
815

816 817 818 819
	# nasmesh driver compilation
	compilations \
	    $oaisim_build_dir nasmesh \
	    CMakeFiles/nasmesh/nasmesh.ko $dbin/nasmesh.ko
820

821
	#oai_nw_drv
Cedric Roux's avatar
Cedric Roux committed
822 823 824
	#compilations \
	#    $oaisim_build_dir oai_nw_drv \
	#    CMakeFiles/oai_nw_drv/oai_nw_drv.ko $dbin/oai_nw_drv.ko
825
    fi
826

827 828 829 830
    if [ "$TP" == "ETHERNET" ] ; then
	compilations \
	    $oaisim_build_dir oai_eth_transpro \
	    liboai_eth_transpro.so $dbin/liboai_eth_transpro.so.$REL
831 832
	ln -sf liboai_eth_transpro.so liboai_transpro.so
	ln -sf $dbin/liboai_eth_transpro.so.$REL $dbin/liboai_transpro.so
833 834 835
	echo_info "liboai_transpro.so is linked with ETHERNET library"	 
    fi
      
836 837
    cmake_file=$DIR/oaisim_mme_build_oai/CMakeLists.txt
    cp $DIR/oaisim_mme_build_oai/CMakeLists.template $cmake_file
838 839 840 841
    echo "set ( CMAKE_BUILD_TYPE $CMAKE_BUILD_TYPE )" >> $cmake_file
    echo "set ( XFORMS $XFORMS )" >>  $cmake_file
    echo "set ( RRC_ASN1_VERSION \"${REL}\")" >>  $cmake_file
    echo "set ( ENABLE_VCD_FIFO $VCD_TIMING )" >>  $cmake_file
842
    echo "set ( T_TRACER $T_TRACER )"        >>  $cmake_file
843
    echo 'include(${CMAKE_CURRENT_SOURCE_DIR}/../CMakeLists.txt)' >> $cmake_file
844 845 846
    #[ "$CLEAN" = "1" ] && rm -rf $DIR/oaisim_mme_build_oai/build
    #mkdir -p $DIR/oaisim_mme_build_oai/build
    #cd $DIR/oaisim_mme_build_oai/build
847
    #eval $CMAKE_CMD
848 849 850
    #compilations \
	#  oaisim_mme_build_oai oaisim_mme \
	#  oaisim_mme $dbin/oaisim_mme.$REL
851 852
  fi

oai's avatar
oai committed
853 854 855
  # Telnet server compilation
  #####################
  if [ "$BUILD_TELNETSRV" = "1" ] ; then
Guy De Souza's avatar
Guy De Souza committed
856
              build_dir=$build_dir
857 858 859
              compilations \
                  $build_dir telnetsrv \
                  libtelnetsrv.so $dbin/libtelnetsrv.so
oai's avatar
oai committed
860 861

  fi  
Wang's avatar
Wang committed
862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917
  # HWLAT compilation
  #####################
  if [ "$HWLAT" = "1" ] ; then

     hwlat_exec=lte-hwlat
     hwlat_build_dir=lte-hwlat
     
     echo_info "Compiling $hwlat_exec ..."
    
     [ "$CLEAN" = "1" ] && rm -rf $DIR/lte-hwlat/build 
     mkdir -p $DIR/$hwlat_build_dir/build
     cmake_file=$DIR/$hwlat_build_dir/CMakeLists.txt
     echo "cmake_minimum_required(VERSION 2.8)"   >   $cmake_file
     echo "set ( CMAKE_BUILD_TYPE $CMAKE_BUILD_TYPE )" >> $cmake_file
     echo "set ( RF_BOARD \"${HW}\")"               >>  $cmake_file
     echo 'set ( PACKAGE_NAME "\"lte-hwlat\"")'        >>  $cmake_file
     echo "set ( DEADLINE_SCHEDULER \"${DEADLINE_SCHEDULER_FLAG_USER}\" )"    >>$cmake_file
     echo "set ( CPU_AFFINITY \"${CPU_AFFINITY_FLAG_USER}\" )"    >>$cmake_file
     echo "set ( HWLAT \"${HWLAT}\" )"    >>$cmake_file
     echo 'include(${CMAKE_CURRENT_SOURCE_DIR}/../CMakeLists.txt)' >> $cmake_file    
     cd $DIR/$hwlat_build_dir/build
     cmake ..
     compilations \
   lte-hwlat lte-hwlat \
   lte-hwlat $dbin/lte-hwlat

  fi  
 
  # HWLAT_TEST compilation
  #####################
  if [ "$HWLAT_TEST" = "1" ] ; then

     hwlat_test_exec=lte-hwlat-test
     hwlat_test_build_dir=lte-hwlat-test
     
     echo_info "Compiling $hwlat_test_exec ..."
    
     [ "$CLEAN" = "1" ] && rm -rf $DIR/lte-hwlat-test/build 
     mkdir -p $DIR/$hwlat_test_build_dir/build
     cmake_file=$DIR/$hwlat_test_build_dir/CMakeLists.txt
     echo "cmake_minimum_required(VERSION 2.8)"   >   $cmake_file
     echo "set ( CMAKE_BUILD_TYPE $CMAKE_BUILD_TYPE )" >> $cmake_file
     echo "set ( RF_BOARD \"${HW}\")"               >>  $cmake_file
     echo 'set ( PACKAGE_NAME "\"lte-hwlat-test\"")'        >>  $cmake_file
     echo "set ( DEADLINE_SCHEDULER \"${DEADLINE_SCHEDULER_FLAG_USER}\" )"    >>$cmake_file
     echo "set ( CPU_AFFINITY \"${CPU_AFFINITY_FLAG_USER}\" )"    >>$cmake_file
     echo "set ( HWLAT \"${HWLAT}\" )"    >>$cmake_file
     echo 'include(${CMAKE_CURRENT_SOURCE_DIR}/../CMakeLists.txt)' >> $cmake_file    
     cd $DIR/$hwlat_test_build_dir/build
     cmake ..
     compilations \
   lte-hwlat-test lte-hwlat-test \
   lte-hwlat-test $dbin/lte-hwlat-test

  fi  
 
918 919
  # build RF device and transport protocol libraries
  #####################################
920
  if [ "$eNB" = "1" -o "$UE" = "1" -o "$gNB" = "1" -o "$nrUE" = "1" -o "$HWLAT" = "1" ] ; then
921

Guy De Souza's avatar
Guy De Souza committed
922
      build_dir=$build_dir
923

924
      # build RF device libraries
925
      if [ "$HW" != "None" ] ; then
926
	  rm -f liboai_device.so
927
	  rm -f $dbin/liboai_device.so
928

Aikaterini Trilyraki's avatar