<div dir="ltr"><div>Hello All,</div><div><br></div><div>Erlang/OTP latest release (R16B03-1) is still having issues with crypto on Redhat based installs using the latest SSL packages.</div><div>Setup:</div><div> * Amazon EC2 instance; AMI: RHEL-6.4_GA-x86_64-10-Hourly2 (ami-a25415cb)</div>

<div> * All packages first upgraded via "sudo yum upgrade -y"</div><div> * Pre-requisities installed via: "sudo yum install -y gcc gcc-c++ make autoconf libxslt fop ncurses-devel openssl-devel *openjdk-devel unixODBC unixODBC-devel"</div>

<div>  * openssl-devel-1.0.1e-16.el6_5.4.x86_64</div><div> * Installing Erlang/OTP R16B03-1 from source using <a href="http://www.erlang.org/download/otp_src_R16B03-1.tar.gz" target="_blank">http://www.erlang.org/download/otp_src_R16B03-1.tar.gz</a></div>

<div><br></div><div>Installation of Erlang/OTP R16B03-1 with latest RHEL packages above still produces an error for crypto package:</div><div><br></div><div>---------------------------</div><div><br></div><div>$ ./configure && make && sudo make install</div>

<div>[...]</div><div>$ erl</div><div>Erlang R16B03-1 (erts-5.10.4) [source] [64-bit] [async-threads:10] [hipe] [kernel-poll:false]</div><div><br></div><div>Eshell V5.10.4  (abort with ^G)</div><div>1> m(crypto).</div>
<div>
** exception error: undefined function crypto:module_info/0</div><div>     in function  c:m/1 (c.erl, line 503)</div><div>2> </div><div>=ERROR REPORT==== 1-Feb-2014::08:46:05 ===</div><div>Unable to load crypto library. Failed with error:</div>

<div>"load_failed, Failed to load NIF library: '/usr/local/lib/erlang/lib/crypto-3.2/priv/lib/crypto.so: undefined symbol: EC_GROUP_new_curve_GF2m'"</div><div>OpenSSL might not be installed on this system.</div>

<div><br></div><div>=ERROR REPORT==== 1-Feb-2014::08:46:05 ===</div><div>The on_load function for module crypto returned {error,</div><div>                                                 {load_failed,</div><div>                                                  "Failed to load NIF library: '/usr/local/lib/erlang/lib/crypto-3.2/priv/lib/crypto.so: undefined symbol: EC_GROUP_new_curve_GF2m'"}}</div>

<div><br></div><div>---------------------------</div><div><br></div><div>Installation with argument CFLAGS="-DOPENSSL_NO_EC=1" passed to configure in order to disable EC solves this issue:</div><div><br></div><div>

---------------------------</div><div><br></div><div>$ ./configure CFLAGS="-DOPENSSL_NO_EC=1" && make && sudo make install</div><div>$ erl</div><div>Erlang R16B03-1 (erts-5.10.4) [source] [64-bit] [async-threads:10] [hipe] [kernel-poll:false]</div>

<div><br></div><div>Eshell V5.10.4  (abort with ^G)</div><div>1> m(crypto).</div><div>Module crypto compiled: Date: January 23 2014, Time: 17.03</div><div>Compiler options:  [{d,'CRYPTO_VSN',"3.2"},</div>

<div>                    {outdir,"/net/isildur/ldisk/daily_build/r16b03-1_prebuild_opu_o.2014-01-23_17/otp_src_R16B03-1/lib/crypto/src/../ebin"},</div><div>                    warnings_as_errors,warn_obsolete_guard,debug_info]</div>

<div>Object file: /usr/local/lib/erlang/lib/crypto-3.2/ebin/crypto.beam</div><div>Exports: </div><div>[...]</div><div><br></div><div>---------------------------</div><div><br></div><div>Note that installation with environment variable set prior to calling configure does not work (took me a while to figure this out since I'm not that familiar with configure/make):</div>

<div><br></div><div>---------------------------</div><div><br></div><div>$ CFLAGS="-DOPENSSL_NO_EC=1"; ./configure && make && sudo make install</div><div>[...]</div><div>$ erl</div><div>Erlang R16B03-1 (erts-5.10.4) [source] [64-bit] [async-threads:10] [hipe] [kernel-poll:false]</div>

<div><br></div><div>Eshell V5.10.4  (abort with ^G)</div><div>1> m(crypto).</div><div>** exception error: undefined function crypto:module_info/0</div><div>     in function  c:m/1 (c.erl, line 503)</div><div>2> </div>

<div>=ERROR REPORT==== 1-Feb-2014::11:40:33 ===</div><div>Unable to load crypto library. Failed with error:</div><div>"load_failed, Failed to load NIF library: '/usr/local/lib/erlang/lib/crypto-3.2/priv/lib/crypto.so: undefined symbol: EC_GROUP_new_curve_GF2m'"</div>

<div>OpenSSL might not be installed on this system.</div><div><br></div><div>=ERROR REPORT==== 1-Feb-2014::11:40:33 ===</div><div>The on_load function for module crypto returned {error,</div><div>                                                 {load_failed,</div>

<div>                                                  "Failed to load NIF library: '/usr/local/lib/erlang/lib/crypto-3.2/priv/lib/crypto.so: undefined symbol: EC_GROUP_new_curve_GF2m'"}}</div><div><br>
</div>
<div>---------------------------</div><div><br></div><div>Any questions, please let me know. If you would like me to provide more verbose logs I can easily rerun steps above.</div><div><br></div><div>Best,</div><div>Adam</div>

<div><br></div><div>Sources:</div><div> * <a href="http://imperialwicket.com/aws-install-erlang-otp-on-amazon-linux" target="_blank">http://imperialwicket.com/aws-install-erlang-otp-on-amazon-linux</a></div><div> * <a href="http://docs.basho.com/riak/latest/ops/building/installing/erlang/#Installing-on-GNU-Linux" target="_blank">http://docs.basho.com/riak/latest/ops/building/installing/erlang/#Installing-on-GNU-Linux</a></div>

<div> * <a href="https://github.com/RoadRunnr/otp/blob/master/HOWTO/INSTALL.md#How-to-Build-and-Install-ErlangOTP_Prebuilt-Source-Release" target="_blank">https://github.com/RoadRunnr/otp/blob/master/HOWTO/INSTALL.md#How-to-Build-and-Install-ErlangOTP_Prebuilt-Source-Release</a></div>

<div> * <a href="https://groups.google.com/forum/#!topic/erlang-programming/wW6Uuz4VO2w" target="_blank">https://groups.google.com/forum/#!topic/erlang-programming/wW6Uuz4VO2w</a></div></div>