Building GNU Radio on Mac OS X

From MyLabWiki
Revision as of 16:23, 31 July 2011 by Alex (Talk | contribs)

Jump to: navigation, search


This page describes how to build gnuradio-core, gnuradio-audio , gr-fcd and gr-uhd on Mac OS X 10.6.8 without using macports or any other ports. The objective is to create a GNU Radio application that bundles all non-standard libraries, including GNU Radio and UHD.

I created this procedure while developing gqrx.

Overview

We are going to work in the

 /User/alexc/gnuradio

directory, where we create following subdirectories:

  • build – This is where we install tools and libraries that are only necessary for the build process (pkg-config and libtool).
  • runtime – This is where we install the tools and libraries that are needed for both build and runtime.
  • deps – This is where I put and build all the dependencies. You can use whatever you want since this is basically just a scratch folder.
  • source – This is where I keep the GNU Radio and UHD sources.


Building the dependencies

Following packages need to be built before we can build GNU Radio:

gr-fcd has no additional requirements. Note that on Mac OS X gr-fcd does not use libusb.

In addition to the above, UHD requires:

We are going to install all dependencies into one target directory:

 /Users/alexc/gnuradio/

We can build both dynamic and static libraries and choose later whether we want to do static or dynamic linking in the application.

Libtool

Libtool is necessary for the bootstrap process, i.e. if we are building GNU Radio from git

 tar xvfz libtool-2.4.tar.gz
 cd libtool-2.4
 ./configure --prefix=/Users/alexc/gnuradio/build
 make
 make install
 export PATH=$PATH:/Users/alexc/gnuradio/build/bin

Pkg-config

Get pkg-config-0.25, which is the last version that includes glib (0.26 wont compile).

 tar xvfz pkg-config-0.25.tar.gz
 cd pkg-config-0.25
 ./configure  --prefix=/Users/alexc/gnuradio/build
 make
 make install
 export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/Users/alexc/gnuradio/build/lib/pkgconfig

Cppunit

 tar xvfz cppunit-1.12.1.tar.gz
 cd cppunit-1.12.1
 ./configure --prefix=/Users/alexc/gnuradio/build
 make
 make install

Boost

The following will build all boost libraries which isn't really necessary since we only need a few libraries.

 tar xvfz boost_1_47_0.tar.gz
 cd boost_1_47_0
 ./bootstrap.sh --prefix=/Users/alexc/gnuradio/runtime
 ./b2 install
 (will appear to hang for a while)

This will build both static and dynamic libraries and install them under prefix (together with the headers).

FFTW

 tar xvfz fftw-3.3.tar.gz
 cd fftw-3.3 
 ./configure --enable-single --enable-shared --prefix=/Users/alexc/gnuradio/runtime
 make
 make install
 cp /Users/alexc/gnuradio/runtime/lib/pkgconfig/fftw3.pc /Users/alexc/gnuradio/build/lib/pkgconfig/

GSL

 tar xvfz gsl-1.9.tar.gz
 cd gsl-1.9
 ./configure --prefix=/Users/alexc/gnuradio/runtime
 make
 make install
 cp /Users/alexc/gnuradio/runtime/lib/pkgconfig/gsl.pc /Users/alexc/gnuradio/build/lib/pkgconfig/

Cmake

To be added...

Libusb

To be added...


Building UHD

To be added...


Building GNU Radio

  • Ensure that PATH and PKG_CONFIG_PATH are set as instructed above.
  • Get GNU Radio from git.
 cd v3.4.0-113-gc491449c
 ./bootstrap
 ./configure --enable-gnuradio-core --enable-gr-audio \
             --with-boost=/Users/alexc/gnuradio/runtime/include \
             --with-boost-libdit=/Users/alexc/gnuradio/runtime/lib \
             --prefix=/Users/alexc/gnuradio/runtime

Building gr-fcd

To be added...'

Building and bundling the application

In order to compile an application the compiler needs to know two things:

  1. The location of the headers
  2. The location of the libraries