CMakeWork

The goal here is to build gnuradio under various systems using CMake.

Install the dependencies

UNIX dependencies

  • Install CMake through your OS's package manager or by some other means.
  • Follow the OS specific instructions to install other dependencies: BuildGuide

Windows dependencies

Dependency Purpose Notes URL
git checkout source code Choose install option: Add to PATH http://code.google.com/p/msysgit/
cmake build system Choose install option: Add to PATH http://www.cmake.org/cmake/resources/software.html
boost all libraries http://www.boostpro.com/download/
cppunit C++ unit tests Build lib/dll with project file http://sourceforge.net/projects/cppunit/files/cppunit
fftw gnuradio-core Manually generate .lib from .def http://www.fftw.org/install/windows.html
gsl gnuradio-core Manually generate .lib from .def http://gnuwin32.sourceforge.net/packages/gsl.htm
swig python wrapped blocks http://www.swig.org/download.html
python build system Use 2.6 or 2.7 http://www.python.org/download/
SDL video-sdl component http://www.libsdl.org/download-1.2.php
qt qtgui component http://qt.nokia.com/downloads/
qwt qtgui component Follow README to build http://sourceforge.net/projects/qwt/
pyqt qtgui component http://www.riverbankcomputing.co.uk/software/pyqt/download
pyqwt qtgui component http://pyqwt.sourceforge.net/download.html
numpy many components http://sourceforge.net/projects/numpy/files/NumPy/
setuptools gnuradio companion easy install.exe Cheetah lxml http://pypi.python.org/pypi/setuptools
pygtk gnuradio companion Use the all-in-one installer http://www.pygtk.org/downloads.html
doxygen generated documentation http://www.stack.nl/~dimitri/doxygen/download.html

Get the source code

The master branch of gnuradio.git has cmake support:
http://gnuradio.org/redmine/projects/gnuradio/wiki/Download


Configure the build

UNIX configuration

mkdir <gnuradio build directory>
cd <gnuradio build directory>
cmake <gnuradio source directory>

-- OR --

cmake-gui <gnuradio source directory>

Windows configuration

  • Open the CMake GUI from the start menu
  • Specify the source and binary directories
  • Now the following is an iterative process:
    • Click configure
    • Enter parameters
    • Repeat until all desired components are enabled
  • Click generate

A screen-shot of a configured gnuradio build: http://i.imgur.com/8qXWb.png

Component selection

By default, the build system will enable all components that it can find dependencies for.
Use cmake-gui or ccmake (curses) to graphically enable or disable components.
Or follow the examples below to configure via the command line:

Disable some components:

cmake -DENABLE_GR_AUDIO=OFF <gnuradio source directory>

Disable all components by default and manually enable desired components:

cmake -DENABLE_DEFAULT=OFF -DENABLE_GRUEL=ON -DENABLE_GR_CORE=ON <gnuradio source directory>

Cause configure to error when an enabled component does not meet dependencies:

cmake -DENABLE_GR_QTGUI=FORCE <gnuradio source directory>


Build the source

CMake has generated a build environment depending upon your system type and the generator options passed into CMake. Below is some documentation for the using the most common build environments (Makefiles on UNIX, and MSVC on Windows):

Makefiles

Open a terminal and enter the following commands:

cd <gnuradio build directory>
make
make test
sudo make install
sudo ldconfig

MSVC command prompt

Open the Visual Studio command prompt and enter the following commands:

cd <gnuradio build directory>
devenv gnuradio.sln /build Release /project ALL_BUILD
devenv gnuradio.sln /build Release /project RUN_TESTS
devenv gnuradio.sln /build Release /project INSTALL

MSVC GUI

  • Open <gnuradio build directory>\gnuradio.sln in Visual Studio
  • Set the build type to Release
  • Right click on the "ALL_BUILD" target and select Build
  • Right click on the "RUN_TESTS" target and select Build
  • Right click on the "INSTALL" target and select Build

Post-installation tasks

In general, you need to set the bin path, the library path, and the python path for your new gnuradio installation.

UNIX post-installation

Follow the OS specific instructions to setup install paths: BuildGuide

Windows post-installation

You need to set the PATH and PYTHONPATH path environment variables. I recommend using Rapid Environment Editor

  • Set the PATH to include <gnuradio install directory>/bin
  • Set the PYTHONPATH to include <gnuradio install directory>/lib/site-packages
  • Add the dlls from all dependency libraries into the PATH or copy them into <gnuradio install directory>/bin