discuss-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Discuss-gnuradio] howto module ... please help


From: Michael Civ
Subject: Re: [Discuss-gnuradio] howto module ... please help
Date: Tue, 2 Nov 2010 07:58:55 -0700 (PDT)

Eric,

Thanks for getting back to me. I rewrote the code as suggested (thanks for the tip) and still get the SEGFAULT.

I'm not sure how to check if I have multiple installations. I have folders titled "gnuradio" in the following locations:

/home/mike
/home/mike/gnuradio/gnuradio-core/src/python
/home/mike/gnuradio/gruel/src/scheme
/etc
/usr/include
/usr/lib/python2.6/dist-packages
/usr/share
/usr/share/doc
/usr/local/etc
/usr/local/include
/usr/local/lib/python2.6/dist-packages
/usr/local/share
/usr/local/libexec


and the gnuradio-core folder is only located in

/home/mike/gnuradio

Does that make it seem like I have multiple installations (and if so, which ones should i remove)? How else could I find out?

Thanks for the help,
Mike


--- On Mon, 11/1/10, Eric Blossom <address@hidden> wrote:

From: Eric Blossom <address@hidden>
Subject: Re: [Discuss-gnuradio] howto module ... please help
To: "Michael Civ" <address@hidden>
Cc: address@hidden
Date: Monday, November 1, 2010, 5:14 PM

On Mon, Nov 01, 2010 at 03:29:25PM -0700, Michael Civ wrote:
> Hello, I posted this a week ago and received no response. Any comments or suggestions would be greatly appreciate.
>
> I recently got python programs to successfully import the howto
> module, but I cannot use the functions:
>

Michael,

I just built gnuradio and howto from the git master (Fedora 13 on x86-64).
It doesn't SEGFAULT for me leading me to think that you have a hosed-
up GNU Radio installation on your system.  Is there any chance that
you've got more than one installation?  Perhaps one from a .deb or
.rpm and one from source?  If so, uninstall the packaged one.

Also, what you really want is something like the code below.
Otherwise the dst.data() is always empty, since the graph hasn't run
when you first print it out.

Eric

$ cd gnuradio
$ ./bootstrap && ./configure --disable-docs
$ (make -j12 && make check && make install) 2>&1 | tee make.log
$ cd gr-howto-write-a-block/
$ ./bootstrap
$ ./configure
$ make && make check && make install



#!/usr/bin/env python

from gnuradio import gr
import howto

class my_top_block(gr.top_block):
  def __init__(self):
    gr.top_block.__init__(self)

    src_nums = (4, 5, 6)
    src = "" (src_nums)
    sqr = howto.square_ff ()
    dst = gr.vector_sink_f ()
    self.dst = dst
    self.connect (src, sqr)
    self.connect (sqr, dst)
    print "src: ", src
    print "sqr: ", sqr
    print "dst.data: ", dst.data()

if __name__ == '__main__':
    tb = my_top_block()
    tb.run()
    print "dst.data: ", tb.dst.data()


$ /tmp/test.py
src:  <gr_block vector_source_f (1)>
sqr:  <gr_block square_ff (2)>
dst.data:  ()
dst.data:  (16.0, 25.0, 36.0)


reply via email to

[Prev in Thread] Current Thread [Next in Thread]