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:
- pkg-config (Arch, Ubuntu)
- make (Arch, Ubuntu)
- libmpv (Arch, Ubuntu)
- libappindicator3 (Arch, Ubuntu)
- libcurl (Arch, Ubuntu)
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>
Build on Linux
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
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
- 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/src/nativeInterop/windows-x86_64
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/src/nativeInterop/windows-x86_64
libmpv.dll.a
intospms/src/nativeInterop/windows-x86_64/lib
libmpv-2.dll
intospms/src/nativeInterop/windows-x86_64/bin