Cannot make new signal processing block

Hi all,

I am currently following the instructions for building new signal
processing
block. I have downloaded complete folder as it was stated. The problem
is
when I enter folder topdir/src.python and run make check I have the
following error:

[[email protected] python]$ make check
make: *** No rule to make target `check’. Stop.

Thanks in advance


View this message in context:
http://gnuradio.4.n7.nabble.com/cannot-make-new-signal-processing-block-tp37924.html
Sent from the GnuRadio mailing list archive at Nabble.com.

Hi all,

in fact, I was following instructions from

http://www.gnu.org/software/gnuradio/doc/howto-write-a-block.html

And the problem was bad reference to the PKG_CONFIG_PATH.

I see that in the instructions you sent me and inistructions that I was
following, building folders are different.

Hi nexy_sm,

read again:
http://gnuradio.org/redmine/projects/gnuradio/wiki/OutOfTreeModules

The command ‘make check’ is nowhere in the instructions for building a
new signal processing block.

M

On Tue, Oct 09, 2012 at 12:50:38AM -0700, nexy_sm wrote:

Thanks in advance
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio

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

On Wed, Oct 10, 2012 at 3:55 AM, Martin B. (CEL)
[email protected] wrote:

impossible to miss.

Johnathan/Tom, can you take that old stuff down? Outdated docs are
poison, if you ask me.

MB

It’s hosted on gnu.org, and I don’t have access to edit it. I’ll have
to contact the FSF webmaster and ask him to remove it.

Tom

On Tue, Oct 09, 2012 at 12:28:57PM +0200, Nemanja S. wrote:

http://www.gnu.org/software/gnuradio/doc/howto-write-a-block.html

And the problem was bad reference to the PKG_CONFIG_PATH.

I see that in the instructions you sent me and inistructions that I was
following, building folders are different.

That’s ancient docs… didn’t you read the sell-by date? :slight_smile:
Just go to gnuradio.org and follow the instructions. They’re really
impossible to miss.

Johnathan/Tom, can you take that old stuff down? Outdated docs are
poison, if you ask me.

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

Hallo again guys,

I followed instructions on the proposed website. Everything “was fine”
until
I had to run test. Even when I run make test from gr-how-to-write-block
folder which comes with the installation tets fail.

Running tests…
Start processing tests
Test project /home/savi_ne/work/gnuradio/gr-howto/build
1/ 1 Testing qa_howto ***Failed

0% tests passed, 1 tests failed out of 1

The following tests FAILED:
1 - qa_howto (Failed)
Errors while running CTest
make: *** [test] Error 8

Any suggestions?


View this message in context:
http://gnuradio.4.n7.nabble.com/cannot-make-new-signal-processing-block-tp37924p37959.html
Sent from the GnuRadio mailing list archive at Nabble.com.

On Thu, Oct 11, 2012 at 10:11 AM, nexy_sm [email protected] wrote:

0% tests passed, 1 tests failed out of 1

The following tests FAILED:
1 - qa_howto (Failed)
Errors while running CTest
make: *** [test] Error 8

Any suggestions?

Can you run this instead of ‘make test’:

ctest -V

That will give more output information about what’s happening during the
test.

Tom

Ok, I run the suggested command. And the problem is in importing module:

UpdateCTestConfiguration from
:/home/savi_ne/work/gnuradio/gr-howto/build/DartConfiguration.tcl
Start processing tests
UpdateCTestConfiguration from
:/home/savi_ne/work/gnuradio/gr-howto/build/DartConfiguration.tcl
Test project /home/savi_ne/work/gnuradio/gr-howto/build
Constructing a list of tests
Done constructing a list of tests
Changing directory into
/home/savi_ne/work/gnuradio/gr-howto/build/python
1/ 1 Testing qa_howto
Test command: /bin/sh
/home/savi_ne/work/gnuradio/gr-howto/build/python/qa_howto_test.sh
Test timeout computed to be: 9.99988e+06
Traceback (most recent call last):
File “/home/savi_ne/work/gnuradio/gr-howto/python/qa_howto.py”, line
24,
in
import howto_swig
ImportError: No module named howto_swig
– Process completed
***Failed

0% tests passed, 1 tests failed out of 1

The following tests FAILED:
1 - qa_howto (Failed)
Errors while running CTest

Any suggestions?
In the line that causes the error is written following:
import howto_swig # Can’t import howto because that module does not yet
exist

Regards


View this message in context:
http://gnuradio.4.n7.nabble.com/cannot-make-new-signal-processing-block-tp37924p37967.html
Sent from the GnuRadio mailing list archive at Nabble.com.

On Fri, Oct 12, 2012 at 3:47 AM, nexy_sm [email protected] wrote:

Done constructing a list of tests
– Process completed
import howto_swig # Can’t import howto because that module does not yet
exist

Regards

Looks like you haven’t done the installation properly. Is the SWIG
interface file correct? All of the CMakeLists.txt files updated?
What’s your install path? If it’s not a standard path (/usr,
/usr/local) you’ll have to make sure Python knows where to find it
(PYTHONPATH=…).

Have you looked at using gr_modtool.py
(https://github.com/mbant/gr-modtool)? It helps make sure the setup is
done correctly to install everything properly.

Tom

Any suggestions how to make this thing working?


View this message in context:
http://gnuradio.4.n7.nabble.com/cannot-make-new-signal-processing-block-tp37924p37997.html
Sent from the GnuRadio mailing list archive at Nabble.com.

On Fri, Oct 12, 2012 at 2:04 PM, nexy_sm [email protected] wrote:

Python path is OK. Gnuradio works fine, I have tried some examples using GRC,
etc.

Have you verified that that module is actually installed where you
think it is? If you are just building the gr-howto-write-a-block like
this:

cmake -DCMAKE_INSTALL_PREFIX=/opt/howto [path to
source]/gr-howto-write-a-block
make && sudo make install

When you look in /opt/howto/lib/python2.7/dist-packages, you will find
a ‘howto’ directory. Under that, you’ll find:

howto_swig.py
howto_swig.pyc
howto_swig.pyo
_howto_swig.so
init.py
init.pyc
init.pyo

All of those files have to be there. Then, if
PYTHONPATH=/opt/howto/lib/python2.7/dist-packages, you can ‘import
howto’ from inside Python.

Tom

Python path is OK. Gnuradio works fine, I have tried some examples using
GRC,
etc.

I also used gr-modtool like it was explained on the website.
I haven’t looked at swig interface file since it was not part of the
tutorial, but I think it should have been generated correctly by
gr-modtool.

How can I check installation of the SWIG?

Anyway I will not have chance to try anything until monday.

Regards and thanks


View this message in context:
http://gnuradio.4.n7.nabble.com/cannot-make-new-signal-processing-block-tp37924p37982.html
Sent from the GnuRadio mailing list archive at Nabble.com.

On Mon, Oct 15, 2012 at 11:24 AM, nexy_sm [email protected] wrote:

Finaly it works.
Thanks!!!

That’s great!

Can you say a few words about what you did to get it working for the
benefit of others that might be having problems?

Tom

Finaly it works.
Thanks!!!


View this message in context:
http://gnuradio.4.n7.nabble.com/cannot-make-new-signal-processing-block-tp37924p38005.html
Sent from the GnuRadio mailing list archive at Nabble.com.

Of course, that’s at least what I can do.

First of all, I would like to say that the biggest problem was lack of
my
knowledge in Linux.
I was strictly following instructions from gnuradio.org about making out
of
tree signal processing block, and there is not stated that i have to do
/make install/ before testing module.
Also, nowhere is stated stest -V, for getting more error information,
and
also using -DCMAKE_INSTALL_PREFIX, whish is used for setting base
address or
whatever.

Maybe somebody should make detailed tutorials, for the people that knows
only signal processing, not Linux, just for smooth start, unti they get
used.

Regards
Nemanja


View this message in context:
http://gnuradio.4.n7.nabble.com/cannot-make-new-signal-processing-block-tp37924p38019.html
Sent from the GnuRadio mailing list archive at Nabble.com.

Do you mean some kind of tutorial or what?

Well, that means that my test don’t work, since you said that make
install
isn’t necesary.

So, let’s start again, what might be a problem?


View this message in context:
http://gnuradio.4.n7.nabble.com/cannot-make-new-signal-processing-block-tp37924p38021.html
Sent from the GnuRadio mailing list archive at Nabble.com.

On Tue, Oct 16, 2012 at 02:08:42AM -0700, nexy_sm wrote:

First of all, I would like to say that the biggest problem was lack of my
knowledge in Linux.
I was strictly following instructions from gnuradio.org about making out of
tree signal processing block, and there is not stated that i have to do
/make install/ before testing module.

Hm, you shouldn’t need to do that. (That’s why it’s not in the
instructions.)

Also, nowhere is stated stest -V, for getting more error information, and
also using -DCMAKE_INSTALL_PREFIX, whish is used for setting base address or
whatever.

That’s already what I’d consider ‘advanced’ usage, which is why it’s not
in the tutorial, either. Although I guess ‘ctest -V’ could be in there.

Maybe somebody should make detailed tutorials, for the people that knows
only signal processing, not Linux, just for smooth start, unti they get
used.

Since you just went through the process, how about writing something
while the knowledge is still fresh?

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

On Tue, Oct 16, 2012 at 03:14:31AM -0700, nexy_sm wrote:

Do you mean some kind of tutorial or what?

Well, that means that my test don’t work, since you said that make install
isn’t necesary.

So, let’s start again, what might be a problem?

That’s still impossible to tell from what you’ve written.
I’ve just checked that gr_modtool and the tutorial are correct.

Here’s what I did:

  1. Create an out-of-tree module

~/tmp % gr_modtool.py create test
Module directory is “./gr-test”.
Creating directory…
Copying howto example…
Unpacking…
Replacing occurences of ‘howto’ to ‘test’… Done.
Use ‘gr_modtool add’ to add a new block to this currently empty module.

  1. Then, I add a sync-block:

~/tmp% cd gr-test
tmp/gr-test % gr_modtool.py add -t sync square_ff
Operating in directory .
GNU Radio module name identified: test
Code is of type: sync
Block/code identifier: square_ff
Enter valid argument list, including default arguments:
Add Python QA code? [Y/n]
Add C++ QA code? [Y/n] n
Traversing lib…
Adding file ‘square_ff_impl.h’…
Adding file ‘square_ff_impl.cc’…
Adding file ‘square_ff.h’…
Traversing swig…
Editing swig/test_swig.i…
Traversing python…
Adding file ‘qa_square_ff.py’…
Editing python/CMakeLists.txt…
Traversing grc…
Adding file ‘test_square_ff.xml’…
Editing grc/CMakeLists.txt…

  1. Next, I edit the work() function of the block (this only needs one
    line to be changed) to look like this:
    Before this is done, the ‘make’ command won’t work!

{
const float *in = (const float *) input_items[0];
float *out = (float *) output_items[0];

    for (int i = 0; i < noutput_items; i++) {
            out[i] = in[i] * in[i];
    }

    // Tell runtime system how many output items we produced.
    return noutput_items;

}

  1. Finally, I edit the file python/qa_square_ff.py such that the test
    case contains this:
    Before this is done, the ‘make test’ or ‘ctest’ commands won’t work!

    def test_001_t (self):
    test_data = (1, 2, 3, 4)
    correct_res = (1, 4, 9, 16)
    sink = gr.vector_sink_f()
    self.tb.connect(gr.vector_source_f(test_data), test.square_ff(),
    sink)
    self.tb.run()
    self.assertEqual(sink.data(), correct_res)

Then, I go to the build directory and invoke the make process:

gr-test/build % cmake … # Output omitted
gr-test/build % make # Output omitted
gr-test/build % make test
Running tests…
Test project /home/braun/tmp/gr-test/build
Start 1: test_test
1/2 Test #1: test_test … Passed 0.02 sec
Start 2: qa_square_ff
2/2 Test #2: qa_square_ff … Passed 0.23 sec

100% tests passed, 0 tests failed out of 2

The End.

This entire process took me less than 10 minutes. If you’re taking
longer, you’re wasting time.

Other notes:

  • I never installed
  • The only editing necessary was three lines in the work() function and
    the
    test case in qa_square_ff

So go through your module once again, start from scratch and it will
work.

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

Ok, I suppose the best and fastest way to learn gnuradio is by exploring
simple existing blocks, like adder for example.
I was first thinking about adder and the opened gr_add_cc.h.

I was immediately stuck in the constructor part

gr_add_cc::gr_add_cc (size_t vlen)
: gr_sync_block (“add_cc”,
gr_make_io_signature (1, -1, sizeof (gr_complex)*vlen),
gr_make_io_signature (1, 1, sizeof (gr_complex)*vlen)),
d_vlen (vlen)
{
}

I was expecting something like:

gr_add_cc::gr_add_cc (size_t vlen)
: gr_sync_block (“add_cc”,
gr_make_io_signature (1, vlen, sizeof (gr_complex)),
gr_make_io_signature (1, 1, sizeof (gr_complex))),
d_vlen (vlen)
{
}

I don’t really understand this line:

gr_make_io_signature (1, -1, sizeof (gr_complex)*vlen)

Can you just explain breafly what is idea behind, cause i was expecting
something more simpler.

Thanks


View this message in context:
http://gnuradio.4.n7.nabble.com/cannot-make-new-signal-processing-block-tp37924p38033.html
Sent from the GnuRadio mailing list archive at Nabble.com.

Hm, I see now, and don’t get, how you specifu number of inputs, and what
exactly means Vec Length (vlen)

and what could be wrong with implementation like this:

int
gr_add_cc::work (int noutput_items,
gr_vector_const_void_star &input_items,
gr_vector_void_star &output_items)
{
gr_complex *optr = (gr_complex *) output_items[0];

int ninputs = input_items.size ();

for (size_t i = 0; i < noutput_items; i++){
gr_complex acc = ((gr_complex *) input_items[0])[i];
for (int j = 1; j < ninputs; j++)
acc += ((gr_complex *) input_items[j])[i];

*optr++ = (gr_complex) acc;

}
return noutput_items;
}

And just one question, in the block gr_add_const_ff, you did loop
unrolling
by yourself, is that because you don’t believe to the compiler or
something
else?

Thanks again
Nemanja


View this message in context:
http://gnuradio.4.n7.nabble.com/cannot-make-new-signal-processing-block-tp37924p38034.html
Sent from the GnuRadio mailing list archive at Nabble.com.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs