Forum: GNU Radio GnuradioConfig.cmake not working properly ?

0817fa933c74eec9b3fcf3a04e16f418?d=identicon&s=25 Sylvain Munaut (Guest)
on 2013-11-10 17:24
(Received via mailing list)
Hi,


I'm having a couple of issues when trying to switch from
FindGnuradioRuntime to GnuradioConfig

1) GNURADIO_ALL_INCLUDE_DIRS (and possibly GNURADIO_ALL_LIBRARIES)
don't seem to be propagated propely.

I have ${GNURADIO_ALL_INCLUDE_DIRS} in include_directories(...) in the
top level CMakeFile but the path is not added and CMakeCache.txt has
no trace of that variable either.

If you install in /usr/local you might not notice ... but if you use a
prefixed install, the OOT module don't find the includes

2) No GNURADIO_ALL_LIBRARY_DIRS to set in link_directories(...). I
don't really know if it's needed since it doesn't even get to that
point due to the include issue above

3) Doesn't follow all the libraries requested by the .pc
    For ex, the .pc for gnuradio-runtime  asks for -lgnuradio-runtime
and -lgnuradio-pmt ... so it should automatically put both in
GNURADIO_RUNTIME_LIBRARIES but it doesn't.
    This causes issues for OSX for example. When using
FindGnuradioRuntime, I had to ship my own patched version that
followed all the libs. It's either that, or I need to specify 'PMT' as
a required component even though I don't use it ... (which then embeds
some GR interdependency knowledge in my own OOT projects ...)
GnuradioConfig

So am I doing something wrong that I get all theses issues ? Or isn't
anyone using GnuradioConfig ?
(I found myself wanting to use it because I now need the FFT
components linked in and didn't want to write a FindGnuradioFFT.cmake
...)

Cheers,

    Sylvain
0817fa933c74eec9b3fcf3a04e16f418?d=identicon&s=25 Sylvain Munaut (Guest)
on 2013-11-10 17:57
(Received via mailing list)
Attachment: fix-gnuradio-config.patch (3 KB)
> I'm having a couple of issues when trying to switch from
> FindGnuradioRuntime to GnuradioConfig

Attached a patch that deals with issue 1 & 3. Issue 2 doesn't seem to
be an issue since ALL_LIBRARIES has absolute path in it.

Cheers,

    Sylvain
C539637020fd56193dd6daec746c4a84?d=identicon&s=25 Tom Rondeau (Guest)
on 2013-11-11 20:42
(Received via mailing list)
On Sun, Nov 10, 2013 at 11:56 AM, Sylvain Munaut <246tnt@gmail.com>
wrote:
>> I'm having a couple of issues when trying to switch from
>> FindGnuradioRuntime to GnuradioConfig
>
> Attached a patch that deals with issue 1 & 3. Issue 2 doesn't seem to
> be an issue since ALL_LIBRARIES has absolute path in it.
>
> Cheers,
>
>     Sylvain


Thanks, Sylvain. I was actually working on a tutorial for gnuradio.org
to describe the use of GnuradioConfig when I noticed the exact same
issue with the _ALL_ variables. Your patch did the trick and has been
pushed.

Tom
0817fa933c74eec9b3fcf3a04e16f418?d=identicon&s=25 Sylvain Munaut (Guest)
on 2013-11-11 23:48
(Received via mailing list)
Hi Tom,

> Thanks, Sylvain. I was actually working on a tutorial for gnuradio.org
> to describe the use of GnuradioConfig when I noticed the exact same
> issue with the _ALL_ variables. Your patch did the trick and has been
> pushed.

Great.

I updated gr-fosphor to use the new stuff. But for now I use a
"bundled" version (renamed FindGnuradio inside the OOT so that it has
precedence over the system-wide GnuradioConfig) Once 3.7.3 has been
out for some time and I can reasonably expect people to be up to date,
I'll remove it and let the system one do the job.

Cheers,

    Sylvain

PS: BTW, in the tutorial, maye it should be "find_package(Gnuradio
3.7.2 REQUIRED)" or it will just be a warning but still try (and fail)
to build ...
0817fa933c74eec9b3fcf3a04e16f418?d=identicon&s=25 Sylvain Munaut (Guest)
on 2013-11-12 18:55
(Received via mailing list)
Attachment: gnuradioconfig-make-global.diff (548 Bytes)
Hi Tom,


I'm afraid my patch broke something :(  gr-osmosdr and probably some
other OOT projects that were using GnuradioConfig but without using
the _ALL_ variable but using the individual ones.

Turns out that after the patch, GNURADIO_XXX_LIBRARIES is no longer
directly build from find_library, but from a custom foreach loop (to
build up the proper list)

But that also mean that it's scope is not restricted to the function
and is not global and so not available elsewhere.

The attached patch fixes that by re-declaring the variable in the parent
scope.

This fixes the gr-osmosdr build for me.
@Martin : could you give it a shot to check it fixes it for you too ?


Cheers,

    Sylvain
Ad80d352eb445a3d7dccd5a779db0e43?d=identicon&s=25 Martin Braun (CEL) (Guest)
on 2013-11-12 19:29
(Received via mailing list)
On Tue, Nov 12, 2013 at 06:54:43PM +0100, Sylvain Munaut wrote:
> The attached patch fixes that by re-declaring the variable in the parent scope.
>
> This fixes the gr-osmosdr build for me.
> @Martin : could you give it a shot to check it fixes it for you too ?

Yep, this fixes gr-osmosdr on my side.

MB

--
Karlsruhe Institute of Technology (KIT)
Communications Engineering Lab (CEL)

Dipl.-Ing. Martin Braun
Research Associate

Kaiserstra├če 12
Building 05.01
76131 Karlsruhe

Phone: +49 721 608-43790
Fax: +49 721 608-46071
www.cel.kit.edu

KIT -- University of the State of Baden-W├╝rttemberg and
National Laboratory of the Helmholtz Association
C539637020fd56193dd6daec746c4a84?d=identicon&s=25 Tom Rondeau (Guest)
on 2013-11-13 17:23
(Received via mailing list)
On Tue, Nov 12, 2013 at 1:28 PM, Martin Braun (CEL)
<martin.braun@kit.edu> wrote:
> On Tue, Nov 12, 2013 at 06:54:43PM +0100, Sylvain Munaut wrote:
>> The attached patch fixes that by re-declaring the variable in the parent scope.
>>
>> This fixes the gr-osmosdr build for me.
>> @Martin : could you give it a shot to check it fixes it for you too ?
>
> Yep, this fixes gr-osmosdr on my side.
>
> MB


Patches applied. I also updated the OOT tutorial to use REQUIRED and
gr-modtool now defaults to using the GnuradioConfig style checks with
REQUIRED as well.

Thanks!

Tom
D9b2772a9387f5dbe010dbc0c3a93f8d?d=identicon&s=25 Douglas Geiger (Guest)
on 2013-11-14 18:26
(Received via mailing list)
I think that needs to be applied to the maint branch as well: i.e.
Sylvain's first patch got applied to both master and maint, but the fix
(second patch) only ended up on master.
 Doug
C539637020fd56193dd6daec746c4a84?d=identicon&s=25 Tom Rondeau (Guest)
on 2013-11-14 18:48
(Received via mailing list)
On Thu, Nov 14, 2013 at 12:25 PM, Douglas Geiger
<doug.geiger@bioradiation.net> wrote:
> I think that needs to be applied to the maint branch as well: i.e. Sylvain's
> first patch got applied to both master and maint, but the fix (second patch)
> only ended up on master.
>  Doug

Thanks for catching that. Since I had done some other changes to how
GnuradioConfig is used, I thought I only put that on master. Fixed
now.

Tom
Please log in before posting. Registration is free and takes only a minute.
Existing account

NEW: Do you have a Google/GoogleMail, Yahoo or Facebook account? No registration required!
Log in with Google account | Log in with Yahoo account | Log in with Facebook account
No account? Register here.