Installation
Inko consists of two parts: the virtual machine, and the compiler. The virtual machine is written in Rust, while the compiler is written in Ruby.
Note
We are working towards a self-hosting compiler. Once complete, Ruby is no longer required.
Inko officially supports Linux, macOS, and Windows. BSDs and other Unix-like operating systems should also work, but are not officially supported at this time.
Windows users can build Inko using the Visual Studio build tools, or using a Unix compatibility layer such as MSYS2.
Inko requires a 64-bits platform, 32-bits platforms are not supported. Inko also requires that you use a CPU with AES-NI support. Pretty much all Intel and AMD x86-64 CPUs since 2010 have AES-NI support, so this should not be a problem.
Choosing an installation method
The easiest way to install Inko is to use the Inko version manager (ivm). ivm works on Linux, macOS, and Windows, and makes it easy to install multiple Inko versions at once. If you decide to use ivm you should read the ivm installation instructions first.
Some Linux package managers also provide packages for Inko, and macOS users can also install Inko using Homebrew.
If you want to contribute to Inko itself, you must build from source instead.
Linux
Using ivm
Tip
Please read the ivm guide before using ivm.
First install the necessary dependencies:
sudo pacman -S rust ruby libffi base-devel
sudo apt install rust ruby ruby-json libffi7 libffi-dev build-essential
sudo apk add rust ruby ruby-json libffi libffi-dev build-base
You can then install Inko using ivm install VERSION
, with "VERSION" being the
version you want to install. For example:
ivm install 0.8.1
Arch Linux
The AUR provides the package inko-git
, which
will install the latest Git version of Inko. You can install this using your
favourite AUR helper:
yay -S inko-git
pacaur -S inko-git
pikaur -S inko-git
git clone https://aur.archlinux.org/inko-git.git
cd inko-git
makepkg -si
If you are unsure about what AUR helper to use, we recommend using yay.
macOS
Using ivm
Tip
Please read the ivm guide before using ivm.
First install the necessary dependencies:
brew install ruby rust libffi
You can then install Inko using ivm install VERSION
, with "VERSION" being the
version you want to install. For example:
ivm install 0.8.1
Using Homebrew
brew install inko
This will install the latest stable version of Inko available in Homebrew.
Attention
The Homebrew formula is maintained by Homebrew and its contributors. For issues specific to the formula (e.g. it doesn't work on a certain version of macOS), please report issues in the homebrew-core issue tracker.
Windows
For Windows we highly recommend using ivm. We recommend using the Visual Studio build tools, but using MSYS2 will also work.
Using Visual Studio build tools
When using the Visual Studio build tools, you must enable the Visual C++ build tools feature in the Visual Studio build tools installer. ivm/Inko will not work without this feature.
For Rust, you'll need to use the stable-msvc
toolchain. If you have
rustup installed, you can set this toolchain as the
default as follows:
rustup default stable-msvc
Next, open a x64 native tools command prompt.You can then install Inko versions
by running ivm install X
with "X" being the version to install. For example:
ivm install 0.8.1
Using MSYS2
First install the necessary dependencies:
pacman -S ruby libffi
For Rust we recommend installing it outside of MSYS2 using rustup, as the MSYS2
version of Rust is not always up to date. When doing so, make sure the default
toolchain is set to stable-x86_64-pc-windows-gnu
:
rustup default stable-x86_64-pc-windows-gnu
You can then install Inko versions by running ivm install X
with "X" being the
version to install. For example:
ivm install 0.8.1
Docker
If you are using Docker or Podman, you can use our official Docker images. These images are published on Docker Hub in the inkolang/inko repository.
Tip
If you are using Linux we recommend using Podman, as Podman can be set up to not require root access.
To install Inko 0.8.1, run the following:
docker pull inkolang/inko:0.8.1
podman pull inkolang/inko:0.8.1
You can then run Inko as follows:
docker run inkolang/inko:0.8.1 inko --version
podman run inkolang/inko:0.8.1 inko --version
A full list of all available tags is found here.
Building from source
We recommend users only build from source if they want to contribute to Inko. If you just want to use Inko, we recommend using ivm instead.
Installing dependencies
When building from source, a few additional dependencies are necessary. For example, source builds will compile libffi from source by default, and this requires some extra dependencies to be installed. All the necessary dependencies can be installed as follows:
sudo pacman -S coreutils autoconf automake libtool rust ruby git make base-devel
sudo apt install coreutils autoconf automake libtool rust ruby ruby-json git make build-essential
sudo apk add coreutils autoconf automake libtool rust ruby ruby-json git make build-base
brew install coreutils autoconf automake libtool rust ruby git make
pacman -S coreutils autoconf automake libtool ruby git make
You can reduce the number of dependencies by dynamically linking Inko against libffi. How to do so is covered below, but when this is enabled you only need the following dependencies:
sudo pacman -S coreutils rust ruby git make base-devel
sudo apt install coreutils rust ruby ruby-json git make build-essential
sudo apk add coreutils rust ruby ruby-json git make build-base
brew install coreutils rust ruby git make
pacman -S coreutils ruby git make
Important
Dynamically linking against libffi on MSYS2 is not supported.
Building
When building from source, you can produce a debug build, a release build, or a profile build.
Debug builds are slow but compile fast and contain debugging symbols. Release builds are fast, but take a little longer to compile (typically around one minute). Profile builds are release builds that contain debugging symbols. Profile builds can take several minutes to compile, so we recommend only using these when necessary.
The commands and their outputs per build type are as follows:
Build type | Command | Executable location | Build time (from scratch) |
---|---|---|---|
debug | make vm/debug DEV=1 |
target/debug/inko |
<= 30 seconds |
release | make vm/release DEV=1 |
target/release/inko |
<= 1 minute |
profile | make vm/profile DEV=1 |
target/release/inko |
1 to 5 minutes |
Packaging
If you want to create an Inko package for your favourite package manager, the build steps are a little different. First you must decide two things:
- What will the installation prefix be at runtime? This typically is
/usr
, but it may be different on some platforms (e.g./usr/local
). - What is the temporary directory/chroot/jail to install the files into, if any?
Let's assume that our prefix is /usr
, and the temporary directory to install
files into is ./chroot
. First we'll build all the necessary files by running
the following:
make build PREFIX=/usr
Now we can install Inko:
make install PREFIX=/usr DESTDIR=./chroot
Tip
You must specify PREFIX
for both make build
and make install
. The
DESTDIR
variable is only to be used when running make install
.
Feature flags
You can customise a source installation by enabling certain features by setting
the FEATURES
Make variable. This variable is set to a comma-separated string
of features to enable. For example:
make build FEATURES='foo,bar'
This would compile the VM with the foo
and bar
features enabled.
The following feature flags are available:
Feature flag | Default state | Description |
---|---|---|
libffi-system | Disabled | Dynamically link against libffi, instead of compiling it from source. |
jemalloc | Disabled | Use jemalloc instead of the system allocator. |