Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot build Erlang/OTP 22.3.4.1 on Apple M1 Silicon #221

Open
peake100 opened this issue Sep 21, 2021 · 5 comments
Open

Cannot build Erlang/OTP 22.3.4.1 on Apple M1 Silicon #221

peake100 opened this issue Sep 21, 2021 · 5 comments

Comments

@peake100
Copy link

peake100 commented Sep 21, 2021

Hello!

I am having a hard time getting Erlang/OTP 22.3.4.1 to install on Apple Silicon. Here is my system info:

Hardware Overview:

  Model Name:	MacBook Pro
  Model Identifier:	MacBookPro17,1
  Chip:	Apple M1
  Total Number of Cores:	8 (4 performance and 4 efficiency)
  Memory:	16 GB
  System Firmware Version:	6723.140.2
  OS Loader Version:	6723.140.2
  Serial Number (system):	C02G93G7Q05N
  Activation Lock Status:	Disabled

System Software Overview:

  System Version:	macOS 11.6 (20G165)
  Kernel Version:	Darwin 20.6.0
  Boot Volume:	Macintosh HD
  Boot Mode:	Normal
  Secure Virtual Memory:	Enabled
  System Integrity Protection:	Enabled
  Time since boot:	1 day 4:54

I have a .tool-versions with the following contents:

erlang 22.3.4.1
elixir 1.10.3
nodejs 14.15.4

I have tried a few different approaches. First, I tried simply using asdf install, and got the following:

elixir 1.10.3 is already installed
asdf_22.3.4.1 is not a kerl-managed Erlang/OTP installation
The asdf_22.3.4.1 build has been deleted
Extracting source code
Building Erlang/OTP 22.3.4.1 (asdf_22.3.4.1), 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/bpeake/.asdf/plugins/erlang/kerl-home/builds/asdf_22.3.4.1/otp_src_22.3.4.1/erts/configure failed!
./configure: line 343: kill: (-36793) - No such process

Okay, no problem, I can try using Rosetta emulation by running arch -x86_64 zsh before running asdf install. I did that for a different project using erlang 23.3.1, and it worked great. Except here I get:

elixir 1.10.3 is already installed
asdf_22.3.4.1 is not a kerl-managed Erlang/OTP installation
The asdf_22.3.4.1 build has been deleted
Extracting source code
Building Erlang/OTP 22.3.4.1 (asdf_22.3.4.1), please wait...
            APPLICATIONS DISABLED (See: /Users/bpeake/.asdf/plugins/erlang/kerl-home/builds/asdf_22.3.4.1/otp_build_22.3.4.1.log)
 * jinterface     : Java compiler disabled by user
 * odbc           : ODBC library - link check failed

APPLICATIONS INFORMATION (See: /Users/bpeake/.asdf/plugins/erlang/kerl-home/builds/asdf_22.3.4.1/otp_build_22.3.4.1.log)
 * wx             : Can not link the wx driver, wx will NOT be useable

DOCUMENTATION INFORMATION (See: /Users/bpeake/.asdf/plugins/erlang/kerl-home/builds/asdf_22.3.4.1/otp_build_22.3.4.1.log)
 * documentation  : 
 *                  fop is missing.
 *                  Using fakefop to generate placeholder PDF files.

Build failed.
      _get_rsa_public_key in rsa.o
  "_RSA_size", referenced from:
      _pkey_crypt_nif in pkey.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[4]: *** [../priv/lib/x86_64-apple-darwin20.6.0/crypto.so] Error 1
make[3]: *** [opt] Error 2
make[2]: *** [opt] Error 2
make[1]: *** [opt] Error 2
make: *** [libs] Error 2

Looks like a linking error against an x86 lib.

I poked around a little online, and gave it one last try (in non-Rosetta mode) using:

KERL_CONFIGURE_OPTIONS="--enable-m64-build --without-javac" asdf install

And got this:

elixir 1.10.3 is already installed
asdf_22.3.4.1 is not a kerl-managed Erlang/OTP installation
The asdf_22.3.4.1 build has been deleted
Extracting source code
Building Erlang/OTP 22.3.4.1 (asdf_22.3.4.1), please wait...
APPLICATIONS DISABLED (See: /Users/bpeake/.asdf/plugins/erlang/kerl-home/builds/asdf_22.3.4.1/otp_build_22.3.4.1.log)
 * jinterface     : Java compiler disabled by user
 * odbc           : ODBC library - link check failed

APPLICATIONS INFORMATION (See: /Users/bpeake/.asdf/plugins/erlang/kerl-home/builds/asdf_22.3.4.1/otp_build_22.3.4.1.log)
 * wx             : Can not link the wx driver, wx will NOT be useable

DOCUMENTATION INFORMATION (See: /Users/bpeake/.asdf/plugins/erlang/kerl-home/builds/asdf_22.3.4.1/otp_build_22.3.4.1.log)
 * documentation  : 
 *                  fop is missing.
 *                  Using fakefop to generate placeholder PDF files.

^[[CBuild failed.
 ERLC	../ebin/hipe_consttab.beam
 ERLC	../ebin/hipe_gensym.beam
/bin/sh: line 1: 80774 Segmentation fault: 11  erlc -W +debug_info -DUSE_ESOCK=true -Werror +warn_export_vars +warn_missing_spec +warn_untyped_record -o../ebin hipe_consttab.erl
make[3]: *** [../ebin/hipe_consttab.beam] Error 139
make[3]: *** Waiting for unfinished jobs....
/bin/sh: line 1: 80775 Segmentation fault: 11  erlc -W +debug_info -DUSE_ESOCK=true -Werror +warn_export_vars +warn_missing_spec +warn_untyped_record -o../ebin hipe_gensym.erl

Any thoughts? Thank you!

@peake100 peake100 changed the title Cannot build Erlang/OTP 22.3.4.1 on Apple M1 Sillicon Cannot build Erlang/OTP 22.3.4.1 on Apple M1 Silicon Sep 21, 2021
@barockok
Copy link

+1 for 22.2

@timuryan
Copy link

"ld: symbol(s) not found for architecture x86_64" - make sure that Apple's toolchain is used.
You could try to remove Homebrew's binutils or adjust the $PATH variable.

% $(which ranlib) -V
Apple Inc. version cctools-977.1

@HWideman
Copy link

HWideman commented Nov 3, 2021

I gave up trying to get this built via asdf and just installed it via brew then copied the installation into asdf.

This was on the 2021 macbook pro Mac OS 12.0

brew install erlang@22
cp -r /opt/homebrew/opt/erlang@22/lib/erlang ~/.asdf/installs/erlang/22.3.4.21
asdf reshim erlang 22.3.4.21

@unixc3t
Copy link

unixc3t commented Dec 4, 2021

@HWideman I found you need edit the .asd/shims/erl
install erlang 24.1.7 by brew
eg:

#!/usr/bin/env bash
# asdf-plugin: erlang 23.0.1
exec /usr/local/opt/asdf/bin/asdf exec "erl" "$@"







#!/usr/bin/env bash
# asdf-plugin: erlang 23.0.1
# asdf-plugin: erlang 24.1.7
exec /usr/local/opt/asdf/bin/asdf exec "erl" "$@"




in terminal you can use erl 

@dylan-chong
Copy link

This fixed it for me: #207 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants