Sunday, 7 January 2018

GNURadio install on Mac OS

Recently I had problems to compile gnuradio from source on my mac. I thought that it would be a great start for the new year to bring it to life, so here is what I've done. Maybe not all the steps are needed but anyway this is more or less a reminder to myself no to forget how I once managed to do it.

Current version of my mac OS is Sierra 10.12.6 (16G1114). First of all I reinstalled homebrew to have a kind of clean start (uninstall + some cleaunp by hand + install):

https://github.com/Homebrew/install

I'm using brew's python. For that I install python2:

$ brew install python2

As I'm using USRPs so I started with compiling UHD. For that I installed the following packages:

brew install cmake gcc python2 libusb doxygen boost


Get the latest UHD from:

$ git clone https://github.com/EttusResearch/uhd

It is practical to specify the python path for each component, so for compiling UHD I used

$ cd uhd/host/
$ mkdir build
$ cd build


$ cmake -DPYTHON_EXECUTABLE=/usr/local/Cellar/python/2.7.14/bin/python2.7 -DPYTHON_INCLUDE_DIR=/usr/local/Cellar/python/2.7.14/Frameworks/Python.framework/Versions/2.7/Headers/ -DPYTHON_LIBRARY=/usr/local/Cellar/python/2.7.14/Frameworks/Python.framework/Versions/2.7/Python ..

$ make
$ sudo make install

Note: this is for current python version with default brew paths. You might need to modify this for python versions other than 2.7.14.

For gnuradio we need qt4. Get it as prompted here: 

$ https://github.com/cartr/homebrew-qt4

It has a dependency on sip which might install python3 so it may be practical to do

$ brew install sip --with-python2

Before 

$ brew tap cartr/qt4
$ brew tap-pin cartr/qt4

$ brew install cartr/qt4/pyqt@4
$ brew install cartr/qt4/pyqt

Install further dependencies for gnuradio:


$ brew install pygtk swig fftw

This might be also needed

$ sudo pip2 install setuptools
$ sudo pip2 install numpy

Now we can compile gnuradio. It might be useful to read this: https://wiki.gnuradio.org/index.php/MacInstall

Anyway, get the latest version 

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

$ cd gnuradio
$ mkdir build
$ cd build
$ cmake -DPYTHON_EXECUTABLE=/usr/local/Cellar/python/2.7.14/bin/python2.7 -DPYTHON_INCLUDE_DIR=/usr/local/Cellar/python/2.7.14/Frameworks/Python.framework/Versions/2.7/Headers/ -DPYTHON_LIBRARY=/usr/local/Cellar/python/2.7.14/Frameworks/Python.framework/Versions/2.7/Python -DCMAKE_PREFIX_PATH=/usr/local/Cellar/qt@4/ ..

$ make
$ sudo make install

Note that in this case the path for Qt is also included. I have some disabled components:


-- ######################################################
-- # Gnuradio disabled components                        
-- ######################################################
--   * gr-comedi
--   * gr-wavelet
--   * gr-wxgui
--   * gr-zeromq

If you need some any of these you have to figure out the missing dependencies from the cmake output.


No comments:

Post a Comment

GNURadio install on Mac OS

Recently I had problems to compile gnuradio from source on my mac. I thought that it would be a great start for the new year to bring it to ...