Giter VIP home page Giter VIP logo

asdf-erlang's Introduction

asdf-erlang

Erlang plugin for asdf version manager that relies on kerl for builds.

This plugin aims to combine the best of both worlds by using kerl.

kerl's compatibility and build scripts, together with asdf's easy version switching and support for the .tool-versions file. You do not need to have kerl already installed to use this. The plugin will install it's own version of kerl automatically.

Install

asdf plugin add erlang https://github.com/asdf-vm/asdf-erlang.git

Important: Make sure to read the "Before asdf install" section below to install dependencies!

Use

Check asdf readme for instructions on how to install & manage versions of Erlang. To specify custom options you can set environment variables just as you would when using kerl. For example, to skip the java dependency during installation use:

$ export KERL_CONFIGURE_OPTIONS="--disable-debug --without-javac"
$ asdf install erlang <version>

You can also install Erlang from git, or provide the url to a fork and build from git.

$ asdf install erlang ref:master

$ export OTP_GITHUB_URL="https://github.com/basho/otp"
$ asdf install erlang ref:basho

See kerl for the complete list of customization options. Note that the KERL_BASE_DIR and KERL_CONFIG environment variables are set by the plugin when it runs kerl so it will not be possible to customize them.

Before asdf install

Ubuntu and Debian

Note that if you are using a previous version of Linux, you may need a different version of one of the below libraries.

Ubuntu 16.04 LTS "Xenial Xerus"

Install the build tools (dpkg-dev g++ gcc libc6-dev make debianutils m4 perl) apt-get -y install build-essential autoconf

Needed for HiPE (native code) support, but already installed by autoconf apt-get -y install m4

Needed for terminal handling (libc-dev libncurses5 libtinfo-dev libtinfo5 ncurses-bin) apt-get -y install libncurses5-dev

For building with wxWidgets (start observer or debugger!) apt-get -y install libwxgtk3.0-dev libgl1-mesa-dev libglu1-mesa-dev libpng-dev

For building ssl (libssh-4 libssl-dev zlib1g-dev) apt-get -y install libssh-dev

ODBC support (libltdl3-dev odbcinst1debian2 unixodbc) apt-get -y install unixodbc-dev

For building documentation: apt-get install xsltproc fop

If you want to install all the above: apt-get -y install build-essential autoconf m4 libncurses5-dev libwxgtk3.0-dev libgl1-mesa-dev libglu1-mesa-dev libpng-dev libssh-dev unixodbc-dev xsltproc fop

Ubuntu 20.04 LTS

If you want to install all the above: apt-get -y install build-essential autoconf m4 libncurses5-dev libwxgtk3.0-gtk3-dev libgl1-mesa-dev libglu1-mesa-dev libpng-dev libssh-dev unixodbc-dev xsltproc fop libxml2-utils libncurses-dev openjdk-11-jdk

Arch Linux

Provides most of the needed build tools. pacman -S --needed base-devel

Needed for terminal handling pacman -S ncurses

For building with wxWidgets (start observer or debugger!) pacman -S glu mesa wxgtk2 libpng

For building ssl pacman -S libssh

ODBC support sudo pacman -S unixodbc

OSX

Note, for MacOS 10.15.4 and newer, 22.3.1 is the earliest version that can be installed through kerl (and, therefore, asdf). Earlier versions will fail to compile. See this issue for details.

Install the build tools brew install autoconf

For building with wxWidgets (start observer or debugger!) brew install wxmac

Dealing with OpenSSL issues on macOS

You may encounter an SSL error with an output along these lines:

crypto : No usable OpenSSL found
ssh : No usable OpenSSL found
ssl : No usable OpenSSL found

This issue has been documented on kerl. If you see this error, you can use the --with-ssl flag with a path before installing Erlang. Here is an example that skips the java dependency and also sets a specific (and existing) path for OpenSSL installed via brew on macOS.

$ export KERL_CONFIGURE_OPTIONS="--without-javac --with-ssl=$(brew --prefix openssl)"
$ asdf install erlang <version>

CentOS & Fedora

These steps assume a most recent build of CentOS (currently tested on CentOS 7.5 x64 & Fedora 28 x64)

Install the build tools sudo yum groupinstall -y 'Development Tools' 'C Development Tools and Libraries'

Automatic configure script builder sudo yum install -y autoconf

Needed for terminal handling sudo yum install -y ncurses-devel

For building with wxWidgets (start observer or debugger!) sudo yum install -y wxGTK3-devel wxBase3

For building ssl sudo yum install -y openssl-devel

for jinterface sudo yum install -y java-1.8.0-openjdk-devel

ODBC support sudo yum install -y libiodbc unixODBC-devel.x86_64 erlang-odbc.x86_64

for the documentation to be built sudo yum install -y libxslt fop

Solus

Install the build tools

sudo eopkg it -c system.devel

For building wxWidgets

sudo eopkg install wxwidgets-devel mesalib-devel libglu-devel fop

For ODBC support

sudo eopkg install unixodbc-devel

For jinterface

sudo eopkg install openjdk-8 openjdk-8-devel

If you want to install all of the above

# Install build tools
sudo eopkg it -c system.devel

sudo eopkg install wxwidgets-devel mesalib-devel libglu-devel fop unixodbc-devel openjdk-8 openjdk-8-devel

OpenJDK issues on Solus

I ran into an issue where javac wasn't a recognized command in the terminal despite having installed openjdk-8 and openjdk-8-devel. Turns out it wasn't added to PATH by default. So simply add it to PATH like so:

# In ~/.bashrc add these to add Java to PATH
JAVA_HOME=/usr/lib64/openjdk-8
PATH=$PATH:$JAVA_HOME/bin

# In terminal
source ~/.bashrc

Getting Erlang documentation

Erlang may come with documentation included (as man pages, pdfs and html files). This allows typing erl -man mnesia to get info on mnesia module. asdf-erlang uses kerl for builds, and kerl is capable of building the docs for specified version of Erlang.

For kerl to be able to build Erlang documentation two requirements have to be met:

  1. KERL_BUILD_DOCS environment variable has to be set
  2. Additional dependencies have to be installed. For detailed list of dependencies for your OS please refer to the specific section above

Note: Environment variable has to be set before asdf install erlang <version> is executed, to take effect.

Setting the environment variable in bash

Type: export KERL_BUILD_DOCS=yes to create KERL_BUILD_DOCS environment variable and set it to true. This line could be added to your .bashrc in case you want KERL_BUILD_DOCS to be set for future (future installations of Erlang).

To remove environment variable: unset KERL_BUILD_DOCS.

Setting the environment variable in fish shell

Type: set -xg KERL_BUILD_DOCS yes to set environment variable. In case you want it to be persisted between sessions (machine reboots - for example for future installations) type set -xU KERL_BUILD_DOCS yes.

To remove environment variable type: set -e KERL_BUILD_DOCS.

asdf-erlang's People

Contributors

adamu avatar aeons avatar aj-foster avatar bobbymcwho avatar cehoffman avatar cesarandreu avatar cschiewek avatar danhper avatar dbernheisel avatar dstrunk avatar edouardmenayde avatar elasticdog avatar enilsen16 avatar eproxus avatar gmcabrita avatar gmile avatar hashnuke avatar jeg2 avatar jmerriweather avatar johnhamelink avatar kamillelonek avatar kianmeng avatar maciektalaska avatar msambarino avatar nicolasdeleplace avatar patreeceeo avatar sirn avatar stratus3d avatar tverlaan avatar yabliznyk avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.