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

OTP 24 compilation error on macOS Big Sur 11.3.1 #207

Closed
LeandroLM opened this issue May 21, 2021 · 14 comments
Closed

OTP 24 compilation error on macOS Big Sur 11.3.1 #207

LeandroLM opened this issue May 21, 2021 · 14 comments

Comments

@LeandroLM
Copy link

Sorry if this is duplicated, but I couldn't find any issue with this specific error.

I'm getting this error when I try to install OTP 24 through asdf. I've tried any solution for any problem reported with OTP 24 on macOS Big Sur that I could find, but nothing works. I've tried installing version 24.0.1 as well, with no success.

asdf_24.0 is not a kerl-managed Erlang/OTP installation
The asdf_24.0 build has been deleted
Extracting source code
Building Erlang/OTP 24.0 (asdf_24.0), please wait...
APPLICATIONS DISABLED (See: /Users/leandro/.asdf/plugins/erlang/kerl-home/builds/asdf_24.0/otp_build_24.0.log)
 * jinterface     : No Java compiler found
 * odbc           : ODBC library - link check failed

DOCUMENTATION INFORMATION (See: /Users/leandro/.asdf/plugins/erlang/kerl-home/builds/asdf_24.0/otp_build_24.0.log)
 * documentation  :
 *                  fop is missing.
 *                  Using fakefop to generate placeholder PDF files.

Build failed.
make[3]: *** Waiting for unfinished jobs....
/bin/sh: line 1: 45821 Segmentation fault: 11  erlc -W -Werror +debug_info -DUSE_ESOCK=true -I/Users/leandro/.asdf/plugins/erlang/kerl-home/builds/asdf_24.0/otp_src_24.0/lib/stdlib/include -Werror -o../ebin yecc.erl
make[3]: *** [../ebin/yecc.beam] Error 139
/bin/sh: line 1: 45824 Segmentation fault: 11  erlc -W -Werror +debug_info -DUSE_ESOCK=true -I/Users/leandro/.asdf/plugins/erlang/kerl-home/builds/asdf_24.0/otp_src_24.0/lib/stdlib/include -Werror -o../ebin yeccparser.erl
make[3]: *** [../ebin/yeccparser.beam] Error 139
/bin/sh: line 1: 45820 Segmentation fault: 11  erlc -W -Werror +debug_info -DUSE_ESOCK=true -I/Users/leandro/.asdf/plugins/erlang/kerl-home/builds/asdf_24.0/otp_src_24.0/lib/stdlib/include -Werror -o../ebin leex.erl
make[3]: *** [../ebin/leex.beam] Error 139
make[2]: *** [opt] Error 2
make[1]: *** [opt] Error 2
make: *** [secondary_bootstrap_build] Error 2
@bencoppock
Copy link

Looks like this is related to kerl/kerl#371, which is in turn related to erlang/otp#4821.

A temporary fix is suggested in this comment: erlang/otp#4821 (comment) though I'm not yet clear on how to apply the patch (I'm not seeing Kerl present on my machine…)

@bencoppock
Copy link

@LeandroLM I was able to find the Kerl script in ~/.asdf/plugins/erlang/kerl and then just searched for the relevant lines based on the suggested patch. After changing those lines, I was able to successfully run asdf install erlang 24.0.1 on Mac OS 10.15.7.

Note that you don't need to downgrade autoconf as they mention in step #1 of the suggested fix—so long as you're installing erlang 24.0.1.

@LeandroLM
Copy link
Author

@bencoppock I've tried these steps and still got the same error. I'm suspecting this is something specific to my machine, since I didn't find anyone else with the same error. Thanks for the help anyway!

@neilberkman
Copy link

@LeandroLM did you manage to work around this? I'm getting the same error with 24.0.2.

@LeandroLM
Copy link
Author

@neilberkman Unfortunately I did not. Nothing works here, even installing through brew doesn't work.

@neilberkman
Copy link

Thanks @LeandroLM, I'll comment here if I figure anything out.

@LeandroLM
Copy link
Author

LeandroLM commented Jul 4, 2021

@neilberkman and for anyone with the same issue, the problem was that I was using a M1 with configuration transfered from my old Intel machine. I restored my mac and made a fresh installation (for another reasons). After this I was able to install OTP 24 without any problems. You can also try to set homebrew path as pointed out on this comment, but it didn't work for me.

@daveed
Copy link

daveed commented Jul 20, 2021

I had the same issue as @LeandroLM, I had a timemachine backup from a macbook pro intel and had the same error with segmentation fault after importing to an M1 macbook air.

I had to uninstall homebrew, make sure my terminal is not using rosetta, install homebrew then make sure to install openssl and wxmac with homebrew. (when I first tried installing wxWidgets from source I still had that issue)

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/uninstall.sh)"
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"

source: https://elixirforum.com/t/segmentation-fault-after-update-elixir-and-erlang/39871

then

brew upgrade && brew update
brew install openssl
brew install wxmac

then in my .zshrc I added:

export KERL_CONFIGURE_OPTIONS="--with-ssl=/opt/homebrew/opt/openssl@1.1 \
                               --with-wx-config=/opt/homebrew/opt/wxmac@3.1/bin/wx-config \
                               --without-javac"

this should also work:

export KERL_CONFIGURE_OPTIONS="--with-ssl=`brew --prefix openssl` \
                               --with-wx-config=`brew --prefix wxmac`/bin/wx-config \
                               --without-javac"

then source it in your terminal: exec zsh

then successfully install erlang 24.0.3 running:

asdf global erlang 24.0.3

@Stratus3D
Copy link
Member

I believe @daveed has provided the correct solution to this problem. Do we need to update the docs with any of this information? PR welcome if anyone thinks the existing info on OSX should be updated.

@dylan-chong
Copy link

@daveed thank you so much, deleting brew, and reinstalling everything under a arm64 terminal fixed it for me!

@nikasulo
Copy link

I had this same problem trying to install Elixir on my M1 Mac. For me, I had to build Erlang from source, this article was really helpful. I then installed Elixir using asdf as usual.

@rexllz
Copy link

rexllz commented Jun 21, 2022

The discussion here is really helpful, I want add one more tip, make sure your homebrew installed under /opt/homebrew for M1 Mac, and please note that Iterm makes the Rosetta enabled by default, you may want install things via Terminal at first, you can turn on/off Rosetta for Terminal in Get Info window.

@Stratus3D
Copy link
Member

Closing as there is nothing that needs to be fixed for this. If someone wants to document @daveed 's solution in the readme somewhere a PR is welcome!

@guisfits
Copy link

guisfits commented Sep 5, 2022

I had the same problem, I solved uninstalling wxwidgets

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

9 participants