Skip to content
master131 edited this page Feb 19, 2022 · 16 revisions

Linux & macOS

To fetch and compile Redsea from source you will need git, the liquid-dsp library, and GNU autotools. Audio files can be decoded if libsndfile is installed. On macOS (OSX) you will also need XCode command-line tools (xcode-select --install).

  1. Clone the repository (unless you downloaded a release zip file, in which case git is not needed):

     $ git clone https://github.com/windytan/redsea.git
     $ cd redsea
    
  2. Compile redsea:

     $ ./autogen.sh && ./configure && make
    
  3. Install:

     $ make install
    

It is also simple to later pull the latest updates and recompile:

    $ git pull
    $ ./autogen.sh && ./configure && make clean && make
    $ make install

For a slower machine it can take some time to compile the TMC support. This can be disabled (./configure --disable-tmc).

If you only need to decode hex or binary input and don't need demodulation, you can compile redsea without liquid-dsp (./configure --without-liquid).

The check for MacPorts directories will fail when cross-compiling. This can be disabled using the --without-macports configure option.

Windows

redsea can be installed using the same instructions for Linux if you are using Windows 10 or newer and have the Windows Subsystem for Linux installed.

Redsea can also be cross-compiled on Windows via MinGW - see minwgw64-redsea on OBS.

MSYS2

MSYS2 can be used to compile redsea into native Windows binaries (via MinGW) that can be distributed easily to other users. These instructions are for a 64-bit build.

  1. Download and install MSYS2 as per the instructions on the front page of MSYS2, including installing the mingw64-gcc packages.

  2. Launch the MSYS MinGW x64 shell from the Start Menu.

  3. Add the MinGW bin folder to the PATH variable:

     $ export PATH=$PATH:/c/msys64/mingw64/bin
    
  4. Install the essential packages required to compile all the required components:

     $ pacman -S --noconfirm autoconf automake git mingw-w64-x86_64-libsndfile mingw-w64-x86_64-libiconv
    
  5. Clone liquid-dsp from Github and apply MinGW build scripts from CubicSDR:

     $ git clone https://github.com/jgaeddert/liquid-dsp.git
     $ cd liquid-dsp
     $ git clone https://github.com/cjcliffe/CubicSDR.git
     $ cp CubicSDR/external/liquid-dsp/makefile* . && cp CubicSDR/external/liquid-dsp/config.h .
    
  6. Compile liquid-dsp:

     $ make -f makefile.mingw64 -j clean && make -f makefile.mingw64 -j
    
  7. Clone redsea:

     $ cd ..
     $ git clone https://github.com/windytan/redsea.git
     $ cd redsea
    
  8. Apply fix to auto-configuration for MinGW so that libiconv is added to the linker settings and remove libc linker flag (MinGW uses msvcrt):

     $ sed -i 's/darwin\*)/darwin*|msys*)/g' configure.ac
     $ sed -i 's/-lc //g' src/Makefile.am
    
  9. Compile redsea:

     $ mkdir -p liquid && cp ../liquid-dsp/include/liquid.h ./liquid/
     $ ./autogen.sh && ./configure LDFLAGS="-L$(pwd)/../liquid-dsp" CXXFLAGS="-D_USE_MATH_DEFINES=1" && make
     $ mkdir -p distrib && cp src/redsea.exe distrib/ && ldd src/redsea.exe | grep -iv windows | grep -iv system32 | grep -v :$ | cut -f2 -d\> | cut -f1 -d\( | awk '{$1=$1};1' | xargs -I{} cp {} distrib/
    

The distrib folder will contain the redsea executable and all its related dependencies.

You can now use redsea in tandem with a MinGW build of rtl-fm (prebuilt) as per the Use cases on the wiki.

Cygwin

Redsea can be built from source using Cygwin. Note that these instructions will produce binaries that will only be usable within a Cygwin environment (it is still possible to execute Cygwin commands from Command Prompt or other shells however).

  1. Use the setup to install Cygwin and the base-packages if it's not already installed.

  2. Install the wget package using the same setup executable

  3. Launch the Cygwin Terminal and install apt-cyg (you can skip this if you've already installed it previously):

     $ wget -O apt-cyg https://raw.githubusercontent.com/transcode-open/apt-cyg/master/apt-cyg
     $ install apt-cyg /bin
    
  4. Install the packages required to compile liquid-dsp and redsea:

     $ apt-cyg install make gcc-core gcc-g++ patch bzip2 perl tar xz git autoconf libsndfile-devel automake libiconv-devel git
    
  5. Clone liquid-dsp from Github:

     $ git clone https://github.com/jgaeddert/liquid-dsp.git
     $ cd liquid-dsp
    
  6. Build and install liquid-dsp:

     $ ./bootstrap.sh
     $ ./configure --prefix=/usr
     $ make
     $ make install
    
  7. Repair the header file for liquid-dsp because Cygwin does not allow underscore variables that start with an uppercase when compiling with gcc:

     $ perl -i -p -e 's/(?<=\s)(_[A-Z])(?=[,\)])/\L\1__/g' /usr/include/liquid/liquid.h
    
  8. Clone redsea:

     $ cd ..
     $ git clone https://github.com/windytan/redsea.git
     $ cd redsea
    
  9. Apply fix to auto-configuration for Cygwin so that libiconv is added to the linker settings:

     $ sed -i 's/darwin\*)/darwin*|cygwin*)/g' configure.ac
    
  10. Compile redsea:

     $ ./autogen.sh && ./configure --prefix=/usr CXXFLAGS="-std=gnu++14" && make
    
  11. Install:

    $ make install
    

It is also simple to later pull the latest updates and recompile:

    $ git pull
    $ ./autogen.sh && ./configure --prefix=/usr CXXFLAGS="-std=gnu++14" && make clean && make
    $ make install

As an additional side-note, to enable decoding from an RTL-SDR device, you can compile the rtl-sdr utilities (ie. rtl_fm) in Cygwin using the following steps:

    $ apt-cyg install libusb1.0-devel libtool
    $ git clone git://git.osmocom.org/rtl-sdr.git
    $ cd rtl-sdr
    $ autoreconf -i && ./configure --prefix=/usr && make
    $ make install

Ensure the RTL-SDR device has the WinUSB driver loaded via Zadig (as is usually required for most RTL-SDR utilities on Windows).

Refer to Use cases for example usage of rtl_fm with redsea.

Clone this wiki locally