[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Discuss-gnuradio] ADS-B on Mac 10.9 - possible linking error
From: |
Alan Woodward |
Subject: |
Re: [Discuss-gnuradio] ADS-B on Mac 10.9 - possible linking error |
Date: |
Tue, 23 Sep 2014 18:21:13 -0400 |
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
On 23 Sep 2014, at 10:56, Michael Dickens <address@hidden> wrote:
> A few points regarding gr-air-modes on OSX:
>
> 0) "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
> > ... 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 <
> 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
>
> On Sep 23, 2014, at 7:51 AM, Bastian Bloessl <address@hidden> wrote:
>> On 23 Sep 2014, at 13:19, Alan Woodward <address@hidden> wrote:
>>> I am trying to build and use gr_air_modes built from
>>> 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 <module>
>>> 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.