GNU Radio OOT 块:AttributeError:'module' 对象没有属性 'pthread'(使用 ZeroMQ 套接字) [英] GNU Radio OOT block : AttributeError: 'module' object has no attribute 'pthread' (using ZeroMQ sockets)

查看:34
本文介绍了GNU Radio OOT 块:AttributeError:'module' 对象没有属性 'pthread'(使用 ZeroMQ 套接字)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我用 C++ 在 GNU Radio 中开发了一个 Out of tree 块.我正在使用 ZMQ 套接字,它是通过 <zmq.hpp> 实现的.库,通过两个线程传递数据.

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.

当我尝试在 GNU Radio 伴侣中执行我的 OOT 块(pthread 块)时,它出现的是:AttributeError: 'module' object has no attribute 'pthread'.

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

回溯(最近一次调用最后一次):文件/home/itupac/workarea-gnuradio/Labs/pthread/top_block.py",第 161 行,在 中.main() 文件/home/itupac/workarea-gnuradio/Labs/pthread/top_block.py",第 149 行,主 tb = top_block_cls() 文件/home/itupac/workarea-gnuradio/Labs/pthread/top_block.py",第 116 行,在 __init__ self.pthread_pthread_0 = pthread.pthread() AttributeError: 'module' object has no attribute 'pthread'

这些天我一直在努力解决这个错误...我在顶部的 CMakeLists.txt 这一行中添加了 ZEROQM 这个词:set(GR_REQUIRED_COMPONENTS RUNTIME ZEROMQ),但它仍然不起作用.

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.

我在 github 中有我的块的 OOT 代码:https://github.com/isaactd92/gr-pthread.git.

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.

推荐答案

我解决了这个问题....线索在 CMakeLists.txt 中:

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

  1. 下载并安装数据包:https://github.com/zeromq/cppzmq.这将带来 zmq.hpp 库和 ZeroMQconfig.cmake
  2. 配置位于 (${SOURCE_DIRECTORY}) 中的 CMakeLists.txt.在#Find gnuradio build dependencies中添加find_package(ZeroMQ).
  3. 配置位于/lib 中的 CMakeLists.txt.在 target_link_libraries 中包含 zmq.
  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.

照常构建您的 OOT 块,它会识别 zmq 套接字并消除问题:)

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

这篇关于GNU Radio OOT 块:AttributeError:'module' 对象没有属性 'pthread'(使用 ZeroMQ 套接字)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆