CygwinInstallMain: Difference between revisions

From GNU Radio
Jump to navigation Jump to search
(Imported from Redmine)
 
(Fix formatting - html entities)
 
Line 97: Line 97:
$ cd gr-audio/examples/python/
$ cd gr-audio/examples/python/
$ python dial_tone.py</pre>
$ python dial_tone.py</pre>
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 &quot;Wave&quot; source is enabled in your audio control panel. Use Ctrl-C to stop the dial tone. If <code>dial_tone.py</code> stops by itself without producing sound or gives a Windows error pop-up, your version of Cygwin may be out of date (see [[WindowsTips|hints, tips, known problems, and solutions for Windows]]).
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 <code>dial_tone.py</code> stops by itself without producing sound or gives a Windows error pop-up, your version of Cygwin may be out of date (see [[WindowsTips|hints, tips, known problems, and solutions for Windows]]).


The <code>PYTHONPATH</code> environment variable must be set to tell Python where to find the GNU Radio extension modules.
The <code>PYTHONPATH</code> environment variable must be set to tell Python where to find the GNU Radio extension modules.
Line 118: Line 118:
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. If an old version of GNU Radio is installed, you should remove it with <code>make uninstall</code> before doing <code>make check</code>.
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. If an old version of GNU Radio is installed, you should remove it with <code>make uninstall</code> before doing <code>make check</code>.


Note that <code>make check</code> sometimes fails on Cygwin due to problems with &quot;sem_init&quot; or &quot;allocate_lock&quot;. These are Python and/or Cygwin problems, which don't affect most users of GNU Radio.
Note that <code>make check</code> 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 <code>PYTHONPATH</code> is set as above before running a GNU Radio application.
Be sure that <code>PYTHONPATH</code> is set as above before running a GNU Radio application.

Latest revision as of 01:06, 21 March 2017

Installing GNU Radio with Cygwin

The easiest way to install GNU Radio on Windows is to use the Cygwin (http://www.cygwin.com) 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.3.0 and are current as of December 19, 2010. 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. FIXME: The instructions for installing from the latest repository are completely out-of-date.

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:

  • cmake (version 2.8)
  • cppunit 1.12.0-1 (1.12.1 doesn't work)
  • gcc-g++ (3.4.4 works, but 4.3.4 does not)
  • gsl-devel
  • guile
  • libfftw3-devel
  • make
  • patch
  • pkg-config
  • python (instructions below assume you have python 2.6)
  • python-numpy
  • swig
  • util-linux

In order to use a USRP you will also need:

  • libusb-win32

If you want to install from source, you will need:

  • git

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:

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 git repository (latest features). This section describes how to build from the release tarball. Additional considerations when building from the git repository are described later.

Downloading the Release Source Code

Download the latest release of the GNU Radio source code from http://gnuradio.org/releases/gnuradio/gnuradio-3.7.2.tar.gz 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.7.2.tar.gz

to produce the directory gnuradio-3.7.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.7.2
$ mkdir build
$ cd build
$ cmake -DENABLE_DEFAULT=False -DENABLE_VOLK=True -DENABLE_GNURADIO_RUNTIME=True \
    -DENABLE_GR_BLOCKS=True -DENABLE_GR_FFT=True -DENABLE_GR_FILTER=True \
    -DENABLE_GR_ANALOG=True -DENABLE_GR_AUDIO=True ../

This disables all components except those explicitly enabled, namely VOLK, gnuradio-runtime, gr-blocks, and gr-audio. To build and install these components use the commands:

$ make
$ make test
$ 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 test.

To actually make GNU Radio do something, try:

$ export PYTHONPATH=/usr/local/lib/python2.6/site-packages
$ cd gr-audio/examples/python/
$ python dial_tone.py

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 dial_tone.py 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 the OSS module of gr-audio.

Building a Full GNU Radio System

Building a full GNU Radio system is simpler but takes longer:

$ cd gnuradio-3.7.2
$ mkdir build
$ cd build
$ cmake ../

This enables all components for which the required libraries and utilities are available. To build and install these components use the commands:

$ make
$ make test
$ 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. 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 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 git repository:

$ git clone https://github.com/gnuradio/gnuradio.git

Be sure to use the Cygwin version of git (available from Cygwin setup); other versions of git for Windows may produce files with an extra CR (^M) character at the end of each line.

The procedure for building the git version is like that given above for building the release version, but because the git 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 30 Dec 2013

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.

Make sure to 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:

$ cd build
$ cmake ../
$ make
$ make test
$ make install

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

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 'examples' subdirectories of the different components, such as gr-audio/python.