-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
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.
Try this make LIBRARY_PATH=/usr/local/lib
I had this error last week. I found this
https://stackoverflow.com/questions/65296289/fatal-error-libusb-libusb-h-no-such-file-or-directory-librtlsdr-install-for-gn
Tsyvarev <https://stackoverflow.com/users/3440745/tsyvarev> recommends
installing pkg-config then retrying.
According to the project's CMakeLists.txt
<http://osmocom.org/projects/rtl-sdr/repository/revisions/master/entry/CMakeLists.txt#L72>,
it expects either libusb to be found with pkg-config or, if pkg-config is
not available, libusb parameters should be filled manually:
LIBUSB_INCLUDE_DIRS should be set to include directory
(/usr/include/libusb-1.0 in your case) and LIBUSB_LIBRARIES should be set
to the libusb library (for link with). Though it seems to be simpler to
install pkg-config. – Tsyvarev
<https://stackoverflow.com/users/3440745/tsyvarev> Dec 14 '20 at 22:48
On Fri, 26 Feb 2021 at 6:44 am, Nicu ***@***.***> wrote:
***@***.**** commented on this gist.
------------------------------
On MacOS Mojave, I get the following:
[ 9%] Built target convenience_static
[ 9%] Building C object src/CMakeFiles/rtlsdr.dir/librtlsdr.c.o
/Users/surdu/Downloads/rtl-sdr/src/librtlsdr.c:30:10: fatal error: 'libusb.h' file not found
#include <libusb.h>
^~~~~~~~~~
1 error generated.
make[2]: *** [src/CMakeFiles/rtlsdr.dir/librtlsdr.c.o] Error 1
make[1]: *** [src/CMakeFiles/rtlsdr.dir/all] Error 2
make: *** [all] Error 2
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<https://gist.github.com/9477732#gistcomment-3645645>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AE2PZZ6RXX3ROZCQQORNBKTTA2SA3ANCNFSM4HXFFBFA>
.
--
*richard horobin*.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I have made a version of these instructions based on MacPorts:
https://gist.github.com/ajmas/144719991f54931b99de43efae13389f
Feel free to copy anything useful.