Ubuntu 22.04 LTS install erlang error
rexllz opened this issue ยท 11 comments
Hi
I'm using the ubuntu 22.04LTS, try to install erlang 24.1 via asdf.
command:
asdf install erlang 24.1
got error:
asdf_24.1 is not a kerl-managed Erlang/OTP installation
The asdf_24.1 build has been deleted
Extracting source code
Building Erlang/OTP 24.1 (asdf_24.1), please wait...
APPLICATIONS DISABLED (See: /home/rex/.asdf/plugins/erlang/kerl-home/builds/asdf_24.1/otp_build_24.1.log)
* jinterface : Java compiler disabled by user
Build failed.
cc1: some warnings being treated as errors
gmake[4]: *** [x86_64-pc-linux-gnu/Makefile:195: ../priv/obj/x86_64-pc-linux-gnu/pkey.o] Error 1
gmake[4]: Leaving directory '/home/rex/.asdf/plugins/erlang/kerl-home/builds/asdf_24.1/otp_src_24.1/lib/crypto/c_src'
gmake[3]: *** [/home/rex/.asdf/plugins/erlang/kerl-home/builds/asdf_24.1/otp_src_24.1/make/run_make.mk:35: opt] Error 2
gmake[3]: Leaving directory '/home/rex/.asdf/plugins/erlang/kerl-home/builds/asdf_24.1/otp_src_24.1/lib/crypto/c_src'
gmake[2]: *** [/home/rex/.asdf/plugins/erlang/kerl-home/builds/asdf_24.1/otp_src_24.1/make/otp_subdir.mk:29: opt] Error 2
gmake[2]: Leaving directory '/home/rex/.asdf/plugins/erlang/kerl-home/builds/asdf_24.1/otp_src_24.1/lib/crypto'
gmake[1]: *** [/home/rex/.asdf/plugins/erlang/kerl-home/builds/asdf_24.1/otp_src_24.1/make/otp_subdir.mk:29: opt] Error 2
gmake[1]: Leaving directory '/home/rex/.asdf/plugins/erlang/kerl-home/builds/asdf_24.1/otp_src_24.1/lib'
gmake: *** [Makefile:498: libs] Error 2
Please see /home/rex/.asdf/plugins/erlang/kerl-home/builds/asdf_24.1/otp_build_24.1.log for full details.
I finished the preapre work from ubuntu 20.04 suggestions (from our README), I'm not sure if I can use the same way to install it on ubuntu22.04, can I fix it somehow or just waiting the updates?
Thanks!
I have the exact same issue here.
This is not an ASDF bug - it is an incompatibility between Erlang 24.1 and Ubuntu 22.04.
I was building with 24.1.5 and it failed - I tried with kerl and it also failed. 24.3.3 works with asdf and Ubuntu 22.04 just fine. Earlier versions may also work, but clearly somewhere between 24.1.5 and 24.3.3 they fixed an incompatibility with the latest Ubuntu LTS.
Ubuntu 22.04 used now openssl 3 instead of openssl1 some openssl 1 functions are now deprecated
The lib/crypto/configure has been modified on the ubuntu build to test the openssl version
if openssl version is 3 the deprecated_warnings is set to no in the ubuntu 22.04 source code for erlang-crypto
if test "x$v3_include" = "xyes" && test "x$deprecated_warnings" = "xdefault_yes" && test "$CRYPTO_APP" != ""; then
deprecated_warnings=no
fi
if test "x$deprecated_warnings" = "xno" && test "$CRYPTO_APP" != "" ; then
SSL_FLAGS="$SSL_FLAGS -Wno-deprecated-declarations"
fi
doing is not enough because the crypto lib is not longer compiled
CFLAGS="-w -O2 -Wno-deprecated-declarations" asdf install erlang 24.1
one workaround
cd /usr/local/src/
sudo wget https://www.openssl.org/source/openssl-1.1.1m.tar.gz
sudo tar -xf openssl-1.1.1m.tar.gz
cd openssl-1.1.1m
sudo ./config --prefix=/usr/local/ssl --openssldir=/usr/local/ssl shared zlib
sudo make
sudo make test
sudo make install
# install erlang now
export KERL_CONFIGURE_OPTIONS="-with-ssl=/usr/local/ssl"
asdf install erlang 24.1
Thanks for the detailed explanation and workarounds. Very helpful.
This works!
one workaround
cd /usr/local/src/ sudo wget https://www.openssl.org/source/openssl-1.1.1m.tar.gz sudo tar -xf openssl-1.1.1m.tar.gz cd openssl-1.1.1m sudo ./config --prefix=/usr/local/ssl --openssldir=/usr/local/ssl shared zlib sudo make sudo make test sudo make install # install erlang now export KERL_CONFIGURE_OPTIONS="-with-ssl=/usr/local/ssl" asdf install erlang 24.1
There are some issues due to certificate expiry in the zip - https://www.openssl.org/source/openssl-1.1.1m.tar.gz
Instead of sudo wget https://www.openssl.org/source/openssl-1.1.1m.tar.gz
use git clone git@github.com:openssl/openssl.git
and follow same steps
Closing this issue as @jbdamiano's workaround if what people should use if 24.1 is needed on Ubuntu 22.04. This is not a problem with asdf-erlang itself.
For me to install 24.3.3 on Ubuntu 22.10 I had to install the following packages first:
sudo apt-get install clang-format clang-tidy clang-tools clang clangd libc++-dev libc++1 libc++abi-dev libc++abi1 libclang-dev libclang1 liblldb-dev libllvm-ocaml-dev libomp-dev libomp5 lld lldb llvm-dev llvm-runtime llvm python3-clang automake autoconf libncurses5-dev
and then
asdf install erlang 24.3.3
Hopefully that helps someone.
Combining and adapting @tjstlekr's and @jbdamiano's workarounds to use the latest stable 1.1.1 code instead of master:
cd /usr/local/src/
sudo git clone https://github.com/openssl/openssl.git -b OpenSSL_1_1_1-stable openssl-1.1.1m
cd openssl-1.1.1m
sudo ./config --prefix=/usr/local/ssl --openssldir=/usr/local/ssl shared zlib
sudo make
sudo make test
sudo make install_sw
export KERL_CONFIGURE_OPTIONS="-with-ssl=/usr/local/ssl"
asdf install erlang 23.3.3
the make install_sw
instead of make install
makes sure that the docs for openssl 1.1.1 aren't installed in other system destinations
one workaround
cd /usr/local/src/ sudo wget https://www.openssl.org/source/openssl-1.1.1m.tar.gz sudo tar -xf openssl-1.1.1m.tar.gz cd openssl-1.1.1m sudo ./config --prefix=/usr/local/ssl --openssldir=/usr/local/ssl shared zlib sudo make sudo make test sudo make install # install erlang now export KERL_CONFIGURE_OPTIONS="-with-ssl=/usr/local/ssl" asdf install erlang 24.1
I am still getting this error : asdf_24.3.3 is not a kerl-managed Erlang/OTP installation
Any help ?