Project

General

Profile

Bug #4950

gr-osmosdr doesn't find iqbalance during build

Added by labomb about 1 month ago. Updated 5 days ago.

Status:
New
Priority:
Normal
Assignee:
-
Target version:
-
Start date:
01/14/2021
Due date:
% Done:

0%

Spec Reference:

Description

Setup:

- new install of ubuntu 20.04.1
- installed gnuradio 3.8.1 and various related packages via the standard apt catalog
- installed gr-iqbal via the standard apt catalog
- installed various SDR drivers by cloning/building the latest from github
- trying to install gr-osmosdr from the latest github osmocom snapshot

'cmake ../' finds all of the SDR drivers and other prerequisites, but no matter what I've tried it does not find iqbalance. After a bit of investigation, I did find that the gr-iqbal package from ubuntu apt doesn't appear to install it correctly (specifically, the swig file are installed to /usr/include/gnuradio/iqbalance/gnuradio/swig instead of /usr/include/gnuradio/swig).

Not sure that mattered, but I removed that package, and cloned the latest gr-iqbal from osmocom. I built and installed it (after doing the same with the prerequisite libosmo-dsp), but still no joy. The cmake error:

-- Searching for GNURadio-Blocks...
-- Found GNURadio-Blocks: 1
-- Searching for IQ Balance...
-- Could NOT find gnuradio-iqbalance (missing: gnuradio-iqbalance_DIR)
-- Found IQ Balance: 0

and subsequently:

-- Configuring Osmocom IQ Imbalance Correction support...
-- Dependency gnuradio-iqbalance_FOUND = 0
-- Disabling Osmocom IQ Imbalance Correction support.
-- Override with -DENABLE_IQBALANCE=ON/OFF

I did confirm that gnuradio companion lists the iqbalance blocks (although I didn't test them).

Any suggestions would be appreciated...thx.

History

#1 Updated by labomb about 1 month ago

As it turns out, there were a couple of contributing factors as to why this wasn't working.

The initial issue is with the ubuntu 20.04.1 apt packaging for gr-iqbal. It installs the cmake search help file (gnuradio-iqbalanceConfig.cmake) in a somewhat non-standard directory, versus the more typical gnuradio cmake modules directory (/usr/lib/x86_64-linux-gnu/cmake/gnuradio/). The gr-osmosdr package searches whatever the default directories are for cmake, as well as /usr/lib/x86_64-linux-gnu/cmake/gnuradio/, like so:

message(STATUS "Searching for IQ Balance...")
find_package(gnuradio-iqbalance PATHS ${Gnuradio_DIR})
message (STATUS " Found IQ Balance: ${gnuradio-iqbalance_FOUND}")

The full search path turns out to be:

-- Searching for IQ Balance...
Checking prefix [/home/userid/]
Checking file [/home/userid/gnuradio-iqbalanceConfig.cmake]
Checking file [/home/userid/gnuradio-iqbalance-config.cmake]
Checking prefix [/usr/local/]
Checking file [/usr/local/gnuradio-iqbalanceConfig.cmake]
Checking file [/usr/local/gnuradio-iqbalance-config.cmake]
Checking prefix [/usr/]
Checking file [/usr/gnuradio-iqbalanceConfig.cmake]
Checking file [/usr/gnuradio-iqbalance-config.cmake]
Checking prefix [/]
Checking file [/gnuradio-iqbalanceConfig.cmake]
Checking file [/gnuradio-iqbalance-config.cmake]
Checking prefix [/usr/games/]
Checking file [/usr/games/gnuradio-iqbalanceConfig.cmake]
Checking file [/usr/games/gnuradio-iqbalance-config.cmake]
Checking prefix [/usr/local/games/]
Checking file [/usr/local/games/gnuradio-iqbalanceConfig.cmake]
Checking file [/usr/local/games/gnuradio-iqbalance-config.cmake]
Checking prefix [/snap/]
Checking file [/snap/gnuradio-iqbalanceConfig.cmake]
Checking file [/snap/gnuradio-iqbalance-config.cmake]
Checking prefix [/usr/X11R6/]
Checking prefix [/usr/pkg/]
Checking prefix [/opt/]
Checking file [/opt/gnuradio-iqbalanceConfig.cmake]
Checking file [/opt/gnuradio-iqbalance-config.cmake]
Checking prefix [/usr/lib/x86_64-linux-gnu/cmake/gnuradio/]
Checking file [/usr/lib/x86_64-linux-gnu/cmake/gnuradio/gnuradio-iqbalanceConfig.cmake]
Checking file [/usr/lib/x86_64-linux-gnu/cmake/gnuradio/gnuradio-iqbalance-config.cmake]
-- Could NOT find gnuradio-iqbalance (missing: gnuradio-iqbalance_DIR)
--  Found IQ Balance: 0

So I made a quick adjustment to the find_package PATHS parameter to insure that it found gr-iqbal, and while it did indeed find gnuradio-iqbalanceConfig.cmake, it still failed with a missing library error. Sure enough, while there was indeed a broken symlink for ibgnuradio-iqbalance.so.3.8.0, the actual lib itself was nowhere to be found (at least I couldn't find it). The package is broken.

As mentioned, I grabbed the latest gr-iqbal snapshot from github, and built it with -DCMAKE_INSTALL_PREFIX=/usr to force it to /usr. The gr-osmosdr build still didn't find iqbalance. The reason for that is because the current gr-iqbal snapshot also doesn't install the cmake search helper to the 'standard' cmake modules directory for gnuradio. Instead, it puts it in ${CMAKE_INSTALL_PREFIX}/lib/cmake/gnuradio/.

I ended up changing the root CMakeLists.txt file for gr-iqbal from this:

if(NOT CMAKE_MODULES_DIR)
  set(CMAKE_MODULES_DIR lib${LIB_SUFFIX}/cmake)
endif(NOT CMAKE_MODULES_DIR)

to this:

if(NOT CMAKE_MODULES_DIR)
  set(CMAKE_MODULES_DIR lib${LIB_SUFFIX}/x86_64-linux-gnu/cmake)
endif(NOT CMAKE_MODULES_DIR)

... and built it with a prefix of /usr instead of the default /usr/local. That finally worked and the un-modified gr-osmosdr found it just fine.

#2 Updated by tnt about 1 month ago

That '/x86_64-linux-gnu/' thing is a ubuntu thing ...

I'm assuming during packaging of gnuradio in ubuntu they patched it to add it for the various GR thing but not for gr-iqbal.
And then of course the vanilla version in the git doesn't know anything about ubuntu specific stuff and so uses the standard ${CMAKE_INSTALL_PREFIX}/lib/cmake/gnuradio/ ...

#3 Updated by labomb about 1 month ago

Appreciate the input.

I'm still a bit confused though. While I understand the vanilla version of gr-iqbal from github uses the standard ${CMAKE_INSTALL_PREFIX}/lib/cmake/gnuradio/, I don't understand why the vanilla gr-osmosdr also from github (which I'm building as per my initial post) doesn't search that directory as well (as detailed in my updated post) when attempting to located iqbalance. If it's a standard directory for cmake search help files, I would think that it would.

I'm using the generic iterations of both packages, both cloned from github, both in the 'osmocom' family :). I would assume that Ubuntu isn't a factor here?

#4 Updated by viktorivan 28 days ago

Hi, I get the following error through Pybombs

[INFO] Installing package: gr-iqbal
Cloning into 'gr-iqbal'...
Configuring: (100%) [=========================================================]
[WARNING] Configuration failed. Re-trying with higher verbosity.
CMake Error at CMakeLists.txt:32 (find_package):
Could not find a configuration file for package "Gnuradio" that is
compatible with requested version "3.9".

The following configuration files were considered but not accepted:
/home/ivan/Software/gr-3.8/lib/cmake/gnuradio/GnuradioConfig.cmake, version: 3.8.2.git

-- Configuring incomplete, errors occurred!
See also "/home/ivan/Software/gr-3.8/src/gr-iqbal/build/CMakeFiles/CMakeOutput.log".
[ERROR] Configuration failed after running at least twice.
[ERROR] Problem occurred while building package gr-iqbal:
Configuration failed
[ERROR] Error installing package gr-iqbal. Aborting.

I think it is looking for gnuradio 3.9 when the installed version is 3.8, this error appear when gnuradio 3.9 was released.

Regards

PS. This error do not let me install gr-osmosdr in gnuradio 3.8

#5 Updated by viktorivan 5 days ago

Hi, I use the next code

ivan@ivan-Latitude-E7250:~/Software/gr-3.8/src/gr-iqbal$ cd /home/ivan/Software/gr-3.8/src/gr-osmosdr/
ivan@ivan-Latitude-E7250:~/Software/gr-3.8/src/gr-osmosdr$ git checkout gr3.8
Branch 'gr3.8' set up to track remote branch 'gr3.8' from 'origin'.
Switched to a new branch 'gr3.8'
ivan@ivan-Latitude-E7250:~/Software/gr-3.8/src/gr-osmosdr$ pybombs rebuild gr-osmosdr

#6 Updated by viktorivan 5 days ago

Hi, I use the next code

ivan@ivan-Latitude-E7250:~/Software/gr-3.8/src/gr-iqbal$ cd /home/ivan/Software/gr-3.8/src/gr-osmosdr/
ivan@ivan-Latitude-E7250:~/Software/gr-3.8/src/gr-osmosdr$ git checkout gr3.8
Branch 'gr3.8' set up to track remote branch 'gr3.8' from 'origin'.
Switched to a new branch 'gr3.8'
ivan@ivan-Latitude-E7250:~/Software/gr-3.8/src/gr-osmosdr$ pybombs rebuild gr-osmosdr

Also available in: Atom PDF

Add picture from clipboard (Maximum size: 48.8 MB)