SoapyHackRF icon indicating copy to clipboard operation
SoapyHackRF copied to clipboard

SoapyHackRF installs but is not found by probe

Open hambone01 opened this issue 2 years ago • 3 comments

I installed hackrf with brew:

brew install hackrf

─gormanst@d-vyjyrp9t06 /opt 
╰─$ brew install hackrf
==> Downloading https://ghcr.io/v2/homebrew/core/hackrf/manifests/2022.09.1
######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/hackrf/blobs/sha256:b3b9c286eba911da05c8df47bb447616925070acaa8b3d44ed2337a814ca2220
==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sha256:b3b9c286eba911da05c8df47bb447616925070acaa8b3d44ed2
######################################################################## 100.0%
==> Pouring hackrf--2022.09.1.arm64_monterey.bottle.tar.gz
🍺  /opt/homebrew/Cellar/hackrf/2022.09.1: 18 files, 712.5KB
==> Running `brew cleanup hackrf`...
Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP.
Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).

I then installed SoapyHackRF

─$ cd SoapyHackRF 
╭─gormanst@d-vyjyrp9t06 ~/temp/SoapyHackRF ‹master› 
╰─$ mkdir build
╭─gormanst@d-vyjyrp9t06 ~/temp/SoapyHackRF ‹master› 
╰─$ cd build 
╭─gormanst@d-vyjyrp9t06 ~/temp/SoapyHackRF/build ‹master› 
╰─$ cmake ..
CMake Deprecation Warning at CMakeLists.txt:5 (cmake_minimum_required):
  Compatibility with CMake < 2.8.12 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.


-- The CXX compiler identification is AppleClang 14.0.0.14000029
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /Library/Developer/CommandLineTools/usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Build type not specified: defaulting to release.
-- Found PkgConfig: /opt/homebrew/bin/pkg-config (found version "0.29.2") 
-- Found LIBHACKRF: /opt/homebrew/Cellar/hackrf/2022.09.1/lib/libhackrf.dylib  
-- LIBHACKRF_INCLUDE_DIRS - /opt/homebrew/Cellar/hackrf/2022.09.1/include/libhackrf
-- LIBHACKRF_LIBRARIES - /opt/homebrew/Cellar/hackrf/2022.09.1/lib/libhackrf.dylib
-- Checking for hackrf_device_list API...
--   Reading /opt/homebrew/Cellar/hackrf/2022.09.1/include/libhackrf/hackrf.h...
-- Found Git: /usr/local/bin/git (found version "2.33.0") 
-- Module HackRFSupport configured with version: 0.3.4-6c0c33f
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/gormanst/temp/SoapyHackRF/build

omitting warnings:

╰─$ sudo make install
Password:
Consolidate compiler generated dependencies of target HackRFSupport
[100%] Built target HackRFSupport
Install the project...
-- Install configuration: "Release"
-- Installing: /usr/local/lib/SoapySDR/modules0.8/libHackRFSupport.so

However, after installation SoapySDRUtil check/probe can't locate the driver.

╭─gormanst@d-vyjyrp9t06 ~/temp/SoapyHackRF/build ‹master●› 
╰─$ SoapySDRUtil --check=hackrf                            
######################################################
##     Soapy SDR -- the SDR abstraction library     ##
######################################################

Loading modules... done
Checking driver 'hackrf'... MISSING!
╭─gormanst@d-vyjyrp9t06 ~/temp/SoapyHackRF/build ‹master●› 
╰─$ SoapySDRUtil --probe="driver=hackrf"                                                                   1 ↵
######################################################
##     Soapy SDR -- the SDR abstraction library     ##
######################################################

Probe device driver=hackrf
Error probing device: SoapySDR::Device::make() no match

I have seen some mentions of setting my LD_LIBRARY_PATH

hambone01 avatar Oct 13 '22 15:10 hambone01

Hi @hambone01 and everyone. I passed by the same issue and this solution worked for me.

Homebrew install the libs at /opt/homebrew/lib/ (🤷‍♂️) and the project at /usr/local/lib/ by unix pattern. So i just copied the file lib file to /opt/homebrew/lib/ and all works fine.

cp /usr/local/lib/SoapySDR/modules0.8/libHackRFSupport.so /opt/homebrew/lib/SoapySDR/modules0.8/

Before

build❯ SoapySDRUtil --find                                                                                                                         SoapyHackRF/git/master 
######################################################
##     Soapy SDR -- the SDR abstraction library     ##
######################################################

No devices found! 

After

######################################################
##     Soapy SDR -- the SDR abstraction library     ##
######################################################

Found device 0
  device = HackRF One
  driver = hackrf
  label = HackRF One #0 xxxxxxxxxxxxxxx
  part_id = zzzzzzzzzzzzzzzz
  serial = 00000000000000000xxxxxxxxxxxxxxx
  version = 2021.03.1

talesluna avatar Jan 29 '23 02:01 talesluna

@talesluna Thank you soooo much!!

nodemand avatar Oct 07 '23 07:10 nodemand

You need to specify the file location during compilation:

cmake -DCMAKE_INSTALL_PREFIX=/opt/homebrew ..

ybm911 avatar Apr 19 '24 07:04 ybm911