|
From: | Boschma, J.J. (Jeroen) |
Subject: | [Discuss-gnuradio] Help needed with hacking through SWIG / Python / custom block |
Date: | Tue, 18 Nov 2014 14:54:43 +0000 |
Hi all, I'm trying a sort of a 'hack', but it doesn't work so far. What I want to do is to add a method to the class in my custom block, and make this method available
in Python (the top_block.py). Without knowledge of SWIG I just tried the following things (where ZZZ is the name of my block): 1) Add the method protoype to ZZZ.h 2) Add the method protoype to ZZZ_impl.h 3) Implement the method in ZZZ_impl.cc 4) Empty the build/swig folder to force a swig rebuild 5) Run make again When running top_block.py I get the following errors (apparently my goal is not that simple): Traceback (most recent call last): File "top_block_modified.py", line 16, in <module> import TNO_JJJ_2014 File "/usr/local/lib/python2.7/dist-packages/TNO_JJJ_2014/__init__.py", line 45, in <module> from TNO_JJJ_2014_swig import * File "/usr/local/lib/python2.7/dist-packages/TNO_JJJ_2014/TNO_JJJ_2014_swig.py", line 28, in <module> _TNO_JJJ_2014_swig = swig_import_helper() File "/usr/local/lib/python2.7/dist-packages/TNO_JJJ_2014/TNO_JJJ_2014_swig.py", line 24, in swig_import_helper _mod = imp.load_module('_TNO_JJJ_2014_swig', fp, pathname, description) ImportError: /usr/local/lib/libgnuradio-TNO_JJJ_2014.so: undefined symbol: _ZN3uhd14tune_request_tC1Ed Make reported me before: Install the project... -- Install configuration: "Release" -- Up-to-date: /usr/local/lib/cmake/TNO_JJJ_2014/TNO_JJJ_2014Config.cmake -- Up-to-date: /usr/local/include/TNO_JJJ_2014/api.h -- Installing: /usr/local/include/TNO_JJJ_2014/JJJ_kernel.h -- Installing: /usr/local/lib/libgnuradio-TNO_JJJ_2014.so -- Installing: /usr/local/lib/python2.7/dist-packages/TNO_JJJ_2014/_TNO_JJJ_2014_swig.so -- Removed runtime path from "/usr/local/lib/python2.7/dist-packages/TNO_JJJ_2014/_TNO_JJJ_2014_swig.so" -- Installing: /usr/local/lib/python2.7/dist-packages/TNO_JJJ_2014/TNO_JJJ_2014_swig.py -- Installing: /usr/local/lib/python2.7/dist-packages/TNO_JJJ_2014/TNO_JJJ_2014_swig.pyc -- Installing: /usr/local/lib/python2.7/dist-packages/TNO_JJJ_2014/TNO_JJJ_2014_swig.pyo -- Up-to-date: /usr/local/include/TNO_JJJ_2014/TNO_JJJ_2014/swig/TNO_JJJ_2014_swig.i -- Installing: /usr/local/include/TNO_JJJ_2014/TNO_JJJ_2014/swig/TNO_JJJ_2014_swig_doc.i -- Up-to-date: /usr/local/lib/python2.7/dist-packages/TNO_JJJ_2014/__init__.py -- Up-to-date: /usr/local/lib/python2.7/dist-packages/TNO_JJJ_2014/__init__.pyc -- Up-to-date: /usr/local/lib/python2.7/dist-packages/TNO_JJJ_2014/__init__.pyo -- Up-to-date: /usr/local/share/gnuradio/grc/blocks/TNO_JJJ_2014_JJJ_kernel.xml Anybody knows what I have to add/change to get this working? Maybe something in the __init__.py file? If so, how do I generate the corresponding .pyc and .pyo
files? Best regards, Jeroen
This message may contain information that is not intended for you. If you are not the addressee or if this message was sent to you by mistake, you are requested to inform the sender and delete the message. TNO accepts no liability for the content of this e-mail, for the manner in which you use it and for damage of any kind resulting from the risks inherent to the electronic transmission of messages. |
[Prev in Thread] | Current Thread | [Next in Thread] |