This page outlines procedures for compiling SpMs from its source code. For installing from pre-compiled packages, see Installation.

Requirements

All platforms:

Linux only:

Download source code

From a command-line terminal:

  1. Clone the spmp-server Git repository

    git clone https://github.com/toasterofbread/spmp-server

  2. Enter the cloned directory cd spmp-server

Build on Linux

1. Install the Kotlin/Native gcc toolchain
  1. Download toolchain from

    https://download.jetbrains.com/kotlin/native/x86_64-unknown-linux-gnu-gcc-8.3.0-glibc-2.19-kernel-4.9-2.tar.gz

  2. Extract downloaded archive to a convenient location

2. Compile libzmq with draft APIs
  1. Download 4.3.5 libzmq source code

    https://github.com/zeromq/libzmq/releases/download/v4.3.5/zeromq-4.3.5.tar.gz

  2. Extract downloaded archive to a convenient location and cd into the extracted directory

  3. Configure and compile the build by running the following commands

# Configure build
LDFLAGS="-lgcc -lgcc_s" \
CC=<toolchain path>/bin/x86_64-unknown-linux-gnu-gcc \
CXX=<toolchain path>/bin/x86_64-unknown-linux-gnu-g++ \
./configure \
    --enable-drafts \
    --enable-static \
    --disable-shared \
    --disable-libbsd \
    --prefix=<absolute path to spms>/src/nativeInterop/linux-x86_64

# Compile
make -j$(nproc)

# Install to prefix
make install
3. Compile SpMs by running the Gradle command linux-x86_64BinariesStatic
4. Upon completion, debug and release executables will be contained in spms/build/bin/linux-x86_64/debugExecutable/ and spms/build/bin/linux-x86_64/releaseExecutable/ respectively

Build on Windows

1. Download and set up vcpkg
  1. Clone the https://github.com/Microsoft/vcpkg.git Git repository (--depth 1 argument recommended)
  2. Run bootstrap-vcpkg.bat inside the cloned directory
2. Build libzmq and libcurl
  1. Run vcpkg install zeromq[draft]:x64-windows curl:x64-windows inside the vcpkg directory
  2. Copy the bin, include, and lib directories from <vcpkg directory>/installed/x64-windows to spms/src/nativeInterop/windows-x86_64
3. Download libmpv
  1. Download mpv-dev-x86_64-20240121(...).7z from the libmpv SourceForge page

    https://sourceforge.net/projects/mpv-player-windows/files/libmpv/mpv-dev-x86_64-20240121-git-a39f9b6.7z

  2. Extract the downloaded archive to a convenient location

  3. Copy/move the following files/directories from the extracted zip:

    • include into spms/src/nativeInterop/windows-x86_64
    • libmpv.dll.a into spms/src/nativeInterop/windows-x86_64/lib
    • libmpv-2.dll into spms/src/nativeInterop/windows-x86_64/bin
3. Compile SpMs by running the Gradle command windows-x86_64Binaries
4. Upon completion, debug and release executables will be contained in spms/build/bin/windows-x86_64/debugExecutable/ and spms/build/bin/windows-x86_64/releaseExecutable/ respectively