GNU Radio on Mac OS X: Installing GNU Radio

Jon Jacky

4 Jan 2010   Emphasize this page is for OS X 10.4 only, also change gnuradio.org/trac to /redmine


To install GNU Radio on recent Mac hardware and operating systems, consult the Build Guide and Mac Install pages at the GNU Radio Wiki:

http://vps.gnuradio.org/redmine/wiki/gnuradio/BuildGuide,   MacInstall

These pages describe our installation of GNU Radio 3.0 and 3.1 with the USRP hardware on Mac OS X 10.4 Tiger on PPC Macs.

Overview, Environment Checkout Bootstrap Configure Make Check Install Next steps

Overview

Now that we have all the prerequisites we are ready to install GNU Radio itself.

As explained in the Build Guide, the GNU Radio installation is a variant of the familiar procedure: configure, make, make install.

A single pass through the procedure builds all the modules specified in the build configuration.

Environment variables

We define some environment variables so we can build and run GNU Radio in our chosen locations.

export GR=$HOME/gr
export PYTHONPATH=$GR/lib/python2.3/site-packages
export PKG_CONFIG_PATH=$GR/lib/pkgconfig:/opt/local/lib/pkgconfig
export CPATH=$GR/include:/opt/local/include
export LDFLAGS="-L$GR/lib -L/opt/local/lib"

I put these commands in a gr-defs shell script in my ~/bin directory. Then I run that script in any shell (any terminal window) before I build or use GNU Radio.

$ source gr-defs

Using source gr-defs rather than just gr-defs ensures that the definitions persist in that shell after the script exits. To confirm that:

$ printenv
... other variables
GR=/Users/jon/gr
PYTHONPATH=/Users/jon/gr/lib/python2.3/site-packages
... etc.

Also, be sure your PATH includes /opt/local/bin. This is typically set in your .profile.

Subversion checkout

To check out the GNU Radio sources from the Subversion repository, execute this command:

$ svn co http://gnuradio.org/svn/gnuradio/branches/releases/3.1 gnuradio

This checks out all modules for the 3.1 stable branch and puts them in a new directory gnuradio under the current directory. This is the GNU Radio build directory. I put mine under my home directory.

Execute all the following commands in the gnuradio directory.

Bootstrap

The libtool programs installed by MacPorts are named glibtool and glibtoolize. The build scripts in the GNU Radio distribution assume that they are named libtool and libtoolize. We fix this by making a copy of the bootstrap script bootstrap_mp where we change the line

libtoolize --automake

to

glibtoolize --automake

(Thanks to Michael Dickens for this fix.)

Execute it:

$ ./bootstrap_mp

Configure

We create a file configure-gr that invokes the configure command with our build configuration. Here the --prefix option sets the location of the installed software and the --disable and --enable options select the modules to install.

Our configure-gr has these contents:

./configure --prefix=$GR \
              --disable-all-components \
              --enable-gnuradio-core \
              --enable-usrp \
              --enable-gr-usrp \
              --enable-gr-wxgui \
              --enable-gr-audio-osx \
              --enable-gnuradio-examples \
              --enable-gr-utils \
              --enable-gr-how-to-write-a-block \
              --enable-omnithread

For more about build configuration options, see the Wiki.

Execute it:

$ ./configure-gr

When the configure command completes successfully, it writes this message:

The following GNU Radio components have been successfully configured:

config
omnithread
gnuradio-core
pmt
mblock
usrp
gr-usrp
gr-audio-osx
gr-wxgui
gr-utils
gnuradio-examples

You may now run the make command to build these components.

Make

Execute it:

$ make

On a 1 GHz Powerbook G4 this can take almost an hour.

Check

The check command executes tests.

$ make check

Most tests pass. Messages similar to the following usually appear. They are expected and do not indicate a problem with the installation:

Testing gr_vmcircbuf_createfilemapping_factory...
gr_vmcircbuf_createfilemapping: createfilemapping is not available
....... gr_vmcircbuf_createfilemapping_factory: Doesn't work
Testing gr_vmcircbuf_sysv_shm_factory...
gr_vmcircbuf_sysv_shm: shmat (1): Too many open files
gr_vmcircbuf_sysv_shm: shmget (1): Invalid argument
....... gr_vmcircbuf_sysv_shm_factory: Doesn't work
Testing gr_vmcircbuf_mmap_shm_open_factory...
....... gr_vmcircbuf_mmap_shm_open_factory: OK
Testing gr_vmcircbuf_mmap_tmpfile_factory...
....... gr_vmcircbuf_mmap_tmpfile_factory: OK

Install

Execute it:

$ make install

Our installation directory is under our home directory, so there is no need to sudo.

Now we have a new installed GNU Radio directory gr.

Confirm that Python can find the GNU Radio installed files:

$ python
...
>>> from gnuradio import gr
>>> 

If Python imports gr without complaint, GNU Radio is ready to use.

Next steps

Instructions for subsequent steps:

Using the GUI Using the USRP


Jon Jacky, jon@u.washington.edu