1This repository contains host software (Linux/Windows) for HackRF, a project to
2produce a low cost, open source software radio platform.
3
4## How to build the host software on Linux:
5
6### Prerequisites for Linux (Debian/Ubuntu):
7`sudo apt-get install build-essential cmake libusb-1.0-0-dev pkg-config libfftw3-dev`
8
9### Build host software on Linux:
10```
11mkdir host/build
12cd host/build
13cmake ..
14make
15sudo make install
16sudo ldconfig
17```
18
19By default this will attempt to install an udev rule to `/etc/udev/rules.d` to
20provide the `usb` or `plugdev` group access to HackRF. If your setup requires
21the udev rule to be installed elsewhere you can modify the path with
22`-DUDEV_RULES_PATH=/path/to/udev`.
23
24Note: The udev rule is not installed by default for PyBOMBS installs as
25they do not ususally get installed with root privileges.
26
27## Clean CMake temporary files/dirs:
28```
29cd host/build
30rm -rf *
31```
32
33## How to build host software on Windows:
34### Prerequisites for Cygwin, MinGW, or Visual Studio:
35
36* cmake-2.8.12.1 or later from http://www.cmake.org/cmake/resources/software.html
37* libusbx-1.0.18 or later from http://sourceforge.net/projects/libusbx/files/latest/download?source=files
38* fftw-3.3.5 or later from http://www.fftw.org/install/windows.html
39* Install Windows driver for HackRF hardware or use Zadig see http://sourceforge.net/projects/libwdi/files/zadig
40  - If you want to use Zadig select HackRF USB device and just install/replace it with WinUSB driver.
41
42>**Note for Windows build:**
43 You shall always execute hackrf-tools from Windows command shell and not from Cygwin or MinGW shell because on Cygwin/MinGW
44 Ctrl C is not managed correctly and especially for hackrf_transfer the Ctrl C(abort) will not stop correctly and will corrupt the file.
45
46### For Cygwin:
47```
48mkdir host/build
49cd host/build
50cmake ../ -G "Unix Makefiles" -DCMAKE_LEGACY_CYGWIN_WIN32=1 -DLIBUSB_INCLUDE_DIR=/usr/local/include/libusb-1.0/
51make
52make install
53```
54
55### For MinGW:
56```
57mkdir host/build
58cd host/build
59cmake ../ -G "MSYS Makefiles" -DLIBUSB_INCLUDE_DIR=/usr/local/include/libusb-1.0/
60make
61make install
62```
63
64### For Visual Studio 2015 x64
65Create library definition for MSVC to link to
66`C:\fftw-3.3.5-dll64> lib /machine:x64 /def:libfftw3f-3.def`
67
68```
69c:\hackrf\host\build> cmake ../ -G "Visual Studio 14 2015 Win64" \
70-DLIBUSB_INCLUDE_DIR=c:\libusb-1.0.21\libusb \
71-DLIBUSB_LIBRARIES=c:\libusb-1.0.21\MS64\dll\lib\libusb-1.0.lib \
72-DTHREADS_PTHREADS_INCLUDE_DIR=c:\pthreads-w32-2-9-1-release\Pre-built.2\include \
73-DTHREADS_PTHREADS_WIN32_LIBRARY=c:\pthreads-w32-2-9-1-release\Pre-built.2\lib\x64\pthreadVC2.lib \
74-DFFTW_INCLUDES=C:\fftw-3.3.5-dll64 \
75-DFFTW_LIBRARIES=C:\fftw-3.3.5-dll64\libfftw3f-3.lib
76```
77
78CMake will produce a solution file named `HackRF.sln` and a series of
79project files which can be built with msbuild as follows:
80`c:\hackrf\host\build> msbuild HackRF.sln`
81
82## How to build host the software on FreeBSD
83You can use the binary package:
84`# pkg install hackrf`
85
86You can build and install from ports:
87```
88# cd /usr/ports/comms/hackrf
89# make install
90```
91
92principal author: Michael Ossmann <mike@ossmann.com>
93
94http://greatscottgadgets.com/hackrf/
95