Difficulty with "howto" tutorial

Hi,

I don’t know if the how to tutorial is out of date, but I cannot find
any
Makefile.am file in the “gr-howto-write-a-block” that looks like example
5
in the tutorial (
http://www.gnu.org/software/gnuradio/doc/howto-write-a-block.html#prereqs).
I’ve tried editing the libs to the best of my ability, but the best that
I
can get from the make check is

make check-am
make[1]: Entering directory
/home/aespiel1/gnuradio/gr-howto-write-a-block/python' make check-TESTS make[2]: Entering directory /home/aespiel1/gnuradio/gr-howto-write-a-block/python’
/home/aespiel1/gnuradio/gr-howto-write-a-block/lib:/home/aespiel1/gnuradio/gr-howto-write-a-block/lib/.libs:/home/aespiel1/gnuradio/gr-howto-write-a-block/swig:/home/aespiel1/gnuradio/gr-howto-write-a-block/swig/.libs:/home/aespiel1/gnuradio/gr-howto-write-a-block/python:/usr/local/lib/python2.7/dist-packages:/usr/local/lib/python2.7/dist-packages:
Traceback (most recent call last):
File “./qa_howto.py”, line 24, in
import howto
ImportError: No module named howto
FAIL: run_tests

1 of 1 test failed

make[2]: *** [check-TESTS] Error 1
make[2]: Leaving directory
/home/aespiel1/gnuradio/gr-howto-write-a-block/python' make[1]: *** [check-am] Error 2 make[1]: Leaving directory /home/aespiel1/gnuradio/gr-howto-write-a-block/python’
make: *** [check] Error 2

from a make check on the python library. I know it’s probably very
wrong (I
have little experience with editting makefiles, but my current makefile
configuration in the /lib folder is attached below.

So is the howto tutorial just out of date, or did I mess something up
(more
probable)? Please let me know if you have any suggestions.

Thank you very much for your time,
Andy S.

Attached Makefile.am:

Copyright 2004,2005,2006,2008,2009,2010 Free Software Foundation, Inc.

This file is part of GNU Radio

GNU Radio is free software; you can redistribute it and/or modify

it under the terms of the GNU General Public License as published by

the Free Software Foundation; either version 3, or (at your option)

any later version.

GNU Radio is distributed in the hope that it will be useful,

but WITHOUT ANY WARRANTY; without even the implied warranty of

MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the

GNU General Public License for more details.

You should have received a copy of the GNU General Public License

along with GNU Radio; see the file COPYING. If not, write to

the Free Software Foundation, Inc., 51 Franklin Street,

Boston, MA 02110-1301, USA.

include $(top_srcdir)/Makefile.common

ourpythondir = $(grpythondir)
ourlibdir = $(grpyexecdir)

INCLUDES = $(STD_DEFINES_AND_INCLUDES) $(PYTHON_CPPFLAGS)

SWIGCPPYTHONARGS = -noruntime -c++ -python $(PYTHON_CPPFLAGS)
-I$(swigincludedir) -I$(grincludedir)

ALL_IFILES =
$(LOCAL_IFILES)
$(NON_LOCAL_IFILES)

NON_LOCAL_IFILES =
%(GNURADIO_CORE_INCLUDEDIR)/swig/gnuradio.i

LOCAL_IFILES=
howto.i

BUILT_SOURCES =
howto.cc
howto.py

ourpython_PYTHON =
howto.py

ourlib_LTLIBRARIES = _howto.la

_howto_la_SOURCES =
howto.cc
howto_square_ff.cc

_howto_la_LDFLAGS = -module -avoid-version

_howto_la_LIBADD =
-lgrswigrunpy
-lstdc++

howto.cc howto.py: howto.i $(ALL_IFILES)
$(SWIG) $(SWIGCPPPYTHONARGS) - module howto -o howto.cc $<

grinclude_HEADERS =
howto_square_ff.h

swiginclude_HEADERS =
$(LOCAL_IFILES)

MOSTLYCLEANFILES = $(BUILT_SOURCES) *.pyc

list of programs run by “make check” and “make distcheck”

TESTS = test_all

----------------------------------------------------------------

howto C++ library: libgnuradio-howto.so

----------------------------------------------------------------

C/C++ headers get installed in ${prefix}/include/$(modname)

modinclude_HEADERS =
howto_square_ff.h
howto_square2_ff.h

lib_LTLIBRARIES = libgnuradio-howto.la

libgnuradio_howto_la_SOURCES =
howto_square_ff.cc
howto_square2_ff.cc

libgnuradio_howto_la_LIBADD =
$(GNURADIO_CORE_LA)

libgnuradio_howto_la_LDFLAGS = $(NO_UNDEFINED) $(LTVERSIONFLAGS)

----------------------------------------------------------------

howto C++ QA library: libgnuradio-howto-qa.so (not installed)

----------------------------------------------------------------

noinst_LTLIBRARIES = libgnuradio-howto-qa.la

libgnuradio_howto_qa_la_SOURCES =
qa_howto.cc
qa_howto_square_ff.cc
qa_howto_square2_ff.cc

libgnuradio_howto_qa_la_LDFLAGS = $(NO_UNDEFINED) -version-info 0:0:0

libgnuradio_howto_qa_la_LIBADD =
libgnuradio-howto.la
$(CPPUNIT_LIBS)

----------------------------------------------------------------

headers that don’t get installed

----------------------------------------------------------------

noinst_HEADERS =
qa_howto.h
qa_howto_square_ff.h
qa_howto_square2_ff.h

----------------------------------------------------------------

test program

----------------------------------------------------------------

noinst_PROGRAMS =
test_all

test_all_SOURCES = test_all.cc
test_all_LDADD = libgnuradio-howto-qa.la

The how-to’s are very out of date and glancing at the email list (in
forum form here: GNU Radio - Ruby-Forum ) you can see
that most cries for help go unanswered (understandable as people are
busy and if you’re determined you’ll figure this stuff out yourself…
eventually).

My best advice for you: if you want to write your own signal processing
blocks is to download something recent from CGRAN and use it as a
template:

https://www.cgran.org/browser/projects

Compare the working code and makefiles and such with the directiosn in
the old tutorial and you’ll probably figure it out.

I would give you more specific info except I don’t know much myself yet.
If I ever get a handle on this stuff, I will write some proper and up to
date tutorials so other people don’t have to suffer through this.

Hi,

For me, the easiest way to create my own block is to use the
create-gnuradio-out-of-tree-project command
(How to make my own block - GNU Radio - Ruby-Forum).

You have to create your .cc .h and .i files and change the
.i file.

Then you have to edit the Makefile.am in lib folder, and in the swig
folder.
(you can first just add your block and then worry about removing the
square’s_ff)

then in the top directory:

./bootstrap
./configure
make
make check
sudo make install

Hope this helps, and I think that I’m not forgetting nothing, but its
possible that I am.

On Tue, Aug 2, 2011 at 9:23 AM, Andrew S. [email protected]
wrote:

make[1]: Entering directory

from a make check on the python library. I know it’s probably very wrong (I
have little experience with editting makefiles, but my current makefile
configuration in the /lib folder is attached below.

So is the howto tutorial just out of date, or did I mess something up (more
probable)? Please let me know if you have any suggestions.

Thank you very much for your time,
Andy S.

Which version of GNU Radio are you running? This looks like an older
style of Makefile. Also, it looks like you’ve mixed in a bunch of
things into the Python directory that don’t need to be there. If you
work from the latest git (master branch), you should make sure that
you can build and make check the gr-howto-write-a-block that’s already
there and then start changing things.

Tom