[USRP-users] How to find and link OOT module with gnuradio 3.8?

Mohamed Yaaseen mdyaaseen1995 at gmail.com
Wed Jul 1 08:01:35 EDT 2020


Hello EJ Kreinar,

I have somehow made gr-ettus and rfnoc mod tools to work with gnuradio 3.8.
I created, built and installed the gain rfnoc oot module. And it was
working as it should be.

I created a new branch called working-maint-3.8 for gr-ettus and pushed it
to my personal repository.

I have  just modified the cmake files and doxygen file (which was problem
during make process)

Here is the link:
https://github.com/yaaseen-dev/gr-ettus.git

This is my first time I am dealing with cmake stuff, so, I am also not sure
if this is the correct way to modify it. Because as you said, entire rfnoc
mod tools need to be updated to gr3.8
similar to gr_modtools
.
But, these fixes worked for me.

You can clone this, and check if it works for you also.

Hope this helps you also


Regards,
Yaaseen


On Wed, 1 Jul 2020 at 02:44, EJ Kreinar <ejkreinar at gmail.com> wrote:

> Ron,
>
> Yes, that looks right on target with my results... A little baffling to me
> though... linking against OOTs seems like a fairly standard use case but
> maybe it's less common than I thought. It's definitely needed for rfnoc
> though.
>
>
> Mohamed Yaaseen,
>
> The change that worked for me was to update GR_CMAKE_DIR in gr-ettus to
> ${CMAKE_MODULES_DIR)/gnuradio-ettus. Then I rebuilt and installed gr-ettus,
> and my OOT could then call find_package(gnuradio-ettus) and link against
> gnuradio-ettus.
>
> But I'm really not a cmake expert in any way, so I don't know if this is
> the "right" answer. Personally I'm satisfied with the GR_CMAKE_DIR change,
> but it does change the package name for downstream users...
>
> I guess the broader question is then... What is "desired" behavior provided
> by default from gr_modtool for finding and linking OOTs?
>
> EJ
>
> On Tue, Jun 30, 2020, 10:53 AM Mohamed Yaaseen <mdyaaseen1995 at gmail.com>
> wrote:
>
>> Hello EJ Kreinar,
>>
>> I just came across this situation. I was trying to create a rfnoc gain
>> tutorial oot module using rfnomodtools. But, when I was doing cmake I got
>> some errors with respect to find_package(ettus).
>> I was just fiddling around with cmakefiles as I am not familiar with
>> cmake and stuff.
>>
>> But, I found a problem with the gr-ettus module itself. In the gr-ettus
>> module ettutsConfig.cmake file, there is a line
>> *include("${CMAKE_CURRENT_LIST_DIR}/ettusTarget.cmake"). *
>> This is the file that rfnoc OOT searches in order to find the
>> package ettus. But, while make && make install gr-ettus module installs *gnuradio-ettusTargets.cmake
>> *file at the location. Hence, rfnoc OOT module throws an error message
>> during cmake.
>>
>> When I corrected the line in gr-ettus and reinstalled it, my OOT module
>> was able to compile  successfully.
>>
>> But, I am now facing errors during the make process.
>>
>> I believe the rfnocmodtools template code present inside gr-ettus has not
>> been migrated for 3.8 even though gr-ettus is migrated.
>>
>> In the meantime I will also try to fix the error which is thrown during
>> make process. And update you in this thread if I have any success
>>
>> If you are able to get past the make process also and install it in gr
>> 3.8. It would be really great...!!!
>>
>> Regards,
>> Mohamed Yaaseen
>>
>> On Tue, 30 Jun 2020 at 16:01, EJ Kreinar via USRP-users <
>> usrp-users at lists.ettus.com> wrote:
>>
>>> Hi gnuradio and usrp-users,
>>>
>>> I'm trying to update rfnoc OOT modules for gnuradio 3.8 (gasp).
>>>
>>> But I'm having trouble finding and linking to gr-ettus specifically, and
>>> I wonder how we're supposed to call find_package(<OOT>) and then link to
>>> OOT modules in general with the updated cmake workflow... Trying to find
>>> and link gr-ettus, I've tried a few things...
>>>
>>> 1) find_package(ettus)
>>>
>>> I believe this worked against gnuradio-3.7. Now, I get the following
>>> error during cmake configure...
>>>
>>> ```
>>> --   No package 'ettus' found
>>> CMake Error at /usr/local/lib/cmake/ettus/ettusConfig.cmake:41 (include):
>>>   include could not find load file:
>>>     /usr/local/lib/cmake/ettus/ettusTarget.cmake
>>> ```
>>>
>>> 2) find_package(gnuradio-ettus)
>>>
>>> This seems more promising, since GR_LIBRARY_FOO seems to
>>> install gnuradio-ettus cmake files into the lib/cmake/ettus install
>>> location. This fails in cmake configure with the following error:
>>>
>>> ```
>>> CMake Error at gr-theseus/CMakeLists.txt:84 (find_package):
>>>   By not providing "Findgnuradio-ettus.cmake" in CMAKE_MODULE_PATH this
>>>   project has asked CMake to find a package configuration file provided
>>> by
>>>   "gnuradio-ettus", but CMake did not find one.
>>>
>>>   Could not find a package configuration file provided by
>>> "gnuradio-ettus"
>>>   with any of the following names:
>>>
>>>     gnuradio-ettusConfig.cmake
>>>     gnuradio-ettus-config.cmake
>>>
>>>   Add the installation prefix of "gnuradio-ettus" to CMAKE_PREFIX_PATH
>>> or set
>>>   "gnuradio-ettus_DIR" to a directory containing one of the above
>>> files.  If
>>>   "gnuradio-ettus" provides a separate development package or SDK, be
>>> sure it
>>>   has been installed.
>>> ```
>>>
>>>
>>> Interestingly, if I change the GR_CMAKE_DIR *inside gr-ettus* to
>>> point to ${CMAKE_MODULES_DIR)/gnuradio-ettus (
>>> https://github.com/EttusResearch/gr-ettus/blob/b69260655e974786ea6e611bd91ab578b13ec72a/CMakeLists.txt#L69),
>>> then the gnuradio-ettus cmake modules get installed to
>>> lib/cmake/gnuradio-ettus. Then, in my OOT module, calling
>>> find_package(gnuradio-ettus) finds gr-ettus, and
>>> target_link_libraries(<my-library> gnuradio-ettus) links successfully.
>>>
>>> So: Is this right? Am I missing something obvious here? Should gnuradio
>>> OOT modules set their GR_CMAKE_DIR to gnuradio-<module>?
>>>
>>> Thanks for the help!
>>> EJ
>>>
>>> _______________________________________________
>>> USRP-users mailing list
>>> USRP-users at lists.ettus.com
>>> http://lists.ettus.com/mailman/listinfo/usrp-users_lists.ettus.com
>>>
>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ettus.com/pipermail/usrp-users_lists.ettus.com/attachments/20200701/4303f5e3/attachment.html>


More information about the USRP-users mailing list