Skip to content

Instantly share code, notes, and snippets.

@jheasly
Forked from 0xabad1dea/rtlsdr-osx.txt
Last active February 26, 2021 04:02
Show Gist options
  • Star 26 You must be signed in to star a gist
  • Fork 5 You must be signed in to fork a gist
  • Save jheasly/9477732 to your computer and use it in GitHub Desktop.
Save jheasly/9477732 to your computer and use it in GitHub Desktop.
Build RTL-SDR on OSX with no tears using homebrew. Forked from https://gist.github.com/0xabad1dea/5777726, a macports solution.
rtl-sdr build notes for OSX
using macports http://www.macports.org/
see http://sdr.osmocom.org/trac/wiki/rtl-sdr
brew install cmake
brew install libusb
brew install pkgconfig
brew install sox # for easy audio
git clone git://git.osmocom.org/rtl-sdr.git
cd rtl-sdr/
mkdir build
cd build/
cmake ../
make
sudo make install
rtl_test -t
Found 1 device(s):
0: Realtek, RTL2838UHIDIR, SN: 00000001
Using device 0: Generic RTL2832U OEM
Found Rafael Micro R820T tuner
Supported gain values (29): 0.0 0.9 1.4 2.7 3.7 7.7 8.7 12.5 14.4 15.7 16.6 19.7 20.7 22.9 25.4 28.0 29.7 32.8 33.8 36.4 37.2 38.6 40.2 42.1 43.4 43.9 44.5 48.0 49.6
Sampling at 2048000 S/s.
No E4000 tuner found, aborting.
@richardh9935
Copy link

Thanks.
Worked (or at least as far as I can tell...) on Mojave 10.14.5 today. (2019-06-12)

@ajmas
Copy link

ajmas commented Mar 10, 2020

I have made a version of these instructions based on MacPorts:

https://gist.github.com/ajmas/144719991f54931b99de43efae13389f

Feel free to copy anything useful.

@euquiq
Copy link

euquiq commented Oct 5, 2020

Hi! Under macOS Catalina (10.15.7) I am following these instructions. Among the previous commands,

I issued the brew install libusb and it finished with no errors. But, later when inside rtl-sdr/build when running make, I get:

user@MBP % make
Scanning dependencies of target convenience_static
[  3%] Building C object src/CMakeFiles/convenience_static.dir/convenience/convenience.c.o
[  6%] Linking C static library libconvenience_static.a
[  6%] Built target convenience_static
Scanning dependencies of target rtlsdr
[  9%] Building C object src/CMakeFiles/rtlsdr.dir/librtlsdr.c.o
[ 12%] Building C object src/CMakeFiles/rtlsdr.dir/tuner_e4k.c.o
[ 15%] Building C object src/CMakeFiles/rtlsdr.dir/tuner_fc0012.c.o
[ 18%] Building C object src/CMakeFiles/rtlsdr.dir/tuner_fc0013.c.o
[ 21%] Building C object src/CMakeFiles/rtlsdr.dir/tuner_fc2580.c.o
[ 25%] Building C object src/CMakeFiles/rtlsdr.dir/tuner_r82xx.c.o
[ 28%] Linking C shared library librtlsdr.dylib
[ 28%] Built target rtlsdr
Scanning dependencies of target rtl_test
[ 31%] Building C object src/CMakeFiles/rtl_test.dir/rtl_test.c.o
[ 34%] Linking C executable rtl_test
ld: library not found for -lusb-1.0
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [src/rtl_test] Error 1
make[1]: *** [src/CMakeFiles/rtl_test.dir/all] Error 2
make: *** [all] Error 2

Any ideas or help are appreciated.

@itchesavvy
Copy link

Try this make LIBRARY_PATH=/usr/local/lib

@richardh9935
Copy link

richardh9935 commented Feb 26, 2021 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment