Install and configure SDK

From GNU Radio
Jump to: navigation, search

Install and configure SDK

The main purpose of the SDK is to provide a cross-compiling environment for our development work. While the embedded machines are getting more powerful, they are generally still limited in CPU power and memory size. Instead, we want to focus our attention on using powerful desktops/workstations to handle the build process while also preserving our standard desktop environments for working and code development.

Install the SDK (one time task)

Download the SDK shell script (or use a locally created SDK). You can get an SDK built for armv7ahf machines from:

$ wget https://www.dropbox.com/s/gegfz6p53q2wx3s/oecore-x86_64-armv7ahf-vfp-neon-toolchain-nodistro.0.sh?dl=0

There are also images that match this SDK for the Xilinx ZC702 and Zedboard.

Install it by running:

$ sudo sh oecore-x86_64-armv7ahf-vfp-neon-toolchain-nodistro.0.sh

This will ask you what directory to install the SDK into. Which directory doesn't matter, just make sure wherever it goes that you have enough disk space. The default is /usr/local. You can also install it in your home directory if you do not have root access. The instructions assume you have root access via sudo and you accept the default settings. Each SDK extracts to many gigabytes (the Zedboard/ARMv7 SDK currently served on gnuradio.org is 4.5 GB).

The SDK comes with everything we need to build GNU Radio and our GNU Radio OOT projects. The main things it contains are:

  • An "environment-setup-..." script that setups up our environmental variables, like editing PATH, CC, CXX, etc.
  • Two sysroots; one for the host machine and one for the device.

' In the ARMv7 SDK for an x86_64 host, we have:

'* armv7a-vfp-neon-oe-linux-gnueabi: the device-related files; built for the ARMv7 architecture:

$ file /usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/lib/libgnuradio-runtime
-3.7.4git.so.0.0.0 
/usr/local/oecore-x86_64/sysroots/armv7a-vfp-neon-oe-linux-gnueabi/usr/lib/libgnuradio-runtime-3.7.4git.so.0.0.0: ELF 32-bit LSB  shared object, ARM, EABI5 version 1 (SYSV), dynamically linked, BuildID[sha1]=cc15e887fad5cb5a193373ed5e7d67c5d75dfe74, not stripped

'* x86_64-oesdk-linux: host-based programs and libraries to support cross-compiling, including the compilers:

$ file /usr/local/oecore-x86_64/sysroots/x86_64-oesdk-linux/usr/bin/arm-oe-linux-gnueabi/arm-oe-linux-gnueabi-g++ 
/usr/local/oecore-x86_64/sysroots/x86_64-oesdk-linux/usr/bin/arm-oe-linux-gnueabi/arm-oe-linux-gnueabi-g++: ELF 64-bit LSB  executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.16, BuildID[sha1]=c71f60d416e3ee8b66f2410db851547170b9b41d, not stripped

Setup the SDK environment variables.

Running the environment script will set up most of the variables we'll need to compile. You will need to do this each time you want to run the SDK (and since the environment variable are only set for the current shell, you need to source it for every console you will run the SDK from)

$ . /usr/local/oecore-x86_64/environment-setup-armv7ahf-vfp-neon-oe-linux-gnueabi