作者主页(文火冰糖的硅基工坊):文火冰糖(王文兵)的博客_文火冰糖的硅基工坊_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/oaigit clone https://gitlab.eurecom.fr/oai/openairinterface5g.git

(5)检查当前的分支

cd openairinterface5ggit branch

master

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

(6)切换到develop分支

cd openairinterface5ggit 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/buildmake 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

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

  1. LNMP架构搭建(源码编译)

    1. LNMP架构介绍 LNMP代表的就是:Linux系统下Nginx+MySQL+PHP这种网站服务器架构. Linux是一类Unix计算机操作系统的统称,是目前最流行的免费操作系统.代表版本有:d ...

  2. 关于Notepad++环境的搭建以及代码的编译工具mingw

      Nopepad++是一个代码编辑工具  1.下载地址http://notepad-plus.en.softonic.com/ 也可以直接百度搜索Nopepad++ 点击第二个 然后   再点击那个 ...

  3. Android编译环境——ubuntu12.04上android2.3.4编译错误以及解决

    1.编译前安装jdk1.5以上版本,我系统安装了jdk1.6 --检查jdk是否安装:java --version --安装jdk: sudo apt-get install sun-java6-jd ...

  4. Ubuntu平台编译环境配置及搭建

    编译服务器配置1. Prepare Ubuntu 14.04.2以下使用Ubuntu14.04.gcc 4.8 配置 2.Install Google-recommended packagesudo ...

  5. 企业实战(Jenkins+GitLab+SonarQube)_12_Jenkins+soanr服务器搭建和代码检查

    文章目录 一.前期准备 1.1. jenkins 服务器搭建完成 1.2. sonarqube服务器搭建完成 二.Jenkins 配置 2.1. 安装 Sonar 插件 2.2. 配置 SonarQu ...

  6. [OpenAirInterface实战-9] :OAI代码的运行与常规测试(ping、Iperf)之RF Simulator

    作者主页(文火冰糖的硅基工坊):文火冰糖(王文兵)的博客_文火冰糖的硅基工坊_CSDN博客 本文网址:https://blog.csdn.net/HiWangWenBing/article/detai ...

  7. 【C++基础】【集成编译环境01】Clion的C++编译环境和Boost Test Framworks框架运行实践

    本文项目源码链接: CLionboostunittestframeworks项目源码-C++文档类资源-CSDN文库 前言和行文思路: VScode.Clion.Pycharm都是集成环境的编辑器,他 ...

  8. 企业应用的Ant模组编译环境

    摘要: 编译环境对于今日的Java企业级应用程序来说,越来越难于管理了.堆积如山的代码,配置文件,以及对第三方的依赖(third-party dependencies)都使得管理编译环境变得困难.本文 ...

  9. 如何建立自己的RISC-V编译环境--汇编?

    如何建立自己的RISC-V编译环境–汇编? 1.RISC-V编译环境框架 这是我RISC-V编译环境的架构: build case common toolchain 一级目录 二级目录 说明 buil ...

最新文章

  1. Linux常见命令(五)——rmdir
  2. 关闭数据执行保护(DEP)
  3. NodeJS学习笔记—1.CommonJS规范
  4. MaxCompute SQL原理解析及性能调优
  5. 3-7:常见任务和主要工具之文本处理
  6. linux centeros下Redis的安装
  7. pyhton中常用的基础模块
  8. 鼠标点击操作实际上如何传递到显示器?【全流程图解】
  9. 卡内基梅隆大学计算机专业录取难,卡内基梅隆大学申请难度分析
  10. 苹果HomeKit生态深度解析,在智能家居领域后发制人?
  11. 腾达ac1200开虚拟服务器,腾达F1200 11AC双频无线路由器的上网设置教程
  12. 蓝桥杯基础-【切面条】不用画图的解题思路
  13. bam获取序列_bam格式文件处理大全(四)
  14. windows10开启/关闭超级管理员账号登陆
  15. 嵌入式开发笔记——调试组件SEGGER_RTT
  16. 网站使用手机相机_手机如何修改证件照片大小和分辨率
  17. 北交大计算机学院教授,北京交通大学计算机与信息技术学院导师教师师资介绍简介-张树君...
  18. 代数方程模型——量纲分析
  19. [H5]HTML5样式、链接和表格
  20. 微信小程序学习笔记(4)

热门文章

  1. Nature reviews neuroscience:后扣带皮层的三分观点
  2. 19学习提升:gRPC源码中的那些优秀设计(上)
  3. 工业实时数据库平台设计
  4. Ubuntu解除文件夹只读
  5. oracle查询所有表字段属性_Oracle查询表字段属性的方法
  6. CSS三:CSS的三种引入方式
  7. 简述单工、半双工、全双工的区别
  8. vulnhub靶机-JETTY: 1
  9. 2012matlab模拟题及答案,MATLAB语言及应用-A卷_2012及答案
  10. SQL-插入insert四种方式