Skip to content

Commit

Permalink
Update build notes
Browse files Browse the repository at this point in the history
  • Loading branch information
zuckschwerdt committed Dec 31, 2018
1 parent 31b17fb commit e7f8b93
Showing 1 changed file with 52 additions and 18 deletions.
70 changes: 52 additions & 18 deletions BUILDING.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
# Building rtl_433

## Linux
rtl_433 currently supports these input types:
* [RTL-SDR](http://sdr.osmocom.org/trac/wiki/rtl-sdr) (optional, recommended)
* [SoapySDR](https://github.com/pothosware/SoapySDR/wiki) (optional)
* files: CU8, CS16, CF32 I/Q data, U16 AM data (built-in)
* rtl_tcp remote data servers (built-in)

Compiling rtl_433 requires [rtl-sdr](http://sdr.osmocom.org/trac/wiki/rtl-sdr) to be installed.
Building rtl_433 with RTL-SDR or SoapySDR support is optional but using RTL-SDR is highly recommended.
The libraries and header files for RTL-SDR and/or SoapySDR should be installed beforehand.

Depending on your system, you may also need to install the following libraries.
## Linux / Mac OS X

Depending on your system, you may need to install the following libraries.

Debian:

Expand All @@ -14,20 +21,28 @@ Centos/Fedora/RHEL (for Centos/RHEL with enabled EPEL):

sudo dnf install libtool libusb-devel rtl-sdr-devel rtl-sdr

Mac OS X with MacPorts:

sudo port install rtl-sdr cmake

Mac OS X with Homebrew:

brew install rtl-sdr cmake

### CMake

Installation using cmake:
Installation using CMake:

cd rtl_433/
mkdir build
cd build
cmake ../
cmake ..
make
make install

### autoconf
### Autotools (Autoconf, Automake)

Installation using autoconf:
Installation using Autotools:

cd rtl_433/
autoreconf --install
Expand All @@ -39,9 +54,9 @@ The final 'make install' step should be run as a user with appropriate permissio

## Windows

### mingw-w64
### MinGW-w64

You'll need librtlsdr and libusb, they are dependencies for rtl_433.
You'll probably want librtlsdr and libusb.

libusb has prebuilt binaries for windows,
librtlsdr needs to be built (at least for the latest version, some binaries
Expand All @@ -51,8 +66,8 @@ of older versions seem to be floating around)

taken and adapted from here: https://www.onetransistor.eu/2017/03/compile-librtlsdr-windows-mingw.html

* install mingw-w64 (https://mingw-w64.org/) and cmake (https://cmake.org/)
* it's easiest if you select the option to include cmake in your path, otherwise you'll need to do this manually
* install [MinGW-w64](https://mingw-w64.org/) and [CMake](https://cmake.org/)
* it's easiest if you select the option to include CMake in your path, otherwise you'll need to do this manually
* download the libusb binaries from https://sourceforge.net/projects/libusb/files/libusb-1.0/ or from https://libusb.info/
* take the latest release and then download the .7z file, the other file contains the sources (or 'windows binaries' on the .info website)
* extract the archive and open the extracted folder
Expand All @@ -61,7 +76,7 @@ taken and adapted from here: https://www.onetransistor.eu/2017/03/compile-librtl
* copy the `mingw64/dll/libusb-1.0.dll` file to `<mingw_installation_folder>/bin`
* download the source code of librtlsdr https://github.com/steve-m/librtlsdr
* go into the librtlsdr folder
* open cmakelists.txt with an editor that knows unix line endings
* open CMakeLists.txt with an editor that knows unix line endings
* go to `# Find build dependencies` (around line 65) and comment/remove the line with `find_package(Threads)`
* add the following lines instead:

Expand All @@ -80,7 +95,7 @@ SET(THREADS_FOUND TRUE)
/usr/local/include
```

* add some extra lines to point to the mingw include folder where you extracted libusb-1.0, making it look like this
* add some extra lines to point to the MinGW include folder where you extracted libusb-1.0, making it look like this
* take note of the "" around the folder names, these are needed when there are spaces in the folder name
* you'll need to find out the exact paths for your system

Expand All @@ -92,9 +107,9 @@ SET(THREADS_FOUND TRUE)
"C:/Program Files/mingw-w64/x86_64-8.1.0-posix-seh-rt_v6-rev0/mingw64/include/libusb-1.0"
```

* open a mingw terminal in the librtlsdr folder
* open a MinGW terminal in the librtlsdr folder
* create build folder and go into it: `mkdir build && cd build`
* generate makefiles for mingw: `cmake -G "MinGW Makefiles" ..`
* generate makefiles for MinGW: `cmake -G "MinGW Makefiles" ..`
* build the librtlsdr library: `mingw32-make`

#### rtl_433
Expand All @@ -110,9 +125,28 @@ SET(THREADS_FOUND TRUE)
* point the `LIBRTLSDR_INCLUDE_DIRS` to the include folder of the librtlsdr source
* point the `LIBRTLSDR_LIBRARIES` to the `librtlsdr.dll.a` file in the <librtlsdr_source>/build/src folder
* that's the one you've built earlier
* edit `CMAKE_C_STANDARD_LIBRARIES` to include `-lws2_32` (this is for winsocks2)
* start a mingw terminal and run `mingw32-make` to build
* when something in the tests folder doesn't build, you can disable it by commenting out `add_subdirectory(tests)` in the cmakelists.txt file in the source folder of rtl_433
* start a MinGW terminal and run `mingw32-make` to build
* when something in the tests folder doesn't build, you can disable it by commenting out `add_subdirectory(tests)` in the CMakeLists.txt file in the source folder of rtl_433
* rtl_433.exe should be built now
* you need to place it in the same folder as librtlsdr.dll and libusb-1.0.dll (you should have seen both of them by now)
* good luck!

### Visual Studio 2017 CMake MSBuild

cd rtl_433
mkdir build
cd build
cmake -G "Visual Studio 15 2017 Win64" ..
MSBuild.exe rtl433.sln

* -or- open the `rtl433.sln`

### Visual Studio 2017 supplied project/solution

* Open the `rtl_433.sln` from the `vs15` folder -or-

cd rtl_433
cd vs15
MSBuild.exe rtl_433.sln

If your system is missing or you find these steps are outdated please PR an update or open an issue.

0 comments on commit e7f8b93

Please sign in to comment.