Status of GNU Radio with OSX 10.9

Or, rather, with Apple’s new libc++ runtime. I’m working on the
MacPorts ticket: < #41162 (gnuradio fails to build on 10.9) – MacPorts >.

The high level advice right now is: If you update to 10.9, you won’t be
using GNU Radio for a while.

It looks like there is will be 2 issues encountered when compiling GNU
Radio on OSX 10.9 using libc++ and clang:

  1. As with the ticket, there will be errors caused by something to do
    with boost. This is typical, and we’re seeing it in a bunch of other
    ports too (incuding UHD, which I have patched temporarily within
    MacPorts to work around the issue). I’m not sure what the solution is,
    but it does not happen to everyone so it’s likely the way boost is
    installed.

  2. Even if you did get past the first boost issue, you’d get to the SWIG
    one, which isn’t easily fixable – we can’t patch SWIG-generated code,
    since it is created during runtime. The issue is that SWIG works with
    C++04 compliant c++ runtime, but not with C++11 compliant runtime, and
    libc++ is the latter, and the 2 are not totally backwards compatible.
    SWIG has a ticket open at < SWIG / Bugs / #1331 C++11: std::vector::erase const vs non-const iteraror >
    with this issue since August 27, 2013; it has LOTS of tickets open right
    now with various issue, and, while I’m sure the SWIG programmers are
    making progress, progress does not seem to be very fast.

With the above in mind, I recommend that you do NOT update to 10.9 if
you’re going to be using GNU Radio; not at this time. I think the
“best” temporary solution right now to get GNU Radio working with 10.9
is to uninstall -everything- from MacPorts and rebuild from go using
libstdc++ (the default in 10.9 is to use Apple’s new libc++; libstdc++
is provided by libgcc). I’m not sure how to do that yet; I’ll
experiment & post back once I’ve figured it out. - MLD

Michael D., Mac OS X Programmer

Ettus R. Technical Support

Email: [email protected]

Web: http://www.ettus.com

On Nov 5, 2013, at 8:41 AM, Michael D. [email protected]
wrote:

I’m not sure how to do that yet; I’ll experiment & post back once I’ve figured
it out.

I’m pretty sure we can use the legacy libstdc++ provided by Apple, but
it requires that “port” be either from the SVN trunk (as of a few days
ago) or that you wait for the next release (probably 2.3), which I’m not
sure when that will be.

Once you have “port” from the SVN trunk installed, you then do:
{{{
sudo port -f uninstall installed
sudo port clean all
sudo port install gnuradio +gcc48 +atlas configure.cxx_stdlib=libstdc++
}}}
and, then go off and wait for a day. Feel free to substitute other
variants you want everything to have, or some other +gcc4X instead of
what I put there. I do recommend +atlas, since Apple’s Accelerate
framework, at least up through 10.8, has bugs in it here and Apple is
both slow to fix and push out fixes; atlas has regular updates and bug
fixes, and generally works much better than Accelerate.

The “down side” to doing this method is that, from now on, you’ll need
to add configure.cxx_stdlib=libstdc++ to any port install command.
There’s probably a way to set this variable in a configuration file, but
it is so new I’m not sure it’s there yet.

Thus, as I wrote before, my high level advice is to not update to 10.9
yet if you truly need GNU Radio. We will continue to work on these bugs
and fix them, but it will take some time, likely months, to track down
enough to make GNU Radio and 10.9 play nicely together using libc++. -
MLD

One final update: You’re not supposed to change configure.cxx_stdlib,
even though you are allowed to do so. It is set to libc++ by default in
10.9, and libstdc++ in 10.8 and earlier. Even trying to override it per
the below does not work, because some ports are now designed internally
to assume libc++ on 10.9 (those dealing with compiling code: ld64,
cctools; for example).

So, the bottom line is truly that GNU Radio (in full) will not work with
10.9 until either (1) SWIG is updated to be C++11 compliant; or (2) GNU
Radio moves away from using SWIG to some other means for interfacing to
Python. Today I will see if the C++ parts of GNU Radio work on 10.9,
without the SWIG Python interface.

Sorry for the bummer news, you OSX 10.9 users! Go ahead and downgrade
to 10.8 for now, and GNU Radio should install and work out of the box
via MacPorts. - MLD

On Nov 6, 2013, at 8:25 AM, Michael D. [email protected]
wrote:

Today I will see if the C++ parts of GNU Radio work on 10.9, without the SWIG
Python interface.

I finally got all of the dependencies installed, and have verified that
the GNU Radio codebase does indeed work with 10.9’s clang and libc++.
So, the issue is purely that SWIG is not generating C++11 compliant
code. I will next look into whether SWIG can even do that (at all; some
special flag) or whether OSX 10.9 users are “out on a limb” for using
the GRC and Python interfaces to GNU Radio. - MLD

Michael D., Mac OS X Programmer

Ettus R. Technical Support

Email: [email protected]

Web: http://www.ettus.com

Hi Michael,

thanks so much for your efforts and for keeping us updated on your
progress. I’m some steps behind of you but reproducing the path the best
I
can. I successfully built GNU Radio runtime, pmt, blocks, fft, filter,
uhd,
fec, trellis, analog, and volk libraries with 10.9’s clang and libc++,
which is enough for my C++ application. Any one else would be interested
in
a ‘gnuradio-devel-mavericks’ port with the libraries that compile well
by
now?

On Thu, Nov 7, 2013 at 6:58 PM, Michael D.

I just pushed < Changeset 113092 – MacPorts >, which
allows exactly what you wrote there Carles: just the C++ API and
runtime. No SWIG Python or GRC. Python is used during the build, but
not used for runtime. It should be live by ~1:30 PM/US/ET. I’m love to
hear feedback from anyone trying to use GNU Radio on 10.9 via MacPorts.

  • MLD

On Nov 7, 2013, at 4:44 PM, Carles Fernandez
[email protected] wrote:

thanks so much for your efforts and for keeping us updated on your progress. I’m
some steps behind of you but reproducing the path the best I can. I successfully
built GNU Radio runtime, pmt, blocks, fft, filter, uhd, fec, trellis, analog, and
volk libraries with 10.9’s clang and libc++, which is enough for my C++
application. Any one else would be interested in a ‘gnuradio-devel-mavericks’ port
with the libraries that compile well by now?

Michael D., Mac OS X Programmer

Ettus R. Technical Support

Email: [email protected]

Web: http://www.ettus.com

Hi Michael,

I’ve tried ‘sudo port install gnuradio-devel’ on OSX 10.9 and it works
fine. The C++ API and runtime are completely usable; when linked from an
out-of-tree project, everything runs smoothly.

Best regards,
Carles

On Sat, Nov 9, 2013 at 3:15 AM, Michael D.

That’s great, Carles! Did you have issues with Boost, as per some
reports in MacPorts ticket < #41162 (gnuradio fails to build on 10.9) – MacPorts >?
If so, do you remember what you did to work around them? Thanks for the
feedback. - MLD

On Nov 9, 2013, at 5:00 AM, Carles Fernandez
[email protected] wrote:

I’ve tried ‘sudo port install gnuradio-devel’ on OSX 10.9 and it works fine. The
C++ API and runtime are completely usable; when linked from an out-of-tree
project, everything runs smoothly.

Michael D., Mac OS X Programmer
Ettus R. Technical Support
Email: [email protected]
Web: http://www.ettus.com

Hi Michael,

Issues with boost disappeared with your last push. However, it seems
that
all the code you link to boost/gnuradio libraries needs “-stdlib=libc++
-std=c++11” to work properly.

This is an example of a C++ out-of-tree project linked to GNU Radio
installed via macports in Mavericks:

Best regards,
Carles

On Sat, Nov 9, 2013 at 9:21 PM, Michael D.

One further update: I played around with the SWIG provided includes for
std, and it seems possible to tweak them to allow GNU Radio to be fully
usable on 10.9. It’s something that needs to come from upstream (the
SWIG folks), since they need to “#ifdef CXX11” or something around the
code. But, it works with only a minor change to gnuradio.i which is
fully backwards compatible. I probably won’t get back to this before
Monday (busy weekend), but I wanted to extend the hope to others of
using GRC with OSX 10.9. - MLD

On Nov 8, 2013, at 1:02 PM, Michael D. [email protected]
wrote:

I just pushed < Changeset 113092 – MacPorts >, which allows
exactly what you wrote there Carles: just the C++ API and runtime. No SWIG Python
or GRC. Python is used during the build, but not used for runtime. It should be
live by ~1:30 PM/US/ET. I’m love to hear feedback from anyone trying to use GNU
Radio on 10.9 via MacPorts.

Michael D., Mac OS X Programmer

Ettus R. Technical Support

Email: [email protected]

Web: http://www.ettus.com

I just pushed r113379 < Changeset 113379 – MacPorts > to
MacPorts, which works for me on 10.8 and 10.9, to get full GNU Radio
with GRC working. For folks using OSX / MacPorts for GNU Radio and UHD,
I invite you to try out these changes to see if they work for you;
you’ll want to do “sudo port selfupdate” to get the changes. Enjoy! -
MLD

Michael D., Mac OS X Programmer
Ettus R. Technical Support
Email: [email protected]
Web: http://www.ettus.com


Michael D., Mac OS X Programmer
Ettus R. Technical Support
Email: [email protected]
Web: http://www.ettus.com

Mike,

I just tried

sudo port upgrade outdated

and got the following

—> Fetching distfiles for gnuradio
—> Verifying checksums for gnuradio
—> Extracting gnuradio
—> Applying patches to gnuradio
—> Configuring gnuradio
—> Building gnuradio
Error: org.macports.build for port gnuradio returned: command execution
failed
Please see the log file for port gnuradio for details:
/opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_science_gnuradio/gnuradio/main.log
Error: Unable to upgrade port: 1

I am attaching the log file.

-George