airspyhf icon indicating copy to clipboard operation
airspyhf copied to clipboard

Build on Fedora

Open BT-Justice opened this issue 2 years ago • 2 comments

Would it be possible to add these Fedora directions to the main pages?

I finally got airspyhf to install on Fedora and update airspyone_host from 1.0.9 (from Fedora repos) to 1.0.11. I was able to clean up what I was doing and simplify it thanks to https://wiki.polaire.nl/doku.php?id=airspy_mini_fedora so here is how to do it:

Prerequisites for Linux (Fedora):

sudo groupadd plugdev
sudo usermod -a -G plugdev $USER

Reboot Fedora.

sudo dnf groupinstall "Development Tools" 
sudo dnf install cmake gcc-c++ libusb libusb-devel pkgconf

Build host software on Linux (Fedora):

wget https://github.com/airspy/airspyhf/archive/master.zip
unzip master.zip
cd airspyhf-master
mkdir build
cd build
cmake ../ -DINSTALL_UDEV_RULES=ON
make
sudo make install
sudo bash -c 'echo /usr/local/lib >>/etc/ld.so.conf.d/local.conf'
sudo bash -c 'echo /usr/local/lib64 >>/etc/ld.so.conf.d/local.conf'
sudo ldconfig
sudo udevadm control --reload-rules
sudo udevadm trigger

These also work for airspyone_host. Uninstall the Fedora version if installed with sudo dnf remove airspyone_host then continue. This might also remove Gqrx so you will have to reinstall it with sudo dnf install gqrx if that happens.

Build host software on Linux (Fedora):

wget https://github.com/airspy/airspyone_host/archive/master.zip
unzip master.zip
cd airspyone_host-master
mkdir build
cd build
cmake ../ -DINSTALL_UDEV_RULES=ON
make
sudo make install
sudo bash -c 'echo /usr/local/lib >>/etc/ld.so.conf.d/local.conf'
sudo bash -c 'echo /usr/local/lib64 >>/etc/ld.so.conf.d/local.conf'
sudo ldconfig
sudo udevadm control --reload-rules
sudo udevadm trigger

BT-Justice avatar Jun 14 '22 19:06 BT-Justice

https://copr.fedorainfracloud.org/coprs/rezso/SDR/ has RPM builds for this library, but the udev rules as packaged in that copr still require some changes (I just locally edited the rules to use uaccess).

I've also submitted that change in #43 with another unrelated build change that seems to be needed when linking to the built library in some cases.

aeroevan avatar Oct 11 '22 03:10 aeroevan

If you are looking to get this library to work with gnuradio in Fedora you will save yourself a massive crapload of time by NOT installing the repository versions of gr-osmosdr, libosmodsp, gr-iqbal, or even gqrx for that matter. You will end up pulling your hair out, as it will only see airspyone_host and ignores this library completely. They are all linked as dependencies in the repository, so if you try to erase/uninstall one, you end up erasing/unstalling them all.

Best to clone them from their respective git repositories and build them in the following order:

  1. airspyhf (this library) - include the steps posted by @BT-Justice.
  2. libosmo-dsp
  3. gr-iqbal
  4. gr-osmosdr
  5. gqrx

Huzzah! Everything will work afterwards.

Edit: Don't forget to "sudo ldconfig" after each step

markjfine avatar Dec 11 '22 22:12 markjfine