discuss-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Discuss-gnuradio] Building gnuradio with Pybombs on MacOSX


From: Sebastian Müller
Subject: Re: [Discuss-gnuradio] Building gnuradio with Pybombs on MacOSX
Date: Sat, 21 Oct 2017 08:40:35 -0700

Hi,

I’ve had a look on this and want to share what I found out. My setup is macOS 10.13 with MacPorts in /opt/local. I’ve used `pybombs install gnuradio` straight away and worked my way to a successful build from there. Please note that I have another GR installation from MacPorts, which means some dependencies may already be installed, but would fail to build from source in PyBombs.

First, I ran into PyBombs issue #423 (https://github.com/gnuradio/pybombs/issues/423). While Python dependencies are installed for 2.7, UHD then uses my default interpreter in /opt/local/bin/python, which is 3.5. Configuring then fails because mako is not found. This problem can be individually solved by installing the dependencies manually for the correct python version or forcing UHD to use 2.7 by using `FIND_PACKAGE(PythonInterp 2.7 REQUIRED)` in host/cmake/Modules/UHDPython.cmake. Still, this issue generally remains unsolved. After these changes, I was able to build UHD on my machine.

Next, GNU Radio failed to find Qt4 correctly. This is due to a MacPorts issue (https://trac.macports.org/ticket/49629) where no `qmake` executable is installed into any $PATH. I’ve solved this creating a symlink from /opt/local/libexec/qt4/bin/qmake to /opt/local/bin. After this change, Qt4 is found by cmake.

GNU Radio still failed to build because of a linking error `ld: library not found for -lgsl`. I had to make some changes as suggested by Peter, but found out Bastian has deleted them earlier in #1247 (https://github.com/gnuradio/gnuradio/pull/1247). I’ve created a new PR to further discuss this in #1490 (https://github.com/gnuradio/gnuradio/pull/1490). After this, I managed to build GNU Radio.

Still, GRC wouldn’t start because different python installations where used (I’m not sure which ones). By manually defining the paths as suggested by Brian, the build succeeds and GRC can actually be started. As a test, I ran gr-digital/examples/ofdm/ofdm_loopback.grc, which worked fine.

The complete cmake command now was (change CMAKE_INSTALL_PREFIX to your PyBombs prefix!):

`cmake .. -DCMAKE_INSTALL_PREFIX=[pybombs prefix] -DENABLE_GR_DTV=1 -DENABLE_GR_ATSC=1 -DPYTHON_EXECUTABLE=/opt/local/bin/python2.7 -DPYTHON_INCLUDE_DIR=/opt/local/Library/Frameworks/Python.framework/Versions/2.7/Headers -DPYTHON_LIBRARY=/opt/local/Library/Frameworks/Python.framework/Versions/2.7/Python -DSPHINX_EXECUTABLE=/opt/local/bin/rst2html-2.7.py`. 

Hope this helps us to make more progress with GR on Mac :)

Best,

Sebastian Müller
PGP ID DC2AA3EE

Am 25. Oktober 2016 um 18:51:14, Brian Cuthie (address@hidden) schrieb:


Hi Martin,

Please see my original post under this subject title. It contained a few other 'gotchas' I found when building for MacOSX using Pybombs.

-brian

Sent from my iPhone

> On Oct 25, 2016, at 11:41 AM, Martin Braun <address@hidden> wrote:
>
> Not quite related, but I would love to see PyBOMBS become a stable means
> for installation on Mac OS X. For other distros, I've started adding
> Docker containers for testing, but Mac OS obviously doesn't let us do that.
>
> Any specific bug report from installing on Mac is thus appreciated --
> and then of course, fixes :)
>
> Cheers,
> Martin
>
>> On 10/22/2016 03:12 PM, Brian Cuthie wrote:
>>
>> Hi Ron,
>>
>> That’s a great pointer, thanks. I hadn’t noticed that gr-fec also uses gsl.
>>
>> Looking at the CMake config for gr-fec I can see where it adds the path for libgsl, however, the path definition appears to be missing from the gr-dtv and gr-atsc configs. So while the link command for gr-fec includes "-L/opt/local/lib” to define where to find libgsl, the link commands for gr-atsc and gr-dtv do not and the link fails.
>>
>> Here’s the link command CMake spit out for gr-dtv swig:
>>
>> /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -std=c++98 -O2 -g -DNDEBUG -bundle -Wl,-headerpad_max_install_names -o _dtv_swig.so CMakeFiles/_dtv_swig.dir/dtv_swigPYTHON_wrap.cxx.o /opt/local/Library/Frameworks/Python.framework/Versions/2.7/Python ../lib/libgnuradio-dtv.3.7.11git.dylib ../../gr-analog/lib/libgnuradio-analog.3.7.11git.dylib ../../gr-filter/lib/libgnuradio-filter.3.7.11git.dylib ../../gr-fft/lib/libgnuradio-fft.3.7.11git.dylib /opt/local/lib/libfftw3f.dylib /opt/local/lib/libfftw3f_threads.dylib ../../gr-fec/lib/libgnuradio-fec.3.7.11git.dylib ../../gr-blocks/lib/libgnuradio-blocks.3.7.11git.dylib ../../gnuradio-runtime/lib/libgnuradio-runtime.3.7.11git.dylib ../../gnuradio-runtime/lib/pmt/libgnuradio-pmt.3.7.11git.dylib /opt/local/lib/libboost_date_time-mt.dylib /opt/local/lib/libboost_program_options-mt.dylib /opt/local/lib/libboost_filesystem-mt.dylib /opt/local/lib/libboost_system-mt.dylib /opt/local/lib/libboost_regex-mt.dylib /opt/local/lib/libboost_thread-mt.dylib /opt/local/lib/libboost_chrono-mt.dylib /opt/local/lib/libboost_atomic-mt.dylib /opt/local/lib/liblog4cpp.dylib -lgsl -lgslcblas -lm ../../volk/lib/libvolk.1.3.dylib /opt/local/lib/liborc-0.4.dylib -Wl,-rpath,/Users/brian/Projects/gnuradio/test/lib
>>
>> I can’t really figure why this builds for anyone else. Am I missing something?
>>
>> -brian
>>
>>
>>> On Oct 19, 2016, at 10:21 PM, Ron Economos <address@hidden> wrote:
>>>
>>> For the gr-dtv issue, it's probably because gr-dtv needs gr-fec for the Reed-Solomon encoder and decoder. But gr-fec needs libgsl for the LDPC stuff.
>>>
>>> If you look at the cmake output, it checks for libgsl right before configuring gr-fec. On my Ubuntu 16.04 box, it looks like this.
>>>
>>> -- Checking for module 'gsl >= 1.10'
>>> -- Found gsl , version 2.1
>>> -- Found GSL: gsl;gslcblas;m
>>> --
>>> -- Configuring gr-fec support...
>>> -- Dependency ENABLE_VOLK = ON
>>> -- Dependency Boost_FOUND = 1
>>> -- Dependency ENABLE_GNURADIO_RUNTIME = ON
>>> -- Dependency ENABLE_GR_BLOCKS = ON
>>> -- Dependency GSL_FOUND = TRUE
>>> -- Enabling gr-fec support.
>>> -- Override with -DENABLE_GR_FEC=ON/OFF
>>>
>>> You might as well leave gr-atsc disabled. All of it's functionality has been replicated in gr-dtv, and it's going away in Gnu Radio 3.8.
>>>
>>> Ron
>>>
>>>> On 10/19/2016 03:13 PM, Brian Cuthie wrote:
>>>> Greetings,
>>>>
>>>> After a few failures, I’ve been able to build gnuradio from source using pybombs on a Mac. But I ran into a some issues that I’m hoping someone can share their wisdom on.
>>>>
>>>> In no particular order:
>>>>
>>>> 1) gr-dtv and gr-atsc fail trying to link to libgsl.
>>>>
>>>> The libraries are installed, but there doesn’t seem to be any relevant path information on the link command line. I suspect this is a cmake configuration error, but I’m still finding my way around cmake and haven’t yet even been able to see where the cmake configuration requires gsl for those modules.
>>>>
>>>> I had to temporarily exclude gr-dtv and gr-atsc by adding the following to config_opt in the gnuradio.lwr recipe file:
>>>>
>>>> -DENABLE_GR_DTV=0
>>>> -DENABLE_GR_ATSC=0
>>>>
>>>> 2) On a successful build, gnuradio-companion crashed miserably because everything was not linked to the same python interpreter. Adding specific path definitions to the recipe fixed that problem.
>>>>
>>>> -DPYTHON_EXECUTABLE=/opt/local/bin/python2.7
>>>> -DPYTHON_INCLUDE_DIR=/opt/local/Library/Frameworks/Python.framework/Versions/2.7/Headers
>>>> -DPYTHON_LIBRARY=/opt/local/Library/Frameworks/Python.framework/Versions/2.7/Python
>>>> -DSPHINX_EXECUTABLE=/opt/local/bin/rst2html-2.7.py).
>>>>
>>>> I can see where this is a mac specific issue because with ports we end up with competing python interpreters (the one supplied with the system, and the one used by ports in /opt). Perhaps there’s a solution in cmake or a conditional configuration directive might be a useful enhancement to pybombs.
>>>>
>>>> 3) Thrift failed to build because it wanted to link to a static version of some boost libraries. But the default port install of boost doesn’t include the static version of its libraries. So I had to pre-install boost with the “-no_static” option. Again, this is a Mac specific thing. But a conditional directive in pybombs recipes might also help here.
>>>>
>>>> Any advice is welcome. Thanks in advance.
>>>>
>>>> -brian
>>>>
>>>>
>>>>
>>>>
>>>> _______________________________________________
>>>> Discuss-gnuradio mailing list
>>>> address@hidden
>>>> https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
>>>
>>>
>>> _______________________________________________
>>> Discuss-gnuradio mailing list
>>> address@hidden
>>> https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
>>
>> _______________________________________________
>> Discuss-gnuradio mailing list
>> address@hidden
>> https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
>>
>
> _______________________________________________
> Discuss-gnuradio mailing list
> address@hidden
> https://lists.gnu.org/mailman/listinfo/discuss-gnuradio

_______________________________________________
Discuss-gnuradio mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio

reply via email to

[Prev in Thread] Current Thread [Next in Thread]