Skip to content

Instantly share code, notes, and snippets.

@pastleo
Last active December 24, 2023 12:09
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pastleo/61e81b7ca78d0420d411cb6a5063adac to your computer and use it in GitHub Desktop.
Save pastleo/61e81b7ca78d0420d411cb6a5063adac to your computer and use it in GitHub Desktop.
asdf erlang openssl not found issue in archlinux

asdf erlang openssl not found issue in archlinux

using asdf to install erlang:

asdf install erlang 19.3

but I got:

APPLICATIONS DISABLED (See: /home/pastleo/.asdf/plugins/erlang/kerl-home/builds/asdf_19.3/otp_build_19.3.log)
 * crypto         : No usable OpenSSL found
 * odbc           : ODBC library - link check failed
 * ssh            : No usable OpenSSL found
 * ssl            : No usable OpenSSL found

the build can still finish though, I encounter no ssl error when installing rebar3 and dependencies...

Solution

according to asdf OpenSSL on ArchLinux wiki, erlang can only use openssl 1.0, and now archlinux is using openssl 1.1 (2018/8/16), we need to build our own 1.0. However, the wiki is a little outdated, I did some research from this post and kerl to get it working, here is my step by step:

# make openssl lib dir
mkdir -p $HOME/.asdf/installs/openssl/1.0

# build and install openssl under asdf folder
cd $HOME/.asdf/tmp
git clone https://github.com/openssl/openssl.git --branch OpenSSL_1_0_2-stable
cd openssl
./config --prefix=$HOME/.asdf/installs/openssl/1.0 shared -fPIC
make depend && make && make install

# build and install erlang with special ssl path
KERL_CONFIGURE_OPTIONS="--with-ssl=$HOME/.asdf/installs/openssl/1.0" asdf install erlang 19.3

not sure if erlang 20 and later having this issue

@zolakeith
Copy link

thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment