BUILD.md 14.5 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13
<table style="border-collapse: collapse; border: none;">
  <tr style="border-collapse: collapse; border: none;">
    <td style="border-collapse: collapse; border: none;">
      <a href="http://www.openairinterface.org/">
         <img src="./images/oai_final_logo.png" alt="" border=3 height=50 width=150>
         </img>
      </a>
    </td>
    <td style="border-collapse: collapse; border: none; vertical-align: center;">
      <b><font size = "5">OAI Build Procedures</font></b>
    </td>
  </tr>
</table>
14

15
This page is valid on tags starting from **`2019.w09`**.
16

17
# Soft Modem Build Script
18

19
The OAI EPC is developed in a distinct project with it's own [documentation](https://github.com/OPENAIRINTERFACE/openair-epc-fed/wiki) , it is not described here.
20

21
OAI softmodem sources, which aim to implement 3GPP compliant UEs, eNodeB and gNodeB can be downloaded from the Eurecom [gitlab repository](./GET_SOURCES.md).
22 23 24 25 26 27

Sources come with a build script [build_oai](../cmake_targets/build_oai) located at the root of the `openairinterface5g/cmake_targets` directory. This script is developed to build the oai binaries (executables,shared libraries) for different hardware platforms, and use cases. 

The main oai binaries, which are tested by the Continuous Integration process are:

-  The LTE UE: `lte-uesoftmodem`
28
-  The 5G UE: `nr-uesoftmodem`
29
-  The LTE eNodeB: `lte-softmodem`
30 31 32 33 34 35 36
-  The 5G gNodeB: `nr-softmodem`
-  The LTE PHY simulators: `dlsim` and `ulsim`
-  The 5G PHY simulators: `nr_dlschsim` `nr_dlsim`   `nr_pbchsim` `nr_pucchsim` `nr_ulschsim` `nr_ulsim` `polartest` `smallblocktest`
   `ulsim` `ldpctest`

Running the  [build_oai](../cmake_targets/build_oai) script also generates some utilities required to build and/or run the oai softmodem binaries:

Julio Renner's avatar
Julio Renner committed
37
- `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.
38 39 40
- `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. This binary is located in the [T Tracer source file directory](../common/utils/T) .
41

42
The build system for OAI uses [cmake](https://cmake.org/) which is a  tool to generate makefiles. The `build_oai` script is a wrapper using cmake, make and standard linux shell commands to ease the oai build and use . The file describing how to build the executables from source files is the [CMakeLists.txt](../cmake_targets/CMakeLists.txt), it is used as input by cmake to generate the makefiles.
43 44 45 46

The oai softmodem supports many use cases, and new ones are regularly added. Most of them are accessible using the configuration file or the command line options and continuous effort is done to avoid introducing build options as it makes tests and usage more complicated than run-time options. The following functionalities, originally requiring a specific build are now accessible by configuration or command line options:

- s1, noS1
47
- all simulators as the rfsimulator, the L2 simulator, with exception of PHY simulators, which are distinct executables. 
48 49


Francois TABURET's avatar
Francois TABURET committed
50
Calling the `build_oai` script with the -h option gives the list of all available options, but a process to simplify and check the requirements of all these options is on-going. Check the [table](BUILD.md "# `build_oai` options") At the end of this page to know the status of `buid_oai` options which are not described hereafter.
51

52
# Building PHY Simulators
53

Remi Hardy's avatar
Remi Hardy committed
54 55 56 57 58 59 60 61 62 63 64 65 66
The PHY layer simulators (LTE and NR) can be built as follows:  

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

After completing the build, the binaries are available in the cmake_targets/phy_simulators/build directory.  
A copy is also available in the target/bin directory, with all binaries suffixed by the 3GPP release number, today **.Rel15**.  


67
Detailed information about these simulators can be found [in this dedicated page](https://gitlab.eurecom.fr/oai/openairinterface5g/wikis/OpenAirLTEPhySimul)
68

69
# Building UEs, eNodeB and gNodeB Executables
70

71
After downloading the source files, a single build command can be used to get the binaries supporting all the oai softmodem use cases (UE and [eg]NodeB):
72 73 74 75

```
cd <your oai installation directory>/openairinterface5g/
source oaienv
76
cd cmake_targets/
77
./build_oai -I -w USRP --eNB --UE --nrUE --gNB
78 79
```

Florian Kaltenberger's avatar
Florian Kaltenberger committed
80
- 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!
81
- 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.
82
- `--eNB` is to build the `lte-softmodem` executable and all required shared libraries
83
- `--gNB` is to build the `nr-softmodem` executable and all required shared libraries
84
- `--UE` is to build the `lte-uesoftmodem` executable and all required shared libraries
85
- `--nrUE` is to build the `nr-uesoftmodem` executable and all required shared libraries
86

87
You can build any oai softmodem executable separately, you may not need all of them depending on your oai usage.
88

89
After completing the build, the binaries are available in the `cmake_targets/ran_build/build` directory. A copy is also available in the `target/bin` directory, with all binaries suffixed by the 3GPP release number, today .Rel15.
90

91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120
## Issue when building `nasmeh` module ##

A lot of users and contributors have faced the issue: `nasmesh` module does not build.

The reason is that the linux headers are not properly installed. For example:

```bash
$ uname -r
4.4.0-145-lowlatency
$ dpkg --list | grep 4.4.0-145-lowlatency | grep headers
ii  linux-headers-4.4.0-145-lowlatency         4.4.0-145.171
```

In my example it is properly installed.

Check on your environment:

```bash
$ uname -r
your-version
$ dpkg --list | grep your-version | grep headers
$
```

Install it:

```bash
$ sudo apt-get install --yes linux-headers-your-version
```

121 122 123 124 125 126 127 128 129 130 131 132 133 134
On CentOS or RedHat Entreprise Linux:

```bash
$ uname -r
3.10.0-1062.9.1.rt56.1033.el7.x86_64
$ yum list installed | grep kernel | grep devel
kernel-devel.x86_64              3.10.0-1062.9.1.el7         @rhel-7-server-rpms
kernel-rt-devel.x86_64           3.10.0-1062.9.1.rt56.1033.el7
```

If your kernel is generic, install `kernel-devel` package: `sudo yum install kernel-devel`

In most case, your kernel is real-time. Install `kernel-rt-devel` package: `sudo yum install kernel-rt-devel`

135
# Building Optional Binaries
136

137
## Telnet Server
138

139
The telnet server can be built  with the `--build-lib telnetsrv` option, after building the softmodem or while building it.
140

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

143
or
144

145
`./build_oai  --build-lib telnetsrv`
146

Francois TABURET's avatar
Francois TABURET committed
147
You can get documentation about the telnet server  [here](common/utils/telnetsrv/DOC/telnetsrv.md)
148

149 150


151 152
## Other optional libraries

153 154 155
Using the help option of the build script you can get the list of available optional libraries. Those which haven't been mentioned above are known to need more tests and documentation. 

`./build_oai  --build-lib all` will build all available optional libraries.
156

157
# `build_oai` options
158 159 160 161 162 163

| 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. |
164
| --verbose-compile                                           | maintained                                  | get compilation messages, as when running `make` or `gcc` directly. |
165
| --cflags_processor                                          | maintained                                  | used to pass options to the compiler.                        |
166 167 168
| --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 |
169
| --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. |
170 171 172 173
| --core_simulators                                           |                                             |                                                              |
| -s                                                          |                                             |                                                              |
| --run-group                                                 |                                             |                                                              |
| -I                                                          | maintained, tested in CI                    | install external dependencies before starting the build      |
174 175 176
| --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. |
| -G                                                          | maintained                                  | Display Cmake debugging messages                             |
177 178
| --eNB                                                       | maintained and tested in CI                 | build `lte-softmodem` the LTE eNodeB                         |
| --UE                                                        | maintained and tested in CI                 | build `lte-uesoftmodem` the LTE UE                           |
179 180 181 182 183 184
| --gNB                                                       | maintained and tested in CI                 | build `nr-softmodem` the 5G gNodeB                           |
| --nrUE                                                      | maintained and tested in CI                 | build `nr-uesoftmodem` the 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. |
| --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](../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` |
185 186 187 188 189 190 191 192
| -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                                     |                                                              |
|                                                             |                                             |                                                              |

frtabu's avatar
frtabu committed
193 194 195 196 197 198
[oai wiki home](https://gitlab.eurecom.fr/oai/openairinterface5g/wikis/home)

[oai softmodem features](FEATURE_SET.md)

[running the oai softmodem ](RUNMODEM.md)