Tuesday 26 September 2017

Installing Multiple Erlang version in one systems

In python you can have multiple python version installed in your systems using virtualenv. I like to do this with Erlang, as need to test my code on several erlang versions. Its not effective if you install and reinstall the version you need if you want to test out.

And in Erlang of course there is such package to manage multiple instance of Erlang. This is used for developer of course. Come the rescue Kerl , an erlang application that make it  "Easy building and installing of Erlang/OTP instances" .

So with no further do, i installed in my debain dev machine. Here are my steps by steps to make use of kerl. You can also see the documentation from kerl on how to work with kerl. In this blog i just documenting what important to run it and ready for developement.

Install Kerl using easy way with curl.

$ curl -O https://raw.githubusercontent.com/kerl/kerl/master/kerl

Don't forget to set it executable .

$chmod a+x kerl

Then you can list what release supported by kerl by running :

$./kerl list releases

You will get all the supported erlang version from R14 to R20.0 in current version as for now.
But before can build it using Kerl, need to install some of the prerequisite like gcc, ncurses-dev.
In debian you can install with this command :

#apt-get install build-essential ncurses-dev libssl-dev 

And in ~/.kerlrc add this entry :

export CFLAGS="-DOPENSSL_NO_EC=1"

Then we need to build the erlang version we need.
$./kerl build 20.0 20.0

This will download and build erlang version 20.0 and put it in ~/.kerl/builds/20.0

If you have multiple builds can do :

   ./kerl list builds

To install the builds run :

./kerl install 20.0 ~/kerl/20.2

This will install in your home directory, inside kerl/20.2/ folder.

To see installed erlang release, you can run :

./kerl list installatins

And to use specific erlang version do this :

$. /installed/path/of/kerl/20.0/activate
$erl --version

To deactivate use this command :

$ kerl_deactivate


Happy coding with erlang / OTP.

Reference :
- Kerl source

0 comments:

Post a Comment

Twitter Delicious Facebook Digg Stumbleupon Favorites More