2021-07-07 00:45:19 -04:00
.. _operating_system_tips:
2023-04-10 16:06:37 -04:00
==========================
2021-09-22 01:23:09 -04:00
Installing HackRF Software
2023-04-10 16:06:37 -04:00
==========================
HackRF software includes HackRF Tools and libhackrf. HackRF Tools are the commandline utilities that let you interact with your HackRF. libhackrf is a low level library that enables software on your computer to operate with HackRF.
2021-07-02 13:52:22 -04:00
2021-09-22 01:23:09 -04:00
Install Using Package Managers
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2021-07-02 13:52:22 -04:00
2021-09-22 01:23:09 -04:00
Unless developing or testing new features for HackRF, we highly recommend that most users use build systems or package managers provided for their operating system. **Our suggested operating system for use with HackRF is Ubuntu** .
2021-07-02 13:52:22 -04:00
2021-09-22 01:23:09 -04:00
FreeBSD
+++++++
2021-07-02 13:52:22 -04:00
2021-09-22 01:23:09 -04:00
You can use the binary package: `` # pkg install hackrf ``
2021-07-02 13:52:22 -04:00
2021-09-22 01:23:09 -04:00
You can also build and install from ports:
2021-07-02 13:52:22 -04:00
2021-09-22 01:23:09 -04:00
.. code-block :: sh
2021-07-02 13:52:22 -04:00
2021-09-22 01:23:09 -04:00
# cd /usr/ports/comms/hackrf
# make install
2021-07-02 13:52:22 -04:00
2021-09-22 01:23:09 -04:00
Linux: Arch
+++++++++++
2021-07-02 13:52:22 -04:00
2021-09-22 01:23:09 -04:00
.. code-block :: sh
2021-07-02 13:52:22 -04:00
2021-10-25 17:41:12 -04:00
pacman -S hackrf
2021-07-02 13:52:22 -04:00
2021-09-22 01:23:09 -04:00
Linux: Fedora / Red Hat
+++++++++++++++++++++++
2021-07-02 13:52:22 -04:00
2021-10-25 17:41:12 -04:00
`` sudo dnf install hackrf -y ``
2021-07-02 13:52:22 -04:00
2021-09-22 01:23:09 -04:00
Linux: Gentoo
+++++++++++++
2021-07-02 13:52:22 -04:00
.. code-block :: sh
emerge -a net-wireless/hackrf-tools
2021-09-22 01:23:09 -04:00
Linux: Ubuntu / Debian
++++++++++++++++++++++
2021-07-02 13:52:22 -04:00
2021-09-22 01:23:09 -04:00
`` sudo apt-get install hackrf ``
2021-07-02 13:52:22 -04:00
2021-09-22 01:23:09 -04:00
OS X (10.5+): Homebrew
++++++++++++++++++++++
2021-07-02 13:52:22 -04:00
2021-10-25 17:41:12 -04:00
`` brew install hackrf ``
2021-07-02 13:52:22 -04:00
2021-09-22 01:23:09 -04:00
OS X (10.5+): MacPorts
++++++++++++++++++++++
2021-07-02 13:52:22 -04:00
2021-10-25 17:41:12 -04:00
`` sudo port install hackrf ``
2021-07-02 13:52:22 -04:00
2021-09-22 01:23:09 -04:00
Windows: Binaries
+++++++++++++++++
2021-07-02 13:52:22 -04:00
2025-06-14 21:22:51 +02:00
Windows users can use `radioconda <https://github.com/ryanvolz/radioconda> `__ to get the required binaries installed.
Alternatively, binaries are available as build artifacts under the 'Actions'-tab on github `here <https://github.com/greatscottgadgets/hackrf/actions> `__ (GitHub Login needed).
2021-07-02 13:52:22 -04:00
2023-04-10 16:06:37 -04:00
2021-09-22 01:23:09 -04:00
-----------
2021-07-02 13:52:22 -04:00
2023-04-10 16:06:37 -04:00
2021-09-22 01:23:09 -04:00
Installing From Source
~~~~~~~~~~~~~~~~~~~~~~
2021-07-02 13:52:22 -04:00
2021-09-22 01:23:09 -04:00
Linux / OS X / \*BSD: Building HackRF Software From Source
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2021-07-02 13:52:22 -04:00
2024-04-06 22:38:26 +08:00
Acquire the source for the HackRF tools from either a `release archive <https://github.com/greatscottgadgets/hackrf/releases> `__ or git: `` git clone https://github.com/greatscottgadgets/hackrf.git ``
2021-07-02 13:52:22 -04:00
Once you have the source downloaded, the host tools can be built as follows:
.. code-block :: sh
cd hackrf/host
mkdir build
cd build
cmake ..
make
sudo make install
sudo ldconfig
2021-07-07 00:45:19 -04:00
If you have HackRF hardware, you may need to :ref: `update the firmware <updating_firmware>` to match the host tools versions.
2021-07-02 13:52:22 -04:00
2025-10-04 04:20:34 +01:00
Windows: Building HackRF Software From Source
2021-09-22 01:23:09 -04:00
+++++++++++++++++++++++++++++++++++++++++++++
2021-07-02 13:52:22 -04:00
2025-10-04 04:20:34 +01:00
Install `Visual Studio Community <https://visualstudio.microsoft.com/vs/community/> `__ (2015 or later) and `CMake <https://cmake.org/> `__ (at least version 3.21.4).
2021-07-02 13:52:22 -04:00
2025-10-04 04:20:34 +01:00
Install library dependencies using `vcpkg <https://vcpkg.io/en/> `__ :
2021-09-22 01:23:09 -04:00
2025-10-04 04:20:34 +01:00
.. code-block :: winbatch
2021-09-22 01:23:09 -04:00
2025-10-04 04:20:34 +01:00
git clone https://github.com/microsoft/vcpkg
cd vcpkg
bootstrap-vcpkg.bat
vcpkg install libusb fftw3 pthreads pkgconf
2021-09-22 01:23:09 -04:00
2025-10-04 04:20:34 +01:00
Open the Visual Studio Developer Command Prompt, and change to the directory where you unpacked the HackRF source.
2021-09-22 01:23:09 -04:00
2025-10-04 04:20:34 +01:00
The following steps assume you installed vcpkg in `` C:\vcpkg `` .
2021-09-22 01:23:09 -04:00
2025-10-04 04:20:34 +01:00
Configure CMake and build the code:
.. code-block :: winbatch
2021-09-22 01:23:09 -04:00
2025-10-04 04:20:34 +01:00
set PKG_CONFIG=C:\vcpkg\installed\x64-windows\tools\pkgconf\pkgconf.exe
set PKG_CONFIG_PATH=C:\vcpkg\installed\x64-windows\lib\pkgconfig
set CMAKE_TOOLCHAIN_FILE=C:\vcpkg\scripts\buildsystems\vcpkg.cmake
cmake -B host\build host
cmake --build host\build
2021-09-22 01:23:09 -04:00
2025-10-04 04:20:34 +01:00
CMake will generate a `` HackRF.sln `` project file which you can open in Visual Studio for editing and development.