Building from source
This page outlines procedures for compiling SpMs from its source code. For installing from pre-compiled packages, see Installation.
Requirements
All platforms:
Linux only:
Not required for minimal build:
Download source code
From a command-line terminal:
Clone the spmp-server Git repository
git clone https://github.com/toasterofbread/spmp-server
Enter the cloned directory
cd spmp-server
Running Gradle commands (in root directory)
./gradlew <command name>
gradlew.bat <command name>
1. Install the Kotlin/Native gcc toolchain
Download toolchain from
Extract downloaded archive to a convenient location
2. Compile libzmq with draft APIs
Download 4.3.5 libzmq source code
https://github.com/zeromq/libzmq/releases/download/v4.3.5/zeromq-4.3.5.tar.gz
Extract downloaded archive to a convenient location and cd into the extracted directory
Configure and compile the build by running the following commands
# Configure build (x86)
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>/library/src/nativeInterop/linuxX64
# Configure build (Arm)
LDFLAGS="-lgcc -lgcc_s" \
CC=<toolchain path>/bin/aarch64-unknown-linux-gnu-gcc \
CXX=<toolchain path>/bin/aarch64-unknown-linux-gnu-g++ \
./configure \
--host=arm-none-linux-gnueabi \
--enable-drafts \
--enable-static \
--disable-shared \
--disable-libbsd \
--prefix=<absolute path to spms>/library/src/nativeInterop/linuxArm64
# Compile
make -j$(nproc)
# Install to prefix
make install
3. Compile SpMs by running the Gradle command app:linuxX64Binaries
(or app:linuxArm64Binaries
for Arm)
4. Upon completion, x86 and Arm executables will be contained in spms/app/build/bin/linuxX64/releaseExecutable/
and spms/app/build/bin/linuxArm64/releaseExecutable/
respectively
Build binary on Windows
1. Download and set up vcpkg
- Clone the
https://github.com/Microsoft/vcpkg.git
Git repository (--depth 1
argument recommended) - Run
bootstrap-vcpkg.bat
inside the cloned directory
2. Build libzmq and libcurl
- Run
vcpkg install zeromq[draft]:x64-windows curl:x64-windows
inside the vcpkg directory - Copy the
bin
,include
, andlib
directories from<vcpkg directory>/installed/x64-windows
tospms/library/src/nativeInterop/mingwX64
3. Download libmpv
Download
mpv-dev-x86_64-20240121(...).7z
from the libmpv SourceForge pageExtract the downloaded archive to a convenient location
Copy/move the following files/directories from the extracted zip:
include
intospms/library/src/nativeInterop/windows-x86_64
libmpv.dll.a
intospms/library/src/nativeInterop/windows-x86_64/lib
libmpv-2.dll
intospms/library/src/nativeInterop/windows-x86_64/bin