Erlang R16B02可以使用OpenSSL在OSX 10.10.5上构建吗?

时间:2016-02-01 19:58:23

标签: macos openssl erlang homebrew osx-yosemite

我需要在OSX 10.10.5上构建Erlang R16B02并支持SSL,因此我可以使用crypto应用程序。我已经用Homebrew安装了OpenSSL 0.9.8。运行openssl > version会产生以下结果:

$ openssl
OpenSSL> version
OpenSSL 0.9.8zg 14 July 2015

我能够构建并安装Erlang R16B02,但在尝试启动crypto应用程序时,我始终遇到同样的错误:

1> crypto:start().
** exception error: undefined function crypto:start/0
2>
=ERROR REPORT==== 1-Feb-2016::14:19:17 ===
Unable to load crypto library. Failed with error:
"load_failed, Failed to load NIF library: 'dlopen(~/.asdf/installs/erlang/R16B02/lib/erlang/lib/crypto-3.1/priv/lib/crypto.so, 2): Symbol not found: _AES_cbc_encrypt
  Referenced from: ~/.asdf/installs/erlang/R16B02/lib/erlang/lib/crypto-3.1/priv/lib/crypto.so
  Expected in: flat namespace
 in ~/.asdf/installs/erlang/R16B02/lib/erlang/lib/crypto-3.1/priv/lib/crypto.so'"
OpenSSL might not be installed on this system.

=ERROR REPORT==== 1-Feb-2016::14:19:17 ===
The on_load function for module crypto returned {error,
                                                 {load_failed,
                                                  "Failed to load NIF library: 'dlopen(~/.asdf/installs/erlang/R16B02/lib/erlang/lib/crypto-3.1/priv/lib/crypto.so, 2): Symbol not found: _AES_cbc_encrypt\n  Referenced from: ~/.asdf/installs/erlang/R16B02/lib/erlang/lib/crypto-3.1/priv/lib/crypto.so\n  Expected in: flat namespace\n in ~/.asdf/installs/erlang/R16B02/lib/erlang/lib/crypto-3.1/priv/lib/crypto.so'"}}

我试过调用其他函数,比如crypto:module_info(),但我总是得到同样的错误。我使用asdf使用各种标志构建了Erlang R16B02。这里有几个我试过的组合:

Building with options: --enable-dynamic-ssl-lib --prefix=~/.asdf/installs/erlang/R16B02

Building with options: --with-ssl=/usr/local/opt/openssl --prefix=~/.asdf/installs/erlang/R16B02 # with-ssl points to the OpenSSL install

Building with options: --with-ssl --prefix=~/.asdf/installs/erlang/R16B02

所有这些都导致了同样的错误。当我试图弄清楚如何使用SSL构建Erlang时,我注意到一个奇怪的事情是--enable-darwin-64bit--enable-darwin-universal标志导致构建失败。这似乎很奇怪,因为我在OSX上构建,所以似乎需要这些标志。

所以回顾一下:

  • 我正在使用asdf(不应该真的很重要)
  • 对于所有成功构建,我在调用crypto模块中的任何函数时都会收到上述错误
  • 我使用OpenSSL和crypto应用程序
  • 构建了Erlang 17

更新

我遇到了这个https://gist.github.com/ThePicard/7378417,所以我尝试了配置脚本中列出的几个选项,但我仍然遇到了同样的错误。

更新2

otool -L ~/.asdf/installs/erlang/R16B02/lib/erlang/lib/crypto-3.1/priv/lib/crypto.so打印出来:

~/.asdf/installs/erlang/R16B02/lib/erlang/lib/crypto-3.1/priv/lib/crypto.so:
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1213.0.0)

0 个答案:

没有答案