Installing GNU Radio with Cygwin

The easiest way to install GNU Radio on Windows is to use the Cygwin ( environment. Once Cygwin and the required utilities and third-party libraries are installed, installation of GNU Radio is as easy on Windows as it is on Linux.

These instructions are for release 3.2.2 and are current as of September 29, 2009. They cover installation of the core GNU Radio components and components for using the USRP, wxPython GUI, and PortAudio. They do not cover installation of components needed for USRP2, GRC, SDL video, or the Qt GUI.

To install GNU Radio with Cygwin you need to:

  1. Install the Cygwin environment
  2. Install the required utilities and third-party libraries
  3. Build and install GNU Radio
  4. Install the driver for the USRP (if you have a USRP)

Installing Cygwin

Installing Cygwin is easy, but there are a few details to worry about; see getting started with Cygwin. If you have previously installed Cygwin, you should check to see that your packages are up-to-date.

Installing Utilities and Third-Party Libraries

Utilities and third-party libraries are of two types: those that are available as Cygwin packages and those that must be downloaded and/or built separately.

apt-cyg may help you installing. It works like aptitude, so you can install and search packages from the command line.

Installing Cygwin packages

You will need the following Cygwin packages to build GNU Radio. For instructions on installing Cygwin packages see getting started with Cygwin:
  • cppunit (1.12.0 or later required)
  • gcc-g++ (3.4.4 works, but 4.3.4 does not)
  • gsl-devel
  • guile
  • libfftw3-devel
  • libtool (version 2.2 or later; see hints, tips, known, problems, and solutions for Windows)
  • make
  • patch
  • pkg-config
  • python (instructions below assume you have python 2.5)
  • python-numpy
  • swig
  • util-linux
In order to use a USRP you will also need:
  • libusb-win32
If you want to install from SVN you will need:
  • subversion

Other libraries and utilities

Some of the libraries and utilities required by GNU Radio are not available as Cygwin packages. These packages must be installed manually:

If you need simultaneous capture and play of audio from your sound card or have difficulties with the basic audio support, you may want:

If you have a USRP you will also need:

Building and Installing a GNU Radio Release

GNU Radio can be built either from a release tarball (more stable) or from the latest code in the svn repository (latest features). This section describes how to build from the release tarball. Additional considerations when building from the svn repository are described later.

Downloading the Release Source Code

Download the latest release of the GNU Radio source code from to a convenient working directory. Be sure that the name of your working directory does not contain any spaces. Unpack the tarball with
$ tar -zxf gnuradio-3.2.2.tar.gz
to produce the directory gnuradio-3.2.2.

Preparing to Build

You must specify where to find the pkg-config configuration files:
$ export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig

Building a Minimal GNU Radio System

GNU Radio is a large system with many options. The simplest build procedure configures and builds all the modules that it can, but you can customize your installation (and maybe save some time) by specifying appropriate options. For a first test, it is helpful to build a minimal GNU Radio. This is done with the commands:
$ cd gnuradio-3.2.2
$ ./configure --disable-all-components --enable-omnithread --enable-gruel --enable-gnuradio-core --enable-gr-audio-oss

This disables all components except those explicitly enabled, namely omnithread, gruel, gnuradio-core, and gr-audio-oss. To build and install these components use the commands:
$ make
$ make check
$ make install

You may get warning messages, but unless one of these commands stops with an error message you should have a working installation of GNU Radio. If you do get errors be sure to check hints, tips, known problems, and solutions for Windows. If an older version of GNU Radio was installed previously, you should remove it with make uninstall before you get to make check. To actually make GNU Radio do something, try:
$ export PYTHONPATH=/usr/local/lib/python2.5/site-packages
$ cd gnuradio-3.2.2/gnuradio-examples/python/audio
$ python
This should produce a dial tone through your speakers. If Python gives you an error message, there is a problem with your installation of GNU Radio. If you get no error messages but no sound, check to see that your speakers are turned on, your volume is turned up, and that the "Wave" source is enabled in your audio control panel. Use Ctrl-C to stop the dial tone. If stops by itself without producing sound or gives a Windows error pop-up, your version of Cygwin may be out of date (see hints, tips, known problems, and solutions for Windows).

The PYTHONPATH environment variable must be set to tell Python where to find the GNU Radio extension modules.

With this minimal GNU Radio system you can capture signals from your sound card, read signals from a file, or generate signals; process signals; and play signals on your sound card or save them to a file. Note that you cannot simultaneously capture and play signals using the same sound card with gr-audio-oss.

Building a Full GNU Radio System

Building a full GNU Radio system is simpler but takes longer:
$ cd gnuradio-3.2.2
$ ./configure
This enables all components for which the required libraries and utilities are available. To build and install these components use the commands:
$ make
$ make check
$ make install
Unless one of these steps fails due to an error, you should have a working GNU Radio installation. If one of the steps fails, you may be able to disable the component that failed. Use ./configure --help to see how the components are named. Look for the "--enable-..." options and add the corresponding "--disable-..." option to your ./configure command and repeat the above steps. If an old version of GNU Radio is installed, you should remove it with make uninstall before doing make check.

Note that make check sometimes fails on Cygwin due to problems with "sem_init" or "allocate_lock". These are Python and/or Cygwin problems, which don't affect most users of GNU Radio.

Be sure that PYTHONPATH is set as above before running a GNU Radio application.

Building and Installing GNU Radio from the SVN Repository

Note: These instructions are obsolete since the changeover to the git repository.

If you want the latest features and are willing to deal with code that is still in development, you can check out the latest code from the subversion (svn) repository:
$ svn co gnuradio
Be sure to use the Cygwin version of subversion (available from Cygwin setup); other versions of svn for Windows may produce files with an extra CR (^M) character at the end of each line.

The procedure for building the svn version is like that given above for building the release version, but because the svn version is constantly
changing, there may be extra requirements a need for patches. Note that the lists of requirements and patches may become out of date at any time.

Extra requirements:

  • none known at this time

The following patches are needed:

  • no patches are needed as of 25 Aug 2008
To apply a patch, follow the link to the listing of the patch file and download it to your gnuradio directory using the Original Format link at the bottom of the page. Then use the command
$ patch -p0 -b -i file.patch

(replacing file.patch with the name of the patch file) to apply the patch. After applying any patches and before running ./configure you must initialize the build with
$ ./bootstrap
and you must set the necessary environment variables:
$ export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
The remainder of the build process is the same as for the release version except that boost should be found automatically in /usr/local/include:
$ ./configure
$ make
$ make check
$ make install

Be sure that no older version of GNU Radio is installed when running make check.

Expect `make check` to fail in test_inband.exe with "uncaught exception of type mbe_mblock_failed" errors; see Issue #191 for details.

Installing the Driver for the USRP

If you have a USRP you will need to install the driver for it; see installing the USRP driver for Windows.

Where to Go From Here

Now that your GNU Radio system is installed, it is time to start exploring. The best way to learn about GNU Radio is to study and modify the examples in the various subdirectories of gnuradio-3.2.2/gnuradio-examples/python and gnuradio-3.2.2/gnuradio/gr-utils/src/python.

注: Installing GNU Radio with Cygwin (原文出处,翻译整理仅供参考!)