discuss-gnuradio
[Top][All Lists]
Advanced

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

Re: [Discuss-gnuradio] Out-of-Tree Block and Gnu Scientific Library: pro


From: Ron Economos
Subject: Re: [Discuss-gnuradio] Out-of-Tree Block and Gnu Scientific Library: problems with SWIG?
Date: Fri, 18 Nov 2016 01:30:40 -0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0

You add it to this line in lib/CMakeLists.txt:

target_link_libraries(gnuradio-xxx ${Boost_LIBRARIES} ${GNURADIO_ALL_LIBRARIES})

like so:

target_link_libraries(gnuradio-xxx ${Boost_LIBRARIES} ${GNURADIO_ALL_LIBRARIES} -lgsl)

This is the quick and dirty way. The better way is to use a cmake find_package command.

In ./CMakeLists.txt after these lines:

find_package(CppUnit)
find_package(Doxygen)

add:

find_package(GSL)

This is optional, but I like to add it. After this line:

if(NOT CPPUNIT_FOUND)
    message(FATAL_ERROR "CppUnit required to compile xxx")
endif()

add:

if(NOT GSL_FOUND)
    message(FATAL_ERROR "Gsl required to compile xxx")
endif()

In lib/CMakeLists.txt:

target_link_libraries(gnuradio-xxx ${Boost_LIBRARIES} ${GNURADIO_ALL_LIBRARIES} ${GSL_LIBRARIES})

Finally, copy the file gnuradio/cmake/Modules/FindGSL.cmake to your OOT cmake/Modules. You may want to edit out all the Windows stuff in it (assuming you're on Linux).

Ron

On 11/18/2016 12:23 AM, address@hidden wrote:

Dear GnuRadio experts,

 

I want to use some minimization functions from the Gnu Scientific Library (GSL) in my own OOT module, e.g. a simple 1-D minimizer such as Brent’s method. In my OOT module I can compile and install my new block with GSL without any errors (seems like compilation and linking worked), but when the flow-graph in GRC is started I get an error that a module (which is already there and worked before) cannot be found. I had a similar problem once when I used e.g., the FFT block in my OOT module and forgot to add “FFT” as part of the required blocks in the CmakeLists file. There I got the some error message.

 

So how do I add the GSL correctly to my Cmake list? I checked some older mails in the archive but did not get any smarter. I also saw that GnuRadio already depends on GSL. So how could I proceed?

 

Regards,

Emanuel

 



reply via email to

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