Accessing gr-blocks, gr-filter, gr-digital, etc. in out-of-tree module

How does one setup cmake to find gr-blocks, gr-filter, etc. in
out-of-tree modules? Is there already a cmake routine for this, or
should I copy /cmake/Modules/FindGnuradioCore.cmake and plug
in the right names?

–sean

On Thu, Apr 18, 2013 at 12:15 PM, Sean Nowlan
[email protected] wrote:

How does one setup cmake to find gr-blocks, gr-filter, etc. in out-of-tree
modules? Is there already a cmake routine for this, or should I copy
/cmake/Modules/FindGnuradioCore.cmake and plug in the right
names?

–sean

There’s a new FindGnuradio.cmake script, and I’m working on improving
it to make it more usable by out of tree projects exactly for this
purpose. You set(GR_REQUIRED_MODULES …) and list, in all caps, which
components you want (RUNTIME, BLOCKS, FILTER, etc). It will find them,
setup some variables, and fail if they aren’t installed on your
system. If you don’t set this variable, it defaults to searching for
everything.

As I said, though, I’m working on it to make it more easily usable, so
some things about it might change. Also, can’t remember if this is in
master or just on next off the top of my head…

Tom

On 04/18/2013 12:28 PM, Tom R. wrote:

purpose. You set(GR_REQUIRED_MODULES …) and list, in all caps, which
components you want (RUNTIME, BLOCKS, FILTER, etc). It will find them,
setup some variables, and fail if they aren’t installed on your
system. If you don’t set this variable, it defaults to searching for
everything.
So this sets up both include and linker paths? I’ve been trying to
update some code to the new namespace-based API. I can compile OK but
I’m getting “symbol not found” errors when importing from swig. It’s
possible the swig files aren’t right, but I modeled them after the
output of gr_modtool. I suspect there’s a linking issue.
As I said, though, I’m working on it to make it more easily usable, so
some things about it might change. Also, can’t remember if this is in
master or just on next off the top of my head…
I found it in ‘next’.
Tom
–sean

On 04/22/2013 11:59 AM, Sean Nowlan wrote:

There’s a new FindGnuradio.cmake script, and I’m working on improving
output of gr_modtool. I suspect there’s a linking issue.
That should read: I’m getting “ImportError: […] undefined symbol”
errors whenever I import the package. Everything compiles including SWIG
wrapper file.

On Mon, Apr 22, 2013 at 6:21 PM, Sean Nowlan
[email protected] wrote:

That should read: I’m getting “ImportError: […] undefined symbol” errors
whenever I import the package. Everything compiles including SWIG wrapper
file.

Ok, solved my problem. It turns out I hadn’t declared member functions as
pure virtual (i.e., “virtual xyz f() = 0”) in the public header file.

Sean,

Great that you got it all cleared up! We’ll be improving the cmake
find_package for GNU Radio before the release, for sure, but it looks
like it’s mostly working. Probably mostly needs to be

Could you maybe update the wiki on issues to consider when upgrading
to 3.7 for what you had to do here? It’s useful to keep tabs on things
people might consider when upgrading their projects.

http://gnuradio.org/redmine/projects/gnuradio/wiki/Move_3-6_to_3-7

Thanks!
Tom

On 04/22/2013 02:49 PM, Sean Nowlan wrote:

On 04/22/2013 11:59 AM, Sean Nowlan wrote:

So this sets up both include and linker paths? I’ve been trying to
update some code to the new namespace-based API. I can compile OK but
I’m getting “symbol not found” errors when importing from swig. It’s
possible the swig files aren’t right, but I modeled them after the
output of gr_modtool. I suspect there’s a linking issue.

That should read: I’m getting “ImportError: […] undefined symbol”
errors whenever I import the package. Everything compiles including
SWIG wrapper file.

Ok, solved my problem. It turns out I hadn’t declared member functions
as pure virtual (i.e., “virtual xyz f() = 0”) in the public header file.

On 04/22/2013 10:03 PM, Tom R. wrote:

Sean, Great that you got it all cleared up! We’ll be improving the
cmake find_package for GNU Radio before the release, for sure, but it
looks like it’s mostly working. Probably mostly needs to be Could you
maybe update the wiki on issues to consider when upgrading to 3.7 for
what you had to do here? It’s useful to keep tabs on things people
might consider when upgrading their projects.
http://gnuradio.org/redmine/projects/gnuradio/wiki/Move_3-6_to_3-7
Thanks! Tom

I updated the following:

http://gnuradio.org/redmine/projects/gnuradio/wiki/Move_3-6_to_3-7
http://gnuradio.org/redmine/projects/gnuradio/wiki/OutOfTreeModules

Please let me know if you want me to add to or change my edits, or feel
free to edit as you see fit.

–sean