Installing GNU Radio via MacPorts

GNU Radio is a fun tool for those of us interested in software-defined radios (SDRs). I’ve been playing around with it for a few years in my hobby projects and I hope by starting blogs about it, that it’ll spark me to follow through with more of those projects because this software can do some pretty awesome stuff. For now, I figured the best place to start is another good ole’ install tutorial (I promise these blogs will not just be all install tutorials, it’s just the best place I knew where to start until I get better at this whole blogging thing).

First, install MacPorts which is pretty easy, just download the install package and run it. You will also need Xcode. These two things are my top two developer must haves on a Mac. Even if you never use the Xcode IDE itself, nearly everything you will do in the command line on a Mac will need the compliers, UNIX tools, etc. at some point that the Xcode command line tools will equip you with.

Xcode is a really simple install, just download it from the Mac App Store.

Next you’ll want to install Xcode’s Command Line Tools, just open a terminal window and type:

xcode-select --install

For MacPorts, just go to their website and grab the installer for your version of Mac OS (https://www.macports.org/install.php).

Once you have that done, run the command,

port version

to make sure it echos back the version of MacPorts you just installed. Now you're not only set for the rest of this blog, but for infinitely more things ahead!

Now you’re ready to get to the good part:

sudo port install gnuradio

I had to attempt this several times due to ports for certain dependences either not being activated or enabled. The great thing about MacPorts is that it's pretty clear about explaining its errors help you along with fixing them without spending days Googling your way through unforgiving forums. I've found it to be extremely helpful as someone who isn’t 100% comfortable with the command line style of doing things yet. And yes, I'm embarrassed that I've gotten this far without getting acquainted with the command line way of life, but it's a life you have to seek out with the way Windows and Mac OS try to essentially "idiot-proof" everything and lock everything down (at least that’s what I’m telling myself to feel better).

This part took about an hour for me and the fans on my MBP kicked on so hard it sounded like my laptop was about to take off and fly out the window. A significant amount of time was spent on the part of the install where it was building the gnuradio package. So long that I thought it was frozen for a bit, it also does the same whenever I update it so I can tell GNU Radio is just a huge program.

Once you’ve made it through the build, run the GNU Radio companion IDE to take it for a test spin:

gnuradio-companion  

X11 will launch automatically and open a blank flow graph. You can find all kinds of example flow graphs under /opt/local/share/gnuradio/examples

Open one of the many examples GNU Radio provides to get started! I personally like the OFDM loopback test because I feel like it gave me the most upfront as far as how the whole flow of GNU Radio works.

Open one of the many examples GNU Radio provides to get started! I personally like the OFDM loopback test because I feel like it gave me the most upfront as far as how the whole flow of GNU Radio works.