Swig problems compiling gnuradio-core/CVS on FC5

I’m using FC5, compiling gnuradio-core from cvs. With both the
current Fedora version of swig (1.3.24) and swig 1.3.29 from
Sourceforge, I have problems compiling
src/lib/swig/gnuradio_swig_python.cc. Let me know if I can provide
any other relevant info; below is part of the compile transcript. I’m
using gcc version 4.1.0 20060304 (Red Hat 4.1.0-3)

make[5]: Entering directory
`/export/home/jamieson/gr-build/gnuradio-core/src/lib/swig’
if /bin/sh …/…/…/libtool --tag=CXX --mode=compile g++
-DHAVE_CONFIG_H -I. -I. -I…/…/… -I…/…/…/src/lib/runtime
-I…/…/…/src/lib/general -I…/…/…/src/lib/filter
-I…/…/…/src/lib/io -I…/…/…/src/lib/g72x -I…/…/…/src/lib/atsc
-I…/…/…/src/lib/omnithread -I…/…/…/src/lib/general
-I…/…/…/src/lib/filter -I/usr/include/python2.4 -I. -g -O2
-Wall -Woverloaded-virtual -pthread -MT gnuradio_swig_python.lo -MD
-MP -MF “.deps/gnuradio_swig_python.Tpo” -c -o gnuradio_swig_python.lo
gnuradio_swig_python.cc;
then mv -f “.deps/gnuradio_swig_python.Tpo”
“.deps/gnuradio_swig_python.Plo”; else rm -f
“.deps/gnuradio_swig_python.Tpo”; exit 1; fi
mkdir .libs
g++ -DHAVE_CONFIG_H -I. -I. -I…/…/… -I…/…/…/src/lib/runtime
-I…/…/…/src/lib/general -I…/…/…/src/lib/filter
-I…/…/…/src/lib/io -I…/…/…/src/lib/g72x -I…/…/…/src/lib/atsc
-I…/…/…/src/lib/omnithread -I…/…/…/src/lib/general
-I…/…/…/src/lib/filter -I/usr/include/python2.4 -I. -g -O2 -Wall
-Woverloaded-virtual -pthread -MT gnuradio_swig_python.lo -MD -MP -MF
.deps/gnuradio_swig_python.Tpo -c gnuradio_swig_python.cc -fPIC -DPIC
-o .libs/gnuradio_swig_python.o
gnuradio_swig_python.cc: In function ‘int
SWIG_AsPtr_std_string(PyObject*, std::string**)’:
gnuradio_swig_python.cc:4557: warning: dereferencing type-punned
pointer will break strict-aliasing rules
gnuradio_swig_python.cc: In function ‘int SWIG_AsVal_bool(PyObject*,
bool*)’:
gnuradio_swig_python.cc:4736: warning: dereferencing type-punned
pointer will break strict-aliasing rules
gnuradio_swig_python.cc:4739: warning: dereferencing type-punned
pointer will break strict-aliasing rules
gnuradio_swig_python.cc: In function ‘PyObject*
_wrap_x_vector_gr_block_sptr_erase__SWIG_0(PyObject*, PyObject*)’:
gnuradio_swig_python.cc:9500: warning: dereferencing type-punned
pointer will break strict-aliasing rules
gnuradio_swig_python.cc: In function ‘PyObject*
_wrap_x_vector_gr_block_sptr_erase__SWIG_1(PyObject*, PyObject*)’:
gnuradio_swig_python.cc:9542: warning: dereferencing type-punned
pointer will break strict-aliasing rules
gnuradio_swig_python.cc:9553: warning: dereferencing type-punned
pointer will break strict-aliasing rules
gnuradio_swig_python.cc: In function ‘PyObject*
_wrap_x_vector_gr_block_sptr_erase(PyObject*, PyObject*)’:
gnuradio_swig_python.cc:9589: warning: dereferencing type-punned
pointer will break strict-aliasing rules
gnuradio_swig_python.cc:9602: warning: dereferencing type-punned
pointer will break strict-aliasing rules
gnuradio_swig_python.cc:9606: warning: dereferencing type-punned
pointer will break strict-aliasing rules
gnuradio_swig_python.cc: In function ‘PyObject*
_wrap_x_vector_gr_block_sptr_insert__SWIG_0(PyObject*, PyObject*)’:
gnuradio_swig_python.cc:9945: warning: dereferencing type-punned
pointer will break strict-aliasing rules
gnuradio_swig_python.cc: In function ‘PyObject*
_wrap_x_vector_gr_block_sptr_insert__SWIG_1(PyObject*, PyObject*)’:
gnuradio_swig_python.cc:9998: warning: dereferencing type-punned
pointer will break strict-aliasing rules
gnuradio_swig_python.cc: In function ‘PyObject*
_wrap_x_vector_gr_block_sptr_insert(PyObject*, PyObject*)’:
gnuradio_swig_python.cc:10046: warning: dereferencing type-punned
pointer will break strict-aliasing rules
gnuradio_swig_python.cc:10063: warning: dereferencing type-punned
pointer will break strict-aliasing rules
…/…/…/src/lib/general/gr_binary_slicer_fb.h: In function ‘PyObject*
_wrap_binary_slicer_fb(PyObject*, PyObject*)’:
…/…/…/src/lib/general/gr_binary_slicer_fb.h:31: error: too few
arguments to function 'gr_binary_slicer_fb_sptr
gr_make_binary_slicer_fb(const std::vector<int, std::allocator

&)’
gnuradio_swig_python.cc:53676: error: at this point in file
.
.
.

Well, I’ve resolved this issue for myself. I’d be interested in why
this isn’t bugging everyone else, and if I made a mistake. It just
involved an apparently bad header prototype; patch follows.

Index: src/lib/general/gr_binary_slicer_fb.h

RCS file:
/sources/gnuradio/gnuradio-core/src/lib/general/gr_binary_slicer_fb.h,v
retrieving revision 1.1
diff -C3 -r1.1 gr_binary_slicer_fb.h
*** src/lib/general/gr_binary_slicer_fb.h 30 May 2006 05:57:06
-0000 1.1
— src/lib/general/gr_binary_slicer_fb.h 13 Jun 2006 20:49:39
-0000


*** 28,34 ****
class gr_binary_slicer_fb;
typedef boost::shared_ptr<gr_binary_slicer_fb>
gr_binary_slicer_fb_sptr;

! gr_binary_slicer_fb_sptr gr_make_binary_slicer_fb (const
std::vector &map);

/*!

  • \brief slice float binary symbol outputting 1 bit output
    — 28,34 ----
    class gr_binary_slicer_fb;
    typedef boost::shared_ptr<gr_binary_slicer_fb>
    gr_binary_slicer_fb_sptr;

! gr_binary_slicer_fb_sptr gr_make_binary_slicer_fb ();

/*!

  • \brief slice float binary symbol outputting 1 bit output

Thanks, I had this problem a week ago after installing FC5 but didn’t
have
the time or skill to solve it. Exactly how do i apply the patch? and
to
what?
Thanks,
John

The patch gets applied in the gnuradio-core directory. Cut-n-paste
the patch from my original email into some file ‘foo’, then

patch -p0 < foo

in dir gnuradio-core.

On Tue, Jun 13, 2006 at 04:51:37PM -0400, Kyle Jamieson wrote:

Well, I’ve resolved this issue for myself. I’d be interested in why
this isn’t bugging everyone else, and if I made a mistake. It just
involved an apparently bad header prototype; patch follows.

Index: src/lib/general/gr_binary_slicer_fb.h

Hi Kyle,

For some reason, g++ 4.0.2 wasn’t reporting this as a problem.
Thanks for the fix. I’ve applied it to CVS.

Eric

I applied the patch but still get a whole lot of gnuradio_swig_python.cc
warnings: dereferencing type-prunned pointer will break strict-aliasing
rules. Then the build hangs. Before the patch, it would exit with
errors.

I rechecked out from cvs with the same result.

On Tue, Jun 13, 2006 at 10:52:33PM -0700, John E. Don Carlos wrote:

I applied the patch but still get a whole lot of gnuradio_swig_python.cc
warnings: dereferencing type-prunned pointer will break strict-aliasing
rules. Then the build hangs. Before the patch, it would exit with errors.

I rechecked out from cvs with the same result.

FYI, I don’t think it’s hanging. It takes a pretty long time to
compile gnuradio_swig_python.cc. Depending on your system, it could
take 10 minutes or more.

Can you let me know the versions of swig and g++ you are using?

$ swig -version
$ g++ --version

Thanks!
Eric

Right, depending on the version of swig you’re using, you’ll get
either a lot or a whole lot of warnings, and then it’ll take a minute
or so to compile.

On Wed, Jun 14, 2006 at 05:01:14PM -0700, John E. Don Carlos wrote:

Right! I let the warnings concern me too much. It did keep compiling.

I’m now getting a configure error: gr-audio-osx required darwin or MacOS X.
What do i need to install? i’m running on a pentium with FC5.

Don’t build gr-audio-osx unless you’re on a Mac :wink:

Eric

BTW, swig version 1.3.24 gcc 4.1.1

Thanks,
Eric

Right! I let the warnings concern me too much. It did keep compiling.

I’m now getting a configure error: gr-audio-osx required darwin or MacOS
X.
What do i need to install? i’m running on a pentium with FC5.

BTW, swig version 1.3.24 gcc 4.1.1

Thanks,
John