Updating gr-specest to 3.7

I’ve spent some time recently attempting to update gr-specest to 3.7,
and I’ve run into a linker issue that’s a bit out of my depth, any
suggestions would be helpful.

I’ve been following the guide published at
http://gnuradio.org/redmine/projects/gnuradio/wiki/Move_3-6_to_3-7

I have so far accomplished the following:

  • Remove FindGnuradioCore.cmake and FindGruel.cmake, replaced with
    FindGnuradioRuntime.cmake
    that I pulled out of
    gr-utils/python/modtool/gr-newmod/cmake/Modules/FindGnuradioRuntime.cmake
  • Remove all GRUEL_ references and replace GNURADIO_CORE variables
    with GNURADIO_RUNTIME_
  • Update #include<gruel/attributes.h> to <gnuradio/attributes.h>
  • Changed file structure:
    • from gr-specest/include/specest-blockname.h to
      gr-specest/include/specest/blockname.h
    • from gr-specest/lib/specest-blockname.cc to
      gr-specest/lib/blockname.cc
      (actually, I think that there was some significant changes that
      should have been done to split
      blockname.cc into blockname_impl.h and blockname_impl.cc but I’m
      actually confused by all the
      blockname_impl.h that are placed under include/specest, and I’m
      not entirely sure that the
      split didn’t already happen under 3.6)
  • Updated gnuradio header files e.g. ‘#include <gr_sync_block.h>’ to
    #include <gnuradio/sync_block.h’
  • Updated gnuradio classes and functions to new namespace, e.g.
    gr_make_io_signature() to gr::io_signature::make()

Current status of the effort:

  • Complilation errors caused by the need for above updates now worked
    out and the files compile without error.
  • Build currently broken, stuck at linker errors:

    [ 52%] Built target gnuradio-specest
    Linking CXX executable qa_arburg_impl
    libgnuradio-specest.so: undefined reference to fftwf_free' libgnuradio-specest.so: undefined reference to fftwf_malloc’
  • Will be looking into the FindGnuradioRuntime.cmake file I lifted
    from gr-utils
  • Would love suggestions on how to debug this, “nm” and “ldd” show
    issues but not root causes…

Future work not yet started:

  • updating the gr-specest namespace to the new format
  • adding new blocks: cross-correlation, normalization, running sum,
    etc

I’ve posted all my code at GitHub - dfxx/gr-specest: A module adding spectral estimation routines to GNU Radio.. Any
help tracking down the root cause of the linker errors would be
greatly appreciated. I have the feeling that it might be in the cmake
configuration, and I feel somewhat like a bull in a china shop when I
start poking around in cmake. Lots of delicate looking code in there.

On Tue, Sep 17, 2013 at 2:34 PM, Jared C.
[email protected] wrote:

that I pulled out of
blockname.cc into blockname_impl.h and blockname_impl.cc but I’m

  • Complilation errors caused by the need for above updates now worked
  • Would love suggestions on how to debug this, “nm” and “ldd” show
    start poking around in cmake. Lots of delicate looking code in there.
    You’ll (probably) need to link against fftw. I think you need to add
    the FFT3 library to target_link_libraries in the lib/CMakeLists.txt
    file. There was a change in policy for linking recently that’s
    affected things like this.


Tom
Visit us at GRCon13 Oct. 1 - 4
http://www.trondeau.com/grcon13

Thanks Tom, that was able to get rid of the fftw linking errors.
There are still a few gnuradio ones I’m seeing, have you seen these
before?

[ 57%] Building CXX object
lib/CMakeFiles/qa_arburg_impl.dir/qa_arburg_impl.cc.o
Linking CXX executable qa_arburg_impl
libgnuradio-specest.so: undefined reference to
gr::blocks::multiply_const_vff::make(std::vector<float, std::allocator<float> >)' libgnuradio-specest.so: undefined reference togr::filter::single_pole_iir_filter_ff::make(double, unsigned int)’
libgnuradio-specest.so: undefined reference to
gr::blocks::keep_one_in_n::make(unsigned long, int)' libgnuradio-specest.so: undefined reference togr::fft::fft_vcc::make(int, bool, std::vector<float,
std::allocator > const&, bool, int)’
libgnuradio-specest.so: undefined reference to
gr::blocks::complex_to_mag_squared::make(unsigned long)' libgnuradio-specest.so: undefined reference togr::filter::firdes::window(gr::filter::firdes::win_type, int,
double)’
libgnuradio-specest.so: undefined reference to
`gr::blocks::stream_to_vector::make(unsigned long, unsigned long)’
collect2: error: ld returned 1 exit status
make[2]: *** [lib/qa_arburg_impl] Error 1
make[1]: *** [lib/CMakeFiles/qa_arburg_impl.dir/all] Error 2
make: *** [all] Error 2

Here’s the command that’s erroring:

/usr/bin/c++ -O3 -DNDEBUG
CMakeFiles/qa_arburg_impl.dir/qa_arburg_impl.cc.o -o qa_arburg_impl
-L/usr/local/lib -rdynamic libgnuradio-specest.so
-lboost_unit_test_framework libgnuradio-specest-fortran.so -llapack
-lblas -larmadillo -lgnuradio-runtime -lgnuradio-pmt -lfftw3f
-Wl,-rpath,/usr/local/lib:/home/jared/allsky/gnuradio/gr-specest/build/lib

Am I missing a gnuradio link command that I should know about?

Thanks,

Jared

Thanks for the help, I’m now compiling without errors. I generated a
new skeleton module with gr_modtool and through diffing the CMakeLists
files between the generated and the currently used ones I was able to
track down the last of the include/linking errors. Worked much better
than attempting to track them down in the in-tree modules.

Again, all changes pushed to GitHub - dfxx/gr-specest: A module adding spectral estimation routines to GNU Radio.

Thanks,

Jared

On Wed, Sep 18, 2013 at 1:37 PM, Jared C.
[email protected] wrote:

`gr::filter::single_pole_iir_filter_ff::make(double, unsigned int)’
libgnuradio-specest.so: undefined reference to
-L/usr/local/lib -rdynamic libgnuradio-specest.so
-lboost_unit_test_framework libgnuradio-specest-fortran.so -llapack
-lblas -larmadillo -lgnuradio-runtime -lgnuradio-pmt -lfftw3f
-Wl,-rpath,/usr/local/lib:/home/jared/allsky/gnuradio/gr-specest/build/lib

Am I missing a gnuradio link command that I should know about?

Thanks,

Jared

Jared,

Because it looks like it’s trying to use blocks out of
gnuradio-filter, gnuradio-fft, and gnuradio-blocks, I think you’ll
need to link against all of those libraries, too. Using the
GnuradioConfig cmake, you can set all of this up with:

set(GR_REQUIRED_MODULES RUNTIME BLOCKS FILTER FFT)
find_package(Gnuradio 3.7.0)

You’ll then have access to the libraries using the following variables:
GNURADIO_RUNTIME_LIBRARIES
GNURADIO_BLOCKS_LIBRARIES
GNURADIO_FILTER_LIBRARIES
GNURADIO_FFT_LIBRARIES

Similarly, you’ll have GNURADIO__INCLUDE_DIRS so you can set
your ‘include_directories’ in cmake.


Tom
Visit us at GRCon13 Oct. 1 - 4
http://www.trondeau.com/grcon13

Hi Jared,

thanks for oiling our module. I will look into this soon, maybe we can
merge your stuff back into our repo.

MB

On Fri, Sep 20, 2013 at 09:38:03AM -0600, Jared C. wrote:

Jared


Discuss-gnuradio mailing list
[email protected]
Discuss-gnuradio Info Page


Karlsruhe Institute of Technology (KIT)
Communications Engineering Lab (CEL)

Dipl.-Ing. Martin B.
Research Associate

Kaiserstraße 12
Building 05.01
76131 Karlsruhe

Phone: +49 721 608-43790
Fax: +49 721 608-46071
www.cel.kit.edu

KIT – University of the State of Baden-Württemberg and
National Laboratory of the Helmholtz Association

:slight_smile: I gave it a good lube job and it mostly works now… Still in need
of
the full tune up to change everything over to the new namespace. I’m
still
seeing some issues, like did the pad_vector function ever work? It
seems
to be missing some pieces. I slapped a GRC wrapper together, but it
doesn’t seem to actually pad things.

Jared