[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Discuss-gnuradio] Out of Tree linker error... libgnuradio-MYMOD.so:
From: |
Marcus Müller |
Subject: |
Re: [Discuss-gnuradio] Out of Tree linker error... libgnuradio-MYMOD.so: undefined reference to `gr::fft::fft_complex::execute()' |
Date: |
Wed, 23 Jul 2014 22:36:43 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 |
Hi John,
I think you're on the right track:
you use gr-fft in your code, but then don't tell your linker to link
against that, which leaves your libgnuradio-comso missing the symbols
from gr::fft, which breaks linking test-comso.
So what you need to do is edit your CMakeLists.txt in your module's root
dir and replace
set(GR_REQUIRED_COMPONENTS RUNTIME)
by
set(GR_REQUIRED_COMPONENTS RUNTIME FFT)
which will add the necessary linker directives, usually.
Then you will need to add
${GNURADIO_FFT_LIBRARY_DIRS}
to your
link_directories(...)
further down.
now, in your lib/ directory, edit the CMakeLists.txt
and extend the target_link_libraries(<yourmodule>...) directive with
${GNURADIO_FFT_LIBRARIES}
and do the same for the test-<yourmodule> target_link_libraries.
Hm. Maaaybe we should be adding some more CMake magic, but then again,
CMake is hard and mean :/
Greetings,
Marcus
On 23.07.2014 22:24, John Murphy wrote:
> I am getting a link error when making my Out-of-Tree module.
>
> I apologize in advance for the length of this, my first post to this list. I
> get the daily 'digest' version.
>
> This Out of Tree module was done with gr_modtool and cmake following the
> outline given in
> http://gnuradio.org/redmine/projects/gnuradio/wiki/OutOfTreeModules which,
> after some figuring out how my setup was missing some things, worked (make
> and install and runs in GRC) on another simpler block in this same module.
>
> This is a re-run of the make spew that fails to link:
>
> address@hidden build]$ make
> Scanning dependencies of target gnuradio-comso
> [ 7%] Building CXX object lib/CMakeFiles/gnuradio-comso.dir/ofdm_rx_impl.cc.o
> Linking CXX shared library libgnuradio-comso.so
> [ 14%] Built target gnuradio-comso
> Linking CXX executable test-comso
> libgnuradio-comso.so: undefined reference to `gr::fft::fft_complex::execute()'
> collect2: error: ld returned 1 exit status
> make[2]: *** [lib/test-comso] Error 1
> make[1]: *** [lib/CMakeFiles/test-comso.dir/all] Error 2
> make: *** [all] Error 2
> address@hidden build]$
>
> Note - it seems to me this is saying it linked my custom code to the fft but
> failed to link the test code? Or am I mis-reading this?
>
> I get the same error when I throw a #define switch in my block implementation
> header to directly use fft_impl_fft_complex instead of gr::fft::fft_complex.
> To make this work, such as it is, I had download the fft_impl_fft.h header
> file and edit as follows.
> //#include <fft/api.h>
> //#include <gr_complex.h>
> #include <gnuradio/fft/api.h>
> #include <gnuradio/gr_complex.h>
> There may be a clue there, but I do not understand enough to know.
>
> Then here is the make error for this version, essentially identical.
>
> address@hidden build]$ make
> Scanning dependencies of target gnuradio-comso
> [ 7%] Building CXX object lib/CMakeFiles/gnuradio-comso.dir/ofdm_rx_impl.cc.o
> Linking CXX shared library libgnuradio-comso.so
> [ 14%] Built target gnuradio-comso
> Linking CXX executable test-comso
> libgnuradio-comso.so: undefined reference to `fft_impl_fft_complex::execute()'
> collect2: error: ld returned 1 exit status
> make[2]: *** [lib/test-comso] Error 1
> make[1]: *** [lib/CMakeFiles/test-comso.dir/all] Error 2
> make: *** [all] Error 2
> address@hidden build]$
>
> I run GNU Radio Comapnion with FFT GUI's and they work fine, so clearly
> something is executing FFT's although that may be unrelated. I do not have
> any problems, for now, with any In-Tree heir blocks or with any Out-Of-Tree
> blocks that do not link to the FFT libraries.
>
> Also, this block uses the get_inbuf() and get_outbuf() functions for the
> gnuradio fft classes, under either header mentioned above, with no linker
> issues reported.
>
> Module name is comso, block name is ofdm_rx, block is a C++ general-type block
> I am running Fedora 20 with the LXDE desktop environment
> GNU Radio is version 3.7.3 installed using yum from the default Fedora
> repositories
>
> linux kernel: 3.15.6-200.fc20.x86_64
>
> Some possibly-relevant Fedora packages already installed and latest version:
> gnuradio-3.7.3-1.fc20.x86_64
> gnuradio-devel-3.7.3-1.fc20.x86_64
> fftw-3.3.4-3.fc20.x86_64
> fftw-devel-3.3.4-3.fc20.x86_64
> fftw-libs-3.3.4-3.fc20.x86_64
> fftw-libs-single-3.3.4-3.fc20.x86_64
> fftw-libs-double-3.3.4-3.fc20.x86_64
> fftw-libs-quad-3.3.4-3.fc20.x86_64
> fftw-libs-long-3.3.4-3.fc20.x86_64
>
> Anyone know what I need to do from here to make this build successfully? Am I
> still missing some file or something is still pointing to the wrong place?
> Thanks.
> -John
>
> _______________________________________________
> Discuss-gnuradio mailing list
> address@hidden
> https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
>