歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> Linux教程 >> Ubuntu 11.10 搭建Erlang環境

Ubuntu 11.10 搭建Erlang環境

日期:2017/2/28 15:53:30   编辑:Linux教程

搜索了很多資料都說到,如果庫不全的話,編譯安裝的時候會報各種錯誤,所以我們站在巨人的肩膀上。

首先,打好庫:

  1. sudo apt-get install build-essential
  2. sudo apt-get install libncurses5-dev
  3. sudo apt-get install libssl-dev
  4. sudo apt-get install m4
  5. sudo apt-get install unixodbc unixodbc-dev
  6. sudo apt-get install freeglut3-dev libwxgtk2.8-dev
  7. sudo apt-get install xsltproc
  8. sudo apt-get install fop
  9. sudo apt-get install tk8.5
安裝好上面到依賴之後,到官網下個源碼包:http://www.erlang.org/download.html

對下到的包進行解壓並編譯安裝:

  1. tar zxvf /home/lqg/下載/otp_src_R15B01.tar.gz
  2. cd /home/lqg/otp_src_R15B01/
  3. ./configure
  4. make && make install

這裡編譯一般不會出什麼錯誤,可能會有的是jdk環境的問題:No Java compiler found
這是你檢查下jdk 的環境就好了。

最後,在終端輸入 erl

可以進行erlang的shell測試了:

  1. 1> io:format("hello wlord").
  2. hello wlordok
  3. 2> io:format("hello wlord ~n").
  4. hello wlord
  5. ok
  6. 3> io:format("the output is: ~w ~w~n",[hello,world]).
  7. the output is: hello world
  8. ok
  9. 4> io:format("the output is: ~w~w~n",[hello,world]).
  10. the output is: helloworld
  11. ok
  12. 5> io:format("the output is: ~w~w~n",[hello,world]).
  13. the output is: helloworld
  14. ok

更多Ubuntu相關信息見Ubuntu 專題頁面 http://www.linuxidc.com/topicnews.aspx?tid=2

更多關於Erlang的詳細信息,或者下載地址請點這裡

Copyright © Linux教程網 All Rights Reserved