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

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

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

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

现在我可以看到该块:但是,如果我要使用它,gnuradio-companion崩溃。

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

Gnuradio版本:3.7.10.1

操作系统:OS X El Capitan

可能是什么问题呢?错误/缺少路径?该计划有误吗?

/ edit2:要添加一个块,用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

最佳答案

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

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

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

关于c++ - 安装自己的块后,Gnuradio崩溃,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/39388386/

10-10 09:27