Building new blocks in Gnu Radio

Hi all,

I am new in GNU Radio and i have recently learned how to make new
blocks in gnuradio. I have successfully made .h .cc and .i files, now
the problem im facing is how to build them to use the newly created
files.

Any help for this problem will be highly welcomed.
Thanx in advance

Regards,
Ebtisam

Hi Ebtisam,

if you’ve succeeded in making the blocks, I seriously doubt you’ve read
all the intro stuff on the website (e.g. “Using GNU Radio”).

MB

On Sun, Mar 25, 2012 at 09:38:31PM +0500, Ebtisam Ahmed wrote:

Regards,
Ebtisam


Discuss-gnuradio mailing list
[email protected]
Discuss-gnuradio Info Page


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

Dipl.-Ing. Martin B.
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

Indeed i have read but i cant understand the building process. I built
it the i understood but it failed terribly, i have made .h .cc .i and
makefile.am. Put them in one folder and then done make. i also tried
./configure and ./bootstrap but it doesnt work

Anyways thanx for ur time and help me on this…

Regards,
Ebtisam

I think that the best way to get started is to use Martins gr-modtool.
It will help you to make out-of-tree blocks (out-of-tree means
separate but compatible with your main gnuradio installation).

It can be found at:

Ben R. <ben reynwar.net> writes:

I think that the best way to get started is to use Martins gr-modtool.
It will help you to make out-of-tree blocks (out-of-tree means
separate but compatible with your main gnuradio installation).

It can be found at:
GitHub - mbr0wn/gr-modtool: Keeping this repo, for now, for archeaological purposes.

On Mon, Mar 26, 2012 at 2:58 AM, Ebtisam Ahmed <ebtisamahmed90 gmail.com>
wrote:


Discuss-gnuradio mailing list
Discuss-gnuradio gnu.org
Discuss-gnuradio Info Page

Hi all,

I’ve decided to follow your suggestion and get gr_modtool.py.

First I created the module with this script which created some folders,
files
and the .cc and .h files with skeleton code.

Then I put my code in the .cc and .h files. I also changed the .xml file
so I
can use GRC (I haven’t used python yet to create graphs).

After this, I used cmake. I wrote:

cmake -i
sudo make
sudo make install
sudo ldconfig

These were my steps to build a new block to use in GRC. However, I get
this
error:

ImportError: /usr/local/lib/python2.7/dist-
packages/mycoolstuff/_mycoolstuff_swig.so: undefined symbol:
_Z38mycoolstuff_make_decimated_average_vccifi

Yes. My module and block are called mycoolstuff and
decimated_average_vcc.cc

It seems that there is a problem with the swig. Do I have to configure
anything
in the .i files before starting to use cmake?

Regards,
Francisco

On Mon, Mar 26, 2012 at 10:42 AM, Francisco
[email protected] wrote:

On Mon, Mar 26, 2012 at 2:58 AM, Ebtisam Ahmed <ebtisamahmed90 gmail.com>

First I created the module with this script which created some folders, files

in the .i files before starting to use cmake?

Regards,
Francisco


Discuss-gnuradio mailing list
[email protected]
Discuss-gnuradio Info Page

It looks like there is currently a bug in gr-modtool where when you
generate a new block it gets the module and block name wrong way
round.

Nick F. wrote in post #1053430:

On Mon, Mar 26, 2012 at 10:42 AM, Francisco
[email protected]wrote:

On Mon, Mar 26, 2012 at 2:58 AM, Ebtisam Ahmed <ebtisamahmed90

Ebtisam

sudo make
Yes. My module and block are called mycoolstuff and
decimated_average_vcc.cc

It seems that there is a problem with the swig. Do I have to configure
anything
in the .i files before starting to use cmake?

My guess is you haven’t declared your functions as API exports. There
should be a file in your module called include/mycoolstuff_api.h, which
should be #included by your block implementations and the public
constructor declared like this:

MYCOOLSTUFF_API mycoolstuff_make_decimated_average(…) {}

This will export the symbol so it gets called out in the library.

–n

This worked. Thanks

I wonder why something so simple wasn’t made in the gr_modtools.py

On Mon, Mar 26, 2012 at 10:42 AM, Francisco
[email protected]wrote:

On Mon, Mar 26, 2012 at 2:58 AM, Ebtisam Ahmed <ebtisamahmed90

Ebtisam

sudo make
Yes. My module and block are called mycoolstuff and
decimated_average_vcc.cc

It seems that there is a problem with the swig. Do I have to configure
anything
in the .i files before starting to use cmake?

My guess is you haven’t declared your functions as API exports. There
should be a file in your module called include/mycoolstuff_api.h, which
should be #included by your block implementations and the public
constructor declared like this:

MYCOOLSTUFF_API mycoolstuff_make_decimated_average(…) {}

This will export the symbol so it gets called out in the library.

–n

On Mon, Mar 26, 2012 at 12:54 PM, Ben R. [email protected] wrote:

GitHub - mbr0wn/gr-modtool: Keeping this repo, for now, for archeaological purposes.

Regards,
I’ve decided to follow your suggestion and get gr_modtool.py.
sudo make install

Discuss-gnuradio Info Page

It looks like there is currently a bug in gr-modtool where when you
generate a new block it gets the module and block name wrong way
round.

There’s no bug. I’m just incompetent.

On Mon, Mar 26, 2012 at 10:42 AM, Francisco
[email protected] wrote:

On Mon, Mar 26, 2012 at 2:58 AM, Ebtisam Ahmed <ebtisamahmed90 gmail.com>

First I created the module with this script which created some folders, files

in the .i files before starting to use cmake?

The only thing that ‘must’ be edited are the gr_make_io_signature
arguments in the .cc file, although without editing the work function
you won’t get much signal processing going on.
All the swig stuff should be taken care of by gr-modtool.

You can test whether it’s working in python by doing:
from mycoolstuff import decimated_average_vcc
that way you can get it working without worrying about the grc stuff.

On Mon, Mar 26, 2012 at 12:27:42PM -0700, Nick F. wrote:

After this, I used cmake. I wrote:
>cmake -i
>sudo make
>sudo make install
>sudo ldconfig

I assume you know what you’re doing, but just in case someone reads this
who doesn’t, the recommended way is

mkdir build
cd build
cmake …/
make # This is what I mean
sudo make install
sudo ldconfig

So don’t run make as root (permissions and so on).

It seems that there is a problem with the swig. Do I have to configure

This will export the symbol so it gets called out in the library.
If you use gr_modtool.py, it will take care of this.

MB


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

Dipl.-Ing. Martin B.
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

PLEASE someone may explain to us step by step how to activate a block on
grc that created gr_modtool. when we created a block with “gr_modtool.py
create example” module appers, than if i have a python code what should
i do? what should we change or not?

Martin B. wrote in post #1053291:

Hi Ebtisam,

if you’ve succeeded in making the blocks, I seriously doubt you’ve read
all the intro stuff on the website (e.g. “Using GNU Radio”).

MB

On Sun, Mar 25, 2012 at 09:38:31PM +0500, Ebtisam Ahmed wrote:

Regards,
Ebtisam


Discuss-gnuradio mailing list
[email protected]
Discuss-gnuradio Info Page


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

Dipl.-Ing. Martin B.
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

Hey I am facing problem with qa test in
writing new block here is the error msg while executing ctest -V

jayram@pc:~/Desktop/gr-test/build$ ctest -V
UpdateCTestConfiguration from
:/home/jayram/Desktop/gr-test/build/DartConfiguration.tcl
UpdateCTestConfiguration from
:/home/jayram/Desktop/gr-test/build/DartConfiguration.tcl
Test project /home/jayram/Desktop/gr-test/build
Constructing a list of tests
Done constructing a list of tests
Checking test dependency graph…
Checking test dependency graph end
test 1
Start 1: test_test

1: Test command: /bin/sh
“/home/jayram/Desktop/gr-test/build/lib/test_test_test.sh”
1: Test timeout computed to be: 9.99988e+06
1:
1:
1/2 Test #1: test_test … Passed 0.00 sec
test 2
Start 2: qa_square_ff

2: Test command: /bin/sh
“/home/jayram/Desktop/gr-test/build/python/qa_square_ff_test.sh”
2: Test timeout computed to be: 9.99988e+06
2: Traceback (most recent call last):
2: File “/home/jayram/Desktop/gr-test/python/qa_square_ff.py”, line
22, in
2: import test_swig as test
2: File “/home/jayram/Desktop/gr-test/build/swig/test_swig.py”, line
314, in
2: square_ff = square_ff.make;
2: NameError: name ‘square_ff’ is not defined
2/2 Test #2: qa_square_ff …***Failed 0.25 sec

50% tests passed, 1 tests failed out of 2

Total Test time (real) = 0.26 sec

The following tests FAILED:
2 - qa_square_ff (Failed)
Errors while running CTest

Can you help me to rectify this problem as I need it to resolve it
urgently.

Thanks