---
# System prepended metadata

title: 'TEEP@2024 - OSC L1 Setup [FHI, WLS, FAPI]'

---

{%hackmd ElOJTlJjTg-GQtxooVV5iw %}

# Build OSC ODU-LOW

## Intel FlexRAN L1
1. Setup Git LFS
```
$ curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.rpm.sh | sudo bash
$ sudo yum install git-lfs
git lfs install

```
2. Clone Intel FlexRAN
```
$ git clone https://github.com/intel/FlexRAN.git
```
## OSC PHY
1. Clone and edit file setupenv.sh
```
$ git clone https://github.com/o-ran-sc/o-du-phy
$ cd o-du-phy
$ vim setupenv.sh
```
2. Edit configuration as below
```
#!/bin/bash

export DIR_ROOT=/home/jsaputro/ORAN
#set the L1 binary root DIR
export DIR_ROOT_L1_BIN=$DIR_ROOT/FlexRAN
#set the phy root DIR
export DIR_ROOT_PHY=$DIR_ROOT/o-du-phy
#set the DPDK root DIR
export DIR_ROOT_DPDK=$HOME/dpdk-stable-20.11.3
#set the GTEST root DIR
export DIR_ROOT_GTEST=/home/gtest/gtest-1.7.0

export WIRELESS_SDK_TARGET_ISA=avx512
export DIR_WIRELESS_TEST_5G=$DIR_ROOT_L1_BIN/testcase
export DIR_WIRELESS_SDK=$DIR_ROOT_L1_BIN/sdk/build-avx512-icc
export DIR_WIRELESS_TABLE_5G=$DIR_ROOT_L1_BIN/l1/bin/nr5g/gnb/l1/table
#source /opt/intel/system_studio_2019/bin/iccvars.sh intel64 -platform linux
export XRAN_DIR=$DIR_ROOT_PHY/fhi_lib
export XRAN_LIB_SO=true
export RTE_TARGET=x86_64-native-linuxapp-icc
export RTE_SDK=$DIR_ROOT_DPDK
export DESTDIR=$DIR_ROOT_DPDK

#Uncomment to run tests - it's commented to make builds faster.
#export GTEST_ROOT=$DIR_ROOT_GTEST

export ORAN_5G_FAPI=true
export DIR_WIRELESS_WLS=$DIR_ROOT_PHY/wls_lib
export DEBUG_MODE=true
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/:$DIR_WIRELESS_WLS:$XRAN_DIR/lib/build:/opt/intel/oneapi/compiler/2022.1.0/linux/compiler/lib/intel64_lin/:/home/jsaputro/ORAN/FlexRAN/l1/source/nr5g/api/:/home/jsaputro/ORAN/dpdk-stable-20.11.3/build/lib/
export DIR_WIRELESS=$DIR_ROOT_L1_BIN/l1
export DIR_WIRELESS_ORAN_5G_FAPI=$DIR_ROOT_PHY/fapi_5g
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$DIR_ROOT_L1_BIN/libs/cpa/bin

```


### Build FHI (Fronthaul Interface) / XRAN
1. Enter $your_dir/o-du-phy/fhi_lib/
```
$ cd $your_dir/o-du-phy/fhi_lib/
```
2. Build fhi shared library (xran)
```
$ sudo chmod +x ./build.sh
$ ./build.sh xclean
$ ./build.sh
```
![Screenshot from 2024-01-05 15-02-38](https://hackmd.io/_uploads/B1EhvNSda.png)

### Build WLS Library
> WLS Library is shared library for FAPI translation used by OSC code.
1. Enter $your_dir/o-du-phy/fapi_5g/build
```
$ cd $your_dir/o-du-phy/fapi_5g/build
```
2. Edit makefile and add linker to c library of your L1.
```
$ vim makefile
```
![Screenshot from 2024-01-05 15-14-22](https://hackmd.io/_uploads/rk7o5NH_p.png)

3. Build FAPI
FAPI is a translator from Low PHY to High PHY
![FAPI Translator](https://hackmd.io/_uploads/HJraiVSO6.png)


#### To Build
```
./build.sh xclean
./build.sh
```
![Screenshot from 2024-01-05 15-12-58](https://hackmd.io/_uploads/rkh4qESOT.png)

File binary of your compilation is at $your_dir/o-du-phy/fapi_5g/bin/

### Integrate FlexRAN L1 and FAPI
1. RUN L1
```
cd $your_dir/FlexRAN/l1/bin/nr5g/gnb/l1
./l1.sh -e
```
![Screenshot from 2024-01-05 15-34-48](https://hackmd.io/_uploads/ByYdkrHda.png)

2. RUN FAPI
```
$ cd $your_dir/o-du-phy/fapi_5g/bin
$ ./oran_5g_fapi --cfg ./oran_5g_fapi.cfg
```
![Screenshot from 2024-01-05 15-37-42](https://hackmd.io/_uploads/ryv1gHB_T.png)
