|
|
This section describes how to configure the Erlang environment to run experiments and
|
|
|
develop code for the ETSI TeraFlowSDN controller.
|
|
|
|
|
|
First we need to install Erlang. There is multiple way, for development we will be
|
|
|
using [ASDF](https://asdf-vm.com/), a tool that allows the installation of multiple
|
|
|
version of Erlang at the same time, and switch from one version to the other at will.
|
|
|
|
|
|
- First, install any missing dependencies:
|
|
|
```bash
|
|
|
sudo apt install curl git autoconf libncurses-dev build-essential m4 libssl-dev
|
|
|
```
|
|
|
|
|
|
- Download *ASDF* tool to the local account:
|
|
|
```bash
|
|
|
git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.10.2
|
|
|
```
|
|
|
|
|
|
- Make *ASDF* activate on login by adding these lines at the end of the `~/.bashrc` file:
|
|
|
```bash
|
|
|
. $HOME/.asdf/asdf.sh
|
|
|
. $HOME/.asdf/completions/asdf.bash
|
|
|
```
|
|
|
|
|
|
- Logout and log back in to activate *ASDF*.
|
|
|
|
|
|
*ASDF* supports multiple tools by installing there corresponding plugins.
|
|
|
|
|
|
- Install *ASDF* plugin for Erlang:
|
|
|
```bash
|
|
|
asdf plugin add erlang https://github.com/asdf-vm/asdf-erlang.git
|
|
|
```
|
|
|
|
|
|
- Install a version of Erlang:
|
|
|
```bash
|
|
|
asdf install erlang 24.3.4.2
|
|
|
```
|
|
|
|
|
|
- Activate Erlang locally for TFS controller. This will create a local file
|
|
|
called `.tool-versions` defining which version of the tools to use when
|
|
|
running under the current directory:
|
|
|
```bash
|
|
|
cd tfs-ctrl/
|
|
|
asdf local erlang 24.3.4.2
|
|
|
```
|
|
|
|
|
|
Erlang projects uses a build tool called
|
|
|
[rebar3](https://github.com/erlang/rebar3).
|
|
|
It is used to manager project dependenecies, compile a project and generate
|
|
|
project releases.
|
|
|
|
|
|
- Install rebar3 localy from source:
|
|
|
```bash
|
|
|
cd ~
|
|
|
git clone https://github.com/erlang/rebar3.git
|
|
|
cd rebar3
|
|
|
asdf local erlang 24.3.4.2
|
|
|
./bootstrap
|
|
|
./rebar3 local install
|
|
|
```
|
|
|
|
|
|
- Update `~/.bashrc` to use rebar3 by adding this line at the end:
|
|
|
```bash
|
|
|
export PATH=$HOME/.cache/rebar3/bin:$PATH
|
|
|
```
|
|
|
|
|
|
- Logout and log back in. |