Creating bindings to other langauges for GNURadio

Hi all!
I am experimenting with GNURadio and in particular trying to create a
binding for another language for a module than Python. Unfortunately I
am not that proficient, yet, with Swig and some of the other tools.
After taking a peek at the make files, the Swig interface files, etc. it
seems a bit of a hurdle to grasp at first. Could someone please provide
a pointer to some of the entries in the files (.i, make-files and
others?) of a module (small one) so I can work out the details for my
experiments …

Thanks in advance,

Robert

P.S. Found out about e.g. the SWIG_PYTHON_OPT = -python in the
makefiles, but I think there some more than that which needs to be
altered for my purposes…

On Sun, Jan 13, 2008 at 09:39:20PM +0100, Robert Varttinen wrote:

I can work out the details for my experiments …
Sorry, there really aren’t any small ones[1]. For gnuradio-core, it all
gets pulled together in gnuradio-core/src/lib/swig. We build
5 separate modules that are logically a single entity. (We used to
build them as a single entity, but the 6MB of generated C++ code got a
bit too large for people with < 512MB to compile).
The first module to study is gnuradio.i which gets compiled into
gnuradio_swig_py_runtime.*. It contains the base of the inheritance
hierarchy.

You’ll want to spend some quality time with the swig documentation.
The main things to study are the overview, C, C++ and Python chapters.
We don’t do anything fancy with typemaps. We mostly avoid those
problems by designing our C++ interfaces to be “SWIG friendly”.

What’s your other language?

Let us know when you’ve got more questions :slight_smile:

Eric

[1] Actually, there are a few small ones, but I don’t think they’ll
help you get going. You could look at gr-audio-alsa/src/audio_alsa.i,
but it has a dependency on gnuradio.i, so you’re back to
gnuradio-core/src/lib/swig/gnuradio.i

Thank you for your swift reply,
The language I am planning to experiment in is Java. Thanks for the
input, I think have a starting point now.

I’ll post back any findings encountered… and questions, of course.
:slight_smile:

//Robert

P.S. Yes, I took a peek at the gnuradio-core and relaised, well, it’s
alot … however, I get to learn about Swig and I’m picking up bits and
pieces of Python. Always exciting learning a new language.


Från: Eric B. [mailto:[email protected]]
Skickat: sö 2008-01-13 22:33
Till: Robert Varttinen
Kopia: [email protected]
Ämne: Re: [Discuss-gnuradio] Creating bindings to other langauges
forGNURadio

On Sun, Jan 13, 2008 at 09:39:20PM +0100, Robert Varttinen wrote:

I can work out the details for my experiments …
Sorry, there really aren’t any small ones[1]. For gnuradio-core, it all
gets pulled together in gnuradio-core/src/lib/swig. We build
5 separate modules that are logically a single entity. (We used to
build them as a single entity, but the 6MB of generated C++ code got a
bit too large for people with < 512MB to compile).
The first module to study is gnuradio.i which gets compiled into
gnuradio_swig_py_runtime.*. It contains the base of the inheritance
hierarchy.

You’ll want to spend some quality time with the swig documentation.
The main things to study are the overview, C, C++ and Python chapters.
We don’t do anything fancy with typemaps. We mostly avoid those
problems by designing our C++ interfaces to be “SWIG friendly”.

What’s your other language?

Let us know when you’ve got more questions :slight_smile:

Eric

[1] Actually, there are a few small ones, but I don’t think they’ll
help you get going. You could look at gr-audio-alsa/src/audio_alsa.i,
but it has a dependency on gnuradio.i, so you’re back to
gnuradio-core/src/lib/swig/gnuradio.i