skysafe / gr-sigmf

GNURadio blocks to read, write, and modify SigMF datasets

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Time mode enum class has swig compatibility problems

zleffke opened this issue · comments

Hello, first off let me apologize in advance because this is likely operator error, so not sure if its actually an issue....I'm a 'user' of GNU Radio, not much of a developer, so please forgive my ignorance here.

I have GNU Radio installed with pybombs. I am trying to install your gr-sigmf blocks, but keep running into a problem during compilation. It appears to be a SWIG related problem. I have installed RapidJSON (not the current problem, but a dependency that might need to be included in future pybombs recipes), I have tried upgrading to GCC 6 (reference to the issue in time_mode.h comments), and updating to the most current version of GNU Radio. I have created a pybombs recipe for gr-sigmf which is located in my own recipes repo and is working with my pybombs setup. I have tried installing gr-sigmf via pybombs with my recipe and via a direct clone cmake/make process, both with the same problem compiling. It appears to be linked to something with SWIG or possibly a syntax error in time_mode.h (though this might be a symptom of something 'upstream' in the compile process)?

Not really sure how to proceed. Below is the terminal output from the 'make' execution. Originally this was cloned/attempted via the pybombs process. the exact output below was from me drilling into the pybombs src directory down into the build directory for gr-sigmf and manually executing 'make'.

Please let me know if there is any further info needed or if you have any tips to get past this to get gr-sigmf to install.

Thanks!
Zach, KJ4QLP

Here is the output from executing make:
[ 5%] Shebangin sigmf_archive.py
[ 5%] Building CXX object swig/CMakeFiles/_sigmf_swig_doc_tag.dir/_sigmf_swig_doc_tag.cpp.o
[ 8%] Generating documentation with doxygen
[ 11%] Shebangin sigmf_hash.py
[ 13%] Generating init.pyc
[ 16%] Generating init.pyo
[ 19%] Building CXX object lib/CMakeFiles/gnuradio-sigmf.dir/meta_namespace.cc.o
[ 22%] Building CXX object lib/CMakeFiles/gnuradio-sigmf.dir/sink_impl.cc.o
[ 25%] Building CXX object lib/CMakeFiles/gnuradio-sigmf.dir/source_impl.cc.o
[ 27%] Building CXX object lib/CMakeFiles/gnuradio-sigmf.dir/sigmf_utils.cc.o
[ 27%] Built target pygen_apps_a4c48
[ 30%] Linking CXX executable _sigmf_swig_doc_tag
[ 33%] Building CXX object lib/CMakeFiles/gnuradio-sigmf.dir/annotation_sink_impl.cc.o
[ 33%] Built target pygen_python_2b29d
[ 36%] Building CXX object lib/CMakeFiles/gnuradio-sigmf.dir/writer_utils.cc.o
[ 36%] Built target _sigmf_swig_doc_tag
[ 38%] Building CXX object lib/CMakeFiles/gnuradio-sigmf.dir/reader_utils.cc.o
[ 38%] Built target doxygen_target
[ 41%] Generating doxygen xml for sigmf_swig_doc docs
[ 44%] Generating python docstrings for sigmf_swig_doc
[ 44%] Built target sigmf_swig_swig_doc
[ 47%] Building CXX object swig/CMakeFiles/_sigmf_swig_swig_tag.dir/_sigmf_swig_swig_tag.cpp.o
[ 50%] Linking CXX executable _sigmf_swig_swig_tag
[ 50%] Built target _sigmf_swig_swig_tag
[ 52%] Generating sigmf_swig.tag
Scanning dependencies of target sigmf_swig_swig_2d0df
[ 55%] Building CXX object swig/CMakeFiles/sigmf_swig_swig_2d0df.dir/sigmf_swig_swig_2d0df.cpp.o
[ 58%] Linking CXX executable sigmf_swig_swig_2d0df
Swig source
/src/gr-sigmf/include/sigmf/time_mode.h:12: Error: Syntax error in input(1).
swig/CMakeFiles/sigmf_swig_swig_2d0df.dir/build.make:133: recipe for target 'swig/sigmf_swig_swig_2d0df' failed
make[2]: *** [swig/sigmf_swig_swig_2d0df] Error 1
make[2]: *** Deleting file 'swig/sigmf_swig_swig_2d0df'
CMakeFiles/Makefile2:307: recipe for target 'swig/CMakeFiles/sigmf_swig_swig_2d0df.dir/all' failed
make[1]: *** [swig/CMakeFiles/sigmf_swig_swig_2d0df.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 61%] Building CXX object lib/CMakeFiles/gnuradio-sigmf.dir/usrp_gps_message_source_impl.cc.o
[ 63%] Linking CXX shared library libgnuradio-sigmf-1.1.5git.so
[ 63%] Built target gnuradio-sigmf
Makefile:138: recipe for target 'all' failed
make: *** [all] Error 2

Thanks for the heads up! None of us (gr-sigmf devs) use pybombs for our primary environments, so it's possible we have done something in an inconsistent way which is breaking in pybombs. We'll try it out and see if we can reproduce this issue.

Just to confirm, this is the recipe you are using?
https://github.com/zleffke/gr-kj4qlp-recipes/blob/master/gr-sigmf.lwr

Also, could you share what distribution you are running on, as well as the output of swig -version?

Hello! Yep thats the recipe I'm using.
The output of swig -version is:

SWIG Version 2.0.12

Compiled with g++ [x86_64-pc-linux-gnu]

Configured options: +pcre

Also I should mention that before I attempted the pybombs/recipe install, I attempted a clone/compile separately using cmake flags to install to the GNU Radio target directory. Same results, but then again its basically the same process as a pybombs/recipe type install.

Thanks again for the help.
-Zach

Ok, thanks. I'm pretty sure that this is unrelated to pybombs, and the issue is that swig 2.0.12 doesn't understand C++11 enum class. I don't know what version of swig added support for that (or why an `enum class`` is used there), but at the moment I can offer that swig 3.0.12 is known to work (Ubuntu 18.04 LTS).

We'll look at this in more detail and see if we can swap to a more compatible parameter type, or at least figure out exactly what swig version is necessary.

As of roughly 763d6f4, this is superseded by GNU Radio moving from swig to pybind11, and gr-sigmf's corresponding changes.