Archive for January 24, 2009

Install Erlang on Mac OSX from sources

If you don’t want to use Flink or MacPorts to get you up and running with Erlang environment then you can follow these steps to compile and install Erlang from sources on your Mac.

First make sure you have installed latest Apple’s Xcode Developer Tools which will provide gcc compiler among the other toys.

The next step is to download Erlang sources and man pages. At the time of writing this post the latest version of Erlang was R12B-5. Consult the Erlang download page for details of current release. Let’s get the above mentioned files :

%  wget http://erlang.org/download/otp_src_R12B-5.tar.gz
%  wget http://erlang.org/download/otp_doc_man_R12B-5.tar.gz

Untar the sources and change current directory:

%  tar xzvf otp_src_R12B-5.tar.gz
%  cd otp_src_R12B-5

What we have to do now is to do usual configure/make/make install steps of compilation. To check available configuration options run:

%  ./configure --help

I will configure Erlang with:

%  ./configure --prefix=/sw/erlang --enable-threads
--enable-smp-support --enable-kernel-poll

Next steps are creating the target directory, compilation and installation, uncompressing the man pages:

%  sudo mkdir /sw/erlang
%  make
%  sudo make install
%  sudo cp ../otp_doc_man_R12B-5.tar.gz /sw/erlang/
%  cd /sw/erlang
%  sudo tar xzvf otp_doc_man_R12B-5.tar.gz
%  sudo rm otp_doc_man_R12B-5.tar.gz

The last step will create man folder in /sw/erlang. Everything almost ready. We should add Erlang to the PATH and man pages to the MANPATH i.e. in ~/.bashrc.

export PATH=$PATH:/sw/erlang/bin
export MANPATH=$MANPATH:/sw/erlang/man

The last step is to load the updated .bashrc file:

%  . ~/.bashrc

Everything should be up and running now. Try:

%  man erlang
%  erl

Popularity: 59% [?]

Comments (5)

Close
E-mail It