Thanks Martin, Now I'm able to add running blocks. However, if I want to add a block written only in Python - there are no C++ files -, I add it with gr_modtool,
gr_modtool add -t sync -l python square3_ff Then it gives the following error, You have called ADD_LIBRARY for library gnuradio-howto without any source files. This typically indicates a problem with your CMakeLists.txt file CMake Error: CMake can not determine linker language for target:gnuradio-howto CMake Error: Cannot determine link language for target "gnuradio-howto". If I add a C++ block with gr_modtool add -t general square_ff then the error disappears. What should I do if I want to add a block written only in Python? And I'm looking for a pure Python block with file-input file-output operations? Does Gnuradio have such a block as reference? Thanks in advance, Tarik ___________________________________ Aydin Tarik Zengin On Tue, Oct 29, 2013 at 5:38 PM, Martin Braun (CEL) <martin.br...@kit.edu>wrote: > Hi Tarik, > > On Tue, Oct 29, 2013 at 04:43:53PM +0200, Aydin Tarik Zengin wrote: > > I'm getting an error while adding a new block to grc version > > 3.7.2git-110-gb8b9bff2. > > I followed the tutorial at > http://gnuradio.org/redmine/projects/gnuradio/wiki/ > > OutOfTreeModules > > > > Also had to modify at some points as below. > > - in the test code it worked when I changed ; > > > > from gnuradio import gr, gr_unittest into from gnuradio import gr, > gr_unittest, > > blocks > > Thanks, there were some references to GNU Radio 3.6-style blocks. I've > updated the tutorial to reflect that. > > > > All the tests pass too. > > 100% tests passed, 0 tests failed out of 2 > > Did you add a test for the Python block? (Perhaps there's a problem > in the Python, which would show up here). > > > I added 3 blocks using c++ for first 2 and python for the last as > explained in > > the tutorial. > > I can see the blocks in the grc block list and can add them into the > sketch. > > It generates the python code without any error. > > But the generated python code cannot be run and giving the error below: > > > > Traceback (most recent call last): > > File "top_block.py", line 82, in <module> > > tb = top_block() > > File "top_block.py", line 48, in __init__ > > self.test_square3_ff_0 = test.square3_ff() > > AttributeError: 'module' object has no attribute 'square3_ff' > > > > You can see the generated file from http://pastebin.com/nE4SFn8Y > > > > test module is placed under /usr/lib/python2.7/site-packages/test > > gnuradio is under /usr/lib/python2.7/site-packages/gnuradio > > > > Is there any point in the tutorial that does not match with the current > version > > of gnuradio? > > Yes there is, but I'm not sure that's the problem. I couldn't replicate > your problem, however. > Make sure > - your Python block works correctly (unit test it) > - the XML definition for the GRC block is correct > - everything is installed correctly. > > Perhaps you want to go over the tutorial with the updated info again. > > MB > > -- > Karlsruhe Institute of Technology (KIT) > Communications Engineering Lab (CEL) > > Dipl.-Ing. Martin Braun > Research Associate > > Kaiserstraße 12 > Building 05.01 > 76131 Karlsruhe > > Phone: +49 721 608-43790 > Fax: +49 721 608-46071 > www.cel.kit.edu > > KIT -- University of the State of Baden-Württemberg and > National Laboratory of the Helmholtz Association > > _______________________________________________ > Discuss-gnuradio mailing list > Discuss-gnuradio@gnu.org > https://lists.gnu.org/mailman/listinfo/discuss-gnuradio > >
_______________________________________________ Discuss-gnuradio mailing list Discuss-gnuradio@gnu.org https://lists.gnu.org/mailman/listinfo/discuss-gnuradio