# FlexRIC Installation
[TOC]
---
## Definition
FlexRIC is a Near RT RIC framework that is integrated with OAI.
## System Requirements
| System |Requirement |
|:--------:|:----: |
| OS | Ubuntu 20.04 LTS |
| Storage | >= 100 GB |
| RAM | >= 8 GB |
| CPU Core | >= 8 |
| Support Avx | `grep -o 'avx[^ ]*' /proc/cpuinfo` <br >  |
## Pre-Requisites
- cmake
- gcc
```bash!
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt update -y && sudo apt upgrade -y
sudo apt install build-essential libssl-dev
sudo apt install -y gcc-13 g++-13 cpp-13
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-13 100 --slave /usr/bin/g++ g++ /usr/bin/g++-13 --slave /usr/bin/gcov gcov /usr/bin/gcov-13
```
- SWIG (at least v.4.0)
```bash!
sudo apt-get install autoconf automake bison flex libpcre2-dev
git clone https://github.com/swig/swig.git
cd swig
git checkout release-4.1
./autogen.sh
./configure --prefix=/usr/
make -j8
make install
```
- Dependencies
```bash!
sudo apt install libsctp-dev python3.8 cmake-curses-gui python-dev
```
## Clone the Repository
For the FlexRIC repository, we will use my version of FlexRIC from this commit `1c52c57a0853e063cdb550f74fea003f6dab086e` from the original FlexRIC repository [oie-ric-taap-xapps (Tue Mar 18 13:20:45 2025)].
```bash!
git clone https://github.com/den-dimas/flexric.git && cd ~/flexric/
```
## Fixing Build Issue
The FlexRIC branch of `oie-ric-taap-xapps` is the still updated and developed. That's why in this specific commit version, there are a some build issue that needs to be fixed.
For more detailed on which part of codes that I changed, you can see the commit details in the Github repository.
### Remove `RRC_MESSAGES`
The `RRC_MESSAGES` module in xApp monitor is using an unknown version of asn1c. Its better not to use it at all.
### Remote RIC Message Definition
In the xApp `ctrl`, the orange xApp code contains a definition for RIC message and also enumeration for reporting styles. Those definition already provided by the E2SM and E2AP library so the xApp didn't need to redefine it again.
### Remove `orange` and `keysight`
Remove `orange` and `keysight` xApp to be built since they still have dependencies issue.
## Configuration
Before building, we need to change the `flexric.conf`.
```bash!
sudo nano ~/flexric/flexric.conf
```
```conf!
[NEAR-RIC]
NEAR_RIC_IP = 127.0.0.1 # --> Change this to match with your Ubuntu IP
[XAPP]
DB_DIR = /tmp/
```
## Build FlexRIC
```bash!
mkdir build && cd build && cmake -DXAPP_MULTILANGUAGE=ON .. && make -j8
```
:::success
:::spoiler Result

::::::
## Install Service Model (SM)
```bash!
sudo make install
```
:::success
:::spoiler Result

::::::
By default the service model libraries will be installed in the path `/usr/local/lib/flexric` while the configuration file in `/usr/local/etc/flexric`.