2

I have such a file ( ~/Pobrane/multi-rtl/swig/multi_rtl_swig.i ) :

/* -*- c++ -*- */

#define MULTI_RTL_API

%include "gnuradio.i"           // the common stuff
%include "feval.i"

//load generated python docstrings
%include "multi_rtl_swig_doc.i"

%{
#include "multi_rtl/vector_sink_cn.h"
%}

%include "multi_rtl/vector_sink_cn.h"
GR_SWIG_BLOCK_MAGIC2(multi_rtl, vector_sink_cn);

and I get following error during make process:

[ 26%] Swig source multi_rtl_swig.i
Deprecated command line option: -modern. This option is now always on.
~/Pobrane/multi-rtl/swig/multi_rtl_swig.i:5: Error: Unable to find 'gnuradio.i'
~/Pobrane/multi-rtl/swig/multi_rtl_swig.i:6: Error: Unable to find 'feval.i'
make[2]: *** [swig/CMakeFiles/multi_rtl_swig_swig_compilation.dir/build.make:81: swig/CMakeFiles/multi_rtl_swig.dir/multi_rtl_swigPYTHON.stamp] Error 1
make[2]: *** Delete file 'swig/CMakeFiles/multi_rtl_swig.dir/multi_rtl_swigPYTHON.stamp'
make[2]: Opuszczenie katalogu '~/Pobrane/multi-rtl/build'
make[1]: *** [CMakeFiles/Makefile2:407: swig/CMakeFiles/multi_rtl_swig_swig_compilation.dir/all] Błąd 2
make[1]: Opuszczenie katalogu '~/Pobrane/multi-rtl/build'
make: *** [Makefile:158: all] Błąd 2

Of course I have these files in such directories:

gnuradio.i - /usr/include/gnuradio/swig/gnuradio.i
feval.i - /usr/include/gnuradio/swig/feval.i

This error occurred during following command ( I know from make VERBOSE=1 command ):

cd ~/Pobrane/multi-rtl/build/swig && /usr/bin/cmake -E env SWIG_LIB=/usr/share/swig/4.0.1 /usr/bin/swig -python -fvirtual -modern -keyword -w511 -w314 -relativeimport -module multi_rtl_swig -I~/Pobrane/multi-rtl/lib -I~/Pobrane/multi-rtl/include -I~/Pobrane/multi-rtl/build/lib -I~/Pobrane/multi-rtl/build/include -I/usr/include -I/usr/include -I~/Pobrane/multi-rtl/build/swig -I~/Pobrane/multi-rtl/swig -I/usr/include/python2.7 -I/usr/include -I/usr/include -I/usr/include -I/usr/include -I/usr/include -I/usr/include -I/usr/include -I/usr/include -I/usr/include -I/usr/include -I/usr/include -I/usr/include -I/usr/include -I~/Pobrane/multi-rtl/lib -I~/Pobrane/multi-rtl/include -I~/Pobrane/multi-rtl/build/lib -I~/Pobrane/multi-rtl/build/include -I/usr/include -I/usr/include -I~/Pobrane/multi-rtl/build/swig -I~/Pobrane/multi-rtl/swig -I/usr/include/python2.7 -I/usr/include -I/usr/include -I/usr/include -I/usr/include -I/usr/include -I/usr/include -I/usr/include -I/usr/include -I/usr/include -I/usr/include -I/usr/include -I/usr/include -I/usr/include -outdir ~/Pobrane/multi-rtl/build/swig -c++ -I~/Pobrane/multi-rtl/lib -I~/Pobrane/multi-rtl/include -I~/Pobrane/multi-rtl/build/lib -I~/Pobrane/multi-rtl/build/include -I/usr/include -o ~/Pobrane/multi-rtl/build/swig/CMakeFiles/multi_rtl_swig.dir/multi_rtl_swigPYTHON_wrap.cxx ~/Pobrane/multi-rtl/swig/multi_rtl_swig.i

I wonder where this error comes from, what it is caused and how can I fix it.

EDIT

I know what's causing the problem. I use deprecated ${GNURADIO_RUNTIME_INCLUDE_DIRS} macro. After replacing

foreach(incdir ${GNURADIO_RUNTIME_INCLUDE_DIRS})
    list(APPEND GR_SWIG_INCLUDE_DIRS ${incdir}/gnuradio/swig)
endforeach(incdir)

with

list(APPEND GR_SWIG_INCLUDE_DIRS "/usr/local/include/gnuradio/swig")
list(APPEND GR_SWIG_INCLUDE_DIRS "/usr/include/gnuradio/swig")

everything works. However, this is a temporary solution. How can I implement similar functionality in gnuradio 3.8?

  • Is this a GNU Radio OOT, or where does your CMake infrastructure come from? – Marcus Müller Apr 03 '20 at 18:27
  • I'm trying to build this project https://github.com/ptrkrysik/multi-rtl – Roman Kwaśniewski Apr 03 '20 at 18:29
  • Ah, Piotr's Mult-RTL project! That was last updated in 2017, so probably works with GNU Radio 3.7.13.5; which version of GNU Radio are you using? – Marcus Müller Apr 03 '20 at 18:40
  • 2
    I know that this is for gnuradio 3.7 but I want to make it work with gnu radio 3.8 I've already ported a few things and now I get ... this. – Roman Kwaśniewski Apr 03 '20 at 18:46
  • That is important info and should be part of your question! How much of the old 3.7-CMake infrastructure did you keep, what have you replaced with new files from 3.8? – Marcus Müller Apr 03 '20 at 18:48
  • I followed this guide - https://wiki.gnuradio.org/index.php/GNU_Radio_3.8_OOT_Module_Porting_Guide Currently I just made some improvements described as "modern CMake" updates ( e.g. gnuradio::gnuradio-$component instead of ${GNURADIO_ALL_LIBRARIES} ) Before I went to xml to yaml conversion I discovered that it's not enough and I can't build the project. – Roman Kwaśniewski Apr 03 '20 at 18:59
  • @RomanKwaśniewski Can you publish your modifications so we can take a look at all cmake files? – Vasil Velichkov Apr 03 '20 at 19:18
  • Here you have https://drive.google.com/open?id=1KWY4UxXEc6-Ef1l_5H3n89euOF7WxxhM – Roman Kwaśniewski Apr 03 '20 at 19:43

1 Answers1

3

As you've found out you need to edit swig/CMakeLists.txt and replace the foreach loop where paths gets added to the GR_SWIG_INCLUDE_DIRS variable with

set(GR_SWIG_INCLUDE_DIRS $<TARGET_PROPERTY:gnuradio::runtime_swig,INTERFACE_INCLUDE_DIRECTORIES>)
set(GR_SWIG_TARGET_DEPS gnuradio::runtime_swig)
Vasil Velichkov
  • 1,236
  • 11
  • 17