GNU Radio OOT block : AttributeError: 'module' object has no attribute 'pthread' (using ZeroMQ sockets)

白昼怎懂夜的黑 提交于 2020-12-15 08:35:01

问题


I've developed an Out of tree block in GNU Radio with C++. I'm using the ZMQ sockets,which are implemented with the <zmq.hpp> library, to pass data through two threads.

When I try to execute my OOT block (pthread block) in GNU Radio companion, what it appears is: AttributeError: 'module' object has no attribute 'pthread'.

Traceback (most recent call last): File "/home/itupac/workarea-gnuradio/Labs/pthread/top_block.py", line 161, in <module> main() File "/home/itupac/workarea-gnuradio/Labs/pthread/top_block.py", line 149, in main tb = top_block_cls() File "/home/itupac/workarea-gnuradio/Labs/pthread/top_block.py", line 116, in __init__ self.pthread_pthread_0 = pthread.pthread() AttributeError: 'module' object has no attribute 'pthread'

I've been trying to solve this error these days... I added in the top CMakeLists.txt the word ZEROQM in this line: set(GR_REQUIRED_COMPONENTS RUNTIME ZEROMQ), but it still doesn't work.

I have the OOT code of my block in github: https://github.com/isaactd92/gr-pthread.git.

I really appreciate any help in this issue. Regards Isaac.


回答1:


I resolved the problem.... The clue was in the CMakeLists.txt:

  1. Download and install the packet:https://github.com/zeromq/cppzmq. This will bring the zmq.hpp library and the ZeroMQconfig.cmake
  2. Configure the CMakeLists.txt located in the (${SOURCE_DIRECTORY}). Add find_package(ZeroMQ) in the # Find gnuradio build dependencies.
  3. Configure the CMakeLists.txt located in the /lib. In target_link_libraries includes zmq.

Build your OOT block as normal and It will recognize the zmq sockets and will disappear the problem :)



来源:https://stackoverflow.com/questions/64050775/gnu-radio-oot-block-attributeerror-module-object-has-no-attribute-pthread

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!