balint256 / gr-baz

Collection of new blocks for GNU Radio
http://wiki.spench.net/wiki/gr-baz
GNU General Public License v3.0
192 stars 78 forks source link

Build failure with GR 3.7.4 on Arch #23

Closed chrisnorthcott closed 10 years ago

chrisnorthcott commented 10 years ago

The current gr-baz git will not build giving a bunch of compilation errors in swig/. All dependencies are installed. All goes well up until compiling the swig wrapper stuff:

[ 50%] Building CXX object lib/CMakeFiles/gnuradio-baz.dir/baz_radar_detector.cc.o [ 52%] Building CXX object lib/CMakeFiles/gnuradio-baz.dir/baz_fastrak_decoder.cc.o [ 55%] Building CXX object lib/CMakeFiles/gnuradio-baz.dir/baz_rtl_source_c.cc.o [ 57%] Building CXX object lib/CMakeFiles/gnuradio-baz.dir/rtl2832.cc.o [ 60%] Building CXX object lib/CMakeFiles/gnuradio-baz.dir/rtl2832-tuner_e4000.cc.o [ 62%] Building CXX object lib/CMakeFiles/gnuradio-baz.dir/rtl2832-tuner_fc0013.cc.o [ 65%] Building CXX object lib/CMakeFiles/gnuradio-baz.dir/rtl2832-tuner_fc0012.cc.o [ 67%] Building CXX object lib/CMakeFiles/gnuradio-baz.dir/rtl2832-tuner_fc2580.cc.o [ 70%] Building CXX object lib/CMakeFiles/gnuradio-baz.dir/rtl2832-tuner_r820t.cc.o [ 72%] Building CXX object lib/CMakeFiles/gnuradio-baz.dir/rtl2832-tuner_e4k.cc.o [ 75%] Building CXX object lib/CMakeFiles/gnuradio-baz.dir/baz_gate.cc.o Linking CXX shared library libgnuradio-baz.so [ 75%] Built target gnuradio-baz Scanning dependencies of target baz_swig_swig_doc [ 75%] Built target baz_swig_swig_doc Scanning dependencies of target _baz_swig_swig_tag [ 77%] Building CXX object swig/CMakeFiles/_baz_swig_swig_tag.dir/_baz_swig_swig_tag.cpp.o Linking CXX executable _baz_swig_swig_tag [ 77%] Built target _baz_swig_swig_tag [ 80%] Generating baz_swig.tag [ 82%] Swig source Scanning dependencies of target _baz_swig [ 85%] Building CXX object swig/CMakeFiles/_baz_swig.dir/baz_swigPYTHON_wrap.cxx.o /home/chris/gr-baz/b/swig/baz_swigPYTHON_wrap.cxx: In function 'std::vectorstd::basic_string* std_vector_Sl_std_string_SggetitemSWIG_0(std::vectorstd::basicstring, PySliceObject_)': /home/chris/gr-baz/b/swig/baz_swigPYTHONwrap.cxx:5646:90: error: cannot convert 'PySliceObject' to 'PyObject_ {aka object}' for argument '1' to 'int PySliceGetIndices(PyObject, Py_ssize_t, Py_ssizet, Py_ssizet, Py_ssizet)' PySlice_GetIndices(SWIGPY_SLICE_ARG(slice), (Py_ssize_t)self->size(), &i, &j, &step); ^ /home/chris/gr-baz/b/swig/baz_swigPYTHON_wrap.cxx: In function 'void std_vector_Sl_std_string_SgsetitemSWIG_0(std::vectorstd::basicstring, PySliceObject_, const std::vectorstd::basic_string&)': /home/chris/gr-baz/b/swig/baz_swigPYTHONwrap.cxx:5657:90: error: cannot convert 'PySliceObject' to 'PyObject* {aka object}' for argument '1' to 'int PySliceGetIndices(PyObject, Py_ssize_t, Py_ssizet, Py_ssizet, Py_ssizet)' PySlice_GetIndices(SWIGPY_SLICE_ARG(slice), (Py_ssize_t)self->size(), &i, &j, &step); ^ /home/chris/gr-baz/b/swig/baz_swigPYTHON_wrap.cxx: In function 'void std_vector_Sl_std_string_SgsetitemSWIG_1(std::vectorstd::basicstring, PySliceObject_)': /home/chris/gr-baz/b/swig/baz_swigPYTHONwrap.cxx:5668:90: error: cannot convert 'PySliceObject' to 'PyObject* {aka object}' for argument '1' to 'int PySliceGetIndices(PyObject, Py_ssize_t, Py_ssizet, Py_ssizet, Py_ssizet)' PySlice_GetIndices(SWIGPY_SLICE_ARG(slice), (Py_ssize_t)self->size(), &i, &j, &step); ^ /home/chris/gr-baz/b/swig/baz_swigPYTHON_wrap.cxx: In function 'void std_vector_Sl_std_string_SgdelitemSWIG_1(std::vectorstd::basicstring, PySliceObject_)': /home/chris/gr-baz/b/swig/baz_swigPYTHONwrap.cxx:5679:90: error: cannot convert 'PySliceObject' to 'PyObject* {aka object}' for argument '1' to 'int PySliceGetIndices(PyObject, Py_ssize_t, Py_ssizet, Py_ssizet, Py_ssizet)' PySlice_GetIndices(SWIGPY_SLICE_ARG(slice), (Py_ssize_t)self->size(), &i, &j, &step); ^ swig/CMakeFiles/_baz_swig.dir/build.make:102: recipe for target 'swig/CMakeFiles/_baz_swig.dir/baz_swigPYTHONwrap.cxx.o' failed make[2]: ** [swig/CMakeFiles/_baz_swig.dir/baz_swigPYTHON_wrap.cxx.o] Error 1 CMakeFiles/Makefile2:165: recipe for target 'swig/CMakeFiles/_baz_swig.dir/all' failed make[1]: * [swig/CMakeFiles/_baz_swig.dir/all] Error 2 Makefile:126: recipe for target 'all' failed make: * [all] Error 2

Changing

define SWIGCPY_SLICE_ARG(arg) ((PySliceObject *)arg)

to

define SWICGPY_SLICE_ARG(arg) ((PyObject *) arg)

in the named source file seems to let the build finish but the resulting blocks do not work in GR and cause early termination.

Running Arch rolling release, both gnuradio and gr-baz have been pulled down from git today.

chrisnorthcott commented 10 years ago

Well, I found the cause of this; Arch has both python3 and python2.7 installed (with 3.0 as the default) and cmake was selecting python3's headers whereas the generated files from swig will only build with 2.7.

Doing pacman -Rdd python as root, building both gnuradio and gr-baz from git, and then reinstalling the python package (pacman -S python) fixed the problem. Although through all this I seem to have broken gnuradio in the process so once I've finished rebuilding everything and tested this solution properly I will close this issue.

chrisnorthcott commented 10 years ago

Everything works fine with the fix above. Three days I've been trying to get gr-baz to build (primarily for the autocorrelation sink) and finally success!

Closing.