discuss-gnuradio
[Top][All Lists]
Advanced

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

Re: [Discuss-gnuradio] GnuradioConfig.cmake on master


From: Sean Nowlan
Subject: Re: [Discuss-gnuradio] GnuradioConfig.cmake on master
Date: Thu, 9 May 2013 12:58:10 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130329 Thunderbird/17.0.5

On 05/09/2013 12:28 PM, Tom Rondeau wrote:
On Thu, May 9, 2013 at 11:56 AM, Sean Nowlan
<address@hidden> wrote:
On 05/09/2013 09:48 AM, Tom Rondeau wrote:
Good catch, Sean, and thanks for the patch as well! Seems I can't make any
changes without messing up between the master/next changes these days... I'm
making sure all of the components are searching for the right headers in
master and next.

Actually, I'm having trouble with the CORE component. Perhaps it's
conflicting with the FindGnuradioCore.cmake module.

This works:
find_package(GnuradioCore)
set(GR_REQUIRED_COMPONENTS ANALOG DIGITAL BLOCKS FFT FILTER)
find_package(Gnuradio)

This doesn't:
set(GR_REQUIRED_COMPONENTS CORE DIGITAL BLOCKS FFT FILTER)
find_package(Gnuradio)

"cmake ../" succeeds and finds both libgnuradio-core.so and includes in
/usr/local/include/gnuradio. However, when I run "make," I get:
fatal error: gr_io_signature.h: No such file or directory
Try it from a clean build directory. I just did and it worked fine.
gr_io_signature.h is in $prefix/include/gnuradio, so if that's in your
include directories like you mentioned above, there should be no
reason for it not to find it.

Somehow the include statements aren't getting set correctly. I suppose I
need to keep find_package(GnuradioCore). If so, what's the purpose of
setting CORE (or RUNTIME) in GR_REQUIRED_COMPONENTS?
You should not need to use find_package(GnuradioCore) (or
GnuradioRuntime) if you are using the GnuradioConfig script. They are
duplications; the latter, if used, should replace any need for the
former in your cmake files.

Try it again. Like I said, I just tried it, and it worked fine for me.

I probably had some cached Cmake stuff that was getting in the way. When purged the build directory it worked.
See the bottom of the main page in the Doxygen manual (you'll have to
build it yourself). It explains it a bit more. Since GnuradioConfig.cmake is
installed by GNU Radio, there's no need to put it into modtool; you just
have to use it in modtool if you want it's functionality. Right now, by
default, projects built with modtool only look for libgnuradio-runtime, just
to make sure it's there. If you need the more complicated functionality the
GnuradioConfig provides, you can easily add that line to the CmakeLists file
yourself to search for the necessary components as well as the API
compatible version you need for your OOT project. So it doesn't really need
to be part of modtool. Thanks! Tom

Ok. Although, I don't think placing a couple of commented-out lines in
CMakeLists.txt would hurt, with a comment like, "to use GR components,
uncomment the following and set GR_REQUIRED_COMPONENTS to libraries you want
to link."
Sure, adding a comment is certainly appropriate here.

Finally, it looks like it's not necessary to set "include_directories" to
${GNURADIO_ALL_INCLUDE_DIRS} and "link_directories" to
${GNURADIO_ALL_LIBRARIES}. Cmake is a colossal mystery to me...
Eh, probably not. But they could be easy convenience variables to use.
And it doesn't hurt anything being there, even if unused.

Tom

Last thing: I have a couple C++ hier blocks that use components from gr-analog and gr-digital. I needed to add GNURADIO_ANALOG_LIBRARIES and GNURADIO_DIGITAL_LIBRARIES to lib/CMakeLists.txt:

target_link_libraries(${Boost_LIBRARIES} ${GRUEL_LIBRARIES} ${GNURADIO_CORE_LIBRARIES} ${GNURADIO_DIGITAL_LIBRARIES} ${GNURADIO_ANALOG_LIBRARIES})

Without this step I would get "undefined symbol" errors when trying to run swigged blocks from Python. I don't quite understand why I didn't need to include GNURADIO_BLOCKS_LIBRARIES or GNURADIO_FILTER_LIBRARIES, which these modules also use. It may be something specific to my code/configuration; it's hard to tell.



reply via email to

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