You are not logged in.

#1 2017-05-13 20:13:36

returntrip
Member
From: Sweden
Registered: 2017-05-13
Posts: 12

[SOLVED] Unable to install erlang 19.x using asdf

15/05/17: Solved on post number 3 by tuvistuvie

I am unable to install erlang 19.3 while using asdf: https://github.com/asdf-vm/asdf

After issuing:

asdf install erlang 19.0

During compilation, I get this error:

crypto.c:131:28: fatal error: openssl/chacha.h: No such file or directory
 #include <openssl/chacha.h>
                            ^
compilation terminated.
make[4]: *** [x86_64-unknown-linux-gnu/Makefile:136: ../priv/obj/x86_64-unknown-linux-gnu/crypto.o] Error 1
make[4]: Leaving directory '/tmp/erlang_build_MwcZWB/otp_src_19.0/lib/crypto/c_src'
make[3]: *** [/tmp/erlang_build_MwcZWB/otp_src_19.0/make/run_make.mk:35: opt] Error 2
make[3]: Leaving directory '/tmp/erlang_build_MwcZWB/otp_src_19.0/lib/crypto/c_src'
make[2]: *** [/tmp/erlang_build_MwcZWB/otp_src_19.0/make/otp_subdir.mk:29: opt] Error 2
make[2]: Leaving directory '/tmp/erlang_build_MwcZWB/otp_src_19.0/lib/crypto'
make[1]: *** [/tmp/erlang_build_MwcZWB/otp_src_19.0/make/otp_subdir.mk:29: opt] Error 2
make[1]: Leaving directory '/tmp/erlang_build_MwcZWB/otp_src_19.0/lib'
make: *** [Makefile:452: libs] Error 2

I believe I have all dependencies installed (especially openssl).

I have also searched for

chacha.h

and I can find it only in the following packages:

sudo pkgfile chacha.h                 
[sudo] password for returntrip: 
core/nettle
extra/crypto++
community/botan
community/gitlab
community/libqtshadowsocks

Hope someone can help. Thanks.

Last edited by returntrip (2017-05-15 13:50:33)

Offline

#2 2017-05-14 00:26:55

victor-am
Member
Registered: 2017-05-14
Posts: 1

Re: [SOLVED] Unable to install erlang 19.x using asdf

I'm having the same problem sad

Offline

#3 2017-05-15 02:09:21

tuvistavie
Member
From: London
Registered: 2012-02-12
Posts: 15
Website

Re: [SOLVED] Unable to install erlang 19.x using asdf

I just replied here: https://github.com/asdf-vm/asdf/issues/ … -301354356
I will just copy/paste the answer, just in case.

tldr (if on ArchLinux)
asdf plugin-update erlang
wget -O /tmp/link-openssl.sh https://gist.githubusercontent.com/tuvistavie/22554261f3e613703d76d882977290f1/raw/0f244ae93e980160492bd9fc9bc84797f16ac10a/archlinux-link-openssl1-0.sh
sudo bash /tmp/link-openssl.sh /usr/local/openssl-1.0
ERLANG_OPENSSL_PATH="/usr/local/openssl-1.0" asdf install erlang 19.3
Explanations

After trying a few things, here are the results:

  • The issue is definitely that Erlang/OTP does not build with OpenSSL 1.1

  • ArchLinux openssl 1.0 package directory structure does not play well with erlang --with-ssl flag. The directory structure should be something like DIR/lib/libssl.so for it to work with --with-ssl=DIR, but it is installed at /usr/lib/openssl-1.0/libssl.so

Let's assume that we want to have OpenSSL 1.0 in $HOME/.openssl-1.0 (if we want to make this /usr/local/openssl-1.0, or something not inside user home, some steps will require sudo) 

  1. First, we need to have OpenSSL 1.0 installed with a a directory structure that Erlang build scripts will understand.
    We have two choices:

    1. Compile OpenSSL 1.0 from sources. This can be done with the following steps:
         

      git clone https://github.com/openssl/openssl.git --branch OpenSSL_1_0_2-stable
      ./config --prefix=$HOME/.openssl-1.0 shared -fPIC
      make depend && make && make install

         

    2. Link the lib and include provided in Arch openssl-1.0 package. This can be done with the following steps:
         

      mkdir -p $HOME/.openssl-1.0
      cd $HOME/.openssl.1-0
      ln -sf /usr/lib/openssl-1.0 lib
      ln -sf /usr/include/openssl-1.0 include

         
          I created a gist with the steps here: https://gist.github.com/tuvistavie/2255 … 82977290f1

         I would rather go with the second solution, as it avoids having to maintain an OpenSSL install for no good reason.
         

  2. Then we need to path --with-ssl to ./configure in Erlang so that it uses OpenSSL 1.0 and not 1.1.
        I updated asdf-erlang to support the ERLANG_OPENSSL_PATH environment variable to make this easier, as the --with-ssl option was currently overriden.
    Erlang can therefore be installed using:

       

    ERLANG_OPENSSL_PATH="$HOME/.openssl-1.0" asdf install erlang 19.3

Let me know how this works for you.

NOTE: do not forget to run

asdf plugin-update erlang

before installing anything.

Offline

#4 2017-05-15 13:48:44

returntrip
Member
From: Sweden
Registered: 2017-05-13
Posts: 12

Re: [SOLVED] Unable to install erlang 19.x using asdf

@tuvistavie: This worked fine. Thanks for the help!

Offline

#5 2017-10-10 08:25:58

Den10o
Member
Registered: 2017-10-10
Posts: 1

Re: [SOLVED] Unable to install erlang 19.x using asdf

Works well. Thank you very much

Offline

#6 2017-10-10 13:03:19

WorMzy
Forum Moderator
From: Scotland
Registered: 2010-06-16
Posts: 11,786
Website

Re: [SOLVED] Unable to install erlang 19.x using asdf


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

Board footer

Powered by FluxBB