discuss-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Discuss-gnuradio] Problem using FFT-class in my own written block (


From: jeroen
Subject: Re: [Discuss-gnuradio] Problem using FFT-class in my own written block (part II)
Date: Fri, 06 Dec 2013 12:56:01 +0100
User-agent: Roundcube Webmail/0.9.5

Marcus Müller schreef op 2013-12-06 08:02:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi Jeroen,

it's not advisable to use the 3.7 Out of tree-module directory
architecture with GR 3.6.
However, gr_modtool should be generating modules that fit exactly your
installed version. You shouldn't have to change anything on the
gnuradio core/runtime/gruel/whatever includes.

After you have set up your new module with gr_modtool, just copy over
the original GNU Radio FindFFTWf.cmake into the cmake/Modules directory,
and use FindPackage(FFTWf) as well as add the found directories to
your target link libraries and the found includes to your include
directories; see my reply to Johannes Demel's post of yesterday.

Greetings, and happy hacking!

Marcus

On 05.12.2013 21:30, Jeroen Boschma wrote:
Hello all,

In order to keep discussions separated (I apparently did something
stupid which mixed up 2 threads), I start a new thread here.

Summarizing: when writing my own out of tree block in C++ using
FFTs (including the 'fft/fft.h' header) and following the tutorial
"Out-of-tree modules", I get an error when I want to use the block
in GNU Radio Companion:

ImportError /usr/local/libgnuradio-MY_MODULE.so: undefined symbol:
fft_complex

According to Tom Rondeau the FFT-library is not included in the
link process, and he suggested the following tutorial:

http://gnuradio.org/redmine/projects/gnuradio/wiki/OutOfTreeModulesConfig

 I started following that tutorial, setting some environment
variables first, and I found out that I am using version 3.6.5git
(on an Ettus Research USB stick) while I suspect that the suggested
tutorial only covers versions >= 3.7.

Even when I only changed the following (as suggested by the
tutorial):

find_package(GnuradioCore)

into:

set(GR_REQUIRED_COMPONENTS CORE) find_package(Gnuradio "3.6.5"
REQUIRED)

I get the following error when I run "cmake ../" from the
build-directory:

================================================= -- Build type not
specified: defaulting to release. -- Boost version: 1.49.0 -- Found
the following Boost libraries: --   filesystem --   system CMake
Error at CMakeLists.txt:92 (find_package): By not providing
"FindGnuradio.cmake" in CMAKE_MODULE_PATH this project has asked
CMake to find a package configuration file provided by "Gnuradio",
but CMake did not find one.

Could not find a package configuration file provided by "Gnuradio"
(requested version 3.6.5) with any of the following names:

GnuradioConfig.cmake gnuradio-config.cmake

Add the installation prefix of "Gnuradio" to CMAKE_PREFIX_PATH or
set "Gnuradio_DIR" to a directory containing one of the above
files. If "Gnuradio" provides a separate development package or
SDK, be sure it has been installed.
=================================================

So I tried (as suggested by the error message):

1) set CMAKE_MODULE_PATH to the path where
"FindGnuradio.cmake"resides 2) add the installation prefix of
"Gnuradio" to CMAKE_PREFIX_PATH

The two mentioned config .cmake files are not even present on the
environment I am working on (not found by a search at the GNU
radio installation prefix which is usr/local).

So I am pretty stuck here.  My goal is to get this working in my
current environment before trying to port my blocks to the latest
version > 3.7. Any help is greatly appreciated.

Best regards,

Jeroen Boschma


_______________________________________________ Discuss-gnuradio
mailing list address@hidden
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.15 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQEcBAEBAgAGBQJSoXahAAoJEAFxB7BbsDrLi2QH/AmKmrZNZYn7BIz7snz/eu0G
X4e2u++r7UJ8M3ty4PB33txGDT83LNlvVLXhHWjnl6BPKClaEezmU6iYLsCSOyKA
otFUvzUw5lc7Q4KgM1aS6KVCCCPczbKWIHGm2d4+4octnabIx1NfuKgeSwwSUdX/
BFXw3q/mjRQpHGXKD+lkcJgCUYLXerLNQd9YCYsY9XxQJL855rBIQd7QEUBi3GXB
c+Foq1/+wVWWbOx+Za1XGkBgmjIIzmQSqwsNLatIhEEbZTseVRH8eJ8UUq4IJSRX
sAVaI3k4j6SvvtNC+EMSee8/kdxj08OlmrNLYrWaU9y9wA/pG0R9PXWwGf3n7Sw=
=CYIj
-----END PGP SIGNATURE-----

_______________________________________________
Discuss-gnuradio mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio

Thanks for your reply Marcus. It did help me a bit, but results are not yet there... So what I did:

1) I Copied the FindFFTW3f.cmake into the cmake/Modules dir of my module. 2) In the top-level CMakeLists.txt I modified/added (just guessing what to do...):

find_package(FFTW3f)                # added this

include_directories(
    ${CMAKE_SOURCE_DIR}/include
    ${Boost_INCLUDE_DIRS}
    ${GRUEL_INCLUDE_DIRS}
    ${CPPUNIT_INCLUDE_DIRS}
    ${GNURADIO_CORE_INCLUDE_DIRS}
${FFTW3F_INCLUDE_DIRS} # added this, I checked that it actually points to an include dir
)

link_directories(
    ${Boost_LIBRARY_DIRS}
    ${GRUEL_LIBRARY_DIRS}
    ${CPPUNIT_LIBRARY_DIRS}
    ${GNURADIO_CORE_LIBRARY_DIRS}
    ${FFTW3F_LIBRARY_DIRS}          # added this, is an empty variable
)

3) In the module CMakeLists.txt I modified/added (again just guessing what to do...):


########################################################################
# Setup library
########################################################################
target_link_libraries(gnuradio-LTE_jamming ${Boost_LIBRARIES} ${GRUEL_LIBRARIES} ${GNURADIO_CORE_LIBRARIES} ${FFTW3F_LIBRARIES}) # added last one

########################################################################
# Build and register unit test
########################################################################
target_link_libraries(
  test-LTE_jamming
  ${GNURADIO_CORE_LIBRARIES}
  ${Boost_LIBRARIES}
  ${CPPUNIT_LIBRARIES}
${FFTW3F_LIBRARIES} # added this, I checked that it actually points to an .so file
  gnuradio-LTE_jamming
)

All of this is just a wild guess of me: I see something refering to, for example, ${CPPUNIT_LIBRARIES} and I conclude that there is a chance that ${FFTW3F_LIBRARIES} should also be there....

But after (from build dir):

  cmake ../
  make
  sudo make install
  sudo ldconfig

I still get the error:

ImportError: /usr/local/lib/libgnuradio-LTE_jamming.so: undefined symbol: _ZN2gr3fft11fft_complexC1Eibi

Did I forget something? Hacking is difficult when you don't fully understand what's going on....

Best regards,

   Jeroen




reply via email to

[Prev in Thread] Current Thread [Next in Thread]