[OpenAirInterface实战-7] :OAI编译环境的架构、搭建、目标代码的编译

2023-11-03

作者主页(文火冰糖的硅基工坊):文火冰糖(王文兵)的博客_文火冰糖的硅基工坊_CSDN博客

本文网址:https://blog.csdn.net/HiWangWenBing/article/details/120556060


目录

第1章 概述

1.1 信息来源

1.2 代码补充说明

1.3 开发环境的架构

1.4 OAI RAN软件的安装启动步骤

第2章 步骤1:Linux编译服务器的选择

2.1 官方指南

第3章 步骤2:Linux编译服务器的内核配置

3.1 官方指南

第4章 步骤3:源代码软件工程的github下载

4.1 官方指南

4.2 手工下载源文件的压缩文件(只适合本地看代码,不适合编译源代码)

4.3 Linux下通过git clone获取(适合编译源代码)

第5章 步骤4:构建X86可执行文件

5.1 官方指南:

5.2 主要的二进制可执行文件输出

5.3 辅助文件输出

5.4 重要的编译功能选项

5.5 多用户环境下,编译前的准备

5.6 构建外部依赖文件

5.7 构建LTE UE, LTE eNodeB , NR UE, NR gNodeB,RF USRP可执行文件

5.8 Build LTE UE and eNB with RF Simulators

5.9 build NR UE and gNB with RF Simulators

5.10 单独构建PHY Simulators

5.11 构建可选的库,如telnet或其他

第6章 build_oai所有选项解读

第7章 构建成功的验证

7.1 静态验证

7.2 动态运行验证(运行程序)



第1章 概述

1.1 信息来源

(1)OAI主页

oai / openairinterface5G · GitLabhttps://gitlab.eurecom.fr/oai/openairinterface5g(2)OAI build 5G的主页

doc/BUILD.md · develop · oai / openairinterface5G · GitLabhttps://gitlab.eurecom.fr/oai/openairinterface5g/-/blob/develop/doc/BUILD.md注意:

目前为止,5G NR的代码还在develop分支上,而不master分支。

1.2 代码补充说明

(1)4G LTE核心网EPC是一个独立的项目,不是OAI RAN的一部分Home · OPENAIRINTERFACE/openair-epc-fed Wiki · GitHub

(2)5G NR核心网5GC是一个独立项目:

这里只包括4G/5G UE和4G/5G基站的代码。

1.3 开发环境的架构

(1)Windows:MobaXterm:

用于远程登录到Linux build server,在编译时,也可以使用SecureCRT替代,但运行目标代码时,最好能够使用MobaXterm,MobaXterm支持远程图形化显示,目标代码运行时,可以动态的图形化显示星座图。

(2)Linux:源文件编译路径:

xxx/oai/…     =》源文件按照路径

xxx/oai/openairinterface5g/cmake_targets/    =》编译路径

xxx/oai/openairinterface5g/cmake_targets/ran_build/build   =》编译后的目标代码路径

(3)github:OAI源代码开源项目

(4)第三方库服务器

在编译的过程中,需要在线下载第三方库,因此需要预先配置Linux服务器,确保Linux编译服务器能够从远程下载到相应的文件。

1.4 OAI RAN软件的安装启动步骤

步骤1:Linux编译服务器的选择

步骤2:Linux编译服务器的内核配置

步骤3:源代码软件工程的github下载

步骤4:构建目标可执行文件

步骤5:Linux运行服务器的选择

步骤6:Linux运行服务器的内核配置

步骤7:部署和运行目标程序

步骤8:功能测试

本文重点关注步骤1-4

第2章 步骤1:Linux编译服务器的选择

2.1 官方指南

OpenAirSystemRequirements · Wiki · oai / openairinterface5G · GitLab

第3章 步骤2:Linux编译服务器的内核配置

3.1 官方指南

第4章 步骤3:源代码软件工程的github下载

4.1 官方指南

doc/GET_SOURCES.md · develop · oai / openairinterface5G · GitLabhttps://gitlab.eurecom.fr/oai/openairinterface5g/-/blob/develop/doc/GET_SOURCES.md

4.2 手工下载源文件的压缩文件(只适合本地看代码,不适合编译源代码)

(1)通过windows IE 登录到如下的主页

Files · develop · oai / openairinterface5G · GitLabOpenairinterface 5G Wireless Implementationhttps://gitlab.eurecom.fr/oai/openairinterface5g/-/tree/develop

(2)选择源文件的压缩文件的格式

获得压缩文件:openairinterface5g-develop.tar.gz

(3)通过windows解压工具解压源代码

(4)通过FTP把下载的压缩文件传输到Linux 编译服务器指定的oai工作目录中

例如:

/home/username/oai

(5)解压openairinterface5g-develop.tar.gz到当前目录

 tar -zxvf openairinterface5g-develop.tar.gz

解压后得到:openairinterface5g-develop目录。

为了简化名称,可以修改为:openairinterface5g

mv openairinterface5g-develop openairinterface5g
~/oai/openairinterface5g$ ls
CHANGELOG.md  cmake_targets  CONTRIBUTING.md  executables  nfapi      openair1  openshift   targets
charts        common         doc              LICENSE      NOTICE.md  openair2  pre-commit
ci-scripts    configuration  docker           maketags     oaienv     openair3  README.md

4.3 Linux下通过git clone获取(适合编译源代码)

(1)配置git

git config --global user.name "Your Name"
git config --global user.email "Your email address"

如果是OAI社区的开发者,这个是必须的。

如果是OAI社区的使用者,这个不是必须,但最好能够提供

备注:只需要执行一次。

(2)在你的Ubuntu编译服务器上安装访问git服务器的安全证书

echo -n | openssl s_client -showcerts -connect gitlab.eurecom.fr:443 2>/dev/null | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' | sudo tee -a /etc/ssl/certs/ca-certificates.crt

备注:只需要执行一次。

(3)disable证书检查

如果你没有权限访问/etc/ssl,则需要disalbe本地的证书检查。

Disable certificate check completely if you do not have root access to /etc/ssl directory

git config --global http.sslverify false

备注:只需要执行一次。

(4)获取所有分支的源代码,包括主分支和各种开发分支(耗时10分钟左右)

/home/username/oai

git clone https://gitlab.eurecom.fr/oai/openairinterface5g.git

(5)检查当前的分支

cd openairinterface5g

git branch

master

备注:默认当前分支为master主分支。

(6)切换到develop分支

cd openairinterface5g

git checkout develop

Switched to branch 'develop'
Your branch is up to date with 'origin/develop'.

备注:

The tag naming conventions are :

  • On master branch: v1.x.y where
    • x is the minor release number, incremented every 2-3 months when we are merging develop into master branch.
    • y is the maintenance number, starting at 0 when we do a minor release and being incremented when a bug fix is incorporated into master branch.
  • On develop branch yyyy.wxx
    • yyyy is the calendar year
    • xx the week number within the year

(7)更新代码

//更新当前分支
git pull

//把xxxx分支合并到自己分支
git merger xxx

至此,代码已经准备好,可以进行编译了。
 

第5章 步骤4:构建X86可执行文件

5.1 官方指南:

doc/BUILD.md · develop · oai / openairinterface5G · GitLab

5.2 主要的二进制可执行文件输出

(1)LTE

  • The LTE UE: lte-uesoftmodem
  • The LTE eNodeB: lte-softmodem
  • The LTE PHY simulators: dlsim and ulsim  (LTE上下行PHY的模拟器)

(2)NR

  • The 5G UE: nr-uesoftmodem  => gnb可执行文件(X86)
  • The 5G gNodeB: nr-softmodem -》ue可执行文件 (X86)
  • The 5G PHY simulators: nr_dlschsim nr_dlsim nr_pbchsim nr_pucchsim nr_ulschsim nr_ulsim polartest smallblocktest ulsim ldpctest(5Gd的PHY模拟器)

5.3 辅助文件输出

  • conf2uedata: a binary used to build the UE data from a configuration file. The created file emulates the sim card of a 3GPP compliant phone.
  • nvram: a binary used to build UE (IMEI...) and EMM (IMSI, registered PLMN) non volatile data.
  • rb_tool: radio bearer utility
  • genids T Tracer utility, used at build time to generate T_IDs.h include file.

5.4 重要的编译功能选项

OAI软件支持很多的业务场景,比如是否支持S1接口,是否使用PHY或RF模拟器。

不同的场景,需要编译的软件模块不同,内部的接口不同,这些业务场景选项,可以通过配置文件或命令行选项来实现。

这些选择对编译的输出文件的功能有很大的影响,因此需要根据自身的需要进行选择。

(1)是否支持S1接口

  • --s1       =》支持真实的S1接口
  • --noS1  =》不支持真实的S1接口,采用S1模拟器器

(2)底层硬件模拟器

  • RF模拟器
  • PHY模拟器
  • L2模拟器

5.5 多用户环境下,编译前的准备

在OAI编译的过程中个,会在/tmp等目录中下载和生产中间文件,因此编译脚本会先清除给目录中的内容,这些文件为多用户共享。

在多用户环境中,其他用户的用户也会在此目录下生成文件,用户A,无法删除用户B在此目录中创建的文件,导致编译出错。

因此,在编译前需要预先进行手工处理:

(1)清空/tmp目录下的内容(这里有潜在的风险,注意避免错误删除其他)

cd /tmp


/tmp>ls
asn1c  protobuf-3.3.0  protobuf-c  protobuf-cpp-3.3.0.tar.gz


/tmp>sudo rm -rf *

5.6 构建外部依赖文件

外部依赖文件与目标文件的场景无关,都需要预先编译,否则会出现运行时的依赖库缺乏的问题。

cd <your oai installation directory>/openairinterface5g/
source oaienv
cd cmake_targets/
./build_oai -I

5.7 构建LTE UE, LTE eNodeB , NR UE, NR gNodeB,RF USRP可执行文件

cd <your oai installation directory>/openairinterface5g/
source oaienv
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 -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 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=》LTE基站
  • --UE is to build the lte-uesoftmodem executable and all required shared libraries=》LTE手机
  • --gNB is to build the nr-softmodem executable and all required shared libraries =》NR基站
  • --nrUE is to build the nr-uesoftmodem executable and all required shared libraries =》NR手机

当然,也可以单独构建某个目标文件或LTE目标文件或NR目标文件。

cd <your oai installation directory>/openairinterface5g/
source oaienv
cd cmake_targets/
./build_oai -w USRP --nrUE --gNB
cd <your oai installation directory>/openairinterface5g/
source oaienv
cd cmake_targets/
./build_oai -w USRP --eNB --UE

5.8 Build LTE UE and eNB with RF Simulators

cd <your oai installation directory>/openairinterface5g/
source oaienv
cd cmake_targets/
./build_oai -w SIMU --eNB --UE


Compiling tcp_bridge_oai
Log file for compilation is being written to: /home/wangwenbing/oai/openairinterface5g/cmake_targets/log/tcp_bridge_oai.Rel15.txt
tcp_bridge_oai compiled


Building transport protocol libraries
Log file for compilation is being written to: /home/wangwenbing/oai/openairinterface5g/cmake_targets/log/oai_eth_transpro.Rel15.txt 

oai_eth_transport compiled


liboai_transpro.so is linked to ETHERNET transport
10. Bypassing the Tests ...
BUILD SHOULD BE SUCCESSFUL

5.9 build NR UE and gNB with RF Simulators

cd <your oai installation directory>/openairinterface5g/
source oaienv
cd cmake_targets/
./build_oai -w SIMU --nrUE --gNB

输出结果:

-- Configuring done
-- Generating done
-- Build files have been written to: /home/wangwenbing/oai/openairinterface5g/cmake_targets/ran_build/build
Compiling nr-softmodem...
Log file for compilation is being written to: /home/wangwenbing/oai/openairinterface5g/cmake_targets/log/nr-softmodem.Rel15.txt

nr-softmodem compiled


Compiling nr-uesoftmodem...
Log file for compilation is being written to: /home/wangwenbing/oai/openairinterface5g/cmake_targets/log/nr-uesoftmodem.Rel15.txt
nr-uesoftmodem compiled


Building shared libraries common to UE and gNB
Log file for compilation is being written to: /home/wangwenbing/oai/openairinterface5g/cmake_targets/log/params_libconfig.Rel15.txt
params_libconfig compiled
Log file for compilation is being written to: /home/wangwenbing/oai/openairinterface5g/cmake_targets/log/coding.Rel15.txt
coding compiled


Compiling rfsimulator
Log file for compilation is being written to: /home/wangwenbing/oai/openairinterface5g/cmake_targets/log/rfsimulator.Rel15.txt
rfsimulator compiled

5.10 单独构建PHY Simulators

(1)方法1

cd <your oai installation directory>/openairinterface5g/
source oaienv
cd cmake_targets/
./build_oai --phy_simulators

(2)方法2:

cd <path to oai sources>/openairinterface5g/cmake_targets/ran_build/build

make rfsimulator

5.11 构建可选的库,如telnet或其他

(1)伴随性构建

./build_oai -I -w USRP --eNB --UE --build-lib telnetsrv

(2)独立构建

./build_oai  --build-lib telnetsrv

(3)构建其他库

./build_oai  --build-lib all

第6章 build_oai所有选项解读

Option Status Description
-h maintained get help
-c maintained

erase all previously built files for this target before starting the new build. =》针对某个目标架构,清楚先前的文件,全部重新构建。

-C maintained, needs improvement erase all previously built files for any target before starting the new build. =》针对所有目标架构,清楚先前的文件,全部重新构建。
--verbose-compile maintained

get compilation messages, as when running make or gcc directly.

=》显示编译过程

--cflags_processor maintained used to pass options to the compiler. =》传递编译flag
--clean-kernel unknown no code in the script corresponding to this option
--install-system-files maintained

install oai built binaries in linux system files repositories

-w maintained and tested in CI for USRP device

build corresponding oai device and create the soft link to enforce this device usage at run-time =》构建OAI RF设备,并创建相关的软连接,以便使用真实的OAI设备。目前只有一款真实的RF设备USRP 是经过测试过的。

如果没有使用USRP设备,可以不使用该选项。

--phy_simulators maintained, tested in CI

build all PHY simulators, a set of executables allowing unitary tests of LTE and 5G channel implementation within oai. =》构建所有的物理层simulators,包括LTE和NR.

--core_simulators
-s start选项,编译后,根据测试脚本的定义,自动启动持续集成CI测试。
--run-group
-I maintained, tested in CI install external dependencies before starting the build =>是否需要安装外部依然性文件。
--install-optional-packages maintained install optional packages, useful for developing and testing. look at the check_install_additional_tools function in cmake_targets/tools/build_helper script to get the list =》编译时,先安装可选包。
-g maintained

Specifies the level of debugging options used to build the binaries. Available levels are Release, RelWithDebInfo, MinSizeRe and Debug. If -g is not specified, Release is used, if -g is used without any level, Debug is used.

=》打开编译的debug信息。

-G maintained Display Cmake debugging messages =》显示cmake debug消息
--eNB maintained and tested in CI build lte-softmodem the LTE eNodeB =》构建LTE eNB可执行文件。
--UE maintained and tested in CI build lte-uesoftmodem the LTE UE =》构建LTE UE可执行文件
--gNB maintained and tested in CI build nr-softmodem the 5G gNodeB =》构建NR gNB可执行文件
--nrUE maintained and tested in CI build nr-uesoftmodem the 5G UE =》构建5G UE 可执行文件
--usrp-recplay deprecated use the USRP configuration parameters to use the record player.
--build-lib maintained build optional shared library(ies), which can then be loaded at run time via command line option. Use the --help option to get the list of supported optional libraries. all can be used to build all available optional libraries. =》是不需要构建可选的共享库so库
--UE-conf-nvram maintained Specifies the path to the input file used by the conf2uedata utility. defaults to openair3/NAS/TOOLS/ue_eurecom_test_sfr.conf
--UE-gen-nvram maintained Specifies the path where the output file created by the conf2uedata utility will be placed. Defaults to target/bin
-V deprecated Used to build with support for synchronization diagram utility. This is now available via the T-Tracer and is included if T-Tracer is not disabled.
--build-doxygen unknown build doxygen documentation, many oai source files do not include doxygen comments
--disable-deadline --enable-deadline --disable-cpu-affinity deprecated These options were used to activate or de-activate specific code depending on the choice of a specific linux scheduling mode. This has not been tested for a while and should be implemented as configuration options
--disable-T-Tracer maintained, to be tested Remove T_Tracer and console LOG messages except error messages.
--ue-autotest-trace --ue-timing --ue-trace deprecated Were used to enable conditional code implementing debugging messages or debugging statistics. These functionalities are now either available from run-time options or not maintained.
--build-eclipse unknown

第7章 构建成功的验证

7.1 静态验证

(1)build路径的生成

xxx/oai/openairinterface5g/cmake_targets/ran_build/build

(2)可执行文件生成

xxx/oai/openairinterface5g/cmake_targets/ran_build/build/nr-softmodem

xxx/oai/openairinterface5g/cmake_targets/ran_build/build/nr-uesoftmodem

xxx/oai/openairinterface5g/cmake_targets/ran_build/build/librfsimulator.so

7.2 动态运行验证(运行程序)

待续。。。。。


作者主页(文火冰糖的硅基工坊):文火冰糖(王文兵)的博客_文火冰糖的硅基工坊_CSDN博客

本文网址:https://blog.csdn.net/HiWangWenBing/article/details/120556060

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

[OpenAirInterface实战-7] :OAI编译环境的架构、搭建、目标代码的编译 的相关文章

随机推荐

  • 频繁跳槽是职场走下坡路的开始,Java程序员注意:跳槽前,你该考虑5个问题

    本文转载自 频繁跳槽是职场走下坡路的开始 Java程序员注意 跳槽前 你该考虑5个问题 职场上 跳槽是所有职场人都会遇到的问题 关于职场跳槽的理由 笔者做了以下盘点 和直接领导的矛盾导致离职 逃避问题而离职 工作压力大 挣钱少而离职 总之
  • Harbor安装及简单使用

    在虚拟机初始化的基础上 安装Docker wget O etc yum repos d CentOS Base repo http mirrors aliyun com repo Centos 7 repo wget https mirro
  • 2020-06-11

    你需要继续学习 这样一来如果有机会的话 你应该可以往前进一步
  • 【C语言】让你不再害怕指针——C指针详解(经典,非常详细)

    https blog csdn net qq 41035588 article details 79673674
  • java 读取excel数据

    本文共介绍两种方式 第一种是常规POI读取 第二种是大文件读取 依赖包
  • OpenCV3.3 + Python3.6 开发环境配置

    2018 9 6 更新 Anaconda3 5 2 0版本 Python 3 6 下OpenCV 3 安装 今天重新安装了 Python 的环境 发现在新版本 Anaconda3 下安装配置 OpenCV 3 十分简单 在 Anaconda
  • 【ubuntu虚拟机命令】+ 【mysql数据库】

    ubuntu虚拟机命令 cd 进入家目录 ll 查看文件列表 rm rf 目录名 删除目录 sudo su 从用户切换到 root su ubuntu 从 root 切换到 用户 vi bim 打开文件 i 编辑文件 退出 esc 保存退出
  • 40-400-020-运维-优化-使用MySQLTunner优化MySQL

    文章目录 1 概述 2 安装MySQL 3 下载 4 报告分析 1 概述 MySQLTuner 是一个 Perl 脚本 可以用来分析您的 MySQL 性能 并且基于收集到的信息给出相应的优化建议 这样子 您就可以调整 my cnf 从而优化
  • 关于colmap+nerf对数据集进行预处理的使用总结

    前言 零零碎碎的东西太多 有必要统一记录一下 因为是回忆步骤 所以可能有不准确的地方 Colmap的使用 1 下载 下载链接 colmap 下载之后直接解压就能使用 点击COLMAP bat 2 colmap 这里到处都是很详细的操作步骤
  • Chisel3 - util - LockingArbiter

    https mp weixin qq com s 5oAwH3scumARzPidRBfG2w 带锁多入单出仲裁器 输出会被锁定指定的时钟周期 参考链接 https github com freechipsproject chisel3 b
  • 单片机系统中实用的按键驱动(STM32、51都适用)

    目录 1 自己使用的按键驱动 1 1 驱动源码 1 2 使用方法 2 另一种按键驱动 2 1 驱动源码 2 2 使用方法 在我们嵌入式开发中 产品上往往少不了按键 一个好的按键驱动可以满足不同场合的客户需求 这里我分享几个实用的按键驱动 希
  • Python机器学习笔记 使用sklearn做特征工程和数据挖掘

    特征处理是特征工程的核心部分 特征工程是数据分析中最耗时间和精力的一部分工作 它不像算法和模型那样式确定的步骤 更多的是工程上的经验和权衡 因此没有统一的方法 但是sklearn提供了较为完整的特征处理方法 包括数据预处理 特征选择 降维等
  • 西门子S7-300 PLC 的50个经典问题

    1 使用CPU 315F和ET 200S时应如何避免出现 通讯故障 消息 使用CPU S7 315F ET 200S以及故障安全DI DO模块 那么您将调用OB35 的故障安全程序 而且 您已经接受所有监控时间的默认设置值 并且愿意接收 通
  • Linux 小结

    前言 为了便于理解 本文从常用操作和概念开始讲起 虽然已经尽量做到简化 但是涉及到的内容还是有点多 在面试中 Linux 知识点相对于网络和操作系统等知识点而言不是那么重要 只需要重点掌握一些原理和命令即可 为了方便大家准备面试 在此先将一
  • Python爬虫

    文章目录 1 概述 2 数据采集 3 数据清洗 3 1 读取数据 3 2 去掉车位 地下室 数据 3 3 房源信息解析 4 数据处理及可视化 4 1 各地区二手房源数 4 2 各地区二手房均价 4 3 各地区二手房总价 4 4 各地区二手房
  • subtitle, CC, TTX

    论坛中的一段解答 1 数据广播 我不清楚你所指的数据广播具体是什么 但在DVB T和MHEG的标准里面传送的TTX和SUB这些被称为数据广播 在中国 analog channel里面的TTX信息被称为图文信息 也就是数据广播 也许有错 你可
  • 输入字符串,逆序输出(两种方法)

    问题描述 从键盘上输入一组字符串 实现逆序输出 解题思路 方法一 输出的时候从 n 1 的数据往前依次输出 方法二 假设输入n个字符 字符串默认末尾补上 0 将第0个字符和第 n 1 个字符交换 依次交换中间的数据 输入的数据 H E L
  • 使用js做华为机试题输入输出总结

    1 输入 1 输入一行 进行处理 得到输出 输入用例有多组 while line readline 代码 2 输入两行 进行处理 得到输出 输入用例有多组 while str1 readline str2 readline 代码 2 输出
  • 解决CentOS7系统无法使用中文输入法的问题

    解决CentOS7系统无法使用中文输入法的问题 问题 不能切换中文输入 解决 进入到应用程序 gt Region Language gt 添加 gt 选择 汉语 中国 gt 汉语 Intelligence Pinyin 原文 https b
  • [OpenAirInterface实战-7] :OAI编译环境的架构、搭建、目标代码的编译

    作者主页 文火冰糖的硅基工坊 文火冰糖 王文兵 的博客 文火冰糖的硅基工坊 CSDN博客 本文网址 https blog csdn net HiWangWenBing article details 120556060 目录 第1章 概述