Skip to main content

Compiling GnuRadio 3.3.0 on Mountain Lion

Fixing all the little issues with this process took me days, so I apologize if it's a complicated and multi-step process. These steps worked for me, hopefully they work for you too, but YMMV.

First of all, it is vital that you don't have the macports boost 1.50installed. There is a problem with that version where the x86_64 version of the library isn't compiled. This is mentioned in an earlier post, and the mac ports trac entry ishere.

The easiest way to begin is to install boost 1.49 then run "sudo port install gnuradio-core" and let macports install all of the pre-requisite packages (you may need to perform the fix I mentioned in that earlier post to fix netpbm) .When it finally gets to gnuradio-core, it will fail. Now, what you need to do is:

$sudo port edit gnuradio-core

Follow the instructions, again in that earlier post (update 2).

$sudo port clean gnuradio-core
$sudo port -n install gnuradio-core
--> Computing dependencies for gnuradio-core
--> Fetching archive for gnuradio-core
--> Attempting to fetch gnuradio-core-3.3.0_0+python26.darwin_12.x86_64.tbz2 from http://packages.macports.org/gnuradio-core
--> Fetching distfiles for gnuradio-core
--> Verifying checksum(s) for gnuradio-core
--> Extracting gnuradio-core
--> Applying patches to gnuradio-core
--> Configuring gnuradio-core

THIS IS IMPORTANT!: Cancel (control-c) when it says "Configuring gnuradio-core." At this point, we need to hand-edit the configure script in the gnuradio source directory. The reason for this is because some of the assembler code in gnuradio uses 32-bit only opcodes. When compiling for 64-bitmachines they generate errors. It's necessary for them to be compiled differently. Luckily, when Lion was released, a fix was devised and added to macports. The same exact fix (in principle) should work for Mountain Lion.But, in the configure script, the change looks for Lion and doesn't detectMountain Lion. We just need to change the test to detect Mountain Lion. The difference is only the version of darwin used. This information is in this trac.

$cd /opt/local/var/macports/build/
$ls    <cd to the long directory that ends with science_gnuradio-core>
$cd gnuradio-core/work/gnuradio-3.3.0
$sudo vi configure

Once editing the configure script, search for darwin*10* or darwin*11*. This is easy if you hit the forward slash and type darwin\\*1

The region of interest should look like this (the numbers are the linenumbers):

20154     *darwin*11*)
20155 # The cast to long int works around a bug in the HP C Compiler
20156 # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
20157 # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
20158 # This bug is HP SR number 8606223364.

Change the *darwin*11* (or *darwin*10* ) to: *darwin*12*

Close the vi session by hitting <esc> then : then type wq and <enter>.

Now, run "sudo port -n install gnuradio-core". Make sure that you DO NOT clean the package. This will destroy our edited configure script.

When that finishes (hopefully it does!) you should be all set! You'll probably want to install gnuradio-companion as well as gnuradio-audio-osx.

If you have any problems or questions, let me know in the comments.

Comments

Comments powered by Disqus