【问题标题】:Gnuradio crash after installing own block安装自己的块后 Gnuradio 崩溃
【发布时间】:2023-03-28 01:48:02
【问题描述】:

我正在尝试为 gnuradio 安装自己的 Block。我通过这个(http://gnuradio.org/redmine/projects/gnuradio/wiki/Guided_Tutorial_GNU_Radio_in_C++) 教程。但是在第 5 步,安装中,我遇到了一些问题。

我安装了它,但我没有在 gnuradio-companion 中看到 Block。 我添加了路径:

导出 PYTHONPATH=/usr/local/lib/python2.7/site-packages/

导出 GRC_BLOCKS_PATH=/usr/local/share/gnuradio/grc/blocks/

现在我可以看到 Block:但如果我想使用它,gnuradio-companion 会崩溃。

^[[A^[[BFatal Python error: PyThreadState_Get: no current thread
Abort trap: 6

Gnuradio 版本:3.7.10.1

操作系统:OS X El Capitan

可能是什么问题?错误/缺少路径?程序出错了?

/edit2:要添加一个Block,用python写就可以了(附教程:http://gnuradio.org/redmine/projects/gnuradio/wiki/Guided_Tutorial_GNU_Radio_in_Python

/edit: 当我安装它时,我在使用 cmake 时收到很多警告:

-- Build type not specified: defaulting to release.
-- Boost version: 1.59.0
-- Found the following Boost libraries:
--   filesystem
--   system
Checking for GNU Radio Module: RUNTIME
 * INCLUDES=/opt/local/include
 * LIBS=/opt/local/lib/libgnuradio-runtime.dylib;/opt/local/lib/libgnuradio-pmt.dylib
GNURADIO_RUNTIME_FOUND = TRUE
CMake Warning (dev) at cmake/Modules/GrTest.cmake:45 (get_target_property):
  Policy CMP0026 is not set: Disallow use of the LOCATION target property.
  Run "cmake --help-policy CMP0026" for policy details.  Use the cmake_policy
  command to set the policy and suppress this warning.

  The LOCATION property should not be read from target "test-tutorialCPP".
  Use the target name directly with add_custom_command, or use the generator
  expression $<TARGET_FILE>, as appropriate.

Call Stack (most recent call first):
  lib/CMakeLists.txt:77 (GR_ADD_TEST)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Using install prefix: /usr/local
-- Building for version: v1.0-compat-xxx-xunknown / 1.0.0git
-- 
-- Checking for module SWIG
-- Found SWIG version 3.0.10.
CMake Warning (dev) at cmake/Modules/GrTest.cmake:45 (get_target_property):
  Policy CMP0026 is not set: Disallow use of the LOCATION target property.
  Run "cmake --help-policy CMP0026" for policy details.  Use the cmake_policy
  command to set the policy and suppress this warning.

  The LOCATION property should not be read from target
  "gnuradio-tutorialCPP".  Use the target name directly with
  add_custom_command, or use the generator expression $<TARGET_FILE>, as
  appropriate.

Call Stack (most recent call first):
  python/CMakeLists.txt:44 (GR_ADD_TEST)
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) at cmake/Modules/GrTest.cmake:45 (get_target_property):
  Policy CMP0045 is not set: Error on non-existent target in
  get_target_property.  Run "cmake --help-policy CMP0045" for policy details.
  Use the cmake_policy command to set the policy and suppress this warning.

  get_target_property() called with non-existent target
  "/opt/local/bin/python2.7".
Call Stack (most recent call first):
  python/CMakeLists.txt:44 (GR_ADD_TEST)
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) at cmake/Modules/GrTest.cmake:45 (get_target_property):
  Policy CMP0045 is not set: Error on non-existent target in
  get_target_property.  Run "cmake --help-policy CMP0045" for policy details.
  Use the cmake_policy command to set the policy and suppress this warning.

  get_target_property() called with non-existent target
  "/Users/abc/dev/gnuradio/modul/gr-tutorialCPP/python/qa_my_qpsk_demod_cb.py".
Call Stack (most recent call first):
  python/CMakeLists.txt:44 (GR_ADD_TEST)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Configuring done
-- Generating done
-- Build files have been written to: /Users/abc/dev/gnuradio/modul/gr-tutorialCPP/build

【问题讨论】:

  • 有关通用计算硬件和软件的问题对于 Stack Overflow 来说是题外话,除非它们直接涉及主要用于编程的工具。您可以通过 Super User 获得帮助。

标签: c++ macos python-2.7 gnuradio gnuradio-companion


【解决方案1】:

当 GNU Radio 和您的模块链接到不同的 Python 库时会发生这种情况。

在 OSX 上,通常有一个系统安装和另一个来自 Homebrew 或 MacPorts 的安装。尝试将所有内容与 Homebrew/MacPorts 库链接。

您似乎在/opt/local 中安装了 Python。使用 cmake 重新配置您的模块并将 PYTHON_LIBRARYPYTHON_INCLUDE_DIR 指向 /opt 中的安装。

【讨论】:

  • 感谢您的回答!我在 CMakeCache.txt 中找到了这个://程序的路径。 PYTHON_EXECUTABLE:FILEPATH=/opt/local/bin/python2.7 //文件路径。 PYTHON_INCLUDE_DIR:PATH=/usr/include/python2.7 //库的路径。 PYTHON_LIBRARY:FILEPATH=/usr/lib/libpython2.7.dylib Soo,我必须更改路径吗?但我不知道该怎么做。
  • 当我在 python 中编写一个新块时,我也收到了与 cmake 相同的警告,但效果很好。
  • 问题在于将不同的 Python 库链接到一个可执行文件中。这是 C++ 的一个问题,当然,Python-only 块不会出现这个问题。有多个前端可以简化 cmake 项目的重新配置。您可以搜索 cmake-gui、cmake-qt-gui、ccmake 等。
  • 已解决:
    cmake -DPYTHON_INCLUDE_DIR=/opt/local/Library/Frameworks/Python.framework/Versions/2.7/Headers -DPYTHON_LIBRARY=/opt/local/Library/Frameworks/ Python.framework/Versions/2.7/Python -DSPHINX_EXECUTABLE=/opt/local/bin/rst2html-2.7.py -DGR_PYTHON_DIR=/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/站点包 -DCMAKE_INSTALL_PREFIX=/opt/local -DPYTHON_EXECUTABLE=/opt/local/bin/python2.7 -DQA_PYTHON_EXECUTABLE=/opt/local/bin/python2.7 ..
猜你喜欢
  • 2017-08-18
  • 2018-08-22
  • 2012-12-01
  • 1970-01-01
  • 1970-01-01
  • 2020-07-22
  • 2018-06-11
  • 2019-02-26
  • 2017-08-23
相关资源
最近更新 更多