Building GNU Radio manually from source
This article assumes you are not using the build-gnuradio script which runs you through the build process automatically, and do not wish to install from a binary installation package. If you don't exactly know if this is correct for you, refer to the install guide first.
For the impatient: Clone the gnuradio repo and run the standard cmake build chain (
make install). On most distros, this does the trick.
I. Meet dependencies
First, ensure that you've fulfilled the dependencies specified in the top-level: http://gnuradio.org/doc/doxygen/build_guide.html.
Most GNU/Linux systems come with our dependencies already packaged. You may need to install them off of your install CD/DVD or over the net. See below for Operating System specific notes.
We only absolutely require Boost 1.35 for GNU Radio to operate, but we recommend 1.47 or greater. There is a race-condition bug in earlier versions that can cause a flowgraph to lock up during a stop or unlock operation (see issue #477). If you are having this problem, check your Boost version and update accordingly.
II. Get the source code
To build and install GNU Radio, you may either download a release tarball, or you may use the git client software to check out code from our git repository. Please refer to the download page for pointers on where to get the code.
To get a handle on what's going on, clone the repository (if you haven't already), then run "qgit" or one of the other git viewers on it. It will show you all of the branching and merging, diffs, etc.
III. Start the build process
To compile, there are 5 steps. Start by cd'ing to the gnuradio directory, then complete the following commands (this works on most Linux-based or -related distros):
$ mkdir build $ cd build $ cmake ../ $ make && make test $ sudo make install
This will perform all configuration checks and select for build, test, and installation all components that pass.
The autotools build chain (using bootstrap, configure etc.) was replaced by CMake, in case you were wondering.
Common configuration options
The previous commands might work out of the box, but perhaps you have to tell cmake more information to make it work.
Here's the most common switches:
-DENABLE_GR_XXX=ONThis enables (or disables for =OFF) the GNU Radio component named XXX. You might not need all of them, and this way, you can compile quicker.
-DCMAKE_INSTALL_PREFIX=XXXInstall your stuff to XXX.
-DQWT_INCLUDE_DIRS=/usr/include/qwt5On some distros, cmake has trouble finding QWT. This solves it.
-DCMAKE_BUILD_TYPE=DebugThis causes gcc to add debug symbols to all binaries. Useful for debugging (otherwise, it decreases efficiency!)
If you use a cmake GUI, such ccmake or cmake-gui, it will prompt you with all the options (no need to learn them by heart).
Dealing with Old Build Problems
1) Uninstall gnuradio (from the build directory):
$ sudo make uninstall
If you don't have the build dir for the current build, you have to manually remove all GNU Radio related files from your install prefix (usually /usr/local/).
2) If you got the code through git, restore the original git files from any added files during an old build:
$ git clean -d -x -f
Then you can configure, make, etc. Careful: this really nukes any changes you made.
Generating GNU Radio Documentation
By default, gnuradio will automatically build documentation if doxygen and xmlto programs are installed prior to installing gnuradio, so make sure they are installed in your system. Doxygen is used to build the gnuradio C++ API documentation. The generated documents can be found and browsed at docs/doxygen/html/index.html. The xmlto is used to convert the extra documentation xml files (found in usrp, gr-trellis,..etc folders) to html files.
To generate the Python docs, you also need sphinx.
IV. Operating System Specific Instructions
This section links to guides which go into more specific detail for a given operating system, outlining how to fulfill the build prerequisites, any non-standard build steps that must be taken, and general configuration issues. If a given operating system has binary installation packages or another automated way to build GNU Radio, it will be listed here.
- Mac OS X
- NetBSD (likely also appropriate for DragonflyBSD and helpful for OpenBSD)
USRP FPGA Firmware
To compile the verilog source code for the fpga firmware for the usrp you need Altera Quartus II Web Edition. This is only needed if you change the verilog code, since the distribution contains pre-compiled versions of this firmware.