Installing elixir and erlang on mac m2

I’m trying to install the most current versions of elixir and erlang here on the mac.

I’m getting a segmentation fault error, so I’m trying to install via asdf and I get these errors.

> asdf install erlang 24.2                                                                                                                                
asdf_24.2 is not a kerl-managed Erlang/OTP installation
The asdf_24.2 build has been deleted
Extracting source code
Building Erlang/OTP 24.2 (asdf_24.2), please wait...
APPLICATIONS DISABLED (See: /Users/rrmartins/.asdf/plugins/erlang/kerl-home/builds/asdf_24.2/otp_build_24.2.log)
 * jinterface     : Java compiler disabled by user
 * wx             : User gave --without-wx option
 * odbc           : User gave --without-odbc option

Build failed.
compiling multi-threaded driver:
clang -c -DMEGACO_DRV_NAME=\"megaco_flex_scanner_drv_mt\" -fno-common -Werror=return-type -g -O2 -I/usr/local/opt/openssl@1.1/include -fPIC -fno-common -DOTP_RELEASE -DMFS_FLEX_DEBUG=0 -I/Users/rrmartins/.asdf/plugins/erlang/kerl-home/builds/asdf_24.2/otp_src_24.2/erts/emulator/beam -I/Users/rrmartins/.asdf/plugins/erlang/kerl-home/builds/asdf_24.2/otp_src_24.2/erts/include -I/Users/rrmartins/.asdf/plugins/erlang/kerl-home/builds/asdf_24.2/otp_src_24.2/erts/include/x86_64-apple-darwin22.3.0 -I/Users/rrmartins/.asdf/plugins/erlang/kerl-home/builds/asdf_24.2/otp_src_24.2/erts/include/internal -I/Users/rrmartins/.asdf/plugins/erlang/kerl-home/builds/asdf_24.2/otp_src_24.2/erts/include/internal/x86_64-apple-darwin22.3.0 -I/Users/rrmartins/.asdf/plugins/erlang/kerl-home/builds/asdf_24.2/otp_src_24.2/erts/emulator/sys/unix -I/Users/rrmartins/.asdf/plugins/erlang/kerl-home/builds/asdf_24.2/otp_src_24.2/erts/emulator/sys/common -I/Users/rrmartins/.asdf/plugins/erlang/kerl-home/builds/asdf_24.2/otp_src_24.2/erts/x86_64-apple-darwin22.3.0  -funroll-loops -Wall -DMEGACO_LINENO  -D_THREAD_SAFE -D_REENTRANT -DPOSIX_THREADS -DMEGACO_REENTRANT_FLEX_SCANNER -o ../../priv/obj/x86_64-apple-darwin22.3.0/megaco_flex_scanner_drv_mt.o megaco_flex_scanner_drv_mt.c
make[5]: *** [../../ebin/megaco_flex_scanner.beam] Segmentation fault: 11
make[5]: *** Waiting for unfinished jobs....
make[5]: *** [../../ebin/megaco_flex_scanner_handler.beam] Segmentation fault: 11
make[4]: *** [opt] Error 2
make[3]: *** [opt] Error 2
make[2]: *** [opt] Error 2
make[1]: *** [opt] Error 2
make: *** [libs] Error 2

Please see /Users/rrmartins/.asdf/plugins/erlang/kerl-home/builds/asdf_24.2/otp_build_24.2.log for full details.

anybody can help me in this situation? :slight_smile:

1 Like

It looks like it’s trying to build x86_64 where being on the M2 your architecture is arm based.

Is your terminal running under Rosetta? Is zsh running under Rosetta?

OTP is already on version 25, soon 26.

If you search the forum for your error messages, you will find many threads. Such as this, which should be very relevant: Asdf install erlang 25.2 failing, unsure of cause, on Mac OSX Monterey 12.5.1 M1 Pro - #6 by Nicd

My guess is that you are running in Rosetta mode with a Homebrew installation migrated from an x86 MacBook (or installed in Rosetta mode). You need to make sure your terminal is in ARM mode (check arch). Then you need to uninstall Homebrew and reinstall it (if you want to use it). After that you can use asdf to install Erlang.

1 Like

hi everyone,

I uninstalled the homebrew, because was installed with x86_64, and I installed the homebrew “basic” to my mac M2 arm. After this everything I installed had the arm.