Reputation: 115
I try to compile an OOT module for GNURadio, which uses an external device driver (LimeSuite.h) as a dynamically linked shared object (.so file). After adding
find_package(LimeSuite)
and the corresponding module under cmake/Modules (cf. https://github.com/kit-cel/gr-dab/blob/working_branch/cmake/Modules/FindFaad.cmake), I was able to compile with make and I observed, that the following variables changed.
CMAKE_CXX_FLAGS=-lLimeSuite
LIMESUITE_FOUND=1
LIMESUITE_FOUND=1
LIMESUITE_INCLUDE_DIR=/usr/include
LIMESUITE_INCLUDE_DIRS=/usr/include
LIMESUITE_LIBRARIES=/usr/lib/x86_64-linux-gnu/libLimeSuite.so
LIMESUITE_LIBRARY=/usr/lib/x86_64-linux-gnu/libLimeSuite.so
However as soon as I use the library in my code I get the following error when I try to instantiate the python object.
AttributeError: 'module' object has no attribute 'limesdr_source'
As soon as I remove the C++ code using the library from the implementation part of the block, the instantiation works again. I do not receive any error reports executing make. How can this be? Any idea how to debug this further?
EDIT:
As pointed out by the answer of Marcus Müller below I did not link properly. In fact one has to edit three different cmake files in three places to add an external dynamically loaded library (.so) to an OOT module in GNURadio. I try to explain briefly what to do:
With ldd it is possible to find out if the external library is linked correctly.
ldd /usr/local/lib/YOURLIB.so
Upvotes: 4
Views: 1586
Reputation: 36442
You probably forgot to add the limesuite object files to the actually linked libraries in lib/CMakeLists.txt.
Anyway, I see zero good reasons why you should link against limesuite in an OOT that is concerned with DAB+ and pretty much hardware agnostic. Instead, encapsulate your lime interfacing in a block in your own OOT! GNU Radio is designed to be a block-connecting framework, so that you don't have to link your signal processing block code against your hardware interfacing driver.
Generating your own OOT should be very easy, indeed: https://tutorials.gnuradio.org
Upvotes: 4