Build Erlang programming environment under Ubuntu-adu World-Blog channel-csdn.net
Spit Groove: Erlang as a small language, programming environment configuration of my crazy Ah, the official standard is Emacs, but I as poisoning has deep vimer really do not want to change the editor, on the way I tried to use Eclipse plug-in erlide, but, when I consumed a lot of character, After having endured a slow speed install, use it to write Erlang code and then run ... Then the card died: 10,000 grass mud horse tumbling ah.
Premise: Ubuntu and Vim use the basic proficiency (about Vim has also recently gained, feel finally can write some summary)
Steps:
1, install a variety of libraries; (refer to this article: Click to open the link)
[Plain]View Plaincopyprint?
- SUDO APT-GET INSTALL BUILD-ESSENTIAL    
- sudo apt-get install libncurses5-dev
- SUDO APT-GET INSTALL LIBSSL-DEV  
- sudo apt-get install m4
- SUDO APT-GET INSTALL UNIXODBC UNIXODBC-DEV  
- sudo apt-get install freeglut3-dev libwxgtk2.8-dev
- SUDO APT-GET INSTALL XSLTPROC    
- sudo apt-get install fop
- SUDO APT-GET INSTALL TK8.5  
sudo apt-get install build-essentialsudo apt-get install libncurses5-devsudo apt-get install Libssl-devsudo apt-get Insta ll m4sudo apt-get Install unixodbc unixodbc-devsudo apt-get install freeglut3-dev libwxgtk2.8-devsudo apt-get install XSLT Procsudo apt-get Install fopsudo apt-get Install tk8.5
2. Installing Erlang
There are two ways to do this:
(1) We go to the official Erlang website to download the source code, and then compile the installation yourself
[Plain]View Plaincopyprint?
- Tar zxvf/home/lqg/download/otp_src_r15b01.tar.gz
- cd/home/lqg/otp_src_r15b01/
- ./configure
- Make && make install
Tar zxvf/home/lqg/download/otp_src_r15b01.tar.gz cd/home/lqg/otp_src_r15b01/ ./configure make && Make install
(2) sudo apt-get install Erlang
Recommendation: The second case is suitable for the older version, however, for beginners, the latest version of how much use it? Quick Start is the last important thing, so I suggest you choose the method of (2)
3. Check if Erlang is installed.
In the terminal input erl, if there is a picture, you have installed, congratulations!!
4, install Vimerl plugin reference this article: Click to open the link
5, write a module, and then compile and run
Using VIM, create a new Hw.erl file and enter the following code:
[Plain]View Plaincopyprint?
- -module (HW).
- -export ([printhelloworld/0]).
- Printhelloworld ()
- Io:format ("Helloworld~n").
-module (HW).-export ([printhelloworld/0]). Printhelloworld (), Io:format ("Helloworld~n").
6, Building Erlang has a tool is very powerful, it is the legendary rebar, about its introduction, you can refer to this article click to open the link
However, we have just touched Erlang, in the course of learning to use this word, it is not a bit overkill it? Of course, under Erlang, it gives us the compiler. And see how we do it:
(1) Open the shell terminal of Erlang
(2) input C (HW). then enter.
(3) Hw:printhelloworld (). Then enter
Congratulations, welcome to the world of Erlang.
Learning a small language, the right programming environment really let me break the heart. First of all thanks to the following bloggers, is your article to help me set up a first environment.
This article references: http://cryolite.iteye.com/blog/1143933;
http://blog.csdn.net/lqg1122/article/details/7434310
Http://dhq.me/build-compile-eunit-release-erlang-application-with-rebar
"Erlang Programming"