- Installing GNU Radio on Mac OS X
Installing GNU Radio on Mac OS X¶
GNU Radio has been compiled and installed on Mac OS X 10.4 ("Tiger") through 10.9 ("Mavericks") running any compatible version of Xcode on all recent and many older Macs -- whether Intel or PPC. There is very little support for getting the background libraries and applications installed on Mac OS X 10.5 or earlier, though it might be possible. Primary support is for Intel-based Macs, running 10.6 or newer.
Running almost any GNU Radio graphical interface (GUI) will require downloading and installing X11/XQuartz first. Through OSX 10.8, Apple provided a means to install X11.app, but XQuartz has always been more up to date. Staring in 10.9, Apple no longer provides a full working version of X11.app. Hence, just use XQuartz from the get-go. Note that unless you experiment with using the Quartz interface to various graphical toolkits (e.g., GTK), you must use X11 as the terminal interface for GNU Radio GUI applications including GRC, the GNU Radio Companion.
Via MacPorts (recommended)¶
If you do not already have MacPorts installed, you will need to install it first. Make sure to follow the MacPorts shell environment changes needed such that MacPorts installed executables are found before all others. These are the only changes to the shell environment needed to execute any MacPorts-installed executable! Setting any DYLD environment variable (e.g., DYLD_LIBRARY_PATH) for general use is highly discouraged, because doing so, in our experience, leads to problems down the road that are very difficult to diagnose. OSX provides robust means for correcting DYLD-based issues even after dependencies are installed.
Once MacPorts is installed, GNU Radio and all of its dependencies can be installed by executing
sudo port install gnuradio
This method of installing GNU Radio is actively kept up to date by Michael Dickens, and hence is the recommended way to install GNU Radio on Mac OS X.
The latest developments in GNU Radio can be installed via
sudo port install gnuradio-devel
Please note that the
gnuradio-devel port, while tested for basic compilation and functionality, is not a formal release and hence should be considered beta software which might contain bugs or major issues.
Other Package Managers¶
There are a number of background libraries and applications that must be installed from source or binary in order to compile or execute GNU Radio. These can be obtained by using MacPorts, Fink, HomeBrew, and/or from source / scratch. MacPorts tends to be more up-to-date with respect to new releases, which can be both a blessing and a curse since sometimes new released are untested and result in build or runtime errors. MacPorts, HomeBrew, and Fink offer thousands of ready-to-install libraries and applications, and hence they are highly recommended to use instead of installing from source / scratch.
NOTE: We highly recommended that you install all dependencies via the same package manager! When issues arise, they are much easier to track down, and your updating to newer versions is also much easier.
Many GNU Radio developers first install GNU Radio using MacPorts in order to get all of the necessary background dependencies installed, then remove just GNU Radio via
sudo port uninstall gnuradio
Compiling GNU Radio from Source¶
Installing GNU Radio from source follows the standard build guide, with a change to the
cmake command such that it always finds the correct version of Python, uses the desired compiler, and finds Sphinx.
For example, on OSX 10.8 or 10.9 using Xcode 5's Apple GCC, MacPorts installed into /opt/local (the default), and for Python 2.7 (as installed by MacPorts), issue the following commands from within the GNU Radio source directory:
$ mkdir build $ cd build $ CC=/usr/bin/llvm-gcc CXX=/usr/bin/llvm-g++ cmake -DPYTHON_EXECUTABLE=/opt/local/bin/python2.7 -DPYTHON_INCLUDE_DIR=/opt/local/Library/Frameworks/Python.framework/Versions/2.7/Headers -DPYTHON_LIBRARY=/opt/local/Library/Frameworks/Python.framework/Versions/2.7/Python -DSPHINX_EXECUTABLE=/opt/local/bin/rst2html-2.7.py .. $ make
makesucceeds, then you can test the build for errors via
$ make test
To install the build, issue
$ sudo make install
Selecting another compiler is as simple as changing the CC and CXX pre-arguments to the
cmake command. Note that all of the PYTHON defines must point to the same install of Python, otherwise runtime errors are likely to occur.