Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix GSL link problem with gr-dtv and gr-atsc #1066

Closed
wants to merge 1 commit into from
Closed

fix GSL link problem with gr-dtv and gr-atsc #1066

wants to merge 1 commit into from

Conversation

horvathp
Copy link
Contributor

Fix build issues on OS X due to missing library path for libgsl in gr-dtv and gr-atsc.

@jmcorgan
Copy link
Contributor

Can you post the build/link output for when this fails?

@horvathp
Copy link
Contributor Author

https://lists.gnu.org/archive/html/discuss-gnuradio/2016-10/msg00186.html

I'm seeing the same (not macports but homebrew, i.e., it is not macports-specific)

A similar fix has been adopted for gr-fec:
c300392

@bastibl
Copy link
Member

bastibl commented Oct 23, 2016

AFAIS , this adds support to link with something like
-L<path> -lgsl
Wouldn't it be better to adapt FindGSL.cmake to use the full path for the library, i.e.,
-l<path>gsl.so
I think most other libraries also use the full path (QT, Python, ...).

@horvathp
Copy link
Contributor Author

Basti, I think if gsl is a dependency then the path to the gsl library needs to be propagated down (-Lxxx as you mention) to the respective modules (in this case specifically to the swig part). This is exactly what this patch does. The fact that these gnuradio modules compile on most Linux platforms is just a fortunate accident, it owes to the fact that on these systems libgsl.so will be found in the common lib directory (e.g., /usr/lib/x86_64-linux-gnu). That is not the case on OS X with macports or homebrew, where almost every library will be installed into a separate subdirectory.

On the other hand it is true that propagating the full path would be the desired behavior, as can be seen in the previously linked output for the boost libraries. However, baking in libXXX.so is not a good idea just because on OS X .dylib is the conventional extension (as far as I understand the OS X development model :)

The current findGSL.cmake is pretty complicated due to hacks related to non-gcc windows compilers. On OS X, exactly like under Linux, it will query
gsl-config --libs
to get the -Lxxx and -lxxx flags, which, in my case, yields
-L/usr/local/Cellar/gsl1/1.16/lib -lgsl -lgslcblas
exactly as seen on the linker command line before.

So I guess one can either stick with the current linux-style -lgsl stuff (which, as I learned, on OS X means linking with libgsl.dylib instead of libgsl.a) and ensure -Lxxx gets propagated down to every module that depends on gsl, or one has to add a specific clause to findGSL.cmake in order to bypass gsl-config or postprocess its output.

@jmcorgan
Copy link
Contributor

jmcorgan commented Oct 23, 2016

I think for now we can continue with the proposed fix, and take a look at how FindGSL.cmake works later.

Also, @horvathp, when submitting bug fixes, we ask that they be branched of the maint branch where possible and submitted with a distinct branch name, that is, not 'maint'.

For this one I'm going to cherry pick the commit manually onto maint, but please keep it in mind for next time, and thanks for the fix.

@horvathp
Copy link
Contributor Author

OK, I'll be more careful next time. Thanks, Jonathan.

@jmcorgan jmcorgan closed this Oct 23, 2016
@jmcorgan jmcorgan modified the milestone: Release 3.7.10.2 Nov 4, 2016
@bastibl bastibl mentioned this pull request Mar 22, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants