GNU Radio & Mac OS X – The Adventure
A few days ago my USRP B100 with WBX daughterboard arrived. It is an awesome piece of kit, judging just from how the PCBs are designed and laid out. The online reviews and demos also agree. My first challenge is going to get the USRP up & running with GNU Radio on my 2013 iMac. I say challenge as many online references are for PPC versions of Mac OS, or simply outdated, as an example, Jon Jacky’s page. And it’s from 2010, just three years ago!
So, like I did with Imagick and MAMP, I’m going to try and write a step-by-step, easy to follow guide as I go along. This is going to be a live post, so keep checking every few days for progress!
Day one: brewing the drivers
The lack of up-to-date, complete information on how to drive the USRP under Mac OS is surprising. Given the market share and BSDness of OS X, one could safely assume it would be a more prone target than, say, Windows. My first attempt to install GNU Radio using macports didn’t go down so well, and having suffered dependencies hell before, I went looking for other ways, without giving it a second look. After some Google time, I found a set of Homebrew recipes in titanous’ GitHub, which claims to have been tested on 10.8. The result is that I could start GNU Radio, but I was missing the WX GUI components, and had only f-ugly QT components. I blame myself for not reading the instructions end-to-end, and the instructions for not pointing out that WX GUI had to be installed beforehand. Other stuff was duplicated. Some stuff was missing. As an example, I could not find the “Variable Slider” component used in Balint Seeber’s tutorial on YouTube. As an example of the ugliness, and keeping up with my obnoxiousness when it comes to user interfaces, here is a graphical review of the window resulting from Balint’s first test:
I had also installed, but was missing in the sources, the driver for the USRP, following instructions found somewhere else. After a couple of email exchanges with the good people at Ettus, I was pointed to a promising set of guides, back on macports. These will come tomorrow, though.
Day 2: playing with MacPorts
The pointers given by Balint were this tutorial by Andy Bardagjy on getting the right sdcc version to install, followed by installation of the gnuradio port, and finally setting the Python path variables. As some of this info was a bit old, I checked out the sdcc ticket on trac, and it’s shown as fixed, so I’m attempting to go ahead with 3.0.0. For the record, trying to clone 57740 (v2.9.0) failed upon build, so that’s another reason for attempting to go with 3.0.0.
Installing the USRP driver also went fine, just that the port name has been changed to UHD. My first attempt to install GNU Radio after this appeared to work, but for some reason, gnuradio-companion was nowhere to be seen. Trying to install any of the gnuradio-<whatever> ports resulted in an error informing me that they had been replaced by ‘gnuradio’ with options.
After some more Google time, I found this ticket on the MacPorts trac, that explains the issue, and suggests a fix. I managed to get GNU Radio with gnuradio-companion working, at least visually, by running
sudo port install gnuradio +grc +python27 +qtqui +wxgui
which includes the WX GUI components. But it doesn’t include the USRP sources. So, let’s try this instead (after port clean etc.)
sudo port install gnuradio +uhd +grc +swig +wxgui +qtgui +python27
Now, I can see the UHD USRP sources in Companion! More to come later…
Day 3: getting some results!
Finally, the light at the end of the tunnel starts to appear. The WX GUI objects are now present in Companion, but they are also ugly as hell. Maybe it’s a Mac OS rendering issue, I’ll have a go on Ubuntu to see the difference.
The Guide™
Step-by-step, here is how to get your USRP to work under Mac OS X 10.7 and 10.8. By the time you read this, new versions of the different pieces of the puzzle could have appeared, so I’m not making guarantees.
1. Install MacPorts if you haven’t yet done so. Grab it here.
2. Install sdcc – the bugs that were reported appear to have been fixed, so v3.0.0 is fine:
sudo port install sdcc
3. Install the UHD driver for the USRP, including libusb and Python 2.7:
sudo port install uhd +libusb +python27
When you do this, Boost 1.53 will also be installed, which doesn’t seem to give any problems.
4. Install GNU Radio, with UHD support, GRC (the Companion), the WX and QT GUIs (just in case):
sudo port install gnuradio +uhd +grc +swig +wxgui +qtgui +python27
You may see the following, depending on what you had installed before trying this procedure:
Error: org.macports.activate for port qwt returned: Image error: /opt/local/include/qwt/qwt.h is being used by the active qwt52 port. Please deactivate this port first, or use 'port -f activate qwt' to force the activation.
I didn’t really feel like bug hunting any longer, so I just forced it with
sudo port -f activate qwt
and was done with. I’ll rest my case with a short quote from Miguel de Icaza’s post on why he ended up with a Mac instead of Linux. He started the GNOME project and Mono.
“While I missed the comprehensive Linux toolchain and userland, I did not miss having to chase the proper package for my current version of Linux, or beg someone to package something. Binaries just worked.”The build may finish with a complaint about qwt52 not installing as qwt is already installed (WTF?), but gnuradio starts OK.
Once this is done, you should be able to start gnuradio-companion. In order to use the B100, you need to add, for example, a UHD: USRP Source. Here is an updated example of a WFM receiver, you can download the .grc file here.




As I’m an 












