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

**URL:** <https://www.ruby-forum.com/t/accessing-gr-blocks-gr-filter-gr-digital-etc-in-out-of-tree-module/228341>\
**Category:** GNU Radio\
**Created:** [April 18, 2013, 6:16pm UTC](https://www.ruby-forum.com/t/accessing-gr-blocks-gr-filter-gr-digital-etc-in-out-of-tree-module/228341 "2013-04-18T18:16:30Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sean\_Nowlan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/e56c9b/32.png) [@Sean\_Nowlan](https://www.ruby-forum.com/u/Sean_Nowlan)\
**Post date:** [April 18, 2013, 6:16pm UTC](https://www.ruby-forum.com/t/accessing-gr-blocks-gr-filter-gr-digital-etc-in-out-of-tree-module/228341/1 "2013-04-18T18:16:30Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Sean\_Nowlan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/e56c9b/32.png) [@Sean\_Nowlan](https://www.ruby-forum.com/u/Sean_Nowlan)\
**Post date:** [April 18, 2013, 6:29pm UTC](https://www.ruby-forum.com/t/accessing-gr-blocks-gr-filter-gr-digital-etc-in-out-of-tree-module/228341/2 "2013-04-18T18:29:56Z")

</div>

On Thu, Apr 18, 2013 at 12:15 PM, Sean Nowlan  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) 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

---

<div class="post-metadata">

**Author:** ![Sean\_Nowlan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/e56c9b/32.png) [@Sean\_Nowlan](https://www.ruby-forum.com/u/Sean_Nowlan)\
**Post date:** [April 22, 2013, 6:01pm UTC](https://www.ruby-forum.com/t/accessing-gr-blocks-gr-filter-gr-digital-etc-in-out-of-tree-module/228341/3 "2013-04-22T18:01:06Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Sean\_Nowlan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/e56c9b/32.png) [@Sean\_Nowlan](https://www.ruby-forum.com/u/Sean_Nowlan)\
**Post date:** [April 22, 2013, 8:51pm UTC](https://www.ruby-forum.com/t/accessing-gr-blocks-gr-filter-gr-digital-etc-in-out-of-tree-module/228341/4 "2013-04-22T20:51:06Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Sean\_Nowlan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/e56c9b/32.png) [@Sean\_Nowlan](https://www.ruby-forum.com/u/Sean_Nowlan)\
**Post date:** [April 23, 2013, 4:05am UTC](https://www.ruby-forum.com/t/accessing-gr-blocks-gr-filter-gr-digital-etc-in-out-of-tree-module/228341/5 "2013-04-23T04:05:14Z")

</div>

On Mon, Apr 22, 2013 at 6:21 PM, Sean Nowlan  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) 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](http://gnuradio.org/redmine/projects/gnuradio/wiki/Move_3-6_to_3-7)

Thanks!  
Tom

---

<div class="post-metadata">

**Author:** ![Sean\_Nowlan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/e56c9b/32.png) [@Sean\_Nowlan](https://www.ruby-forum.com/u/Sean_Nowlan)\
**Post date:** [April 23, 2013, 12:22am UTC](https://www.ruby-forum.com/t/accessing-gr-blocks-gr-filter-gr-digital-etc-in-out-of-tree-module/228341/6 "2013-04-23T00:22:39Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Sean\_Nowlan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/e56c9b/32.png) [@Sean\_Nowlan](https://www.ruby-forum.com/u/Sean_Nowlan)\
**Post date:** [April 23, 2013, 2:05pm UTC](https://www.ruby-forum.com/t/accessing-gr-blocks-gr-filter-gr-digital-etc-in-out-of-tree-module/228341/7 "2013-04-23T14:05:47Z")

</div>

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](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/Move_3-6_to_3-7)  
[http://gnuradio.org/redmine/projects/gnuradio/wiki/OutOfTreeModules](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
