Commit bca61ec6 authored by Robert Schmidt's avatar Robert Schmidt

Merge remote-tracking branch 'origin/build_oai_support_on_ubuntu20' into integration_2022_wk13b

parents 5d63a756 790f2802
......@@ -59,13 +59,16 @@ BUILD_ECLIPSE=0
NR="False"
OPTIONAL_LIBRARIES="telnetsrv enbscope uescope nrscope"
RU=0
trap handle_ctrl_c INT
CMAKE_C_FLAGS=()
CMAKE_CXX_FLAGS=()
function print_help() {
echo_info "
This program installs OpenAirInterface Software
You should have ubuntu 16.xx or 18.04 updated
Options
This script compiles OpenAirInterface Software, and can install dependencies
for a number of distributions (Ubuntu 18-22, Fedora, RHEL7/8).
Options:
--arch-native
Passes -march=native to the compiler.
-c | --clean
Erase all files to make a rebuild from start
-C | --clean-all
......@@ -185,6 +188,10 @@ function main() {
until [ -z "$1" ]
do
case "$1" in
--arch-native)
CMAKE_C_FLAGS+=("-march=native")
CMAKE_CXX_FLAGS+=("-march=native")
shift;;
-c | --clean)
CLEAN=1
shift;;
......@@ -570,8 +577,7 @@ function main() {
#fi
fi
echo_info "Installing protobuf/protobuf-c for flexran agent support"
install_protobuf_from_source
install_protobuf_c_from_source
install_protobuf_c
echo_success "protobuf/protobuf-c installation successful"
fi
......@@ -580,19 +586,6 @@ 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"
......@@ -612,10 +605,27 @@ 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" ]]; then
echo_success "installing dependencies successful"
exit
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
if [[ ${#CMAKE_C_FLAGS[@]} > 0 ]]; then CMAKE_CMD="$CMAKE_CMD -DCMAKE_C_FLAGS=\"${CMAKE_C_FLAGS[*]}\""; fi
if [[ ${#CMAKE_CXX_FLAGS[@]} > 0 ]]; then CMAKE_CMD="$CMAKE_CMD -DCMAKE_CXX_FLAGS=\"${CMAKE_CXX_FLAGS[*]}\""; fi
echo_info "running $CMAKE_CMD"
eval $CMAKE_CMD ../..
for f in $execlist ; do
echo_info "Compiling $f..."
......
This diff is collapsed.
......@@ -103,12 +103,12 @@ get_distribution_release() {
check_supported_distribution() {
local distribution=$(get_distribution_release)
case "$distribution" in
"ubuntu22.04") return 0 ;;
"ubuntu21.04") return 0 ;;
"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 ;;
"fedora35") return 0 ;;
"rhel7") return 0 ;;
"rhel7.6") return 0 ;;
"rhel7.7") return 0 ;;
......@@ -315,6 +315,26 @@ install_protobuf_c_from_source(){
) >& $protobuf_c_install_log
}
install_protobuf_c() {
local protobuf_packages=""
case "$(get_distribution_release)" in
"ubuntu18.04" | "ubuntu20.04" | "ubuntu21.04" | "ubuntu22.04")
protobuf_packages="protobuf-c-compiler libprotobuf-c1 libprotobuf-c-dev"
;;
esac
case "$OS_DISTRO" in
"rhel" | "centos" | "fedora") # in EPEL and Fedora repos (at least as of 35)
protobuf_packages="protobuf-c-compiler protobuf-c protobuf-c-devel"
;;
esac
if [[ "$protobuf_packages" == "" ]]; then
install_protobuf_from_source
install_protobuf_c_from_source
else
$SUDO $INSTALLER -y install $protobuf_packages
fi
}
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 "
......@@ -471,10 +491,6 @@ 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
......@@ -574,7 +590,16 @@ check_install_soapy () {
check_install_additional_tools (){
$SUDO $INSTALLER update -y
local optional_packages=""
if [[ "$OS_DISTRO" == "ubuntu" ]]; then
case "$(get_distribution_release)" in
"ubuntu16.04"| "ubuntu18.04")
optional_packages="python-dev python-pexpect python-numpy python-scipy python-matplotlib ctags"
;;
"ubuntu20.04" | "ubuntu21.04" | "ubuntu22.04" )
optional_packages="python3 python3-pip python3-dev python3-scipy python3-matplotlib universal-ctags"
;;
esac
PACKAGE_LIST="\
check \
dialog \
......@@ -584,8 +609,6 @@ check_install_additional_tools (){
libpthread-stubs0-dev \
openvpn \
pkg-config \
python-dev \
python-pexpect \
sshfs \
swig \
tshark \
......@@ -593,18 +616,14 @@ check_install_additional_tools (){
unzip \
valgrind \
vlan \
ctags \
ntpdate \
iperf3 \
android-tools-adb \
wvdial \
python-numpy \
sshpass \
nscd \
bc \
ntp \
python-scipy \
python-matplotlib"
ntp"
elif [[ "$OS_DISTRO" == "rhel" ]] || [[ "$OS_DISTRO" == "centos" ]]; then
PACKAGE_LIST="\
check \
......@@ -650,22 +669,19 @@ check_install_additional_tools (){
valgrind \
vconfig \
ctags \
ntpdate \
ntpsec \
iperf3 \
wvdial \
python-numpy \
sshpass \
nscd \
python2-paramiko \
python-paramiko \
python-pyroute2 \
python-netifaces \
python2-scipy \
python2-matplotlib"
python-scipy \
python-matplotlib"
fi
$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
$SUDO $INSTALLER install -y $PACKAGE_LIST $optional_packages
#The packages below are already installed for Redhat distros (RHEL, CentOS, Fedora)
if [[ "$OS_DISTRO" == "ubuntu" ]]; then
......@@ -696,25 +712,26 @@ 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"
# For iperf3
$SUDO add-apt-repository "deb http://archive.ubuntu.com/ubuntu trusty-backports universe"
$SUDO apt-get update
;;
"ubuntu16.04")
specific_packages="libtasn1-6-dev libgnutls-dev libatlas-dev iproute libconfig8-dev"
specific_packages="libtasn1-6-dev libgnutls-dev libatlas-dev iproute libconfig8-dev iptables-dev libgcrypt11-dev python-pip pydb python guile-2.0-dev"
;;
"ubuntu17.04")
specific_packages="libtasn1-6-dev libgnutls28-dev libatlas-dev iproute libconfig8-dev"
"ubuntu18.04")
specific_packages="libtasn1-6-dev libgnutls28-dev iproute2 libconfig-dev iptables-dev libgcrypt11-dev python-pip pydb python guile-2.0-dev"
LAPACK_LIBNAME="liblapack.so-x86_64-linux-gnu"
LAPACK_TARGET="/usr/lib/x86_64-linux-gnu/atlas/liblapack.so"
;;
"ubuntu17.10")
specific_packages="libtasn1-6-dev libgnutls28-dev iproute libconfig8-dev"
"ubuntu20.04")
specific_packages="libtasn1-6-dev libgnutls28-dev iproute2 libconfig-dev python guile-2.0-dev"
LAPACK_LIBNAME="liblapack.so-x86_64-linux-gnu"
LAPACK_TARGET="/usr/lib/x86_64-linux-gnu/atlas/liblapack.so"
;;
"ubuntu18.04")
specific_packages="libtasn1-6-dev libgnutls28-dev iproute2 libconfig-dev"
"ubuntu21.04")
specific_packages="libtasn1-6-dev libgnutls28-dev iproute2 libconfig-dev python guile-2.0-dev"
LAPACK_LIBNAME="liblapack.so-x86_64-linux-gnu"
LAPACK_TARGET="/usr/lib/x86_64-linux-gnu/atlas/liblapack.so"
;;
"ubuntu22.04")
specific_packages="libtasn1-6-dev libgnutls28-dev iproute2 libconfig-dev python2 guile-2.2-dev"
LAPACK_LIBNAME="liblapack.so-x86_64-linux-gnu"
LAPACK_TARGET="/usr/lib/x86_64-linux-gnu/atlas/liblapack.so"
;;
......@@ -734,22 +751,21 @@ check_install_oai_software() {
texlive-latex-base \
ethtool \
flex \
g++ \
gcc \
gdb \
git \
graphviz \
gtkwave \
guile-2.0-dev \
iperf \
iptables \
iptables-dev \
libatlas-base-dev \
libblas-dev \
liblapack-dev\
liblapacke-dev\
liblapack-dev \
liblapacke-dev \
libffi-dev \
libforms-bin \
libforms-dev \
libgcrypt11-dev \
libgmp-dev \
libgtk-3-dev \
libidn2-0-dev \
......@@ -769,11 +785,8 @@ check_install_oai_software() {
openssh-client \
openssh-server \
openssl \
python \
subversion \
xmlstarlet \
python-pip \
pydb \
libyaml-dev \
wget \
libxpm-dev \
......@@ -791,8 +804,6 @@ 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 \
......@@ -804,6 +815,8 @@ check_install_oai_software() {
doxygen \
ethtool \
flex \
g++ \
gcc \
gdb \
git \
graphviz \
......@@ -860,8 +873,6 @@ check_install_oai_software() {
fi
install_asn1c_from_source $1
$SUDO rm -fr /opt/ssh
$SUDO git clone https://gist.github.com/2190472.git /opt/ssh
}
install_asn1c_from_source(){
......@@ -955,23 +966,3 @@ do
fi
done
}
# 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
}
......@@ -77,7 +77,7 @@ cd cmake_targets/
./build_oai -I -w USRP --eNB --UE --nrUE --gNB
```
- The `-I` option is to install pre-requisites, you only need it the first time you build the softmodem or when some oai dependencies have changed. Note: for Ubuntu 20 use cmake_targets/install_external_packages.ubuntu20 instead!
- The `-I` option is to install pre-requisites, you only need it the first time you build the softmodem or when some oai dependencies have changed.
- The `-w` option is to select the radio head support you want to include in your build. Radio head support is provided via a shared library, which is called the "oai device" The build script creates a soft link from `liboai_device.so` to the true device which will be used at run-time (here the USRP one,`liboai_usrpdevif.so` . USRP is the only hardware tested today in the Continuous Integration process. The RF simulator[RF simulator](../targets/ARCH/rfsimulator/README.md) is implemented as a specific device replacing RF hardware, it can be specifically built using `-w SIMU` option, but is also built during any softmodem build.
- `--eNB` is to build the `lte-softmodem` executable and all required shared libraries
- `--gNB` is to build the `nr-softmodem` executable and all required shared libraries
......
......@@ -96,7 +96,7 @@ COPY --from=enb-base \
# Now we are copying from builder-image the UHD files.
COPY --from=enb-base /usr/local/bin/uhd_find_devices /usr/local/bin
COPY --from=enb-base /usr/local/lib/libprotobuf-c.so.1 /usr/local/lib
COPY --from=enb-base /usr/lib64/libprotobuf-c.so.1 /usr/local/lib
COPY --from=enb-base /usr/local/lib64/libuhd.so.3.15.0 /usr/local/lib64
COPY --from=enb-base /usr/local/lib64/uhd/utils/uhd_images_downloader.py /opt/oai-enb/bin
......
......@@ -83,7 +83,7 @@ COPY --from=enb-build \
COPY --from=enb-base /usr/local/bin/uhd_find_devices /usr/local/bin
COPY --from=enb-base \
/usr/local/lib/libuhd.so.3.15.0 \
/usr/local/lib/libprotobuf-c.so.1 \
/usr/lib/x86_64-linux-gnu/libprotobuf-c.so.1 \
/usr/local/lib/
COPY --from=enb-base /usr/local/lib/uhd/utils/uhd_images_downloader.py /opt/oai-enb/bin
COPY --from=enb-base \
......
......@@ -100,7 +100,7 @@ COPY --from=gnb-base \
# Now we are copying from builder-image the UHD files.
COPY --from=gnb-base /usr/local/bin/uhd_find_devices /usr/local/bin
COPY --from=gnb-base /usr/local/lib/libprotobuf-c.so.1 /usr/local/lib
COPY --from=gnb-base /usr/lib64/libprotobuf-c.so.1 /usr/local/lib
COPY --from=gnb-base /usr/local/lib64/libuhd.so.3.15.0 /usr/local/lib64
COPY --from=gnb-base /usr/local/lib64/uhd/utils/uhd_images_downloader.py /opt/oai-gnb/bin
......
......@@ -84,7 +84,7 @@ COPY --from=gnb-build \
COPY --from=gnb-base /usr/local/bin/uhd_find_devices /usr/local/bin
COPY --from=gnb-base \
/usr/local/lib/libuhd.so.3.15.0 \
/usr/local/lib/libprotobuf-c.so.1 \
/usr/lib/x86_64-linux-gnu/libprotobuf-c.so.1 \
/usr/local/lib/
COPY --from=gnb-base /usr/local/lib/uhd/utils/uhd_images_downloader.py /opt/oai-gnb/bin
COPY --from=gnb-base \
......
......@@ -98,7 +98,7 @@ COPY --from=lte-ue-base \
# Now we are copying from builder-image the UHD files.
COPY --from=lte-ue-base /usr/local/bin/uhd_find_devices /usr/local/bin
COPY --from=lte-ue-base /usr/local/lib/libprotobuf-c.so.1 /usr/local/lib
COPY --from=lte-ue-base /usr/lib64/libprotobuf-c.so.1 /usr/local/lib
COPY --from=lte-ue-base /usr/local/lib64/libuhd.so.3.15.0 /usr/local/lib64
COPY --from=lte-ue-base /usr/local/lib64/uhd/utils/uhd_images_downloader.py /opt/oai-lte-ue/bin
......
......@@ -86,7 +86,7 @@ COPY --from=lte-ue-build \
COPY --from=lte-ue-base /usr/local/bin/uhd_find_devices /usr/local/bin
COPY --from=lte-ue-base \
/usr/local/lib/libuhd.so.3.15.0 \
/usr/local/lib/libprotobuf-c.so.1 \
/usr/lib/x86_64-linux-gnu/libprotobuf-c.so.1 \
/usr/local/lib/
COPY --from=lte-ue-base /usr/local/lib/uhd/utils/uhd_images_downloader.py /opt/oai-lte-ue/bin
......
......@@ -103,7 +103,7 @@ COPY --from=nr-ue-base \
# Now we are copying from builder-image the UHD files.
COPY --from=nr-ue-base /usr/local/bin/uhd_find_devices /usr/local/bin
COPY --from=nr-ue-base /usr/local/lib/libprotobuf-c.so.1 /usr/local/lib
COPY --from=nr-ue-base /usr/lib64/libprotobuf-c.so.1 /usr/local/lib
COPY --from=nr-ue-base /usr/local/lib64/libuhd.so.3.15.0 /usr/local/lib64
COPY --from=nr-ue-base /usr/local/lib64/uhd/utils/uhd_images_downloader.py /opt/oai-nr-ue/bin
......
......@@ -88,7 +88,7 @@ COPY --from=nr-ue-build \
COPY --from=nr-ue-base /usr/local/bin/uhd_find_devices /usr/local/bin
COPY --from=nr-ue-base \
/usr/local/lib/libuhd.so.3.15.0 \
/usr/local/lib/libprotobuf-c.so.1 \
/usr/lib/x86_64-linux-gnu/libprotobuf-c.so.1 \
/usr/local/lib/
COPY --from=nr-ue-base /usr/local/lib/uhd/utils/uhd_images_downloader.py /opt/oai-nr-ue/bin
......
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