First round of documentation cleanup for oran_e_maintenance_release_v1.0
[o-du/phy.git] / docs / build_prerequisite.rst
1 ..    Copyright (c) 2019-2022 Intel
2 ..
3 ..  Licensed under the Apache License, Version 2.0 (the "License");
4 ..  you may not use this file except in compliance with the License.
5 ..  You may obtain a copy of the License at
6 ..
7 ..      http://www.apache.org/licenses/LICENSE-2.0
8 ..
9 ..  Unless required by applicable law or agreed to in writing, software
10 ..  distributed under the License is distributed on an "AS IS" BASIS,
11 ..  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 ..  See the License for the specific language governing permissions and
13 ..  limitations under the License.
14
15 .. |br| raw:: html
16
17    <br />
18
19 Build Prerequisite
20 ====================
21
22 .. contents::
23     :depth: 3
24     :local:
25     
26 This section describes how to install and build the required components needed to build the FHI Library, WLS Library and the 5G FAPI TM modules.
27
28 Install ICC and System Studio
29 -----------------------------
30 Intel® C++ Compiler and System Studio v19.0.3 is used for the test application and system integration with L1,available from the following link 
31 https://registrationcenter-download.intel.com/akdlm/irc_nas/emb/15322/system_studio_2019_update_3_composer_edition_offline.tar.gz
32
33 The Intel® C++ Compiler can be used with a community license generated from the text below save it to a file named license.lic
34
35 PACKAGE IF1C22FFF INTEL 2023.0331 4F89A5B28D2F COMPONENTS="CCompL \
36         Comp-CA Comp-CL Comp-OpenMP Comp-PointerChecker MKernL \
37         PerfPrimL ThreadBB" OPTIONS=SUITE ck=209 SIGN=9661868C5C80
38 INCREMENT IF1C22FFF INTEL 2023.0331 31-mar-2023 uncounted \
39         90F19E3889A3 VENDOR_STRING="SUPPORT=COM \
40         https://registrationcenter.intel.com" HOSTID=ID=07472690 \
41         PLATFORMS="i86_n i86_r i86_re amd64_re x64_n" ck=175 \
42         SN=SMSAJ7B6G8WS TS_OK SIGN=920966B67D16
43 PACKAGE IF1C22FFF INTEL 2023.0331 4F89A5B28D2F COMPONENTS="CCompL \
44         Comp-CA Comp-CL Comp-OpenMP Comp-PointerChecker MKernL \
45         PerfPrimL ThreadBB" OPTIONS=SUITE ck=209 SIGN=9661868C5C80
46 INCREMENT IF1C22FFF INTEL 2023.0331 31-mar-2023 uncounted \
47         32225D03FBAA VENDOR_STRING="SUPPORT=COM \
48         https://registrationcenter.intel.com" HOSTID=ID=07472690 \
49         PLATFORMS="i86_n i86_r i86_re amd64_re x64_n" ck=80 \
50         SN=SMSAJ7B6G8WS SIGN=2577A4F65138
51 PACKAGE IF1C22FFF INTEL 2023.0331 4F89A5B28D2F COMPONENTS="CCompL \
52         Comp-CA Comp-CL Comp-OpenMP Comp-PointerChecker MKernL \
53         PerfPrimL ThreadBB" OPTIONS=SUITE ck=209 SIGN=9661868C5C80
54 INCREMENT IF1C22FFF INTEL 2023.0331 31-mar-2023 uncounted \
55         90F19E3889A3 VENDOR_STRING="SUPPORT=COM \
56         https://registrationcenter.intel.com" HOSTID=ID=07472690 \
57         PLATFORMS="i86_n i86_r i86_re amd64_re x64_n" ck=175 \
58         SN=SMSAJ7B6G8WS TS_OK SIGN=920966B67D16
59 PACKAGE IF1C22FFF INTEL 2023.0331 4F89A5B28D2F COMPONENTS="CCompL \
60         Comp-CA Comp-CL Comp-OpenMP Comp-PointerChecker MKernL \
61         PerfPrimL ThreadBB" OPTIONS=SUITE ck=209 SIGN=9661868C5C80
62 INCREMENT IF1C22FFF INTEL 2023.0331 31-mar-2023 uncounted \
63         32225D03FBAA VENDOR_STRING="SUPPORT=COM \
64         https://registrationcenter.intel.com" HOSTID=ID=07472690 \
65         PLATFORMS="i86_n i86_r i86_re amd64_re x64_n" ck=80 \
66         SN=SMSAJ7B6G8WS SIGN=2577A4F65138
67 PACKAGE I4BB00C7C INTEL 2023.0331 8D6186E5077C COMPONENTS="Comp-CA \
68         Comp-CL Comp-OpenMP Comp-PointerChecker MKernL PerfPrimL \
69         ThreadBB" OPTIONS=SUITE ck=131 SIGN=7BB6EE06F9A6
70 INCREMENT I4BB00C7C INTEL 2023.0331 31-mar-2023 uncounted \
71         F1765BD5FCB4 VENDOR_STRING="SUPPORT=COM \
72         https://registrationcenter.intel.com" HOSTID=ID=07472690 \
73         PLATFORMS="i86_mac x64_mac" ck=114 SN=SMSAJ7B6G8WS \
74         SIGN=4EC364AC3576 
75     
76 Then copy license file to the build directory under license.lic ::
77
78          COPY license.lic $BUILD_DIR/license.lic
79     
80 *Note: Use serial number CG7X-J7B6G8WS*
81
82
83 You can follow the installation guide from above website to download Intel System Studio and install. Intel® Math Kernel Library, Intel® Integrated Performance Primitives and Intel® C++ Compiler are mandatory components.
84 Here we are using the Linux* Host,Linux* Target and standalone installer as one example, below link might need update based on the website ::
85
86          #wget https://registrationcenter-download.intel.com/akdlm/irc_nas/emb/15322/system_studio_2019_update_3_composer_edition_offline.tar.gz
87          #cd /opt && mkdir intel && cp $BUILD_DIR/license.lic intel/license.lic
88          #tar -zxvf $BUILD_DIR/system_studio_2019_update_3_composer_edition_offline.tar.gz
89
90 Edit system_studio_2029_update_3_composer_edition_offline/silent.cfg to accept the EULA file as below example::
91   
92          ACCEPT_EULA=accept
93          PSET_INSTALL_DIR=opt/intel
94          ACTIVATION_LICENSE_FILE=/opt/intel/license.lic
95          ACTIVATION_TYPE=license_file
96     
97 Silent installation::
98
99          #./install.sh -s silent.cfg
100
101 Set env for ICC::
102          Check for your installation path. The folloing is an example
103          #source /opt/intel_2019/system_studio_2019/compiler_and_libraries_2019.3.206/linux/bin/iccvars.sh intel64
104          #export PATH=/opt/intel_2019/system_studio_2019/compiler_and_libraries_2019.3.206/linux/bin/:$PATH
105
106
107 Download and Build DPDK
108 -----------------------
109    - download DPDK::
110      
111          #wget http://static.dpdk.org/rel/dpdk-20.11.1.tar.x
112          #tar -xf dpdk-20.11.1.tar.xz
113          #export RTE_TARGET=x86_64-native-linuxapp-icc
114          #export RTE_SDK=Intallation_DIR/dpdk-20.11.1
115
116    - patch DPDK for O-RAN FHI lib, this patch is specific for O-RAN FHI to reduce the data transmission latency of Intel NIC. This may not be needed for some NICs, please refer to |br| O-RAN FHI Lib Introduction -> setup configuration -> A.2 prerequisites
117
118    - SW FEC was enabled by default, to enable HW FEC with specific accelerator card, you need to get the associated driver and build steps from the accelerator card vendors.
119
120
121    - build DPDK
122         This release uses DPDK version 20.11.1 plus patches so the build procedure for the DPDK is the following
123         
124         export RTE_TARGET=x86_64-native-linuxapp-icc
125         export WIRELESS_SDK_TARGET_ISA=avx512
126         export WIRELESS_SDK_TOOLCHAIN=icc
127         export SDK_BUILD=build-${WIRELESS_DSK_TARGET_ISA}-icc
128         
129         Then locate the shell script file compilervars.sh that goes into the system studio 2019 installation folder and invoke following the example below:
130         source /opt/intel_2019/system_studio_2019/compilers_and_libraries_2019/linux/bin/compilervars.sh -arch intel64 -platform linux
131
132         The build procedure uses meson and ninja so if not present in your system please install before the next step
133         
134         Then at the root of the DPDK folder issue::
135         
136            meson build
137            cd build
138            ninja
139         
140     - set DPDK path
141        DPDK path is needed during build and run lib/app::
142
143         #export RTE_SDK=Installation_DIR/dpdk-20.11.1
144         #export DESTDIR=Installation_DIR/dpdk-20.11.1
145
146
147 Install google test
148 -------------------
149 Download google test from https://github.com/google/googletest/releases 
150    - Example build and installation commands::
151
152         #tar -xvf googletest-release-1.7.0.tar.gz
153         #mv googletest-release-1.7.0 gtest-1.7.0
154         #export GTEST_DIR=YOUR_DIR/gtest-1.7.0
155         #export GTEST_ROOT= $GTEST_DIR
156         #cd ${GTEST_DIR}
157         #g++ -isystem ${GTEST_DIR}/include -I${GTEST_DIR} -pthread -c ${GTEST_DIR}/src/gtest-all.cc
158         #ar -rv libgtest.a gtest-all.o
159         #cd ${GTEST_DIR}/build-aux
160         #cmake ${GTEST_DIR}
161         #make
162         #cd ${GTEST_DIR}
163         #ln -s build-aux/libgtest_main.a libgtest_main.a
164
165 - Set the google test Path
166    this path should be always here when you build and run O-RAN FH lib unit test::
167
168         #export DIR_ROOT_GTEST="your google test path"
169
170
171 Configure FEC card
172 --------------------
173 For the E Maintenance Release either a SW FEC, or an FPGA FEC (Vista Creek N3000) or an ASIC FEC (Mount Bryce ACC100) can be used.
174 The procedure to configure the HW based FECs is explained below.
175
176 Customize a setup environment shell script
177 ------------------------------------------
178 Using as an example the provided in the folder phy\\setupenv.sh as the starting point
179 customize this script to provide the paths to the tools and libraries that
180 are used building and running the code.
181 You can add for example the following entries based on your particular installation and the
182 following illustration is just an example::
183                                                                            
184 - export DIR_ROOT=/home/                                                           
185 - #set the L1 binary root DIR                                                      
186 - export DIR_ROOT_L1_BIN=$DIR_ROOT/FlexRAN                                         
187 - #set the phy root DIR                                                            
188 - export DIR_ROOT_PHY=$DIR_ROOT/phy                                                
189 - #set the DPDK root DIR                                                           
190 - #export DIR_ROOT_DPDK=/home/dpdk-20.11.1                                           
191 - #set the GTEST root DIR                                                          
192 - #export DIR_ROOT_GTEST=/home/gtest/gtest-1.7.0                                                                                                                   
193 - export DIR_WIRELESS_TEST_5G=$DIR_ROOT_L1_BIN/testcase                            
194 - export DIR_WIRELESS_SDK=$DIR_ROOT_L1_BIN/sdk/build-avx512-icc                    
195 - export DIR_WIRELESS_TABLE_5G=$DIR_ROOT_L1_BIN/l1/bin/nr5g/gnb/l1/table           
196 - #source /opt/intel/system_studio_2019/bin/iccvars.sh intel64 -platform linux     
197 - export XRAN_DIR=$DIR_ROOT_PHY/fhi_lib                                            
198 - export XRAN_LIB_SO=true                                                          
199 - export RTE_TARGET=x86_64-native-linuxapp-icc                                     
200 - #export RTE_SDK=$DIR_ROOT_DPDK                                                   
201 - #export DESTDIR=""                                                                                                                                              
202 - #export GTEST_ROOT=$DIR_ROOT_GTEST                                                                                                                             
203 - export ORAN_5G_FAPI=true                                                         
204 - export DIR_WIRELESS_WLS=$DIR_ROOT_PHY/wls_lib                                    
205 - export DEBUG_MODE=true                                                           
206 - export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$DIR_WIRELESS_WLS:$XRAN_DIR/lib/build    
207 - export DIR_WIRELESS=$DIR_ROOT_L1_BIN/l1                                          
208 - export DIR_WIRELESS_ORAN_5G_FAPI=$DIR_ROOT_PHY/fapi_5g                           
209 - export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$DIR_ROOT_L1_BIN/libs/cpa/bin        
210
211 Then issue::
212
213 - source ./setupenv.sh
214
215 This sets up the correct environment to build the code
216
217 Then build the wls_lib, FHI_Lib, 5G FAPI TM prior to running the code with the steps described in the Run L1 section
218                                                                                  
219
220
221
222
223
224
225