CentOS 6.5源碼安裝Erlang教程_Erlang

來源:互聯網
上載者:User

Erlang目前已經是Fedora和Debian/Ubuntu軟體倉庫中的一部分。

Erlang目前最新的版本是OTP 17.0。Erlang是一種程式設計語言,用於構建大規模、高延展性、高可用性的軟即時系統的程式設計語言。它已經在電信、金融、電子商務、網路電話和立即訊息中得到應用。Erlang的運行時系統已經內建了對並發、分布式和容錯的支援。

OTP是Erlang庫和設計原則的集合,提供了開發各種系統的中介軟體。它包含了自己的分散式資料庫、面向其它程式設計語言的介面、調試和發布處理工具等。

BEAM是Erlang代碼執行所需的虛擬機器。Erlang代碼編譯後的副檔名為.beam。ERTS是Erlang的運行時系統,他包括了BEAM、核心和標準庫等組件。

官方推薦從源碼安裝Erlang,因此下面開始從源碼安裝OTP 17.0。

下載OTP 17.0源碼:http://www.erlang.org/download/otp_src_17.0.tar.gz

複製代碼 代碼如下:

# tar zvxf otp_src_17.0.tar.gz
# mv otp_src_17.0/ otp
# cd otp
# ./configure --prefix=/home/erlang --without-javac

報錯:
複製代碼 代碼如下:

configure: error: No curses library functions found
configure: error: /bin/sh '/root/otp/erts/configure' failed for erts

# yum -y install ncurses-devel
# ./configure --prefix=/home/erlang --without-javac


報錯
複製代碼 代碼如下:

*********************************************************************
**********************  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
*********************************************************************

# yum list | grep ssl
# yum install openssl-devel
# ./configure --prefix=/home/erlang --without-javac


報錯
複製代碼 代碼如下:

*********************************************************************
**********************  APPLICATIONS DISABLED  **********************
*********************************************************************
jinterface     : Java compiler disabled by user
odbc           : ODBC library - link check failed
orber          : No C++ compiler found
*********************************************************************

# yum list | grep ODBC
# yum install unixODBC-devel
# ./configure --prefix=/home/erlang --without-javac


報錯
複製代碼 代碼如下:

*********************************************************************
**********************  APPLICATIONS DISABLED  **********************
*********************************************************************
jinterface     : Java compiler disabled by user
orber          : No C++ compiler found
*********************************************************************

# yum install gcc-c++
# ./configure --prefix=/home/erlang --without-javac
# make
# make install


安裝完成!

測試Erlang是否安裝正確

複製代碼 代碼如下:

# /home/erlang/bin/erl
Erlang/OTP 17 [erts-6.0] [source] [64-bit] [async-threads:10] [hipe] [kernel-poll:false]

Eshell V6.0  (abort with ^G)
1> EvenN = lists:filter (fun (N) -> N rem 2 == 0 end, lists:seq(1,100)).
[2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,
 44,46,48,50,52,54,56,58|...]
2> halt().


在PATH環境變數添加Erlang的bin路徑,以便執行。

【安裝總結】

從源碼編譯安裝Erlang,有兩個庫或工具是必須的:
一是完整的GCC編譯器環境
二是Ncurses開發庫

還有一些庫或工具,如果沒有它們,在編譯配置時會出現警告資訊,而且可能不能通過配置。這些庫有:
1)OpenSSL開發庫
2)ODBC開發庫
3)Java編譯器

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.