Building GNU Radio on Mac OS X
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.
We are going to work in the
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:
We can build both dynamic and static libraries and choose later whether we want to do static or dynamic linking in the application.
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
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
tar xvfz cppunit-1.12.1.tar.gz cd cppunit-1.12.1 ./configure --prefix=/Users/alexc/gnuradio/build make make install
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).
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/
To be added...
To be added...
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/
Building and bundling the application
In order to compile an application the compiler needs to know two things:
- The location of the headers
- The location of the libraries