# ADS-B on Mac 10.9 - possible linking error

**URL:** <https://www.ruby-forum.com/t/ads-b-on-mac-10-9-possible-linking-error/232179>\
**Category:** GNU Radio\
**Created:** [September 23, 2014, 1:21pm UTC](https://www.ruby-forum.com/t/ads-b-on-mac-10-9-possible-linking-error/232179 "2014-09-23T13:21:14Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![addis\_a](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/c4cdca/32.png) [@addis\_a](https://www.ruby-forum.com/u/addis_a)\
**Post date:** [September 23, 2014, 1:21pm UTC](https://www.ruby-forum.com/t/ads-b-on-mac-10-9-possible-linking-error/232179/1 "2014-09-23T13:21:14Z")

</div>

Hi

I am trying to build and use gr\_air\_modes built from  
[GitHub - bistromath/gr-air-modes: Gnuradio Mode-S/ADS-B radio](https://github.com/bistromath/gr-air-modes). But the command

sudo ldconfig

is not available on Mac 10.9.5. When I execute the modes\_rx command I  
get the following:

sudo /usr/local/bin/modes\_gui  
Traceback (most recent call last):  
File “/usr/local/bin/modes\_gui”, line 30, in   
import air\_modes  
ImportError: No module named air\_modes

Any help greatly appreciated.

[I have reloaded / built all the dependencies from macports yesterday.]

Alan

---

<div class="post-metadata">

**Author:** ![alanwatts](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/ad7895/32.png) [@alanwatts](https://www.ruby-forum.com/u/alanwatts)\
**Post date:** [September 23, 2014, 1:52pm UTC](https://www.ruby-forum.com/t/ads-b-on-mac-10-9-possible-linking-error/232179/2 "2014-09-23T13:52:25Z")

</div>

Hi Alan,

On 23 Sep 2014, at 13:19, Alan W. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> File “/usr/local/bin/modes\_gui”, line 30, in   
> import air\_modes  
> ImportError: No module named air\_modes

Python cannot find find the module, so you might have to adapt you  
PYTHONPATH to include the folder where air\_modes is installed (something  
like /usr/local/lib/python2.7/site-packages). Then you will most likely  
run into problems with shared libraries that can be fixed like this

> <https://github.com/bastibl/gr-air-modes/commit/c1379fa5979fadd296e8be03634c1a561384b424>

If you run it and it segfaults assert (with cmake) that you use the  
python libraries from port which are typically installed under  
/opt/local. By default it selects the libs from OS X.

Best,  
Bastian

---

<div class="post-metadata">

**Author:** ![alanwatts](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/ad7895/32.png) [@alanwatts](https://www.ruby-forum.com/u/alanwatts)\
**Post date:** [September 23, 2014, 4:58pm UTC](https://www.ruby-forum.com/t/ads-b-on-mac-10-9-possible-linking-error/232179/3 "2014-09-23T16:58:12Z")

</div>

A few points regarding gr-air-modes on OSX:

1. “ldconfig” does not exist on OSX. Apple’s DYLD manager “does the  
right thing” most of the time without having to be told that new  
libraries are available. One can tweak the DYLD manager behavior during  
runtime via various DYLD\_\* variables \<  
[https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man1/dyld.1.html](https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man1/dyld.1.html)

> … I encourage folks to set these variables just for a specific  
> execution, e.g,:  
> {{{  
> DYLD\_PRINT\_LIBRARIES=1 /opt/local/bin/python2.7  
> }}}  
> and so forth. Setting (e.g.) DYLD\_LIBRARY\_PATH to always include  
> /opt/local/lib is dangerous since generally a library knows which other  
> libraries it is linked to and it is those libraries that should be used,  
> not some identically named on that might not be ABI compatible.

1. I just added gr-air-modes to MacPorts \<  
[Making sure you're not a bot!](https://trac.macports.org/changeset/125643) \>, with a few patches to get  
things going. I’ll send a pull request to bistromath with the changes.  
This port should be live by around 11 AM US/Eastern this morning. You’ll  
want to “sudo port sync” at a minimum; “sudo port selfupdate” is almost  
always better.

2. Because GNU Radio now links on OSX with some @rpath libraries, it’s  
wise to set the RPATH too, not just the INSTALL\_NAME.

[“rpath” == “runtime path”; instead of specifying the exact library  
location, e.g. /opt/local/lib/libfoo.dylib, one uses the runtime path  
instead, e.g., @rpath/libfoo.dylib . This, in theory, allows the  
libraries using @rpath to be embedded within an application by setting  
the @rpath to be the absolute path to where those libraries are actually  
located.]

The addition is:  
{{{  
if(APPLE)  
if(NOT CMAKE\_INSTALL\_NAME\_DIR)  
set(CMAKE\_INSTALL\_NAME\_DIR  
${CMAKE\_INSTALL\_PREFIX}/${GR\_LIBRARY\_DIR} CACHE  
PATH “Library Install Name Destination Directory” FORCE)  
endif(NOT CMAKE\_INSTALL\_NAME\_DIR)  
if(NOT CMAKE\_INSTALL\_RPATH)  
set(CMAKE\_INSTALL\_RPATH  
${CMAKE\_INSTALL\_PREFIX}/${GR\_LIBRARY\_DIR} CACHE  
PATH “Library Install RPath” FORCE)  
endif(NOT CMAKE\_INSTALL\_RPATH)  
if(NOT CMAKE\_BUILD\_WITH\_INSTALL\_RPATH)  
set(CMAKE\_BUILD\_WITH\_INSTALL\_RPATH ON CACHE  
BOOL “Do Build Using Library Install RPath” FORCE)  
endif(NOT CMAKE\_BUILD\_WITH\_INSTALL\_RPATH)  
endif(APPLE)  
}}}

Hope this helps! - MLD

---

<div class="post-metadata">

**Author:** ![alanwatts](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/ad7895/32.png) [@alanwatts](https://www.ruby-forum.com/u/alanwatts)\
**Post date:** [September 24, 2014, 12:29am UTC](https://www.ruby-forum.com/t/ads-b-on-mac-10-9-possible-linking-error/232179/4 "2014-09-24T00:29:39Z")

</div>

Awesome, thanks for the report Alan, and thanks Michael for the package.  
Happy to incorporate any required changes.

–n  
On Sep 23, 2014 3:21 PM, “Alan W.” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![alanwatts](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/ad7895/32.png) [@alanwatts](https://www.ruby-forum.com/u/alanwatts)\
**Post date:** [September 24, 2014, 12:22am UTC](https://www.ruby-forum.com/t/ads-b-on-mac-10-9-possible-linking-error/232179/5 "2014-09-24T00:22:48Z")

</div>

Michael, Bastian

Many thanks for your help, the macports method has worked perfectly and  
I now have a working gr-air-modes with the rtl-sdr dongle.

Alan

---

<div class="post-metadata">

**Author:** ![alanwatts](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/ad7895/32.png) [@alanwatts](https://www.ruby-forum.com/u/alanwatts)\
**Post date:** [September 24, 2014, 3:31am UTC](https://www.ruby-forum.com/t/ads-b-on-mac-10-9-possible-linking-error/232179/6 "2014-09-24T03:31:29Z")

</div>

That’s great, Alan. Thanks for the feedback & have fun with your GNU  
Radio / RTL dongle setup. - MLD
