Skip to content
Oona Räisänen edited this page Jun 13, 2024 · 16 revisions

Linux & macOS

To fetch and compile Redsea from source you will need git, the liquid-dsp library, meson, and libsndfile. 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:

     $ meson setup build && cd build && meson compile
    

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

    $ git pull
    $ cd build && meson compile

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:/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 mingw-w64-x86_64-meson mingw-w64-x86_64-python3
    
  5. Clone liquid-dsp from Github:

     $ git clone https://github.com/jgaeddert/liquid-dsp.git
     $ cd liquid-dsp
    
  6. Compile & install liquid-dsp (disable glibc specific checks and headers):

     $ perl -i -p -e 's/(AC_CHECK_LIB\(\[c\].+| sys\/resource.h)//g' configure.ac
     $ ./bootstrap.sh && ./configure --prefix=/mingw64 && make
     $ make install
    
  7. Clone redsea:

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

     $ meson setup build && cd build && meson compile && cd ..
     $ mkdir -p distrib && cp build/redsea.exe distrib/ && ldd build/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 meson 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. Compile redsea:

     $ meson setup build && cd build && meson compile
    

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

    $ git pull
    $ cd build && meson compile

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.