(updated: 2017, May 8th)
This document explains how to install and configure OAI EPC+eNB on one single Ubuntu 17.04 64 bits machine connected with a regular UE (a Huawei E3272), routing the UE traffic to internet.
The description uses a USRP B210 board.
We also explain how to simplify, fix existing issues, to make a single computer as a full LTE network: EPC+eNB.
Known limitations fixed in the hereafter description
- OAI EPC require kernel >= 4.7, so we have to use Ubuntu 17.04
- GTP UDP ports are in conflict for eNB and SGW
- Useless link between OAI and the Ubuntu/Linux hostname
Install Ubuntu
- Prepare a machine: a 4 actual cores, no hyper-threading.
All other configuration OAI Wiki (C1 states, …) describes is about useless. - Download Ubuntu 17.04n 64 bits version iso file
- create a usb key to boot on it
- install Ubuntu: choose to install Third party SW, and to upgrade all packages while installing
- do: apt update; apt upgrade until the machine is up-to-date
- install git and configure your identification in git:
apt install git
git config –global user.name “Laurent”
git config –global user.email “laurent.thomas@open-cells.com” - Add the OAI repository as authorized remote system
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 - if you are upset with sudo password, add this line in /etc/sudoers
- xxxxxxxxxxx ALL=(ALL) NOPASSWD: ALL
- (xxxxxxxxxxx is your login name)
- sudo will not ask anymore for a password
Install USRP drivers
Ettus has not yet released their driver for Ubuntu 17.04, we take it from source:
- sudo apt-get install libboost-all-dev libusb-1.0-0-dev python-mako doxygen python-docutils python-requests cmake build-essential
- git clone git://github.com/EttusResearch/uhd.git
- cd uhd; mkdir host/build; cd host/build
- cmake -DCMAKE_INSTALL_PREFIX=/usr ..
- make -j4
- sudo make install
- sudo ldconfig
- sudo /usr/lib/uhd/utils/uhd_images_downloader.py
Download & Compile the eNB on 17.04
- git clone https://gitlab.eurecom.fr/oai/openairinterface5g.git
- cd openairinterface5g
- git checkout develop
- As we already tested and merged in develop updates for Ubuntu 16.10
- A few updates are required for Ubuntu 17.04
replace the file cmake_targets/tools/build_helper by: build_helper - Now, you should be able to build as usual the eNB
- source oaienv # configure the shell
- ./cmake_targets/build_oai -I # install SW packages from internet
- ./cmake_targets/build_oai -c -w USRP –eNB –UE # compile eNB
Download and patch EPC
First, clone OAI EPC:
git clone https://gitlab.eurecom.fr/oai/openair-cn.git
I detached the OAI code from any relation between the Linux host name, DNS and the Diameter protocol identifiers such as Realm and end point identifier for diameter protocol
For this, you need to replace with openair-cn-fixes these files
- SRC/GTPV1-U/gtp_mod_kernel.[ch] and SRC/GTPV1-U/gtpv1u_task.c
To use the SPGW destination address parameter. This parameter is already in the config file (but not used in the present EPC code). This enhancement removes the conflict on the same port with the eNB, therefore we can run both SPGW and eNB in the same machine. - SRC/S6A/s6a_peer.c
The modification is only to remove the code that reads Linux host name to overwrite the (correct, already read from the configuration file) diameter id. - build_helper: for Ubuntu 17.04 support
Install third party SW for EPC
- cd openair-cn; source oaienv; cd SCRIPTS
- ./build_hss -i
- Answer yes to install: freeDiameter 1.2.0
- for mysql and phpmyadmin, remember the password you set, it will be mandatory to configure the hss
- Install 3PP SW for mme and spgw
- ./build_mme -i ; ./build_spgw -i
When questions pop-up- Don’t re-install ans1c (should have been installed correctly for eNB)
- Don’t re-install what is already installed
- Install the GTP kernel module
- The kernel you have should be 4.10, it contains the Osmocom gtp module
- This archive contains the module source, patched with the OAI improvements done for kernel 4.7: gtp
- NO need to download the whole kernel in source to compile a module
- tar xf gtp_mod.4.10.tgz; cd gtp_mod.4.10
- make -C /lib/modules/`uname -r`/build M=$PWD
- sudo cp gtp.ko /lib/modules/`uname -r`/kernel/drivers/net/gtp.ko
- If you keep Ubuntu up-to-date automatically (default Ubuntu behavior), you’ll need to update the module after each Ubuntu kernel upgrades (each time “uname -r” changes)
- If you want to use another kernel, you’ll have to merge the file gtp.c with your kernel version source code of gtp.c.
To help, I’ve let origin 4.10 code in gtp.c.orig
- NO need to download the whole kernel in source to compile a module
Compile the EPC nodes
No difficulty found in this phase.
- cd openair-cn; source oaienv; cd SCRIPTS
- ./build_hss
- ./build_mme
- ./build_spgw
Our Network setup description
I’ve made a simple configuration for this all-in-one setup.
Each node is on a separate IP address, this address is used for all it’s interfaces. In our case of all-in-one, we take addresses on the loopback: this will be fine on all your machines.
- HSS is on localhost: 127.0.0.1
- eNB is on 127.0.0.10
- MME is on 127.0.0.20
- SPGW is on 127.0.0.30
Thanks to the above patch: the diameter configuration is now isolated from Linux hostname.
I’ve chosen: realm for the EPC: “OpenAir5G.Alliance”
So, full distinguish names are:
- hss.OpenAir5G.Alliance
- mme.OpenAir5G.Alliance
Install this configuration for eNB
In your eNB configuration file, the network is now fixed, as lo interface always exists and our computer internal addresses also:
////////// MME parameters: mme_ip_address = ( { ipv4 = "127.0.0.20"; ipv6 = "192:168:30::17"; active = "yes"; preference = "ipv4"; } ); NETWORK_INTERFACES : { ENB_INTERFACE_NAME_FOR_S1_MME = "lo"; ENB_IPV4_ADDRESS_FOR_S1_MME = "127.0.0.10/8"; ENB_INTERFACE_NAME_FOR_S1U = "lo"; ENB_IPV4_ADDRESS_FOR_S1U = "127.0.0.10/8"; ENB_PORT_FOR_S1U = 2152; # Spec 2152 };
In the eNB config file, you need also to set the MCC and MNC as per your SIM card:
tracking_area_code = “1”;
mobile_country_code = “208”;
mobile_network_code = “92”;
And obviously, your radio parameters.
Install this configuration for EPC
For the EPC, we install in OAI default directory: /usr/local/etc/oai this tar file: oai.config
Then, you should generate the cyphering certificates:
- cd openair-cn; source oaienv; cd SCRIPTS
- ./check_hss_s6a_certificate /usr/local/etc/oai/freeDiameter hss.OpenAir5G.Alliance
- ./check_mme_s6a_certificate /usr/local/etc/oai/freeDiameter mme.OpenAir5G.Alliance
Only the SGi output to internet need to be configured.
In /usr/local/etc/oai/spgw.conf,
your should set the Ethernet interface that is connected to Internet, and,
to tell to the PGW to implement NAPT for the UE traffic
PGW_INTERFACE_NAME_FOR_SGI = "enp3s0"; PGW_MASQUERADE_SGI = "yes";
For the SIM card, you’ll have more to do:
- SIM MCC/MNC should be duplicated
- eNB: See above in eNB configuration chapter
- MME
- file: /usr/local/etc/oai/mme.conf to update
- GUMMEI_LIST = ( MCC=”208″ ; MNC=”92″; MME_GID=”4″ ; MME_CODE=”1″; } );
- TAI_LIST = ({MCC=”208″ ; MNC=”92″; TAC = “1”; } );
- S-GW_LIST_SELECTION = (
{ID=”tac-lb01.tac-hb00.tac.epc.mnc092.mcc208.3gppnetwork.org” ; SGW_IPV4_ADDRESS_FOR_S11=”127.0.0.30/8″;}
);
- file: /usr/local/etc/oai/mme.conf to update
- HSS
- Configure the password for MySQL
- in /usr/local/etc/oai/hss.conf, set user as root and password as the password you created during MySQL installation
- A HSS database in text is in: /usr/local/etc/oai/opencells_db.sql
- It is preconfigured with the mme id, the pgw id
- A SIM user in network 001/01 (the test network defined by 3GGP) is already created.
- 10 users is network 208/92 (a French test network) are also created
- Each time you import this db, it erases the entire database
(example: mysql user=root, password=linux)- ./hss_db_import 127.0.0.1 root linux oai_db /usr/local/etc/oai/opencells_db.sql
- One can modify the db either with a text editor of this file, or ,
by sql: http://localhost/phpmyadmin - The important values to set are:
- table pdn:
- all IMSI are listed, with the APN: these values are in UE/SIM
- table users:
- all IMSI are, key (Ki) and OPc must be the same in USIM card.
Sqn increments when the UE authenticate,
it should be set as per USIM internal incrementation
- all IMSI are, key (Ki) and OPc must be the same in USIM card.
- table pdn:
- SIM card update
- will be described later, for Open cells UICC and card reader
- Configure the password for MySQL
Final test and verification
open 4 terminal windows
- in first window
- cd openair-cn; source oaienv; cd SCRIPTS; ./run_hss
- in second window
- cd openair-cn; source oaienv; cd SCRIPTS; ./run_mme
- in third window
- cd openair-cn; source oaienv; cd SCRIPTS; sudo -E ./run_spgw
- in last windows
- sudo bash
- cd openairinterface5g; source oaienv;
- export LD_LIBRARY_PATH=/usr/local/lib/:./targets/bin;
- ./cmake_targets/lte_build_oai/build/lte-softmodem -d -O <your config file>
- Connect the UE, it should attach to network and be able to reach internet through OAI network
- Enjoy
Laurent, thanks to your excellent instructions listed at https://open-cells.com I attempted your instructions on Ubuntu 17.04 x86, (just for prospectively being able to run OAI on more General Purpose Hardware than just 64bit), and I am incurring the same issue you documented here 3 months ago:
OAI – UE : Test on real time improvement branch from Laurent Thomas
I have tried to isolate the problem in lte-ue.c file and i have seen that when using the function UE_thread_rxn_txnp4 and UE_thread … https://gitlab.eurecom.fr/oai/openairinterface5g/issues/190
I’m running 32 bit Ubuntu 17.04:
ubuntu@ubuntu:~/openairinterface5g$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 17.04
Release: 17.04
Codename: zesty
ubuntu@ubuntu:~/openairinterface5g$ uname -a
Linux ubuntu 4.10.0-20-generic #22-Ubuntu SMP Thu Apr 20 09:22:16 UTC 2017 i686 i686 i686 GNU/Linux
ubuntu@ubuntu:~/openairinterface5g$ cat /proc/cpuinfo
processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 23
model name : Pentium(R) Dual-Core CPU E5800 @ 3.20GHz
(Yes this processor has successfully built OAI on 64Bit Ubuntu 14.04, but hoping 32Bit will build)
FLAGS: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx lm constant_tsc arch_perfmon pebs bts aperfmperf pni dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm xsave lahf_lm tpr_shadow vnmi flexpriority dtherm
ubuntu@ubuntu:~/openairinterface5g$ sudo git log -n1
commit c124e32ab56b471bef2c274b65116accb7dd85d0
Merge: 38abafed2 fc4d03d41
Author: Cedric Roux
Date: Tue Apr 18 10:03:46 2017 +0200
Merge branch ‘develop_integration_w15’ into ‘develop’
develop_integration_w15 into develop
Summary of changes:
– DCI1 20MHz phy-test bug fix
– RLC UM/AM max header size fix
– UE autotests improvements
See merge request !177
Mr. Thomas, per your instructions, OAI WILL build on x86 OS, but here is the exact issue I’m incurring as you have before:
ubuntu@ubuntu:~/openairinterface5g$ source oaienv .
ubuntu@ubuntu:~/openairinterface5g$ sudo ./cmake_targets/build_oai –verbose-compile –cflags_processor “-msse3 -msse4.1 -msse4.2 -mavx2” -I
Will compile with verbose instructions
Setting CPU FLAGS from USER to: -msse3 -msse4.1 -msse4.2 -mavx2
Will install external packages
CMAKE_CMD=cmake ..
RF HW set to None
Flags for Deadline scheduler: False
Flags for CPU Affinity: False
2. Setting the OAI PATHS …
OPENAIR_DIR = /home/ubuntu/openairinterface5g
FreeDiameter prefix not found, install freeDiameter if EPC, HSS
Installing packages ….
DHAVE_SOCKET=1 -DHAVE_MEMSET=1 -DHAVE_GETTIMEOFDAY=1 -DHAVE_STDLIB_H=1 -DHAVE_MALLOC=1 -DHAVE_LIBSCTP -mssse3 -msse3 -msse4.1 -msse4.2 -mavx2 -std=gnu99 -Wall -Wstrict-prototypes -fno-strict-aliasing -rdynamic -funroll-loops -Wno-packed-bitfield-compat -fPIC -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_FCNTL_H=1 -DHAVE_ARPA_INET_H=1 -DHAVE_SYS_TIME_H=1 -DHAVE_SYS_SOCKET_H=1 -DHAVE_STRERROR=1 -DHAVE_SOCKET=1 -DHAVE_MEMSET=1 -DHAVE_GETTIMEOFDAY=1 -DHAVE_STDLIB_H=1 -DHAVE_MALLOC=1 -DHAVE_LIBSCTP -g -DMALLOC_CHECK_=3 -O2 -DUPDATE_RELEASE_9 -DUPDATE_RELEASE_10 -o CMakeFiles/lte-softmodem.dir/home/ubuntu/openairinterface5g/targets/RT/USER/lte-enb.c.o -c /home/ubuntu/openairinterface5g/targets/RT/USER/lte-enb.c
In file included from /home/ubuntu/openairinterface5g/openair2/UTIL/LOG/log_extern.h:22:0,
from /home/ubuntu/openairinterface5g/targets/RT/USER/rt_wrapper.h:58,
from /home/ubuntu/openairinterface5g/targets/RT/USER/lte-softmodem.h:9,
from /home/ubuntu/openairinterface5g/targets/RT/USER/lte-ue.c:32:
/home/ubuntu/openairinterface5g/targets/RT/USER/lte-ue.c: In function ‘UE_thread_rxn_txnp4’:
/home/ubuntu/openairinterface5g/openair2/UTIL/LOG/log.h:354:3: error: inconsistent operand constraints in an ‘asm’
__asm__ volatile (“rdtsc” : “=a” (a), “=d” (d));
^~~~~~~
/home/ubuntu/openairinterface5g/openair2/UTIL/LOG/log.h:354:3: error: inconsistent operand constraints in an ‘asm’
__asm__ volatile (“rdtsc” : “=a” (a), “=d” (d));
^~~~~~~
/home/ubuntu/openairinterface5g/openair2/UTIL/LOG/log.h:354:3: error: inconsistent operand constraints in an ‘asm’
__asm__ volatile (“rdtsc” : “=a” (a), “=d” (d));
^~~~~~~
CMakeFiles/lte-softmodem.dir/build.make:126: recipe for target ‘CMakeFiles/lte-softmodem.dir/home/ubuntu/openairinterface5g/targets/RT/USER/lte-ue.c.o’ failed
make[3]: *** [CMakeFiles/lte-softmodem.dir/home/ubuntu/openairinterface5g/targets/RT/USER/lte-ue.c.o] Error 1
make[3]: *** Waiting for unfinished jobs….
make[3]: Leaving directory ‘/home/ubuntu/openairinterface5g/cmake_targets/lte_build_oai/build’
CMakeFiles/Makefile2:2016: recipe for target ‘CMakeFiles/lte-softmodem.dir/all’ failed
make[2]: *** [CMakeFiles/lte-softmodem.dir/all] Error 2
make[2]: Leaving directory ‘/home/ubuntu/openairinterface5g/cmake_targets/lte_build_oai/build’
CMakeFiles/Makefile2:2028: recipe for target ‘CMakeFiles/lte-softmodem.dir/rule’ failed
make[1]: *** [CMakeFiles/lte-softmodem.dir/rule] Error 2
make[1]: Leaving directory ‘/home/ubuntu/openairinterface5g/cmake_targets/lte_build_oai/build’
Makefile:781: recipe for target ‘lte-softmodem’ failed
make: *** [lte-softmodem] Error 2
Its frustrating because everything else builds/installs, but it looks like it WILL complete as it PASSES the [100% Build} part of the OAI eNB compiling process.
I’d appreciate any assistance please.
Yours Truly,
Peter
Peter,
We decided to not test x86 for a while, nevertheless it could work.
If you decide to continue, the issue is easy to fix.
#ifdef __i386
extern __inline__ uint64_t rdtsc(void) {
uint64_t x;
__asm__ volatile ("rdtsc" : "=A" (x));
return x;
}
#elif defined __amd64
extern __inline__ uint64_t rdtsc(void) {
uint64_t a, d;
__asm__ volatile ("rdtsc" : "=a" (a), "=d" (d));
return (d<<32) | a; } #endif
It is already implemented in OAI, with ARM version in: openair1/PHY/TOOLS/time_meas.h
The rdtsc() macro is in openair2/UTIL/LOG/log.h just for realtime tests, you could even remove it and set:
#define DEBUG_REALTIME 0
the line after.
In x86, you'll reach two possible problems:
- lower performance: x86 access to only 8 SIMD registers instead of 16 ones
- loosely defined C types that could have different length (pointer, long, long long, ...)
Also, I see in your trace your processor seems to not support sse4.1 instructions.
You could compile, but not execute normal OAI eNB: the code uses sse4.1 instructions.
There is still in git the pure C code, no SIMD.
But, I don't think cmake compilation target still exists.
Also, you can anticipate the code performance will degrade by a factor larger than 10 (deoding a sub frame will cost 10 time more CPU).
Doing 4G signal processing is a CPU demanding task, that was considered to be impossible to do with a general purpose processor.
OpenAir demonstrates it is possible, nevertheless it requires a good SIMD co-processor in each CPU core.
Intel declared your processor E5800 end of life in 2011.
It is still a good processor, for WEB service and many tasks, but not for high end signal processing such as LTE, deep learning, face recognition, ...
Regards,
Laurent
Laurent,
Your 100% on Point in your description of the discontinued PC i am using but as you pointed out, while it is NOT powerful enough to actually run OAI, it is, and HAS been continually successful at compiling OAI.
And as to your “easy fix” that is something I shall try next and report back to you.
If everything else compiles per your excellent instructions, I shall start purchasing SIM cards from you!
I shall report back shortly and thanks again!
Laurent, I’ve tried on 32-Bit Ubuntu 17.04 Desktop, & 32-Bit Lubuntu 17.04 Desktop, and I get the following errors, whether setting #define DEBUG_REALTIME 0 or 1 the log.h file:
(It gets the following error around 98% compile completion and the below is just a partial listing of all the files rtdtsc fails)
[ 98%] Linking C executable lte-softmodem
/usr/bin/cmake -E cmake_link_script CMakeFiles/lte-softmodem.dir/link.txt –verbose=1
/usr/bin/cc -mssse3 -mssse3 -msse4.1 -std=gnu99 -Wall -Wstrict-prototypes -fno-strict-aliasing -rdynamic -funroll-loops $
CMakeFiles/lte-softmodem.dir/home/lubuntu/openairinterface5g/targets/RT/USER/lte-ue.c.o: In function `rdtsc’:
/home/lubuntu/openairinterface5g/openair2/UTIL/LOG/log.h:355: multiple definition of `rdtsc’
CMakeFiles/lte-softmodem.dir/home/lubuntu/openairinterface5g/targets/RT/USER/rt_wrapper.c.o:/home/lubuntu/openairinterface5g$
CMakeFiles/lte-softmodem.dir/home/lubuntu/openairinterface5g/targets/RT/USER/lte-enb.c.o: In function `rdtsc’:
/home/lubuntu/openairinterface5g/openair2/UTIL/LOG/log.h:355: multiple definition of `rdtsc’
CMakeFiles/lte-softmodem.dir/home/lubuntu/openairinterface5g/targets/RT/USER/rt_wrapper.c.o:/home/lubuntu/openairinterface5g$
CMakeFiles/lte-softmodem.dir/home/lubuntu/openairinterface5g/targets/RT/USER/lte-softmodem.c.o: In function `rdtsc’:
/home/lubuntu/openairinterface5g/openair2/UTIL/LOG/log.h:355: multiple definition of `rdtsc’
CMakeFiles/lte-softmodem.dir/home/lubuntu/openairinterface5g/targets/RT/USER/rt_wrapper.c.o:/home/lubuntu/openairinterface5g$
CMakeFiles/lte-softmodem.dir/home/lubuntu/openairinterface5g/targets/SIMU/USER/init_lte.c.o: In function `rdtsc’:
/home/lubuntu/openairinterface5g/openair2/UTIL/LOG/log.h:355: multiple definition of `rdtsc’
CMakeFiles/lte-softmodem.dir/home/lubuntu/openairinterface5g/targets/RT/USER/rt_wrapper.c.o:/home/lubuntu/openairinterface5g$
CMakeFiles/lte-softmodem.dir/home/lubuntu/openairinterface5g/targets/COMMON/create_tasks.c.o: In function `rdtsc’:
/home/lubuntu/openairinterface5g/openair2/UTIL/LOG/log.h:355: multiple definition of `rdtsc’
CMakeFiles/lte-softmodem.dir/home/lubuntu/openairinterface5g/targets/RT/USER/rt_wrapper.c.o:/home/lubuntu/openairinterface5g$
CMakeFiles/lte-softmodem.dir/home/lubuntu/openairinterface5g/openair3/NAS/UE/nas_ue_task.c.o: In function `rdtsc’:
/home/lubuntu/openairinterface5g/openair2/UTIL/LOG/log.h:355: multiple definition of `rdtsc’
CMakeFiles/lte-softmodem.dir/home/lubuntu/openairinterface5g/targets/RT/USER/rt_wrapper.c.o:/home/lubuntu/openairinterface5g$
CMakeFiles/lte-softmodem.dir/home/lubuntu/openairinterface5g/openair3/GTPV1-U/gtpv1u_eNB.c.o: In function `rdtsc’:
/home/lubuntu/openairinterface5g/openair2/UTIL/LOG/log.h:355: multiple definition of `rdtsc’
CMakeFiles/lte-softmodem.dir/home/lubuntu/openairinterface5g/targets/RT/USER/rt_wrapper.c.o:/home/lubuntu/openairinterface5g$
CMakeFiles/lte-softmodem.dir/home/lubuntu/openairinterface5g/openair1/PHY/TOOLS/lte_phy_scope.c.o: In function `rdtsc’:
/home/lubuntu/openairinterface5g/openair2/UTIL/LOG/log.h:355: multiple definition of `rdtsc’
CMakeFiles/lte-softmodem.dir/home/lubuntu/openairinterface5g/targets/RT/USER/rt_wrapper.c.o:/home/lubuntu/openairinterface5g$
libS1AP_ENB.a(s1ap_eNB.c.o): In function `rdtsc’:
/home/lubuntu/openairinterface5g/openair2/UTIL/LOG/log.h:355: multiple definition of `rdtsc’
CMakeFiles/lte-softmodem.dir/home/lubuntu/openairinterface5g/targets/RT/USER/rt_wrapper.c.o:/home/lubuntu/openairinterface5g$
libS1AP_ENB.a(s1ap_eNB_context_management_procedures.c.o): In function `rdtsc’:
/home/lubuntu/openairinterface5g/openair2/UTIL/LOG/log.h:355: multiple definition of `rdtsc’
CMakeFiles/lte-softmodem.dir/home/lubuntu/openairinterface5g/targets/RT/USER/rt_wrapper.c.o:/home/lubuntu/openairinterface5g$
libS1AP_ENB.a(s1ap_eNB_encoder.c.o): In function `rdtsc’:
/home/lubuntu/openairinterface5g/openair2/UTIL/LOG/log.h:355: multiple definition of `rdtsc’
CMakeFiles/lte-softmodem.dir/home/lubuntu/openairinterface5g/targets/RT/USER/rt_wrapper.c.o:/home/lubuntu/openairinterface5g$
libS1AP_ENB.a(s1ap_eNB_handlers.c.o): In function `rdtsc’:
/home/lubuntu/openairinterface5g/openair2/UTIL/LOG/log.h:355: multiple definition of `rdtsc’
CMakeFiles/lte-softmodem.dir/home/lubuntu/openairinterface5g/targets/RT/USER/rt_wrapper.c.o:/home/lubuntu/openairinterface5g$
libS1AP_ENB.a(s1ap_eNB_management_procedures.c.o): In function `rdtsc’:
On the following website, I’ve found where someone else reported the same problem and the suggestion was as follows:
https://stackoverflow.com/questions/9887839/clock-cycle-count-wth-gcc
On Linux with gcc, I use the following:
/* define this somewhere */
#ifdef __i386
__inline__ uint64_t rdtsc() {
uint64_t x;
__asm__ volatile (“rdtsc” : “=A” (x));
return x;
}
#elif __amd64
__inline__ uint64_t rdtsc() {
uint64_t a, d;
__asm__ volatile (“rdtsc” : “=a” (a), “=d” (d));
return (d<<32) | a;
}
#endif
/* now, in your function, do the following */
uint64_t t;
t = rdtsc();
// … the stuff that you want to time …
t = rdtsc() – t;
// t now contains the number of cycles elapsed
Would I have to add that to each of the files reported above?
Hello,
Multiple definitions of “rdtsc” means the same function is defined more than one time.
Maybe you didn’t remove the existing function rdtsc when you added the conditional definition of the 2 versions: 32 bits and 64 bits?
I still don’t understand your goal, except a pure trial.
Laurent
Laurent,
Per your instructions I modified the log.h file with what you suggested to get OAI5G to compile:
#ifdef __i386
extern __inline__ uint64_t rdtsc(void) {
uint64_t x;
__asm__ volatile (“rdtsc” : “=A” (x));
return x;
}
#elif defined __amd64
extern __inline__ uint64_t rdtsc(void) {
uint64_t a, d;
__asm__ volatile (“rdtsc” : “=a” (a), “=d” (d));
return (d< <32) | a; } #endif
And it gave me those rdtsc errors.
The reason for trying to get OAI5G to compile on 32-Bit OSes is to get OAI5G to work on as many computer platforms as possible.
Per following your instructions above to get this compiled on 32-Bit OS, was I to have removed rdtsc from log.h which is giving the error ?
Peter,
You are very motivated, so:
#ifdef __i386
static __inline__ uint64_t rdtsc(void) {
uint64_t x;
__asm__ volatile ("rdtsc" : "=A" (x));
return x;
}
#elif defined __amd64
static __inline__ uint64_t rdtsc(void) {
uint64_t a, d;
__asm__ volatile ("rdtsc" : "=a" (a), "=d" (d));
return (d<<32) | a; } #endif
Would be better: the multiple rdtsc () definitions comes from the lack of 'static' word in my initial answer.
Laurent,
Thanks for replying and me re-reading all this, as I” just learning about this prospective solution now.
I deleted that 32-Bit version and have been trying with what you reported: Ubuntu 16.04 64-Bit
So let me try the above on one computer with the appropriate processor flags, and the below with the correct command eliminating the “-mavx2” and hopefully it should build as BOTH computer I have reported using here has successfully compiled previous versions of OAI.
Thanks for replying… i’lol report back
Laurent,
Using Lubuntu 17.04 64-Bit installed, I am getting the following error when attempting to compile lte-softmodem with the following command:
sudo ./cmake_targets/build_oai –verbose-compile –cflags_processor “-mssse3 -msse4.1 -mavx2” –verbose-compile -c -C -w USRP -x –eNB –UE
[ 98%] Linking C executable lte-softmodem
/usr/bin/cmake -E cmake_link_script CMakeFiles/lte-softmodem.dir/link.txt –verbose=1
/usr/bin/cc -mssse3 -mssse3 -msse4.1 -mavx2 -std=gnu99 -Wall -Wstrict-prototypes -fno-strict-aliasing -rdynamic -funroll$
libPHY.a(dlsch_llr_computation.c.o): In function `dlsch_64qam_64qam_llr’:
/home/lubuntu/openairinterface5g/openair1/PHY/LTE_TRANSPORT/dlsch_llr_computation.c:8859: undefined reference to `qam64_qam6$
collect2: error: ld returned 1 exit status
CMakeFiles/lte-softmodem.dir/build.make:515: recipe for target ‘lte-softmodem’ failed
make[3]: *** [lte-softmodem] Error 1
make[3]: Leaving directory ‘/home/lubuntu/openairinterface5g/cmake_targets/lte_build_oai/build’
CMakeFiles/Makefile2:1976: recipe for target ‘CMakeFiles/lte-softmodem.dir/all’ failed
make[2]: *** [CMakeFiles/lte-softmodem.dir/all] Error 2
make[2]: Leaving directory ‘/home/lubuntu/openairinterface5g/cmake_targets/lte_build_oai/build’
CMakeFiles/Makefile2:1988: recipe for target ‘CMakeFiles/lte-softmodem.dir/rule’ failed
make[1]: *** [CMakeFiles/lte-softmodem.dir/rule] Error 2
make[1]: Leaving directory ‘/home/lubuntu/openairinterface5g/cmake_targets/lte_build_oai/build’
Makefile:768: recipe for target ‘lte-softmodem’ failed
I’ve cleared the built files and still come up with the above error message but don’t know how to get around this error
Peter,
I don’t know: i’ll get back a Ubuntu 17.04 64bits machines only June 4th.
I tried on 16.04, it works even with all options you added on compute line.
I don’t think this issue is related to the origin topic, neither a Ubuntu 17.04 specific issue.
You may update with latest git (in case it was a bad commit from someone).
Laurent
Laurent, thank you for your quick replies and attention to this. Here is a quick report for your knowledge and prospective fixes for either Ubuntu 17.04 or Lubuntu 17.04.
Per your message, I just did a git pull:
lubuntu@lubuntu-Inspiron-560:~/openairinterface5g$ sudo git pull
[sudo] password for lubuntu:
Already up-to-date.
lubuntu@lubuntu-Inspiron-560:~/openairinterface5g$ sudo git log -n1
commit 9bef36f23a9679a3fb2d6fc332b37d2f748c497e
Author: Cedric Roux
Date: Mon May 22 11:41:14 2017 +0200
Release 0.6.
I cleared the OpenAirInterface built files:
lubuntu@lubuntu-Inspiron-560:~/openairinterface5g$ sudo ./cmake_targets/build_oai -c -C
CMAKE_CMD=cmake ..
RF HW set to None
Flags for Deadline scheduler: False
Flags for CPU Affinity: False
2. Setting the OAI PATHS …
OPENAIR_DIR = /home/lubuntu/openairinterface5g
FreeDiameter prefix not found, install freeDiameter if EPC, HSS
Erased all previously producted files
3. building the compilation directives …
10. Bypassing the Tests …
And then I issue the “Build_OAI” command again:
lubuntu@lubuntu-Inspiron-560:~/openairinterface5g$ sudo ./cmake_targets/build_oai –verbose-compile –cflags_processor “-mssse3 -msse4.1 -mavx2” –verbose-compile -w USRP –eNB –UE
And it fails around 98% with the following:
/home/lubuntu/openairinterface5g/openair1/PHY/LTE_TRANSPORT/dlsch_llr_computation.c:8859: undefined reference to `qam64_qam6$
collect2: error: ld returned 1 exit status
So I’ll download and try Ubuntu 16.04 and report back.
Thank you sincerely!
Laurent,
Utilizing Ubuntu 16.04 64-Bit:
ubuntu@ubuntu:~/openairinterface5g$ hostnamectl
Static hostname: ubuntu
Icon name: computer-desktop
Chassis: desktop
Machine ID: f3d08f32847744cfbbf0321211178817
Boot ID: bc82069c86914cc09c15626b9c92f25c
Operating System: Ubuntu 16.04.2 LTS
Kernel: Linux 4.8.0-36-generic
Architecture: x86-64
Using this command:
sudo ./cmake_targets/build_oai -c –cflags_processor “-mssse3 -msse4.1 -mavx2” –verbose-compile -w USRP –eNB –UE
The “Build_OAI” fails with:
Compiling lte-softmodem
Log file for compilation has been written to: /home/ubuntu/openairinterface5g/cmake_targets/log/lte-softmodem.Rel14.txt
lte-softmodem compilation failed
build have failed
[ 98%] Linking C executable lte-softmodem
/usr/bin/cmake -E cmake_link_script CMakeFiles/lte-softmodem.dir/link.txt –verbose=1
/usr/bin/cc -mssse3 -mssse3 -msse4.1 -mavx2 -std=gnu99 -Wall -Wstrict-prototypes -fno-strict-aliasin$
libPHY.a(dlsch_llr_computation.c.o): In function `dlsch_64qam_64qam_llr’:
[ 98%] Linking C executable lte-softmodem
/usr/bin/cmake -E cmake_link_script CMakeFiles/lte-softmodem.dir/link.txt –verbose=1
/usr/bin/cc -mssse3 -mssse3 -msse4.1 -mavx2 -std=gnu99 -Wall -Wstrict-prototypes -fno-strict-aliasin$
libPHY.a(dlsch_llr_computation.c.o): In function `dlsch_64qam_64qam_llr’:
/home/ubuntu/openairinterface5g/openair1/PHY/LTE_TRANSPORT/dlsch_llr_computation.c:8859: undefined reference to `qam64_qam64_avx2′
I’m using the same Ubuntu version as you’ve posted and your not getting these errors ?
Laurent, I just tried on a “newer” computer with the required processor capabilities and the build still failed around 98%:
/home/ubuntu/openairinterface5g/openair1/PHY/LTE_TRANSPORT/dlsch_llr_computation.c:8859: undefined reference to `qam64_qam64_avx2′
ubuntu@ubuntu:~/openairinterface5g$ cat /proc/cpuinfo
processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 42
model name : Intel(R) Pentium(R) CPU G630 @ 2.70GHz
stepping : 7
microcode : 0x25
cpu MHz : 1962.707
cache size : 3072 KB
physical id : 0
siblings : 2
core id : 0
cpu cores : 2
apicid : 0
initial apicid : 0
fpu : yes
fpu_exception : yes
cpuid level : 13
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm pcid sse4_1 sse4_2 popcnt tsc_deadline_timer xsave lahf_lm epb tpr_shadow vnmi flexpriority ept vpid xsaveopt dtherm arat pln pts
bugs :
bogomips : 5389.22
clflush size : 64
cache_alignment : 64
address sizes : 36 bits physical, 48 bits virtual
power management:
processor : 1
vendor_id : GenuineIntel
cpu family : 6
model : 42
model name : Intel(R) Pentium(R) CPU G630 @ 2.70GHz
stepping : 7
microcode : 0x25
cpu MHz : 1864.324
cache size : 3072 KB
physical id : 0
siblings : 2
core id : 1
cpu cores : 2
apicid : 2
initial apicid : 2
fpu : yes
fpu_exception : yes
cpuid level : 13
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm pcid sse4_1 sse4_2 popcnt tsc_deadline_timer xsave lahf_lm epb tpr_shadow vnmi flexpriority ept vpid xsaveopt dtherm arat pln pts
bugs :
bogomips : 5389.22
clflush size : 64
cache_alignment : 64
address sizes : 36 bits physical, 48 bits virtual
power management:
I’ve never been able to get to the 2nd & 3rd part of your tutorial due to the 1st part, Download & Compile the eNB, as the eNB never fully compiles/builds.
Laurent, I forgot to mention which version was checked out for OpenAirInterface5G:
ubuntu@ubuntu:~/openairinterface5g$ sudo git log -n1
commit 9bef36f23a9679a3fb2d6fc332b37d2f748c497e
Author: Cedric Roux
Date: Mon May 22 11:41:14 2017 +0200
Release 0.6.
ubuntu@ubuntu:~/openairinterface5g
Peter,
The issue is linked to the options you pass that doesn’t match the latest cmake file changes author.
On one hand, you specify to use avx2 instructions: this option is partially understood, so compilation of openair1/PHY/LTE_TRANSPORT/dlsch_llr_computation.c generates calls to the avx2 version of the underlying functions.
Unfortunately, the modifications author detects himself your processor capabilities in cmake_targets/CMakeLists.txt:
file(STRINGS “/proc/cpuinfo” CPUINFO REGEX flags LIMIT_COUNT 1)
if (CPUINFO MATCHES “avx2”)
So, as your CPU doesn’t implements avx2, the later instruction:
if (${COMPILATION_AVX2} STREQUAL “True”)
set(PHY_SRC ${PHY_SRC} ${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/dlsch_llr_computation_avx2.c)
endif ()
doesn’t compile the avx2 version of the function.
OAI has not been designed to perform cross-compilation on one machine to execute on another CPU type, as this is not a strong need in open source: it is always possible to compile the source directly on the target machine.
Either you fix the CMakelist.txt file (thanks for other people), either you got for native CPU compilation (that will not generate avx2 version of the compilation).
If you got the instructions to add –cflags_processor ‘-mssse3 -msse4.1 -mavx2’ from some manual, please also complain or fix yourself: this is wrong instructions regarding the actual capabilities of the CMakeLists.txt file.
Regards,
Laurent
Laurent,
Looks like I just need to delete the the “-mavx2” from the build_oai command and hopefully it should build.
When anyone issues the “Build_oai” command, and IF it fails, it WILL tell you either:
“use cflags_processor flag” and/or if you issue the command “build_oai -h” it prints out all the options of the “build_oai” command, one of which is “–cflags_processor” should the script NOT detect all the appropriate THE correct processor capabilities.
I’ll try and report back
Thank you!
Laurent Thomas, per your excellent observation, and per my previous post, removing the “-mvax2” allowed for “lte-softmodem” to be built with the following 1 warning:
lte-softmodem compiled
Compiling UE specific part
Log file for compilation has been written to: /home/ubuntu/openairinterface5g/cmake_targets/log/ue_ip.Rel14.txt
ue_ip compiled
WARNING: 1 warnings. See /home/ubuntu/openairinterface5g/cmake_targets/log/ue_ip.Rel14.txt
And looking at the “ue_ip.Rel14.txt” file, I provide the relevant last lines detailing the “Warning”:
cd /home/ubuntu/openairinterface5g/cmake_targets/lte_build_oai/build/CMakeFiles/ue_ip && make -C /lib/modules/4.8.0-36-generic/build M=/home/ubuntu/openairinterface5g/cmake_targets/lte_build_oai/build/CMakeFiles/ue_ip
make[4]: Entering directory ‘/home/ubuntu/openairinterface5g/cmake_targets/lte_build_oai/build/CMakeFiles/ue_ip’
make[4]: warning: jobserver unavailable: using -j1. Add ‘+’ to parent make rule.
LD /home/ubuntu/openairinterface5g/cmake_targets/lte_build_oai/build/CMakeFiles/ue_ip/built-in.o
CC [M] /home/ubuntu/openairinterface5g/cmake_targets/lte_build_oai/build/CMakeFiles/ue_ip/device.o
CC [M] /home/ubuntu/openairinterface5g/cmake_targets/lte_build_oai/build/CMakeFiles/ue_ip/common.o
CC [M] /home/ubuntu/openairinterface5g/cmake_targets/lte_build_oai/build/CMakeFiles/ue_ip/netlink.o
LD [M] /home/ubuntu/openairinterface5g/cmake_targets/lte_build_oai/build/CMakeFiles/ue_ip/ue_ip.o
Building modules, stage 2.
MODPOST 1 modules
CC /home/ubuntu/openairinterface5g/cmake_targets/lte_build_oai/build/CMakeFiles/ue_ip/ue_ip.mod.o
LD [M] /home/ubuntu/openairinterface5g/cmake_targets/lte_build_oai/build/CMakeFiles/ue_ip/ue_ip.ko
make[4]: Leaving directory ‘/usr/src/linux-headers-4.8.0-36-generic’
make[3]: Leaving directory ‘/home/ubuntu/openairinterface5g/cmake_targets/lte_build_oai/build’
Built target ue_ip
make[2]: Leaving directory ‘/home/ubuntu/openairinterface5g/cmake_targets/lte_build_oai/build’
/usr/bin/cmake -E cmake_progress_start /home/ubuntu/openairinterface5g/cmake_targets/lte_build_oai/build/CMakeFiles 0
make[1]: Leaving directory ‘/home/ubuntu/openairinterface5g/cmake_targets/lte_build_oai/build’
So on Ubuntu 16.04 64-Bit, “Open-Cells OAI” lte-softmodem builds! I’ll try to complete the 2nd & 3rd parts of your tutorial!
Thank you!
Laurent, It looks like you need to “quick fix” 2 files:
1. build_helper – In the OpenairCN directory under the section “Ubuntu 16.04:”, PLEASE add:
php5.6 libapache2-mod-php5.6
…. or else the following command ” ./build_mme -i ” will fail.
2. s6a_peer.c:152:15: – ERROR….. as for actually building “mme” with the following command, ” ./build_mme “, (long story short), will fail due to the following lines within the s6a_peer.c file @ lines 152:
[ 36%] Building C object CMakeFiles/S1AP_LIB.dir/CMakeFiles/R10.5/s1ap_encoder.c.o
/usr/bin/cc -DASN1_MINIMUM_VERSION=924 -DCMAKER -DCMAKE_BUILD_TYPE=\”Debug\” -DDAEMONIZE=0 -DDISABLE_EX$
/home/ubuntu/openair-cn/SRC/S6A/s6a_peer.c: In function ‘s6a_fd_new_peer’:
/home/ubuntu/openair-cn/SRC/S6A/s6a_peer.c:152:15: error: ‘RUN_MODE_SCENARIO_PLAYER’ undeclared (first use in this function)
if (RUN_MODE_SCENARIO_PLAYER == mme_config.run_mode) {
^
/home/ubuntu/openair-cn/SRC/S6A/s6a_peer.c:152:15: note: each undeclared identifier is reported only onc$
/home/ubuntu/openair-cn/SRC/S6A/s6a_peer.c:154:36: error: ‘TASK_MME_SCENARIO_PLAYER’ undeclared (first u$
itti_send_msg_to_task (TASK_MME_SCENARIO_PLAYER, INSTANCE_DEFAULT, message_p);
^
/home/ubuntu/openair-cn/SRC/S6A/s6a_peer.c:160:13: warning: implicit declaration of function ‘bdestroy_w$
bdestroy_wrapper (&filename);
^
CMakeFiles/S6A.dir/build.make:137: recipe for target ‘CMakeFiles/S6A.dir/home/ubuntu/openair-cn/SRC/S6A/$
make[3]: *** [CMakeFiles/S6A.dir/home/ubuntu/openair-cn/SRC/S6A/s6a_peer.c.o] Error 1
make[3]: Leaving directory ‘/home/ubuntu/openair-cn/BUILD/MME/BUILD’
CMakeFiles/Makefile2:524: recipe for target ‘CMakeFiles/S6A.dir/all’ failed
make[2]: *** [CMakeFiles/S6A.dir/all] Error 2
make[2]: *** Waiting for unfinished jobs….
I’m sure you’ll have a easy fix for it me hopes 🙂 but the above instructions *almost* works flawlessly with Ubuntu 16.04 64-bit. I think we’re like around 90% completed so far.
Peter,
The huge recent contribution from Facebook/TIP made my patches obsolete.
I’ll redo it for the latest commit in develop branch.
Your comments are valuable, nevertheless, the article title is about regular OAI on Ubuntu 17.04, 64 bits, native CPU compilation.
You change this in a very different context: Ubuntu 16.04, 32 bits, live usb: this is your project, you should contribute yourself
Regards,
Laurent
Laurent,
I’m using Ubuntu 16.04 64-bit installed on regular hard drive, not a LiveUSB and can’t get past the error of the s6a_peer.c file where everyone will get stuck…
For what it’s worth, I too have the same problem with RUN_MODE_SCENARIO_PLAYER and TASK_MME_SCENARIO_PLAYER. I edited the ‘typedef enum’ in mme_config.h to get past the first problem. No luck with the second one 🙁
Linux openair 4.10.0-38-generic #42-Ubuntu SMP Tue Oct 10 13:24:27 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
Just made a fresh install this evening, following along in this tutorial…
You might want to add a dependency on the ‘check’ package, i.e.
apt-get install check
Peter, We’ve never been able to get any of the instructions to work either with Ubuntu 17.04 or Ubuntu 16.04, both 64-Bit Operating Systems.
So maybe these instructions worked the very day it was posted, but never since.
These instructions simply don’t work so we stopped trying over 1 month!
Hello,
I’m sorry for you.
I has been tested successfully by a couple of independent users.
Nevertheless, all directories and many files have been updated in the EPC during May.
Also, parameter in configuration files changed.
We’ll write a updated version for the new EPC.
Regards,
Laurent
Laurent, I see you’ve updated the instructions for Ubuntu 17.04 64-Bit and have a patch for the errant s6a_peer.c file which I will check on Ubuntu 16.04 64-Bit and shall report back.
Thank you for the patch I think it will work!
Hi Laurent,
First of all, I would like to thank you for the tutorial. But unfortunately, at the end of the whole procedure I am facing an unexpected problem. The compilation of spgw is interrupted by the following error: openair-cn / SRC / SGW / sgw_handlers.c: 655: 12: error: too few arguments to function ‘gtp_mod_kernel_tunnel_add’
I noticed that the function is present in the patch that you pointed to to be applied.
More details…
/vds/openair-cn/SRC/SGW/sgw_handlers.c:655:12: error: too few arguments to function ‘gtp_mod_kernel_tunnel_add’
rv = gtp_mod_kernel_tunnel_add(ue, enb, eps_bearer_entry_p->s_gw_teid_S1u_S12_S4_up, eps_bearer_entry_p->enb_teid_S1u);
^~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /vds/openair-cn/SRC/SGW/sgw_handlers.c:60:0:
/vds/openair-cn/SRC/GTPV1-U/gtp_mod_kernel.h:6:5: note: declared here
int gtp_mod_kernel_tunnel_add(struct in_addr ue, struct in_addr gw, uint32_t i_tei, uint32_t o_tei, uint8_t bearer_id);
^~~~~~~~~~~~~~~~~~~~~~~~~
Warlei,
You took a more recent version of openair-cn than the one i’ve patched.
So, I make a never version of this note (see http://open-cells.com/index.php/2017/06/07/openair-single-machine-ubuntu-17-04-after-major-epc-update/)
The bad thing is that it will again evolve soon: the two TEiD parameters (that disappeared) may come back when the merge with Facebook/TIP contributors will be completed.
Laurent
Laurent,
Fortunately, that’s the way it must be. 😉
I’m really grateful anyway.
Many thanx!
Warlei
hello,did anyone get this problem in ubuntu 17.04 and ubuntu16.04?
calisson@calisson:~/openair-cn/SCRIPTS$ ./build_mme -c
Clean the build generated files (build from scratch)
[sudo] password for calisson:
mkdir: created directory ‘BUILD’
Build type is Debug
Architecture is x86_64
git found: /usr/bin/git
mme compilation failed
cp: cannot stat ‘/home/calisson/openair-cn/BUILD/MME/BUILD/mme’: No such file or directory
auth_request compiled
‘/home/calisson/openair-cn/BUILD/MME/BUILD/auth_request’ -> ‘/usr/local/bin/auth_request’
auth_request installed
and I try to locate it. So I edit the compilations in build_helper to get the detailed log.
build_helper:
compilations() {
cd $OPENAIRCN_DIR/BUILD/$1/BUILD
#if [ “a$4” == “a1” ]; then
if [ 1 ]; then
{
rm -f $3
make $make_args
} | tee $dlog/$2.txt
else
{
rm -f $3
make $make_args
} > $dlog/$2.txt 2>&1
fi
if [ -s $3 ] ; then
echo_success “$2 compiled”
else
echo_error “$2 compilation failed”
fi
}
then, I got this:
calisson@calisson:~/openair-cn/SCRIPTS$ ./build_mme -c >log.txt
Build type is Debug
Architecture is x86_64
git found: /usr/bin/git
/home/calisson/openair-cn/SRC/SECU/nas_stream_eea2.c: In function ‘nas_stream_encrypt_eea2’:
/home/calisson/openair-cn/SRC/SECU/nas_stream_eea2.c:64:39: warning: passing argument 2 of ‘nettle_aes128.set_encrypt_key’ makes pointer from integer without a cast [-Wint-conversion]
nettle_aes128.set_encrypt_key (ctx, stream_cipher->key_length, stream_cipher->key);
^
/home/calisson/openair-cn/SRC/SECU/nas_stream_eea2.c:64:39: note: expected ‘const uint8_t * {aka const unsigned char *}’ but argument is of type ‘uint32_t {aka unsigned int}’
/home/calisson/openair-cn/SRC/SECU/nas_stream_eea2.c:64:3: error: too many arguments to function ‘nettle_aes128.set_encrypt_key’
nettle_aes128.set_encrypt_key (ctx, stream_cipher->key_length, stream_cipher->key);
^
make[2]: *** [CMakeFiles/SECU_CN.dir/home/calisson/openair-cn/SRC/SECU/nas_stream_eea2.c.o] Error 1
make[2]: *** Waiting for unfinished jobs….
make[1]: *** [CMakeFiles/SECU_CN.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs….
make: *** [all] Error 2
I’d appreciate any assistance please.
Yours Truly,
qiaoping
Dear Qiaping,
For the second error: nettle_aes128.set_encrypt_key, this is a change in nettle library API.
So, you don’t install the right version of nettle for this version of the OpenAir EPC.
I don’t know the branch/version you use, I would recommend to take “develop” branch in git, nevertheless it changes quickly.
For cp: cannot stat ‘/home/calisson/openair-cn/BUILD/MME/BUILD/mme’: No such file or directory
the mme binary has not been compiled successfully, so it can’t be copied
Regards,
Laurent
Laurent, thank you for your replies and attention to this.
I was too careless to switch git branch from “master” to “develop”, after doing this, those errors just disappeared in ubuntu 16.04 and ubuntu 17.04.
Thank you for helping me.
Dear Qiaoping
I have the same problem as you.Because I am a beginner of linux. Can you tell me how you solved it?
Yours Truly,
Yonghao
Hi,
I am trying to follow this tutorial and when i try to build the eNB after patching the build_helper file:
./cmake_targets/build_oai -c -x -w USRP –eNB –UE
I get the following error afterwards:
(…)
FreeDiameter prefix not found, install freeDiameter if EPC, HSS
3. building the compilation directives …
Compiling UE S1 build : enabling Linux and NETLINK
./cmake_targets/build_oai: line 538: ..: command not found
build have failed
Can this be due to the OAI code updates and the patch no longer works?
Thanks for the attention,
Joao Amaral
I tried 5 minutes ago:
git pull
./cmake_targets/build_oai -c -x -w USRP –eNB –UE
It compiled fine
From your message, it seems Free diameter is not installed correctly.
I would suggest to verify the output of the external packages installation
/cmake_targets/build_oai -I
That would probably display errors related to this package installation
Regards,
Laurent
It says that the free diameter prefix is missing, do i need to build it all on the “build” folder for uhd? Or there is any workaround for this error?
Joao,
I should have detect it in your first comment: this post is related to May 2017 EPC.
If you use the latest develop branch, you must use the post: https://open-cells.com/index.php/2017/06/07/openair-single-machine-ubuntu-17-04-after-major-epc-update/
Now i can’t build HSS, when i build it after installing the necessary software, it returns the following message:
CMake Error at CMakeLists.txt:106 (MESSAGE):
FreeDiameter is not enabled for OAI_HSS
git found: /usr/bin/git
make: *** No targets specified and no makefile found. Stop.
cp: cannot stat ‘/home/joao/IDTS/openair-cn/BUILD/HSS/BUILD/oai_hss’: No such file or directory
Can you help me with this error please?
Hi Laurent,
I am experiencing this error logs during enodeB compilation:
./cmake_targets/build_oai -I
protoc-c/c_file.cc: In member function ‘void google::protobuf::compiler::c::FileGenerator::GenerateHeader(google::protobuf::io::Printer*)’:
protoc-c/c_file.cc:123:14: error: ‘const class google::protobuf::FileDescriptor’ has no member named ‘syntax’
if (file_->syntax() == FileDescriptor::SYNTAX_PROTO3) {
^~~~~~
protoc-c/c_file.cc:123:26: error: ‘SYNTAX_PROTO3’ is not a member of ‘google::protobuf::FileDescriptor’
if (file_->syntax() == FileDescriptor::SYNTAX_PROTO3) {
^~~~~~~~~~~~~~
Makefile:1396: recipe for target ‘protoc-c/protoc_c_protoc_gen_c-c_file.o’ failed
make: *** [protoc-c/protoc_c_protoc_gen_c-c_file.o] Error 1
make: *** Waiting for unfinished jobs….
I could not pass the protobuf-c installation part.
But if i comment that part in the protoc-c/c_file.cc and tried the installation of protobuf-c manually , the installation continues and successful for protobuf-c.
Did i miss something?
Can you guide me on what to do with this error?
Thanks in advance,
Dennis
Hi Laurent and guys,
Just an update, Installation is successful after following the instruction in this link:
https://open-cells.com/index.php/2017/06/07/openair-single-machine-ubuntu-17-04-after-major-epc-update/
Next step will be connecting a commercial ue to the oai(enb+epc+hss).
Thanks,
Dennis
Hello,
I’m happy to see your report.
I’ve made a new post for latest commits in develop branch.
It also fixes a bug in the MME that occurs with some phones.
Thanks
Laurent
Hi, I tried something similar to what you did running oaisim. My UE is able to attach to the eNB but I’m not able to generate traffic towards the UE. How can I troubleshoot it? I’ve seen a new interface oip1.
Many thanks in advance
Hi Daniele,
Sorry, we never use oaisim
Regards,
Laurent