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¶
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