-
Notifications
You must be signed in to change notification settings - Fork 38
Linux Build Environment
This page is to document the Linux build environment that is used and verified to work. This is the environment that Jenkins runs on for the continuous integration tests of each pull request. The version of everything used is:
- Ubuntu 18.04
- GCC 7.3.0
- arm_none_eabi_gcc 7.3.1
- clang-format 6.0.0
- TI RTOS 2.16.01.14
- XDC Tools 3.32.00.06
TI RTOS library installation requires 32 bit library for libc, so if you are running on a 64-bit machine you will need to install these.
apt install libc6-i386
The Unity unit test framework uses Ruby to run the tests.
apt install ruby
The host software uses libedit, so this library will need to be installed if you plan to build the middleware.
apt install libedit-dev
Unity is used for the unit test framework. The current version can be found here The unit tests use the environment variable UNITY_ROOT to know where to look for the source code, so if this is not at the same level as the OpenCellular/ top directory this variable should be set in your environment
git clone https://github.com/ThrowTheSwitch/Unity.git Unity
export UNITY_ROOT=$HOME/Unity
TI-RTOS libraries are required to build the firmware and to run the unit tests. The current version used is 2.16.01.14. If you use a different version, all the makefiles will require updating to point to the correct versions. The installer can be downloaded from TI, the expected install location is $HOME/ti.
wget http://software-dl.ti.com/dsps/dsps_public_sw/sdo_sb/targetcontent/tirtos/2_16_01_14/exports/tirtos_tivac_setuplinux_2_16_01_14.bin
chmod +x tirtos_tivac_setuplinux_2_16_01_14.bin
./tirtos_tivac_setuplinux_2_16_01_14.bin
To build the firmware, the arm-none-eabi-gcc tool is used. Installing via apt creates issues when trying to link, so it is easier to use the latest version directly downloaded and installed. The environment variable TOOLCHAIN should point to the install directory for the version you want to use, the default is /usr/
wget https://developer.arm.com/-/media/Files/downloads/gnu-rm/7-2018q2/gcc-arm-none-eabi-7-2018-q2-update-linux.tar.bz2
tar -jxf gcc-arm-none-eabi-7-2018-q2-update-linux.tar.bz2
export TOOLCHAIN=$HOME/gcc-arm-none-eabi-7-2018-q2-update
Install clang-format for linting. The version used is 6.0, but it just required that it is >=5.0 to work with the current configuration file.
apt install clang-format
The following commands can be used to setup Ubuntu 18.04 (as root user, or add sudo to apt install commands):
# Go to home directory
cd $HOME
# Clone OpenCellular
git clone https://github.com/Telecominfraproject/OpenCellular.git OpenCellular
# Install dependencies
apt install -y libc6-i386 ruby libedit-dev clang-format
# Uncomment the following for java needed by Jenkins
#apt install -y openjdk-8-jdk
# Download and extract gcc-arm-none-eabi
wget https://developer.arm.com/-/media/Files/downloads/gnu-rm/7-2018q2/gcc-arm-none-eabi-7-2018-q2-update-linux.tar.bz2
tar -jxf gcc-arm-none-eabi-7-2018-q2-update-linux.tar.bz2
# Clone Unity
git clone https://github.com/ThrowTheSwitch/Unity.git Unity
# Set environment variables
export UNITY_ROOT=$HOME/Unity
export TOOLCHAIN=$HOME/gcc-arm-none-eabi-7-2018-q2-update
#Run TI RTOS install - this will require user inputs so run last
wget http://software-dl.ti.com/dsps/dsps_public_sw/sdo_sb/targetcontent/tirtos/2_16_01_14/exports/tirtos_tivac_setuplinux_2_16_01_14.bin
chmod +x tirtos_tivac_setuplinux_2_16_01_14.bin
./tirtos_tivac_setuplinux_2_16_01_14.bin
OpenCellular | Open-Source Rural Access | Tower to the People | Democratizing Access