CentOS 7安裝Erlang/OTP 18.3
官方推薦從源碼安裝Erlang,所以下面開始從源碼安裝OTP 18.3。
1、下載OTP 18.3源碼:http://www.erlang.org/download/otp_src_18.3.tar.gzjava
- # tar zvxf otp_src_18.3.tar.gz
- # mv otp_src_18.3/ otp
- # cd otp
- # ./configure --prefix=/usr/local/erlang --with-ssl -enable-threads -enable-smmp-support -enable-kernel-poll --enable-hipe --without-javac
報錯: configure: error: No curses library functions found configure: error: /bin/sh '/root/otp/erts/configure' failed for erts 解決:c++
- # yum -y install ncurses-devel
|
2、繼續 # ./configure --prefix=/usr/local/erlang --with-ssl -enable-threads -enable-smmp-support -enable-kernel-poll --enable-hipe --without-javacshell
報錯: ********************************************************************* ********************** APPLICATIONS DISABLED ********************** ********************************************************************* crypto : No usable OpenSSL found jinterface : Java compiler disabled by user odbc : ODBC library - link check failed orber : No C++ compiler found ssh : No usable OpenSSL found ssl : No usable OpenSSL found *********************************************************************ssh 解決:async
- # yum list | grep ssl
- # yum install openssl-devel
|
3、繼續 # ./configure --prefix=/usr/local/erlang --with-ssl -enable-threads -enable-smmp-support -enable-kernel-poll --enable-hipe --without-javac工具
報錯 ********************************************************************* ********************** APPLICATIONS DISABLED ********************** ********************************************************************* jinterface : Java compiler disabled by user odbc : ODBC library - link check failed orber : No C++ compiler found *********************************************************************測試 解決:spa
- # yum list | grep ODBC
- # yum install unixODBC-devel
|
4、繼續 # ./configure --prefix=/usr/local/erlang --with-ssl -enable-threads -enable-smmp-support -enable-kernel-poll --enable-hipe --without-javac
.net
報錯 ********************************************************************* ********************** APPLICATIONS DISABLED ********************** ********************************************************************* jinterface : Java compiler disabled by user orber : No C++ compiler found *********************************************************************unix 解決:
- # yum install gcc-c++
|
5、繼續 # ./configure --prefix=/usr/local/erlang --with-ssl -enable-threads -enable-smmp-support -enable-kernel-poll --enable-hipe --without-javac
OK!!!沒報錯了,下面就執行:
- # make
- # make install
漫長的等待... 安裝完成!
6、測試Erlang是否安裝正確
[root@localhost bin]# /work/install/erlang/bin/erl Erlang/OTP 18 [erts-7.3] [source] [64-bit] [smp:4:4] [async-threads:10] [hipe] [kernel-poll:false] Eshell V7.3 (abort with ^G) 1> |
安裝成功啦!!!
7、在PATH環境變量添加Erlang的bin路徑,以便執行。
# erlang env conf ERLANG_HOME=/work/install/erlang PATH=$PATH:$ERLANG_HOME/bin |
【安裝總結】
從源碼編譯安裝Erlang,有兩個庫或工具是必須的:
一是完整的GCC編譯器環境
二是Ncurses開發庫
還有一些庫或工具,若是沒有它們,在編譯配置時會出現警告信息,並且可能不能經過配置。這些庫有:
1)OpenSSL開發庫
2)ODBC開發庫
3)Java編譯器