Skip to content

Instantly share code, notes, and snippets.

@jadeallenx
Last active June 10, 2021 06:38
Show Gist options
  • Save jadeallenx/6f980c332612e5a8d4f9f34c39d31a79 to your computer and use it in GitHub Desktop.
Save jadeallenx/6f980c332612e5a8d4f9f34c39d31a79 to your computer and use it in GitHub Desktop.
Building Erlang on WSL/Ubuntu 16.04(LTS)

Building Erlang on Windows Subsystem for Linux (WSL)

WSL Overview

WSL is a driver shim for Windows 10 that enables you to run native Linux code on Windows without recompiling or running a Docker/VM. It currently supports Ubuntu 16.04 LTS - but more distribution support has been announced.

Building Erlang

From a "clean" install of Ubuntu such as the kind you would get from a fresh install of WSL, you need to preinstall these debs to enable kerl to compile a working Erlang:

 $ sudo apt install libssl-dev automake autoconf libncurses5-dev gcc

(N.B. You will need to add xsltproc to the list of libraries if you want to build/install Erlang's documentation.)

Then you should clone the kerl repo to your box:

 $ git clone https://github.com/kerl/kerl     
 $ cd kerl

Or if you prefer curl -O https://raw.githubusercontent.com/kerl/kerl/master/kerl; chmod +x kerl

 $ export KERL_BUILD_BACKEND=git
 $ ./kerl update releases

Select an Erlang release to build. For example:

 $ ./kerl build 19.3.3 19.3.3

Once that completes, you'll want to select a place to install your Erlang. For example:

 $ ./kerl install 19.3.3 ~/erlangs/19.3.3

Then, activate your new installation

 $ . ~/erlangs/19.3.3/activate
 $ erl
 
 Erlang/OTP 19 [erts-8.3.3] [source] [64-bit] [smp:8:8] [async-threads:10] [hipe] [kernel-poll:false]

 Eshell V8.3.3  (abort with ^G)
 1> {erlang_installed, true}.
 {erlang_installed,true}
 2> 
@rm-rf-etc
Copy link

Would be nice to see this updated for 2020. I could not get this to work.

@jadeallenx
Copy link
Author

What didn't work?

@adolfont
Copy link

It doesn't work. It takes hours and it doesn't finish.

@jadeallenx
Copy link
Author

Can you please post the error message(s) you're seeing and your WSL2/Windows information?

@adolfont
Copy link

I don't get any error message. It just starts and doesn't finish.

@jadeallenx
Copy link
Author

Could you provide the output from uname -a in WSL and winver from Windows 10? I have never seen this behavior.

@adolfont
Copy link

uname -a
Linux DESKTOP-KDMDFTB 4.4.0-18362-Microsoft #1049-Microsoft Thu Aug 14 12:01:00 PST 2020 x86_64 x86_64 x86_64 GNU/Linux

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment