# Grc block definition directories

**URL:** <https://www.ruby-forum.com/t/grc-block-definition-directories/208205>\
**Category:** GNU Radio\
**Created:** [June 12, 2011, 4:17am UTC](https://www.ruby-forum.com/t/grc-block-definition-directories/208205 "2011-06-12T04:17:34Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![luislavena](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/0ea827/32.png) [@luislavena](https://www.ruby-forum.com/u/luislavena)\
**Post date:** [June 12, 2011, 4:17am UTC](https://www.ruby-forum.com/t/grc-block-definition-directories/208205/1 "2011-06-12T04:17:34Z")

</div>

I notice that in some directories (eg, gr-noaa, gr-pager) there is a grc  
subdirectory with the corresponding definitions, while for others the  
definitions are in the grc/blocks directory.

Is there a specific reason for one vs the other option?  
Which one is the preferred method?

I want to add some grc block defs for the newly added pccc  
and sccc encoders/decoders in gr-trellis and would prefer a  
grc subdir inside gr-trellis.  
If there is no objection, can someone generate it and put inside the  
already existing grc defs from grc/blocks.  
I would do it myself but don’t know what other files need to be  
changed…

BTW, I also see a discrepancy in the way swig files are handled:  
some are in the swig subdir while other inside src/lib.  
Is there a prefered way to do this as well???

thanks  
Achilleas

---

<div class="post-metadata">

**Author:** ![Achilleas\_A](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/74df32/32.png) [@Achilleas\_A](https://www.ruby-forum.com/u/Achilleas_A)\
**Post date:** [June 12, 2011, 4:28am UTC](https://www.ruby-forum.com/t/grc-block-definition-directories/208205/2 "2011-06-12T04:28:38Z")

</div>

On 06/11/2011 07:16 PM, Achilleas A. wrote:

> I notice that in some directories (eg, gr-noaa, gr-pager) there is a grc  
> subdirectory with the corresponding definitions, while for others the  
> definitions are in the grc/blocks directory.

I did the cmake’ification of gr-trellis after those files were added and  
I was just thinking about the organization. 🙂

> Is there a specific reason for one vs the other option?  
> Which one is the preferred method?

It seems that there is an unofficial new standard for a gnuradio  
component (gr-uhd, gr-noaa, gr-audio, gr-pager, a few others…)

Its a flat directory structure inside the component directory.

/lib - for the cc files, private headers, and maybe public  
/include - if you feel like separating the public header files  
/swig - swig .i files and swig generation  
/python - python modules and often the swig module’s **init**.py  
/grc - grc xml block wrappers  
/apps - apps installed into the runtime/bin directory  
/examples - examples installed into the share directory

> I want to add some grc block defs for the newly added pccc  
> and sccc encoders/decoders in gr-trellis and would prefer a  
> grc subdir inside gr-trellis.  
> If there is no objection, can someone generate it and put inside the  
> already existing grc defs from grc/blocks.  
> I would do it myself but don’t know what other files need to be changed…

1. Move the .xml files from grc/blocks to gr-trellis/grc.
2. Remove the entries from grc/blocks/Makefile.am
3. Remove the entries from grc/blocks/block\_tree.xml  
4a) Either add tags to the blocks  
4b) Or create a gr-trellis/grc/trellis\_block\_tree.xml

> BTW, I also see a discrepancy in the way swig files are handled:  
> some are in the swig subdir while other inside src/lib.  
> Is there a prefered way to do this as well???

Its way easier to follow when its under its own swig directory and not  
lib.

-Josh

---

<div class="post-metadata">

**Author:** ![Achilleas\_A](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/74df32/32.png) [@Achilleas\_A](https://www.ruby-forum.com/u/Achilleas_A)\
**Post date:** [June 12, 2011, 11:32pm UTC](https://www.ruby-forum.com/t/grc-block-definition-directories/208205/3 "2011-06-12T23:32:43Z")

</div>

On Sat, Jun 11, 2011 at 10:27 PM, Josh B. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > Is there a specific reason for one vs the other option?  
> > Which one is the preferred method?
> 
> It seems that there is an unofficial new standard for a gnuradio  
> component (gr-uhd, gr-noaa, gr-audio, gr-pager, a few others…)

It’s not unofficial. It’s the official, if under-documented, new  
directory  
structure.

Tom
