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

Additional Changes for cmake_targets

parent d3bc5803
......@@ -34,13 +34,15 @@ source "$THIS_SCRIPT_PATH"/tools/build_helper
set_openair_env
# Variables for UE data generation
gen_nvram_path=$OPENAIR_DIR/cmake_targets/ran_build/build
gen_nvram_path=$OPENAIR_DIR/targets/bin
conf_nvram_path=$OPENAIR_DIR/openair3/NAS/TOOLS/ue_eurecom_test_sfr.conf
MSC_GEN=0
XFORMS="True"
SKIP_SHARED_LIB_FLAG="False"
PRINT_STATS="False"
DEADLINE_SCHEDULER_FLAG_USER=""
REL="Rel15"
HW="None"
TP="Ethernet"
EPC=0
......@@ -115,7 +117,7 @@ Options:
--UE-gen-nvram [output path]
Specify gen_nvram_path (default \"$gen_nvram_path\")
-w | --hardware
USRP, BLADERF, LMSSDR, IRIS, SIMU, AW2SORI, None (Default)
EXMIMO, USRP, BLADERF, LMSSDR, IRIS, ADRV9371_ZC706, SIMU, AW2SORI, None (Default)
Adds this RF board support (in external packages installation and in compilation)
-t | --transport
Selects the transport protocol type, options: None, Ethernet, benetel4g, benetel5g
......@@ -131,10 +133,16 @@ Options:
Adds a debgging facility to the binary files: GUI with major internal synchronization events
-x | --xforms
Will compile with software oscilloscope features
--HWLAT
Makes test program for haw latency tests
--HWLAT_TEST
Compiles a hw latency test program
--verbose-ci
Compile with verbose instructions in CI Docker env
--verbose-compile
Shows detailed compilation instructions in makefile
--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
--build-doxygen
Builds doxygen based documentation.
--build-coverity-scan
......@@ -166,6 +174,8 @@ Options:
Disable AVX512 intrinsics whatever processor capability is
--noavx2
Disable AVX2 intrinsics whatever processor capability is
--usrp-recplay
Build for I/Q record-playback modes
-k | --skip-shared-libraries
Skip build for shared libraries to reduce compilation time when building frequently for debugging purposes
--ninja
......@@ -176,36 +186,20 @@ Options:
Enable the address sanitizer on all targets
--sanitize-undefined | -fsanitize=undefined
Enable the undefined behavior sanitizer on all targets
Enable the address sanitizer on all targets
--ittiSIM
Makes the itti simulator
-h | --help
Print this help"
}
Print this help
check_supported_distribution() {
local distribution=$(get_distribution_release)
case "$distribution" in
"ubuntu20.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 ;;
"rhel7") return 0 ;;
"rhel7.6") return 0 ;;
"rhel7.7") return 0 ;;
"rhel7.8") return 0 ;;
"rhel7.9") return 0 ;;
"rhel8.2") return 0 ;;
"rhel8.3") return 0 ;;
"rhel8.4") return 0 ;;
"rhel8.5") return 0 ;;
"rhel8.6") return 0 ;;
"rhel8.7") return 0 ;;
"centos7") return 0 ;;
esac
return 1
Usage (first build):
NI/ETTUS B201 + COTS UE : ./build_oai -I -i --eNB -w USRP
Usage (regular):
Eurecom EXMIMO + OAI ENB : ./build_oai --eNB
NI/ETTUS B201 + OAI ENB : ./build_oai --eNB -w USRP"
}
function main() {
until [ -z "$1" ]
......@@ -292,6 +286,9 @@ function main() {
RU=1
echo_info "Will compile RRU"
shift;;
-a | --agent)
echo_info "FlexRAN support is always compiled into the eNB"
shift;;
--UE)
UE=1
echo_info "Will compile UE"
......@@ -314,7 +311,10 @@ function main() {
-w | --hardware)
# Use OAI_USRP as the key word USRP is used inside UHD driver
case "$2" in
"USRP" | "BLADERF" | "LMSSDR" | "IRIS" | "SIMU" | "AW2SORI")
"EXMIMO")
HW="EXMIMO"
;;
"USRP" | "BLADERF" | "LMSSDR" | "IRIS" | "ADRV9371_ZC706" | "SIMU" | "AW2SORI")
HW="OAI_"$2
;;
"None")
......@@ -357,6 +357,14 @@ function main() {
EXE_ARGUMENTS="$EXE_ARGUMENTS -d"
echo_info "Will generate the software oscilloscope features"
shift;;
--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;;
--verbose-ci)
VERBOSE_CI=1
echo_info "Will compile with verbose instructions in CI Docker env"
......@@ -365,6 +373,10 @@ function main() {
VERBOSE_COMPILE=1
echo_info "Will compile with verbose instructions"
shift;;
--cflags_processor)
CMAKE_CMD="$CMAKE_CMD -DCFLAGS_PROCESSOR_USER=\"$2\""
echo_info "Setting CPU FLAGS from USER to: $2"
shift 2;;
--build-doxygen)
CMAKE_CMD="$CMAKE_CMD -DGENERATE_DOXYGEN=ON"
BUILD_DOXYGEN=1
......@@ -374,6 +386,26 @@ function main() {
BUILD_COVERITY_SCAN=1
echo_info "Will build Coverity-Scan objects for upload"
shift;;
--disable-deadline)
DEADLINE_SCHEDULER_FLAG_USER="False"
CMAKE_CMD="$CMAKE_CMD -DDEADLINE_SCHEDULER=False"
echo_info "Disabling the usage of deadline scheduler"
shift 1;;
--enable-deadline)
DEADLINE_SCHEDULER_FLAG_USER="True"
CMAKE_CMD="$CMAKE_CMD -DDEADLINE_SCHEDULER=True"
echo_info "Enabling the usage of deadline scheduler"
shift 1;;
--enable-cpu-affinity)
CPU_AFFINITY_FLAG_USER="True"
CMAKE_CMD="$CMAKE_CMD -DCPU_AFFINITY=True"
echo_info "Enabling CPU Affinity (only valid when not using deadline scheduler)"
shift 1;;
--disable-cpu-affinity)
CPU_AFFINITY_FLAG_USER="False"
CMAKE_CMD="$CMAKE_CMD -DCPU_AFFINITY=False"
echo_info "Disabling CPU Affinity (only valid when not using deadline scheduler)"
shift 1;;
--disable-T-Tracer)
CMAKE_CMD="$CMAKE_CMD -DT_TRACER=False"
echo_info "Disabling the T tracer"
......@@ -447,6 +479,10 @@ function main() {
shift;;
--sanitize-undefined | -fundefined=address)
CMAKE_CMD="$CMAKE_CMD -DSANITIZE_UNDEFINED=True"
--ittiSIM)
ittiSIM=1
CMAKE_CMD="$CMAKE_CMD -DITTI_SIM=True"
echo_info "Will compile itti simulator"
shift;;
-h | --help)
print_help
......@@ -487,9 +523,34 @@ function main() {
echo_info "No transport protocol has been selected (TP set to $TP)"
fi
fi
if [ "$HWLAT" = "1" ] ; then
if [ "$HW" = "None" ] ; then
echo_info "No radio head has been selected (HW set to $HW)"
fi
fi
echo_info "RF HW set to $HW"
# If the user doesn't specify the Linux scheduler to use, we set a value
if [ "$DEADLINE_SCHEDULER_FLAG_USER" = "" ]; then
case "$HW" in
"EXMIMO")
DEADLINE_SCHEDULER_FLAG_USER="True"
;;
*)
DEADLINE_SCHEDULER_FLAG_USER="False"
;;
esac
fi
#Disable CPU Affinity for deadline scheduler
if [ "$DEADLINE_SCHEDULER_FLAG_USER" = "True" ] ; then
CPU_AFFINITY_FLAG_USER="False"
CMAKE_CMD="$CMAKE_CMD -DCPU_AFFINITY=False"
fi
echo_info "Flags for Deadline scheduler: $DEADLINE_SCHEDULER_FLAG_USER"
echo_info "Flags for CPU Affinity: $CPU_AFFINITY_FLAG_USER"
#######################################################
# Setting and printing OAI envs, we should check here #
......@@ -508,42 +569,16 @@ function main() {
else
echo_warning "FreeDiameter prefix not found, install freeDiameter if EPC, HSS"
fi
if [ "$MAKE_CMD" != "" ]; then
$MAKE_CMD $2
else
if [ "$VERBOSE_COMPILE" == "1" ]; then
$COV_SCAN_PREFIX make -j`nproc` $2 VERBOSE=$VERBOSE_COMPILE
else
$COV_SCAN_PREFIX make -j`nproc` $2
fi
fi
ret=$?
} > $dlog/$2.$REL.txt 2>&1
set -e
if [ "$VERBOSE_CI" == "1" ]; then
echo_info "====== Start of log for $2.$REL.txt ======"
cat $dlog/$2.$REL.txt
echo_info "====== End of log for $2.$REL.txt ======"
fi
if [ "$CLEAN_ALL" = "1" ] ; then
clean_all_files
echo_info "Erased all previously producted files"
fi
if [ -s $3 ] ; then
cp $3 $4
echo_success "$2 compiled"
check_warnings "$dlog/$2.$REL.txt"
else
check_warnings "$dlog/$2.$REL.txt"
check_errors "$dlog/$2.$REL.txt"
echo_error "$2 compilation failed"
exit 1
fi
}
dbin=$OPENAIR_DIR/targets/bin
dlog=$OPENAIR_DIR/cmake_targets/log
mkdir -p $dlog
mkdir -p $dbin $dlog
if [ "$INSTALL_EXTERNAL" = "1" ] ; then
echo_info "Installing packages"
......@@ -555,6 +590,10 @@ function main() {
install_usrp_uhd_driver $UHD_IMAGES_DIR
fi
fi
# if [ "$HW" == "OAI_ADRV9371_ZC706" ] ; then
# echo_info "\nInstalling packages for ADRV9371_ZC706 support"
# check_install_libiio_driver
# fi
if [ "$HW" == "OAI_BLADERF" ] ; then
echo_info "installing packages for BLADERF support"
check_install_bladerf_driver
......@@ -569,6 +608,10 @@ function main() {
# flash_firmware_iris
#fi
fi
echo_info "Installing protobuf/protobuf-c for flexran agent support"
install_protobuf_from_source
install_protobuf_c_from_source
echo_success "protobuf/protobuf-c installation successful"
fi
if [ "$INSTALL_OPTIONAL" = "1" ] ; then
......@@ -576,6 +619,19 @@ function main() {
check_install_additional_tools
fi
echo_info "3. building the compilation directives ..."
DIR=$OPENAIR_DIR/cmake_targets
[ "$CLEAN" = "1" ] && rm -rf $DIR/$BUILD_DIR/build
mkdir -p $DIR/$BUILD_DIR/build
cd $DIR/$BUILD_DIR/build
echo_info "running $CMAKE_CMD"
eval $CMAKE_CMD ../..
execlist=""
if [ "$eNB" = "1" ] ; then
execlist="$execlist lte-softmodem"
......@@ -595,7 +651,9 @@ function main() {
if [ "$nrUE" = 1 ] ; then
execlist="$execlist nr-uesoftmodem"
fi
if [ "$ittiSIM" = "1" ] ; then
execlist="$execlist nr-ittisim"
fi
if [[ "$execlist" == "" && "$SIMUS_PHY" != "1" && "$HW" == "None" ]]; then
SKIP_SHARED_LIB_FLAG="True"
fi
......@@ -619,7 +677,9 @@ function main() {
for f in $execlist ; do
echo_info "Compiling $f..."
compilations $BUILD_DIR $f
compilations \
$BUILD_DIR $f \
$f $dbin/$f.$REL
done
......@@ -631,9 +691,13 @@ function main() {
# configuration module libraries, one currently available, using libconfig
config_libconfig_shlib=params_libconfig
compilations $BUILD_DIR $config_libconfig_shlib
compilations \
$BUILD_DIR $config_libconfig_shlib \
lib$config_libconfig_shlib.so $dbin/lib$config_libconfig_shlib.so
compilations $BUILD_DIR coding
compilations \
$BUILD_DIR coding \
libcoding.so $dbin/libcoding.so
fi
......@@ -644,7 +708,9 @@ function main() {
if [ $IS_CONTAINER -eq 0 ]
then
echo_info "Building ue_ip module"
compilations $BUILD_DIR ue_ip
compilations \
$BUILD_DIR ue_ip \
CMakeFiles/ue_ip/ue_ip.ko $dbin/ue_ip.ko
else
echo_info "Bypassing ue_ip build"
fi #IS_CONTAINER
......@@ -652,25 +718,36 @@ function main() {
# mkdir -p $DIR/at_commands/build
# cd $DIR/at_commands/build
# eval $CMAKE_CMD
# compilations at_commands at_nas_ue
# compilations \
# at_commands at_nas_ue \
# at_nas_ue $dbin/at_nas_ue
[ "$CLEAN" = "1" ] && rm -rf $DIR/nas_sim_tools/build
mkdir -p $DIR/nas_sim_tools/build
cd $DIR/nas_sim_tools/build
eval $CMAKE_CMD ..
compilations nas_sim_tools usim
compilations nas_sim_tools nvram
compilations nas_sim_tools conf2uedata
compilations \
nas_sim_tools usim \
usim $dbin/usim
compilations \
nas_sim_tools nvram \
nvram $dbin/nvram
compilations \
nas_sim_tools conf2uedata \
conf2uedata $dbin/conf2uedata
# generate USIM data
if [ -f conf2uedata ]; then
install_nas_tools $conf_nvram_path $DIR/$BUILD_DIR/build "$DIR/$BUILD_DIR/build/conf2uedata.txt"
if [ -f $dbin/conf2uedata ]; then
install_nas_tools $conf_nvram_path $gen_nvram_path "$dlog/conf2uedata.txt"
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
else
echo_warning "not generated UE NAS files: binaries not found"
fi
fi
$SUDO $INSTALLER install -y $PACKAGE_LIST
cd $DIR/$BUILD_DIR/build
......@@ -683,9 +760,13 @@ function main() {
simlist="dlsim ulsim ldpctest polartest smallblocktest nr_pbchsim nr_dlschsim nr_ulschsim nr_dlsim nr_ulsim nr_pucchsim nr_prachsim"
# simlist="ldpctest"
for f in $simlist ; do
compilations $BUILD_DIR $f
compilations \
ran_build $f \
$f $dbin/$f.$REL
done
compilations $BUILD_DIR coding
compilations \
ran_build coding \
libcoding.so $dbin/libcoding.so
fi
###################
......@@ -695,22 +776,100 @@ function main() {
echo_info "Compiling security 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 $BUILD_DIR test_$f
compilations \
ran_build test_$f \
test_$f $dbin/test_$f.$REL
done
fi
####################################
# EXMIMO drivers & firmware loader #
####################################
if [ "$HW" = "EXMIMO" ] ; then
echo_info "Compiling Express MIMO 2 board drivers"
compilations \
$BUILD_DIR openair_rf \
CMakeFiles/openair_rf/openair_rf.ko $dbin/openair_rf.ko
compilations \
$BUILD_DIR updatefw \
updatefw $dbin/updatefw
echo_info "Compiling oarf tools. The logfile for compilation is here: $dlog/oarf.txt"
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
if [ -s $dbin/oarf_config_exmimo.oct ] ; then
echo_success "oarf tools compiled"
else
echo_error "oarf tools compilation failed"
fi
cp $OPENAIR_DIR/cmake_targets/tools/init_exmimo2 $dbin
fi
######################
# Optional libraries #
######################
if [ ! -z "$BUILD_OPTLIB" ] ; then
for oklib in $BUILD_OPTLIB ; do
compilations $BUILD_DIR $oklib
if [ "$oklib" == "websrv" ] ; then
BUILD_WEBSRVFRONT=1
echo_info "Build of websrv frontend enabled"
fi
compilations \
$BUILD_DIR $oklib \
lib${oklib}.so $dbin/lib${oklib}.so
done
fi
#####################
# 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
############################################
# Optional targets (others than libraries) #
......@@ -725,69 +884,6 @@ function main() {
else
echo_warning "build of websrv front-end skipped, dependencies not met : " $npmv " " $nodev
fi
$SUDO $INSTALLER install -y \
autoconf \
automake \
bc \
bison \
$CMAKE \
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 \
lksctp-tools \
lksctp-tools-devel \
openssl-devel \
libtasn1 \
libtool \
libusb-devel \
libxml2 \
libxml2-devel \
libxslt-devel \
ninja-build \
make \
openssh-clients \
openssh-server \
openssl \
patch \
psmisc \
python \
readline-devel \
subversion \
xmlstarlet \
python-pip \
wget \
kernel-headers \
kernel-devel \
nettle-devel \
gnutls-devel \
libXpm-devel \
lapack \
lapack-devel \
blas \
blas-devel \
libyaml-devel
fi
####################################################
# Build RF device and transport protocol libraries #
......@@ -797,35 +893,72 @@ function main() {
# build RF device libraries
if [ "$HW" != "None" ] ; then
rm -f liboai_device.so
rm -f $dbin/liboai_device.so
if [ "$HW" == "OAI_USRP" ] ; then
compilations $BUILD_DIR oai_usrpdevif
# link liboai_device.so with the selected RF device library
if [ "$HW" == "EXMIMO" ] ; then
compilations \
$BUILD_DIR oai_exmimodevif \
liboai_exmimodevif.so $dbin/liboai_exmimodevif.so.$REL
ln -sf liboai_exmimodevif.so liboai_device.so
ln -sf $dbin/liboai_exmimodevif.so.$REL $dbin/liboai_device.so
echo_info "liboai_device.so is linked to EXMIMO device library"
elif [ "$HW" == "OAI_USRP" ] ; then
compilations \
$BUILD_DIR oai_usrpdevif \
liboai_usrpdevif.so $dbin/liboai_usrpdevif.so.$REL
ln -sf liboai_usrpdevif.so liboai_device.so
ln -sf $dbin/liboai_usrpdevif.so.$REL $dbin/liboai_device.so
echo_info "liboai_device.so is linked to USRP device library"
elif [ "$HW" == "OAI_BLADERF" ] ; then
if [ -f "/usr/include/libbladeRF.h" ] ; then
compilations $BUILD_DIR oai_bladerfdevif
compilations \
$BUILD_DIR oai_bladerfdevif \
liboai_bladerfdevif.so $dbin/liboai_bladerfdevif.so.$REL
fi
ln -sf liboai_bladerfdevif.so liboai_device.so
ln -sf $dbin/liboai_bladerfdevif.so.$REL $dbin/liboai_device.so
echo_info "liboai_device.so is linked to BLADERF device library"
elif [ "$HW" == "OAI_LMSSDR" ] ; then
# if [ -f "/usr/include/libbladeRF.h" ] ; then
compilations $BUILD_DIR oai_lmssdrdevif
compilations \
$BUILD_DIR oai_lmssdrdevif \
liboai_lmssdrdevif.so $dbin/liboai_lmssdrdevif.so.$REL
# fi
ln -sf liboai_lmssdrdevif.so liboai_device.so
ln -sf $dbin/liboai_lmssdrdevif.so.$REL $dbin/liboai_device.so
echo_info "liboai_device.so is linked to LMSSDR device library"
elif [ "$HW" == "OAI_IRIS" ] ; then
compilations $BUILD_DIR oai_irisdevif
compilations \
$BUILD_DIR oai_irisdevif \
liboai_irisdevif.so $dbin/liboai_irisdevif.so.$REL
ln -s liboai_irisdevif.so liboai_device.so
ln -s $dbin/liboai_irisdevif.so.$REL $dbin/liboai_device.so
echo_info "liboai_device.so is linked to IRIS device library"
elif [ "$HW" == "OAI_ADRV9371_ZC706" ] ; then
SYRIQ_KVER=$(uname -r)
SYRIQ_KMAJ=$(echo $SYRIQ_KVER | sed -e 's/^\([0-9][0-9]*\)\.[0-9][0-9]*\.[0-9][0-9]*.*/\1/')
SYRIQ_KMIN=$(echo $SYRIQ_KVER | sed -e 's/^[0-9][0-9]*\.\([0-9][0-9]*\)\.[0-9][0-9]*.*/\1/')
# echo $SYRIQ_KMAJ$SYRIQ_KMIN
if [ "$SYRIQ_KMAJ$SYRIQ_KMIN" == "319" ] || [ "$SYRIQ_KMAJ$SYRIQ_KMIN" == "410" ] || [ "$SYRIQ_KMAJ$SYRIQ_KMIN" == "415" ] ; then
# echo "Kernel $SYRIQ_KMAJ.$SYRIQ_KMIN detected"
ln -sf /usr/local/lib/syriq/libadrv9371zc706.so liboai_device.so
else
echo_error "== FAILED == Unexpected Kernel $SYRIQ_KMAJ.$SYRIQ_KMIN"
fi
echo_info "liboai_device.so is linked to ADRV9371_ZC706 device library for Kernel $SYRIQ_KMAJ.$SYRIQ_KMIN"
elif [ "$HW" == "OAI_AW2SORI" ] ; then
compilations $BUILD_DIR aw2sori_transpro
compilations \
$BUILD_DIR aw2sori_transpro \
libaw2sori_transpro.so $dbin/libaw2sori_transpro.so.$REL
ln -sf libaw2sori_transpro.so libthirdparty_transpro.so
ln -sf $dbin/libaw2sori_transpro.so.$REL $dbin/libaw2sori_transpro.so
echo_info "build libthirdparty_transpro.so for AW2SORI fronthaul"
else
echo_info "liboai_device.so is not linked to any device library"
......@@ -835,26 +968,43 @@ function main() {
#build simulators devices
if [ "$SKIP_SHARED_LIB_FLAG" = "False" ]; then
echo_info "Compiling rfsimulator"
compilations $BUILD_DIR rfsimulator
compilations \
$BUILD_DIR rfsimulator \
librfsimulator.so $dbin/librfsimulator.so.$REL
echo_info "Compiling tcp_bridge_oai"
compilations \
$BUILD_DIR tcp_bridge_oai \
libtcp_bridge_oai.so $dbin/libtcp_bridge_oai.so.$REL
fi
#build transport protocol libraries (currently only ETHERNET is available)
if [ "$SKIP_SHARED_LIB_FLAG" = "False" ]; then
echo_info "Building transport protocol libraries"
rm -f liboai_transpro.so
rm -f $dbin/liboai_transpro.so
if [ "$TP" == "Ethernet" ]; then
compilations $BUILD_DIR oai_eth_transpro
compilations \
$BUILD_DIR oai_eth_transpro \
liboai_eth_transpro.so $dbin/liboai_eth_transpro.so.$REL
ln -sf liboai_eth_transpro.so liboai_transpro.so
ln -sf $dbin/liboai_eth_transpro.so.$REL $dbin/liboai_transpro.so
echo_info "liboai_transpro.so is linked to ETHERNET transport"
fi
if [ "$TP" == "benetel4g" ]; then
compilations $BUILD_DIR benetel_4g
compilations \
$BUILD_DIR benetel_4g \
libbenetel_4g.so $dbin/libbenetel_4g.$REL
ln -sf libbenetel_4g.so liboai_transpro.so
ln -sf $dbin/libbenetel_4g.so.$REL $dbin/liboai_transpro.so
echo_info "liboai_transpro.so is linked to BENETEL4G transport"
fi
if [ "$TP" == "benetel5g" ]; then
compilations $BUILD_DIR benetel_5g
compilations \
$BUILD_DIR benetel_5g \
libbenetel_5g.so $dbin/libbenetel_5g.$REL
ln -sf libbenetel_5g.so liboai_transpro.so
ln -sf $dbin/libbenetel_5g.so.$REL $dbin/liboai_transpro.so
echo_info "liboai_transpro.so is linked to BENETEL4G transport"
fi
fi
......@@ -869,7 +1019,11 @@ function main() {
echo_info "Doxygen generation log is located here: $doxygen_log"
echo_info "Generating Doxygen files....please wait"
(
$MAKE_CMD doc
[ "$CLEAN" = "1" ] && rm -rf $OPENAIR_DIR/cmake_targets/doxygen/build
mkdir -p $OPENAIR_DIR/cmake_targets/doxygen/build
cd $OPENAIR_DIR/cmake_targets/doxygen/build
eval $CMAKE_CMD ..
make doc
) >& $doxygen_log
fi
......@@ -901,20 +1055,6 @@ function main() {
echo_success "BUILD SHOULD BE SUCCESSFUL"
fi
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
}
main "$@"
......@@ -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