discuss-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Discuss-gnuradio] adding python block to gnuradio


From: Serhat BOYNUKALIN
Subject: Re: [Discuss-gnuradio] adding python block to gnuradio
Date: Thu, 14 Mar 2013 09:58:21 +0200

1. step:

address@hidden:~$ gr_modtool.py create qpsk
Module directory is "./gr-qpsk".
Creating directory...
Copying howto example...
Unpacking...
Replacing occurences of 'howto' to 'qpsk'... Done.
Use 'gr_modtool add' to add a new block to this currently empty module.
address@hidden:~$ gr_modtool.py add
No GNU Radio module found in the given directory. Quitting.

2. step:

address@hidden:~$ cd  gr-qpsk

3. step:

address@hidden:~/gr-qpsk$ gr_modtool.py add
Operating in directory .
GNU Radio module name identified: qpsk
Enter code type: sync
Language: C++
Enter name of block/code (without module name prefix): QPSK
Block/code identifier: QPSK
Enter valid argument list, including default arguments: int val1, double val2=0
Add Python QA code? [Y/n] n
Add C++ QA code? [Y/n] y
Traversing lib...
Adding file 'QPSK_impl.h'...
Adding file 'QPSK_impl.cc'...
Adding file 'QPSK.h'...
Adding file 'qa_QPSK.cc'...
Adding file 'qa_QPSK.h'...
Traversing swig...
Editing swig/qpsk_swig.i...
Traversing grc...
Adding file 'qpsk_QPSK.xml'...
Editing grc/CMakeLists.txt...

4. step:


address@hidden:~/gr-qpsk$ gr_modtool.py add -l python
Operating in directory .
GNU Radio module name identified: qpsk
Enter code type: sync
Language: Python
Enter name of block/code (without module name prefix): QPSK
Block/code identifier: QPSK
Enter valid argument list, including default arguments: int val1, double val2=0
Add Python QA code? [Y/n] y
Traversing python...
Adding file 'QPSK.py'...
Adding Python QA...
Adding file 'qa_QPSK.py'...
Editing python/CMakeLists.txt...
Traversing grc...
Adding file 'qpsk_QPSK.xml'...
Editing grc/CMakeLists.txt...

before 5th step i had removed <+ your compan.. +> then

5. step:

address@hidden:~/gr-qpsk$ mkdir build && cd build && cmake ../ && make
-- The CXX compiler identification is GNU 4.7.2
-- The C compiler identification is GNU 4.7.2
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working C compiler: /usr/bin/gcc
-- Check for working C compiler: /usr/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Build type not specified: defaulting to release.
-- Boost version: 1.49.0
-- Found the following Boost libraries:
--   filesystem
--   system
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.26") 
-- checking for module 'gruel'
--   found gruel, version 3.6.4
-- Found GRUEL: /usr/local/lib/libgruel.so  
-- checking for module 'gnuradio-core'
--   found gnuradio-core, version 3.6.4
-- Found GNURADIO_CORE: /usr/local/lib/libgnuradio-core.so  
-- checking for module 'cppunit'
--   found cppunit, version 1.12.1
-- Found CPPUNIT: /usr/lib/libcppunit.so;dl  
-- Found SWIG: /usr/bin/swig2.0 (found version "2.0.7") 
-- Found PythonLibs: /usr/lib/python3.2/config/libpython3.2.so (found version "2.7.3") 
-- Found PythonInterp: /usr/bin/python (found version "2.7.3") 
-- Found Doxygen: /usr/bin/doxygen (found version "1.8.1.2") 
-- Configuring done
-- Generating done
-- Build files have been written to: /home/bynkln/gr-qpsk/build
Scanning dependencies of target gnuradio-qpsk
[  5%] Building CXX object lib/CMakeFiles/gnuradio-qpsk.dir/QPSK_impl.cc.o
/home/bynkln/gr-qpsk/lib/QPSK_impl.cc: In constructor ‘gr::qpsk::QPSK_impl::QPSK_impl(int, double)’:
/home/bynkln/gr-qpsk/lib/QPSK_impl.cc:42:30: error: expected primary-_expression_ before ‘<’ token
/home/bynkln/gr-qpsk/lib/QPSK_impl.cc:42:32: error: ‘MIN_IN’ was not declared in this scope
/home/bynkln/gr-qpsk/lib/QPSK_impl.cc:42:39: error: expected primary-_expression_ before ‘>’ token
/home/bynkln/gr-qpsk/lib/QPSK_impl.cc:42:40: error: expected primary-_expression_ before ‘,’ token
/home/bynkln/gr-qpsk/lib/QPSK_impl.cc:42:42: error: expected primary-_expression_ before ‘<’ token
/home/bynkln/gr-qpsk/lib/QPSK_impl.cc:42:44: error: ‘MAX_IN’ was not declared in this scope
/home/bynkln/gr-qpsk/lib/QPSK_impl.cc:42:51: error: expected primary-_expression_ before ‘>’ token
/home/bynkln/gr-qpsk/lib/QPSK_impl.cc:42:52: error: expected primary-_expression_ before ‘,’ token
/home/bynkln/gr-qpsk/lib/QPSK_impl.cc:42:62: error: expected primary-_expression_ before ‘<’ token
/home/bynkln/gr-qpsk/lib/QPSK_impl.cc:42:64: error: expected primary-_expression_ before ‘float’
/home/bynkln/gr-qpsk/lib/QPSK_impl.cc:42:64: error: expected ‘)’ before ‘float’
/home/bynkln/gr-qpsk/lib/QPSK_impl.cc:67:3: error: expected ‘{’ before ‘}’ token
make[2]: *** [lib/CMakeFiles/gnuradio-qpsk.dir/QPSK_impl.cc.o] Error 1
make[1]: *** [lib/CMakeFiles/gnuradio-qpsk.dir/all] Error 2
make: *** [all] Error 2
address@hidden:~/gr-qpsk/build$ 


then gived to me error like this, again... what shoul i do, thank you.

2013/3/13 Mike Jameson <address@hidden>
Hi Mohammed,

Nathan just beat me to it and as he said, this link explains more about gr_modtool:

http://gnuradio.org/redmine/projects/gnuradio/wiki/OutOfTreeModules

gr_modtool makes the template for you to paste your code into.

Here's my methodology on how I do it:

1) $ gr_modtool newmod
(type in your project name)

2) $ cd gr-<project name>

3) $ gr_modtool add
(you need to make a dummy c++ block before you can build the project and therefore to make a python template. pick 'sync' without any qa files. see: http://gnuradio.org/redmine/issues/522 for explanation)

4) $ gr_modtool add -l python
(this is where you make the python template, if in doubt pick the 'sync' block)

5) $ mkdir build && cd build && cmake ../ && make
(look at the errors and you will see that the '<+' and '+>' need to be removed from the files in order for it to compile. When make works, 'sudo make install' will put your new project into action. don't forget to reload GRC or hit the blue refresh button at the top.  the GRC templates need to be edited too in order for them to turn into GRC icons)

Once you can compile the templates successfully, modify the files that gr_modtool created by pasting in your code. Good luck :)

Mike

--
Mike Jameson M0MIK BSc
Radio Communications Technology Specialist
Email: address@hidden
Web: http://www.scanoo.com


On 13 March 2013 10:57, Mohammed Ramadan <address@hidden> wrote:
i made python block and want to add it to module in gnuradio, i open the directory of the module and use gr_motool add -t source filename.py. the tool created the .cc file and .h but as templates no processing done in the files.
so can anyone advise me to add python block?

_______________________________________________
Discuss-gnuradio mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio



_______________________________________________
Discuss-gnuradio mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio



reply via email to

[Prev in Thread] Current Thread [Next in Thread]