script

script

Install Erlang with asdf on m1 MacBook

I have asdf installed with the all the dependencies mentioned on the site. I am able to successfully installed and use different versions of elixir, but when it comes to Erlang I am unable to install any version with asdf. I tried 21.x and also 22.x versions. I have latest Erlang version installed with brew and it’s working. I got the below error when I try to install any version.

 asdf install erlang 22.0                                         
 Downloading kerl...
 asdf_22.0 is not a kerl-managed Erlang/OTP installation
No build named asdf_22.0
Downloading OTP-22.0.tar.gz to /Users/weiswise/.asdf/plugins/erlang/kerl-home/archives...
 % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                              Dload  Upload   Total   Spent    Left  Speed
100   120  100   120    0     0    200      0 --:--:-- --:--:-- --:--:--   200
100 52.2M    0 52.2M    0     0  1495k      0 --:--:--  0:00:35 --:--:-- 1568k
Extracting source code
Building Erlang/OTP 22.0 (asdf_22.0), please wait...
Configure failed.
checking size of int... 0
checking size of long... 0
checking size of long long... 0
checking size of __int64... 0
checking size of __int128_t... 0
checking whether byte ordering is bigendian... no
checking whether double word ordering is middle-endian... yes
configure: error: cannot build emulator since no thread library was found
ERROR: /Users/weiswise/.asdf/plugins/erlang/kerl-home/builds/asdf_22.0/otp_src_22.0/erts/configure         failed!
./configure: line 343: kill: (-60536) - No such process

I think Erlang 21.x and 22.x are not supported on apple silicon Macs, at least not all the versions that’s why it’s not installing.
I tried with version 23.3.4 stable build and asdf is able to install it successfully.
I tried with 22.3.4.19 stable build and asdf is also able to install it without any issue.

For this issue

           ./configure: line 343: kill: (-60536) - No such process

add the below line in your bash or zsh file.

            CFLAGS="-O2 -g"

Also add this line in the bash or zsh

           KERL_CONFIGURE_OPTIONS="--disable-debug --without-javac"

So, asdf is working fine, the only issue is arm base architecture of MacBook.
I am leaving the post here, so that anyone in the future can get help from here.

Thank you.

Most Liked

moogle19

moogle19

Erlang/OTP 22.3.4.2 doesn’t work with M1 Macs.

If it is an option, you can use OTP >= 22.3.4.16.
The Apple Silicon build was fixed in that release.

Ivor

Ivor

Changing from 24.1.7 to 24.3.4 resolved my issue. Ventura + M1. Observer is working as well.

7stud

7stud

I’ve also got an M1 MacBook running Monterey 12.3.1, and a couple days ago I successfully installed Erlang 24.3.4 with wxWidgets using asdf. I did struggle for a couple of days trying to solve some wxWidgets issues, and I posted an issue on github about my problems:

When I first attempted the install, I was running Monterey 12.2.1, and I stupidly agreed to a system update, which bumped me up to Monterey 12.3.1, and the next day I tried some things to correct the wxWidgets problems, and suddenly the install worked.

Even though the initial output poined to some issues with wxWidgets, I think erlang 24.3.4 installed successfully on the first go:

...
...
APPLICATIONS INFORMATION (See: /Users/7stud/.asdf/plugins/erlang/kerl-home/builds/asdf_24.3.4/otp_build_24.3.4.log)
 * crypto         : Using OpenSSL 3.0 is not yet recommended for production code.
 * wx             : wxWidgets was not compiled with --enable-webview or wxWebView developer package is not installed, wxWebView will NOT be available
 *         wxWidgets must be installed on your system.
 *         Please check that wx-config is in path, the directory
 *         where wxWidgets libraries are installed (returned by
 *         'wx-config --libs' or 'wx-config --static --libs' command)
 *         is in LD_LIBRARY_PATH or equivalent variable and
 *         wxWidgets version is 3.0.2 or above.

Erlang/OTP 24.3.4 (asdf_24.3.4) has been successfully built
Cleaning up compilation products for 
Cleaned up compilation products for  under /Users/7stud/.asdf/plugins/erlang/kerl-home/builds
bapti

bapti

Thanks a million, this solved my issue, once I bumped up my version then I had no further problems :white_check_mark:

sridhar

sridhar

FYI, I was able to backport fixes to an older version (22.0.7) and create OTP binaries on my M1 machine with that (if anyone’s interested). I don’t think you can do it with kerl/asdf but directly from source is possible Commits · smocherla-brex/otp · GitHub

If anyone’s interested, these are the steps


export PATH=$PATH:<path/to/wx-install>/bin
cd $OTP_SOURCE_DIR`Preformatted text`
# Ensure we have autoconf version 2.69, latest Mac has 2.71 which does not work with OTP 22.0.7
./otp_build autoconf
# To deal with error described here https://github.com/asdf-vm/asdf-erlang/issues/164#issuecomment-695103295
export CFLAGS="-O2 -Wno-error=implicit-function-declaration"
./configure --with-ssl=$(brew --prefix openssl@1.1) --without-javac --disable-debug --enable-m64-build --prefix=~/repos/otp-22.0.7-fork-release
make
make install
# this has the pre-built binaries we need.
cd ~/repos/otp-22.0.7-fork-release/lib/erlang/

Where Next?

Popular in Questions Top

Fl4m3Ph03n1x
Background Let’s assume I have a typical GenServer that receives messages as requests, does some operation in a DB and returns responses....
New
srinivasu
How to handle excepions in elixir? Suppose i have A, B, C ,D, E modules. and each module has get() function. A.get() method will call th...
New
romenigld
I am trying to run a deploy with docker and I successfully runned with this command: docker build -t romenigld/blog-prod . but when I t...
New
polypush135
As many of you may have realized by now (sorry for all the posts here) I’ve been working on a db problem where I’m trying to aggregate a ...
New
sacepums
Hey guys. I'm new to elixir and im really stocked about it. But I ran into a bit of problem - I need to convert a date sting, for examp...
New
fireproofsocks
Forgive me if this is obvious, but how does one delete a database record WITHOUT selecting it first? https://hexdocs.pm/ecto/Ecto.Repo.h...
New
chewm
Hi guys, nice to meet you to the whole forum, I’m new here, I’m trying to configure visual studio code for elixir, right now the intellis...
New
Exadra37
Sometimes I want to check if the input into a function is not a blank string. My first approach: defmodule Example do def do_stuff(s...
New
jay1
Why is it that the mnesia database isn’t the most preferred database for use in Elixir/Phoenix?
New
vrod
I am using the Starship cross-shell prompt – it seems pretty nice, but I get some errors: [WARN] - (starship::utils): Executing command ...
New

Other popular topics Top

josevalim
Hi everyone, One of the features added to Elixir early on to help integration with Erlang code was the idea of overridable function defi...
New
senggen
Erlang/OTP 25 [erts-13.2.2] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] 15:22:35.803 [error] gen_event {lager_file_backend...
New
chrismccord
Phoenix 1.4.0 released Phoenix 1.4 is out! This release ships with exciting new features, most notably with HTTP2 support, improved deve...
688 30048 115
New
fireproofsocks
I’m working on defining a simple Ecto schema for a table (in PostGres), but I don’t see where I can define a column as NOT NULL. Conside...
New
polypush135
As many of you may have realized by now (sorry for all the posts here) I’ve been working on a db problem where I’m trying to aggregate a ...
New
ashish173
I am using Ecto timestamps with postgres, I can see the timestamps() use the :naive_dateime but for my use case I wanted to store the ti...
New
vonH
When I run the Plug and I recompile I wind up having to use Ctrl C to quit iex and start again. Witht the help of rlwrap I can use the cu...
New
chrisalley
ExUnit now has describe blocks which is a welcome addition coming from RSpec. In the docs, it states that nested hierarchies of describe ...
New
siddhant3030
Hi, I have to write a raw query for one of my project. But till now I have used ecto queries and don’t have much experience writing raw ...
New
vrod
I am using the Starship cross-shell prompt – it seems pretty nice, but I get some errors: [WARN] - (starship::utils): Executing command ...
New

We're in Beta

About us Mission Statement