[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Discuss-gnuradio] playing nice with swig
From: |
Eric Blossom |
Subject: |
Re: [Discuss-gnuradio] playing nice with swig |
Date: |
Tue, 17 Aug 2004 21:52:56 -0700 |
User-agent: |
Mutt/1.4.1i |
On Tue, Aug 17, 2004 at 02:44:14PM -0500, David Carr wrote:
> I'm working on an AM demodulator using my gr_complex_mag block.
> Unfourtunately I don't think I have everything working with SWIG.
> This is the error I get.
>
> $ python am_demod_file.py 1
> audio: using audio_oss
> >>> gr_fir_scc: using SSE
> >>> gr_fir_fff: using SSE
> Traceback (most recent call last):
> File "am_demod_file.py", line 168, in ?
> main (sys.argv[1:])
> File "am_demod_file.py", line 145, in main
> fg = build_graph (IF_freq, None)
> File "am_demod_file.py", line 50, in build_graph
> complex_mag = gr.complex_mag()
> AttributeError: 'module' object has no attribute 'complex_mag'
>
> This line in am_demod_file.py causes the error:
> complex_mag = gr.complex_mag()
>
> My C++ code compiles.
> Here is my gr_complex_mag.i:
>
> GR_SWIG_BLOCK_MAGIC (gr, complex_mag)
>
> gr_complex_mag_sptr gr_make_complex_mag ();
>
> class gr_complex_mag : public gr_sync_block
> {
> gr_complex_mag ();
> };
>
> I also added %include "gr_complex_mag.i" to general.i as well.
> I added "gr_complex_mag.cc" to libgeneral_la_SOURCES and
> "gr_complex_mag.h" to grinclude_HEADERS in Makefile.am
>
> I did a make distclean, bootstrap.sh, configure, make and make install
> but no love.
>
> -David Carr
>
Hmmm. Looks OK to me.
I'm assuming you've also got a #include <gr_complex_mag.h> in
general.i in addition to the %include "gr_complex_mag.i".
If not, it wouldn't have built.
Try this:
$ cd gnuradio-core/src/lib/swig
$ make clean
$ make
$ make install
Then try your experiment again.
There's a known problem where the .i file dependencies aren't properly
tracked.
http://comsec.com/bugzilla/show_bug.cgi?id=6
Eric