# Erlang installation using kerl on Mac M1: OpenSSL dependency

**URL:** <https://erlangforums.com/t/erlang-installation-using-kerl-on-mac-m1-openssl-dependency/1306>\
**Category:** Questions / Help\
**Tags:** macos, apple-silicon, kerl\
**Created:** [April 11, 2022, 9:15am UTC](https://erlangforums.com/t/erlang-installation-using-kerl-on-mac-m1-openssl-dependency/1306 "2022-04-11T09:15:31Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![phild](https://erlangforums.com/user_avatar/erlangforums.com/phild/32/742_2.png) [@phild](https://erlangforums.com/u/phild)\
**Post date:** [April 11, 2022, 9:15am UTC](https://erlangforums.com/t/erlang-installation-using-kerl-on-mac-m1-openssl-dependency/1306/1 "2022-04-11T09:15:31Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![garazdawi](https://erlangforums.com/user_avatar/erlangforums.com/garazdawi/32/175_2.png) [@garazdawi](https://erlangforums.com/u/garazdawi)\
**Post date:** [April 11, 2022, 9:27am UTC](https://erlangforums.com/t/erlang-installation-using-kerl-on-mac-m1-openssl-dependency/1306/2 "2022-04-11T09:27:39Z")

</div>

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](https://github.com/kerl/kerl/issues/371)

---

<div class="post-metadata">

**Author:** ![phild](https://erlangforums.com/user_avatar/erlangforums.com/phild/32/742_2.png) [@phild](https://erlangforums.com/u/phild)\
**Post date:** [April 11, 2022, 4:27pm UTC](https://erlangforums.com/t/erlang-installation-using-kerl-on-mac-m1-openssl-dependency/1306/3 "2022-04-11T16:27:06Z")

</div>

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:

```erlang
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:

```erlang
~/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!

```erlang
===> 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>

```

---

<div class="post-metadata">

**Author:** ![kxkannan](https://erlangforums.com/user_avatar/erlangforums.com/kxkannan/32/1405_2.png) [@kxkannan](https://erlangforums.com/u/kxkannan)\
**Post date:** [April 30, 2022, 4:22pm UTC](https://erlangforums.com/t/erlang-installation-using-kerl-on-mac-m1-openssl-dependency/1306/4 "2022-04-30T16:22:44Z")

</div>

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.

```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

```

---

<div class="post-metadata">

**Author:** ![kxkannan](https://erlangforums.com/user_avatar/erlangforums.com/kxkannan/32/1405_2.png) [@kxkannan](https://erlangforums.com/u/kxkannan)\
**Post date:** [April 30, 2022, 4:53pm UTC](https://erlangforums.com/t/erlang-installation-using-kerl-on-mac-m1-openssl-dependency/1306/5 "2022-04-30T16:53:54Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![starbelly](https://erlangforums.com/user_avatar/erlangforums.com/starbelly/32/209_2.png) [@starbelly](https://erlangforums.com/u/starbelly)\
**Post date:** [April 30, 2022, 10:02pm UTC](https://erlangforums.com/t/erlang-installation-using-kerl-on-mac-m1-openssl-dependency/1306/6 "2022-04-30T22:02:09Z")

</div>

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

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

---

<div class="post-metadata">

**Author:** ![phild](https://erlangforums.com/user_avatar/erlangforums.com/phild/32/742_2.png) [@phild](https://erlangforums.com/u/phild)\
**Post date:** [May 1, 2022, 10:11am UTC](https://erlangforums.com/t/erlang-installation-using-kerl-on-mac-m1-openssl-dependency/1306/7 "2022-05-01T10:11:24Z")

</div>

Glad you have a resolution.

---

<div class="post-metadata">

**Author:** ![garazdawi](https://erlangforums.com/user_avatar/erlangforums.com/garazdawi/32/175_2.png) [@garazdawi](https://erlangforums.com/u/garazdawi)\
**Post date:** [May 1, 2022, 3:53pm UTC](https://erlangforums.com/t/erlang-installation-using-kerl-on-mac-m1-openssl-dependency/1306/8 "2022-05-01T15:53:27Z")

</div>

wxWidgets 3.1.6 contains changes that broke Erlang’s wx binding. The issue was reported [here](https://github.com/erlang/otp/issues/5893) and fixed [here](https://github.com/erlang/otp/pull/5912). 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).
