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¶
- Dependencies are split into build-time (for compilation only) and runtime
- Runtime dependencies are also needed for building (component configuration)
- Most dependencies are optional, based on the desired gnuradio components
- gnuradio-core requires only boost, swig, python
- How to generate a .lib from a .def
| Dependency | Purpose | Notes | URL | Dependency Type |
|---|---|---|---|---|
| git | checkout source code | Choose install option: Add to PATH | http://code.google.com/p/msysgit/ | build-time |
| cmake | build system | Choose install option: Add to PATH | http://www.cmake.org/cmake/resources/software.html | build-time |
| boost | all libraries | http://www.boostpro.com/download/ | build-time | |
| cppunit | C++ unit tests | Build lib/dll with project file | http://sourceforge.net/projects/cppunit/files/cppunit | build-time |
| fftw | gr-fft component | Manually generate .lib from .def | http://www.fftw.org/install/windows.html | build-time |
| gsl | gr-wavelet component | Manually generate .lib from .def | http://gnuwin32.sourceforge.net/packages/gsl.htm | build-time |
| swig | python wrapped blocks | http://www.swig.org/download.html | build-time | |
| python | build system | Use 2.6 or 2.7 | http://www.python.org/download/ | runtime |
| SDL | video-sdl component | http://www.libsdl.org/download-1.2.php | build-time | |
| wx | wxgui component | http://www.wxpython.org/download.php | runtime | |
| qt | qtgui component | http://qt.nokia.com/downloads/ | build-time | |
| qwt | qtgui component | Follow README to build | http://sourceforge.net/projects/qwt/ | build-time |
| pyqt | qtgui component | http://www.riverbankcomputing.co.uk/software/pyqt/download | runtime | |
| pyqwt | qtgui component | http://pyqwt.sourceforge.net/download.html | runtime | |
| numpy | many components | http://sourceforge.net/projects/numpy/files/NumPy/ | runtime | |
| setuptools | gnuradio companion | easy install.exe Cheetah lxml | http://pypi.python.org/pypi/setuptools | runtime |
| pygtk | gnuradio companion | Use the all-in-one installer | http://www.pygtk.org/downloads.html | runtime |
| doxygen | generated documentation | http://www.stack.nl/~dimitri/doxygen/download.html | build-time |
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