Hi:
      I missed one thing. If I copy the gr-howto-write-a-block 3.3.0 folder to 
my gnuradio folder,then after
./bootstrap, ./configure ,make, make check ,make install, the block 
how.square_ff() and how.square2_ff()
can work well in my test code.Why? I just use the 
create-gnuradio-out-of-tree-project command to change the 
name of the new package,and other things are same.Why the block of this package 
can work? 

From: tianxia...@hotmail.com
To: discuss-gnuradio@gnu.org
Date: Mon, 18 Apr 2011 16:20:13 +0800
Subject: Re: [Discuss-gnuradio] segmentation fault when using a new added block








Hi all:
      I have already figured out my problem I mentioned in my last e-mail. That 
is because I installed two 
versions of GNU Radio in my computer.So I get the error "segmentation 
fault".But there is another question.
After I uninstalled one version of GnuRadio (now i use gnuradio3.3.0),I use the 
create-gnuradio-out-of-tree-project
command to add a new package which named test.And I did not change the block in 
the package,so they still
were test.square_ff() and test.square2_ff().When I run the test code which is a 
simple python code,I got this error:
AttributeError: 'module' object has no attribute 'square_ff'.So how can I do to 
figure out this problem?I hope someone
can tell me .Thanks in advance.

inter

From: tianxia...@hotmail.com
To: discuss-gnuradio@gnu.org
Date: Thu, 14 Apr 2011 16:09:01 +0800
Subject: [Discuss-gnuradio] segmentation fault when using a new added block








hi all:
    I want to use the gr-howto-write-a-block-3.3.0 (my version of the Gnuradio 
is 3.3.0)to add a new package
or a new block to the gnuradio and grc. At first I did not change anything in 
the gr-howto-write-a-block-3.3.0,
so the name of the new package should be howto,and the name of the block should 
be howto.square_ff() and 
howto.square2_ff().I run the follow command as follow:
    sudo ./bootstrap
    sudo ./configure --prefix=/usr/local
    sudo make
    sudo make check
    sudo make install
 After all commands done,everything seems fine (no error appear after make 
check)and the package looks like  been installed.
Then I write a small python program to test the new block.Here are the codes:
#! /usr/bin/env python
from gnuradio import gr
import howto
class example_block(gr.top_block):
    def __init__(self):
        gr.top_block.__init__(self)
        src = gr.vector_source_f((2,-2,1),
                                 True)
        thr = gr.throttle(gr.sizeof_float,
                          32000)
        sqr =howto.square_ff()
        dst = gr.file_sink(gr.sizeof_float,
                           "/home/tianxia515/result.dat")

        self.connect(src,thr)
        self.connect(thr,sqr)
        self.connect(sqr,dst)

if __name__ == '__main__':
    tb = example_block()
    tb.run()

But when I run the program in the shell, there is error "segmentation fault".I 
do not know why does this error happen.
I did not change anything in the gr-howto-write-a-block-3.3.0. I hope someone 
can help me to fix this problem and 
tell me why this error happen.
Thanks in advance.

inter.
                                          

_______________________________________________
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
http://lists.gnu.org/mailman/listinfo/discuss-gnuradio                          
          

_______________________________________________
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
http://lists.gnu.org/mailman/listinfo/discuss-gnuradio                          
          
_______________________________________________
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
http://lists.gnu.org/mailman/listinfo/discuss-gnuradio

Reply via email to