Erlang installation using kerl on Mac M1: OpenSSL dependency

Shiny new Mac Studio. Installed Erlang using kerl as usual. Noted crypto module (as well as unixodbc and the usual wx) failed. I could probably have coped with those omissions in the short term except that rebar3 requires the crypto module.

So, has anyone else trodden this path and have a recipe to follow to get OpenSSL built for darwin-arm64 and hence Erlang/OTP to build the crypto module?

2 Likes

There is a lot of discussion about what to do in the kerl issue Can't install Erlang-24 due to openssl issues · Issue #371 · kerl/kerl · GitHub

3 Likes

Turns out all the work has been done by the OTP and kerl teams, all that is left is the OpenSSL install. I used the following runes:

git clone git://git.openssl.org/openssl.git
cd openssl
export MACOSX_DEPLOYMENT_TARGET=12
./Configure enable-rc5 zlib darwin64-arm64-cc no-asm
make
make test
sudo make install

Then installed Erlang & rebar3:

~/bin/kerl build 25.0-rc2 25.0-rc2
~/bin/kerl install 25.0-rc2 ~/kerl/25.0-rc2
. ~/kerl/25.0-rc2/activate
rebar3 local install
~/.cache/rebar3/bin/rebar3 shell

Success!

===> Verifying dependencies...
Erlang/OTP 25 [RELEASE CANDIDATE 2] [erts-13.0] [source] [64-bit] [smp:10:10] [ds:10:10:10] [async-threads:1] [jit]
Eshell V13.0 (abort with ^G)
1>
2 Likes

I am getting an error building erlang 24.3.3 using kerl

I followed the above steps to compile and install openssl and then used kerl to install erlang.

kerl build 24.3.3 24.3.3
-n Extracting source code
-n Building Erlang/OTP 24.3.3 (24.3.3), please wait...
Build failed.
    wxEventLoop* m_modalEventLoop = NULL;
                                  ^
gen/wxe_wrapper_5.cpp:2165:29: error: taking the address of a temporary object of type 'wxBitmap' [-Waddress-of-temporary]
  const wxBitmap * Result = &This->GetBitmap();
                            ^~~~~~~~~~~~~~~~~~
1 warning and 1 error generated.
make[3]: *** [aarch64-apple-darwin21.4.0/wxe_wrapper_5.o] Error 1
make[2]: *** [opt] Error 2
make[1]: *** [opt] Error 2
make: *** [libs] Error 2
2 Likes

Just an update.

I set the KERL_CONFIGURE_OPTIONS as export KERL_CONFIGURE_OPTIONS="--without-wx --without-javac"

Used asdf install erlang 24.2.2 and it installed erlang successfully.

Was so happy to see that as I have spent most of the day yesterday and today trying various different options.

1 Like

For some reason I always have trouble with kerl or asdf :person_shrugging:
I just built OTP-25-rc3 sans kerl or asdf and it just worked :tm:

I’m just adding this comment for the record. Also, jealous of your M1 studio :stuck_out_tongue:

3 Likes

Glad you have a resolution.

2 Likes

wxWidgets 3.1.6 contains changes that broke Erlang’s wx binding. The issue was reported here and fixed here. So if you want wx you either need to apply that fix, or rollback your wxWidget version (or wait for a release that fixes the problem).

4 Likes