Ubuntu 11.10 搭建Erlang环境


搜索了很多资料都说到,如果库不全的话,编译安装的时候会报各种错误,所以我们站在巨人的肩膀上。

首先,打好库:

  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.bkjia.com/topicnews.aspx?tid=2

更多关于Erlang的详细信息,或者下载地址请点这里

相关内容