# Gnuradio questions

**URL:** <https://www.ruby-forum.com/t/gnuradio-questions/230814>\
**Category:** GNU Radio\
**Created:** [July 7, 2014, 11:47am UTC](https://www.ruby-forum.com/t/gnuradio-questions/230814 "2014-07-07T11:47:39Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![addis\_a](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/c4cdca/32.png) [@addis\_a](https://www.ruby-forum.com/u/addis_a)\
**Post date:** [July 7, 2014, 11:47am UTC](https://www.ruby-forum.com/t/gnuradio-questions/230814/1 "2014-07-07T11:47:39Z")

</div>

Goodmorning,  
I’m a PhD student working with gnuradio in ubuntu.  
The motivation for which I need to write is regarded to how gnuradio  
treats  
a project flow graph to make it as an application program, I have  
searched  
over internet and various forum but I have not find nothing.

Consider that I have a gnuradio flow graph that works fine, and also, I  
have the top\_block.py that works fine, when imparting ./top\_block.py  
from  
the terminal.

My questions:

Is “top\_block.py” my final application program? ( for example, is the  
executable “.exe” file equivalent in windows )

I would use this file as an independent program, running it in an other  
pc  
where gnuradio is not installed, is it possible? or Have I need some  
tools  
( for example, at least python installed ).

Last, Is it possible to estimate the execution time of a specific block  
in  
a gnuradio flow graph?

If there are documentation that I have missed in the net, please give me  
the reference…  
I think for you these are simple questions, but I’m at the beginning and  
gnuradio is a beautiful environment, I will learn!

Thank you for your help in advance,

Sincerely,  
Simone Ciccia,  
PhD student,  
electronic engineering,  
Antenna and EMC lab,  
Politechnic of Turin, Italy

---

<div class="post-metadata">

**Author:** ![Simone\_Ciccia\_S2106](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/e495f1/32.png) [@Simone\_Ciccia\_S2106](https://www.ruby-forum.com/u/Simone_Ciccia_S2106)\
**Post date:** [July 7, 2014, 12:26pm UTC](https://www.ruby-forum.com/t/gnuradio-questions/230814/2 "2014-07-07T12:26:24Z")

</div>

On Mon, Jul 7, 2014 at 3:16 PM, Simone Ciccia S210664 \<  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)\> wrote:

> My questions:
> 
> Is “top\_block.py” my final application program? ( for example, is the  
> executable “.exe” file equivalent in windows )
> 
> I would use this file as an independent program, running it in an other pc  
> where gnuradio is not installed, is it possible? or Have I need some tools  
> ( for example, at least python installed ).

I am not aware of the exact answer to your question. Here is what I  
think.

Since the top\_block.py is a python program it will require at least  
python  
interpreter. When you run top\_block.py, it usually imports modules from  
GNU  
Radio. So if you run it on a machine without GNU Radio installed, python  
will complain saying that it can not import modules required for your  
application.

May be there are ways to generate a standalone executable. But the  
top\_block.py is not a standalone executable. I hope someone out there  
knows  
a better answer to your question.

> Discuss-gnuradio mailing list  
> [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
> [Discuss-gnuradio Info Page](https://lists.gnu.org/mailman/listinfo/discuss-gnuradio)

Regards

---

<div class="post-metadata">

**Author:** ![Simone\_Ciccia\_S2106](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/e495f1/32.png) [@Simone\_Ciccia\_S2106](https://www.ruby-forum.com/u/Simone_Ciccia_S2106)\
**Post date:** [July 7, 2014, 12:37pm UTC](https://www.ruby-forum.com/t/gnuradio-questions/230814/3 "2014-07-07T12:37:09Z")

</div>

Hello Simone,  
On 07.07.2014 11:46, Simone Ciccia S210664 wrote:

> Goodmorning,  
> I’m a PhD student working with gnuradio in ubuntu.  
> The motivation for which I need to write is regarded to how gnuradio treats  
> a project flow graph to make it as an application program, I have searched  
> over internet and various forum but I have not find nothing.  
> Ok, so your flow graph is actually “just” blocks connected together.  
> Most of the “magic” happens in these blocks, which simply are wrappers  
> for a specific method (general\_work) which gets called upon input data  
> and produces output data. GNU Radio’s core job is to keep these blocks  
> called and ensure that data is in the right place at the right time and  
> call these blocks.  
> Consider that I have a gnuradio flow graph that works fine, and also, I  
> have the top\_block.py that works fine, when imparting ./top\_block.py from  
> the terminal.  
> Ah, so you’ve actually seen a GNU Radio application in action! Sounds  
> like you generated a python file from the GNU Radio companion, where  
> flow graphs are represented in a graphical manner. If you look at  
> top\_block.py you will find a bunch of “connect()” calls, and these match  
> the connections you drew in GRC. This is how GNU Radio sees the  
> flowgraph: Constructed from block class instances, their in- and outputs  
> connected by connect.  
> Somewhere at the end of the file, you see a “top\_block.start()” or  
> “.run()”; this is where GNU Radio takes over and starts calling blocks’  
> work functions to get the data running through the flow graph.
> 
> My questions:
> 
> Is “top\_block.py” my final application program? ( for example, is the  
> executable “.exe” file equivalent in windows )  
> Yes.  
> I would use this file as an independent program, running it in an other pc  
> where gnuradio is not installed, is it possible? or Have I need some tools  
> ( for example, at least python installed ).  
> Well, when running a GNU Radio program you will need GNU Radio. Under  
> certain circumstances, you can get away with statically linking all the  
> used GNU Radio functionality into your executable, but when using  
> python, this is never the case.  
> So for all means, GNU Radio is only a library that your program uses;  
> it’s a mighty library. You have to have that library when you want to  
> run a program. This is like every other library out there, you can’t for  
> example execute a program that uses the QT library to generate graphical  
> interfaces without having the QT library on the target computer.  
> That is why windows software usually comes with an installer that  
> installs a load of application-necessary libraries, that are not  
> directly part of the software you are using, but are used by it. Under  
> most linux distributions, library dependencies are handled by package  
> management, so you just install let’s say firefox and your system  
> installs all the necessary libraries itself.  
> Last, Is it possible to estimate the execution time of a specific block in  
> a gnuradio flow graph?  
> Yes, you can measure it. Have a look at the “performance counters”  
> subpage on [1].  
> If there are documentation that I have missed in the net, please give me  
> the reference…  
> I think the working principle is explained on [gnuradio.org](http://gnuradio.org) in the “what  
> is GNU Radio and Why do I want it” article among with the beginners’  
> Tutorials on the “Tutorials” page.  
> I consider [gnuradio.org](http://gnuradio.org) to be the only /reliable/ source on how GNU  
> Radio works and for beginners’ tutorials, all the other sites will be  
> outdated quite fast.  
> I think for you these are simple questions, but I’m at the beginning and  
> gnuradio is a beautiful environment, I will learn!  
> I hope that it serves your purposes well 🙂

Happy hacking,  
Marcus

[1] [GNU Radio Manual and C++ API Reference: Main Page](http://gnuradio.org/doc/doxygen/)

---

<div class="post-metadata">

**Author:** ![Simone\_Ciccia\_S2106](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/e495f1/32.png) [@Simone\_Ciccia\_S2106](https://www.ruby-forum.com/u/Simone_Ciccia_S2106)\
**Post date:** [July 7, 2014, 6:34pm UTC](https://www.ruby-forum.com/t/gnuradio-questions/230814/4 "2014-07-07T18:34:09Z")

</div>

> May be there are ways to generate a standalone executable.

I do this on windows, if you are looking to distribute binaries then  
re-write the python flow-graph in C++, then compile and you will get a  
portable binary exe, if the other system does not have Gnuradio then  
just  
include the gnuradio\*.dll’s with it. Follow the windows native CMake  
build  
guide to generate those. If you want to stay in linux then it will be  
libgnuradio-\*.so’s.

> Last, Is it possible to estimate the execution time of a specific block in  
> a gnuradio flow graph?

You can look into ‘gnuradio performance counters’.
