Custom block problem on OSX 10.6

Hi,

I am having trouble getting a custom block to run with a GNU Radio 3.2.2
install on my 64-bit Intel-based Macbook Pro running Snow Leopard 10.6.
I
installed GNU Radio through MacPorts about a week ago. After some trial
and
error with ./configure options, I got my custom block to compile and
install, but it breaks on make check with this error:


Eswig/python detected a memory leak of type ‘gr_basic_block_sptr *’, no
destructor found.

======================================================================
ERROR: test_ple_trx_ff (main.qa_ple)

Traceback (most recent call last):
File “./qa_ple.py”, line 110, in test_ple_trx_ff
self.fg.connect(self.sig_src1, self.ple_tx_ff)
File
“/opt/local/lib/python2.6/site-packages/gnuradio/gr/top_block.py”,
line 124, in connect
self._connect(points[i-1], points[i])
File
“/opt/local/lib/python2.6/site-packages/gnuradio/gr/top_block.py”,
line 130, in _connect
dst_block.basic_block(), dst_port)
File
“/opt/local/lib/python2.6/site-packages/gnuradio/gr/gnuradio_swig_py_runtime.py”,
line 1487, in connect
return _gnuradio_swig_py_runtime.gr_top_block_sptr_connect(self,
*args)
NotImplementedError: Wrong number of arguments for overloaded function
‘gr_top_block_sptr_connect’.
Possible C/C++ prototypes are:
connect(boost::shared_ptr< gr_top_block > *,gr_basic_block_sptr)
connect(boost::shared_ptr< gr_top_block >
*,gr_basic_block_sptr,int,gr_basic_block_sptr,int)


Ran 1 test in 0.061s

FAILED (errors=1)
FAIL: run_tests

… etc. etc…

This same script used to run fine on my 32-bit build on OSX 10.5. I can
get
example scripts like dial_tone.py to run without any problems. I get the
same error after building and running make check for the
howto-write-a…
block from the gr-howto-write-a-block-3.2.2 tar ball:


make check-TESTS
Eswig/python detected a memory leak of type ‘gr_basic_block_sptr *’, no
destructor found.
Eswig/python detected a memory leak of type ‘gr_basic_block_sptr *’, no
destructor found.

======================================================================
ERROR: test_001_square_ff (main.qa_howto)

Traceback (most recent call last):
File “./qa_howto.py”, line 40, in test_001_square_ff
self.tb.connect (src, sqr)
File
“/opt/local/lib/python2.6/site-packages/gnuradio/gr/top_block.py”,
line 124, in connect
self._connect(points[i-1], points[i])
File
“/opt/local/lib/python2.6/site-packages/gnuradio/gr/top_block.py”,
line 130, in _connect
dst_block.basic_block(), dst_port)
File
“/opt/local/lib/python2.6/site-packages/gnuradio/gr/gnuradio_swig_py_runtime.py”,
line 1487, in connect
return _gnuradio_swig_py_runtime.gr_top_block_sptr_connect(self,
*args)
NotImplementedError: Wrong number of arguments for overloaded function
‘gr_top_block_sptr_connect’.
Possible C/C++ prototypes are:
connect(boost::shared_ptr< gr_top_block > *,gr_basic_block_sptr)
connect(boost::shared_ptr< gr_top_block >
*,gr_basic_block_sptr,int,gr_basic_block_sptr,int)

======================================================================
ERROR: test_002_square2_ff (main.qa_howto)

Traceback (most recent call last):
File “./qa_howto.py”, line 52, in test_002_square2_ff
self.tb.connect (src, sqr)
File
“/opt/local/lib/python2.6/site-packages/gnuradio/gr/top_block.py”,
line 124, in connect
self._connect(points[i-1], points[i])
File
“/opt/local/lib/python2.6/site-packages/gnuradio/gr/top_block.py”,
line 130, in _connect
dst_block.basic_block(), dst_port)
File
“/opt/local/lib/python2.6/site-packages/gnuradio/gr/gnuradio_swig_py_runtime.py”,
line 1487, in connect
return _gnuradio_swig_py_runtime.gr_top_block_sptr_connect(self,
*args)
NotImplementedError: Wrong number of arguments for overloaded function
‘gr_top_block_sptr_connect’.
Possible C/C++ prototypes are:
connect(boost::shared_ptr< gr_top_block > *,gr_basic_block_sptr)
connect(boost::shared_ptr< gr_top_block >
*,gr_basic_block_sptr,int,gr_basic_block_sptr,int)


Ran 2 tests in 0.002s

FAILED (errors=2)
FAIL: run_tests

… etc. etc…

So I suspect it is a problem with either the install or my configuration
rather than my code. Searching the archives turned up a few previous
mentions of the same problem, but solutions for those don’t seem to help
here. I don’t understand the “no destructor found” error, since I do
have
virtual destructors implemented for my blocks (as do the howto examples,
of
course).

Anyone manage to get any custom blocks running on 64-bit OSX 10.6? Any
tips
would be appreciated!

Thanks,
Kunal

Hi Kunal - I can’t directly address the question of whether or not
custom blocks work on OSX 10.6 x86_64, since I’ve never compiled by
custom blocks under that OS (yet). I need to do some 10.6 x64 work
anyway, so I’ll try out my blocks later today & see what happens.

Not sure if this makes any difference, but one of the errors seems to
be:

File “/opt/local/lib/python2.6/site-packages/gnuradio/gr/
gnuradio_swig_py_runtime.py”, line 1487, in connect
return _gnuradio_swig_py_runtime.gr_top_block_sptr_connect(self,
*args)
NotImplementedError: Wrong number of arguments for overloaded
function ‘gr_top_block_sptr_connect’.
Possible C/C++ prototypes are:
connect(boost::shared_ptr< gr_top_block > *,gr_basic_block_sptr)
connect(boost::shared_ptr< gr_top_block >
*,gr_basic_block_sptr,int,gr_basic_block_sptr,int)

so … maybe in your QA code you’re creating a bad connection?

If you go back to 10.5 32-bit, does your custom block work correctly?

  • MLD

Hi Michael,

Thanks for looking into it. I don’t have access to a 10.5 32-bit machine
to
test it out on at the moment (is there anything I can do with the
configuration?) However, I had built and tested my code on a 10.5 32-bit
machine, and it worked fine then. I have not changed the code itself
since I
moved to the new Snow Leopard machine, but I did have to play with the
configuration to get it to compile. Basically I had to force a 64-bit
build,
and override pkg-config to get Makefile to use the macports gnuradio
install. This is the configure command I ran in my custom block
directory:

./configure --build=i686-apple-darwin10 --host=x86_64-apple-darwin10
–target=i686-apple-darwin10 LDFLAGS=-L/opt/local/lib
CFLAGS=-I/usr/include/python2.6 CXXFLAGS=-I/usr/include/python2.6
–with-pythondir=/opt/local/lib/python2.6/site-packages
GNURADIO_CORE_INCLUDEDIR=/opt/local/include/gnuradio
GNURADIO_CORE_LIBS=/opt/local/lib

I had the same error for howto-write-a-block (with the same configure
command) as I did my custom block, so I suspect a problem in the install
or
my configuration.

Kunal