GNU Radio Manual and C++ API Reference  3.10.9.1
The Free & Open Software Radio Ecosystem
Build Instructions and Information

Dependencies

The list of GNU Radio dependencies and the minimum required versions, if any, to build the various GNU Radio components.

Most of these components do not need to be individually compiled or installed. Instead, rely on your operating system's package manager or binary installation process (the apt-get or apt system in Debian and Ubuntu, yum or dnf in RedHat and Fedora, etc.). GNU Radio tries to keep an up-to-date build guide for the majority of the supported operating systems on gnuradio.org (https://wiki.gnuradio.org/index.php/BuildGuide).

Not all dependencies are required for all components, and not all components are required for a given installation. The list of required components is determined by what the user requires from GNU Radio. If, for example, you do not use any UHD-based hardware, do not worry about building gr-uhd.

Before trying to build these from source, please try your system's installation tool (apt-get, pkg_install, YaST, yum, urpmi, etc.) first. Most recent systems have these packages available.

Global Dependencies

A C/C++ compiler is also required. These are known to work:

Other compilers may work, but are not supported.

Python Wrappers

docs: Building the documentation

grc: The GNU Radio Companion

gr-fft: Fast Frequency Transform

gr-zeromq: ZeroMQ Network layer

cppzmq is included (undocumentedly) in the debian and Ubuntu libzmq3-dev packages.

gr-wavelet: Collection of wavelet blocks

gr-qtgui: The QT-based Graphical User Interface

gr-audio: Audio Subsystems (system/OS dependent)

Optional

It is not necessary to satisfy all of these dependencies; just the one(s) that are right for your system. On Linux, don't expect audio-osx and audio-windows to be either satisfied or built.

uhd: The Ettus USRP Hardware Driver Interface

gr-fcd: The FunCube Dongle hardware interface (only if you want to use one)

gr-video-sdl: PAL and NTSC display (rarely used)

ControlPort may use various backends to perform the RPC process, and each is its own dependency.

Currently, ControlPort only supports the Apache Thrift backend.

To have nice formula formatting in doxygen, you'll need LaTeX:

Building GNU Radio

GNU Radio is built using the CMake build system (http://www.cmake.org/). The standard build method is as follows:

$ mkdir $(builddir)
$ cd $(builddir)
$ cmake [OPTIONS] $(srcdir)
$ make
$ make test
$ sudo make install

The $(builddir) is the directory in which the code is built. This cannot be the same path as where the source code resides. Often, $(builddir) is $(srcdir)/build.

CMake Options

Options can be used to specify where to find various library or include file dependencies that are not automatically being found (-DCMAKE_PREFIX_PATH) or set the install prefix (-DCMAKE_INSTALL_PREFIX=(dir)).

Components can also be enabled and disabled through the options. For a component named gr-comp, the option to disable would look like: -DENABLE_GR_COMP=off. The "off" could also be "false" or "no", and cmake is not case sensitive about these options. Similarly, "true", "on", or "yes" will turn this component on. All components are enabled by default so long as their dependencies are met.

An example is -DENABLE_PYTHON=False turns off building any Python components or generating Python bindings. The result will be the GNU Radio libraries and C++ programs/applications/examples. No Python or GRC files will be built or installed.

The -DENABLE_DEFAULT=False can be used to disable all components. Individual components can then be selectively turned back on. For example, just building the VOLK library can be done with this:

cmake -DENABLE_DEFAULT=Off -DENABLE_VOLK=True <srcdir>

The build type allows you to specify the build as a debug or release version. Each type sets different flags for different purposes. To set the build type, use:

-DCMAKE_BUILD_TYPE=<type>

The available build types and the C/C++ flags they set are:

  • None: No flags; define them yourself
  • Release: -O3
  • Debug: -O2 -g
  • RelWithDebInfo: -O3 -g
  • MinSizeRel: -Os
  • NoOptWithASM: -O0 -g -save-temps
  • O2WithASM: -O2 -g -save-temps
  • O3WithASM: -O3 -g -save-temps

If not specified, the "Release" mode is the default.

Collection of CMake Flags

  • CMAKE_BUILD_TYPE: Build profile type defined above. Default is "release".
  • CMAKE_INSTALL_PREFIX: Installation prefix path. Default is "/usr/local".
  • ENABLE_PYTHON: Turn Python bindings on/off. Default is True.
  • ENABLE_GR_<component>: Turn any top-level component on/off. Default is True for all.
  • ENABLE_GR_CTRLPORT: Turn Building ControlPort. Default is True
  • ENABLE_PERFORMANCE_COUNTERS: Turn performance counters on/off in runtime. Default is True.
  • ENABLE_ORC: tells VOLK enable/disable use of Orc. Default is True.
  • ENABLE_STATIC_LIBS: build static library files. Default is False.
  • CMAKE_TOOLCHAIN_FILE: A toolchain file to setup the CMake environment for cross-compiling.

Here are some other potentially helpful CMake flags. These are to help you specifically locate certain dependencies. While the CMake scripts themselves should generally find these for us, we can use these to help direct CMake to specific locations if we have installed a different version elsewhere on the system that CMake doesn't know about.

  • QWT_LIBRARIES: shared library to use for Qwt (in the form <path>/libqwt.so).
  • QWT_INCLUDE_DIRS: path to Qwt include files (e.g., /usr/include/qwt).
  • PYTHON_EXECUTABLE: Location of the 'python' binary you want to use (e.g., /usr/bin/python2.7).
  • PYTHON_INCLUDE_PATH: path to Python include files (e.g., /usr/include/python2.7).
  • PYTHON_LIBRARY: Python's shared library location (e.g., /usr/lib/python2.7.so.1).
  • Boost_INCLUDE_DIR: location of the 'boost' header file directory (e.g., /usr/include).
  • Boost_LIBRARY_DIRS: location of the libboost-xxx.so files (e.g., /usr/lib)

Other dependencies will have similar settings like these to properly locate them.

Building for the E100

To build GNU Radio on the Ettus Research E100 embedded platforms, CMake has to know that the processors uses the NEON extensions. Use the

cmake -DCMAKE_CXX_FLAGS:STRING="-mcpu=cortex-a8 -mfpu=neon -mfloat-abi=softfp -g" \
-DCMAKE_C_FLAGS:STRING="-mcpu=cortex-a8 -mfpu=neon -mfloat-abi=softfp -g" \
<gr_source_dir>
@ STRING
Definition: qtgui_types.h:27