Skip to content

Compiling and or running

TheUnnamedDude edited this page Apr 2, 2016 · 10 revisions

Table of contents

Compiling on Linux

Installing dependencies

Install openssl and sdl2 (with headers) via your distro's package manager. (Packages with headers generally end with -dev)

Compiling

Compile and run:

cargo run --release

Just compile:

cargo build --release

Compiling on OS X

Installing dependencies

Compiling Steven requires a working rust installation(currently only nightly), openssl and sdl2, installing this is easiest with homebrew.

Installing multirust

The easiest way to install a nightly version of rust is probably by using multirust, to install multirust issue the command:

brew install multirust

Set the default rust version:

multirust default nightly

Installing dependencies with homebrew

To install openssl and sdl2 issue these commands:

brew install sdl2
brew install openssl

Older versions of OS X comes with a older version of openssl while El Capitan and newer does not come with openssl at all, compiling steven with older OS X versions would most likely work without installing the openssl library(and using the OPENSSL_ environment variables) but I would recommend installing it anyway.

TODO: Instructions without homebrew

Compiling

To compile steven you can either use this simple bash script to set the environment variables so the compiler can find the required libraries and run ./scriptname.sh build --release to compile or ./scriptname.sh run --release to run:

#!/bin/bash
export LIBRARY_PATH="$LIBRARY_PATH:/usr/local/lib"
export OPENSSL_INCLUDE_DIR=`brew --prefix openssl`/include
export OPENSSL_LIB_DIR=`brew --prefix openssl`/lib
cargo "$@"

or add the variables directly to the command:

LIBRARY_PATH="$LIBRARY_PATH:/usr/local/lib" OPENSSL_INCLUDE_DIR=`brew --prefix openssl`/include OPENSSL_LIB_DIR=`brew --prefix openssl`/lib cargo build --release

Note: If you're not using homebrew you probably don't need to set the environment variables.

Compiling on Windows (Mingw + MSYS2)

Installing dependencies

Follow the instructions at https://msys2.github.io to install msys and mingw, when thats done you want to install the dependencies for steven and multirust:

pacman -S git tar mingw-w64-x86_64-openssl mingw-w64-x86_64-SDL2 mingw-w64-x86_64-gcc

When thats done follow the instructions to install multirust from here.
Set the default rust version:

multirust default nightly

Clone the git repo:

git clone git@github.com:Thinkofname/steven-rust.git

Compiling

Compile and run:

cargo run --release

Just compile:

cargo build --release

Compiling on Windows (MSVC)

Clone this wiki locally