Skip to content

Commit

Permalink
Clear up the installation documentation
Browse files Browse the repository at this point in the history
This ensures both the installation and ivm guides make various mentions
of the necessary dependencies and environment variables.
  • Loading branch information
yorickpeterse committed Jul 3, 2024
1 parent efba0cf commit 131c0e1
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 33 deletions.
62 changes: 33 additions & 29 deletions docs/source/setup/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ ivm install latest
```

::: note
When using macOS and Homebrew, you may need to set the `LIBRARY_PATH` and `PATH`
variables. See the [macOS installation section](#macos) for more details.
ivm installs Inko from source, so you'll need to install the necessary
[dependencies](#dependencies) for your platform first.
:::

This installs the latest known version. If you want to install a specific
Expand Down Expand Up @@ -128,19 +128,6 @@ Inko is available in [Homebrew](https://brew.sh/):
brew install inko
```

You may need to add the LLVM `bin` directory to your `PATH` as follows:

```bash
export PATH="$(brew --prefix llvm@17)/bin:$PATH"
```

You may also need to set the `LIBRARY_PATH` to the following, though this
doesn't appear to always be needed:

```bash
export LIBRARY_PATH="$(brew --prefix llvm@17)/lib:$(brew --prefix zstd)/lib"
```

## From source

When building from Git, first clone the repository:
Expand Down Expand Up @@ -209,22 +196,10 @@ make install DESTDIR=./package-root PREFIX=/usr/local
The `PREFIX` variable must be set for both the `make` and `make install`
commands, but `DESTDIR` is only necessary for `make install`.

### FreeBSD

When building from source, you may have to set the `LIBRARY_PATH` variable as
follows:

```bash
LIBRARY_PATH="/usr/local/lib" cargo build
```

Without this the linker may fail to find the zstd and libffi libraries, which
are needed by LLVM on FreeBSD.

## Dependencies

When building from source or using [ivm](ivm), you'll first need to install
the compiler's dependencies.
When building from source or using [ivm](ivm), you'll need to install the
necessary dependencies.

### Arch Linux

Expand Down Expand Up @@ -301,12 +276,41 @@ Older versions of Fedora aren't supported.
sudo pkg install llvm17 rust git
```

You may have to set the `LIBRARY_PATH` variable as follows:

```bash
export LIBRARY_PATH="/usr/local/lib"
```

Without this the linker may fail to find the zstd and libffi libraries, which
are needed by LLVM on FreeBSD.

### macOS

```bash
brew install llvm@17 rust git
```

You may have to set `LIBRARY_PATH` as follows:

```bash
export LIBRARY_PATH="$(brew --prefix llvm@17)/lib:$(brew --prefix zstd)/lib"
```

You may also have to add the LLVM `bin` directory to your `PATH` as follows:

```bash
export PATH="$(brew --prefix llvm@17)/bin:$PATH"
```

Without setting these variables, it's possible building of Inko fails due to the
build process not finding the necessary LLVM libraries.

::: tip
See [this Homebrew issue](https://github.com/Homebrew/brew/issues/13481) for
details on why this might be necessary.
:::

### Ubuntu

For Ubuntu 24.04 and newer:
Expand Down
16 changes: 12 additions & 4 deletions docs/source/setup/ivm.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,13 @@
different versions of Inko, independent from your system's package manager. ivm
is written in Rust.

## Installing
## Requirements

- Rust 1.70 or newer
- The [dependencies](../installation#dependencies) necessary to build Inko from
source

ivm itself only requires Rust 1.70 or newer, but to build Inko itself you'll
need to also meet the requirements listed in the [installation
guide](installation).
## Installing

### Arch Linux

Expand Down Expand Up @@ -102,6 +104,12 @@ Make sure to set a default version after installing Inko, otherwise you have
to use `ivm run VERSION inko ...` to use Inko.
:::

::: note
Make sure the [dependencies](../installation#dependencies) necessary for your
platform are installed, and that any required environment variables are set
_before_ running `ivm install`.
:::

To remove a version:

```bash
Expand Down

0 comments on commit 131c0e1

Please sign in to comment.