asdf-erlang: Unable to install Erlang/OTP 27.1 and 26.2.5.3 on Apple Silicon macOS and Xcode 16.0
Hi,
I tried to build Erlang/OTP 27.1 on Apple Silicon macOS Sonoma and Sequoia, but got the following error:
In file included from sys/unix/erl_unix_sys.h:65:
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/unistd.h:525:10: fatal error: cannot open file 'aarch64-apple-darwin24.0.0/opt/jit/_ctermid.h': Too many open files
525 | #include <_ctermid.h>
| ^
1 error generated.
make[4]: *** [obj/aarch64-apple-darwin24.0.0/opt/jit/beam_asm_module.o] Error 1
make[4]: *** Waiting for unfinished jobs....
make[3]: *** [opt] Error 2
make[2]: *** [opt] Error 2
make[1]: *** [jit] Error 2
make: *** [emulator] Error 2
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 14
- Comments: 29 (4 by maintainers)
I encountered the same issue on Apple Silicon with Xcode 16.0. A temporary fix that worked for me was adjusting the
ulimitto increase the number of allowed open files. Here’s what I did:ulimit -n 65536to increase the limit.This is a temporary solution, and if needed, the change can be made permanent by modifying system configuration files.
Hope this helps!
Hello, I encountered the same problem. I resolved it by doing these steps.
I uninstalled xcode by following these commands: https://mac.install.guide/commandlinetools/6
After that I ran these commands cleaning up my environment.
asdf uninstall erlang <version>asdf uninstall elixir <version>rm -rf .asdf/brew uninstall asdfThen, I tried to re-install asdf with homebrew but it requires me to reinstall xcode so I reinstall xcode again by running this command:
xcode-select --installAfter installation I installed asdf with homebrew:
brew install asdfInstalled plugin Elixir:
asdf plugin-add elixir https://github.com/asdf-vm/asdf-elixir.gitInstalled plugin Erlang:asdf plugin-add erlang https://github.com/asdf-vm/asdf-erlang.gitInstalled erlang:
asdf install erlang 27.1Installed elixir:asdf install elixir 1.17.3-otp-27set global erlang:asdf global erlang 1.17.3-otp-27set global elixir :asdf global elixir 1.17.3-otp-27Then I go to my project directory and run
mix assets.deploy and mix phx.serverand it worked. Hope this helps.I solved my Erlang installation with the following:
Refernce: https://github.com/erlang/otp/issues/7687#issuecomment-1737184968
@redac I encountered the same issue (
'initializer_list' file not found). I can confirm that reinstalling Xcode Command Line Tools resolved it. I followed these instructions to uninstall and then reinstall.Hi! 👋 I had to deal with all the errors above trying to fix my Elixir installation 😂 To get the installation working on my MacBook Pro M1 (Sequoia 15.1.1) I did a mix of a mix of this and this. Also, thanks @obieewan for this suggestion and @haavars for this as well 🙇
EDIT: My previous installation of Erlang was made using
--without-wxas a KERL install option. As a result, I’ve found that the:observerdoes not work. I now need the observer to work, and that is why I buildwxmacand go through the trouble of fixing thewxinstallation.rm -rf ~/.asdfbrew uninstall asdfbrew autoremovexcode-select -pto see the directory where they are (likely to be/Library/Developer/CommandLineTools)sudo rm -rf /Library/Developer/CommandLineToolsXcode-select --installAccept the pop upbrew install asdfasdf plugin-add erlang https://github.com/asdf-vm/asdf-erlang.gitasdf plugin-add elixir https://github.com/asdf-vm/asdf-elixir.git(I am installing Elixir)wxmac(nowwxwidgets) from sourcebrew uninstall wxmac--> This is the culprit of thewxerrorbrew autoremovebrew install --build-from-source wxmac--> Building it from source fixes the issue.asdf plugin-update erlangbrew install openjdkecho 'export PATH="/opt/homebrew/opt/openjdk/bin:$PATH"' >> ${ZDOTDIR:-~}/.zshrcsource ${ZDOTDIR:-~}/.zshrcbrew install fopexport CC="/usr/bin/clang -I$(brew --prefix unixodbc)/include"export LDFLAGS=-L$(brew --prefix unixodbc)/libexport KERL_CONFIGURE_OPTIONS="--with-ssl=$(brew --prefix openssl@3) --with-odbc=$(brew --prefix unixodbc)"ulimit -n 65536--> The “too many files open”asdf install erlang latestasdf global erlang latestunset CC LDFLAGSasdf plugin-add elixir https://github.com/asdf-vm/asdf-elixir.gitasdf install elixir latestsimilar issue here, but with different error:
The header file on my system is found in the llvm & gcc flavors:
Also fails for otp-26 builds, complaining about a different header file
I assume the Xcode tool update is the culprit as well.
Looking into this issue now. Thanks a lot for the notes @ppicom.
The right version of openssl isn’t picked up because kerl (reference) seems to be looking for this:
The command should actually be the following:
Here’s the console output.
I was still facing similar errors. Uninstalling xcode and then reinstalling. Then a clean asdf, erlang and elixir install solved the problems on my mac m1 machine with macOS Sequoia 15.3.2.
Uninstalling xcode:
sudo rm -rf /Library/Developer/CommandLineToolsAnd reinstalling it usingxcode-select --install#334.
PR has some screenshots and notes.
Please update to latest master branch of this plugin. Issues mentioned on this ticket should be fixed.
Hello! 👋 I’m getting a different error with OTP 27.1.2 on Apple M3 Max with Sequoia:
I tried different things:
CPP=cpp EGREP=egrep KERL_CONFIGURE_OPTIONS="--enable-darwin-64bit --disable-parallel-configure"--disable-parallel-configurebut in that case I got a different error:At this point I don’t know what to do. Any ideas? Thanks!
If running
ulimit -n 65536didn’t worked. You can try this https://github.com/asdf-vm/asdf-erlang/issues/319#issuecomment-2367630445. Don’t update your xcode until issue is resolved.