2

i am trying to install a own Block for gnuradio. I go through this(http://gnuradio.org/redmine/projects/gnuradio/wiki/Guided_Tutorial_GNU_Radio_in_C++) tutorial. But in Step 5, Installing, I get some problems.

I installed it, but i didnt see the Block in gnuradio-companion. I added the path:

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

export GRC_BLOCKS_PATH=/usr/local/share/gnuradio/grc/blocks/

Now i can see the Block: But if I want to use it, the gnuradio-companion crash.

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

Gnuradio Version: 3.7.10.1

OS: OS X El Capitan

What could be the problem? Wrong/Missing path? Mistake in the program?

/edit2: To add a Block, writen in python works fine(With the tutorial: http://gnuradio.org/redmine/projects/gnuradio/wiki/Guided_Tutorial_GNU_Radio_in_Python)

/edit: When I install it, I get many warnings when i use 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
knuut
  • 71
  • 7
  • Questions about general computing hardware and software are off-topic for Stack Overflow unless they directly involve tools used primarily for programming. You may be able to get help on [Super User](http://superuser.com/). – Ivan Rubinson Sep 08 '16 at 10:31

1 Answers1

1

This happens when GNU Radio and your module are linked against different Python libraries.

On OSX, there is usually a system installation and another one from Homebrew or MacPorts. Try linking everything against the Homebrew/MacPorts libraries.

You seem to have a Python installation in /opt/local. Use cmake to reconfigure your module and point PYTHON_LIBRARY and PYTHON_INCLUDE_DIR to the installation in /opt.

bastibl
  • 181
  • 2
  • Thanks for your answer! I found this in CMakeCache.txt: //Path to a program. PYTHON_EXECUTABLE:FILEPATH=/opt/local/bin/python2.7 //Path to a file. PYTHON_INCLUDE_DIR:PATH=/usr/include/python2.7 //Path to a library. PYTHON_LIBRARY:FILEPATH=/usr/lib/libpython2.7.dylib Soo, i have to change the path? But i have no clue, how to do this. – knuut Sep 08 '16 at 13:50
  • I also get the same warning with cmake, when I write a new Block in python- but that works fine. – knuut Sep 08 '16 at 14:00
  • 1
    The problem is about linking different Python libraries in one executable. That's a problem of C++ that, of course, doesn't occur with Python-only blocks. There are multiple frontends that ease reconfiguration of cmake projects. You could search for cmake-gui, cmake-qt-gui, ccmake, etc. – bastibl Sep 08 '16 at 14:45
  • Solved it with:
    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/site-packages -DCMAKE_INSTALL_PREFIX=/opt/local -DPYTHON_EXECUTABLE=/opt/local/bin/python2.7 -DQA_PYTHON_EXECUTABLE=/opt/local/bin/python2.7 ..
    – knuut Sep 13 '16 at 18:57