Fatal error asdf install of erlang 24.2.1

I’m trying to install the latest version of Erlang and Elixir using asdf. I’ve successfully been using ASDF with older versions, but trying to the install 24.2.1 has encountered an error.

> asdf install erlang 24.2.1
asdf_24.2.1 is not a kerl-managed Erlang/OTP installation. # <-- is this important?
# ... some warnings, fop is missing, then...
gmake: *** [Makefile:498: libs] Error 2

The referenced log file has a lot of fatal errors like this:

In file included from gen/glu_nif.cpp:25:
gen/../egl_impl.h:34:11: fatal error: 'GL/glu.h' file not found
# include <GL/glu.h>

I am not specifying any KERL_CONFIGURE_OPTIONS during install. Host OS is MacOS 11.6.2 Big Sur; 2.6 GHz 6-Core Intel Core i7.

Anyone have any ideas on this one? I’m stymied. Thanks!

For what its worth I have the following in my .zshrc and i have Erlang 24.2 installed via ASDF

export KERL_CONFIGURE_OPTIONS="--without-javac --without-jinterface --without-odbc --without-hipe"
export KERL_BUILD_DOCS=yes

From what I can tell, it has something to do with autoconf not detecting things correctly. For me, autoconf can’t find brew-installed openssl@3 … even though it is definitely there …

I tried using the KERL options but I got the same result. I don’t know enough about how the asdf install process works to know if it uses those options when it’s not a kerl-managed installation.

I also tried the trick of forcing an older version of autoconf per https://www.stevenchang.tw/blog/2021/05/25/asdf-install-erlang-failed-on-macbigsur (which has worked for me in the past), but I’m still getting the same result.

Is the GL a graphics library? Maybe for the observer? The error hasn’t given me much to go on and I’m trying to remember if I customized anything on my computer that might have had unintended side-effects…

1 Like

I was able to install Erlang 22, but versions 23 and 24 don’t seem to agree with my system.

Can you check which the version of wxWidgets is installed on your mac?

I had a similar issue and did a write up here:

Let me know if you have any questions!

In my .bash_profile I have this alias set up:

alias kern-no-wx="export KERL_CONFIGURE_OPTIONS=\"--with-ssl=\`brew --prefix openssl@1.1\` \
                               --without-wx \
                               --disable-hipe \
                               --disable-debug \
                               --without-javac\""

This worked no problem for me!

And yes - this removes wxWidgets from compiling for Erlang. But I don’t really use that Observer anyways.
But you might, so beware that my method will skip wxWidgets, so you won’t have Observer UI.

1 Like

wxwidgets 3.1.5

I ran brew install wxwidgets at some point…

I had this problem of erlang build failing maybe an year ago - on mac due to wxwidgets. I uninstalled and installed it again. But this was definitely not for OTP 24.

I tried compiling wxWidgets from source per https://github.com/asdf-vm/asdf-erlang/issues/203 but that caused a different error:

gen/wxe_wrapper_7.cpp:2342:58: error: call to member function 'AddTool' is ambiguous
  wxToolBarToolBase * Result = (wxToolBarToolBase*)This->AddTool(toolId,label,*bitmap,shortHelp,kind);
                                                   ~~~~~~^~~~~~~

Thanks, this was helpful – I was able to get it working like so:

export KERL_CONFIGURE_OPTIONS="--without-wx --without-javac"
asdf install erlang 24.2.1
asdf install elixir 1.13.2-otp-24

but it would be nice to have the observer…

1 Like

What if you reinstall wxwidgets using homebrew (not from source) ? It’s not working out for you ?

Observer is nice addition - i had to run erlang without observer few months, it used to crash when I open due to some incompatible version.

It’s a different error:

/usr/local/include/wx-3.1/wx/utils.h:749:35: warning: default member initializer for non-static data member is a C++11 extension [-Wc++11-extensions]
    wxEventLoop* m_modalEventLoop = NULL;

Do I need a different compiler? mekusigjinn’s article mentioned needing to install the full OS XCode…

Oh, you absolutely should install XCode, there’s no ways around that if you want anything to compile against system sources and libraries.

xcode-select --install

2 Likes

Ah… turns out I already had XCode installed. Back to beard-stroking… it is a clue that Erlang 22 installed ok, but 23 and 24 had similar errors.

Awesome it helped! And yeah I don’t think I can help you with enabled wxWidgets.

I think I tried to update to Big Sur, hoping that would solve and XCode will pick up the glu.h location, but it seems from your initial post that the problem is something else.

Main reason is the glu.h or the OpenGL library is not where it should be in macs.

My post has other links that might have more information. I am not well-versed in the world of gcc compilation so I might be mincing a lot of details here.

Actually, now that I’ve re-done this a few times, I think your suggestion works, but I can’t say 100% for certain what the steps were. Something like this:

xcode-select --install # <-- just to be sure
brew uninstall wxwidgets
brew install wxwidgets 
brew link wxwidgets # <-- you might be prompted to do this
# installs to /usr/local/bin/wx-config
# Optionally set some options here...
export KERL_CONFIGURE_OPTIONS="--with-wx-config=/usr/local/bin/wx-config"
# OR
export KERL_CONFIGURE_OPTIONS="--without-wx --without-javac"
# Then
asdf install erlang 24.2.1
asdf install elixir 1.13.2-otp-24

Although there seems to be a snag with asdf here because doing iex or even elixir --version will cough up this error:

{"init terminating in do_boot",{undef,[{elixir,start_cli,[],[]},{init,start_em,1,[]},{init,do_boot,3,[]}]}}
init terminating in do_boot ({undef,[{elixir,start_cli,[],[]},{init,start_em,1,[]},{init,do_boot,3,[]}]})

But oddly, this only seems to happen if elixir and erlang versions are scoped globally. As soon as I scope them locally, everything works fine:

asdf local erlang 24.2.1
asdf local elixir 1.13.2-otp-24

I don’t know if this is because I’ve torn out so many pieces of this without rebooting or if there is a legit bug in the global bits or what.

2 Likes

Glad you figured out a way to have a working version.

If you can share crash dumps or logs - may be someone can help.

I tried compiling wxWidgets from source per Erlang 24.0 installation error message: wxWidgets was not compiled with --enable-webview or wxWebView developer package is not installed · Issue #203 · asdf-vm/asdf-erlang · GitHub 2 but that caused a different error:

error: call to member function ‘AddTool’ is ambiguous

Same problem for me. I’m using OSX 12.2.1 (Apple M1 Pro). I can’t install Erlang 24, 23, or 22. Same error. I have the latest version of Xcode installed, and I installed the command line tools via:

$ xcode-select —install

I opened an issue here:

Hmm…I got erlang 24.3.4 installed, but I’m not sure why it worked on this attempt. The last thing I tried was deleting my manually installed wxWidgets:

~% ls
Computing	Downloads	Music		erlang_programs
Desktop		Library		Pictures	wxWidgets
Documents	Movies		Public

~% rm -rf ./wxWidgets

Then I manually reinstalled wxWidgets per conradwt’s instructions in issue #203. I did add one flag to ~/.zshrc:

--with-ssl-incl=/opt/local

based on josevalim’s post here. I highly doubt that was necessary. So, this is what I have for asdf in my ~/.zshrc file:

#For asdf:                                                                    
. $HOME/.asdf/asdf.sh                                                         
                                                                              
#For asdf erlang installs with wxWidgets:                                     
export KERL_BUILD_DOCS=yes                                                    
export KERL_INSTALL_MANPAGES=yes                                              
export wxUSE_MACOSX_VERSION_MIN=11.3                                          
export EGREP=egrep                                                            
export CC=clang                                                               
export CPP="clang -E"                                                         
export KERL_USE_AUTOCONF=0                                                    
                                                                              
export KERL_CONFIGURE_OPTIONS="--disable-debug \                              
                               --disable-hipe \                               
                               --disable-sctp \                               
                               --disable-silent-rules \                       
                               --enable-darwin-64bit \                        
                               --enable-dynamic-ssl-lib \                     
                               --enable-kernel-poll \                         
                               --enable-shared-zlib \                         
                               --enable-smp-support \                         
                               --enable-threads \                             
                               --enable-wx \                                  
                               --with-ssl=/opt/local \                        
                               --with-ssl-incl=/opt/local \                   
                               --with-wx-config=/usr/local/bin/wx-config \    
                               --without-javac \                              
                               --without-jinterface \                         
                               --without-odbc"

Maybe those .zshrc flags need to be setup up BEFORE installing wxWidgets? Don’t forget to start a new shell when you make any changes to ~/.zshrc!

I just realized that last night I was prompted to update macOS 12.2.1, and I stupidly said yes. So, now I have macOS 12.3.1. I think that is the most likely reason I was suddenly able to install erlang 24.3.4

I tested wxWidgets by launching observer in the shell:

~/erlang_programs% erl
Erlang/OTP 24 [erts-12.3.2] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1]

Eshell V12.3.2  (abort with ^G)
1> observer:start().
ok

And, the observer window opened, and everything seems to be working fine.