Forum: GNU Radio gr_modtool generating incorrect code?

Posted by Rowland Johnson (rowland)
on 2013-01-26 23:13
I'm using gr_modtool as described in the OutOfTree Modules
http://gnuradio.org/redmine/projects/gnuradio/wiki...
to generate the square_ff block. However, the code generated produces an
error when compiled and is different from the code in the
<GNURADIO>/howto-write-a-block directory. E.g., in the generated
../gr-howto/lib/howto_square_ff.cc file there is the line
  gr_make_io_signature (<+MIN_IN+>, <+MAX_IN+>, sizeof (<+float+>))
which needs to be

.
.
static const int MIN_IN = 1;  // mininum number of input streams
static const int MAX_IN = 1;  // maximum number of input streams
.
.
gr_make_io_signature (MIN_IN, MAX_IN, sizeof (float)),

Do the values for <+MIN_IN+> and <+MAX_IN+> need to be set somewhere so
that the proper code gets generated?
Posted by Rowland Johnson (rowland)
on 2013-01-29 16:45
I just now downloaded and installed gr_modtool from

https://github.com/mbant/gr-modtool/blob/master/gr...

which is 2 hours old. When a new module is being added an error occurs
because it attempts to get the skeleton from

/home/braun/.usrlocal/share/gnuradio/modtool/gr-newmod

Using the code from a previous version of gr_modtool I fixed the code
so that the skeleton comes from the NEWMOD_TARFILE.

Although this change allows gr_modtool to correctly generate the module
I STILL have the problem described in my original post. I.e. in the
block added by gr_modtool there is the file
..../gr-howto/lib/square_ff_impl.cc file which has the line
  gr_make_io_signature (<+MIN_IN+>, <+MAX_IN+>, sizeof (<+float+>))
I have to manually fix this by lifting the code out the
gnuradio/gr-howto-write-a-block and changing
..../gr-howto/lib/square_ff_impl.cc
to something like
.
.
static const int MIN_IN = 1;  // mininum number of input streams
static const int MAX_IN = 1;  // maximum number of input streams
.
.
gr_make_io_signature (MIN_IN, MAX_IN, sizeof (float)),

Do the values for <+MIN_IN+> and <+MAX_IN+> need to be set somewhere so
that the proper code gets generated?
Please log in before posting. Registration is free and takes only a minute.
Existing account (Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
No account? Register here.