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: Nathan West
Subject: Re: [Discuss-gnuradio] adding python block to gnuradio
Date: Thu, 14 Mar 2013 03:12:47 -0500

On Thu, Mar 14, 2013 at 2:58 AM, Serhat BOYNUKALIN
<address@hidden> wrote:
>
> 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.

As the error message indicates this last command didn't do anything.

>
> 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

>From http://gnuradio.org/redmine/projects/gnuradio/wiki/OutOfTreeModules
The C++ code (part 1)

"gr_modtool hints at where you have to change code by adding <++> symbols."

>
> 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.

Look at those line numbers that give errors. You need to replace the
"<++ hint ++>"  with actual C++ code.

As a side note, unless you're doing something fancy there's already a
QPSK modulator/demodulator that comes with GR as a python hier_block.
It's in gr-digital/python/psk.py .

-Nathan



reply via email to

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